From c5ed9ba6b7e1bb8aff90d43acd2f0af4990fa57c Mon Sep 17 00:00:00 2001 From: Arpad Borsos Date: Mon, 28 Jun 2021 23:21:42 +0200 Subject: [PATCH] update dependencies and rebuild --- dist/restore/index.js | 35534 ++++++++++++++++++++-------------------- dist/save/index.js | 35529 +++++++++++++++++++-------------------- package-lock.json | 379 +- package.json | 10 +- 4 files changed, 36355 insertions(+), 35097 deletions(-) diff --git a/dist/restore/index.js b/dist/restore/index.js index 37b8026..2e730b8 100644 --- a/dist/restore/index.js +++ b/dist/restore/index.js @@ -416,7 +416,7 @@ var __importStar = (this && this.__importStar) || function (mod) { Object.defineProperty(exports, "__esModule", ({ value: true })); const core = __importStar(__nccwpck_require__(2186)); const exec = __importStar(__nccwpck_require__(1514)); -const glob = __importStar(__nccwpck_require__(8090)); +const glob = __importStar(__nccwpck_require__(1597)); const io = __importStar(__nccwpck_require__(7436)); const fs = __importStar(__nccwpck_require__(5747)); const path = __importStar(__nccwpck_require__(5622)); @@ -1196,7 +1196,40 @@ exports.getDownloadOptions = getDownloadOptions; /***/ }), -/***/ 7351: +/***/ 1597: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.create = void 0; +const internal_globber_1 = __nccwpck_require__(7341); +/** + * Constructs a globber + * + * @param patterns Patterns separated by newlines + * @param options Glob options + */ +function create(patterns, options) { + return __awaiter(this, void 0, void 0, function* () { + return yield internal_globber_1.DefaultGlobber.create(patterns, options); + }); +} +exports.create = create; +//# sourceMappingURL=glob.js.map + +/***/ }), + +/***/ 9350: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -1221,81 +1254,39 @@ var __importStar = (this && this.__importStar) || function (mod) { return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.issue = exports.issueCommand = void 0; -const os = __importStar(__nccwpck_require__(2087)); -const utils_1 = __nccwpck_require__(5278); +exports.getOptions = void 0; +const core = __importStar(__nccwpck_require__(2186)); /** - * Commands - * - * Command Format: - * ::name key=value,key=value::message - * - * Examples: - * ::warning::This is the message - * ::set-env name=MY_VAR::some value + * Returns a copy with defaults filled in. */ -function issueCommand(command, properties, message) { - const cmd = new Command(command, properties, message); - process.stdout.write(cmd.toString() + os.EOL); -} -exports.issueCommand = issueCommand; -function issue(name, message = '') { - issueCommand(name, {}, message); -} -exports.issue = issue; -const CMD_STRING = '::'; -class Command { - constructor(command, properties, message) { - if (!command) { - command = 'missing.command'; +function getOptions(copy) { + const result = { + followSymbolicLinks: true, + implicitDescendants: true, + omitBrokenSymbolicLinks: true + }; + if (copy) { + if (typeof copy.followSymbolicLinks === 'boolean') { + result.followSymbolicLinks = copy.followSymbolicLinks; + core.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`); } - this.command = command; - this.properties = properties; - this.message = message; - } - toString() { - let cmdStr = CMD_STRING + this.command; - if (this.properties && Object.keys(this.properties).length > 0) { - cmdStr += ' '; - let first = true; - for (const key in this.properties) { - if (this.properties.hasOwnProperty(key)) { - const val = this.properties[key]; - if (val) { - if (first) { - first = false; - } - else { - cmdStr += ','; - } - cmdStr += `${key}=${escapeProperty(val)}`; - } - } - } + if (typeof copy.implicitDescendants === 'boolean') { + result.implicitDescendants = copy.implicitDescendants; + core.debug(`implicitDescendants '${result.implicitDescendants}'`); + } + if (typeof copy.omitBrokenSymbolicLinks === 'boolean') { + result.omitBrokenSymbolicLinks = copy.omitBrokenSymbolicLinks; + core.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`); } - cmdStr += `${CMD_STRING}${escapeData(this.message)}`; - return cmdStr; } + return result; } -function escapeData(s) { - return utils_1.toCommandValue(s) - .replace(/%/g, '%25') - .replace(/\r/g, '%0D') - .replace(/\n/g, '%0A'); -} -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'); -} -//# sourceMappingURL=command.js.map +exports.getOptions = getOptions; +//# sourceMappingURL=internal-glob-options-helper.js.map /***/ }), -/***/ 2186: +/***/ 7341: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -1328,265 +1319,450 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; +var __asyncValues = (this && this.__asyncValues) || function (o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } +}; +var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); } +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } +}; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0; -const command_1 = __nccwpck_require__(7351); -const file_command_1 = __nccwpck_require__(717); -const utils_1 = __nccwpck_require__(5278); -const os = __importStar(__nccwpck_require__(2087)); +exports.DefaultGlobber = void 0; +const core = __importStar(__nccwpck_require__(2186)); +const fs = __importStar(__nccwpck_require__(5747)); +const globOptionsHelper = __importStar(__nccwpck_require__(9350)); const path = __importStar(__nccwpck_require__(5622)); -/** - * The code to exit an action - */ -var ExitCode; -(function (ExitCode) { - /** - * A code indicating that the action was successful - */ - ExitCode[ExitCode["Success"] = 0] = "Success"; +const patternHelper = __importStar(__nccwpck_require__(5186)); +const internal_match_kind_1 = __nccwpck_require__(836); +const internal_pattern_1 = __nccwpck_require__(5343); +const internal_search_state_1 = __nccwpck_require__(8530); +const IS_WINDOWS = process.platform === 'win32'; +class DefaultGlobber { + constructor(options) { + this.patterns = []; + this.searchPaths = []; + this.options = globOptionsHelper.getOptions(options); + } + getSearchPaths() { + // Return a copy + return this.searchPaths.slice(); + } + glob() { + var e_1, _a; + return __awaiter(this, void 0, void 0, function* () { + const result = []; + try { + for (var _b = __asyncValues(this.globGenerator()), _c; _c = yield _b.next(), !_c.done;) { + const itemPath = _c.value; + result.push(itemPath); + } + } + catch (e_1_1) { e_1 = { error: e_1_1 }; } + finally { + try { + if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b); + } + finally { if (e_1) throw e_1.error; } + } + return result; + }); + } + globGenerator() { + return __asyncGenerator(this, arguments, function* globGenerator_1() { + // Fill in defaults options + const options = globOptionsHelper.getOptions(this.options); + // Implicit descendants? + const patterns = []; + for (const pattern of this.patterns) { + patterns.push(pattern); + if (options.implicitDescendants && + (pattern.trailingSeparator || + pattern.segments[pattern.segments.length - 1] !== '**')) { + patterns.push(new internal_pattern_1.Pattern(pattern.negate, true, pattern.segments.concat('**'))); + } + } + // Push the search paths + const stack = []; + for (const searchPath of patternHelper.getSearchPaths(patterns)) { + core.debug(`Search path '${searchPath}'`); + // Exists? + try { + // Intentionally using lstat. Detection for broken symlink + // will be performed later (if following symlinks). + yield __await(fs.promises.lstat(searchPath)); + } + catch (err) { + if (err.code === 'ENOENT') { + continue; + } + throw err; + } + stack.unshift(new internal_search_state_1.SearchState(searchPath, 1)); + } + // Search + const traversalChain = []; // used to detect cycles + while (stack.length) { + // Pop + const item = stack.pop(); + // Match? + const match = patternHelper.match(patterns, item.path); + const partialMatch = !!match || patternHelper.partialMatch(patterns, item.path); + if (!match && !partialMatch) { + continue; + } + // Stat + const stats = yield __await(DefaultGlobber.stat(item, options, traversalChain) + // Broken symlink, or symlink cycle detected, or no longer exists + ); + // Broken symlink, or symlink cycle detected, or no longer exists + if (!stats) { + continue; + } + // Directory + if (stats.isDirectory()) { + // Matched + if (match & internal_match_kind_1.MatchKind.Directory) { + yield yield __await(item.path); + } + // Descend? + else if (!partialMatch) { + continue; + } + // Push the child items in reverse + const childLevel = item.level + 1; + const childItems = (yield __await(fs.promises.readdir(item.path))).map(x => new internal_search_state_1.SearchState(path.join(item.path, x), childLevel)); + stack.push(...childItems.reverse()); + } + // File + else if (match & internal_match_kind_1.MatchKind.File) { + yield yield __await(item.path); + } + } + }); + } /** - * A code indicating that the action was a failure + * Constructs a DefaultGlobber */ - ExitCode[ExitCode["Failure"] = 1] = "Failure"; -})(ExitCode = exports.ExitCode || (exports.ExitCode = {})); -//----------------------------------------------------------------------- -// Variables -//----------------------------------------------------------------------- -/** - * Sets env variable for this action and future actions in the job - * @param name the name of the variable to set - * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify - */ -// eslint-disable-next-line @typescript-eslint/no-explicit-any -function exportVariable(name, val) { - const convertedVal = utils_1.toCommandValue(val); - process.env[name] = convertedVal; - const filePath = process.env['GITHUB_ENV'] || ''; - if (filePath) { - const delimiter = '_GitHubActionsFileCommandDelimeter_'; - const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`; - file_command_1.issueCommand('ENV', commandValue); + static create(patterns, options) { + return __awaiter(this, void 0, void 0, function* () { + const result = new DefaultGlobber(options); + if (IS_WINDOWS) { + patterns = patterns.replace(/\r\n/g, '\n'); + patterns = patterns.replace(/\r/g, '\n'); + } + const lines = patterns.split('\n').map(x => x.trim()); + for (const line of lines) { + // Empty or comment + if (!line || line.startsWith('#')) { + continue; + } + // Pattern + else { + result.patterns.push(new internal_pattern_1.Pattern(line)); + } + } + result.searchPaths.push(...patternHelper.getSearchPaths(result.patterns)); + return result; + }); } - else { - command_1.issueCommand('set-env', { name }, convertedVal); + static stat(item, options, traversalChain) { + return __awaiter(this, void 0, void 0, function* () { + // Note: + // `stat` returns info about the target of a symlink (or symlink chain) + // `lstat` returns info about a symlink itself + let stats; + if (options.followSymbolicLinks) { + try { + // Use `stat` (following symlinks) + stats = yield fs.promises.stat(item.path); + } + catch (err) { + if (err.code === 'ENOENT') { + if (options.omitBrokenSymbolicLinks) { + core.debug(`Broken symlink '${item.path}'`); + return undefined; + } + throw new Error(`No information found for the path '${item.path}'. This may indicate a broken symbolic link.`); + } + throw err; + } + } + else { + // Use `lstat` (not following symlinks) + stats = yield fs.promises.lstat(item.path); + } + // Note, isDirectory() returns false for the lstat of a symlink + if (stats.isDirectory() && options.followSymbolicLinks) { + // Get the realpath + const realPath = yield fs.promises.realpath(item.path); + // Fixup the traversal chain to match the item level + while (traversalChain.length >= item.level) { + traversalChain.pop(); + } + // Test for a cycle + if (traversalChain.some((x) => x === realPath)) { + core.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`); + return undefined; + } + // Update the traversal chain + traversalChain.push(realPath); + } + return stats; + }); } } -exports.exportVariable = exportVariable; +exports.DefaultGlobber = DefaultGlobber; +//# sourceMappingURL=internal-globber.js.map + +/***/ }), + +/***/ 836: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.MatchKind = void 0; /** - * Registers a secret which will get masked from logs - * @param secret value of the secret + * Indicates whether a pattern matches a path */ -function setSecret(secret) { - command_1.issueCommand('add-mask', {}, secret); -} -exports.setSecret = setSecret; +var MatchKind; +(function (MatchKind) { + /** Not matched */ + MatchKind[MatchKind["None"] = 0] = "None"; + /** Matched if the path is a directory */ + MatchKind[MatchKind["Directory"] = 1] = "Directory"; + /** Matched if the path is a regular file */ + MatchKind[MatchKind["File"] = 2] = "File"; + /** Matched */ + MatchKind[MatchKind["All"] = 3] = "All"; +})(MatchKind = exports.MatchKind || (exports.MatchKind = {})); +//# sourceMappingURL=internal-match-kind.js.map + +/***/ }), + +/***/ 22: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__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)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.safeTrimTrailingSeparator = exports.normalizeSeparators = exports.hasRoot = exports.hasAbsoluteRoot = exports.ensureAbsoluteRoot = exports.dirname = void 0; +const path = __importStar(__nccwpck_require__(5622)); +const assert_1 = __importDefault(__nccwpck_require__(2357)); +const IS_WINDOWS = process.platform === 'win32'; /** - * Prepends inputPath to the PATH (for this action and future actions) - * @param inputPath + * Similar to path.dirname except normalizes the path separators and slightly better handling for Windows UNC paths. + * + * For example, on Linux/macOS: + * - `/ => /` + * - `/hello => /` + * + * For example, on Windows: + * - `C:\ => C:\` + * - `C:\hello => C:\` + * - `C: => C:` + * - `C:hello => C:` + * - `\ => \` + * - `\hello => \` + * - `\\hello => \\hello` + * - `\\hello\world => \\hello\world` */ -function addPath(inputPath) { - const filePath = process.env['GITHUB_PATH'] || ''; - if (filePath) { - file_command_1.issueCommand('PATH', inputPath); +function dirname(p) { + // Normalize slashes and trim unnecessary trailing slash + p = safeTrimTrailingSeparator(p); + // Windows UNC root, e.g. \\hello or \\hello\world + if (IS_WINDOWS && /^\\\\[^\\]+(\\[^\\]+)?$/.test(p)) { + return p; } - else { - command_1.issueCommand('add-path', {}, inputPath); + // Get dirname + let result = path.dirname(p); + // Trim trailing slash for Windows UNC root, e.g. \\hello\world\ + if (IS_WINDOWS && /^\\\\[^\\]+\\[^\\]+\\$/.test(result)) { + result = safeTrimTrailingSeparator(result); } - process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`; + return result; } -exports.addPath = addPath; +exports.dirname = dirname; /** - * Gets the value of an input. - * Unless trimWhitespace is set to false in InputOptions, the value is also trimmed. - * Returns an empty string if the value is not defined. - * - * @param name name of the input to get - * @param options optional. See InputOptions. - * @returns string + * Roots the path if not already rooted. On Windows, relative roots like `\` + * or `C:` are expanded based on the current working directory. */ -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}`); +function ensureAbsoluteRoot(root, itemPath) { + assert_1.default(root, `ensureAbsoluteRoot parameter 'root' must not be empty`); + assert_1.default(itemPath, `ensureAbsoluteRoot parameter 'itemPath' must not be empty`); + // Already rooted + if (hasAbsoluteRoot(itemPath)) { + return itemPath; } - if (options && options.trimWhitespace === false) { - return val; + // Windows + if (IS_WINDOWS) { + // Check for itemPath like C: or C:foo + if (itemPath.match(/^[A-Z]:[^\\/]|^[A-Z]:$/i)) { + let cwd = process.cwd(); + assert_1.default(cwd.match(/^[A-Z]:\\/i), `Expected current directory to start with an absolute drive root. Actual '${cwd}'`); + // Drive letter matches cwd? Expand to cwd + if (itemPath[0].toUpperCase() === cwd[0].toUpperCase()) { + // Drive only, e.g. C: + if (itemPath.length === 2) { + // Preserve specified drive letter case (upper or lower) + return `${itemPath[0]}:\\${cwd.substr(3)}`; + } + // Drive + path, e.g. C:foo + else { + if (!cwd.endsWith('\\')) { + cwd += '\\'; + } + // Preserve specified drive letter case (upper or lower) + return `${itemPath[0]}:\\${cwd.substr(3)}${itemPath.substr(2)}`; + } + } + // Different drive + else { + return `${itemPath[0]}:\\${itemPath.substr(2)}`; + } + } + // Check for itemPath like \ or \foo + else if (normalizeSeparators(itemPath).match(/^\\$|^\\[^\\]/)) { + const cwd = process.cwd(); + assert_1.default(cwd.match(/^[A-Z]:\\/i), `Expected current directory to start with an absolute drive root. Actual '${cwd}'`); + return `${cwd[0]}:\\${itemPath.substr(1)}`; + } } - return val.trim(); -} -exports.getInput = getInput; -/** - * Gets the input value of the boolean type in the YAML 1.2 "core schema" specification. - * Support boolean input list: `true | True | TRUE | false | False | FALSE` . - * The return value is also in boolean type. - * ref: https://yaml.org/spec/1.2/spec.html#id2804923 - * - * @param name name of the input to get - * @param options optional. See InputOptions. - * @returns boolean - */ -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}\n` + - `Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); -} -exports.getBooleanInput = getBooleanInput; -/** - * Sets the value of an output. - * - * @param name name of the output to set - * @param value value to store. Non-string values will be converted to a string via JSON.stringify - */ -// eslint-disable-next-line @typescript-eslint/no-explicit-any -function setOutput(name, value) { - process.stdout.write(os.EOL); - command_1.issueCommand('set-output', { name }, value); -} -exports.setOutput = setOutput; -/** - * Enables or disables the echoing of commands into stdout for the rest of the step. - * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set. - * - */ -function setCommandEcho(enabled) { - command_1.issue('echo', enabled ? 'on' : 'off'); -} -exports.setCommandEcho = setCommandEcho; -//----------------------------------------------------------------------- -// Results -//----------------------------------------------------------------------- -/** - * Sets the action status to failed. - * When the action exits it will be with an exit code of 1 - * @param message add error issue message - */ -function setFailed(message) { - process.exitCode = ExitCode.Failure; - error(message); -} -exports.setFailed = setFailed; -//----------------------------------------------------------------------- -// Logging Commands -//----------------------------------------------------------------------- -/** - * Gets whether Actions Step Debug is on or not - */ -function isDebug() { - return process.env['RUNNER_DEBUG'] === '1'; -} -exports.isDebug = isDebug; -/** - * Writes debug message to user log - * @param message debug message - */ -function debug(message) { - command_1.issueCommand('debug', {}, message); -} -exports.debug = debug; -/** - * Adds an error issue - * @param message error issue message. Errors will be converted to string via toString() - */ -function error(message) { - command_1.issue('error', message instanceof Error ? message.toString() : message); -} -exports.error = error; -/** - * Adds an warning issue - * @param message warning issue message. Errors will be converted to string via toString() - */ -function warning(message) { - command_1.issue('warning', message instanceof Error ? message.toString() : message); -} -exports.warning = warning; -/** - * Writes info to log with console.log. - * @param message info message - */ -function info(message) { - process.stdout.write(message + os.EOL); -} -exports.info = info; -/** - * Begin an output group. - * - * Output until the next `groupEnd` will be foldable in this group - * - * @param name The name of the output group - */ -function startGroup(name) { - command_1.issue('group', name); + assert_1.default(hasAbsoluteRoot(root), `ensureAbsoluteRoot parameter 'root' must have an absolute root`); + // Otherwise ensure root ends with a separator + if (root.endsWith('/') || (IS_WINDOWS && root.endsWith('\\'))) { + // Intentionally empty + } + else { + // Append separator + root += path.sep; + } + return root + itemPath; } -exports.startGroup = startGroup; +exports.ensureAbsoluteRoot = ensureAbsoluteRoot; /** - * End an output group. + * On Linux/macOS, true if path starts with `/`. On Windows, true for paths like: + * `\\hello\share` and `C:\hello` (and using alternate separator). */ -function endGroup() { - command_1.issue('endgroup'); +function hasAbsoluteRoot(itemPath) { + assert_1.default(itemPath, `hasAbsoluteRoot parameter 'itemPath' must not be empty`); + // Normalize separators + itemPath = normalizeSeparators(itemPath); + // Windows + if (IS_WINDOWS) { + // E.g. \\hello\share or C:\hello + return itemPath.startsWith('\\\\') || /^[A-Z]:\\/i.test(itemPath); + } + // E.g. /hello + return itemPath.startsWith('/'); } -exports.endGroup = endGroup; +exports.hasAbsoluteRoot = hasAbsoluteRoot; /** - * Wrap an asynchronous function call in a group. - * - * Returns the same type as the function itself. - * - * @param name The name of the group - * @param fn The function to wrap in the group + * On Linux/macOS, true if path starts with `/`. On Windows, true for paths like: + * `\`, `\hello`, `\\hello\share`, `C:`, and `C:\hello` (and using alternate separator). */ -function group(name, fn) { - return __awaiter(this, void 0, void 0, function* () { - startGroup(name); - let result; - try { - result = yield fn(); - } - finally { - endGroup(); - } - return result; - }); +function hasRoot(itemPath) { + assert_1.default(itemPath, `isRooted parameter 'itemPath' must not be empty`); + // Normalize separators + itemPath = normalizeSeparators(itemPath); + // Windows + if (IS_WINDOWS) { + // E.g. \ or \hello or \\hello + // E.g. C: or C:\hello + return itemPath.startsWith('\\') || /^[A-Z]:/i.test(itemPath); + } + // E.g. /hello + return itemPath.startsWith('/'); } -exports.group = group; -//----------------------------------------------------------------------- -// Wrapper action state -//----------------------------------------------------------------------- +exports.hasRoot = hasRoot; /** - * Saves state for current action, the state can only be retrieved by this action's post job execution. - * - * @param name name of the state to store - * @param value value to store. Non-string values will be converted to a string via JSON.stringify + * Removes redundant slashes and converts `/` to `\` on Windows */ -// eslint-disable-next-line @typescript-eslint/no-explicit-any -function saveState(name, value) { - command_1.issueCommand('save-state', { name }, value); +function normalizeSeparators(p) { + p = p || ''; + // Windows + if (IS_WINDOWS) { + // Convert slashes on Windows + p = p.replace(/\//g, '\\'); + // Remove redundant slashes + const isUnc = /^\\\\+[^\\]/.test(p); // e.g. \\hello + return (isUnc ? '\\' : '') + p.replace(/\\\\+/g, '\\'); // preserve leading \\ for UNC + } + // Remove redundant slashes + return p.replace(/\/\/+/g, '/'); } -exports.saveState = saveState; +exports.normalizeSeparators = normalizeSeparators; /** - * Gets the value of an state set by this action's main execution. - * - * @param name name of the state to get - * @returns string + * Normalizes the path separators and trims the trailing separator (when safe). + * For example, `/foo/ => /foo` but `/ => /` */ -function getState(name) { - return process.env[`STATE_${name}`] || ''; +function safeTrimTrailingSeparator(p) { + // Short-circuit if empty + if (!p) { + return ''; + } + // Normalize separators + p = normalizeSeparators(p); + // No trailing slash + if (!p.endsWith(path.sep)) { + return p; + } + // Check '/' on Linux/macOS and '\' on Windows + if (p === path.sep) { + return p; + } + // On Windows check if drive root. E.g. C:\ + if (IS_WINDOWS && /^[A-Z]:\\$/i.test(p)) { + return p; + } + // Otherwise trim trailing slash + return p.substr(0, p.length - 1); } -exports.getState = getState; -//# sourceMappingURL=core.js.map +exports.safeTrimTrailingSeparator = safeTrimTrailingSeparator; +//# sourceMappingURL=internal-path-helper.js.map /***/ }), -/***/ 717: +/***/ 9413: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; -// For internal use, subject to change. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); @@ -1606,749 +1782,484 @@ var __importStar = (this && this.__importStar) || function (mod) { __setModuleDefault(result, mod); return result; }; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.issueCommand = void 0; -// We use any as a valid input type -/* eslint-disable @typescript-eslint/no-explicit-any */ -const fs = __importStar(__nccwpck_require__(5747)); -const os = __importStar(__nccwpck_require__(2087)); -const utils_1 = __nccwpck_require__(5278); -function issueCommand(command, message) { - const filePath = process.env[`GITHUB_${command}`]; - if (!filePath) { - throw new Error(`Unable to find environment variable for file command ${command}`); - } - if (!fs.existsSync(filePath)) { - throw new Error(`Missing file at path: ${filePath}`); - } - fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, { - encoding: 'utf8' - }); -} -exports.issueCommand = issueCommand; -//# sourceMappingURL=file-command.js.map - -/***/ }), - -/***/ 5278: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -// We use any as a valid input type -/* eslint-disable @typescript-eslint/no-explicit-any */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.toCommandValue = void 0; +exports.Path = void 0; +const path = __importStar(__nccwpck_require__(5622)); +const pathHelper = __importStar(__nccwpck_require__(22)); +const assert_1 = __importDefault(__nccwpck_require__(2357)); +const IS_WINDOWS = process.platform === 'win32'; /** - * Sanitizes an input into a string so it can be passed into issueCommand safely - * @param input input to sanitize into a string + * Helper class for parsing paths into segments */ -function toCommandValue(input) { - if (input === null || input === undefined) { - return ''; +class Path { + /** + * Constructs a Path + * @param itemPath Path or array of segments + */ + constructor(itemPath) { + this.segments = []; + // String + if (typeof itemPath === 'string') { + assert_1.default(itemPath, `Parameter 'itemPath' must not be empty`); + // Normalize slashes and trim unnecessary trailing slash + itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); + // Not rooted + if (!pathHelper.hasRoot(itemPath)) { + this.segments = itemPath.split(path.sep); + } + // Rooted + else { + // Add all segments, while not at the root + let remaining = itemPath; + let dir = pathHelper.dirname(remaining); + while (dir !== remaining) { + // Add the segment + const basename = path.basename(remaining); + this.segments.unshift(basename); + // Truncate the last segment + remaining = dir; + dir = pathHelper.dirname(remaining); + } + // Remainder is the root + this.segments.unshift(remaining); + } + } + // Array + else { + // Must not be empty + assert_1.default(itemPath.length > 0, `Parameter 'itemPath' must not be an empty array`); + // Each segment + for (let i = 0; i < itemPath.length; i++) { + let segment = itemPath[i]; + // Must not be empty + assert_1.default(segment, `Parameter 'itemPath' must not contain any empty segments`); + // Normalize slashes + segment = pathHelper.normalizeSeparators(itemPath[i]); + // Root segment + if (i === 0 && pathHelper.hasRoot(segment)) { + segment = pathHelper.safeTrimTrailingSeparator(segment); + assert_1.default(segment === pathHelper.dirname(segment), `Parameter 'itemPath' root segment contains information for multiple segments`); + this.segments.push(segment); + } + // All other segments + else { + // Must not contain slash + assert_1.default(!segment.includes(path.sep), `Parameter 'itemPath' contains unexpected path separators`); + this.segments.push(segment); + } + } + } } - else if (typeof input === 'string' || input instanceof String) { - return input; + /** + * Converts the path to it's string representation + */ + toString() { + // First segment + let result = this.segments[0]; + // All others + let skipSlash = result.endsWith(path.sep) || (IS_WINDOWS && /^[A-Z]:$/i.test(result)); + for (let i = 1; i < this.segments.length; i++) { + if (skipSlash) { + skipSlash = false; + } + else { + result += path.sep; + } + result += this.segments[i]; + } + return result; } - return JSON.stringify(input); } -exports.toCommandValue = toCommandValue; -//# sourceMappingURL=utils.js.map +exports.Path = Path; +//# sourceMappingURL=internal-path.js.map /***/ }), -/***/ 1514: +/***/ 5186: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; - result["default"] = mod; + if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -const tr = __importStar(__nccwpck_require__(8159)); +exports.partialMatch = exports.match = exports.getSearchPaths = void 0; +const pathHelper = __importStar(__nccwpck_require__(22)); +const internal_match_kind_1 = __nccwpck_require__(836); +const IS_WINDOWS = process.platform === 'win32'; /** - * Exec a command. - * Output will be streamed to the live console. - * Returns promise with return code - * - * @param commandLine command to execute (can include additional args). Must be correctly escaped. - * @param args optional arguments for tool. Escaping is handled by the lib. - * @param options optional exec options. See ExecOptions - * @returns Promise exit code + * Given an array of patterns, returns an array of paths to search. + * Duplicates and paths under other included paths are filtered out. */ -function exec(commandLine, args, options) { - return __awaiter(this, void 0, void 0, function* () { - const commandArgs = tr.argStringToArray(commandLine); - if (commandArgs.length === 0) { - throw new Error(`Parameter 'commandLine' cannot be null or empty.`); +function getSearchPaths(patterns) { + // Ignore negate patterns + patterns = patterns.filter(x => !x.negate); + // Create a map of all search paths + const searchPathMap = {}; + for (const pattern of patterns) { + const key = IS_WINDOWS + ? pattern.searchPath.toUpperCase() + : pattern.searchPath; + searchPathMap[key] = 'candidate'; + } + const result = []; + for (const pattern of patterns) { + // Check if already included + const key = IS_WINDOWS + ? pattern.searchPath.toUpperCase() + : pattern.searchPath; + if (searchPathMap[key] === 'included') { + continue; } - // Path to tool to execute should be first arg - const toolPath = commandArgs[0]; - args = commandArgs.slice(1).concat(args || []); - const runner = new tr.ToolRunner(toolPath, args, options); - return runner.exec(); - }); + // Check for an ancestor search path + let foundAncestor = false; + let tempKey = key; + let parent = pathHelper.dirname(tempKey); + while (parent !== tempKey) { + if (searchPathMap[parent]) { + foundAncestor = true; + break; + } + tempKey = parent; + parent = pathHelper.dirname(tempKey); + } + // Include the search pattern in the result + if (!foundAncestor) { + result.push(pattern.searchPath); + searchPathMap[key] = 'included'; + } + } + return result; } -exports.exec = exec; -//# sourceMappingURL=exec.js.map +exports.getSearchPaths = getSearchPaths; +/** + * Matches the patterns against the path + */ +function match(patterns, itemPath) { + let result = internal_match_kind_1.MatchKind.None; + for (const pattern of patterns) { + if (pattern.negate) { + result &= ~pattern.match(itemPath); + } + else { + result |= pattern.match(itemPath); + } + } + return result; +} +exports.match = match; +/** + * Checks whether to descend further into the directory + */ +function partialMatch(patterns, itemPath) { + return patterns.some(x => !x.negate && x.partialMatch(itemPath)); +} +exports.partialMatch = partialMatch; +//# sourceMappingURL=internal-pattern-helper.js.map /***/ }), -/***/ 8159: +/***/ 5343: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; - result["default"] = mod; + if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); return result; }; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Pattern = void 0; const os = __importStar(__nccwpck_require__(2087)); -const events = __importStar(__nccwpck_require__(8614)); -const child = __importStar(__nccwpck_require__(3129)); const path = __importStar(__nccwpck_require__(5622)); -const io = __importStar(__nccwpck_require__(7436)); -const ioUtil = __importStar(__nccwpck_require__(1962)); -/* eslint-disable @typescript-eslint/unbound-method */ +const pathHelper = __importStar(__nccwpck_require__(22)); +const assert_1 = __importDefault(__nccwpck_require__(2357)); +const minimatch_1 = __nccwpck_require__(3973); +const internal_match_kind_1 = __nccwpck_require__(836); +const internal_path_1 = __nccwpck_require__(9413); const IS_WINDOWS = process.platform === 'win32'; -/* - * Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way. - */ -class ToolRunner extends events.EventEmitter { - constructor(toolPath, args, options) { - super(); - if (!toolPath) { - throw new Error("Parameter 'toolPath' cannot be null or empty."); - } - this.toolPath = toolPath; - this.args = args || []; - this.options = options || {}; - } - _debug(message) { - if (this.options.listeners && this.options.listeners.debug) { - this.options.listeners.debug(message); - } - } - _getCommandString(options, noPrefix) { - const toolPath = this._getSpawnFileName(); - const args = this._getSpawnArgs(options); - let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool - if (IS_WINDOWS) { - // Windows + cmd file - if (this._isCmdFile()) { - cmd += toolPath; - for (const a of args) { - cmd += ` ${a}`; - } - } - // Windows + verbatim - else if (options.windowsVerbatimArguments) { - cmd += `"${toolPath}"`; - for (const a of args) { - cmd += ` ${a}`; - } - } - // Windows (regular) - else { - cmd += this._windowsQuoteCmdArg(toolPath); - for (const a of args) { - cmd += ` ${this._windowsQuoteCmdArg(a)}`; - } - } +class Pattern { + constructor(patternOrNegate, isImplicitPattern = false, segments, homedir) { + /** + * Indicates whether matches should be excluded from the result set + */ + this.negate = false; + // Pattern overload + let pattern; + if (typeof patternOrNegate === 'string') { + pattern = patternOrNegate.trim(); } + // Segments overload else { - // OSX/Linux - this can likely be improved with some form of quoting. - // creating processes on Unix is fundamentally different than Windows. - // on Unix, execvp() takes an arg array. - cmd += toolPath; - for (const a of args) { - cmd += ` ${a}`; + // Convert to pattern + segments = segments || []; + assert_1.default(segments.length, `Parameter 'segments' must not empty`); + const root = Pattern.getLiteral(segments[0]); + assert_1.default(root && pathHelper.hasAbsoluteRoot(root), `Parameter 'segments' first element must be a root path`); + pattern = new internal_path_1.Path(segments).toString().trim(); + if (patternOrNegate) { + pattern = `!${pattern}`; } } - return cmd; + // Negate + while (pattern.startsWith('!')) { + this.negate = !this.negate; + pattern = pattern.substr(1).trim(); + } + // Normalize slashes and ensures absolute root + pattern = Pattern.fixupPattern(pattern, homedir); + // Segments + this.segments = new internal_path_1.Path(pattern).segments; + // Trailing slash indicates the pattern should only match directories, not regular files + this.trailingSeparator = pathHelper + .normalizeSeparators(pattern) + .endsWith(path.sep); + pattern = pathHelper.safeTrimTrailingSeparator(pattern); + // Search path (literal path prior to the first glob segment) + let foundGlob = false; + const searchSegments = this.segments + .map(x => Pattern.getLiteral(x)) + .filter(x => !foundGlob && !(foundGlob = x === '')); + this.searchPath = new internal_path_1.Path(searchSegments).toString(); + // Root RegExp (required when determining partial match) + this.rootRegExp = new RegExp(Pattern.regExpEscape(searchSegments[0]), IS_WINDOWS ? 'i' : ''); + this.isImplicitPattern = isImplicitPattern; + // Create minimatch + const minimatchOptions = { + dot: true, + nobrace: true, + nocase: IS_WINDOWS, + nocomment: true, + noext: true, + nonegate: true + }; + pattern = IS_WINDOWS ? pattern.replace(/\\/g, '/') : pattern; + this.minimatch = new minimatch_1.Minimatch(pattern, minimatchOptions); } - _processLineBuffer(data, strBuffer, onLine) { - try { - let s = strBuffer + data.toString(); - let n = s.indexOf(os.EOL); - while (n > -1) { - const line = s.substring(0, n); - onLine(line); - // the rest of the string ... - s = s.substring(n + os.EOL.length); - n = s.indexOf(os.EOL); + /** + * Matches the pattern against the specified path + */ + match(itemPath) { + // Last segment is globstar? + if (this.segments[this.segments.length - 1] === '**') { + // Normalize slashes + itemPath = pathHelper.normalizeSeparators(itemPath); + // Append a trailing slash. Otherwise Minimatch will not match the directory immediately + // preceding the globstar. For example, given the pattern `/foo/**`, Minimatch returns + // false for `/foo` but returns true for `/foo/`. Append a trailing slash to handle that quirk. + if (!itemPath.endsWith(path.sep) && this.isImplicitPattern === false) { + // Note, this is safe because the constructor ensures the pattern has an absolute root. + // For example, formats like C: and C:foo on Windows are resolved to an absolute root. + itemPath = `${itemPath}${path.sep}`; } - strBuffer = s; } - catch (err) { - // streaming lines to console is best effort. Don't fail a build. - this._debug(`error processing line. Failed with error ${err}`); + else { + // Normalize slashes and trim unnecessary trailing slash + itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); } - } - _getSpawnFileName() { - if (IS_WINDOWS) { - if (this._isCmdFile()) { - return process.env['COMSPEC'] || 'cmd.exe'; - } + // Match + if (this.minimatch.match(itemPath)) { + return this.trailingSeparator ? internal_match_kind_1.MatchKind.Directory : internal_match_kind_1.MatchKind.All; } - return this.toolPath; + return internal_match_kind_1.MatchKind.None; } - _getSpawnArgs(options) { - if (IS_WINDOWS) { - if (this._isCmdFile()) { - let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`; - for (const a of this.args) { - argline += ' '; - argline += options.windowsVerbatimArguments - ? a - : this._windowsQuoteCmdArg(a); - } - argline += '"'; - return [argline]; - } + /** + * Indicates whether the pattern may match descendants of the specified path + */ + partialMatch(itemPath) { + // Normalize slashes and trim unnecessary trailing slash + itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); + // matchOne does not handle root path correctly + if (pathHelper.dirname(itemPath) === itemPath) { + return this.rootRegExp.test(itemPath); } - return this.args; - } - _endsWith(str, end) { - return str.endsWith(end); + return this.minimatch.matchOne(itemPath.split(IS_WINDOWS ? /\\+/ : /\/+/), this.minimatch.set[0], true); } - _isCmdFile() { - const upperToolPath = this.toolPath.toUpperCase(); - return (this._endsWith(upperToolPath, '.CMD') || - this._endsWith(upperToolPath, '.BAT')); + /** + * Escapes glob patterns within a path + */ + static globEscape(s) { + return (IS_WINDOWS ? s : s.replace(/\\/g, '\\\\')) // escape '\' on Linux/macOS + .replace(/(\[)(?=[^/]+\])/g, '[[]') // escape '[' when ']' follows within the path segment + .replace(/\?/g, '[?]') // escape '?' + .replace(/\*/g, '[*]'); // escape '*' } - _windowsQuoteCmdArg(arg) { - // for .exe, apply the normal quoting rules that libuv applies - if (!this._isCmdFile()) { - return this._uvQuoteCmdArg(arg); + /** + * Normalizes slashes and ensures absolute root + */ + static fixupPattern(pattern, homedir) { + // Empty + assert_1.default(pattern, 'pattern cannot be empty'); + // Must not contain `.` segment, unless first segment + // Must not contain `..` segment + const literalSegments = new internal_path_1.Path(pattern).segments.map(x => Pattern.getLiteral(x)); + assert_1.default(literalSegments.every((x, i) => (x !== '.' || i === 0) && x !== '..'), `Invalid pattern '${pattern}'. Relative pathing '.' and '..' is not allowed.`); + // Must not contain globs in root, e.g. Windows UNC path \\foo\b*r + assert_1.default(!pathHelper.hasRoot(pattern) || literalSegments[0], `Invalid pattern '${pattern}'. Root segment must not contain globs.`); + // Normalize slashes + pattern = pathHelper.normalizeSeparators(pattern); + // Replace leading `.` segment + if (pattern === '.' || pattern.startsWith(`.${path.sep}`)) { + pattern = Pattern.globEscape(process.cwd()) + pattern.substr(1); } - // otherwise apply quoting rules specific to the cmd.exe command line parser. - // the libuv rules are generic and are not designed specifically for cmd.exe - // command line parser. - // - // for a detailed description of the cmd.exe command line parser, refer to - // http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912 - // need quotes for empty arg - if (!arg) { - return '""'; + // Replace leading `~` segment + else if (pattern === '~' || pattern.startsWith(`~${path.sep}`)) { + homedir = homedir || os.homedir(); + assert_1.default(homedir, 'Unable to determine HOME directory'); + assert_1.default(pathHelper.hasAbsoluteRoot(homedir), `Expected HOME directory to be a rooted path. Actual '${homedir}'`); + pattern = Pattern.globEscape(homedir) + pattern.substr(1); } - // determine whether the arg needs to be quoted - const cmdSpecialChars = [ - ' ', - '\t', - '&', - '(', - ')', - '[', - ']', - '{', - '}', - '^', - '=', - ';', - '!', - "'", - '+', - ',', - '`', - '~', - '|', - '<', - '>', - '"' - ]; - let needsQuotes = false; - for (const char of arg) { - if (cmdSpecialChars.some(x => x === char)) { - needsQuotes = true; - break; + // Replace relative drive root, e.g. pattern is C: or C:foo + else if (IS_WINDOWS && + (pattern.match(/^[A-Z]:$/i) || pattern.match(/^[A-Z]:[^\\]/i))) { + let root = pathHelper.ensureAbsoluteRoot('C:\\dummy-root', pattern.substr(0, 2)); + if (pattern.length > 2 && !root.endsWith('\\')) { + root += '\\'; } + pattern = Pattern.globEscape(root) + pattern.substr(2); } - // short-circuit if quotes not needed - if (!needsQuotes) { - return arg; - } - // the following quoting rules are very similar to the rules that by libuv applies. - // - // 1) wrap the string in quotes - // - // 2) double-up quotes - i.e. " => "" - // - // this is different from the libuv quoting rules. libuv replaces " with \", which unfortunately - // doesn't work well with a cmd.exe command line. - // - // note, replacing " with "" also works well if the arg is passed to a downstream .NET console app. - // for example, the command line: - // foo.exe "myarg:""my val""" - // is parsed by a .NET console app into an arg array: - // [ "myarg:\"my val\"" ] - // which is the same end result when applying libuv quoting rules. although the actual - // command line from libuv quoting rules would look like: - // foo.exe "myarg:\"my val\"" - // - // 3) double-up slashes that precede a quote, - // e.g. hello \world => "hello \world" - // hello\"world => "hello\\""world" - // hello\\"world => "hello\\\\""world" - // hello world\ => "hello world\\" - // - // technically this is not required for a cmd.exe command line, or the batch argument parser. - // the reasons for including this as a .cmd quoting rule are: - // - // a) this is optimized for the scenario where the argument is passed from the .cmd file to an - // external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule. - // - // b) it's what we've been doing previously (by deferring to node default behavior) and we - // haven't heard any complaints about that aspect. - // - // note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be - // escaped when used on the command line directly - even though within a .cmd file % can be escaped - // by using %%. - // - // the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts - // the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing. - // - // one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would - // often work, since it is unlikely that var^ would exist, and the ^ character is removed when the - // variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args - // to an external program. - // - // an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file. - // % can be escaped within a .cmd file. - let reverse = '"'; - let quoteHit = true; - for (let i = arg.length; i > 0; i--) { - // walk the string in reverse - reverse += arg[i - 1]; - if (quoteHit && arg[i - 1] === '\\') { - reverse += '\\'; // double the slash - } - else if (arg[i - 1] === '"') { - quoteHit = true; - reverse += '"'; // double the quote - } - else { - quoteHit = false; + // Replace relative root, e.g. pattern is \ or \foo + else if (IS_WINDOWS && (pattern === '\\' || pattern.match(/^\\[^\\]/))) { + let root = pathHelper.ensureAbsoluteRoot('C:\\dummy-root', '\\'); + if (!root.endsWith('\\')) { + root += '\\'; } + pattern = Pattern.globEscape(root) + pattern.substr(1); } - reverse += '"'; - return reverse - .split('') - .reverse() - .join(''); - } - _uvQuoteCmdArg(arg) { - // Tool runner wraps child_process.spawn() and needs to apply the same quoting as - // Node in certain cases where the undocumented spawn option windowsVerbatimArguments - // is used. - // - // Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV, - // see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details), - // pasting copyright notice from Node within this function: - // - // Copyright Joyent, Inc. and other Node contributors. All rights reserved. - // - // Permission is hereby granted, free of charge, to any person obtaining a copy - // of this software and associated documentation files (the "Software"), to - // deal in the Software without restriction, including without limitation the - // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - // sell copies of the Software, and to permit persons to whom the Software is - // furnished to do so, subject to the following conditions: - // - // The above copyright notice and this permission notice shall be included in - // all copies or substantial portions of the Software. - // - // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - // IN THE SOFTWARE. - if (!arg) { - // Need double quotation for empty argument - return '""'; - } - if (!arg.includes(' ') && !arg.includes('\t') && !arg.includes('"')) { - // No quotation needed - return arg; - } - if (!arg.includes('"') && !arg.includes('\\')) { - // No embedded double quotes or backslashes, so I can just wrap - // quote marks around the whole thing. - return `"${arg}"`; + // Otherwise ensure absolute root + else { + pattern = pathHelper.ensureAbsoluteRoot(Pattern.globEscape(process.cwd()), pattern); } - // Expected input/output: - // input : hello"world - // output: "hello\"world" - // input : hello""world - // output: "hello\"\"world" - // input : hello\world - // output: hello\world - // input : hello\\world - // output: hello\\world - // input : hello\"world - // output: "hello\\\"world" - // input : hello\\"world - // output: "hello\\\\\"world" - // input : hello world\ - // output: "hello world\\" - note the comment in libuv actually reads "hello world\" - // but it appears the comment is wrong, it should be "hello world\\" - let reverse = '"'; - let quoteHit = true; - for (let i = arg.length; i > 0; i--) { - // walk the string in reverse - reverse += arg[i - 1]; - if (quoteHit && arg[i - 1] === '\\') { - reverse += '\\'; + return pathHelper.normalizeSeparators(pattern); + } + /** + * Attempts to unescape a pattern segment to create a literal path segment. + * Otherwise returns empty string. + */ + static getLiteral(segment) { + let literal = ''; + for (let i = 0; i < segment.length; i++) { + const c = segment[i]; + // Escape + if (c === '\\' && !IS_WINDOWS && i + 1 < segment.length) { + literal += segment[++i]; + continue; } - else if (arg[i - 1] === '"') { - quoteHit = true; - reverse += '\\'; + // Wildcard + else if (c === '*' || c === '?') { + return ''; } - else { - quoteHit = false; + // Character set + else if (c === '[' && i + 1 < segment.length) { + let set = ''; + let closed = -1; + for (let i2 = i + 1; i2 < segment.length; i2++) { + const c2 = segment[i2]; + // Escape + if (c2 === '\\' && !IS_WINDOWS && i2 + 1 < segment.length) { + set += segment[++i2]; + continue; + } + // Closed + else if (c2 === ']') { + closed = i2; + break; + } + // Otherwise + else { + set += c2; + } + } + // Closed? + if (closed >= 0) { + // Cannot convert + if (set.length > 1) { + return ''; + } + // Convert to literal + if (set) { + literal += set; + i = closed; + continue; + } + } + // Otherwise fall thru } + // Append + literal += c; } - reverse += '"'; - return reverse - .split('') - .reverse() - .join(''); - } - _cloneExecOptions(options) { - options = options || {}; - const result = { - cwd: options.cwd || process.cwd(), - env: options.env || process.env, - silent: options.silent || false, - windowsVerbatimArguments: options.windowsVerbatimArguments || false, - failOnStdErr: options.failOnStdErr || false, - ignoreReturnCode: options.ignoreReturnCode || false, - delay: options.delay || 10000 - }; - result.outStream = options.outStream || process.stdout; - result.errStream = options.errStream || process.stderr; - return result; - } - _getSpawnOptions(options, toolPath) { - options = options || {}; - const result = {}; - result.cwd = options.cwd; - result.env = options.env; - result['windowsVerbatimArguments'] = - options.windowsVerbatimArguments || this._isCmdFile(); - if (options.windowsVerbatimArguments) { - result.argv0 = `"${toolPath}"`; - } - return result; + return literal; } /** - * Exec a tool. - * Output will be streamed to the live console. - * Returns promise with return code - * - * @param tool path to tool to exec - * @param options optional exec options. See ExecOptions - * @returns number + * Escapes regexp special characters + * https://javascript.info/regexp-escaping */ - exec() { - return __awaiter(this, void 0, void 0, function* () { - // root the tool path if it is unrooted and contains relative pathing - if (!ioUtil.isRooted(this.toolPath) && - (this.toolPath.includes('/') || - (IS_WINDOWS && this.toolPath.includes('\\')))) { - // prefer options.cwd if it is specified, however options.cwd may also need to be rooted - this.toolPath = path.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); - } - // if the tool is only a file name, then resolve it from the PATH - // otherwise verify it exists (add extension on Windows if necessary) - this.toolPath = yield io.which(this.toolPath, true); - return new Promise((resolve, reject) => { - this._debug(`exec tool: ${this.toolPath}`); - this._debug('arguments:'); - for (const arg of this.args) { - this._debug(` ${arg}`); - } - const optionsNonNull = this._cloneExecOptions(this.options); - if (!optionsNonNull.silent && optionsNonNull.outStream) { - optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL); - } - const state = new ExecState(optionsNonNull, this.toolPath); - state.on('debug', (message) => { - this._debug(message); - }); - const fileName = this._getSpawnFileName(); - const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName)); - const stdbuffer = ''; - if (cp.stdout) { - cp.stdout.on('data', (data) => { - if (this.options.listeners && this.options.listeners.stdout) { - this.options.listeners.stdout(data); - } - if (!optionsNonNull.silent && optionsNonNull.outStream) { - optionsNonNull.outStream.write(data); - } - this._processLineBuffer(data, stdbuffer, (line) => { - if (this.options.listeners && this.options.listeners.stdline) { - this.options.listeners.stdline(line); - } - }); - }); - } - const errbuffer = ''; - if (cp.stderr) { - cp.stderr.on('data', (data) => { - state.processStderr = true; - if (this.options.listeners && this.options.listeners.stderr) { - this.options.listeners.stderr(data); - } - if (!optionsNonNull.silent && - optionsNonNull.errStream && - optionsNonNull.outStream) { - const s = optionsNonNull.failOnStdErr - ? optionsNonNull.errStream - : optionsNonNull.outStream; - s.write(data); - } - this._processLineBuffer(data, errbuffer, (line) => { - if (this.options.listeners && this.options.listeners.errline) { - this.options.listeners.errline(line); - } - }); - }); - } - cp.on('error', (err) => { - state.processError = err.message; - state.processExited = true; - state.processClosed = true; - state.CheckComplete(); - }); - cp.on('exit', (code) => { - state.processExitCode = code; - state.processExited = true; - this._debug(`Exit code ${code} received from tool '${this.toolPath}'`); - state.CheckComplete(); - }); - cp.on('close', (code) => { - state.processExitCode = code; - state.processExited = true; - state.processClosed = true; - this._debug(`STDIO streams have closed for tool '${this.toolPath}'`); - state.CheckComplete(); - }); - state.on('done', (error, exitCode) => { - if (stdbuffer.length > 0) { - this.emit('stdline', stdbuffer); - } - if (errbuffer.length > 0) { - this.emit('errline', errbuffer); - } - cp.removeAllListeners(); - if (error) { - reject(error); - } - else { - resolve(exitCode); - } - }); - if (this.options.input) { - if (!cp.stdin) { - throw new Error('child process missing stdin'); - } - cp.stdin.end(this.options.input); - } - }); - }); - } -} -exports.ToolRunner = ToolRunner; -/** - * Convert an arg string to an array of args. Handles escaping - * - * @param argString string of arguments - * @returns string[] array of arguments - */ -function argStringToArray(argString) { - const args = []; - let inQuotes = false; - let escaped = false; - let arg = ''; - function append(c) { - // we only escape double quotes. - if (escaped && c !== '"') { - arg += '\\'; - } - arg += c; - escaped = false; - } - for (let i = 0; i < argString.length; i++) { - const c = argString.charAt(i); - if (c === '"') { - if (!escaped) { - inQuotes = !inQuotes; - } - else { - append(c); - } - continue; - } - if (c === '\\' && escaped) { - append(c); - continue; - } - if (c === '\\' && inQuotes) { - escaped = true; - continue; - } - if (c === ' ' && !inQuotes) { - if (arg.length > 0) { - args.push(arg); - arg = ''; - } - continue; - } - append(c); - } - if (arg.length > 0) { - args.push(arg.trim()); - } - return args; -} -exports.argStringToArray = argStringToArray; -class ExecState extends events.EventEmitter { - constructor(options, toolPath) { - super(); - this.processClosed = false; // tracks whether the process has exited and stdio is closed - this.processError = ''; - this.processExitCode = 0; - this.processExited = false; // tracks whether the process has exited - this.processStderr = false; // tracks whether stderr was written to - this.delay = 10000; // 10 seconds - this.done = false; - this.timeout = null; - if (!toolPath) { - throw new Error('toolPath must not be empty'); - } - this.options = options; - this.toolPath = toolPath; - if (options.delay) { - this.delay = options.delay; - } - } - CheckComplete() { - if (this.done) { - return; - } - if (this.processClosed) { - this._setResult(); - } - else if (this.processExited) { - this.timeout = setTimeout(ExecState.HandleTimeout, this.delay, this); - } - } - _debug(message) { - this.emit('debug', message); - } - _setResult() { - // determine whether there is an error - let error; - if (this.processExited) { - if (this.processError) { - error = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`); - } - else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) { - error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`); - } - else if (this.processStderr && this.options.failOnStdErr) { - error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`); - } - } - // clear the timeout - if (this.timeout) { - clearTimeout(this.timeout); - this.timeout = null; - } - this.done = true; - this.emit('done', error, this.processExitCode); - } - static HandleTimeout(state) { - if (state.done) { - return; - } - if (!state.processClosed && state.processExited) { - const message = `The STDIO streams did not close within ${state.delay / - 1000} seconds of the exit event from process '${state.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`; - state._debug(message); - } - state._setResult(); + static regExpEscape(s) { + return s.replace(/[[\\^$.|?*+()]/g, '\\$&'); } } -//# sourceMappingURL=toolrunner.js.map +exports.Pattern = Pattern; +//# sourceMappingURL=internal-pattern.js.map /***/ }), -/***/ 8090: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 8530: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.create = void 0; -const internal_globber_1 = __nccwpck_require__(8298); -/** - * Constructs a globber - * - * @param patterns Patterns separated by newlines - * @param options Glob options - */ -function create(patterns, options) { - return __awaiter(this, void 0, void 0, function* () { - return yield internal_globber_1.DefaultGlobber.create(patterns, options); - }); +exports.SearchState = void 0; +class SearchState { + constructor(path, level) { + this.path = path; + this.level = level; + } } -exports.create = create; -//# sourceMappingURL=glob.js.map +exports.SearchState = SearchState; +//# sourceMappingURL=internal-search-state.js.map /***/ }), -/***/ 1026: +/***/ 7351: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -2373,39 +2284,81 @@ var __importStar = (this && this.__importStar) || function (mod) { return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getOptions = void 0; -const core = __importStar(__nccwpck_require__(2186)); +exports.issue = exports.issueCommand = void 0; +const os = __importStar(__nccwpck_require__(2087)); +const utils_1 = __nccwpck_require__(5278); /** - * Returns a copy with defaults filled in. + * Commands + * + * Command Format: + * ::name key=value,key=value::message + * + * Examples: + * ::warning::This is the message + * ::set-env name=MY_VAR::some value */ -function getOptions(copy) { - const result = { - followSymbolicLinks: true, - implicitDescendants: true, - omitBrokenSymbolicLinks: true - }; - if (copy) { - if (typeof copy.followSymbolicLinks === 'boolean') { - result.followSymbolicLinks = copy.followSymbolicLinks; - core.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`); - } - if (typeof copy.implicitDescendants === 'boolean') { - result.implicitDescendants = copy.implicitDescendants; - core.debug(`implicitDescendants '${result.implicitDescendants}'`); +function issueCommand(command, properties, message) { + const cmd = new Command(command, properties, message); + process.stdout.write(cmd.toString() + os.EOL); +} +exports.issueCommand = issueCommand; +function issue(name, message = '') { + issueCommand(name, {}, message); +} +exports.issue = issue; +const CMD_STRING = '::'; +class Command { + constructor(command, properties, message) { + if (!command) { + command = 'missing.command'; } - if (typeof copy.omitBrokenSymbolicLinks === 'boolean') { - result.omitBrokenSymbolicLinks = copy.omitBrokenSymbolicLinks; - core.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`); + this.command = command; + this.properties = properties; + this.message = message; + } + toString() { + let cmdStr = CMD_STRING + this.command; + if (this.properties && Object.keys(this.properties).length > 0) { + cmdStr += ' '; + let first = true; + for (const key in this.properties) { + if (this.properties.hasOwnProperty(key)) { + const val = this.properties[key]; + if (val) { + if (first) { + first = false; + } + else { + cmdStr += ','; + } + cmdStr += `${key}=${escapeProperty(val)}`; + } + } + } } + cmdStr += `${CMD_STRING}${escapeData(this.message)}`; + return cmdStr; } - return result; } -exports.getOptions = getOptions; -//# sourceMappingURL=internal-glob-options-helper.js.map +function escapeData(s) { + return utils_1.toCommandValue(s) + .replace(/%/g, '%25') + .replace(/\r/g, '%0D') + .replace(/\n/g, '%0A'); +} +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'); +} +//# sourceMappingURL=command.js.map /***/ }), -/***/ 8298: +/***/ 2186: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -2438,245 +2391,280 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; -var __asyncValues = (this && this.__asyncValues) || function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } -}; -var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); } -var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } -}; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DefaultGlobber = void 0; -const core = __importStar(__nccwpck_require__(2186)); -const fs = __importStar(__nccwpck_require__(5747)); -const globOptionsHelper = __importStar(__nccwpck_require__(1026)); +exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0; +const command_1 = __nccwpck_require__(7351); +const file_command_1 = __nccwpck_require__(717); +const utils_1 = __nccwpck_require__(5278); +const os = __importStar(__nccwpck_require__(2087)); const path = __importStar(__nccwpck_require__(5622)); -const patternHelper = __importStar(__nccwpck_require__(9005)); -const internal_match_kind_1 = __nccwpck_require__(1063); -const internal_pattern_1 = __nccwpck_require__(4536); -const internal_search_state_1 = __nccwpck_require__(9117); -const IS_WINDOWS = process.platform === 'win32'; -class DefaultGlobber { - constructor(options) { - this.patterns = []; - this.searchPaths = []; - this.options = globOptionsHelper.getOptions(options); +/** + * The code to exit an action + */ +var ExitCode; +(function (ExitCode) { + /** + * A code indicating that the action was successful + */ + ExitCode[ExitCode["Success"] = 0] = "Success"; + /** + * A code indicating that the action was a failure + */ + ExitCode[ExitCode["Failure"] = 1] = "Failure"; +})(ExitCode = exports.ExitCode || (exports.ExitCode = {})); +//----------------------------------------------------------------------- +// Variables +//----------------------------------------------------------------------- +/** + * Sets env variable for this action and future actions in the job + * @param name the name of the variable to set + * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function exportVariable(name, val) { + const convertedVal = utils_1.toCommandValue(val); + process.env[name] = convertedVal; + const filePath = process.env['GITHUB_ENV'] || ''; + if (filePath) { + const delimiter = '_GitHubActionsFileCommandDelimeter_'; + const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`; + file_command_1.issueCommand('ENV', commandValue); } - getSearchPaths() { - // Return a copy - return this.searchPaths.slice(); + else { + command_1.issueCommand('set-env', { name }, convertedVal); } - glob() { - var e_1, _a; - return __awaiter(this, void 0, void 0, function* () { - const result = []; - try { - for (var _b = __asyncValues(this.globGenerator()), _c; _c = yield _b.next(), !_c.done;) { - const itemPath = _c.value; - result.push(itemPath); - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b); - } - finally { if (e_1) throw e_1.error; } - } - return result; - }); +} +exports.exportVariable = exportVariable; +/** + * Registers a secret which will get masked from logs + * @param secret value of the secret + */ +function setSecret(secret) { + command_1.issueCommand('add-mask', {}, secret); +} +exports.setSecret = setSecret; +/** + * Prepends inputPath to the PATH (for this action and future actions) + * @param inputPath + */ +function addPath(inputPath) { + const filePath = process.env['GITHUB_PATH'] || ''; + if (filePath) { + file_command_1.issueCommand('PATH', inputPath); } - globGenerator() { - return __asyncGenerator(this, arguments, function* globGenerator_1() { - // Fill in defaults options - const options = globOptionsHelper.getOptions(this.options); - // Implicit descendants? - const patterns = []; - for (const pattern of this.patterns) { - patterns.push(pattern); - if (options.implicitDescendants && - (pattern.trailingSeparator || - pattern.segments[pattern.segments.length - 1] !== '**')) { - patterns.push(new internal_pattern_1.Pattern(pattern.negate, true, pattern.segments.concat('**'))); - } - } - // Push the search paths - const stack = []; - for (const searchPath of patternHelper.getSearchPaths(patterns)) { - core.debug(`Search path '${searchPath}'`); - // Exists? - try { - // Intentionally using lstat. Detection for broken symlink - // will be performed later (if following symlinks). - yield __await(fs.promises.lstat(searchPath)); - } - catch (err) { - if (err.code === 'ENOENT') { - continue; - } - throw err; - } - stack.unshift(new internal_search_state_1.SearchState(searchPath, 1)); - } - // Search - const traversalChain = []; // used to detect cycles - while (stack.length) { - // Pop - const item = stack.pop(); - // Match? - const match = patternHelper.match(patterns, item.path); - const partialMatch = !!match || patternHelper.partialMatch(patterns, item.path); - if (!match && !partialMatch) { - continue; - } - // Stat - const stats = yield __await(DefaultGlobber.stat(item, options, traversalChain) - // Broken symlink, or symlink cycle detected, or no longer exists - ); - // Broken symlink, or symlink cycle detected, or no longer exists - if (!stats) { - continue; - } - // Directory - if (stats.isDirectory()) { - // Matched - if (match & internal_match_kind_1.MatchKind.Directory) { - yield yield __await(item.path); - } - // Descend? - else if (!partialMatch) { - continue; - } - // Push the child items in reverse - const childLevel = item.level + 1; - const childItems = (yield __await(fs.promises.readdir(item.path))).map(x => new internal_search_state_1.SearchState(path.join(item.path, x), childLevel)); - stack.push(...childItems.reverse()); - } - // File - else if (match & internal_match_kind_1.MatchKind.File) { - yield yield __await(item.path); - } - } - }); + else { + command_1.issueCommand('add-path', {}, inputPath); } - /** - * Constructs a DefaultGlobber - */ - static create(patterns, options) { - return __awaiter(this, void 0, void 0, function* () { - const result = new DefaultGlobber(options); - if (IS_WINDOWS) { - patterns = patterns.replace(/\r\n/g, '\n'); - patterns = patterns.replace(/\r/g, '\n'); - } - const lines = patterns.split('\n').map(x => x.trim()); - for (const line of lines) { - // Empty or comment - if (!line || line.startsWith('#')) { - continue; - } - // Pattern - else { - result.patterns.push(new internal_pattern_1.Pattern(line)); - } - } - result.searchPaths.push(...patternHelper.getSearchPaths(result.patterns)); - return result; - }); + process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`; +} +exports.addPath = addPath; +/** + * Gets the value of an input. + * Unless trimWhitespace is set to false in InputOptions, the value is also trimmed. + * Returns an empty string if the value is not defined. + * + * @param name name of the input to get + * @param options optional. See InputOptions. + * @returns string + */ +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}`); } - static stat(item, options, traversalChain) { - return __awaiter(this, void 0, void 0, function* () { - // Note: - // `stat` returns info about the target of a symlink (or symlink chain) - // `lstat` returns info about a symlink itself - let stats; - if (options.followSymbolicLinks) { - try { - // Use `stat` (following symlinks) - stats = yield fs.promises.stat(item.path); - } - catch (err) { - if (err.code === 'ENOENT') { - if (options.omitBrokenSymbolicLinks) { - core.debug(`Broken symlink '${item.path}'`); - return undefined; - } - throw new Error(`No information found for the path '${item.path}'. This may indicate a broken symbolic link.`); - } - throw err; - } - } - else { - // Use `lstat` (not following symlinks) - stats = yield fs.promises.lstat(item.path); - } - // Note, isDirectory() returns false for the lstat of a symlink - if (stats.isDirectory() && options.followSymbolicLinks) { - // Get the realpath - const realPath = yield fs.promises.realpath(item.path); - // Fixup the traversal chain to match the item level - while (traversalChain.length >= item.level) { - traversalChain.pop(); - } - // Test for a cycle - if (traversalChain.some((x) => x === realPath)) { - core.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`); - return undefined; - } - // Update the traversal chain - traversalChain.push(realPath); - } - return stats; - }); + if (options && options.trimWhitespace === false) { + return val; } + return val.trim(); } -exports.DefaultGlobber = DefaultGlobber; -//# sourceMappingURL=internal-globber.js.map - -/***/ }), - -/***/ 1063: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.MatchKind = void 0; +exports.getInput = getInput; /** - * Indicates whether a pattern matches a path + * Gets the values of an multiline input. Each value is also trimmed. + * + * @param name name of the input to get + * @param options optional. See InputOptions. + * @returns string[] + * */ -var MatchKind; -(function (MatchKind) { - /** Not matched */ - MatchKind[MatchKind["None"] = 0] = "None"; - /** Matched if the path is a directory */ - MatchKind[MatchKind["Directory"] = 1] = "Directory"; - /** Matched if the path is a regular file */ - MatchKind[MatchKind["File"] = 2] = "File"; - /** Matched */ - MatchKind[MatchKind["All"] = 3] = "All"; -})(MatchKind = exports.MatchKind || (exports.MatchKind = {})); -//# sourceMappingURL=internal-match-kind.js.map +function getMultilineInput(name, options) { + const inputs = getInput(name, options) + .split('\n') + .filter(x => x !== ''); + return inputs; +} +exports.getMultilineInput = getMultilineInput; +/** + * Gets the input value of the boolean type in the YAML 1.2 "core schema" specification. + * Support boolean input list: `true | True | TRUE | false | False | FALSE` . + * The return value is also in boolean type. + * ref: https://yaml.org/spec/1.2/spec.html#id2804923 + * + * @param name name of the input to get + * @param options optional. See InputOptions. + * @returns boolean + */ +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}\n` + + `Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); +} +exports.getBooleanInput = getBooleanInput; +/** + * Sets the value of an output. + * + * @param name name of the output to set + * @param value value to store. Non-string values will be converted to a string via JSON.stringify + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function setOutput(name, value) { + process.stdout.write(os.EOL); + command_1.issueCommand('set-output', { name }, value); +} +exports.setOutput = setOutput; +/** + * Enables or disables the echoing of commands into stdout for the rest of the step. + * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set. + * + */ +function setCommandEcho(enabled) { + command_1.issue('echo', enabled ? 'on' : 'off'); +} +exports.setCommandEcho = setCommandEcho; +//----------------------------------------------------------------------- +// Results +//----------------------------------------------------------------------- +/** + * Sets the action status to failed. + * When the action exits it will be with an exit code of 1 + * @param message add error issue message + */ +function setFailed(message) { + process.exitCode = ExitCode.Failure; + error(message); +} +exports.setFailed = setFailed; +//----------------------------------------------------------------------- +// Logging Commands +//----------------------------------------------------------------------- +/** + * Gets whether Actions Step Debug is on or not + */ +function isDebug() { + return process.env['RUNNER_DEBUG'] === '1'; +} +exports.isDebug = isDebug; +/** + * Writes debug message to user log + * @param message debug message + */ +function debug(message) { + command_1.issueCommand('debug', {}, message); +} +exports.debug = debug; +/** + * Adds an error issue + * @param message error issue message. Errors will be converted to string via toString() + */ +function error(message) { + command_1.issue('error', message instanceof Error ? message.toString() : message); +} +exports.error = error; +/** + * Adds an warning issue + * @param message warning issue message. Errors will be converted to string via toString() + */ +function warning(message) { + command_1.issue('warning', message instanceof Error ? message.toString() : message); +} +exports.warning = warning; +/** + * Writes info to log with console.log. + * @param message info message + */ +function info(message) { + process.stdout.write(message + os.EOL); +} +exports.info = info; +/** + * Begin an output group. + * + * Output until the next `groupEnd` will be foldable in this group + * + * @param name The name of the output group + */ +function startGroup(name) { + command_1.issue('group', name); +} +exports.startGroup = startGroup; +/** + * End an output group. + */ +function endGroup() { + command_1.issue('endgroup'); +} +exports.endGroup = endGroup; +/** + * Wrap an asynchronous function call in a group. + * + * Returns the same type as the function itself. + * + * @param name The name of the group + * @param fn The function to wrap in the group + */ +function group(name, fn) { + return __awaiter(this, void 0, void 0, function* () { + startGroup(name); + let result; + try { + result = yield fn(); + } + finally { + endGroup(); + } + return result; + }); +} +exports.group = group; +//----------------------------------------------------------------------- +// Wrapper action state +//----------------------------------------------------------------------- +/** + * Saves state for current action, the state can only be retrieved by this action's post job execution. + * + * @param name name of the state to store + * @param value value to store. Non-string values will be converted to a string via JSON.stringify + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function saveState(name, value) { + command_1.issueCommand('save-state', { name }, value); +} +exports.saveState = saveState; +/** + * Gets the value of an state set by this action's main execution. + * + * @param name name of the state to get + * @returns string + */ +function getState(name) { + return process.env[`STATE_${name}`] || ''; +} +exports.getState = getState; +//# sourceMappingURL=core.js.map /***/ }), -/***/ 1849: +/***/ 717: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; +// For internal use, subject to change. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); @@ -2696,188 +2684,58 @@ var __importStar = (this && this.__importStar) || function (mod) { __setModuleDefault(result, mod); return result; }; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.safeTrimTrailingSeparator = exports.normalizeSeparators = exports.hasRoot = exports.hasAbsoluteRoot = exports.ensureAbsoluteRoot = exports.dirname = void 0; -const path = __importStar(__nccwpck_require__(5622)); -const assert_1 = __importDefault(__nccwpck_require__(2357)); -const IS_WINDOWS = process.platform === 'win32'; -/** - * Similar to path.dirname except normalizes the path separators and slightly better handling for Windows UNC paths. - * - * For example, on Linux/macOS: - * - `/ => /` - * - `/hello => /` - * - * For example, on Windows: - * - `C:\ => C:\` - * - `C:\hello => C:\` - * - `C: => C:` - * - `C:hello => C:` - * - `\ => \` - * - `\hello => \` - * - `\\hello => \\hello` - * - `\\hello\world => \\hello\world` - */ -function dirname(p) { - // Normalize slashes and trim unnecessary trailing slash - p = safeTrimTrailingSeparator(p); - // Windows UNC root, e.g. \\hello or \\hello\world - if (IS_WINDOWS && /^\\\\[^\\]+(\\[^\\]+)?$/.test(p)) { - return p; - } - // Get dirname - let result = path.dirname(p); - // Trim trailing slash for Windows UNC root, e.g. \\hello\world\ - if (IS_WINDOWS && /^\\\\[^\\]+\\[^\\]+\\$/.test(result)) { - result = safeTrimTrailingSeparator(result); - } - return result; -} -exports.dirname = dirname; -/** - * Roots the path if not already rooted. On Windows, relative roots like `\` - * or `C:` are expanded based on the current working directory. - */ -function ensureAbsoluteRoot(root, itemPath) { - assert_1.default(root, `ensureAbsoluteRoot parameter 'root' must not be empty`); - assert_1.default(itemPath, `ensureAbsoluteRoot parameter 'itemPath' must not be empty`); - // Already rooted - if (hasAbsoluteRoot(itemPath)) { - return itemPath; - } - // Windows - if (IS_WINDOWS) { - // Check for itemPath like C: or C:foo - if (itemPath.match(/^[A-Z]:[^\\/]|^[A-Z]:$/i)) { - let cwd = process.cwd(); - assert_1.default(cwd.match(/^[A-Z]:\\/i), `Expected current directory to start with an absolute drive root. Actual '${cwd}'`); - // Drive letter matches cwd? Expand to cwd - if (itemPath[0].toUpperCase() === cwd[0].toUpperCase()) { - // Drive only, e.g. C: - if (itemPath.length === 2) { - // Preserve specified drive letter case (upper or lower) - return `${itemPath[0]}:\\${cwd.substr(3)}`; - } - // Drive + path, e.g. C:foo - else { - if (!cwd.endsWith('\\')) { - cwd += '\\'; - } - // Preserve specified drive letter case (upper or lower) - return `${itemPath[0]}:\\${cwd.substr(3)}${itemPath.substr(2)}`; - } - } - // Different drive - else { - return `${itemPath[0]}:\\${itemPath.substr(2)}`; - } - } - // Check for itemPath like \ or \foo - else if (normalizeSeparators(itemPath).match(/^\\$|^\\[^\\]/)) { - const cwd = process.cwd(); - assert_1.default(cwd.match(/^[A-Z]:\\/i), `Expected current directory to start with an absolute drive root. Actual '${cwd}'`); - return `${cwd[0]}:\\${itemPath.substr(1)}`; - } - } - assert_1.default(hasAbsoluteRoot(root), `ensureAbsoluteRoot parameter 'root' must have an absolute root`); - // Otherwise ensure root ends with a separator - if (root.endsWith('/') || (IS_WINDOWS && root.endsWith('\\'))) { - // Intentionally empty - } - else { - // Append separator - root += path.sep; - } - return root + itemPath; -} -exports.ensureAbsoluteRoot = ensureAbsoluteRoot; -/** - * On Linux/macOS, true if path starts with `/`. On Windows, true for paths like: - * `\\hello\share` and `C:\hello` (and using alternate separator). - */ -function hasAbsoluteRoot(itemPath) { - assert_1.default(itemPath, `hasAbsoluteRoot parameter 'itemPath' must not be empty`); - // Normalize separators - itemPath = normalizeSeparators(itemPath); - // Windows - if (IS_WINDOWS) { - // E.g. \\hello\share or C:\hello - return itemPath.startsWith('\\\\') || /^[A-Z]:\\/i.test(itemPath); - } - // E.g. /hello - return itemPath.startsWith('/'); -} -exports.hasAbsoluteRoot = hasAbsoluteRoot; -/** - * On Linux/macOS, true if path starts with `/`. On Windows, true for paths like: - * `\`, `\hello`, `\\hello\share`, `C:`, and `C:\hello` (and using alternate separator). - */ -function hasRoot(itemPath) { - assert_1.default(itemPath, `isRooted parameter 'itemPath' must not be empty`); - // Normalize separators - itemPath = normalizeSeparators(itemPath); - // Windows - if (IS_WINDOWS) { - // E.g. \ or \hello or \\hello - // E.g. C: or C:\hello - return itemPath.startsWith('\\') || /^[A-Z]:/i.test(itemPath); +exports.issueCommand = void 0; +// We use any as a valid input type +/* eslint-disable @typescript-eslint/no-explicit-any */ +const fs = __importStar(__nccwpck_require__(5747)); +const os = __importStar(__nccwpck_require__(2087)); +const utils_1 = __nccwpck_require__(5278); +function issueCommand(command, message) { + const filePath = process.env[`GITHUB_${command}`]; + if (!filePath) { + throw new Error(`Unable to find environment variable for file command ${command}`); } - // E.g. /hello - return itemPath.startsWith('/'); -} -exports.hasRoot = hasRoot; -/** - * Removes redundant slashes and converts `/` to `\` on Windows - */ -function normalizeSeparators(p) { - p = p || ''; - // Windows - if (IS_WINDOWS) { - // Convert slashes on Windows - p = p.replace(/\//g, '\\'); - // Remove redundant slashes - const isUnc = /^\\\\+[^\\]/.test(p); // e.g. \\hello - return (isUnc ? '\\' : '') + p.replace(/\\\\+/g, '\\'); // preserve leading \\ for UNC + if (!fs.existsSync(filePath)) { + throw new Error(`Missing file at path: ${filePath}`); } - // Remove redundant slashes - return p.replace(/\/\/+/g, '/'); + fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, { + encoding: 'utf8' + }); } -exports.normalizeSeparators = normalizeSeparators; +exports.issueCommand = issueCommand; +//# sourceMappingURL=file-command.js.map + +/***/ }), + +/***/ 5278: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +// We use any as a valid input type +/* eslint-disable @typescript-eslint/no-explicit-any */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.toCommandValue = void 0; /** - * Normalizes the path separators and trims the trailing separator (when safe). - * For example, `/foo/ => /foo` but `/ => /` + * Sanitizes an input into a string so it can be passed into issueCommand safely + * @param input input to sanitize into a string */ -function safeTrimTrailingSeparator(p) { - // Short-circuit if empty - if (!p) { +function toCommandValue(input) { + if (input === null || input === undefined) { return ''; } - // Normalize separators - p = normalizeSeparators(p); - // No trailing slash - if (!p.endsWith(path.sep)) { - return p; - } - // Check '/' on Linux/macOS and '\' on Windows - if (p === path.sep) { - return p; - } - // On Windows check if drive root. E.g. C:\ - if (IS_WINDOWS && /^[A-Z]:\\$/i.test(p)) { - return p; + else if (typeof input === 'string' || input instanceof String) { + return input; } - // Otherwise trim trailing slash - return p.substr(0, p.length - 1); + return JSON.stringify(input); } -exports.safeTrimTrailingSeparator = safeTrimTrailingSeparator; -//# sourceMappingURL=internal-path-helper.js.map +exports.toCommandValue = toCommandValue; +//# sourceMappingURL=utils.js.map /***/ }), -/***/ 6836: +/***/ 1514: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -2901,204 +2759,93 @@ var __importStar = (this && this.__importStar) || function (mod) { __setModuleDefault(result, mod); return result; }; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Path = void 0; -const path = __importStar(__nccwpck_require__(5622)); -const pathHelper = __importStar(__nccwpck_require__(1849)); -const assert_1 = __importDefault(__nccwpck_require__(2357)); -const IS_WINDOWS = process.platform === 'win32'; -/** - * Helper class for parsing paths into segments - */ -class Path { - /** - * Constructs a Path - * @param itemPath Path or array of segments - */ - constructor(itemPath) { - this.segments = []; - // String - if (typeof itemPath === 'string') { - assert_1.default(itemPath, `Parameter 'itemPath' must not be empty`); - // Normalize slashes and trim unnecessary trailing slash - itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); - // Not rooted - if (!pathHelper.hasRoot(itemPath)) { - this.segments = itemPath.split(path.sep); - } - // Rooted - else { - // Add all segments, while not at the root - let remaining = itemPath; - let dir = pathHelper.dirname(remaining); - while (dir !== remaining) { - // Add the segment - const basename = path.basename(remaining); - this.segments.unshift(basename); - // Truncate the last segment - remaining = dir; - dir = pathHelper.dirname(remaining); - } - // Remainder is the root - this.segments.unshift(remaining); - } - } - // Array - else { - // Must not be empty - assert_1.default(itemPath.length > 0, `Parameter 'itemPath' must not be an empty array`); - // Each segment - for (let i = 0; i < itemPath.length; i++) { - let segment = itemPath[i]; - // Must not be empty - assert_1.default(segment, `Parameter 'itemPath' must not contain any empty segments`); - // Normalize slashes - segment = pathHelper.normalizeSeparators(itemPath[i]); - // Root segment - if (i === 0 && pathHelper.hasRoot(segment)) { - segment = pathHelper.safeTrimTrailingSeparator(segment); - assert_1.default(segment === pathHelper.dirname(segment), `Parameter 'itemPath' root segment contains information for multiple segments`); - this.segments.push(segment); - } - // All other segments - else { - // Must not contain slash - assert_1.default(!segment.includes(path.sep), `Parameter 'itemPath' contains unexpected path separators`); - this.segments.push(segment); - } - } - } - } - /** - * Converts the path to it's string representation - */ - toString() { - // First segment - let result = this.segments[0]; - // All others - let skipSlash = result.endsWith(path.sep) || (IS_WINDOWS && /^[A-Z]:$/i.test(result)); - for (let i = 1; i < this.segments.length; i++) { - if (skipSlash) { - skipSlash = false; - } - else { - result += path.sep; - } - result += this.segments[i]; - } - return result; - } -} -exports.Path = Path; -//# sourceMappingURL=internal-path.js.map - -/***/ }), - -/***/ 9005: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__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)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.partialMatch = exports.match = exports.getSearchPaths = void 0; -const pathHelper = __importStar(__nccwpck_require__(1849)); -const internal_match_kind_1 = __nccwpck_require__(1063); -const IS_WINDOWS = process.platform === 'win32'; -/** - * Given an array of patterns, returns an array of paths to search. - * Duplicates and paths under other included paths are filtered out. - */ -function getSearchPaths(patterns) { - // Ignore negate patterns - patterns = patterns.filter(x => !x.negate); - // Create a map of all search paths - const searchPathMap = {}; - for (const pattern of patterns) { - const key = IS_WINDOWS - ? pattern.searchPath.toUpperCase() - : pattern.searchPath; - searchPathMap[key] = 'candidate'; - } - const result = []; - for (const pattern of patterns) { - // Check if already included - const key = IS_WINDOWS - ? pattern.searchPath.toUpperCase() - : pattern.searchPath; - if (searchPathMap[key] === 'included') { - continue; - } - // Check for an ancestor search path - let foundAncestor = false; - let tempKey = key; - let parent = pathHelper.dirname(tempKey); - while (parent !== tempKey) { - if (searchPathMap[parent]) { - foundAncestor = true; - break; - } - tempKey = parent; - parent = pathHelper.dirname(tempKey); - } - // Include the search pattern in the result - if (!foundAncestor) { - result.push(pattern.searchPath); - searchPathMap[key] = 'included'; - } - } - return result; -} -exports.getSearchPaths = getSearchPaths; +exports.getExecOutput = exports.exec = void 0; +const string_decoder_1 = __nccwpck_require__(4304); +const tr = __importStar(__nccwpck_require__(8159)); /** - * Matches the patterns against the path + * Exec a command. + * Output will be streamed to the live console. + * Returns promise with return code + * + * @param commandLine command to execute (can include additional args). Must be correctly escaped. + * @param args optional arguments for tool. Escaping is handled by the lib. + * @param options optional exec options. See ExecOptions + * @returns Promise exit code */ -function match(patterns, itemPath) { - let result = internal_match_kind_1.MatchKind.None; - for (const pattern of patterns) { - if (pattern.negate) { - result &= ~pattern.match(itemPath); - } - else { - result |= pattern.match(itemPath); +function exec(commandLine, args, options) { + return __awaiter(this, void 0, void 0, function* () { + const commandArgs = tr.argStringToArray(commandLine); + if (commandArgs.length === 0) { + throw new Error(`Parameter 'commandLine' cannot be null or empty.`); } - } - return result; + // Path to tool to execute should be first arg + const toolPath = commandArgs[0]; + args = commandArgs.slice(1).concat(args || []); + const runner = new tr.ToolRunner(toolPath, args, options); + return runner.exec(); + }); } -exports.match = match; +exports.exec = exec; /** - * Checks whether to descend further into the directory + * Exec a command and get the output. + * Output will be streamed to the live console. + * Returns promise with the exit code and collected stdout and stderr + * + * @param commandLine command to execute (can include additional args). Must be correctly escaped. + * @param args optional arguments for tool. Escaping is handled by the lib. + * @param options optional exec options. See ExecOptions + * @returns Promise exit code, stdout, and stderr */ -function partialMatch(patterns, itemPath) { - return patterns.some(x => !x.negate && x.partialMatch(itemPath)); +function getExecOutput(commandLine, args, options) { + var _a, _b; + return __awaiter(this, void 0, void 0, function* () { + let stdout = ''; + let stderr = ''; + //Using string decoder covers the case where a mult-byte character is split + const stdoutDecoder = new string_decoder_1.StringDecoder('utf8'); + const stderrDecoder = new string_decoder_1.StringDecoder('utf8'); + const originalStdoutListener = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.stdout; + const originalStdErrListener = (_b = options === null || options === void 0 ? void 0 : options.listeners) === null || _b === void 0 ? void 0 : _b.stderr; + const stdErrListener = (data) => { + stderr += stderrDecoder.write(data); + if (originalStdErrListener) { + originalStdErrListener(data); + } + }; + const stdOutListener = (data) => { + stdout += stdoutDecoder.write(data); + if (originalStdoutListener) { + originalStdoutListener(data); + } + }; + const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener }); + const exitCode = yield exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); + //flush any remaining characters + stdout += stdoutDecoder.end(); + stderr += stderrDecoder.end(); + return { + exitCode, + stdout, + stderr + }; + }); } -exports.partialMatch = partialMatch; -//# sourceMappingURL=internal-pattern-helper.js.map +exports.getExecOutput = getExecOutput; +//# sourceMappingURL=exec.js.map /***/ }), -/***/ 4536: +/***/ 8159: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -3122,943 +2869,986 @@ var __importStar = (this && this.__importStar) || function (mod) { __setModuleDefault(result, mod); return result; }; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Pattern = void 0; +exports.argStringToArray = exports.ToolRunner = void 0; const os = __importStar(__nccwpck_require__(2087)); +const events = __importStar(__nccwpck_require__(8614)); +const child = __importStar(__nccwpck_require__(3129)); const path = __importStar(__nccwpck_require__(5622)); -const pathHelper = __importStar(__nccwpck_require__(1849)); -const assert_1 = __importDefault(__nccwpck_require__(2357)); -const minimatch_1 = __nccwpck_require__(3973); -const internal_match_kind_1 = __nccwpck_require__(1063); -const internal_path_1 = __nccwpck_require__(6836); +const io = __importStar(__nccwpck_require__(7436)); +const ioUtil = __importStar(__nccwpck_require__(1962)); +const timers_1 = __nccwpck_require__(8213); +/* eslint-disable @typescript-eslint/unbound-method */ const IS_WINDOWS = process.platform === 'win32'; -class Pattern { - constructor(patternOrNegate, isImplicitPattern = false, segments, homedir) { - /** - * Indicates whether matches should be excluded from the result set - */ - this.negate = false; - // Pattern overload - let pattern; - if (typeof patternOrNegate === 'string') { - pattern = patternOrNegate.trim(); +/* + * Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way. + */ +class ToolRunner extends events.EventEmitter { + constructor(toolPath, args, options) { + super(); + if (!toolPath) { + throw new Error("Parameter 'toolPath' cannot be null or empty."); } - // Segments overload - else { - // Convert to pattern - segments = segments || []; - assert_1.default(segments.length, `Parameter 'segments' must not empty`); - const root = Pattern.getLiteral(segments[0]); - assert_1.default(root && pathHelper.hasAbsoluteRoot(root), `Parameter 'segments' first element must be a root path`); - pattern = new internal_path_1.Path(segments).toString().trim(); - if (patternOrNegate) { - pattern = `!${pattern}`; + this.toolPath = toolPath; + this.args = args || []; + this.options = options || {}; + } + _debug(message) { + if (this.options.listeners && this.options.listeners.debug) { + this.options.listeners.debug(message); + } + } + _getCommandString(options, noPrefix) { + const toolPath = this._getSpawnFileName(); + const args = this._getSpawnArgs(options); + let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool + if (IS_WINDOWS) { + // Windows + cmd file + if (this._isCmdFile()) { + cmd += toolPath; + for (const a of args) { + cmd += ` ${a}`; + } + } + // Windows + verbatim + else if (options.windowsVerbatimArguments) { + cmd += `"${toolPath}"`; + for (const a of args) { + cmd += ` ${a}`; + } + } + // Windows (regular) + else { + cmd += this._windowsQuoteCmdArg(toolPath); + for (const a of args) { + cmd += ` ${this._windowsQuoteCmdArg(a)}`; + } } } - // Negate - while (pattern.startsWith('!')) { - this.negate = !this.negate; - pattern = pattern.substr(1).trim(); + else { + // OSX/Linux - this can likely be improved with some form of quoting. + // creating processes on Unix is fundamentally different than Windows. + // on Unix, execvp() takes an arg array. + cmd += toolPath; + for (const a of args) { + cmd += ` ${a}`; + } } - // Normalize slashes and ensures absolute root - pattern = Pattern.fixupPattern(pattern, homedir); - // Segments - this.segments = new internal_path_1.Path(pattern).segments; - // Trailing slash indicates the pattern should only match directories, not regular files - this.trailingSeparator = pathHelper - .normalizeSeparators(pattern) - .endsWith(path.sep); - pattern = pathHelper.safeTrimTrailingSeparator(pattern); - // Search path (literal path prior to the first glob segment) - let foundGlob = false; - const searchSegments = this.segments - .map(x => Pattern.getLiteral(x)) - .filter(x => !foundGlob && !(foundGlob = x === '')); - this.searchPath = new internal_path_1.Path(searchSegments).toString(); - // Root RegExp (required when determining partial match) - this.rootRegExp = new RegExp(Pattern.regExpEscape(searchSegments[0]), IS_WINDOWS ? 'i' : ''); - this.isImplicitPattern = isImplicitPattern; - // Create minimatch - const minimatchOptions = { - dot: true, - nobrace: true, - nocase: IS_WINDOWS, - nocomment: true, - noext: true, - nonegate: true - }; - pattern = IS_WINDOWS ? pattern.replace(/\\/g, '/') : pattern; - this.minimatch = new minimatch_1.Minimatch(pattern, minimatchOptions); + return cmd; } - /** - * Matches the pattern against the specified path - */ - match(itemPath) { - // Last segment is globstar? - if (this.segments[this.segments.length - 1] === '**') { - // Normalize slashes - itemPath = pathHelper.normalizeSeparators(itemPath); - // Append a trailing slash. Otherwise Minimatch will not match the directory immediately - // preceding the globstar. For example, given the pattern `/foo/**`, Minimatch returns - // false for `/foo` but returns true for `/foo/`. Append a trailing slash to handle that quirk. - if (!itemPath.endsWith(path.sep) && this.isImplicitPattern === false) { - // Note, this is safe because the constructor ensures the pattern has an absolute root. - // For example, formats like C: and C:foo on Windows are resolved to an absolute root. - itemPath = `${itemPath}${path.sep}`; + _processLineBuffer(data, strBuffer, onLine) { + try { + let s = strBuffer + data.toString(); + let n = s.indexOf(os.EOL); + while (n > -1) { + const line = s.substring(0, n); + onLine(line); + // the rest of the string ... + s = s.substring(n + os.EOL.length); + n = s.indexOf(os.EOL); } + return s; } - else { - // Normalize slashes and trim unnecessary trailing slash - itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); + catch (err) { + // streaming lines to console is best effort. Don't fail a build. + this._debug(`error processing line. Failed with error ${err}`); + return ''; } - // Match - if (this.minimatch.match(itemPath)) { - return this.trailingSeparator ? internal_match_kind_1.MatchKind.Directory : internal_match_kind_1.MatchKind.All; + } + _getSpawnFileName() { + if (IS_WINDOWS) { + if (this._isCmdFile()) { + return process.env['COMSPEC'] || 'cmd.exe'; + } } - return internal_match_kind_1.MatchKind.None; + return this.toolPath; } - /** - * Indicates whether the pattern may match descendants of the specified path - */ - partialMatch(itemPath) { - // Normalize slashes and trim unnecessary trailing slash - itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); - // matchOne does not handle root path correctly - if (pathHelper.dirname(itemPath) === itemPath) { - return this.rootRegExp.test(itemPath); + _getSpawnArgs(options) { + if (IS_WINDOWS) { + if (this._isCmdFile()) { + let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`; + for (const a of this.args) { + argline += ' '; + argline += options.windowsVerbatimArguments + ? a + : this._windowsQuoteCmdArg(a); + } + argline += '"'; + return [argline]; + } } - return this.minimatch.matchOne(itemPath.split(IS_WINDOWS ? /\\+/ : /\/+/), this.minimatch.set[0], true); + return this.args; } - /** - * Escapes glob patterns within a path - */ - static globEscape(s) { - return (IS_WINDOWS ? s : s.replace(/\\/g, '\\\\')) // escape '\' on Linux/macOS - .replace(/(\[)(?=[^/]+\])/g, '[[]') // escape '[' when ']' follows within the path segment - .replace(/\?/g, '[?]') // escape '?' - .replace(/\*/g, '[*]'); // escape '*' + _endsWith(str, end) { + return str.endsWith(end); } - /** - * Normalizes slashes and ensures absolute root - */ - static fixupPattern(pattern, homedir) { - // Empty - assert_1.default(pattern, 'pattern cannot be empty'); - // Must not contain `.` segment, unless first segment - // Must not contain `..` segment - const literalSegments = new internal_path_1.Path(pattern).segments.map(x => Pattern.getLiteral(x)); - assert_1.default(literalSegments.every((x, i) => (x !== '.' || i === 0) && x !== '..'), `Invalid pattern '${pattern}'. Relative pathing '.' and '..' is not allowed.`); - // Must not contain globs in root, e.g. Windows UNC path \\foo\b*r - assert_1.default(!pathHelper.hasRoot(pattern) || literalSegments[0], `Invalid pattern '${pattern}'. Root segment must not contain globs.`); - // Normalize slashes - pattern = pathHelper.normalizeSeparators(pattern); - // Replace leading `.` segment - if (pattern === '.' || pattern.startsWith(`.${path.sep}`)) { - pattern = Pattern.globEscape(process.cwd()) + pattern.substr(1); + _isCmdFile() { + const upperToolPath = this.toolPath.toUpperCase(); + return (this._endsWith(upperToolPath, '.CMD') || + this._endsWith(upperToolPath, '.BAT')); + } + _windowsQuoteCmdArg(arg) { + // for .exe, apply the normal quoting rules that libuv applies + if (!this._isCmdFile()) { + return this._uvQuoteCmdArg(arg); } - // Replace leading `~` segment - else if (pattern === '~' || pattern.startsWith(`~${path.sep}`)) { - homedir = homedir || os.homedir(); - assert_1.default(homedir, 'Unable to determine HOME directory'); - assert_1.default(pathHelper.hasAbsoluteRoot(homedir), `Expected HOME directory to be a rooted path. Actual '${homedir}'`); - pattern = Pattern.globEscape(homedir) + pattern.substr(1); + // otherwise apply quoting rules specific to the cmd.exe command line parser. + // the libuv rules are generic and are not designed specifically for cmd.exe + // command line parser. + // + // for a detailed description of the cmd.exe command line parser, refer to + // http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912 + // need quotes for empty arg + if (!arg) { + return '""'; } - // Replace relative drive root, e.g. pattern is C: or C:foo - else if (IS_WINDOWS && - (pattern.match(/^[A-Z]:$/i) || pattern.match(/^[A-Z]:[^\\]/i))) { - let root = pathHelper.ensureAbsoluteRoot('C:\\dummy-root', pattern.substr(0, 2)); - if (pattern.length > 2 && !root.endsWith('\\')) { - root += '\\'; + // determine whether the arg needs to be quoted + const cmdSpecialChars = [ + ' ', + '\t', + '&', + '(', + ')', + '[', + ']', + '{', + '}', + '^', + '=', + ';', + '!', + "'", + '+', + ',', + '`', + '~', + '|', + '<', + '>', + '"' + ]; + let needsQuotes = false; + for (const char of arg) { + if (cmdSpecialChars.some(x => x === char)) { + needsQuotes = true; + break; } - pattern = Pattern.globEscape(root) + pattern.substr(2); } - // Replace relative root, e.g. pattern is \ or \foo - else if (IS_WINDOWS && (pattern === '\\' || pattern.match(/^\\[^\\]/))) { - let root = pathHelper.ensureAbsoluteRoot('C:\\dummy-root', '\\'); - if (!root.endsWith('\\')) { - root += '\\'; - } - pattern = Pattern.globEscape(root) + pattern.substr(1); + // short-circuit if quotes not needed + if (!needsQuotes) { + return arg; } - // Otherwise ensure absolute root - else { - pattern = pathHelper.ensureAbsoluteRoot(Pattern.globEscape(process.cwd()), pattern); + // the following quoting rules are very similar to the rules that by libuv applies. + // + // 1) wrap the string in quotes + // + // 2) double-up quotes - i.e. " => "" + // + // this is different from the libuv quoting rules. libuv replaces " with \", which unfortunately + // doesn't work well with a cmd.exe command line. + // + // note, replacing " with "" also works well if the arg is passed to a downstream .NET console app. + // for example, the command line: + // foo.exe "myarg:""my val""" + // is parsed by a .NET console app into an arg array: + // [ "myarg:\"my val\"" ] + // which is the same end result when applying libuv quoting rules. although the actual + // command line from libuv quoting rules would look like: + // foo.exe "myarg:\"my val\"" + // + // 3) double-up slashes that precede a quote, + // e.g. hello \world => "hello \world" + // hello\"world => "hello\\""world" + // hello\\"world => "hello\\\\""world" + // hello world\ => "hello world\\" + // + // technically this is not required for a cmd.exe command line, or the batch argument parser. + // the reasons for including this as a .cmd quoting rule are: + // + // a) this is optimized for the scenario where the argument is passed from the .cmd file to an + // external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule. + // + // b) it's what we've been doing previously (by deferring to node default behavior) and we + // haven't heard any complaints about that aspect. + // + // note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be + // escaped when used on the command line directly - even though within a .cmd file % can be escaped + // by using %%. + // + // the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts + // the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing. + // + // one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would + // often work, since it is unlikely that var^ would exist, and the ^ character is removed when the + // variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args + // to an external program. + // + // an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file. + // % can be escaped within a .cmd file. + let reverse = '"'; + let quoteHit = true; + for (let i = arg.length; i > 0; i--) { + // walk the string in reverse + reverse += arg[i - 1]; + if (quoteHit && arg[i - 1] === '\\') { + reverse += '\\'; // double the slash + } + else if (arg[i - 1] === '"') { + quoteHit = true; + reverse += '"'; // double the quote + } + else { + quoteHit = false; + } } - return pathHelper.normalizeSeparators(pattern); + reverse += '"'; + return reverse + .split('') + .reverse() + .join(''); + } + _uvQuoteCmdArg(arg) { + // Tool runner wraps child_process.spawn() and needs to apply the same quoting as + // Node in certain cases where the undocumented spawn option windowsVerbatimArguments + // is used. + // + // Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV, + // see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details), + // pasting copyright notice from Node within this function: + // + // Copyright Joyent, Inc. and other Node contributors. All rights reserved. + // + // Permission is hereby granted, free of charge, to any person obtaining a copy + // of this software and associated documentation files (the "Software"), to + // deal in the Software without restriction, including without limitation the + // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + // sell copies of the Software, and to permit persons to whom the Software is + // furnished to do so, subject to the following conditions: + // + // The above copyright notice and this permission notice shall be included in + // all copies or substantial portions of the Software. + // + // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + // IN THE SOFTWARE. + if (!arg) { + // Need double quotation for empty argument + return '""'; + } + if (!arg.includes(' ') && !arg.includes('\t') && !arg.includes('"')) { + // No quotation needed + return arg; + } + if (!arg.includes('"') && !arg.includes('\\')) { + // No embedded double quotes or backslashes, so I can just wrap + // quote marks around the whole thing. + return `"${arg}"`; + } + // Expected input/output: + // input : hello"world + // output: "hello\"world" + // input : hello""world + // output: "hello\"\"world" + // input : hello\world + // output: hello\world + // input : hello\\world + // output: hello\\world + // input : hello\"world + // output: "hello\\\"world" + // input : hello\\"world + // output: "hello\\\\\"world" + // input : hello world\ + // output: "hello world\\" - note the comment in libuv actually reads "hello world\" + // but it appears the comment is wrong, it should be "hello world\\" + let reverse = '"'; + let quoteHit = true; + for (let i = arg.length; i > 0; i--) { + // walk the string in reverse + reverse += arg[i - 1]; + if (quoteHit && arg[i - 1] === '\\') { + reverse += '\\'; + } + else if (arg[i - 1] === '"') { + quoteHit = true; + reverse += '\\'; + } + else { + quoteHit = false; + } + } + reverse += '"'; + return reverse + .split('') + .reverse() + .join(''); + } + _cloneExecOptions(options) { + options = options || {}; + const result = { + cwd: options.cwd || process.cwd(), + env: options.env || process.env, + silent: options.silent || false, + windowsVerbatimArguments: options.windowsVerbatimArguments || false, + failOnStdErr: options.failOnStdErr || false, + ignoreReturnCode: options.ignoreReturnCode || false, + delay: options.delay || 10000 + }; + result.outStream = options.outStream || process.stdout; + result.errStream = options.errStream || process.stderr; + return result; + } + _getSpawnOptions(options, toolPath) { + options = options || {}; + const result = {}; + result.cwd = options.cwd; + result.env = options.env; + result['windowsVerbatimArguments'] = + options.windowsVerbatimArguments || this._isCmdFile(); + if (options.windowsVerbatimArguments) { + result.argv0 = `"${toolPath}"`; + } + return result; } /** - * Attempts to unescape a pattern segment to create a literal path segment. - * Otherwise returns empty string. + * Exec a tool. + * Output will be streamed to the live console. + * Returns promise with return code + * + * @param tool path to tool to exec + * @param options optional exec options. See ExecOptions + * @returns number */ - static getLiteral(segment) { - let literal = ''; - for (let i = 0; i < segment.length; i++) { - const c = segment[i]; - // Escape - if (c === '\\' && !IS_WINDOWS && i + 1 < segment.length) { - literal += segment[++i]; - continue; - } - // Wildcard - else if (c === '*' || c === '?') { - return ''; + exec() { + return __awaiter(this, void 0, void 0, function* () { + // root the tool path if it is unrooted and contains relative pathing + if (!ioUtil.isRooted(this.toolPath) && + (this.toolPath.includes('/') || + (IS_WINDOWS && this.toolPath.includes('\\')))) { + // prefer options.cwd if it is specified, however options.cwd may also need to be rooted + this.toolPath = path.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); } - // Character set - else if (c === '[' && i + 1 < segment.length) { - let set = ''; - let closed = -1; - for (let i2 = i + 1; i2 < segment.length; i2++) { - const c2 = segment[i2]; - // Escape - if (c2 === '\\' && !IS_WINDOWS && i2 + 1 < segment.length) { - set += segment[++i2]; - continue; + // if the tool is only a file name, then resolve it from the PATH + // otherwise verify it exists (add extension on Windows if necessary) + this.toolPath = yield io.which(this.toolPath, true); + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + this._debug(`exec tool: ${this.toolPath}`); + this._debug('arguments:'); + for (const arg of this.args) { + this._debug(` ${arg}`); + } + const optionsNonNull = this._cloneExecOptions(this.options); + if (!optionsNonNull.silent && optionsNonNull.outStream) { + optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL); + } + const state = new ExecState(optionsNonNull, this.toolPath); + state.on('debug', (message) => { + this._debug(message); + }); + if (this.options.cwd && !(yield ioUtil.exists(this.options.cwd))) { + return reject(new Error(`The cwd: ${this.options.cwd} does not exist!`)); + } + const fileName = this._getSpawnFileName(); + const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName)); + let stdbuffer = ''; + if (cp.stdout) { + cp.stdout.on('data', (data) => { + if (this.options.listeners && this.options.listeners.stdout) { + this.options.listeners.stdout(data); + } + if (!optionsNonNull.silent && optionsNonNull.outStream) { + optionsNonNull.outStream.write(data); + } + stdbuffer = this._processLineBuffer(data, stdbuffer, (line) => { + if (this.options.listeners && this.options.listeners.stdline) { + this.options.listeners.stdline(line); + } + }); + }); + } + let errbuffer = ''; + if (cp.stderr) { + cp.stderr.on('data', (data) => { + state.processStderr = true; + if (this.options.listeners && this.options.listeners.stderr) { + this.options.listeners.stderr(data); + } + if (!optionsNonNull.silent && + optionsNonNull.errStream && + optionsNonNull.outStream) { + const s = optionsNonNull.failOnStdErr + ? optionsNonNull.errStream + : optionsNonNull.outStream; + s.write(data); + } + errbuffer = this._processLineBuffer(data, errbuffer, (line) => { + if (this.options.listeners && this.options.listeners.errline) { + this.options.listeners.errline(line); + } + }); + }); + } + cp.on('error', (err) => { + state.processError = err.message; + state.processExited = true; + state.processClosed = true; + state.CheckComplete(); + }); + cp.on('exit', (code) => { + state.processExitCode = code; + state.processExited = true; + this._debug(`Exit code ${code} received from tool '${this.toolPath}'`); + state.CheckComplete(); + }); + cp.on('close', (code) => { + state.processExitCode = code; + state.processExited = true; + state.processClosed = true; + this._debug(`STDIO streams have closed for tool '${this.toolPath}'`); + state.CheckComplete(); + }); + state.on('done', (error, exitCode) => { + if (stdbuffer.length > 0) { + this.emit('stdline', stdbuffer); } - // Closed - else if (c2 === ']') { - closed = i2; - break; + if (errbuffer.length > 0) { + this.emit('errline', errbuffer); } - // Otherwise - else { - set += c2; + cp.removeAllListeners(); + if (error) { + reject(error); } - } - // Closed? - if (closed >= 0) { - // Cannot convert - if (set.length > 1) { - return ''; + else { + resolve(exitCode); } - // Convert to literal - if (set) { - literal += set; - i = closed; - continue; + }); + if (this.options.input) { + if (!cp.stdin) { + throw new Error('child process missing stdin'); } + cp.stdin.end(this.options.input); } - // Otherwise fall thru + })); + }); + } +} +exports.ToolRunner = ToolRunner; +/** + * Convert an arg string to an array of args. Handles escaping + * + * @param argString string of arguments + * @returns string[] array of arguments + */ +function argStringToArray(argString) { + const args = []; + let inQuotes = false; + let escaped = false; + let arg = ''; + function append(c) { + // we only escape double quotes. + if (escaped && c !== '"') { + arg += '\\'; + } + arg += c; + escaped = false; + } + for (let i = 0; i < argString.length; i++) { + const c = argString.charAt(i); + if (c === '"') { + if (!escaped) { + inQuotes = !inQuotes; } - // Append - literal += c; + else { + append(c); + } + continue; } - return literal; + if (c === '\\' && escaped) { + append(c); + continue; + } + if (c === '\\' && inQuotes) { + escaped = true; + continue; + } + if (c === ' ' && !inQuotes) { + if (arg.length > 0) { + args.push(arg); + arg = ''; + } + continue; + } + append(c); } - /** - * Escapes regexp special characters - * https://javascript.info/regexp-escaping - */ - static regExpEscape(s) { - return s.replace(/[[\\^$.|?*+()]/g, '\\$&'); + if (arg.length > 0) { + args.push(arg.trim()); } + return args; } -exports.Pattern = Pattern; -//# sourceMappingURL=internal-pattern.js.map +exports.argStringToArray = argStringToArray; +class ExecState extends events.EventEmitter { + constructor(options, toolPath) { + super(); + this.processClosed = false; // tracks whether the process has exited and stdio is closed + this.processError = ''; + this.processExitCode = 0; + this.processExited = false; // tracks whether the process has exited + this.processStderr = false; // tracks whether stderr was written to + this.delay = 10000; // 10 seconds + this.done = false; + this.timeout = null; + if (!toolPath) { + throw new Error('toolPath must not be empty'); + } + this.options = options; + this.toolPath = toolPath; + if (options.delay) { + this.delay = options.delay; + } + } + CheckComplete() { + if (this.done) { + return; + } + if (this.processClosed) { + this._setResult(); + } + else if (this.processExited) { + this.timeout = timers_1.setTimeout(ExecState.HandleTimeout, this.delay, this); + } + } + _debug(message) { + this.emit('debug', message); + } + _setResult() { + // determine whether there is an error + let error; + if (this.processExited) { + if (this.processError) { + error = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`); + } + else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) { + error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`); + } + else if (this.processStderr && this.options.failOnStdErr) { + error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`); + } + } + // clear the timeout + if (this.timeout) { + clearTimeout(this.timeout); + this.timeout = null; + } + this.done = true; + this.emit('done', error, this.processExitCode); + } + static HandleTimeout(state) { + if (state.done) { + return; + } + if (!state.processClosed && state.processExited) { + const message = `The STDIO streams did not close within ${state.delay / + 1000} seconds of the exit event from process '${state.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`; + state._debug(message); + } + state._setResult(); + } +} +//# sourceMappingURL=toolrunner.js.map /***/ }), -/***/ 9117: -/***/ ((__unused_webpack_module, exports) => { +/***/ 8090: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SearchState = void 0; -class SearchState { - constructor(path, level) { - this.path = path; - this.level = level; - } +exports.hashFiles = exports.create = void 0; +const internal_globber_1 = __nccwpck_require__(8298); +const internal_hash_files_1 = __nccwpck_require__(2448); +/** + * Constructs a globber + * + * @param patterns Patterns separated by newlines + * @param options Glob options + */ +function create(patterns, options) { + return __awaiter(this, void 0, void 0, function* () { + return yield internal_globber_1.DefaultGlobber.create(patterns, options); + }); } -exports.SearchState = SearchState; -//# sourceMappingURL=internal-search-state.js.map +exports.create = create; +/** + * Computes the sha256 hash of a glob + * + * @param patterns Patterns separated by newlines + * @param options Glob options + */ +function hashFiles(patterns, options) { + return __awaiter(this, void 0, void 0, function* () { + let followSymbolicLinks = true; + if (options && typeof options.followSymbolicLinks === 'boolean') { + followSymbolicLinks = options.followSymbolicLinks; + } + const globber = yield create(patterns, { followSymbolicLinks }); + return internal_hash_files_1.hashFiles(globber); + }); +} +exports.hashFiles = hashFiles; +//# sourceMappingURL=glob.js.map /***/ }), -/***/ 3702: -/***/ ((__unused_webpack_module, exports) => { +/***/ 1026: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -class BasicCredentialHandler { - constructor(username, password) { - this.username = username; - this.password = password; - } - prepareRequest(options) { - options.headers['Authorization'] = - 'Basic ' + - Buffer.from(this.username + ':' + this.password).toString('base64'); - } - // This handler cannot handle 401 - canHandleAuthentication(response) { - return false; - } - handleAuthentication(httpClient, requestInfo, objs) { - return null; - } -} -exports.BasicCredentialHandler = BasicCredentialHandler; -class BearerCredentialHandler { - constructor(token) { - this.token = token; - } - // currently implements pre-authorization - // TODO: support preAuth = false where it hooks on 401 - prepareRequest(options) { - options.headers['Authorization'] = 'Bearer ' + this.token; - } - // This handler cannot handle 401 - canHandleAuthentication(response) { - return false; - } - handleAuthentication(httpClient, requestInfo, objs) { - return null; - } -} -exports.BearerCredentialHandler = BearerCredentialHandler; -class PersonalAccessTokenCredentialHandler { - constructor(token) { - this.token = token; - } - // currently implements pre-authorization - // TODO: support preAuth = false where it hooks on 401 - prepareRequest(options) { - options.headers['Authorization'] = - 'Basic ' + Buffer.from('PAT:' + this.token).toString('base64'); - } - // This handler cannot handle 401 - canHandleAuthentication(response) { - return false; - } - handleAuthentication(httpClient, requestInfo, objs) { - return null; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__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)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getOptions = void 0; +const core = __importStar(__nccwpck_require__(2186)); +/** + * Returns a copy with defaults filled in. + */ +function getOptions(copy) { + const result = { + followSymbolicLinks: true, + implicitDescendants: true, + matchDirectories: true, + omitBrokenSymbolicLinks: true + }; + if (copy) { + if (typeof copy.followSymbolicLinks === 'boolean') { + result.followSymbolicLinks = copy.followSymbolicLinks; + core.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`); + } + if (typeof copy.implicitDescendants === 'boolean') { + result.implicitDescendants = copy.implicitDescendants; + core.debug(`implicitDescendants '${result.implicitDescendants}'`); + } + if (typeof copy.matchDirectories === 'boolean') { + result.matchDirectories = copy.matchDirectories; + core.debug(`matchDirectories '${result.matchDirectories}'`); + } + if (typeof copy.omitBrokenSymbolicLinks === 'boolean') { + result.omitBrokenSymbolicLinks = copy.omitBrokenSymbolicLinks; + core.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`); + } } + return result; } -exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; - +exports.getOptions = getOptions; +//# sourceMappingURL=internal-glob-options-helper.js.map /***/ }), -/***/ 9925: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 8298: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__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)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __asyncValues = (this && this.__asyncValues) || function (o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } +}; +var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); } +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } +}; Object.defineProperty(exports, "__esModule", ({ value: true })); -const http = __nccwpck_require__(8605); -const https = __nccwpck_require__(7211); -const pm = __nccwpck_require__(6443); -let tunnel; -var HttpCodes; -(function (HttpCodes) { - HttpCodes[HttpCodes["OK"] = 200] = "OK"; - HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices"; - HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently"; - HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved"; - HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther"; - HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified"; - HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy"; - HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy"; - HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect"; - HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect"; - HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest"; - HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized"; - HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired"; - HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden"; - HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound"; - HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed"; - HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable"; - HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired"; - HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout"; - HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict"; - HttpCodes[HttpCodes["Gone"] = 410] = "Gone"; - HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests"; - HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError"; - HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented"; - HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway"; - HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable"; - HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout"; -})(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {})); -var Headers; -(function (Headers) { - Headers["Accept"] = "accept"; - Headers["ContentType"] = "content-type"; -})(Headers = exports.Headers || (exports.Headers = {})); -var MediaTypes; -(function (MediaTypes) { - MediaTypes["ApplicationJson"] = "application/json"; -})(MediaTypes = exports.MediaTypes || (exports.MediaTypes = {})); -/** - * Returns the proxy URL, depending upon the supplied url and proxy environment variables. - * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com - */ -function getProxyUrl(serverUrl) { - let proxyUrl = pm.getProxyUrl(new URL(serverUrl)); - return proxyUrl ? proxyUrl.href : ''; -} -exports.getProxyUrl = getProxyUrl; -const HttpRedirectCodes = [ - HttpCodes.MovedPermanently, - HttpCodes.ResourceMoved, - HttpCodes.SeeOther, - HttpCodes.TemporaryRedirect, - HttpCodes.PermanentRedirect -]; -const HttpResponseRetryCodes = [ - HttpCodes.BadGateway, - HttpCodes.ServiceUnavailable, - HttpCodes.GatewayTimeout -]; -const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD']; -const ExponentialBackoffCeiling = 10; -const ExponentialBackoffTimeSlice = 5; -class HttpClientError extends Error { - constructor(message, statusCode) { - super(message); - this.name = 'HttpClientError'; - this.statusCode = statusCode; - Object.setPrototypeOf(this, HttpClientError.prototype); - } -} -exports.HttpClientError = HttpClientError; -class HttpClientResponse { - constructor(message) { - this.message = message; +exports.DefaultGlobber = void 0; +const core = __importStar(__nccwpck_require__(2186)); +const fs = __importStar(__nccwpck_require__(5747)); +const globOptionsHelper = __importStar(__nccwpck_require__(1026)); +const path = __importStar(__nccwpck_require__(5622)); +const patternHelper = __importStar(__nccwpck_require__(9005)); +const internal_match_kind_1 = __nccwpck_require__(1063); +const internal_pattern_1 = __nccwpck_require__(4536); +const internal_search_state_1 = __nccwpck_require__(9117); +const IS_WINDOWS = process.platform === 'win32'; +class DefaultGlobber { + constructor(options) { + this.patterns = []; + this.searchPaths = []; + this.options = globOptionsHelper.getOptions(options); } - readBody() { - return new Promise(async (resolve, reject) => { - let output = Buffer.alloc(0); - this.message.on('data', (chunk) => { - output = Buffer.concat([output, chunk]); - }); - this.message.on('end', () => { - resolve(output.toString()); - }); - }); + getSearchPaths() { + // Return a copy + return this.searchPaths.slice(); } -} -exports.HttpClientResponse = HttpClientResponse; -function isHttps(requestUrl) { - let parsedUrl = new URL(requestUrl); - return parsedUrl.protocol === 'https:'; -} -exports.isHttps = isHttps; -class HttpClient { - constructor(userAgent, handlers, requestOptions) { - this._ignoreSslError = false; - this._allowRedirects = true; - this._allowRedirectDowngrade = false; - this._maxRedirects = 50; - this._allowRetries = false; - this._maxRetries = 1; - this._keepAlive = false; - this._disposed = false; - this.userAgent = userAgent; - this.handlers = handlers || []; - this.requestOptions = requestOptions; - if (requestOptions) { - if (requestOptions.ignoreSslError != null) { - this._ignoreSslError = requestOptions.ignoreSslError; - } - this._socketTimeout = requestOptions.socketTimeout; - if (requestOptions.allowRedirects != null) { - this._allowRedirects = requestOptions.allowRedirects; - } - if (requestOptions.allowRedirectDowngrade != null) { - this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade; - } - if (requestOptions.maxRedirects != null) { - this._maxRedirects = Math.max(requestOptions.maxRedirects, 0); - } - if (requestOptions.keepAlive != null) { - this._keepAlive = requestOptions.keepAlive; - } - if (requestOptions.allowRetries != null) { - this._allowRetries = requestOptions.allowRetries; + glob() { + var e_1, _a; + return __awaiter(this, void 0, void 0, function* () { + const result = []; + try { + for (var _b = __asyncValues(this.globGenerator()), _c; _c = yield _b.next(), !_c.done;) { + const itemPath = _c.value; + result.push(itemPath); + } } - if (requestOptions.maxRetries != null) { - this._maxRetries = requestOptions.maxRetries; + catch (e_1_1) { e_1 = { error: e_1_1 }; } + finally { + try { + if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b); + } + finally { if (e_1) throw e_1.error; } } - } - } - options(requestUrl, additionalHeaders) { - return this.request('OPTIONS', requestUrl, null, additionalHeaders || {}); - } - get(requestUrl, additionalHeaders) { - return this.request('GET', requestUrl, null, additionalHeaders || {}); - } - del(requestUrl, additionalHeaders) { - return this.request('DELETE', requestUrl, null, additionalHeaders || {}); - } - post(requestUrl, data, additionalHeaders) { - return this.request('POST', requestUrl, data, additionalHeaders || {}); - } - patch(requestUrl, data, additionalHeaders) { - return this.request('PATCH', requestUrl, data, additionalHeaders || {}); - } - put(requestUrl, data, additionalHeaders) { - return this.request('PUT', requestUrl, data, additionalHeaders || {}); - } - head(requestUrl, additionalHeaders) { - return this.request('HEAD', requestUrl, null, additionalHeaders || {}); - } - sendStream(verb, requestUrl, stream, additionalHeaders) { - return this.request(verb, requestUrl, stream, additionalHeaders); - } - /** - * Gets a typed object from an endpoint - * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise - */ - async getJson(requestUrl, additionalHeaders = {}) { - additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); - let res = await this.get(requestUrl, additionalHeaders); - return this._processResponse(res, this.requestOptions); - } - async postJson(requestUrl, obj, additionalHeaders = {}) { - let data = JSON.stringify(obj, null, 2); - additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); - additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); - let res = await this.post(requestUrl, data, additionalHeaders); - return this._processResponse(res, this.requestOptions); - } - async putJson(requestUrl, obj, additionalHeaders = {}) { - let data = JSON.stringify(obj, null, 2); - additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); - additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); - let res = await this.put(requestUrl, data, additionalHeaders); - return this._processResponse(res, this.requestOptions); - } - async patchJson(requestUrl, obj, additionalHeaders = {}) { - let data = JSON.stringify(obj, null, 2); - additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); - additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); - let res = await this.patch(requestUrl, data, additionalHeaders); - return this._processResponse(res, this.requestOptions); + return result; + }); } - /** - * Makes a raw http request. - * All other methods such as get, post, patch, and request ultimately call this. - * Prefer get, del, post and patch - */ - async request(verb, requestUrl, data, headers) { - if (this._disposed) { - throw new Error('Client has already been disposed.'); - } - let parsedUrl = new URL(requestUrl); - let info = this._prepareRequest(verb, parsedUrl, headers); - // Only perform retries on reads since writes may not be idempotent. - let maxTries = this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1 - ? this._maxRetries + 1 - : 1; - let numTries = 0; - let response; - while (numTries < maxTries) { - response = await this.requestRaw(info, data); - // Check if it's an authentication challenge - if (response && - response.message && - response.message.statusCode === HttpCodes.Unauthorized) { - let authenticationHandler; - for (let i = 0; i < this.handlers.length; i++) { - if (this.handlers[i].canHandleAuthentication(response)) { - authenticationHandler = this.handlers[i]; - break; - } + globGenerator() { + return __asyncGenerator(this, arguments, function* globGenerator_1() { + // Fill in defaults options + const options = globOptionsHelper.getOptions(this.options); + // Implicit descendants? + const patterns = []; + for (const pattern of this.patterns) { + patterns.push(pattern); + if (options.implicitDescendants && + (pattern.trailingSeparator || + pattern.segments[pattern.segments.length - 1] !== '**')) { + patterns.push(new internal_pattern_1.Pattern(pattern.negate, true, pattern.segments.concat('**'))); } - if (authenticationHandler) { - return authenticationHandler.handleAuthentication(this, info, data); + } + // Push the search paths + const stack = []; + for (const searchPath of patternHelper.getSearchPaths(patterns)) { + core.debug(`Search path '${searchPath}'`); + // Exists? + try { + // Intentionally using lstat. Detection for broken symlink + // will be performed later (if following symlinks). + yield __await(fs.promises.lstat(searchPath)); } - else { - // We have received an unauthorized response but have no handlers to handle it. - // Let the response return to the caller. - return response; + catch (err) { + if (err.code === 'ENOENT') { + continue; + } + throw err; } + stack.unshift(new internal_search_state_1.SearchState(searchPath, 1)); } - let redirectsRemaining = this._maxRedirects; - while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1 && - this._allowRedirects && - redirectsRemaining > 0) { - const redirectUrl = response.message.headers['location']; - if (!redirectUrl) { - // if there's no location to redirect to, we won't - break; + // Search + const traversalChain = []; // used to detect cycles + while (stack.length) { + // Pop + const item = stack.pop(); + // Match? + const match = patternHelper.match(patterns, item.path); + const partialMatch = !!match || patternHelper.partialMatch(patterns, item.path); + if (!match && !partialMatch) { + continue; } - let parsedRedirectUrl = new URL(redirectUrl); - if (parsedUrl.protocol == 'https:' && - parsedUrl.protocol != parsedRedirectUrl.protocol && - !this._allowRedirectDowngrade) { - throw new Error('Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.'); + // Stat + const stats = yield __await(DefaultGlobber.stat(item, options, traversalChain) + // Broken symlink, or symlink cycle detected, or no longer exists + ); + // Broken symlink, or symlink cycle detected, or no longer exists + if (!stats) { + continue; } - // we need to finish reading the response before reassigning response - // which will leak the open socket. - await response.readBody(); - // strip authorization header if redirected to a different hostname - if (parsedRedirectUrl.hostname !== parsedUrl.hostname) { - for (let header in headers) { - // header names are case insensitive - if (header.toLowerCase() === 'authorization') { - delete headers[header]; - } + // Directory + if (stats.isDirectory()) { + // Matched + if (match & internal_match_kind_1.MatchKind.Directory && options.matchDirectories) { + yield yield __await(item.path); + } + // Descend? + else if (!partialMatch) { + continue; } + // Push the child items in reverse + const childLevel = item.level + 1; + const childItems = (yield __await(fs.promises.readdir(item.path))).map(x => new internal_search_state_1.SearchState(path.join(item.path, x), childLevel)); + stack.push(...childItems.reverse()); + } + // File + else if (match & internal_match_kind_1.MatchKind.File) { + yield yield __await(item.path); } - // let's make the request with the new redirectUrl - info = this._prepareRequest(verb, parsedRedirectUrl, headers); - response = await this.requestRaw(info, data); - redirectsRemaining--; - } - if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) { - // If not a retry code, return immediately instead of retrying - return response; - } - numTries += 1; - if (numTries < maxTries) { - await response.readBody(); - await this._performExponentialBackoff(numTries); } - } - return response; - } - /** - * Needs to be called if keepAlive is set to true in request options. - */ - dispose() { - if (this._agent) { - this._agent.destroy(); - } - this._disposed = true; + }); } /** - * Raw request. - * @param info - * @param data + * Constructs a DefaultGlobber */ - requestRaw(info, data) { - return new Promise((resolve, reject) => { - let callbackForResult = function (err, res) { - if (err) { - reject(err); - } - resolve(res); - }; - this.requestRawWithCallback(info, data, callbackForResult); - }); - } - /** - * Raw request with callback. - * @param info - * @param data - * @param onResult - */ - requestRawWithCallback(info, data, onResult) { - let socket; - if (typeof data === 'string') { - info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8'); - } - let callbackCalled = false; - let handleResult = (err, res) => { - if (!callbackCalled) { - callbackCalled = true; - onResult(err, res); + static create(patterns, options) { + return __awaiter(this, void 0, void 0, function* () { + const result = new DefaultGlobber(options); + if (IS_WINDOWS) { + patterns = patterns.replace(/\r\n/g, '\n'); + patterns = patterns.replace(/\r/g, '\n'); } - }; - let req = info.httpModule.request(info.options, (msg) => { - let res = new HttpClientResponse(msg); - handleResult(null, res); - }); - req.on('socket', sock => { - socket = sock; - }); - // If we ever get disconnected, we want the socket to timeout eventually - req.setTimeout(this._socketTimeout || 3 * 60000, () => { - if (socket) { - socket.end(); + const lines = patterns.split('\n').map(x => x.trim()); + for (const line of lines) { + // Empty or comment + if (!line || line.startsWith('#')) { + continue; + } + // Pattern + else { + result.patterns.push(new internal_pattern_1.Pattern(line)); + } } - handleResult(new Error('Request timeout: ' + info.options.path), null); - }); - req.on('error', function (err) { - // err has statusCode property - // res should have headers - handleResult(err, null); + result.searchPaths.push(...patternHelper.getSearchPaths(result.patterns)); + return result; }); - if (data && typeof data === 'string') { - req.write(data, 'utf8'); - } - if (data && typeof data !== 'string') { - data.on('close', function () { - req.end(); - }); - data.pipe(req); - } - else { - req.end(); - } - } - /** - * Gets an http agent. This function is useful when you need an http agent that handles - * routing through a proxy server - depending upon the url and proxy environment variables. - * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com - */ - getAgent(serverUrl) { - let parsedUrl = new URL(serverUrl); - return this._getAgent(parsedUrl); - } - _prepareRequest(method, requestUrl, headers) { - const info = {}; - info.parsedUrl = requestUrl; - const usingSsl = info.parsedUrl.protocol === 'https:'; - info.httpModule = usingSsl ? https : http; - const defaultPort = usingSsl ? 443 : 80; - info.options = {}; - info.options.host = info.parsedUrl.hostname; - info.options.port = info.parsedUrl.port - ? parseInt(info.parsedUrl.port) - : defaultPort; - info.options.path = - (info.parsedUrl.pathname || '') + (info.parsedUrl.search || ''); - info.options.method = method; - info.options.headers = this._mergeHeaders(headers); - if (this.userAgent != null) { - info.options.headers['user-agent'] = this.userAgent; - } - info.options.agent = this._getAgent(info.parsedUrl); - // gives handlers an opportunity to participate - if (this.handlers) { - this.handlers.forEach(handler => { - handler.prepareRequest(info.options); - }); - } - return info; - } - _mergeHeaders(headers) { - const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {}); - if (this.requestOptions && this.requestOptions.headers) { - return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers)); - } - return lowercaseKeys(headers || {}); - } - _getExistingOrDefaultHeader(additionalHeaders, header, _default) { - const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {}); - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; - } - return additionalHeaders[header] || clientHeader || _default; } - _getAgent(parsedUrl) { - let agent; - let proxyUrl = pm.getProxyUrl(parsedUrl); - let useProxy = proxyUrl && proxyUrl.hostname; - if (this._keepAlive && useProxy) { - agent = this._proxyAgent; - } - if (this._keepAlive && !useProxy) { - agent = this._agent; - } - // if agent is already assigned use that agent. - if (!!agent) { - return agent; - } - const usingSsl = parsedUrl.protocol === 'https:'; - let maxSockets = 100; - if (!!this.requestOptions) { - maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets; - } - if (useProxy) { - // If using proxy, need tunnel - if (!tunnel) { - tunnel = __nccwpck_require__(4294); - } - const agentOptions = { - maxSockets: maxSockets, - keepAlive: this._keepAlive, - proxy: { - ...((proxyUrl.username || proxyUrl.password) && { - proxyAuth: `${proxyUrl.username}:${proxyUrl.password}` - }), - host: proxyUrl.hostname, - port: proxyUrl.port + static stat(item, options, traversalChain) { + return __awaiter(this, void 0, void 0, function* () { + // Note: + // `stat` returns info about the target of a symlink (or symlink chain) + // `lstat` returns info about a symlink itself + let stats; + if (options.followSymbolicLinks) { + try { + // Use `stat` (following symlinks) + stats = yield fs.promises.stat(item.path); } - }; - let tunnelAgent; - const overHttps = proxyUrl.protocol === 'https:'; - if (usingSsl) { - tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp; - } - else { - tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp; - } - agent = tunnelAgent(agentOptions); - this._proxyAgent = agent; - } - // if reusing agent across request and tunneling agent isn't assigned create a new agent - if (this._keepAlive && !agent) { - const options = { keepAlive: this._keepAlive, maxSockets: maxSockets }; - agent = usingSsl ? new https.Agent(options) : new http.Agent(options); - this._agent = agent; - } - // if not using private agent and tunnel agent isn't setup then use global agent - if (!agent) { - agent = usingSsl ? https.globalAgent : http.globalAgent; - } - if (usingSsl && this._ignoreSslError) { - // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process - // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options - // we have to cast it to any and change it directly - agent.options = Object.assign(agent.options || {}, { - rejectUnauthorized: false - }); - } - return agent; - } - _performExponentialBackoff(retryNumber) { - retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); - const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); - return new Promise(resolve => setTimeout(() => resolve(), ms)); - } - static dateTimeDeserializer(key, value) { - if (typeof value === 'string') { - let a = new Date(value); - if (!isNaN(a.valueOf())) { - return a; - } - } - return value; - } - async _processResponse(res, options) { - return new Promise(async (resolve, reject) => { - const statusCode = res.message.statusCode; - const response = { - statusCode: statusCode, - result: null, - headers: {} - }; - // not found leads to null obj returned - if (statusCode == HttpCodes.NotFound) { - resolve(response); - } - let obj; - let contents; - // get the result from the body - try { - contents = await res.readBody(); - if (contents && contents.length > 0) { - if (options && options.deserializeDates) { - obj = JSON.parse(contents, HttpClient.dateTimeDeserializer); - } - else { - obj = JSON.parse(contents); + catch (err) { + if (err.code === 'ENOENT') { + if (options.omitBrokenSymbolicLinks) { + core.debug(`Broken symlink '${item.path}'`); + return undefined; + } + throw new Error(`No information found for the path '${item.path}'. This may indicate a broken symbolic link.`); } - response.result = obj; + throw err; } - response.headers = res.message.headers; } - catch (err) { - // Invalid resource (contents not json); leaving result obj null + else { + // Use `lstat` (not following symlinks) + stats = yield fs.promises.lstat(item.path); } - // note that 3xx redirects are handled by the http layer. - if (statusCode > 299) { - let msg; - // if exception/error in body, attempt to get better error - if (obj && obj.message) { - msg = obj.message; - } - else if (contents && contents.length > 0) { - // it may be the case that the exception is in the body message as string - msg = contents; + // Note, isDirectory() returns false for the lstat of a symlink + if (stats.isDirectory() && options.followSymbolicLinks) { + // Get the realpath + const realPath = yield fs.promises.realpath(item.path); + // Fixup the traversal chain to match the item level + while (traversalChain.length >= item.level) { + traversalChain.pop(); } - else { - msg = 'Failed request: (' + statusCode + ')'; + // Test for a cycle + if (traversalChain.some((x) => x === realPath)) { + core.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`); + return undefined; } - let err = new HttpClientError(msg, statusCode); - err.result = response.result; - reject(err); - } - else { - resolve(response); + // Update the traversal chain + traversalChain.push(realPath); } + return stats; }); } } -exports.HttpClient = HttpClient; - - -/***/ }), - -/***/ 6443: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -function getProxyUrl(reqUrl) { - let usingSsl = reqUrl.protocol === 'https:'; - let proxyUrl; - if (checkBypass(reqUrl)) { - return proxyUrl; - } - let proxyVar; - if (usingSsl) { - proxyVar = process.env['https_proxy'] || process.env['HTTPS_PROXY']; - } - else { - proxyVar = process.env['http_proxy'] || process.env['HTTP_PROXY']; - } - if (proxyVar) { - proxyUrl = new URL(proxyVar); - } - return proxyUrl; -} -exports.getProxyUrl = getProxyUrl; -function checkBypass(reqUrl) { - if (!reqUrl.hostname) { - return false; - } - let noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || ''; - if (!noProxy) { - return false; - } - // Determine the request port - let reqPort; - if (reqUrl.port) { - reqPort = Number(reqUrl.port); - } - else if (reqUrl.protocol === 'http:') { - reqPort = 80; - } - else if (reqUrl.protocol === 'https:') { - reqPort = 443; - } - // Format the request hostname and hostname with port - let upperReqHosts = [reqUrl.hostname.toUpperCase()]; - if (typeof reqPort === 'number') { - upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); - } - // Compare request host against noproxy - for (let upperNoProxyItem of noProxy - .split(',') - .map(x => x.trim().toUpperCase()) - .filter(x => x)) { - if (upperReqHosts.some(x => x === upperNoProxyItem)) { - return true; - } - } - return false; -} -exports.checkBypass = checkBypass; - +exports.DefaultGlobber = DefaultGlobber; +//# sourceMappingURL=internal-globber.js.map /***/ }), -/***/ 1962: +/***/ 2448: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__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)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { @@ -4068,9947 +3858,8318 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; - result["default"] = mod; - return result; +var __asyncValues = (this && this.__asyncValues) || function (o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } }; -var _a; Object.defineProperty(exports, "__esModule", ({ value: true })); -const assert_1 = __nccwpck_require__(2357); +exports.hashFiles = void 0; +const crypto = __importStar(__nccwpck_require__(6417)); +const core = __importStar(__nccwpck_require__(2186)); const fs = __importStar(__nccwpck_require__(5747)); +const stream = __importStar(__nccwpck_require__(2413)); +const util = __importStar(__nccwpck_require__(1669)); const path = __importStar(__nccwpck_require__(5622)); -_a = fs.promises, exports.chmod = _a.chmod, exports.copyFile = _a.copyFile, exports.lstat = _a.lstat, exports.mkdir = _a.mkdir, exports.readdir = _a.readdir, exports.readlink = _a.readlink, exports.rename = _a.rename, exports.rmdir = _a.rmdir, exports.stat = _a.stat, exports.symlink = _a.symlink, exports.unlink = _a.unlink; -exports.IS_WINDOWS = process.platform === 'win32'; -function exists(fsPath) { +function hashFiles(globber) { + var e_1, _a; + var _b; return __awaiter(this, void 0, void 0, function* () { + let hasMatch = false; + const githubWorkspace = (_b = process.env['GITHUB_WORKSPACE']) !== null && _b !== void 0 ? _b : process.cwd(); + const result = crypto.createHash('sha256'); + let count = 0; try { - yield exports.stat(fsPath); + for (var _c = __asyncValues(globber.globGenerator()), _d; _d = yield _c.next(), !_d.done;) { + const file = _d.value; + core.debug(file); + if (!file.startsWith(`${githubWorkspace}${path.sep}`)) { + core.debug(`Ignore '${file}' since it is not under GITHUB_WORKSPACE.`); + continue; + } + if (fs.statSync(file).isDirectory()) { + core.debug(`Skip directory '${file}'.`); + continue; + } + const hash = crypto.createHash('sha256'); + const pipeline = util.promisify(stream.pipeline); + yield pipeline(fs.createReadStream(file), hash); + result.write(hash.digest()); + count++; + if (!hasMatch) { + hasMatch = true; + } + } } - catch (err) { - if (err.code === 'ENOENT') { - return false; + catch (e_1_1) { e_1 = { error: e_1_1 }; } + finally { + try { + if (_d && !_d.done && (_a = _c.return)) yield _a.call(_c); } - throw err; + finally { if (e_1) throw e_1.error; } + } + result.end(); + if (hasMatch) { + core.debug(`Found ${count} files to hash.`); + return result.digest('hex'); + } + else { + core.debug(`No matches found for glob`); + return ''; } - return true; - }); -} -exports.exists = exists; -function isDirectory(fsPath, useStat = false) { - return __awaiter(this, void 0, void 0, function* () { - const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath); - return stats.isDirectory(); }); } -exports.isDirectory = isDirectory; +exports.hashFiles = hashFiles; +//# sourceMappingURL=internal-hash-files.js.map + +/***/ }), + +/***/ 1063: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.MatchKind = void 0; /** - * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like: - * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases). + * Indicates whether a pattern matches a path */ -function isRooted(p) { - p = normalizeSeparators(p); - if (!p) { - throw new Error('isRooted() parameter "p" cannot be empty'); - } - if (exports.IS_WINDOWS) { - return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello - ); // e.g. C: or C:\hello - } - return p.startsWith('/'); -} -exports.isRooted = isRooted; +var MatchKind; +(function (MatchKind) { + /** Not matched */ + MatchKind[MatchKind["None"] = 0] = "None"; + /** Matched if the path is a directory */ + MatchKind[MatchKind["Directory"] = 1] = "Directory"; + /** Matched if the path is a regular file */ + MatchKind[MatchKind["File"] = 2] = "File"; + /** Matched */ + MatchKind[MatchKind["All"] = 3] = "All"; +})(MatchKind = exports.MatchKind || (exports.MatchKind = {})); +//# sourceMappingURL=internal-match-kind.js.map + +/***/ }), + +/***/ 1849: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__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)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.safeTrimTrailingSeparator = exports.normalizeSeparators = exports.hasRoot = exports.hasAbsoluteRoot = exports.ensureAbsoluteRoot = exports.dirname = void 0; +const path = __importStar(__nccwpck_require__(5622)); +const assert_1 = __importDefault(__nccwpck_require__(2357)); +const IS_WINDOWS = process.platform === 'win32'; /** - * Recursively create a directory at `fsPath`. + * Similar to path.dirname except normalizes the path separators and slightly better handling for Windows UNC paths. * - * This implementation is optimistic, meaning it attempts to create the full - * path first, and backs up the path stack from there. + * For example, on Linux/macOS: + * - `/ => /` + * - `/hello => /` * - * @param fsPath The path to create - * @param maxDepth The maximum recursion depth - * @param depth The current recursion depth + * For example, on Windows: + * - `C:\ => C:\` + * - `C:\hello => C:\` + * - `C: => C:` + * - `C:hello => C:` + * - `\ => \` + * - `\hello => \` + * - `\\hello => \\hello` + * - `\\hello\world => \\hello\world` */ -function mkdirP(fsPath, maxDepth = 1000, depth = 1) { - return __awaiter(this, void 0, void 0, function* () { - assert_1.ok(fsPath, 'a path argument must be provided'); - fsPath = path.resolve(fsPath); - if (depth >= maxDepth) - return exports.mkdir(fsPath); - try { - yield exports.mkdir(fsPath); - return; - } - catch (err) { - switch (err.code) { - case 'ENOENT': { - yield mkdirP(path.dirname(fsPath), maxDepth, depth + 1); - yield exports.mkdir(fsPath); - return; - } - default: { - let stats; - try { - stats = yield exports.stat(fsPath); - } - catch (err2) { - throw err; - } - if (!stats.isDirectory()) - throw err; - } - } - } - }); +function dirname(p) { + // Normalize slashes and trim unnecessary trailing slash + p = safeTrimTrailingSeparator(p); + // Windows UNC root, e.g. \\hello or \\hello\world + if (IS_WINDOWS && /^\\\\[^\\]+(\\[^\\]+)?$/.test(p)) { + return p; + } + // Get dirname + let result = path.dirname(p); + // Trim trailing slash for Windows UNC root, e.g. \\hello\world\ + if (IS_WINDOWS && /^\\\\[^\\]+\\[^\\]+\\$/.test(result)) { + result = safeTrimTrailingSeparator(result); + } + return result; } -exports.mkdirP = mkdirP; +exports.dirname = dirname; /** - * Best effort attempt to determine whether a file exists and is executable. - * @param filePath file path to check - * @param extensions additional file extensions to try - * @return if file exists and is executable, returns the file path. otherwise empty string. + * Roots the path if not already rooted. On Windows, relative roots like `\` + * or `C:` are expanded based on the current working directory. */ -function tryGetExecutablePath(filePath, extensions) { - return __awaiter(this, void 0, void 0, function* () { - let stats = undefined; - try { - // test file exists - stats = yield exports.stat(filePath); - } - catch (err) { - if (err.code !== 'ENOENT') { - // eslint-disable-next-line no-console - console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`); - } - } - if (stats && stats.isFile()) { - if (exports.IS_WINDOWS) { - // on Windows, test for valid extension - const upperExt = path.extname(filePath).toUpperCase(); - if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) { - return filePath; - } - } - else { - if (isUnixExecutable(stats)) { - return filePath; - } - } - } - // try each extension - const originalFilePath = filePath; - for (const extension of extensions) { - filePath = originalFilePath + extension; - stats = undefined; - try { - stats = yield exports.stat(filePath); - } - catch (err) { - if (err.code !== 'ENOENT') { - // eslint-disable-next-line no-console - console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`); - } - } - if (stats && stats.isFile()) { - if (exports.IS_WINDOWS) { - // preserve the case of the actual file (since an extension was appended) - try { - const directory = path.dirname(filePath); - const upperName = path.basename(filePath).toUpperCase(); - for (const actualName of yield exports.readdir(directory)) { - if (upperName === actualName.toUpperCase()) { - filePath = path.join(directory, actualName); - break; - } - } - } - catch (err) { - // eslint-disable-next-line no-console - console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`); - } - return filePath; +function ensureAbsoluteRoot(root, itemPath) { + assert_1.default(root, `ensureAbsoluteRoot parameter 'root' must not be empty`); + assert_1.default(itemPath, `ensureAbsoluteRoot parameter 'itemPath' must not be empty`); + // Already rooted + if (hasAbsoluteRoot(itemPath)) { + return itemPath; + } + // Windows + if (IS_WINDOWS) { + // Check for itemPath like C: or C:foo + if (itemPath.match(/^[A-Z]:[^\\/]|^[A-Z]:$/i)) { + let cwd = process.cwd(); + assert_1.default(cwd.match(/^[A-Z]:\\/i), `Expected current directory to start with an absolute drive root. Actual '${cwd}'`); + // Drive letter matches cwd? Expand to cwd + if (itemPath[0].toUpperCase() === cwd[0].toUpperCase()) { + // Drive only, e.g. C: + if (itemPath.length === 2) { + // Preserve specified drive letter case (upper or lower) + return `${itemPath[0]}:\\${cwd.substr(3)}`; } + // Drive + path, e.g. C:foo else { - if (isUnixExecutable(stats)) { - return filePath; + if (!cwd.endsWith('\\')) { + cwd += '\\'; } + // Preserve specified drive letter case (upper or lower) + return `${itemPath[0]}:\\${cwd.substr(3)}${itemPath.substr(2)}`; } } + // Different drive + else { + return `${itemPath[0]}:\\${itemPath.substr(2)}`; + } } - return ''; - }); + // Check for itemPath like \ or \foo + else if (normalizeSeparators(itemPath).match(/^\\$|^\\[^\\]/)) { + const cwd = process.cwd(); + assert_1.default(cwd.match(/^[A-Z]:\\/i), `Expected current directory to start with an absolute drive root. Actual '${cwd}'`); + return `${cwd[0]}:\\${itemPath.substr(1)}`; + } + } + assert_1.default(hasAbsoluteRoot(root), `ensureAbsoluteRoot parameter 'root' must have an absolute root`); + // Otherwise ensure root ends with a separator + if (root.endsWith('/') || (IS_WINDOWS && root.endsWith('\\'))) { + // Intentionally empty + } + else { + // Append separator + root += path.sep; + } + return root + itemPath; } -exports.tryGetExecutablePath = tryGetExecutablePath; +exports.ensureAbsoluteRoot = ensureAbsoluteRoot; +/** + * On Linux/macOS, true if path starts with `/`. On Windows, true for paths like: + * `\\hello\share` and `C:\hello` (and using alternate separator). + */ +function hasAbsoluteRoot(itemPath) { + assert_1.default(itemPath, `hasAbsoluteRoot parameter 'itemPath' must not be empty`); + // Normalize separators + itemPath = normalizeSeparators(itemPath); + // Windows + if (IS_WINDOWS) { + // E.g. \\hello\share or C:\hello + return itemPath.startsWith('\\\\') || /^[A-Z]:\\/i.test(itemPath); + } + // E.g. /hello + return itemPath.startsWith('/'); +} +exports.hasAbsoluteRoot = hasAbsoluteRoot; +/** + * On Linux/macOS, true if path starts with `/`. On Windows, true for paths like: + * `\`, `\hello`, `\\hello\share`, `C:`, and `C:\hello` (and using alternate separator). + */ +function hasRoot(itemPath) { + assert_1.default(itemPath, `isRooted parameter 'itemPath' must not be empty`); + // Normalize separators + itemPath = normalizeSeparators(itemPath); + // Windows + if (IS_WINDOWS) { + // E.g. \ or \hello or \\hello + // E.g. C: or C:\hello + return itemPath.startsWith('\\') || /^[A-Z]:/i.test(itemPath); + } + // E.g. /hello + return itemPath.startsWith('/'); +} +exports.hasRoot = hasRoot; +/** + * Removes redundant slashes and converts `/` to `\` on Windows + */ function normalizeSeparators(p) { p = p || ''; - if (exports.IS_WINDOWS) { - // convert slashes on Windows + // Windows + if (IS_WINDOWS) { + // Convert slashes on Windows p = p.replace(/\//g, '\\'); - // remove redundant slashes - return p.replace(/\\\\+/g, '\\'); + // Remove redundant slashes + const isUnc = /^\\\\+[^\\]/.test(p); // e.g. \\hello + return (isUnc ? '\\' : '') + p.replace(/\\\\+/g, '\\'); // preserve leading \\ for UNC } - // remove redundant slashes + // Remove redundant slashes return p.replace(/\/\/+/g, '/'); } -// on Mac/Linux, test the execute bit -// R W X R W X R W X -// 256 128 64 32 16 8 4 2 1 -function isUnixExecutable(stats) { - return ((stats.mode & 1) > 0 || - ((stats.mode & 8) > 0 && stats.gid === process.getgid()) || - ((stats.mode & 64) > 0 && stats.uid === process.getuid())); +exports.normalizeSeparators = normalizeSeparators; +/** + * Normalizes the path separators and trims the trailing separator (when safe). + * For example, `/foo/ => /foo` but `/ => /` + */ +function safeTrimTrailingSeparator(p) { + // Short-circuit if empty + if (!p) { + return ''; + } + // Normalize separators + p = normalizeSeparators(p); + // No trailing slash + if (!p.endsWith(path.sep)) { + return p; + } + // Check '/' on Linux/macOS and '\' on Windows + if (p === path.sep) { + return p; + } + // On Windows check if drive root. E.g. C:\ + if (IS_WINDOWS && /^[A-Z]:\\$/i.test(p)) { + return p; + } + // Otherwise trim trailing slash + return p.substr(0, p.length - 1); } -//# sourceMappingURL=io-util.js.map +exports.safeTrimTrailingSeparator = safeTrimTrailingSeparator; +//# sourceMappingURL=internal-path-helper.js.map /***/ }), -/***/ 7436: +/***/ 6836: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; - result["default"] = mod; + if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); return result; }; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; Object.defineProperty(exports, "__esModule", ({ value: true })); -const childProcess = __importStar(__nccwpck_require__(3129)); +exports.Path = void 0; const path = __importStar(__nccwpck_require__(5622)); -const util_1 = __nccwpck_require__(1669); -const ioUtil = __importStar(__nccwpck_require__(1962)); -const exec = util_1.promisify(childProcess.exec); +const pathHelper = __importStar(__nccwpck_require__(1849)); +const assert_1 = __importDefault(__nccwpck_require__(2357)); +const IS_WINDOWS = process.platform === 'win32'; /** - * Copies a file or folder. - * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js - * - * @param source source path - * @param dest destination path - * @param options optional. See CopyOptions. + * Helper class for parsing paths into segments */ -function cp(source, dest, options = {}) { - return __awaiter(this, void 0, void 0, function* () { - const { force, recursive } = readCopyOptions(options); - const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null; - // Dest is an existing file, but not forcing - if (destStat && destStat.isFile() && !force) { - return; - } - // If dest is an existing directory, should copy inside. - const newDest = destStat && destStat.isDirectory() - ? path.join(dest, path.basename(source)) - : dest; - if (!(yield ioUtil.exists(source))) { - throw new Error(`no such file or directory: ${source}`); - } - const sourceStat = yield ioUtil.stat(source); - if (sourceStat.isDirectory()) { - if (!recursive) { - throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`); +class Path { + /** + * Constructs a Path + * @param itemPath Path or array of segments + */ + constructor(itemPath) { + this.segments = []; + // String + if (typeof itemPath === 'string') { + assert_1.default(itemPath, `Parameter 'itemPath' must not be empty`); + // Normalize slashes and trim unnecessary trailing slash + itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); + // Not rooted + if (!pathHelper.hasRoot(itemPath)) { + this.segments = itemPath.split(path.sep); } + // Rooted else { - yield cpDirRecursive(source, newDest, 0, force); - } - } - else { - if (path.relative(source, newDest) === '') { - // a file cannot be copied to itself - throw new Error(`'${newDest}' and '${source}' are the same file`); - } - yield copyFile(source, newDest, force); - } - }); -} -exports.cp = cp; -/** - * Moves a path. - * - * @param source source path - * @param dest destination path - * @param options optional. See MoveOptions. - */ -function mv(source, dest, options = {}) { - return __awaiter(this, void 0, void 0, function* () { - if (yield ioUtil.exists(dest)) { - let destExists = true; - if (yield ioUtil.isDirectory(dest)) { - // If dest is directory copy src into dest - dest = path.join(dest, path.basename(source)); - destExists = yield ioUtil.exists(dest); - } - if (destExists) { - if (options.force == null || options.force) { - yield rmRF(dest); - } - else { - throw new Error('Destination already exists'); + // Add all segments, while not at the root + let remaining = itemPath; + let dir = pathHelper.dirname(remaining); + while (dir !== remaining) { + // Add the segment + const basename = path.basename(remaining); + this.segments.unshift(basename); + // Truncate the last segment + remaining = dir; + dir = pathHelper.dirname(remaining); } + // Remainder is the root + this.segments.unshift(remaining); } } - yield mkdirP(path.dirname(dest)); - yield ioUtil.rename(source, dest); - }); -} -exports.mv = mv; -/** - * Remove a path recursively with force - * - * @param inputPath path to remove - */ -function rmRF(inputPath) { - return __awaiter(this, void 0, void 0, function* () { - if (ioUtil.IS_WINDOWS) { - // Node doesn't provide a delete operation, only an unlink function. This means that if the file is being used by another - // program (e.g. antivirus), it won't be deleted. To address this, we shell out the work to rd/del. - try { - if (yield ioUtil.isDirectory(inputPath, true)) { - yield exec(`rd /s /q "${inputPath}"`); + // Array + else { + // Must not be empty + assert_1.default(itemPath.length > 0, `Parameter 'itemPath' must not be an empty array`); + // Each segment + for (let i = 0; i < itemPath.length; i++) { + let segment = itemPath[i]; + // Must not be empty + assert_1.default(segment, `Parameter 'itemPath' must not contain any empty segments`); + // Normalize slashes + segment = pathHelper.normalizeSeparators(itemPath[i]); + // Root segment + if (i === 0 && pathHelper.hasRoot(segment)) { + segment = pathHelper.safeTrimTrailingSeparator(segment); + assert_1.default(segment === pathHelper.dirname(segment), `Parameter 'itemPath' root segment contains information for multiple segments`); + this.segments.push(segment); } + // All other segments else { - yield exec(`del /f /a "${inputPath}"`); + // Must not contain slash + assert_1.default(!segment.includes(path.sep), `Parameter 'itemPath' contains unexpected path separators`); + this.segments.push(segment); } } - catch (err) { - // if you try to delete a file that doesn't exist, desired result is achieved - // other errors are valid - if (err.code !== 'ENOENT') - throw err; - } - // Shelling out fails to remove a symlink folder with missing source, this unlink catches that - try { - yield ioUtil.unlink(inputPath); - } - catch (err) { - // if you try to delete a file that doesn't exist, desired result is achieved - // other errors are valid - if (err.code !== 'ENOENT') - throw err; - } } - else { - let isDir = false; - try { - isDir = yield ioUtil.isDirectory(inputPath); - } - catch (err) { - // if you try to delete a file that doesn't exist, desired result is achieved - // other errors are valid - if (err.code !== 'ENOENT') - throw err; - return; - } - if (isDir) { - yield exec(`rm -rf "${inputPath}"`); + } + /** + * Converts the path to it's string representation + */ + toString() { + // First segment + let result = this.segments[0]; + // All others + let skipSlash = result.endsWith(path.sep) || (IS_WINDOWS && /^[A-Z]:$/i.test(result)); + for (let i = 1; i < this.segments.length; i++) { + if (skipSlash) { + skipSlash = false; } else { - yield ioUtil.unlink(inputPath); + result += path.sep; } + result += this.segments[i]; } - }); -} -exports.rmRF = rmRF; -/** - * Make a directory. Creates the full path with folders in between - * Will throw if it fails - * - * @param fsPath path to create - * @returns Promise - */ -function mkdirP(fsPath) { - return __awaiter(this, void 0, void 0, function* () { - yield ioUtil.mkdirP(fsPath); - }); + return result; + } } -exports.mkdirP = mkdirP; +exports.Path = Path; +//# sourceMappingURL=internal-path.js.map + +/***/ }), + +/***/ 9005: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__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)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.partialMatch = exports.match = exports.getSearchPaths = void 0; +const pathHelper = __importStar(__nccwpck_require__(1849)); +const internal_match_kind_1 = __nccwpck_require__(1063); +const IS_WINDOWS = process.platform === 'win32'; /** - * Returns path of a tool had the tool actually been invoked. Resolves via paths. - * If you check and the tool does not exist, it will throw. - * - * @param tool name of the tool - * @param check whether to check if tool exists - * @returns Promise path to tool + * Given an array of patterns, returns an array of paths to search. + * Duplicates and paths under other included paths are filtered out. */ -function which(tool, check) { - return __awaiter(this, void 0, void 0, function* () { - if (!tool) { - throw new Error("parameter 'tool' is required"); - } - // recursive when check=true - if (check) { - const result = yield which(tool, false); - if (!result) { - if (ioUtil.IS_WINDOWS) { - throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`); - } - else { - throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`); - } +function getSearchPaths(patterns) { + // Ignore negate patterns + patterns = patterns.filter(x => !x.negate); + // Create a map of all search paths + const searchPathMap = {}; + for (const pattern of patterns) { + const key = IS_WINDOWS + ? pattern.searchPath.toUpperCase() + : pattern.searchPath; + searchPathMap[key] = 'candidate'; + } + const result = []; + for (const pattern of patterns) { + // Check if already included + const key = IS_WINDOWS + ? pattern.searchPath.toUpperCase() + : pattern.searchPath; + if (searchPathMap[key] === 'included') { + continue; + } + // Check for an ancestor search path + let foundAncestor = false; + let tempKey = key; + let parent = pathHelper.dirname(tempKey); + while (parent !== tempKey) { + if (searchPathMap[parent]) { + foundAncestor = true; + break; } - return result; + tempKey = parent; + parent = pathHelper.dirname(tempKey); } - const matches = yield findInPath(tool); - if (matches && matches.length > 0) { - return matches[0]; + // Include the search pattern in the result + if (!foundAncestor) { + result.push(pattern.searchPath); + searchPathMap[key] = 'included'; } - return ''; - }); + } + return result; } -exports.which = which; +exports.getSearchPaths = getSearchPaths; /** - * Returns a list of all occurrences of the given tool on the system path. - * - * @returns Promise the paths of the tool + * Matches the patterns against the path */ -function findInPath(tool) { - return __awaiter(this, void 0, void 0, function* () { - if (!tool) { - throw new Error("parameter 'tool' is required"); - } - // build the list of extensions to try - const extensions = []; - if (ioUtil.IS_WINDOWS && process.env['PATHEXT']) { - for (const extension of process.env['PATHEXT'].split(path.delimiter)) { - if (extension) { - extensions.push(extension); - } - } - } - // if it's rooted, return it if exists. otherwise return empty. - if (ioUtil.isRooted(tool)) { - const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions); - if (filePath) { - return [filePath]; - } - return []; - } - // if any path separators, return empty - if (tool.includes(path.sep)) { - return []; - } - // build the list of directories - // - // Note, technically "where" checks the current directory on Windows. From a toolkit perspective, - // it feels like we should not do this. Checking the current directory seems like more of a use - // case of a shell, and the which() function exposed by the toolkit should strive for consistency - // across platforms. - const directories = []; - if (process.env.PATH) { - for (const p of process.env.PATH.split(path.delimiter)) { - if (p) { - directories.push(p); - } - } - } - // find all matches - const matches = []; - for (const directory of directories) { - const filePath = yield ioUtil.tryGetExecutablePath(path.join(directory, tool), extensions); - if (filePath) { - matches.push(filePath); - } +function match(patterns, itemPath) { + let result = internal_match_kind_1.MatchKind.None; + for (const pattern of patterns) { + if (pattern.negate) { + result &= ~pattern.match(itemPath); } - return matches; - }); -} -exports.findInPath = findInPath; -function readCopyOptions(options) { - const force = options.force == null ? true : options.force; - const recursive = Boolean(options.recursive); - return { force, recursive }; -} -function cpDirRecursive(sourceDir, destDir, currentDepth, force) { - return __awaiter(this, void 0, void 0, function* () { - // Ensure there is not a run away recursive copy - if (currentDepth >= 255) - return; - currentDepth++; - yield mkdirP(destDir); - const files = yield ioUtil.readdir(sourceDir); - for (const fileName of files) { - const srcFile = `${sourceDir}/${fileName}`; - const destFile = `${destDir}/${fileName}`; - const srcFileStat = yield ioUtil.lstat(srcFile); - if (srcFileStat.isDirectory()) { - // Recurse - yield cpDirRecursive(srcFile, destFile, currentDepth, force); - } - else { - yield copyFile(srcFile, destFile, force); - } + else { + result |= pattern.match(itemPath); } - // Change the mode for the newly created directory - yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); - }); + } + return result; } -// Buffered file copy -function copyFile(srcFile, destFile, force) { - return __awaiter(this, void 0, void 0, function* () { - if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) { - // unlink/re-link it - try { - yield ioUtil.lstat(destFile); - yield ioUtil.unlink(destFile); - } - catch (e) { - // Try to override file permission - if (e.code === 'EPERM') { - yield ioUtil.chmod(destFile, '0666'); - yield ioUtil.unlink(destFile); - } - // other errors = it doesn't exist, no work to do - } - // Copy over symlink - const symlinkFull = yield ioUtil.readlink(srcFile); - yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? 'junction' : null); - } - else if (!(yield ioUtil.exists(destFile)) || force) { - yield ioUtil.copyFile(srcFile, destFile); - } - }); +exports.match = match; +/** + * Checks whether to descend further into the directory + */ +function partialMatch(patterns, itemPath) { + return patterns.some(x => !x.negate && x.partialMatch(itemPath)); } -//# sourceMappingURL=io.js.map +exports.partialMatch = partialMatch; +//# sourceMappingURL=internal-pattern-helper.js.map /***/ }), -/***/ 2557: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 4536: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; - +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__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)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; Object.defineProperty(exports, "__esModule", ({ value: true })); - -var tslib = __nccwpck_require__(9268); - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -var listenersMap = new WeakMap(); -var abortedMap = new WeakMap(); -/** - * An aborter instance implements AbortSignal interface, can abort HTTP requests. - * - * - Call AbortSignal.none to create a new AbortSignal instance that cannot be cancelled. - * Use `AbortSignal.none` when you are required to pass a cancellation token but the operation - * cannot or will not ever be cancelled. - * - * @example - * Abort without timeout - * ```ts - * await doAsyncWork(AbortSignal.none); - * ``` - */ -var AbortSignal = /** @class */ (function () { - function AbortSignal() { +exports.Pattern = void 0; +const os = __importStar(__nccwpck_require__(2087)); +const path = __importStar(__nccwpck_require__(5622)); +const pathHelper = __importStar(__nccwpck_require__(1849)); +const assert_1 = __importDefault(__nccwpck_require__(2357)); +const minimatch_1 = __nccwpck_require__(3973); +const internal_match_kind_1 = __nccwpck_require__(1063); +const internal_path_1 = __nccwpck_require__(6836); +const IS_WINDOWS = process.platform === 'win32'; +class Pattern { + constructor(patternOrNegate, isImplicitPattern = false, segments, homedir) { /** - * onabort event listener. + * Indicates whether matches should be excluded from the result set */ - this.onabort = null; - listenersMap.set(this, []); - abortedMap.set(this, false); + this.negate = false; + // Pattern overload + let pattern; + if (typeof patternOrNegate === 'string') { + pattern = patternOrNegate.trim(); + } + // Segments overload + else { + // Convert to pattern + segments = segments || []; + assert_1.default(segments.length, `Parameter 'segments' must not empty`); + const root = Pattern.getLiteral(segments[0]); + assert_1.default(root && pathHelper.hasAbsoluteRoot(root), `Parameter 'segments' first element must be a root path`); + pattern = new internal_path_1.Path(segments).toString().trim(); + if (patternOrNegate) { + pattern = `!${pattern}`; + } + } + // Negate + while (pattern.startsWith('!')) { + this.negate = !this.negate; + pattern = pattern.substr(1).trim(); + } + // Normalize slashes and ensures absolute root + pattern = Pattern.fixupPattern(pattern, homedir); + // Segments + this.segments = new internal_path_1.Path(pattern).segments; + // Trailing slash indicates the pattern should only match directories, not regular files + this.trailingSeparator = pathHelper + .normalizeSeparators(pattern) + .endsWith(path.sep); + pattern = pathHelper.safeTrimTrailingSeparator(pattern); + // Search path (literal path prior to the first glob segment) + let foundGlob = false; + const searchSegments = this.segments + .map(x => Pattern.getLiteral(x)) + .filter(x => !foundGlob && !(foundGlob = x === '')); + this.searchPath = new internal_path_1.Path(searchSegments).toString(); + // Root RegExp (required when determining partial match) + this.rootRegExp = new RegExp(Pattern.regExpEscape(searchSegments[0]), IS_WINDOWS ? 'i' : ''); + this.isImplicitPattern = isImplicitPattern; + // Create minimatch + const minimatchOptions = { + dot: true, + nobrace: true, + nocase: IS_WINDOWS, + nocomment: true, + noext: true, + nonegate: true + }; + pattern = IS_WINDOWS ? pattern.replace(/\\/g, '/') : pattern; + this.minimatch = new minimatch_1.Minimatch(pattern, minimatchOptions); } - Object.defineProperty(AbortSignal.prototype, "aborted", { - /** - * Status of whether aborted or not. - * - * @readonly - */ - get: function () { - if (!abortedMap.has(this)) { - throw new TypeError("Expected `this` to be an instance of AbortSignal."); + /** + * Matches the pattern against the specified path + */ + match(itemPath) { + // Last segment is globstar? + if (this.segments[this.segments.length - 1] === '**') { + // Normalize slashes + itemPath = pathHelper.normalizeSeparators(itemPath); + // Append a trailing slash. Otherwise Minimatch will not match the directory immediately + // preceding the globstar. For example, given the pattern `/foo/**`, Minimatch returns + // false for `/foo` but returns true for `/foo/`. Append a trailing slash to handle that quirk. + if (!itemPath.endsWith(path.sep) && this.isImplicitPattern === false) { + // Note, this is safe because the constructor ensures the pattern has an absolute root. + // For example, formats like C: and C:foo on Windows are resolved to an absolute root. + itemPath = `${itemPath}${path.sep}`; } - return abortedMap.get(this); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(AbortSignal, "none", { - /** - * Creates a new AbortSignal instance that will never be aborted. - * - * @readonly - */ - get: function () { - return new AbortSignal(); - }, - enumerable: false, - configurable: true - }); + } + else { + // Normalize slashes and trim unnecessary trailing slash + itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); + } + // Match + if (this.minimatch.match(itemPath)) { + return this.trailingSeparator ? internal_match_kind_1.MatchKind.Directory : internal_match_kind_1.MatchKind.All; + } + return internal_match_kind_1.MatchKind.None; + } /** - * Added new "abort" event listener, only support "abort" event. - * - * @param _type - Only support "abort" event - * @param listener - The listener to be added + * Indicates whether the pattern may match descendants of the specified path */ - AbortSignal.prototype.addEventListener = function ( - // tslint:disable-next-line:variable-name - _type, listener) { - if (!listenersMap.has(this)) { - throw new TypeError("Expected `this` to be an instance of AbortSignal."); + partialMatch(itemPath) { + // Normalize slashes and trim unnecessary trailing slash + itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); + // matchOne does not handle root path correctly + if (pathHelper.dirname(itemPath) === itemPath) { + return this.rootRegExp.test(itemPath); } - var listeners = listenersMap.get(this); - listeners.push(listener); - }; + return this.minimatch.matchOne(itemPath.split(IS_WINDOWS ? /\\+/ : /\/+/), this.minimatch.set[0], true); + } /** - * Remove "abort" event listener, only support "abort" event. - * - * @param _type - Only support "abort" event - * @param listener - The listener to be removed + * Escapes glob patterns within a path */ - AbortSignal.prototype.removeEventListener = function ( - // tslint:disable-next-line:variable-name - _type, listener) { - if (!listenersMap.has(this)) { - throw new TypeError("Expected `this` to be an instance of AbortSignal."); + static globEscape(s) { + return (IS_WINDOWS ? s : s.replace(/\\/g, '\\\\')) // escape '\' on Linux/macOS + .replace(/(\[)(?=[^/]+\])/g, '[[]') // escape '[' when ']' follows within the path segment + .replace(/\?/g, '[?]') // escape '?' + .replace(/\*/g, '[*]'); // escape '*' + } + /** + * Normalizes slashes and ensures absolute root + */ + static fixupPattern(pattern, homedir) { + // Empty + assert_1.default(pattern, 'pattern cannot be empty'); + // Must not contain `.` segment, unless first segment + // Must not contain `..` segment + const literalSegments = new internal_path_1.Path(pattern).segments.map(x => Pattern.getLiteral(x)); + assert_1.default(literalSegments.every((x, i) => (x !== '.' || i === 0) && x !== '..'), `Invalid pattern '${pattern}'. Relative pathing '.' and '..' is not allowed.`); + // Must not contain globs in root, e.g. Windows UNC path \\foo\b*r + assert_1.default(!pathHelper.hasRoot(pattern) || literalSegments[0], `Invalid pattern '${pattern}'. Root segment must not contain globs.`); + // Normalize slashes + pattern = pathHelper.normalizeSeparators(pattern); + // Replace leading `.` segment + if (pattern === '.' || pattern.startsWith(`.${path.sep}`)) { + pattern = Pattern.globEscape(process.cwd()) + pattern.substr(1); } - var listeners = listenersMap.get(this); - var index = listeners.indexOf(listener); - if (index > -1) { - listeners.splice(index, 1); + // Replace leading `~` segment + else if (pattern === '~' || pattern.startsWith(`~${path.sep}`)) { + homedir = homedir || os.homedir(); + assert_1.default(homedir, 'Unable to determine HOME directory'); + assert_1.default(pathHelper.hasAbsoluteRoot(homedir), `Expected HOME directory to be a rooted path. Actual '${homedir}'`); + pattern = Pattern.globEscape(homedir) + pattern.substr(1); } - }; + // Replace relative drive root, e.g. pattern is C: or C:foo + else if (IS_WINDOWS && + (pattern.match(/^[A-Z]:$/i) || pattern.match(/^[A-Z]:[^\\]/i))) { + let root = pathHelper.ensureAbsoluteRoot('C:\\dummy-root', pattern.substr(0, 2)); + if (pattern.length > 2 && !root.endsWith('\\')) { + root += '\\'; + } + pattern = Pattern.globEscape(root) + pattern.substr(2); + } + // Replace relative root, e.g. pattern is \ or \foo + else if (IS_WINDOWS && (pattern === '\\' || pattern.match(/^\\[^\\]/))) { + let root = pathHelper.ensureAbsoluteRoot('C:\\dummy-root', '\\'); + if (!root.endsWith('\\')) { + root += '\\'; + } + pattern = Pattern.globEscape(root) + pattern.substr(1); + } + // Otherwise ensure absolute root + else { + pattern = pathHelper.ensureAbsoluteRoot(Pattern.globEscape(process.cwd()), pattern); + } + return pathHelper.normalizeSeparators(pattern); + } /** - * Dispatches a synthetic event to the AbortSignal. + * Attempts to unescape a pattern segment to create a literal path segment. + * Otherwise returns empty string. */ - AbortSignal.prototype.dispatchEvent = function (_event) { - throw new Error("This is a stub dispatchEvent implementation that should not be used. It only exists for type-checking purposes."); - }; - return AbortSignal; -}()); -/** - * Helper to trigger an abort event immediately, the onabort and all abort event listeners will be triggered. - * Will try to trigger abort event for all linked AbortSignal nodes. - * - * - If there is a timeout, the timer will be cancelled. - * - If aborted is true, nothing will happen. - * - * @internal - */ -// eslint-disable-next-line @azure/azure-sdk/ts-use-interface-parameters -function abortSignal(signal) { - if (signal.aborted) { - return; + static getLiteral(segment) { + let literal = ''; + for (let i = 0; i < segment.length; i++) { + const c = segment[i]; + // Escape + if (c === '\\' && !IS_WINDOWS && i + 1 < segment.length) { + literal += segment[++i]; + continue; + } + // Wildcard + else if (c === '*' || c === '?') { + return ''; + } + // Character set + else if (c === '[' && i + 1 < segment.length) { + let set = ''; + let closed = -1; + for (let i2 = i + 1; i2 < segment.length; i2++) { + const c2 = segment[i2]; + // Escape + if (c2 === '\\' && !IS_WINDOWS && i2 + 1 < segment.length) { + set += segment[++i2]; + continue; + } + // Closed + else if (c2 === ']') { + closed = i2; + break; + } + // Otherwise + else { + set += c2; + } + } + // Closed? + if (closed >= 0) { + // Cannot convert + if (set.length > 1) { + return ''; + } + // Convert to literal + if (set) { + literal += set; + i = closed; + continue; + } + } + // Otherwise fall thru + } + // Append + literal += c; + } + return literal; } - if (signal.onabort) { - signal.onabort.call(signal); + /** + * Escapes regexp special characters + * https://javascript.info/regexp-escaping + */ + static regExpEscape(s) { + return s.replace(/[[\\^$.|?*+()]/g, '\\$&'); } - var listeners = listenersMap.get(signal); - if (listeners) { - // Create a copy of listeners so mutations to the array - // (e.g. via removeListener calls) don't affect the listeners - // we invoke. - listeners.slice().forEach(function (listener) { - listener.call(signal, { type: "abort" }); - }); - } - abortedMap.set(signal, true); } - -// Copyright (c) Microsoft Corporation. -/** - * This error is thrown when an asynchronous operation has been aborted. - * Check for this error by testing the `name` that the name property of the - * error matches `"AbortError"`. - * - * @example - * ```ts - * const controller = new AbortController(); - * controller.abort(); - * try { - * doAsyncWork(controller.signal) - * } catch (e) { - * if (e.name === 'AbortError') { - * // handle abort error here. - * } - * } - * ``` - */ -var AbortError = /** @class */ (function (_super) { - tslib.__extends(AbortError, _super); - function AbortError(message) { - var _this = _super.call(this, message) || this; - _this.name = "AbortError"; - return _this; - } - return AbortError; -}(Error)); -/** - * An AbortController provides an AbortSignal and the associated controls to signal - * that an asynchronous operation should be aborted. - * - * @example - * Abort an operation when another event fires - * ```ts - * const controller = new AbortController(); - * const signal = controller.signal; - * doAsyncWork(signal); - * button.addEventListener('click', () => controller.abort()); - * ``` - * - * @example - * Share aborter cross multiple operations in 30s - * ```ts - * // Upload the same data to 2 different data centers at the same time, - * // abort another when any of them is finished - * const controller = AbortController.withTimeout(30 * 1000); - * doAsyncWork(controller.signal).then(controller.abort); - * doAsyncWork(controller.signal).then(controller.abort); - *``` - * - * @example - * Cascaded aborting - * ```ts - * // All operations can't take more than 30 seconds - * const aborter = Aborter.timeout(30 * 1000); - * - * // Following 2 operations can't take more than 25 seconds - * await doAsyncWork(aborter.withTimeout(25 * 1000)); - * await doAsyncWork(aborter.withTimeout(25 * 1000)); - * ``` - */ -var AbortController = /** @class */ (function () { - // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types - function AbortController(parentSignals) { - var _this = this; - this._signal = new AbortSignal(); - if (!parentSignals) { - return; - } - // coerce parentSignals into an array - if (!Array.isArray(parentSignals)) { - // eslint-disable-next-line prefer-rest-params - parentSignals = arguments; - } - for (var _i = 0, parentSignals_1 = parentSignals; _i < parentSignals_1.length; _i++) { - var parentSignal = parentSignals_1[_i]; - // if the parent signal has already had abort() called, - // then call abort on this signal as well. - if (parentSignal.aborted) { - this.abort(); - } - else { - // when the parent signal aborts, this signal should as well. - parentSignal.addEventListener("abort", function () { - _this.abort(); - }); - } - } - } - Object.defineProperty(AbortController.prototype, "signal", { - /** - * The AbortSignal associated with this controller that will signal aborted - * when the abort method is called on this controller. - * - * @readonly - */ - get: function () { - return this._signal; - }, - enumerable: false, - configurable: true - }); - /** - * Signal that any operations passed this controller's associated abort signal - * to cancel any remaining work and throw an `AbortError`. - */ - AbortController.prototype.abort = function () { - abortSignal(this._signal); - }; - /** - * Creates a new AbortSignal instance that will abort after the provided ms. - * @param ms - Elapsed time in milliseconds to trigger an abort. - */ - AbortController.timeout = function (ms) { - var signal = new AbortSignal(); - var timer = setTimeout(abortSignal, ms, signal); - // Prevent the active Timer from keeping the Node.js event loop active. - if (typeof timer.unref === "function") { - timer.unref(); - } - return signal; - }; - return AbortController; -}()); - -exports.AbortController = AbortController; -exports.AbortError = AbortError; -exports.AbortSignal = AbortSignal; -//# sourceMappingURL=index.js.map - - -/***/ }), - -/***/ 9268: -/***/ ((module) => { - -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, System, Reflect, Promise */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __createBinding; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); - } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; - } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; - - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; - - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; - - __awaiter = function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; - - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; - - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); - - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; - - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; - - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; - - __spreadArray = function (to, from) { - for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) - to[j] = from[i]; - return to; - }; - - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; - - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } - }; - - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; - - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; - - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - - __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)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; - - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; - - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); -}); - +exports.Pattern = Pattern; +//# sourceMappingURL=internal-pattern.js.map /***/ }), -/***/ 6821: -/***/ (() => { +/***/ 9117: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -if (typeof Symbol === undefined || !Symbol.asyncIterator) { - Symbol.asyncIterator = Symbol.for("Symbol.asyncIterator"); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.SearchState = void 0; +class SearchState { + constructor(path, level) { + this.path = path; + this.level = level; + } } -//# sourceMappingURL=index.js.map +exports.SearchState = SearchState; +//# sourceMappingURL=internal-search-state.js.map /***/ }), -/***/ 9645: +/***/ 3702: /***/ ((__unused_webpack_module, exports) => { "use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * A static-key-based credential that supports updating - * the underlying key value. - */ -var AzureKeyCredential = /** @class */ (function () { - /** - * Create an instance of an AzureKeyCredential for use - * with a service client. - * - * @param key - The initial value of the key to use in authentication - */ - function AzureKeyCredential(key) { - if (!key) { - throw new Error("key must be a non-empty string"); - } - this._key = key; +class BasicCredentialHandler { + constructor(username, password) { + this.username = username; + this.password = password; } - Object.defineProperty(AzureKeyCredential.prototype, "key", { - /** - * The value of the key to be used in authentication - */ - get: function () { - return this._key; - }, - enumerable: false, - configurable: true - }); - /** - * Change the value of the key. - * - * Updates will take effect upon the next request after - * updating the key value. - * - * @param newKey - The new key value to be used - */ - AzureKeyCredential.prototype.update = function (newKey) { - this._key = newKey; - }; - return AzureKeyCredential; -}()); - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * Helper TypeGuard that checks if something is defined or not. - * @param thing - Anything - * @internal - */ -function isDefined(thing) { - return typeof thing !== "undefined" && thing !== null; -} -/** - * Helper TypeGuard that checks if the input is an object with the specified properties. - * Note: The properties may be inherited. - * @param thing - Anything. - * @param properties - The name of the properties that should appear in the object. - * @internal - */ -function isObjectWithProperties(thing, properties) { - if (!isDefined(thing) || typeof thing !== "object") { + prepareRequest(options) { + options.headers['Authorization'] = + 'Basic ' + + Buffer.from(this.username + ':' + this.password).toString('base64'); + } + // This handler cannot handle 401 + canHandleAuthentication(response) { return false; } - for (var _i = 0, properties_1 = properties; _i < properties_1.length; _i++) { - var property = properties_1[_i]; - if (!objectHasProperty(thing, property)) { - return false; - } + handleAuthentication(httpClient, requestInfo, objs) { + return null; } - return true; } -/** - * Helper TypeGuard that checks if the input is an object with the specified property. - * Note: The property may be inherited. - * @param thing - Any object. - * @param property - The name of the property that should appear in the object. - * @internal - */ -function objectHasProperty(thing, property) { - return typeof thing === "object" && property in thing; -} - -// Copyright (c) Microsoft Corporation. -/** - * A static name/key-based credential that supports updating - * the underlying name and key values. - */ -var AzureNamedKeyCredential = /** @class */ (function () { - /** - * Create an instance of an AzureNamedKeyCredential for use - * with a service client. - * - * @param name - The initial value of the name to use in authentication. - * @param key - The initial value of the key to use in authentication. - */ - function AzureNamedKeyCredential(name, key) { - if (!name || !key) { - throw new TypeError("name and key must be non-empty strings"); - } - this._name = name; - this._key = key; +exports.BasicCredentialHandler = BasicCredentialHandler; +class BearerCredentialHandler { + constructor(token) { + this.token = token; } - Object.defineProperty(AzureNamedKeyCredential.prototype, "key", { - /** - * The value of the key to be used in authentication. - */ - get: function () { - return this._key; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(AzureNamedKeyCredential.prototype, "name", { - /** - * The value of the name to be used in authentication. - */ - get: function () { - return this._name; - }, - enumerable: false, - configurable: true - }); - /** - * Change the value of the key. - * - * Updates will take effect upon the next request after - * updating the key value. - * - * @param newName - The new name value to be used. - * @param newKey - The new key value to be used. - */ - AzureNamedKeyCredential.prototype.update = function (newName, newKey) { - if (!newName || !newKey) { - throw new TypeError("newName and newKey must be non-empty strings"); - } - this._name = newName; - this._key = newKey; - }; - return AzureNamedKeyCredential; -}()); -/** - * Tests an object to determine whether it implements NamedKeyCredential. - * - * @param credential - The assumed NamedKeyCredential to be tested. - */ -function isNamedKeyCredential(credential) { - return (isObjectWithProperties(credential, ["name", "key"]) && - typeof credential.key === "string" && - typeof credential.name === "string"); -} - -// Copyright (c) Microsoft Corporation. -/** - * A static-signature-based credential that supports updating - * the underlying signature value. - */ -var AzureSASCredential = /** @class */ (function () { - /** - * Create an instance of an AzureSASCredential for use - * with a service client. - * - * @param signature - The initial value of the shared access signature to use in authentication - */ - function AzureSASCredential(signature) { - if (!signature) { - throw new Error("shared access signature must be a non-empty string"); - } - this._signature = signature; + // currently implements pre-authorization + // TODO: support preAuth = false where it hooks on 401 + prepareRequest(options) { + options.headers['Authorization'] = 'Bearer ' + this.token; + } + // This handler cannot handle 401 + canHandleAuthentication(response) { + return false; + } + handleAuthentication(httpClient, requestInfo, objs) { + return null; } - Object.defineProperty(AzureSASCredential.prototype, "signature", { - /** - * The value of the shared access signature to be used in authentication - */ - get: function () { - return this._signature; - }, - enumerable: false, - configurable: true - }); - /** - * Change the value of the signature. - * - * Updates will take effect upon the next request after - * updating the signature value. - * - * @param newSignature - The new shared access signature value to be used - */ - AzureSASCredential.prototype.update = function (newSignature) { - if (!newSignature) { - throw new Error("shared access signature must be a non-empty string"); - } - this._signature = newSignature; - }; - return AzureSASCredential; -}()); -/** - * Tests an object to determine whether it implements SASCredential. - * - * @param credential - The assumed SASCredential to be tested. - */ -function isSASCredential(credential) { - return (isObjectWithProperties(credential, ["signature"]) && typeof credential.signature === "string"); } - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * Tests an object to determine whether it implements TokenCredential. - * - * @param credential - The assumed TokenCredential to be tested. - */ -function isTokenCredential(credential) { - // Check for an object with a 'getToken' function and possibly with - // a 'signRequest' function. We do this check to make sure that - // a ServiceClientCredentials implementor (like TokenClientCredentials - // in ms-rest-nodeauth) doesn't get mistaken for a TokenCredential if - // it doesn't actually implement TokenCredential also. - var castCredential = credential; - return (castCredential && - typeof castCredential.getToken === "function" && - (castCredential.signRequest === undefined || castCredential.getToken.length > 0)); +exports.BearerCredentialHandler = BearerCredentialHandler; +class PersonalAccessTokenCredentialHandler { + constructor(token) { + this.token = token; + } + // currently implements pre-authorization + // TODO: support preAuth = false where it hooks on 401 + prepareRequest(options) { + options.headers['Authorization'] = + 'Basic ' + Buffer.from('PAT:' + this.token).toString('base64'); + } + // This handler cannot handle 401 + canHandleAuthentication(response) { + return false; + } + handleAuthentication(httpClient, requestInfo, objs) { + return null; + } } - -exports.AzureKeyCredential = AzureKeyCredential; -exports.AzureNamedKeyCredential = AzureNamedKeyCredential; -exports.AzureSASCredential = AzureSASCredential; -exports.isNamedKeyCredential = isNamedKeyCredential; -exports.isSASCredential = isSASCredential; -exports.isTokenCredential = isTokenCredential; -//# sourceMappingURL=index.js.map +exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; /***/ }), -/***/ 4607: +/***/ 9925: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } - -var tslib = __nccwpck_require__(2107); -var uuid = __nccwpck_require__(3415); -var tough = __nccwpck_require__(8165); -var http = __nccwpck_require__(8605); -var https = __nccwpck_require__(7211); -var node_fetch = _interopDefault(__nccwpck_require__(467)); -var abortController = __nccwpck_require__(2557); -var FormData = _interopDefault(__nccwpck_require__(6279)); -var util = __nccwpck_require__(1669); -var url = __nccwpck_require__(8835); -var stream = __nccwpck_require__(2413); -var logger$1 = __nccwpck_require__(3233); -var tunnel = __nccwpck_require__(4294); -var coreAuth = __nccwpck_require__(9645); -var xml2js = __nccwpck_require__(6189); -var os = __nccwpck_require__(2087); -var coreTracing = __nccwpck_require__(1754); -__nccwpck_require__(6821); - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. +const http = __nccwpck_require__(8605); +const https = __nccwpck_require__(7211); +const pm = __nccwpck_require__(6443); +let tunnel; +var HttpCodes; +(function (HttpCodes) { + HttpCodes[HttpCodes["OK"] = 200] = "OK"; + HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices"; + HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently"; + HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved"; + HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther"; + HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified"; + HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy"; + HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy"; + HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect"; + HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect"; + HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest"; + HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized"; + HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired"; + HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden"; + HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound"; + HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed"; + HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable"; + HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired"; + HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout"; + HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict"; + HttpCodes[HttpCodes["Gone"] = 410] = "Gone"; + HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests"; + HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError"; + HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented"; + HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway"; + HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable"; + HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout"; +})(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {})); +var Headers; +(function (Headers) { + Headers["Accept"] = "accept"; + Headers["ContentType"] = "content-type"; +})(Headers = exports.Headers || (exports.Headers = {})); +var MediaTypes; +(function (MediaTypes) { + MediaTypes["ApplicationJson"] = "application/json"; +})(MediaTypes = exports.MediaTypes || (exports.MediaTypes = {})); /** - * A collection of HttpHeaders that can be sent with a HTTP request. + * Returns the proxy URL, depending upon the supplied url and proxy environment variables. + * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com */ -function getHeaderKey(headerName) { - return headerName.toLowerCase(); +function getProxyUrl(serverUrl) { + let proxyUrl = pm.getProxyUrl(new URL(serverUrl)); + return proxyUrl ? proxyUrl.href : ''; } -function isHttpHeadersLike(object) { - if (object && typeof object === "object") { - var castObject = object; - if (typeof castObject.rawHeaders === "function" && - typeof castObject.clone === "function" && - typeof castObject.get === "function" && - typeof castObject.set === "function" && - typeof castObject.contains === "function" && - typeof castObject.remove === "function" && - typeof castObject.headersArray === "function" && - typeof castObject.headerValues === "function" && - typeof castObject.headerNames === "function" && - typeof castObject.toJson === "function") { - return true; - } +exports.getProxyUrl = getProxyUrl; +const HttpRedirectCodes = [ + HttpCodes.MovedPermanently, + HttpCodes.ResourceMoved, + HttpCodes.SeeOther, + HttpCodes.TemporaryRedirect, + HttpCodes.PermanentRedirect +]; +const HttpResponseRetryCodes = [ + HttpCodes.BadGateway, + HttpCodes.ServiceUnavailable, + HttpCodes.GatewayTimeout +]; +const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD']; +const ExponentialBackoffCeiling = 10; +const ExponentialBackoffTimeSlice = 5; +class HttpClientError extends Error { + constructor(message, statusCode) { + super(message); + this.name = 'HttpClientError'; + this.statusCode = statusCode; + Object.setPrototypeOf(this, HttpClientError.prototype); } - return false; } -/** - * A collection of HTTP header key/value pairs. - */ -var HttpHeaders = /** @class */ (function () { - function HttpHeaders(rawHeaders) { - this._headersMap = {}; - if (rawHeaders) { - for (var headerName in rawHeaders) { - this.set(headerName, rawHeaders[headerName]); +exports.HttpClientError = HttpClientError; +class HttpClientResponse { + constructor(message) { + this.message = message; + } + readBody() { + return new Promise(async (resolve, reject) => { + let output = Buffer.alloc(0); + this.message.on('data', (chunk) => { + output = Buffer.concat([output, chunk]); + }); + this.message.on('end', () => { + resolve(output.toString()); + }); + }); + } +} +exports.HttpClientResponse = HttpClientResponse; +function isHttps(requestUrl) { + let parsedUrl = new URL(requestUrl); + return parsedUrl.protocol === 'https:'; +} +exports.isHttps = isHttps; +class HttpClient { + constructor(userAgent, handlers, requestOptions) { + this._ignoreSslError = false; + this._allowRedirects = true; + this._allowRedirectDowngrade = false; + this._maxRedirects = 50; + this._allowRetries = false; + this._maxRetries = 1; + this._keepAlive = false; + this._disposed = false; + this.userAgent = userAgent; + this.handlers = handlers || []; + this.requestOptions = requestOptions; + if (requestOptions) { + if (requestOptions.ignoreSslError != null) { + this._ignoreSslError = requestOptions.ignoreSslError; + } + this._socketTimeout = requestOptions.socketTimeout; + if (requestOptions.allowRedirects != null) { + this._allowRedirects = requestOptions.allowRedirects; + } + if (requestOptions.allowRedirectDowngrade != null) { + this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade; + } + if (requestOptions.maxRedirects != null) { + this._maxRedirects = Math.max(requestOptions.maxRedirects, 0); + } + if (requestOptions.keepAlive != null) { + this._keepAlive = requestOptions.keepAlive; + } + if (requestOptions.allowRetries != null) { + this._allowRetries = requestOptions.allowRetries; + } + if (requestOptions.maxRetries != null) { + this._maxRetries = requestOptions.maxRetries; } } } + options(requestUrl, additionalHeaders) { + return this.request('OPTIONS', requestUrl, null, additionalHeaders || {}); + } + get(requestUrl, additionalHeaders) { + return this.request('GET', requestUrl, null, additionalHeaders || {}); + } + del(requestUrl, additionalHeaders) { + return this.request('DELETE', requestUrl, null, additionalHeaders || {}); + } + post(requestUrl, data, additionalHeaders) { + return this.request('POST', requestUrl, data, additionalHeaders || {}); + } + patch(requestUrl, data, additionalHeaders) { + return this.request('PATCH', requestUrl, data, additionalHeaders || {}); + } + put(requestUrl, data, additionalHeaders) { + return this.request('PUT', requestUrl, data, additionalHeaders || {}); + } + head(requestUrl, additionalHeaders) { + return this.request('HEAD', requestUrl, null, additionalHeaders || {}); + } + sendStream(verb, requestUrl, stream, additionalHeaders) { + return this.request(verb, requestUrl, stream, additionalHeaders); + } /** - * Set a header in this collection with the provided name and value. The name is - * case-insensitive. - * @param headerName - The name of the header to set. This value is case-insensitive. - * @param headerValue - The value of the header to set. - */ - HttpHeaders.prototype.set = function (headerName, headerValue) { - this._headersMap[getHeaderKey(headerName)] = { - name: headerName, - value: headerValue.toString() - }; - }; - /** - * Get the header value for the provided header name, or undefined if no header exists in this - * collection with the provided name. - * @param headerName - The name of the header. - */ - HttpHeaders.prototype.get = function (headerName) { - var header = this._headersMap[getHeaderKey(headerName)]; - return !header ? undefined : header.value; - }; - /** - * Get whether or not this header collection contains a header entry for the provided header name. - */ - HttpHeaders.prototype.contains = function (headerName) { - return !!this._headersMap[getHeaderKey(headerName)]; - }; - /** - * Remove the header with the provided headerName. Return whether or not the header existed and - * was removed. - * @param headerName - The name of the header to remove. - */ - HttpHeaders.prototype.remove = function (headerName) { - var result = this.contains(headerName); - delete this._headersMap[getHeaderKey(headerName)]; - return result; - }; - /** - * Get the headers that are contained this collection as an object. + * Gets a typed object from an endpoint + * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise */ - HttpHeaders.prototype.rawHeaders = function () { - var result = {}; - for (var headerKey in this._headersMap) { - var header = this._headersMap[headerKey]; - result[header.name.toLowerCase()] = header.value; - } - return result; - }; + async getJson(requestUrl, additionalHeaders = {}) { + additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); + let res = await this.get(requestUrl, additionalHeaders); + return this._processResponse(res, this.requestOptions); + } + async postJson(requestUrl, obj, additionalHeaders = {}) { + let data = JSON.stringify(obj, null, 2); + additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); + additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); + let res = await this.post(requestUrl, data, additionalHeaders); + return this._processResponse(res, this.requestOptions); + } + async putJson(requestUrl, obj, additionalHeaders = {}) { + let data = JSON.stringify(obj, null, 2); + additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); + additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); + let res = await this.put(requestUrl, data, additionalHeaders); + return this._processResponse(res, this.requestOptions); + } + async patchJson(requestUrl, obj, additionalHeaders = {}) { + let data = JSON.stringify(obj, null, 2); + additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); + additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); + let res = await this.patch(requestUrl, data, additionalHeaders); + return this._processResponse(res, this.requestOptions); + } /** - * Get the headers that are contained in this collection as an array. + * Makes a raw http request. + * All other methods such as get, post, patch, and request ultimately call this. + * Prefer get, del, post and patch */ - HttpHeaders.prototype.headersArray = function () { - var headers = []; - for (var headerKey in this._headersMap) { - headers.push(this._headersMap[headerKey]); + async request(verb, requestUrl, data, headers) { + if (this._disposed) { + throw new Error('Client has already been disposed.'); } - return headers; - }; - /** - * Get the header names that are contained in this collection. - */ - HttpHeaders.prototype.headerNames = function () { - var headerNames = []; - var headers = this.headersArray(); - for (var i = 0; i < headers.length; ++i) { - headerNames.push(headers[i].name); + let parsedUrl = new URL(requestUrl); + let info = this._prepareRequest(verb, parsedUrl, headers); + // Only perform retries on reads since writes may not be idempotent. + let maxTries = this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1 + ? this._maxRetries + 1 + : 1; + let numTries = 0; + let response; + while (numTries < maxTries) { + response = await this.requestRaw(info, data); + // Check if it's an authentication challenge + if (response && + response.message && + response.message.statusCode === HttpCodes.Unauthorized) { + let authenticationHandler; + for (let i = 0; i < this.handlers.length; i++) { + if (this.handlers[i].canHandleAuthentication(response)) { + authenticationHandler = this.handlers[i]; + break; + } + } + if (authenticationHandler) { + return authenticationHandler.handleAuthentication(this, info, data); + } + else { + // We have received an unauthorized response but have no handlers to handle it. + // Let the response return to the caller. + return response; + } + } + let redirectsRemaining = this._maxRedirects; + while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1 && + this._allowRedirects && + redirectsRemaining > 0) { + const redirectUrl = response.message.headers['location']; + if (!redirectUrl) { + // if there's no location to redirect to, we won't + break; + } + let parsedRedirectUrl = new URL(redirectUrl); + if (parsedUrl.protocol == 'https:' && + parsedUrl.protocol != parsedRedirectUrl.protocol && + !this._allowRedirectDowngrade) { + throw new Error('Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.'); + } + // we need to finish reading the response before reassigning response + // which will leak the open socket. + await response.readBody(); + // strip authorization header if redirected to a different hostname + if (parsedRedirectUrl.hostname !== parsedUrl.hostname) { + for (let header in headers) { + // header names are case insensitive + if (header.toLowerCase() === 'authorization') { + delete headers[header]; + } + } + } + // let's make the request with the new redirectUrl + info = this._prepareRequest(verb, parsedRedirectUrl, headers); + response = await this.requestRaw(info, data); + redirectsRemaining--; + } + if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) { + // If not a retry code, return immediately instead of retrying + return response; + } + numTries += 1; + if (numTries < maxTries) { + await response.readBody(); + await this._performExponentialBackoff(numTries); + } } - return headerNames; - }; + return response; + } /** - * Get the header values that are contained in this collection. + * Needs to be called if keepAlive is set to true in request options. */ - HttpHeaders.prototype.headerValues = function () { - var headerValues = []; - var headers = this.headersArray(); - for (var i = 0; i < headers.length; ++i) { - headerValues.push(headers[i].value); + dispose() { + if (this._agent) { + this._agent.destroy(); } - return headerValues; - }; - /** - * Get the JSON object representation of this HTTP header collection. - */ - HttpHeaders.prototype.toJson = function () { - return this.rawHeaders(); - }; - /** - * Get the string representation of this HTTP header collection. - */ - HttpHeaders.prototype.toString = function () { - return JSON.stringify(this.toJson()); - }; - /** - * Create a deep clone/copy of this HttpHeaders collection. - */ - HttpHeaders.prototype.clone = function () { - return new HttpHeaders(this.rawHeaders()); - }; - return HttpHeaders; -}()); - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * Encodes a string in base64 format. - * @param value - The string to encode - */ -function encodeString(value) { - return Buffer.from(value).toString("base64"); -} -/** - * Encodes a byte array in base64 format. - * @param value - The Uint8Aray to encode - */ -function encodeByteArray(value) { - // Buffer.from accepts | -- the TypeScript definition is off here - // https://nodejs.org/api/buffer.html#buffer_class_method_buffer_from_arraybuffer_byteoffset_length - var bufferValue = value instanceof Buffer ? value : Buffer.from(value.buffer); - return bufferValue.toString("base64"); -} -/** - * Decodes a base64 string into a byte array. - * @param value - The base64 string to decode - */ -function decodeString(value) { - return Buffer.from(value, "base64"); -} - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -var Constants = { - /** - * The core-http version - */ - coreHttpVersion: "1.2.4", - /** - * Specifies HTTP. - */ - HTTP: "http:", - /** - * Specifies HTTPS. - */ - HTTPS: "https:", - /** - * Specifies HTTP Proxy. - */ - HTTP_PROXY: "HTTP_PROXY", - /** - * Specifies HTTPS Proxy. - */ - HTTPS_PROXY: "HTTPS_PROXY", + this._disposed = true; + } /** - * Specifies NO Proxy. + * Raw request. + * @param info + * @param data */ - NO_PROXY: "NO_PROXY", + requestRaw(info, data) { + return new Promise((resolve, reject) => { + let callbackForResult = function (err, res) { + if (err) { + reject(err); + } + resolve(res); + }; + this.requestRawWithCallback(info, data, callbackForResult); + }); + } /** - * Specifies ALL Proxy. + * Raw request with callback. + * @param info + * @param data + * @param onResult */ - ALL_PROXY: "ALL_PROXY", - HttpConstants: { - /** - * Http Verbs - */ - HttpVerbs: { - PUT: "PUT", - GET: "GET", - DELETE: "DELETE", - POST: "POST", - MERGE: "MERGE", - HEAD: "HEAD", - PATCH: "PATCH" - }, - StatusCodes: { - TooManyRequests: 429 + requestRawWithCallback(info, data, onResult) { + let socket; + if (typeof data === 'string') { + info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8'); } - }, - /** - * Defines constants for use with HTTP headers. - */ - HeaderConstants: { - /** - * The Authorization header. - */ - AUTHORIZATION: "authorization", - AUTHORIZATION_SCHEME: "Bearer", - /** - * The Retry-After response-header field can be used with a 503 (Service - * Unavailable) or 349 (Too Many Requests) responses to indicate how long - * the service is expected to be unavailable to the requesting client. - */ - RETRY_AFTER: "Retry-After", - /** - * The UserAgent header. - */ - USER_AGENT: "User-Agent" - } -}; - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * Default key used to access the XML attributes. - */ -var XML_ATTRKEY = "$"; -/** - * Default key used to access the XML value content. - */ -var XML_CHARKEY = "_"; - -// Copyright (c) Microsoft Corporation. -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; -/** - * A constant that indicates whether the environment is node.js or browser based. - */ -var isNode = typeof process !== "undefined" && - !!process.version && - !!process.versions && - !!process.versions.node; -/** - * Encodes an URI. - * - * @param uri - The URI to be encoded. - * @returns The encoded URI. - */ -function encodeUri(uri) { - return encodeURIComponent(uri) - .replace(/!/g, "%21") - .replace(/"/g, "%27") - .replace(/\(/g, "%28") - .replace(/\)/g, "%29") - .replace(/\*/g, "%2A"); -} -/** - * Returns a stripped version of the Http Response which only contains body, - * headers and the status. - * - * @param response - The Http Response - * @returns The stripped version of Http Response. - */ -function stripResponse(response) { - var strippedResponse = {}; - strippedResponse.body = response.bodyAsText; - strippedResponse.headers = response.headers; - strippedResponse.status = response.status; - return strippedResponse; -} -/** - * Returns a stripped version of the Http Request that does not contain the - * Authorization header. - * - * @param request - The Http Request object - * @returns The stripped version of Http Request. - */ -function stripRequest(request) { - var strippedRequest = request.clone(); - if (strippedRequest.headers) { - strippedRequest.headers.remove("authorization"); - } - return strippedRequest; -} -/** - * Validates the given uuid as a string - * - * @param uuid - The uuid as a string that needs to be validated - * @returns True if the uuid is valid; false otherwise. - */ -function isValidUuid(uuid) { - return validUuidRegex.test(uuid); -} -/** - * Generated UUID - * - * @returns RFC4122 v4 UUID. - */ -function generateUuid() { - return uuid.v4(); -} -/** - * Executes an array of promises sequentially. Inspiration of this method is here: - * https://pouchdb.com/2015/05/18/we-have-a-problem-with-promises.html. An awesome blog on promises! - * - * @param promiseFactories - An array of promise factories(A function that return a promise) - * @param kickstart - Input to the first promise that is used to kickstart the promise chain. - * If not provided then the promise chain starts with undefined. - * @returns A chain of resolved or rejected promises - */ -function executePromisesSequentially(promiseFactories, kickstart) { - var result = Promise.resolve(kickstart); - promiseFactories.forEach(function (promiseFactory) { - result = result.then(promiseFactory); - }); - return result; -} -/** - * A wrapper for setTimeout that resolves a promise after t milliseconds. - * @param t - The number of milliseconds to be delayed. - * @param value - The value to be resolved with after a timeout of t milliseconds. - * @returns Resolved promise - */ -function delay(t, value) { - return new Promise(function (resolve) { return setTimeout(function () { return resolve(value); }, t); }); -} -/** - * Converts a Promise to a callback. - * @param promise - The Promise to be converted to a callback - * @returns A function that takes the callback `(cb: Function) => void` - * @deprecated generated code should instead depend on responseToBody - */ -// eslint-disable-next-line @typescript-eslint/ban-types -function promiseToCallback(promise) { - if (typeof promise.then !== "function") { - throw new Error("The provided input is not a Promise."); - } - // eslint-disable-next-line @typescript-eslint/ban-types - return function (cb) { - promise - .then(function (data) { - // eslint-disable-next-line promise/no-callback-in-promise - return cb(undefined, data); - }) - .catch(function (err) { - // eslint-disable-next-line promise/no-callback-in-promise - cb(err); + let callbackCalled = false; + let handleResult = (err, res) => { + if (!callbackCalled) { + callbackCalled = true; + onResult(err, res); + } + }; + let req = info.httpModule.request(info.options, (msg) => { + let res = new HttpClientResponse(msg); + handleResult(null, res); }); - }; -} -/** - * Converts a Promise to a service callback. - * @param promise - The Promise of HttpOperationResponse to be converted to a service callback - * @returns A function that takes the service callback (cb: ServiceCallback): void - */ -function promiseToServiceCallback(promise) { - if (typeof promise.then !== "function") { - throw new Error("The provided input is not a Promise."); - } - return function (cb) { - promise - .then(function (data) { - return process.nextTick(cb, undefined, data.parsedBody, data.request, data); - }) - .catch(function (err) { - process.nextTick(cb, err); + req.on('socket', sock => { + socket = sock; }); - }; -} -function prepareXMLRootList(obj, elementName, xmlNamespaceKey, xmlNamespace) { - var _a, _b, _c; - if (!Array.isArray(obj)) { - obj = [obj]; + // If we ever get disconnected, we want the socket to timeout eventually + req.setTimeout(this._socketTimeout || 3 * 60000, () => { + if (socket) { + socket.end(); + } + handleResult(new Error('Request timeout: ' + info.options.path), null); + }); + req.on('error', function (err) { + // err has statusCode property + // res should have headers + handleResult(err, null); + }); + if (data && typeof data === 'string') { + req.write(data, 'utf8'); + } + if (data && typeof data !== 'string') { + data.on('close', function () { + req.end(); + }); + data.pipe(req); + } + else { + req.end(); + } } - if (!xmlNamespaceKey || !xmlNamespace) { - return _a = {}, _a[elementName] = obj, _a; + /** + * Gets an http agent. This function is useful when you need an http agent that handles + * routing through a proxy server - depending upon the url and proxy environment variables. + * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com + */ + getAgent(serverUrl) { + let parsedUrl = new URL(serverUrl); + return this._getAgent(parsedUrl); } - var result = (_b = {}, _b[elementName] = obj, _b); - result[XML_ATTRKEY] = (_c = {}, _c[xmlNamespaceKey] = xmlNamespace, _c); - return result; -} -/** - * Applies the properties on the prototype of sourceCtors to the prototype of targetCtor - * @param targetCtor - The target object on which the properties need to be applied. - * @param sourceCtors - An array of source objects from which the properties need to be taken. - */ -function applyMixins(targetCtorParam, sourceCtors) { - var castTargetCtorParam = targetCtorParam; - sourceCtors.forEach(function (sourceCtor) { - Object.getOwnPropertyNames(sourceCtor.prototype).forEach(function (name) { - castTargetCtorParam.prototype[name] = sourceCtor.prototype[name]; - }); - }); -} -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)?)?$/; -/** - * Indicates whether the given string is in ISO 8601 format. - * @param value - The value to be validated for ISO 8601 duration format. - * @returns `true` if valid, `false` otherwise. - */ -function isDuration(value) { - return validateISODuration.test(value); -} -/** - * Replace all of the instances of searchValue in value with the provided replaceValue. - * @param value - The value to search and replace in. - * @param searchValue - The value to search for in the value argument. - * @param replaceValue - The value to replace searchValue with in the value argument. - * @returns The value where each instance of searchValue was replaced with replacedValue. - */ -function replaceAll(value, searchValue, replaceValue) { - return !value || !searchValue ? value : value.split(searchValue).join(replaceValue || ""); -} -/** - * Determines whether the given entity is a basic/primitive type - * (string, number, boolean, null, undefined). - * @param value - Any entity - * @returns true is it is primitive type, false otherwise. - */ -function isPrimitiveType(value) { - return (typeof value !== "object" && typeof value !== "function") || value === null; -} -function getEnvironmentValue(name) { - if (process.env[name]) { - return process.env[name]; + _prepareRequest(method, requestUrl, headers) { + const info = {}; + info.parsedUrl = requestUrl; + const usingSsl = info.parsedUrl.protocol === 'https:'; + info.httpModule = usingSsl ? https : http; + const defaultPort = usingSsl ? 443 : 80; + info.options = {}; + info.options.host = info.parsedUrl.hostname; + info.options.port = info.parsedUrl.port + ? parseInt(info.parsedUrl.port) + : defaultPort; + info.options.path = + (info.parsedUrl.pathname || '') + (info.parsedUrl.search || ''); + info.options.method = method; + info.options.headers = this._mergeHeaders(headers); + if (this.userAgent != null) { + info.options.headers['user-agent'] = this.userAgent; + } + info.options.agent = this._getAgent(info.parsedUrl); + // gives handlers an opportunity to participate + if (this.handlers) { + this.handlers.forEach(handler => { + handler.prepareRequest(info.options); + }); + } + return info; } - else if (process.env[name.toLowerCase()]) { - return process.env[name.toLowerCase()]; + _mergeHeaders(headers) { + const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {}); + if (this.requestOptions && this.requestOptions.headers) { + return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers)); + } + return lowercaseKeys(headers || {}); } - return undefined; -} - -// Copyright (c) Microsoft Corporation. -var Serializer = /** @class */ (function () { - function Serializer(modelMappers, isXML) { - if (modelMappers === void 0) { modelMappers = {}; } - this.modelMappers = modelMappers; - this.isXML = isXML; - } - Serializer.prototype.validateConstraints = function (mapper, value, objectName) { - var failValidation = function (constraintName, constraintValue) { - throw new Error("\"" + objectName + "\" with value \"" + value + "\" should satisfy the constraint \"" + constraintName + "\": " + constraintValue + "."); - }; - if (mapper.constraints && value != undefined) { - var valueAsNumber = value; - var _a = mapper.constraints, ExclusiveMaximum = _a.ExclusiveMaximum, ExclusiveMinimum = _a.ExclusiveMinimum, InclusiveMaximum = _a.InclusiveMaximum, InclusiveMinimum = _a.InclusiveMinimum, MaxItems = _a.MaxItems, MaxLength = _a.MaxLength, MinItems = _a.MinItems, MinLength = _a.MinLength, MultipleOf = _a.MultipleOf, Pattern = _a.Pattern, UniqueItems = _a.UniqueItems; - if (ExclusiveMaximum != undefined && valueAsNumber >= ExclusiveMaximum) { - failValidation("ExclusiveMaximum", ExclusiveMaximum); - } - if (ExclusiveMinimum != undefined && valueAsNumber <= ExclusiveMinimum) { - failValidation("ExclusiveMinimum", ExclusiveMinimum); - } - if (InclusiveMaximum != undefined && valueAsNumber > InclusiveMaximum) { - failValidation("InclusiveMaximum", InclusiveMaximum); - } - if (InclusiveMinimum != undefined && valueAsNumber < InclusiveMinimum) { - failValidation("InclusiveMinimum", InclusiveMinimum); - } - var valueAsArray = value; - if (MaxItems != undefined && valueAsArray.length > MaxItems) { - failValidation("MaxItems", MaxItems); - } - if (MaxLength != undefined && valueAsArray.length > MaxLength) { - failValidation("MaxLength", MaxLength); - } - if (MinItems != undefined && valueAsArray.length < MinItems) { - failValidation("MinItems", MinItems); - } - if (MinLength != undefined && valueAsArray.length < MinLength) { - failValidation("MinLength", MinLength); - } - if (MultipleOf != undefined && valueAsNumber % MultipleOf !== 0) { - failValidation("MultipleOf", MultipleOf); - } - if (Pattern) { - var pattern = typeof Pattern === "string" ? new RegExp(Pattern) : Pattern; - if (typeof value !== "string" || value.match(pattern) === null) { - failValidation("Pattern", Pattern); - } - } - if (UniqueItems && - valueAsArray.some(function (item, i, ar) { return ar.indexOf(item) !== i; })) { - failValidation("UniqueItems", UniqueItems); - } - } - }; - /** - * Serialize the given object based on its metadata defined in the mapper - * - * @param mapper - The mapper which defines the metadata of the serializable object - * @param object - A valid Javascript object to be serialized - * @param objectName - Name of the serialized object - * @param options - additional options to deserialization - * @returns A valid serialized Javascript object - */ - Serializer.prototype.serialize = function (mapper, object, objectName, options) { - var _a, _b, _c; - if (options === void 0) { options = {}; } - var updatedOptions = { - rootName: (_a = options.rootName) !== null && _a !== void 0 ? _a : "", - includeRoot: (_b = options.includeRoot) !== null && _b !== void 0 ? _b : false, - xmlCharKey: (_c = options.xmlCharKey) !== null && _c !== void 0 ? _c : XML_CHARKEY - }; - var payload = {}; - var mapperType = mapper.type.name; - if (!objectName) { - objectName = mapper.serializedName; - } - if (mapperType.match(/^Sequence$/i) !== null) { - payload = []; - } - if (mapper.isConstant) { - object = mapper.defaultValue; + _getExistingOrDefaultHeader(additionalHeaders, header, _default) { + const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {}); + let clientHeader; + if (this.requestOptions && this.requestOptions.headers) { + clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; } - // This table of allowed values should help explain - // the mapper.required and mapper.nullable properties. - // X means "neither undefined or null are allowed". - // || required - // || true | false - // nullable || ========================== - // true || null | undefined/null - // false || X | undefined - // undefined || X | undefined/null - var required = mapper.required, nullable = mapper.nullable; - if (required && nullable && object === undefined) { - throw new Error(objectName + " cannot be undefined."); + return additionalHeaders[header] || clientHeader || _default; + } + _getAgent(parsedUrl) { + let agent; + let proxyUrl = pm.getProxyUrl(parsedUrl); + let useProxy = proxyUrl && proxyUrl.hostname; + if (this._keepAlive && useProxy) { + agent = this._proxyAgent; } - if (required && !nullable && object == undefined) { - throw new Error(objectName + " cannot be null or undefined."); + if (this._keepAlive && !useProxy) { + agent = this._agent; } - if (!required && nullable === false && object === null) { - throw new Error(objectName + " cannot be null."); + // if agent is already assigned use that agent. + if (!!agent) { + return agent; } - if (object == undefined) { - payload = object; + const usingSsl = parsedUrl.protocol === 'https:'; + let maxSockets = 100; + if (!!this.requestOptions) { + maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets; } - else { - // Validate Constraints if any - this.validateConstraints(mapper, object, objectName); - if (mapperType.match(/^any$/i) !== null) { - payload = object; - } - else if (mapperType.match(/^(Number|String|Boolean|Object|Stream|Uuid)$/i) !== null) { - payload = serializeBasicTypes(mapperType, objectName, object); - } - else if (mapperType.match(/^Enum$/i) !== null) { - var enumMapper = mapper; - payload = serializeEnumType(objectName, enumMapper.type.allowedValues, object); - } - else if (mapperType.match(/^(Date|DateTime|TimeSpan|DateTimeRfc1123|UnixTime)$/i) !== null) { - payload = serializeDateTypes(mapperType, object, objectName); - } - else if (mapperType.match(/^ByteArray$/i) !== null) { - payload = serializeByteArrayType(objectName, object); - } - else if (mapperType.match(/^Base64Url$/i) !== null) { - payload = serializeBase64UrlType(objectName, object); - } - else if (mapperType.match(/^Sequence$/i) !== null) { - payload = serializeSequenceType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); + if (useProxy) { + // If using proxy, need tunnel + if (!tunnel) { + tunnel = __nccwpck_require__(4294); } - else if (mapperType.match(/^Dictionary$/i) !== null) { - payload = serializeDictionaryType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); + const agentOptions = { + maxSockets: maxSockets, + keepAlive: this._keepAlive, + proxy: { + ...((proxyUrl.username || proxyUrl.password) && { + proxyAuth: `${proxyUrl.username}:${proxyUrl.password}` + }), + host: proxyUrl.hostname, + port: proxyUrl.port + } + }; + let tunnelAgent; + const overHttps = proxyUrl.protocol === 'https:'; + if (usingSsl) { + tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp; } - else if (mapperType.match(/^Composite$/i) !== null) { - payload = serializeCompositeType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); + else { + tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp; } + agent = tunnelAgent(agentOptions); + this._proxyAgent = agent; } - return payload; - }; - /** - * Deserialize the given object based on its metadata defined in the mapper - * - * @param mapper - The mapper which defines the metadata of the serializable object - * @param responseBody - A valid Javascript entity to be deserialized - * @param objectName - Name of the deserialized object - * @param options - Controls behavior of XML parser and builder. - * @returns A valid deserialized Javascript object - */ - Serializer.prototype.deserialize = function (mapper, responseBody, objectName, options) { - var _a, _b, _c; - if (options === void 0) { options = {}; } - var updatedOptions = { - rootName: (_a = options.rootName) !== null && _a !== void 0 ? _a : "", - includeRoot: (_b = options.includeRoot) !== null && _b !== void 0 ? _b : false, - xmlCharKey: (_c = options.xmlCharKey) !== null && _c !== void 0 ? _c : XML_CHARKEY - }; - if (responseBody == undefined) { - if (this.isXML && mapper.type.name === "Sequence" && !mapper.xmlIsWrapped) { - // Edge case for empty XML non-wrapped lists. xml2js can't distinguish - // between the list being empty versus being missing, - // so let's do the more user-friendly thing and return an empty list. - responseBody = []; - } - // specifically check for undefined as default value can be a falsey value `0, "", false, null` - if (mapper.defaultValue !== undefined) { - responseBody = mapper.defaultValue; - } - return responseBody; + // if reusing agent across request and tunneling agent isn't assigned create a new agent + if (this._keepAlive && !agent) { + const options = { keepAlive: this._keepAlive, maxSockets: maxSockets }; + agent = usingSsl ? new https.Agent(options) : new http.Agent(options); + this._agent = agent; } - var payload; - var mapperType = mapper.type.name; - if (!objectName) { - objectName = mapper.serializedName; + // if not using private agent and tunnel agent isn't setup then use global agent + if (!agent) { + agent = usingSsl ? https.globalAgent : http.globalAgent; } - if (mapperType.match(/^Composite$/i) !== null) { - payload = deserializeCompositeType(this, mapper, responseBody, objectName, updatedOptions); + if (usingSsl && this._ignoreSslError) { + // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process + // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options + // we have to cast it to any and change it directly + agent.options = Object.assign(agent.options || {}, { + rejectUnauthorized: false + }); } - else { - if (this.isXML) { - var xmlCharKey = updatedOptions.xmlCharKey; - var castResponseBody = responseBody; - /** - * If the mapper specifies this as a non-composite type value but the responseBody contains - * both header ("$" i.e., XML_ATTRKEY) and body ("#" i.e., XML_CHARKEY) properties, - * then just reduce the responseBody value to the body ("#" i.e., XML_CHARKEY) property. - */ - if (castResponseBody[XML_ATTRKEY] != undefined && - castResponseBody[xmlCharKey] != undefined) { - responseBody = castResponseBody[xmlCharKey]; - } + return agent; + } + _performExponentialBackoff(retryNumber) { + retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); + const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); + return new Promise(resolve => setTimeout(() => resolve(), ms)); + } + static dateTimeDeserializer(key, value) { + if (typeof value === 'string') { + let a = new Date(value); + if (!isNaN(a.valueOf())) { + return a; } - if (mapperType.match(/^Number$/i) !== null) { - payload = parseFloat(responseBody); - if (isNaN(payload)) { - payload = responseBody; + } + return value; + } + async _processResponse(res, options) { + return new Promise(async (resolve, reject) => { + const statusCode = res.message.statusCode; + const response = { + statusCode: statusCode, + result: null, + headers: {} + }; + // not found leads to null obj returned + if (statusCode == HttpCodes.NotFound) { + resolve(response); + } + let obj; + let contents; + // get the result from the body + try { + contents = await res.readBody(); + if (contents && contents.length > 0) { + if (options && options.deserializeDates) { + obj = JSON.parse(contents, HttpClient.dateTimeDeserializer); + } + else { + obj = JSON.parse(contents); + } + response.result = obj; } + response.headers = res.message.headers; } - else if (mapperType.match(/^Boolean$/i) !== null) { - if (responseBody === "true") { - payload = true; + catch (err) { + // Invalid resource (contents not json); leaving result obj null + } + // note that 3xx redirects are handled by the http layer. + if (statusCode > 299) { + let msg; + // if exception/error in body, attempt to get better error + if (obj && obj.message) { + msg = obj.message; } - else if (responseBody === "false") { - payload = false; + else if (contents && contents.length > 0) { + // it may be the case that the exception is in the body message as string + msg = contents; } else { - payload = responseBody; + msg = 'Failed request: (' + statusCode + ')'; } + let err = new HttpClientError(msg, statusCode); + err.result = response.result; + reject(err); } - else if (mapperType.match(/^(String|Enum|Object|Stream|Uuid|TimeSpan|any)$/i) !== null) { - payload = responseBody; - } - else if (mapperType.match(/^(Date|DateTime|DateTimeRfc1123)$/i) !== null) { - payload = new Date(responseBody); - } - else if (mapperType.match(/^UnixTime$/i) !== null) { - payload = unixTimeToDate(responseBody); - } - else if (mapperType.match(/^ByteArray$/i) !== null) { - payload = decodeString(responseBody); - } - else if (mapperType.match(/^Base64Url$/i) !== null) { - payload = base64UrlToByteArray(responseBody); - } - else if (mapperType.match(/^Sequence$/i) !== null) { - payload = deserializeSequenceType(this, mapper, responseBody, objectName, updatedOptions); - } - else if (mapperType.match(/^Dictionary$/i) !== null) { - payload = deserializeDictionaryType(this, mapper, responseBody, objectName, updatedOptions); + else { + resolve(response); } - } - if (mapper.isConstant) { - payload = mapper.defaultValue; - } - return payload; - }; - return Serializer; -}()); -function trimEnd(str, ch) { - var len = str.length; - while (len - 1 >= 0 && str[len - 1] === ch) { - --len; + }); } - return str.substr(0, len); } -function bufferToBase64Url(buffer) { - if (!buffer) { - return undefined; - } - if (!(buffer instanceof Uint8Array)) { - throw new Error("Please provide an input of type Uint8Array for converting to Base64Url."); +exports.HttpClient = HttpClient; + + +/***/ }), + +/***/ 6443: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +function getProxyUrl(reqUrl) { + let usingSsl = reqUrl.protocol === 'https:'; + let proxyUrl; + if (checkBypass(reqUrl)) { + return proxyUrl; } - // Uint8Array to Base64. - var str = encodeByteArray(buffer); - // Base64 to Base64Url. - return trimEnd(str, "=") - .replace(/\+/g, "-") - .replace(/\//g, "_"); -} -function base64UrlToByteArray(str) { - if (!str) { - return undefined; + let proxyVar; + if (usingSsl) { + proxyVar = process.env['https_proxy'] || process.env['HTTPS_PROXY']; } - if (str && typeof str.valueOf() !== "string") { - throw new Error("Please provide an input of type string for converting to Uint8Array"); + else { + proxyVar = process.env['http_proxy'] || process.env['HTTP_PROXY']; } - // Base64Url to Base64. - str = str.replace(/-/g, "+").replace(/_/g, "/"); - // Base64 to Uint8Array. - return decodeString(str); -} -function splitSerializeName(prop) { - var classes = []; - var partialclass = ""; - if (prop) { - var subwords = prop.split("."); - for (var _i = 0, subwords_1 = subwords; _i < subwords_1.length; _i++) { - var item = subwords_1[_i]; - if (item.charAt(item.length - 1) === "\\") { - partialclass += item.substr(0, item.length - 1) + "."; - } - else { - partialclass += item; - classes.push(partialclass); - partialclass = ""; - } - } + if (proxyVar) { + proxyUrl = new URL(proxyVar); } - return classes; + return proxyUrl; } -function dateToUnixTime(d) { - if (!d) { - return undefined; - } - if (typeof d.valueOf() === "string") { - d = new Date(d); +exports.getProxyUrl = getProxyUrl; +function checkBypass(reqUrl) { + if (!reqUrl.hostname) { + return false; } - return Math.floor(d.getTime() / 1000); -} -function unixTimeToDate(n) { - if (!n) { - return undefined; + let noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || ''; + if (!noProxy) { + return false; } - return new Date(n * 1000); -} -function serializeBasicTypes(typeName, objectName, value) { - if (value !== null && value !== undefined) { - if (typeName.match(/^Number$/i) !== null) { - if (typeof value !== "number") { - throw new Error(objectName + " with value " + value + " must be of type number."); - } - } - else if (typeName.match(/^String$/i) !== null) { - if (typeof value.valueOf() !== "string") { - throw new Error(objectName + " with value \"" + value + "\" must be of type string."); - } - } - else if (typeName.match(/^Uuid$/i) !== null) { - if (!(typeof value.valueOf() === "string" && isValidUuid(value))) { - throw new Error(objectName + " with value \"" + value + "\" must be of type string and a valid uuid."); - } - } - else if (typeName.match(/^Boolean$/i) !== null) { - if (typeof value !== "boolean") { - throw new Error(objectName + " with value " + value + " must be of type boolean."); - } - } - else if (typeName.match(/^Stream$/i) !== null) { - var objectType = typeof value; - if (objectType !== "string" && - objectType !== "function" && - !(value instanceof ArrayBuffer) && - !ArrayBuffer.isView(value) && - !((typeof Blob === "function" || typeof Blob === "object") && value instanceof Blob)) { - throw new Error(objectName + " must be a string, Blob, ArrayBuffer, ArrayBufferView, or a function returning NodeJS.ReadableStream."); - } - } + // Determine the request port + let reqPort; + if (reqUrl.port) { + reqPort = Number(reqUrl.port); } - return value; -} -function serializeEnumType(objectName, allowedValues, value) { - if (!allowedValues) { - throw new Error("Please provide a set of allowedValues to validate " + objectName + " as an Enum Type."); + else if (reqUrl.protocol === 'http:') { + reqPort = 80; } - var isPresent = allowedValues.some(function (item) { - if (typeof item.valueOf() === "string") { - return item.toLowerCase() === value.toLowerCase(); - } - return item === value; - }); - if (!isPresent) { - throw new Error(value + " is not a valid value for " + objectName + ". The valid values are: " + JSON.stringify(allowedValues) + "."); + else if (reqUrl.protocol === 'https:') { + reqPort = 443; } - return value; -} -function serializeByteArrayType(objectName, value) { - var returnValue = ""; - if (value != undefined) { - if (!(value instanceof Uint8Array)) { - throw new Error(objectName + " must be of type Uint8Array."); - } - returnValue = encodeByteArray(value); + // Format the request hostname and hostname with port + let upperReqHosts = [reqUrl.hostname.toUpperCase()]; + if (typeof reqPort === 'number') { + upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); } - return returnValue; -} -function serializeBase64UrlType(objectName, value) { - var returnValue = ""; - if (value != undefined) { - if (!(value instanceof Uint8Array)) { - throw new Error(objectName + " must be of type Uint8Array."); + // Compare request host against noproxy + for (let upperNoProxyItem of noProxy + .split(',') + .map(x => x.trim().toUpperCase()) + .filter(x => x)) { + if (upperReqHosts.some(x => x === upperNoProxyItem)) { + return true; } - returnValue = bufferToBase64Url(value) || ""; } - return returnValue; + return false; } -function serializeDateTypes(typeName, value, objectName) { - if (value != undefined) { - if (typeName.match(/^Date$/i) !== null) { - if (!(value instanceof Date || - (typeof value.valueOf() === "string" && !isNaN(Date.parse(value))))) { - throw new Error(objectName + " must be an instanceof Date or a string in ISO8601 format."); - } - value = - value instanceof Date - ? value.toISOString().substring(0, 10) - : new Date(value).toISOString().substring(0, 10); - } - else if (typeName.match(/^DateTime$/i) !== null) { - if (!(value instanceof Date || - (typeof value.valueOf() === "string" && !isNaN(Date.parse(value))))) { - throw new Error(objectName + " must be an instanceof Date or a string in ISO8601 format."); - } - value = value instanceof Date ? value.toISOString() : new Date(value).toISOString(); - } - else if (typeName.match(/^DateTimeRfc1123$/i) !== null) { - if (!(value instanceof Date || - (typeof value.valueOf() === "string" && !isNaN(Date.parse(value))))) { - throw new Error(objectName + " must be an instanceof Date or a string in RFC-1123 format."); - } - value = value instanceof Date ? value.toUTCString() : new Date(value).toUTCString(); - } - else if (typeName.match(/^UnixTime$/i) !== null) { - if (!(value instanceof Date || - (typeof value.valueOf() === "string" && !isNaN(Date.parse(value))))) { - throw new Error(objectName + " must be an instanceof Date or a string in RFC-1123/ISO8601 format " + - "for it to be serialized in UnixTime/Epoch format."); - } - value = dateToUnixTime(value); - } - else if (typeName.match(/^TimeSpan$/i) !== null) { - if (!isDuration(value)) { - throw new Error(objectName + " must be a string in ISO 8601 format. Instead was \"" + value + "\"."); - } +exports.checkBypass = checkBypass; + + +/***/ }), + +/***/ 1962: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__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)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var _a; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getCmdPath = exports.tryGetExecutablePath = exports.isRooted = exports.isDirectory = exports.exists = exports.IS_WINDOWS = exports.unlink = exports.symlink = exports.stat = exports.rmdir = exports.rename = exports.readlink = exports.readdir = exports.mkdir = exports.lstat = exports.copyFile = exports.chmod = void 0; +const fs = __importStar(__nccwpck_require__(5747)); +const path = __importStar(__nccwpck_require__(5622)); +_a = fs.promises, exports.chmod = _a.chmod, exports.copyFile = _a.copyFile, exports.lstat = _a.lstat, exports.mkdir = _a.mkdir, exports.readdir = _a.readdir, exports.readlink = _a.readlink, exports.rename = _a.rename, exports.rmdir = _a.rmdir, exports.stat = _a.stat, exports.symlink = _a.symlink, exports.unlink = _a.unlink; +exports.IS_WINDOWS = process.platform === 'win32'; +function exists(fsPath) { + return __awaiter(this, void 0, void 0, function* () { + try { + yield exports.stat(fsPath); } - } - return value; -} -function serializeSequenceType(serializer, mapper, object, objectName, isXml, options) { - var _a, _b; - if (!Array.isArray(object)) { - throw new Error(objectName + " must be of type Array."); - } - var elementType = mapper.type.element; - if (!elementType || typeof elementType !== "object") { - throw new Error("element\" metadata for an Array must be defined in the " + - ("mapper and it must of type \"object\" in " + objectName + ".")); - } - var tempArray = []; - for (var i = 0; i < object.length; i++) { - var serializedValue = serializer.serialize(elementType, object[i], objectName, options); - if (isXml && elementType.xmlNamespace) { - var xmlnsKey = elementType.xmlNamespacePrefix - ? "xmlns:" + elementType.xmlNamespacePrefix - : "xmlns"; - if (elementType.type.name === "Composite") { - tempArray[i] = tslib.__assign({}, serializedValue); - tempArray[i][XML_ATTRKEY] = (_a = {}, _a[xmlnsKey] = elementType.xmlNamespace, _a); - } - else { - tempArray[i] = {}; - tempArray[i][options.xmlCharKey] = serializedValue; - tempArray[i][XML_ATTRKEY] = (_b = {}, _b[xmlnsKey] = elementType.xmlNamespace, _b); + catch (err) { + if (err.code === 'ENOENT') { + return false; } + throw err; } - else { - tempArray[i] = serializedValue; - } - } - return tempArray; + return true; + }); } -function serializeDictionaryType(serializer, mapper, object, objectName, isXml, options) { - var _a; - if (typeof object !== "object") { - throw new Error(objectName + " must be of type object."); - } - var valueType = mapper.type.value; - if (!valueType || typeof valueType !== "object") { - throw new Error("\"value\" metadata for a Dictionary must be defined in the " + - ("mapper and it must of type \"object\" in " + objectName + ".")); - } - var tempDictionary = {}; - for (var _i = 0, _b = Object.keys(object); _i < _b.length; _i++) { - var key = _b[_i]; - var serializedValue = serializer.serialize(valueType, object[key], objectName, options); - // If the element needs an XML namespace we need to add it within the $ property - tempDictionary[key] = getXmlObjectValue(valueType, serializedValue, isXml, options); - } - // Add the namespace to the root element if needed - if (isXml && mapper.xmlNamespace) { - var xmlnsKey = mapper.xmlNamespacePrefix ? "xmlns:" + mapper.xmlNamespacePrefix : "xmlns"; - var result = tempDictionary; - result[XML_ATTRKEY] = (_a = {}, _a[xmlnsKey] = mapper.xmlNamespace, _a); - return result; - } - return tempDictionary; +exports.exists = exists; +function isDirectory(fsPath, useStat = false) { + return __awaiter(this, void 0, void 0, function* () { + const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath); + return stats.isDirectory(); + }); } +exports.isDirectory = isDirectory; /** - * Resolves the additionalProperties property from a referenced mapper - * @param serializer - The serializer containing the entire set of mappers - * @param mapper - The composite mapper to resolve - * @param objectName - Name of the object being serialized + * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like: + * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases). */ -function resolveAdditionalProperties(serializer, mapper, objectName) { - var additionalProperties = mapper.type.additionalProperties; - if (!additionalProperties && mapper.type.className) { - var modelMapper = resolveReferencedMapper(serializer, mapper, objectName); - return modelMapper === null || modelMapper === void 0 ? void 0 : modelMapper.type.additionalProperties; +function isRooted(p) { + p = normalizeSeparators(p); + if (!p) { + throw new Error('isRooted() parameter "p" cannot be empty'); } - return additionalProperties; -} -/** - * Finds the mapper referenced by className - * @param serializer - The serializer containing the entire set of mappers - * @param mapper - The composite mapper to resolve - * @param objectName - Name of the object being serialized - */ -function resolveReferencedMapper(serializer, mapper, objectName) { - var className = mapper.type.className; - if (!className) { - throw new Error("Class name for model \"" + objectName + "\" is not provided in the mapper \"" + JSON.stringify(mapper, undefined, 2) + "\"."); + if (exports.IS_WINDOWS) { + return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello + ); // e.g. C: or C:\hello } - return serializer.modelMappers[className]; + return p.startsWith('/'); } +exports.isRooted = isRooted; /** - * Resolves a composite mapper's modelProperties. - * @param serializer - The serializer containing the entire set of mappers - * @param mapper - The composite mapper to resolve + * Best effort attempt to determine whether a file exists and is executable. + * @param filePath file path to check + * @param extensions additional file extensions to try + * @return if file exists and is executable, returns the file path. otherwise empty string. */ -function resolveModelProperties(serializer, mapper, objectName) { - var modelProps = mapper.type.modelProperties; - if (!modelProps) { - var modelMapper = resolveReferencedMapper(serializer, mapper, objectName); - if (!modelMapper) { - throw new Error("mapper() cannot be null or undefined for model \"" + mapper.type.className + "\"."); - } - modelProps = modelMapper === null || modelMapper === void 0 ? void 0 : modelMapper.type.modelProperties; - if (!modelProps) { - throw new Error("modelProperties cannot be null or undefined in the " + - ("mapper \"" + JSON.stringify(modelMapper) + "\" of type \"" + mapper.type.className + "\" for object \"" + objectName + "\".")); +function tryGetExecutablePath(filePath, extensions) { + return __awaiter(this, void 0, void 0, function* () { + let stats = undefined; + try { + // test file exists + stats = yield exports.stat(filePath); } - } - return modelProps; -} -function serializeCompositeType(serializer, mapper, object, objectName, isXml, options) { - var _a, _b; - if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) { - mapper = getPolymorphicMapper(serializer, mapper, object, "clientName"); - } - if (object != undefined) { - var payload = {}; - var modelProps = resolveModelProperties(serializer, mapper, objectName); - for (var _i = 0, _c = Object.keys(modelProps); _i < _c.length; _i++) { - var key = _c[_i]; - var propertyMapper = modelProps[key]; - if (propertyMapper.readOnly) { - continue; + catch (err) { + if (err.code !== 'ENOENT') { + // eslint-disable-next-line no-console + console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`); } - var propName = void 0; - var parentObject = payload; - if (serializer.isXML) { - if (propertyMapper.xmlIsWrapped) { - propName = propertyMapper.xmlName; - } - else { - propName = propertyMapper.xmlElementName || propertyMapper.xmlName; + } + if (stats && stats.isFile()) { + if (exports.IS_WINDOWS) { + // on Windows, test for valid extension + const upperExt = path.extname(filePath).toUpperCase(); + if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) { + return filePath; } } else { - var paths = splitSerializeName(propertyMapper.serializedName); - propName = paths.pop(); - for (var _d = 0, paths_1 = paths; _d < paths_1.length; _d++) { - var pathName = paths_1[_d]; - var childObject = parentObject[pathName]; - if (childObject == undefined && - (object[key] != undefined || propertyMapper.defaultValue !== undefined)) { - parentObject[pathName] = {}; - } - parentObject = parentObject[pathName]; + if (isUnixExecutable(stats)) { + return filePath; } } - if (parentObject != undefined) { - if (isXml && mapper.xmlNamespace) { - var xmlnsKey = mapper.xmlNamespacePrefix - ? "xmlns:" + mapper.xmlNamespacePrefix - : "xmlns"; - parentObject[XML_ATTRKEY] = tslib.__assign(tslib.__assign({}, parentObject[XML_ATTRKEY]), (_a = {}, _a[xmlnsKey] = mapper.xmlNamespace, _a)); - } - var propertyObjectName = propertyMapper.serializedName !== "" - ? objectName + "." + propertyMapper.serializedName - : objectName; - var toSerialize = object[key]; - var polymorphicDiscriminator = getPolymorphicDiscriminatorRecursively(serializer, mapper); - if (polymorphicDiscriminator && - polymorphicDiscriminator.clientName === key && - toSerialize == undefined) { - toSerialize = mapper.serializedName; + } + // try each extension + const originalFilePath = filePath; + for (const extension of extensions) { + filePath = originalFilePath + extension; + stats = undefined; + try { + stats = yield exports.stat(filePath); + } + catch (err) { + if (err.code !== 'ENOENT') { + // eslint-disable-next-line no-console + console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`); } - var serializedValue = serializer.serialize(propertyMapper, toSerialize, propertyObjectName, options); - if (serializedValue !== undefined && propName != undefined) { - var value = getXmlObjectValue(propertyMapper, serializedValue, isXml, options); - if (isXml && propertyMapper.xmlIsAttribute) { - // XML_ATTRKEY, i.e., $ is the key attributes are kept under in xml2js. - // This keeps things simple while preventing name collision - // with names in user documents. - parentObject[XML_ATTRKEY] = parentObject[XML_ATTRKEY] || {}; - parentObject[XML_ATTRKEY][propName] = serializedValue; - } - else if (isXml && propertyMapper.xmlIsWrapped) { - parentObject[propName] = (_b = {}, _b[propertyMapper.xmlElementName] = value, _b); + } + if (stats && stats.isFile()) { + if (exports.IS_WINDOWS) { + // preserve the case of the actual file (since an extension was appended) + try { + const directory = path.dirname(filePath); + const upperName = path.basename(filePath).toUpperCase(); + for (const actualName of yield exports.readdir(directory)) { + if (upperName === actualName.toUpperCase()) { + filePath = path.join(directory, actualName); + break; + } + } } - else { - parentObject[propName] = value; + catch (err) { + // eslint-disable-next-line no-console + console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`); } + return filePath; } - } - } - var additionalPropertiesMapper = resolveAdditionalProperties(serializer, mapper, objectName); - if (additionalPropertiesMapper) { - var propNames = Object.keys(modelProps); - var _loop_1 = function (clientPropName) { - var isAdditionalProperty = propNames.every(function (pn) { return pn !== clientPropName; }); - if (isAdditionalProperty) { - payload[clientPropName] = serializer.serialize(additionalPropertiesMapper, object[clientPropName], objectName + '["' + clientPropName + '"]', options); + else { + if (isUnixExecutable(stats)) { + return filePath; + } } - }; - for (var clientPropName in object) { - _loop_1(clientPropName); } } - return payload; - } - return object; + return ''; + }); } -function getXmlObjectValue(propertyMapper, serializedValue, isXml, options) { - var _a; - if (!isXml || !propertyMapper.xmlNamespace) { - return serializedValue; - } - var xmlnsKey = propertyMapper.xmlNamespacePrefix - ? "xmlns:" + propertyMapper.xmlNamespacePrefix - : "xmlns"; - var xmlNamespace = (_a = {}, _a[xmlnsKey] = propertyMapper.xmlNamespace, _a); - if (["Composite"].includes(propertyMapper.type.name)) { - if (serializedValue[XML_ATTRKEY]) { - return serializedValue; - } - else { - var result_1 = tslib.__assign({}, serializedValue); - result_1[XML_ATTRKEY] = xmlNamespace; - return result_1; - } +exports.tryGetExecutablePath = tryGetExecutablePath; +function normalizeSeparators(p) { + p = p || ''; + if (exports.IS_WINDOWS) { + // convert slashes on Windows + p = p.replace(/\//g, '\\'); + // remove redundant slashes + return p.replace(/\\\\+/g, '\\'); } - var result = {}; - result[options.xmlCharKey] = serializedValue; - result[XML_ATTRKEY] = xmlNamespace; - return result; + // remove redundant slashes + return p.replace(/\/\/+/g, '/'); } -function isSpecialXmlProperty(propertyName, options) { - return [XML_ATTRKEY, options.xmlCharKey].includes(propertyName); +// on Mac/Linux, test the execute bit +// R W X R W X R W X +// 256 128 64 32 16 8 4 2 1 +function isUnixExecutable(stats) { + return ((stats.mode & 1) > 0 || + ((stats.mode & 8) > 0 && stats.gid === process.getgid()) || + ((stats.mode & 64) > 0 && stats.uid === process.getuid())); } -function deserializeCompositeType(serializer, mapper, responseBody, objectName, options) { +// Get the path of cmd.exe in windows +function getCmdPath() { var _a; - if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) { - mapper = getPolymorphicMapper(serializer, mapper, responseBody, "serializedName"); - } - var modelProps = resolveModelProperties(serializer, mapper, objectName); - var instance = {}; - var handledPropertyNames = []; - for (var _i = 0, _b = Object.keys(modelProps); _i < _b.length; _i++) { - var key = _b[_i]; - var propertyMapper = modelProps[key]; - var paths = splitSerializeName(modelProps[key].serializedName); - handledPropertyNames.push(paths[0]); - var serializedName = propertyMapper.serializedName, xmlName = propertyMapper.xmlName, xmlElementName = propertyMapper.xmlElementName; - var propertyObjectName = objectName; - if (serializedName !== "" && serializedName !== undefined) { - propertyObjectName = objectName + "." + serializedName; + return (_a = process.env['COMSPEC']) !== null && _a !== void 0 ? _a : `cmd.exe`; +} +exports.getCmdPath = getCmdPath; +//# sourceMappingURL=io-util.js.map + +/***/ }), + +/***/ 7436: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__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)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.findInPath = exports.which = exports.mkdirP = exports.rmRF = exports.mv = exports.cp = void 0; +const assert_1 = __nccwpck_require__(2357); +const childProcess = __importStar(__nccwpck_require__(3129)); +const path = __importStar(__nccwpck_require__(5622)); +const util_1 = __nccwpck_require__(1669); +const ioUtil = __importStar(__nccwpck_require__(1962)); +const exec = util_1.promisify(childProcess.exec); +const execFile = util_1.promisify(childProcess.execFile); +/** + * Copies a file or folder. + * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js + * + * @param source source path + * @param dest destination path + * @param options optional. See CopyOptions. + */ +function cp(source, dest, options = {}) { + return __awaiter(this, void 0, void 0, function* () { + const { force, recursive, copySourceDirectory } = readCopyOptions(options); + const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null; + // Dest is an existing file, but not forcing + if (destStat && destStat.isFile() && !force) { + return; } - var headerCollectionPrefix = propertyMapper.headerCollectionPrefix; - if (headerCollectionPrefix) { - var dictionary = {}; - for (var _c = 0, _d = Object.keys(responseBody); _c < _d.length; _c++) { - var headerKey = _d[_c]; - if (headerKey.startsWith(headerCollectionPrefix)) { - dictionary[headerKey.substring(headerCollectionPrefix.length)] = serializer.deserialize(propertyMapper.type.value, responseBody[headerKey], propertyObjectName, options); - } - handledPropertyNames.push(headerKey); - } - instance[key] = dictionary; + // If dest is an existing directory, should copy inside. + const newDest = destStat && destStat.isDirectory() && copySourceDirectory + ? path.join(dest, path.basename(source)) + : dest; + if (!(yield ioUtil.exists(source))) { + throw new Error(`no such file or directory: ${source}`); } - else if (serializer.isXML) { - if (propertyMapper.xmlIsAttribute && responseBody[XML_ATTRKEY]) { - instance[key] = serializer.deserialize(propertyMapper, responseBody[XML_ATTRKEY][xmlName], propertyObjectName, options); + const sourceStat = yield ioUtil.stat(source); + if (sourceStat.isDirectory()) { + if (!recursive) { + throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`); } else { - var propertyName = xmlElementName || xmlName || serializedName; - if (propertyMapper.xmlIsWrapped) { - /* a list of wrapped by - For the xml example below - - ... - ... - - the responseBody has - { - Cors: { - CorsRule: [{...}, {...}] - } - } - xmlName is "Cors" and xmlElementName is"CorsRule". - */ - var wrapped = responseBody[xmlName]; - var elementList = (_a = wrapped === null || wrapped === void 0 ? void 0 : wrapped[xmlElementName]) !== null && _a !== void 0 ? _a : []; - instance[key] = serializer.deserialize(propertyMapper, elementList, propertyObjectName, options); - } - else { - var property = responseBody[propertyName]; - instance[key] = serializer.deserialize(propertyMapper, property, propertyObjectName, options); - } + yield cpDirRecursive(source, newDest, 0, force); } } else { - // deserialize the property if it is present in the provided responseBody instance - var propertyInstance = void 0; - var res = responseBody; - // traversing the object step by step. - for (var _e = 0, paths_2 = paths; _e < paths_2.length; _e++) { - var item = paths_2[_e]; - if (!res) - break; - res = res[item]; - } - propertyInstance = res; - var polymorphicDiscriminator = mapper.type.polymorphicDiscriminator; - // checking that the model property name (key)(ex: "fishtype") and the - // clientName of the polymorphicDiscriminator {metadata} (ex: "fishtype") - // instead of the serializedName of the polymorphicDiscriminator (ex: "fish.type") - // is a better approach. The generator is not consistent with escaping '\.' in the - // serializedName of the property (ex: "fish\.type") that is marked as polymorphic discriminator - // and the serializedName of the metadata polymorphicDiscriminator (ex: "fish.type"). However, - // the clientName transformation of the polymorphicDiscriminator (ex: "fishtype") and - // the transformation of model property name (ex: "fishtype") is done consistently. - // Hence, it is a safer bet to rely on the clientName of the polymorphicDiscriminator. - if (polymorphicDiscriminator && - key === polymorphicDiscriminator.clientName && - propertyInstance == undefined) { - propertyInstance = mapper.serializedName; + if (path.relative(source, newDest) === '') { + // a file cannot be copied to itself + throw new Error(`'${newDest}' and '${source}' are the same file`); } - var serializedValue = void 0; - // paging - if (Array.isArray(responseBody[key]) && modelProps[key].serializedName === "") { - propertyInstance = responseBody[key]; - instance = serializer.deserialize(propertyMapper, propertyInstance, propertyObjectName, options); + yield copyFile(source, newDest, force); + } + }); +} +exports.cp = cp; +/** + * Moves a path. + * + * @param source source path + * @param dest destination path + * @param options optional. See MoveOptions. + */ +function mv(source, dest, options = {}) { + return __awaiter(this, void 0, void 0, function* () { + if (yield ioUtil.exists(dest)) { + let destExists = true; + if (yield ioUtil.isDirectory(dest)) { + // If dest is directory copy src into dest + dest = path.join(dest, path.basename(source)); + destExists = yield ioUtil.exists(dest); } - else if (propertyInstance !== undefined || propertyMapper.defaultValue !== undefined) { - serializedValue = serializer.deserialize(propertyMapper, propertyInstance, propertyObjectName, options); - instance[key] = serializedValue; + if (destExists) { + if (options.force == null || options.force) { + yield rmRF(dest); + } + else { + throw new Error('Destination already exists'); + } } } - } - var additionalPropertiesMapper = mapper.type.additionalProperties; - if (additionalPropertiesMapper) { - var isAdditionalProperty = function (responsePropName) { - for (var clientPropName in modelProps) { - var paths = splitSerializeName(modelProps[clientPropName].serializedName); - if (paths[0] === responsePropName) { - return false; + yield mkdirP(path.dirname(dest)); + yield ioUtil.rename(source, dest); + }); +} +exports.mv = mv; +/** + * Remove a path recursively with force + * + * @param inputPath path to remove + */ +function rmRF(inputPath) { + return __awaiter(this, void 0, void 0, function* () { + if (ioUtil.IS_WINDOWS) { + // Node doesn't provide a delete operation, only an unlink function. This means that if the file is being used by another + // program (e.g. antivirus), it won't be deleted. To address this, we shell out the work to rd/del. + // Check for invalid characters + // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file + if (/[*"<>|]/.test(inputPath)) { + throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows'); + } + try { + const cmdPath = ioUtil.getCmdPath(); + if (yield ioUtil.isDirectory(inputPath, true)) { + yield exec(`${cmdPath} /s /c "rd /s /q "%inputPath%""`, { + env: { inputPath } + }); + } + else { + yield exec(`${cmdPath} /s /c "del /f /a "%inputPath%""`, { + env: { inputPath } + }); } } - return true; - }; - for (var responsePropName in responseBody) { - if (isAdditionalProperty(responsePropName)) { - instance[responsePropName] = serializer.deserialize(additionalPropertiesMapper, responseBody[responsePropName], objectName + '["' + responsePropName + '"]', options); + catch (err) { + // if you try to delete a file that doesn't exist, desired result is achieved + // other errors are valid + if (err.code !== 'ENOENT') + throw err; + } + // Shelling out fails to remove a symlink folder with missing source, this unlink catches that + try { + yield ioUtil.unlink(inputPath); + } + catch (err) { + // if you try to delete a file that doesn't exist, desired result is achieved + // other errors are valid + if (err.code !== 'ENOENT') + throw err; } } - } - else if (responseBody) { - for (var _f = 0, _g = Object.keys(responseBody); _f < _g.length; _f++) { - var key = _g[_f]; - if (instance[key] === undefined && - !handledPropertyNames.includes(key) && - !isSpecialXmlProperty(key, options)) { - instance[key] = responseBody[key]; + else { + let isDir = false; + try { + isDir = yield ioUtil.isDirectory(inputPath); + } + catch (err) { + // if you try to delete a file that doesn't exist, desired result is achieved + // other errors are valid + if (err.code !== 'ENOENT') + throw err; + return; + } + if (isDir) { + yield execFile(`rm`, [`-rf`, `${inputPath}`]); + } + else { + yield ioUtil.unlink(inputPath); } } - } - return instance; + }); } -function deserializeDictionaryType(serializer, mapper, responseBody, objectName, options) { - var value = mapper.type.value; - if (!value || typeof value !== "object") { - throw new Error("\"value\" metadata for a Dictionary must be defined in the " + - ("mapper and it must of type \"object\" in " + objectName)); - } - if (responseBody) { - var tempDictionary = {}; - for (var _i = 0, _a = Object.keys(responseBody); _i < _a.length; _i++) { - var key = _a[_i]; - tempDictionary[key] = serializer.deserialize(value, responseBody[key], objectName, options); - } - return tempDictionary; - } - return responseBody; +exports.rmRF = rmRF; +/** + * Make a directory. Creates the full path with folders in between + * Will throw if it fails + * + * @param fsPath path to create + * @returns Promise + */ +function mkdirP(fsPath) { + return __awaiter(this, void 0, void 0, function* () { + assert_1.ok(fsPath, 'a path argument must be provided'); + yield ioUtil.mkdir(fsPath, { recursive: true }); + }); } -function deserializeSequenceType(serializer, mapper, responseBody, objectName, options) { - var element = mapper.type.element; - if (!element || typeof element !== "object") { - throw new Error("element\" metadata for an Array must be defined in the " + - ("mapper and it must of type \"object\" in " + objectName)); - } - if (responseBody) { - if (!Array.isArray(responseBody)) { - // xml2js will interpret a single element array as just the element, so force it to be an array - responseBody = [responseBody]; +exports.mkdirP = mkdirP; +/** + * Returns path of a tool had the tool actually been invoked. Resolves via paths. + * If you check and the tool does not exist, it will throw. + * + * @param tool name of the tool + * @param check whether to check if tool exists + * @returns Promise path to tool + */ +function which(tool, check) { + return __awaiter(this, void 0, void 0, function* () { + if (!tool) { + throw new Error("parameter 'tool' is required"); } - var tempArray = []; - for (var i = 0; i < responseBody.length; i++) { - tempArray[i] = serializer.deserialize(element, responseBody[i], objectName + "[" + i + "]", options); + // recursive when check=true + if (check) { + const result = yield which(tool, false); + if (!result) { + if (ioUtil.IS_WINDOWS) { + throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`); + } + else { + throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`); + } + } + return result; } - return tempArray; - } - return responseBody; + const matches = yield findInPath(tool); + if (matches && matches.length > 0) { + return matches[0]; + } + return ''; + }); } -function getPolymorphicMapper(serializer, mapper, object, polymorphicPropertyName) { - var polymorphicDiscriminator = getPolymorphicDiscriminatorRecursively(serializer, mapper); - if (polymorphicDiscriminator) { - var discriminatorName = polymorphicDiscriminator[polymorphicPropertyName]; - if (discriminatorName != undefined) { - var discriminatorValue = object[discriminatorName]; - if (discriminatorValue != undefined) { - var typeName = mapper.type.uberParent || mapper.type.className; - var indexDiscriminator = discriminatorValue === typeName - ? discriminatorValue - : typeName + "." + discriminatorValue; - var polymorphicMapper = serializer.modelMappers.discriminators[indexDiscriminator]; - if (polymorphicMapper) { - mapper = polymorphicMapper; +exports.which = which; +/** + * Returns a list of all occurrences of the given tool on the system path. + * + * @returns Promise the paths of the tool + */ +function findInPath(tool) { + return __awaiter(this, void 0, void 0, function* () { + if (!tool) { + throw new Error("parameter 'tool' is required"); + } + // build the list of extensions to try + const extensions = []; + if (ioUtil.IS_WINDOWS && process.env['PATHEXT']) { + for (const extension of process.env['PATHEXT'].split(path.delimiter)) { + if (extension) { + extensions.push(extension); } } } - } - return mapper; + // if it's rooted, return it if exists. otherwise return empty. + if (ioUtil.isRooted(tool)) { + const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions); + if (filePath) { + return [filePath]; + } + return []; + } + // if any path separators, return empty + if (tool.includes(path.sep)) { + return []; + } + // build the list of directories + // + // Note, technically "where" checks the current directory on Windows. From a toolkit perspective, + // it feels like we should not do this. Checking the current directory seems like more of a use + // case of a shell, and the which() function exposed by the toolkit should strive for consistency + // across platforms. + const directories = []; + if (process.env.PATH) { + for (const p of process.env.PATH.split(path.delimiter)) { + if (p) { + directories.push(p); + } + } + } + // find all matches + const matches = []; + for (const directory of directories) { + const filePath = yield ioUtil.tryGetExecutablePath(path.join(directory, tool), extensions); + if (filePath) { + matches.push(filePath); + } + } + return matches; + }); } -function getPolymorphicDiscriminatorRecursively(serializer, mapper) { - return (mapper.type.polymorphicDiscriminator || - getPolymorphicDiscriminatorSafely(serializer, mapper.type.uberParent) || - getPolymorphicDiscriminatorSafely(serializer, mapper.type.className)); +exports.findInPath = findInPath; +function readCopyOptions(options) { + const force = options.force == null ? true : options.force; + const recursive = Boolean(options.recursive); + const copySourceDirectory = options.copySourceDirectory == null + ? true + : Boolean(options.copySourceDirectory); + return { force, recursive, copySourceDirectory }; } -function getPolymorphicDiscriminatorSafely(serializer, typeName) { - return (typeName && - serializer.modelMappers[typeName] && - serializer.modelMappers[typeName].type.polymorphicDiscriminator); +function cpDirRecursive(sourceDir, destDir, currentDepth, force) { + return __awaiter(this, void 0, void 0, function* () { + // Ensure there is not a run away recursive copy + if (currentDepth >= 255) + return; + currentDepth++; + yield mkdirP(destDir); + const files = yield ioUtil.readdir(sourceDir); + for (const fileName of files) { + const srcFile = `${sourceDir}/${fileName}`; + const destFile = `${destDir}/${fileName}`; + const srcFileStat = yield ioUtil.lstat(srcFile); + if (srcFileStat.isDirectory()) { + // Recurse + yield cpDirRecursive(srcFile, destFile, currentDepth, force); + } + else { + yield copyFile(srcFile, destFile, force); + } + } + // Change the mode for the newly created directory + yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); + }); } -// TODO: why is this here? -function serializeObject(toSerialize) { - var castToSerialize = toSerialize; - if (toSerialize == undefined) - return undefined; - if (toSerialize instanceof Uint8Array) { - toSerialize = encodeByteArray(toSerialize); - return toSerialize; - } - else if (toSerialize instanceof Date) { - return toSerialize.toISOString(); - } - else if (Array.isArray(toSerialize)) { - var array = []; - for (var i = 0; i < toSerialize.length; i++) { - array.push(serializeObject(toSerialize[i])); +// Buffered file copy +function copyFile(srcFile, destFile, force) { + return __awaiter(this, void 0, void 0, function* () { + if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) { + // unlink/re-link it + try { + yield ioUtil.lstat(destFile); + yield ioUtil.unlink(destFile); + } + catch (e) { + // Try to override file permission + if (e.code === 'EPERM') { + yield ioUtil.chmod(destFile, '0666'); + yield ioUtil.unlink(destFile); + } + // other errors = it doesn't exist, no work to do + } + // Copy over symlink + const symlinkFull = yield ioUtil.readlink(srcFile); + yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? 'junction' : null); } - return array; - } - else if (typeof toSerialize === "object") { - var dictionary = {}; - for (var property in toSerialize) { - dictionary[property] = serializeObject(castToSerialize[property]); + else if (!(yield ioUtil.exists(destFile)) || force) { + yield ioUtil.copyFile(srcFile, destFile); } - return dictionary; - } - return toSerialize; -} -/** - * Utility function to create a K:V from a list of strings - */ -function strEnum(o) { - var result = {}; - for (var _i = 0, o_1 = o; _i < o_1.length; _i++) { - var key = o_1[_i]; - result[key] = key; - } - return result; + }); } -// eslint-disable-next-line @typescript-eslint/no-redeclare -var MapperType = strEnum([ - "Base64Url", - "Boolean", - "ByteArray", - "Composite", - "Date", - "DateTime", - "DateTimeRfc1123", - "Dictionary", - "Enum", - "Number", - "Object", - "Sequence", - "String", - "Stream", - "TimeSpan", - "UnixTime" -]); +//# sourceMappingURL=io.js.map + +/***/ }), + +/***/ 2557: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +var tslib = __nccwpck_require__(9268); // Copyright (c) Microsoft Corporation. -function isWebResourceLike(object) { - if (object && typeof object === "object") { - var castObject = object; - if (typeof castObject.url === "string" && - typeof castObject.method === "string" && - typeof castObject.headers === "object" && - isHttpHeadersLike(castObject.headers) && - typeof castObject.validateRequestProperties === "function" && - typeof castObject.prepare === "function" && - typeof castObject.clone === "function") { - return true; - } - } - return false; -} +// Licensed under the MIT license. +var listenersMap = new WeakMap(); +var abortedMap = new WeakMap(); /** - * Creates a new WebResource object. + * An aborter instance implements AbortSignal interface, can abort HTTP requests. * - * This class provides an abstraction over a REST call by being library / implementation agnostic and wrapping the necessary - * properties to initiate a request. + * - Call AbortSignal.none to create a new AbortSignal instance that cannot be cancelled. + * Use `AbortSignal.none` when you are required to pass a cancellation token but the operation + * cannot or will not ever be cancelled. + * + * @example + * Abort without timeout + * ```ts + * await doAsyncWork(AbortSignal.none); + * ``` */ -var WebResource = /** @class */ (function () { - function WebResource(url, method, body, query, headers, streamResponseBody, withCredentials, abortSignal, timeout, onUploadProgress, onDownloadProgress, proxySettings, keepAlive, decompressResponse, streamResponseStatusCodes) { - this.streamResponseBody = streamResponseBody; - this.streamResponseStatusCodes = streamResponseStatusCodes; - this.url = url || ""; - this.method = method || "GET"; - this.headers = isHttpHeadersLike(headers) ? headers : new HttpHeaders(headers); - this.body = body; - this.query = query; - this.formData = undefined; - this.withCredentials = withCredentials || false; - this.abortSignal = abortSignal; - this.timeout = timeout || 0; - this.onUploadProgress = onUploadProgress; - this.onDownloadProgress = onDownloadProgress; - this.proxySettings = proxySettings; - this.keepAlive = keepAlive; - this.decompressResponse = decompressResponse; - this.requestId = this.headers.get("x-ms-client-request-id") || generateUuid(); +var AbortSignal = /** @class */ (function () { + function AbortSignal() { + /** + * onabort event listener. + */ + this.onabort = null; + listenersMap.set(this, []); + abortedMap.set(this, false); } + Object.defineProperty(AbortSignal.prototype, "aborted", { + /** + * Status of whether aborted or not. + * + * @readonly + */ + get: function () { + if (!abortedMap.has(this)) { + throw new TypeError("Expected `this` to be an instance of AbortSignal."); + } + return abortedMap.get(this); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(AbortSignal, "none", { + /** + * Creates a new AbortSignal instance that will never be aborted. + * + * @readonly + */ + get: function () { + return new AbortSignal(); + }, + enumerable: false, + configurable: true + }); /** - * Validates that the required properties such as method, url, headers["Content-Type"], - * headers["accept-language"] are defined. It will throw an error if one of the above - * mentioned properties are not defined. + * Added new "abort" event listener, only support "abort" event. + * + * @param _type - Only support "abort" event + * @param listener - The listener to be added */ - WebResource.prototype.validateRequestProperties = function () { - if (!this.method) { - throw new Error("WebResource.method is required."); - } - if (!this.url) { - throw new Error("WebResource.url is required."); + AbortSignal.prototype.addEventListener = function ( + // tslint:disable-next-line:variable-name + _type, listener) { + if (!listenersMap.has(this)) { + throw new TypeError("Expected `this` to be an instance of AbortSignal."); } + var listeners = listenersMap.get(this); + listeners.push(listener); }; /** - * Prepares the request. - * @param options - Options to provide for preparing the request. - * @returns Returns the prepared WebResource (HTTP Request) object that needs to be given to the request pipeline. + * Remove "abort" event listener, only support "abort" event. + * + * @param _type - Only support "abort" event + * @param listener - The listener to be removed */ - WebResource.prototype.prepare = function (options) { - if (!options) { - throw new Error("options object is required"); - } - if (options.method === undefined || - options.method === null || - typeof options.method.valueOf() !== "string") { - throw new Error("options.method must be a string."); - } - if (options.url && options.pathTemplate) { - throw new Error("options.url and options.pathTemplate are mutually exclusive. Please provide exactly one of them."); - } - if ((options.pathTemplate === undefined || - options.pathTemplate === null || - typeof options.pathTemplate.valueOf() !== "string") && - (options.url === undefined || - options.url === null || - typeof options.url.valueOf() !== "string")) { - throw new Error("Please provide exactly one of options.pathTemplate or options.url."); - } - // set the url if it is provided. - if (options.url) { - if (typeof options.url !== "string") { - throw new Error('options.url must be of type "string".'); - } - this.url = options.url; - } - // set the method - if (options.method) { - var validMethods = ["GET", "PUT", "HEAD", "DELETE", "OPTIONS", "POST", "PATCH", "TRACE"]; - if (validMethods.indexOf(options.method.toUpperCase()) === -1) { - throw new Error('The provided method "' + - options.method + - '" is invalid. Supported HTTP methods are: ' + - JSON.stringify(validMethods)); - } - } - this.method = options.method.toUpperCase(); - // construct the url if path template is provided - if (options.pathTemplate) { - var pathTemplate_1 = options.pathTemplate, pathParameters_1 = options.pathParameters; - if (typeof pathTemplate_1 !== "string") { - throw new Error('options.pathTemplate must be of type "string".'); - } - if (!options.baseUrl) { - options.baseUrl = "https://management.azure.com"; - } - var baseUrl = options.baseUrl; - var url_1 = baseUrl + - (baseUrl.endsWith("/") ? "" : "/") + - (pathTemplate_1.startsWith("/") ? pathTemplate_1.slice(1) : pathTemplate_1); - var segments = url_1.match(/({[\w-]*\s*[\w-]*})/gi); - if (segments && segments.length) { - if (!pathParameters_1) { - throw new Error("pathTemplate: " + pathTemplate_1 + " has been provided. Hence, options.pathParameters must also be provided."); - } - segments.forEach(function (item) { - var pathParamName = item.slice(1, -1); - var pathParam = pathParameters_1[pathParamName]; - if (pathParam === null || - pathParam === undefined || - !(typeof pathParam === "string" || typeof pathParam === "object")) { - var stringifiedPathParameters = JSON.stringify(pathParameters_1, undefined, 2); - throw new Error("pathTemplate: " + pathTemplate_1 + " contains the path parameter " + pathParamName + - (" however, it is not present in parameters: " + stringifiedPathParameters + ".") + - ("The value of the path parameter can either be a \"string\" of the form { " + pathParamName + ": \"some sample value\" } or ") + - ("it can be an \"object\" of the form { \"" + pathParamName + "\": { value: \"some sample value\", skipUrlEncoding: true } }.")); - } - if (typeof pathParam.valueOf() === "string") { - url_1 = url_1.replace(item, encodeURIComponent(pathParam)); - } - if (typeof pathParam.valueOf() === "object") { - if (!pathParam.value) { - throw new Error("options.pathParameters[" + pathParamName + "] is of type \"object\" but it does not contain a \"value\" property."); - } - if (pathParam.skipUrlEncoding) { - url_1 = url_1.replace(item, pathParam.value); - } - else { - url_1 = url_1.replace(item, encodeURIComponent(pathParam.value)); - } - } - }); - } - this.url = url_1; - } - // append query parameters to the url if they are provided. They can be provided with pathTemplate or url option. - if (options.queryParameters) { - var queryParameters = options.queryParameters; - if (typeof queryParameters !== "object") { - throw new Error("options.queryParameters must be of type object. It should be a JSON object " + - "of \"query-parameter-name\" as the key and the \"query-parameter-value\" as the value. " + - "The \"query-parameter-value\" may be fo type \"string\" or an \"object\" of the form { value: \"query-parameter-value\", skipUrlEncoding: true }."); - } - // append question mark if it is not present in the url - if (this.url && this.url.indexOf("?") === -1) { - this.url += "?"; - } - // construct queryString - var queryParams = []; - // We need to populate this.query as a dictionary if the request is being used for Sway's validateRequest(). - this.query = {}; - for (var queryParamName in queryParameters) { - var queryParam = queryParameters[queryParamName]; - if (queryParam) { - if (typeof queryParam === "string") { - queryParams.push(queryParamName + "=" + encodeURIComponent(queryParam)); - this.query[queryParamName] = encodeURIComponent(queryParam); - } - else if (typeof queryParam === "object") { - if (!queryParam.value) { - throw new Error("options.queryParameters[" + queryParamName + "] is of type \"object\" but it does not contain a \"value\" property."); - } - if (queryParam.skipUrlEncoding) { - queryParams.push(queryParamName + "=" + queryParam.value); - this.query[queryParamName] = queryParam.value; - } - else { - queryParams.push(queryParamName + "=" + encodeURIComponent(queryParam.value)); - this.query[queryParamName] = encodeURIComponent(queryParam.value); - } - } - } - } // end-of-for - // append the queryString - this.url += queryParams.join("&"); - } - // add headers to the request if they are provided - if (options.headers) { - var headers = options.headers; - for (var _i = 0, _a = Object.keys(options.headers); _i < _a.length; _i++) { - var headerName = _a[_i]; - this.headers.set(headerName, headers[headerName]); - } - } - // ensure accept-language is set correctly - if (!this.headers.get("accept-language")) { - this.headers.set("accept-language", "en-US"); - } - // ensure the request-id is set correctly - if (!this.headers.get("x-ms-client-request-id") && !options.disableClientRequestId) { - this.headers.set("x-ms-client-request-id", this.requestId); - } - // default - if (!this.headers.get("Content-Type")) { - this.headers.set("Content-Type", "application/json; charset=utf-8"); - } - // set the request body. request.js automatically sets the Content-Length request header, so we need not set it explicitly - this.body = options.body; - if (options.body !== undefined && options.body !== null) { - // body as a stream special case. set the body as-is and check for some special request headers specific to sending a stream. - if (options.bodyIsStream) { - if (!this.headers.get("Transfer-Encoding")) { - this.headers.set("Transfer-Encoding", "chunked"); - } - if (this.headers.get("Content-Type") !== "application/octet-stream") { - this.headers.set("Content-Type", "application/octet-stream"); - } - } - else { - if (options.serializationMapper) { - this.body = new Serializer(options.mappers).serialize(options.serializationMapper, options.body, "requestBody"); - } - if (!options.disableJsonStringifyOnBody) { - this.body = JSON.stringify(options.body); - } - } - } - if (options.spanOptions) { - this.spanOptions = options.spanOptions; + AbortSignal.prototype.removeEventListener = function ( + // tslint:disable-next-line:variable-name + _type, listener) { + if (!listenersMap.has(this)) { + throw new TypeError("Expected `this` to be an instance of AbortSignal."); } - if (options.tracingContext) { - this.tracingContext = options.tracingContext; + var listeners = listenersMap.get(this); + var index = listeners.indexOf(listener); + if (index > -1) { + listeners.splice(index, 1); } - this.abortSignal = options.abortSignal; - this.onDownloadProgress = options.onDownloadProgress; - this.onUploadProgress = options.onUploadProgress; - return this; }; /** - * Clone this WebResource HTTP request object. - * @returns The clone of this WebResource HTTP request object. + * Dispatches a synthetic event to the AbortSignal. */ - WebResource.prototype.clone = function () { - var result = new WebResource(this.url, this.method, this.body, this.query, this.headers && this.headers.clone(), this.streamResponseBody, this.withCredentials, this.abortSignal, this.timeout, this.onUploadProgress, this.onDownloadProgress, this.proxySettings, this.keepAlive, this.decompressResponse, this.streamResponseStatusCodes); - if (this.formData) { - result.formData = this.formData; - } - if (this.operationSpec) { - result.operationSpec = this.operationSpec; - } - if (this.shouldDeserialize) { - result.shouldDeserialize = this.shouldDeserialize; - } - if (this.operationResponseGetter) { - result.operationResponseGetter = this.operationResponseGetter; - } - return result; + AbortSignal.prototype.dispatchEvent = function (_event) { + throw new Error("This is a stub dispatchEvent implementation that should not be used. It only exists for type-checking purposes."); }; - return WebResource; + return AbortSignal; }()); - -// Copyright (c) Microsoft Corporation. -var custom = util.inspect.custom; +/** + * Helper to trigger an abort event immediately, the onabort and all abort event listeners will be triggered. + * Will try to trigger abort event for all linked AbortSignal nodes. + * + * - If there is a timeout, the timer will be cancelled. + * - If aborted is true, nothing will happen. + * + * @internal + */ +// eslint-disable-next-line @azure/azure-sdk/ts-use-interface-parameters +function abortSignal(signal) { + if (signal.aborted) { + return; + } + if (signal.onabort) { + signal.onabort.call(signal); + } + var listeners = listenersMap.get(signal); + if (listeners) { + // Create a copy of listeners so mutations to the array + // (e.g. via removeListener calls) don't affect the listeners + // we invoke. + listeners.slice().forEach(function (listener) { + listener.call(signal, { type: "abort" }); + }); + } + abortedMap.set(signal, true); +} // Copyright (c) Microsoft Corporation. /** - * A class that handles the query portion of a URLBuilder. + * This error is thrown when an asynchronous operation has been aborted. + * Check for this error by testing the `name` that the name property of the + * error matches `"AbortError"`. + * + * @example + * ```ts + * const controller = new AbortController(); + * controller.abort(); + * try { + * doAsyncWork(controller.signal) + * } catch (e) { + * if (e.name === 'AbortError') { + * // handle abort error here. + * } + * } + * ``` */ -var URLQuery = /** @class */ (function () { - function URLQuery() { - this._rawQuery = {}; +var AbortError = /** @class */ (function (_super) { + tslib.__extends(AbortError, _super); + function AbortError(message) { + var _this = _super.call(this, message) || this; + _this.name = "AbortError"; + return _this; } - /** - * Get whether or not there any query parameters in this URLQuery. - */ - URLQuery.prototype.any = function () { - return Object.keys(this._rawQuery).length > 0; - }; - /** - * Get the keys of the query string. - */ - URLQuery.prototype.keys = function () { - return Object.keys(this._rawQuery); - }; - /** - * Set a query parameter with the provided name and value. If the parameterValue is undefined or - * empty, then this will attempt to remove an existing query parameter with the provided - * parameterName. - */ - URLQuery.prototype.set = function (parameterName, parameterValue) { - var caseParameterValue = parameterValue; - if (parameterName) { - if (caseParameterValue !== undefined && caseParameterValue !== null) { - var newValue = Array.isArray(caseParameterValue) - ? caseParameterValue - : caseParameterValue.toString(); - this._rawQuery[parameterName] = newValue; - } - else { - delete this._rawQuery[parameterName]; - } + return AbortError; +}(Error)); +/** + * An AbortController provides an AbortSignal and the associated controls to signal + * that an asynchronous operation should be aborted. + * + * @example + * Abort an operation when another event fires + * ```ts + * const controller = new AbortController(); + * const signal = controller.signal; + * doAsyncWork(signal); + * button.addEventListener('click', () => controller.abort()); + * ``` + * + * @example + * Share aborter cross multiple operations in 30s + * ```ts + * // Upload the same data to 2 different data centers at the same time, + * // abort another when any of them is finished + * const controller = AbortController.withTimeout(30 * 1000); + * doAsyncWork(controller.signal).then(controller.abort); + * doAsyncWork(controller.signal).then(controller.abort); + *``` + * + * @example + * Cascaded aborting + * ```ts + * // All operations can't take more than 30 seconds + * const aborter = Aborter.timeout(30 * 1000); + * + * // Following 2 operations can't take more than 25 seconds + * await doAsyncWork(aborter.withTimeout(25 * 1000)); + * await doAsyncWork(aborter.withTimeout(25 * 1000)); + * ``` + */ +var AbortController = /** @class */ (function () { + // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types + function AbortController(parentSignals) { + var _this = this; + this._signal = new AbortSignal(); + if (!parentSignals) { + return; } - }; - /** - * Get the value of the query parameter with the provided name. If no parameter exists with the - * provided parameter name, then undefined will be returned. - */ - URLQuery.prototype.get = function (parameterName) { - return parameterName ? this._rawQuery[parameterName] : undefined; - }; - /** - * Get the string representation of this query. The return value will not start with a "?". - */ - URLQuery.prototype.toString = function () { - var result = ""; - for (var parameterName in this._rawQuery) { - if (result) { - result += "&"; - } - var parameterValue = this._rawQuery[parameterName]; - if (Array.isArray(parameterValue)) { - var parameterStrings = []; - for (var _i = 0, parameterValue_1 = parameterValue; _i < parameterValue_1.length; _i++) { - var parameterValueElement = parameterValue_1[_i]; - parameterStrings.push(parameterName + "=" + parameterValueElement); - } - result += parameterStrings.join("&"); - } - else { - result += parameterName + "=" + parameterValue; - } + // coerce parentSignals into an array + if (!Array.isArray(parentSignals)) { + // eslint-disable-next-line prefer-rest-params + parentSignals = arguments; } - return result; - }; - /** - * Parse a URLQuery from the provided text. - */ - URLQuery.parse = function (text) { - var result = new URLQuery(); - if (text) { - if (text.startsWith("?")) { - text = text.substring(1); - } - var currentState = "ParameterName"; - var parameterName = ""; - var parameterValue = ""; - for (var i = 0; i < text.length; ++i) { - var currentCharacter = text[i]; - switch (currentState) { - case "ParameterName": - switch (currentCharacter) { - case "=": - currentState = "ParameterValue"; - break; - case "&": - parameterName = ""; - parameterValue = ""; - break; - default: - parameterName += currentCharacter; - break; - } - break; - case "ParameterValue": - switch (currentCharacter) { - case "&": - result.set(parameterName, parameterValue); - parameterName = ""; - parameterValue = ""; - currentState = "ParameterName"; - break; - default: - parameterValue += currentCharacter; - break; - } - break; - default: - throw new Error("Unrecognized URLQuery parse state: " + currentState); - } + for (var _i = 0, parentSignals_1 = parentSignals; _i < parentSignals_1.length; _i++) { + var parentSignal = parentSignals_1[_i]; + // if the parent signal has already had abort() called, + // then call abort on this signal as well. + if (parentSignal.aborted) { + this.abort(); } - if (currentState === "ParameterValue") { - result.set(parameterName, parameterValue); + else { + // when the parent signal aborts, this signal should as well. + parentSignal.addEventListener("abort", function () { + _this.abort(); + }); } } - return result; - }; - return URLQuery; -}()); -/** - * A class that handles creating, modifying, and parsing URLs. - */ -var URLBuilder = /** @class */ (function () { - function URLBuilder() { } + Object.defineProperty(AbortController.prototype, "signal", { + /** + * The AbortSignal associated with this controller that will signal aborted + * when the abort method is called on this controller. + * + * @readonly + */ + get: function () { + return this._signal; + }, + enumerable: false, + configurable: true + }); /** - * Set the scheme/protocol for this URL. If the provided scheme contains other parts of a URL - * (such as a host, port, path, or query), those parts will be added to this URL as well. - */ - URLBuilder.prototype.setScheme = function (scheme) { - if (!scheme) { - this._scheme = undefined; - } - else { - this.set(scheme, "SCHEME"); - } - }; - /** - * Get the scheme that has been set in this URL. - */ - URLBuilder.prototype.getScheme = function () { - return this._scheme; - }; - /** - * Set the host for this URL. If the provided host contains other parts of a URL (such as a - * port, path, or query), those parts will be added to this URL as well. - */ - URLBuilder.prototype.setHost = function (host) { - if (!host) { - this._host = undefined; - } - else { - this.set(host, "SCHEME_OR_HOST"); - } - }; - /** - * Get the host that has been set in this URL. + * Signal that any operations passed this controller's associated abort signal + * to cancel any remaining work and throw an `AbortError`. */ - URLBuilder.prototype.getHost = function () { - return this._host; + AbortController.prototype.abort = function () { + abortSignal(this._signal); }; /** - * Set the port for this URL. If the provided port contains other parts of a URL (such as a - * path or query), those parts will be added to this URL as well. + * Creates a new AbortSignal instance that will abort after the provided ms. + * @param ms - Elapsed time in milliseconds to trigger an abort. */ - URLBuilder.prototype.setPort = function (port) { - if (port === undefined || port === null || port === "") { - this._port = undefined; - } - else { - this.set(port.toString(), "PORT"); + AbortController.timeout = function (ms) { + var signal = new AbortSignal(); + var timer = setTimeout(abortSignal, ms, signal); + // Prevent the active Timer from keeping the Node.js event loop active. + if (typeof timer.unref === "function") { + timer.unref(); } + return signal; }; - /** - * Get the port that has been set in this URL. - */ - URLBuilder.prototype.getPort = function () { - return this._port; - }; - /** - * Set the path for this URL. If the provided path contains a query, then it will be added to - * this URL as well. - */ - URLBuilder.prototype.setPath = function (path) { - if (!path) { - this._path = undefined; - } - else { - var schemeIndex = path.indexOf("://"); - if (schemeIndex !== -1) { - var schemeStart = path.lastIndexOf("/", schemeIndex); - // Make sure to only grab the URL part of the path before setting the state back to SCHEME - // this will handle cases such as "/a/b/c/https://microsoft.com" => "https://microsoft.com" - this.set(schemeStart === -1 ? path : path.substr(schemeStart + 1), "SCHEME"); - } - else { - this.set(path, "PATH"); - } - } - }; - /** - * Append the provided path to this URL's existing path. If the provided path contains a query, - * then it will be added to this URL as well. - */ - URLBuilder.prototype.appendPath = function (path) { - if (path) { - var currentPath = this.getPath(); - if (currentPath) { - if (!currentPath.endsWith("/")) { - currentPath += "/"; - } - if (path.startsWith("/")) { - path = path.substring(1); - } - path = currentPath + path; - } - this.set(path, "PATH"); - } - }; - /** - * Get the path that has been set in this URL. - */ - URLBuilder.prototype.getPath = function () { - return this._path; - }; - /** - * Set the query in this URL. - */ - URLBuilder.prototype.setQuery = function (query) { - if (!query) { - this._query = undefined; - } - else { - this._query = URLQuery.parse(query); - } - }; - /** - * Set a query parameter with the provided name and value in this URL's query. If the provided - * query parameter value is undefined or empty, then the query parameter will be removed if it - * existed. - */ - URLBuilder.prototype.setQueryParameter = function (queryParameterName, queryParameterValue) { - if (queryParameterName) { - if (!this._query) { - this._query = new URLQuery(); - } - this._query.set(queryParameterName, queryParameterValue); - } - }; - /** - * Get the value of the query parameter with the provided query parameter name. If no query - * parameter exists with the provided name, then undefined will be returned. - */ - URLBuilder.prototype.getQueryParameterValue = function (queryParameterName) { - return this._query ? this._query.get(queryParameterName) : undefined; - }; - /** - * Get the query in this URL. - */ - URLBuilder.prototype.getQuery = function () { - return this._query ? this._query.toString() : undefined; - }; - /** - * Set the parts of this URL by parsing the provided text using the provided startState. - */ - URLBuilder.prototype.set = function (text, startState) { - var tokenizer = new URLTokenizer(text, startState); - while (tokenizer.next()) { - var token = tokenizer.current(); - var tokenPath = void 0; - if (token) { - switch (token.type) { - case "SCHEME": - this._scheme = token.text || undefined; - break; - case "HOST": - this._host = token.text || undefined; - break; - case "PORT": - this._port = token.text || undefined; - break; - case "PATH": - tokenPath = token.text || undefined; - if (!this._path || this._path === "/" || tokenPath !== "/") { - this._path = tokenPath; - } - break; - case "QUERY": - this._query = URLQuery.parse(token.text); - break; - default: - throw new Error("Unrecognized URLTokenType: " + token.type); - } - } - } - }; - URLBuilder.prototype.toString = function () { - var result = ""; - if (this._scheme) { - result += this._scheme + "://"; - } - if (this._host) { - result += this._host; - } - if (this._port) { - result += ":" + this._port; - } - if (this._path) { - if (!this._path.startsWith("/")) { - result += "/"; - } - result += this._path; - } - if (this._query && this._query.any()) { - result += "?" + this._query.toString(); - } - return result; - }; - /** - * If the provided searchValue is found in this URLBuilder, then replace it with the provided - * replaceValue. - */ - URLBuilder.prototype.replaceAll = function (searchValue, replaceValue) { - if (searchValue) { - this.setScheme(replaceAll(this.getScheme(), searchValue, replaceValue)); - this.setHost(replaceAll(this.getHost(), searchValue, replaceValue)); - this.setPort(replaceAll(this.getPort(), searchValue, replaceValue)); - this.setPath(replaceAll(this.getPath(), searchValue, replaceValue)); - this.setQuery(replaceAll(this.getQuery(), searchValue, replaceValue)); - } - }; - URLBuilder.parse = function (text) { - var result = new URLBuilder(); - result.set(text, "SCHEME_OR_HOST"); - return result; - }; - return URLBuilder; -}()); -var URLToken = /** @class */ (function () { - function URLToken(text, type) { - this.text = text; - this.type = type; - } - URLToken.scheme = function (text) { - return new URLToken(text, "SCHEME"); - }; - URLToken.host = function (text) { - return new URLToken(text, "HOST"); - }; - URLToken.port = function (text) { - return new URLToken(text, "PORT"); - }; - URLToken.path = function (text) { - return new URLToken(text, "PATH"); - }; - URLToken.query = function (text) { - return new URLToken(text, "QUERY"); - }; - return URLToken; -}()); -/** - * Get whether or not the provided character (single character string) is an alphanumeric (letter or - * digit) character. - */ -function isAlphaNumericCharacter(character) { - var characterCode = character.charCodeAt(0); - return ((48 /* '0' */ <= characterCode && characterCode <= 57) /* '9' */ || - (65 /* 'A' */ <= characterCode && characterCode <= 90) /* 'Z' */ || - (97 /* 'a' */ <= characterCode && characterCode <= 122) /* 'z' */); -} -/** - * A class that tokenizes URL strings. - */ -var URLTokenizer = /** @class */ (function () { - function URLTokenizer(_text, state) { - this._text = _text; - this._textLength = _text ? _text.length : 0; - this._currentState = state !== undefined && state !== null ? state : "SCHEME_OR_HOST"; - this._currentIndex = 0; - } - /** - * Get the current URLToken this URLTokenizer is pointing at, or undefined if the URLTokenizer - * hasn't started or has finished tokenizing. - */ - URLTokenizer.prototype.current = function () { - return this._currentToken; - }; - /** - * Advance to the next URLToken and return whether or not a URLToken was found. - */ - URLTokenizer.prototype.next = function () { - if (!hasCurrentCharacter(this)) { - this._currentToken = undefined; - } - else { - switch (this._currentState) { - case "SCHEME": - nextScheme(this); - break; - case "SCHEME_OR_HOST": - nextSchemeOrHost(this); - break; - case "HOST": - nextHost(this); - break; - case "PORT": - nextPort(this); - break; - case "PATH": - nextPath(this); - break; - case "QUERY": - nextQuery(this); - break; - default: - throw new Error("Unrecognized URLTokenizerState: " + this._currentState); - } - } - return !!this._currentToken; - }; - return URLTokenizer; + return AbortController; }()); -/** - * Read the remaining characters from this Tokenizer's character stream. - */ -function readRemaining(tokenizer) { - var result = ""; - if (tokenizer._currentIndex < tokenizer._textLength) { - result = tokenizer._text.substring(tokenizer._currentIndex); - tokenizer._currentIndex = tokenizer._textLength; - } - return result; -} -/** - * Whether or not this URLTokenizer has a current character. - */ -function hasCurrentCharacter(tokenizer) { - return tokenizer._currentIndex < tokenizer._textLength; -} -/** - * Get the character in the text string at the current index. - */ -function getCurrentCharacter(tokenizer) { - return tokenizer._text[tokenizer._currentIndex]; -} -/** - * Advance to the character in text that is "step" characters ahead. If no step value is provided, - * then step will default to 1. - */ -function nextCharacter(tokenizer, step) { - if (hasCurrentCharacter(tokenizer)) { - if (!step) { - step = 1; - } - tokenizer._currentIndex += step; - } -} -/** - * Starting with the current character, peek "charactersToPeek" number of characters ahead in this - * Tokenizer's stream of characters. - */ -function peekCharacters(tokenizer, charactersToPeek) { - var endIndex = tokenizer._currentIndex + charactersToPeek; - if (tokenizer._textLength < endIndex) { - endIndex = tokenizer._textLength; - } - return tokenizer._text.substring(tokenizer._currentIndex, endIndex); -} -/** - * Read characters from this Tokenizer until the end of the stream or until the provided condition - * is false when provided the current character. - */ -function readWhile(tokenizer, condition) { - var result = ""; - while (hasCurrentCharacter(tokenizer)) { - var currentCharacter = getCurrentCharacter(tokenizer); - if (!condition(currentCharacter)) { - break; - } - else { - result += currentCharacter; - nextCharacter(tokenizer); - } - } - return result; -} -/** - * Read characters from this Tokenizer until a non-alphanumeric character or the end of the - * character stream is reached. - */ -function readWhileLetterOrDigit(tokenizer) { - return readWhile(tokenizer, function (character) { return isAlphaNumericCharacter(character); }); -} -/** - * Read characters from this Tokenizer until one of the provided terminating characters is read or - * the end of the character stream is reached. - */ -function readUntilCharacter(tokenizer) { - var terminatingCharacters = []; - for (var _i = 1; _i < arguments.length; _i++) { - terminatingCharacters[_i - 1] = arguments[_i]; - } - return readWhile(tokenizer, function (character) { return terminatingCharacters.indexOf(character) === -1; }); -} -function nextScheme(tokenizer) { - var scheme = readWhileLetterOrDigit(tokenizer); - tokenizer._currentToken = URLToken.scheme(scheme); - if (!hasCurrentCharacter(tokenizer)) { - tokenizer._currentState = "DONE"; - } - else { - tokenizer._currentState = "HOST"; - } -} -function nextSchemeOrHost(tokenizer) { - var schemeOrHost = readUntilCharacter(tokenizer, ":", "/", "?"); - if (!hasCurrentCharacter(tokenizer)) { - tokenizer._currentToken = URLToken.host(schemeOrHost); - tokenizer._currentState = "DONE"; - } - else if (getCurrentCharacter(tokenizer) === ":") { - if (peekCharacters(tokenizer, 3) === "://") { - tokenizer._currentToken = URLToken.scheme(schemeOrHost); - tokenizer._currentState = "HOST"; - } - else { - tokenizer._currentToken = URLToken.host(schemeOrHost); - tokenizer._currentState = "PORT"; - } - } - else { - tokenizer._currentToken = URLToken.host(schemeOrHost); - if (getCurrentCharacter(tokenizer) === "/") { - tokenizer._currentState = "PATH"; - } - else { - tokenizer._currentState = "QUERY"; - } - } -} -function nextHost(tokenizer) { - if (peekCharacters(tokenizer, 3) === "://") { - nextCharacter(tokenizer, 3); - } - var host = readUntilCharacter(tokenizer, ":", "/", "?"); - tokenizer._currentToken = URLToken.host(host); - if (!hasCurrentCharacter(tokenizer)) { - tokenizer._currentState = "DONE"; - } - else if (getCurrentCharacter(tokenizer) === ":") { - tokenizer._currentState = "PORT"; - } - else if (getCurrentCharacter(tokenizer) === "/") { - tokenizer._currentState = "PATH"; - } - else { - tokenizer._currentState = "QUERY"; - } -} -function nextPort(tokenizer) { - if (getCurrentCharacter(tokenizer) === ":") { - nextCharacter(tokenizer); - } - var port = readUntilCharacter(tokenizer, "/", "?"); - tokenizer._currentToken = URLToken.port(port); - if (!hasCurrentCharacter(tokenizer)) { - tokenizer._currentState = "DONE"; - } - else if (getCurrentCharacter(tokenizer) === "/") { - tokenizer._currentState = "PATH"; - } - else { - tokenizer._currentState = "QUERY"; - } -} -function nextPath(tokenizer) { - var path = readUntilCharacter(tokenizer, "?"); - tokenizer._currentToken = URLToken.path(path); - if (!hasCurrentCharacter(tokenizer)) { - tokenizer._currentState = "DONE"; - } - else { - tokenizer._currentState = "QUERY"; - } -} -function nextQuery(tokenizer) { - if (getCurrentCharacter(tokenizer) === "?") { - nextCharacter(tokenizer); - } - var query = readRemaining(tokenizer); - tokenizer._currentToken = URLToken.query(query); - tokenizer._currentState = "DONE"; -} -// Copyright (c) Microsoft Corporation. -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", - "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" -]; -var defaultAllowedQueryParameters = ["api-version"]; -var Sanitizer = /** @class */ (function () { - function Sanitizer(_a) { - var _b = _a === void 0 ? {} : _a, _c = _b.allowedHeaderNames, allowedHeaderNames = _c === void 0 ? [] : _c, _d = _b.allowedQueryParameters, allowedQueryParameters = _d === void 0 ? [] : _d; - allowedHeaderNames = Array.isArray(allowedHeaderNames) - ? defaultAllowedHeaderNames.concat(allowedHeaderNames) - : defaultAllowedHeaderNames; - allowedQueryParameters = Array.isArray(allowedQueryParameters) - ? defaultAllowedQueryParameters.concat(allowedQueryParameters) - : defaultAllowedQueryParameters; - this.allowedHeaderNames = new Set(allowedHeaderNames.map(function (n) { return n.toLowerCase(); })); - this.allowedQueryParameters = new Set(allowedQueryParameters.map(function (p) { return p.toLowerCase(); })); - } - Sanitizer.prototype.sanitize = function (obj) { - return JSON.stringify(obj, this.replacer.bind(this), 2); - }; - Sanitizer.prototype.replacer = function (key, value) { - // Ensure Errors include their interesting non-enumerable members - if (value instanceof Error) { - return tslib.__assign(tslib.__assign({}, value), { name: value.name, message: value.message }); - } - if (key === "_headersMap") { - return this.sanitizeHeaders(key, value); - } - else if (key === "url") { - return this.sanitizeUrl(value); - } - else if (key === "query") { - return this.sanitizeQuery(value); - } - else if (key === "body") { - // Don't log the request body - return undefined; - } - else if (key === "response") { - // Don't log response again - return undefined; - } - else if (key === "operationSpec") { - // When using sendOperationRequest, the request carries a massive - // field with the autorest spec. No need to log it. - return undefined; - } - return value; - }; - Sanitizer.prototype.sanitizeHeaders = function (_, value) { - return this.sanitizeObject(value, this.allowedHeaderNames, function (v, k) { return v[k].value; }); - }; - Sanitizer.prototype.sanitizeQuery = function (value) { - return this.sanitizeObject(value, this.allowedQueryParameters, function (v, k) { return v[k]; }); - }; - Sanitizer.prototype.sanitizeObject = function (value, allowedKeys, accessor) { - if (typeof value !== "object" || value === null) { - return value; - } - var sanitized = {}; - for (var _i = 0, _a = Object.keys(value); _i < _a.length; _i++) { - var k = _a[_i]; - if (allowedKeys.has(k.toLowerCase())) { - sanitized[k] = accessor(value, k); - } - else { - sanitized[k] = RedactedString; - } - } - return sanitized; - }; - Sanitizer.prototype.sanitizeUrl = function (value) { - if (typeof value !== "string" || value === null) { - return value; - } - var urlBuilder = URLBuilder.parse(value); - var queryString = urlBuilder.getQuery(); - if (!queryString) { - return value; - } - var query = URLQuery.parse(queryString); - for (var _i = 0, _a = query.keys(); _i < _a.length; _i++) { - var k = _a[_i]; - if (!this.allowedQueryParameters.has(k.toLowerCase())) { - query.set(k, RedactedString); - } - } - urlBuilder.setQuery(query.toString()); - return urlBuilder.toString(); - }; - return Sanitizer; -}()); +exports.AbortController = AbortController; +exports.AbortError = AbortError; +exports.AbortSignal = AbortSignal; +//# sourceMappingURL=index.js.map -// Copyright (c) Microsoft Corporation. -var errorSanitizer = new Sanitizer(); -var RestError = /** @class */ (function (_super) { - tslib.__extends(RestError, _super); - function RestError(message, code, statusCode, request, response) { - var _this = _super.call(this, message) || this; - _this.name = "RestError"; - _this.code = code; - _this.statusCode = statusCode; - _this.request = request; - _this.response = response; - Object.setPrototypeOf(_this, RestError.prototype); - return _this; - } - /** - * Logging method for util.inspect in Node - */ - RestError.prototype[custom] = function () { - return "RestError: " + this.message + " \n " + errorSanitizer.sanitize(this); - }; - RestError.REQUEST_SEND_ERROR = "REQUEST_SEND_ERROR"; - RestError.PARSE_ERROR = "PARSE_ERROR"; - return RestError; -}(Error)); -// Copyright (c) Microsoft Corporation. -var logger = logger$1.createClientLogger("core-http"); +/***/ }), -// Copyright (c) Microsoft Corporation. -var ReportTransform = /** @class */ (function (_super) { - tslib.__extends(ReportTransform, _super); - function ReportTransform(progressCallback) { - var _this = _super.call(this) || this; - _this.progressCallback = progressCallback; - _this.loadedBytes = 0; - return _this; - } - ReportTransform.prototype._transform = function (chunk, _encoding, callback) { - this.push(chunk); - this.loadedBytes += chunk.length; - this.progressCallback({ loadedBytes: this.loadedBytes }); - callback(undefined); - }; - return ReportTransform; -}(stream.Transform)); -var FetchHttpClient = /** @class */ (function () { - function FetchHttpClient() { - } - FetchHttpClient.prototype.sendRequest = function (httpRequest) { - var _a; - return tslib.__awaiter(this, void 0, void 0, function () { - var abortController$1, abortListener, formData, requestForm_1, appendFormValue, _i, _b, formKey, formValue, j, contentType, body, onUploadProgress, uploadReportStream, platformSpecificRequestInit, requestInit, operationResponse, response, headers, streaming, _c, onDownloadProgress, responseBody, downloadReportStream, length_1, error_1, fetchError, uploadStreamDone, downloadStreamDone; - var _d; - return tslib.__generator(this, function (_e) { - switch (_e.label) { - case 0: - if (!httpRequest && typeof httpRequest !== "object") { - throw new Error("'httpRequest' (WebResourceLike) cannot be null or undefined and must be of type object."); - } - abortController$1 = new abortController.AbortController(); - if (httpRequest.abortSignal) { - if (httpRequest.abortSignal.aborted) { - throw new abortController.AbortError("The operation was aborted."); - } - abortListener = function (event) { - if (event.type === "abort") { - abortController$1.abort(); - } - }; - httpRequest.abortSignal.addEventListener("abort", abortListener); - } - if (httpRequest.timeout) { - setTimeout(function () { - abortController$1.abort(); - }, httpRequest.timeout); - } - if (httpRequest.formData) { - formData = httpRequest.formData; - requestForm_1 = new FormData(); - appendFormValue = function (key, value) { - // value function probably returns a stream so we can provide a fresh stream on each retry - if (typeof value === "function") { - value = value(); - } - if (value && - Object.prototype.hasOwnProperty.call(value, "value") && - Object.prototype.hasOwnProperty.call(value, "options")) { - requestForm_1.append(key, value.value, value.options); - } - else { - requestForm_1.append(key, value); - } - }; - for (_i = 0, _b = Object.keys(formData); _i < _b.length; _i++) { - formKey = _b[_i]; - formValue = formData[formKey]; - if (Array.isArray(formValue)) { - for (j = 0; j < formValue.length; j++) { - appendFormValue(formKey, formValue[j]); - } - } - else { - appendFormValue(formKey, formValue); - } - } - httpRequest.body = requestForm_1; - httpRequest.formData = undefined; - contentType = httpRequest.headers.get("Content-Type"); - if (contentType && contentType.indexOf("multipart/form-data") !== -1) { - if (typeof requestForm_1.getBoundary === "function") { - httpRequest.headers.set("Content-Type", "multipart/form-data; boundary=" + requestForm_1.getBoundary()); - } - else { - // browser will automatically apply a suitable content-type header - httpRequest.headers.remove("Content-Type"); - } - } - } - body = httpRequest.body - ? typeof httpRequest.body === "function" - ? httpRequest.body() - : httpRequest.body - : undefined; - if (httpRequest.onUploadProgress && httpRequest.body) { - onUploadProgress = httpRequest.onUploadProgress; - uploadReportStream = new ReportTransform(onUploadProgress); - if (isReadableStream(body)) { - body.pipe(uploadReportStream); - } - else { - uploadReportStream.end(body); - } - body = uploadReportStream; - } - return [4 /*yield*/, this.prepareRequest(httpRequest)]; - case 1: - platformSpecificRequestInit = _e.sent(); - requestInit = tslib.__assign({ body: body, headers: httpRequest.headers.rawHeaders(), method: httpRequest.method, signal: abortController$1.signal, redirect: "manual" }, platformSpecificRequestInit); - _e.label = 2; - case 2: - _e.trys.push([2, 8, 9, 10]); - return [4 /*yield*/, this.fetch(httpRequest.url, requestInit)]; - case 3: - response = _e.sent(); - headers = parseHeaders(response.headers); - streaming = ((_a = httpRequest.streamResponseStatusCodes) === null || _a === void 0 ? void 0 : _a.has(response.status)) || - httpRequest.streamResponseBody; - _d = { - headers: headers, - request: httpRequest, - status: response.status, - readableStreamBody: streaming - ? response.body - : undefined - }; - if (!!streaming) return [3 /*break*/, 5]; - return [4 /*yield*/, response.text()]; - case 4: - _c = _e.sent(); - return [3 /*break*/, 6]; - case 5: - _c = undefined; - _e.label = 6; - case 6: - operationResponse = (_d.bodyAsText = _c, - _d); - onDownloadProgress = httpRequest.onDownloadProgress; - if (onDownloadProgress) { - responseBody = response.body || undefined; - if (isReadableStream(responseBody)) { - downloadReportStream = new ReportTransform(onDownloadProgress); - responseBody.pipe(downloadReportStream); - operationResponse.readableStreamBody = downloadReportStream; - } - else { - length_1 = parseInt(headers.get("Content-Length")) || undefined; - if (length_1) { - // Calling callback for non-stream response for consistency with browser - onDownloadProgress({ loadedBytes: length_1 }); - } - } - } - return [4 /*yield*/, this.processRequest(operationResponse)]; - case 7: - _e.sent(); - return [2 /*return*/, operationResponse]; - case 8: - error_1 = _e.sent(); - fetchError = error_1; - if (fetchError.code === "ENOTFOUND") { - throw new RestError(fetchError.message, RestError.REQUEST_SEND_ERROR, undefined, httpRequest); - } - else if (fetchError.type === "aborted") { - throw new abortController.AbortError("The operation was aborted."); - } - throw fetchError; - case 9: - // clean up event listener - if (httpRequest.abortSignal && abortListener) { - uploadStreamDone = Promise.resolve(); - if (isReadableStream(body)) { - uploadStreamDone = isStreamComplete(body); - } - downloadStreamDone = Promise.resolve(); - if (isReadableStream(operationResponse === null || operationResponse === void 0 ? void 0 : operationResponse.readableStreamBody)) { - downloadStreamDone = isStreamComplete(operationResponse.readableStreamBody); - } - Promise.all([uploadStreamDone, downloadStreamDone]) - .then(function () { - var _a; - (_a = httpRequest.abortSignal) === null || _a === void 0 ? void 0 : _a.removeEventListener("abort", abortListener); - return; - }) - .catch(function (e) { - logger.warning("Error when cleaning up abortListener on httpRequest", e); - }); - } - return [7 /*endfinally*/]; - case 10: return [2 /*return*/]; - } - }); - }); - }; - return FetchHttpClient; -}()); -function isReadableStream(body) { - return body && typeof body.pipe === "function"; -} -function isStreamComplete(stream) { - return new Promise(function (resolve) { - stream.on("close", resolve); - stream.on("end", resolve); - stream.on("error", resolve); - }); -} -function parseHeaders(headers) { - var httpHeaders = new HttpHeaders(); - headers.forEach(function (value, key) { - httpHeaders.set(key, value); - }); - return httpHeaders; -} +/***/ 9268: +/***/ ((module) => { + +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ +/* global global, define, System, Reflect, Promise */ +var __extends; +var __assign; +var __rest; +var __decorate; +var __param; +var __metadata; +var __awaiter; +var __generator; +var __exportStar; +var __values; +var __read; +var __spread; +var __spreadArrays; +var __spreadArray; +var __await; +var __asyncGenerator; +var __asyncDelegator; +var __asyncValues; +var __makeTemplateObject; +var __importStar; +var __importDefault; +var __classPrivateFieldGet; +var __classPrivateFieldSet; +var __createBinding; +(function (factory) { + var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; + if (typeof define === "function" && define.amd) { + define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); + } + else if ( true && typeof module.exports === "object") { + factory(createExporter(root, createExporter(module.exports))); + } + else { + factory(createExporter(root)); + } + function createExporter(exports, previous) { + if (exports !== root) { + if (typeof Object.create === "function") { + Object.defineProperty(exports, "__esModule", { value: true }); + } + else { + exports.__esModule = true; + } + } + return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; + } +}) +(function (exporter) { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + + __extends = function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + + __assign = Object.assign || function (t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + }; + + __rest = function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; + }; + + __decorate = function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + + __param = function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } + }; + + __metadata = function (metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); + }; + + __awaiter = function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + + __generator = function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } + }; + + __exportStar = function(m, o) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); + }; + + __createBinding = Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); + }) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); + + __values = function (o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) return m.call(o); + if (o && typeof o.length === "number") return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); + }; + + __read = function (o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; + }; + + /** @deprecated */ + __spread = function () { + for (var ar = [], i = 0; i < arguments.length; i++) + ar = ar.concat(__read(arguments[i])); + return ar; + }; + + /** @deprecated */ + __spreadArrays = function () { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; + }; + + __spreadArray = function (to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || from); + }; + + __await = function (v) { + return this instanceof __await ? (this.v = v, this) : new __await(v); + }; + + __asyncGenerator = function (thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } + }; + + __asyncDelegator = function (o) { + var i, p; + return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; + function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } + }; + + __asyncValues = function (o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } + }; + + __makeTemplateObject = function (cooked, raw) { + if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } + return cooked; + }; + + var __setModuleDefault = Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + }) : function(o, v) { + o["default"] = v; + }; + + __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)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; + }; + + __importDefault = function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; + }; + + __classPrivateFieldGet = function (receiver, state, kind, f) { + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); + }; + + __classPrivateFieldSet = function (receiver, state, value, kind, f) { + if (kind === "m") throw new TypeError("Private method is not writable"); + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; + }; + + exporter("__extends", __extends); + exporter("__assign", __assign); + exporter("__rest", __rest); + exporter("__decorate", __decorate); + exporter("__param", __param); + exporter("__metadata", __metadata); + exporter("__awaiter", __awaiter); + exporter("__generator", __generator); + exporter("__exportStar", __exportStar); + exporter("__createBinding", __createBinding); + exporter("__values", __values); + exporter("__read", __read); + exporter("__spread", __spread); + exporter("__spreadArrays", __spreadArrays); + exporter("__spreadArray", __spreadArray); + exporter("__await", __await); + exporter("__asyncGenerator", __asyncGenerator); + exporter("__asyncDelegator", __asyncDelegator); + exporter("__asyncValues", __asyncValues); + exporter("__makeTemplateObject", __makeTemplateObject); + exporter("__importStar", __importStar); + exporter("__importDefault", __importDefault); + exporter("__classPrivateFieldGet", __classPrivateFieldGet); + exporter("__classPrivateFieldSet", __classPrivateFieldSet); +}); -// Copyright (c) Microsoft Corporation. -function createProxyAgent(requestUrl, proxySettings, headers) { - var host = URLBuilder.parse(proxySettings.host).getHost(); - if (!host) { - throw new Error("Expecting a non-empty host in proxy settings."); - } - if (!isValidPort(proxySettings.port)) { - throw new Error("Expecting a valid port number in the range of [0, 65535] in proxy settings."); - } - var tunnelOptions = { - proxy: { - host: host, - port: proxySettings.port, - headers: (headers && headers.rawHeaders()) || {} - } - }; - if (proxySettings.username && proxySettings.password) { - tunnelOptions.proxy.proxyAuth = proxySettings.username + ":" + proxySettings.password; - } - var isRequestHttps = isUrlHttps(requestUrl); - var isProxyHttps = isUrlHttps(proxySettings.host); - var proxyAgent = { - isHttps: isRequestHttps, - agent: createTunnel(isRequestHttps, isProxyHttps, tunnelOptions) - }; - return proxyAgent; -} -function isUrlHttps(url) { - var urlScheme = URLBuilder.parse(url).getScheme() || ""; - return urlScheme.toLowerCase() === "https"; -} -function createTunnel(isRequestHttps, isProxyHttps, tunnelOptions) { - if (isRequestHttps && isProxyHttps) { - return tunnel.httpsOverHttps(tunnelOptions); - } - else if (isRequestHttps && !isProxyHttps) { - return tunnel.httpsOverHttp(tunnelOptions); - } - else if (!isRequestHttps && isProxyHttps) { - return tunnel.httpOverHttps(tunnelOptions); - } - else { - return tunnel.httpOverHttp(tunnelOptions); - } -} -function isValidPort(port) { - // any port in 0-65535 range is valid (RFC 793) even though almost all implementations - // will reserve 0 for a specific purpose, and a range of numbers for ephemeral ports - return 0 <= port && port <= 65535; -} -// Copyright (c) Microsoft Corporation. -function getCachedAgent(isHttps, agentCache) { - return isHttps ? agentCache.httpsAgent : agentCache.httpAgent; -} -var NodeFetchHttpClient = /** @class */ (function (_super) { - tslib.__extends(NodeFetchHttpClient, _super); - function NodeFetchHttpClient() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.proxyAgents = {}; - _this.keepAliveAgents = {}; - _this.cookieJar = new tough.CookieJar(undefined, { looseMode: true }); - return _this; - } - NodeFetchHttpClient.prototype.getOrCreateAgent = function (httpRequest) { - var isHttps = isUrlHttps(httpRequest.url); - // At the moment, proxy settings and keepAlive are mutually - // exclusive because the 'tunnel' library currently lacks the - // ability to create a proxy with keepAlive turned on. - if (httpRequest.proxySettings) { - var agent = getCachedAgent(isHttps, this.proxyAgents); - if (agent) { - return agent; - } - var tunnel = createProxyAgent(httpRequest.url, httpRequest.proxySettings, httpRequest.headers); - agent = tunnel.agent; - if (tunnel.isHttps) { - this.proxyAgents.httpsAgent = tunnel.agent; - } - else { - this.proxyAgents.httpAgent = tunnel.agent; - } - return agent; - } - else if (httpRequest.keepAlive) { - var agent = getCachedAgent(isHttps, this.keepAliveAgents); - if (agent) { - return agent; - } - var agentOptions = { - keepAlive: httpRequest.keepAlive - }; - if (isHttps) { - agent = this.keepAliveAgents.httpsAgent = new https.Agent(agentOptions); - } - else { - agent = this.keepAliveAgents.httpAgent = new http.Agent(agentOptions); - } - return agent; - } - else { - return isHttps ? https.globalAgent : http.globalAgent; - } - }; - // eslint-disable-next-line @azure/azure-sdk/ts-apisurface-standardized-verbs - NodeFetchHttpClient.prototype.fetch = function (input, init) { - return tslib.__awaiter(this, void 0, void 0, function () { - return tslib.__generator(this, function (_a) { - return [2 /*return*/, node_fetch(input, init)]; - }); - }); - }; - NodeFetchHttpClient.prototype.prepareRequest = function (httpRequest) { - return tslib.__awaiter(this, void 0, void 0, function () { - var requestInit, cookieString; - var _this = this; - return tslib.__generator(this, function (_a) { - switch (_a.label) { - case 0: - requestInit = {}; - if (!(this.cookieJar && !httpRequest.headers.get("Cookie"))) return [3 /*break*/, 2]; - return [4 /*yield*/, new Promise(function (resolve, reject) { - _this.cookieJar.getCookieString(httpRequest.url, function (err, cookie) { - if (err) { - reject(err); - } - else { - resolve(cookie); - } - }); - })]; - case 1: - cookieString = _a.sent(); - httpRequest.headers.set("Cookie", cookieString); - _a.label = 2; - case 2: - // Set the http(s) agent - requestInit.agent = this.getOrCreateAgent(httpRequest); - requestInit.compress = httpRequest.decompressResponse; - return [2 /*return*/, requestInit]; - } - }); - }); - }; - NodeFetchHttpClient.prototype.processRequest = function (operationResponse) { - return tslib.__awaiter(this, void 0, void 0, function () { - var setCookieHeader_1; - var _this = this; - return tslib.__generator(this, function (_a) { - switch (_a.label) { - case 0: - if (!this.cookieJar) return [3 /*break*/, 2]; - setCookieHeader_1 = operationResponse.headers.get("Set-Cookie"); - if (!(setCookieHeader_1 !== undefined)) return [3 /*break*/, 2]; - return [4 /*yield*/, new Promise(function (resolve, reject) { - _this.cookieJar.setCookie(setCookieHeader_1, operationResponse.request.url, { ignoreError: true }, function (err) { - if (err) { - reject(err); - } - else { - resolve(); - } - }); - })]; - case 1: - _a.sent(); - _a.label = 2; - case 2: return [2 /*return*/]; - } - }); - }); - }; - return NodeFetchHttpClient; -}(FetchHttpClient)); +/***/ }), -// Copyright (c) Microsoft Corporation. -(function (HttpPipelineLogLevel) { - /** - * A log level that indicates that no logs will be logged. - */ - HttpPipelineLogLevel[HttpPipelineLogLevel["OFF"] = 0] = "OFF"; - /** - * An error log. - */ - HttpPipelineLogLevel[HttpPipelineLogLevel["ERROR"] = 1] = "ERROR"; - /** - * A warning log. - */ - HttpPipelineLogLevel[HttpPipelineLogLevel["WARNING"] = 2] = "WARNING"; - /** - * An information log. - */ - HttpPipelineLogLevel[HttpPipelineLogLevel["INFO"] = 3] = "INFO"; -})(exports.HttpPipelineLogLevel || (exports.HttpPipelineLogLevel = {})); +/***/ 6821: +/***/ (() => { -/** - * Converts an OperationOptions to a RequestOptionsBase - * - * @param opts - OperationOptions object to convert to RequestOptionsBase - */ -function operationOptionsToRequestOptionsBase(opts) { - var requestOptions = opts.requestOptions, tracingOptions = opts.tracingOptions, additionalOptions = tslib.__rest(opts, ["requestOptions", "tracingOptions"]); - var result = additionalOptions; - if (requestOptions) { - result = tslib.__assign(tslib.__assign({}, result), requestOptions); - } - if (tracingOptions) { - result.spanOptions = tracingOptions.spanOptions; - result.tracingContext = tracingOptions.tracingContext; - } - return result; +"use strict"; + +if (typeof Symbol === undefined || !Symbol.asyncIterator) { + Symbol.asyncIterator = Symbol.for("Symbol.asyncIterator"); } +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 9645: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ value: true })); // Copyright (c) Microsoft Corporation. -var BaseRequestPolicy = /** @class */ (function () { - function BaseRequestPolicy(_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. - */ - BaseRequestPolicy.prototype.shouldLog = function (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. - */ - BaseRequestPolicy.prototype.log = function (logLevel, message) { - this._options.log(logLevel, message); - }; - return BaseRequestPolicy; -}()); +// Licensed under the MIT license. /** - * Optional properties that can be used when creating a RequestPolicy. + * A static-key-based credential that supports updating + * the underlying key value. */ -var RequestPolicyOptions = /** @class */ (function () { - function RequestPolicyOptions(_logger) { - this._logger = _logger; - } - /** - * 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. - */ - RequestPolicyOptions.prototype.shouldLog = function (logLevel) { - return (!!this._logger && - logLevel !== exports.HttpPipelineLogLevel.OFF && - logLevel <= this._logger.minimumLogLevel); - }; +var AzureKeyCredential = /** @class */ (function () { /** - * Attempt to log the provided message to the provided logger. If no logger was provided or if - * the log level does not meet the logger's threshold, then nothing will be logged. - * @param logLevel - The log level of this log. - * @param message - The message of this log. - */ - RequestPolicyOptions.prototype.log = function (logLevel, message) { - if (this._logger && this.shouldLog(logLevel)) { - this._logger.log(logLevel, message); - } - }; - return RequestPolicyOptions; -}()); - -// Copyright (c) Microsoft Corporation. -function logPolicy(loggingOptions) { - if (loggingOptions === void 0) { loggingOptions = {}; } - return { - create: function (nextPolicy, options) { - return new LogPolicy(nextPolicy, options, loggingOptions); - } - }; -} -var LogPolicy = /** @class */ (function (_super) { - tslib.__extends(LogPolicy, _super); - function LogPolicy(nextPolicy, options, _a) { - var _b = _a === void 0 ? {} : _a, _c = _b.logger, logger$1 = _c === void 0 ? logger.info : _c, _d = _b.allowedHeaderNames, allowedHeaderNames = _d === void 0 ? [] : _d, _e = _b.allowedQueryParameters, allowedQueryParameters = _e === void 0 ? [] : _e; - var _this = _super.call(this, nextPolicy, options) || this; - _this.logger = logger$1; - _this.sanitizer = new Sanitizer({ allowedHeaderNames: allowedHeaderNames, allowedQueryParameters: allowedQueryParameters }); - return _this; - } - Object.defineProperty(LogPolicy.prototype, "allowedHeaderNames", { - /** - * Header names whose values will be logged when logging is enabled. Defaults to - * Date, traceparent, x-ms-client-request-id, and x-ms-request id. Any headers - * specified in this field will be added to that list. Any other values will - * be written to logs as "REDACTED". - * @deprecated Pass these into the constructor instead. - */ - get: function () { - return this.sanitizer.allowedHeaderNames; - }, - /** - * Header names whose values will be logged when logging is enabled. Defaults to - * Date, traceparent, x-ms-client-request-id, and x-ms-request id. Any headers - * specified in this field will be added to that list. Any other values will - * be written to logs as "REDACTED". - * @deprecated Pass these into the constructor instead. - */ - set: function (allowedHeaderNames) { - this.sanitizer.allowedHeaderNames = allowedHeaderNames; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(LogPolicy.prototype, "allowedQueryParameters", { + * Create an instance of an AzureKeyCredential for use + * with a service client. + * + * @param key - The initial value of the key to use in authentication + */ + function AzureKeyCredential(key) { + if (!key) { + throw new Error("key must be a non-empty string"); + } + this._key = key; + } + Object.defineProperty(AzureKeyCredential.prototype, "key", { /** - * Query string names whose values will be logged when logging is enabled. By default no - * query string values are logged. - * @deprecated Pass these into the constructor instead. + * The value of the key to be used in authentication */ get: function () { - return this.sanitizer.allowedQueryParameters; - }, - /** - * Query string names whose values will be logged when logging is enabled. By default no - * query string values are logged. - * @deprecated Pass these into the constructor instead. - */ - set: function (allowedQueryParameters) { - this.sanitizer.allowedQueryParameters = allowedQueryParameters; + return this._key; }, enumerable: false, configurable: true }); - LogPolicy.prototype.sendRequest = function (request) { - var _this = this; - if (!this.logger.enabled) - return this._nextPolicy.sendRequest(request); - this.logRequest(request); - return this._nextPolicy.sendRequest(request).then(function (response) { return _this.logResponse(response); }); - }; - LogPolicy.prototype.logRequest = function (request) { - this.logger("Request: " + this.sanitizer.sanitize(request)); - }; - LogPolicy.prototype.logResponse = function (response) { - this.logger("Response status code: " + response.status); - this.logger("Headers: " + this.sanitizer.sanitize(response.headers)); - return response; + /** + * Change the value of the key. + * + * Updates will take effect upon the next request after + * updating the key value. + * + * @param newKey - The new key value to be used + */ + AzureKeyCredential.prototype.update = function (newKey) { + this._key = newKey; }; - return LogPolicy; -}(BaseRequestPolicy)); + return AzureKeyCredential; +}()); // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. /** - * Get the path to this parameter's value as a dotted string (a.b.c). - * @param parameter - The parameter to get the path string for. - * @returns The path to this parameter's value as a dotted string. + * Helper TypeGuard that checks if something is defined or not. + * @param thing - Anything + * @internal */ -function getPathStringFromParameter(parameter) { - return getPathStringFromParameterPath(parameter.parameterPath, parameter.mapper); -} -function getPathStringFromParameterPath(parameterPath, mapper) { - var result; - if (typeof parameterPath === "string") { - result = parameterPath; - } - else if (Array.isArray(parameterPath)) { - result = parameterPath.join("."); - } - else { - result = mapper.serializedName; - } - return result; +function isDefined(thing) { + return typeof thing !== "undefined" && thing !== null; } - -// Copyright (c) Microsoft Corporation. /** - * Gets the list of status codes for streaming responses. + * Helper TypeGuard that checks if the input is an object with the specified properties. + * Note: The properties may be inherited. + * @param thing - Anything. + * @param properties - The name of the properties that should appear in the object. * @internal */ -function getStreamResponseStatusCodes(operationSpec) { - var result = new Set(); - for (var statusCode in operationSpec.responses) { - var operationResponse = operationSpec.responses[statusCode]; - if (operationResponse.bodyMapper && - operationResponse.bodyMapper.type.name === MapperType.Stream) { - result.add(Number(statusCode)); +function isObjectWithProperties(thing, properties) { + if (!isDefined(thing) || typeof thing !== "object") { + return false; + } + for (var _i = 0, properties_1 = properties; _i < properties_1.length; _i++) { + var property = properties_1[_i]; + if (!objectHasProperty(thing, property)) { + return false; } } - return result; -} - -// Copyright (c) Microsoft Corporation. -// Note: The reason we re-define all of the xml2js default settings (version 2.0) here is because the default settings object exposed -// by the xm2js library is mutable. See https://github.com/Leonidas-from-XIV/node-xml2js/issues/536 -// By creating a new copy of the settings each time we instantiate the parser, -// we are safeguarding against the possibility of the default settings being mutated elsewhere unintentionally. -var xml2jsDefaultOptionsV2 = { - explicitCharkey: false, - trim: false, - normalize: false, - normalizeTags: false, - attrkey: XML_ATTRKEY, - explicitArray: true, - ignoreAttrs: false, - mergeAttrs: false, - explicitRoot: true, - validator: undefined, - xmlns: false, - explicitChildren: false, - preserveChildrenOrder: false, - childkey: "$$", - charsAsChildren: false, - includeWhiteChars: false, - async: false, - strict: true, - attrNameProcessors: undefined, - attrValueProcessors: undefined, - tagNameProcessors: undefined, - valueProcessors: undefined, - rootName: "root", - xmldec: { - version: "1.0", - encoding: "UTF-8", - standalone: true - }, - doctype: undefined, - renderOpts: { - pretty: true, - indent: " ", - newline: "\n" - }, - headless: false, - chunkSize: 10000, - emptyTag: "", - cdata: false -}; -// The xml2js settings for general XML parsing operations. -var xml2jsParserSettings = Object.assign({}, xml2jsDefaultOptionsV2); -xml2jsParserSettings.explicitArray = false; -// The xml2js settings for general XML building operations. -var xml2jsBuilderSettings = Object.assign({}, xml2jsDefaultOptionsV2); -xml2jsBuilderSettings.explicitArray = false; -xml2jsBuilderSettings.renderOpts = { - pretty: false -}; -/** - * Converts given JSON object to XML string - * @param obj - JSON object to be converted into XML string - * @param opts - Options that govern the parsing of given JSON object - */ -function stringifyXML(obj, opts) { - var _a; - if (opts === void 0) { opts = {}; } - xml2jsBuilderSettings.rootName = opts.rootName; - xml2jsBuilderSettings.charkey = (_a = opts.xmlCharKey) !== null && _a !== void 0 ? _a : XML_CHARKEY; - var builder = new xml2js.Builder(xml2jsBuilderSettings); - return builder.buildObject(obj); + return true; } /** - * Converts given XML string into JSON - * @param str - String containing the XML content to be parsed into JSON - * @param opts - Options that govern the parsing of given xml string + * Helper TypeGuard that checks if the input is an object with the specified property. + * Note: The property may be inherited. + * @param thing - Any object. + * @param property - The name of the property that should appear in the object. + * @internal */ -function parseXML(str, opts) { - var _a; - if (opts === void 0) { opts = {}; } - xml2jsParserSettings.explicitRoot = !!opts.includeRoot; - xml2jsParserSettings.charkey = (_a = opts.xmlCharKey) !== null && _a !== void 0 ? _a : XML_CHARKEY; - var xmlParser = new xml2js.Parser(xml2jsParserSettings); - return new Promise(function (resolve, reject) { - if (!str) { - reject(new Error("Document is empty")); - } - else { - xmlParser.parseString(str, function (err, res) { - if (err) { - reject(err); - } - else { - resolve(res); - } - }); - } - }); +function objectHasProperty(thing, property) { + return typeof thing === "object" && property in thing; } // Copyright (c) Microsoft Corporation. /** - * Create a new serialization RequestPolicyCreator that will serialized HTTP request bodies as they - * pass through the HTTP pipeline. + * A static name/key-based credential that supports updating + * the underlying name and key values. */ -function deserializationPolicy(deserializationContentTypes, parsingOptions) { - return { - create: function (nextPolicy, options) { - return new DeserializationPolicy(nextPolicy, options, deserializationContentTypes, parsingOptions); +var AzureNamedKeyCredential = /** @class */ (function () { + /** + * Create an instance of an AzureNamedKeyCredential for use + * with a service client. + * + * @param name - The initial value of the name to use in authentication. + * @param key - The initial value of the key to use in authentication. + */ + function AzureNamedKeyCredential(name, key) { + if (!name || !key) { + throw new TypeError("name and key must be non-empty strings"); + } + this._name = name; + this._key = key; + } + Object.defineProperty(AzureNamedKeyCredential.prototype, "key", { + /** + * The value of the key to be used in authentication. + */ + get: function () { + return this._key; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(AzureNamedKeyCredential.prototype, "name", { + /** + * The value of the name to be used in authentication. + */ + get: function () { + return this._name; + }, + enumerable: false, + configurable: true + }); + /** + * Change the value of the key. + * + * Updates will take effect upon the next request after + * updating the key value. + * + * @param newName - The new name value to be used. + * @param newKey - The new key value to be used. + */ + AzureNamedKeyCredential.prototype.update = function (newName, newKey) { + if (!newName || !newKey) { + throw new TypeError("newName and newKey must be non-empty strings"); } + this._name = newName; + this._key = newKey; }; + return AzureNamedKeyCredential; +}()); +/** + * Tests an object to determine whether it implements NamedKeyCredential. + * + * @param credential - The assumed NamedKeyCredential to be tested. + */ +function isNamedKeyCredential(credential) { + return (isObjectWithProperties(credential, ["name", "key"]) && + typeof credential.key === "string" && + typeof credential.name === "string"); } -var defaultJsonContentTypes = ["application/json", "text/json"]; -var defaultXmlContentTypes = ["application/xml", "application/atom+xml"]; -var DefaultDeserializationOptions = { - expectedContentTypes: { - json: defaultJsonContentTypes, - xml: defaultXmlContentTypes - } -}; + +// Copyright (c) Microsoft Corporation. /** - * A RequestPolicy that will deserialize HTTP response bodies and headers as they pass through the - * HTTP pipeline. + * A static-signature-based credential that supports updating + * the underlying signature value. */ -var DeserializationPolicy = /** @class */ (function (_super) { - tslib.__extends(DeserializationPolicy, _super); - function DeserializationPolicy(nextPolicy, requestPolicyOptions, deserializationContentTypes, parsingOptions) { - if (parsingOptions === void 0) { parsingOptions = {}; } - var _a; - var _this = _super.call(this, nextPolicy, requestPolicyOptions) || this; - _this.jsonContentTypes = - (deserializationContentTypes && deserializationContentTypes.json) || defaultJsonContentTypes; - _this.xmlContentTypes = - (deserializationContentTypes && deserializationContentTypes.xml) || defaultXmlContentTypes; - _this.xmlCharKey = (_a = parsingOptions.xmlCharKey) !== null && _a !== void 0 ? _a : XML_CHARKEY; - return _this; - } - DeserializationPolicy.prototype.sendRequest = function (request) { - return tslib.__awaiter(this, void 0, void 0, function () { - var _this = this; - return tslib.__generator(this, function (_a) { - return [2 /*return*/, this._nextPolicy.sendRequest(request).then(function (response) { - return deserializeResponseBody(_this.jsonContentTypes, _this.xmlContentTypes, response, { - xmlCharKey: _this.xmlCharKey - }); - })]; - }); - }); - }; - return DeserializationPolicy; -}(BaseRequestPolicy)); -function getOperationResponse(parsedResponse) { - var result; - var request = parsedResponse.request; - var operationSpec = request.operationSpec; - if (operationSpec) { - var operationResponseGetter = request.operationResponseGetter; - if (!operationResponseGetter) { - result = operationSpec.responses[parsedResponse.status]; - } - else { - result = operationResponseGetter(operationSpec, parsedResponse); +var AzureSASCredential = /** @class */ (function () { + /** + * Create an instance of an AzureSASCredential for use + * with a service client. + * + * @param signature - The initial value of the shared access signature to use in authentication + */ + function AzureSASCredential(signature) { + if (!signature) { + throw new Error("shared access signature must be a non-empty string"); } + this._signature = signature; } - return result; -} -function shouldDeserializeResponse(parsedResponse) { - var shouldDeserialize = parsedResponse.request.shouldDeserialize; - var result; - if (shouldDeserialize === undefined) { - result = true; - } - else if (typeof shouldDeserialize === "boolean") { - result = shouldDeserialize; - } - else { - result = shouldDeserialize(parsedResponse); - } - return result; -} -function deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, options) { - var _a, _b, _c; - if (options === void 0) { options = {}; } - var updatedOptions = { - rootName: (_a = options.rootName) !== null && _a !== void 0 ? _a : "", - includeRoot: (_b = options.includeRoot) !== null && _b !== void 0 ? _b : false, - xmlCharKey: (_c = options.xmlCharKey) !== null && _c !== void 0 ? _c : XML_CHARKEY - }; - return parse(jsonContentTypes, xmlContentTypes, response, updatedOptions).then(function (parsedResponse) { - if (!shouldDeserializeResponse(parsedResponse)) { - return parsedResponse; - } - var operationSpec = parsedResponse.request.operationSpec; - if (!operationSpec || !operationSpec.responses) { - return parsedResponse; - } - var responseSpec = getOperationResponse(parsedResponse); - var _a = handleErrorResponse(parsedResponse, operationSpec, responseSpec), error = _a.error, shouldReturnResponse = _a.shouldReturnResponse; - if (error) { - throw error; - } - else if (shouldReturnResponse) { - return parsedResponse; - } - // An operation response spec does exist for current status code, so - // use it to deserialize the response. - if (responseSpec) { - if (responseSpec.bodyMapper) { - var valueToDeserialize = parsedResponse.parsedBody; - if (operationSpec.isXML && responseSpec.bodyMapper.type.name === MapperType.Sequence) { - valueToDeserialize = - typeof valueToDeserialize === "object" - ? valueToDeserialize[responseSpec.bodyMapper.xmlElementName] - : []; - } - try { - parsedResponse.parsedBody = operationSpec.serializer.deserialize(responseSpec.bodyMapper, valueToDeserialize, "operationRes.parsedBody", options); - } - catch (innerError) { - var restError = new RestError("Error " + innerError + " occurred in deserializing the responseBody - " + parsedResponse.bodyAsText, undefined, parsedResponse.status, parsedResponse.request, parsedResponse); - throw restError; - } - } - else if (operationSpec.httpMethod === "HEAD") { - // head methods never have a body, but we return a boolean to indicate presence/absence of the resource - parsedResponse.parsedBody = response.status >= 200 && response.status < 300; - } - if (responseSpec.headersMapper) { - parsedResponse.parsedHeaders = operationSpec.serializer.deserialize(responseSpec.headersMapper, parsedResponse.headers.rawHeaders(), "operationRes.parsedHeaders", options); - } - } - return parsedResponse; + Object.defineProperty(AzureSASCredential.prototype, "signature", { + /** + * The value of the shared access signature to be used in authentication + */ + get: function () { + return this._signature; + }, + enumerable: false, + configurable: true }); -} -function isOperationSpecEmpty(operationSpec) { - var expectedStatusCodes = Object.keys(operationSpec.responses); - return (expectedStatusCodes.length === 0 || - (expectedStatusCodes.length === 1 && expectedStatusCodes[0] === "default")); -} -function handleErrorResponse(parsedResponse, operationSpec, responseSpec) { - var _a; - var isSuccessByStatus = 200 <= parsedResponse.status && parsedResponse.status < 300; - var isExpectedStatusCode = isOperationSpecEmpty(operationSpec) - ? isSuccessByStatus - : !!responseSpec; - if (isExpectedStatusCode) { - if (responseSpec) { - if (!responseSpec.isError) { - return { error: null, shouldReturnResponse: false }; - } - } - else { - return { error: null, shouldReturnResponse: false }; - } - } - var errorResponseSpec = responseSpec !== null && responseSpec !== void 0 ? responseSpec : operationSpec.responses.default; - var streaming = ((_a = parsedResponse.request.streamResponseStatusCodes) === null || _a === void 0 ? void 0 : _a.has(parsedResponse.status)) || - parsedResponse.request.streamResponseBody; - var initialErrorMessage = streaming - ? "Unexpected status code: " + parsedResponse.status - : parsedResponse.bodyAsText; - var error = new RestError(initialErrorMessage, undefined, parsedResponse.status, parsedResponse.request, parsedResponse); - // If the item failed but there's no error spec or default spec to deserialize the error, - // we should fail so we just throw the parsed response - if (!errorResponseSpec) { - throw error; - } - var defaultBodyMapper = errorResponseSpec.bodyMapper; - var defaultHeadersMapper = errorResponseSpec.headersMapper; - try { - // If error response has a body, try to deserialize it using default body mapper. - // Then try to extract error code & message from it - if (parsedResponse.parsedBody) { - var parsedBody = parsedResponse.parsedBody; - var parsedError = void 0; - if (defaultBodyMapper) { - var valueToDeserialize = parsedBody; - if (operationSpec.isXML && defaultBodyMapper.type.name === MapperType.Sequence) { - valueToDeserialize = - typeof parsedBody === "object" ? parsedBody[defaultBodyMapper.xmlElementName] : []; - } - parsedError = operationSpec.serializer.deserialize(defaultBodyMapper, valueToDeserialize, "error.response.parsedBody"); - } - var internalError = parsedBody.error || parsedError || parsedBody; - error.code = internalError.code; - if (internalError.message) { - error.message = internalError.message; - } - if (defaultBodyMapper) { - error.response.parsedBody = parsedError; - } - } - // If error response has headers, try to deserialize it using default header mapper - if (parsedResponse.headers && defaultHeadersMapper) { - error.response.parsedHeaders = operationSpec.serializer.deserialize(defaultHeadersMapper, parsedResponse.headers.rawHeaders(), "operationRes.parsedHeaders"); - } - } - catch (defaultError) { - error.message = "Error \"" + defaultError.message + "\" occurred in deserializing the responseBody - \"" + parsedResponse.bodyAsText + "\" for the default response."; - } - return { error: error, shouldReturnResponse: false }; -} -function parse(jsonContentTypes, xmlContentTypes, operationResponse, opts) { - var _a; - var errorHandler = function (err) { - var msg = "Error \"" + err + "\" occurred while parsing the response body - " + operationResponse.bodyAsText + "."; - var errCode = err.code || RestError.PARSE_ERROR; - var e = new RestError(msg, errCode, operationResponse.status, operationResponse.request, operationResponse); - return Promise.reject(e); - }; - var streaming = ((_a = operationResponse.request.streamResponseStatusCodes) === null || _a === void 0 ? void 0 : _a.has(operationResponse.status)) || - operationResponse.request.streamResponseBody; - if (!streaming && operationResponse.bodyAsText) { - var text_1 = operationResponse.bodyAsText; - var contentType = operationResponse.headers.get("Content-Type") || ""; - var contentComponents = !contentType - ? [] - : contentType.split(";").map(function (component) { return component.toLowerCase(); }); - if (contentComponents.length === 0 || - contentComponents.some(function (component) { return jsonContentTypes.indexOf(component) !== -1; })) { - return new Promise(function (resolve) { - operationResponse.parsedBody = JSON.parse(text_1); - resolve(operationResponse); - }).catch(errorHandler); - } - else if (contentComponents.some(function (component) { return xmlContentTypes.indexOf(component) !== -1; })) { - return parseXML(text_1, opts) - .then(function (body) { - operationResponse.parsedBody = body; - return operationResponse; - }) - .catch(errorHandler); + /** + * Change the value of the signature. + * + * Updates will take effect upon the next request after + * updating the signature value. + * + * @param newSignature - The new shared access signature value to be used + */ + AzureSASCredential.prototype.update = function (newSignature) { + if (!newSignature) { + throw new Error("shared access signature must be a non-empty string"); } - } - return Promise.resolve(operationResponse); + this._signature = newSignature; + }; + return AzureSASCredential; +}()); +/** + * Tests an object to determine whether it implements SASCredential. + * + * @param credential - The assumed SASCredential to be tested. + */ +function isSASCredential(credential) { + return (isObjectWithProperties(credential, ["signature"]) && typeof credential.signature === "string"); } // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -var DEFAULT_CLIENT_RETRY_COUNT = 3; -// intervals are in ms -var DEFAULT_CLIENT_RETRY_INTERVAL = 1000 * 30; -var DEFAULT_CLIENT_MAX_RETRY_INTERVAL = 1000 * 90; -var DEFAULT_CLIENT_MIN_RETRY_INTERVAL = 1000 * 3; -function isNumber(n) { - return typeof n === "number"; -} /** - * @internal - * Determines if the operation should be retried. + * Tests an object to determine whether it implements TokenCredential. * - * @param retryLimit - Specifies the max number of retries. - * @param predicate - Initial chekck on whether to retry based on given responses or errors - * @param retryData - The retry data. - * @returns True if the operation qualifies for a retry; false otherwise. + * @param credential - The assumed TokenCredential to be tested. */ -function shouldRetry(retryLimit, predicate, retryData, response, error) { - if (!predicate(response, error)) { - return false; - } - return retryData.retryCount < retryLimit; +function isTokenCredential(credential) { + // Check for an object with a 'getToken' function and possibly with + // a 'signRequest' function. We do this check to make sure that + // a ServiceClientCredentials implementor (like TokenClientCredentials + // in ms-rest-nodeauth) doesn't get mistaken for a TokenCredential if + // it doesn't actually implement TokenCredential also. + var castCredential = credential; + return (castCredential && + typeof castCredential.getToken === "function" && + (castCredential.signRequest === undefined || castCredential.getToken.length > 0)); } + +exports.AzureKeyCredential = AzureKeyCredential; +exports.AzureNamedKeyCredential = AzureNamedKeyCredential; +exports.AzureSASCredential = AzureSASCredential; +exports.isNamedKeyCredential = isNamedKeyCredential; +exports.isSASCredential = isSASCredential; +exports.isTokenCredential = isTokenCredential; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 4607: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } + +var tslib = __nccwpck_require__(2107); +var uuid = __nccwpck_require__(3415); +var tough = __nccwpck_require__(8165); +var http = __nccwpck_require__(8605); +var https = __nccwpck_require__(7211); +var node_fetch = _interopDefault(__nccwpck_require__(467)); +var abortController = __nccwpck_require__(2557); +var FormData = _interopDefault(__nccwpck_require__(6279)); +var util = __nccwpck_require__(1669); +var url = __nccwpck_require__(8835); +var stream = __nccwpck_require__(2413); +var logger$1 = __nccwpck_require__(3233); +var tunnel = __nccwpck_require__(4294); +var coreAuth = __nccwpck_require__(9645); +var xml2js = __nccwpck_require__(6189); +var os = __nccwpck_require__(2087); +var coreTracing = __nccwpck_require__(4175); +__nccwpck_require__(6821); + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. /** - * @internal - * Updates the retry data for the next attempt. - * - * @param retryOptions - specifies retry interval, and its lower bound and upper bound. - * @param retryData - The retry data. - * @param err - The operation"s error, if any. + * A collection of HttpHeaders that can be sent with a HTTP request. */ -function updateRetryData(retryOptions, retryData, err) { - if (retryData === void 0) { retryData = { retryCount: 0, retryInterval: 0 }; } - if (err) { - if (retryData.error) { - err.innerError = retryData.error; - } - retryData.error = err; - } - // Adjust retry count - retryData.retryCount++; - // Adjust retry interval - var incrementDelta = Math.pow(2, retryData.retryCount - 1) - 1; - var boundedRandDelta = retryOptions.retryInterval * 0.8 + - Math.floor(Math.random() * (retryOptions.retryInterval * 0.4)); - incrementDelta *= boundedRandDelta; - retryData.retryInterval = Math.min(retryOptions.minRetryInterval + incrementDelta, retryOptions.maxRetryInterval); - return retryData; +function getHeaderKey(headerName) { + return headerName.toLowerCase(); } - -// Copyright (c) Microsoft Corporation. -function exponentialRetryPolicy(retryCount, retryInterval, maxRetryInterval) { - return { - create: function (nextPolicy, options) { - return new ExponentialRetryPolicy(nextPolicy, options, retryCount, retryInterval, maxRetryInterval); +function isHttpHeadersLike(object) { + if (object && typeof object === "object") { + var castObject = object; + if (typeof castObject.rawHeaders === "function" && + typeof castObject.clone === "function" && + typeof castObject.get === "function" && + typeof castObject.set === "function" && + typeof castObject.contains === "function" && + typeof castObject.remove === "function" && + typeof castObject.headersArray === "function" && + typeof castObject.headerValues === "function" && + typeof castObject.headerNames === "function" && + typeof castObject.toJson === "function") { + return true; } - }; + } + return false; } -(function (RetryMode) { - RetryMode[RetryMode["Exponential"] = 0] = "Exponential"; -})(exports.RetryMode || (exports.RetryMode = {})); -var DefaultRetryOptions = { - maxRetries: DEFAULT_CLIENT_RETRY_COUNT, - retryDelayInMs: DEFAULT_CLIENT_RETRY_INTERVAL, - maxRetryDelayInMs: DEFAULT_CLIENT_MAX_RETRY_INTERVAL -}; /** - * Instantiates a new "ExponentialRetryPolicyFilter" instance. + * A collection of HTTP header key/value pairs. */ -var ExponentialRetryPolicy = /** @class */ (function (_super) { - tslib.__extends(ExponentialRetryPolicy, _super); - /** - * @param nextPolicy - The next RequestPolicy in the pipeline chain. - * @param options - The options for this RequestPolicy. - * @param retryCount - The client retry count. - * @param retryInterval - The client retry interval, in milliseconds. - * @param minRetryInterval - The minimum retry interval, in milliseconds. - * @param maxRetryInterval - The maximum retry interval, in milliseconds. - */ - function ExponentialRetryPolicy(nextPolicy, options, retryCount, retryInterval, maxRetryInterval) { - var _this = _super.call(this, nextPolicy, options) || this; - _this.retryCount = isNumber(retryCount) ? retryCount : DEFAULT_CLIENT_RETRY_COUNT; - _this.retryInterval = isNumber(retryInterval) ? retryInterval : DEFAULT_CLIENT_RETRY_INTERVAL; - _this.maxRetryInterval = isNumber(maxRetryInterval) - ? maxRetryInterval - : DEFAULT_CLIENT_MAX_RETRY_INTERVAL; - return _this; - } - ExponentialRetryPolicy.prototype.sendRequest = function (request) { - var _this = this; - return this._nextPolicy - .sendRequest(request.clone()) - .then(function (response) { return retry(_this, request, response); }) - .catch(function (error) { return retry(_this, request, error.response, undefined, error); }); - }; - return ExponentialRetryPolicy; -}(BaseRequestPolicy)); -function retry(policy, request, response, retryData, requestError) { - return tslib.__awaiter(this, void 0, void 0, function () { - function shouldPolicyRetry(responseParam) { - var statusCode = responseParam === null || responseParam === void 0 ? void 0 : responseParam.status; - if (statusCode === undefined || - (statusCode < 500 && statusCode !== 408) || - statusCode === 501 || - statusCode === 505) { - return false; - } - return true; - } - var isAborted, res, err_1, err; - return tslib.__generator(this, function (_a) { - switch (_a.label) { - case 0: - retryData = updateRetryData({ - retryInterval: policy.retryInterval, - minRetryInterval: 0, - maxRetryInterval: policy.maxRetryInterval - }, retryData, requestError); - isAborted = request.abortSignal && request.abortSignal.aborted; - if (!(!isAborted && shouldRetry(policy.retryCount, shouldPolicyRetry, retryData, response))) return [3 /*break*/, 6]; - logger.info("Retrying request in " + retryData.retryInterval); - _a.label = 1; - case 1: - _a.trys.push([1, 4, , 5]); - return [4 /*yield*/, delay(retryData.retryInterval)]; - case 2: - _a.sent(); - return [4 /*yield*/, policy._nextPolicy.sendRequest(request.clone())]; - case 3: - res = _a.sent(); - return [2 /*return*/, retry(policy, request, res, retryData)]; - case 4: - err_1 = _a.sent(); - return [2 /*return*/, retry(policy, request, response, retryData, err_1)]; - case 5: return [3 /*break*/, 7]; - case 6: - if (isAborted || requestError || !response) { - err = retryData.error || - new RestError("Failed to send the request.", RestError.REQUEST_SEND_ERROR, response && response.status, response && response.request, response); - throw err; - } - else { - return [2 /*return*/, response]; - } - case 7: return [2 /*return*/]; +var HttpHeaders = /** @class */ (function () { + function HttpHeaders(rawHeaders) { + this._headersMap = {}; + if (rawHeaders) { + for (var headerName in rawHeaders) { + this.set(headerName, rawHeaders[headerName]); } - }); - }); -} - -// Copyright (c) Microsoft Corporation. -function generateClientRequestIdPolicy(requestIdHeaderName) { - if (requestIdHeaderName === void 0) { requestIdHeaderName = "x-ms-client-request-id"; } - return { - create: function (nextPolicy, options) { - return new GenerateClientRequestIdPolicy(nextPolicy, options, requestIdHeaderName); } - }; -} -var GenerateClientRequestIdPolicy = /** @class */ (function (_super) { - tslib.__extends(GenerateClientRequestIdPolicy, _super); - function GenerateClientRequestIdPolicy(nextPolicy, options, _requestIdHeaderName) { - var _this = _super.call(this, nextPolicy, options) || this; - _this._requestIdHeaderName = _requestIdHeaderName; - return _this; } - GenerateClientRequestIdPolicy.prototype.sendRequest = function (request) { - if (!request.headers.contains(this._requestIdHeaderName)) { - request.headers.set(this._requestIdHeaderName, request.requestId); - } - return this._nextPolicy.sendRequest(request); + /** + * Set a header in this collection with the provided name and value. The name is + * case-insensitive. + * @param headerName - The name of the header to set. This value is case-insensitive. + * @param headerValue - The value of the header to set. + */ + HttpHeaders.prototype.set = function (headerName, headerValue) { + this._headersMap[getHeaderKey(headerName)] = { + name: headerName, + value: headerValue.toString() + }; }; - return GenerateClientRequestIdPolicy; -}(BaseRequestPolicy)); - -// Copyright (c) Microsoft Corporation. -function getDefaultUserAgentKey() { - return Constants.HeaderConstants.USER_AGENT; -} -function getPlatformSpecificData() { - var runtimeInfo = { - key: "Node", - value: process.version + /** + * Get the header value for the provided header name, or undefined if no header exists in this + * collection with the provided name. + * @param headerName - The name of the header. + */ + HttpHeaders.prototype.get = function (headerName) { + var header = this._headersMap[getHeaderKey(headerName)]; + return !header ? undefined : header.value; }; - var osInfo = { - key: "OS", - value: "(" + os.arch() + "-" + os.type() + "-" + os.release() + ")" + /** + * Get whether or not this header collection contains a header entry for the provided header name. + */ + HttpHeaders.prototype.contains = function (headerName) { + return !!this._headersMap[getHeaderKey(headerName)]; }; - return [runtimeInfo, osInfo]; -} - -// Copyright (c) Microsoft Corporation. -function getRuntimeInfo() { - var msRestRuntime = { - key: "core-http", - value: Constants.coreHttpVersion + /** + * Remove the header with the provided headerName. Return whether or not the header existed and + * was removed. + * @param headerName - The name of the header to remove. + */ + HttpHeaders.prototype.remove = function (headerName) { + var result = this.contains(headerName); + delete this._headersMap[getHeaderKey(headerName)]; + return result; }; - return [msRestRuntime]; -} -function getUserAgentString(telemetryInfo, keySeparator, valueSeparator) { - if (keySeparator === void 0) { keySeparator = " "; } - if (valueSeparator === void 0) { valueSeparator = "/"; } - return telemetryInfo - .map(function (info) { - var value = info.value ? "" + valueSeparator + info.value : ""; - return "" + info.key + value; - }) - .join(keySeparator); -} -var getDefaultUserAgentHeaderName = getDefaultUserAgentKey; -function getDefaultUserAgentValue() { - var runtimeInfo = getRuntimeInfo(); - var platformSpecificData = getPlatformSpecificData(); - var userAgent = getUserAgentString(runtimeInfo.concat(platformSpecificData)); - return userAgent; -} -function userAgentPolicy(userAgentData) { - var key = !userAgentData || userAgentData.key === undefined || userAgentData.key === null - ? getDefaultUserAgentKey() - : userAgentData.key; - var value = !userAgentData || userAgentData.value === undefined || userAgentData.value === null - ? getDefaultUserAgentValue() - : userAgentData.value; - return { - create: function (nextPolicy, options) { - return new UserAgentPolicy(nextPolicy, options, key, value); + /** + * Get the headers that are contained this collection as an object. + */ + HttpHeaders.prototype.rawHeaders = function () { + var result = {}; + for (var headerKey in this._headersMap) { + var header = this._headersMap[headerKey]; + result[header.name.toLowerCase()] = header.value; } + return result; }; -} -var UserAgentPolicy = /** @class */ (function (_super) { - tslib.__extends(UserAgentPolicy, _super); - function UserAgentPolicy(_nextPolicy, _options, headerKey, headerValue) { - var _this = _super.call(this, _nextPolicy, _options) || this; - _this._nextPolicy = _nextPolicy; - _this._options = _options; - _this.headerKey = headerKey; - _this.headerValue = headerValue; - return _this; - } - UserAgentPolicy.prototype.sendRequest = function (request) { - this.addUserAgentHeader(request); - return this._nextPolicy.sendRequest(request); + /** + * Get the headers that are contained in this collection as an array. + */ + HttpHeaders.prototype.headersArray = function () { + var headers = []; + for (var headerKey in this._headersMap) { + headers.push(this._headersMap[headerKey]); + } + return headers; }; - UserAgentPolicy.prototype.addUserAgentHeader = function (request) { - if (!request.headers) { - request.headers = new HttpHeaders(); + /** + * Get the header names that are contained in this collection. + */ + HttpHeaders.prototype.headerNames = function () { + var headerNames = []; + var headers = this.headersArray(); + for (var i = 0; i < headers.length; ++i) { + headerNames.push(headers[i].name); } - if (!request.headers.get(this.headerKey) && this.headerValue) { - request.headers.set(this.headerKey, this.headerValue); + return headerNames; + }; + /** + * Get the header values that are contained in this collection. + */ + HttpHeaders.prototype.headerValues = function () { + var headerValues = []; + var headers = this.headersArray(); + for (var i = 0; i < headers.length; ++i) { + headerValues.push(headers[i].value); } + return headerValues; }; - return UserAgentPolicy; -}(BaseRequestPolicy)); + /** + * Get the JSON object representation of this HTTP header collection. + */ + HttpHeaders.prototype.toJson = function () { + return this.rawHeaders(); + }; + /** + * Get the string representation of this HTTP header collection. + */ + HttpHeaders.prototype.toString = function () { + return JSON.stringify(this.toJson()); + }; + /** + * Create a deep clone/copy of this HttpHeaders collection. + */ + HttpHeaders.prototype.clone = function () { + return new HttpHeaders(this.rawHeaders()); + }; + return HttpHeaders; +}()); // Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. /** - * Methods that are allowed to follow redirects 301 and 302 + * Encodes a string in base64 format. + * @param value - The string to encode */ -var allowedRedirect = ["GET", "HEAD"]; -var DefaultRedirectOptions = { - handleRedirects: true, - maxRetries: 20 -}; -function redirectPolicy(maximumRetries) { - if (maximumRetries === void 0) { maximumRetries = 20; } - return { - create: function (nextPolicy, options) { - return new RedirectPolicy(nextPolicy, options, maximumRetries); - } - }; +function encodeString(value) { + return Buffer.from(value).toString("base64"); } -var RedirectPolicy = /** @class */ (function (_super) { - tslib.__extends(RedirectPolicy, _super); - function RedirectPolicy(nextPolicy, options, maxRetries) { - if (maxRetries === void 0) { maxRetries = 20; } - var _this = _super.call(this, nextPolicy, options) || this; - _this.maxRetries = maxRetries; - return _this; - } - RedirectPolicy.prototype.sendRequest = function (request) { - var _this = this; - return this._nextPolicy - .sendRequest(request) - .then(function (response) { return handleRedirect(_this, response, 0); }); - }; - return RedirectPolicy; -}(BaseRequestPolicy)); -function handleRedirect(policy, response, currentRetries) { - var request = response.request, status = response.status; - var locationHeader = response.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) && - (!policy.maxRetries || currentRetries < policy.maxRetries)) { - var builder = URLBuilder.parse(request.url); - builder.setPath(locationHeader); - request.url = builder.toString(); - // POST request with Status code 303 should be converted into a - // redirected GET request if the redirect url is present in the location header - if (status === 303) { - request.method = "GET"; - delete request.body; +/** + * Encodes a byte array in base64 format. + * @param value - The Uint8Aray to encode + */ +function encodeByteArray(value) { + // Buffer.from accepts | -- the TypeScript definition is off here + // https://nodejs.org/api/buffer.html#buffer_class_method_buffer_from_arraybuffer_byteoffset_length + var bufferValue = value instanceof Buffer ? value : Buffer.from(value.buffer); + return bufferValue.toString("base64"); +} +/** + * Decodes a base64 string into a byte array. + * @param value - The base64 string to decode + */ +function decodeString(value) { + return Buffer.from(value, "base64"); +} + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +var Constants = { + /** + * The core-http version + */ + coreHttpVersion: "1.2.6", + /** + * Specifies HTTP. + */ + HTTP: "http:", + /** + * Specifies HTTPS. + */ + HTTPS: "https:", + /** + * Specifies HTTP Proxy. + */ + HTTP_PROXY: "HTTP_PROXY", + /** + * Specifies HTTPS Proxy. + */ + HTTPS_PROXY: "HTTPS_PROXY", + /** + * Specifies NO Proxy. + */ + NO_PROXY: "NO_PROXY", + /** + * Specifies ALL Proxy. + */ + ALL_PROXY: "ALL_PROXY", + HttpConstants: { + /** + * Http Verbs + */ + HttpVerbs: { + PUT: "PUT", + GET: "GET", + DELETE: "DELETE", + POST: "POST", + MERGE: "MERGE", + HEAD: "HEAD", + PATCH: "PATCH" + }, + StatusCodes: { + TooManyRequests: 429 } - return policy._nextPolicy - .sendRequest(request) - .then(function (res) { return handleRedirect(policy, res, currentRetries + 1); }); + }, + /** + * Defines constants for use with HTTP headers. + */ + HeaderConstants: { + /** + * The Authorization header. + */ + AUTHORIZATION: "authorization", + AUTHORIZATION_SCHEME: "Bearer", + /** + * The Retry-After response-header field can be used with a 503 (Service + * Unavailable) or 349 (Too Many Requests) responses to indicate how long + * the service is expected to be unavailable to the requesting client. + */ + RETRY_AFTER: "Retry-After", + /** + * The UserAgent header. + */ + USER_AGENT: "User-Agent" } - return Promise.resolve(response); -} +}; // Copyright (c) Microsoft Corporation. -function rpRegistrationPolicy(retryTimeout) { - if (retryTimeout === void 0) { retryTimeout = 30; } - return { - create: function (nextPolicy, options) { - return new RPRegistrationPolicy(nextPolicy, options, retryTimeout); - } - }; +// Licensed under the MIT license. +/** + * Default key used to access the XML attributes. + */ +var XML_ATTRKEY = "$"; +/** + * Default key used to access the XML value content. + */ +var XML_CHARKEY = "_"; + +// Copyright (c) Microsoft Corporation. +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; +/** + * A constant that indicates whether the environment is node.js or browser based. + */ +var isNode = typeof process !== "undefined" && + !!process.version && + !!process.versions && + !!process.versions.node; +/** + * Encodes an URI. + * + * @param uri - The URI to be encoded. + * @returns The encoded URI. + */ +function encodeUri(uri) { + return encodeURIComponent(uri) + .replace(/!/g, "%21") + .replace(/"/g, "%27") + .replace(/\(/g, "%28") + .replace(/\)/g, "%29") + .replace(/\*/g, "%2A"); } -var RPRegistrationPolicy = /** @class */ (function (_super) { - tslib.__extends(RPRegistrationPolicy, _super); - function RPRegistrationPolicy(nextPolicy, options, _retryTimeout) { - if (_retryTimeout === void 0) { _retryTimeout = 30; } - var _this = _super.call(this, nextPolicy, options) || this; - _this._retryTimeout = _retryTimeout; - return _this; - } - RPRegistrationPolicy.prototype.sendRequest = function (request) { - var _this = this; - return this._nextPolicy - .sendRequest(request.clone()) - .then(function (response) { return registerIfNeeded(_this, request, response); }); - }; - return RPRegistrationPolicy; -}(BaseRequestPolicy)); -function registerIfNeeded(policy, request, response) { - if (response.status === 409) { - var rpName = checkRPNotRegisteredError(response.bodyAsText); - if (rpName) { - var urlPrefix = extractSubscriptionUrl(request.url); - return (registerRP(policy, urlPrefix, rpName, request) - // Autoregistration of ${provider} failed for some reason. We will not return this error - // instead will return the initial response with 409 status code back to the user. - // do nothing here as we are returning the original response at the end of this method. - .catch(function () { return false; }) - .then(function (registrationStatus) { - if (registrationStatus) { - // Retry the original request. We have to change the x-ms-client-request-id - // otherwise Azure endpoint will return the initial 409 (cached) response. - request.headers.set("x-ms-client-request-id", generateUuid()); - return policy._nextPolicy.sendRequest(request.clone()); - } - return response; - })); - } - } - return Promise.resolve(response); +/** + * Returns a stripped version of the Http Response which only contains body, + * headers and the status. + * + * @param response - The Http Response + * @returns The stripped version of Http Response. + */ +function stripResponse(response) { + var strippedResponse = {}; + strippedResponse.body = response.bodyAsText; + strippedResponse.headers = response.headers; + strippedResponse.status = response.status; + return strippedResponse; } /** - * Reuses the headers of the original request and url (if specified). - * @param originalRequest - The original request - * @param reuseUrlToo - Should the url from the original request be reused as well. Default false. - * @returns A new request object with desired headers. + * Returns a stripped version of the Http Request that does not contain the + * Authorization header. + * + * @param request - The Http Request object + * @returns The stripped version of Http Request. */ -function getRequestEssentials(originalRequest, reuseUrlToo) { - if (reuseUrlToo === void 0) { reuseUrlToo = false; } - var reqOptions = originalRequest.clone(); - if (reuseUrlToo) { - reqOptions.url = originalRequest.url; +function stripRequest(request) { + var strippedRequest = request.clone(); + if (strippedRequest.headers) { + strippedRequest.headers.remove("authorization"); } - // We have to change the x-ms-client-request-id otherwise Azure endpoint - // will return the initial 409 (cached) response. - reqOptions.headers.set("x-ms-client-request-id", generateUuid()); - // Set content-type to application/json - reqOptions.headers.set("Content-Type", "application/json; charset=utf-8"); - return reqOptions; + return strippedRequest; } /** - * Validates the error code and message associated with 409 response status code. If it matches to that of - * RP not registered then it returns the name of the RP else returns undefined. - * @param body - The response body received after making the original request. - * @returns The name of the RP if condition is satisfied else undefined. + * Validates the given uuid as a string + * + * @param uuid - The uuid as a string that needs to be validated + * @returns True if the uuid is valid; false otherwise. */ -function checkRPNotRegisteredError(body) { - var result, responseBody; - if (body) { - try { - responseBody = JSON.parse(body); - } - catch (err) { - // do nothing; - } - if (responseBody && - responseBody.error && - responseBody.error.message && - responseBody.error.code && - responseBody.error.code === "MissingSubscriptionRegistration") { - var matchRes = responseBody.error.message.match(/.*'(.*)'/i); - if (matchRes) { - result = matchRes.pop(); - } - } - } - return result; +function isValidUuid(uuid) { + return validUuidRegex.test(uuid); } /** - * Extracts the first part of the URL, just after subscription: - * https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/ - * @param url - The original request url - * @returns The url prefix as explained above. + * Generated UUID + * + * @returns RFC4122 v4 UUID. */ -function extractSubscriptionUrl(url) { - var result; - var matchRes = url.match(/.*\/subscriptions\/[a-f0-9-]+\//gi); - if (matchRes && matchRes[0]) { - result = matchRes[0]; - } - else { - throw new Error("Unable to extract subscriptionId from the given url - " + url + "."); - } - return result; +function generateUuid() { + return uuid.v4(); } /** - * Registers the given provider. - * @param policy - The RPRegistrationPolicy this function is being called against. - * @param urlPrefix - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/ - * @param provider - The provider name to be registered. - * @param originalRequest - The original request sent by the user that returned a 409 response - * with a message that the provider is not registered. - * @param callback - The callback that handles the RP registration + * Executes an array of promises sequentially. Inspiration of this method is here: + * https://pouchdb.com/2015/05/18/we-have-a-problem-with-promises.html. An awesome blog on promises! + * + * @param promiseFactories - An array of promise factories(A function that return a promise) + * @param kickstart - Input to the first promise that is used to kickstart the promise chain. + * If not provided then the promise chain starts with undefined. + * @returns A chain of resolved or rejected promises */ -function registerRP(policy, urlPrefix, provider, originalRequest) { - var postUrl = urlPrefix + "providers/" + provider + "/register?api-version=2016-02-01"; - var getUrl = urlPrefix + "providers/" + provider + "?api-version=2016-02-01"; - var reqOptions = getRequestEssentials(originalRequest); - reqOptions.method = "POST"; - reqOptions.url = postUrl; - return policy._nextPolicy.sendRequest(reqOptions).then(function (response) { - if (response.status !== 200) { - throw new Error("Autoregistration of " + provider + " failed. Please try registering manually."); - } - return getRegistrationStatus(policy, getUrl, originalRequest); +function executePromisesSequentially(promiseFactories, kickstart) { + var result = Promise.resolve(kickstart); + promiseFactories.forEach(function (promiseFactory) { + result = result.then(promiseFactory); }); + return result; } /** - * Polls the registration status of the provider that was registered. Polling happens at an interval of 30 seconds. - * Polling will happen till the registrationState property of the response body is "Registered". - * @param policy - The RPRegistrationPolicy this function is being called against. - * @param url - The request url for polling - * @param originalRequest - The original request sent by the user that returned a 409 response - * with a message that the provider is not registered. - * @returns True if RP Registration is successful. + * A wrapper for setTimeout that resolves a promise after t milliseconds. + * @param t - The number of milliseconds to be delayed. + * @param value - The value to be resolved with after a timeout of t milliseconds. + * @returns Resolved promise */ -function getRegistrationStatus(policy, url, originalRequest) { - var reqOptions = getRequestEssentials(originalRequest); - reqOptions.url = url; - reqOptions.method = "GET"; - return policy._nextPolicy.sendRequest(reqOptions).then(function (res) { - var obj = res.parsedBody; - if (res.parsedBody && obj.registrationState && obj.registrationState === "Registered") { - return true; - } - else { - return delay(policy._retryTimeout * 1000) - .then(function () { return getRegistrationStatus(policy, url, originalRequest); }); - } - }); +function delay(t, value) { + return new Promise(function (resolve) { return setTimeout(function () { return resolve(value); }, t); }); } - -// Copyright (c) Microsoft Corporation. -// Default options for the cycler if none are provided -var DEFAULT_CYCLER_OPTIONS = { - forcedRefreshWindowInMs: 1000, - retryIntervalInMs: 3000, - refreshWindowInMs: 1000 * 60 * 2 // Start refreshing 2m before expiry -}; /** - * Converts an an unreliable access token getter (which may resolve with null) - * into an AccessTokenGetter by retrying the unreliable getter in a regular - * interval. - * - * @param getAccessToken - a function that produces a promise of an access - * token that may fail by returning null - * @param retryIntervalInMs - the time (in milliseconds) to wait between retry - * attempts - * @param timeoutInMs - the timestamp after which the refresh attempt will fail, - * throwing an exception - * @returns - a promise that, if it resolves, will resolve with an access token + * Converts a Promise to a callback. + * @param promise - The Promise to be converted to a callback + * @returns A function that takes the callback `(cb: Function) => void` + * @deprecated generated code should instead depend on responseToBody */ -function beginRefresh(getAccessToken, retryIntervalInMs, timeoutInMs) { - return tslib.__awaiter(this, void 0, void 0, function () { - // This wrapper handles exceptions gracefully as long as we haven't exceeded - // the timeout. - function tryGetAccessToken() { - return tslib.__awaiter(this, void 0, void 0, function () { - var _a, finalToken; - return tslib.__generator(this, function (_b) { - switch (_b.label) { - case 0: - if (!(Date.now() < timeoutInMs)) return [3 /*break*/, 5]; - _b.label = 1; - case 1: - _b.trys.push([1, 3, , 4]); - return [4 /*yield*/, getAccessToken()]; - case 2: return [2 /*return*/, _b.sent()]; - case 3: - _a = _b.sent(); - return [2 /*return*/, null]; - case 4: return [3 /*break*/, 7]; - case 5: return [4 /*yield*/, getAccessToken()]; - case 6: - finalToken = _b.sent(); - // Timeout is up, so throw if it's still null - if (finalToken === null) { - throw new Error("Failed to refresh access token."); - } - return [2 /*return*/, finalToken]; - case 7: return [2 /*return*/]; - } - }); - }); - } - var token; - return tslib.__generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, tryGetAccessToken()]; - case 1: - token = _a.sent(); - _a.label = 2; - case 2: - if (!(token === null)) return [3 /*break*/, 5]; - return [4 /*yield*/, delay(retryIntervalInMs)]; - case 3: - _a.sent(); - return [4 /*yield*/, tryGetAccessToken()]; - case 4: - token = _a.sent(); - return [3 /*break*/, 2]; - case 5: return [2 /*return*/, token]; - } +// eslint-disable-next-line @typescript-eslint/ban-types +function promiseToCallback(promise) { + if (typeof promise.then !== "function") { + throw new Error("The provided input is not a Promise."); + } + // eslint-disable-next-line @typescript-eslint/ban-types + return function (cb) { + promise + .then(function (data) { + // eslint-disable-next-line promise/no-callback-in-promise + return cb(undefined, data); + }) + .catch(function (err) { + // eslint-disable-next-line promise/no-callback-in-promise + cb(err); }); - }); + }; } /** - * Creates a token cycler from a credential, scopes, and optional settings. - * - * A token cycler represents a way to reliably retrieve a valid access token - * from a TokenCredential. It will handle initializing the token, refreshing it - * when it nears expiration, and synchronizes refresh attempts to avoid - * concurrency hazards. - * - * @param credential - the underlying TokenCredential that provides the access - * token - * @param scopes - the scopes to request authorization for - * @param tokenCyclerOptions - optionally override default settings for the cycler - * - * @returns - a function that reliably produces a valid access token + * Converts a Promise to a service callback. + * @param promise - The Promise of HttpOperationResponse to be converted to a service callback + * @returns A function that takes the service callback (cb: ServiceCallback): void */ -function createTokenCycler(credential, scopes, tokenCyclerOptions) { - var _this = this; - var refreshWorker = null; - var token = null; - var options = tslib.__assign(tslib.__assign({}, DEFAULT_CYCLER_OPTIONS), tokenCyclerOptions); - /** - * This little holder defines several predicates that we use to construct - * the rules of refreshing the token. - */ - var cycler = { - /** - * Produces true if a refresh job is currently in progress. - */ - get isRefreshing() { - return refreshWorker !== null; - }, - /** - * Produces true if the cycler SHOULD refresh (we are within the refresh - * window and not already refreshing) - */ - get shouldRefresh() { - var _a; - return (!cycler.isRefreshing && - ((_a = token === null || token === void 0 ? void 0 : token.expiresOnTimestamp) !== null && _a !== void 0 ? _a : 0) - options.refreshWindowInMs < Date.now()); - }, - /** - * Produces true if the cycler MUST refresh (null or nearly-expired - * token). - */ - get mustRefresh() { - return (token === null || token.expiresOnTimestamp - options.forcedRefreshWindowInMs < Date.now()); - } +function promiseToServiceCallback(promise) { + if (typeof promise.then !== "function") { + throw new Error("The provided input is not a Promise."); + } + return function (cb) { + promise + .then(function (data) { + return process.nextTick(cb, undefined, data.parsedBody, data.request, data); + }) + .catch(function (err) { + process.nextTick(cb, err); + }); }; - /** - * Starts a refresh job or returns the existing job if one is already - * running. - */ - function refresh(getTokenOptions) { - var _a; - if (!cycler.isRefreshing) { - // We bind `scopes` here to avoid passing it around a lot - var tryGetAccessToken = function () { - return credential.getToken(scopes, getTokenOptions); - }; - // Take advantage of promise chaining to insert an assignment to `token` - // before the refresh can be considered done. - 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()) - .then(function (_token) { - refreshWorker = null; - token = _token; - return token; - }) - .catch(function (reason) { - // We also should reset the refresher if we enter a failed state. All - // existing awaiters will throw, but subsequent requests will start a - // new retry chain. - refreshWorker = null; - token = null; - throw reason; - }); - } - return refreshWorker; +} +function prepareXMLRootList(obj, elementName, xmlNamespaceKey, xmlNamespace) { + var _a, _b, _c; + if (!Array.isArray(obj)) { + obj = [obj]; } - return function (tokenOptions) { return tslib.__awaiter(_this, void 0, void 0, function () { - return tslib.__generator(this, function (_a) { - // - // Simple rules: - // - If we MUST refresh, then return the refresh task, blocking - // the pipeline until a token is available. - // - If we SHOULD refresh, then run refresh but don't return it - // (we can still use the cached token). - // - Return the token, since it's fine if we didn't return in - // step 1. - // - if (cycler.mustRefresh) - return [2 /*return*/, refresh(tokenOptions)]; - if (cycler.shouldRefresh) { - refresh(tokenOptions); - } - return [2 /*return*/, token]; + if (!xmlNamespaceKey || !xmlNamespace) { + return _a = {}, _a[elementName] = obj, _a; + } + var result = (_b = {}, _b[elementName] = obj, _b); + result[XML_ATTRKEY] = (_c = {}, _c[xmlNamespaceKey] = xmlNamespace, _c); + return result; +} +/** + * Applies the properties on the prototype of sourceCtors to the prototype of targetCtor + * @param targetCtor - The target object on which the properties need to be applied. + * @param sourceCtors - An array of source objects from which the properties need to be taken. + */ +function applyMixins(targetCtorParam, sourceCtors) { + var castTargetCtorParam = targetCtorParam; + sourceCtors.forEach(function (sourceCtor) { + Object.getOwnPropertyNames(sourceCtor.prototype).forEach(function (name) { + castTargetCtorParam.prototype[name] = sourceCtor.prototype[name]; }); - }); }; + }); +} +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)?)?$/; +/** + * Indicates whether the given string is in ISO 8601 format. + * @param value - The value to be validated for ISO 8601 duration format. + * @returns `true` if valid, `false` otherwise. + */ +function isDuration(value) { + return validateISODuration.test(value); +} +/** + * Replace all of the instances of searchValue in value with the provided replaceValue. + * @param value - The value to search and replace in. + * @param searchValue - The value to search for in the value argument. + * @param replaceValue - The value to replace searchValue with in the value argument. + * @returns The value where each instance of searchValue was replaced with replacedValue. + */ +function replaceAll(value, searchValue, replaceValue) { + return !value || !searchValue ? value : value.split(searchValue).join(replaceValue || ""); } -// #endregion /** - * Creates a new factory for a RequestPolicy that applies a bearer token to - * the requests' `Authorization` headers. - * - * @param credential - The TokenCredential implementation that can supply the bearer token. - * @param scopes - The scopes for which the bearer token applies. + * Determines whether the given entity is a basic/primitive type + * (string, number, boolean, null, undefined). + * @param value - Any entity + * @returns true is it is primitive type, false otherwise. */ -function bearerTokenAuthenticationPolicy(credential, scopes) { - // This simple function encapsulates the entire process of reliably retrieving the token - var getToken = createTokenCycler(credential, scopes /* , options */); - var BearerTokenAuthenticationPolicy = /** @class */ (function (_super) { - tslib.__extends(BearerTokenAuthenticationPolicy, _super); - function BearerTokenAuthenticationPolicy(nextPolicy, options) { - return _super.call(this, nextPolicy, options) || this; - } - BearerTokenAuthenticationPolicy.prototype.sendRequest = function (webResource) { - return tslib.__awaiter(this, void 0, void 0, function () { - var token; - return tslib.__generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, getToken({ - abortSignal: webResource.abortSignal, - tracingOptions: { - spanOptions: webResource.spanOptions, - tracingContext: webResource.tracingContext - } - })]; - case 1: - token = (_a.sent()).token; - webResource.headers.set(Constants.HeaderConstants.AUTHORIZATION, "Bearer " + token); - return [2 /*return*/, this._nextPolicy.sendRequest(webResource)]; - } - }); - }); - }; - return BearerTokenAuthenticationPolicy; - }(BaseRequestPolicy)); - return { - create: function (nextPolicy, options) { - return new BearerTokenAuthenticationPolicy(nextPolicy, options); - } - }; +function isPrimitiveType(value) { + return (typeof value !== "object" && typeof value !== "function") || value === null; } - -// Copyright (c) Microsoft Corporation. -function systemErrorRetryPolicy(retryCount, retryInterval, minRetryInterval, maxRetryInterval) { - return { - create: function (nextPolicy, options) { - return new SystemErrorRetryPolicy(nextPolicy, options, retryCount, retryInterval, minRetryInterval, maxRetryInterval); - } - }; +function getEnvironmentValue(name) { + if (process.env[name]) { + return process.env[name]; + } + else if (process.env[name.toLowerCase()]) { + return process.env[name.toLowerCase()]; + } + return undefined; } /** - * @param retryCount - The client retry count. - * @param retryInterval - The client retry interval, in milliseconds. - * @param minRetryInterval - The minimum retry interval, in milliseconds. - * @param maxRetryInterval - The maximum retry interval, in milliseconds. + * @internal + * @returns true when input is an object type that is not null, Array, RegExp, or Date. */ -var SystemErrorRetryPolicy = /** @class */ (function (_super) { - tslib.__extends(SystemErrorRetryPolicy, _super); - function SystemErrorRetryPolicy(nextPolicy, options, retryCount, retryInterval, minRetryInterval, maxRetryInterval) { - var _this = _super.call(this, nextPolicy, options) || this; - _this.retryCount = isNumber(retryCount) ? retryCount : DEFAULT_CLIENT_RETRY_COUNT; - _this.retryInterval = isNumber(retryInterval) ? retryInterval : DEFAULT_CLIENT_RETRY_INTERVAL; - _this.minRetryInterval = isNumber(minRetryInterval) - ? minRetryInterval - : DEFAULT_CLIENT_MIN_RETRY_INTERVAL; - _this.maxRetryInterval = isNumber(maxRetryInterval) - ? maxRetryInterval - : DEFAULT_CLIENT_MAX_RETRY_INTERVAL; - return _this; +function isObject(input) { + return (typeof input === "object" && + input !== null && + !Array.isArray(input) && + !(input instanceof RegExp) && + !(input instanceof Date)); +} + +// Copyright (c) Microsoft Corporation. +var Serializer = /** @class */ (function () { + function Serializer(modelMappers, isXML) { + if (modelMappers === void 0) { modelMappers = {}; } + this.modelMappers = modelMappers; + this.isXML = isXML; } - SystemErrorRetryPolicy.prototype.sendRequest = function (request) { - var _this = this; - return this._nextPolicy - .sendRequest(request.clone()) - .catch(function (error) { return retry$1(_this, request, error.response, error); }); + Serializer.prototype.validateConstraints = function (mapper, value, objectName) { + var failValidation = function (constraintName, constraintValue) { + throw new Error("\"" + objectName + "\" with value \"" + value + "\" should satisfy the constraint \"" + constraintName + "\": " + constraintValue + "."); + }; + if (mapper.constraints && value != undefined) { + var valueAsNumber = value; + var _a = mapper.constraints, ExclusiveMaximum = _a.ExclusiveMaximum, ExclusiveMinimum = _a.ExclusiveMinimum, InclusiveMaximum = _a.InclusiveMaximum, InclusiveMinimum = _a.InclusiveMinimum, MaxItems = _a.MaxItems, MaxLength = _a.MaxLength, MinItems = _a.MinItems, MinLength = _a.MinLength, MultipleOf = _a.MultipleOf, Pattern = _a.Pattern, UniqueItems = _a.UniqueItems; + if (ExclusiveMaximum != undefined && valueAsNumber >= ExclusiveMaximum) { + failValidation("ExclusiveMaximum", ExclusiveMaximum); + } + if (ExclusiveMinimum != undefined && valueAsNumber <= ExclusiveMinimum) { + failValidation("ExclusiveMinimum", ExclusiveMinimum); + } + if (InclusiveMaximum != undefined && valueAsNumber > InclusiveMaximum) { + failValidation("InclusiveMaximum", InclusiveMaximum); + } + if (InclusiveMinimum != undefined && valueAsNumber < InclusiveMinimum) { + failValidation("InclusiveMinimum", InclusiveMinimum); + } + var valueAsArray = value; + if (MaxItems != undefined && valueAsArray.length > MaxItems) { + failValidation("MaxItems", MaxItems); + } + if (MaxLength != undefined && valueAsArray.length > MaxLength) { + failValidation("MaxLength", MaxLength); + } + if (MinItems != undefined && valueAsArray.length < MinItems) { + failValidation("MinItems", MinItems); + } + if (MinLength != undefined && valueAsArray.length < MinLength) { + failValidation("MinLength", MinLength); + } + if (MultipleOf != undefined && valueAsNumber % MultipleOf !== 0) { + failValidation("MultipleOf", MultipleOf); + } + if (Pattern) { + var pattern = typeof Pattern === "string" ? new RegExp(Pattern) : Pattern; + if (typeof value !== "string" || value.match(pattern) === null) { + failValidation("Pattern", Pattern); + } + } + if (UniqueItems && + valueAsArray.some(function (item, i, ar) { return ar.indexOf(item) !== i; })) { + failValidation("UniqueItems", UniqueItems); + } + } }; - return SystemErrorRetryPolicy; -}(BaseRequestPolicy)); -function retry$1(policy, request, operationResponse, err, retryData) { - return tslib.__awaiter(this, void 0, void 0, function () { - function shouldPolicyRetry(_response, error) { - if (error && - error.code && - (error.code === "ETIMEDOUT" || - error.code === "ESOCKETTIMEDOUT" || - error.code === "ECONNREFUSED" || - error.code === "ECONNRESET" || - error.code === "ENOENT")) { - return true; + /** + * Serialize the given object based on its metadata defined in the mapper + * + * @param mapper - The mapper which defines the metadata of the serializable object + * @param object - A valid Javascript object to be serialized + * @param objectName - Name of the serialized object + * @param options - additional options to deserialization + * @returns A valid serialized Javascript object + */ + Serializer.prototype.serialize = function (mapper, object, objectName, options) { + var _a, _b, _c; + if (options === void 0) { options = {}; } + var updatedOptions = { + rootName: (_a = options.rootName) !== null && _a !== void 0 ? _a : "", + includeRoot: (_b = options.includeRoot) !== null && _b !== void 0 ? _b : false, + xmlCharKey: (_c = options.xmlCharKey) !== null && _c !== void 0 ? _c : XML_CHARKEY + }; + var payload = {}; + var mapperType = mapper.type.name; + if (!objectName) { + objectName = mapper.serializedName; + } + if (mapperType.match(/^Sequence$/i) !== null) { + payload = []; + } + if (mapper.isConstant) { + object = mapper.defaultValue; + } + // This table of allowed values should help explain + // the mapper.required and mapper.nullable properties. + // X means "neither undefined or null are allowed". + // || required + // || true | false + // nullable || ========================== + // true || null | undefined/null + // false || X | undefined + // undefined || X | undefined/null + var required = mapper.required, nullable = mapper.nullable; + if (required && nullable && object === undefined) { + throw new Error(objectName + " cannot be undefined."); + } + if (required && !nullable && object == undefined) { + throw new Error(objectName + " cannot be null or undefined."); + } + if (!required && nullable === false && object === null) { + throw new Error(objectName + " cannot be null."); + } + if (object == undefined) { + payload = object; + } + else { + // Validate Constraints if any + this.validateConstraints(mapper, object, objectName); + if (mapperType.match(/^any$/i) !== null) { + payload = object; + } + else if (mapperType.match(/^(Number|String|Boolean|Object|Stream|Uuid)$/i) !== null) { + payload = serializeBasicTypes(mapperType, objectName, object); + } + else if (mapperType.match(/^Enum$/i) !== null) { + var enumMapper = mapper; + payload = serializeEnumType(objectName, enumMapper.type.allowedValues, object); + } + else if (mapperType.match(/^(Date|DateTime|TimeSpan|DateTimeRfc1123|UnixTime)$/i) !== null) { + payload = serializeDateTypes(mapperType, object, objectName); + } + else if (mapperType.match(/^ByteArray$/i) !== null) { + payload = serializeByteArrayType(objectName, object); + } + else if (mapperType.match(/^Base64Url$/i) !== null) { + payload = serializeBase64UrlType(objectName, object); + } + else if (mapperType.match(/^Sequence$/i) !== null) { + payload = serializeSequenceType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); + } + else if (mapperType.match(/^Dictionary$/i) !== null) { + payload = serializeDictionaryType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); + } + else if (mapperType.match(/^Composite$/i) !== null) { + payload = serializeCompositeType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); } - return false; } - var nestedErr_1; - return tslib.__generator(this, function (_a) { - switch (_a.label) { - case 0: - retryData = updateRetryData(policy, retryData, err); - if (!shouldRetry(policy.retryCount, shouldPolicyRetry, retryData, operationResponse, err)) return [3 /*break*/, 5]; - _a.label = 1; - case 1: - _a.trys.push([1, 3, , 4]); - return [4 /*yield*/, delay(retryData.retryInterval)]; - case 2: - _a.sent(); - return [2 /*return*/, policy._nextPolicy.sendRequest(request.clone())]; - case 3: - nestedErr_1 = _a.sent(); - return [2 /*return*/, retry$1(policy, request, operationResponse, nestedErr_1, retryData)]; - case 4: return [3 /*break*/, 6]; - case 5: - if (err) { - // If the operation failed in the end, return all errors instead of just the last one - return [2 /*return*/, Promise.reject(retryData.error)]; - } - return [2 /*return*/, operationResponse]; - case 6: return [2 /*return*/]; + return payload; + }; + /** + * Deserialize the given object based on its metadata defined in the mapper + * + * @param mapper - The mapper which defines the metadata of the serializable object + * @param responseBody - A valid Javascript entity to be deserialized + * @param objectName - Name of the deserialized object + * @param options - Controls behavior of XML parser and builder. + * @returns A valid deserialized Javascript object + */ + Serializer.prototype.deserialize = function (mapper, responseBody, objectName, options) { + var _a, _b, _c; + if (options === void 0) { options = {}; } + var updatedOptions = { + rootName: (_a = options.rootName) !== null && _a !== void 0 ? _a : "", + includeRoot: (_b = options.includeRoot) !== null && _b !== void 0 ? _b : false, + xmlCharKey: (_c = options.xmlCharKey) !== null && _c !== void 0 ? _c : XML_CHARKEY + }; + if (responseBody == undefined) { + if (this.isXML && mapper.type.name === "Sequence" && !mapper.xmlIsWrapped) { + // Edge case for empty XML non-wrapped lists. xml2js can't distinguish + // between the list being empty versus being missing, + // so let's do the more user-friendly thing and return an empty list. + responseBody = []; } - }); - }); + // specifically check for undefined as default value can be a falsey value `0, "", false, null` + if (mapper.defaultValue !== undefined) { + responseBody = mapper.defaultValue; + } + return responseBody; + } + var payload; + var mapperType = mapper.type.name; + if (!objectName) { + objectName = mapper.serializedName; + } + if (mapperType.match(/^Composite$/i) !== null) { + payload = deserializeCompositeType(this, mapper, responseBody, objectName, updatedOptions); + } + else { + if (this.isXML) { + var xmlCharKey = updatedOptions.xmlCharKey; + var castResponseBody = responseBody; + /** + * If the mapper specifies this as a non-composite type value but the responseBody contains + * both header ("$" i.e., XML_ATTRKEY) and body ("#" i.e., XML_CHARKEY) properties, + * then just reduce the responseBody value to the body ("#" i.e., XML_CHARKEY) property. + */ + if (castResponseBody[XML_ATTRKEY] != undefined && + castResponseBody[xmlCharKey] != undefined) { + responseBody = castResponseBody[xmlCharKey]; + } + } + if (mapperType.match(/^Number$/i) !== null) { + payload = parseFloat(responseBody); + if (isNaN(payload)) { + payload = responseBody; + } + } + else if (mapperType.match(/^Boolean$/i) !== null) { + if (responseBody === "true") { + payload = true; + } + else if (responseBody === "false") { + payload = false; + } + else { + payload = responseBody; + } + } + else if (mapperType.match(/^(String|Enum|Object|Stream|Uuid|TimeSpan|any)$/i) !== null) { + payload = responseBody; + } + else if (mapperType.match(/^(Date|DateTime|DateTimeRfc1123)$/i) !== null) { + payload = new Date(responseBody); + } + else if (mapperType.match(/^UnixTime$/i) !== null) { + payload = unixTimeToDate(responseBody); + } + else if (mapperType.match(/^ByteArray$/i) !== null) { + payload = decodeString(responseBody); + } + else if (mapperType.match(/^Base64Url$/i) !== null) { + payload = base64UrlToByteArray(responseBody); + } + else if (mapperType.match(/^Sequence$/i) !== null) { + payload = deserializeSequenceType(this, mapper, responseBody, objectName, updatedOptions); + } + else if (mapperType.match(/^Dictionary$/i) !== null) { + payload = deserializeDictionaryType(this, mapper, responseBody, objectName, updatedOptions); + } + } + if (mapper.isConstant) { + payload = mapper.defaultValue; + } + return payload; + }; + return Serializer; +}()); +function trimEnd(str, ch) { + var len = str.length; + while (len - 1 >= 0 && str[len - 1] === ch) { + --len; + } + return str.substr(0, len); } - -// Copyright (c) Microsoft Corporation. -(function (QueryCollectionFormat) { - QueryCollectionFormat["Csv"] = ","; - QueryCollectionFormat["Ssv"] = " "; - QueryCollectionFormat["Tsv"] = "\t"; - QueryCollectionFormat["Pipes"] = "|"; - QueryCollectionFormat["Multi"] = "Multi"; -})(exports.QueryCollectionFormat || (exports.QueryCollectionFormat = {})); - -// Copyright (c) Microsoft Corporation. -/** - * @internal - */ -var noProxyList = loadNoProxy(); -var byPassedList = new Map(); -function loadEnvironmentProxyValue() { - if (!process) { +function bufferToBase64Url(buffer) { + if (!buffer) { return undefined; } - var httpsProxy = getEnvironmentValue(Constants.HTTPS_PROXY); - var allProxy = getEnvironmentValue(Constants.ALL_PROXY); - var httpProxy = getEnvironmentValue(Constants.HTTP_PROXY); - return httpsProxy || allProxy || httpProxy; + if (!(buffer instanceof Uint8Array)) { + throw new Error("Please provide an input of type Uint8Array for converting to Base64Url."); + } + // Uint8Array to Base64. + var str = encodeByteArray(buffer); + // Base64 to Base64Url. + return trimEnd(str, "=") + .replace(/\+/g, "-") + .replace(/\//g, "_"); } -// Check whether the host of a given `uri` is in the noProxyList. -// If there's a match, any request sent to the same host won't have the proxy settings set. -// This implementation is a port of https://github.com/Azure/azure-sdk-for-net/blob/8cca811371159e527159c7eb65602477898683e2/sdk/core/Azure.Core/src/Pipeline/Internal/HttpEnvironmentProxy.cs#L210 -function isBypassed(uri) { - if (noProxyList.length === 0) { - return false; +function base64UrlToByteArray(str) { + if (!str) { + return undefined; } - var host = URLBuilder.parse(uri).getHost(); - if (byPassedList.has(host)) { - return byPassedList.get(host); + if (str && typeof str.valueOf() !== "string") { + throw new Error("Please provide an input of type string for converting to Uint8Array"); } - var isBypassedFlag = false; - for (var _i = 0, noProxyList_1 = noProxyList; _i < noProxyList_1.length; _i++) { - var pattern = noProxyList_1[_i]; - if (pattern[0] === ".") { - // This should match either domain it self or any subdomain or host - // .foo.com will match foo.com it self or *.foo.com - if (host.endsWith(pattern)) { - isBypassedFlag = true; + // Base64Url to Base64. + str = str.replace(/-/g, "+").replace(/_/g, "/"); + // Base64 to Uint8Array. + return decodeString(str); +} +function splitSerializeName(prop) { + var classes = []; + var partialclass = ""; + if (prop) { + var subwords = prop.split("."); + for (var _i = 0, subwords_1 = subwords; _i < subwords_1.length; _i++) { + var item = subwords_1[_i]; + if (item.charAt(item.length - 1) === "\\") { + partialclass += item.substr(0, item.length - 1) + "."; } else { - if (host.length === pattern.length - 1 && host === pattern.slice(1)) { - isBypassedFlag = true; - } - } - } - else { - if (host === pattern) { - isBypassedFlag = true; + partialclass += item; + classes.push(partialclass); + partialclass = ""; } } } - byPassedList.set(host, isBypassedFlag); - return isBypassedFlag; + return classes; } -/** - * @internal - */ -function loadNoProxy() { - var noProxy = getEnvironmentValue(Constants.NO_PROXY); - if (noProxy) { - return noProxy - .split(",") - .map(function (item) { return item.trim(); }) - .filter(function (item) { return item.length; }); +function dateToUnixTime(d) { + if (!d) { + return undefined; } - return []; -} -function getDefaultProxySettings(proxyUrl) { - if (!proxyUrl) { - proxyUrl = loadEnvironmentProxyValue(); - if (!proxyUrl) { - return undefined; - } + if (typeof d.valueOf() === "string") { + d = new Date(d); } - var _a = extractAuthFromUrl(proxyUrl), username = _a.username, password = _a.password, urlWithoutAuth = _a.urlWithoutAuth; - var parsedUrl = URLBuilder.parse(urlWithoutAuth); - var schema = parsedUrl.getScheme() ? parsedUrl.getScheme() + "://" : ""; - return { - host: schema + parsedUrl.getHost(), - port: Number.parseInt(parsedUrl.getPort() || "80"), - username: username, - password: password - }; + return Math.floor(d.getTime() / 1000); } -function proxyPolicy(proxySettings) { - if (!proxySettings) { - proxySettings = getDefaultProxySettings(); +function unixTimeToDate(n) { + if (!n) { + return undefined; } - return { - create: function (nextPolicy, options) { - return new ProxyPolicy(nextPolicy, options, proxySettings); + return new Date(n * 1000); +} +function serializeBasicTypes(typeName, objectName, value) { + if (value !== null && value !== undefined) { + if (typeName.match(/^Number$/i) !== null) { + if (typeof value !== "number") { + throw new Error(objectName + " with value " + value + " must be of type number."); + } + } + else if (typeName.match(/^String$/i) !== null) { + if (typeof value.valueOf() !== "string") { + throw new Error(objectName + " with value \"" + value + "\" must be of type string."); + } + } + else if (typeName.match(/^Uuid$/i) !== null) { + if (!(typeof value.valueOf() === "string" && isValidUuid(value))) { + throw new Error(objectName + " with value \"" + value + "\" must be of type string and a valid uuid."); + } + } + else if (typeName.match(/^Boolean$/i) !== null) { + if (typeof value !== "boolean") { + throw new Error(objectName + " with value " + value + " must be of type boolean."); + } + } + else if (typeName.match(/^Stream$/i) !== null) { + var objectType = typeof value; + if (objectType !== "string" && + objectType !== "function" && + !(value instanceof ArrayBuffer) && + !ArrayBuffer.isView(value) && + !((typeof Blob === "function" || typeof Blob === "object") && value instanceof Blob)) { + throw new Error(objectName + " must be a string, Blob, ArrayBuffer, ArrayBufferView, or a function returning NodeJS.ReadableStream."); + } } - }; -} -function extractAuthFromUrl(url) { - var atIndex = url.indexOf("@"); - if (atIndex === -1) { - return { urlWithoutAuth: url }; } - var schemeIndex = url.indexOf("://"); - var authStart = schemeIndex !== -1 ? schemeIndex + 3 : 0; - var auth = url.substring(authStart, atIndex); - var colonIndex = auth.indexOf(":"); - var hasPassword = colonIndex !== -1; - var username = hasPassword ? auth.substring(0, colonIndex) : auth; - var password = hasPassword ? auth.substring(colonIndex + 1) : undefined; - var urlWithoutAuth = url.substring(0, authStart) + url.substring(atIndex + 1); - return { - username: username, - password: password, - urlWithoutAuth: urlWithoutAuth - }; + return value; } -var ProxyPolicy = /** @class */ (function (_super) { - tslib.__extends(ProxyPolicy, _super); - function ProxyPolicy(nextPolicy, options, proxySettings) { - var _this = _super.call(this, nextPolicy, options) || this; - _this.proxySettings = proxySettings; - return _this; +function serializeEnumType(objectName, allowedValues, value) { + if (!allowedValues) { + throw new Error("Please provide a set of allowedValues to validate " + objectName + " as an Enum Type."); } - ProxyPolicy.prototype.sendRequest = function (request) { - if (!request.proxySettings && !isBypassed(request.url)) { - request.proxySettings = this.proxySettings; + var isPresent = allowedValues.some(function (item) { + if (typeof item.valueOf() === "string") { + return item.toLowerCase() === value.toLowerCase(); } - return this._nextPolicy.sendRequest(request); - }; - return ProxyPolicy; -}(BaseRequestPolicy)); - -// Copyright (c) Microsoft Corporation. -var StatusCodes = Constants.HttpConstants.StatusCodes; -function throttlingRetryPolicy() { - return { - create: function (nextPolicy, options) { - return new ThrottlingRetryPolicy(nextPolicy, options); + return item === value; + }); + if (!isPresent) { + throw new Error(value + " is not a valid value for " + objectName + ". The valid values are: " + JSON.stringify(allowedValues) + "."); + } + return value; +} +function serializeByteArrayType(objectName, value) { + var returnValue = ""; + if (value != undefined) { + if (!(value instanceof Uint8Array)) { + throw new Error(objectName + " must be of type Uint8Array."); } - }; + returnValue = encodeByteArray(value); + } + return returnValue; } -/** - * To learn more, please refer to - * https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-request-limits, - * https://docs.microsoft.com/en-us/azure/azure-subscription-service-limits and - * https://docs.microsoft.com/en-us/azure/virtual-machines/troubleshooting/troubleshooting-throttling-errors - */ -var ThrottlingRetryPolicy = /** @class */ (function (_super) { - tslib.__extends(ThrottlingRetryPolicy, _super); - function ThrottlingRetryPolicy(nextPolicy, options, _handleResponse) { - var _this = _super.call(this, nextPolicy, options) || this; - _this._handleResponse = _handleResponse || _this._defaultResponseHandler; - return _this; +function serializeBase64UrlType(objectName, value) { + var returnValue = ""; + if (value != undefined) { + if (!(value instanceof Uint8Array)) { + throw new Error(objectName + " must be of type Uint8Array."); + } + returnValue = bufferToBase64Url(value) || ""; } - ThrottlingRetryPolicy.prototype.sendRequest = function (httpRequest) { - return tslib.__awaiter(this, void 0, void 0, function () { - var _this = this; - return tslib.__generator(this, function (_a) { - return [2 /*return*/, this._nextPolicy.sendRequest(httpRequest.clone()).then(function (response) { - if (response.status !== StatusCodes.TooManyRequests) { - return response; - } - else { - return _this._handleResponse(httpRequest, response); - } - })]; - }); - }); - }; - ThrottlingRetryPolicy.prototype._defaultResponseHandler = function (httpRequest, httpResponse) { - return tslib.__awaiter(this, void 0, void 0, function () { - var retryAfterHeader, delayInMs; - var _this = this; - return tslib.__generator(this, function (_a) { - retryAfterHeader = httpResponse.headers.get(Constants.HeaderConstants.RETRY_AFTER); - if (retryAfterHeader) { - delayInMs = ThrottlingRetryPolicy.parseRetryAfterHeader(retryAfterHeader); - if (delayInMs) { - return [2 /*return*/, delay(delayInMs).then(function (_) { return _this._nextPolicy.sendRequest(httpRequest); })]; - } - } - return [2 /*return*/, httpResponse]; - }); - }); - }; - ThrottlingRetryPolicy.parseRetryAfterHeader = function (headerValue) { - var retryAfterInSeconds = Number(headerValue); - if (Number.isNaN(retryAfterInSeconds)) { - return ThrottlingRetryPolicy.parseDateRetryAfterHeader(headerValue); + return returnValue; +} +function serializeDateTypes(typeName, value, objectName) { + if (value != undefined) { + if (typeName.match(/^Date$/i) !== null) { + if (!(value instanceof Date || + (typeof value.valueOf() === "string" && !isNaN(Date.parse(value))))) { + throw new Error(objectName + " must be an instanceof Date or a string in ISO8601 format."); + } + value = + value instanceof Date + ? value.toISOString().substring(0, 10) + : new Date(value).toISOString().substring(0, 10); } - else { - return retryAfterInSeconds * 1000; + else if (typeName.match(/^DateTime$/i) !== null) { + if (!(value instanceof Date || + (typeof value.valueOf() === "string" && !isNaN(Date.parse(value))))) { + throw new Error(objectName + " must be an instanceof Date or a string in ISO8601 format."); + } + value = value instanceof Date ? value.toISOString() : new Date(value).toISOString(); } - }; - ThrottlingRetryPolicy.parseDateRetryAfterHeader = function (headerValue) { - try { - var now = Date.now(); - var date = Date.parse(headerValue); - var diff = date - now; - return Number.isNaN(diff) ? undefined : diff; + else if (typeName.match(/^DateTimeRfc1123$/i) !== null) { + if (!(value instanceof Date || + (typeof value.valueOf() === "string" && !isNaN(Date.parse(value))))) { + throw new Error(objectName + " must be an instanceof Date or a string in RFC-1123 format."); + } + value = value instanceof Date ? value.toUTCString() : new Date(value).toUTCString(); } - catch (error) { - return undefined; + else if (typeName.match(/^UnixTime$/i) !== null) { + if (!(value instanceof Date || + (typeof value.valueOf() === "string" && !isNaN(Date.parse(value))))) { + throw new Error(objectName + " must be an instanceof Date or a string in RFC-1123/ISO8601 format " + + "for it to be serialized in UnixTime/Epoch format."); + } + value = dateToUnixTime(value); } - }; - return ThrottlingRetryPolicy; -}(BaseRequestPolicy)); - -// Copyright (c) Microsoft Corporation. -function signingPolicy(authenticationProvider) { - return { - create: function (nextPolicy, options) { - return new SigningPolicy(nextPolicy, options, authenticationProvider); + else if (typeName.match(/^TimeSpan$/i) !== null) { + if (!isDuration(value)) { + throw new Error(objectName + " must be a string in ISO 8601 format. Instead was \"" + value + "\"."); + } } - }; -} -var SigningPolicy = /** @class */ (function (_super) { - tslib.__extends(SigningPolicy, _super); - function SigningPolicy(nextPolicy, options, authenticationProvider) { - var _this = _super.call(this, nextPolicy, options) || this; - _this.authenticationProvider = authenticationProvider; - return _this; } - SigningPolicy.prototype.signRequest = function (request) { - return this.authenticationProvider.signRequest(request); - }; - SigningPolicy.prototype.sendRequest = function (request) { - var _this = this; - return this.signRequest(request).then(function (nextRequest) { - return _this._nextPolicy.sendRequest(nextRequest); - }); - }; - return SigningPolicy; -}(BaseRequestPolicy)); - -// Copyright (c) Microsoft Corporation. -var DefaultKeepAliveOptions = { - enable: true -}; -function keepAlivePolicy(keepAliveOptions) { - return { - create: function (nextPolicy, options) { - return new KeepAlivePolicy(nextPolicy, options, keepAliveOptions || DefaultKeepAliveOptions); - } - }; + return value; } -/** - * KeepAlivePolicy is a policy used to control keep alive settings for every request. - */ -var KeepAlivePolicy = /** @class */ (function (_super) { - tslib.__extends(KeepAlivePolicy, _super); - /** - * Creates an instance of KeepAlivePolicy. - * - * @param nextPolicy - - * @param options - - * @param keepAliveOptions - - */ - function KeepAlivePolicy(nextPolicy, options, keepAliveOptions) { - var _this = _super.call(this, nextPolicy, options) || this; - _this.keepAliveOptions = keepAliveOptions; - return _this; +function serializeSequenceType(serializer, mapper, object, objectName, isXml, options) { + var _a, _b; + if (!Array.isArray(object)) { + throw new Error(objectName + " must be of type Array."); } - /** - * Sends out request. - * - * @param request - - * @returns - */ - KeepAlivePolicy.prototype.sendRequest = function (request) { - return tslib.__awaiter(this, void 0, void 0, function () { - return tslib.__generator(this, function (_a) { - request.keepAlive = this.keepAliveOptions.enable; - return [2 /*return*/, this._nextPolicy.sendRequest(request)]; - }); - }); - }; - return KeepAlivePolicy; -}(BaseRequestPolicy)); - -// Copyright (c) Microsoft Corporation. -var createSpan = coreTracing.createSpanFunction({ - packagePrefix: "", - namespace: "" -}); -function tracingPolicy(tracingOptions) { - if (tracingOptions === void 0) { tracingOptions = {}; } - return { - create: function (nextPolicy, options) { - return new TracingPolicy(nextPolicy, options, tracingOptions); + var elementType = mapper.type.element; + if (!elementType || typeof elementType !== "object") { + throw new Error("element\" metadata for an Array must be defined in the " + + ("mapper and it must of type \"object\" in " + objectName + ".")); + } + var tempArray = []; + for (var i = 0; i < object.length; i++) { + var serializedValue = serializer.serialize(elementType, object[i], objectName, options); + if (isXml && elementType.xmlNamespace) { + var xmlnsKey = elementType.xmlNamespacePrefix + ? "xmlns:" + elementType.xmlNamespacePrefix + : "xmlns"; + if (elementType.type.name === "Composite") { + tempArray[i] = tslib.__assign({}, serializedValue); + tempArray[i][XML_ATTRKEY] = (_a = {}, _a[xmlnsKey] = elementType.xmlNamespace, _a); + } + else { + tempArray[i] = {}; + tempArray[i][options.xmlCharKey] = serializedValue; + tempArray[i][XML_ATTRKEY] = (_b = {}, _b[xmlnsKey] = elementType.xmlNamespace, _b); + } } - }; + else { + tempArray[i] = serializedValue; + } + } + return tempArray; } -var TracingPolicy = /** @class */ (function (_super) { - tslib.__extends(TracingPolicy, _super); - function TracingPolicy(nextPolicy, options, tracingOptions) { - var _this = _super.call(this, nextPolicy, options) || this; - _this.userAgent = tracingOptions.userAgent; - return _this; +function serializeDictionaryType(serializer, mapper, object, objectName, isXml, options) { + var _a; + if (typeof object !== "object") { + throw new Error(objectName + " must be of type object."); } - TracingPolicy.prototype.sendRequest = function (request) { - return tslib.__awaiter(this, void 0, void 0, function () { - var path, span, spanContext, traceParentHeader, traceState, response, serviceRequestId, err_1; - return tslib.__generator(this, function (_a) { - switch (_a.label) { - case 0: - if (!request.tracingContext) { - return [2 /*return*/, this._nextPolicy.sendRequest(request)]; - } - path = URLBuilder.parse(request.url).getPath() || "/"; - span = createSpan(path, { - tracingOptions: { - spanOptions: tslib.__assign(tslib.__assign({}, request.spanOptions), { kind: coreTracing.SpanKind.CLIENT }), - tracingContext: request.tracingContext - } - }).span; - span.setAttributes({ - "http.method": request.method, - "http.url": request.url, - requestId: request.requestId - }); - if (this.userAgent) { - span.setAttribute("http.user_agent", this.userAgent); - } - _a.label = 1; - case 1: - _a.trys.push([1, 3, , 4]); - spanContext = span.context(); - traceParentHeader = coreTracing.getTraceParentHeader(spanContext); - if (traceParentHeader) { - request.headers.set("traceparent", traceParentHeader); - traceState = spanContext.traceState && spanContext.traceState.serialize(); - // if tracestate is set, traceparent MUST be set, so only set tracestate after traceparent - if (traceState) { - request.headers.set("tracestate", traceState); - } - } - return [4 /*yield*/, this._nextPolicy.sendRequest(request)]; - case 2: - response = _a.sent(); - span.setAttribute("http.status_code", response.status); - serviceRequestId = response.headers.get("x-ms-request-id"); - if (serviceRequestId) { - span.setAttribute("serviceRequestId", serviceRequestId); - } - span.end(); - return [2 /*return*/, response]; - case 3: - err_1 = _a.sent(); - span.end(); - throw err_1; - case 4: return [2 /*return*/]; - } - }); - }); - }; - return TracingPolicy; -}(BaseRequestPolicy)); - -// Copyright (c) Microsoft Corporation. -/** - * Returns a request policy factory that can be used to create an instance of - * {@link DisableResponseDecompressionPolicy}. - */ -function disableResponseDecompressionPolicy() { - return { - create: function (nextPolicy, options) { - return new DisableResponseDecompressionPolicy(nextPolicy, options); - } - }; + var valueType = mapper.type.value; + if (!valueType || typeof valueType !== "object") { + throw new Error("\"value\" metadata for a Dictionary must be defined in the " + + ("mapper and it must of type \"object\" in " + objectName + ".")); + } + var tempDictionary = {}; + for (var _i = 0, _b = Object.keys(object); _i < _b.length; _i++) { + var key = _b[_i]; + var serializedValue = serializer.serialize(valueType, object[key], objectName, options); + // If the element needs an XML namespace we need to add it within the $ property + tempDictionary[key] = getXmlObjectValue(valueType, serializedValue, isXml, options); + } + // Add the namespace to the root element if needed + if (isXml && mapper.xmlNamespace) { + var xmlnsKey = mapper.xmlNamespacePrefix ? "xmlns:" + mapper.xmlNamespacePrefix : "xmlns"; + var result = tempDictionary; + result[XML_ATTRKEY] = (_a = {}, _a[xmlnsKey] = mapper.xmlNamespace, _a); + return result; + } + return tempDictionary; } /** - * A policy to disable response decompression according to Accept-Encoding header - * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Encoding + * Resolves the additionalProperties property from a referenced mapper + * @param serializer - The serializer containing the entire set of mappers + * @param mapper - The composite mapper to resolve + * @param objectName - Name of the object being serialized */ -var DisableResponseDecompressionPolicy = /** @class */ (function (_super) { - tslib.__extends(DisableResponseDecompressionPolicy, _super); - /** - * Creates an instance of DisableResponseDecompressionPolicy. - * - * @param nextPolicy - - * @param options - - */ - // The parent constructor is protected. - /* eslint-disable-next-line @typescript-eslint/no-useless-constructor */ - function DisableResponseDecompressionPolicy(nextPolicy, options) { - return _super.call(this, nextPolicy, options) || this; +function resolveAdditionalProperties(serializer, mapper, objectName) { + var additionalProperties = mapper.type.additionalProperties; + if (!additionalProperties && mapper.type.className) { + var modelMapper = resolveReferencedMapper(serializer, mapper, objectName); + return modelMapper === null || modelMapper === void 0 ? void 0 : modelMapper.type.additionalProperties; } - /** - * Sends out request. - * - * @param request - - * @returns - */ - DisableResponseDecompressionPolicy.prototype.sendRequest = function (request) { - return tslib.__awaiter(this, void 0, void 0, function () { - return tslib.__generator(this, function (_a) { - request.decompressResponse = false; - return [2 /*return*/, this._nextPolicy.sendRequest(request)]; - }); - }); - }; - return DisableResponseDecompressionPolicy; -}(BaseRequestPolicy)); - -// Copyright (c) Microsoft Corporation. -function ndJsonPolicy() { - return { - create: function (nextPolicy, options) { - return new NdJsonPolicy(nextPolicy, options); - } - }; + return additionalProperties; } /** - * NdJsonPolicy that formats a JSON array as newline-delimited JSON + * Finds the mapper referenced by className + * @param serializer - The serializer containing the entire set of mappers + * @param mapper - The composite mapper to resolve + * @param objectName - Name of the object being serialized */ -var NdJsonPolicy = /** @class */ (function (_super) { - tslib.__extends(NdJsonPolicy, _super); - /** - * Creates an instance of KeepAlivePolicy. - */ - function NdJsonPolicy(nextPolicy, options) { - return _super.call(this, nextPolicy, options) || this; - } - /** - * Sends a request. - */ - NdJsonPolicy.prototype.sendRequest = function (request) { - return tslib.__awaiter(this, void 0, void 0, function () { - var body; - return tslib.__generator(this, function (_a) { - // There currently isn't a good way to bypass the serializer - if (typeof request.body === "string" && request.body.startsWith("[")) { - body = JSON.parse(request.body); - if (Array.isArray(body)) { - request.body = body.map(function (item) { return JSON.stringify(item) + "\n"; }).join(""); - } - } - return [2 /*return*/, this._nextPolicy.sendRequest(request)]; - }); - }); - }; - return NdJsonPolicy; -}(BaseRequestPolicy)); - -// Copyright (c) Microsoft Corporation. -var cachedHttpClient; -function getCachedDefaultHttpClient() { - if (!cachedHttpClient) { - cachedHttpClient = new NodeFetchHttpClient(); +function resolveReferencedMapper(serializer, mapper, objectName) { + var className = mapper.type.className; + if (!className) { + throw new Error("Class name for model \"" + objectName + "\" is not provided in the mapper \"" + JSON.stringify(mapper, undefined, 2) + "\"."); } - return cachedHttpClient; + return serializer.modelMappers[className]; } - -// Copyright (c) Microsoft Corporation. /** - * ServiceClient sends service requests and receives responses. + * Resolves a composite mapper's modelProperties. + * @param serializer - The serializer containing the entire set of mappers + * @param mapper - The composite mapper to resolve */ -var ServiceClient = /** @class */ (function () { - /** - * The ServiceClient constructor - * @param credentials - The credentials used for authentication with the service. - * @param options - The service client options that govern the behavior of the client. - */ - function ServiceClient(credentials, - /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */ - options) { - var _this = this; - if (!options) { - options = {}; - } - this._withCredentials = options.withCredentials || false; - this._httpClient = options.httpClient || getCachedDefaultHttpClient(); - this._requestPolicyOptions = new RequestPolicyOptions(options.httpPipelineLogger); - var requestPolicyFactories; - if (Array.isArray(options.requestPolicyFactories)) { - logger.info("ServiceClient: using custom request policies"); - requestPolicyFactories = options.requestPolicyFactories; +function resolveModelProperties(serializer, mapper, objectName) { + var modelProps = mapper.type.modelProperties; + if (!modelProps) { + var modelMapper = resolveReferencedMapper(serializer, mapper, objectName); + if (!modelMapper) { + throw new Error("mapper() cannot be null or undefined for model \"" + mapper.type.className + "\"."); } - else { - var authPolicyFactory = undefined; - if (coreAuth.isTokenCredential(credentials)) { - logger.info("ServiceClient: creating bearer token authentication policy from provided credentials"); - // Create a wrapped RequestPolicyFactory here so that we can provide the - // correct scope to the BearerTokenAuthenticationPolicy at the first time - // one is requested. This is needed because generated ServiceClient - // implementations do not set baseUri until after ServiceClient's constructor - // is finished, leaving baseUri empty at the time when it is needed to - // build the correct scope name. - var wrappedPolicyFactory = function () { - var bearerTokenPolicyFactory = undefined; - // eslint-disable-next-line @typescript-eslint/no-this-alias - var serviceClient = _this; - var serviceClientOptions = options; - return { - create: function (nextPolicy, createOptions) { - var credentialScopes = getCredentialScopes(serviceClientOptions, serviceClient.baseUri); - if (!credentialScopes) { - throw new Error("When using credential, the ServiceClient must contain a baseUri or a credentialScopes in ServiceClientOptions. Unable to create a bearerTokenAuthenticationPolicy"); - } - if (bearerTokenPolicyFactory === undefined || bearerTokenPolicyFactory === null) { - bearerTokenPolicyFactory = bearerTokenAuthenticationPolicy(credentials, credentialScopes); - } - return bearerTokenPolicyFactory.create(nextPolicy, createOptions); - } - }; - }; - authPolicyFactory = wrappedPolicyFactory(); + modelProps = modelMapper === null || modelMapper === void 0 ? void 0 : modelMapper.type.modelProperties; + if (!modelProps) { + throw new Error("modelProperties cannot be null or undefined in the " + + ("mapper \"" + JSON.stringify(modelMapper) + "\" of type \"" + mapper.type.className + "\" for object \"" + objectName + "\".")); + } + } + return modelProps; +} +function serializeCompositeType(serializer, mapper, object, objectName, isXml, options) { + var _a, _b; + if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) { + mapper = getPolymorphicMapper(serializer, mapper, object, "clientName"); + } + if (object != undefined) { + var payload = {}; + var modelProps = resolveModelProperties(serializer, mapper, objectName); + for (var _i = 0, _c = Object.keys(modelProps); _i < _c.length; _i++) { + var key = _c[_i]; + var propertyMapper = modelProps[key]; + if (propertyMapper.readOnly) { + continue; } - else if (credentials && typeof credentials.signRequest === "function") { - logger.info("ServiceClient: creating signing policy from provided credentials"); - authPolicyFactory = signingPolicy(credentials); + var propName = void 0; + var parentObject = payload; + if (serializer.isXML) { + if (propertyMapper.xmlIsWrapped) { + propName = propertyMapper.xmlName; + } + else { + propName = propertyMapper.xmlElementName || propertyMapper.xmlName; + } } - else if (credentials !== undefined && credentials !== null) { - throw new Error("The credentials argument must implement the TokenCredential interface"); + else { + var paths = splitSerializeName(propertyMapper.serializedName); + propName = paths.pop(); + for (var _d = 0, paths_1 = paths; _d < paths_1.length; _d++) { + var pathName = paths_1[_d]; + var childObject = parentObject[pathName]; + if (childObject == undefined && + (object[key] != undefined || propertyMapper.defaultValue !== undefined)) { + parentObject[pathName] = {}; + } + parentObject = parentObject[pathName]; + } } - logger.info("ServiceClient: using default request policies"); - requestPolicyFactories = createDefaultRequestPolicyFactories(authPolicyFactory, options); - if (options.requestPolicyFactories) { - // options.requestPolicyFactories can also be a function that manipulates - // the default requestPolicyFactories array - var newRequestPolicyFactories = options.requestPolicyFactories(requestPolicyFactories); - if (newRequestPolicyFactories) { - requestPolicyFactories = newRequestPolicyFactories; + if (parentObject != undefined) { + if (isXml && mapper.xmlNamespace) { + var xmlnsKey = mapper.xmlNamespacePrefix + ? "xmlns:" + mapper.xmlNamespacePrefix + : "xmlns"; + parentObject[XML_ATTRKEY] = tslib.__assign(tslib.__assign({}, parentObject[XML_ATTRKEY]), (_a = {}, _a[xmlnsKey] = mapper.xmlNamespace, _a)); + } + var propertyObjectName = propertyMapper.serializedName !== "" + ? objectName + "." + propertyMapper.serializedName + : objectName; + var toSerialize = object[key]; + var polymorphicDiscriminator = getPolymorphicDiscriminatorRecursively(serializer, mapper); + if (polymorphicDiscriminator && + polymorphicDiscriminator.clientName === key && + toSerialize == undefined) { + toSerialize = mapper.serializedName; + } + var serializedValue = serializer.serialize(propertyMapper, toSerialize, propertyObjectName, options); + if (serializedValue !== undefined && propName != undefined) { + var value = getXmlObjectValue(propertyMapper, serializedValue, isXml, options); + if (isXml && propertyMapper.xmlIsAttribute) { + // XML_ATTRKEY, i.e., $ is the key attributes are kept under in xml2js. + // This keeps things simple while preventing name collision + // with names in user documents. + parentObject[XML_ATTRKEY] = parentObject[XML_ATTRKEY] || {}; + parentObject[XML_ATTRKEY][propName] = serializedValue; + } + else if (isXml && propertyMapper.xmlIsWrapped) { + parentObject[propName] = (_b = {}, _b[propertyMapper.xmlElementName] = value, _b); + } + else { + parentObject[propName] = value; + } } } } - this._requestPolicyFactories = requestPolicyFactories; + var additionalPropertiesMapper = resolveAdditionalProperties(serializer, mapper, objectName); + if (additionalPropertiesMapper) { + var propNames = Object.keys(modelProps); + var _loop_1 = function (clientPropName) { + var isAdditionalProperty = propNames.every(function (pn) { return pn !== clientPropName; }); + if (isAdditionalProperty) { + payload[clientPropName] = serializer.serialize(additionalPropertiesMapper, object[clientPropName], objectName + '["' + clientPropName + '"]', options); + } + }; + for (var clientPropName in object) { + _loop_1(clientPropName); + } + } + return payload; } - /** - * Send the provided httpRequest. - */ - ServiceClient.prototype.sendRequest = function (options) { - if (options === null || options === undefined || typeof options !== "object") { - throw new Error("options cannot be null or undefined and it must be of type object."); + return object; +} +function getXmlObjectValue(propertyMapper, serializedValue, isXml, options) { + var _a; + if (!isXml || !propertyMapper.xmlNamespace) { + return serializedValue; + } + var xmlnsKey = propertyMapper.xmlNamespacePrefix + ? "xmlns:" + propertyMapper.xmlNamespacePrefix + : "xmlns"; + var xmlNamespace = (_a = {}, _a[xmlnsKey] = propertyMapper.xmlNamespace, _a); + if (["Composite"].includes(propertyMapper.type.name)) { + if (serializedValue[XML_ATTRKEY]) { + return serializedValue; } - var httpRequest; - try { - if (isWebResourceLike(options)) { - options.validateRequestProperties(); - httpRequest = options; - } - else { - httpRequest = new WebResource(); - httpRequest = httpRequest.prepare(options); - } + else { + var result_1 = tslib.__assign({}, serializedValue); + result_1[XML_ATTRKEY] = xmlNamespace; + return result_1; } - catch (error) { - return Promise.reject(error); + } + var result = {}; + result[options.xmlCharKey] = serializedValue; + result[XML_ATTRKEY] = xmlNamespace; + return result; +} +function isSpecialXmlProperty(propertyName, options) { + return [XML_ATTRKEY, options.xmlCharKey].includes(propertyName); +} +function deserializeCompositeType(serializer, mapper, responseBody, objectName, options) { + var _a; + if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) { + mapper = getPolymorphicMapper(serializer, mapper, responseBody, "serializedName"); + } + var modelProps = resolveModelProperties(serializer, mapper, objectName); + var instance = {}; + var handledPropertyNames = []; + for (var _i = 0, _b = Object.keys(modelProps); _i < _b.length; _i++) { + var key = _b[_i]; + var propertyMapper = modelProps[key]; + var paths = splitSerializeName(modelProps[key].serializedName); + handledPropertyNames.push(paths[0]); + var serializedName = propertyMapper.serializedName, xmlName = propertyMapper.xmlName, xmlElementName = propertyMapper.xmlElementName; + var propertyObjectName = objectName; + if (serializedName !== "" && serializedName !== undefined) { + propertyObjectName = objectName + "." + serializedName; } - var httpPipeline = this._httpClient; - if (this._requestPolicyFactories && this._requestPolicyFactories.length > 0) { - for (var i = this._requestPolicyFactories.length - 1; i >= 0; --i) { - httpPipeline = this._requestPolicyFactories[i].create(httpPipeline, this._requestPolicyOptions); + var headerCollectionPrefix = propertyMapper.headerCollectionPrefix; + if (headerCollectionPrefix) { + var dictionary = {}; + for (var _c = 0, _d = Object.keys(responseBody); _c < _d.length; _c++) { + var headerKey = _d[_c]; + if (headerKey.startsWith(headerCollectionPrefix)) { + dictionary[headerKey.substring(headerCollectionPrefix.length)] = serializer.deserialize(propertyMapper.type.value, responseBody[headerKey], propertyObjectName, options); + } + handledPropertyNames.push(headerKey); } + instance[key] = dictionary; } - return httpPipeline.sendRequest(httpRequest); - }; - /** - * Send an HTTP request that is populated using the provided OperationSpec. - * @param operationArguments - The arguments that the HTTP request's templated values will be populated from. - * @param operationSpec - The OperationSpec to use to populate the httpRequest. - * @param callback - The callback to call when the response is received. - */ - ServiceClient.prototype.sendOperationRequest = function (operationArguments, operationSpec, callback) { - var _a; - return tslib.__awaiter(this, void 0, void 0, function () { - var serializerOptions, httpRequest, result, baseUri, requestUrl, _i, _b, urlParameter, urlParameterValue, _c, _d, queryParameter, queryParameterValue, index, item, index, contentType, _e, _f, headerParameter, headerValue, headerCollectionPrefix, _g, _h, key, options, customHeaderName, rawResponse, sendRequestError, error_1, error_2, cb; - return tslib.__generator(this, function (_j) { - switch (_j.label) { - case 0: - if (typeof operationArguments.options === "function") { - callback = operationArguments.options; - operationArguments.options = undefined; - } - serializerOptions = (_a = operationArguments.options) === null || _a === void 0 ? void 0 : _a.serializerOptions; - httpRequest = new WebResource(); - _j.label = 1; - case 1: - _j.trys.push([1, 6, , 7]); - baseUri = operationSpec.baseUrl || this.baseUri; - if (!baseUri) { - throw new Error("If operationSpec.baseUrl is not specified, then the ServiceClient must have a baseUri string property that contains the base URL to use."); - } - httpRequest.method = operationSpec.httpMethod; - httpRequest.operationSpec = operationSpec; - requestUrl = URLBuilder.parse(baseUri); - if (operationSpec.path) { - requestUrl.appendPath(operationSpec.path); - } - if (operationSpec.urlParameters && operationSpec.urlParameters.length > 0) { - for (_i = 0, _b = operationSpec.urlParameters; _i < _b.length; _i++) { - urlParameter = _b[_i]; - urlParameterValue = getOperationArgumentValueFromParameter(this, operationArguments, urlParameter, operationSpec.serializer); - urlParameterValue = operationSpec.serializer.serialize(urlParameter.mapper, urlParameterValue, getPathStringFromParameter(urlParameter), serializerOptions); - if (!urlParameter.skipEncoding) { - urlParameterValue = encodeURIComponent(urlParameterValue); - } - requestUrl.replaceAll("{" + (urlParameter.mapper.serializedName || getPathStringFromParameter(urlParameter)) + "}", urlParameterValue); - } - } - if (operationSpec.queryParameters && operationSpec.queryParameters.length > 0) { - for (_c = 0, _d = operationSpec.queryParameters; _c < _d.length; _c++) { - queryParameter = _d[_c]; - queryParameterValue = getOperationArgumentValueFromParameter(this, operationArguments, queryParameter, operationSpec.serializer); - if (queryParameterValue !== undefined && queryParameterValue !== null) { - queryParameterValue = operationSpec.serializer.serialize(queryParameter.mapper, queryParameterValue, getPathStringFromParameter(queryParameter), serializerOptions); - if (queryParameter.collectionFormat !== undefined && - queryParameter.collectionFormat !== null) { - if (queryParameter.collectionFormat === exports.QueryCollectionFormat.Multi) { - if (queryParameterValue.length === 0) { - // The collection is empty, no need to try serializing the current queryParam - continue; - } - else { - for (index in queryParameterValue) { - item = queryParameterValue[index]; - queryParameterValue[index] = - item === undefined || item === null ? "" : item.toString(); - } - } - } - else if (queryParameter.collectionFormat === exports.QueryCollectionFormat.Ssv || - queryParameter.collectionFormat === exports.QueryCollectionFormat.Tsv) { - queryParameterValue = queryParameterValue.join(queryParameter.collectionFormat); - } - } - if (!queryParameter.skipEncoding) { - if (Array.isArray(queryParameterValue)) { - for (index in queryParameterValue) { - if (queryParameterValue[index] !== undefined && - queryParameterValue[index] !== null) { - queryParameterValue[index] = encodeURIComponent(queryParameterValue[index]); - } - } - } - else { - queryParameterValue = encodeURIComponent(queryParameterValue); - } - } - if (queryParameter.collectionFormat !== undefined && - queryParameter.collectionFormat !== null && - queryParameter.collectionFormat !== exports.QueryCollectionFormat.Multi && - queryParameter.collectionFormat !== exports.QueryCollectionFormat.Ssv && - queryParameter.collectionFormat !== exports.QueryCollectionFormat.Tsv) { - queryParameterValue = queryParameterValue.join(queryParameter.collectionFormat); - } - requestUrl.setQueryParameter(queryParameter.mapper.serializedName || getPathStringFromParameter(queryParameter), queryParameterValue); - } - } - } - httpRequest.url = requestUrl.toString(); - contentType = operationSpec.contentType || this.requestContentType; - if (contentType && operationSpec.requestBody) { - httpRequest.headers.set("Content-Type", contentType); - } - if (operationSpec.headerParameters) { - for (_e = 0, _f = operationSpec.headerParameters; _e < _f.length; _e++) { - headerParameter = _f[_e]; - headerValue = getOperationArgumentValueFromParameter(this, operationArguments, headerParameter, operationSpec.serializer); - if (headerValue !== undefined && headerValue !== null) { - headerValue = operationSpec.serializer.serialize(headerParameter.mapper, headerValue, getPathStringFromParameter(headerParameter), serializerOptions); - headerCollectionPrefix = headerParameter.mapper - .headerCollectionPrefix; - if (headerCollectionPrefix) { - for (_g = 0, _h = Object.keys(headerValue); _g < _h.length; _g++) { - key = _h[_g]; - httpRequest.headers.set(headerCollectionPrefix + key, headerValue[key]); - } - } - else { - httpRequest.headers.set(headerParameter.mapper.serializedName || - getPathStringFromParameter(headerParameter), headerValue); - } - } - } - } - options = operationArguments.options; - if (options) { - if (options.customHeaders) { - for (customHeaderName in options.customHeaders) { - httpRequest.headers.set(customHeaderName, options.customHeaders[customHeaderName]); - } - } - if (options.abortSignal) { - httpRequest.abortSignal = options.abortSignal; - } - if (options.timeout) { - httpRequest.timeout = options.timeout; - } - if (options.onUploadProgress) { - httpRequest.onUploadProgress = options.onUploadProgress; - } - if (options.onDownloadProgress) { - httpRequest.onDownloadProgress = options.onDownloadProgress; - } - if (options.spanOptions) { - httpRequest.spanOptions = options.spanOptions; - } - if (options.tracingContext) { - httpRequest.tracingContext = options.tracingContext; - } - if (options.shouldDeserialize !== undefined && options.shouldDeserialize !== null) { - httpRequest.shouldDeserialize = options.shouldDeserialize; - } - } - httpRequest.withCredentials = this._withCredentials; - serializeRequestBody(this, httpRequest, operationArguments, operationSpec); - if (httpRequest.streamResponseStatusCodes === undefined) { - httpRequest.streamResponseStatusCodes = getStreamResponseStatusCodes(operationSpec); - } - rawResponse = void 0; - sendRequestError = void 0; - _j.label = 2; - case 2: - _j.trys.push([2, 4, , 5]); - return [4 /*yield*/, this.sendRequest(httpRequest)]; - case 3: - rawResponse = _j.sent(); - return [3 /*break*/, 5]; - case 4: - error_1 = _j.sent(); - sendRequestError = error_1; - return [3 /*break*/, 5]; - case 5: - if (sendRequestError) { - if (sendRequestError.response) { - sendRequestError.details = flattenResponse(sendRequestError.response, operationSpec.responses[sendRequestError.statusCode] || - operationSpec.responses["default"]); - } - result = Promise.reject(sendRequestError); - } - else { - result = Promise.resolve(flattenResponse(rawResponse, operationSpec.responses[rawResponse.status])); - } - return [3 /*break*/, 7]; - case 6: - error_2 = _j.sent(); - result = Promise.reject(error_2); - return [3 /*break*/, 7]; - case 7: - cb = callback; - if (cb) { - result - .then(function (res) { return cb(null, res._response.parsedBody, res._response.request, res._response); }) - .catch(function (err) { return cb(err); }); + else if (serializer.isXML) { + if (propertyMapper.xmlIsAttribute && responseBody[XML_ATTRKEY]) { + instance[key] = serializer.deserialize(propertyMapper, responseBody[XML_ATTRKEY][xmlName], propertyObjectName, options); + } + else { + var propertyName = xmlElementName || xmlName || serializedName; + if (propertyMapper.xmlIsWrapped) { + /* a list of wrapped by + For the xml example below + + ... + ... + + the responseBody has + { + Cors: { + CorsRule: [{...}, {...}] + } } - return [2 /*return*/, result]; + xmlName is "Cors" and xmlElementName is"CorsRule". + */ + var wrapped = responseBody[xmlName]; + var elementList = (_a = wrapped === null || wrapped === void 0 ? void 0 : wrapped[xmlElementName]) !== null && _a !== void 0 ? _a : []; + instance[key] = serializer.deserialize(propertyMapper, elementList, propertyObjectName, options); } - }); - }); - }; - return ServiceClient; -}()); -function serializeRequestBody(serviceClient, httpRequest, operationArguments, operationSpec) { - var _a, _b, _c, _d, _e, _f; - var serializerOptions = (_b = (_a = operationArguments.options) === null || _a === void 0 ? void 0 : _a.serializerOptions) !== null && _b !== void 0 ? _b : {}; - var updatedOptions = { - rootName: (_c = serializerOptions.rootName) !== null && _c !== void 0 ? _c : "", - includeRoot: (_d = serializerOptions.includeRoot) !== null && _d !== void 0 ? _d : false, - xmlCharKey: (_e = serializerOptions.xmlCharKey) !== null && _e !== void 0 ? _e : XML_CHARKEY - }; - var xmlCharKey = serializerOptions.xmlCharKey; - if (operationSpec.requestBody && operationSpec.requestBody.mapper) { - httpRequest.body = getOperationArgumentValueFromParameter(serviceClient, operationArguments, operationSpec.requestBody, operationSpec.serializer); - var bodyMapper = operationSpec.requestBody.mapper; - var required = bodyMapper.required, xmlName = bodyMapper.xmlName, xmlElementName = bodyMapper.xmlElementName, serializedName = bodyMapper.serializedName, xmlNamespace = bodyMapper.xmlNamespace, xmlNamespacePrefix = bodyMapper.xmlNamespacePrefix; - var typeName = bodyMapper.type.name; - try { - if ((httpRequest.body !== undefined && httpRequest.body !== null) || required) { - var requestBodyParameterPathString = getPathStringFromParameter(operationSpec.requestBody); - httpRequest.body = operationSpec.serializer.serialize(bodyMapper, httpRequest.body, requestBodyParameterPathString, updatedOptions); - var isStream = typeName === MapperType.Stream; - if (operationSpec.isXML) { - var xmlnsKey = xmlNamespacePrefix ? "xmlns:" + xmlNamespacePrefix : "xmlns"; - var value = getXmlValueWithNamespace(xmlNamespace, xmlnsKey, typeName, httpRequest.body, updatedOptions); - if (typeName === MapperType.Sequence) { - httpRequest.body = stringifyXML(prepareXMLRootList(value, xmlElementName || xmlName || serializedName, xmlnsKey, xmlNamespace), { - rootName: xmlName || serializedName, - xmlCharKey: xmlCharKey - }); - } - else if (!isStream) { - httpRequest.body = stringifyXML(value, { - rootName: xmlName || serializedName, - xmlCharKey: xmlCharKey - }); - } + else { + var property = responseBody[propertyName]; + instance[key] = serializer.deserialize(propertyMapper, property, propertyObjectName, options); } - else if (typeName === MapperType.String && - (((_f = operationSpec.contentType) === null || _f === void 0 ? void 0 : _f.match("text/plain")) || operationSpec.mediaType === "text")) { - // the String serializer has validated that request body is a string - // so just send the string. - return; + } + } + else { + // deserialize the property if it is present in the provided responseBody instance + var propertyInstance = void 0; + var res = responseBody; + // traversing the object step by step. + for (var _e = 0, paths_2 = paths; _e < paths_2.length; _e++) { + var item = paths_2[_e]; + if (!res) + break; + res = res[item]; + } + propertyInstance = res; + var polymorphicDiscriminator = mapper.type.polymorphicDiscriminator; + // checking that the model property name (key)(ex: "fishtype") and the + // clientName of the polymorphicDiscriminator {metadata} (ex: "fishtype") + // instead of the serializedName of the polymorphicDiscriminator (ex: "fish.type") + // is a better approach. The generator is not consistent with escaping '\.' in the + // serializedName of the property (ex: "fish\.type") that is marked as polymorphic discriminator + // and the serializedName of the metadata polymorphicDiscriminator (ex: "fish.type"). However, + // the clientName transformation of the polymorphicDiscriminator (ex: "fishtype") and + // the transformation of model property name (ex: "fishtype") is done consistently. + // Hence, it is a safer bet to rely on the clientName of the polymorphicDiscriminator. + if (polymorphicDiscriminator && + key === polymorphicDiscriminator.clientName && + propertyInstance == undefined) { + propertyInstance = mapper.serializedName; + } + var serializedValue = void 0; + // paging + if (Array.isArray(responseBody[key]) && modelProps[key].serializedName === "") { + propertyInstance = responseBody[key]; + var arrayInstance = serializer.deserialize(propertyMapper, propertyInstance, propertyObjectName, options); + // Copy over any properties that have already been added into the instance, where they do + // not exist on the newly de-serialized array + for (var _f = 0, _g = Object.entries(instance); _f < _g.length; _f++) { + var _h = _g[_f], k = _h[0], v = _h[1]; + if (!Object.prototype.hasOwnProperty.call(arrayInstance, k)) { + arrayInstance[k] = v; + } } - else if (!isStream) { - httpRequest.body = JSON.stringify(httpRequest.body); + instance = arrayInstance; + } + else if (propertyInstance !== undefined || propertyMapper.defaultValue !== undefined) { + serializedValue = serializer.deserialize(propertyMapper, propertyInstance, propertyObjectName, options); + instance[key] = serializedValue; + } + } + } + var additionalPropertiesMapper = mapper.type.additionalProperties; + if (additionalPropertiesMapper) { + var isAdditionalProperty = function (responsePropName) { + for (var clientPropName in modelProps) { + var paths = splitSerializeName(modelProps[clientPropName].serializedName); + if (paths[0] === responsePropName) { + return false; } } - } - catch (error) { - throw new Error("Error \"" + error.message + "\" occurred in serializing the payload - " + JSON.stringify(serializedName, undefined, " ") + "."); + return true; + }; + for (var responsePropName in responseBody) { + if (isAdditionalProperty(responsePropName)) { + instance[responsePropName] = serializer.deserialize(additionalPropertiesMapper, responseBody[responsePropName], objectName + '["' + responsePropName + '"]', options); + } } } - else if (operationSpec.formDataParameters && operationSpec.formDataParameters.length > 0) { - httpRequest.formData = {}; - for (var _i = 0, _g = operationSpec.formDataParameters; _i < _g.length; _i++) { - var formDataParameter = _g[_i]; - var formDataParameterValue = getOperationArgumentValueFromParameter(serviceClient, operationArguments, formDataParameter, operationSpec.serializer); - if (formDataParameterValue !== undefined && formDataParameterValue !== null) { - var formDataParameterPropertyName = formDataParameter.mapper.serializedName || getPathStringFromParameter(formDataParameter); - httpRequest.formData[formDataParameterPropertyName] = operationSpec.serializer.serialize(formDataParameter.mapper, formDataParameterValue, getPathStringFromParameter(formDataParameter), updatedOptions); + else if (responseBody) { + for (var _j = 0, _k = Object.keys(responseBody); _j < _k.length; _j++) { + var key = _k[_j]; + if (instance[key] === undefined && + !handledPropertyNames.includes(key) && + !isSpecialXmlProperty(key, options)) { + instance[key] = responseBody[key]; } } } + return instance; } -/** - * Adds an xml namespace to the xml serialized object if needed, otherwise it just returns the value itself - */ -function getXmlValueWithNamespace(xmlNamespace, xmlnsKey, typeName, serializedValue, options) { - var _a; - // Composite and Sequence schemas already got their root namespace set during serialization - // We just need to add xmlns to the other schema types - if (xmlNamespace && !["Composite", "Sequence", "Dictionary"].includes(typeName)) { - var result = {}; - result[options.xmlCharKey] = serializedValue; - result[XML_ATTRKEY] = (_a = {}, _a[xmlnsKey] = xmlNamespace, _a); - return result; +function deserializeDictionaryType(serializer, mapper, responseBody, objectName, options) { + var value = mapper.type.value; + if (!value || typeof value !== "object") { + throw new Error("\"value\" metadata for a Dictionary must be defined in the " + + ("mapper and it must of type \"object\" in " + objectName)); } - return serializedValue; + if (responseBody) { + var tempDictionary = {}; + for (var _i = 0, _a = Object.keys(responseBody); _i < _a.length; _i++) { + var key = _a[_i]; + tempDictionary[key] = serializer.deserialize(value, responseBody[key], objectName, options); + } + return tempDictionary; + } + return responseBody; } -function getValueOrFunctionResult(value, defaultValueCreator) { - var result; - if (typeof value === "string") { - result = value; +function deserializeSequenceType(serializer, mapper, responseBody, objectName, options) { + var 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)); } - else { - result = defaultValueCreator(); - if (typeof value === "function") { - result = value(result); + if (responseBody) { + if (!Array.isArray(responseBody)) { + // xml2js will interpret a single element array as just the element, so force it to be an array + responseBody = [responseBody]; + } + var tempArray = []; + for (var i = 0; i < responseBody.length; i++) { + tempArray[i] = serializer.deserialize(element, responseBody[i], objectName + "[" + i + "]", options); } + return tempArray; } - return result; + return responseBody; } -function createDefaultRequestPolicyFactories(authPolicyFactory, options) { - var factories = []; - if (options.generateClientRequestIdHeader) { - factories.push(generateClientRequestIdPolicy(options.clientRequestIdHeaderName)); +function getPolymorphicMapper(serializer, mapper, object, polymorphicPropertyName) { + var polymorphicDiscriminator = getPolymorphicDiscriminatorRecursively(serializer, mapper); + if (polymorphicDiscriminator) { + var discriminatorName = polymorphicDiscriminator[polymorphicPropertyName]; + if (discriminatorName != undefined) { + var discriminatorValue = object[discriminatorName]; + if (discriminatorValue != undefined) { + var typeName = mapper.type.uberParent || mapper.type.className; + var indexDiscriminator = discriminatorValue === typeName + ? discriminatorValue + : typeName + "." + discriminatorValue; + var polymorphicMapper = serializer.modelMappers.discriminators[indexDiscriminator]; + if (polymorphicMapper) { + mapper = polymorphicMapper; + } + } + } } - if (authPolicyFactory) { - factories.push(authPolicyFactory); + return mapper; +} +function getPolymorphicDiscriminatorRecursively(serializer, mapper) { + return (mapper.type.polymorphicDiscriminator || + getPolymorphicDiscriminatorSafely(serializer, mapper.type.uberParent) || + getPolymorphicDiscriminatorSafely(serializer, mapper.type.className)); +} +function getPolymorphicDiscriminatorSafely(serializer, typeName) { + return (typeName && + serializer.modelMappers[typeName] && + serializer.modelMappers[typeName].type.polymorphicDiscriminator); +} +// TODO: why is this here? +function serializeObject(toSerialize) { + var castToSerialize = toSerialize; + if (toSerialize == undefined) + return undefined; + if (toSerialize instanceof Uint8Array) { + toSerialize = encodeByteArray(toSerialize); + return toSerialize; } - var userAgentHeaderName = getValueOrFunctionResult(options.userAgentHeaderName, getDefaultUserAgentHeaderName); - var userAgentHeaderValue = getValueOrFunctionResult(options.userAgent, getDefaultUserAgentValue); - if (userAgentHeaderName && userAgentHeaderValue) { - factories.push(userAgentPolicy({ key: userAgentHeaderName, value: userAgentHeaderValue })); + else if (toSerialize instanceof Date) { + return toSerialize.toISOString(); } - factories.push(redirectPolicy()); - factories.push(rpRegistrationPolicy(options.rpRegistrationRetryTimeout)); - if (!options.noRetryPolicy) { - factories.push(exponentialRetryPolicy()); - factories.push(systemErrorRetryPolicy()); - factories.push(throttlingRetryPolicy()); + else if (Array.isArray(toSerialize)) { + var array = []; + for (var i = 0; i < toSerialize.length; i++) { + array.push(serializeObject(toSerialize[i])); + } + return array; } - factories.push(deserializationPolicy(options.deserializationContentTypes)); - { - factories.push(proxyPolicy(options.proxySettings)); + else if (typeof toSerialize === "object") { + var dictionary = {}; + for (var property in toSerialize) { + dictionary[property] = serializeObject(castToSerialize[property]); + } + return dictionary; } - factories.push(logPolicy({ logger: logger.info })); - return factories; + return toSerialize; } -function createPipelineFromOptions(pipelineOptions, authPolicyFactory) { - var requestPolicyFactories = []; - if (pipelineOptions.sendStreamingJson) { - requestPolicyFactories.push(ndJsonPolicy()); +/** + * Utility function to create a K:V from a list of strings + */ +function strEnum(o) { + var result = {}; + for (var _i = 0, o_1 = o; _i < o_1.length; _i++) { + var key = o_1[_i]; + result[key] = key; } - var userAgentValue = undefined; - if (pipelineOptions.userAgentOptions && pipelineOptions.userAgentOptions.userAgentPrefix) { - var userAgentInfo = []; - userAgentInfo.push(pipelineOptions.userAgentOptions.userAgentPrefix); - // Add the default user agent value if it isn't already specified - // by the userAgentPrefix option. - var defaultUserAgentInfo = getDefaultUserAgentValue(); - if (userAgentInfo.indexOf(defaultUserAgentInfo) === -1) { - userAgentInfo.push(defaultUserAgentInfo); + return result; +} +// eslint-disable-next-line @typescript-eslint/no-redeclare +var MapperType = strEnum([ + "Base64Url", + "Boolean", + "ByteArray", + "Composite", + "Date", + "DateTime", + "DateTimeRfc1123", + "Dictionary", + "Enum", + "Number", + "Object", + "Sequence", + "String", + "Stream", + "TimeSpan", + "UnixTime" +]); + +// Copyright (c) Microsoft Corporation. +function isWebResourceLike(object) { + if (object && typeof object === "object") { + var castObject = object; + if (typeof castObject.url === "string" && + typeof castObject.method === "string" && + typeof castObject.headers === "object" && + isHttpHeadersLike(castObject.headers) && + typeof castObject.validateRequestProperties === "function" && + typeof castObject.prepare === "function" && + typeof castObject.clone === "function") { + return true; } - userAgentValue = userAgentInfo.join(" "); - } - var keepAliveOptions = tslib.__assign(tslib.__assign({}, DefaultKeepAliveOptions), pipelineOptions.keepAliveOptions); - var retryOptions = tslib.__assign(tslib.__assign({}, DefaultRetryOptions), pipelineOptions.retryOptions); - var redirectOptions = tslib.__assign(tslib.__assign({}, DefaultRedirectOptions), pipelineOptions.redirectOptions); - { - requestPolicyFactories.push(proxyPolicy(pipelineOptions.proxyOptions)); - } - var deserializationOptions = tslib.__assign(tslib.__assign({}, DefaultDeserializationOptions), pipelineOptions.deserializationOptions); - var loggingOptions = tslib.__assign({}, pipelineOptions.loggingOptions); - requestPolicyFactories.push(tracingPolicy({ userAgent: userAgentValue }), keepAlivePolicy(keepAliveOptions), userAgentPolicy({ value: userAgentValue }), generateClientRequestIdPolicy(), deserializationPolicy(deserializationOptions.expectedContentTypes), throttlingRetryPolicy(), systemErrorRetryPolicy(), exponentialRetryPolicy(retryOptions.maxRetries, retryOptions.retryDelayInMs, retryOptions.maxRetryDelayInMs)); - if (redirectOptions.handleRedirects) { - requestPolicyFactories.push(redirectPolicy(redirectOptions.maxRetries)); - } - if (authPolicyFactory) { - requestPolicyFactories.push(authPolicyFactory); - } - requestPolicyFactories.push(logPolicy(loggingOptions)); - if (isNode && pipelineOptions.decompressResponse === false) { - requestPolicyFactories.push(disableResponseDecompressionPolicy()); } - return { - httpClient: pipelineOptions.httpClient, - requestPolicyFactories: requestPolicyFactories - }; -} -function getOperationArgumentValueFromParameter(serviceClient, operationArguments, parameter, serializer) { - return getOperationArgumentValueFromParameterPath(serviceClient, operationArguments, parameter.parameterPath, parameter.mapper, serializer); + return false; } -function getOperationArgumentValueFromParameterPath(serviceClient, operationArguments, parameterPath, parameterMapper, serializer) { - var _a; - var value; - if (typeof parameterPath === "string") { - parameterPath = [parameterPath]; +/** + * Creates a new WebResource object. + * + * This class provides an abstraction over a REST call by being library / implementation agnostic and wrapping the necessary + * properties to initiate a request. + */ +var WebResource = /** @class */ (function () { + function WebResource(url, method, body, query, headers, streamResponseBody, withCredentials, abortSignal, timeout, onUploadProgress, onDownloadProgress, proxySettings, keepAlive, decompressResponse, streamResponseStatusCodes) { + this.streamResponseBody = streamResponseBody; + this.streamResponseStatusCodes = streamResponseStatusCodes; + this.url = url || ""; + this.method = method || "GET"; + this.headers = isHttpHeadersLike(headers) ? headers : new HttpHeaders(headers); + this.body = body; + this.query = query; + this.formData = undefined; + this.withCredentials = withCredentials || false; + this.abortSignal = abortSignal; + this.timeout = timeout || 0; + this.onUploadProgress = onUploadProgress; + this.onDownloadProgress = onDownloadProgress; + this.proxySettings = proxySettings; + this.keepAlive = keepAlive; + this.decompressResponse = decompressResponse; + this.requestId = this.headers.get("x-ms-client-request-id") || generateUuid(); } - var serializerOptions = (_a = operationArguments.options) === null || _a === void 0 ? void 0 : _a.serializerOptions; - if (Array.isArray(parameterPath)) { - if (parameterPath.length > 0) { - if (parameterMapper.isConstant) { - value = parameterMapper.defaultValue; + /** + * Validates that the required properties such as method, url, headers["Content-Type"], + * headers["accept-language"] are defined. It will throw an error if one of the above + * mentioned properties are not defined. + */ + WebResource.prototype.validateRequestProperties = function () { + if (!this.method) { + throw new Error("WebResource.method is required."); + } + if (!this.url) { + throw new Error("WebResource.url is required."); + } + }; + /** + * Prepares the request. + * @param options - Options to provide for preparing the request. + * @returns Returns the prepared WebResource (HTTP Request) object that needs to be given to the request pipeline. + */ + WebResource.prototype.prepare = function (options) { + if (!options) { + throw new Error("options object is required"); + } + if (options.method === undefined || + options.method === null || + typeof options.method.valueOf() !== "string") { + throw new Error("options.method must be a string."); + } + if (options.url && options.pathTemplate) { + throw new Error("options.url and options.pathTemplate are mutually exclusive. Please provide exactly one of them."); + } + if ((options.pathTemplate === undefined || + options.pathTemplate === null || + typeof options.pathTemplate.valueOf() !== "string") && + (options.url === undefined || + options.url === null || + typeof options.url.valueOf() !== "string")) { + throw new Error("Please provide exactly one of options.pathTemplate or options.url."); + } + // set the url if it is provided. + if (options.url) { + if (typeof options.url !== "string") { + throw new Error('options.url must be of type "string".'); } - else { - var propertySearchResult = getPropertyFromParameterPath(operationArguments, parameterPath); - if (!propertySearchResult.propertyFound) { - propertySearchResult = getPropertyFromParameterPath(serviceClient, parameterPath); - } - var useDefaultValue = false; - if (!propertySearchResult.propertyFound) { - useDefaultValue = - parameterMapper.required || - (parameterPath[0] === "options" && parameterPath.length === 2); - } - value = useDefaultValue ? parameterMapper.defaultValue : propertySearchResult.propertyValue; + this.url = options.url; + } + // set the method + if (options.method) { + var validMethods = ["GET", "PUT", "HEAD", "DELETE", "OPTIONS", "POST", "PATCH", "TRACE"]; + if (validMethods.indexOf(options.method.toUpperCase()) === -1) { + throw new Error('The provided method "' + + options.method + + '" is invalid. Supported HTTP methods are: ' + + JSON.stringify(validMethods)); } - // Serialize just for validation purposes. - var parameterPathString = getPathStringFromParameterPath(parameterPath, parameterMapper); - serializer.serialize(parameterMapper, value, parameterPathString, serializerOptions); } - } - else { - if (parameterMapper.required) { - value = {}; + this.method = options.method.toUpperCase(); + // construct the url if path template is provided + if (options.pathTemplate) { + var pathTemplate_1 = options.pathTemplate, pathParameters_1 = options.pathParameters; + if (typeof pathTemplate_1 !== "string") { + throw new Error('options.pathTemplate must be of type "string".'); + } + if (!options.baseUrl) { + options.baseUrl = "https://management.azure.com"; + } + var baseUrl = options.baseUrl; + var url_1 = baseUrl + + (baseUrl.endsWith("/") ? "" : "/") + + (pathTemplate_1.startsWith("/") ? pathTemplate_1.slice(1) : pathTemplate_1); + var segments = url_1.match(/({[\w-]*\s*[\w-]*})/gi); + if (segments && segments.length) { + if (!pathParameters_1) { + throw new Error("pathTemplate: " + pathTemplate_1 + " has been provided. Hence, options.pathParameters must also be provided."); + } + segments.forEach(function (item) { + var pathParamName = item.slice(1, -1); + var pathParam = pathParameters_1[pathParamName]; + if (pathParam === null || + pathParam === undefined || + !(typeof pathParam === "string" || typeof pathParam === "object")) { + var stringifiedPathParameters = JSON.stringify(pathParameters_1, undefined, 2); + throw new Error("pathTemplate: " + pathTemplate_1 + " contains the path parameter " + pathParamName + + (" however, it is not present in parameters: " + stringifiedPathParameters + ".") + + ("The value of the path parameter can either be a \"string\" of the form { " + pathParamName + ": \"some sample value\" } or ") + + ("it can be an \"object\" of the form { \"" + pathParamName + "\": { value: \"some sample value\", skipUrlEncoding: true } }.")); + } + if (typeof pathParam.valueOf() === "string") { + url_1 = url_1.replace(item, encodeURIComponent(pathParam)); + } + if (typeof pathParam.valueOf() === "object") { + if (!pathParam.value) { + throw new Error("options.pathParameters[" + pathParamName + "] is of type \"object\" but it does not contain a \"value\" property."); + } + if (pathParam.skipUrlEncoding) { + url_1 = url_1.replace(item, pathParam.value); + } + else { + url_1 = url_1.replace(item, encodeURIComponent(pathParam.value)); + } + } + }); + } + this.url = url_1; } - for (var propertyName in parameterPath) { - var propertyMapper = parameterMapper.type.modelProperties[propertyName]; - var propertyPath = parameterPath[propertyName]; - var propertyValue = getOperationArgumentValueFromParameterPath(serviceClient, operationArguments, propertyPath, propertyMapper, serializer); - // Serialize just for validation purposes. - var propertyPathString = getPathStringFromParameterPath(propertyPath, propertyMapper); - serializer.serialize(propertyMapper, propertyValue, propertyPathString, serializerOptions); - if (propertyValue !== undefined && propertyValue !== null) { - if (!value) { - value = {}; + // append query parameters to the url if they are provided. They can be provided with pathTemplate or url option. + if (options.queryParameters) { + var queryParameters = options.queryParameters; + if (typeof queryParameters !== "object") { + throw new Error("options.queryParameters must be of type object. It should be a JSON object " + + "of \"query-parameter-name\" as the key and the \"query-parameter-value\" as the value. " + + "The \"query-parameter-value\" may be fo type \"string\" or an \"object\" of the form { value: \"query-parameter-value\", skipUrlEncoding: true }."); + } + // append question mark if it is not present in the url + if (this.url && this.url.indexOf("?") === -1) { + this.url += "?"; + } + // construct queryString + var queryParams = []; + // We need to populate this.query as a dictionary if the request is being used for Sway's validateRequest(). + this.query = {}; + for (var queryParamName in queryParameters) { + var queryParam = queryParameters[queryParamName]; + if (queryParam) { + if (typeof queryParam === "string") { + queryParams.push(queryParamName + "=" + encodeURIComponent(queryParam)); + this.query[queryParamName] = encodeURIComponent(queryParam); + } + else if (typeof queryParam === "object") { + if (!queryParam.value) { + throw new Error("options.queryParameters[" + queryParamName + "] is of type \"object\" but it does not contain a \"value\" property."); + } + if (queryParam.skipUrlEncoding) { + queryParams.push(queryParamName + "=" + queryParam.value); + this.query[queryParamName] = queryParam.value; + } + else { + queryParams.push(queryParamName + "=" + encodeURIComponent(queryParam.value)); + this.query[queryParamName] = encodeURIComponent(queryParam.value); + } + } } - value[propertyName] = propertyValue; + } // end-of-for + // append the queryString + this.url += queryParams.join("&"); + } + // add headers to the request if they are provided + if (options.headers) { + var headers = options.headers; + for (var _i = 0, _a = Object.keys(options.headers); _i < _a.length; _i++) { + var headerName = _a[_i]; + this.headers.set(headerName, headers[headerName]); } } - } - return value; -} -function getPropertyFromParameterPath(parent, parameterPath) { - var result = { propertyFound: false }; - var i = 0; - for (; i < parameterPath.length; ++i) { - var parameterPathPart = parameterPath[i]; - // Make sure to check inherited properties too, so don't use hasOwnProperty(). - if (parent !== undefined && parent !== null && parameterPathPart in parent) { - parent = parent[parameterPathPart]; + // ensure accept-language is set correctly + if (!this.headers.get("accept-language")) { + this.headers.set("accept-language", "en-US"); } - else { - break; + // ensure the request-id is set correctly + if (!this.headers.get("x-ms-client-request-id") && !options.disableClientRequestId) { + this.headers.set("x-ms-client-request-id", this.requestId); } - } - if (i === parameterPath.length) { - result.propertyValue = parent; - result.propertyFound = true; - } - return result; -} -function flattenResponse(_response, responseSpec) { - var parsedHeaders = _response.parsedHeaders; - var bodyMapper = responseSpec && responseSpec.bodyMapper; - var addOperationResponse = function (obj) { - return Object.defineProperty(obj, "_response", { - value: _response - }); - }; - if (bodyMapper) { - var typeName = bodyMapper.type.name; - if (typeName === "Stream") { - return addOperationResponse(tslib.__assign(tslib.__assign({}, parsedHeaders), { blobBody: _response.blobBody, readableStreamBody: _response.readableStreamBody })); + // default + if (!this.headers.get("Content-Type")) { + this.headers.set("Content-Type", "application/json; charset=utf-8"); } - var modelProperties_1 = (typeName === "Composite" && bodyMapper.type.modelProperties) || {}; - var isPageableResponse = Object.keys(modelProperties_1).some(function (k) { return modelProperties_1[k].serializedName === ""; }); - if (typeName === "Sequence" || isPageableResponse) { - var arrayResponse = tslib.__spreadArray([], (_response.parsedBody || [])); - for (var _i = 0, _a = Object.keys(modelProperties_1); _i < _a.length; _i++) { - var key = _a[_i]; - if (modelProperties_1[key].serializedName) { - arrayResponse[key] = _response.parsedBody[key]; + // set the request body. request.js automatically sets the Content-Length request header, so we need not set it explicitly + this.body = options.body; + if (options.body !== undefined && options.body !== null) { + // body as a stream special case. set the body as-is and check for some special request headers specific to sending a stream. + if (options.bodyIsStream) { + if (!this.headers.get("Transfer-Encoding")) { + this.headers.set("Transfer-Encoding", "chunked"); + } + if (this.headers.get("Content-Type") !== "application/octet-stream") { + this.headers.set("Content-Type", "application/octet-stream"); } } - if (parsedHeaders) { - for (var _b = 0, _c = Object.keys(parsedHeaders); _b < _c.length; _b++) { - var key = _c[_b]; - arrayResponse[key] = parsedHeaders[key]; + else { + if (options.serializationMapper) { + this.body = new Serializer(options.mappers).serialize(options.serializationMapper, options.body, "requestBody"); + } + if (!options.disableJsonStringifyOnBody) { + this.body = JSON.stringify(options.body); } } - addOperationResponse(arrayResponse); - return arrayResponse; } - if (typeName === "Composite" || typeName === "Dictionary") { - return addOperationResponse(tslib.__assign(tslib.__assign({}, parsedHeaders), _response.parsedBody)); + if (options.spanOptions) { + this.spanOptions = options.spanOptions; } - } - if (bodyMapper || - _response.request.method === "HEAD" || - isPrimitiveType(_response.parsedBody)) { - // primitive body types and HEAD booleans - return addOperationResponse(tslib.__assign(tslib.__assign({}, parsedHeaders), { body: _response.parsedBody })); - } - return addOperationResponse(tslib.__assign(tslib.__assign({}, parsedHeaders), _response.parsedBody)); -} -function getCredentialScopes(options, baseUri) { - if (options === null || options === void 0 ? void 0 : options.credentialScopes) { - var scopes = options.credentialScopes; - return Array.isArray(scopes) - ? scopes.map(function (scope) { return new url.URL(scope).toString(); }) - : new url.URL(scopes).toString(); - } - if (baseUri) { - return baseUri + "/.default"; - } - return undefined; -} - -// Copyright (c) Microsoft Corporation. -/** - * This function is only here for compatibility. Use createSpanFunction in core-tracing. - * - * @deprecated This function is only here for compatibility. Use createSpanFunction in core-tracing. - * @hidden - - * @param spanConfig - The name of the operation being performed. - * @param tracingOptions - The options for the underlying http request. - */ -function createSpanFunction(args) { - return coreTracing.createSpanFunction(args); -} - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * Defines the default token refresh buffer duration. - */ -var TokenRefreshBufferMs = 2 * 60 * 1000; // 2 Minutes -/** - * Provides an {@link AccessTokenCache} implementation which clears - * the cached {@link AccessToken}'s after the expiresOnTimestamp has - * passed. - * - * @deprecated No longer used in the bearer authorization policy. - */ -var ExpiringAccessTokenCache = /** @class */ (function () { + if (options.tracingContext) { + this.tracingContext = options.tracingContext; + } + this.abortSignal = options.abortSignal; + this.onDownloadProgress = options.onDownloadProgress; + this.onUploadProgress = options.onUploadProgress; + return this; + }; /** - * Constructs an instance of {@link ExpiringAccessTokenCache} with - * an optional expiration buffer time. + * Clone this WebResource HTTP request object. + * @returns The clone of this WebResource HTTP request object. */ - function ExpiringAccessTokenCache(tokenRefreshBufferMs) { - if (tokenRefreshBufferMs === void 0) { tokenRefreshBufferMs = TokenRefreshBufferMs; } - this.cachedToken = undefined; - this.tokenRefreshBufferMs = tokenRefreshBufferMs; - } - ExpiringAccessTokenCache.prototype.setCachedToken = function (accessToken) { - this.cachedToken = accessToken; - }; - ExpiringAccessTokenCache.prototype.getCachedToken = function () { - if (this.cachedToken && - Date.now() + this.tokenRefreshBufferMs >= this.cachedToken.expiresOnTimestamp) { - this.cachedToken = undefined; + WebResource.prototype.clone = function () { + var result = new WebResource(this.url, this.method, this.body, this.query, this.headers && this.headers.clone(), this.streamResponseBody, this.withCredentials, this.abortSignal, this.timeout, this.onUploadProgress, this.onDownloadProgress, this.proxySettings, this.keepAlive, this.decompressResponse, this.streamResponseStatusCodes); + if (this.formData) { + result.formData = this.formData; } - return this.cachedToken; + if (this.operationSpec) { + result.operationSpec = this.operationSpec; + } + if (this.shouldDeserialize) { + result.shouldDeserialize = this.shouldDeserialize; + } + if (this.operationResponseGetter) { + result.operationResponseGetter = this.operationResponseGetter; + } + return result; }; - return ExpiringAccessTokenCache; + return WebResource; }()); +// Copyright (c) Microsoft Corporation. +var custom = util.inspect.custom; + // Copyright (c) Microsoft Corporation. /** - * Helps the core-http token authentication policies with requesting a new token if we're not currently waiting for a new token. - * - * @deprecated No longer used in the bearer authorization policy. + * A class that handles the query portion of a URLBuilder. */ -var AccessTokenRefresher = /** @class */ (function () { - function AccessTokenRefresher(credential, scopes, requiredMillisecondsBeforeNewRefresh) { - if (requiredMillisecondsBeforeNewRefresh === void 0) { requiredMillisecondsBeforeNewRefresh = 30000; } - this.credential = credential; - this.scopes = scopes; - this.requiredMillisecondsBeforeNewRefresh = requiredMillisecondsBeforeNewRefresh; - this.lastCalled = 0; +var URLQuery = /** @class */ (function () { + function URLQuery() { + this._rawQuery = {}; } /** - * Returns true if the required milliseconds(defaulted to 30000) have been passed signifying - * that we are ready for a new refresh. + * Get whether or not there any query parameters in this URLQuery. */ - AccessTokenRefresher.prototype.isReady = function () { - // We're only ready for a new refresh if the required milliseconds have passed. - return (!this.lastCalled || Date.now() - this.lastCalled > this.requiredMillisecondsBeforeNewRefresh); + URLQuery.prototype.any = function () { + return Object.keys(this._rawQuery).length > 0; }; /** - * Stores the time in which it is called, - * then requests a new token, - * then sets this.promise to undefined, - * then returns the token. + * Get the keys of the query string. */ - AccessTokenRefresher.prototype.getToken = function (options) { - return tslib.__awaiter(this, void 0, void 0, function () { - var token; - return tslib.__generator(this, function (_a) { - switch (_a.label) { - case 0: - this.lastCalled = Date.now(); - return [4 /*yield*/, this.credential.getToken(this.scopes, options)]; - case 1: - token = _a.sent(); - this.promise = undefined; - return [2 /*return*/, token || undefined]; - } - }); - }); + URLQuery.prototype.keys = function () { + return Object.keys(this._rawQuery); }; /** - * Requests a new token if we're not currently waiting for a new token. - * Returns null if the required time between each call hasn't been reached. + * Set a query parameter with the provided name and value. If the parameterValue is undefined or + * empty, then this will attempt to remove an existing query parameter with the provided + * parameterName. */ - AccessTokenRefresher.prototype.refresh = function (options) { - if (!this.promise) { - this.promise = this.getToken(options); + URLQuery.prototype.set = function (parameterName, parameterValue) { + var caseParameterValue = parameterValue; + if (parameterName) { + if (caseParameterValue !== undefined && caseParameterValue !== null) { + var newValue = Array.isArray(caseParameterValue) + ? caseParameterValue + : caseParameterValue.toString(); + this._rawQuery[parameterName] = newValue; + } + else { + delete this._rawQuery[parameterName]; + } } - return this.promise; }; - return AccessTokenRefresher; -}()); - -// Copyright (c) Microsoft Corporation. -var HeaderConstants = Constants.HeaderConstants; -var DEFAULT_AUTHORIZATION_SCHEME = "Basic"; -var BasicAuthenticationCredentials = /** @class */ (function () { /** - * Creates a new BasicAuthenticationCredentials object. - * - * @param userName - User name. - * @param password - Password. - * @param authorizationScheme - The authorization scheme. + * Get the value of the query parameter with the provided name. If no parameter exists with the + * provided parameter name, then undefined will be returned. */ - function BasicAuthenticationCredentials(userName, password, authorizationScheme) { - if (authorizationScheme === void 0) { authorizationScheme = DEFAULT_AUTHORIZATION_SCHEME; } - this.authorizationScheme = DEFAULT_AUTHORIZATION_SCHEME; - if (userName === null || userName === undefined || typeof userName.valueOf() !== "string") { - throw new Error("userName cannot be null or undefined and must be of type string."); - } - if (password === null || password === undefined || typeof password.valueOf() !== "string") { - throw new Error("password cannot be null or undefined and must be of type string."); + URLQuery.prototype.get = function (parameterName) { + return parameterName ? this._rawQuery[parameterName] : undefined; + }; + /** + * Get the string representation of this query. The return value will not start with a "?". + */ + URLQuery.prototype.toString = function () { + var result = ""; + for (var parameterName in this._rawQuery) { + if (result) { + result += "&"; + } + var parameterValue = this._rawQuery[parameterName]; + if (Array.isArray(parameterValue)) { + var parameterStrings = []; + for (var _i = 0, parameterValue_1 = parameterValue; _i < parameterValue_1.length; _i++) { + var parameterValueElement = parameterValue_1[_i]; + parameterStrings.push(parameterName + "=" + parameterValueElement); + } + result += parameterStrings.join("&"); + } + else { + result += parameterName + "=" + parameterValue; + } } - this.userName = userName; - this.password = password; - this.authorizationScheme = authorizationScheme; - } + return result; + }; /** - * Signs a request with the Authentication header. - * - * @param webResource - The WebResourceLike to be signed. - * @returns The signed request object. + * Parse a URLQuery from the provided text. */ - BasicAuthenticationCredentials.prototype.signRequest = function (webResource) { - var credentials = this.userName + ":" + this.password; - var encodedCredentials = this.authorizationScheme + " " + encodeString(credentials); - if (!webResource.headers) - webResource.headers = new HttpHeaders(); - webResource.headers.set(HeaderConstants.AUTHORIZATION, encodedCredentials); - return Promise.resolve(webResource); + URLQuery.parse = function (text) { + var result = new URLQuery(); + if (text) { + if (text.startsWith("?")) { + text = text.substring(1); + } + var currentState = "ParameterName"; + var parameterName = ""; + var parameterValue = ""; + for (var i = 0; i < text.length; ++i) { + var currentCharacter = text[i]; + switch (currentState) { + case "ParameterName": + switch (currentCharacter) { + case "=": + currentState = "ParameterValue"; + break; + case "&": + parameterName = ""; + parameterValue = ""; + break; + default: + parameterName += currentCharacter; + break; + } + break; + case "ParameterValue": + switch (currentCharacter) { + case "&": + result.set(parameterName, parameterValue); + parameterName = ""; + parameterValue = ""; + currentState = "ParameterName"; + break; + default: + parameterValue += currentCharacter; + break; + } + break; + default: + throw new Error("Unrecognized URLQuery parse state: " + currentState); + } + } + if (currentState === "ParameterValue") { + result.set(parameterName, parameterValue); + } + } + return result; }; - return BasicAuthenticationCredentials; + return URLQuery; }()); - -// Copyright (c) Microsoft Corporation. /** - * Authenticates to a service using an API key. + * A class that handles creating, modifying, and parsing URLs. */ -var ApiKeyCredentials = /** @class */ (function () { +var URLBuilder = /** @class */ (function () { + function URLBuilder() { + } /** - * @param options - Specifies the options to be provided for auth. Either header or query needs to be provided. + * Set the scheme/protocol for this URL. If the provided scheme contains other parts of a URL + * (such as a host, port, path, or query), those parts will be added to this URL as well. */ - function ApiKeyCredentials(options) { - if (!options || (options && !options.inHeader && !options.inQuery)) { - throw new Error("options cannot be null or undefined. Either \"inHeader\" or \"inQuery\" property of the options object needs to be provided."); + URLBuilder.prototype.setScheme = function (scheme) { + if (!scheme) { + this._scheme = undefined; } - this.inHeader = options.inHeader; - this.inQuery = options.inQuery; - } + else { + this.set(scheme, "SCHEME"); + } + }; /** - * Signs a request with the values provided in the inHeader and inQuery parameter. - * - * @param webResource - The WebResourceLike to be signed. - * @returns The signed request object. + * Get the scheme that has been set in this URL. */ - ApiKeyCredentials.prototype.signRequest = function (webResource) { - if (!webResource) { - return Promise.reject(new Error("webResource cannot be null or undefined and must be of type \"object\".")); + URLBuilder.prototype.getScheme = function () { + return this._scheme; + }; + /** + * Set the host for this URL. If the provided host contains other parts of a URL (such as a + * port, path, or query), those parts will be added to this URL as well. + */ + URLBuilder.prototype.setHost = function (host) { + if (!host) { + this._host = undefined; } - if (this.inHeader) { - if (!webResource.headers) { - webResource.headers = new HttpHeaders(); - } - for (var headerName in this.inHeader) { - webResource.headers.set(headerName, this.inHeader[headerName]); - } + else { + this.set(host, "SCHEME_OR_HOST"); } - if (this.inQuery) { - if (!webResource.url) { - return Promise.reject(new Error("url cannot be null in the request object.")); - } - if (webResource.url.indexOf("?") < 0) { - webResource.url += "?"; - } - for (var key in this.inQuery) { - if (!webResource.url.endsWith("?")) { - webResource.url += "&"; - } - webResource.url += key + "=" + this.inQuery[key]; - } + }; + /** + * Get the host that has been set in this URL. + */ + URLBuilder.prototype.getHost = function () { + return this._host; + }; + /** + * Set the port for this URL. If the provided port contains other parts of a URL (such as a + * path or query), those parts will be added to this URL as well. + */ + URLBuilder.prototype.setPort = function (port) { + if (port === undefined || port === null || port === "") { + this._port = undefined; + } + else { + this.set(port.toString(), "PORT"); } - return Promise.resolve(webResource); }; - return ApiKeyCredentials; -}()); - -// Copyright (c) Microsoft Corporation. -var TopicCredentials = /** @class */ (function (_super) { - tslib.__extends(TopicCredentials, _super); /** - * Creates a new EventGrid TopicCredentials object. - * - * @param topicKey - The EventGrid topic key + * Get the port that has been set in this URL. */ - function TopicCredentials(topicKey) { - var _this = this; - if (!topicKey || (topicKey && typeof topicKey !== "string")) { - throw new Error("topicKey cannot be null or undefined and must be of type string."); + URLBuilder.prototype.getPort = function () { + return this._port; + }; + /** + * Set the path for this URL. If the provided path contains a query, then it will be added to + * this URL as well. + */ + URLBuilder.prototype.setPath = function (path) { + if (!path) { + this._path = undefined; } - var options = { - inHeader: { - "aeg-sas-key": topicKey + else { + var schemeIndex = path.indexOf("://"); + if (schemeIndex !== -1) { + var schemeStart = path.lastIndexOf("/", schemeIndex); + // Make sure to only grab the URL part of the path before setting the state back to SCHEME + // this will handle cases such as "/a/b/c/https://microsoft.com" => "https://microsoft.com" + this.set(schemeStart === -1 ? path : path.substr(schemeStart + 1), "SCHEME"); } - }; - _this = _super.call(this, options) || this; - return _this; - } - return TopicCredentials; -}(ApiKeyCredentials)); - -Object.defineProperty(exports, "isTokenCredential", ({ - enumerable: true, - get: function () { - return coreAuth.isTokenCredential; - } -})); -exports.AccessTokenRefresher = AccessTokenRefresher; -exports.ApiKeyCredentials = ApiKeyCredentials; -exports.BaseRequestPolicy = BaseRequestPolicy; -exports.BasicAuthenticationCredentials = BasicAuthenticationCredentials; -exports.Constants = Constants; -exports.DefaultHttpClient = NodeFetchHttpClient; -exports.ExpiringAccessTokenCache = ExpiringAccessTokenCache; -exports.HttpHeaders = HttpHeaders; -exports.MapperType = MapperType; -exports.RequestPolicyOptions = RequestPolicyOptions; -exports.RestError = RestError; -exports.Serializer = Serializer; -exports.ServiceClient = ServiceClient; -exports.TopicCredentials = TopicCredentials; -exports.URLBuilder = URLBuilder; -exports.URLQuery = URLQuery; -exports.WebResource = WebResource; -exports.XML_ATTRKEY = XML_ATTRKEY; -exports.XML_CHARKEY = XML_CHARKEY; -exports.applyMixins = applyMixins; -exports.bearerTokenAuthenticationPolicy = bearerTokenAuthenticationPolicy; -exports.createPipelineFromOptions = createPipelineFromOptions; -exports.createSpanFunction = createSpanFunction; -exports.delay = delay; -exports.deserializationPolicy = deserializationPolicy; -exports.deserializeResponseBody = deserializeResponseBody; -exports.disableResponseDecompressionPolicy = disableResponseDecompressionPolicy; -exports.encodeUri = encodeUri; -exports.executePromisesSequentially = executePromisesSequentially; -exports.exponentialRetryPolicy = exponentialRetryPolicy; -exports.flattenResponse = flattenResponse; -exports.generateClientRequestIdPolicy = generateClientRequestIdPolicy; -exports.generateUuid = generateUuid; -exports.getDefaultProxySettings = getDefaultProxySettings; -exports.getDefaultUserAgentValue = getDefaultUserAgentValue; -exports.isDuration = isDuration; -exports.isNode = isNode; -exports.isValidUuid = isValidUuid; -exports.keepAlivePolicy = keepAlivePolicy; -exports.logPolicy = logPolicy; -exports.operationOptionsToRequestOptionsBase = operationOptionsToRequestOptionsBase; -exports.parseXML = parseXML; -exports.promiseToCallback = promiseToCallback; -exports.promiseToServiceCallback = promiseToServiceCallback; -exports.proxyPolicy = proxyPolicy; -exports.redirectPolicy = redirectPolicy; -exports.serializeObject = serializeObject; -exports.signingPolicy = signingPolicy; -exports.stringifyXML = stringifyXML; -exports.stripRequest = stripRequest; -exports.stripResponse = stripResponse; -exports.systemErrorRetryPolicy = systemErrorRetryPolicy; -exports.throttlingRetryPolicy = throttlingRetryPolicy; -exports.tracingPolicy = tracingPolicy; -exports.userAgentPolicy = userAgentPolicy; -//# sourceMappingURL=index.js.map - - -/***/ }), - -/***/ 1754: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -var api = __nccwpck_require__(6865); -var tslib = __nccwpck_require__(2107); - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * A no-op implementation of Span that can safely be used without side-effects. - */ -var NoOpSpan = /** @class */ (function () { - function NoOpSpan() { - } + else { + this.set(path, "PATH"); + } + } + }; /** - * Returns the SpanContext associated with this Span. + * Append the provided path to this URL's existing path. If the provided path contains a query, + * then it will be added to this URL as well. */ - NoOpSpan.prototype.context = function () { - return { - spanId: "", - traceId: "", - traceFlags: 0 /* NONE */ - }; + URLBuilder.prototype.appendPath = function (path) { + if (path) { + var currentPath = this.getPath(); + if (currentPath) { + if (!currentPath.endsWith("/")) { + currentPath += "/"; + } + if (path.startsWith("/")) { + path = path.substring(1); + } + path = currentPath + path; + } + this.set(path, "PATH"); + } }; /** - * Marks the end of Span execution. - * @param _endTime - The time to use as the Span's end time. Defaults to - * the current time. + * Get the path that has been set in this URL. */ - NoOpSpan.prototype.end = function (_endTime) { - /* Noop */ + URLBuilder.prototype.getPath = function () { + return this._path; }; /** - * Sets an attribute on the Span - * @param _key - The attribute key - * @param _value - The attribute value + * Set the query in this URL. */ - NoOpSpan.prototype.setAttribute = function (_key, _value) { - return this; + URLBuilder.prototype.setQuery = function (query) { + if (!query) { + this._query = undefined; + } + else { + this._query = URLQuery.parse(query); + } }; /** - * Sets attributes on the Span - * @param _attributes - The attributes to add + * Set a query parameter with the provided name and value in this URL's query. If the provided + * query parameter value is undefined or empty, then the query parameter will be removed if it + * existed. */ - NoOpSpan.prototype.setAttributes = function (_attributes) { - return this; + URLBuilder.prototype.setQueryParameter = function (queryParameterName, queryParameterValue) { + if (queryParameterName) { + if (!this._query) { + this._query = new URLQuery(); + } + this._query.set(queryParameterName, queryParameterValue); + } }; /** - * Adds an event to the Span - * @param _name - The name of the event - * @param _attributes - The associated attributes to add for this event + * Get the value of the query parameter with the provided query parameter name. If no query + * parameter exists with the provided name, then undefined will be returned. */ - NoOpSpan.prototype.addEvent = function (_name, _attributes) { - return this; + URLBuilder.prototype.getQueryParameterValue = function (queryParameterName) { + return this._query ? this._query.get(queryParameterName) : undefined; }; /** - * Sets a status on the span. Overrides the default of SpanStatusCode.OK. - * @param _status - The status to set. + * Get the query in this URL. */ - NoOpSpan.prototype.setStatus = function (_status) { - return this; + URLBuilder.prototype.getQuery = function () { + return this._query ? this._query.toString() : undefined; }; /** - * Updates the name of the Span - * @param _name - the new Span name + * Set the parts of this URL by parsing the provided text using the provided startState. */ - NoOpSpan.prototype.updateName = function (_name) { - return this; + URLBuilder.prototype.set = function (text, startState) { + var tokenizer = new URLTokenizer(text, startState); + while (tokenizer.next()) { + var token = tokenizer.current(); + var tokenPath = void 0; + if (token) { + switch (token.type) { + case "SCHEME": + this._scheme = token.text || undefined; + break; + case "HOST": + this._host = token.text || undefined; + break; + case "PORT": + this._port = token.text || undefined; + break; + case "PATH": + tokenPath = token.text || undefined; + if (!this._path || this._path === "/" || tokenPath !== "/") { + this._path = tokenPath; + } + break; + case "QUERY": + this._query = URLQuery.parse(token.text); + break; + default: + throw new Error("Unrecognized URLTokenType: " + token.type); + } + } + } }; - /** - * Returns whether this span will be recorded - */ - NoOpSpan.prototype.isRecording = function () { - return false; + URLBuilder.prototype.toString = function () { + var result = ""; + if (this._scheme) { + result += this._scheme + "://"; + } + if (this._host) { + result += this._host; + } + if (this._port) { + result += ":" + this._port; + } + if (this._path) { + if (!this._path.startsWith("/")) { + result += "/"; + } + result += this._path; + } + if (this._query && this._query.any()) { + result += "?" + this._query.toString(); + } + return result; }; /** - * Sets exception as a span event - * @param exception - the exception the only accepted values are string or Error - * @param time - the time to set as Span's event time. If not provided, - * use the current time. + * If the provided searchValue is found in this URLBuilder, then replace it with the provided + * replaceValue. */ - NoOpSpan.prototype.recordException = function (_exception, _time) { - /* do nothing */ + URLBuilder.prototype.replaceAll = function (searchValue, replaceValue) { + if (searchValue) { + this.setScheme(replaceAll(this.getScheme(), searchValue, replaceValue)); + this.setHost(replaceAll(this.getHost(), searchValue, replaceValue)); + this.setPort(replaceAll(this.getPort(), searchValue, replaceValue)); + this.setPath(replaceAll(this.getPath(), searchValue, replaceValue)); + this.setQuery(replaceAll(this.getQuery(), searchValue, replaceValue)); + } }; - return NoOpSpan; + URLBuilder.parse = function (text) { + var result = new URLBuilder(); + result.set(text, "SCHEME_OR_HOST"); + return result; + }; + return URLBuilder; }()); - -// Copyright (c) Microsoft Corporation. -/** - * A no-op implementation of Tracer that can be used when tracing - * is disabled. - */ -var NoOpTracer = /** @class */ (function () { - function NoOpTracer() { +var URLToken = /** @class */ (function () { + function URLToken(text, type) { + this.text = text; + this.type = type; } - /** - * Starts a new Span. - * @param _name - The name of the span. - * @param _options - The SpanOptions used during Span creation. - */ - NoOpTracer.prototype.startSpan = function (_name, _options) { - return new NoOpSpan(); + URLToken.scheme = function (text) { + return new URLToken(text, "SCHEME"); }; - /** - * Returns the current Span from the current context, if available. - */ - NoOpTracer.prototype.getCurrentSpan = function () { - return new NoOpSpan(); + URLToken.host = function (text) { + return new URLToken(text, "HOST"); + }; + URLToken.port = function (text) { + return new URLToken(text, "PORT"); + }; + URLToken.path = function (text) { + return new URLToken(text, "PATH"); + }; + URLToken.query = function (text) { + return new URLToken(text, "QUERY"); }; + return URLToken; +}()); +/** + * Get whether or not the provided character (single character string) is an alphanumeric (letter or + * digit) character. + */ +function isAlphaNumericCharacter(character) { + var characterCode = character.charCodeAt(0); + return ((48 /* '0' */ <= characterCode && characterCode <= 57) /* '9' */ || + (65 /* 'A' */ <= characterCode && characterCode <= 90) /* 'Z' */ || + (97 /* 'a' */ <= characterCode && characterCode <= 122) /* 'z' */); +} +/** + * A class that tokenizes URL strings. + */ +var URLTokenizer = /** @class */ (function () { + function URLTokenizer(_text, state) { + this._text = _text; + this._textLength = _text ? _text.length : 0; + this._currentState = state !== undefined && state !== null ? state : "SCHEME_OR_HOST"; + this._currentIndex = 0; + } /** - * Executes the given function within the context provided by a Span. - * @param _span - The span that provides the context. - * @param fn - The function to be executed. + * Get the current URLToken this URLTokenizer is pointing at, or undefined if the URLTokenizer + * hasn't started or has finished tokenizing. */ - NoOpTracer.prototype.withSpan = function (_span, fn) { - return fn(); + URLTokenizer.prototype.current = function () { + return this._currentToken; }; /** - * Bind a Span as the target's scope - * @param target - An object to bind the scope. - * @param _span - A specific Span to use. Otherwise, use the current one. + * Advance to the next URLToken and return whether or not a URLToken was found. */ - NoOpTracer.prototype.bind = function (target, _span) { - return target; - }; - return NoOpTracer; -}()); - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -function getGlobalObject() { - return global; -} - -// Copyright (c) Microsoft Corporation. -// V1 = OpenTelemetry 0.1 -// V2 = OpenTelemetry 0.2 -// V3 = OpenTelemetry 0.6.1 -// V4 = OpenTelemetry 1.0.0-rc.0 -var GLOBAL_TRACER_VERSION = 4; -// preview5 shipped with @azure/core-tracing.tracerCache -// and didn't have smart detection for collisions -var GLOBAL_TRACER_SYMBOL = Symbol.for("@azure/core-tracing.tracerCache3"); -var cache; -function loadTracerCache() { - var globalObj = getGlobalObject(); - var existingCache = globalObj[GLOBAL_TRACER_SYMBOL]; - var setGlobalCache = true; - if (existingCache) { - if (existingCache.version === GLOBAL_TRACER_VERSION) { - cache = existingCache; + URLTokenizer.prototype.next = function () { + if (!hasCurrentCharacter(this)) { + this._currentToken = undefined; } else { - setGlobalCache = false; - if (existingCache.tracer) { - throw new Error("Two incompatible versions of @azure/core-tracing have been loaded.\n This library is " + GLOBAL_TRACER_VERSION + ", existing is " + existingCache.version + "."); + switch (this._currentState) { + case "SCHEME": + nextScheme(this); + break; + case "SCHEME_OR_HOST": + nextSchemeOrHost(this); + break; + case "HOST": + nextHost(this); + break; + case "PORT": + nextPort(this); + break; + case "PATH": + nextPath(this); + break; + case "QUERY": + nextQuery(this); + break; + default: + throw new Error("Unrecognized URLTokenizerState: " + this._currentState); } } + return !!this._currentToken; + }; + return URLTokenizer; +}()); +/** + * Read the remaining characters from this Tokenizer's character stream. + */ +function readRemaining(tokenizer) { + var result = ""; + if (tokenizer._currentIndex < tokenizer._textLength) { + result = tokenizer._text.substring(tokenizer._currentIndex); + tokenizer._currentIndex = tokenizer._textLength; } - if (!cache) { - cache = { - tracer: undefined, - version: GLOBAL_TRACER_VERSION - }; - } - if (setGlobalCache) { - globalObj[GLOBAL_TRACER_SYMBOL] = cache; - } -} -function getCache() { - if (!cache) { - loadTracerCache(); - } - return cache; -} - -// Copyright (c) Microsoft Corporation. -var defaultTracer; -function getDefaultTracer() { - if (!defaultTracer) { - defaultTracer = new NoOpTracer(); - } - return defaultTracer; + return result; } /** - * Sets the global tracer, enabling tracing for the Azure SDK. - * @param tracer - An OpenTelemetry Tracer instance. + * Whether or not this URLTokenizer has a current character. */ -function setTracer(tracer) { - var cache = getCache(); - cache.tracer = tracer; +function hasCurrentCharacter(tokenizer) { + return tokenizer._currentIndex < tokenizer._textLength; } /** - * Retrieves the active tracer, or returns a - * no-op implementation if one is not set. + * Get the character in the text string at the current index. */ -function getTracer() { - var cache = getCache(); - if (!cache.tracer) { - return getDefaultTracer(); - } - return cache.tracer; +function getCurrentCharacter(tokenizer) { + return tokenizer._text[tokenizer._currentIndex]; } - -// Copyright (c) Microsoft Corporation. -(function (SpanKind) { - /** Default value. Indicates that the span is used internally. */ - SpanKind[SpanKind["INTERNAL"] = 0] = "INTERNAL"; - /** - * Indicates that the span covers server-side handling of an RPC or other - * remote request. - */ - SpanKind[SpanKind["SERVER"] = 1] = "SERVER"; - /** - * Indicates that the span covers the client-side wrapper around an RPC or - * other remote request. - */ - SpanKind[SpanKind["CLIENT"] = 2] = "CLIENT"; - /** - * Indicates that the span describes producer sending a message to a - * broker. Unlike client and server, there is no direct critical path latency - * relationship between producer and consumer spans. - */ - SpanKind[SpanKind["PRODUCER"] = 3] = "PRODUCER"; - /** - * Indicates that the span describes consumer receiving a message from a - * broker. Unlike client and server, there is no direct critical path latency - * relationship between producer and consumer spans. - */ - SpanKind[SpanKind["CONSUMER"] = 4] = "CONSUMER"; -})(exports.SpanKind || (exports.SpanKind = {})); /** - * Return the span if one exists - * - * @param context - context to get span from + * Advance to the character in text that is "step" characters ahead. If no step value is provided, + * then step will default to 1. */ -function getSpan(context) { - return api.getSpan(context); +function nextCharacter(tokenizer, step) { + if (hasCurrentCharacter(tokenizer)) { + if (!step) { + step = 1; + } + tokenizer._currentIndex += step; + } } /** - * Set the span on a context - * - * @param context - context to use as parent - * @param span - span to set active + * Starting with the current character, peek "charactersToPeek" number of characters ahead in this + * Tokenizer's stream of characters. */ -function setSpan(context, span) { - return api.setSpan(context, span); +function peekCharacters(tokenizer, charactersToPeek) { + var endIndex = tokenizer._currentIndex + charactersToPeek; + if (tokenizer._textLength < endIndex) { + endIndex = tokenizer._textLength; + } + return tokenizer._text.substring(tokenizer._currentIndex, endIndex); } /** - * Wrap span context in a NoopSpan and set as span in a new - * context - * - * @param context - context to set active span on - * @param spanContext - span context to be wrapped + * Read characters from this Tokenizer until the end of the stream or until the provided condition + * is false when provided the current character. */ -function setSpanContext(context, spanContext) { - return api.setSpanContext(context, spanContext); +function readWhile(tokenizer, condition) { + var result = ""; + while (hasCurrentCharacter(tokenizer)) { + var currentCharacter = getCurrentCharacter(tokenizer); + if (!condition(currentCharacter)) { + break; + } + else { + result += currentCharacter; + nextCharacter(tokenizer); + } + } + return result; } /** - * Get the span context of the span if it exists. - * - * @param context - context to get values from + * Read characters from this Tokenizer until a non-alphanumeric character or the end of the + * character stream is reached. */ -function getSpanContext(context) { - return api.getSpanContext(context); +function readWhileLetterOrDigit(tokenizer) { + return readWhile(tokenizer, function (character) { return isAlphaNumericCharacter(character); }); } -/** Entrypoint for context API */ -var context = api.context; -(function (SpanStatusCode) { - /** - * The default status. - */ - SpanStatusCode[SpanStatusCode["UNSET"] = 0] = "UNSET"; - /** - * The operation has been validated by an Application developer or - * Operator to have completed successfully. - */ - SpanStatusCode[SpanStatusCode["OK"] = 1] = "OK"; - /** - * The operation contains an error. - */ - SpanStatusCode[SpanStatusCode["ERROR"] = 2] = "ERROR"; -})(exports.SpanStatusCode || (exports.SpanStatusCode = {})); - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. /** - * @internal + * Read characters from this Tokenizer until one of the provided terminating characters is read or + * the end of the character stream is reached. */ -var OpenCensusTraceStateWrapper = /** @class */ (function () { - function OpenCensusTraceStateWrapper(state) { - this._state = state; +function readUntilCharacter(tokenizer) { + var terminatingCharacters = []; + for (var _i = 1; _i < arguments.length; _i++) { + terminatingCharacters[_i - 1] = arguments[_i]; + } + return readWhile(tokenizer, function (character) { return terminatingCharacters.indexOf(character) === -1; }); +} +function nextScheme(tokenizer) { + var scheme = readWhileLetterOrDigit(tokenizer); + tokenizer._currentToken = URLToken.scheme(scheme); + if (!hasCurrentCharacter(tokenizer)) { + tokenizer._currentState = "DONE"; + } + else { + tokenizer._currentState = "HOST"; + } +} +function nextSchemeOrHost(tokenizer) { + var schemeOrHost = readUntilCharacter(tokenizer, ":", "/", "?"); + if (!hasCurrentCharacter(tokenizer)) { + tokenizer._currentToken = URLToken.host(schemeOrHost); + tokenizer._currentState = "DONE"; + } + else if (getCurrentCharacter(tokenizer) === ":") { + if (peekCharacters(tokenizer, 3) === "://") { + tokenizer._currentToken = URLToken.scheme(schemeOrHost); + tokenizer._currentState = "HOST"; + } + else { + tokenizer._currentToken = URLToken.host(schemeOrHost); + tokenizer._currentState = "PORT"; + } + } + else { + tokenizer._currentToken = URLToken.host(schemeOrHost); + if (getCurrentCharacter(tokenizer) === "/") { + tokenizer._currentState = "PATH"; + } + else { + tokenizer._currentState = "QUERY"; + } + } +} +function nextHost(tokenizer) { + if (peekCharacters(tokenizer, 3) === "://") { + nextCharacter(tokenizer, 3); + } + var host = readUntilCharacter(tokenizer, ":", "/", "?"); + tokenizer._currentToken = URLToken.host(host); + if (!hasCurrentCharacter(tokenizer)) { + tokenizer._currentState = "DONE"; + } + else if (getCurrentCharacter(tokenizer) === ":") { + tokenizer._currentState = "PORT"; + } + else if (getCurrentCharacter(tokenizer) === "/") { + tokenizer._currentState = "PATH"; + } + else { + tokenizer._currentState = "QUERY"; + } +} +function nextPort(tokenizer) { + if (getCurrentCharacter(tokenizer) === ":") { + nextCharacter(tokenizer); + } + var port = readUntilCharacter(tokenizer, "/", "?"); + tokenizer._currentToken = URLToken.port(port); + if (!hasCurrentCharacter(tokenizer)) { + tokenizer._currentState = "DONE"; + } + else if (getCurrentCharacter(tokenizer) === "/") { + tokenizer._currentState = "PATH"; + } + else { + tokenizer._currentState = "QUERY"; } - OpenCensusTraceStateWrapper.prototype.get = function (_key) { - throw new Error("Method not implemented."); - }; - OpenCensusTraceStateWrapper.prototype.set = function (_key, _value) { - throw new Error("Method not implemented."); - }; - OpenCensusTraceStateWrapper.prototype.unset = function (_key) { - throw new Error("Method not implemented"); - }; - OpenCensusTraceStateWrapper.prototype.serialize = function () { - return this._state || ""; - }; - return OpenCensusTraceStateWrapper; -}()); - -// Copyright (c) Microsoft Corporation. -/** An enumeration of canonical status codes. */ -var CanonicalCode; -(function (CanonicalCode) { - /** - * Not an error; returned on success - */ - CanonicalCode[CanonicalCode["OK"] = 0] = "OK"; - /** - * Internal errors. Means some invariants expected by underlying - * system has been broken. If you see one of these errors, - * something is very broken. - */ - CanonicalCode[CanonicalCode["INTERNAL"] = 13] = "INTERNAL"; -})(CanonicalCode || (CanonicalCode = {})); -function isWrappedSpan(span) { - return !!span && span.getWrappedSpan !== undefined; } -function isTracer(tracerOrSpan) { - return tracerOrSpan.getWrappedTracer !== undefined; +function nextPath(tokenizer) { + var path = readUntilCharacter(tokenizer, "?"); + tokenizer._currentToken = URLToken.path(path); + if (!hasCurrentCharacter(tokenizer)) { + tokenizer._currentState = "DONE"; + } + else { + tokenizer._currentState = "QUERY"; + } } -/** - * An implementation of OpenTelemetry Span that wraps an OpenCensus Span. - */ -var OpenCensusSpanWrapper = /** @class */ (function () { - function OpenCensusSpanWrapper(tracerOrSpan, name, options, context$1) { - if (name === void 0) { name = ""; } - if (options === void 0) { options = {}; } - if (isTracer(tracerOrSpan)) { - var span = getSpan(context$1 !== null && context$1 !== void 0 ? context$1 : context.active()); - var parent = isWrappedSpan(span) ? span.getWrappedSpan() : undefined; - this._span = tracerOrSpan.getWrappedTracer().startChildSpan({ - name: name, - childOf: parent - }); - this._span.start(); - if (options.links) { - for (var _i = 0, _a = options.links; _i < _a.length; _i++) { - var link = _a[_i]; - // Since there is no way to set the link relationship, leave it as Unspecified. - this._span.addLink(link.context.traceId, link.context.spanId, 0 /* LinkType.UNSPECIFIED */, link.attributes); +function nextQuery(tokenizer) { + if (getCurrentCharacter(tokenizer) === "?") { + nextCharacter(tokenizer); + } + var query = readRemaining(tokenizer); + tokenizer._currentToken = URLToken.query(query); + tokenizer._currentState = "DONE"; +} + +// Copyright (c) Microsoft Corporation. +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" +]; +var defaultAllowedQueryParameters = ["api-version"]; +var Sanitizer = /** @class */ (function () { + function Sanitizer(_a) { + var _b = _a === void 0 ? {} : _a, _c = _b.allowedHeaderNames, allowedHeaderNames = _c === void 0 ? [] : _c, _d = _b.allowedQueryParameters, allowedQueryParameters = _d === void 0 ? [] : _d; + allowedHeaderNames = Array.isArray(allowedHeaderNames) + ? defaultAllowedHeaderNames.concat(allowedHeaderNames) + : defaultAllowedHeaderNames; + allowedQueryParameters = Array.isArray(allowedQueryParameters) + ? defaultAllowedQueryParameters.concat(allowedQueryParameters) + : defaultAllowedQueryParameters; + this.allowedHeaderNames = new Set(allowedHeaderNames.map(function (n) { return n.toLowerCase(); })); + this.allowedQueryParameters = new Set(allowedQueryParameters.map(function (p) { return p.toLowerCase(); })); + } + Sanitizer.prototype.sanitize = function (obj) { + var _this = this; + var seen = new Set(); + return JSON.stringify(obj, function (key, value) { + // Ensure Errors include their interesting non-enumerable members + if (value instanceof Error) { + return tslib.__assign(tslib.__assign({}, value), { name: value.name, message: value.message }); + } + if (key === "_headersMap") { + return _this.sanitizeHeaders(value); + } + else if (key === "url") { + return _this.sanitizeUrl(value); + } + else if (key === "query") { + return _this.sanitizeQuery(value); + } + else if (key === "body") { + // Don't log the request body + return undefined; + } + else if (key === "response") { + // Don't log response again + return undefined; + } + else if (key === "operationSpec") { + // When using sendOperationRequest, the request carries a massive + // field with the autorest spec. No need to log it. + return undefined; + } + else if (Array.isArray(value) || isObject(value)) { + if (seen.has(value)) { + return "[Circular]"; } + seen.add(value); } - } - else { - this._span = tracerOrSpan; - } - } - /** - * The underlying OpenCensus Span - */ - OpenCensusSpanWrapper.prototype.getWrappedSpan = function () { - return this._span; - }; - /** - * Marks the end of Span execution. - * @param endTime - The time to use as the Span's end time. Defaults to - * the current time. - */ - OpenCensusSpanWrapper.prototype.end = function (_endTime) { - this._span.end(); - }; - /** - * Returns the SpanContext associated with this Span. - */ - OpenCensusSpanWrapper.prototype.context = function () { - var openCensusSpanContext = this._span.spanContext; - return { - spanId: openCensusSpanContext.spanId, - traceId: openCensusSpanContext.traceId, - traceFlags: openCensusSpanContext.options, - traceState: new OpenCensusTraceStateWrapper(openCensusSpanContext.traceState) - }; - }; - /** - * Sets an attribute on the Span - * @param key - The attribute key - * @param value - The attribute value - */ - OpenCensusSpanWrapper.prototype.setAttribute = function (key, value) { - this._span.addAttribute(key, value); - return this; + return value; + }, 2); }; - /** - * Sets attributes on the Span - * @param attributes - The attributes to add - */ - OpenCensusSpanWrapper.prototype.setAttributes = function (attributes) { - this._span.attributes = attributes; - return this; + Sanitizer.prototype.sanitizeHeaders = function (value) { + return this.sanitizeObject(value, this.allowedHeaderNames, function (v, k) { return v[k].value; }); }; - /** - * Adds an event to the Span - * @param name - The name of the event - * @param attributes - The associated attributes to add for this event - */ - OpenCensusSpanWrapper.prototype.addEvent = function (_name, _attributes) { - throw new Error("Method not implemented."); + Sanitizer.prototype.sanitizeQuery = function (value) { + return this.sanitizeObject(value, this.allowedQueryParameters, function (v, k) { return v[k]; }); }; - /** - * Sets a status on the span. Overrides the default of SpanStatusCode.OK. - * @param status - The status to set. - */ - OpenCensusSpanWrapper.prototype.setStatus = function (status) { - switch (status.code) { - case exports.SpanStatusCode.ERROR: { - this._span.setStatus(CanonicalCode.INTERNAL, status.message); - break; - } - case exports.SpanStatusCode.OK: { - this._span.setStatus(CanonicalCode.OK, status.message); - break; + Sanitizer.prototype.sanitizeObject = function (value, allowedKeys, accessor) { + if (typeof value !== "object" || value === null) { + return value; + } + var sanitized = {}; + for (var _i = 0, _a = Object.keys(value); _i < _a.length; _i++) { + var k = _a[_i]; + if (allowedKeys.has(k.toLowerCase())) { + sanitized[k] = accessor(value, k); } - case exports.SpanStatusCode.UNSET: { - break; + else { + sanitized[k] = RedactedString; } } - return this; - }; - /** - * Updates the name of the Span - * @param name - The new Span name - */ - OpenCensusSpanWrapper.prototype.updateName = function (name) { - this._span.name = name; - return this; - }; - /** - * Returns whether this span will be recorded - */ - OpenCensusSpanWrapper.prototype.isRecording = function () { - // NoRecordSpans have an empty traceId - return !!this._span.traceId; + return sanitized; }; - /** - * Sets exception as a span event - * @param exception - the exception the only accepted values are string or Error - * @param time - the time to set as Span's event time. If not provided, - * use the current time. - */ - OpenCensusSpanWrapper.prototype.recordException = function (_exception, _time) { - throw new Error("Method not implemented"); + Sanitizer.prototype.sanitizeUrl = function (value) { + if (typeof value !== "string" || value === null) { + return value; + } + var urlBuilder = URLBuilder.parse(value); + var queryString = urlBuilder.getQuery(); + if (!queryString) { + return value; + } + var query = URLQuery.parse(queryString); + for (var _i = 0, _a = query.keys(); _i < _a.length; _i++) { + var k = _a[_i]; + if (!this.allowedQueryParameters.has(k.toLowerCase())) { + query.set(k, RedactedString); + } + } + urlBuilder.setQuery(query.toString()); + return urlBuilder.toString(); }; - return OpenCensusSpanWrapper; + return Sanitizer; }()); // Copyright (c) Microsoft Corporation. -/** - * An implementation of OpenTelemetry Tracer that wraps an OpenCensus Tracer. - */ -var OpenCensusTracerWrapper = /** @class */ (function () { - /** - * Create a new wrapper around a given OpenCensus Tracer. - * @param tracer - The OpenCensus Tracer to wrap. - */ - function OpenCensusTracerWrapper(tracer) { - this._tracer = tracer; +var errorSanitizer = new Sanitizer(); +var RestError = /** @class */ (function (_super) { + tslib.__extends(RestError, _super); + function RestError(message, code, statusCode, request, response) { + var _this = _super.call(this, message) || this; + _this.name = "RestError"; + _this.code = code; + _this.statusCode = statusCode; + _this.request = request; + _this.response = response; + Object.setPrototypeOf(_this, RestError.prototype); + return _this; } /** - * The wrapped OpenCensus Tracer - */ - OpenCensusTracerWrapper.prototype.getWrappedTracer = function () { - return this._tracer; - }; - /** - * Starts a new Span. - * @param name - The name of the span. - * @param options - The SpanOptions used during Span creation. - */ - OpenCensusTracerWrapper.prototype.startSpan = function (name, options) { - return new OpenCensusSpanWrapper(this, name, options); - }; - /** - * Returns the current Span from the current context, if available. + * Logging method for util.inspect in Node */ - OpenCensusTracerWrapper.prototype.getCurrentSpan = function () { - return undefined; + RestError.prototype[custom] = function () { + return "RestError: " + this.message + " \n " + errorSanitizer.sanitize(this); }; - /** - * Executes the given function within the context provided by a Span. - * @param _span - The span that provides the context. - * @param _fn - The function to be executed. - */ - OpenCensusTracerWrapper.prototype.withSpan = function (_span, _fn) { - throw new Error("Method not implemented."); + RestError.REQUEST_SEND_ERROR = "REQUEST_SEND_ERROR"; + RestError.PARSE_ERROR = "PARSE_ERROR"; + return RestError; +}(Error)); + +// Copyright (c) Microsoft Corporation. +var logger = logger$1.createClientLogger("core-http"); + +// Copyright (c) Microsoft Corporation. +var ReportTransform = /** @class */ (function (_super) { + tslib.__extends(ReportTransform, _super); + function ReportTransform(progressCallback) { + var _this = _super.call(this) || this; + _this.progressCallback = progressCallback; + _this.loadedBytes = 0; + return _this; + } + ReportTransform.prototype._transform = function (chunk, _encoding, callback) { + this.push(chunk); + this.loadedBytes += chunk.length; + this.progressCallback({ loadedBytes: this.loadedBytes }); + callback(undefined); }; - /** - * Bind a Span as the target's scope - * @param target - An object to bind the scope. - * @param _span - A specific Span to use. Otherwise, use the current one. - */ - OpenCensusTracerWrapper.prototype.bind = function (_target, _span) { - throw new Error("Method not implemented."); + return ReportTransform; +}(stream.Transform)); +var FetchHttpClient = /** @class */ (function () { + function FetchHttpClient() { + } + FetchHttpClient.prototype.sendRequest = function (httpRequest) { + var _a; + return tslib.__awaiter(this, void 0, void 0, function () { + var abortController$1, abortListener, formData, requestForm_1, appendFormValue, _i, _b, formKey, formValue, j, contentType, body, onUploadProgress, uploadReportStream, platformSpecificRequestInit, requestInit, operationResponse, response, headers, streaming, _c, onDownloadProgress, responseBody, downloadReportStream, length_1, error_1, fetchError, uploadStreamDone, downloadStreamDone; + var _d; + return tslib.__generator(this, function (_e) { + switch (_e.label) { + case 0: + if (!httpRequest && typeof httpRequest !== "object") { + throw new Error("'httpRequest' (WebResourceLike) cannot be null or undefined and must be of type object."); + } + abortController$1 = new abortController.AbortController(); + if (httpRequest.abortSignal) { + if (httpRequest.abortSignal.aborted) { + throw new abortController.AbortError("The operation was aborted."); + } + abortListener = function (event) { + if (event.type === "abort") { + abortController$1.abort(); + } + }; + httpRequest.abortSignal.addEventListener("abort", abortListener); + } + if (httpRequest.timeout) { + setTimeout(function () { + abortController$1.abort(); + }, httpRequest.timeout); + } + if (httpRequest.formData) { + formData = httpRequest.formData; + requestForm_1 = new FormData(); + appendFormValue = function (key, value) { + // value function probably returns a stream so we can provide a fresh stream on each retry + if (typeof value === "function") { + value = value(); + } + if (value && + Object.prototype.hasOwnProperty.call(value, "value") && + Object.prototype.hasOwnProperty.call(value, "options")) { + requestForm_1.append(key, value.value, value.options); + } + else { + requestForm_1.append(key, value); + } + }; + for (_i = 0, _b = Object.keys(formData); _i < _b.length; _i++) { + formKey = _b[_i]; + formValue = formData[formKey]; + if (Array.isArray(formValue)) { + for (j = 0; j < formValue.length; j++) { + appendFormValue(formKey, formValue[j]); + } + } + else { + appendFormValue(formKey, formValue); + } + } + httpRequest.body = requestForm_1; + httpRequest.formData = undefined; + contentType = httpRequest.headers.get("Content-Type"); + if (contentType && contentType.indexOf("multipart/form-data") !== -1) { + if (typeof requestForm_1.getBoundary === "function") { + httpRequest.headers.set("Content-Type", "multipart/form-data; boundary=" + requestForm_1.getBoundary()); + } + else { + // browser will automatically apply a suitable content-type header + httpRequest.headers.remove("Content-Type"); + } + } + } + body = httpRequest.body + ? typeof httpRequest.body === "function" + ? httpRequest.body() + : httpRequest.body + : undefined; + if (httpRequest.onUploadProgress && httpRequest.body) { + onUploadProgress = httpRequest.onUploadProgress; + uploadReportStream = new ReportTransform(onUploadProgress); + if (isReadableStream(body)) { + body.pipe(uploadReportStream); + } + else { + uploadReportStream.end(body); + } + body = uploadReportStream; + } + return [4 /*yield*/, this.prepareRequest(httpRequest)]; + case 1: + platformSpecificRequestInit = _e.sent(); + requestInit = tslib.__assign({ body: body, headers: httpRequest.headers.rawHeaders(), method: httpRequest.method, signal: abortController$1.signal, redirect: "manual" }, platformSpecificRequestInit); + _e.label = 2; + case 2: + _e.trys.push([2, 8, 9, 10]); + return [4 /*yield*/, this.fetch(httpRequest.url, requestInit)]; + case 3: + response = _e.sent(); + headers = parseHeaders(response.headers); + streaming = ((_a = httpRequest.streamResponseStatusCodes) === null || _a === void 0 ? void 0 : _a.has(response.status)) || + httpRequest.streamResponseBody; + _d = { + headers: headers, + request: httpRequest, + status: response.status, + readableStreamBody: streaming + ? response.body + : undefined + }; + if (!!streaming) return [3 /*break*/, 5]; + return [4 /*yield*/, response.text()]; + case 4: + _c = _e.sent(); + return [3 /*break*/, 6]; + case 5: + _c = undefined; + _e.label = 6; + case 6: + operationResponse = (_d.bodyAsText = _c, + _d); + onDownloadProgress = httpRequest.onDownloadProgress; + if (onDownloadProgress) { + responseBody = response.body || undefined; + if (isReadableStream(responseBody)) { + downloadReportStream = new ReportTransform(onDownloadProgress); + responseBody.pipe(downloadReportStream); + operationResponse.readableStreamBody = downloadReportStream; + } + else { + length_1 = parseInt(headers.get("Content-Length")) || undefined; + if (length_1) { + // Calling callback for non-stream response for consistency with browser + onDownloadProgress({ loadedBytes: length_1 }); + } + } + } + return [4 /*yield*/, this.processRequest(operationResponse)]; + case 7: + _e.sent(); + return [2 /*return*/, operationResponse]; + case 8: + error_1 = _e.sent(); + fetchError = error_1; + if (fetchError.code === "ENOTFOUND") { + throw new RestError(fetchError.message, RestError.REQUEST_SEND_ERROR, undefined, httpRequest); + } + else if (fetchError.type === "aborted") { + throw new abortController.AbortError("The operation was aborted."); + } + throw fetchError; + case 9: + // clean up event listener + if (httpRequest.abortSignal && abortListener) { + uploadStreamDone = Promise.resolve(); + if (isReadableStream(body)) { + uploadStreamDone = isStreamComplete(body); + } + downloadStreamDone = Promise.resolve(); + if (isReadableStream(operationResponse === null || operationResponse === void 0 ? void 0 : operationResponse.readableStreamBody)) { + downloadStreamDone = isStreamComplete(operationResponse.readableStreamBody); + } + Promise.all([uploadStreamDone, downloadStreamDone]) + .then(function () { + var _a; + (_a = httpRequest.abortSignal) === null || _a === void 0 ? void 0 : _a.removeEventListener("abort", abortListener); + return; + }) + .catch(function (e) { + logger.warning("Error when cleaning up abortListener on httpRequest", e); + }); + } + return [7 /*endfinally*/]; + case 10: return [2 /*return*/]; + } + }); + }); }; - return OpenCensusTracerWrapper; + return FetchHttpClient; }()); +function isReadableStream(body) { + return body && typeof body.pipe === "function"; +} +function isStreamComplete(stream) { + return new Promise(function (resolve) { + stream.on("close", resolve); + stream.on("end", resolve); + stream.on("error", resolve); + }); +} +function parseHeaders(headers) { + var httpHeaders = new HttpHeaders(); + headers.forEach(function (value, key) { + httpHeaders.set(key, value); + }); + return httpHeaders; +} // Copyright (c) Microsoft Corporation. -/** - * A mock span useful for testing. - */ -var TestSpan = /** @class */ (function (_super) { - tslib.__extends(TestSpan, _super); - /** - * Starts a new Span. - * @param parentTracer- The tracer that created this Span - * @param name - The name of the span. - * @param context - The SpanContext this span belongs to - * @param kind - The SpanKind of this Span - * @param parentSpanId - The identifier of the parent Span - * @param startTime - The startTime of the event (defaults to now) - */ - function TestSpan(parentTracer, name, context, kind, parentSpanId, startTime) { - if (startTime === void 0) { startTime = Date.now(); } - var _this = _super.call(this) || this; - _this._tracer = parentTracer; - _this.name = name; - _this.kind = kind; - _this.startTime = startTime; - _this.parentSpanId = parentSpanId; - _this.status = { - code: exports.SpanStatusCode.OK - }; - _this.endCalled = false; - _this._context = context; - _this.attributes = {}; - return _this; +function createProxyAgent(requestUrl, proxySettings, headers) { + var host = URLBuilder.parse(proxySettings.host).getHost(); + if (!host) { + throw new Error("Expecting a non-empty host in proxy settings."); } - /** - * Returns the Tracer that created this Span - */ - TestSpan.prototype.tracer = function () { - return this._tracer; - }; - /** - * Returns the SpanContext associated with this Span. - */ - TestSpan.prototype.context = function () { - return this._context; - }; - /** - * Marks the end of Span execution. - * @param _endTime - The time to use as the Span's end time. Defaults to - * the current time. - */ - TestSpan.prototype.end = function (_endTime) { - this.endCalled = true; - }; - /** - * Sets a status on the span. Overrides the default of SpanStatusCode.OK. - * @param status - The status to set. - */ - TestSpan.prototype.setStatus = function (status) { - this.status = status; - return this; - }; - /** - * Returns whether this span will be recorded - */ - TestSpan.prototype.isRecording = function () { - return true; - }; - /** - * Sets an attribute on the Span - * @param key - The attribute key - * @param value - The attribute value - */ - TestSpan.prototype.setAttribute = function (key, value) { - this.attributes[key] = value; - return this; - }; - /** - * Sets attributes on the Span - * @param attributes - The attributes to add - */ - TestSpan.prototype.setAttributes = function (attributes) { - for (var _i = 0, _a = Object.keys(attributes); _i < _a.length; _i++) { - var key = _a[_i]; - this.attributes[key] = attributes[key]; + if (!isValidPort(proxySettings.port)) { + throw new Error("Expecting a valid port number in the range of [0, 65535] in proxy settings."); + } + var tunnelOptions = { + proxy: { + host: host, + port: proxySettings.port, + headers: (headers && headers.rawHeaders()) || {} } - return this; }; - return TestSpan; -}(NoOpSpan)); + if (proxySettings.username && proxySettings.password) { + tunnelOptions.proxy.proxyAuth = proxySettings.username + ":" + proxySettings.password; + } + var isRequestHttps = isUrlHttps(requestUrl); + var isProxyHttps = isUrlHttps(proxySettings.host); + var proxyAgent = { + isHttps: isRequestHttps, + agent: createTunnel(isRequestHttps, isProxyHttps, tunnelOptions) + }; + return proxyAgent; +} +function isUrlHttps(url) { + var urlScheme = URLBuilder.parse(url).getScheme() || ""; + return urlScheme.toLowerCase() === "https"; +} +function createTunnel(isRequestHttps, isProxyHttps, tunnelOptions) { + if (isRequestHttps && isProxyHttps) { + return tunnel.httpsOverHttps(tunnelOptions); + } + else if (isRequestHttps && !isProxyHttps) { + return tunnel.httpsOverHttp(tunnelOptions); + } + else if (!isRequestHttps && isProxyHttps) { + return tunnel.httpOverHttps(tunnelOptions); + } + else { + return tunnel.httpOverHttp(tunnelOptions); + } +} +function isValidPort(port) { + // any port in 0-65535 range is valid (RFC 793) even though almost all implementations + // will reserve 0 for a specific purpose, and a range of numbers for ephemeral ports + return 0 <= port && port <= 65535; +} // Copyright (c) Microsoft Corporation. -/** - * A mock tracer useful for testing - */ -var TestTracer = /** @class */ (function (_super) { - tslib.__extends(TestTracer, _super); - function TestTracer() { +function getCachedAgent(isHttps, agentCache) { + return isHttps ? agentCache.httpsAgent : agentCache.httpAgent; +} +var NodeFetchHttpClient = /** @class */ (function (_super) { + tslib.__extends(NodeFetchHttpClient, _super); + function NodeFetchHttpClient() { var _this = _super !== null && _super.apply(this, arguments) || this; - _this.traceIdCounter = 0; - _this.spanIdCounter = 0; - _this.rootSpans = []; - _this.knownSpans = []; + _this.proxyAgents = {}; + _this.keepAliveAgents = {}; + _this.cookieJar = new tough.CookieJar(undefined, { looseMode: true }); return _this; } - TestTracer.prototype.getNextTraceId = function () { - this.traceIdCounter++; - return String(this.traceIdCounter); - }; - TestTracer.prototype.getNextSpanId = function () { - this.spanIdCounter++; - return String(this.spanIdCounter); - }; - /** - * Returns all Spans that were created without a parent - */ - TestTracer.prototype.getRootSpans = function () { - return this.rootSpans; - }; - /** - * Returns all Spans this Tracer knows about - */ - TestTracer.prototype.getKnownSpans = function () { - return this.knownSpans; - }; - /** - * Returns all Spans where end() has not been called - */ - TestTracer.prototype.getActiveSpans = function () { - return this.knownSpans.filter(function (span) { - return !span.endCalled; - }); - }; - /** - * Return all Spans for a particular trace, grouped by their - * parent Span in a tree-like structure - * @param traceId - The traceId to return the graph for - */ - TestTracer.prototype.getSpanGraph = function (traceId) { - var traceSpans = this.knownSpans.filter(function (span) { - return span.context().traceId === traceId; - }); - var roots = []; - var nodeMap = new Map(); - for (var _i = 0, traceSpans_1 = traceSpans; _i < traceSpans_1.length; _i++) { - var span = traceSpans_1[_i]; - var spanId = span.context().spanId; - var node = { - name: span.name, - children: [] - }; - nodeMap.set(spanId, node); - if (span.parentSpanId) { - var parent = nodeMap.get(span.parentSpanId); - if (!parent) { - throw new Error("Span with name " + node.name + " has an unknown parentSpan with id " + span.parentSpanId); - } - parent.children.push(node); + NodeFetchHttpClient.prototype.getOrCreateAgent = function (httpRequest) { + var isHttps = isUrlHttps(httpRequest.url); + // At the moment, proxy settings and keepAlive are mutually + // exclusive because the 'tunnel' library currently lacks the + // ability to create a proxy with keepAlive turned on. + if (httpRequest.proxySettings) { + var agent = getCachedAgent(isHttps, this.proxyAgents); + if (agent) { + return agent; + } + var tunnel = createProxyAgent(httpRequest.url, httpRequest.proxySettings, httpRequest.headers); + agent = tunnel.agent; + if (tunnel.isHttps) { + this.proxyAgents.httpsAgent = tunnel.agent; } else { - roots.push(node); + this.proxyAgents.httpAgent = tunnel.agent; } + return agent; } - return { - roots: roots - }; - }; - /** - * Starts a new Span. - * @param name - The name of the span. - * @param options - The SpanOptions used during Span creation. - */ - TestTracer.prototype.startSpan = function (name, options, context$1) { - var parentContext = getSpanContext(context$1 || context.active()); - var traceId; - var isRootSpan = false; - if (parentContext && parentContext.traceId) { - traceId = parentContext.traceId; + else if (httpRequest.keepAlive) { + var agent = getCachedAgent(isHttps, this.keepAliveAgents); + if (agent) { + return agent; + } + var agentOptions = { + keepAlive: httpRequest.keepAlive + }; + if (isHttps) { + agent = this.keepAliveAgents.httpsAgent = new https.Agent(agentOptions); + } + else { + agent = this.keepAliveAgents.httpAgent = new http.Agent(agentOptions); + } + return agent; } else { - traceId = this.getNextTraceId(); - isRootSpan = true; - } - var spanContext = { - traceId: traceId, - spanId: this.getNextSpanId(), - traceFlags: 0 /* NONE */ - }; - var span = new TestSpan(this, name, spanContext, (options === null || options === void 0 ? void 0 : options.kind) || exports.SpanKind.INTERNAL, parentContext ? parentContext.spanId : undefined, options === null || options === void 0 ? void 0 : options.startTime); - this.knownSpans.push(span); - if (isRootSpan) { - this.rootSpans.push(span); + return isHttps ? https.globalAgent : http.globalAgent; } - return span; }; - return TestTracer; -}(NoOpTracer)); - -// Copyright (c) Microsoft Corporation. -/** - * Creates a function that can be used to create spans using the global tracer. - * - * Usage: - * - * ```typescript - * // once - * const createSpan = createSpanFunction({ packagePrefix: "Azure.Data.AppConfiguration", namespace: "Microsoft.AppConfiguration" }); - * - * // in each operation - * const span = createSpan("deleteConfigurationSetting", operationOptions); - * // code... - * span.end(); - * ``` - * - * @hidden - * @param args - allows configuration of the prefix for each span as well as the az.namespace field. - */ -function createSpanFunction(args) { - return function (operationName, operationOptions) { - var tracer = getTracer(); - var tracingOptions = (operationOptions === null || operationOptions === void 0 ? void 0 : operationOptions.tracingOptions) || {}; - var spanOptions = tslib.__assign({ kind: exports.SpanKind.INTERNAL }, tracingOptions.spanOptions); - var spanName = args.packagePrefix ? args.packagePrefix + "." + operationName : operationName; - var span = tracer.startSpan(spanName, spanOptions, tracingOptions.tracingContext); - if (args.namespace) { - span.setAttribute("az.namespace", args.namespace); - } - var newSpanOptions = tracingOptions.spanOptions || {}; - if (span.isRecording() && args.namespace) { - newSpanOptions = tslib.__assign(tslib.__assign({}, tracingOptions.spanOptions), { attributes: tslib.__assign(tslib.__assign({}, spanOptions.attributes), { "az.namespace": args.namespace }) }); - } - var newTracingOptions = tslib.__assign(tslib.__assign({}, tracingOptions), { spanOptions: newSpanOptions, tracingContext: setSpan(tracingOptions.tracingContext || context.active(), span) }); - var newOperationOptions = tslib.__assign(tslib.__assign({}, operationOptions), { tracingOptions: newTracingOptions }); - return { - span: span, - updatedOptions: newOperationOptions - }; + // eslint-disable-next-line @azure/azure-sdk/ts-apisurface-standardized-verbs + NodeFetchHttpClient.prototype.fetch = function (input, init) { + return tslib.__awaiter(this, void 0, void 0, function () { + return tslib.__generator(this, function (_a) { + return [2 /*return*/, node_fetch(input, init)]; + }); + }); }; -} - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -var VERSION = "00"; -/** - * Generates a `SpanContext` given a `traceparent` header value. - * @param traceParent - Serialized span context data as a `traceparent` header value. - * @returns The `SpanContext` generated from the `traceparent` value. - */ -function extractSpanContextFromTraceParentHeader(traceParentHeader) { - var parts = traceParentHeader.split("-"); - if (parts.length !== 4) { - return; - } - var version = parts[0], traceId = parts[1], spanId = parts[2], traceOptions = parts[3]; - if (version !== VERSION) { - return; - } - var traceFlags = parseInt(traceOptions, 16); - var spanContext = { - spanId: spanId, - traceId: traceId, - traceFlags: traceFlags + NodeFetchHttpClient.prototype.prepareRequest = function (httpRequest) { + return tslib.__awaiter(this, void 0, void 0, function () { + var requestInit, cookieString; + var _this = this; + return tslib.__generator(this, function (_a) { + switch (_a.label) { + case 0: + requestInit = {}; + if (!(this.cookieJar && !httpRequest.headers.get("Cookie"))) return [3 /*break*/, 2]; + return [4 /*yield*/, new Promise(function (resolve, reject) { + _this.cookieJar.getCookieString(httpRequest.url, function (err, cookie) { + if (err) { + reject(err); + } + else { + resolve(cookie); + } + }); + })]; + case 1: + cookieString = _a.sent(); + httpRequest.headers.set("Cookie", cookieString); + _a.label = 2; + case 2: + // Set the http(s) agent + requestInit.agent = this.getOrCreateAgent(httpRequest); + requestInit.compress = httpRequest.decompressResponse; + return [2 /*return*/, requestInit]; + } + }); + }); }; - return spanContext; -} -/** - * Generates a `traceparent` value given a span context. - * @param spanContext - Contains context for a specific span. - * @returns The `spanContext` represented as a `traceparent` value. - */ -function getTraceParentHeader(spanContext) { - var missingFields = []; - if (!spanContext.traceId) { - missingFields.push("traceId"); - } - if (!spanContext.spanId) { - missingFields.push("spanId"); - } - if (missingFields.length) { - return; - } - var flags = spanContext.traceFlags || 0 /* NONE */; - var hexFlags = flags.toString(16); - var traceFlags = hexFlags.length === 1 ? "0" + hexFlags : hexFlags; - // https://www.w3.org/TR/trace-context/#traceparent-header-field-values - return VERSION + "-" + spanContext.traceId + "-" + spanContext.spanId + "-" + traceFlags; -} - -exports.NoOpSpan = NoOpSpan; -exports.NoOpTracer = NoOpTracer; -exports.OpenCensusSpanWrapper = OpenCensusSpanWrapper; -exports.OpenCensusTracerWrapper = OpenCensusTracerWrapper; -exports.TestSpan = TestSpan; -exports.TestTracer = TestTracer; -exports.context = context; -exports.createSpanFunction = createSpanFunction; -exports.extractSpanContextFromTraceParentHeader = extractSpanContextFromTraceParentHeader; -exports.getSpan = getSpan; -exports.getSpanContext = getSpanContext; -exports.getTraceParentHeader = getTraceParentHeader; -exports.getTracer = getTracer; -exports.setSpan = setSpan; -exports.setSpanContext = setSpanContext; -exports.setTracer = setTracer; -//# sourceMappingURL=index.js.map - - -/***/ }), - -/***/ 7407: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var __spreadArrays = (this && this.__spreadArrays) || function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ContextAPI = void 0; -var NoopContextManager_1 = __nccwpck_require__(469); -var global_utils_1 = __nccwpck_require__(6965); -var API_NAME = 'context'; -var NOOP_CONTEXT_MANAGER = new NoopContextManager_1.NoopContextManager(); -/** - * Singleton object which represents the entry point to the OpenTelemetry Context API - */ -var ContextAPI = /** @class */ (function () { - /** Empty private constructor prevents end users from constructing a new instance of the API */ - function ContextAPI() { - } - /** Get the singleton instance of the Context API */ - ContextAPI.getInstance = function () { - if (!this._instance) { - this._instance = new ContextAPI(); - } - return this._instance; + NodeFetchHttpClient.prototype.processRequest = function (operationResponse) { + return tslib.__awaiter(this, void 0, void 0, function () { + var setCookieHeader_1; + var _this = this; + return tslib.__generator(this, function (_a) { + switch (_a.label) { + case 0: + if (!this.cookieJar) return [3 /*break*/, 2]; + setCookieHeader_1 = operationResponse.headers.get("Set-Cookie"); + if (!(setCookieHeader_1 !== undefined)) return [3 /*break*/, 2]; + return [4 /*yield*/, new Promise(function (resolve, reject) { + _this.cookieJar.setCookie(setCookieHeader_1, operationResponse.request.url, { ignoreError: true }, function (err) { + if (err) { + reject(err); + } + else { + resolve(); + } + }); + })]; + case 1: + _a.sent(); + _a.label = 2; + case 2: return [2 /*return*/]; + } + }); + }); }; + return NodeFetchHttpClient; +}(FetchHttpClient)); + +// Copyright (c) Microsoft Corporation. +(function (HttpPipelineLogLevel) { /** - * Set the current context manager. Returns the initialized context manager + * A log level that indicates that no logs will be logged. */ - ContextAPI.prototype.setGlobalContextManager = function (contextManager) { - global_utils_1.registerGlobal(API_NAME, contextManager); - return contextManager; - }; + HttpPipelineLogLevel[HttpPipelineLogLevel["OFF"] = 0] = "OFF"; /** - * Get the currently active context + * An error log. */ - ContextAPI.prototype.active = function () { - return this._getContextManager().active(); - }; + HttpPipelineLogLevel[HttpPipelineLogLevel["ERROR"] = 1] = "ERROR"; /** - * Execute a function with an active context - * - * @param context context to be active during function execution - * @param fn function to execute in a context - * @param thisArg optional receiver to be used for calling fn - * @param args optional arguments forwarded to fn + * A warning log. */ - ContextAPI.prototype.with = function (context, fn, thisArg) { - var _a; - var args = []; - for (var _i = 3; _i < arguments.length; _i++) { - args[_i - 3] = arguments[_i]; - } - return (_a = this._getContextManager()).with.apply(_a, __spreadArrays([context, fn, thisArg], args)); - }; + HttpPipelineLogLevel[HttpPipelineLogLevel["WARNING"] = 2] = "WARNING"; /** - * Bind a context to a target function or event emitter - * - * @param target function or event emitter to bind - * @param context context to bind to the event emitter or function. Defaults to the currently active context + * An information log. */ - ContextAPI.prototype.bind = function (target, context) { - if (context === void 0) { context = this.active(); } - return this._getContextManager().bind(target, context); - }; - ContextAPI.prototype._getContextManager = function () { - return global_utils_1.getGlobal(API_NAME) || NOOP_CONTEXT_MANAGER; - }; - /** Disable and remove the global context manager */ - ContextAPI.prototype.disable = function () { - this._getContextManager().disable(); - global_utils_1.unregisterGlobal(API_NAME); - }; - return ContextAPI; -}()); -exports.ContextAPI = ContextAPI; -//# sourceMappingURL=context.js.map - -/***/ }), - -/***/ 4658: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; + HttpPipelineLogLevel[HttpPipelineLogLevel["INFO"] = 3] = "INFO"; +})(exports.HttpPipelineLogLevel || (exports.HttpPipelineLogLevel = {})); -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DiagAPI = void 0; -var logLevelLogger_1 = __nccwpck_require__(6430); -var types_1 = __nccwpck_require__(2339); -var global_utils_1 = __nccwpck_require__(6965); -var API_NAME = 'diag'; /** - * Singleton object which represents the entry point to the OpenTelemetry internal - * diagnostic API + * Converts an OperationOptions to a RequestOptionsBase + * + * @param opts - OperationOptions object to convert to RequestOptionsBase */ -var DiagAPI = /** @class */ (function () { - /** - * Private internal constructor - * @private - */ - function DiagAPI() { - function _logProxy(funcName) { - return function () { - var logger = global_utils_1.getGlobal('diag'); - // shortcut if logger not set - if (!logger) - return; - return logger[funcName].apply(logger, - // work around Function.prototype.apply types - // eslint-disable-next-line @typescript-eslint/no-explicit-any - arguments); - }; - } - // Using self local variable for minification purposes as 'this' cannot be minified - var self = this; - // DiagAPI specific functions - self.setLogger = function (logger, logLevel) { - var _a; - if (logLevel === void 0) { logLevel = types_1.DiagLogLevel.INFO; } - if (logger === self) { - // There isn't much we can do here. - // Logging to the console might break the user application. - // Try to log to self. If a logger was previously registered it will receive the log. - var err = new Error('Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation'); - self.error((_a = err.stack) !== null && _a !== void 0 ? _a : err.message); - return; - } - global_utils_1.registerGlobal('diag', logLevelLogger_1.createLogLevelDiagLogger(logLevel, logger), true); - }; - self.disable = function () { - global_utils_1.unregisterGlobal(API_NAME); - }; - self.verbose = _logProxy('verbose'); - self.debug = _logProxy('debug'); - self.info = _logProxy('info'); - self.warn = _logProxy('warn'); - self.error = _logProxy('error'); +function operationOptionsToRequestOptionsBase(opts) { + var requestOptions = opts.requestOptions, tracingOptions = opts.tracingOptions, additionalOptions = tslib.__rest(opts, ["requestOptions", "tracingOptions"]); + var result = additionalOptions; + if (requestOptions) { + result = tslib.__assign(tslib.__assign({}, result), requestOptions); } - /** Get the singleton instance of the DiagAPI API */ - DiagAPI.instance = function () { - if (!this._instance) { - this._instance = new DiagAPI(); - } - return this._instance; - }; - return DiagAPI; -}()); -exports.DiagAPI = DiagAPI; -//# sourceMappingURL=diag.js.map - -/***/ }), - -/***/ 9362: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; + if (tracingOptions) { + result.spanOptions = tracingOptions.spanOptions; + result.tracingContext = tracingOptions.tracingContext; + } + return result; +} -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PropagationAPI = void 0; -var NoopTextMapPropagator_1 = __nccwpck_require__(3848); -var TextMapPropagator_1 = __nccwpck_require__(9017); -var global_utils_1 = __nccwpck_require__(6965); -var API_NAME = 'propagation'; -/** - * Singleton object which represents the entry point to the OpenTelemetry Propagation API - */ -var PropagationAPI = /** @class */ (function () { - /** Empty private constructor prevents end users from constructing a new instance of the API */ - function PropagationAPI() { +// Copyright (c) Microsoft Corporation. +var BaseRequestPolicy = /** @class */ (function () { + function BaseRequestPolicy(_nextPolicy, _options) { + this._nextPolicy = _nextPolicy; + this._options = _options; } - /** Get the singleton instance of the Propagator API */ - PropagationAPI.getInstance = function () { - if (!this._instance) { - this._instance = new PropagationAPI(); - } - return this._instance; - }; /** - * Set the current propagator. Returns the initialized propagator + * 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. */ - PropagationAPI.prototype.setGlobalPropagator = function (propagator) { - global_utils_1.registerGlobal(API_NAME, propagator); - return propagator; + BaseRequestPolicy.prototype.shouldLog = function (logLevel) { + return this._options.shouldLog(logLevel); }; /** - * Inject context into a carrier to be propagated inter-process - * - * @param context Context carrying tracing data to inject - * @param carrier carrier to inject context into - * @param setter Function used to set values on the carrier + * 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. */ - PropagationAPI.prototype.inject = function (context, carrier, setter) { - if (setter === void 0) { setter = TextMapPropagator_1.defaultTextMapSetter; } - return this._getGlobalPropagator().inject(context, carrier, setter); + BaseRequestPolicy.prototype.log = function (logLevel, message) { + this._options.log(logLevel, message); }; + return BaseRequestPolicy; +}()); +/** + * Optional properties that can be used when creating a RequestPolicy. + */ +var RequestPolicyOptions = /** @class */ (function () { + function RequestPolicyOptions(_logger) { + this._logger = _logger; + } /** - * Extract context from a carrier - * - * @param context Context which the newly created context will inherit from - * @param carrier Carrier to extract context from - * @param getter Function used to extract keys from a carrier + * 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. */ - PropagationAPI.prototype.extract = function (context, carrier, getter) { - if (getter === void 0) { getter = TextMapPropagator_1.defaultTextMapGetter; } - return this._getGlobalPropagator().extract(context, carrier, getter); + RequestPolicyOptions.prototype.shouldLog = function (logLevel) { + return (!!this._logger && + logLevel !== exports.HttpPipelineLogLevel.OFF && + logLevel <= this._logger.minimumLogLevel); }; /** - * Return a list of all fields which may be used by the propagator. + * Attempt to log the provided message to the provided logger. If no logger was provided or if + * the log level does not meet the logger's threshold, then nothing will be logged. + * @param logLevel - The log level of this log. + * @param message - The message of this log. */ - PropagationAPI.prototype.fields = function () { - return this._getGlobalPropagator().fields(); + RequestPolicyOptions.prototype.log = function (logLevel, message) { + if (this._logger && this.shouldLog(logLevel)) { + this._logger.log(logLevel, message); + } }; - /** Remove the global propagator */ - PropagationAPI.prototype.disable = function () { - global_utils_1.unregisterGlobal(API_NAME); + return RequestPolicyOptions; +}()); + +// Copyright (c) Microsoft Corporation. +function logPolicy(loggingOptions) { + if (loggingOptions === void 0) { loggingOptions = {}; } + return { + create: function (nextPolicy, options) { + return new LogPolicy(nextPolicy, options, loggingOptions); + } }; - PropagationAPI.prototype._getGlobalPropagator = function () { - return global_utils_1.getGlobal(API_NAME) || NoopTextMapPropagator_1.NOOP_TEXT_MAP_PROPAGATOR; +} +var LogPolicy = /** @class */ (function (_super) { + tslib.__extends(LogPolicy, _super); + function LogPolicy(nextPolicy, options, _a) { + var _b = _a === void 0 ? {} : _a, _c = _b.logger, logger$1 = _c === void 0 ? logger.info : _c, _d = _b.allowedHeaderNames, allowedHeaderNames = _d === void 0 ? [] : _d, _e = _b.allowedQueryParameters, allowedQueryParameters = _e === void 0 ? [] : _e; + var _this = _super.call(this, nextPolicy, options) || this; + _this.logger = logger$1; + _this.sanitizer = new Sanitizer({ allowedHeaderNames: allowedHeaderNames, allowedQueryParameters: allowedQueryParameters }); + return _this; + } + Object.defineProperty(LogPolicy.prototype, "allowedHeaderNames", { + /** + * Header names whose values will be logged when logging is enabled. Defaults to + * Date, traceparent, x-ms-client-request-id, and x-ms-request id. Any headers + * specified in this field will be added to that list. Any other values will + * be written to logs as "REDACTED". + * @deprecated Pass these into the constructor instead. + */ + get: function () { + return this.sanitizer.allowedHeaderNames; + }, + /** + * Header names whose values will be logged when logging is enabled. Defaults to + * Date, traceparent, x-ms-client-request-id, and x-ms-request id. Any headers + * specified in this field will be added to that list. Any other values will + * be written to logs as "REDACTED". + * @deprecated Pass these into the constructor instead. + */ + set: function (allowedHeaderNames) { + this.sanitizer.allowedHeaderNames = allowedHeaderNames; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(LogPolicy.prototype, "allowedQueryParameters", { + /** + * Query string names whose values will be logged when logging is enabled. By default no + * query string values are logged. + * @deprecated Pass these into the constructor instead. + */ + get: function () { + return this.sanitizer.allowedQueryParameters; + }, + /** + * Query string names whose values will be logged when logging is enabled. By default no + * query string values are logged. + * @deprecated Pass these into the constructor instead. + */ + set: function (allowedQueryParameters) { + this.sanitizer.allowedQueryParameters = allowedQueryParameters; + }, + enumerable: false, + configurable: true + }); + LogPolicy.prototype.sendRequest = function (request) { + var _this = this; + if (!this.logger.enabled) + return this._nextPolicy.sendRequest(request); + this.logRequest(request); + return this._nextPolicy.sendRequest(request).then(function (response) { return _this.logResponse(response); }); }; - return PropagationAPI; -}()); -exports.PropagationAPI = PropagationAPI; -//# sourceMappingURL=propagation.js.map + LogPolicy.prototype.logRequest = function (request) { + this.logger("Request: " + this.sanitizer.sanitize(request)); + }; + LogPolicy.prototype.logResponse = function (response) { + this.logger("Response status code: " + response.status); + this.logger("Headers: " + this.sanitizer.sanitize(response.headers)); + return response; + }; + return LogPolicy; +}(BaseRequestPolicy)); -/***/ }), +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +/** + * Get the path to this parameter's value as a dotted string (a.b.c). + * @param parameter - The parameter to get the path string for. + * @returns The path to this parameter's value as a dotted string. + */ +function getPathStringFromParameter(parameter) { + return getPathStringFromParameterPath(parameter.parameterPath, parameter.mapper); +} +function getPathStringFromParameterPath(parameterPath, mapper) { + var result; + if (typeof parameterPath === "string") { + result = parameterPath; + } + else if (Array.isArray(parameterPath)) { + result = parameterPath.join("."); + } + else { + result = mapper.serializedName; + } + return result; +} -/***/ 9857: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +// Copyright (c) Microsoft Corporation. +/** + * Gets the list of status codes for streaming responses. + * @internal + */ +function getStreamResponseStatusCodes(operationSpec) { + var result = new Set(); + for (var statusCode in operationSpec.responses) { + var operationResponse = operationSpec.responses[statusCode]; + if (operationResponse.bodyMapper && + operationResponse.bodyMapper.type.name === MapperType.Stream) { + result.add(Number(statusCode)); + } + } + return result; +} -"use strict"; +// Copyright (c) Microsoft Corporation. +// Note: The reason we re-define all of the xml2js default settings (version 2.0) here is because the default settings object exposed +// by the xm2js library is mutable. See https://github.com/Leonidas-from-XIV/node-xml2js/issues/536 +// By creating a new copy of the settings each time we instantiate the parser, +// we are safeguarding against the possibility of the default settings being mutated elsewhere unintentionally. +var xml2jsDefaultOptionsV2 = { + explicitCharkey: false, + trim: false, + normalize: false, + normalizeTags: false, + attrkey: XML_ATTRKEY, + explicitArray: true, + ignoreAttrs: false, + mergeAttrs: false, + explicitRoot: true, + validator: undefined, + xmlns: false, + explicitChildren: false, + preserveChildrenOrder: false, + childkey: "$$", + charsAsChildren: false, + includeWhiteChars: false, + async: false, + strict: true, + attrNameProcessors: undefined, + attrValueProcessors: undefined, + tagNameProcessors: undefined, + valueProcessors: undefined, + rootName: "root", + xmldec: { + version: "1.0", + encoding: "UTF-8", + standalone: true + }, + doctype: undefined, + renderOpts: { + pretty: true, + indent: " ", + newline: "\n" + }, + headless: false, + chunkSize: 10000, + emptyTag: "", + cdata: false +}; +// The xml2js settings for general XML parsing operations. +var xml2jsParserSettings = Object.assign({}, xml2jsDefaultOptionsV2); +xml2jsParserSettings.explicitArray = false; +// The xml2js settings for general XML building operations. +var xml2jsBuilderSettings = Object.assign({}, xml2jsDefaultOptionsV2); +xml2jsBuilderSettings.explicitArray = false; +xml2jsBuilderSettings.renderOpts = { + pretty: false +}; +/** + * Converts given JSON object to XML string + * @param obj - JSON object to be converted into XML string + * @param opts - Options that govern the parsing of given JSON object + */ +function stringifyXML(obj, opts) { + var _a; + if (opts === void 0) { opts = {}; } + xml2jsBuilderSettings.rootName = opts.rootName; + xml2jsBuilderSettings.charkey = (_a = opts.xmlCharKey) !== null && _a !== void 0 ? _a : XML_CHARKEY; + var builder = new xml2js.Builder(xml2jsBuilderSettings); + return builder.buildObject(obj); +} +/** + * Converts given XML string into JSON + * @param str - String containing the XML content to be parsed into JSON + * @param opts - Options that govern the parsing of given xml string + */ +function parseXML(str, opts) { + var _a; + if (opts === void 0) { opts = {}; } + xml2jsParserSettings.explicitRoot = !!opts.includeRoot; + xml2jsParserSettings.charkey = (_a = opts.xmlCharKey) !== null && _a !== void 0 ? _a : XML_CHARKEY; + var xmlParser = new xml2js.Parser(xml2jsParserSettings); + return new Promise(function (resolve, reject) { + if (!str) { + reject(new Error("Document is empty")); + } + else { + xmlParser.parseString(str, function (err, res) { + if (err) { + reject(err); + } + else { + resolve(res); + } + }); + } + }); +} -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. +// Copyright (c) Microsoft Corporation. +/** + * Create a new serialization RequestPolicyCreator that will serialized HTTP request bodies as they + * pass through the HTTP pipeline. */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TraceAPI = void 0; -var ProxyTracerProvider_1 = __nccwpck_require__(9483); -var spancontext_utils_1 = __nccwpck_require__(541); -var global_utils_1 = __nccwpck_require__(6965); -var API_NAME = 'trace'; +function deserializationPolicy(deserializationContentTypes, parsingOptions) { + return { + create: function (nextPolicy, options) { + return new DeserializationPolicy(nextPolicy, options, deserializationContentTypes, parsingOptions); + } + }; +} +var defaultJsonContentTypes = ["application/json", "text/json"]; +var defaultXmlContentTypes = ["application/xml", "application/atom+xml"]; +var DefaultDeserializationOptions = { + expectedContentTypes: { + json: defaultJsonContentTypes, + xml: defaultXmlContentTypes + } +}; /** - * Singleton object which represents the entry point to the OpenTelemetry Tracing API + * A RequestPolicy that will deserialize HTTP response bodies and headers as they pass through the + * HTTP pipeline. */ -var TraceAPI = /** @class */ (function () { - /** Empty private constructor prevents end users from constructing a new instance of the API */ - function TraceAPI() { - this._proxyTracerProvider = new ProxyTracerProvider_1.ProxyTracerProvider(); - this.isSpanContextValid = spancontext_utils_1.isSpanContextValid; +var DeserializationPolicy = /** @class */ (function (_super) { + tslib.__extends(DeserializationPolicy, _super); + function DeserializationPolicy(nextPolicy, requestPolicyOptions, deserializationContentTypes, parsingOptions) { + if (parsingOptions === void 0) { parsingOptions = {}; } + var _a; + var _this = _super.call(this, nextPolicy, requestPolicyOptions) || this; + _this.jsonContentTypes = + (deserializationContentTypes && deserializationContentTypes.json) || defaultJsonContentTypes; + _this.xmlContentTypes = + (deserializationContentTypes && deserializationContentTypes.xml) || defaultXmlContentTypes; + _this.xmlCharKey = (_a = parsingOptions.xmlCharKey) !== null && _a !== void 0 ? _a : XML_CHARKEY; + return _this; } - /** Get the singleton instance of the Trace API */ - TraceAPI.getInstance = function () { - if (!this._instance) { - this._instance = new TraceAPI(); - } - return this._instance; - }; - /** - * Set the current global tracer. Returns the initialized global tracer provider - */ - TraceAPI.prototype.setGlobalTracerProvider = function (provider) { - this._proxyTracerProvider.setDelegate(provider); - global_utils_1.registerGlobal(API_NAME, this._proxyTracerProvider); - return this._proxyTracerProvider; - }; - /** - * Returns the global tracer provider. - */ - TraceAPI.prototype.getTracerProvider = function () { - return global_utils_1.getGlobal(API_NAME) || this._proxyTracerProvider; + DeserializationPolicy.prototype.sendRequest = function (request) { + return tslib.__awaiter(this, void 0, void 0, function () { + var _this = this; + return tslib.__generator(this, function (_a) { + return [2 /*return*/, this._nextPolicy.sendRequest(request).then(function (response) { + return deserializeResponseBody(_this.jsonContentTypes, _this.xmlContentTypes, response, { + xmlCharKey: _this.xmlCharKey + }); + })]; + }); + }); }; - /** - * Returns a tracer from the global tracer provider. - */ - TraceAPI.prototype.getTracer = function (name, version) { - return this.getTracerProvider().getTracer(name, version); + return DeserializationPolicy; +}(BaseRequestPolicy)); +function getOperationResponse(parsedResponse) { + var result; + var request = parsedResponse.request; + var operationSpec = request.operationSpec; + if (operationSpec) { + var operationResponseGetter = request.operationResponseGetter; + if (!operationResponseGetter) { + result = operationSpec.responses[parsedResponse.status]; + } + else { + result = operationResponseGetter(operationSpec, parsedResponse); + } + } + return result; +} +function shouldDeserializeResponse(parsedResponse) { + var shouldDeserialize = parsedResponse.request.shouldDeserialize; + var result; + if (shouldDeserialize === undefined) { + result = true; + } + else if (typeof shouldDeserialize === "boolean") { + result = shouldDeserialize; + } + else { + result = shouldDeserialize(parsedResponse); + } + return result; +} +function deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, options) { + var _a, _b, _c; + if (options === void 0) { options = {}; } + var updatedOptions = { + rootName: (_a = options.rootName) !== null && _a !== void 0 ? _a : "", + includeRoot: (_b = options.includeRoot) !== null && _b !== void 0 ? _b : false, + xmlCharKey: (_c = options.xmlCharKey) !== null && _c !== void 0 ? _c : XML_CHARKEY }; - /** Remove the global tracer provider */ - TraceAPI.prototype.disable = function () { - global_utils_1.unregisterGlobal(API_NAME); - this._proxyTracerProvider = new ProxyTracerProvider_1.ProxyTracerProvider(); + return parse(jsonContentTypes, xmlContentTypes, response, updatedOptions).then(function (parsedResponse) { + if (!shouldDeserializeResponse(parsedResponse)) { + return parsedResponse; + } + var operationSpec = parsedResponse.request.operationSpec; + if (!operationSpec || !operationSpec.responses) { + return parsedResponse; + } + var responseSpec = getOperationResponse(parsedResponse); + var _a = handleErrorResponse(parsedResponse, operationSpec, responseSpec), error = _a.error, shouldReturnResponse = _a.shouldReturnResponse; + if (error) { + throw error; + } + else if (shouldReturnResponse) { + return parsedResponse; + } + // An operation response spec does exist for current status code, so + // use it to deserialize the response. + if (responseSpec) { + if (responseSpec.bodyMapper) { + var valueToDeserialize = parsedResponse.parsedBody; + if (operationSpec.isXML && responseSpec.bodyMapper.type.name === MapperType.Sequence) { + valueToDeserialize = + typeof valueToDeserialize === "object" + ? valueToDeserialize[responseSpec.bodyMapper.xmlElementName] + : []; + } + try { + parsedResponse.parsedBody = operationSpec.serializer.deserialize(responseSpec.bodyMapper, valueToDeserialize, "operationRes.parsedBody", options); + } + catch (innerError) { + var restError = new RestError("Error " + innerError + " occurred in deserializing the responseBody - " + parsedResponse.bodyAsText, undefined, parsedResponse.status, parsedResponse.request, parsedResponse); + throw restError; + } + } + else if (operationSpec.httpMethod === "HEAD") { + // head methods never have a body, but we return a boolean to indicate presence/absence of the resource + parsedResponse.parsedBody = response.status >= 200 && response.status < 300; + } + if (responseSpec.headersMapper) { + parsedResponse.parsedHeaders = operationSpec.serializer.deserialize(responseSpec.headersMapper, parsedResponse.headers.rawHeaders(), "operationRes.parsedHeaders", options); + } + } + return parsedResponse; + }); +} +function isOperationSpecEmpty(operationSpec) { + var expectedStatusCodes = Object.keys(operationSpec.responses); + return (expectedStatusCodes.length === 0 || + (expectedStatusCodes.length === 1 && expectedStatusCodes[0] === "default")); +} +function handleErrorResponse(parsedResponse, operationSpec, responseSpec) { + var _a; + var isSuccessByStatus = 200 <= parsedResponse.status && parsedResponse.status < 300; + var isExpectedStatusCode = isOperationSpecEmpty(operationSpec) + ? isSuccessByStatus + : !!responseSpec; + if (isExpectedStatusCode) { + if (responseSpec) { + if (!responseSpec.isError) { + return { error: null, shouldReturnResponse: false }; + } + } + else { + return { error: null, shouldReturnResponse: false }; + } + } + var errorResponseSpec = responseSpec !== null && responseSpec !== void 0 ? responseSpec : operationSpec.responses.default; + var streaming = ((_a = parsedResponse.request.streamResponseStatusCodes) === null || _a === void 0 ? void 0 : _a.has(parsedResponse.status)) || + parsedResponse.request.streamResponseBody; + var initialErrorMessage = streaming + ? "Unexpected status code: " + parsedResponse.status + : parsedResponse.bodyAsText; + var error = new RestError(initialErrorMessage, undefined, parsedResponse.status, parsedResponse.request, parsedResponse); + // If the item failed but there's no error spec or default spec to deserialize the error, + // we should fail so we just throw the parsed response + if (!errorResponseSpec) { + throw error; + } + var defaultBodyMapper = errorResponseSpec.bodyMapper; + var defaultHeadersMapper = errorResponseSpec.headersMapper; + try { + // If error response has a body, try to deserialize it using default body mapper. + // Then try to extract error code & message from it + if (parsedResponse.parsedBody) { + var parsedBody = parsedResponse.parsedBody; + var parsedError = void 0; + if (defaultBodyMapper) { + var valueToDeserialize = parsedBody; + if (operationSpec.isXML && defaultBodyMapper.type.name === MapperType.Sequence) { + valueToDeserialize = + typeof parsedBody === "object" ? parsedBody[defaultBodyMapper.xmlElementName] : []; + } + parsedError = operationSpec.serializer.deserialize(defaultBodyMapper, valueToDeserialize, "error.response.parsedBody"); + } + var internalError = parsedBody.error || parsedError || parsedBody; + error.code = internalError.code; + if (internalError.message) { + error.message = internalError.message; + } + if (defaultBodyMapper) { + error.response.parsedBody = parsedError; + } + } + // If error response has headers, try to deserialize it using default header mapper + if (parsedResponse.headers && defaultHeadersMapper) { + error.response.parsedHeaders = operationSpec.serializer.deserialize(defaultHeadersMapper, parsedResponse.headers.rawHeaders(), "operationRes.parsedHeaders"); + } + } + catch (defaultError) { + error.message = "Error \"" + defaultError.message + "\" occurred in deserializing the responseBody - \"" + parsedResponse.bodyAsText + "\" for the default response."; + } + return { error: error, shouldReturnResponse: false }; +} +function parse(jsonContentTypes, xmlContentTypes, operationResponse, opts) { + var _a; + var errorHandler = function (err) { + var msg = "Error \"" + err + "\" occurred while parsing the response body - " + operationResponse.bodyAsText + "."; + var errCode = err.code || RestError.PARSE_ERROR; + var e = new RestError(msg, errCode, operationResponse.status, operationResponse.request, operationResponse); + return Promise.reject(e); }; - return TraceAPI; -}()); -exports.TraceAPI = TraceAPI; -//# sourceMappingURL=trace.js.map - -/***/ }), - -/***/ 1301: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=Baggage.js.map - -/***/ }), - -/***/ 100: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=Entry.js.map - -/***/ }), - -/***/ 6196: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; + var streaming = ((_a = operationResponse.request.streamResponseStatusCodes) === null || _a === void 0 ? void 0 : _a.has(operationResponse.status)) || + operationResponse.request.streamResponseBody; + if (!streaming && operationResponse.bodyAsText) { + var text_1 = operationResponse.bodyAsText; + var contentType = operationResponse.headers.get("Content-Type") || ""; + var contentComponents = !contentType + ? [] + : contentType.split(";").map(function (component) { return component.toLowerCase(); }); + if (contentComponents.length === 0 || + contentComponents.some(function (component) { return jsonContentTypes.indexOf(component) !== -1; })) { + return new Promise(function (resolve) { + operationResponse.parsedBody = JSON.parse(text_1); + resolve(operationResponse); + }).catch(errorHandler); + } + else if (contentComponents.some(function (component) { return xmlContentTypes.indexOf(component) !== -1; })) { + return parseXML(text_1, opts) + .then(function (body) { + operationResponse.parsedBody = body; + return operationResponse; + }) + .catch(errorHandler); + } + } + return Promise.resolve(operationResponse); +} -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.baggageEntryMetadataFromString = exports.createBaggage = void 0; -var baggage_1 = __nccwpck_require__(6393); -var symbol_1 = __nccwpck_require__(8256); -__exportStar(__nccwpck_require__(1301), exports); -__exportStar(__nccwpck_require__(100), exports); +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +var DEFAULT_CLIENT_RETRY_COUNT = 3; +// intervals are in ms +var DEFAULT_CLIENT_RETRY_INTERVAL = 1000 * 30; +var DEFAULT_CLIENT_MAX_RETRY_INTERVAL = 1000 * 90; +var DEFAULT_CLIENT_MIN_RETRY_INTERVAL = 1000 * 3; +function isNumber(n) { + return typeof n === "number"; +} /** - * Create a new Baggage with optional entries + * @internal + * Determines if the operation should be retried. * - * @param entries An array of baggage entries the new baggage should contain + * @param retryLimit - Specifies the max number of retries. + * @param predicate - Initial chekck on whether to retry based on given responses or errors + * @param retryData - The retry data. + * @returns True if the operation qualifies for a retry; false otherwise. */ -function createBaggage(entries) { - if (entries === void 0) { entries = {}; } - return new baggage_1.BaggageImpl(new Map(Object.entries(entries))); +function shouldRetry(retryLimit, predicate, retryData, response, error) { + if (!predicate(response, error)) { + return false; + } + return retryData.retryCount < retryLimit; } -exports.createBaggage = createBaggage; /** - * Create a serializable BaggageEntryMetadata object from a string. - * - * @param str string metadata. Format is currently not defined by the spec and has no special meaning. + * @internal + * Updates the retry data for the next attempt. * + * @param retryOptions - specifies retry interval, and its lower bound and upper bound. + * @param retryData - The retry data. + * @param err - The operation"s error, if any. */ -function baggageEntryMetadataFromString(str) { - if (typeof str !== 'string') { - // @TODO log diagnostic - str = ''; +function updateRetryData(retryOptions, retryData, err) { + if (retryData === void 0) { retryData = { retryCount: 0, retryInterval: 0 }; } + if (err) { + if (retryData.error) { + err.innerError = retryData.error; + } + retryData.error = err; } + // Adjust retry count + retryData.retryCount++; + // Adjust retry interval + var incrementDelta = Math.pow(2, retryData.retryCount - 1) - 1; + var boundedRandDelta = retryOptions.retryInterval * 0.8 + + Math.floor(Math.random() * (retryOptions.retryInterval * 0.4)); + incrementDelta *= boundedRandDelta; + retryData.retryInterval = Math.min(retryOptions.minRetryInterval + incrementDelta, retryOptions.maxRetryInterval); + return retryData; +} + +// Copyright (c) Microsoft Corporation. +function exponentialRetryPolicy(retryCount, retryInterval, maxRetryInterval) { return { - __TYPE__: symbol_1.baggageEntryMetadataSymbol, - toString: function () { - return str; - }, + create: function (nextPolicy, options) { + return new ExponentialRetryPolicy(nextPolicy, options, retryCount, retryInterval, maxRetryInterval); + } }; } -exports.baggageEntryMetadataFromString = baggageEntryMetadataFromString; -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 6393: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. +(function (RetryMode) { + RetryMode[RetryMode["Exponential"] = 0] = "Exponential"; +})(exports.RetryMode || (exports.RetryMode = {})); +var DefaultRetryOptions = { + maxRetries: DEFAULT_CLIENT_RETRY_COUNT, + retryDelayInMs: DEFAULT_CLIENT_RETRY_INTERVAL, + maxRetryDelayInMs: DEFAULT_CLIENT_MAX_RETRY_INTERVAL +}; +/** + * Instantiates a new "ExponentialRetryPolicyFilter" instance. */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.BaggageImpl = void 0; -var BaggageImpl = /** @class */ (function () { - function BaggageImpl(entries) { - this._entries = entries ? new Map(entries) : new Map(); +var ExponentialRetryPolicy = /** @class */ (function (_super) { + tslib.__extends(ExponentialRetryPolicy, _super); + /** + * @param nextPolicy - The next RequestPolicy in the pipeline chain. + * @param options - The options for this RequestPolicy. + * @param retryCount - The client retry count. + * @param retryInterval - The client retry interval, in milliseconds. + * @param minRetryInterval - The minimum retry interval, in milliseconds. + * @param maxRetryInterval - The maximum retry interval, in milliseconds. + */ + function ExponentialRetryPolicy(nextPolicy, options, retryCount, retryInterval, maxRetryInterval) { + var _this = _super.call(this, nextPolicy, options) || this; + _this.retryCount = isNumber(retryCount) ? retryCount : DEFAULT_CLIENT_RETRY_COUNT; + _this.retryInterval = isNumber(retryInterval) ? retryInterval : DEFAULT_CLIENT_RETRY_INTERVAL; + _this.maxRetryInterval = isNumber(maxRetryInterval) + ? maxRetryInterval + : DEFAULT_CLIENT_MAX_RETRY_INTERVAL; + return _this; + } + ExponentialRetryPolicy.prototype.sendRequest = function (request) { + var _this = this; + return this._nextPolicy + .sendRequest(request.clone()) + .then(function (response) { return retry(_this, request, response); }) + .catch(function (error) { return retry(_this, request, error.response, undefined, error); }); + }; + return ExponentialRetryPolicy; +}(BaseRequestPolicy)); +function retry(policy, request, response, retryData, requestError) { + return tslib.__awaiter(this, void 0, void 0, function () { + function shouldPolicyRetry(responseParam) { + var statusCode = responseParam === null || responseParam === void 0 ? void 0 : responseParam.status; + if (statusCode === undefined || + (statusCode < 500 && statusCode !== 408) || + statusCode === 501 || + statusCode === 505) { + return false; + } + return true; + } + var isAborted, res, err_1, err; + return tslib.__generator(this, function (_a) { + switch (_a.label) { + case 0: + retryData = updateRetryData({ + retryInterval: policy.retryInterval, + minRetryInterval: 0, + maxRetryInterval: policy.maxRetryInterval + }, retryData, requestError); + isAborted = request.abortSignal && request.abortSignal.aborted; + if (!(!isAborted && shouldRetry(policy.retryCount, shouldPolicyRetry, retryData, response))) return [3 /*break*/, 6]; + logger.info("Retrying request in " + retryData.retryInterval); + _a.label = 1; + case 1: + _a.trys.push([1, 4, , 5]); + return [4 /*yield*/, delay(retryData.retryInterval)]; + case 2: + _a.sent(); + return [4 /*yield*/, policy._nextPolicy.sendRequest(request.clone())]; + case 3: + res = _a.sent(); + return [2 /*return*/, retry(policy, request, res, retryData)]; + case 4: + err_1 = _a.sent(); + return [2 /*return*/, retry(policy, request, response, retryData, err_1)]; + case 5: return [3 /*break*/, 7]; + case 6: + if (isAborted || requestError || !response) { + err = retryData.error || + new RestError("Failed to send the request.", RestError.REQUEST_SEND_ERROR, response && response.status, response && response.request, response); + throw err; + } + else { + return [2 /*return*/, response]; + } + case 7: return [2 /*return*/]; + } + }); + }); +} + +// Copyright (c) Microsoft Corporation. +function generateClientRequestIdPolicy(requestIdHeaderName) { + if (requestIdHeaderName === void 0) { requestIdHeaderName = "x-ms-client-request-id"; } + return { + create: function (nextPolicy, options) { + return new GenerateClientRequestIdPolicy(nextPolicy, options, requestIdHeaderName); + } + }; +} +var GenerateClientRequestIdPolicy = /** @class */ (function (_super) { + tslib.__extends(GenerateClientRequestIdPolicy, _super); + function GenerateClientRequestIdPolicy(nextPolicy, options, _requestIdHeaderName) { + var _this = _super.call(this, nextPolicy, options) || this; + _this._requestIdHeaderName = _requestIdHeaderName; + return _this; } - BaggageImpl.prototype.getEntry = function (key) { - var entry = this._entries.get(key); - if (!entry) { - return undefined; + GenerateClientRequestIdPolicy.prototype.sendRequest = function (request) { + if (!request.headers.contains(this._requestIdHeaderName)) { + request.headers.set(this._requestIdHeaderName, request.requestId); } - return Object.assign({}, entry); + return this._nextPolicy.sendRequest(request); }; - BaggageImpl.prototype.getAllEntries = function () { - return Array.from(this._entries.entries()).map(function (_a) { - var k = _a[0], v = _a[1]; - return [k, v]; - }); + return GenerateClientRequestIdPolicy; +}(BaseRequestPolicy)); + +// Copyright (c) Microsoft Corporation. +function getDefaultUserAgentKey() { + return Constants.HeaderConstants.USER_AGENT; +} +function getPlatformSpecificData() { + var runtimeInfo = { + key: "Node", + value: process.version }; - BaggageImpl.prototype.setEntry = function (key, entry) { - var newBaggage = new BaggageImpl(this._entries); - newBaggage._entries.set(key, entry); - return newBaggage; + var osInfo = { + key: "OS", + value: "(" + os.arch() + "-" + os.type() + "-" + os.release() + ")" }; - BaggageImpl.prototype.removeEntry = function (key) { - var newBaggage = new BaggageImpl(this._entries); - newBaggage._entries.delete(key); - return newBaggage; + return [runtimeInfo, osInfo]; +} + +// Copyright (c) Microsoft Corporation. +function getRuntimeInfo() { + var msRestRuntime = { + key: "core-http", + value: Constants.coreHttpVersion }; - BaggageImpl.prototype.removeEntries = function () { - var keys = []; - for (var _i = 0; _i < arguments.length; _i++) { - keys[_i] = arguments[_i]; - } - var newBaggage = new BaggageImpl(this._entries); - for (var _a = 0, keys_1 = keys; _a < keys_1.length; _a++) { - var key = keys_1[_a]; - newBaggage._entries.delete(key); + return [msRestRuntime]; +} +function getUserAgentString(telemetryInfo, keySeparator, valueSeparator) { + if (keySeparator === void 0) { keySeparator = " "; } + if (valueSeparator === void 0) { valueSeparator = "/"; } + return telemetryInfo + .map(function (info) { + var value = info.value ? "" + valueSeparator + info.value : ""; + return "" + info.key + value; + }) + .join(keySeparator); +} +var getDefaultUserAgentHeaderName = getDefaultUserAgentKey; +function getDefaultUserAgentValue() { + var runtimeInfo = getRuntimeInfo(); + var platformSpecificData = getPlatformSpecificData(); + var userAgent = getUserAgentString(runtimeInfo.concat(platformSpecificData)); + return userAgent; +} +function userAgentPolicy(userAgentData) { + var key = !userAgentData || userAgentData.key === undefined || userAgentData.key === null + ? getDefaultUserAgentKey() + : userAgentData.key; + var value = !userAgentData || userAgentData.value === undefined || userAgentData.value === null + ? getDefaultUserAgentValue() + : userAgentData.value; + return { + create: function (nextPolicy, options) { + return new UserAgentPolicy(nextPolicy, options, key, value); } - return newBaggage; }; - BaggageImpl.prototype.clear = function () { - return new BaggageImpl(); +} +var UserAgentPolicy = /** @class */ (function (_super) { + tslib.__extends(UserAgentPolicy, _super); + function UserAgentPolicy(_nextPolicy, _options, headerKey, headerValue) { + var _this = _super.call(this, _nextPolicy, _options) || this; + _this._nextPolicy = _nextPolicy; + _this._options = _options; + _this.headerKey = headerKey; + _this.headerValue = headerValue; + return _this; + } + UserAgentPolicy.prototype.sendRequest = function (request) { + this.addUserAgentHeader(request); + return this._nextPolicy.sendRequest(request); }; - return BaggageImpl; -}()); -exports.BaggageImpl = BaggageImpl; -//# sourceMappingURL=baggage.js.map - -/***/ }), - -/***/ 8256: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; + UserAgentPolicy.prototype.addUserAgentHeader = function (request) { + if (!request.headers) { + request.headers = new HttpHeaders(); + } + if (!request.headers.get(this.headerKey) && this.headerValue) { + request.headers.set(this.headerKey, this.headerValue); + } + }; + return UserAgentPolicy; +}(BaseRequestPolicy)); -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.baggageEntryMetadataSymbol = void 0; +// Copyright (c) Microsoft Corporation. /** - * Symbol used to make BaggageEntryMetadata an opaque type - */ -exports.baggageEntryMetadataSymbol = Symbol('BaggageEntryMetadata'); -//# sourceMappingURL=symbol.js.map - -/***/ }), - -/***/ 9777: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=Exception.js.map - -/***/ }), - -/***/ 7413: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=Time.js.map - -/***/ }), - -/***/ 469: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Methods that are allowed to follow redirects 301 and 302 */ -var __spreadArrays = (this && this.__spreadArrays) || function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; +var allowedRedirect = ["GET", "HEAD"]; +var DefaultRedirectOptions = { + handleRedirects: true, + maxRetries: 20 }; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NoopContextManager = void 0; -var context_1 = __nccwpck_require__(7135); -var NoopContextManager = /** @class */ (function () { - function NoopContextManager() { - } - NoopContextManager.prototype.active = function () { - return context_1.ROOT_CONTEXT; - }; - NoopContextManager.prototype.with = function (_context, fn, thisArg) { - var args = []; - for (var _i = 3; _i < arguments.length; _i++) { - args[_i - 3] = arguments[_i]; +function redirectPolicy(maximumRetries) { + if (maximumRetries === void 0) { maximumRetries = 20; } + return { + create: function (nextPolicy, options) { + return new RedirectPolicy(nextPolicy, options, maximumRetries); } - return fn.call.apply(fn, __spreadArrays([thisArg], args)); }; - NoopContextManager.prototype.bind = function (target, _context) { - return target; +} +var RedirectPolicy = /** @class */ (function (_super) { + tslib.__extends(RedirectPolicy, _super); + function RedirectPolicy(nextPolicy, options, maxRetries) { + if (maxRetries === void 0) { maxRetries = 20; } + var _this = _super.call(this, nextPolicy, options) || this; + _this.maxRetries = maxRetries; + return _this; + } + RedirectPolicy.prototype.sendRequest = function (request) { + var _this = this; + return this._nextPolicy + .sendRequest(request) + .then(function (response) { return handleRedirect(_this, response, 0); }); }; - NoopContextManager.prototype.enable = function () { - return this; + return RedirectPolicy; +}(BaseRequestPolicy)); +function handleRedirect(policy, response, currentRetries) { + var request = response.request, status = response.status; + var locationHeader = response.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) && + (!policy.maxRetries || currentRetries < policy.maxRetries)) { + var builder = URLBuilder.parse(request.url); + builder.setPath(locationHeader); + request.url = builder.toString(); + // POST request with Status code 303 should be converted into a + // redirected GET request if the redirect url is present in the location header + if (status === 303) { + request.method = "GET"; + delete request.body; + } + return policy._nextPolicy + .sendRequest(request) + .then(function (res) { return handleRedirect(policy, res, currentRetries + 1); }); + } + return Promise.resolve(response); +} + +// Copyright (c) Microsoft Corporation. +function rpRegistrationPolicy(retryTimeout) { + if (retryTimeout === void 0) { retryTimeout = 30; } + return { + create: function (nextPolicy, options) { + return new RPRegistrationPolicy(nextPolicy, options, retryTimeout); + } }; - NoopContextManager.prototype.disable = function () { - return this; +} +var RPRegistrationPolicy = /** @class */ (function (_super) { + tslib.__extends(RPRegistrationPolicy, _super); + function RPRegistrationPolicy(nextPolicy, options, _retryTimeout) { + if (_retryTimeout === void 0) { _retryTimeout = 30; } + var _this = _super.call(this, nextPolicy, options) || this; + _this._retryTimeout = _retryTimeout; + return _this; + } + RPRegistrationPolicy.prototype.sendRequest = function (request) { + var _this = this; + return this._nextPolicy + .sendRequest(request.clone()) + .then(function (response) { return registerIfNeeded(_this, request, response); }); }; - return NoopContextManager; -}()); -exports.NoopContextManager = NoopContextManager; -//# sourceMappingURL=NoopContextManager.js.map - -/***/ }), - -/***/ 7135: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ROOT_CONTEXT = exports.createContextKey = exports.setBaggage = exports.getBaggage = exports.isInstrumentationSuppressed = exports.unsuppressInstrumentation = exports.suppressInstrumentation = exports.getSpanContext = exports.setSpanContext = exports.setSpan = exports.getSpan = void 0; -var NoopSpan_1 = __nccwpck_require__(3116); -/** - * span key - */ -var SPAN_KEY = createContextKey('OpenTelemetry Context Key SPAN'); -/** - * Shared key for indicating if instrumentation should be suppressed beyond - * this current scope. - */ -var SUPPRESS_INSTRUMENTATION_KEY = createContextKey('OpenTelemetry Context Key SUPPRESS_INSTRUMENTATION'); + return RPRegistrationPolicy; +}(BaseRequestPolicy)); +function registerIfNeeded(policy, request, response) { + if (response.status === 409) { + var rpName = checkRPNotRegisteredError(response.bodyAsText); + if (rpName) { + var urlPrefix = extractSubscriptionUrl(request.url); + return (registerRP(policy, urlPrefix, rpName, request) + // Autoregistration of ${provider} failed for some reason. We will not return this error + // instead will return the initial response with 409 status code back to the user. + // do nothing here as we are returning the original response at the end of this method. + .catch(function () { return false; }) + .then(function (registrationStatus) { + if (registrationStatus) { + // Retry the original request. We have to change the x-ms-client-request-id + // otherwise Azure endpoint will return the initial 409 (cached) response. + request.headers.set("x-ms-client-request-id", generateUuid()); + return policy._nextPolicy.sendRequest(request.clone()); + } + return response; + })); + } + } + return Promise.resolve(response); +} /** - * Baggage key + * Reuses the headers of the original request and url (if specified). + * @param originalRequest - The original request + * @param reuseUrlToo - Should the url from the original request be reused as well. Default false. + * @returns A new request object with desired headers. */ -var BAGGAGE_KEY = createContextKey('OpenTelemetry Baggage Key'); +function getRequestEssentials(originalRequest, reuseUrlToo) { + if (reuseUrlToo === void 0) { reuseUrlToo = false; } + var reqOptions = originalRequest.clone(); + if (reuseUrlToo) { + reqOptions.url = originalRequest.url; + } + // We have to change the x-ms-client-request-id otherwise Azure endpoint + // will return the initial 409 (cached) response. + reqOptions.headers.set("x-ms-client-request-id", generateUuid()); + // Set content-type to application/json + reqOptions.headers.set("Content-Type", "application/json; charset=utf-8"); + return reqOptions; +} /** - * Return the span if one exists - * - * @param context context to get span from + * Validates the error code and message associated with 409 response status code. If it matches to that of + * RP not registered then it returns the name of the RP else returns undefined. + * @param body - The response body received after making the original request. + * @returns The name of the RP if condition is satisfied else undefined. */ -function getSpan(context) { - return context.getValue(SPAN_KEY) || undefined; +function checkRPNotRegisteredError(body) { + var result, responseBody; + if (body) { + try { + responseBody = JSON.parse(body); + } + catch (err) { + // do nothing; + } + if (responseBody && + responseBody.error && + responseBody.error.message && + responseBody.error.code && + responseBody.error.code === "MissingSubscriptionRegistration") { + var matchRes = responseBody.error.message.match(/.*'(.*)'/i); + if (matchRes) { + result = matchRes.pop(); + } + } + } + return result; } -exports.getSpan = getSpan; /** - * Set the span on a context - * - * @param context context to use as parent - * @param span span to set active + * Extracts the first part of the URL, just after subscription: + * https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/ + * @param url - The original request url + * @returns The url prefix as explained above. */ -function setSpan(context, span) { - return context.setValue(SPAN_KEY, span); +function extractSubscriptionUrl(url) { + var result; + var matchRes = url.match(/.*\/subscriptions\/[a-f0-9-]+\//gi); + if (matchRes && matchRes[0]) { + result = matchRes[0]; + } + else { + throw new Error("Unable to extract subscriptionId from the given url - " + url + "."); + } + return result; } -exports.setSpan = setSpan; /** - * Wrap span context in a NoopSpan and set as span in a new - * context - * - * @param context context to set active span on - * @param spanContext span context to be wrapped + * Registers the given provider. + * @param policy - The RPRegistrationPolicy this function is being called against. + * @param urlPrefix - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/ + * @param provider - The provider name to be registered. + * @param originalRequest - The original request sent by the user that returned a 409 response + * with a message that the provider is not registered. + * @param callback - The callback that handles the RP registration */ -function setSpanContext(context, spanContext) { - return setSpan(context, new NoopSpan_1.NoopSpan(spanContext)); +function registerRP(policy, urlPrefix, provider, originalRequest) { + var postUrl = urlPrefix + "providers/" + provider + "/register?api-version=2016-02-01"; + var getUrl = urlPrefix + "providers/" + provider + "?api-version=2016-02-01"; + var reqOptions = getRequestEssentials(originalRequest); + reqOptions.method = "POST"; + reqOptions.url = postUrl; + return policy._nextPolicy.sendRequest(reqOptions).then(function (response) { + if (response.status !== 200) { + throw new Error("Autoregistration of " + provider + " failed. Please try registering manually."); + } + return getRegistrationStatus(policy, getUrl, originalRequest); + }); } -exports.setSpanContext = setSpanContext; /** - * Get the span context of the span if it exists. - * - * @param context context to get values from + * Polls the registration status of the provider that was registered. Polling happens at an interval of 30 seconds. + * Polling will happen till the registrationState property of the response body is "Registered". + * @param policy - The RPRegistrationPolicy this function is being called against. + * @param url - The request url for polling + * @param originalRequest - The original request sent by the user that returned a 409 response + * with a message that the provider is not registered. + * @returns True if RP Registration is successful. */ -function getSpanContext(context) { - var _a; - return (_a = getSpan(context)) === null || _a === void 0 ? void 0 : _a.context(); +function getRegistrationStatus(policy, url, originalRequest) { + var reqOptions = getRequestEssentials(originalRequest); + reqOptions.url = url; + reqOptions.method = "GET"; + return policy._nextPolicy.sendRequest(reqOptions).then(function (res) { + var obj = res.parsedBody; + if (res.parsedBody && obj.registrationState && obj.registrationState === "Registered") { + return true; + } + else { + return delay(policy._retryTimeout * 1000) + .then(function () { return getRegistrationStatus(policy, url, originalRequest); }); + } + }); } -exports.getSpanContext = getSpanContext; + +// Copyright (c) Microsoft Corporation. +// Default options for the cycler if none are provided +var DEFAULT_CYCLER_OPTIONS = { + forcedRefreshWindowInMs: 1000, + retryIntervalInMs: 3000, + refreshWindowInMs: 1000 * 60 * 2 // Start refreshing 2m before expiry +}; /** - * Sets value on context to indicate that instrumentation should - * be suppressed beyond this current scope. + * Converts an an unreliable access token getter (which may resolve with null) + * into an AccessTokenGetter by retrying the unreliable getter in a regular + * interval. * - * @param context context to set the suppress instrumentation value on. + * @param getAccessToken - a function that produces a promise of an access + * token that may fail by returning null + * @param retryIntervalInMs - the time (in milliseconds) to wait between retry + * attempts + * @param timeoutInMs - the timestamp after which the refresh attempt will fail, + * throwing an exception + * @returns - a promise that, if it resolves, will resolve with an access token */ -function suppressInstrumentation(context) { - return context.setValue(SUPPRESS_INSTRUMENTATION_KEY, true); +function beginRefresh(getAccessToken, retryIntervalInMs, timeoutInMs) { + return tslib.__awaiter(this, void 0, void 0, function () { + // This wrapper handles exceptions gracefully as long as we haven't exceeded + // the timeout. + function tryGetAccessToken() { + return tslib.__awaiter(this, void 0, void 0, function () { + var _a, finalToken; + return tslib.__generator(this, function (_b) { + switch (_b.label) { + case 0: + if (!(Date.now() < timeoutInMs)) return [3 /*break*/, 5]; + _b.label = 1; + case 1: + _b.trys.push([1, 3, , 4]); + return [4 /*yield*/, getAccessToken()]; + case 2: return [2 /*return*/, _b.sent()]; + case 3: + _a = _b.sent(); + return [2 /*return*/, null]; + case 4: return [3 /*break*/, 7]; + case 5: return [4 /*yield*/, getAccessToken()]; + case 6: + finalToken = _b.sent(); + // Timeout is up, so throw if it's still null + if (finalToken === null) { + throw new Error("Failed to refresh access token."); + } + return [2 /*return*/, finalToken]; + case 7: return [2 /*return*/]; + } + }); + }); + } + var token; + return tslib.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, tryGetAccessToken()]; + case 1: + token = _a.sent(); + _a.label = 2; + case 2: + if (!(token === null)) return [3 /*break*/, 5]; + return [4 /*yield*/, delay(retryIntervalInMs)]; + case 3: + _a.sent(); + return [4 /*yield*/, tryGetAccessToken()]; + case 4: + token = _a.sent(); + return [3 /*break*/, 2]; + case 5: return [2 /*return*/, token]; + } + }); + }); } -exports.suppressInstrumentation = suppressInstrumentation; /** - * Sets value on context to indicate that instrumentation should - * no-longer be suppressed beyond this current scope. + * Creates a token cycler from a credential, scopes, and optional settings. * - * @param context context to set the suppress instrumentation value on. + * A token cycler represents a way to reliably retrieve a valid access token + * from a TokenCredential. It will handle initializing the token, refreshing it + * when it nears expiration, and synchronizes refresh attempts to avoid + * concurrency hazards. + * + * @param credential - the underlying TokenCredential that provides the access + * token + * @param scopes - the scopes to request authorization for + * @param tokenCyclerOptions - optionally override default settings for the cycler + * + * @returns - a function that reliably produces a valid access token */ -function unsuppressInstrumentation(context) { - return context.setValue(SUPPRESS_INSTRUMENTATION_KEY, false); +function createTokenCycler(credential, scopes, tokenCyclerOptions) { + var _this = this; + var refreshWorker = null; + var token = null; + var options = tslib.__assign(tslib.__assign({}, DEFAULT_CYCLER_OPTIONS), tokenCyclerOptions); + /** + * This little holder defines several predicates that we use to construct + * the rules of refreshing the token. + */ + var cycler = { + /** + * Produces true if a refresh job is currently in progress. + */ + get isRefreshing() { + return refreshWorker !== null; + }, + /** + * Produces true if the cycler SHOULD refresh (we are within the refresh + * window and not already refreshing) + */ + get shouldRefresh() { + var _a; + return (!cycler.isRefreshing && + ((_a = token === null || token === void 0 ? void 0 : token.expiresOnTimestamp) !== null && _a !== void 0 ? _a : 0) - options.refreshWindowInMs < Date.now()); + }, + /** + * Produces true if the cycler MUST refresh (null or nearly-expired + * token). + */ + get mustRefresh() { + return (token === null || token.expiresOnTimestamp - options.forcedRefreshWindowInMs < Date.now()); + } + }; + /** + * Starts a refresh job or returns the existing job if one is already + * running. + */ + function refresh(getTokenOptions) { + var _a; + if (!cycler.isRefreshing) { + // We bind `scopes` here to avoid passing it around a lot + var tryGetAccessToken = function () { + return credential.getToken(scopes, getTokenOptions); + }; + // Take advantage of promise chaining to insert an assignment to `token` + // before the refresh can be considered done. + 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()) + .then(function (_token) { + refreshWorker = null; + token = _token; + return token; + }) + .catch(function (reason) { + // We also should reset the refresher if we enter a failed state. All + // existing awaiters will throw, but subsequent requests will start a + // new retry chain. + refreshWorker = null; + token = null; + throw reason; + }); + } + return refreshWorker; + } + return function (tokenOptions) { return tslib.__awaiter(_this, void 0, void 0, function () { + return tslib.__generator(this, function (_a) { + // + // Simple rules: + // - If we MUST refresh, then return the refresh task, blocking + // the pipeline until a token is available. + // - If we SHOULD refresh, then run refresh but don't return it + // (we can still use the cached token). + // - Return the token, since it's fine if we didn't return in + // step 1. + // + if (cycler.mustRefresh) + return [2 /*return*/, refresh(tokenOptions)]; + if (cycler.shouldRefresh) { + refresh(tokenOptions); + } + return [2 /*return*/, token]; + }); + }); }; } -exports.unsuppressInstrumentation = unsuppressInstrumentation; +// #endregion /** - * Return current suppress instrumentation value for the given context, - * if it exists. + * Creates a new factory for a RequestPolicy that applies a bearer token to + * the requests' `Authorization` headers. * - * @param context context check for the suppress instrumentation value. + * @param credential - The TokenCredential implementation that can supply the bearer token. + * @param scopes - The scopes for which the bearer token applies. */ -function isInstrumentationSuppressed(context) { - return Boolean(context.getValue(SUPPRESS_INSTRUMENTATION_KEY)); +function bearerTokenAuthenticationPolicy(credential, scopes) { + // This simple function encapsulates the entire process of reliably retrieving the token + var getToken = createTokenCycler(credential, scopes /* , options */); + var BearerTokenAuthenticationPolicy = /** @class */ (function (_super) { + tslib.__extends(BearerTokenAuthenticationPolicy, _super); + function BearerTokenAuthenticationPolicy(nextPolicy, options) { + return _super.call(this, nextPolicy, options) || this; + } + BearerTokenAuthenticationPolicy.prototype.sendRequest = function (webResource) { + return tslib.__awaiter(this, void 0, void 0, function () { + var token; + return tslib.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, getToken({ + abortSignal: webResource.abortSignal, + tracingOptions: { + spanOptions: webResource.spanOptions, + tracingContext: webResource.tracingContext + } + })]; + case 1: + token = (_a.sent()).token; + webResource.headers.set(Constants.HeaderConstants.AUTHORIZATION, "Bearer " + token); + return [2 /*return*/, this._nextPolicy.sendRequest(webResource)]; + } + }); + }); + }; + return BearerTokenAuthenticationPolicy; + }(BaseRequestPolicy)); + return { + create: function (nextPolicy, options) { + return new BearerTokenAuthenticationPolicy(nextPolicy, options); + } + }; } -exports.isInstrumentationSuppressed = isInstrumentationSuppressed; -/** - * @param {Context} Context that manage all context values - * @returns {Baggage} Extracted baggage from the context - */ -function getBaggage(context) { - return context.getValue(BAGGAGE_KEY) || undefined; + +// Copyright (c) Microsoft Corporation. +function systemErrorRetryPolicy(retryCount, retryInterval, minRetryInterval, maxRetryInterval) { + return { + create: function (nextPolicy, options) { + return new SystemErrorRetryPolicy(nextPolicy, options, retryCount, retryInterval, minRetryInterval, maxRetryInterval); + } + }; } -exports.getBaggage = getBaggage; /** - * @param {Context} Context that manage all context values - * @param {Baggage} baggage that will be set in the actual context + * @param retryCount - The client retry count. + * @param retryInterval - The client retry interval, in milliseconds. + * @param minRetryInterval - The minimum retry interval, in milliseconds. + * @param maxRetryInterval - The maximum retry interval, in milliseconds. */ -function setBaggage(context, baggage) { - return context.setValue(BAGGAGE_KEY, baggage); -} -exports.setBaggage = setBaggage; -/** Get a key to uniquely identify a context value */ -function createContextKey(description) { - return Symbol.for(description); -} -exports.createContextKey = createContextKey; -var BaseContext = /** @class */ (function () { - /** - * Construct a new context which inherits values from an optional parent context. - * - * @param parentContext a context from which to inherit values - */ - function BaseContext(parentContext) { - // for minification - var self = this; - self._currentContext = parentContext ? new Map(parentContext) : new Map(); - self.getValue = function (key) { return self._currentContext.get(key); }; - self.setValue = function (key, value) { - var context = new BaseContext(self._currentContext); - context._currentContext.set(key, value); - return context; - }; - self.deleteValue = function (key) { - var context = new BaseContext(self._currentContext); - context._currentContext.delete(key); - return context; - }; +var SystemErrorRetryPolicy = /** @class */ (function (_super) { + tslib.__extends(SystemErrorRetryPolicy, _super); + function SystemErrorRetryPolicy(nextPolicy, options, retryCount, retryInterval, minRetryInterval, maxRetryInterval) { + var _this = _super.call(this, nextPolicy, options) || this; + _this.retryCount = isNumber(retryCount) ? retryCount : DEFAULT_CLIENT_RETRY_COUNT; + _this.retryInterval = isNumber(retryInterval) ? retryInterval : DEFAULT_CLIENT_RETRY_INTERVAL; + _this.minRetryInterval = isNumber(minRetryInterval) + ? minRetryInterval + : DEFAULT_CLIENT_MIN_RETRY_INTERVAL; + _this.maxRetryInterval = isNumber(maxRetryInterval) + ? maxRetryInterval + : DEFAULT_CLIENT_MAX_RETRY_INTERVAL; + return _this; } - return BaseContext; -}()); -/** The root context is used as the default parent context when there is no active context */ -exports.ROOT_CONTEXT = new BaseContext(); -//# sourceMappingURL=context.js.map - -/***/ }), - -/***/ 5658: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=types.js.map - -/***/ }), - -/***/ 7171: -/***/ ((__unused_webpack_module, exports) => { + SystemErrorRetryPolicy.prototype.sendRequest = function (request) { + var _this = this; + return this._nextPolicy + .sendRequest(request.clone()) + .catch(function (error) { return retry$1(_this, request, error.response, error); }); + }; + return SystemErrorRetryPolicy; +}(BaseRequestPolicy)); +function retry$1(policy, request, operationResponse, err, retryData) { + return tslib.__awaiter(this, void 0, void 0, function () { + function shouldPolicyRetry(_response, error) { + if (error && + error.code && + (error.code === "ETIMEDOUT" || + error.code === "ESOCKETTIMEDOUT" || + error.code === "ECONNREFUSED" || + error.code === "ECONNRESET" || + error.code === "ENOENT")) { + return true; + } + return false; + } + var nestedErr_1; + return tslib.__generator(this, function (_a) { + switch (_a.label) { + case 0: + retryData = updateRetryData(policy, retryData, err); + if (!shouldRetry(policy.retryCount, shouldPolicyRetry, retryData, operationResponse, err)) return [3 /*break*/, 5]; + _a.label = 1; + case 1: + _a.trys.push([1, 3, , 4]); + return [4 /*yield*/, delay(retryData.retryInterval)]; + case 2: + _a.sent(); + return [2 /*return*/, policy._nextPolicy.sendRequest(request.clone())]; + case 3: + nestedErr_1 = _a.sent(); + return [2 /*return*/, retry$1(policy, request, operationResponse, nestedErr_1, retryData)]; + case 4: return [3 /*break*/, 6]; + case 5: + if (err) { + // If the operation failed in the end, return all errors instead of just the last one + return [2 /*return*/, Promise.reject(retryData.error)]; + } + return [2 /*return*/, operationResponse]; + case 6: return [2 /*return*/]; + } + }); + }); +} -"use strict"; +// Copyright (c) Microsoft Corporation. +(function (QueryCollectionFormat) { + QueryCollectionFormat["Csv"] = ","; + QueryCollectionFormat["Ssv"] = " "; + QueryCollectionFormat["Tsv"] = "\t"; + QueryCollectionFormat["Pipes"] = "|"; + QueryCollectionFormat["Multi"] = "Multi"; +})(exports.QueryCollectionFormat || (exports.QueryCollectionFormat = {})); -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DiagConsoleLogger = void 0; -var consoleMap = [ - { n: 'error', c: 'error' }, - { n: 'warn', c: 'warn' }, - { n: 'info', c: 'info' }, - { n: 'debug', c: 'debug' }, - { n: 'verbose', c: 'trace' }, -]; +// Copyright (c) Microsoft Corporation. /** - * A simple Immutable Console based diagnostic logger which will output any messages to the Console. - * If you want to limit the amount of logging to a specific level or lower use the - * {@link createLogLevelDiagLogger} + * @internal */ -var DiagConsoleLogger = /** @class */ (function () { - function DiagConsoleLogger() { - function _consoleFunc(funcName) { - return function () { - var orgArguments = arguments; - if (console) { - // Some environments only expose the console when the F12 developer console is open - var theFunc = console[funcName]; - if (typeof theFunc !== 'function') { - // Not all environments support all functions - theFunc = console.log; - } - // One last final check - if (typeof theFunc === 'function') { - return theFunc.apply(console, orgArguments); - } - } - }; - } - for (var i = 0; i < consoleMap.length; i++) { - this[consoleMap[i].n] = _consoleFunc(consoleMap[i].c); - } +var noProxyList = []; +var noProxyListLoaded = false; +var byPassedList = new Map(); +function loadEnvironmentProxyValue() { + if (!process) { + return undefined; } - return DiagConsoleLogger; -}()); -exports.DiagConsoleLogger = DiagConsoleLogger; -//# sourceMappingURL=consoleLogger.js.map - -/***/ }), - -/***/ 8266: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__nccwpck_require__(7171), exports); -__exportStar(__nccwpck_require__(2339), exports); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 6430: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + var httpsProxy = getEnvironmentValue(Constants.HTTPS_PROXY); + var allProxy = getEnvironmentValue(Constants.ALL_PROXY); + var httpProxy = getEnvironmentValue(Constants.HTTP_PROXY); + return httpsProxy || allProxy || httpProxy; +} +// Check whether the host of a given `uri` is in the noProxyList. +// If there's a match, any request sent to the same host won't have the proxy settings set. +// This implementation is a port of https://github.com/Azure/azure-sdk-for-net/blob/8cca811371159e527159c7eb65602477898683e2/sdk/core/Azure.Core/src/Pipeline/Internal/HttpEnvironmentProxy.cs#L210 +function isBypassed(uri) { + if (noProxyList.length === 0) { + return false; + } + var host = URLBuilder.parse(uri).getHost(); + if (byPassedList.has(host)) { + return byPassedList.get(host); + } + var isBypassedFlag = false; + for (var _i = 0, noProxyList_1 = noProxyList; _i < noProxyList_1.length; _i++) { + var pattern = noProxyList_1[_i]; + if (pattern[0] === ".") { + // This should match either domain it self or any subdomain or host + // .foo.com will match foo.com it self or *.foo.com + if (host.endsWith(pattern)) { + isBypassedFlag = true; + } + else { + if (host.length === pattern.length - 1 && host === pattern.slice(1)) { + isBypassedFlag = true; + } + } + } + else { + if (host === pattern) { + isBypassedFlag = true; + } + } + } + byPassedList.set(host, isBypassedFlag); + return isBypassedFlag; +} +/** + * @internal */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.createLogLevelDiagLogger = void 0; -var types_1 = __nccwpck_require__(2339); -function createLogLevelDiagLogger(maxLevel, logger) { - if (maxLevel < types_1.DiagLogLevel.NONE) { - maxLevel = types_1.DiagLogLevel.NONE; +function loadNoProxy() { + var noProxy = getEnvironmentValue(Constants.NO_PROXY); + noProxyListLoaded = true; + if (noProxy) { + return noProxy + .split(",") + .map(function (item) { return item.trim(); }) + .filter(function (item) { return item.length; }); } - else if (maxLevel > types_1.DiagLogLevel.ALL) { - maxLevel = types_1.DiagLogLevel.ALL; + return []; +} +function getDefaultProxySettings(proxyUrl) { + if (!proxyUrl) { + proxyUrl = loadEnvironmentProxyValue(); + if (!proxyUrl) { + return undefined; + } } - // In case the logger is null or undefined - logger = logger || {}; - function _filterFunc(funcName, theLevel) { - var theFunc = logger[funcName]; - if (typeof theFunc === 'function' && maxLevel >= theLevel) { - return theFunc.bind(logger); + var _a = extractAuthFromUrl(proxyUrl), username = _a.username, password = _a.password, urlWithoutAuth = _a.urlWithoutAuth; + var parsedUrl = URLBuilder.parse(urlWithoutAuth); + var schema = parsedUrl.getScheme() ? parsedUrl.getScheme() + "://" : ""; + return { + host: schema + parsedUrl.getHost(), + port: Number.parseInt(parsedUrl.getPort() || "80"), + username: username, + password: password + }; +} +function proxyPolicy(proxySettings) { + if (!proxySettings) { + proxySettings = getDefaultProxySettings(); + } + if (!noProxyListLoaded) { + noProxyList.push.apply(noProxyList, loadNoProxy()); + } + return { + create: function (nextPolicy, options) { + return new ProxyPolicy(nextPolicy, options, proxySettings); } - return function () { }; + }; +} +function extractAuthFromUrl(url) { + var atIndex = url.indexOf("@"); + if (atIndex === -1) { + return { urlWithoutAuth: url }; } + var schemeIndex = url.indexOf("://"); + var authStart = schemeIndex !== -1 ? schemeIndex + 3 : 0; + var auth = url.substring(authStart, atIndex); + var colonIndex = auth.indexOf(":"); + var hasPassword = colonIndex !== -1; + var username = hasPassword ? auth.substring(0, colonIndex) : auth; + var password = hasPassword ? auth.substring(colonIndex + 1) : undefined; + var urlWithoutAuth = url.substring(0, authStart) + url.substring(atIndex + 1); return { - error: _filterFunc('error', types_1.DiagLogLevel.ERROR), - warn: _filterFunc('warn', types_1.DiagLogLevel.WARN), - info: _filterFunc('info', types_1.DiagLogLevel.INFO), - debug: _filterFunc('debug', types_1.DiagLogLevel.DEBUG), - verbose: _filterFunc('verbose', types_1.DiagLogLevel.VERBOSE), + username: username, + password: password, + urlWithoutAuth: urlWithoutAuth }; } -exports.createLogLevelDiagLogger = createLogLevelDiagLogger; -//# sourceMappingURL=logLevelLogger.js.map - -/***/ }), - -/***/ 2339: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; +var ProxyPolicy = /** @class */ (function (_super) { + tslib.__extends(ProxyPolicy, _super); + function ProxyPolicy(nextPolicy, options, proxySettings) { + var _this = _super.call(this, nextPolicy, options) || this; + _this.proxySettings = proxySettings; + return _this; + } + ProxyPolicy.prototype.sendRequest = function (request) { + if (!request.proxySettings && !isBypassed(request.url)) { + request.proxySettings = this.proxySettings; + } + return this._nextPolicy.sendRequest(request); + }; + return ProxyPolicy; +}(BaseRequestPolicy)); -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DiagLogLevel = void 0; +// Copyright (c) Microsoft Corporation. +var StatusCodes = Constants.HttpConstants.StatusCodes; +function throttlingRetryPolicy() { + return { + create: function (nextPolicy, options) { + return new ThrottlingRetryPolicy(nextPolicy, options); + } + }; +} /** - * Defines the available internal logging levels for the diagnostic logger, the numeric values - * of the levels are defined to match the original values from the initial LogLevel to avoid - * compatibility/migration issues for any implementation that assume the numeric ordering. + * To learn more, please refer to + * https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-request-limits, + * https://docs.microsoft.com/en-us/azure/azure-subscription-service-limits and + * https://docs.microsoft.com/en-us/azure/virtual-machines/troubleshooting/troubleshooting-throttling-errors */ -var DiagLogLevel; -(function (DiagLogLevel) { - /** Diagnostic Logging level setting to disable all logging (except and forced logs) */ - DiagLogLevel[DiagLogLevel["NONE"] = 0] = "NONE"; - /** Identifies an error scenario */ - DiagLogLevel[DiagLogLevel["ERROR"] = 30] = "ERROR"; - /** Identifies a warning scenario */ - DiagLogLevel[DiagLogLevel["WARN"] = 50] = "WARN"; - /** General informational log message */ - DiagLogLevel[DiagLogLevel["INFO"] = 60] = "INFO"; - /** General debug log message */ - DiagLogLevel[DiagLogLevel["DEBUG"] = 70] = "DEBUG"; - /** - * Detailed trace level logging should only be used for development, should only be set - * in a development environment. - */ - DiagLogLevel[DiagLogLevel["VERBOSE"] = 80] = "VERBOSE"; - /** Used to set the logging level to include all logging */ - DiagLogLevel[DiagLogLevel["ALL"] = 9999] = "ALL"; -})(DiagLogLevel = exports.DiagLogLevel || (exports.DiagLogLevel = {})); -//# sourceMappingURL=types.js.map - -/***/ }), - -/***/ 6865: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +var ThrottlingRetryPolicy = /** @class */ (function (_super) { + tslib.__extends(ThrottlingRetryPolicy, _super); + function ThrottlingRetryPolicy(nextPolicy, options, _handleResponse) { + var _this = _super.call(this, nextPolicy, options) || this; + _this._handleResponse = _handleResponse || _this._defaultResponseHandler; + return _this; + } + ThrottlingRetryPolicy.prototype.sendRequest = function (httpRequest) { + return tslib.__awaiter(this, void 0, void 0, function () { + var _this = this; + return tslib.__generator(this, function (_a) { + return [2 /*return*/, this._nextPolicy.sendRequest(httpRequest.clone()).then(function (response) { + if (response.status !== StatusCodes.TooManyRequests) { + return response; + } + else { + return _this._handleResponse(httpRequest, response); + } + })]; + }); + }); + }; + ThrottlingRetryPolicy.prototype._defaultResponseHandler = function (httpRequest, httpResponse) { + return tslib.__awaiter(this, void 0, void 0, function () { + var retryAfterHeader, delayInMs; + var _this = this; + return tslib.__generator(this, function (_a) { + retryAfterHeader = httpResponse.headers.get(Constants.HeaderConstants.RETRY_AFTER); + if (retryAfterHeader) { + delayInMs = ThrottlingRetryPolicy.parseRetryAfterHeader(retryAfterHeader); + if (delayInMs) { + return [2 /*return*/, delay(delayInMs).then(function (_) { return _this._nextPolicy.sendRequest(httpRequest); })]; + } + } + return [2 /*return*/, httpResponse]; + }); + }); + }; + ThrottlingRetryPolicy.parseRetryAfterHeader = function (headerValue) { + var retryAfterInSeconds = Number(headerValue); + if (Number.isNaN(retryAfterInSeconds)) { + return ThrottlingRetryPolicy.parseDateRetryAfterHeader(headerValue); + } + else { + return retryAfterInSeconds * 1000; + } + }; + ThrottlingRetryPolicy.parseDateRetryAfterHeader = function (headerValue) { + try { + var now = Date.now(); + var date = Date.parse(headerValue); + var diff = date - now; + return Number.isNaN(diff) ? undefined : diff; + } + catch (error) { + return undefined; + } + }; + return ThrottlingRetryPolicy; +}(BaseRequestPolicy)); -"use strict"; +// Copyright (c) Microsoft Corporation. +function signingPolicy(authenticationProvider) { + return { + create: function (nextPolicy, options) { + return new SigningPolicy(nextPolicy, options, authenticationProvider); + } + }; +} +var SigningPolicy = /** @class */ (function (_super) { + tslib.__extends(SigningPolicy, _super); + function SigningPolicy(nextPolicy, options, authenticationProvider) { + var _this = _super.call(this, nextPolicy, options) || this; + _this.authenticationProvider = authenticationProvider; + return _this; + } + SigningPolicy.prototype.signRequest = function (request) { + return this.authenticationProvider.signRequest(request); + }; + SigningPolicy.prototype.sendRequest = function (request) { + var _this = this; + return this.signRequest(request).then(function (nextRequest) { + return _this._nextPolicy.sendRequest(nextRequest); + }); + }; + return SigningPolicy; +}(BaseRequestPolicy)); -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +// Copyright (c) Microsoft Corporation. +var DefaultKeepAliveOptions = { + enable: true }; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.diag = exports.propagation = exports.trace = exports.context = exports.isValidSpanId = exports.isValidTraceId = exports.isSpanContextValid = exports.INVALID_SPAN_CONTEXT = exports.INVALID_TRACEID = exports.INVALID_SPANID = void 0; -__exportStar(__nccwpck_require__(6196), exports); -__exportStar(__nccwpck_require__(9777), exports); -__exportStar(__nccwpck_require__(7413), exports); -__exportStar(__nccwpck_require__(8266), exports); -__exportStar(__nccwpck_require__(3848), exports); -__exportStar(__nccwpck_require__(9017), exports); -__exportStar(__nccwpck_require__(761), exports); -__exportStar(__nccwpck_require__(9217), exports); -__exportStar(__nccwpck_require__(8984), exports); -__exportStar(__nccwpck_require__(9067), exports); -__exportStar(__nccwpck_require__(913), exports); -__exportStar(__nccwpck_require__(2793), exports); -__exportStar(__nccwpck_require__(5159), exports); -__exportStar(__nccwpck_require__(9483), exports); -__exportStar(__nccwpck_require__(1569), exports); -__exportStar(__nccwpck_require__(7502), exports); -__exportStar(__nccwpck_require__(9955), exports); -__exportStar(__nccwpck_require__(3107), exports); -__exportStar(__nccwpck_require__(8052), exports); -__exportStar(__nccwpck_require__(9618), exports); -__exportStar(__nccwpck_require__(1997), exports); -__exportStar(__nccwpck_require__(886), exports); -__exportStar(__nccwpck_require__(8434), exports); -__exportStar(__nccwpck_require__(2749), exports); -__exportStar(__nccwpck_require__(9824), exports); -__exportStar(__nccwpck_require__(3833), exports); -var spancontext_utils_1 = __nccwpck_require__(541); -Object.defineProperty(exports, "INVALID_SPANID", ({ enumerable: true, get: function () { return spancontext_utils_1.INVALID_SPANID; } })); -Object.defineProperty(exports, "INVALID_TRACEID", ({ enumerable: true, get: function () { return spancontext_utils_1.INVALID_TRACEID; } })); -Object.defineProperty(exports, "INVALID_SPAN_CONTEXT", ({ enumerable: true, get: function () { return spancontext_utils_1.INVALID_SPAN_CONTEXT; } })); -Object.defineProperty(exports, "isSpanContextValid", ({ enumerable: true, get: function () { return spancontext_utils_1.isSpanContextValid; } })); -Object.defineProperty(exports, "isValidTraceId", ({ enumerable: true, get: function () { return spancontext_utils_1.isValidTraceId; } })); -Object.defineProperty(exports, "isValidSpanId", ({ enumerable: true, get: function () { return spancontext_utils_1.isValidSpanId; } })); -__exportStar(__nccwpck_require__(7135), exports); -__exportStar(__nccwpck_require__(469), exports); -__exportStar(__nccwpck_require__(5658), exports); -var context_1 = __nccwpck_require__(7407); -/** Entrypoint for context API */ -exports.context = context_1.ContextAPI.getInstance(); -var trace_1 = __nccwpck_require__(9857); -/** Entrypoint for trace API */ -exports.trace = trace_1.TraceAPI.getInstance(); -var propagation_1 = __nccwpck_require__(9362); -/** Entrypoint for propagation API */ -exports.propagation = propagation_1.PropagationAPI.getInstance(); -var diag_1 = __nccwpck_require__(4658); +function keepAlivePolicy(keepAliveOptions) { + return { + create: function (nextPolicy, options) { + return new KeepAlivePolicy(nextPolicy, options, keepAliveOptions || DefaultKeepAliveOptions); + } + }; +} /** - * Entrypoint for Diag API. - * Defines Diagnostic handler used for internal diagnostic logging operations. - * The default provides a Noop DiagLogger implementation which may be changed via the - * diag.setLogger(logger: DiagLogger) function. + * KeepAlivePolicy is a policy used to control keep alive settings for every request. */ -exports.diag = diag_1.DiagAPI.instance(); -exports.default = { - trace: exports.trace, - context: exports.context, - propagation: exports.propagation, - diag: exports.diag, -}; -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 6965: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; +var KeepAlivePolicy = /** @class */ (function (_super) { + tslib.__extends(KeepAlivePolicy, _super); + /** + * Creates an instance of KeepAlivePolicy. + * + * @param nextPolicy - + * @param options - + * @param keepAliveOptions - + */ + function KeepAlivePolicy(nextPolicy, options, keepAliveOptions) { + var _this = _super.call(this, nextPolicy, options) || this; + _this.keepAliveOptions = keepAliveOptions; + return _this; + } + /** + * Sends out request. + * + * @param request - + * @returns + */ + KeepAlivePolicy.prototype.sendRequest = function (request) { + return tslib.__awaiter(this, void 0, void 0, function () { + return tslib.__generator(this, function (_a) { + request.keepAlive = this.keepAliveOptions.enable; + return [2 /*return*/, this._nextPolicy.sendRequest(request)]; + }); + }); + }; + return KeepAlivePolicy; +}(BaseRequestPolicy)); -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.unregisterGlobal = exports.getGlobal = exports.registerGlobal = void 0; -var __1 = __nccwpck_require__(6865); -var platform_1 = __nccwpck_require__(4730); -var version_1 = __nccwpck_require__(4044); -var semver_1 = __nccwpck_require__(5149); -var major = version_1.VERSION.split('.')[0]; -var GLOBAL_OPENTELEMETRY_API_KEY = Symbol.for("io.opentelemetry.js.api." + major); -var _global = platform_1._globalThis; -function registerGlobal(type, instance, allowOverride) { - var _a; - if (allowOverride === void 0) { allowOverride = false; } - _global[GLOBAL_OPENTELEMETRY_API_KEY] = (_a = _global[GLOBAL_OPENTELEMETRY_API_KEY]) !== null && _a !== void 0 ? _a : { - version: version_1.VERSION, +// Copyright (c) Microsoft Corporation. +var createSpan = coreTracing.createSpanFunction({ + packagePrefix: "", + namespace: "" +}); +function tracingPolicy(tracingOptions) { + if (tracingOptions === void 0) { tracingOptions = {}; } + return { + create: function (nextPolicy, options) { + return new TracingPolicy(nextPolicy, options, tracingOptions); + } }; - var api = _global[GLOBAL_OPENTELEMETRY_API_KEY]; - if (!allowOverride && api[type]) { - // already registered an API of this type - var err = new Error("@opentelemetry/api: Attempted duplicate registration of API: " + type); - __1.diag.error(err.stack || err.message); - return; - } - if (api.version !== version_1.VERSION) { - // All registered APIs must be of the same version exactly - var err = new Error('@opentelemetry/api: All API registration versions must match'); - __1.diag.error(err.stack || err.message); - return; - } - api[type] = instance; -} -exports.registerGlobal = registerGlobal; -function getGlobal(type) { - var _a, _b; - var globalVersion = (_a = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _a === void 0 ? void 0 : _a.version; - if (!globalVersion || !semver_1.isCompatible(globalVersion)) { - return; - } - return (_b = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _b === void 0 ? void 0 : _b[type]; } -exports.getGlobal = getGlobal; -function unregisterGlobal(type) { - var api = _global[GLOBAL_OPENTELEMETRY_API_KEY]; - if (api) { - delete api[type]; +var TracingPolicy = /** @class */ (function (_super) { + tslib.__extends(TracingPolicy, _super); + function TracingPolicy(nextPolicy, options, tracingOptions) { + var _this = _super.call(this, nextPolicy, options) || this; + _this.userAgent = tracingOptions.userAgent; + return _this; } -} -exports.unregisterGlobal = unregisterGlobal; -//# sourceMappingURL=global-utils.js.map - -/***/ }), - -/***/ 5149: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; + TracingPolicy.prototype.sendRequest = function (request) { + return tslib.__awaiter(this, void 0, void 0, function () { + var path, span, spanContext, traceParentHeader, traceState, response, serviceRequestId, err_1; + return tslib.__generator(this, function (_a) { + switch (_a.label) { + case 0: + if (!request.tracingContext) { + return [2 /*return*/, this._nextPolicy.sendRequest(request)]; + } + path = URLBuilder.parse(request.url).getPath() || "/"; + span = createSpan(path, { + tracingOptions: { + spanOptions: tslib.__assign(tslib.__assign({}, request.spanOptions), { kind: coreTracing.SpanKind.CLIENT }), + tracingContext: request.tracingContext + } + }).span; + span.setAttributes({ + "http.method": request.method, + "http.url": request.url, + requestId: request.requestId + }); + if (this.userAgent) { + span.setAttribute("http.user_agent", this.userAgent); + } + _a.label = 1; + case 1: + _a.trys.push([1, 3, 4, 5]); + spanContext = span.context(); + traceParentHeader = coreTracing.getTraceParentHeader(spanContext); + if (traceParentHeader) { + request.headers.set("traceparent", traceParentHeader); + traceState = spanContext.traceState && spanContext.traceState.serialize(); + // if tracestate is set, traceparent MUST be set, so only set tracestate after traceparent + if (traceState) { + request.headers.set("tracestate", traceState); + } + } + return [4 /*yield*/, this._nextPolicy.sendRequest(request)]; + case 2: + response = _a.sent(); + span.setAttribute("http.status_code", response.status); + serviceRequestId = response.headers.get("x-ms-request-id"); + if (serviceRequestId) { + span.setAttribute("serviceRequestId", serviceRequestId); + } + span.setStatus({ + code: coreTracing.SpanStatusCode.OK + }); + return [2 /*return*/, response]; + case 3: + err_1 = _a.sent(); + span.setStatus({ + code: coreTracing.SpanStatusCode.ERROR, + message: err_1.message + }); + span.setAttribute("http.status_code", err_1.statusCode); + throw err_1; + case 4: + span.end(); + return [7 /*endfinally*/]; + case 5: return [2 /*return*/]; + } + }); + }); + }; + return TracingPolicy; +}(BaseRequestPolicy)); -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. +// Copyright (c) Microsoft Corporation. +/** + * Returns a request policy factory that can be used to create an instance of + * {@link DisableResponseDecompressionPolicy}. */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isCompatible = exports._makeCompatibilityCheck = void 0; -var version_1 = __nccwpck_require__(4044); -var re = /^(\d+)\.(\d+)\.(\d+)(?:-(.*))?$/; +function disableResponseDecompressionPolicy() { + return { + create: function (nextPolicy, options) { + return new DisableResponseDecompressionPolicy(nextPolicy, options); + } + }; +} /** - * Create a function to test an API version to see if it is compatible with the provided ownVersion. - * - * The returned function has the following semantics: - * - Exact match is always compatible - * - Major versions must match exactly - * - 1.x package cannot use global 2.x package - * - 2.x package cannot use global 1.x package - * - The minor version of the API module requesting access to the global API must be less than or equal to the minor version of this API - * - 1.3 package may use 1.4 global because the later global contains all functions 1.3 expects - * - 1.4 package may NOT use 1.3 global because it may try to call functions which don't exist on 1.3 - * - If the major version is 0, the minor version is treated as the major and the patch is treated as the minor - * - Patch and build tag differences are not considered at this time - * - * @param ownVersion version which should be checked against + * A policy to disable response decompression according to Accept-Encoding header + * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Encoding */ -function _makeCompatibilityCheck(ownVersion) { - var acceptedVersions = new Set([ownVersion]); - var rejectedVersions = new Set(); - var myVersionMatch = ownVersion.match(re); - if (!myVersionMatch) { - // we cannot guarantee compatibility so we always return noop - return function () { return false; }; +var DisableResponseDecompressionPolicy = /** @class */ (function (_super) { + tslib.__extends(DisableResponseDecompressionPolicy, _super); + /** + * Creates an instance of DisableResponseDecompressionPolicy. + * + * @param nextPolicy - + * @param options - + */ + // The parent constructor is protected. + /* eslint-disable-next-line @typescript-eslint/no-useless-constructor */ + function DisableResponseDecompressionPolicy(nextPolicy, options) { + return _super.call(this, nextPolicy, options) || this; } - var ownVersionParsed = { - major: +myVersionMatch[1], - minor: +myVersionMatch[2], - patch: +myVersionMatch[3], + /** + * Sends out request. + * + * @param request - + * @returns + */ + DisableResponseDecompressionPolicy.prototype.sendRequest = function (request) { + return tslib.__awaiter(this, void 0, void 0, function () { + return tslib.__generator(this, function (_a) { + request.decompressResponse = false; + return [2 /*return*/, this._nextPolicy.sendRequest(request)]; + }); + }); }; - function _reject(v) { - rejectedVersions.add(v); - return false; - } - function _accept(v) { - acceptedVersions.add(v); - return true; - } - return function isCompatible(globalVersion) { - if (acceptedVersions.has(globalVersion)) { - return true; - } - if (rejectedVersions.has(globalVersion)) { - return false; - } - var globalVersionMatch = globalVersion.match(re); - if (!globalVersionMatch) { - // cannot parse other version - // we cannot guarantee compatibility so we always noop - return _reject(globalVersion); - } - var globalVersionParsed = { - major: +globalVersionMatch[1], - minor: +globalVersionMatch[2], - patch: +globalVersionMatch[3], - }; - // major versions must match - if (ownVersionParsed.major !== globalVersionParsed.major) { - return _reject(globalVersion); - } - if (ownVersionParsed.major === 0) { - if (ownVersionParsed.minor === globalVersionParsed.minor && - ownVersionParsed.patch <= globalVersionParsed.patch) { - return _accept(globalVersion); - } - return _reject(globalVersion); - } - if (ownVersionParsed.minor <= globalVersionParsed.minor) { - return _accept(globalVersion); + return DisableResponseDecompressionPolicy; +}(BaseRequestPolicy)); + +// Copyright (c) Microsoft Corporation. +function ndJsonPolicy() { + return { + create: function (nextPolicy, options) { + return new NdJsonPolicy(nextPolicy, options); } - return _reject(globalVersion); }; } -exports._makeCompatibilityCheck = _makeCompatibilityCheck; /** - * Test an API version to see if it is compatible with this API. - * - * - Exact match is always compatible - * - Major versions must match exactly - * - 1.x package cannot use global 2.x package - * - 2.x package cannot use global 1.x package - * - The minor version of the API module requesting access to the global API must be less than or equal to the minor version of this API - * - 1.3 package may use 1.4 global because the later global contains all functions 1.3 expects - * - 1.4 package may NOT use 1.3 global because it may try to call functions which don't exist on 1.3 - * - If the major version is 0, the minor version is treated as the major and the patch is treated as the minor - * - Patch and build tag differences are not considered at this time - * - * @param version version of the API requesting an instance of the global API - */ -exports.isCompatible = _makeCompatibilityCheck(version_1.VERSION); -//# sourceMappingURL=semver.js.map - -/***/ }), - -/***/ 4730: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__nccwpck_require__(6819), exports); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 9164: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports._globalThis = void 0; -/** only globals that common to node and browsers are allowed */ -// eslint-disable-next-line node/no-unsupported-features/es-builtins -exports._globalThis = typeof globalThis === 'object' ? globalThis : global; -//# sourceMappingURL=globalThis.js.map - -/***/ }), - -/***/ 6819: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * NdJsonPolicy that formats a JSON array as newline-delimited JSON */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__nccwpck_require__(9164), exports); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 3848: -/***/ ((__unused_webpack_module, exports) => { +var NdJsonPolicy = /** @class */ (function (_super) { + tslib.__extends(NdJsonPolicy, _super); + /** + * Creates an instance of KeepAlivePolicy. + */ + function NdJsonPolicy(nextPolicy, options) { + return _super.call(this, nextPolicy, options) || this; + } + /** + * Sends a request. + */ + NdJsonPolicy.prototype.sendRequest = function (request) { + return tslib.__awaiter(this, void 0, void 0, function () { + var body; + return tslib.__generator(this, function (_a) { + // There currently isn't a good way to bypass the serializer + if (typeof request.body === "string" && request.body.startsWith("[")) { + body = JSON.parse(request.body); + if (Array.isArray(body)) { + request.body = body.map(function (item) { return JSON.stringify(item) + "\n"; }).join(""); + } + } + return [2 /*return*/, this._nextPolicy.sendRequest(request)]; + }); + }); + }; + return NdJsonPolicy; +}(BaseRequestPolicy)); -"use strict"; +// Copyright (c) Microsoft Corporation. +var cachedHttpClient; +function getCachedDefaultHttpClient() { + if (!cachedHttpClient) { + cachedHttpClient = new NodeFetchHttpClient(); + } + return cachedHttpClient; +} -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NOOP_TEXT_MAP_PROPAGATOR = exports.NoopTextMapPropagator = void 0; +// Copyright (c) Microsoft Corporation. /** - * No-op implementations of {@link TextMapPropagator}. + * ServiceClient sends service requests and receives responses. */ -var NoopTextMapPropagator = /** @class */ (function () { - function NoopTextMapPropagator() { +var ServiceClient = /** @class */ (function () { + /** + * The ServiceClient constructor + * @param credentials - The credentials used for authentication with the service. + * @param options - The service client options that govern the behavior of the client. + */ + function ServiceClient(credentials, + /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */ + options) { + var _this = this; + if (!options) { + options = {}; + } + this._withCredentials = options.withCredentials || false; + this._httpClient = options.httpClient || getCachedDefaultHttpClient(); + this._requestPolicyOptions = new RequestPolicyOptions(options.httpPipelineLogger); + var requestPolicyFactories; + if (Array.isArray(options.requestPolicyFactories)) { + logger.info("ServiceClient: using custom request policies"); + requestPolicyFactories = options.requestPolicyFactories; + } + else { + var authPolicyFactory = undefined; + if (coreAuth.isTokenCredential(credentials)) { + logger.info("ServiceClient: creating bearer token authentication policy from provided credentials"); + // Create a wrapped RequestPolicyFactory here so that we can provide the + // correct scope to the BearerTokenAuthenticationPolicy at the first time + // one is requested. This is needed because generated ServiceClient + // implementations do not set baseUri until after ServiceClient's constructor + // is finished, leaving baseUri empty at the time when it is needed to + // build the correct scope name. + var wrappedPolicyFactory = function () { + var bearerTokenPolicyFactory = undefined; + // eslint-disable-next-line @typescript-eslint/no-this-alias + var serviceClient = _this; + var serviceClientOptions = options; + return { + create: function (nextPolicy, createOptions) { + var credentialScopes = getCredentialScopes(serviceClientOptions, serviceClient.baseUri); + if (!credentialScopes) { + throw new Error("When using credential, the ServiceClient must contain a baseUri or a credentialScopes in ServiceClientOptions. Unable to create a bearerTokenAuthenticationPolicy"); + } + if (bearerTokenPolicyFactory === undefined || bearerTokenPolicyFactory === null) { + bearerTokenPolicyFactory = bearerTokenAuthenticationPolicy(credentials, credentialScopes); + } + return bearerTokenPolicyFactory.create(nextPolicy, createOptions); + } + }; + }; + authPolicyFactory = wrappedPolicyFactory(); + } + else if (credentials && typeof credentials.signRequest === "function") { + logger.info("ServiceClient: creating signing policy from provided credentials"); + authPolicyFactory = signingPolicy(credentials); + } + else if (credentials !== undefined && credentials !== null) { + throw new Error("The credentials argument must implement the TokenCredential interface"); + } + logger.info("ServiceClient: using default request policies"); + requestPolicyFactories = createDefaultRequestPolicyFactories(authPolicyFactory, options); + if (options.requestPolicyFactories) { + // options.requestPolicyFactories can also be a function that manipulates + // the default requestPolicyFactories array + var newRequestPolicyFactories = options.requestPolicyFactories(requestPolicyFactories); + if (newRequestPolicyFactories) { + requestPolicyFactories = newRequestPolicyFactories; + } + } + } + this._requestPolicyFactories = requestPolicyFactories; } - /** Noop inject function does nothing */ - NoopTextMapPropagator.prototype.inject = function (_context, _carrier) { }; - /** Noop extract function does nothing and returns the input context */ - NoopTextMapPropagator.prototype.extract = function (context, _carrier) { - return context; + /** + * Send the provided httpRequest. + */ + ServiceClient.prototype.sendRequest = function (options) { + if (options === null || options === undefined || typeof options !== "object") { + throw new Error("options cannot be null or undefined and it must be of type object."); + } + var httpRequest; + try { + if (isWebResourceLike(options)) { + options.validateRequestProperties(); + httpRequest = options; + } + else { + httpRequest = new WebResource(); + httpRequest = httpRequest.prepare(options); + } + } + catch (error) { + return Promise.reject(error); + } + var httpPipeline = this._httpClient; + if (this._requestPolicyFactories && this._requestPolicyFactories.length > 0) { + for (var i = this._requestPolicyFactories.length - 1; i >= 0; --i) { + httpPipeline = this._requestPolicyFactories[i].create(httpPipeline, this._requestPolicyOptions); + } + } + return httpPipeline.sendRequest(httpRequest); }; - NoopTextMapPropagator.prototype.fields = function () { - return []; + /** + * Send an HTTP request that is populated using the provided OperationSpec. + * @param operationArguments - The arguments that the HTTP request's templated values will be populated from. + * @param operationSpec - The OperationSpec to use to populate the httpRequest. + * @param callback - The callback to call when the response is received. + */ + ServiceClient.prototype.sendOperationRequest = function (operationArguments, operationSpec, callback) { + var _a; + return tslib.__awaiter(this, void 0, void 0, function () { + var serializerOptions, httpRequest, result, baseUri, requestUrl, _i, _b, urlParameter, urlParameterValue, _c, _d, queryParameter, queryParameterValue, index, item, index, contentType, _e, _f, headerParameter, headerValue, headerCollectionPrefix, _g, _h, key, options, customHeaderName, rawResponse, sendRequestError, error_1, error_2, cb; + return tslib.__generator(this, function (_j) { + switch (_j.label) { + case 0: + if (typeof operationArguments.options === "function") { + callback = operationArguments.options; + operationArguments.options = undefined; + } + serializerOptions = (_a = operationArguments.options) === null || _a === void 0 ? void 0 : _a.serializerOptions; + httpRequest = new WebResource(); + _j.label = 1; + case 1: + _j.trys.push([1, 6, , 7]); + baseUri = operationSpec.baseUrl || this.baseUri; + if (!baseUri) { + throw new Error("If operationSpec.baseUrl is not specified, then the ServiceClient must have a baseUri string property that contains the base URL to use."); + } + httpRequest.method = operationSpec.httpMethod; + httpRequest.operationSpec = operationSpec; + requestUrl = URLBuilder.parse(baseUri); + if (operationSpec.path) { + requestUrl.appendPath(operationSpec.path); + } + if (operationSpec.urlParameters && operationSpec.urlParameters.length > 0) { + for (_i = 0, _b = operationSpec.urlParameters; _i < _b.length; _i++) { + urlParameter = _b[_i]; + urlParameterValue = getOperationArgumentValueFromParameter(this, operationArguments, urlParameter, operationSpec.serializer); + urlParameterValue = operationSpec.serializer.serialize(urlParameter.mapper, urlParameterValue, getPathStringFromParameter(urlParameter), serializerOptions); + if (!urlParameter.skipEncoding) { + urlParameterValue = encodeURIComponent(urlParameterValue); + } + requestUrl.replaceAll("{" + (urlParameter.mapper.serializedName || getPathStringFromParameter(urlParameter)) + "}", urlParameterValue); + } + } + if (operationSpec.queryParameters && operationSpec.queryParameters.length > 0) { + for (_c = 0, _d = operationSpec.queryParameters; _c < _d.length; _c++) { + queryParameter = _d[_c]; + queryParameterValue = getOperationArgumentValueFromParameter(this, operationArguments, queryParameter, operationSpec.serializer); + if (queryParameterValue !== undefined && queryParameterValue !== null) { + queryParameterValue = operationSpec.serializer.serialize(queryParameter.mapper, queryParameterValue, getPathStringFromParameter(queryParameter), serializerOptions); + if (queryParameter.collectionFormat !== undefined && + queryParameter.collectionFormat !== null) { + if (queryParameter.collectionFormat === exports.QueryCollectionFormat.Multi) { + if (queryParameterValue.length === 0) { + // The collection is empty, no need to try serializing the current queryParam + continue; + } + else { + for (index in queryParameterValue) { + item = queryParameterValue[index]; + queryParameterValue[index] = + item === undefined || item === null ? "" : item.toString(); + } + } + } + else if (queryParameter.collectionFormat === exports.QueryCollectionFormat.Ssv || + queryParameter.collectionFormat === exports.QueryCollectionFormat.Tsv) { + queryParameterValue = queryParameterValue.join(queryParameter.collectionFormat); + } + } + if (!queryParameter.skipEncoding) { + if (Array.isArray(queryParameterValue)) { + for (index in queryParameterValue) { + if (queryParameterValue[index] !== undefined && + queryParameterValue[index] !== null) { + queryParameterValue[index] = encodeURIComponent(queryParameterValue[index]); + } + } + } + else { + queryParameterValue = encodeURIComponent(queryParameterValue); + } + } + if (queryParameter.collectionFormat !== undefined && + queryParameter.collectionFormat !== null && + queryParameter.collectionFormat !== exports.QueryCollectionFormat.Multi && + queryParameter.collectionFormat !== exports.QueryCollectionFormat.Ssv && + queryParameter.collectionFormat !== exports.QueryCollectionFormat.Tsv) { + queryParameterValue = queryParameterValue.join(queryParameter.collectionFormat); + } + requestUrl.setQueryParameter(queryParameter.mapper.serializedName || getPathStringFromParameter(queryParameter), queryParameterValue); + } + } + } + httpRequest.url = requestUrl.toString(); + contentType = operationSpec.contentType || this.requestContentType; + if (contentType && operationSpec.requestBody) { + httpRequest.headers.set("Content-Type", contentType); + } + if (operationSpec.headerParameters) { + for (_e = 0, _f = operationSpec.headerParameters; _e < _f.length; _e++) { + headerParameter = _f[_e]; + headerValue = getOperationArgumentValueFromParameter(this, operationArguments, headerParameter, operationSpec.serializer); + if (headerValue !== undefined && headerValue !== null) { + headerValue = operationSpec.serializer.serialize(headerParameter.mapper, headerValue, getPathStringFromParameter(headerParameter), serializerOptions); + headerCollectionPrefix = headerParameter.mapper + .headerCollectionPrefix; + if (headerCollectionPrefix) { + for (_g = 0, _h = Object.keys(headerValue); _g < _h.length; _g++) { + key = _h[_g]; + httpRequest.headers.set(headerCollectionPrefix + key, headerValue[key]); + } + } + else { + httpRequest.headers.set(headerParameter.mapper.serializedName || + getPathStringFromParameter(headerParameter), headerValue); + } + } + } + } + options = operationArguments.options; + if (options) { + if (options.customHeaders) { + for (customHeaderName in options.customHeaders) { + httpRequest.headers.set(customHeaderName, options.customHeaders[customHeaderName]); + } + } + if (options.abortSignal) { + httpRequest.abortSignal = options.abortSignal; + } + if (options.timeout) { + httpRequest.timeout = options.timeout; + } + if (options.onUploadProgress) { + httpRequest.onUploadProgress = options.onUploadProgress; + } + if (options.onDownloadProgress) { + httpRequest.onDownloadProgress = options.onDownloadProgress; + } + if (options.spanOptions) { + httpRequest.spanOptions = options.spanOptions; + } + if (options.tracingContext) { + httpRequest.tracingContext = options.tracingContext; + } + if (options.shouldDeserialize !== undefined && options.shouldDeserialize !== null) { + httpRequest.shouldDeserialize = options.shouldDeserialize; + } + } + httpRequest.withCredentials = this._withCredentials; + serializeRequestBody(this, httpRequest, operationArguments, operationSpec); + if (httpRequest.streamResponseStatusCodes === undefined) { + httpRequest.streamResponseStatusCodes = getStreamResponseStatusCodes(operationSpec); + } + rawResponse = void 0; + sendRequestError = void 0; + _j.label = 2; + case 2: + _j.trys.push([2, 4, , 5]); + return [4 /*yield*/, this.sendRequest(httpRequest)]; + case 3: + rawResponse = _j.sent(); + return [3 /*break*/, 5]; + case 4: + error_1 = _j.sent(); + sendRequestError = error_1; + return [3 /*break*/, 5]; + case 5: + if (sendRequestError) { + if (sendRequestError.response) { + sendRequestError.details = flattenResponse(sendRequestError.response, operationSpec.responses[sendRequestError.statusCode] || + operationSpec.responses["default"]); + } + result = Promise.reject(sendRequestError); + } + else { + result = Promise.resolve(flattenResponse(rawResponse, operationSpec.responses[rawResponse.status])); + } + return [3 /*break*/, 7]; + case 6: + error_2 = _j.sent(); + result = Promise.reject(error_2); + return [3 /*break*/, 7]; + case 7: + cb = callback; + if (cb) { + result + .then(function (res) { return cb(null, res._response.parsedBody, res._response.request, res._response); }) + .catch(function (err) { return cb(err); }); + } + return [2 /*return*/, result]; + } + }); + }); }; - return NoopTextMapPropagator; + return ServiceClient; }()); -exports.NoopTextMapPropagator = NoopTextMapPropagator; -exports.NOOP_TEXT_MAP_PROPAGATOR = new NoopTextMapPropagator(); -//# sourceMappingURL=NoopTextMapPropagator.js.map - -/***/ }), - -/***/ 9017: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.defaultTextMapSetter = exports.defaultTextMapGetter = void 0; -exports.defaultTextMapGetter = { - get: function (carrier, key) { - if (carrier == null) { - return undefined; +function serializeRequestBody(serviceClient, httpRequest, operationArguments, operationSpec) { + var _a, _b, _c, _d, _e, _f; + var serializerOptions = (_b = (_a = operationArguments.options) === null || _a === void 0 ? void 0 : _a.serializerOptions) !== null && _b !== void 0 ? _b : {}; + var updatedOptions = { + rootName: (_c = serializerOptions.rootName) !== null && _c !== void 0 ? _c : "", + includeRoot: (_d = serializerOptions.includeRoot) !== null && _d !== void 0 ? _d : false, + xmlCharKey: (_e = serializerOptions.xmlCharKey) !== null && _e !== void 0 ? _e : XML_CHARKEY + }; + var xmlCharKey = serializerOptions.xmlCharKey; + if (operationSpec.requestBody && operationSpec.requestBody.mapper) { + httpRequest.body = getOperationArgumentValueFromParameter(serviceClient, operationArguments, operationSpec.requestBody, operationSpec.serializer); + var bodyMapper = operationSpec.requestBody.mapper; + var required = bodyMapper.required, xmlName = bodyMapper.xmlName, xmlElementName = bodyMapper.xmlElementName, serializedName = bodyMapper.serializedName, xmlNamespace = bodyMapper.xmlNamespace, xmlNamespacePrefix = bodyMapper.xmlNamespacePrefix; + var typeName = bodyMapper.type.name; + try { + if ((httpRequest.body !== undefined && httpRequest.body !== null) || required) { + var requestBodyParameterPathString = getPathStringFromParameter(operationSpec.requestBody); + httpRequest.body = operationSpec.serializer.serialize(bodyMapper, httpRequest.body, requestBodyParameterPathString, updatedOptions); + var isStream = typeName === MapperType.Stream; + if (operationSpec.isXML) { + var xmlnsKey = xmlNamespacePrefix ? "xmlns:" + xmlNamespacePrefix : "xmlns"; + var value = getXmlValueWithNamespace(xmlNamespace, xmlnsKey, typeName, httpRequest.body, updatedOptions); + if (typeName === MapperType.Sequence) { + httpRequest.body = stringifyXML(prepareXMLRootList(value, xmlElementName || xmlName || serializedName, xmlnsKey, xmlNamespace), { + rootName: xmlName || serializedName, + xmlCharKey: xmlCharKey + }); + } + else if (!isStream) { + httpRequest.body = stringifyXML(value, { + rootName: xmlName || serializedName, + xmlCharKey: xmlCharKey + }); + } + } + else if (typeName === MapperType.String && + (((_f = operationSpec.contentType) === null || _f === void 0 ? void 0 : _f.match("text/plain")) || operationSpec.mediaType === "text")) { + // the String serializer has validated that request body is a string + // so just send the string. + return; + } + else if (!isStream) { + httpRequest.body = JSON.stringify(httpRequest.body); + } + } } - return carrier[key]; - }, - keys: function (carrier) { - if (carrier == null) { - return []; + catch (error) { + throw new Error("Error \"" + error.message + "\" occurred in serializing the payload - " + JSON.stringify(serializedName, undefined, " ") + "."); } - return Object.keys(carrier); - }, -}; -exports.defaultTextMapSetter = { - set: function (carrier, key, value) { - if (carrier == null) { - return; + } + else if (operationSpec.formDataParameters && operationSpec.formDataParameters.length > 0) { + httpRequest.formData = {}; + for (var _i = 0, _g = operationSpec.formDataParameters; _i < _g.length; _i++) { + var formDataParameter = _g[_i]; + var formDataParameterValue = getOperationArgumentValueFromParameter(serviceClient, operationArguments, formDataParameter, operationSpec.serializer); + if (formDataParameterValue !== undefined && formDataParameterValue !== null) { + var formDataParameterPropertyName = formDataParameter.mapper.serializedName || getPathStringFromParameter(formDataParameter); + httpRequest.formData[formDataParameterPropertyName] = operationSpec.serializer.serialize(formDataParameter.mapper, formDataParameterValue, getPathStringFromParameter(formDataParameter), updatedOptions); + } } - carrier[key] = value; - }, -}; -//# sourceMappingURL=TextMapPropagator.js.map - -/***/ }), - -/***/ 9217: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=Event.js.map - -/***/ }), - -/***/ 3116: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NoopSpan = void 0; -var spancontext_utils_1 = __nccwpck_require__(541); + } +} /** - * The NoopSpan is the default {@link Span} that is used when no Span - * implementation is available. All operations are no-op including context - * propagation. + * Adds an xml namespace to the xml serialized object if needed, otherwise it just returns the value itself */ -var NoopSpan = /** @class */ (function () { - function NoopSpan(_spanContext) { - if (_spanContext === void 0) { _spanContext = spancontext_utils_1.INVALID_SPAN_CONTEXT; } - this._spanContext = _spanContext; +function getXmlValueWithNamespace(xmlNamespace, xmlnsKey, typeName, serializedValue, options) { + var _a; + // Composite and Sequence schemas already got their root namespace set during serialization + // We just need to add xmlns to the other schema types + if (xmlNamespace && !["Composite", "Sequence", "Dictionary"].includes(typeName)) { + var result = {}; + result[options.xmlCharKey] = serializedValue; + result[XML_ATTRKEY] = (_a = {}, _a[xmlnsKey] = xmlNamespace, _a); + return result; } - // Returns a SpanContext. - NoopSpan.prototype.context = function () { - return this._spanContext; - }; - // By default does nothing - NoopSpan.prototype.setAttribute = function (_key, _value) { - return this; - }; - // By default does nothing - NoopSpan.prototype.setAttributes = function (_attributes) { - return this; - }; - // By default does nothing - NoopSpan.prototype.addEvent = function (_name, _attributes) { - return this; - }; - // By default does nothing - NoopSpan.prototype.setStatus = function (_status) { - return this; - }; - // By default does nothing - NoopSpan.prototype.updateName = function (_name) { - return this; - }; - // By default does nothing - NoopSpan.prototype.end = function (_endTime) { }; - // isRecording always returns false for noopSpan. - NoopSpan.prototype.isRecording = function () { - return false; + return serializedValue; +} +function getValueOrFunctionResult(value, defaultValueCreator) { + var result; + if (typeof value === "string") { + result = value; + } + else { + result = defaultValueCreator(); + if (typeof value === "function") { + result = value(result); + } + } + return result; +} +function createDefaultRequestPolicyFactories(authPolicyFactory, options) { + var factories = []; + if (options.generateClientRequestIdHeader) { + factories.push(generateClientRequestIdPolicy(options.clientRequestIdHeaderName)); + } + if (authPolicyFactory) { + factories.push(authPolicyFactory); + } + var userAgentHeaderName = getValueOrFunctionResult(options.userAgentHeaderName, getDefaultUserAgentHeaderName); + var userAgentHeaderValue = getValueOrFunctionResult(options.userAgent, getDefaultUserAgentValue); + if (userAgentHeaderName && userAgentHeaderValue) { + factories.push(userAgentPolicy({ key: userAgentHeaderName, value: userAgentHeaderValue })); + } + factories.push(redirectPolicy()); + factories.push(rpRegistrationPolicy(options.rpRegistrationRetryTimeout)); + if (!options.noRetryPolicy) { + factories.push(exponentialRetryPolicy()); + factories.push(systemErrorRetryPolicy()); + factories.push(throttlingRetryPolicy()); + } + factories.push(deserializationPolicy(options.deserializationContentTypes)); + { + factories.push(proxyPolicy(options.proxySettings)); + } + factories.push(logPolicy({ logger: logger.info })); + return factories; +} +function createPipelineFromOptions(pipelineOptions, authPolicyFactory) { + var requestPolicyFactories = []; + if (pipelineOptions.sendStreamingJson) { + requestPolicyFactories.push(ndJsonPolicy()); + } + var userAgentValue = undefined; + if (pipelineOptions.userAgentOptions && pipelineOptions.userAgentOptions.userAgentPrefix) { + var userAgentInfo = []; + userAgentInfo.push(pipelineOptions.userAgentOptions.userAgentPrefix); + // Add the default user agent value if it isn't already specified + // by the userAgentPrefix option. + var defaultUserAgentInfo = getDefaultUserAgentValue(); + if (userAgentInfo.indexOf(defaultUserAgentInfo) === -1) { + userAgentInfo.push(defaultUserAgentInfo); + } + userAgentValue = userAgentInfo.join(" "); + } + var keepAliveOptions = tslib.__assign(tslib.__assign({}, DefaultKeepAliveOptions), pipelineOptions.keepAliveOptions); + var retryOptions = tslib.__assign(tslib.__assign({}, DefaultRetryOptions), pipelineOptions.retryOptions); + var redirectOptions = tslib.__assign(tslib.__assign({}, DefaultRedirectOptions), pipelineOptions.redirectOptions); + { + requestPolicyFactories.push(proxyPolicy(pipelineOptions.proxyOptions)); + } + var deserializationOptions = tslib.__assign(tslib.__assign({}, DefaultDeserializationOptions), pipelineOptions.deserializationOptions); + var loggingOptions = tslib.__assign({}, pipelineOptions.loggingOptions); + requestPolicyFactories.push(tracingPolicy({ userAgent: userAgentValue }), keepAlivePolicy(keepAliveOptions), userAgentPolicy({ value: userAgentValue }), generateClientRequestIdPolicy(), deserializationPolicy(deserializationOptions.expectedContentTypes), throttlingRetryPolicy(), systemErrorRetryPolicy(), exponentialRetryPolicy(retryOptions.maxRetries, retryOptions.retryDelayInMs, retryOptions.maxRetryDelayInMs)); + if (redirectOptions.handleRedirects) { + requestPolicyFactories.push(redirectPolicy(redirectOptions.maxRetries)); + } + if (authPolicyFactory) { + requestPolicyFactories.push(authPolicyFactory); + } + requestPolicyFactories.push(logPolicy(loggingOptions)); + if (isNode && pipelineOptions.decompressResponse === false) { + requestPolicyFactories.push(disableResponseDecompressionPolicy()); + } + return { + httpClient: pipelineOptions.httpClient, + requestPolicyFactories: requestPolicyFactories }; - // By default does nothing - NoopSpan.prototype.recordException = function (_exception, _time) { }; - return NoopSpan; -}()); -exports.NoopSpan = NoopSpan; -//# sourceMappingURL=NoopSpan.js.map - -/***/ }), - -/***/ 913: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NOOP_TRACER = exports.NoopTracer = void 0; -var context_1 = __nccwpck_require__(7135); -var NoopSpan_1 = __nccwpck_require__(3116); -var spancontext_utils_1 = __nccwpck_require__(541); -/** - * No-op implementations of {@link Tracer}. - */ -var NoopTracer = /** @class */ (function () { - function NoopTracer() { +} +function getOperationArgumentValueFromParameter(serviceClient, operationArguments, parameter, serializer) { + return getOperationArgumentValueFromParameterPath(serviceClient, operationArguments, parameter.parameterPath, parameter.mapper, serializer); +} +function getOperationArgumentValueFromParameterPath(serviceClient, operationArguments, parameterPath, parameterMapper, serializer) { + var _a; + var value; + if (typeof parameterPath === "string") { + parameterPath = [parameterPath]; } - // startSpan starts a noop span. - NoopTracer.prototype.startSpan = function (name, options, context) { - var root = Boolean(options === null || options === void 0 ? void 0 : options.root); - if (root) { - return new NoopSpan_1.NoopSpan(); + var serializerOptions = (_a = operationArguments.options) === null || _a === void 0 ? void 0 : _a.serializerOptions; + if (Array.isArray(parameterPath)) { + if (parameterPath.length > 0) { + if (parameterMapper.isConstant) { + value = parameterMapper.defaultValue; + } + else { + var propertySearchResult = getPropertyFromParameterPath(operationArguments, parameterPath); + if (!propertySearchResult.propertyFound) { + propertySearchResult = getPropertyFromParameterPath(serviceClient, parameterPath); + } + var useDefaultValue = false; + if (!propertySearchResult.propertyFound) { + useDefaultValue = + parameterMapper.required || + (parameterPath[0] === "options" && parameterPath.length === 2); + } + value = useDefaultValue ? parameterMapper.defaultValue : propertySearchResult.propertyValue; + } + // Serialize just for validation purposes. + var parameterPathString = getPathStringFromParameterPath(parameterPath, parameterMapper); + serializer.serialize(parameterMapper, value, parameterPathString, serializerOptions); } - var parentFromContext = context && context_1.getSpanContext(context); - if (isSpanContext(parentFromContext) && - spancontext_utils_1.isSpanContextValid(parentFromContext)) { - return new NoopSpan_1.NoopSpan(parentFromContext); + } + else { + if (parameterMapper.required) { + value = {}; + } + for (var propertyName in parameterPath) { + var propertyMapper = parameterMapper.type.modelProperties[propertyName]; + var propertyPath = parameterPath[propertyName]; + var propertyValue = getOperationArgumentValueFromParameterPath(serviceClient, operationArguments, propertyPath, propertyMapper, serializer); + // Serialize just for validation purposes. + var propertyPathString = getPathStringFromParameterPath(propertyPath, propertyMapper); + serializer.serialize(propertyMapper, propertyValue, propertyPathString, serializerOptions); + if (propertyValue !== undefined && propertyValue !== null) { + if (!value) { + value = {}; + } + value[propertyName] = propertyValue; + } + } + } + return value; +} +function getPropertyFromParameterPath(parent, parameterPath) { + var result = { propertyFound: false }; + var i = 0; + for (; i < parameterPath.length; ++i) { + var parameterPathPart = parameterPath[i]; + // Make sure to check inherited properties too, so don't use hasOwnProperty(). + if (parent !== undefined && parent !== null && parameterPathPart in parent) { + parent = parent[parameterPathPart]; } else { - return new NoopSpan_1.NoopSpan(); + break; } + } + if (i === parameterPath.length) { + result.propertyValue = parent; + result.propertyFound = true; + } + return result; +} +function flattenResponse(_response, responseSpec) { + var parsedHeaders = _response.parsedHeaders; + var bodyMapper = responseSpec && responseSpec.bodyMapper; + var addOperationResponse = function (obj) { + return Object.defineProperty(obj, "_response", { + value: _response + }); }; - return NoopTracer; -}()); -exports.NoopTracer = NoopTracer; -function isSpanContext(spanContext) { - return (typeof spanContext === 'object' && - typeof spanContext['spanId'] === 'string' && - typeof spanContext['traceId'] === 'string' && - typeof spanContext['traceFlags'] === 'number'); + if (bodyMapper) { + var typeName = bodyMapper.type.name; + if (typeName === "Stream") { + return addOperationResponse(tslib.__assign(tslib.__assign({}, parsedHeaders), { blobBody: _response.blobBody, readableStreamBody: _response.readableStreamBody })); + } + var modelProperties_1 = (typeName === "Composite" && bodyMapper.type.modelProperties) || {}; + var isPageableResponse = Object.keys(modelProperties_1).some(function (k) { return modelProperties_1[k].serializedName === ""; }); + if (typeName === "Sequence" || isPageableResponse) { + var arrayResponse = tslib.__spreadArray([], (_response.parsedBody || [])); + for (var _i = 0, _a = Object.keys(modelProperties_1); _i < _a.length; _i++) { + var key = _a[_i]; + if (modelProperties_1[key].serializedName) { + arrayResponse[key] = _response.parsedBody[key]; + } + } + if (parsedHeaders) { + for (var _b = 0, _c = Object.keys(parsedHeaders); _b < _c.length; _b++) { + var key = _c[_b]; + arrayResponse[key] = parsedHeaders[key]; + } + } + addOperationResponse(arrayResponse); + return arrayResponse; + } + if (typeName === "Composite" || typeName === "Dictionary") { + return addOperationResponse(tslib.__assign(tslib.__assign({}, parsedHeaders), _response.parsedBody)); + } + } + if (bodyMapper || + _response.request.method === "HEAD" || + isPrimitiveType(_response.parsedBody)) { + // primitive body types and HEAD booleans + return addOperationResponse(tslib.__assign(tslib.__assign({}, parsedHeaders), { body: _response.parsedBody })); + } + return addOperationResponse(tslib.__assign(tslib.__assign({}, parsedHeaders), _response.parsedBody)); +} +function getCredentialScopes(options, baseUri) { + if (options === null || options === void 0 ? void 0 : options.credentialScopes) { + var scopes = options.credentialScopes; + return Array.isArray(scopes) + ? scopes.map(function (scope) { return new url.URL(scope).toString(); }) + : new url.URL(scopes).toString(); + } + if (baseUri) { + return baseUri + "/.default"; + } + return undefined; } -exports.NOOP_TRACER = new NoopTracer(); -//# sourceMappingURL=NoopTracer.js.map - -/***/ }), - -/***/ 2793: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NOOP_TRACER_PROVIDER = exports.NoopTracerProvider = void 0; -var NoopTracer_1 = __nccwpck_require__(913); +// Copyright (c) Microsoft Corporation. /** - * An implementation of the {@link TracerProvider} which returns an impotent - * Tracer for all calls to `getTracer`. + * This function is only here for compatibility. Use createSpanFunction in core-tracing. * - * All operations are no-op. - */ -var NoopTracerProvider = /** @class */ (function () { - function NoopTracerProvider() { - } - NoopTracerProvider.prototype.getTracer = function (_name, _version) { - return NoopTracer_1.NOOP_TRACER; - }; - return NoopTracerProvider; -}()); -exports.NoopTracerProvider = NoopTracerProvider; -exports.NOOP_TRACER_PROVIDER = new NoopTracerProvider(); -//# sourceMappingURL=NoopTracerProvider.js.map - -/***/ }), - -/***/ 5159: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + * @deprecated This function is only here for compatibility. Use createSpanFunction in core-tracing. + * @hidden -"use strict"; + * @param spanConfig - The name of the operation being performed. + * @param tracingOptions - The options for the underlying http request. + */ +function createSpanFunction(args) { + return coreTracing.createSpanFunction(args); +} -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +/** + * Defines the default token refresh buffer duration. */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ProxyTracer = void 0; -var NoopTracer_1 = __nccwpck_require__(913); +var TokenRefreshBufferMs = 2 * 60 * 1000; // 2 Minutes /** - * Proxy tracer provided by the proxy tracer provider + * Provides an {@link AccessTokenCache} implementation which clears + * the cached {@link AccessToken}'s after the expiresOnTimestamp has + * passed. + * + * @deprecated No longer used in the bearer authorization policy. */ -var ProxyTracer = /** @class */ (function () { - function ProxyTracer(_provider, name, version) { - this._provider = _provider; - this.name = name; - this.version = version; - } - ProxyTracer.prototype.startSpan = function (name, options, context) { - return this._getTracer().startSpan(name, options, context); - }; +var ExpiringAccessTokenCache = /** @class */ (function () { /** - * Try to get a tracer from the proxy tracer provider. - * If the proxy tracer provider has no delegate, return a noop tracer. + * Constructs an instance of {@link ExpiringAccessTokenCache} with + * an optional expiration buffer time. */ - ProxyTracer.prototype._getTracer = function () { - if (this._delegate) { - return this._delegate; - } - var tracer = this._provider.getDelegateTracer(this.name, this.version); - if (!tracer) { - return NoopTracer_1.NOOP_TRACER; + function ExpiringAccessTokenCache(tokenRefreshBufferMs) { + if (tokenRefreshBufferMs === void 0) { tokenRefreshBufferMs = TokenRefreshBufferMs; } + this.cachedToken = undefined; + this.tokenRefreshBufferMs = tokenRefreshBufferMs; + } + ExpiringAccessTokenCache.prototype.setCachedToken = function (accessToken) { + this.cachedToken = accessToken; + }; + ExpiringAccessTokenCache.prototype.getCachedToken = function () { + if (this.cachedToken && + Date.now() + this.tokenRefreshBufferMs >= this.cachedToken.expiresOnTimestamp) { + this.cachedToken = undefined; } - this._delegate = tracer; - return this._delegate; + return this.cachedToken; }; - return ProxyTracer; + return ExpiringAccessTokenCache; }()); -exports.ProxyTracer = ProxyTracer; -//# sourceMappingURL=ProxyTracer.js.map -/***/ }), - -/***/ 9483: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ProxyTracerProvider = void 0; -var ProxyTracer_1 = __nccwpck_require__(5159); -var NoopTracerProvider_1 = __nccwpck_require__(2793); +// Copyright (c) Microsoft Corporation. /** - * Tracer provider which provides {@link ProxyTracer}s. + * Helps the core-http token authentication policies with requesting a new token if we're not currently waiting for a new token. * - * Before a delegate is set, tracers provided are NoOp. - * When a delegate is set, traces are provided from the delegate. - * When a delegate is set after tracers have already been provided, - * all tracers already provided will use the provided delegate implementation. + * @deprecated No longer used in the bearer authorization policy. */ -var ProxyTracerProvider = /** @class */ (function () { - function ProxyTracerProvider() { +var AccessTokenRefresher = /** @class */ (function () { + function AccessTokenRefresher(credential, scopes, requiredMillisecondsBeforeNewRefresh) { + if (requiredMillisecondsBeforeNewRefresh === void 0) { requiredMillisecondsBeforeNewRefresh = 30000; } + this.credential = credential; + this.scopes = scopes; + this.requiredMillisecondsBeforeNewRefresh = requiredMillisecondsBeforeNewRefresh; + this.lastCalled = 0; } /** - * Get a {@link ProxyTracer} + * Returns true if the required milliseconds(defaulted to 30000) have been passed signifying + * that we are ready for a new refresh. */ - ProxyTracerProvider.prototype.getTracer = function (name, version) { - var _a; - return ((_a = this.getDelegateTracer(name, version)) !== null && _a !== void 0 ? _a : new ProxyTracer_1.ProxyTracer(this, name, version)); - }; - ProxyTracerProvider.prototype.getDelegate = function () { - var _a; - return (_a = this._delegate) !== null && _a !== void 0 ? _a : NoopTracerProvider_1.NOOP_TRACER_PROVIDER; + AccessTokenRefresher.prototype.isReady = function () { + // We're only ready for a new refresh if the required milliseconds have passed. + return (!this.lastCalled || Date.now() - this.lastCalled > this.requiredMillisecondsBeforeNewRefresh); }; /** - * Set the delegate tracer provider + * Stores the time in which it is called, + * then requests a new token, + * then sets this.promise to undefined, + * then returns the token. */ - ProxyTracerProvider.prototype.setDelegate = function (delegate) { - this._delegate = delegate; - }; - ProxyTracerProvider.prototype.getDelegateTracer = function (name, version) { - var _a; - return (_a = this._delegate) === null || _a === void 0 ? void 0 : _a.getTracer(name, version); + AccessTokenRefresher.prototype.getToken = function (options) { + return tslib.__awaiter(this, void 0, void 0, function () { + var token; + return tslib.__generator(this, function (_a) { + switch (_a.label) { + case 0: + this.lastCalled = Date.now(); + return [4 /*yield*/, this.credential.getToken(this.scopes, options)]; + case 1: + token = _a.sent(); + this.promise = undefined; + return [2 /*return*/, token || undefined]; + } + }); + }); }; - return ProxyTracerProvider; -}()); -exports.ProxyTracerProvider = ProxyTracerProvider; -//# sourceMappingURL=ProxyTracerProvider.js.map - -/***/ }), - -/***/ 1569: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=Sampler.js.map - -/***/ }), - -/***/ 7502: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SamplingDecision = void 0; -/** - * A sampling decision that determines how a {@link Span} will be recorded - * and collected. - */ -var SamplingDecision; -(function (SamplingDecision) { - /** - * `Span.isRecording() === false`, span will not be recorded and all events - * and attributes will be dropped. - */ - SamplingDecision[SamplingDecision["NOT_RECORD"] = 0] = "NOT_RECORD"; - /** - * `Span.isRecording() === true`, but `Sampled` flag in {@link TraceFlags} - * MUST NOT be set. - */ - SamplingDecision[SamplingDecision["RECORD"] = 1] = "RECORD"; /** - * `Span.isRecording() === true` AND `Sampled` flag in {@link TraceFlags} - * MUST be set. + * Requests a new token if we're not currently waiting for a new token. + * Returns null if the required time between each call hasn't been reached. */ - SamplingDecision[SamplingDecision["RECORD_AND_SAMPLED"] = 2] = "RECORD_AND_SAMPLED"; -})(SamplingDecision = exports.SamplingDecision || (exports.SamplingDecision = {})); -//# sourceMappingURL=SamplingResult.js.map - -/***/ }), - -/***/ 9618: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=SpanOptions.js.map - -/***/ }), - -/***/ 886: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=TimedEvent.js.map - -/***/ }), - -/***/ 761: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=attributes.js.map - -/***/ }), - -/***/ 9067: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=link.js.map - -/***/ }), - -/***/ 8984: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=link_context.js.map - -/***/ }), - -/***/ 8052: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=span.js.map - -/***/ }), - -/***/ 9955: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=span_context.js.map - -/***/ }), - -/***/ 3107: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; + AccessTokenRefresher.prototype.refresh = function (options) { + if (!this.promise) { + this.promise = this.getToken(options); + } + return this.promise; + }; + return AccessTokenRefresher; +}()); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SpanKind = void 0; -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var SpanKind; -(function (SpanKind) { - /** Default value. Indicates that the span is used internally. */ - SpanKind[SpanKind["INTERNAL"] = 0] = "INTERNAL"; - /** - * Indicates that the span covers server-side handling of an RPC or other - * remote request. - */ - SpanKind[SpanKind["SERVER"] = 1] = "SERVER"; - /** - * Indicates that the span covers the client-side wrapper around an RPC or - * other remote request. - */ - SpanKind[SpanKind["CLIENT"] = 2] = "CLIENT"; +// Copyright (c) Microsoft Corporation. +var HeaderConstants = Constants.HeaderConstants; +var DEFAULT_AUTHORIZATION_SCHEME = "Basic"; +var BasicAuthenticationCredentials = /** @class */ (function () { /** - * Indicates that the span describes producer sending a message to a - * broker. Unlike client and server, there is no direct critical path latency - * relationship between producer and consumer spans. + * Creates a new BasicAuthenticationCredentials object. + * + * @param userName - User name. + * @param password - Password. + * @param authorizationScheme - The authorization scheme. */ - SpanKind[SpanKind["PRODUCER"] = 3] = "PRODUCER"; + function BasicAuthenticationCredentials(userName, password, authorizationScheme) { + if (authorizationScheme === void 0) { authorizationScheme = DEFAULT_AUTHORIZATION_SCHEME; } + this.authorizationScheme = DEFAULT_AUTHORIZATION_SCHEME; + if (userName === null || userName === undefined || typeof userName.valueOf() !== "string") { + throw new Error("userName cannot be null or undefined and must be of type string."); + } + if (password === null || password === undefined || typeof password.valueOf() !== "string") { + throw new Error("password cannot be null or undefined and must be of type string."); + } + this.userName = userName; + this.password = password; + this.authorizationScheme = authorizationScheme; + } /** - * Indicates that the span describes consumer receiving a message from a - * broker. Unlike client and server, there is no direct critical path latency - * relationship between producer and consumer spans. + * Signs a request with the Authentication header. + * + * @param webResource - The WebResourceLike to be signed. + * @returns The signed request object. */ - SpanKind[SpanKind["CONSUMER"] = 4] = "CONSUMER"; -})(SpanKind = exports.SpanKind || (exports.SpanKind = {})); -//# sourceMappingURL=span_kind.js.map - -/***/ }), - -/***/ 541: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isSpanContextValid = exports.isValidSpanId = exports.isValidTraceId = exports.INVALID_SPAN_CONTEXT = exports.INVALID_TRACEID = exports.INVALID_SPANID = void 0; -var trace_flags_1 = __nccwpck_require__(8434); -var VALID_TRACEID_REGEX = /^([0-9a-f]{32})$/i; -var VALID_SPANID_REGEX = /^[0-9a-f]{16}$/i; -exports.INVALID_SPANID = '0000000000000000'; -exports.INVALID_TRACEID = '00000000000000000000000000000000'; -exports.INVALID_SPAN_CONTEXT = { - traceId: exports.INVALID_TRACEID, - spanId: exports.INVALID_SPANID, - traceFlags: trace_flags_1.TraceFlags.NONE, -}; -function isValidTraceId(traceId) { - return VALID_TRACEID_REGEX.test(traceId) && traceId !== exports.INVALID_TRACEID; -} -exports.isValidTraceId = isValidTraceId; -function isValidSpanId(spanId) { - return VALID_SPANID_REGEX.test(spanId) && spanId !== exports.INVALID_SPANID; -} -exports.isValidSpanId = isValidSpanId; -/** - * Returns true if this {@link SpanContext} is valid. - * @return true if this {@link SpanContext} is valid. - */ -function isSpanContextValid(spanContext) { - return (isValidTraceId(spanContext.traceId) && isValidSpanId(spanContext.spanId)); -} -exports.isSpanContextValid = isSpanContextValid; -//# sourceMappingURL=spancontext-utils.js.map - -/***/ }), - -/***/ 1997: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; + BasicAuthenticationCredentials.prototype.signRequest = function (webResource) { + var credentials = this.userName + ":" + this.password; + var encodedCredentials = this.authorizationScheme + " " + encodeString(credentials); + if (!webResource.headers) + webResource.headers = new HttpHeaders(); + webResource.headers.set(HeaderConstants.AUTHORIZATION, encodedCredentials); + return Promise.resolve(webResource); + }; + return BasicAuthenticationCredentials; +}()); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SpanStatusCode = void 0; +// Copyright (c) Microsoft Corporation. /** - * An enumeration of status codes. + * Authenticates to a service using an API key. */ -var SpanStatusCode; -(function (SpanStatusCode) { +var ApiKeyCredentials = /** @class */ (function () { /** - * The default status. + * @param options - Specifies the options to be provided for auth. Either header or query needs to be provided. */ - SpanStatusCode[SpanStatusCode["UNSET"] = 0] = "UNSET"; + function ApiKeyCredentials(options) { + if (!options || (options && !options.inHeader && !options.inQuery)) { + throw new Error("options cannot be null or undefined. Either \"inHeader\" or \"inQuery\" property of the options object needs to be provided."); + } + this.inHeader = options.inHeader; + this.inQuery = options.inQuery; + } /** - * The operation has been validated by an Application developer or - * Operator to have completed successfully. + * Signs a request with the values provided in the inHeader and inQuery parameter. + * + * @param webResource - The WebResourceLike to be signed. + * @returns The signed request object. */ - SpanStatusCode[SpanStatusCode["OK"] = 1] = "OK"; + ApiKeyCredentials.prototype.signRequest = function (webResource) { + if (!webResource) { + return Promise.reject(new Error("webResource cannot be null or undefined and must be of type \"object\".")); + } + if (this.inHeader) { + if (!webResource.headers) { + webResource.headers = new HttpHeaders(); + } + for (var headerName in this.inHeader) { + webResource.headers.set(headerName, this.inHeader[headerName]); + } + } + if (this.inQuery) { + if (!webResource.url) { + return Promise.reject(new Error("url cannot be null in the request object.")); + } + if (webResource.url.indexOf("?") < 0) { + webResource.url += "?"; + } + for (var key in this.inQuery) { + if (!webResource.url.endsWith("?")) { + webResource.url += "&"; + } + webResource.url += key + "=" + this.inQuery[key]; + } + } + return Promise.resolve(webResource); + }; + return ApiKeyCredentials; +}()); + +// Copyright (c) Microsoft Corporation. +var TopicCredentials = /** @class */ (function (_super) { + tslib.__extends(TopicCredentials, _super); /** - * The operation contains an error. + * Creates a new EventGrid TopicCredentials object. + * + * @param topicKey - The EventGrid topic key */ - SpanStatusCode[SpanStatusCode["ERROR"] = 2] = "ERROR"; -})(SpanStatusCode = exports.SpanStatusCode || (exports.SpanStatusCode = {})); -//# sourceMappingURL=status.js.map - -/***/ }), - -/***/ 8434: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TraceFlags = void 0; -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var TraceFlags; -(function (TraceFlags) { - /** Represents no flag set. */ - TraceFlags[TraceFlags["NONE"] = 0] = "NONE"; - /** Bit to represent whether trace is sampled in trace flags. */ - TraceFlags[TraceFlags["SAMPLED"] = 1] = "SAMPLED"; -})(TraceFlags = exports.TraceFlags || (exports.TraceFlags = {})); -//# sourceMappingURL=trace_flags.js.map - -/***/ }), - -/***/ 2749: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=trace_state.js.map - -/***/ }), - -/***/ 3833: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=tracer.js.map - -/***/ }), - -/***/ 9824: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=tracer_provider.js.map - -/***/ }), - -/***/ 4044: -/***/ ((__unused_webpack_module, exports) => { + function TopicCredentials(topicKey) { + var _this = this; + if (!topicKey || (topicKey && typeof topicKey !== "string")) { + throw new Error("topicKey cannot be null or undefined and must be of type string."); + } + var options = { + inHeader: { + "aeg-sas-key": topicKey + } + }; + _this = _super.call(this, options) || this; + return _this; + } + return TopicCredentials; +}(ApiKeyCredentials)); -"use strict"; +Object.defineProperty(exports, "isTokenCredential", ({ + enumerable: true, + get: function () { + return coreAuth.isTokenCredential; + } +})); +exports.AccessTokenRefresher = AccessTokenRefresher; +exports.ApiKeyCredentials = ApiKeyCredentials; +exports.BaseRequestPolicy = BaseRequestPolicy; +exports.BasicAuthenticationCredentials = BasicAuthenticationCredentials; +exports.Constants = Constants; +exports.DefaultHttpClient = NodeFetchHttpClient; +exports.ExpiringAccessTokenCache = ExpiringAccessTokenCache; +exports.HttpHeaders = HttpHeaders; +exports.MapperType = MapperType; +exports.RequestPolicyOptions = RequestPolicyOptions; +exports.RestError = RestError; +exports.Serializer = Serializer; +exports.ServiceClient = ServiceClient; +exports.TopicCredentials = TopicCredentials; +exports.URLBuilder = URLBuilder; +exports.URLQuery = URLQuery; +exports.WebResource = WebResource; +exports.XML_ATTRKEY = XML_ATTRKEY; +exports.XML_CHARKEY = XML_CHARKEY; +exports.applyMixins = applyMixins; +exports.bearerTokenAuthenticationPolicy = bearerTokenAuthenticationPolicy; +exports.createPipelineFromOptions = createPipelineFromOptions; +exports.createSpanFunction = createSpanFunction; +exports.delay = delay; +exports.deserializationPolicy = deserializationPolicy; +exports.deserializeResponseBody = deserializeResponseBody; +exports.disableResponseDecompressionPolicy = disableResponseDecompressionPolicy; +exports.encodeUri = encodeUri; +exports.executePromisesSequentially = executePromisesSequentially; +exports.exponentialRetryPolicy = exponentialRetryPolicy; +exports.flattenResponse = flattenResponse; +exports.generateClientRequestIdPolicy = generateClientRequestIdPolicy; +exports.generateUuid = generateUuid; +exports.getDefaultProxySettings = getDefaultProxySettings; +exports.getDefaultUserAgentValue = getDefaultUserAgentValue; +exports.isDuration = isDuration; +exports.isNode = isNode; +exports.isValidUuid = isValidUuid; +exports.keepAlivePolicy = keepAlivePolicy; +exports.logPolicy = logPolicy; +exports.operationOptionsToRequestOptionsBase = operationOptionsToRequestOptionsBase; +exports.parseXML = parseXML; +exports.promiseToCallback = promiseToCallback; +exports.promiseToServiceCallback = promiseToServiceCallback; +exports.proxyPolicy = proxyPolicy; +exports.redirectPolicy = redirectPolicy; +exports.serializeObject = serializeObject; +exports.signingPolicy = signingPolicy; +exports.stringifyXML = stringifyXML; +exports.stripRequest = stripRequest; +exports.stripResponse = stripResponse; +exports.systemErrorRetryPolicy = systemErrorRetryPolicy; +exports.throttlingRetryPolicy = throttlingRetryPolicy; +exports.tracingPolicy = tracingPolicy; +exports.userAgentPolicy = userAgentPolicy; +//# sourceMappingURL=index.js.map -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.VERSION = void 0; -// this is autogenerated file, see scripts/version-update.js -exports.VERSION = '1.0.0-rc.0'; -//# sourceMappingURL=version.js.map /***/ }), @@ -16905,10 +15066,14 @@ var __createBinding; return r; }; - __spreadArray = function (to, from) { - for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) - to[j] = from[i]; - return to; + __spreadArray = function (to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || from); }; __await = function (v) { @@ -18335,10 +16500,14 @@ var __createBinding; return r; }; - __spreadArray = function (to, from) { - for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) - to[j] = from[i]; - return to; + __spreadArray = function (to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || from); }; __await = function (v) { @@ -18461,6 +16630,7 @@ var api = __nccwpck_require__(5163); var tslib = __nccwpck_require__(1027); // Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. /** * A no-op implementation of Span that can safely be used without side-effects. */ @@ -18474,7 +16644,7 @@ var NoOpSpan = /** @class */ (function () { return { spanId: "", traceId: "", - traceFlags: api.TraceFlags.NONE + traceFlags: 0 /* NONE */ }; }; /** @@ -18509,7 +16679,7 @@ var NoOpSpan = /** @class */ (function () { return this; }; /** - * Sets a status on the span. Overrides the default of CanonicalCode.OK. + * Sets a status on the span. Overrides the default of SpanStatusCode.OK. * @param _status - The status to set. */ NoOpSpan.prototype.setStatus = function (_status) { @@ -18528,6 +16698,15 @@ var NoOpSpan = /** @class */ (function () { NoOpSpan.prototype.isRecording = function () { return false; }; + /** + * Sets exception as a span event + * @param exception - the exception the only accepted values are string or Error + * @param time - the time to set as Span's event time. If not provided, + * use the current time. + */ + NoOpSpan.prototype.recordException = function (_exception, _time) { + /* do nothing */ + }; return NoOpSpan; }()); @@ -18582,10 +16761,11 @@ function getGlobalObject() { // V1 = OpenTelemetry 0.1 // V2 = OpenTelemetry 0.2 // V3 = OpenTelemetry 0.6.1 -var GLOBAL_TRACER_VERSION = 3; +// V4 = OpenTelemetry 1.0.0-rc.0 +var GLOBAL_TRACER_VERSION = 4; // preview5 shipped with @azure/core-tracing.tracerCache // and didn't have smart detection for collisions -var GLOBAL_TRACER_SYMBOL = Symbol.for("@azure/core-tracing.tracerCache2"); +var GLOBAL_TRACER_SYMBOL = Symbol.for("@azure/core-tracing.tracerCache3"); var cache; function loadTracerCache() { var globalObj = getGlobalObject(); @@ -18647,6 +16827,86 @@ function getTracer() { return cache.tracer; } +// Copyright (c) Microsoft Corporation. +(function (SpanKind) { + /** Default value. Indicates that the span is used internally. */ + SpanKind[SpanKind["INTERNAL"] = 0] = "INTERNAL"; + /** + * Indicates that the span covers server-side handling of an RPC or other + * remote request. + */ + SpanKind[SpanKind["SERVER"] = 1] = "SERVER"; + /** + * Indicates that the span covers the client-side wrapper around an RPC or + * other remote request. + */ + SpanKind[SpanKind["CLIENT"] = 2] = "CLIENT"; + /** + * Indicates that the span describes producer sending a message to a + * broker. Unlike client and server, there is no direct critical path latency + * relationship between producer and consumer spans. + */ + SpanKind[SpanKind["PRODUCER"] = 3] = "PRODUCER"; + /** + * Indicates that the span describes consumer receiving a message from a + * broker. Unlike client and server, there is no direct critical path latency + * relationship between producer and consumer spans. + */ + SpanKind[SpanKind["CONSUMER"] = 4] = "CONSUMER"; +})(exports.SpanKind || (exports.SpanKind = {})); +/** + * Return the span if one exists + * + * @param context - context to get span from + */ +function getSpan(context) { + return api.getSpan(context); +} +/** + * Set the span on a context + * + * @param context - context to use as parent + * @param span - span to set active + */ +function setSpan(context, span) { + return api.setSpan(context, span); +} +/** + * Wrap span context in a NoopSpan and set as span in a new + * context + * + * @param context - context to set active span on + * @param spanContext - span context to be wrapped + */ +function setSpanContext(context, spanContext) { + return api.setSpanContext(context, spanContext); +} +/** + * Get the span context of the span if it exists. + * + * @param context - context to get values from + */ +function getSpanContext(context) { + return api.getSpanContext(context); +} +/** Entrypoint for context API */ +var context = api.context; +(function (SpanStatusCode) { + /** + * The default status. + */ + SpanStatusCode[SpanStatusCode["UNSET"] = 0] = "UNSET"; + /** + * The operation has been validated by an Application developer or + * Operator to have completed successfully. + */ + SpanStatusCode[SpanStatusCode["OK"] = 1] = "OK"; + /** + * The operation contains an error. + */ + SpanStatusCode[SpanStatusCode["ERROR"] = 2] = "ERROR"; +})(exports.SpanStatusCode || (exports.SpanStatusCode = {})); + // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. /** @@ -18672,6 +16932,20 @@ var OpenCensusTraceStateWrapper = /** @class */ (function () { }()); // Copyright (c) Microsoft Corporation. +/** An enumeration of canonical status codes. */ +var CanonicalCode; +(function (CanonicalCode) { + /** + * Not an error; returned on success + */ + CanonicalCode[CanonicalCode["OK"] = 0] = "OK"; + /** + * Internal errors. Means some invariants expected by underlying + * system has been broken. If you see one of these errors, + * something is very broken. + */ + CanonicalCode[CanonicalCode["INTERNAL"] = 13] = "INTERNAL"; +})(CanonicalCode || (CanonicalCode = {})); function isWrappedSpan(span) { return !!span && span.getWrappedSpan !== undefined; } @@ -18682,11 +16956,12 @@ function isTracer(tracerOrSpan) { * An implementation of OpenTelemetry Span that wraps an OpenCensus Span. */ var OpenCensusSpanWrapper = /** @class */ (function () { - function OpenCensusSpanWrapper(tracerOrSpan, name, options) { + function OpenCensusSpanWrapper(tracerOrSpan, name, options, context$1) { if (name === void 0) { name = ""; } if (options === void 0) { options = {}; } if (isTracer(tracerOrSpan)) { - var parent = isWrappedSpan(options.parent) ? options.parent.getWrappedSpan() : undefined; + var span = getSpan(context$1 !== null && context$1 !== void 0 ? context$1 : context.active()); + var parent = isWrappedSpan(span) ? span.getWrappedSpan() : undefined; this._span = tracerOrSpan.getWrappedTracer().startChildSpan({ name: name, childOf: parent @@ -18756,11 +17031,23 @@ var OpenCensusSpanWrapper = /** @class */ (function () { throw new Error("Method not implemented."); }; /** - * Sets a status on the span. Overrides the default of CanonicalCode.OK. + * Sets a status on the span. Overrides the default of SpanStatusCode.OK. * @param status - The status to set. */ OpenCensusSpanWrapper.prototype.setStatus = function (status) { - this._span.setStatus(status.code, status.message); + switch (status.code) { + case exports.SpanStatusCode.ERROR: { + this._span.setStatus(CanonicalCode.INTERNAL, status.message); + break; + } + case exports.SpanStatusCode.OK: { + this._span.setStatus(CanonicalCode.OK, status.message); + break; + } + case exports.SpanStatusCode.UNSET: { + break; + } + } return this; }; /** @@ -18778,6 +17065,15 @@ var OpenCensusSpanWrapper = /** @class */ (function () { // NoRecordSpans have an empty traceId return !!this._span.traceId; }; + /** + * Sets exception as a span event + * @param exception - the exception the only accepted values are string or Error + * @param time - the time to set as Span's event time. If not provided, + * use the current time. + */ + OpenCensusSpanWrapper.prototype.recordException = function (_exception, _time) { + throw new Error("Method not implemented"); + }; return OpenCensusSpanWrapper; }()); @@ -18856,7 +17152,7 @@ var TestSpan = /** @class */ (function (_super) { _this.startTime = startTime; _this.parentSpanId = parentSpanId; _this.status = { - code: api.CanonicalCode.OK + code: exports.SpanStatusCode.OK }; _this.endCalled = false; _this._context = context; @@ -18884,7 +17180,7 @@ var TestSpan = /** @class */ (function (_super) { this.endCalled = true; }; /** - * Sets a status on the span. Overrides the default of CanonicalCode.OK. + * Sets a status on the span. Overrides the default of SpanStatusCode.OK. * @param status - The status to set. */ TestSpan.prototype.setStatus = function (status) { @@ -19001,9 +17297,8 @@ var TestTracer = /** @class */ (function (_super) { * @param name - The name of the span. * @param options - The SpanOptions used during Span creation. */ - TestTracer.prototype.startSpan = function (name, options) { - if (options === void 0) { options = {}; } - var parentContext = this._getParentContext(options); + TestTracer.prototype.startSpan = function (name, options, context$1) { + var parentContext = getSpanContext(context$1 || context.active()); var traceId; var isRootSpan = false; if (parentContext && parentContext.traceId) { @@ -19013,31 +17308,18 @@ var TestTracer = /** @class */ (function (_super) { traceId = this.getNextTraceId(); isRootSpan = true; } - var context = { + var spanContext = { traceId: traceId, spanId: this.getNextSpanId(), - traceFlags: api.TraceFlags.NONE + traceFlags: 0 /* NONE */ }; - var span = new TestSpan(this, name, context, options.kind || api.SpanKind.INTERNAL, parentContext ? parentContext.spanId : undefined, options.startTime); + var span = new TestSpan(this, name, spanContext, (options === null || options === void 0 ? void 0 : options.kind) || exports.SpanKind.INTERNAL, parentContext ? parentContext.spanId : undefined, options === null || options === void 0 ? void 0 : options.startTime); this.knownSpans.push(span); if (isRootSpan) { this.rootSpans.push(span); } return span; }; - TestTracer.prototype._getParentContext = function (options) { - var parent = options.parent; - var result; - if (parent) { - if ("traceId" in parent) { - result = parent; - } - else { - result = parent.context(); - } - } - return result; - }; return TestTracer; }(NoOpTracer)); @@ -19064,17 +17346,17 @@ function createSpanFunction(args) { return function (operationName, operationOptions) { var tracer = getTracer(); var tracingOptions = (operationOptions === null || operationOptions === void 0 ? void 0 : operationOptions.tracingOptions) || {}; - var spanOptions = tslib.__assign({ kind: api.SpanKind.INTERNAL }, tracingOptions.spanOptions); + var spanOptions = tslib.__assign({ kind: exports.SpanKind.INTERNAL }, tracingOptions.spanOptions); var spanName = args.packagePrefix ? args.packagePrefix + "." + operationName : operationName; - var span = tracer.startSpan(spanName, spanOptions); + var span = tracer.startSpan(spanName, spanOptions, tracingOptions.tracingContext); if (args.namespace) { span.setAttribute("az.namespace", args.namespace); } var newSpanOptions = tracingOptions.spanOptions || {}; if (span.isRecording() && args.namespace) { - newSpanOptions = tslib.__assign(tslib.__assign({}, tracingOptions.spanOptions), { parent: span.context(), attributes: tslib.__assign(tslib.__assign({}, spanOptions.attributes), { "az.namespace": args.namespace }) }); + newSpanOptions = tslib.__assign(tslib.__assign({}, tracingOptions.spanOptions), { attributes: tslib.__assign(tslib.__assign({}, spanOptions.attributes), { "az.namespace": args.namespace }) }); } - var newTracingOptions = tslib.__assign(tslib.__assign({}, tracingOptions), { spanOptions: newSpanOptions }); + var newTracingOptions = tslib.__assign(tslib.__assign({}, tracingOptions), { spanOptions: newSpanOptions, tracingContext: setSpan(tracingOptions.tracingContext || context.active(), span) }); var newOperationOptions = tslib.__assign(tslib.__assign({}, operationOptions), { tracingOptions: newTracingOptions }); return { span: span, @@ -19137,10 +17419,15 @@ exports.OpenCensusSpanWrapper = OpenCensusSpanWrapper; exports.OpenCensusTracerWrapper = OpenCensusTracerWrapper; exports.TestSpan = TestSpan; exports.TestTracer = TestTracer; +exports.context = context; exports.createSpanFunction = createSpanFunction; exports.extractSpanContextFromTraceParentHeader = extractSpanContextFromTraceParentHeader; +exports.getSpan = getSpan; +exports.getSpanContext = getSpanContext; exports.getTraceParentHeader = getTraceParentHeader; exports.getTracer = getTracer; +exports.setSpan = setSpan; +exports.setSpanContext = setSpanContext; exports.setTracer = setTracer; //# sourceMappingURL=index.js.map @@ -19355,10 +17642,14 @@ var __createBinding; return r; }; - __spreadArray = function (to, from) { - for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) - to[j] = from[i]; - return to; + __spreadArray = function (to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || from); }; __await = function (v) { @@ -19952,10 +18243,14 @@ var __createBinding; return r; }; - __spreadArray = function (to, from) { - for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) - to[j] = from[i]; - return to; + __spreadArray = function (to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || from); }; __await = function (v) { @@ -20063,12 +18358,11 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); var coreHttp = __nccwpck_require__(4607); var tslib = __nccwpck_require__(679); -var api = __nccwpck_require__(5163); +var coreTracing = __nccwpck_require__(4175); var logger$1 = __nccwpck_require__(3233); var abortController = __nccwpck_require__(2557); var os = __nccwpck_require__(2087); var crypto = __nccwpck_require__(6417); -var coreTracing = __nccwpck_require__(4175); var stream = __nccwpck_require__(2413); __nccwpck_require__(4559); var coreLro = __nccwpck_require__(7094); @@ -20077,12 +18371,572 @@ var fs = __nccwpck_require__(5747); var util = __nccwpck_require__(1669); /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +var BlobServiceProperties = { + serializedName: "BlobServiceProperties", + xmlName: "StorageServiceProperties", + type: { + name: "Composite", + className: "BlobServiceProperties", + modelProperties: { + blobAnalyticsLogging: { + serializedName: "Logging", + xmlName: "Logging", + type: { + name: "Composite", + className: "Logging" + } + }, + hourMetrics: { + serializedName: "HourMetrics", + xmlName: "HourMetrics", + type: { + name: "Composite", + className: "Metrics" + } + }, + minuteMetrics: { + serializedName: "MinuteMetrics", + xmlName: "MinuteMetrics", + type: { + name: "Composite", + className: "Metrics" + } + }, + cors: { + serializedName: "Cors", + xmlName: "Cors", + xmlIsWrapped: true, + xmlElementName: "CorsRule", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "CorsRule" + } + } + } + }, + defaultServiceVersion: { + serializedName: "DefaultServiceVersion", + xmlName: "DefaultServiceVersion", + type: { + name: "String" + } + }, + deleteRetentionPolicy: { + serializedName: "DeleteRetentionPolicy", + xmlName: "DeleteRetentionPolicy", + type: { + name: "Composite", + className: "RetentionPolicy" + } + }, + staticWebsite: { + serializedName: "StaticWebsite", + xmlName: "StaticWebsite", + type: { + name: "Composite", + className: "StaticWebsite" + } + } + } + } +}; +var Logging = { + serializedName: "Logging", + type: { + name: "Composite", + className: "Logging", + modelProperties: { + version: { + serializedName: "Version", + required: true, + xmlName: "Version", + type: { + name: "String" + } + }, + deleteProperty: { + serializedName: "Delete", + required: true, + xmlName: "Delete", + type: { + name: "Boolean" + } + }, + read: { + serializedName: "Read", + required: true, + xmlName: "Read", + type: { + name: "Boolean" + } + }, + write: { + serializedName: "Write", + required: true, + xmlName: "Write", + type: { + name: "Boolean" + } + }, + retentionPolicy: { + serializedName: "RetentionPolicy", + xmlName: "RetentionPolicy", + type: { + name: "Composite", + className: "RetentionPolicy" + } + } + } + } +}; +var RetentionPolicy = { + serializedName: "RetentionPolicy", + type: { + name: "Composite", + className: "RetentionPolicy", + modelProperties: { + enabled: { + serializedName: "Enabled", + required: true, + xmlName: "Enabled", + type: { + name: "Boolean" + } + }, + days: { + constraints: { + InclusiveMinimum: 1 + }, + serializedName: "Days", + xmlName: "Days", + type: { + name: "Number" + } + } + } + } +}; +var Metrics = { + serializedName: "Metrics", + type: { + name: "Composite", + className: "Metrics", + modelProperties: { + version: { + serializedName: "Version", + xmlName: "Version", + type: { + name: "String" + } + }, + enabled: { + serializedName: "Enabled", + required: true, + xmlName: "Enabled", + type: { + name: "Boolean" + } + }, + includeAPIs: { + serializedName: "IncludeAPIs", + xmlName: "IncludeAPIs", + type: { + name: "Boolean" + } + }, + retentionPolicy: { + serializedName: "RetentionPolicy", + xmlName: "RetentionPolicy", + type: { + name: "Composite", + className: "RetentionPolicy" + } + } + } + } +}; +var CorsRule = { + serializedName: "CorsRule", + type: { + name: "Composite", + className: "CorsRule", + modelProperties: { + allowedOrigins: { + serializedName: "AllowedOrigins", + required: true, + xmlName: "AllowedOrigins", + type: { + name: "String" + } + }, + allowedMethods: { + serializedName: "AllowedMethods", + required: true, + xmlName: "AllowedMethods", + type: { + name: "String" + } + }, + allowedHeaders: { + serializedName: "AllowedHeaders", + required: true, + xmlName: "AllowedHeaders", + type: { + name: "String" + } + }, + exposedHeaders: { + serializedName: "ExposedHeaders", + required: true, + xmlName: "ExposedHeaders", + type: { + name: "String" + } + }, + maxAgeInSeconds: { + constraints: { + InclusiveMinimum: 0 + }, + serializedName: "MaxAgeInSeconds", + required: true, + xmlName: "MaxAgeInSeconds", + type: { + name: "Number" + } + } + } + } +}; +var StaticWebsite = { + serializedName: "StaticWebsite", + type: { + name: "Composite", + className: "StaticWebsite", + modelProperties: { + enabled: { + serializedName: "Enabled", + required: true, + xmlName: "Enabled", + type: { + name: "Boolean" + } + }, + indexDocument: { + serializedName: "IndexDocument", + xmlName: "IndexDocument", + type: { + name: "String" + } + }, + errorDocument404Path: { + serializedName: "ErrorDocument404Path", + xmlName: "ErrorDocument404Path", + type: { + name: "String" + } + }, + defaultIndexDocumentPath: { + serializedName: "DefaultIndexDocumentPath", + xmlName: "DefaultIndexDocumentPath", + type: { + name: "String" + } + } + } + } +}; +var StorageError = { + serializedName: "StorageError", + type: { + name: "Composite", + className: "StorageError", + modelProperties: { + message: { + serializedName: "Message", + xmlName: "Message", + type: { + name: "String" + } + }, + code: { + serializedName: "Code", + xmlName: "Code", + type: { + name: "String" + } + } + } + } +}; +var BlobServiceStatistics = { + serializedName: "BlobServiceStatistics", + xmlName: "StorageServiceStats", + type: { + name: "Composite", + className: "BlobServiceStatistics", + modelProperties: { + geoReplication: { + serializedName: "GeoReplication", + xmlName: "GeoReplication", + type: { + name: "Composite", + className: "GeoReplication" + } + } + } + } +}; +var GeoReplication = { + serializedName: "GeoReplication", + type: { + name: "Composite", + className: "GeoReplication", + modelProperties: { + status: { + serializedName: "Status", + required: true, + xmlName: "Status", + type: { + name: "Enum", + allowedValues: ["live", "bootstrap", "unavailable"] + } + }, + lastSyncOn: { + serializedName: "LastSyncTime", + required: true, + xmlName: "LastSyncTime", + type: { + name: "DateTimeRfc1123" + } + } + } + } +}; +var ListContainersSegmentResponse = { + serializedName: "ListContainersSegmentResponse", + xmlName: "EnumerationResults", + type: { + name: "Composite", + className: "ListContainersSegmentResponse", + modelProperties: { + serviceEndpoint: { + serializedName: "ServiceEndpoint", + required: true, + xmlName: "ServiceEndpoint", + xmlIsAttribute: true, + type: { + name: "String" + } + }, + prefix: { + serializedName: "Prefix", + xmlName: "Prefix", + type: { + name: "String" + } + }, + marker: { + serializedName: "Marker", + xmlName: "Marker", + type: { + name: "String" + } + }, + maxPageSize: { + serializedName: "MaxResults", + xmlName: "MaxResults", + type: { + name: "Number" + } + }, + containerItems: { + serializedName: "ContainerItems", + required: true, + xmlName: "Containers", + xmlIsWrapped: true, + xmlElementName: "Container", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ContainerItem" + } + } + } + }, + continuationToken: { + serializedName: "NextMarker", + xmlName: "NextMarker", + type: { + name: "String" + } + } + } + } +}; +var ContainerItem = { + serializedName: "ContainerItem", + xmlName: "Container", + type: { + name: "Composite", + className: "ContainerItem", + modelProperties: { + name: { + serializedName: "Name", + required: true, + xmlName: "Name", + type: { + name: "String" + } + }, + deleted: { + serializedName: "Deleted", + xmlName: "Deleted", + type: { + name: "Boolean" + } + }, + version: { + serializedName: "Version", + xmlName: "Version", + type: { + name: "String" + } + }, + properties: { + serializedName: "Properties", + xmlName: "Properties", + type: { + name: "Composite", + className: "ContainerProperties" + } + }, + metadata: { + serializedName: "Metadata", + xmlName: "Metadata", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + } + } + } +}; +var ContainerProperties = { + serializedName: "ContainerProperties", + type: { + name: "Composite", + className: "ContainerProperties", + modelProperties: { + lastModified: { + serializedName: "Last-Modified", + required: true, + xmlName: "Last-Modified", + type: { + name: "DateTimeRfc1123" + } + }, + etag: { + serializedName: "Etag", + required: true, + xmlName: "Etag", + type: { + name: "String" + } + }, + leaseStatus: { + serializedName: "LeaseStatus", + xmlName: "LeaseStatus", + type: { + name: "Enum", + allowedValues: ["locked", "unlocked"] + } + }, + leaseState: { + serializedName: "LeaseState", + xmlName: "LeaseState", + type: { + name: "Enum", + allowedValues: [ + "available", + "leased", + "expired", + "breaking", + "broken" + ] + } + }, + leaseDuration: { + serializedName: "LeaseDuration", + xmlName: "LeaseDuration", + type: { + name: "Enum", + allowedValues: ["infinite", "fixed"] + } + }, + publicAccess: { + serializedName: "PublicAccess", + xmlName: "PublicAccess", + type: { + name: "Enum", + allowedValues: ["container", "blob"] + } + }, + hasImmutabilityPolicy: { + serializedName: "HasImmutabilityPolicy", + xmlName: "HasImmutabilityPolicy", + type: { + name: "Boolean" + } + }, + hasLegalHold: { + serializedName: "HasLegalHold", + xmlName: "HasLegalHold", + type: { + name: "Boolean" + } + }, + defaultEncryptionScope: { + serializedName: "DefaultEncryptionScope", + xmlName: "DefaultEncryptionScope", + type: { + name: "String" + } + }, + preventEncryptionScopeOverride: { + serializedName: "DenyEncryptionScopeOverride", + xmlName: "DenyEncryptionScopeOverride", + type: { + name: "Boolean" + } + }, + deletedOn: { + serializedName: "DeletedTime", + xmlName: "DeletedTime", + type: { + name: "DateTimeRfc1123" + } + }, + remainingRetentionDays: { + serializedName: "RemainingRetentionDays", + xmlName: "RemainingRetentionDays", + type: { + name: "Number" + } + } + } + } +}; var KeyInfo = { serializedName: "KeyInfo", type: { @@ -20090,17 +18944,17 @@ var KeyInfo = { className: "KeyInfo", modelProperties: { startsOn: { - xmlName: "Start", - required: true, serializedName: "Start", + required: true, + xmlName: "Start", type: { name: "String" } }, expiresOn: { - xmlName: "Expiry", - required: true, serializedName: "Expiry", + required: true, + xmlName: "Expiry", type: { name: "String" } @@ -20115,57 +18969,107 @@ var UserDelegationKey = { className: "UserDelegationKey", modelProperties: { signedObjectId: { - xmlName: "SignedOid", - required: true, serializedName: "SignedOid", + required: true, + xmlName: "SignedOid", type: { name: "String" } }, signedTenantId: { - xmlName: "SignedTid", - required: true, serializedName: "SignedTid", + required: true, + xmlName: "SignedTid", type: { name: "String" } }, signedStartsOn: { - xmlName: "SignedStart", - required: true, serializedName: "SignedStart", + required: true, + xmlName: "SignedStart", type: { name: "String" } }, signedExpiresOn: { - xmlName: "SignedExpiry", - required: true, serializedName: "SignedExpiry", + required: true, + xmlName: "SignedExpiry", type: { name: "String" } }, signedService: { - xmlName: "SignedService", - required: true, serializedName: "SignedService", + required: true, + xmlName: "SignedService", type: { name: "String" } }, signedVersion: { - xmlName: "SignedVersion", - required: true, serializedName: "SignedVersion", + required: true, + xmlName: "SignedVersion", type: { name: "String" } }, value: { + serializedName: "Value", + required: true, xmlName: "Value", + type: { + name: "String" + } + } + } + } +}; +var FilterBlobSegment = { + serializedName: "FilterBlobSegment", + xmlName: "EnumerationResults", + type: { + name: "Composite", + className: "FilterBlobSegment", + modelProperties: { + serviceEndpoint: { + serializedName: "ServiceEndpoint", required: true, - serializedName: "Value", + xmlName: "ServiceEndpoint", + xmlIsAttribute: true, + type: { + name: "String" + } + }, + where: { + serializedName: "Where", + required: true, + xmlName: "Where", + type: { + name: "String" + } + }, + blobs: { + serializedName: "Blobs", + required: true, + xmlName: "Blobs", + xmlIsWrapped: true, + xmlElementName: "Blob", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "FilterBlobItem" + } + } + } + }, + continuationToken: { + serializedName: "NextMarker", + xmlName: "NextMarker", type: { name: "String" } @@ -20173,45 +19077,85 @@ var UserDelegationKey = { } } }; -var StorageError = { - serializedName: "StorageError", +var FilterBlobItem = { + serializedName: "FilterBlobItem", + xmlName: "Blob", type: { name: "Composite", - className: "StorageError", + className: "FilterBlobItem", modelProperties: { - message: { - xmlName: "Message", - serializedName: "Message", + name: { + serializedName: "Name", + required: true, + xmlName: "Name", type: { name: "String" } }, - code: { - xmlName: "Code", - serializedName: "Code", + containerName: { + serializedName: "ContainerName", + required: true, + xmlName: "ContainerName", type: { name: "String" } + }, + tags: { + serializedName: "Tags", + xmlName: "Tags", + type: { + name: "Composite", + className: "BlobTags" + } } } } }; -var DataLakeStorageErrorError = { - serializedName: "DataLakeStorageError_error", +var BlobTags = { + serializedName: "BlobTags", + xmlName: "Tags", type: { name: "Composite", - className: "DataLakeStorageErrorError", + className: "BlobTags", modelProperties: { - code: { - xmlName: "Code", - serializedName: "Code", + blobTagSet: { + serializedName: "BlobTagSet", + required: true, + xmlName: "TagSet", + xmlIsWrapped: true, + xmlElementName: "Tag", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "BlobTag" + } + } + } + } + } + } +}; +var BlobTag = { + serializedName: "BlobTag", + xmlName: "Tag", + type: { + name: "Composite", + className: "BlobTag", + modelProperties: { + key: { + serializedName: "Key", + required: true, + xmlName: "Key", type: { name: "String" } }, - message: { - xmlName: "Message", - serializedName: "Message", + value: { + serializedName: "Value", + required: true, + xmlName: "Value", type: { name: "String" } @@ -20219,18 +19163,27 @@ var DataLakeStorageErrorError = { } } }; -var DataLakeStorageError = { - serializedName: "DataLakeStorageError", +var SignedIdentifier = { + serializedName: "SignedIdentifier", + xmlName: "SignedIdentifier", type: { name: "Composite", - className: "DataLakeStorageError", + className: "SignedIdentifier", modelProperties: { - dataLakeStorageErrorDetails: { - xmlName: "error", - serializedName: "error", + id: { + serializedName: "Id", + required: true, + xmlName: "Id", + type: { + name: "String" + } + }, + accessPolicy: { + serializedName: "AccessPolicy", + xmlName: "AccessPolicy", type: { name: "Composite", - className: "DataLakeStorageErrorError" + className: "AccessPolicy" } } } @@ -20243,141 +19196,303 @@ var AccessPolicy = { className: "AccessPolicy", modelProperties: { startsOn: { - xmlName: "Start", serializedName: "Start", + xmlName: "Start", type: { name: "String" } }, expiresOn: { - xmlName: "Expiry", serializedName: "Expiry", + xmlName: "Expiry", type: { name: "String" } }, permissions: { - xmlName: "Permission", serializedName: "Permission", + xmlName: "Permission", + type: { + name: "String" + } + } + } + } +}; +var ListBlobsFlatSegmentResponse = { + serializedName: "ListBlobsFlatSegmentResponse", + xmlName: "EnumerationResults", + type: { + name: "Composite", + className: "ListBlobsFlatSegmentResponse", + modelProperties: { + serviceEndpoint: { + serializedName: "ServiceEndpoint", + required: true, + xmlName: "ServiceEndpoint", + xmlIsAttribute: true, + type: { + name: "String" + } + }, + containerName: { + serializedName: "ContainerName", + required: true, + xmlName: "ContainerName", + xmlIsAttribute: true, + type: { + name: "String" + } + }, + prefix: { + serializedName: "Prefix", + xmlName: "Prefix", + type: { + name: "String" + } + }, + marker: { + serializedName: "Marker", + xmlName: "Marker", + type: { + name: "String" + } + }, + maxPageSize: { + serializedName: "MaxResults", + xmlName: "MaxResults", + type: { + name: "Number" + } + }, + segment: { + serializedName: "Segment", + xmlName: "Blobs", + type: { + name: "Composite", + className: "BlobFlatListSegment" + } + }, + continuationToken: { + serializedName: "NextMarker", + xmlName: "NextMarker", + type: { + name: "String" + } + } + } + } +}; +var BlobFlatListSegment = { + serializedName: "BlobFlatListSegment", + xmlName: "Blobs", + type: { + name: "Composite", + className: "BlobFlatListSegment", + modelProperties: { + blobItems: { + serializedName: "BlobItems", + required: true, + xmlName: "BlobItems", + xmlElementName: "Blob", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "BlobItemInternal" + } + } + } + } + } + } +}; +var BlobItemInternal = { + serializedName: "BlobItemInternal", + xmlName: "Blob", + type: { + name: "Composite", + className: "BlobItemInternal", + modelProperties: { + name: { + serializedName: "Name", + required: true, + xmlName: "Name", + type: { + name: "String" + } + }, + deleted: { + serializedName: "Deleted", + required: true, + xmlName: "Deleted", + type: { + name: "Boolean" + } + }, + snapshot: { + serializedName: "Snapshot", + required: true, + xmlName: "Snapshot", + type: { + name: "String" + } + }, + versionId: { + serializedName: "VersionId", + xmlName: "VersionId", + type: { + name: "String" + } + }, + isCurrentVersion: { + serializedName: "IsCurrentVersion", + xmlName: "IsCurrentVersion", + type: { + name: "Boolean" + } + }, + properties: { + serializedName: "Properties", + xmlName: "Properties", + type: { + name: "Composite", + className: "BlobPropertiesInternal" + } + }, + metadata: { + serializedName: "Metadata", + xmlName: "Metadata", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + blobTags: { + serializedName: "BlobTags", + xmlName: "Tags", + type: { + name: "Composite", + className: "BlobTags" + } + }, + objectReplicationMetadata: { + serializedName: "ObjectReplicationMetadata", + xmlName: "OrMetadata", type: { - name: "String" + name: "Dictionary", + value: { type: { name: "String" } } } } } } }; var BlobPropertiesInternal = { - xmlName: "Properties", serializedName: "BlobPropertiesInternal", + xmlName: "Properties", type: { name: "Composite", className: "BlobPropertiesInternal", modelProperties: { createdOn: { - xmlName: "Creation-Time", serializedName: "Creation-Time", + xmlName: "Creation-Time", type: { name: "DateTimeRfc1123" } }, lastModified: { - xmlName: "Last-Modified", - required: true, serializedName: "Last-Modified", + required: true, + xmlName: "Last-Modified", type: { name: "DateTimeRfc1123" } }, etag: { - xmlName: "Etag", - required: true, serializedName: "Etag", + required: true, + xmlName: "Etag", type: { name: "String" } }, contentLength: { - xmlName: "Content-Length", serializedName: "Content-Length", + xmlName: "Content-Length", type: { name: "Number" } }, contentType: { - xmlName: "Content-Type", serializedName: "Content-Type", + xmlName: "Content-Type", type: { name: "String" } }, contentEncoding: { - xmlName: "Content-Encoding", serializedName: "Content-Encoding", + xmlName: "Content-Encoding", type: { name: "String" } }, contentLanguage: { - xmlName: "Content-Language", serializedName: "Content-Language", + xmlName: "Content-Language", type: { name: "String" } }, contentMD5: { - xmlName: "Content-MD5", serializedName: "Content-MD5", + xmlName: "Content-MD5", type: { name: "ByteArray" } }, contentDisposition: { - xmlName: "Content-Disposition", serializedName: "Content-Disposition", + xmlName: "Content-Disposition", type: { name: "String" } }, cacheControl: { - xmlName: "Cache-Control", serializedName: "Cache-Control", + xmlName: "Cache-Control", type: { name: "String" } }, blobSequenceNumber: { - xmlName: "x-ms-blob-sequence-number", serializedName: "x-ms-blob-sequence-number", + xmlName: "x-ms-blob-sequence-number", type: { name: "Number" } }, blobType: { - xmlName: "BlobType", serializedName: "BlobType", + xmlName: "BlobType", type: { name: "Enum", - allowedValues: [ - "BlockBlob", - "PageBlob", - "AppendBlob" - ] + allowedValues: ["BlockBlob", "PageBlob", "AppendBlob"] } }, leaseStatus: { - xmlName: "LeaseStatus", serializedName: "LeaseStatus", + xmlName: "LeaseStatus", type: { name: "Enum", - allowedValues: [ - "locked", - "unlocked" - ] + allowedValues: ["locked", "unlocked"] } }, leaseState: { - xmlName: "LeaseState", serializedName: "LeaseState", + xmlName: "LeaseState", type: { name: "Enum", allowedValues: [ @@ -20390,172 +19505,185 @@ var BlobPropertiesInternal = { } }, leaseDuration: { - xmlName: "LeaseDuration", serializedName: "LeaseDuration", + xmlName: "LeaseDuration", type: { name: "Enum", - allowedValues: [ - "infinite", - "fixed" - ] + allowedValues: ["infinite", "fixed"] } }, copyId: { - xmlName: "CopyId", serializedName: "CopyId", + xmlName: "CopyId", type: { name: "String" } }, copyStatus: { - xmlName: "CopyStatus", serializedName: "CopyStatus", + xmlName: "CopyStatus", type: { name: "Enum", - allowedValues: [ - "pending", - "success", - "aborted", - "failed" - ] + allowedValues: ["pending", "success", "aborted", "failed"] } }, copySource: { - xmlName: "CopySource", serializedName: "CopySource", + xmlName: "CopySource", type: { name: "String" } }, copyProgress: { - xmlName: "CopyProgress", serializedName: "CopyProgress", + xmlName: "CopyProgress", type: { name: "String" } }, copyCompletedOn: { - xmlName: "CopyCompletionTime", serializedName: "CopyCompletionTime", + xmlName: "CopyCompletionTime", type: { name: "DateTimeRfc1123" } }, copyStatusDescription: { - xmlName: "CopyStatusDescription", serializedName: "CopyStatusDescription", + xmlName: "CopyStatusDescription", type: { name: "String" } }, serverEncrypted: { - xmlName: "ServerEncrypted", serializedName: "ServerEncrypted", + xmlName: "ServerEncrypted", type: { name: "Boolean" } }, incrementalCopy: { - xmlName: "IncrementalCopy", serializedName: "IncrementalCopy", + xmlName: "IncrementalCopy", type: { name: "Boolean" } }, destinationSnapshot: { - xmlName: "DestinationSnapshot", serializedName: "DestinationSnapshot", + xmlName: "DestinationSnapshot", type: { name: "String" } }, deletedOn: { - xmlName: "DeletedTime", serializedName: "DeletedTime", + xmlName: "DeletedTime", type: { name: "DateTimeRfc1123" } }, remainingRetentionDays: { - xmlName: "RemainingRetentionDays", serializedName: "RemainingRetentionDays", + xmlName: "RemainingRetentionDays", type: { name: "Number" } }, accessTier: { - xmlName: "AccessTier", serializedName: "AccessTier", + xmlName: "AccessTier", type: { - name: "String" + name: "Enum", + allowedValues: [ + "P4", + "P6", + "P10", + "P15", + "P20", + "P30", + "P40", + "P50", + "P60", + "P70", + "P80", + "Hot", + "Cool", + "Archive" + ] } }, accessTierInferred: { - xmlName: "AccessTierInferred", serializedName: "AccessTierInferred", + xmlName: "AccessTierInferred", type: { name: "Boolean" } }, archiveStatus: { - xmlName: "ArchiveStatus", serializedName: "ArchiveStatus", + xmlName: "ArchiveStatus", type: { - name: "String" + name: "Enum", + allowedValues: [ + "rehydrate-pending-to-hot", + "rehydrate-pending-to-cool" + ] } }, customerProvidedKeySha256: { - xmlName: "CustomerProvidedKeySha256", serializedName: "CustomerProvidedKeySha256", + xmlName: "CustomerProvidedKeySha256", type: { name: "String" } }, encryptionScope: { - xmlName: "EncryptionScope", serializedName: "EncryptionScope", + xmlName: "EncryptionScope", type: { name: "String" } }, accessTierChangedOn: { - xmlName: "AccessTierChangeTime", serializedName: "AccessTierChangeTime", + xmlName: "AccessTierChangeTime", type: { name: "DateTimeRfc1123" } }, tagCount: { - xmlName: "TagCount", serializedName: "TagCount", + xmlName: "TagCount", type: { name: "Number" } }, expiresOn: { - xmlName: "Expiry-Time", serializedName: "Expiry-Time", + xmlName: "Expiry-Time", type: { name: "DateTimeRfc1123" } }, isSealed: { - xmlName: "Sealed", serializedName: "Sealed", + xmlName: "Sealed", type: { name: "Boolean" } }, rehydratePriority: { - xmlName: "RehydratePriority", serializedName: "RehydratePriority", + xmlName: "RehydratePriority", type: { - name: "String" + name: "Enum", + allowedValues: ["High", "Standard"] } }, lastAccessedOn: { - xmlName: "LastAccessTime", serializedName: "LastAccessTime", + xmlName: "LastAccessTime", type: { name: "DateTimeRfc1123" } @@ -20563,247 +19691,70 @@ var BlobPropertiesInternal = { } } }; -var BlobTag = { - xmlName: "Tag", - serializedName: "BlobTag", - type: { - name: "Composite", - className: "BlobTag", - modelProperties: { - key: { - xmlName: "Key", - required: true, - serializedName: "Key", - type: { - name: "String" - } - }, - value: { - xmlName: "Value", - required: true, - serializedName: "Value", - type: { - name: "String" - } - } - } - } -}; -var BlobTags = { - xmlName: "Tags", - serializedName: "BlobTags", - type: { - name: "Composite", - className: "BlobTags", - modelProperties: { - blobTagSet: { - xmlIsWrapped: true, - xmlName: "TagSet", - xmlElementName: "Tag", - required: true, - serializedName: "BlobTagSet", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "BlobTag" - } - } - } - } - } - } -}; -var BlobItemInternal = { - xmlName: "Blob", - serializedName: "BlobItemInternal", - type: { - name: "Composite", - className: "BlobItemInternal", - modelProperties: { - name: { - xmlName: "Name", - required: true, - serializedName: "Name", - type: { - name: "String" - } - }, - deleted: { - xmlName: "Deleted", - required: true, - serializedName: "Deleted", - type: { - name: "Boolean" - } - }, - snapshot: { - xmlName: "Snapshot", - required: true, - serializedName: "Snapshot", - type: { - name: "String" - } - }, - versionId: { - xmlName: "VersionId", - serializedName: "VersionId", - type: { - name: "String" - } - }, - isCurrentVersion: { - xmlName: "IsCurrentVersion", - serializedName: "IsCurrentVersion", - type: { - name: "Boolean" - } - }, - properties: { - xmlName: "Properties", - required: true, - serializedName: "Properties", - type: { - name: "Composite", - className: "BlobPropertiesInternal" - } - }, - metadata: { - xmlName: "Metadata", - serializedName: "Metadata", - type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } - } - }, - blobTags: { - xmlName: "Tags", - serializedName: "BlobTags", - type: { - name: "Composite", - className: "BlobTags" - } - }, - objectReplicationMetadata: { - xmlName: "OrMetadata", - serializedName: "ObjectReplicationMetadata", - type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } - } - } - } - } -}; -var BlobFlatListSegment = { - xmlName: "Blobs", - serializedName: "BlobFlatListSegment", - type: { - name: "Composite", - className: "BlobFlatListSegment", - modelProperties: { - blobItems: { - xmlName: "BlobItems", - xmlElementName: "Blob", - required: true, - serializedName: "BlobItems", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "BlobItemInternal" - } - } - } - } - } - } -}; -var ListBlobsFlatSegmentResponse = { +var ListBlobsHierarchySegmentResponse = { + serializedName: "ListBlobsHierarchySegmentResponse", xmlName: "EnumerationResults", - serializedName: "ListBlobsFlatSegmentResponse", type: { name: "Composite", - className: "ListBlobsFlatSegmentResponse", + className: "ListBlobsHierarchySegmentResponse", modelProperties: { serviceEndpoint: { - xmlIsAttribute: true, - xmlName: "ServiceEndpoint", - required: true, serializedName: "ServiceEndpoint", + required: true, + xmlName: "ServiceEndpoint", + xmlIsAttribute: true, type: { name: "String" } }, containerName: { - xmlIsAttribute: true, - xmlName: "ContainerName", - required: true, serializedName: "ContainerName", + required: true, + xmlName: "ContainerName", + xmlIsAttribute: true, type: { name: "String" } }, prefix: { - xmlName: "Prefix", serializedName: "Prefix", + xmlName: "Prefix", type: { name: "String" } }, marker: { - xmlName: "Marker", serializedName: "Marker", + xmlName: "Marker", type: { name: "String" } }, maxPageSize: { - xmlName: "MaxResults", serializedName: "MaxResults", + xmlName: "MaxResults", type: { name: "Number" } }, + delimiter: { + serializedName: "Delimiter", + xmlName: "Delimiter", + type: { + name: "String" + } + }, segment: { - xmlName: "Blobs", - required: true, serializedName: "Segment", + xmlName: "Blobs", type: { name: "Composite", - className: "BlobFlatListSegment" + className: "BlobHierarchyListSegment" } }, continuationToken: { - xmlName: "NextMarker", serializedName: "NextMarker", - type: { - name: "String" - } - } - } - } -}; -var BlobPrefix = { - serializedName: "BlobPrefix", - type: { - name: "Composite", - className: "BlobPrefix", - modelProperties: { - name: { - xmlName: "Name", - required: true, - serializedName: "Name", + xmlName: "NextMarker", type: { name: "String" } @@ -20812,16 +19763,16 @@ var BlobPrefix = { } }; var BlobHierarchyListSegment = { - xmlName: "Blobs", serializedName: "BlobHierarchyListSegment", + xmlName: "Blobs", type: { name: "Composite", className: "BlobHierarchyListSegment", modelProperties: { blobPrefixes: { + serializedName: "BlobPrefixes", xmlName: "BlobPrefixes", xmlElementName: "BlobPrefix", - serializedName: "BlobPrefixes", type: { name: "Sequence", element: { @@ -20833,10 +19784,10 @@ var BlobHierarchyListSegment = { } }, blobItems: { + serializedName: "BlobItems", + required: true, xmlName: "BlobItems", xmlElementName: "Blob", - required: true, - serializedName: "BlobItems", type: { name: "Sequence", element: { @@ -20850,71 +19801,56 @@ var BlobHierarchyListSegment = { } } }; -var ListBlobsHierarchySegmentResponse = { - xmlName: "EnumerationResults", - serializedName: "ListBlobsHierarchySegmentResponse", +var BlobPrefix = { + serializedName: "BlobPrefix", type: { name: "Composite", - className: "ListBlobsHierarchySegmentResponse", + className: "BlobPrefix", modelProperties: { - serviceEndpoint: { - xmlIsAttribute: true, - xmlName: "ServiceEndpoint", - required: true, - serializedName: "ServiceEndpoint", - type: { - name: "String" - } - }, - containerName: { - xmlIsAttribute: true, - xmlName: "ContainerName", + name: { + serializedName: "Name", required: true, - serializedName: "ContainerName", - type: { - name: "String" - } - }, - prefix: { - xmlName: "Prefix", - serializedName: "Prefix", - type: { - name: "String" - } - }, - marker: { - xmlName: "Marker", - serializedName: "Marker", + xmlName: "Name", type: { name: "String" } - }, - maxPageSize: { - xmlName: "MaxResults", - serializedName: "MaxResults", + } + } + } +}; +var DataLakeStorageError = { + serializedName: "DataLakeStorageError", + type: { + name: "Composite", + className: "DataLakeStorageError", + modelProperties: { + dataLakeStorageErrorDetails: { + serializedName: "error", + xmlName: "error", type: { - name: "Number" + name: "Composite", + className: "DataLakeStorageErrorError" } - }, - delimiter: { - xmlName: "Delimiter", - serializedName: "Delimiter", + } + } + } +}; +var DataLakeStorageErrorError = { + serializedName: "DataLakeStorageErrorError", + type: { + name: "Composite", + className: "DataLakeStorageErrorError", + modelProperties: { + code: { + serializedName: "Code", + xmlName: "Code", type: { name: "String" } }, - segment: { - xmlName: "Blobs", - required: true, - serializedName: "Segment", - type: { - name: "Composite", - className: "BlobHierarchyListSegment" - } - }, - continuationToken: { - xmlName: "NextMarker", - serializedName: "NextMarker", + message: { + serializedName: "Message", + xmlName: "Message", type: { name: "String" } @@ -20922,26 +19858,50 @@ var ListBlobsHierarchySegmentResponse = { } } }; -var Block = { - serializedName: "Block", +var BlockLookupList = { + serializedName: "BlockLookupList", + xmlName: "BlockList", type: { name: "Composite", - className: "Block", + className: "BlockLookupList", modelProperties: { - name: { - xmlName: "Name", - required: true, - serializedName: "Name", + committed: { + serializedName: "Committed", + xmlName: "Committed", + xmlElementName: "Committed", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "String" + } + } } }, - size: { - xmlName: "Size", - required: true, - serializedName: "Size", + uncommitted: { + serializedName: "Uncommitted", + xmlName: "Uncommitted", + xmlElementName: "Uncommitted", type: { - name: "Number" + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + latest: { + serializedName: "Latest", + xmlName: "Latest", + xmlElementName: "Latest", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } } } } @@ -20954,10 +19914,10 @@ var BlockList = { className: "BlockList", modelProperties: { committedBlocks: { - xmlIsWrapped: true, + serializedName: "CommittedBlocks", xmlName: "CommittedBlocks", + xmlIsWrapped: true, xmlElementName: "Block", - serializedName: "CommittedBlocks", type: { name: "Sequence", element: { @@ -20969,10 +19929,10 @@ var BlockList = { } }, uncommittedBlocks: { - xmlIsWrapped: true, + serializedName: "UncommittedBlocks", xmlName: "UncommittedBlocks", + xmlIsWrapped: true, xmlElementName: "Block", - serializedName: "UncommittedBlocks", type: { name: "Sequence", element: { @@ -20986,48 +19946,61 @@ var BlockList = { } } }; -var BlockLookupList = { - xmlName: "BlockList", - serializedName: "BlockLookupList", +var Block = { + serializedName: "Block", type: { name: "Composite", - className: "BlockLookupList", + className: "Block", modelProperties: { - committed: { - xmlName: "Committed", - xmlElementName: "Committed", - serializedName: "Committed", + name: { + serializedName: "Name", + required: true, + xmlName: "Name", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" } }, - uncommitted: { - xmlName: "Uncommitted", - xmlElementName: "Uncommitted", - serializedName: "Uncommitted", + size: { + serializedName: "Size", + required: true, + xmlName: "Size", + type: { + name: "Number" + } + } + } + } +}; +var PageList = { + serializedName: "PageList", + type: { + name: "Composite", + className: "PageList", + modelProperties: { + pageRange: { + serializedName: "PageRange", + xmlName: "PageRange", + xmlElementName: "PageRange", type: { name: "Sequence", element: { type: { - name: "String" + name: "Composite", + className: "PageRange" } } } }, - latest: { - xmlName: "Latest", - xmlElementName: "Latest", - serializedName: "Latest", + clearRange: { + serializedName: "ClearRange", + xmlName: "ClearRange", + xmlElementName: "ClearRange", type: { name: "Sequence", element: { type: { - name: "String" + name: "Composite", + className: "ClearRange" } } } @@ -21035,164 +20008,153 @@ var BlockLookupList = { } } }; -var ContainerProperties = { - serializedName: "ContainerProperties", +var PageRange = { + serializedName: "PageRange", + xmlName: "PageRange", type: { name: "Composite", - className: "ContainerProperties", + className: "PageRange", modelProperties: { - lastModified: { - xmlName: "Last-Modified", + start: { + serializedName: "Start", required: true, - serializedName: "Last-Modified", + xmlName: "Start", type: { - name: "DateTimeRfc1123" + name: "Number" } }, - etag: { - xmlName: "Etag", + end: { + serializedName: "End", required: true, - serializedName: "Etag", - type: { - name: "String" - } - }, - leaseStatus: { - xmlName: "LeaseStatus", - serializedName: "LeaseStatus", + xmlName: "End", type: { - name: "Enum", - allowedValues: [ - "locked", - "unlocked" - ] + name: "Number" } - }, - leaseState: { - xmlName: "LeaseState", - serializedName: "LeaseState", + } + } + } +}; +var ClearRange = { + serializedName: "ClearRange", + xmlName: "ClearRange", + type: { + name: "Composite", + className: "ClearRange", + modelProperties: { + start: { + serializedName: "Start", + required: true, + xmlName: "Start", type: { - name: "Enum", - allowedValues: [ - "available", - "leased", - "expired", - "breaking", - "broken" - ] + name: "Number" } }, - leaseDuration: { - xmlName: "LeaseDuration", - serializedName: "LeaseDuration", + end: { + serializedName: "End", + required: true, + xmlName: "End", type: { - name: "Enum", - allowedValues: [ - "infinite", - "fixed" - ] + name: "Number" } - }, - publicAccess: { - xmlName: "PublicAccess", - serializedName: "PublicAccess", + } + } + } +}; +var QueryRequest = { + serializedName: "QueryRequest", + xmlName: "QueryRequest", + type: { + name: "Composite", + className: "QueryRequest", + modelProperties: { + queryType: { + serializedName: "QueryType", + required: true, + xmlName: "QueryType", type: { name: "String" } }, - hasImmutabilityPolicy: { - xmlName: "HasImmutabilityPolicy", - serializedName: "HasImmutabilityPolicy", - type: { - name: "Boolean" - } - }, - hasLegalHold: { - xmlName: "HasLegalHold", - serializedName: "HasLegalHold", - type: { - name: "Boolean" - } - }, - defaultEncryptionScope: { - xmlName: "DefaultEncryptionScope", - serializedName: "DefaultEncryptionScope", + expression: { + serializedName: "Expression", + required: true, + xmlName: "Expression", type: { name: "String" } }, - preventEncryptionScopeOverride: { - xmlName: "DenyEncryptionScopeOverride", - serializedName: "DenyEncryptionScopeOverride", - type: { - name: "Boolean" - } - }, - deletedOn: { - xmlName: "DeletedTime", - serializedName: "DeletedTime", + inputSerialization: { + serializedName: "InputSerialization", + xmlName: "InputSerialization", type: { - name: "DateTimeRfc1123" + name: "Composite", + className: "QuerySerialization" } }, - remainingRetentionDays: { - xmlName: "RemainingRetentionDays", - serializedName: "RemainingRetentionDays", + outputSerialization: { + serializedName: "OutputSerialization", + xmlName: "OutputSerialization", type: { - name: "Number" + name: "Composite", + className: "QuerySerialization" } } } } }; -var ContainerItem = { - xmlName: "Container", - serializedName: "ContainerItem", +var QuerySerialization = { + serializedName: "QuerySerialization", type: { name: "Composite", - className: "ContainerItem", + className: "QuerySerialization", modelProperties: { - name: { - xmlName: "Name", - required: true, - serializedName: "Name", + format: { + serializedName: "Format", + xmlName: "Format", type: { - name: "String" + name: "Composite", + className: "QueryFormat" } - }, - deleted: { - xmlName: "Deleted", - serializedName: "Deleted", + } + } + } +}; +var QueryFormat = { + serializedName: "QueryFormat", + type: { + name: "Composite", + className: "QueryFormat", + modelProperties: { + type: { + serializedName: "Type", + xmlName: "Type", type: { - name: "Boolean" + name: "Enum", + allowedValues: ["delimited", "json", "arrow"] } }, - version: { - xmlName: "Version", - serializedName: "Version", + delimitedTextConfiguration: { + serializedName: "DelimitedTextConfiguration", + xmlName: "DelimitedTextConfiguration", type: { - name: "String" + name: "Composite", + className: "DelimitedTextConfiguration" } }, - properties: { - xmlName: "Properties", - required: true, - serializedName: "Properties", + jsonTextConfiguration: { + serializedName: "JsonTextConfiguration", + xmlName: "JsonTextConfiguration", type: { name: "Composite", - className: "ContainerProperties" + className: "JsonTextConfiguration" } }, - metadata: { - xmlName: "Metadata", - serializedName: "Metadata", + arrowConfiguration: { + serializedName: "ArrowConfiguration", + xmlName: "ArrowConfiguration", type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } + name: "Composite", + className: "ArrowConfiguration" } } } @@ -21200,46 +20162,47 @@ var ContainerItem = { }; var DelimitedTextConfiguration = { serializedName: "DelimitedTextConfiguration", + xmlName: "DelimitedTextConfiguration", type: { name: "Composite", className: "DelimitedTextConfiguration", modelProperties: { columnSeparator: { - xmlName: "ColumnSeparator", - required: true, serializedName: "ColumnSeparator", + required: true, + xmlName: "ColumnSeparator", type: { name: "String" } }, fieldQuote: { - xmlName: "FieldQuote", - required: true, serializedName: "FieldQuote", + required: true, + xmlName: "FieldQuote", type: { name: "String" } }, recordSeparator: { - xmlName: "RecordSeparator", - required: true, serializedName: "RecordSeparator", + required: true, + xmlName: "RecordSeparator", type: { name: "String" } }, escapeChar: { - xmlName: "EscapeChar", - required: true, serializedName: "EscapeChar", + required: true, + xmlName: "EscapeChar", type: { name: "String" } }, headersPresent: { - xmlName: "HasHeaders", - required: true, serializedName: "HeadersPresent", + required: true, + xmlName: "HasHeaders", type: { name: "Boolean" } @@ -21249,14 +20212,15 @@ var DelimitedTextConfiguration = { }; var JsonTextConfiguration = { serializedName: "JsonTextConfiguration", + xmlName: "JsonTextConfiguration", type: { name: "Composite", className: "JsonTextConfiguration", modelProperties: { recordSeparator: { - xmlName: "RecordSeparator", - required: true, serializedName: "RecordSeparator", + required: true, + xmlName: "RecordSeparator", type: { name: "String" } @@ -21264,38 +20228,64 @@ var JsonTextConfiguration = { } } }; +var ArrowConfiguration = { + serializedName: "ArrowConfiguration", + xmlName: "ArrowConfiguration", + type: { + name: "Composite", + className: "ArrowConfiguration", + modelProperties: { + schema: { + serializedName: "Schema", + required: true, + xmlName: "Schema", + xmlIsWrapped: true, + xmlElementName: "Field", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ArrowField" + } + } + } + } + } + } +}; var ArrowField = { - xmlName: "Field", serializedName: "ArrowField", + xmlName: "Field", type: { name: "Composite", className: "ArrowField", modelProperties: { type: { - xmlName: "Type", - required: true, serializedName: "Type", + required: true, + xmlName: "Type", type: { name: "String" } }, name: { - xmlName: "Name", serializedName: "Name", + xmlName: "Name", type: { name: "String" } }, precision: { - xmlName: "Precision", serializedName: "Precision", + xmlName: "Precision", type: { name: "Number" } }, scale: { - xmlName: "Scale", serializedName: "Scale", + xmlName: "Scale", type: { name: "Number" } @@ -21303,87 +20293,36 @@ var ArrowField = { } } }; -var ArrowConfiguration = { - serializedName: "ArrowConfiguration", - type: { - name: "Composite", - className: "ArrowConfiguration", - modelProperties: { - schema: { - xmlIsWrapped: true, - xmlName: "Schema", - xmlElementName: "Field", - required: true, - serializedName: "Schema", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ArrowField" - } - } - } - } - } - } -}; -var ListContainersSegmentResponse = { - xmlName: "EnumerationResults", - serializedName: "ListContainersSegmentResponse", +var ServiceSetPropertiesHeaders = { + serializedName: "Service_setPropertiesHeaders", type: { name: "Composite", - className: "ListContainersSegmentResponse", + className: "ServiceSetPropertiesHeaders", modelProperties: { - serviceEndpoint: { - xmlIsAttribute: true, - xmlName: "ServiceEndpoint", - required: true, - serializedName: "ServiceEndpoint", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - prefix: { - xmlName: "Prefix", - serializedName: "Prefix", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - marker: { - xmlName: "Marker", - serializedName: "Marker", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - maxPageSize: { - xmlName: "MaxResults", - serializedName: "MaxResults", - type: { - name: "Number" - } - }, - containerItems: { - xmlIsWrapped: true, - xmlName: "Containers", - xmlElementName: "Container", - required: true, - serializedName: "ContainerItems", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ContainerItem" - } - } - } - }, - continuationToken: { - xmlName: "NextMarker", - serializedName: "NextMarker", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -21391,135 +20330,112 @@ var ListContainersSegmentResponse = { } } }; -var CorsRule = { - serializedName: "CorsRule", +var ServiceSetPropertiesExceptionHeaders = { + serializedName: "Service_setPropertiesExceptionHeaders", type: { name: "Composite", - className: "CorsRule", + className: "ServiceSetPropertiesExceptionHeaders", modelProperties: { - allowedOrigins: { - xmlName: "AllowedOrigins", - required: true, - serializedName: "AllowedOrigins", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, - allowedMethods: { - xmlName: "AllowedMethods", - required: true, - serializedName: "AllowedMethods", + } + } + } +}; +var ServiceGetPropertiesHeaders = { + serializedName: "Service_getPropertiesHeaders", + type: { + name: "Composite", + className: "ServiceGetPropertiesHeaders", + modelProperties: { + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - allowedHeaders: { - xmlName: "AllowedHeaders", - required: true, - serializedName: "AllowedHeaders", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - exposedHeaders: { - xmlName: "ExposedHeaders", - required: true, - serializedName: "ExposedHeaders", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - maxAgeInSeconds: { - xmlName: "MaxAgeInSeconds", - required: true, - serializedName: "MaxAgeInSeconds", - constraints: { - InclusiveMinimum: 0 - }, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Number" + name: "String" } } } } }; -var FilterBlobItem = { - xmlName: "Blob", - serializedName: "FilterBlobItem", +var ServiceGetPropertiesExceptionHeaders = { + serializedName: "Service_getPropertiesExceptionHeaders", type: { name: "Composite", - className: "FilterBlobItem", + className: "ServiceGetPropertiesExceptionHeaders", modelProperties: { - name: { - xmlName: "Name", - required: true, - serializedName: "Name", - type: { - name: "String" - } - }, - containerName: { - xmlName: "ContainerName", - required: true, - serializedName: "ContainerName", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, - tags: { - xmlName: "Tags", - serializedName: "Tags", - type: { - name: "Composite", - className: "BlobTags" - } } } } }; -var FilterBlobSegment = { - xmlName: "EnumerationResults", - serializedName: "FilterBlobSegment", +var ServiceGetStatisticsHeaders = { + serializedName: "Service_getStatisticsHeaders", type: { name: "Composite", - className: "FilterBlobSegment", + className: "ServiceGetStatisticsHeaders", modelProperties: { - serviceEndpoint: { - xmlIsAttribute: true, - xmlName: "ServiceEndpoint", - required: true, - serializedName: "ServiceEndpoint", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - where: { - xmlName: "Where", - required: true, - serializedName: "Where", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - blobs: { - xmlIsWrapped: true, - xmlName: "Blobs", - xmlElementName: "Blob", - required: true, - serializedName: "Blobs", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "FilterBlobItem" - } - } + name: "String" } }, - continuationToken: { - xmlName: "NextMarker", - serializedName: "NextMarker", + date: { + serializedName: "date", + xmlName: "date", + type: { + name: "DateTimeRfc1123" + } + }, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -21527,520 +20443,610 @@ var FilterBlobSegment = { } } }; -var GeoReplication = { - serializedName: "GeoReplication", +var ServiceGetStatisticsExceptionHeaders = { + serializedName: "Service_getStatisticsExceptionHeaders", type: { name: "Composite", - className: "GeoReplication", + className: "ServiceGetStatisticsExceptionHeaders", modelProperties: { - status: { - xmlName: "Status", - required: true, - serializedName: "Status", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var ServiceListContainersSegmentHeaders = { + serializedName: "Service_listContainersSegmentHeaders", + type: { + name: "Composite", + className: "ServiceListContainersSegmentHeaders", + modelProperties: { + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", + type: { + name: "String" + } + }, + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - lastSyncOn: { - xmlName: "LastSyncTime", - required: true, - serializedName: "LastSyncTime", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "DateTimeRfc1123" + name: "String" + } + }, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" } } } } }; -var RetentionPolicy = { - serializedName: "RetentionPolicy", +var ServiceListContainersSegmentExceptionHeaders = { + serializedName: "Service_listContainersSegmentExceptionHeaders", type: { name: "Composite", - className: "RetentionPolicy", + className: "ServiceListContainersSegmentExceptionHeaders", modelProperties: { - enabled: { - xmlName: "Enabled", - required: true, - serializedName: "Enabled", - type: { - name: "Boolean" - } - }, - days: { - xmlName: "Days", - serializedName: "Days", - constraints: { - InclusiveMinimum: 1 - }, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Number" + name: "String" } } } } }; -var Logging = { - serializedName: "Logging", +var ServiceGetUserDelegationKeyHeaders = { + serializedName: "Service_getUserDelegationKeyHeaders", type: { name: "Composite", - className: "Logging", + className: "ServiceGetUserDelegationKeyHeaders", modelProperties: { - version: { - xmlName: "Version", - required: true, - serializedName: "Version", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - deleteProperty: { - xmlName: "Delete", - required: true, - serializedName: "Delete", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Boolean" + name: "String" } }, - read: { - xmlName: "Read", - required: true, - serializedName: "Read", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Boolean" + name: "String" } }, - write: { - xmlName: "Write", - required: true, - serializedName: "Write", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Boolean" + name: "DateTimeRfc1123" } }, - retentionPolicy: { - xmlName: "RetentionPolicy", - required: true, - serializedName: "RetentionPolicy", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Composite", - className: "RetentionPolicy" + name: "String" } } } } }; -var Metrics = { - serializedName: "Metrics", +var ServiceGetUserDelegationKeyExceptionHeaders = { + serializedName: "Service_getUserDelegationKeyExceptionHeaders", type: { name: "Composite", - className: "Metrics", + className: "ServiceGetUserDelegationKeyExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var ServiceGetAccountInfoHeaders = { + serializedName: "Service_getAccountInfoHeaders", + type: { + name: "Composite", + className: "ServiceGetAccountInfoHeaders", modelProperties: { + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", + type: { + name: "String" + } + }, + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", + type: { + name: "String" + } + }, version: { - xmlName: "Version", - serializedName: "Version", + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - enabled: { - xmlName: "Enabled", - required: true, - serializedName: "Enabled", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Boolean" + name: "DateTimeRfc1123" } }, - includeAPIs: { - xmlName: "IncludeAPIs", - serializedName: "IncludeAPIs", + skuName: { + serializedName: "x-ms-sku-name", + xmlName: "x-ms-sku-name", + type: { + name: "Enum", + allowedValues: [ + "Standard_LRS", + "Standard_GRS", + "Standard_RAGRS", + "Standard_ZRS", + "Premium_LRS" + ] + } + }, + accountKind: { + serializedName: "x-ms-account-kind", + xmlName: "x-ms-account-kind", + type: { + name: "Enum", + allowedValues: [ + "Storage", + "BlobStorage", + "StorageV2", + "FileStorage", + "BlockBlobStorage" + ] + } + }, + isHierarchicalNamespaceEnabled: { + serializedName: "x-ms-is-hns-enabled", + xmlName: "x-ms-is-hns-enabled", type: { name: "Boolean" } }, - retentionPolicy: { - xmlName: "RetentionPolicy", - serializedName: "RetentionPolicy", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Composite", - className: "RetentionPolicy" + name: "String" } } } } }; -var PageRange = { - serializedName: "PageRange", +var ServiceGetAccountInfoExceptionHeaders = { + serializedName: "Service_getAccountInfoExceptionHeaders", type: { name: "Composite", - className: "PageRange", + className: "ServiceGetAccountInfoExceptionHeaders", modelProperties: { - start: { - xmlName: "Start", - required: true, - serializedName: "Start", - type: { - name: "Number" - } - }, - end: { - xmlName: "End", - required: true, - serializedName: "End", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Number" + name: "String" } } } } }; -var ClearRange = { - serializedName: "ClearRange", +var ServiceSubmitBatchHeaders = { + serializedName: "Service_submitBatchHeaders", type: { name: "Composite", - className: "ClearRange", + className: "ServiceSubmitBatchHeaders", modelProperties: { - start: { - xmlName: "Start", - required: true, - serializedName: "Start", + contentType: { + serializedName: "content-type", + xmlName: "content-type", type: { - name: "Number" + name: "String" } }, - end: { - xmlName: "End", - required: true, - serializedName: "End", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Number" + name: "String" + } + }, + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", + type: { + name: "String" + } + }, + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", + type: { + name: "String" + } + }, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" } } } } }; -var PageList = { - serializedName: "PageList", +var ServiceSubmitBatchExceptionHeaders = { + serializedName: "Service_submitBatchExceptionHeaders", type: { name: "Composite", - className: "PageList", + className: "ServiceSubmitBatchExceptionHeaders", modelProperties: { - pageRange: { - xmlName: "PageRange", - xmlElementName: "PageRange", - serializedName: "PageRange", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PageRange" - } - } - } - }, - clearRange: { - xmlName: "ClearRange", - xmlElementName: "ClearRange", - serializedName: "ClearRange", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ClearRange" - } - } + name: "String" } } } } }; -var QueryFormat = { - serializedName: "QueryFormat", +var ServiceFilterBlobsHeaders = { + serializedName: "Service_filterBlobsHeaders", type: { name: "Composite", - className: "QueryFormat", + className: "ServiceFilterBlobsHeaders", modelProperties: { - type: { - xmlName: "Type", - serializedName: "Type", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { - name: "Enum", - allowedValues: [ - "delimited", - "json", - "arrow" - ] + name: "String" } }, - delimitedTextConfiguration: { - xmlName: "DelimitedTextConfiguration", - serializedName: "DelimitedTextConfiguration", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Composite", - className: "DelimitedTextConfiguration" + name: "String" } }, - jsonTextConfiguration: { - xmlName: "JsonTextConfiguration", - serializedName: "JsonTextConfiguration", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Composite", - className: "JsonTextConfiguration" + name: "String" } }, - arrowConfiguration: { - xmlName: "ArrowConfiguration", - serializedName: "ArrowConfiguration", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Composite", - className: "ArrowConfiguration" + name: "DateTimeRfc1123" + } + }, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" } } } } }; -var QuerySerialization = { - serializedName: "QuerySerialization", +var ServiceFilterBlobsExceptionHeaders = { + serializedName: "Service_filterBlobsExceptionHeaders", type: { name: "Composite", - className: "QuerySerialization", + className: "ServiceFilterBlobsExceptionHeaders", modelProperties: { - format: { - xmlName: "Format", - required: true, - serializedName: "Format", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Composite", - className: "QueryFormat" + name: "String" } } } } }; -var QueryRequest = { - serializedName: "QueryRequest", +var ContainerCreateHeaders = { + serializedName: "Container_createHeaders", type: { name: "Composite", - className: "QueryRequest", + className: "ContainerCreateHeaders", modelProperties: { - queryType: { - xmlName: "QueryType", - required: true, - isConstant: true, - serializedName: "QueryType", - defaultValue: 'SQL', + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - expression: { - xmlName: "Expression", - required: true, - serializedName: "Expression", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", + type: { + name: "DateTimeRfc1123" + } + }, + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - inputSerialization: { - xmlName: "InputSerialization", - serializedName: "InputSerialization", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Composite", - className: "QuerySerialization" + name: "String" } }, - outputSerialization: { - xmlName: "OutputSerialization", - serializedName: "OutputSerialization", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Composite", - className: "QuerySerialization" + name: "String" + } + }, + date: { + serializedName: "date", + xmlName: "date", + type: { + name: "DateTimeRfc1123" + } + }, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" } } } } }; -var SignedIdentifier = { - serializedName: "SignedIdentifier", +var ContainerCreateExceptionHeaders = { + serializedName: "Container_createExceptionHeaders", type: { name: "Composite", - className: "SignedIdentifier", + className: "ContainerCreateExceptionHeaders", modelProperties: { - id: { - xmlName: "Id", - required: true, - serializedName: "Id", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, - accessPolicy: { - xmlName: "AccessPolicy", - required: true, - serializedName: "AccessPolicy", - type: { - name: "Composite", - className: "AccessPolicy" - } } } } }; -var StaticWebsite = { - serializedName: "StaticWebsite", +var ContainerGetPropertiesHeaders = { + serializedName: "Container_getPropertiesHeaders", type: { name: "Composite", - className: "StaticWebsite", + className: "ContainerGetPropertiesHeaders", modelProperties: { - enabled: { - xmlName: "Enabled", - required: true, - serializedName: "Enabled", + metadata: { + serializedName: "x-ms-meta", + xmlName: "x-ms-meta", type: { - name: "Boolean" + name: "Dictionary", + value: { type: { name: "String" } } + }, + headerCollectionPrefix: "x-ms-meta-" + }, + etag: { + serializedName: "etag", + xmlName: "etag", + type: { + name: "String" } }, - indexDocument: { - xmlName: "IndexDocument", - serializedName: "IndexDocument", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", + type: { + name: "DateTimeRfc1123" + } + }, + leaseDuration: { + serializedName: "x-ms-lease-duration", + xmlName: "x-ms-lease-duration", + type: { + name: "Enum", + allowedValues: ["infinite", "fixed"] + } + }, + leaseState: { + serializedName: "x-ms-lease-state", + xmlName: "x-ms-lease-state", + type: { + name: "Enum", + allowedValues: [ + "available", + "leased", + "expired", + "breaking", + "broken" + ] + } + }, + leaseStatus: { + serializedName: "x-ms-lease-status", + xmlName: "x-ms-lease-status", + type: { + name: "Enum", + allowedValues: ["locked", "unlocked"] + } + }, + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - errorDocument404Path: { - xmlName: "ErrorDocument404Path", - serializedName: "ErrorDocument404Path", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - defaultIndexDocumentPath: { - xmlName: "DefaultIndexDocumentPath", - serializedName: "DefaultIndexDocumentPath", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } - } - } - } -}; -var BlobServiceProperties = { - xmlName: "StorageServiceProperties", - serializedName: "BlobServiceProperties", - type: { - name: "Composite", - className: "BlobServiceProperties", - modelProperties: { - blobAnalyticsLogging: { - xmlName: "Logging", - serializedName: "Logging", + }, + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Composite", - className: "Logging" + name: "DateTimeRfc1123" } }, - hourMetrics: { - xmlName: "HourMetrics", - serializedName: "HourMetrics", + blobPublicAccess: { + serializedName: "x-ms-blob-public-access", + xmlName: "x-ms-blob-public-access", type: { - name: "Composite", - className: "Metrics" + name: "Enum", + allowedValues: ["container", "blob"] } }, - minuteMetrics: { - xmlName: "MinuteMetrics", - serializedName: "MinuteMetrics", + hasImmutabilityPolicy: { + serializedName: "x-ms-has-immutability-policy", + xmlName: "x-ms-has-immutability-policy", type: { - name: "Composite", - className: "Metrics" + name: "Boolean" } }, - cors: { - xmlIsWrapped: true, - xmlName: "Cors", - xmlElementName: "CorsRule", - serializedName: "Cors", + hasLegalHold: { + serializedName: "x-ms-has-legal-hold", + xmlName: "x-ms-has-legal-hold", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "CorsRule" - } - } + name: "Boolean" } }, - defaultServiceVersion: { - xmlName: "DefaultServiceVersion", - serializedName: "DefaultServiceVersion", + defaultEncryptionScope: { + serializedName: "x-ms-default-encryption-scope", + xmlName: "x-ms-default-encryption-scope", type: { name: "String" } }, - deleteRetentionPolicy: { - xmlName: "DeleteRetentionPolicy", - serializedName: "DeleteRetentionPolicy", + denyEncryptionScopeOverride: { + serializedName: "x-ms-deny-encryption-scope-override", + xmlName: "x-ms-deny-encryption-scope-override", type: { - name: "Composite", - className: "RetentionPolicy" + name: "Boolean" } }, - staticWebsite: { - xmlName: "StaticWebsite", - serializedName: "StaticWebsite", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Composite", - className: "StaticWebsite" + name: "String" } } } } }; -var BlobServiceStatistics = { - xmlName: "StorageServiceStats", - serializedName: "BlobServiceStatistics", +var ContainerGetPropertiesExceptionHeaders = { + serializedName: "Container_getPropertiesExceptionHeaders", type: { name: "Composite", - className: "BlobServiceStatistics", + className: "ContainerGetPropertiesExceptionHeaders", modelProperties: { - geoReplication: { - xmlName: "GeoReplication", - serializedName: "GeoReplication", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Composite", - className: "GeoReplication" + name: "String" } } } } }; -var ServiceSetPropertiesHeaders = { - serializedName: "service-setproperties-headers", +var ContainerDeleteHeaders = { + serializedName: "Container_deleteHeaders", type: { name: "Composite", - className: "ServiceSetPropertiesHeaders", + className: "ContainerDeleteHeaders", modelProperties: { clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, + date: { + serializedName: "date", + xmlName: "date", + type: { + name: "DateTimeRfc1123" + } + }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -22048,32 +21054,15 @@ var ServiceSetPropertiesHeaders = { } } }; -var ServiceGetPropertiesHeaders = { - serializedName: "service-getproperties-headers", +var ContainerDeleteExceptionHeaders = { + serializedName: "Container_deleteExceptionHeaders", type: { name: "Composite", - className: "ServiceGetPropertiesHeaders", + className: "ContainerDeleteExceptionHeaders", modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - type: { - name: "String" - } - }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -22081,38 +21070,57 @@ var ServiceGetPropertiesHeaders = { } } }; -var ServiceGetStatisticsHeaders = { - serializedName: "service-getstatistics-headers", +var ContainerSetMetadataHeaders = { + serializedName: "Container_setMetadataHeaders", type: { name: "Composite", - className: "ServiceGetStatisticsHeaders", + className: "ContainerSetMetadataHeaders", modelProperties: { + etag: { + serializedName: "etag", + xmlName: "etag", + type: { + name: "String" + } + }, + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", + type: { + name: "DateTimeRfc1123" + } + }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -22120,32 +21128,15 @@ var ServiceGetStatisticsHeaders = { } } }; -var ServiceListContainersSegmentHeaders = { - serializedName: "service-listcontainerssegment-headers", +var ContainerSetMetadataExceptionHeaders = { + serializedName: "Container_setMetadataExceptionHeaders", type: { name: "Composite", - className: "ServiceListContainersSegmentHeaders", + className: "ContainerSetMetadataExceptionHeaders", modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - type: { - name: "String" - } - }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -22153,38 +21144,65 @@ var ServiceListContainersSegmentHeaders = { } } }; -var ServiceGetUserDelegationKeyHeaders = { - serializedName: "service-getuserdelegationkey-headers", +var ContainerGetAccessPolicyHeaders = { + serializedName: "Container_getAccessPolicyHeaders", type: { name: "Composite", - className: "ServiceGetUserDelegationKeyHeaders", + className: "ContainerGetAccessPolicyHeaders", modelProperties: { + blobPublicAccess: { + serializedName: "x-ms-blob-public-access", + xmlName: "x-ms-blob-public-access", + type: { + name: "Enum", + allowedValues: ["container", "blob"] + } + }, + etag: { + serializedName: "etag", + xmlName: "etag", + type: { + name: "String" + } + }, + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", + type: { + name: "DateTimeRfc1123" + } + }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -22192,70 +21210,89 @@ var ServiceGetUserDelegationKeyHeaders = { } } }; -var ServiceGetAccountInfoHeaders = { - serializedName: "service-getaccountinfo-headers", +var ContainerGetAccessPolicyExceptionHeaders = { + serializedName: "Container_getAccessPolicyExceptionHeaders", type: { name: "Composite", - className: "ServiceGetAccountInfoHeaders", + className: "ContainerGetAccessPolicyExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var ContainerSetAccessPolicyHeaders = { + serializedName: "Container_setAccessPolicyHeaders", + type: { + name: "Composite", + className: "ContainerSetAccessPolicyHeaders", modelProperties: { + etag: { + serializedName: "etag", + xmlName: "etag", + type: { + name: "String" + } + }, + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", + type: { + name: "DateTimeRfc1123" + } + }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, - skuName: { - serializedName: "x-ms-sku-name", - type: { - name: "Enum", - allowedValues: [ - "Standard_LRS", - "Standard_GRS", - "Standard_RAGRS", - "Standard_ZRS", - "Premium_LRS" - ] - } - }, - accountKind: { - serializedName: "x-ms-account-kind", - type: { - name: "Enum", - allowedValues: [ - "Storage", - "BlobStorage", - "StorageV2", - "FileStorage", - "BlockBlobStorage" - ] - } - }, - isHierarchicalNamespaceEnabled: { - serializedName: "x-ms-is-hns-enabled", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Boolean" + name: "String" } - }, + } + } + } +}; +var ContainerSetAccessPolicyExceptionHeaders = { + serializedName: "Container_setAccessPolicyExceptionHeaders", + type: { + name: "Composite", + className: "ContainerSetAccessPolicyExceptionHeaders", + modelProperties: { errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -22263,38 +21300,43 @@ var ServiceGetAccountInfoHeaders = { } } }; -var ServiceSubmitBatchHeaders = { - serializedName: "service-submitbatch-headers", +var ContainerRestoreHeaders = { + serializedName: "Container_restoreHeaders", type: { name: "Composite", - className: "ServiceSubmitBatchHeaders", + className: "ContainerRestoreHeaders", modelProperties: { - contentType: { - serializedName: "content-type", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - clientRequestId: { - serializedName: "x-ms-client-request-id", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "String" + name: "DateTimeRfc1123" } }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -22302,38 +21344,59 @@ var ServiceSubmitBatchHeaders = { } } }; -var ServiceFilterBlobsHeaders = { - serializedName: "service-filterblobs-headers", +var ContainerRestoreExceptionHeaders = { + serializedName: "Container_restoreExceptionHeaders", type: { name: "Composite", - className: "ServiceFilterBlobsHeaders", + className: "ContainerRestoreExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var ContainerRenameHeaders = { + serializedName: "Container_renameHeaders", + type: { + name: "Composite", + className: "ContainerRenameHeaders", modelProperties: { clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -22341,50 +21404,61 @@ var ServiceFilterBlobsHeaders = { } } }; -var ContainerCreateHeaders = { - serializedName: "container-create-headers", +var ContainerRenameExceptionHeaders = { + serializedName: "Container_renameExceptionHeaders", type: { name: "Composite", - className: "ContainerCreateHeaders", + className: "ContainerRenameExceptionHeaders", modelProperties: { - etag: { - serializedName: "etag", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, - lastModified: { - serializedName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", + } + } + } +}; +var ContainerSubmitBatchHeaders = { + serializedName: "Container_submitBatchHeaders", + type: { + name: "Composite", + className: "ContainerSubmitBatchHeaders", + modelProperties: { + contentType: { + serializedName: "content-type", + xmlName: "content-type", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } - }, - date: { - serializedName: "date", - type: { - name: "DateTimeRfc1123" - } - }, + } + } + } +}; +var ContainerSubmitBatchExceptionHeaders = { + serializedName: "Container_submitBatchExceptionHeaders", + type: { + name: "Composite", + className: "ContainerSubmitBatchExceptionHeaders", + modelProperties: { errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -22392,125 +21466,73 @@ var ContainerCreateHeaders = { } } }; -var ContainerGetPropertiesHeaders = { - serializedName: "container-getproperties-headers", +var ContainerAcquireLeaseHeaders = { + serializedName: "Container_acquireLeaseHeaders", type: { name: "Composite", - className: "ContainerGetPropertiesHeaders", + className: "ContainerAcquireLeaseHeaders", modelProperties: { - metadata: { - serializedName: "x-ms-meta", - type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } - }, - headerCollectionPrefix: "x-ms-meta-" - }, etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, - leaseDuration: { - serializedName: "x-ms-lease-duration", - type: { - name: "Enum", - allowedValues: [ - "infinite", - "fixed" - ] - } - }, - leaseState: { - serializedName: "x-ms-lease-state", - type: { - name: "Enum", - allowedValues: [ - "available", - "leased", - "expired", - "breaking", - "broken" - ] - } - }, - leaseStatus: { - serializedName: "x-ms-lease-status", + leaseId: { + serializedName: "x-ms-lease-id", + xmlName: "x-ms-lease-id", type: { - name: "Enum", - allowedValues: [ - "locked", - "unlocked" - ] + name: "String" } }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } - }, - blobPublicAccess: { - serializedName: "x-ms-blob-public-access", - type: { - name: "String" - } - }, - hasImmutabilityPolicy: { - serializedName: "x-ms-has-immutability-policy", - type: { - name: "Boolean" - } - }, - hasLegalHold: { - serializedName: "x-ms-has-legal-hold", - type: { - name: "Boolean" - } - }, - defaultEncryptionScope: { - serializedName: "x-ms-default-encryption-scope", - type: { - name: "String" - } - }, - denyEncryptionScopeOverride: { - serializedName: "x-ms-deny-encryption-scope-override", - type: { - name: "Boolean" - } - }, + } + } + } +}; +var ContainerAcquireLeaseExceptionHeaders = { + serializedName: "Container_acquireLeaseExceptionHeaders", + type: { + name: "Composite", + className: "ContainerAcquireLeaseExceptionHeaders", + modelProperties: { errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -22518,38 +21540,66 @@ var ContainerGetPropertiesHeaders = { } } }; -var ContainerDeleteHeaders = { - serializedName: "container-delete-headers", +var ContainerReleaseLeaseHeaders = { + serializedName: "Container_releaseLeaseHeaders", type: { name: "Composite", - className: "ContainerDeleteHeaders", + className: "ContainerReleaseLeaseHeaders", modelProperties: { + etag: { + serializedName: "etag", + xmlName: "etag", + type: { + name: "String" + } + }, + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", + type: { + name: "DateTimeRfc1123" + } + }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } - }, + } + } + } +}; +var ContainerReleaseLeaseExceptionHeaders = { + serializedName: "Container_releaseLeaseExceptionHeaders", + type: { + name: "Composite", + className: "ContainerReleaseLeaseExceptionHeaders", + modelProperties: { errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -22557,50 +21607,73 @@ var ContainerDeleteHeaders = { } } }; -var ContainerSetMetadataHeaders = { - serializedName: "container-setmetadata-headers", +var ContainerRenewLeaseHeaders = { + serializedName: "Container_renewLeaseHeaders", type: { name: "Composite", - className: "ContainerSetMetadataHeaders", + className: "ContainerRenewLeaseHeaders", modelProperties: { etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, + leaseId: { + serializedName: "x-ms-lease-id", + xmlName: "x-ms-lease-id", + type: { + name: "String" + } + }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } - }, + } + } + } +}; +var ContainerRenewLeaseExceptionHeaders = { + serializedName: "Container_renewLeaseExceptionHeaders", + type: { + name: "Composite", + className: "ContainerRenewLeaseExceptionHeaders", + modelProperties: { errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -22608,56 +21681,73 @@ var ContainerSetMetadataHeaders = { } } }; -var ContainerGetAccessPolicyHeaders = { - serializedName: "container-getaccesspolicy-headers", +var ContainerBreakLeaseHeaders = { + serializedName: "Container_breakLeaseHeaders", type: { name: "Composite", - className: "ContainerGetAccessPolicyHeaders", + className: "ContainerBreakLeaseHeaders", modelProperties: { - blobPublicAccess: { - serializedName: "x-ms-blob-public-access", - type: { - name: "String" - } - }, etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, + leaseTime: { + serializedName: "x-ms-lease-time", + xmlName: "x-ms-lease-time", + type: { + name: "Number" + } + }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } - }, + } + } + } +}; +var ContainerBreakLeaseExceptionHeaders = { + serializedName: "Container_breakLeaseExceptionHeaders", + type: { + name: "Composite", + className: "ContainerBreakLeaseExceptionHeaders", + modelProperties: { errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -22665,50 +21755,73 @@ var ContainerGetAccessPolicyHeaders = { } } }; -var ContainerSetAccessPolicyHeaders = { - serializedName: "container-setaccesspolicy-headers", +var ContainerChangeLeaseHeaders = { + serializedName: "Container_changeLeaseHeaders", type: { name: "Composite", - className: "ContainerSetAccessPolicyHeaders", + className: "ContainerChangeLeaseHeaders", modelProperties: { etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, + leaseId: { + serializedName: "x-ms-lease-id", + xmlName: "x-ms-lease-id", + type: { + name: "String" + } + }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } - }, + } + } + } +}; +var ContainerChangeLeaseExceptionHeaders = { + serializedName: "Container_changeLeaseExceptionHeaders", + type: { + name: "Composite", + className: "ContainerChangeLeaseExceptionHeaders", + modelProperties: { errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -22716,38 +21829,50 @@ var ContainerSetAccessPolicyHeaders = { } } }; -var ContainerRestoreHeaders = { - serializedName: "container-restore-headers", +var ContainerListBlobFlatSegmentHeaders = { + serializedName: "Container_listBlobFlatSegmentHeaders", type: { name: "Composite", - className: "ContainerRestoreHeaders", + className: "ContainerListBlobFlatSegmentHeaders", modelProperties: { + contentType: { + serializedName: "content-type", + xmlName: "content-type", + type: { + name: "String" + } + }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -22755,38 +21880,66 @@ var ContainerRestoreHeaders = { } } }; -var ContainerRenameHeaders = { - serializedName: "container-rename-headers", +var ContainerListBlobFlatSegmentExceptionHeaders = { + serializedName: "Container_listBlobFlatSegmentExceptionHeaders", type: { name: "Composite", - className: "ContainerRenameHeaders", + className: "ContainerListBlobFlatSegmentExceptionHeaders", modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var ContainerListBlobHierarchySegmentHeaders = { + serializedName: "Container_listBlobHierarchySegmentHeaders", + type: { + name: "Composite", + className: "ContainerListBlobHierarchySegmentHeaders", + modelProperties: { + contentType: { + serializedName: "content-type", + xmlName: "content-type", + type: { + name: "String" + } + }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -22794,32 +21947,15 @@ var ContainerRenameHeaders = { } } }; -var ContainerSubmitBatchHeaders = { - serializedName: "container-submitbatch-headers", +var ContainerListBlobHierarchySegmentExceptionHeaders = { + serializedName: "Container_listBlobHierarchySegmentExceptionHeaders", type: { name: "Composite", - className: "ContainerSubmitBatchHeaders", + className: "ContainerListBlobHierarchySegmentExceptionHeaders", modelProperties: { - contentType: { - serializedName: "content-type", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - type: { - name: "String" - } - }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -22827,56 +21963,80 @@ var ContainerSubmitBatchHeaders = { } } }; -var ContainerAcquireLeaseHeaders = { - serializedName: "container-acquirelease-headers", +var ContainerGetAccountInfoHeaders = { + serializedName: "Container_getAccountInfoHeaders", type: { name: "Composite", - className: "ContainerAcquireLeaseHeaders", + className: "ContainerGetAccountInfoHeaders", modelProperties: { - etag: { - serializedName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - leaseId: { - serializedName: "x-ms-lease-id", - type: { - name: "String" - } - }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, + skuName: { + serializedName: "x-ms-sku-name", + xmlName: "x-ms-sku-name", + type: { + name: "Enum", + allowedValues: [ + "Standard_LRS", + "Standard_GRS", + "Standard_RAGRS", + "Standard_ZRS", + "Premium_LRS" + ] + } + }, + accountKind: { + serializedName: "x-ms-account-kind", + xmlName: "x-ms-account-kind", + type: { + name: "Enum", + allowedValues: [ + "Storage", + "BlobStorage", + "StorageV2", + "FileStorage", + "BlockBlobStorage" + ] + } + } + } + } +}; +var ContainerGetAccountInfoExceptionHeaders = { + serializedName: "Container_getAccountInfoExceptionHeaders", + type: { + name: "Composite", + className: "ContainerGetAccountInfoExceptionHeaders", + modelProperties: { errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -22884,50 +22044,87 @@ var ContainerAcquireLeaseHeaders = { } } }; -var ContainerReleaseLeaseHeaders = { - serializedName: "container-releaselease-headers", +var DirectoryCreateHeaders = { + serializedName: "Directory_createHeaders", type: { name: "Composite", - className: "ContainerReleaseLeaseHeaders", + className: "DirectoryCreateHeaders", modelProperties: { etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, + contentLength: { + serializedName: "content-length", + xmlName: "content-length", + type: { + name: "Number" + } + }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } + } + } + } +}; +var DirectoryCreateExceptionHeaders = { + serializedName: "Directory_createExceptionHeaders", + type: { + name: "Composite", + className: "DirectoryCreateExceptionHeaders", + modelProperties: { + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", + type: { + name: "String" + } }, - errorCode: { - serializedName: "x-ms-error-code", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", + type: { + name: "String" + } + }, + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } @@ -22935,113 +22132,168 @@ var ContainerReleaseLeaseHeaders = { } } }; -var ContainerRenewLeaseHeaders = { - serializedName: "container-renewlease-headers", +var DirectoryRenameHeaders = { + serializedName: "Directory_renameHeaders", type: { name: "Composite", - className: "ContainerRenewLeaseHeaders", + className: "DirectoryRenameHeaders", modelProperties: { + marker: { + serializedName: "x-ms-continuation", + xmlName: "x-ms-continuation", + type: { + name: "String" + } + }, etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, - leaseId: { - serializedName: "x-ms-lease-id", - type: { - name: "String" - } - }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - date: { - serializedName: "date", + contentLength: { + serializedName: "content-length", + xmlName: "content-length", type: { - name: "DateTimeRfc1123" + name: "Number" } }, - errorCode: { - serializedName: "x-ms-error-code", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "String" + name: "DateTimeRfc1123" } } } } }; -var ContainerBreakLeaseHeaders = { - serializedName: "container-breaklease-headers", +var DirectoryRenameExceptionHeaders = { + serializedName: "Directory_renameExceptionHeaders", type: { name: "Composite", - className: "ContainerBreakLeaseHeaders", + className: "DirectoryRenameExceptionHeaders", modelProperties: { - etag: { - serializedName: "etag", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - lastModified: { - serializedName: "last-modified", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "DateTimeRfc1123" + name: "String" } }, - leaseTime: { - serializedName: "x-ms-lease-time", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Number" + name: "String" + } + } + } + } +}; +var DirectoryDeleteHeaders = { + serializedName: "Directory_deleteHeaders", + type: { + name: "Composite", + className: "DirectoryDeleteHeaders", + modelProperties: { + marker: { + serializedName: "x-ms-continuation", + xmlName: "x-ms-continuation", + type: { + name: "String" } }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } + } + } + } +}; +var DirectoryDeleteExceptionHeaders = { + serializedName: "Directory_deleteExceptionHeaders", + type: { + name: "Composite", + className: "DirectoryDeleteExceptionHeaders", + modelProperties: { + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", + type: { + name: "String" + } }, - errorCode: { - serializedName: "x-ms-error-code", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", + type: { + name: "String" + } + }, + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } @@ -23049,56 +22301,43 @@ var ContainerBreakLeaseHeaders = { } } }; -var ContainerChangeLeaseHeaders = { - serializedName: "container-changelease-headers", +var DirectorySetAccessControlHeaders = { + serializedName: "Directory_setAccessControlHeaders", type: { name: "Composite", - className: "ContainerChangeLeaseHeaders", + className: "DirectorySetAccessControlHeaders", modelProperties: { + date: { + serializedName: "date", + xmlName: "date", + type: { + name: "DateTimeRfc1123" + } + }, etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, - leaseId: { - serializedName: "x-ms-lease-id", - type: { - name: "String" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - type: { - name: "String" - } - }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - errorCode: { - serializedName: "x-ms-error-code", + xmlName: "x-ms-version", type: { name: "String" } @@ -23106,89 +22345,101 @@ var ContainerChangeLeaseHeaders = { } } }; -var ContainerListBlobFlatSegmentHeaders = { - serializedName: "container-listblobflatsegment-headers", +var DirectorySetAccessControlExceptionHeaders = { + serializedName: "Directory_setAccessControlExceptionHeaders", type: { name: "Composite", - className: "ContainerListBlobFlatSegmentHeaders", + className: "DirectorySetAccessControlExceptionHeaders", modelProperties: { - contentType: { - serializedName: "content-type", - type: { - name: "String" - } - }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } - }, + } + } + } +}; +var DirectoryGetAccessControlHeaders = { + serializedName: "Directory_getAccessControlHeaders", + type: { + name: "Composite", + className: "DirectoryGetAccessControlHeaders", + modelProperties: { date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, - errorCode: { - serializedName: "x-ms-error-code", + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } - } - } - } -}; -var ContainerListBlobHierarchySegmentHeaders = { - serializedName: "container-listblobhierarchysegment-headers", - type: { - name: "Composite", - className: "ContainerListBlobHierarchySegmentHeaders", - modelProperties: { - contentType: { - serializedName: "content-type", + }, + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", + type: { + name: "DateTimeRfc1123" + } + }, + xMsOwner: { + serializedName: "x-ms-owner", + xmlName: "x-ms-owner", type: { name: "String" } }, - clientRequestId: { - serializedName: "x-ms-client-request-id", + xMsGroup: { + serializedName: "x-ms-group", + xmlName: "x-ms-group", type: { name: "String" } }, - requestId: { - serializedName: "x-ms-request-id", + xMsPermissions: { + serializedName: "x-ms-permissions", + xmlName: "x-ms-permissions", type: { name: "String" } }, - version: { - serializedName: "x-ms-version", + xMsAcl: { + serializedName: "x-ms-acl", + xmlName: "x-ms-acl", type: { name: "String" } }, - date: { - serializedName: "date", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "DateTimeRfc1123" + name: "String" } }, - errorCode: { - serializedName: "x-ms-error-code", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } @@ -23196,64 +22447,29 @@ var ContainerListBlobHierarchySegmentHeaders = { } } }; -var ContainerGetAccountInfoHeaders = { - serializedName: "container-getaccountinfo-headers", +var DirectoryGetAccessControlExceptionHeaders = { + serializedName: "Directory_getAccessControlExceptionHeaders", type: { name: "Composite", - className: "ContainerGetAccountInfoHeaders", + className: "DirectoryGetAccessControlExceptionHeaders", modelProperties: { clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - skuName: { - serializedName: "x-ms-sku-name", - type: { - name: "Enum", - allowedValues: [ - "Standard_LRS", - "Standard_GRS", - "Standard_RAGRS", - "Standard_ZRS", - "Premium_LRS" - ] - } - }, - accountKind: { - serializedName: "x-ms-account-kind", - type: { - name: "Enum", - allowedValues: [ - "Storage", - "BlobStorage", - "StorageV2", - "FileStorage", - "BlockBlobStorage" - ] - } - }, - errorCode: { - serializedName: "x-ms-error-code", + xmlName: "x-ms-version", type: { name: "String" } @@ -23262,172 +22478,175 @@ var ContainerGetAccountInfoHeaders = { } }; var BlobDownloadHeaders = { - serializedName: "blob-download-headers", + serializedName: "Blob_downloadHeaders", type: { name: "Composite", className: "BlobDownloadHeaders", modelProperties: { lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, metadata: { serializedName: "x-ms-meta", + xmlName: "x-ms-meta", type: { name: "Dictionary", - value: { - type: { - name: "String" - } - } + value: { type: { name: "String" } } }, headerCollectionPrefix: "x-ms-meta-" }, objectReplicationPolicyId: { serializedName: "x-ms-or-policy-id", + xmlName: "x-ms-or-policy-id", type: { name: "String" } }, objectReplicationRules: { serializedName: "x-ms-or", + xmlName: "x-ms-or", type: { name: "Dictionary", - value: { - type: { - name: "String" - } - } + value: { type: { name: "String" } } }, headerCollectionPrefix: "x-ms-or-" }, contentLength: { serializedName: "content-length", + xmlName: "content-length", type: { name: "Number" } }, contentType: { serializedName: "content-type", + xmlName: "content-type", type: { name: "String" } }, contentRange: { serializedName: "content-range", + xmlName: "content-range", type: { name: "String" } }, etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, contentMD5: { serializedName: "content-md5", + xmlName: "content-md5", type: { name: "ByteArray" } }, contentEncoding: { serializedName: "content-encoding", + xmlName: "content-encoding", type: { name: "String" } }, cacheControl: { serializedName: "cache-control", + xmlName: "cache-control", type: { name: "String" } }, contentDisposition: { serializedName: "content-disposition", + xmlName: "content-disposition", type: { name: "String" } }, contentLanguage: { serializedName: "content-language", + xmlName: "content-language", type: { name: "String" } }, blobSequenceNumber: { serializedName: "x-ms-blob-sequence-number", + xmlName: "x-ms-blob-sequence-number", type: { name: "Number" } }, blobType: { serializedName: "x-ms-blob-type", + xmlName: "x-ms-blob-type", type: { name: "Enum", - allowedValues: [ - "BlockBlob", - "PageBlob", - "AppendBlob" - ] + allowedValues: ["BlockBlob", "PageBlob", "AppendBlob"] } }, copyCompletedOn: { serializedName: "x-ms-copy-completion-time", + xmlName: "x-ms-copy-completion-time", type: { name: "DateTimeRfc1123" } }, copyStatusDescription: { serializedName: "x-ms-copy-status-description", + xmlName: "x-ms-copy-status-description", type: { name: "String" } }, copyId: { serializedName: "x-ms-copy-id", + xmlName: "x-ms-copy-id", type: { name: "String" } }, copyProgress: { serializedName: "x-ms-copy-progress", + xmlName: "x-ms-copy-progress", type: { name: "String" } }, copySource: { serializedName: "x-ms-copy-source", + xmlName: "x-ms-copy-source", type: { name: "String" } }, copyStatus: { serializedName: "x-ms-copy-status", + xmlName: "x-ms-copy-status", type: { name: "Enum", - allowedValues: [ - "pending", - "success", - "aborted", - "failed" - ] + allowedValues: ["pending", "success", "aborted", "failed"] } }, leaseDuration: { serializedName: "x-ms-lease-duration", + xmlName: "x-ms-lease-duration", type: { name: "Enum", - allowedValues: [ - "infinite", - "fixed" - ] + allowedValues: ["infinite", "fixed"] } }, leaseState: { serializedName: "x-ms-lease-state", + xmlName: "x-ms-lease-state", type: { name: "Enum", allowedValues: [ @@ -23441,112 +22660,143 @@ var BlobDownloadHeaders = { }, leaseStatus: { serializedName: "x-ms-lease-status", + xmlName: "x-ms-lease-status", type: { name: "Enum", - allowedValues: [ - "locked", - "unlocked" - ] + allowedValues: ["locked", "unlocked"] } }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, versionId: { serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", type: { name: "String" } }, isCurrentVersion: { serializedName: "x-ms-is-current-version", + xmlName: "x-ms-is-current-version", type: { name: "Boolean" } }, acceptRanges: { serializedName: "accept-ranges", + xmlName: "accept-ranges", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, blobCommittedBlockCount: { serializedName: "x-ms-blob-committed-block-count", + xmlName: "x-ms-blob-committed-block-count", type: { name: "Number" } }, isServerEncrypted: { serializedName: "x-ms-server-encrypted", + xmlName: "x-ms-server-encrypted", type: { name: "Boolean" } }, encryptionKeySha256: { serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { name: "String" } }, encryptionScope: { serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { name: "String" } }, blobContentMD5: { serializedName: "x-ms-blob-content-md5", + xmlName: "x-ms-blob-content-md5", type: { name: "ByteArray" } }, tagCount: { serializedName: "x-ms-tag-count", + xmlName: "x-ms-tag-count", type: { name: "Number" } }, isSealed: { serializedName: "x-ms-blob-sealed", + xmlName: "x-ms-blob-sealed", type: { name: "Boolean" } }, lastAccessed: { serializedName: "x-ms-last-access-time", + xmlName: "x-ms-last-access-time", type: { name: "DateTimeRfc1123" } }, contentCrc64: { serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { name: "ByteArray" } }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var BlobDownloadExceptionHeaders = { + serializedName: "Blob_downloadExceptionHeaders", + type: { + name: "Composite", + className: "BlobDownloadExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -23555,130 +22805,126 @@ var BlobDownloadHeaders = { } }; var BlobGetPropertiesHeaders = { - serializedName: "blob-getproperties-headers", + serializedName: "Blob_getPropertiesHeaders", type: { name: "Composite", className: "BlobGetPropertiesHeaders", modelProperties: { lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, createdOn: { serializedName: "x-ms-creation-time", + xmlName: "x-ms-creation-time", type: { name: "DateTimeRfc1123" } }, metadata: { serializedName: "x-ms-meta", + xmlName: "x-ms-meta", type: { name: "Dictionary", - value: { - type: { - name: "String" - } - } + value: { type: { name: "String" } } }, headerCollectionPrefix: "x-ms-meta-" }, objectReplicationPolicyId: { serializedName: "x-ms-or-policy-id", + xmlName: "x-ms-or-policy-id", type: { name: "String" } }, objectReplicationRules: { serializedName: "x-ms-or", + xmlName: "x-ms-or", type: { name: "Dictionary", - value: { - type: { - name: "String" - } - } + value: { type: { name: "String" } } }, headerCollectionPrefix: "x-ms-or-" }, blobType: { serializedName: "x-ms-blob-type", + xmlName: "x-ms-blob-type", type: { name: "Enum", - allowedValues: [ - "BlockBlob", - "PageBlob", - "AppendBlob" - ] + allowedValues: ["BlockBlob", "PageBlob", "AppendBlob"] } }, copyCompletedOn: { serializedName: "x-ms-copy-completion-time", + xmlName: "x-ms-copy-completion-time", type: { name: "DateTimeRfc1123" } }, copyStatusDescription: { serializedName: "x-ms-copy-status-description", + xmlName: "x-ms-copy-status-description", type: { name: "String" } }, copyId: { serializedName: "x-ms-copy-id", + xmlName: "x-ms-copy-id", type: { name: "String" } }, copyProgress: { serializedName: "x-ms-copy-progress", + xmlName: "x-ms-copy-progress", type: { name: "String" } }, copySource: { serializedName: "x-ms-copy-source", + xmlName: "x-ms-copy-source", type: { name: "String" } }, copyStatus: { serializedName: "x-ms-copy-status", + xmlName: "x-ms-copy-status", type: { name: "Enum", - allowedValues: [ - "pending", - "success", - "aborted", - "failed" - ] + allowedValues: ["pending", "success", "aborted", "failed"] } }, isIncrementalCopy: { serializedName: "x-ms-incremental-copy", + xmlName: "x-ms-incremental-copy", type: { name: "Boolean" } }, destinationSnapshot: { serializedName: "x-ms-copy-destination-snapshot", + xmlName: "x-ms-copy-destination-snapshot", type: { name: "String" } }, leaseDuration: { serializedName: "x-ms-lease-duration", + xmlName: "x-ms-lease-duration", type: { name: "Enum", - allowedValues: [ - "infinite", - "fixed" - ] + allowedValues: ["infinite", "fixed"] } }, leaseState: { serializedName: "x-ms-lease-state", + xmlName: "x-ms-lease-state", type: { name: "Enum", allowedValues: [ @@ -23692,190 +22938,235 @@ var BlobGetPropertiesHeaders = { }, leaseStatus: { serializedName: "x-ms-lease-status", + xmlName: "x-ms-lease-status", type: { name: "Enum", - allowedValues: [ - "locked", - "unlocked" - ] + allowedValues: ["locked", "unlocked"] } }, contentLength: { serializedName: "content-length", + xmlName: "content-length", type: { name: "Number" } }, contentType: { serializedName: "content-type", + xmlName: "content-type", type: { name: "String" } }, etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, contentMD5: { serializedName: "content-md5", + xmlName: "content-md5", type: { name: "ByteArray" } }, contentEncoding: { serializedName: "content-encoding", + xmlName: "content-encoding", type: { name: "String" } }, contentDisposition: { serializedName: "content-disposition", + xmlName: "content-disposition", type: { name: "String" } }, contentLanguage: { serializedName: "content-language", + xmlName: "content-language", type: { name: "String" } }, cacheControl: { serializedName: "cache-control", + xmlName: "cache-control", type: { name: "String" } }, blobSequenceNumber: { serializedName: "x-ms-blob-sequence-number", + xmlName: "x-ms-blob-sequence-number", type: { name: "Number" } }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, acceptRanges: { serializedName: "accept-ranges", + xmlName: "accept-ranges", type: { name: "String" } }, blobCommittedBlockCount: { serializedName: "x-ms-blob-committed-block-count", + xmlName: "x-ms-blob-committed-block-count", type: { name: "Number" } }, isServerEncrypted: { serializedName: "x-ms-server-encrypted", + xmlName: "x-ms-server-encrypted", type: { name: "Boolean" } }, encryptionKeySha256: { serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { name: "String" } }, encryptionScope: { serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { name: "String" } }, accessTier: { serializedName: "x-ms-access-tier", + xmlName: "x-ms-access-tier", type: { name: "String" } }, accessTierInferred: { serializedName: "x-ms-access-tier-inferred", + xmlName: "x-ms-access-tier-inferred", type: { name: "Boolean" } }, archiveStatus: { serializedName: "x-ms-archive-status", + xmlName: "x-ms-archive-status", type: { name: "String" } }, accessTierChangedOn: { serializedName: "x-ms-access-tier-change-time", + xmlName: "x-ms-access-tier-change-time", type: { name: "DateTimeRfc1123" } }, versionId: { serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", type: { name: "String" } }, isCurrentVersion: { serializedName: "x-ms-is-current-version", + xmlName: "x-ms-is-current-version", type: { name: "Boolean" } }, tagCount: { serializedName: "x-ms-tag-count", + xmlName: "x-ms-tag-count", type: { name: "Number" } }, expiresOn: { serializedName: "x-ms-expiry-time", + xmlName: "x-ms-expiry-time", type: { name: "DateTimeRfc1123" } }, isSealed: { serializedName: "x-ms-blob-sealed", + xmlName: "x-ms-blob-sealed", type: { name: "Boolean" } }, rehydratePriority: { serializedName: "x-ms-rehydrate-priority", + xmlName: "x-ms-rehydrate-priority", type: { - name: "String" + name: "Enum", + allowedValues: ["High", "Standard"] } }, lastAccessed: { serializedName: "x-ms-last-access-time", + xmlName: "x-ms-last-access-time", type: { name: "DateTimeRfc1123" } }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var BlobGetPropertiesExceptionHeaders = { + serializedName: "Blob_getPropertiesExceptionHeaders", + type: { + name: "Composite", + className: "BlobGetPropertiesExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -23884,37 +23175,58 @@ var BlobGetPropertiesHeaders = { } }; var BlobDeleteHeaders = { - serializedName: "blob-delete-headers", + serializedName: "Blob_deleteHeaders", type: { name: "Composite", className: "BlobDeleteHeaders", modelProperties: { clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var BlobDeleteExceptionHeaders = { + serializedName: "Blob_deleteExceptionHeaders", + type: { + name: "Composite", + className: "BlobDeleteExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -23923,43 +23235,72 @@ var BlobDeleteHeaders = { } }; var BlobSetAccessControlHeaders = { - serializedName: "blob-setaccesscontrol-headers", + serializedName: "Blob_setAccessControlHeaders", type: { name: "Composite", className: "BlobSetAccessControlHeaders", modelProperties: { date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } - }, + } + } + } +}; +var BlobSetAccessControlExceptionHeaders = { + serializedName: "Blob_setAccessControlExceptionHeaders", + type: { + name: "Composite", + className: "BlobSetAccessControlExceptionHeaders", + modelProperties: { clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", + type: { + name: "String" + } + }, + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", + type: { + name: "String" + } + }, + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } @@ -23968,67 +23309,70 @@ var BlobSetAccessControlHeaders = { } }; var BlobGetAccessControlHeaders = { - serializedName: "blob-getaccesscontrol-headers", + serializedName: "Blob_getAccessControlHeaders", type: { name: "Composite", className: "BlobGetAccessControlHeaders", modelProperties: { date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, xMsOwner: { serializedName: "x-ms-owner", + xmlName: "x-ms-owner", type: { name: "String" } }, xMsGroup: { serializedName: "x-ms-group", + xmlName: "x-ms-group", type: { name: "String" } }, xMsPermissions: { serializedName: "x-ms-permissions", + xmlName: "x-ms-permissions", type: { name: "String" } }, xMsAcl: { serializedName: "x-ms-acl", + xmlName: "x-ms-acl", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", - type: { - name: "String" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", + xmlName: "x-ms-version", type: { name: "String" } @@ -24036,212 +23380,117 @@ var BlobGetAccessControlHeaders = { } } }; -var BlobRenameHeaders = { - serializedName: "blob-rename-headers", +var BlobGetAccessControlExceptionHeaders = { + serializedName: "Blob_getAccessControlExceptionHeaders", type: { name: "Composite", - className: "BlobRenameHeaders", + className: "BlobGetAccessControlExceptionHeaders", modelProperties: { - etag: { - serializedName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } - }, - contentLength: { - serializedName: "content-length", - type: { - name: "Number" - } - }, - date: { - serializedName: "date", - type: { - name: "DateTimeRfc1123" - } } } } }; -var PageBlobCreateHeaders = { - serializedName: "pageblob-create-headers", +var BlobRenameHeaders = { + serializedName: "Blob_renameHeaders", type: { name: "Composite", - className: "PageBlobCreateHeaders", + className: "BlobRenameHeaders", modelProperties: { etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, - contentMD5: { - serializedName: "content-md5", - type: { - name: "ByteArray" - } - }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - versionId: { - serializedName: "x-ms-version-id", + contentLength: { + serializedName: "content-length", + xmlName: "content-length", type: { - name: "String" + name: "Number" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } - }, - isServerEncrypted: { - serializedName: "x-ms-request-server-encrypted", - type: { - name: "Boolean" - } - }, - encryptionKeySha256: { - serializedName: "x-ms-encryption-key-sha256", - type: { - name: "String" - } - }, - encryptionScope: { - serializedName: "x-ms-encryption-scope", - type: { - name: "String" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - type: { - name: "String" - } } } } }; -var AppendBlobCreateHeaders = { - serializedName: "appendblob-create-headers", +var BlobRenameExceptionHeaders = { + serializedName: "Blob_renameExceptionHeaders", type: { name: "Composite", - className: "AppendBlobCreateHeaders", + className: "BlobRenameExceptionHeaders", modelProperties: { - etag: { - serializedName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - contentMD5: { - serializedName: "content-md5", - type: { - name: "ByteArray" - } - }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", - type: { - name: "String" - } - }, - versionId: { - serializedName: "x-ms-version-id", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - isServerEncrypted: { - serializedName: "x-ms-request-server-encrypted", - type: { - name: "Boolean" - } - }, - encryptionKeySha256: { - serializedName: "x-ms-encryption-key-sha256", - type: { - name: "String" - } - }, - encryptionScope: { - serializedName: "x-ms-encryption-scope", - type: { - name: "String" - } - }, - errorCode: { - serializedName: "x-ms-error-code", + xmlName: "x-ms-version", type: { name: "String" } @@ -24249,80 +23498,59 @@ var AppendBlobCreateHeaders = { } } }; -var BlockBlobUploadHeaders = { - serializedName: "blockblob-upload-headers", +var BlobUndeleteHeaders = { + serializedName: "Blob_undeleteHeaders", type: { name: "Composite", - className: "BlockBlobUploadHeaders", + className: "BlobUndeleteHeaders", modelProperties: { - etag: { - serializedName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - contentMD5: { - serializedName: "content-md5", - type: { - name: "ByteArray" - } - }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", - type: { - name: "String" - } - }, - versionId: { - serializedName: "x-ms-version-id", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, - isServerEncrypted: { - serializedName: "x-ms-request-server-encrypted", - type: { - name: "Boolean" - } - }, - encryptionKeySha256: { - serializedName: "x-ms-encryption-key-sha256", - type: { - name: "String" - } - }, - encryptionScope: { - serializedName: "x-ms-encryption-scope", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, + } + } + } +}; +var BlobUndeleteExceptionHeaders = { + serializedName: "Blob_undeleteExceptionHeaders", + type: { + name: "Composite", + className: "BlobUndeleteExceptionHeaders", + modelProperties: { errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -24330,119 +23558,66 @@ var BlockBlobUploadHeaders = { } } }; -var BlockBlobPutBlobFromUrlHeaders = { - serializedName: "blockblob-putblobfromurl-headers", +var BlobSetExpiryHeaders = { + serializedName: "Blob_setExpiryHeaders", type: { name: "Composite", - className: "BlockBlobPutBlobFromUrlHeaders", + className: "BlobSetExpiryHeaders", modelProperties: { etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, - contentMD5: { - serializedName: "content-md5", - type: { - name: "ByteArray" - } - }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", - type: { - name: "String" - } - }, - versionId: { - serializedName: "x-ms-version-id", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } - }, - isServerEncrypted: { - serializedName: "x-ms-request-server-encrypted", - type: { - name: "Boolean" - } - }, - encryptionKeySha256: { - serializedName: "x-ms-encryption-key-sha256", - type: { - name: "String" - } - }, - encryptionScope: { - serializedName: "x-ms-encryption-scope", - type: { - name: "String" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - type: { - name: "String" - } } } } }; -var BlobUndeleteHeaders = { - serializedName: "blob-undelete-headers", +var BlobSetExpiryExceptionHeaders = { + serializedName: "Blob_setExpiryExceptionHeaders", type: { name: "Composite", - className: "BlobUndeleteHeaders", + className: "BlobSetExpiryExceptionHeaders", modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - type: { - name: "DateTimeRfc1123" - } - }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -24450,50 +23625,64 @@ var BlobUndeleteHeaders = { } } }; -var BlobSetExpiryHeaders = { - serializedName: "blob-setexpiry-headers", +var BlobSetHttpHeadersHeaders = { + serializedName: "Blob_setHttpHeadersHeaders", type: { name: "Composite", - className: "BlobSetExpiryHeaders", + className: "BlobSetHttpHeadersHeaders", modelProperties: { etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, + blobSequenceNumber: { + serializedName: "x-ms-blob-sequence-number", + xmlName: "x-ms-blob-sequence-number", + type: { + name: "Number" + } + }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -24501,56 +23690,15 @@ var BlobSetExpiryHeaders = { } } }; -var BlobSetHTTPHeadersHeaders = { - serializedName: "blob-sethttpheaders-headers", +var BlobSetHttpHeadersExceptionHeaders = { + serializedName: "Blob_setHttpHeadersExceptionHeaders", type: { name: "Composite", - className: "BlobSetHTTPHeadersHeaders", + className: "BlobSetHttpHeadersExceptionHeaders", modelProperties: { - etag: { - serializedName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - blobSequenceNumber: { - serializedName: "x-ms-blob-sequence-number", - type: { - name: "Number" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - type: { - name: "DateTimeRfc1123" - } - }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -24559,73 +23707,100 @@ var BlobSetHTTPHeadersHeaders = { } }; var BlobSetMetadataHeaders = { - serializedName: "blob-setmetadata-headers", + serializedName: "Blob_setMetadataHeaders", type: { name: "Composite", className: "BlobSetMetadataHeaders", modelProperties: { etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, versionId: { serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, isServerEncrypted: { serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { name: "Boolean" } }, encryptionKeySha256: { serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { name: "String" } }, encryptionScope: { serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { name: "String" } }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var BlobSetMetadataExceptionHeaders = { + serializedName: "Blob_setMetadataExceptionHeaders", + type: { + name: "Composite", + className: "BlobSetMetadataExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -24634,55 +23809,72 @@ var BlobSetMetadataHeaders = { } }; var BlobAcquireLeaseHeaders = { - serializedName: "blob-acquirelease-headers", + serializedName: "Blob_acquireLeaseHeaders", type: { name: "Composite", className: "BlobAcquireLeaseHeaders", modelProperties: { etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, leaseId: { serializedName: "x-ms-lease-id", + xmlName: "x-ms-lease-id", type: { name: "String" } }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } - }, + } + } + } +}; +var BlobAcquireLeaseExceptionHeaders = { + serializedName: "Blob_acquireLeaseExceptionHeaders", + type: { + name: "Composite", + className: "BlobAcquireLeaseExceptionHeaders", + modelProperties: { errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -24691,49 +23883,65 @@ var BlobAcquireLeaseHeaders = { } }; var BlobReleaseLeaseHeaders = { - serializedName: "blob-releaselease-headers", + serializedName: "Blob_releaseLeaseHeaders", type: { name: "Composite", className: "BlobReleaseLeaseHeaders", modelProperties: { etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } - }, + } + } + } +}; +var BlobReleaseLeaseExceptionHeaders = { + serializedName: "Blob_releaseLeaseExceptionHeaders", + type: { + name: "Composite", + className: "BlobReleaseLeaseExceptionHeaders", + modelProperties: { errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -24742,55 +23950,72 @@ var BlobReleaseLeaseHeaders = { } }; var BlobRenewLeaseHeaders = { - serializedName: "blob-renewlease-headers", + serializedName: "Blob_renewLeaseHeaders", type: { name: "Composite", className: "BlobRenewLeaseHeaders", modelProperties: { etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, leaseId: { serializedName: "x-ms-lease-id", + xmlName: "x-ms-lease-id", type: { name: "String" } }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } - }, + } + } + } +}; +var BlobRenewLeaseExceptionHeaders = { + serializedName: "Blob_renewLeaseExceptionHeaders", + type: { + name: "Composite", + className: "BlobRenewLeaseExceptionHeaders", + modelProperties: { errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -24799,55 +24024,72 @@ var BlobRenewLeaseHeaders = { } }; var BlobChangeLeaseHeaders = { - serializedName: "blob-changelease-headers", + serializedName: "Blob_changeLeaseHeaders", type: { name: "Composite", className: "BlobChangeLeaseHeaders", modelProperties: { etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, leaseId: { serializedName: "x-ms-lease-id", + xmlName: "x-ms-lease-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } - }, + } + } + } +}; +var BlobChangeLeaseExceptionHeaders = { + serializedName: "Blob_changeLeaseExceptionHeaders", + type: { + name: "Composite", + className: "BlobChangeLeaseExceptionHeaders", + modelProperties: { errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -24856,55 +24098,72 @@ var BlobChangeLeaseHeaders = { } }; var BlobBreakLeaseHeaders = { - serializedName: "blob-breaklease-headers", + serializedName: "Blob_breakLeaseHeaders", type: { name: "Composite", className: "BlobBreakLeaseHeaders", modelProperties: { etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, leaseTime: { serializedName: "x-ms-lease-time", + xmlName: "x-ms-lease-time", type: { name: "Number" } }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } - }, + } + } + } +}; +var BlobBreakLeaseExceptionHeaders = { + serializedName: "Blob_breakLeaseExceptionHeaders", + type: { + name: "Composite", + className: "BlobBreakLeaseExceptionHeaders", + modelProperties: { errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -24913,67 +24172,93 @@ var BlobBreakLeaseHeaders = { } }; var BlobCreateSnapshotHeaders = { - serializedName: "blob-createsnapshot-headers", + serializedName: "Blob_createSnapshotHeaders", type: { name: "Composite", className: "BlobCreateSnapshotHeaders", modelProperties: { snapshot: { serializedName: "x-ms-snapshot", + xmlName: "x-ms-snapshot", type: { name: "String" } }, etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, versionId: { serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, isServerEncrypted: { serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { name: "Boolean" } }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var BlobCreateSnapshotExceptionHeaders = { + serializedName: "Blob_createSnapshotExceptionHeaders", + type: { + name: "Composite", + className: "BlobCreateSnapshotExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -24982,73 +24267,94 @@ var BlobCreateSnapshotHeaders = { } }; var BlobStartCopyFromURLHeaders = { - serializedName: "blob-startcopyfromurl-headers", + serializedName: "Blob_startCopyFromURLHeaders", type: { name: "Composite", className: "BlobStartCopyFromURLHeaders", modelProperties: { etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, versionId: { serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, copyId: { serializedName: "x-ms-copy-id", + xmlName: "x-ms-copy-id", type: { name: "String" } }, copyStatus: { serializedName: "x-ms-copy-status", + xmlName: "x-ms-copy-status", type: { name: "Enum", - allowedValues: [ - "pending", - "success", - "aborted", - "failed" - ] + allowedValues: ["pending", "success", "aborted", "failed"] } }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var BlobStartCopyFromURLExceptionHeaders = { + serializedName: "Blob_startCopyFromURLExceptionHeaders", + type: { + name: "Composite", + className: "BlobStartCopyFromURLExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -25057,82 +24363,108 @@ var BlobStartCopyFromURLHeaders = { } }; var BlobCopyFromURLHeaders = { - serializedName: "blob-copyfromurl-headers", + serializedName: "Blob_copyFromURLHeaders", type: { name: "Composite", className: "BlobCopyFromURLHeaders", modelProperties: { etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, versionId: { serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, copyId: { serializedName: "x-ms-copy-id", + xmlName: "x-ms-copy-id", type: { name: "String" } }, copyStatus: { + defaultValue: "success", + isConstant: true, serializedName: "x-ms-copy-status", type: { - name: "Enum", - allowedValues: [ - "success" - ] + name: "String" } }, contentMD5: { serializedName: "content-md5", + xmlName: "content-md5", type: { name: "ByteArray" } }, xMsContentCrc64: { serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { name: "ByteArray" } }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var BlobCopyFromURLExceptionHeaders = { + serializedName: "Blob_copyFromURLExceptionHeaders", + type: { + name: "Composite", + className: "BlobCopyFromURLExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -25141,37 +24473,58 @@ var BlobCopyFromURLHeaders = { } }; var BlobAbortCopyFromURLHeaders = { - serializedName: "blob-abortcopyfromurl-headers", + serializedName: "Blob_abortCopyFromURLHeaders", type: { name: "Composite", className: "BlobAbortCopyFromURLHeaders", modelProperties: { clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var BlobAbortCopyFromURLExceptionHeaders = { + serializedName: "Blob_abortCopyFromURLExceptionHeaders", + type: { + name: "Composite", + className: "BlobAbortCopyFromURLExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -25180,31 +24533,51 @@ var BlobAbortCopyFromURLHeaders = { } }; var BlobSetTierHeaders = { - serializedName: "blob-settier-headers", + serializedName: "Blob_setTierHeaders", type: { name: "Composite", className: "BlobSetTierHeaders", modelProperties: { clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var BlobSetTierExceptionHeaders = { + serializedName: "Blob_setTierExceptionHeaders", + type: { + name: "Composite", + className: "BlobSetTierExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -25213,37 +24586,42 @@ var BlobSetTierHeaders = { } }; var BlobGetAccountInfoHeaders = { - serializedName: "blob-getaccountinfo-headers", + serializedName: "Blob_getAccountInfoHeaders", type: { name: "Composite", className: "BlobGetAccountInfoHeaders", modelProperties: { clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, skuName: { serializedName: "x-ms-sku-name", + xmlName: "x-ms-sku-name", type: { name: "Enum", allowedValues: [ @@ -25257,6 +24635,7 @@ var BlobGetAccountInfoHeaders = { }, accountKind: { serializedName: "x-ms-account-kind", + xmlName: "x-ms-account-kind", type: { name: "Enum", allowedValues: [ @@ -25267,9 +24646,19 @@ var BlobGetAccountInfoHeaders = { "BlockBlobStorage" ] } - }, + } + } + } +}; +var BlobGetAccountInfoExceptionHeaders = { + serializedName: "Blob_getAccountInfoExceptionHeaders", + type: { + name: "Composite", + className: "BlobGetAccountInfoExceptionHeaders", + modelProperties: { errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -25277,68 +24666,334 @@ var BlobGetAccountInfoHeaders = { } } }; -var BlockBlobStageBlockHeaders = { - serializedName: "blockblob-stageblock-headers", +var BlobQueryHeaders = { + serializedName: "Blob_queryHeaders", type: { name: "Composite", - className: "BlockBlobStageBlockHeaders", + className: "BlobQueryHeaders", modelProperties: { + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", + type: { + name: "DateTimeRfc1123" + } + }, + metadata: { + serializedName: "x-ms-meta", + xmlName: "x-ms-meta", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + contentLength: { + serializedName: "content-length", + xmlName: "content-length", + type: { + name: "Number" + } + }, + contentType: { + serializedName: "content-type", + xmlName: "content-type", + type: { + name: "String" + } + }, + contentRange: { + serializedName: "content-range", + xmlName: "content-range", + type: { + name: "String" + } + }, + etag: { + serializedName: "etag", + xmlName: "etag", + type: { + name: "String" + } + }, contentMD5: { serializedName: "content-md5", + xmlName: "content-md5", type: { name: "ByteArray" } }, + contentEncoding: { + serializedName: "content-encoding", + xmlName: "content-encoding", + type: { + name: "String" + } + }, + cacheControl: { + serializedName: "cache-control", + xmlName: "cache-control", + type: { + name: "String" + } + }, + contentDisposition: { + serializedName: "content-disposition", + xmlName: "content-disposition", + type: { + name: "String" + } + }, + contentLanguage: { + serializedName: "content-language", + xmlName: "content-language", + type: { + name: "String" + } + }, + blobSequenceNumber: { + serializedName: "x-ms-blob-sequence-number", + xmlName: "x-ms-blob-sequence-number", + type: { + name: "Number" + } + }, + blobType: { + serializedName: "x-ms-blob-type", + xmlName: "x-ms-blob-type", + type: { + name: "Enum", + allowedValues: ["BlockBlob", "PageBlob", "AppendBlob"] + } + }, + copyCompletionTime: { + serializedName: "x-ms-copy-completion-time", + xmlName: "x-ms-copy-completion-time", + type: { + name: "DateTimeRfc1123" + } + }, + copyStatusDescription: { + serializedName: "x-ms-copy-status-description", + xmlName: "x-ms-copy-status-description", + type: { + name: "String" + } + }, + copyId: { + serializedName: "x-ms-copy-id", + xmlName: "x-ms-copy-id", + type: { + name: "String" + } + }, + copyProgress: { + serializedName: "x-ms-copy-progress", + xmlName: "x-ms-copy-progress", + type: { + name: "String" + } + }, + copySource: { + serializedName: "x-ms-copy-source", + xmlName: "x-ms-copy-source", + type: { + name: "String" + } + }, + copyStatus: { + serializedName: "x-ms-copy-status", + xmlName: "x-ms-copy-status", + type: { + name: "Enum", + allowedValues: ["pending", "success", "aborted", "failed"] + } + }, + leaseDuration: { + serializedName: "x-ms-lease-duration", + xmlName: "x-ms-lease-duration", + type: { + name: "Enum", + allowedValues: ["infinite", "fixed"] + } + }, + leaseState: { + serializedName: "x-ms-lease-state", + xmlName: "x-ms-lease-state", + type: { + name: "Enum", + allowedValues: [ + "available", + "leased", + "expired", + "breaking", + "broken" + ] + } + }, + leaseStatus: { + serializedName: "x-ms-lease-status", + xmlName: "x-ms-lease-status", + type: { + name: "Enum", + allowedValues: ["locked", "unlocked"] + } + }, + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", + type: { + name: "String" + } + }, + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", + type: { + name: "String" + } + }, + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", + type: { + name: "String" + } + }, + acceptRanges: { + serializedName: "accept-ranges", + xmlName: "accept-ranges", + type: { + name: "String" + } + }, + date: { + serializedName: "date", + xmlName: "date", + type: { + name: "DateTimeRfc1123" + } + }, + blobCommittedBlockCount: { + serializedName: "x-ms-blob-committed-block-count", + xmlName: "x-ms-blob-committed-block-count", + type: { + name: "Number" + } + }, + isServerEncrypted: { + serializedName: "x-ms-server-encrypted", + xmlName: "x-ms-server-encrypted", + type: { + name: "Boolean" + } + }, + encryptionKeySha256: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", + type: { + name: "String" + } + }, + encryptionScope: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", + type: { + name: "String" + } + }, + blobContentMD5: { + serializedName: "x-ms-blob-content-md5", + xmlName: "x-ms-blob-content-md5", + type: { + name: "ByteArray" + } + }, + contentCrc64: { + serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", + type: { + name: "ByteArray" + } + }, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var BlobQueryExceptionHeaders = { + serializedName: "Blob_queryExceptionHeaders", + type: { + name: "Composite", + className: "BlobQueryExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var BlobGetTagsHeaders = { + serializedName: "Blob_getTagsHeaders", + type: { + name: "Composite", + className: "BlobGetTagsHeaders", + modelProperties: { clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, - xMsContentCrc64: { - serializedName: "x-ms-content-crc64", - type: { - name: "ByteArray" - } - }, - isServerEncrypted: { - serializedName: "x-ms-request-server-encrypted", - type: { - name: "Boolean" - } - }, - encryptionKeySha256: { - serializedName: "x-ms-encryption-key-sha256", - type: { - name: "String" - } - }, - encryptionScope: { - serializedName: "x-ms-encryption-scope", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, + } + } + } +}; +var BlobGetTagsExceptionHeaders = { + serializedName: "Blob_getTagsExceptionHeaders", + type: { + name: "Composite", + className: "BlobGetTagsExceptionHeaders", + modelProperties: { errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -25346,68 +25001,59 @@ var BlockBlobStageBlockHeaders = { } } }; -var BlockBlobStageBlockFromURLHeaders = { - serializedName: "blockblob-stageblockfromurl-headers", +var BlobSetTagsHeaders = { + serializedName: "Blob_setTagsHeaders", type: { name: "Composite", - className: "BlockBlobStageBlockFromURLHeaders", + className: "BlobSetTagsHeaders", modelProperties: { - contentMD5: { - serializedName: "content-md5", - type: { - name: "ByteArray" - } - }, - xMsContentCrc64: { - serializedName: "x-ms-content-crc64", - type: { - name: "ByteArray" - } - }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, - isServerEncrypted: { - serializedName: "x-ms-request-server-encrypted", - type: { - name: "Boolean" - } - }, - encryptionKeySha256: { - serializedName: "x-ms-encryption-key-sha256", - type: { - name: "String" - } - }, - encryptionScope: { - serializedName: "x-ms-encryption-scope", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, + } + } + } +}; +var BlobSetTagsExceptionHeaders = { + serializedName: "Blob_setTagsExceptionHeaders", + type: { + name: "Composite", + className: "BlobSetTagsExceptionHeaders", + modelProperties: { errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -25415,86 +25061,92 @@ var BlockBlobStageBlockFromURLHeaders = { } } }; -var BlockBlobCommitBlockListHeaders = { - serializedName: "blockblob-commitblocklist-headers", +var PageBlobCreateHeaders = { + serializedName: "PageBlob_createHeaders", type: { name: "Composite", - className: "BlockBlobCommitBlockListHeaders", + className: "PageBlobCreateHeaders", modelProperties: { etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, contentMD5: { serializedName: "content-md5", - type: { - name: "ByteArray" - } - }, - xMsContentCrc64: { - serializedName: "x-ms-content-crc64", + xmlName: "content-md5", type: { name: "ByteArray" } }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, versionId: { serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, isServerEncrypted: { serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { name: "Boolean" } }, encryptionKeySha256: { serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { name: "String" } }, encryptionScope: { serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { name: "String" } }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -25502,62 +25154,15 @@ var BlockBlobCommitBlockListHeaders = { } } }; -var BlockBlobGetBlockListHeaders = { - serializedName: "blockblob-getblocklist-headers", +var PageBlobCreateExceptionHeaders = { + serializedName: "PageBlob_createExceptionHeaders", type: { name: "Composite", - className: "BlockBlobGetBlockListHeaders", + className: "PageBlobCreateExceptionHeaders", modelProperties: { - lastModified: { - serializedName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - etag: { - serializedName: "etag", - type: { - name: "String" - } - }, - contentType: { - serializedName: "content-type", - type: { - name: "String" - } - }, - blobContentLength: { - serializedName: "x-ms-blob-content-length", - type: { - name: "Number" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - type: { - name: "DateTimeRfc1123" - } - }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -25566,85 +25171,114 @@ var BlockBlobGetBlockListHeaders = { } }; var PageBlobUploadPagesHeaders = { - serializedName: "pageblob-uploadpages-headers", + serializedName: "PageBlob_uploadPagesHeaders", type: { name: "Composite", className: "PageBlobUploadPagesHeaders", modelProperties: { etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, contentMD5: { serializedName: "content-md5", + xmlName: "content-md5", type: { name: "ByteArray" } }, xMsContentCrc64: { serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { name: "ByteArray" } }, blobSequenceNumber: { serializedName: "x-ms-blob-sequence-number", + xmlName: "x-ms-blob-sequence-number", type: { name: "Number" } }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, isServerEncrypted: { serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { name: "Boolean" } }, encryptionKeySha256: { serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { name: "String" } }, encryptionScope: { serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { name: "String" } }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var PageBlobUploadPagesExceptionHeaders = { + serializedName: "PageBlob_uploadPagesExceptionHeaders", + type: { + name: "Composite", + className: "PageBlobUploadPagesExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -25653,67 +25287,93 @@ var PageBlobUploadPagesHeaders = { } }; var PageBlobClearPagesHeaders = { - serializedName: "pageblob-clearpages-headers", + serializedName: "PageBlob_clearPagesHeaders", type: { name: "Composite", className: "PageBlobClearPagesHeaders", modelProperties: { etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, contentMD5: { serializedName: "content-md5", + xmlName: "content-md5", type: { name: "ByteArray" } }, xMsContentCrc64: { serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { name: "ByteArray" } }, blobSequenceNumber: { serializedName: "x-ms-blob-sequence-number", + xmlName: "x-ms-blob-sequence-number", type: { name: "Number" } }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var PageBlobClearPagesExceptionHeaders = { + serializedName: "PageBlob_clearPagesExceptionHeaders", + type: { + name: "Composite", + className: "PageBlobClearPagesExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -25722,79 +25382,107 @@ var PageBlobClearPagesHeaders = { } }; var PageBlobUploadPagesFromURLHeaders = { - serializedName: "pageblob-uploadpagesfromurl-headers", + serializedName: "PageBlob_uploadPagesFromURLHeaders", type: { name: "Composite", className: "PageBlobUploadPagesFromURLHeaders", modelProperties: { etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, contentMD5: { serializedName: "content-md5", + xmlName: "content-md5", type: { name: "ByteArray" } }, xMsContentCrc64: { serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { name: "ByteArray" } }, blobSequenceNumber: { serializedName: "x-ms-blob-sequence-number", + xmlName: "x-ms-blob-sequence-number", type: { name: "Number" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, isServerEncrypted: { serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { name: "Boolean" } }, encryptionKeySha256: { serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { name: "String" } }, encryptionScope: { serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { name: "String" } }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var PageBlobUploadPagesFromURLExceptionHeaders = { + serializedName: "PageBlob_uploadPagesFromURLExceptionHeaders", + type: { + name: "Composite", + className: "PageBlobUploadPagesFromURLExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -25803,55 +25491,79 @@ var PageBlobUploadPagesFromURLHeaders = { } }; var PageBlobGetPageRangesHeaders = { - serializedName: "pageblob-getpageranges-headers", + serializedName: "PageBlob_getPageRangesHeaders", type: { name: "Composite", className: "PageBlobGetPageRangesHeaders", modelProperties: { lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, blobContentLength: { serializedName: "x-ms-blob-content-length", + xmlName: "x-ms-blob-content-length", type: { name: "Number" } }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var PageBlobGetPageRangesExceptionHeaders = { + serializedName: "PageBlob_getPageRangesExceptionHeaders", + type: { + name: "Composite", + className: "PageBlobGetPageRangesExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -25860,55 +25572,79 @@ var PageBlobGetPageRangesHeaders = { } }; var PageBlobGetPageRangesDiffHeaders = { - serializedName: "pageblob-getpagerangesdiff-headers", + serializedName: "PageBlob_getPageRangesDiffHeaders", type: { name: "Composite", className: "PageBlobGetPageRangesDiffHeaders", modelProperties: { lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, blobContentLength: { serializedName: "x-ms-blob-content-length", + xmlName: "x-ms-blob-content-length", type: { name: "Number" } }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var PageBlobGetPageRangesDiffExceptionHeaders = { + serializedName: "PageBlob_getPageRangesDiffExceptionHeaders", + type: { + name: "Composite", + className: "PageBlobGetPageRangesDiffExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -25917,55 +25653,144 @@ var PageBlobGetPageRangesDiffHeaders = { } }; var PageBlobResizeHeaders = { - serializedName: "pageblob-resize-headers", + serializedName: "PageBlob_resizeHeaders", type: { name: "Composite", className: "PageBlobResizeHeaders", modelProperties: { etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, blobSequenceNumber: { serializedName: "x-ms-blob-sequence-number", + xmlName: "x-ms-blob-sequence-number", + type: { + name: "Number" + } + }, + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", + type: { + name: "String" + } + }, + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", + type: { + name: "String" + } + }, + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", + type: { + name: "String" + } + }, + date: { + serializedName: "date", + xmlName: "date", + type: { + name: "DateTimeRfc1123" + } + }, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var PageBlobResizeExceptionHeaders = { + serializedName: "PageBlob_resizeExceptionHeaders", + type: { + name: "Composite", + className: "PageBlobResizeExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var PageBlobUpdateSequenceNumberHeaders = { + serializedName: "PageBlob_updateSequenceNumberHeaders", + type: { + name: "Composite", + className: "PageBlobUpdateSequenceNumberHeaders", + modelProperties: { + etag: { + serializedName: "etag", + xmlName: "etag", + type: { + name: "String" + } + }, + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", + type: { + name: "DateTimeRfc1123" + } + }, + blobSequenceNumber: { + serializedName: "x-ms-blob-sequence-number", + xmlName: "x-ms-blob-sequence-number", type: { name: "Number" } }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -25973,56 +25798,88 @@ var PageBlobResizeHeaders = { } } }; -var PageBlobUpdateSequenceNumberHeaders = { - serializedName: "pageblob-updatesequencenumber-headers", +var PageBlobUpdateSequenceNumberExceptionHeaders = { + serializedName: "PageBlob_updateSequenceNumberExceptionHeaders", type: { name: "Composite", - className: "PageBlobUpdateSequenceNumberHeaders", + className: "PageBlobUpdateSequenceNumberExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var PageBlobCopyIncrementalHeaders = { + serializedName: "PageBlob_copyIncrementalHeaders", + type: { + name: "Composite", + className: "PageBlobCopyIncrementalHeaders", modelProperties: { etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, - blobSequenceNumber: { - serializedName: "x-ms-blob-sequence-number", - type: { - name: "Number" - } - }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, + copyId: { + serializedName: "x-ms-copy-id", + xmlName: "x-ms-copy-id", + type: { + name: "String" + } + }, + copyStatus: { + serializedName: "x-ms-copy-status", + xmlName: "x-ms-copy-status", + type: { + name: "Enum", + allowedValues: ["pending", "success", "aborted", "failed"] + } + }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -26030,68 +25887,124 @@ var PageBlobUpdateSequenceNumberHeaders = { } } }; -var PageBlobCopyIncrementalHeaders = { - serializedName: "pageblob-copyincremental-headers", +var PageBlobCopyIncrementalExceptionHeaders = { + serializedName: "PageBlob_copyIncrementalExceptionHeaders", type: { name: "Composite", - className: "PageBlobCopyIncrementalHeaders", + className: "PageBlobCopyIncrementalExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var AppendBlobCreateHeaders = { + serializedName: "AppendBlob_createHeaders", + type: { + name: "Composite", + className: "AppendBlobCreateHeaders", modelProperties: { etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", + type: { + name: "ByteArray" + } + }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", + type: { + name: "String" + } + }, + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, - copyId: { - serializedName: "x-ms-copy-id", + isServerEncrypted: { + serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", + type: { + name: "Boolean" + } + }, + encryptionKeySha256: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { name: "String" } }, - copyStatus: { - serializedName: "x-ms-copy-status", + encryptionScope: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { - name: "Enum", - allowedValues: [ - "pending", - "success", - "aborted", - "failed" - ] + name: "String" } }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var AppendBlobCreateExceptionHeaders = { + serializedName: "AppendBlob_createExceptionHeaders", + type: { + name: "Composite", + className: "AppendBlobCreateExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -26100,91 +26013,121 @@ var PageBlobCopyIncrementalHeaders = { } }; var AppendBlobAppendBlockHeaders = { - serializedName: "appendblob-appendblock-headers", + serializedName: "AppendBlob_appendBlockHeaders", type: { name: "Composite", className: "AppendBlobAppendBlockHeaders", modelProperties: { etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, contentMD5: { serializedName: "content-md5", + xmlName: "content-md5", type: { name: "ByteArray" } }, xMsContentCrc64: { serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { name: "ByteArray" } }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, blobAppendOffset: { serializedName: "x-ms-blob-append-offset", + xmlName: "x-ms-blob-append-offset", type: { name: "String" } }, blobCommittedBlockCount: { serializedName: "x-ms-blob-committed-block-count", + xmlName: "x-ms-blob-committed-block-count", type: { name: "Number" } }, isServerEncrypted: { serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { name: "Boolean" } }, encryptionKeySha256: { serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { name: "String" } }, encryptionScope: { serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { name: "String" } }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var AppendBlobAppendBlockExceptionHeaders = { + serializedName: "AppendBlob_appendBlockExceptionHeaders", + type: { + name: "Composite", + className: "AppendBlobAppendBlockExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -26193,85 +26136,114 @@ var AppendBlobAppendBlockHeaders = { } }; var AppendBlobAppendBlockFromUrlHeaders = { - serializedName: "appendblob-appendblockfromurl-headers", + serializedName: "AppendBlob_appendBlockFromUrlHeaders", type: { name: "Composite", className: "AppendBlobAppendBlockFromUrlHeaders", modelProperties: { etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, contentMD5: { serializedName: "content-md5", + xmlName: "content-md5", type: { name: "ByteArray" } }, xMsContentCrc64: { serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { name: "ByteArray" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, blobAppendOffset: { serializedName: "x-ms-blob-append-offset", + xmlName: "x-ms-blob-append-offset", type: { name: "String" } }, blobCommittedBlockCount: { serializedName: "x-ms-blob-committed-block-count", + xmlName: "x-ms-blob-committed-block-count", type: { name: "Number" } }, encryptionKeySha256: { serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { name: "String" } }, encryptionScope: { serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { name: "String" } }, isServerEncrypted: { serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { name: "Boolean" } }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var AppendBlobAppendBlockFromUrlExceptionHeaders = { + serializedName: "AppendBlob_appendBlockFromUrlExceptionHeaders", + type: { + name: "Composite", + className: "AppendBlobAppendBlockFromUrlExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -26280,55 +26252,72 @@ var AppendBlobAppendBlockFromUrlHeaders = { } }; var AppendBlobSealHeaders = { - serializedName: "appendblob-seal-headers", + serializedName: "AppendBlob_sealHeaders", type: { name: "Composite", className: "AppendBlobSealHeaders", modelProperties: { etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, isSealed: { serializedName: "x-ms-blob-sealed", + xmlName: "x-ms-blob-sealed", type: { name: "Boolean" } - }, + } + } + } +}; +var AppendBlobSealExceptionHeaders = { + serializedName: "AppendBlob_sealExceptionHeaders", + type: { + name: "Composite", + className: "AppendBlobSealExceptionHeaders", + modelProperties: { errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -26336,244 +26325,391 @@ var AppendBlobSealHeaders = { } } }; -var BlobQueryHeaders = { - serializedName: "blob-query-headers", +var BlockBlobUploadHeaders = { + serializedName: "BlockBlob_uploadHeaders", type: { name: "Composite", - className: "BlobQueryHeaders", + className: "BlockBlobUploadHeaders", modelProperties: { + etag: { + serializedName: "etag", + xmlName: "etag", + type: { + name: "String" + } + }, lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, - metadata: { - serializedName: "x-ms-meta", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } - }, - headerCollectionPrefix: "x-ms-meta-" + name: "ByteArray" + } }, - contentLength: { - serializedName: "content-length", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { - name: "Number" + name: "String" } }, - contentType: { - serializedName: "content-type", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - contentRange: { - serializedName: "content-range", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - etag: { - serializedName: "etag", + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", type: { name: "String" } }, - contentMD5: { - serializedName: "content-md5", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "ByteArray" + name: "DateTimeRfc1123" } }, - contentEncoding: { - serializedName: "content-encoding", + isServerEncrypted: { + serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { - name: "String" + name: "Boolean" } }, - cacheControl: { - serializedName: "cache-control", + encryptionKeySha256: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { name: "String" } }, - contentDisposition: { - serializedName: "content-disposition", + encryptionScope: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { name: "String" } }, - contentLanguage: { - serializedName: "content-language", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, - blobSequenceNumber: { - serializedName: "x-ms-blob-sequence-number", + } + } + } +}; +var BlockBlobUploadExceptionHeaders = { + serializedName: "BlockBlob_uploadExceptionHeaders", + type: { + name: "Composite", + className: "BlockBlobUploadExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Number" + name: "String" } - }, - blobType: { - serializedName: "x-ms-blob-type", + } + } + } +}; +var BlockBlobPutBlobFromUrlHeaders = { + serializedName: "BlockBlob_putBlobFromUrlHeaders", + type: { + name: "Composite", + className: "BlockBlobPutBlobFromUrlHeaders", + modelProperties: { + etag: { + serializedName: "etag", + xmlName: "etag", type: { - name: "Enum", - allowedValues: [ - "BlockBlob", - "PageBlob", - "AppendBlob" - ] + name: "String" } }, - copyCompletionTime: { - serializedName: "x-ms-copy-completion-time", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, - copyStatusDescription: { - serializedName: "x-ms-copy-status-description", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", + type: { + name: "ByteArray" + } + }, + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - copyId: { - serializedName: "x-ms-copy-id", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - copyProgress: { - serializedName: "x-ms-copy-progress", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - copySource: { - serializedName: "x-ms-copy-source", + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", type: { name: "String" } }, - copyStatus: { - serializedName: "x-ms-copy-status", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Enum", - allowedValues: [ - "pending", - "success", - "aborted", - "failed" - ] + name: "DateTimeRfc1123" } }, - leaseDuration: { - serializedName: "x-ms-lease-duration", + isServerEncrypted: { + serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { - name: "Enum", - allowedValues: [ - "infinite", - "fixed" - ] + name: "Boolean" } }, - leaseState: { - serializedName: "x-ms-lease-state", + encryptionKeySha256: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { - name: "Enum", - allowedValues: [ - "available", - "leased", - "expired", - "breaking", - "broken" - ] + name: "String" } }, - leaseStatus: { - serializedName: "x-ms-lease-status", + encryptionScope: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { - name: "Enum", - allowedValues: [ - "locked", - "unlocked" - ] + name: "String" + } + }, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var BlockBlobPutBlobFromUrlExceptionHeaders = { + serializedName: "BlockBlob_putBlobFromUrlExceptionHeaders", + type: { + name: "Composite", + className: "BlockBlobPutBlobFromUrlExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var BlockBlobStageBlockHeaders = { + serializedName: "BlockBlob_stageBlockHeaders", + type: { + name: "Composite", + className: "BlockBlobStageBlockHeaders", + modelProperties: { + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", + type: { + name: "ByteArray" } }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", - type: { - name: "String" - } - }, - acceptRanges: { - serializedName: "accept-ranges", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, - blobCommittedBlockCount: { - serializedName: "x-ms-blob-committed-block-count", + xMsContentCrc64: { + serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { - name: "Number" + name: "ByteArray" } }, isServerEncrypted: { - serializedName: "x-ms-server-encrypted", + serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { name: "Boolean" } }, encryptionKeySha256: { serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { name: "String" } }, encryptionScope: { serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { name: "String" } }, - blobContentMD5: { - serializedName: "x-ms-blob-content-md5", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var BlockBlobStageBlockExceptionHeaders = { + serializedName: "BlockBlob_stageBlockExceptionHeaders", + type: { + name: "Composite", + className: "BlockBlobStageBlockExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var BlockBlobStageBlockFromURLHeaders = { + serializedName: "BlockBlob_stageBlockFromURLHeaders", + type: { + name: "Composite", + className: "BlockBlobStageBlockFromURLHeaders", + modelProperties: { + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { name: "ByteArray" } }, - contentCrc64: { + xMsContentCrc64: { serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { name: "ByteArray" } }, + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", + type: { + name: "String" + } + }, + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", + type: { + name: "String" + } + }, + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", + type: { + name: "String" + } + }, + date: { + serializedName: "date", + xmlName: "date", + type: { + name: "DateTimeRfc1123" + } + }, + isServerEncrypted: { + serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", + type: { + name: "Boolean" + } + }, + encryptionKeySha256: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", + type: { + name: "String" + } + }, + encryptionScope: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", + type: { + name: "String" + } + }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -26581,77 +26717,219 @@ var BlobQueryHeaders = { } } }; -var BlobGetTagsHeaders = { - serializedName: "blob-gettags-headers", +var BlockBlobStageBlockFromURLExceptionHeaders = { + serializedName: "BlockBlob_stageBlockFromURLExceptionHeaders", type: { name: "Composite", - className: "BlobGetTagsHeaders", + className: "BlockBlobStageBlockFromURLExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var BlockBlobCommitBlockListHeaders = { + serializedName: "BlockBlob_commitBlockListHeaders", + type: { + name: "Composite", + className: "BlockBlobCommitBlockListHeaders", modelProperties: { + etag: { + serializedName: "etag", + xmlName: "etag", + type: { + name: "String" + } + }, + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", + type: { + name: "DateTimeRfc1123" + } + }, + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", + type: { + name: "ByteArray" + } + }, + xMsContentCrc64: { + serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", + type: { + name: "ByteArray" + } + }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", + type: { + name: "String" + } + }, + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, + isServerEncrypted: { + serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", + type: { + name: "Boolean" + } + }, + encryptionKeySha256: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", + type: { + name: "String" + } + }, + encryptionScope: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", + type: { + name: "String" + } + }, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var BlockBlobCommitBlockListExceptionHeaders = { + serializedName: "BlockBlob_commitBlockListExceptionHeaders", + type: { + name: "Composite", + className: "BlockBlobCommitBlockListExceptionHeaders", + modelProperties: { errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var BlockBlobGetBlockListHeaders = { + serializedName: "BlockBlob_getBlockListHeaders", + type: { + name: "Composite", + className: "BlockBlobGetBlockListHeaders", + modelProperties: { + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", + type: { + name: "DateTimeRfc1123" + } + }, + etag: { + serializedName: "etag", + xmlName: "etag", + type: { + name: "String" + } + }, + contentType: { + serializedName: "content-type", + xmlName: "content-type", + type: { + name: "String" + } + }, + blobContentLength: { + serializedName: "x-ms-blob-content-length", + xmlName: "x-ms-blob-content-length", type: { - name: "String" + name: "Number" } - } - } - } -}; -var BlobSetTagsHeaders = { - serializedName: "blob-settags-headers", - type: { - name: "Composite", - className: "BlobSetTagsHeaders", - modelProperties: { + }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var BlockBlobGetBlockListExceptionHeaders = { + serializedName: "BlockBlob_getBlockListExceptionHeaders", + type: { + name: "Composite", + className: "BlockBlobGetBlockListExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -26659,1894 +26937,2033 @@ var BlobSetTagsHeaders = { } } }; - -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ var Mappers = /*#__PURE__*/Object.freeze({ __proto__: null, BlobServiceProperties: BlobServiceProperties, + Logging: Logging, + RetentionPolicy: RetentionPolicy, + Metrics: Metrics, + CorsRule: CorsRule, + StaticWebsite: StaticWebsite, + StorageError: StorageError, BlobServiceStatistics: BlobServiceStatistics, - BlobTag: BlobTag, - BlobTags: BlobTags, + GeoReplication: GeoReplication, + ListContainersSegmentResponse: ListContainersSegmentResponse, ContainerItem: ContainerItem, ContainerProperties: ContainerProperties, - CorsRule: CorsRule, - FilterBlobItem: FilterBlobItem, - FilterBlobSegment: FilterBlobSegment, - GeoReplication: GeoReplication, KeyInfo: KeyInfo, - ListContainersSegmentResponse: ListContainersSegmentResponse, - Logging: Logging, - Metrics: Metrics, - RetentionPolicy: RetentionPolicy, - ServiceFilterBlobsHeaders: ServiceFilterBlobsHeaders, - ServiceGetAccountInfoHeaders: ServiceGetAccountInfoHeaders, + UserDelegationKey: UserDelegationKey, + FilterBlobSegment: FilterBlobSegment, + FilterBlobItem: FilterBlobItem, + BlobTags: BlobTags, + BlobTag: BlobTag, + SignedIdentifier: SignedIdentifier, + AccessPolicy: AccessPolicy, + ListBlobsFlatSegmentResponse: ListBlobsFlatSegmentResponse, + BlobFlatListSegment: BlobFlatListSegment, + BlobItemInternal: BlobItemInternal, + BlobPropertiesInternal: BlobPropertiesInternal, + ListBlobsHierarchySegmentResponse: ListBlobsHierarchySegmentResponse, + BlobHierarchyListSegment: BlobHierarchyListSegment, + BlobPrefix: BlobPrefix, + DataLakeStorageError: DataLakeStorageError, + DataLakeStorageErrorError: DataLakeStorageErrorError, + BlockLookupList: BlockLookupList, + BlockList: BlockList, + Block: Block, + PageList: PageList, + PageRange: PageRange, + ClearRange: ClearRange, + QueryRequest: QueryRequest, + QuerySerialization: QuerySerialization, + QueryFormat: QueryFormat, + DelimitedTextConfiguration: DelimitedTextConfiguration, + JsonTextConfiguration: JsonTextConfiguration, + ArrowConfiguration: ArrowConfiguration, + ArrowField: ArrowField, + ServiceSetPropertiesHeaders: ServiceSetPropertiesHeaders, + ServiceSetPropertiesExceptionHeaders: ServiceSetPropertiesExceptionHeaders, ServiceGetPropertiesHeaders: ServiceGetPropertiesHeaders, + ServiceGetPropertiesExceptionHeaders: ServiceGetPropertiesExceptionHeaders, ServiceGetStatisticsHeaders: ServiceGetStatisticsHeaders, - ServiceGetUserDelegationKeyHeaders: ServiceGetUserDelegationKeyHeaders, + ServiceGetStatisticsExceptionHeaders: ServiceGetStatisticsExceptionHeaders, ServiceListContainersSegmentHeaders: ServiceListContainersSegmentHeaders, - ServiceSetPropertiesHeaders: ServiceSetPropertiesHeaders, + ServiceListContainersSegmentExceptionHeaders: ServiceListContainersSegmentExceptionHeaders, + ServiceGetUserDelegationKeyHeaders: ServiceGetUserDelegationKeyHeaders, + ServiceGetUserDelegationKeyExceptionHeaders: ServiceGetUserDelegationKeyExceptionHeaders, + ServiceGetAccountInfoHeaders: ServiceGetAccountInfoHeaders, + ServiceGetAccountInfoExceptionHeaders: ServiceGetAccountInfoExceptionHeaders, ServiceSubmitBatchHeaders: ServiceSubmitBatchHeaders, - StaticWebsite: StaticWebsite, - StorageError: StorageError, - UserDelegationKey: UserDelegationKey + ServiceSubmitBatchExceptionHeaders: ServiceSubmitBatchExceptionHeaders, + ServiceFilterBlobsHeaders: ServiceFilterBlobsHeaders, + ServiceFilterBlobsExceptionHeaders: ServiceFilterBlobsExceptionHeaders, + ContainerCreateHeaders: ContainerCreateHeaders, + ContainerCreateExceptionHeaders: ContainerCreateExceptionHeaders, + ContainerGetPropertiesHeaders: ContainerGetPropertiesHeaders, + ContainerGetPropertiesExceptionHeaders: ContainerGetPropertiesExceptionHeaders, + ContainerDeleteHeaders: ContainerDeleteHeaders, + ContainerDeleteExceptionHeaders: ContainerDeleteExceptionHeaders, + ContainerSetMetadataHeaders: ContainerSetMetadataHeaders, + ContainerSetMetadataExceptionHeaders: ContainerSetMetadataExceptionHeaders, + ContainerGetAccessPolicyHeaders: ContainerGetAccessPolicyHeaders, + ContainerGetAccessPolicyExceptionHeaders: ContainerGetAccessPolicyExceptionHeaders, + ContainerSetAccessPolicyHeaders: ContainerSetAccessPolicyHeaders, + ContainerSetAccessPolicyExceptionHeaders: ContainerSetAccessPolicyExceptionHeaders, + ContainerRestoreHeaders: ContainerRestoreHeaders, + ContainerRestoreExceptionHeaders: ContainerRestoreExceptionHeaders, + ContainerRenameHeaders: ContainerRenameHeaders, + ContainerRenameExceptionHeaders: ContainerRenameExceptionHeaders, + ContainerSubmitBatchHeaders: ContainerSubmitBatchHeaders, + ContainerSubmitBatchExceptionHeaders: ContainerSubmitBatchExceptionHeaders, + ContainerAcquireLeaseHeaders: ContainerAcquireLeaseHeaders, + ContainerAcquireLeaseExceptionHeaders: ContainerAcquireLeaseExceptionHeaders, + ContainerReleaseLeaseHeaders: ContainerReleaseLeaseHeaders, + ContainerReleaseLeaseExceptionHeaders: ContainerReleaseLeaseExceptionHeaders, + ContainerRenewLeaseHeaders: ContainerRenewLeaseHeaders, + ContainerRenewLeaseExceptionHeaders: ContainerRenewLeaseExceptionHeaders, + ContainerBreakLeaseHeaders: ContainerBreakLeaseHeaders, + ContainerBreakLeaseExceptionHeaders: ContainerBreakLeaseExceptionHeaders, + ContainerChangeLeaseHeaders: ContainerChangeLeaseHeaders, + ContainerChangeLeaseExceptionHeaders: ContainerChangeLeaseExceptionHeaders, + ContainerListBlobFlatSegmentHeaders: ContainerListBlobFlatSegmentHeaders, + ContainerListBlobFlatSegmentExceptionHeaders: ContainerListBlobFlatSegmentExceptionHeaders, + ContainerListBlobHierarchySegmentHeaders: ContainerListBlobHierarchySegmentHeaders, + ContainerListBlobHierarchySegmentExceptionHeaders: ContainerListBlobHierarchySegmentExceptionHeaders, + ContainerGetAccountInfoHeaders: ContainerGetAccountInfoHeaders, + ContainerGetAccountInfoExceptionHeaders: ContainerGetAccountInfoExceptionHeaders, + DirectoryCreateHeaders: DirectoryCreateHeaders, + DirectoryCreateExceptionHeaders: DirectoryCreateExceptionHeaders, + DirectoryRenameHeaders: DirectoryRenameHeaders, + DirectoryRenameExceptionHeaders: DirectoryRenameExceptionHeaders, + DirectoryDeleteHeaders: DirectoryDeleteHeaders, + DirectoryDeleteExceptionHeaders: DirectoryDeleteExceptionHeaders, + DirectorySetAccessControlHeaders: DirectorySetAccessControlHeaders, + DirectorySetAccessControlExceptionHeaders: DirectorySetAccessControlExceptionHeaders, + DirectoryGetAccessControlHeaders: DirectoryGetAccessControlHeaders, + DirectoryGetAccessControlExceptionHeaders: DirectoryGetAccessControlExceptionHeaders, + BlobDownloadHeaders: BlobDownloadHeaders, + BlobDownloadExceptionHeaders: BlobDownloadExceptionHeaders, + BlobGetPropertiesHeaders: BlobGetPropertiesHeaders, + BlobGetPropertiesExceptionHeaders: BlobGetPropertiesExceptionHeaders, + BlobDeleteHeaders: BlobDeleteHeaders, + BlobDeleteExceptionHeaders: BlobDeleteExceptionHeaders, + BlobSetAccessControlHeaders: BlobSetAccessControlHeaders, + BlobSetAccessControlExceptionHeaders: BlobSetAccessControlExceptionHeaders, + BlobGetAccessControlHeaders: BlobGetAccessControlHeaders, + BlobGetAccessControlExceptionHeaders: BlobGetAccessControlExceptionHeaders, + BlobRenameHeaders: BlobRenameHeaders, + BlobRenameExceptionHeaders: BlobRenameExceptionHeaders, + BlobUndeleteHeaders: BlobUndeleteHeaders, + BlobUndeleteExceptionHeaders: BlobUndeleteExceptionHeaders, + BlobSetExpiryHeaders: BlobSetExpiryHeaders, + BlobSetExpiryExceptionHeaders: BlobSetExpiryExceptionHeaders, + BlobSetHttpHeadersHeaders: BlobSetHttpHeadersHeaders, + BlobSetHttpHeadersExceptionHeaders: BlobSetHttpHeadersExceptionHeaders, + BlobSetMetadataHeaders: BlobSetMetadataHeaders, + BlobSetMetadataExceptionHeaders: BlobSetMetadataExceptionHeaders, + BlobAcquireLeaseHeaders: BlobAcquireLeaseHeaders, + BlobAcquireLeaseExceptionHeaders: BlobAcquireLeaseExceptionHeaders, + BlobReleaseLeaseHeaders: BlobReleaseLeaseHeaders, + BlobReleaseLeaseExceptionHeaders: BlobReleaseLeaseExceptionHeaders, + BlobRenewLeaseHeaders: BlobRenewLeaseHeaders, + BlobRenewLeaseExceptionHeaders: BlobRenewLeaseExceptionHeaders, + BlobChangeLeaseHeaders: BlobChangeLeaseHeaders, + BlobChangeLeaseExceptionHeaders: BlobChangeLeaseExceptionHeaders, + BlobBreakLeaseHeaders: BlobBreakLeaseHeaders, + BlobBreakLeaseExceptionHeaders: BlobBreakLeaseExceptionHeaders, + BlobCreateSnapshotHeaders: BlobCreateSnapshotHeaders, + BlobCreateSnapshotExceptionHeaders: BlobCreateSnapshotExceptionHeaders, + BlobStartCopyFromURLHeaders: BlobStartCopyFromURLHeaders, + BlobStartCopyFromURLExceptionHeaders: BlobStartCopyFromURLExceptionHeaders, + BlobCopyFromURLHeaders: BlobCopyFromURLHeaders, + BlobCopyFromURLExceptionHeaders: BlobCopyFromURLExceptionHeaders, + BlobAbortCopyFromURLHeaders: BlobAbortCopyFromURLHeaders, + BlobAbortCopyFromURLExceptionHeaders: BlobAbortCopyFromURLExceptionHeaders, + BlobSetTierHeaders: BlobSetTierHeaders, + BlobSetTierExceptionHeaders: BlobSetTierExceptionHeaders, + BlobGetAccountInfoHeaders: BlobGetAccountInfoHeaders, + BlobGetAccountInfoExceptionHeaders: BlobGetAccountInfoExceptionHeaders, + BlobQueryHeaders: BlobQueryHeaders, + BlobQueryExceptionHeaders: BlobQueryExceptionHeaders, + BlobGetTagsHeaders: BlobGetTagsHeaders, + BlobGetTagsExceptionHeaders: BlobGetTagsExceptionHeaders, + BlobSetTagsHeaders: BlobSetTagsHeaders, + BlobSetTagsExceptionHeaders: BlobSetTagsExceptionHeaders, + PageBlobCreateHeaders: PageBlobCreateHeaders, + PageBlobCreateExceptionHeaders: PageBlobCreateExceptionHeaders, + PageBlobUploadPagesHeaders: PageBlobUploadPagesHeaders, + PageBlobUploadPagesExceptionHeaders: PageBlobUploadPagesExceptionHeaders, + PageBlobClearPagesHeaders: PageBlobClearPagesHeaders, + PageBlobClearPagesExceptionHeaders: PageBlobClearPagesExceptionHeaders, + PageBlobUploadPagesFromURLHeaders: PageBlobUploadPagesFromURLHeaders, + PageBlobUploadPagesFromURLExceptionHeaders: PageBlobUploadPagesFromURLExceptionHeaders, + PageBlobGetPageRangesHeaders: PageBlobGetPageRangesHeaders, + PageBlobGetPageRangesExceptionHeaders: PageBlobGetPageRangesExceptionHeaders, + PageBlobGetPageRangesDiffHeaders: PageBlobGetPageRangesDiffHeaders, + PageBlobGetPageRangesDiffExceptionHeaders: PageBlobGetPageRangesDiffExceptionHeaders, + PageBlobResizeHeaders: PageBlobResizeHeaders, + PageBlobResizeExceptionHeaders: PageBlobResizeExceptionHeaders, + PageBlobUpdateSequenceNumberHeaders: PageBlobUpdateSequenceNumberHeaders, + PageBlobUpdateSequenceNumberExceptionHeaders: PageBlobUpdateSequenceNumberExceptionHeaders, + PageBlobCopyIncrementalHeaders: PageBlobCopyIncrementalHeaders, + PageBlobCopyIncrementalExceptionHeaders: PageBlobCopyIncrementalExceptionHeaders, + AppendBlobCreateHeaders: AppendBlobCreateHeaders, + AppendBlobCreateExceptionHeaders: AppendBlobCreateExceptionHeaders, + AppendBlobAppendBlockHeaders: AppendBlobAppendBlockHeaders, + AppendBlobAppendBlockExceptionHeaders: AppendBlobAppendBlockExceptionHeaders, + AppendBlobAppendBlockFromUrlHeaders: AppendBlobAppendBlockFromUrlHeaders, + AppendBlobAppendBlockFromUrlExceptionHeaders: AppendBlobAppendBlockFromUrlExceptionHeaders, + AppendBlobSealHeaders: AppendBlobSealHeaders, + AppendBlobSealExceptionHeaders: AppendBlobSealExceptionHeaders, + BlockBlobUploadHeaders: BlockBlobUploadHeaders, + BlockBlobUploadExceptionHeaders: BlockBlobUploadExceptionHeaders, + BlockBlobPutBlobFromUrlHeaders: BlockBlobPutBlobFromUrlHeaders, + BlockBlobPutBlobFromUrlExceptionHeaders: BlockBlobPutBlobFromUrlExceptionHeaders, + BlockBlobStageBlockHeaders: BlockBlobStageBlockHeaders, + BlockBlobStageBlockExceptionHeaders: BlockBlobStageBlockExceptionHeaders, + BlockBlobStageBlockFromURLHeaders: BlockBlobStageBlockFromURLHeaders, + BlockBlobStageBlockFromURLExceptionHeaders: BlockBlobStageBlockFromURLExceptionHeaders, + BlockBlobCommitBlockListHeaders: BlockBlobCommitBlockListHeaders, + BlockBlobCommitBlockListExceptionHeaders: BlockBlobCommitBlockListExceptionHeaders, + BlockBlobGetBlockListHeaders: BlockBlobGetBlockListHeaders, + BlockBlobGetBlockListExceptionHeaders: BlockBlobGetBlockListExceptionHeaders }); /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -var access = { - parameterPath: [ - "options", - "access" - ], +var contentType = { + parameterPath: ["options", "contentType"], mapper: { - serializedName: "x-ms-blob-public-access", + defaultValue: "application/xml", + isConstant: true, + serializedName: "Content-Type", type: { name: "String" } } }; -var action0 = { - parameterPath: "action", +var blobServiceProperties = { + parameterPath: "blobServiceProperties", + mapper: BlobServiceProperties +}; +var accept = { + parameterPath: "accept", mapper: { - required: true, + defaultValue: "application/xml", isConstant: true, - serializedName: "x-ms-lease-action", - defaultValue: 'acquire', + serializedName: "Accept", type: { name: "String" } } }; -var action1 = { - parameterPath: "action", +var url = { + parameterPath: "url", mapper: { + serializedName: "url", required: true, - isConstant: true, - serializedName: "x-ms-lease-action", - defaultValue: 'release', + xmlName: "url", type: { name: "String" } - } + }, + skipEncoding: true }; -var action2 = { - parameterPath: "action", +var restype = { + parameterPath: "restype", mapper: { - required: true, + defaultValue: "service", isConstant: true, - serializedName: "x-ms-lease-action", - defaultValue: 'renew', + serializedName: "restype", type: { name: "String" } } }; -var action3 = { - parameterPath: "action", +var comp = { + parameterPath: "comp", mapper: { - required: true, + defaultValue: "properties", isConstant: true, - serializedName: "x-ms-lease-action", - defaultValue: 'break', + serializedName: "comp", type: { name: "String" } } }; -var action4 = { - parameterPath: "action", +var timeoutInSeconds = { + parameterPath: ["options", "timeoutInSeconds"], mapper: { - required: true, - isConstant: true, - serializedName: "x-ms-lease-action", - defaultValue: 'change', + constraints: { + InclusiveMinimum: 0 + }, + serializedName: "timeout", + xmlName: "timeout", type: { - name: "String" + name: "Number" } } }; -var action5 = { - parameterPath: "action", +var version = { + parameterPath: "version", mapper: { - required: true, + defaultValue: "2020-08-04", isConstant: true, - serializedName: "action", - defaultValue: 'setAccessControl', + serializedName: "x-ms-version", type: { name: "String" } } }; -var action6 = { - parameterPath: "action", +var requestId = { + parameterPath: ["options", "requestId"], mapper: { - required: true, - isConstant: true, - serializedName: "action", - defaultValue: 'getAccessControl', + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } } }; -var appendPosition = { - parameterPath: [ - "options", - "appendPositionAccessConditions", - "appendPosition" - ], +var accept1 = { + parameterPath: "accept", mapper: { - serializedName: "x-ms-blob-condition-appendpos", + defaultValue: "application/xml", + isConstant: true, + serializedName: "Accept", type: { - name: "Number" + name: "String" } } }; -var blobCacheControl = { - parameterPath: [ - "options", - "blobHTTPHeaders", - "blobCacheControl" - ], +var comp1 = { + parameterPath: "comp", mapper: { - serializedName: "x-ms-blob-cache-control", + defaultValue: "stats", + isConstant: true, + serializedName: "comp", type: { name: "String" } } }; -var blobContentDisposition = { - parameterPath: [ - "options", - "blobHTTPHeaders", - "blobContentDisposition" - ], +var comp2 = { + parameterPath: "comp", mapper: { - serializedName: "x-ms-blob-content-disposition", + defaultValue: "list", + isConstant: true, + serializedName: "comp", type: { name: "String" } } }; -var blobContentEncoding = { - parameterPath: [ - "options", - "blobHTTPHeaders", - "blobContentEncoding" - ], +var prefix = { + parameterPath: ["options", "prefix"], mapper: { - serializedName: "x-ms-blob-content-encoding", + serializedName: "prefix", + xmlName: "prefix", type: { name: "String" } } }; -var blobContentLanguage = { - parameterPath: [ - "options", - "blobHTTPHeaders", - "blobContentLanguage" - ], +var marker = { + parameterPath: ["options", "marker"], mapper: { - serializedName: "x-ms-blob-content-language", + serializedName: "marker", + xmlName: "marker", type: { name: "String" } } }; -var blobContentLength = { - parameterPath: "blobContentLength", +var maxPageSize = { + parameterPath: ["options", "maxPageSize"], mapper: { - required: true, - serializedName: "x-ms-blob-content-length", + constraints: { + InclusiveMinimum: 1 + }, + serializedName: "maxresults", + xmlName: "maxresults", type: { name: "Number" } } }; -var blobContentMD5 = { - parameterPath: [ - "options", - "blobHTTPHeaders", - "blobContentMD5" - ], +var include = { + parameterPath: ["options", "include"], mapper: { - serializedName: "x-ms-blob-content-md5", + serializedName: "include", + xmlName: "include", + xmlElementName: "ListContainersIncludeType", type: { - name: "ByteArray" + name: "Sequence", + element: { + type: { + name: "Enum", + allowedValues: ["metadata", "deleted"] + } + } + } + }, + collectionFormat: coreHttp.QueryCollectionFormat.Csv +}; +var keyInfo = { + parameterPath: "keyInfo", + mapper: KeyInfo +}; +var comp3 = { + parameterPath: "comp", + mapper: { + defaultValue: "userdelegationkey", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; -var blobContentType = { - parameterPath: [ - "options", - "blobHTTPHeaders", - "blobContentType" - ], +var restype1 = { + parameterPath: "restype", mapper: { - serializedName: "x-ms-blob-content-type", + defaultValue: "account", + isConstant: true, + serializedName: "restype", type: { name: "String" } } }; -var blobDeleteType = { - parameterPath: [ - "options", - "blobDeleteType" - ], +var body = { + parameterPath: "body", mapper: { - serializedName: "deletetype", + serializedName: "body", + required: true, + xmlName: "body", type: { - name: "Enum", - allowedValues: [ - "Permanent" - ] + name: "Stream" } } }; -var blobSequenceNumber = { - parameterPath: [ - "options", - "blobSequenceNumber" - ], +var comp4 = { + parameterPath: "comp", mapper: { - serializedName: "x-ms-blob-sequence-number", - defaultValue: 0, + defaultValue: "batch", + isConstant: true, + serializedName: "comp", + type: { + name: "String" + } + } +}; +var contentLength = { + parameterPath: "contentLength", + mapper: { + serializedName: "Content-Length", + required: true, + xmlName: "Content-Length", type: { name: "Number" } } }; -var blobTagsString = { - parameterPath: [ - "options", - "blobTagsString" - ], +var multipartContentType = { + parameterPath: "multipartContentType", mapper: { - serializedName: "x-ms-tags", + serializedName: "Content-Type", + required: true, + xmlName: "Content-Type", type: { name: "String" } } }; -var blobType0 = { - parameterPath: "blobType", +var comp5 = { + parameterPath: "comp", mapper: { - required: true, + defaultValue: "blobs", isConstant: true, - serializedName: "x-ms-blob-type", - defaultValue: 'PageBlob', + serializedName: "comp", type: { name: "String" } } }; -var blobType1 = { - parameterPath: "blobType", +var where = { + parameterPath: ["options", "where"], mapper: { - required: true, - isConstant: true, - serializedName: "x-ms-blob-type", - defaultValue: 'AppendBlob', + serializedName: "where", + xmlName: "where", type: { name: "String" } } }; -var blobType2 = { - parameterPath: "blobType", +var restype2 = { + parameterPath: "restype", mapper: { - required: true, + defaultValue: "container", isConstant: true, - serializedName: "x-ms-blob-type", - defaultValue: 'BlockBlob', + serializedName: "restype", type: { name: "String" } } }; -var blockId = { - parameterPath: "blockId", +var metadata = { + parameterPath: ["options", "metadata"], mapper: { - required: true, - serializedName: "blockid", + serializedName: "x-ms-meta", + xmlName: "x-ms-meta", type: { - name: "String" + name: "Dictionary", + value: { type: { name: "String" } } + }, + headerCollectionPrefix: "x-ms-meta-" + } +}; +var access = { + parameterPath: ["options", "access"], + mapper: { + serializedName: "x-ms-blob-public-access", + xmlName: "x-ms-blob-public-access", + type: { + name: "Enum", + allowedValues: ["container", "blob"] } } }; -var breakPeriod = { +var defaultEncryptionScope = { parameterPath: [ "options", - "breakPeriod" + "containerEncryptionScope", + "defaultEncryptionScope" ], mapper: { - serializedName: "x-ms-lease-break-period", + serializedName: "x-ms-default-encryption-scope", + xmlName: "x-ms-default-encryption-scope", type: { - name: "Number" + name: "String" } } }; -var cacheControl = { +var preventEncryptionScopeOverride = { parameterPath: [ "options", - "directoryHttpHeaders", - "cacheControl" + "containerEncryptionScope", + "preventEncryptionScopeOverride" ], mapper: { - serializedName: "x-ms-cache-control", + serializedName: "x-ms-deny-encryption-scope-override", + xmlName: "x-ms-deny-encryption-scope-override", type: { - name: "String" + name: "Boolean" } } }; -var comp0 = { - parameterPath: "comp", +var leaseId = { + parameterPath: ["options", "leaseAccessConditions", "leaseId"], mapper: { - required: true, - isConstant: true, - serializedName: "comp", - defaultValue: 'properties', + serializedName: "x-ms-lease-id", + xmlName: "x-ms-lease-id", type: { name: "String" } } }; -var comp1 = { +var ifModifiedSince = { + parameterPath: ["options", "modifiedAccessConditions", "ifModifiedSince"], + mapper: { + serializedName: "If-Modified-Since", + xmlName: "If-Modified-Since", + type: { + name: "DateTimeRfc1123" + } + } +}; +var ifUnmodifiedSince = { + parameterPath: ["options", "modifiedAccessConditions", "ifUnmodifiedSince"], + mapper: { + serializedName: "If-Unmodified-Since", + xmlName: "If-Unmodified-Since", + type: { + name: "DateTimeRfc1123" + } + } +}; +var comp6 = { parameterPath: "comp", mapper: { - required: true, + defaultValue: "metadata", isConstant: true, serializedName: "comp", - defaultValue: 'stats', type: { name: "String" } } }; -var comp10 = { +var comp7 = { parameterPath: "comp", mapper: { - required: true, + defaultValue: "acl", isConstant: true, serializedName: "comp", - defaultValue: 'lease', type: { name: "String" } } }; -var comp11 = { +var containerAcl = { + parameterPath: ["options", "containerAcl"], + mapper: { + serializedName: "containerAcl", + xmlName: "SignedIdentifiers", + xmlIsWrapped: true, + xmlElementName: "SignedIdentifier", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SignedIdentifier" + } + } + } + } +}; +var comp8 = { parameterPath: "comp", mapper: { - required: true, + defaultValue: "undelete", isConstant: true, serializedName: "comp", - defaultValue: 'expiry', type: { name: "String" } } }; -var comp12 = { - parameterPath: "comp", +var deletedContainerName = { + parameterPath: ["options", "deletedContainerName"], mapper: { - required: true, - isConstant: true, - serializedName: "comp", - defaultValue: 'snapshot', + serializedName: "x-ms-deleted-container-name", + xmlName: "x-ms-deleted-container-name", type: { name: "String" } } }; -var comp13 = { - parameterPath: "comp", +var deletedContainerVersion = { + parameterPath: ["options", "deletedContainerVersion"], mapper: { - required: true, - isConstant: true, - serializedName: "comp", - defaultValue: 'copy', + serializedName: "x-ms-deleted-container-version", + xmlName: "x-ms-deleted-container-version", type: { name: "String" } } }; -var comp14 = { +var comp9 = { parameterPath: "comp", mapper: { - required: true, + defaultValue: "rename", isConstant: true, serializedName: "comp", - defaultValue: 'tier', type: { name: "String" } } }; -var comp15 = { - parameterPath: "comp", +var sourceContainerName = { + parameterPath: "sourceContainerName", mapper: { + serializedName: "x-ms-source-container-name", required: true, - isConstant: true, - serializedName: "comp", - defaultValue: 'query', + xmlName: "x-ms-source-container-name", type: { name: "String" } } }; -var comp16 = { - parameterPath: "comp", +var sourceLeaseId = { + parameterPath: ["options", "sourceLeaseId"], mapper: { - required: true, - isConstant: true, - serializedName: "comp", - defaultValue: 'tags', + serializedName: "x-ms-source-lease-id", + xmlName: "x-ms-source-lease-id", type: { name: "String" } } }; -var comp17 = { +var comp10 = { parameterPath: "comp", mapper: { - required: true, + defaultValue: "lease", isConstant: true, serializedName: "comp", - defaultValue: 'page', type: { name: "String" } } }; -var comp18 = { - parameterPath: "comp", +var action = { + parameterPath: "action", mapper: { - required: true, + defaultValue: "acquire", isConstant: true, - serializedName: "comp", - defaultValue: 'pagelist', + serializedName: "x-ms-lease-action", type: { name: "String" } } }; -var comp19 = { - parameterPath: "comp", +var duration = { + parameterPath: ["options", "duration"], mapper: { - required: true, - isConstant: true, - serializedName: "comp", - defaultValue: 'incrementalcopy', + serializedName: "x-ms-lease-duration", + xmlName: "x-ms-lease-duration", + type: { + name: "Number" + } + } +}; +var proposedLeaseId = { + parameterPath: ["options", "proposedLeaseId"], + mapper: { + serializedName: "x-ms-proposed-lease-id", + xmlName: "x-ms-proposed-lease-id", type: { name: "String" } } }; -var comp2 = { - parameterPath: "comp", +var action1 = { + parameterPath: "action", mapper: { - required: true, + defaultValue: "release", isConstant: true, - serializedName: "comp", - defaultValue: 'list', + serializedName: "x-ms-lease-action", type: { name: "String" } } }; -var comp20 = { - parameterPath: "comp", +var leaseId1 = { + parameterPath: "leaseId", mapper: { + serializedName: "x-ms-lease-id", required: true, - isConstant: true, - serializedName: "comp", - defaultValue: 'appendblock', + xmlName: "x-ms-lease-id", type: { name: "String" } } }; -var comp21 = { - parameterPath: "comp", +var action2 = { + parameterPath: "action", mapper: { - required: true, + defaultValue: "renew", isConstant: true, - serializedName: "comp", - defaultValue: 'seal', + serializedName: "x-ms-lease-action", type: { name: "String" } } }; -var comp22 = { - parameterPath: "comp", +var action3 = { + parameterPath: "action", mapper: { - required: true, + defaultValue: "break", isConstant: true, - serializedName: "comp", - defaultValue: 'block', + serializedName: "x-ms-lease-action", type: { name: "String" } } }; -var comp23 = { - parameterPath: "comp", +var breakPeriod = { + parameterPath: ["options", "breakPeriod"], mapper: { - required: true, - isConstant: true, - serializedName: "comp", - defaultValue: 'blocklist', + serializedName: "x-ms-lease-break-period", + xmlName: "x-ms-lease-break-period", type: { - name: "String" + name: "Number" } } }; -var comp3 = { - parameterPath: "comp", +var action4 = { + parameterPath: "action", mapper: { - required: true, + defaultValue: "change", isConstant: true, - serializedName: "comp", - defaultValue: 'userdelegationkey', + serializedName: "x-ms-lease-action", type: { name: "String" } } }; -var comp4 = { - parameterPath: "comp", +var proposedLeaseId1 = { + parameterPath: "proposedLeaseId", mapper: { + serializedName: "x-ms-proposed-lease-id", required: true, - isConstant: true, - serializedName: "comp", - defaultValue: 'batch', + xmlName: "x-ms-proposed-lease-id", type: { name: "String" } } }; -var comp5 = { - parameterPath: "comp", +var include1 = { + parameterPath: ["options", "include"], + mapper: { + serializedName: "include", + xmlName: "include", + xmlElementName: "ListBlobsIncludeItem", + type: { + name: "Sequence", + element: { + type: { + name: "Enum", + allowedValues: [ + "copy", + "deleted", + "metadata", + "snapshots", + "uncommittedblobs", + "versions", + "tags" + ] + } + } + } + }, + collectionFormat: coreHttp.QueryCollectionFormat.Csv +}; +var delimiter = { + parameterPath: "delimiter", mapper: { + serializedName: "delimiter", required: true, - isConstant: true, - serializedName: "comp", - defaultValue: 'blobs', + xmlName: "delimiter", type: { name: "String" } } }; -var comp6 = { - parameterPath: "comp", +var directoryProperties = { + parameterPath: ["options", "directoryProperties"], mapper: { - required: true, - isConstant: true, - serializedName: "comp", - defaultValue: 'metadata', + serializedName: "x-ms-properties", + xmlName: "x-ms-properties", type: { name: "String" } } }; -var comp7 = { - parameterPath: "comp", +var posixPermissions = { + parameterPath: ["options", "posixPermissions"], mapper: { - required: true, - isConstant: true, - serializedName: "comp", - defaultValue: 'acl', + serializedName: "x-ms-permissions", + xmlName: "x-ms-permissions", type: { name: "String" } } }; -var comp8 = { - parameterPath: "comp", +var posixUmask = { + parameterPath: ["options", "posixUmask"], mapper: { - required: true, - isConstant: true, - serializedName: "comp", - defaultValue: 'undelete', + serializedName: "x-ms-umask", + xmlName: "x-ms-umask", type: { name: "String" } } }; -var comp9 = { - parameterPath: "comp", +var cacheControl = { + parameterPath: ["options", "directoryHttpHeaders", "cacheControl"], mapper: { - required: true, - isConstant: true, - serializedName: "comp", - defaultValue: 'rename', + serializedName: "x-ms-cache-control", + xmlName: "x-ms-cache-control", type: { name: "String" } } }; -var contentDisposition = { - parameterPath: [ - "options", - "directoryHttpHeaders", - "contentDisposition" - ], +var contentType1 = { + parameterPath: ["options", "directoryHttpHeaders", "contentType"], mapper: { - serializedName: "x-ms-content-disposition", + serializedName: "x-ms-content-type", + xmlName: "x-ms-content-type", type: { name: "String" } } }; var contentEncoding = { - parameterPath: [ - "options", - "directoryHttpHeaders", - "contentEncoding" - ], + parameterPath: ["options", "directoryHttpHeaders", "contentEncoding"], mapper: { serializedName: "x-ms-content-encoding", + xmlName: "x-ms-content-encoding", type: { name: "String" } } }; var contentLanguage = { - parameterPath: [ - "options", - "directoryHttpHeaders", - "contentLanguage" - ], + parameterPath: ["options", "directoryHttpHeaders", "contentLanguage"], mapper: { serializedName: "x-ms-content-language", + xmlName: "x-ms-content-language", type: { name: "String" } } }; -var contentLength = { - parameterPath: "contentLength", +var contentDisposition = { + parameterPath: ["options", "directoryHttpHeaders", "contentDisposition"], mapper: { - required: true, - serializedName: "Content-Length", + serializedName: "x-ms-content-disposition", + xmlName: "x-ms-content-disposition", type: { - name: "Number" + name: "String" } } }; -var contentType = { - parameterPath: [ - "options", - "directoryHttpHeaders", - "contentType" - ], +var ifMatch = { + parameterPath: ["options", "modifiedAccessConditions", "ifMatch"], mapper: { - serializedName: "x-ms-content-type", + serializedName: "If-Match", + xmlName: "If-Match", type: { name: "String" } } }; -var copyActionAbortConstant = { - parameterPath: "copyActionAbortConstant", +var ifNoneMatch = { + parameterPath: ["options", "modifiedAccessConditions", "ifNoneMatch"], mapper: { - required: true, - isConstant: true, - serializedName: "x-ms-copy-action", - defaultValue: 'abort', + serializedName: "If-None-Match", + xmlName: "If-None-Match", type: { name: "String" } } }; -var copyId = { - parameterPath: "copyId", +var pathRenameMode = { + parameterPath: ["options", "pathRenameMode"], mapper: { - required: true, - serializedName: "copyid", + serializedName: "mode", + xmlName: "mode", type: { - name: "String" + name: "Enum", + allowedValues: ["legacy", "posix"] } } }; -var copySource = { - parameterPath: "copySource", +var renameSource = { + parameterPath: "renameSource", mapper: { + serializedName: "x-ms-rename-source", required: true, - serializedName: "x-ms-copy-source", + xmlName: "x-ms-rename-source", type: { name: "String" } } }; -var copySourceBlobProperties = { +var sourceIfModifiedSince = { parameterPath: [ "options", - "copySourceBlobProperties" + "sourceModifiedAccessConditions", + "sourceIfModifiedSince" ], mapper: { - serializedName: "x-ms-copy-source-blob-properties", + serializedName: "x-ms-source-if-modified-since", + xmlName: "x-ms-source-if-modified-since", type: { - name: "Boolean" + name: "DateTimeRfc1123" } } }; -var defaultEncryptionScope = { +var sourceIfUnmodifiedSince = { parameterPath: [ "options", - "containerEncryptionScope", - "defaultEncryptionScope" + "sourceModifiedAccessConditions", + "sourceIfUnmodifiedSince" ], mapper: { - serializedName: "x-ms-default-encryption-scope", + serializedName: "x-ms-source-if-unmodified-since", + xmlName: "x-ms-source-if-unmodified-since", type: { - name: "String" + name: "DateTimeRfc1123" } } }; -var deletedContainerName = { - parameterPath: [ - "options", - "deletedContainerName" - ], +var sourceIfMatch = { + parameterPath: ["options", "sourceModifiedAccessConditions", "sourceIfMatch"], mapper: { - serializedName: "x-ms-deleted-container-name", + serializedName: "x-ms-source-if-match", + xmlName: "x-ms-source-if-match", type: { name: "String" } } }; -var deletedContainerVersion = { +var sourceIfNoneMatch = { parameterPath: [ "options", - "deletedContainerVersion" + "sourceModifiedAccessConditions", + "sourceIfNoneMatch" ], mapper: { - serializedName: "x-ms-deleted-container-version", + serializedName: "x-ms-source-if-none-match", + xmlName: "x-ms-source-if-none-match", type: { name: "String" } } }; -var deleteSnapshots = { - parameterPath: [ - "options", - "deleteSnapshots" - ], +var action5 = { + parameterPath: "action", mapper: { - serializedName: "x-ms-delete-snapshots", + defaultValue: "setAccessControl", + isConstant: true, + serializedName: "action", type: { - name: "Enum", - allowedValues: [ - "include", - "only" - ] + name: "String" } } }; -var delimiter = { - parameterPath: "delimiter", +var owner = { + parameterPath: ["options", "owner"], mapper: { - required: true, - serializedName: "delimiter", + serializedName: "x-ms-owner", + xmlName: "x-ms-owner", type: { name: "String" } } }; -var directoryProperties = { - parameterPath: [ - "options", - "directoryProperties" - ], +var group = { + parameterPath: ["options", "group"], mapper: { - serializedName: "x-ms-properties", + serializedName: "x-ms-group", + xmlName: "x-ms-group", type: { name: "String" } } }; -var duration = { - parameterPath: [ - "options", - "duration" - ], +var posixAcl = { + parameterPath: ["options", "posixAcl"], mapper: { - serializedName: "x-ms-lease-duration", + serializedName: "x-ms-acl", + xmlName: "x-ms-acl", type: { - name: "Number" + name: "String" } } }; -var encryptionAlgorithm = { - parameterPath: [ - "options", - "cpkInfo", - "encryptionAlgorithm" - ], +var action6 = { + parameterPath: "action", mapper: { - serializedName: "x-ms-encryption-algorithm", + defaultValue: "getAccessControl", + isConstant: true, + serializedName: "action", type: { - name: "Enum", - allowedValues: [ - "AES256" - ] + name: "String" } } }; -var encryptionKey = { - parameterPath: [ - "options", - "cpkInfo", - "encryptionKey" - ], +var upn = { + parameterPath: ["options", "upn"], mapper: { - serializedName: "x-ms-encryption-key", + serializedName: "upn", + xmlName: "upn", type: { - name: "String" + name: "Boolean" } } }; -var encryptionKeySha256 = { - parameterPath: [ - "options", - "cpkInfo", - "encryptionKeySha256" - ], +var snapshot = { + parameterPath: ["options", "snapshot"], mapper: { - serializedName: "x-ms-encryption-key-sha256", + serializedName: "snapshot", + xmlName: "snapshot", type: { name: "String" } } }; -var encryptionScope = { - parameterPath: [ - "options", - "encryptionScope" - ], +var versionId = { + parameterPath: ["options", "versionId"], mapper: { - serializedName: "x-ms-encryption-scope", + serializedName: "versionid", + xmlName: "versionid", type: { name: "String" } } }; -var expiresOn = { - parameterPath: [ - "options", - "expiresOn" - ], +var range = { + parameterPath: ["options", "range"], mapper: { - serializedName: "x-ms-expiry-time", + serializedName: "x-ms-range", + xmlName: "x-ms-range", type: { name: "String" } } }; -var expiryOptions = { - parameterPath: "expiryOptions", +var rangeGetContentMD5 = { + parameterPath: ["options", "rangeGetContentMD5"], mapper: { - required: true, - serializedName: "x-ms-expiry-option", + serializedName: "x-ms-range-get-content-md5", + xmlName: "x-ms-range-get-content-md5", type: { - name: "String" + name: "Boolean" } } }; -var group = { - parameterPath: [ - "options", - "group" - ], +var rangeGetContentCRC64 = { + parameterPath: ["options", "rangeGetContentCRC64"], mapper: { - serializedName: "x-ms-group", + serializedName: "x-ms-range-get-content-crc64", + xmlName: "x-ms-range-get-content-crc64", type: { - name: "String" + name: "Boolean" } } }; -var ifMatch = { - parameterPath: [ - "options", - "modifiedAccessConditions", - "ifMatch" - ], +var encryptionKey = { + parameterPath: ["options", "cpkInfo", "encryptionKey"], mapper: { - serializedName: "If-Match", + serializedName: "x-ms-encryption-key", + xmlName: "x-ms-encryption-key", type: { name: "String" } } }; -var ifModifiedSince = { - parameterPath: [ - "options", - "modifiedAccessConditions", - "ifModifiedSince" - ], +var encryptionKeySha256 = { + parameterPath: ["options", "cpkInfo", "encryptionKeySha256"], mapper: { - serializedName: "If-Modified-Since", + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { - name: "DateTimeRfc1123" + name: "String" } } }; -var ifNoneMatch = { - parameterPath: [ - "options", - "modifiedAccessConditions", - "ifNoneMatch" - ], +var encryptionAlgorithm = { + parameterPath: ["options", "encryptionAlgorithm"], mapper: { - serializedName: "If-None-Match", + defaultValue: "AES256", + isConstant: true, + serializedName: "x-ms-encryption-algorithm", type: { name: "String" } } }; -var ifSequenceNumberEqualTo = { - parameterPath: [ - "options", - "sequenceNumberAccessConditions", - "ifSequenceNumberEqualTo" - ], +var ifTags = { + parameterPath: ["options", "modifiedAccessConditions", "ifTags"], mapper: { - serializedName: "x-ms-if-sequence-number-eq", + serializedName: "x-ms-if-tags", + xmlName: "x-ms-if-tags", type: { - name: "Number" + name: "String" } } }; -var ifSequenceNumberLessThan = { - parameterPath: [ - "options", - "sequenceNumberAccessConditions", - "ifSequenceNumberLessThan" - ], +var deleteSnapshots = { + parameterPath: ["options", "deleteSnapshots"], mapper: { - serializedName: "x-ms-if-sequence-number-lt", + serializedName: "x-ms-delete-snapshots", + xmlName: "x-ms-delete-snapshots", type: { - name: "Number" + name: "Enum", + allowedValues: ["include", "only"] } } }; -var ifSequenceNumberLessThanOrEqualTo = { - parameterPath: [ - "options", - "sequenceNumberAccessConditions", - "ifSequenceNumberLessThanOrEqualTo" - ], +var blobDeleteType = { + parameterPath: ["options", "blobDeleteType"], mapper: { - serializedName: "x-ms-if-sequence-number-le", + serializedName: "deletetype", + xmlName: "deletetype", type: { - name: "Number" + name: "String" } } }; -var ifTags = { - parameterPath: [ - "options", - "modifiedAccessConditions", - "ifTags" - ], +var comp11 = { + parameterPath: "comp", mapper: { - serializedName: "x-ms-if-tags", + defaultValue: "expiry", + isConstant: true, + serializedName: "comp", type: { name: "String" } } }; -var ifUnmodifiedSince = { - parameterPath: [ - "options", - "modifiedAccessConditions", - "ifUnmodifiedSince" - ], +var expiryOptions = { + parameterPath: "expiryOptions", mapper: { - serializedName: "If-Unmodified-Since", + serializedName: "x-ms-expiry-option", + required: true, + xmlName: "x-ms-expiry-option", type: { - name: "DateTimeRfc1123" + name: "String" } } }; -var include0 = { - parameterPath: [ - "options", - "include" - ], - mapper: { - serializedName: "include", - type: { - name: "Sequence", - element: { - type: { - name: "Enum", - allowedValues: [ - "metadata", - "deleted" - ] - } - } - } - }, - collectionFormat: coreHttp.QueryCollectionFormat.Csv -}; -var include1 = { - parameterPath: [ - "options", - "include" - ], +var expiresOn = { + parameterPath: ["options", "expiresOn"], mapper: { - serializedName: "include", + serializedName: "x-ms-expiry-time", + xmlName: "x-ms-expiry-time", type: { - name: "Sequence", - element: { - type: { - name: "Enum", - allowedValues: [ - "copy", - "deleted", - "metadata", - "snapshots", - "uncommittedblobs", - "versions", - "tags" - ] - } - } + name: "String" } - }, - collectionFormat: coreHttp.QueryCollectionFormat.Csv + } }; -var leaseId0 = { - parameterPath: [ - "options", - "leaseAccessConditions", - "leaseId" - ], +var blobCacheControl = { + parameterPath: ["options", "blobHttpHeaders", "blobCacheControl"], mapper: { - serializedName: "x-ms-lease-id", + serializedName: "x-ms-blob-cache-control", + xmlName: "x-ms-blob-cache-control", type: { name: "String" } } }; -var leaseId1 = { - parameterPath: "leaseId", +var blobContentType = { + parameterPath: ["options", "blobHttpHeaders", "blobContentType"], mapper: { - required: true, - serializedName: "x-ms-lease-id", + serializedName: "x-ms-blob-content-type", + xmlName: "x-ms-blob-content-type", type: { name: "String" } } }; -var listType = { - parameterPath: "listType", +var blobContentMD5 = { + parameterPath: ["options", "blobHttpHeaders", "blobContentMD5"], mapper: { - required: true, - serializedName: "blocklisttype", - defaultValue: 'committed', + serializedName: "x-ms-blob-content-md5", + xmlName: "x-ms-blob-content-md5", type: { - name: "Enum", - allowedValues: [ - "committed", - "uncommitted", - "all" - ] + name: "ByteArray" } } }; -var marker0 = { - parameterPath: [ - "options", - "marker" - ], +var blobContentEncoding = { + parameterPath: ["options", "blobHttpHeaders", "blobContentEncoding"], mapper: { - serializedName: "marker", + serializedName: "x-ms-blob-content-encoding", + xmlName: "x-ms-blob-content-encoding", type: { name: "String" } } }; -var maxPageSize = { - parameterPath: [ - "options", - "maxPageSize" - ], +var blobContentLanguage = { + parameterPath: ["options", "blobHttpHeaders", "blobContentLanguage"], mapper: { - serializedName: "maxresults", - constraints: { - InclusiveMinimum: 1 - }, + serializedName: "x-ms-blob-content-language", + xmlName: "x-ms-blob-content-language", type: { - name: "Number" + name: "String" } } }; -var maxSize = { - parameterPath: [ - "options", - "appendPositionAccessConditions", - "maxSize" - ], +var blobContentDisposition = { + parameterPath: ["options", "blobHttpHeaders", "blobContentDisposition"], mapper: { - serializedName: "x-ms-blob-condition-maxsize", + serializedName: "x-ms-blob-content-disposition", + xmlName: "x-ms-blob-content-disposition", type: { - name: "Number" + name: "String" } } }; -var metadata = { - parameterPath: [ - "options", - "metadata" - ], +var encryptionScope = { + parameterPath: ["options", "encryptionScope"], mapper: { - serializedName: "x-ms-meta", + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } - }, - headerCollectionPrefix: "x-ms-meta-" + name: "String" + } } }; -var multipartContentType = { - parameterPath: "multipartContentType", +var comp12 = { + parameterPath: "comp", mapper: { - required: true, - serializedName: "Content-Type", + defaultValue: "snapshot", + isConstant: true, + serializedName: "comp", type: { name: "String" } } }; -var owner = { - parameterPath: [ - "options", - "owner" - ], +var tier = { + parameterPath: ["options", "tier"], mapper: { - serializedName: "x-ms-owner", + serializedName: "x-ms-access-tier", + xmlName: "x-ms-access-tier", type: { - name: "String" + name: "Enum", + allowedValues: [ + "P4", + "P6", + "P10", + "P15", + "P20", + "P30", + "P40", + "P50", + "P60", + "P70", + "P80", + "Hot", + "Cool", + "Archive" + ] } } }; -var pageWrite0 = { - parameterPath: "pageWrite", +var rehydratePriority = { + parameterPath: ["options", "rehydratePriority"], mapper: { - required: true, - isConstant: true, - serializedName: "x-ms-page-write", - defaultValue: 'update', + serializedName: "x-ms-rehydrate-priority", + xmlName: "x-ms-rehydrate-priority", type: { - name: "String" + name: "Enum", + allowedValues: ["High", "Standard"] } } }; -var pageWrite1 = { - parameterPath: "pageWrite", +var sourceIfTags = { + parameterPath: ["options", "sourceModifiedAccessConditions", "sourceIfTags"], mapper: { - required: true, - isConstant: true, - serializedName: "x-ms-page-write", - defaultValue: 'clear', + serializedName: "x-ms-source-if-tags", + xmlName: "x-ms-source-if-tags", type: { name: "String" } } }; -var pathRenameMode = { - parameterPath: [ - "options", - "pathRenameMode" - ], +var copySource = { + parameterPath: "copySource", mapper: { - serializedName: "mode", + serializedName: "x-ms-copy-source", + required: true, + xmlName: "x-ms-copy-source", type: { - name: "Enum", - allowedValues: [ - "legacy", - "posix" - ] + name: "String" } } }; -var posixAcl = { - parameterPath: [ - "options", - "posixAcl" - ], +var blobTagsString = { + parameterPath: ["options", "blobTagsString"], mapper: { - serializedName: "x-ms-acl", + serializedName: "x-ms-tags", + xmlName: "x-ms-tags", type: { name: "String" } } }; -var posixPermissions = { - parameterPath: [ - "options", - "posixPermissions" - ], +var sealBlob = { + parameterPath: ["options", "sealBlob"], mapper: { - serializedName: "x-ms-permissions", + serializedName: "x-ms-seal-blob", + xmlName: "x-ms-seal-blob", type: { - name: "String" + name: "Boolean" } } }; -var posixUmask = { - parameterPath: [ - "options", - "posixUmask" - ], +var xMsRequiresSync = { + parameterPath: "xMsRequiresSync", mapper: { - serializedName: "x-ms-umask", + defaultValue: "true", + isConstant: true, + serializedName: "x-ms-requires-sync", type: { name: "String" } } }; -var prefix = { - parameterPath: [ - "options", - "prefix" - ], +var sourceContentMD5 = { + parameterPath: ["options", "sourceContentMD5"], mapper: { - serializedName: "prefix", + serializedName: "x-ms-source-content-md5", + xmlName: "x-ms-source-content-md5", type: { - name: "String" + name: "ByteArray" } } }; -var preventEncryptionScopeOverride = { - parameterPath: [ - "options", - "containerEncryptionScope", - "preventEncryptionScopeOverride" - ], +var comp13 = { + parameterPath: "comp", mapper: { - serializedName: "x-ms-deny-encryption-scope-override", + defaultValue: "copy", + isConstant: true, + serializedName: "comp", type: { - name: "Boolean" + name: "String" } } }; -var prevsnapshot = { - parameterPath: [ - "options", - "prevsnapshot" - ], +var copyActionAbortConstant = { + parameterPath: "copyActionAbortConstant", mapper: { - serializedName: "prevsnapshot", + defaultValue: "abort", + isConstant: true, + serializedName: "x-ms-copy-action", type: { name: "String" } } }; -var prevSnapshotUrl = { - parameterPath: [ - "options", - "prevSnapshotUrl" - ], +var copyId = { + parameterPath: "copyId", mapper: { - serializedName: "x-ms-previous-snapshot-url", + serializedName: "copyid", + required: true, + xmlName: "copyid", type: { name: "String" } } }; -var proposedLeaseId0 = { - parameterPath: [ - "options", - "proposedLeaseId" - ], +var comp14 = { + parameterPath: "comp", mapper: { - serializedName: "x-ms-proposed-lease-id", + defaultValue: "tier", + isConstant: true, + serializedName: "comp", type: { name: "String" } } }; -var proposedLeaseId1 = { - parameterPath: "proposedLeaseId", +var tier1 = { + parameterPath: "tier", mapper: { + serializedName: "x-ms-access-tier", required: true, - serializedName: "x-ms-proposed-lease-id", + xmlName: "x-ms-access-tier", type: { - name: "String" + name: "Enum", + allowedValues: [ + "P4", + "P6", + "P10", + "P15", + "P20", + "P30", + "P40", + "P50", + "P60", + "P70", + "P80", + "Hot", + "Cool", + "Archive" + ] } } }; -var range0 = { - parameterPath: [ - "options", - "range" - ], +var queryRequest = { + parameterPath: ["options", "queryRequest"], + mapper: QueryRequest +}; +var comp15 = { + parameterPath: "comp", mapper: { - serializedName: "x-ms-range", + defaultValue: "query", + isConstant: true, + serializedName: "comp", type: { name: "String" } } }; -var range1 = { - parameterPath: "range", +var comp16 = { + parameterPath: "comp", mapper: { - required: true, - serializedName: "x-ms-range", + defaultValue: "tags", + isConstant: true, + serializedName: "comp", type: { name: "String" } } }; -var rangeGetContentCRC64 = { - parameterPath: [ - "options", - "rangeGetContentCRC64" - ], +var tags = { + parameterPath: ["options", "tags"], + mapper: BlobTags +}; +var transactionalContentMD5 = { + parameterPath: ["options", "transactionalContentMD5"], mapper: { - serializedName: "x-ms-range-get-content-crc64", + serializedName: "Content-MD5", + xmlName: "Content-MD5", type: { - name: "Boolean" + name: "ByteArray" } } }; -var rangeGetContentMD5 = { - parameterPath: [ - "options", - "rangeGetContentMD5" - ], +var transactionalContentCrc64 = { + parameterPath: ["options", "transactionalContentCrc64"], mapper: { - serializedName: "x-ms-range-get-content-md5", + serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { - name: "Boolean" + name: "ByteArray" } } }; -var rehydratePriority = { - parameterPath: [ - "options", - "rehydratePriority" - ], +var blobType = { + parameterPath: "blobType", mapper: { - serializedName: "x-ms-rehydrate-priority", + defaultValue: "PageBlob", + isConstant: true, + serializedName: "x-ms-blob-type", type: { name: "String" } } }; -var renameSource = { - parameterPath: "renameSource", +var blobContentLength = { + parameterPath: "blobContentLength", mapper: { + serializedName: "x-ms-blob-content-length", required: true, - serializedName: "x-ms-rename-source", + xmlName: "x-ms-blob-content-length", type: { - name: "String" + name: "Number" } } }; -var requestId = { - parameterPath: [ - "options", - "requestId" - ], +var blobSequenceNumber = { + parameterPath: ["options", "blobSequenceNumber"], mapper: { - serializedName: "x-ms-client-request-id", + serializedName: "x-ms-blob-sequence-number", + xmlName: "x-ms-blob-sequence-number", type: { - name: "String" + name: "Number" } } }; -var restype0 = { - parameterPath: "restype", +var contentType2 = { + parameterPath: ["options", "contentType"], mapper: { - required: true, + defaultValue: "application/octet-stream", isConstant: true, - serializedName: "restype", - defaultValue: 'service', + serializedName: "Content-Type", type: { name: "String" } } }; -var restype1 = { - parameterPath: "restype", +var body1 = { + parameterPath: "body", mapper: { + serializedName: "body", required: true, - isConstant: true, - serializedName: "restype", - defaultValue: 'account', + xmlName: "body", type: { - name: "String" + name: "Stream" } } }; -var restype2 = { - parameterPath: "restype", +var accept2 = { + parameterPath: "accept", mapper: { - required: true, + defaultValue: "application/xml", isConstant: true, - serializedName: "restype", - defaultValue: 'container', + serializedName: "Accept", type: { name: "String" } } }; -var sealBlob = { - parameterPath: [ - "options", - "sealBlob" - ], +var comp17 = { + parameterPath: "comp", mapper: { - serializedName: "x-ms-seal-blob", + defaultValue: "page", + isConstant: true, + serializedName: "comp", type: { - name: "Boolean" + name: "String" } } }; -var sequenceNumberAction = { - parameterPath: "sequenceNumberAction", +var pageWrite = { + parameterPath: "pageWrite", mapper: { - required: true, - serializedName: "x-ms-sequence-number-action", + defaultValue: "update", + isConstant: true, + serializedName: "x-ms-page-write", type: { - name: "Enum", - allowedValues: [ - "max", - "update", - "increment" - ] + name: "String" } } }; -var snapshot = { +var ifSequenceNumberLessThanOrEqualTo = { parameterPath: [ "options", - "snapshot" + "sequenceNumberAccessConditions", + "ifSequenceNumberLessThanOrEqualTo" ], mapper: { - serializedName: "snapshot", - type: { - name: "String" - } - } -}; -var sourceContainerName = { - parameterPath: "sourceContainerName", - mapper: { - required: true, - serializedName: "x-ms-source-container-name", + serializedName: "x-ms-if-sequence-number-le", + xmlName: "x-ms-if-sequence-number-le", type: { - name: "String" + name: "Number" } } }; -var sourceContentCrc64 = { +var ifSequenceNumberLessThan = { parameterPath: [ "options", - "sourceContentCrc64" + "sequenceNumberAccessConditions", + "ifSequenceNumberLessThan" ], mapper: { - serializedName: "x-ms-source-content-crc64", + serializedName: "x-ms-if-sequence-number-lt", + xmlName: "x-ms-if-sequence-number-lt", type: { - name: "ByteArray" + name: "Number" } } }; -var sourceContentMD5 = { +var ifSequenceNumberEqualTo = { parameterPath: [ "options", - "sourceContentMD5" + "sequenceNumberAccessConditions", + "ifSequenceNumberEqualTo" ], mapper: { - serializedName: "x-ms-source-content-md5", + serializedName: "x-ms-if-sequence-number-eq", + xmlName: "x-ms-if-sequence-number-eq", type: { - name: "ByteArray" + name: "Number" } } }; -var sourceIfMatch = { - parameterPath: [ - "options", - "sourceModifiedAccessConditions", - "sourceIfMatch" - ], +var pageWrite1 = { + parameterPath: "pageWrite", mapper: { - serializedName: "x-ms-source-if-match", + defaultValue: "clear", + isConstant: true, + serializedName: "x-ms-page-write", type: { name: "String" } } }; -var sourceIfModifiedSince = { - parameterPath: [ - "options", - "sourceModifiedAccessConditions", - "sourceIfModifiedSince" - ], +var sourceUrl = { + parameterPath: "sourceUrl", mapper: { - serializedName: "x-ms-source-if-modified-since", + serializedName: "x-ms-copy-source", + required: true, + xmlName: "x-ms-copy-source", type: { - name: "DateTimeRfc1123" + name: "String" } } }; -var sourceIfNoneMatch = { - parameterPath: [ - "options", - "sourceModifiedAccessConditions", - "sourceIfNoneMatch" - ], +var sourceRange = { + parameterPath: "sourceRange", mapper: { - serializedName: "x-ms-source-if-none-match", + serializedName: "x-ms-source-range", + required: true, + xmlName: "x-ms-source-range", type: { name: "String" } } }; -var sourceIfTags = { - parameterPath: [ - "options", - "sourceModifiedAccessConditions", - "sourceIfTags" - ], +var sourceContentCrc64 = { + parameterPath: ["options", "sourceContentCrc64"], mapper: { - serializedName: "x-ms-source-if-tags", + serializedName: "x-ms-source-content-crc64", + xmlName: "x-ms-source-content-crc64", type: { - name: "String" + name: "ByteArray" } } }; -var sourceIfUnmodifiedSince = { - parameterPath: [ - "options", - "sourceModifiedAccessConditions", - "sourceIfUnmodifiedSince" - ], +var range1 = { + parameterPath: "range", mapper: { - serializedName: "x-ms-source-if-unmodified-since", + serializedName: "x-ms-range", + required: true, + xmlName: "x-ms-range", type: { - name: "DateTimeRfc1123" + name: "String" } } }; -var sourceLeaseId = { - parameterPath: [ - "options", - "sourceLeaseId" - ], +var comp18 = { + parameterPath: "comp", mapper: { - serializedName: "x-ms-source-lease-id", + defaultValue: "pagelist", + isConstant: true, + serializedName: "comp", type: { name: "String" } } }; -var sourceRange0 = { - parameterPath: "sourceRange", +var prevsnapshot = { + parameterPath: ["options", "prevsnapshot"], mapper: { - required: true, - serializedName: "x-ms-source-range", + serializedName: "prevsnapshot", + xmlName: "prevsnapshot", type: { name: "String" } } }; -var sourceRange1 = { - parameterPath: [ - "options", - "sourceRange" - ], +var prevSnapshotUrl = { + parameterPath: ["options", "prevSnapshotUrl"], mapper: { - serializedName: "x-ms-source-range", + serializedName: "x-ms-previous-snapshot-url", + xmlName: "x-ms-previous-snapshot-url", type: { name: "String" } } }; -var sourceUrl = { - parameterPath: "sourceUrl", +var sequenceNumberAction = { + parameterPath: "sequenceNumberAction", mapper: { + serializedName: "x-ms-sequence-number-action", required: true, - serializedName: "x-ms-copy-source", + xmlName: "x-ms-sequence-number-action", + type: { + name: "Enum", + allowedValues: ["max", "update", "increment"] + } + } +}; +var comp19 = { + parameterPath: "comp", + mapper: { + defaultValue: "incrementalcopy", + isConstant: true, + serializedName: "comp", type: { name: "String" } } }; -var tier0 = { - parameterPath: [ - "options", - "tier" - ], +var blobType1 = { + parameterPath: "blobType", mapper: { - serializedName: "x-ms-access-tier", + defaultValue: "AppendBlob", + isConstant: true, + serializedName: "x-ms-blob-type", type: { name: "String" } } }; -var tier1 = { - parameterPath: "tier", +var comp20 = { + parameterPath: "comp", mapper: { - required: true, - serializedName: "x-ms-access-tier", + defaultValue: "appendblock", + isConstant: true, + serializedName: "comp", type: { name: "String" } } }; -var timeoutInSeconds = { - parameterPath: [ - "options", - "timeoutInSeconds" - ], +var maxSize = { + parameterPath: ["options", "appendPositionAccessConditions", "maxSize"], mapper: { - serializedName: "timeout", - constraints: { - InclusiveMinimum: 0 - }, + serializedName: "x-ms-blob-condition-maxsize", + xmlName: "x-ms-blob-condition-maxsize", type: { name: "Number" } } }; -var transactionalContentCrc64 = { +var appendPosition = { parameterPath: [ "options", - "transactionalContentCrc64" + "appendPositionAccessConditions", + "appendPosition" ], mapper: { - serializedName: "x-ms-content-crc64", + serializedName: "x-ms-blob-condition-appendpos", + xmlName: "x-ms-blob-condition-appendpos", type: { - name: "ByteArray" + name: "Number" } } }; -var transactionalContentMD5 = { - parameterPath: [ - "options", - "transactionalContentMD5" - ], +var sourceRange1 = { + parameterPath: ["options", "sourceRange"], mapper: { - serializedName: "Content-MD5", + serializedName: "x-ms-source-range", + xmlName: "x-ms-source-range", type: { - name: "ByteArray" + name: "String" } } }; -var upn = { - parameterPath: [ - "options", - "upn" - ], +var comp21 = { + parameterPath: "comp", mapper: { - serializedName: "upn", + defaultValue: "seal", + isConstant: true, + serializedName: "comp", type: { - name: "Boolean" + name: "String" } } }; -var url = { - parameterPath: "url", +var blobType2 = { + parameterPath: "blobType", mapper: { - required: true, - serializedName: "url", - defaultValue: '', + defaultValue: "BlockBlob", + isConstant: true, + serializedName: "x-ms-blob-type", type: { name: "String" } - }, - skipEncoding: true + } }; -var version = { - parameterPath: "version", +var copySourceBlobProperties = { + parameterPath: ["options", "copySourceBlobProperties"], mapper: { - required: true, + serializedName: "x-ms-copy-source-blob-properties", + xmlName: "x-ms-copy-source-blob-properties", + type: { + name: "Boolean" + } + } +}; +var comp22 = { + parameterPath: "comp", + mapper: { + defaultValue: "block", isConstant: true, - serializedName: "x-ms-version", - defaultValue: '2020-06-12', + serializedName: "comp", type: { name: "String" } } }; -var versionId = { - parameterPath: [ - "options", - "versionId" - ], +var blockId = { + parameterPath: "blockId", mapper: { - serializedName: "versionid", + serializedName: "blockid", + required: true, + xmlName: "blockid", type: { name: "String" } } }; -var where = { - parameterPath: [ - "options", - "where" - ], +var blocks = { + parameterPath: "blocks", + mapper: BlockLookupList +}; +var comp23 = { + parameterPath: "comp", mapper: { - serializedName: "where", + defaultValue: "blocklist", + isConstant: true, + serializedName: "comp", type: { name: "String" } } }; -var xMsRequiresSync = { - parameterPath: "xMsRequiresSync", +var listType = { + parameterPath: "listType", mapper: { + defaultValue: "committed", + serializedName: "blocklisttype", required: true, - isConstant: true, - serializedName: "x-ms-requires-sync", - defaultValue: 'true', + xmlName: "blocklisttype", type: { - name: "String" + name: "Enum", + allowedValues: ["committed", "uncommitted", "all"] } } }; /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ /** Class representing a Service. */ var Service = /** @class */ (function () { /** - * Create a Service. - * @param {StorageClientContext} client Reference to the service client. + * Initialize a new instance of the class Service class. + * @param client Reference to the service client */ function Service(client) { this.client = client; } - Service.prototype.setProperties = function (blobServiceProperties, options, callback) { - return this.client.sendOperationRequest({ + /** + * Sets properties for a storage account's Blob service endpoint, including properties for Storage + * Analytics and CORS (Cross-Origin Resource Sharing) rules + * @param blobServiceProperties The StorageService properties. + * @param options The options parameters. + */ + Service.prototype.setProperties = function (blobServiceProperties, options) { + var operationArguments = { blobServiceProperties: blobServiceProperties, - options: options - }, setPropertiesOperationSpec, callback); - }; - Service.prototype.getProperties = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, getPropertiesOperationSpec, callback); - }; - Service.prototype.getStatistics = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, getStatisticsOperationSpec, callback); - }; - Service.prototype.listContainersSegment = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, listContainersSegmentOperationSpec, callback); - }; - Service.prototype.getUserDelegationKey = function (keyInfo, options, callback) { - return this.client.sendOperationRequest({ + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, setPropertiesOperationSpec); + }; + /** + * gets the properties of a storage account's Blob service, including properties for Storage Analytics + * and CORS (Cross-Origin Resource Sharing) rules. + * @param options The options parameters. + */ + Service.prototype.getProperties = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, getPropertiesOperationSpec); + }; + /** + * Retrieves statistics related to replication for the Blob service. It is only available on the + * secondary location endpoint when read-access geo-redundant replication is enabled for the storage + * account. + * @param options The options parameters. + */ + Service.prototype.getStatistics = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, getStatisticsOperationSpec); + }; + /** + * The List Containers Segment operation returns a list of the containers under the specified account + * @param options The options parameters. + */ + Service.prototype.listContainersSegment = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, listContainersSegmentOperationSpec); + }; + /** + * Retrieves a user delegation key for the Blob service. This is only a valid operation when using + * bearer token authentication. + * @param keyInfo Key information + * @param options The options parameters. + */ + Service.prototype.getUserDelegationKey = function (keyInfo, options) { + var operationArguments = { keyInfo: keyInfo, - options: options - }, getUserDelegationKeyOperationSpec, callback); + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, getUserDelegationKeyOperationSpec); }; - Service.prototype.getAccountInfo = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, getAccountInfoOperationSpec, callback); + /** + * Returns the sku name and account kind + * @param options The options parameters. + */ + Service.prototype.getAccountInfo = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, getAccountInfoOperationSpec); }; - Service.prototype.submitBatch = function (body, contentLength, multipartContentType, options, callback) { - return this.client.sendOperationRequest({ - body: body, + /** + * The Batch operation allows multiple API calls to be embedded into a single HTTP request. + * @param contentLength The length of the request. + * @param multipartContentType Required. The value of this header must be multipart/mixed with a batch + * boundary. Example header value: multipart/mixed; boundary=batch_ + * @param body Initial data + * @param options The options parameters. + */ + Service.prototype.submitBatch = function (contentLength, multipartContentType, body, options) { + var operationArguments = { contentLength: contentLength, multipartContentType: multipartContentType, - options: options - }, submitBatchOperationSpec, callback); + body: body, + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, submitBatchOperationSpec); }; - Service.prototype.filterBlobs = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, filterBlobsOperationSpec, callback); + /** + * The Filter Blobs operation enables callers to list blobs across all containers whose tags match a + * given search expression. Filter blobs searches across all containers within a storage account but + * can be scoped within the expression to a single container. + * @param options The options parameters. + */ + Service.prototype.filterBlobs = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, filterBlobsOperationSpec); }; return Service; }()); // Operation Specifications -var serializer = new coreHttp.Serializer(Mappers, true); +var xmlSerializer = new coreHttp.Serializer(Mappers, /* isXml */ true); var setPropertiesOperationSpec = { + path: "/", httpMethod: "PUT", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds, - restype0, - comp0 - ], - headerParameters: [ - version, - requestId - ], - requestBody: { - parameterPath: "blobServiceProperties", - mapper: tslib.__assign(tslib.__assign({}, BlobServiceProperties), { required: true }) - }, - contentType: "application/xml; charset=utf-8", responses: { 202: { headersMapper: ServiceSetPropertiesHeaders }, default: { bodyMapper: StorageError, - headersMapper: ServiceSetPropertiesHeaders + headersMapper: ServiceSetPropertiesExceptionHeaders } }, - isXML: true, - serializer: serializer -}; -var getPropertiesOperationSpec = { - httpMethod: "GET", - urlParameters: [ - url - ], + requestBody: blobServiceProperties, queryParameters: [ - timeoutInSeconds, - restype0, - comp0 + restype, + comp, + timeoutInSeconds ], + urlParameters: [url], headerParameters: [ + contentType, + accept, version, requestId ], + isXML: true, + contentType: "application/xml; charset=utf-8", + mediaType: "xml", + serializer: xmlSerializer +}; +var getPropertiesOperationSpec = { + path: "/", + httpMethod: "GET", responses: { 200: { bodyMapper: BlobServiceProperties, @@ -28554,26 +28971,26 @@ var getPropertiesOperationSpec = { }, default: { bodyMapper: StorageError, - headersMapper: ServiceGetPropertiesHeaders + headersMapper: ServiceGetPropertiesExceptionHeaders } }, - isXML: true, - serializer: serializer -}; -var getStatisticsOperationSpec = { - httpMethod: "GET", - urlParameters: [ - url - ], queryParameters: [ - timeoutInSeconds, - restype0, - comp1 + restype, + comp, + timeoutInSeconds ], + urlParameters: [url], headerParameters: [ version, - requestId + requestId, + accept1 ], + isXML: true, + serializer: xmlSerializer +}; +var getStatisticsOperationSpec = { + path: "/", + httpMethod: "GET", responses: { 200: { bodyMapper: BlobServiceStatistics, @@ -28581,29 +28998,26 @@ var getStatisticsOperationSpec = { }, default: { bodyMapper: StorageError, - headersMapper: ServiceGetStatisticsHeaders + headersMapper: ServiceGetStatisticsExceptionHeaders } }, - isXML: true, - serializer: serializer -}; -var listContainersSegmentOperationSpec = { - httpMethod: "GET", - urlParameters: [ - url - ], queryParameters: [ - prefix, - marker0, - maxPageSize, - include0, + restype, timeoutInSeconds, - comp2 + comp1 ], + urlParameters: [url], headerParameters: [ version, - requestId + requestId, + accept1 ], + isXML: true, + serializer: xmlSerializer +}; +var listContainersSegmentOperationSpec = { + path: "/", + httpMethod: "GET", responses: { 200: { bodyMapper: ListContainersSegmentResponse, @@ -28611,31 +29025,29 @@ var listContainersSegmentOperationSpec = { }, default: { bodyMapper: StorageError, - headersMapper: ServiceListContainersSegmentHeaders + headersMapper: ServiceListContainersSegmentExceptionHeaders } }, - isXML: true, - serializer: serializer -}; -var getUserDelegationKeyOperationSpec = { - httpMethod: "POST", - urlParameters: [ - url - ], queryParameters: [ timeoutInSeconds, - restype0, - comp3 + comp2, + prefix, + marker, + maxPageSize, + include ], + urlParameters: [url], headerParameters: [ version, - requestId + requestId, + accept1 ], - requestBody: { - parameterPath: "keyInfo", - mapper: tslib.__assign(tslib.__assign({}, KeyInfo), { required: true }) - }, - contentType: "application/xml; charset=utf-8", + isXML: true, + serializer: xmlSerializer +}; +var getUserDelegationKeyOperationSpec = { + path: "/", + httpMethod: "POST", responses: { 200: { bodyMapper: UserDelegationKey, @@ -28643,96 +29055,80 @@ var getUserDelegationKeyOperationSpec = { }, default: { bodyMapper: StorageError, - headersMapper: ServiceGetUserDelegationKeyHeaders + headersMapper: ServiceGetUserDelegationKeyExceptionHeaders } }, - isXML: true, - serializer: serializer -}; -var getAccountInfoOperationSpec = { - httpMethod: "GET", - urlParameters: [ - url - ], + requestBody: keyInfo, queryParameters: [ - restype1, - comp0 + restype, + timeoutInSeconds, + comp3 ], + urlParameters: [url], headerParameters: [ - version + contentType, + accept, + version, + requestId ], + isXML: true, + contentType: "application/xml; charset=utf-8", + mediaType: "xml", + serializer: xmlSerializer +}; +var getAccountInfoOperationSpec = { + path: "/", + httpMethod: "GET", responses: { 200: { headersMapper: ServiceGetAccountInfoHeaders }, default: { bodyMapper: StorageError, - headersMapper: ServiceGetAccountInfoHeaders + headersMapper: ServiceGetAccountInfoExceptionHeaders } }, + queryParameters: [comp, restype1], + urlParameters: [url], + headerParameters: [version, accept1], isXML: true, - serializer: serializer + serializer: xmlSerializer }; var submitBatchOperationSpec = { + path: "/", httpMethod: "POST", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds, - comp4 - ], - headerParameters: [ - contentLength, - multipartContentType, - version, - requestId - ], - requestBody: { - parameterPath: "body", - mapper: { - required: true, - serializedName: "body", - type: { - name: "Stream" - } - } - }, - contentType: "application/xml; charset=utf-8", responses: { 202: { bodyMapper: { - serializedName: "parsedResponse", - type: { - name: "Stream" - } + type: { name: "Stream" }, + serializedName: "parsedResponse" }, headersMapper: ServiceSubmitBatchHeaders }, default: { bodyMapper: StorageError, - headersMapper: ServiceSubmitBatchHeaders + headersMapper: ServiceSubmitBatchExceptionHeaders } }, + requestBody: body, + queryParameters: [timeoutInSeconds, comp4], + urlParameters: [url], + headerParameters: [ + contentType, + accept, + version, + requestId, + contentLength, + multipartContentType + ], isXML: true, - serializer: serializer + contentType: "application/xml; charset=utf-8", + mediaType: "xml", + serializer: xmlSerializer }; var filterBlobsOperationSpec = { + path: "/", httpMethod: "GET", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds, - where, - marker0, - maxPageSize, - comp5 - ], - headerParameters: [ - version, - requestId - ], responses: { 200: { bodyMapper: FilterBlobSegment, @@ -28740,659 +29136,673 @@ var filterBlobsOperationSpec = { }, default: { bodyMapper: StorageError, - headersMapper: ServiceFilterBlobsHeaders + headersMapper: ServiceFilterBlobsExceptionHeaders } }, + queryParameters: [ + timeoutInSeconds, + marker, + maxPageSize, + comp5, + where + ], + urlParameters: [url], + headerParameters: [ + version, + requestId, + accept1 + ], isXML: true, - serializer: serializer + serializer: xmlSerializer }; /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ - -var Mappers$1 = /*#__PURE__*/Object.freeze({ - __proto__: null, - AccessPolicy: AccessPolicy, - BlobFlatListSegment: BlobFlatListSegment, - BlobHierarchyListSegment: BlobHierarchyListSegment, - BlobItemInternal: BlobItemInternal, - BlobPrefix: BlobPrefix, - BlobPropertiesInternal: BlobPropertiesInternal, - BlobTag: BlobTag, - BlobTags: BlobTags, - ContainerAcquireLeaseHeaders: ContainerAcquireLeaseHeaders, - ContainerBreakLeaseHeaders: ContainerBreakLeaseHeaders, - ContainerChangeLeaseHeaders: ContainerChangeLeaseHeaders, - ContainerCreateHeaders: ContainerCreateHeaders, - ContainerDeleteHeaders: ContainerDeleteHeaders, - ContainerGetAccessPolicyHeaders: ContainerGetAccessPolicyHeaders, - ContainerGetAccountInfoHeaders: ContainerGetAccountInfoHeaders, - ContainerGetPropertiesHeaders: ContainerGetPropertiesHeaders, - ContainerListBlobFlatSegmentHeaders: ContainerListBlobFlatSegmentHeaders, - ContainerListBlobHierarchySegmentHeaders: ContainerListBlobHierarchySegmentHeaders, - ContainerReleaseLeaseHeaders: ContainerReleaseLeaseHeaders, - ContainerRenameHeaders: ContainerRenameHeaders, - ContainerRenewLeaseHeaders: ContainerRenewLeaseHeaders, - ContainerRestoreHeaders: ContainerRestoreHeaders, - ContainerSetAccessPolicyHeaders: ContainerSetAccessPolicyHeaders, - ContainerSetMetadataHeaders: ContainerSetMetadataHeaders, - ContainerSubmitBatchHeaders: ContainerSubmitBatchHeaders, - ListBlobsFlatSegmentResponse: ListBlobsFlatSegmentResponse, - ListBlobsHierarchySegmentResponse: ListBlobsHierarchySegmentResponse, - SignedIdentifier: SignedIdentifier, - StorageError: StorageError -}); - -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ /** Class representing a Container. */ var Container = /** @class */ (function () { /** - * Create a Container. - * @param {StorageClientContext} client Reference to the service client. + * Initialize a new instance of the class Container class. + * @param client Reference to the service client */ function Container(client) { this.client = client; } - Container.prototype.create = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, createOperationSpec, callback); - }; - Container.prototype.getProperties = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, getPropertiesOperationSpec$1, callback); - }; - Container.prototype.deleteMethod = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, deleteMethodOperationSpec, callback); - }; - Container.prototype.setMetadata = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, setMetadataOperationSpec, callback); - }; - Container.prototype.getAccessPolicy = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, getAccessPolicyOperationSpec, callback); - }; - Container.prototype.setAccessPolicy = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, setAccessPolicyOperationSpec, callback); - }; - Container.prototype.restore = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, restoreOperationSpec, callback); - }; - Container.prototype.rename = function (sourceContainerName, options, callback) { - return this.client.sendOperationRequest({ + /** + * creates a new container under the specified account. If the container with the same name already + * exists, the operation fails + * @param options The options parameters. + */ + Container.prototype.create = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, createOperationSpec); + }; + /** + * returns all user-defined metadata and system properties for the specified container. The data + * returned does not include the container's list of blobs + * @param options The options parameters. + */ + Container.prototype.getProperties = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, getPropertiesOperationSpec$1); + }; + /** + * operation marks the specified container for deletion. The container and any blobs contained within + * it are later deleted during garbage collection + * @param options The options parameters. + */ + Container.prototype.delete = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, deleteOperationSpec); + }; + /** + * operation sets one or more user-defined name-value pairs for the specified container. + * @param options The options parameters. + */ + Container.prototype.setMetadata = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, setMetadataOperationSpec); + }; + /** + * gets the permissions for the specified container. The permissions indicate whether container data + * may be accessed publicly. + * @param options The options parameters. + */ + Container.prototype.getAccessPolicy = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, getAccessPolicyOperationSpec); + }; + /** + * sets the permissions for the specified container. The permissions indicate whether blobs in a + * container may be accessed publicly. + * @param options The options parameters. + */ + Container.prototype.setAccessPolicy = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, setAccessPolicyOperationSpec); + }; + /** + * Restores a previously-deleted container. + * @param options The options parameters. + */ + Container.prototype.restore = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, restoreOperationSpec); + }; + /** + * Renames an existing container. + * @param sourceContainerName Required. Specifies the name of the container to rename. + * @param options The options parameters. + */ + Container.prototype.rename = function (sourceContainerName, options) { + var operationArguments = { sourceContainerName: sourceContainerName, - options: options - }, renameOperationSpec, callback); + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, renameOperationSpec); }; - Container.prototype.submitBatch = function (body, contentLength, multipartContentType, options, callback) { - return this.client.sendOperationRequest({ - body: body, + /** + * The Batch operation allows multiple API calls to be embedded into a single HTTP request. + * @param contentLength The length of the request. + * @param multipartContentType Required. The value of this header must be multipart/mixed with a batch + * boundary. Example header value: multipart/mixed; boundary=batch_ + * @param body Initial data + * @param options The options parameters. + */ + Container.prototype.submitBatch = function (contentLength, multipartContentType, body, options) { + var operationArguments = { contentLength: contentLength, multipartContentType: multipartContentType, - options: options - }, submitBatchOperationSpec$1, callback); + body: body, + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, submitBatchOperationSpec$1); }; - Container.prototype.acquireLease = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, acquireLeaseOperationSpec, callback); + /** + * [Update] establishes and manages a lock on a container for delete operations. The lock duration can + * be 15 to 60 seconds, or can be infinite + * @param options The options parameters. + */ + Container.prototype.acquireLease = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, acquireLeaseOperationSpec); }; - Container.prototype.releaseLease = function (leaseId, options, callback) { - return this.client.sendOperationRequest({ + /** + * [Update] establishes and manages a lock on a container for delete operations. The lock duration can + * be 15 to 60 seconds, or can be infinite + * @param leaseId Specifies the current lease ID on the resource. + * @param options The options parameters. + */ + Container.prototype.releaseLease = function (leaseId, options) { + var operationArguments = { leaseId: leaseId, - options: options - }, releaseLeaseOperationSpec, callback); + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, releaseLeaseOperationSpec); }; - Container.prototype.renewLease = function (leaseId, options, callback) { - return this.client.sendOperationRequest({ + /** + * [Update] establishes and manages a lock on a container for delete operations. The lock duration can + * be 15 to 60 seconds, or can be infinite + * @param leaseId Specifies the current lease ID on the resource. + * @param options The options parameters. + */ + Container.prototype.renewLease = function (leaseId, options) { + var operationArguments = { leaseId: leaseId, - options: options - }, renewLeaseOperationSpec, callback); + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, renewLeaseOperationSpec); }; - Container.prototype.breakLease = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, breakLeaseOperationSpec, callback); + /** + * [Update] establishes and manages a lock on a container for delete operations. The lock duration can + * be 15 to 60 seconds, or can be infinite + * @param options The options parameters. + */ + Container.prototype.breakLease = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, breakLeaseOperationSpec); }; - Container.prototype.changeLease = function (leaseId, proposedLeaseId, options, callback) { - return this.client.sendOperationRequest({ + /** + * [Update] establishes and manages a lock on a container for delete operations. The lock duration can + * be 15 to 60 seconds, or can be infinite + * @param leaseId Specifies the current lease ID on the resource. + * @param proposedLeaseId Proposed lease ID, in a GUID string format. The Blob service returns 400 + * (Invalid request) if the proposed lease ID is not in the correct format. See Guid Constructor + * (String) for a list of valid GUID string formats. + * @param options The options parameters. + */ + Container.prototype.changeLease = function (leaseId, proposedLeaseId, options) { + var operationArguments = { leaseId: leaseId, proposedLeaseId: proposedLeaseId, - options: options - }, changeLeaseOperationSpec, callback); + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, changeLeaseOperationSpec); }; - Container.prototype.listBlobFlatSegment = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, listBlobFlatSegmentOperationSpec, callback); + /** + * [Update] The List Blobs operation returns a list of the blobs under the specified container + * @param options The options parameters. + */ + Container.prototype.listBlobFlatSegment = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, listBlobFlatSegmentOperationSpec); }; - Container.prototype.listBlobHierarchySegment = function (delimiter, options, callback) { - return this.client.sendOperationRequest({ + /** + * [Update] The List Blobs operation returns a list of the blobs under the specified container + * @param delimiter When the request includes this parameter, the operation returns a BlobPrefix + * element in the response body that acts as a placeholder for all blobs whose names begin with the + * same substring up to the appearance of the delimiter character. The delimiter may be a single + * character or a string. + * @param options The options parameters. + */ + Container.prototype.listBlobHierarchySegment = function (delimiter, options) { + var operationArguments = { delimiter: delimiter, - options: options - }, listBlobHierarchySegmentOperationSpec, callback); + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, listBlobHierarchySegmentOperationSpec); }; - Container.prototype.getAccountInfo = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, getAccountInfoOperationSpec$1, callback); + /** + * Returns the sku name and account kind + * @param options The options parameters. + */ + Container.prototype.getAccountInfo = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, getAccountInfoOperationSpec$1); }; return Container; }()); // Operation Specifications -var serializer$1 = new coreHttp.Serializer(Mappers$1, true); +var xmlSerializer$1 = new coreHttp.Serializer(Mappers, /* isXml */ true); var createOperationSpec = { + path: "/{containerName}", httpMethod: "PUT", - path: "{containerName}", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds, - restype2 - ], - headerParameters: [ - metadata, - access, - version, - requestId, - defaultEncryptionScope, - preventEncryptionScopeOverride - ], responses: { 201: { headersMapper: ContainerCreateHeaders }, default: { bodyMapper: StorageError, - headersMapper: ContainerCreateHeaders + headersMapper: ContainerCreateExceptionHeaders } }, - isXML: true, - serializer: serializer$1 -}; -var getPropertiesOperationSpec$1 = { - httpMethod: "GET", - path: "{containerName}", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds, - restype2 - ], + queryParameters: [timeoutInSeconds, restype2], + urlParameters: [url], headerParameters: [ version, requestId, - leaseId0 + accept1, + metadata, + access, + defaultEncryptionScope, + preventEncryptionScopeOverride ], + isXML: true, + serializer: xmlSerializer$1 +}; +var getPropertiesOperationSpec$1 = { + path: "/{containerName}", + httpMethod: "GET", responses: { 200: { headersMapper: ContainerGetPropertiesHeaders }, default: { bodyMapper: StorageError, - headersMapper: ContainerGetPropertiesHeaders + headersMapper: ContainerGetPropertiesExceptionHeaders } }, - isXML: true, - serializer: serializer$1 -}; -var deleteMethodOperationSpec = { - httpMethod: "DELETE", - path: "{containerName}", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds, - restype2 - ], + queryParameters: [timeoutInSeconds, restype2], + urlParameters: [url], headerParameters: [ version, requestId, - leaseId0, - ifModifiedSince, - ifUnmodifiedSince + accept1, + leaseId ], + isXML: true, + serializer: xmlSerializer$1 +}; +var deleteOperationSpec = { + path: "/{containerName}", + httpMethod: "DELETE", responses: { 202: { headersMapper: ContainerDeleteHeaders }, default: { bodyMapper: StorageError, - headersMapper: ContainerDeleteHeaders + headersMapper: ContainerDeleteExceptionHeaders } }, - isXML: true, - serializer: serializer$1 -}; -var setMetadataOperationSpec = { - httpMethod: "PUT", - path: "{containerName}", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds, - restype2, - comp6 - ], + queryParameters: [timeoutInSeconds, restype2], + urlParameters: [url], headerParameters: [ - metadata, version, requestId, - leaseId0, - ifModifiedSince + accept1, + leaseId, + ifModifiedSince, + ifUnmodifiedSince ], + isXML: true, + serializer: xmlSerializer$1 +}; +var setMetadataOperationSpec = { + path: "/{containerName}", + httpMethod: "PUT", responses: { 200: { headersMapper: ContainerSetMetadataHeaders }, default: { bodyMapper: StorageError, - headersMapper: ContainerSetMetadataHeaders + headersMapper: ContainerSetMetadataExceptionHeaders } }, - isXML: true, - serializer: serializer$1 -}; -var getAccessPolicyOperationSpec = { - httpMethod: "GET", - path: "{containerName}", - urlParameters: [ - url - ], queryParameters: [ timeoutInSeconds, restype2, - comp7 + comp6 ], + urlParameters: [url], headerParameters: [ version, requestId, - leaseId0 + accept1, + metadata, + leaseId, + ifModifiedSince ], + isXML: true, + serializer: xmlSerializer$1 +}; +var getAccessPolicyOperationSpec = { + path: "/{containerName}", + httpMethod: "GET", responses: { 200: { bodyMapper: { - xmlElementName: "SignedIdentifier", - serializedName: "parsedResponse", type: { name: "Sequence", element: { - type: { - name: "Composite", - className: "SignedIdentifier" - } + type: { name: "Composite", className: "SignedIdentifier" } } - } + }, + serializedName: "SignedIdentifiers", + xmlName: "SignedIdentifiers", + xmlIsWrapped: true, + xmlElementName: "SignedIdentifier" }, headersMapper: ContainerGetAccessPolicyHeaders }, default: { bodyMapper: StorageError, - headersMapper: ContainerGetAccessPolicyHeaders + headersMapper: ContainerGetAccessPolicyExceptionHeaders } }, - isXML: true, - serializer: serializer$1 -}; -var setAccessPolicyOperationSpec = { - httpMethod: "PUT", - path: "{containerName}", - urlParameters: [ - url - ], queryParameters: [ timeoutInSeconds, restype2, comp7 ], + urlParameters: [url], headerParameters: [ - access, version, requestId, - leaseId0, - ifModifiedSince, - ifUnmodifiedSince + accept1, + leaseId ], - requestBody: { - parameterPath: [ - "options", - "containerAcl" - ], - mapper: { - xmlName: "SignedIdentifiers", - xmlElementName: "SignedIdentifier", - serializedName: "containerAcl", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SignedIdentifier" - } - } - } - } - }, - contentType: "application/xml; charset=utf-8", + isXML: true, + serializer: xmlSerializer$1 +}; +var setAccessPolicyOperationSpec = { + path: "/{containerName}", + httpMethod: "PUT", responses: { 200: { headersMapper: ContainerSetAccessPolicyHeaders }, default: { bodyMapper: StorageError, - headersMapper: ContainerSetAccessPolicyHeaders + headersMapper: ContainerSetAccessPolicyExceptionHeaders } }, - isXML: true, - serializer: serializer$1 -}; -var restoreOperationSpec = { - httpMethod: "PUT", - path: "{containerName}", - urlParameters: [ - url - ], + requestBody: containerAcl, queryParameters: [ timeoutInSeconds, restype2, - comp8 + comp7 ], + urlParameters: [url], headerParameters: [ + contentType, + accept, version, requestId, - deletedContainerName, - deletedContainerVersion + access, + leaseId, + ifModifiedSince, + ifUnmodifiedSince ], + isXML: true, + contentType: "application/xml; charset=utf-8", + mediaType: "xml", + serializer: xmlSerializer$1 +}; +var restoreOperationSpec = { + path: "/{containerName}", + httpMethod: "PUT", responses: { 201: { headersMapper: ContainerRestoreHeaders }, default: { bodyMapper: StorageError, - headersMapper: ContainerRestoreHeaders + headersMapper: ContainerRestoreExceptionHeaders } }, - isXML: true, - serializer: serializer$1 -}; -var renameOperationSpec = { - httpMethod: "PUT", - path: "{containerName}", - urlParameters: [ - url - ], queryParameters: [ timeoutInSeconds, restype2, - comp9 + comp8 ], + urlParameters: [url], headerParameters: [ version, requestId, - sourceContainerName, - sourceLeaseId + accept1, + deletedContainerName, + deletedContainerVersion ], + isXML: true, + serializer: xmlSerializer$1 +}; +var renameOperationSpec = { + path: "/{containerName}", + httpMethod: "PUT", responses: { 200: { headersMapper: ContainerRenameHeaders }, default: { bodyMapper: StorageError, - headersMapper: ContainerRenameHeaders + headersMapper: ContainerRenameExceptionHeaders } }, - isXML: true, - serializer: serializer$1 -}; -var submitBatchOperationSpec$1 = { - httpMethod: "POST", - path: "{containerName}", - urlParameters: [ - url - ], queryParameters: [ timeoutInSeconds, restype2, - comp4 + comp9 ], + urlParameters: [url], headerParameters: [ - contentLength, - multipartContentType, version, - requestId + requestId, + accept1, + sourceContainerName, + sourceLeaseId ], - requestBody: { - parameterPath: "body", - mapper: { - required: true, - serializedName: "body", - type: { - name: "Stream" - } - } - }, - contentType: "application/xml; charset=utf-8", + isXML: true, + serializer: xmlSerializer$1 +}; +var submitBatchOperationSpec$1 = { + path: "/{containerName}", + httpMethod: "POST", responses: { 202: { bodyMapper: { - serializedName: "parsedResponse", - type: { - name: "Stream" - } + type: { name: "Stream" }, + serializedName: "parsedResponse" }, headersMapper: ContainerSubmitBatchHeaders }, default: { bodyMapper: StorageError, - headersMapper: ContainerSubmitBatchHeaders + headersMapper: ContainerSubmitBatchExceptionHeaders } }, - isXML: true, - serializer: serializer$1 -}; -var acquireLeaseOperationSpec = { - httpMethod: "PUT", - path: "{containerName}", - urlParameters: [ - url - ], + requestBody: body, queryParameters: [ timeoutInSeconds, - comp10, + comp4, restype2 ], + urlParameters: [url], headerParameters: [ - duration, - proposedLeaseId0, + contentType, + accept, version, requestId, - action0, - ifModifiedSince, - ifUnmodifiedSince + contentLength, + multipartContentType ], + isXML: true, + contentType: "application/xml; charset=utf-8", + mediaType: "xml", + serializer: xmlSerializer$1 +}; +var acquireLeaseOperationSpec = { + path: "/{containerName}", + httpMethod: "PUT", responses: { 201: { headersMapper: ContainerAcquireLeaseHeaders }, default: { bodyMapper: StorageError, - headersMapper: ContainerAcquireLeaseHeaders + headersMapper: ContainerAcquireLeaseExceptionHeaders } }, - isXML: true, - serializer: serializer$1 -}; -var releaseLeaseOperationSpec = { - httpMethod: "PUT", - path: "{containerName}", - urlParameters: [ - url - ], queryParameters: [ timeoutInSeconds, - comp10, - restype2 + restype2, + comp10 ], + urlParameters: [url], headerParameters: [ - leaseId1, version, requestId, - action1, + accept1, ifModifiedSince, - ifUnmodifiedSince + ifUnmodifiedSince, + action, + duration, + proposedLeaseId ], + isXML: true, + serializer: xmlSerializer$1 +}; +var releaseLeaseOperationSpec = { + path: "/{containerName}", + httpMethod: "PUT", responses: { 200: { headersMapper: ContainerReleaseLeaseHeaders }, default: { bodyMapper: StorageError, - headersMapper: ContainerReleaseLeaseHeaders + headersMapper: ContainerReleaseLeaseExceptionHeaders } }, - isXML: true, - serializer: serializer$1 -}; -var renewLeaseOperationSpec = { - httpMethod: "PUT", - path: "{containerName}", - urlParameters: [ - url - ], queryParameters: [ timeoutInSeconds, - comp10, - restype2 + restype2, + comp10 ], + urlParameters: [url], headerParameters: [ - leaseId1, version, requestId, - action2, + accept1, ifModifiedSince, - ifUnmodifiedSince + ifUnmodifiedSince, + action1, + leaseId1 ], + isXML: true, + serializer: xmlSerializer$1 +}; +var renewLeaseOperationSpec = { + path: "/{containerName}", + httpMethod: "PUT", responses: { 200: { headersMapper: ContainerRenewLeaseHeaders }, default: { bodyMapper: StorageError, - headersMapper: ContainerRenewLeaseHeaders + headersMapper: ContainerRenewLeaseExceptionHeaders } }, - isXML: true, - serializer: serializer$1 -}; -var breakLeaseOperationSpec = { - httpMethod: "PUT", - path: "{containerName}", - urlParameters: [ - url - ], queryParameters: [ timeoutInSeconds, - comp10, - restype2 + restype2, + comp10 ], + urlParameters: [url], headerParameters: [ - breakPeriod, version, requestId, - action3, + accept1, ifModifiedSince, - ifUnmodifiedSince + ifUnmodifiedSince, + leaseId1, + action2 ], + isXML: true, + serializer: xmlSerializer$1 +}; +var breakLeaseOperationSpec = { + path: "/{containerName}", + httpMethod: "PUT", responses: { 202: { headersMapper: ContainerBreakLeaseHeaders }, default: { bodyMapper: StorageError, - headersMapper: ContainerBreakLeaseHeaders + headersMapper: ContainerBreakLeaseExceptionHeaders } }, - isXML: true, - serializer: serializer$1 -}; -var changeLeaseOperationSpec = { - httpMethod: "PUT", - path: "{containerName}", - urlParameters: [ - url - ], queryParameters: [ timeoutInSeconds, - comp10, - restype2 + restype2, + comp10 ], + urlParameters: [url], headerParameters: [ - leaseId1, - proposedLeaseId1, version, requestId, - action4, + accept1, ifModifiedSince, - ifUnmodifiedSince + ifUnmodifiedSince, + action3, + breakPeriod ], + isXML: true, + serializer: xmlSerializer$1 +}; +var changeLeaseOperationSpec = { + path: "/{containerName}", + httpMethod: "PUT", responses: { 200: { headersMapper: ContainerChangeLeaseHeaders }, default: { bodyMapper: StorageError, - headersMapper: ContainerChangeLeaseHeaders + headersMapper: ContainerChangeLeaseExceptionHeaders } }, - isXML: true, - serializer: serializer$1 -}; -var listBlobFlatSegmentOperationSpec = { - httpMethod: "GET", - path: "{containerName}", - urlParameters: [ - url - ], queryParameters: [ - prefix, - marker0, - maxPageSize, - include1, timeoutInSeconds, restype2, - comp2 + comp10 ], + urlParameters: [url], headerParameters: [ version, - requestId + requestId, + accept1, + ifModifiedSince, + ifUnmodifiedSince, + leaseId1, + action4, + proposedLeaseId1 ], + isXML: true, + serializer: xmlSerializer$1 +}; +var listBlobFlatSegmentOperationSpec = { + path: "/{containerName}", + httpMethod: "GET", responses: { 200: { bodyMapper: ListBlobsFlatSegmentResponse, @@ -29400,973 +29810,1021 @@ var listBlobFlatSegmentOperationSpec = { }, default: { bodyMapper: StorageError, - headersMapper: ContainerListBlobFlatSegmentHeaders + headersMapper: ContainerListBlobFlatSegmentExceptionHeaders } }, - isXML: true, - serializer: serializer$1 -}; -var listBlobHierarchySegmentOperationSpec = { - httpMethod: "GET", - path: "{containerName}", - urlParameters: [ - url - ], queryParameters: [ + timeoutInSeconds, + comp2, prefix, - delimiter, - marker0, + marker, maxPageSize, - include1, - timeoutInSeconds, restype2, - comp2 + include1 ], + urlParameters: [url], headerParameters: [ version, - requestId + requestId, + accept1 ], - responses: { - 200: { - bodyMapper: ListBlobsHierarchySegmentResponse, - headersMapper: ContainerListBlobHierarchySegmentHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerListBlobHierarchySegmentHeaders - } - }, isXML: true, - serializer: serializer$1 + serializer: xmlSerializer$1 }; -var getAccountInfoOperationSpec$1 = { +var listBlobHierarchySegmentOperationSpec = { + path: "/{containerName}", httpMethod: "GET", - path: "{containerName}", - urlParameters: [ - url - ], - queryParameters: [ - restype1, - comp0 - ], - headerParameters: [ - version - ], responses: { 200: { - headersMapper: ContainerGetAccountInfoHeaders + bodyMapper: ListBlobsHierarchySegmentResponse, + headersMapper: ContainerListBlobHierarchySegmentHeaders }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerGetAccountInfoHeaders - } - }, - isXML: true, - serializer: serializer$1 -}; - -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -var Mappers$2 = /*#__PURE__*/Object.freeze({ - __proto__: null, - ArrowConfiguration: ArrowConfiguration, - ArrowField: ArrowField, - BlobAbortCopyFromURLHeaders: BlobAbortCopyFromURLHeaders, - BlobAcquireLeaseHeaders: BlobAcquireLeaseHeaders, - BlobBreakLeaseHeaders: BlobBreakLeaseHeaders, - BlobChangeLeaseHeaders: BlobChangeLeaseHeaders, - BlobCopyFromURLHeaders: BlobCopyFromURLHeaders, - BlobCreateSnapshotHeaders: BlobCreateSnapshotHeaders, - BlobDeleteHeaders: BlobDeleteHeaders, - BlobDownloadHeaders: BlobDownloadHeaders, - BlobGetAccessControlHeaders: BlobGetAccessControlHeaders, - BlobGetAccountInfoHeaders: BlobGetAccountInfoHeaders, - BlobGetPropertiesHeaders: BlobGetPropertiesHeaders, - BlobGetTagsHeaders: BlobGetTagsHeaders, - BlobQueryHeaders: BlobQueryHeaders, - BlobReleaseLeaseHeaders: BlobReleaseLeaseHeaders, - BlobRenameHeaders: BlobRenameHeaders, - BlobRenewLeaseHeaders: BlobRenewLeaseHeaders, - BlobSetAccessControlHeaders: BlobSetAccessControlHeaders, - BlobSetExpiryHeaders: BlobSetExpiryHeaders, - BlobSetHTTPHeadersHeaders: BlobSetHTTPHeadersHeaders, - BlobSetMetadataHeaders: BlobSetMetadataHeaders, - BlobSetTagsHeaders: BlobSetTagsHeaders, - BlobSetTierHeaders: BlobSetTierHeaders, - BlobStartCopyFromURLHeaders: BlobStartCopyFromURLHeaders, - BlobTag: BlobTag, - BlobTags: BlobTags, - BlobUndeleteHeaders: BlobUndeleteHeaders, - DataLakeStorageError: DataLakeStorageError, - DataLakeStorageErrorError: DataLakeStorageErrorError, - DelimitedTextConfiguration: DelimitedTextConfiguration, - JsonTextConfiguration: JsonTextConfiguration, - QueryFormat: QueryFormat, - QueryRequest: QueryRequest, - QuerySerialization: QuerySerialization, - StorageError: StorageError -}); + default: { + bodyMapper: StorageError, + headersMapper: ContainerListBlobHierarchySegmentExceptionHeaders + } + }, + queryParameters: [ + timeoutInSeconds, + comp2, + prefix, + marker, + maxPageSize, + restype2, + include1, + delimiter + ], + urlParameters: [url], + headerParameters: [ + version, + requestId, + accept1 + ], + isXML: true, + serializer: xmlSerializer$1 +}; +var getAccountInfoOperationSpec$1 = { + path: "/{containerName}", + httpMethod: "GET", + responses: { + 200: { + headersMapper: ContainerGetAccountInfoHeaders + }, + default: { + bodyMapper: StorageError, + headersMapper: ContainerGetAccountInfoExceptionHeaders + } + }, + queryParameters: [comp, restype1], + urlParameters: [url], + headerParameters: [version, accept1], + isXML: true, + serializer: xmlSerializer$1 +}; /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ /** Class representing a Blob. */ var Blob$1 = /** @class */ (function () { /** - * Create a Blob. - * @param {StorageClientContext} client Reference to the service client. + * Initialize a new instance of the class Blob class. + * @param client Reference to the service client */ function Blob(client) { this.client = client; } - Blob.prototype.download = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, downloadOperationSpec, callback); - }; - Blob.prototype.getProperties = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, getPropertiesOperationSpec$2, callback); - }; - Blob.prototype.deleteMethod = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, deleteMethodOperationSpec$1, callback); - }; - Blob.prototype.setAccessControl = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, setAccessControlOperationSpec, callback); - }; - Blob.prototype.getAccessControl = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, getAccessControlOperationSpec, callback); - }; - Blob.prototype.rename = function (renameSource, options, callback) { - return this.client.sendOperationRequest({ + /** + * The Download operation reads or downloads a blob from the system, including its metadata and + * properties. You can also call Download to read a snapshot. + * @param options The options parameters. + */ + Blob.prototype.download = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, downloadOperationSpec); + }; + /** + * The Get Properties operation returns all user-defined metadata, standard HTTP properties, and system + * properties for the blob. It does not return the content of the blob. + * @param options The options parameters. + */ + Blob.prototype.getProperties = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, getPropertiesOperationSpec$2); + }; + /** + * If the storage account's soft delete feature is disabled then, when a blob is deleted, it is + * permanently removed from the storage account. If the storage account's soft delete feature is + * enabled, then, when a blob is deleted, it is marked for deletion and becomes inaccessible + * immediately. However, the blob service retains the blob or snapshot for the number of days specified + * by the DeleteRetentionPolicy section of [Storage service properties] + * (Set-Blob-Service-Properties.md). After the specified number of days has passed, the blob's data is + * permanently removed from the storage account. Note that you continue to be charged for the + * soft-deleted blob's storage until it is permanently removed. Use the List Blobs API and specify the + * "include=deleted" query parameter to discover which blobs and snapshots have been soft deleted. You + * can then use the Undelete Blob API to restore a soft-deleted blob. All other operations on a + * soft-deleted blob or snapshot causes the service to return an HTTP status code of 404 + * (ResourceNotFound). + * @param options The options parameters. + */ + Blob.prototype.delete = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, deleteOperationSpec$1); + }; + /** + * Set the owner, group, permissions, or access control list for a blob. + * @param options The options parameters. + */ + Blob.prototype.setAccessControl = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, setAccessControlOperationSpec); + }; + /** + * Get the owner, group, permissions, or access control list for a blob. + * @param options The options parameters. + */ + Blob.prototype.getAccessControl = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, getAccessControlOperationSpec); + }; + /** + * Rename a blob/file. By default, the destination is overwritten and if the destination already + * exists and has a lease the lease is broken. This operation supports conditional HTTP requests. For + * more information, see [Specifying Conditional Headers for Blob Service + * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). + * To fail if the destination already exists, use a conditional request with If-None-Match: "*". + * @param renameSource The file or directory to be renamed. The value must have the following format: + * "/{filesysystem}/{path}". If "x-ms-properties" is specified, the properties will overwrite the + * existing properties; otherwise, the existing properties will be preserved. + * @param options The options parameters. + */ + Blob.prototype.rename = function (renameSource, options) { + var operationArguments = { renameSource: renameSource, - options: options - }, renameOperationSpec$1, callback); + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, renameOperationSpec$1); }; - Blob.prototype.undelete = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, undeleteOperationSpec, callback); + /** + * Undelete a blob that was previously soft deleted + * @param options The options parameters. + */ + Blob.prototype.undelete = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, undeleteOperationSpec); }; - Blob.prototype.setExpiry = function (expiryOptions, options, callback) { - return this.client.sendOperationRequest({ + /** + * Sets the time a blob will expire and be deleted. + * @param expiryOptions Required. Indicates mode of the expiry time + * @param options The options parameters. + */ + Blob.prototype.setExpiry = function (expiryOptions, options) { + var operationArguments = { expiryOptions: expiryOptions, - options: options - }, setExpiryOperationSpec, callback); - }; - Blob.prototype.setHTTPHeaders = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, setHTTPHeadersOperationSpec, callback); - }; - Blob.prototype.setMetadata = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, setMetadataOperationSpec$1, callback); - }; - Blob.prototype.acquireLease = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, acquireLeaseOperationSpec$1, callback); - }; - Blob.prototype.releaseLease = function (leaseId, options, callback) { - return this.client.sendOperationRequest({ + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, setExpiryOperationSpec); + }; + /** + * The Set HTTP Headers operation sets system properties on the blob + * @param options The options parameters. + */ + Blob.prototype.setHttpHeaders = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, setHttpHeadersOperationSpec); + }; + /** + * The Set Blob Metadata operation sets user-defined metadata for the specified blob as one or more + * name-value pairs + * @param options The options parameters. + */ + Blob.prototype.setMetadata = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, setMetadataOperationSpec$1); + }; + /** + * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete + * operations + * @param options The options parameters. + */ + Blob.prototype.acquireLease = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, acquireLeaseOperationSpec$1); + }; + /** + * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete + * operations + * @param leaseId Specifies the current lease ID on the resource. + * @param options The options parameters. + */ + Blob.prototype.releaseLease = function (leaseId, options) { + var operationArguments = { leaseId: leaseId, - options: options - }, releaseLeaseOperationSpec$1, callback); + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, releaseLeaseOperationSpec$1); }; - Blob.prototype.renewLease = function (leaseId, options, callback) { - return this.client.sendOperationRequest({ + /** + * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete + * operations + * @param leaseId Specifies the current lease ID on the resource. + * @param options The options parameters. + */ + Blob.prototype.renewLease = function (leaseId, options) { + var operationArguments = { leaseId: leaseId, - options: options - }, renewLeaseOperationSpec$1, callback); + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, renewLeaseOperationSpec$1); }; - Blob.prototype.changeLease = function (leaseId, proposedLeaseId, options, callback) { - return this.client.sendOperationRequest({ + /** + * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete + * operations + * @param leaseId Specifies the current lease ID on the resource. + * @param proposedLeaseId Proposed lease ID, in a GUID string format. The Blob service returns 400 + * (Invalid request) if the proposed lease ID is not in the correct format. See Guid Constructor + * (String) for a list of valid GUID string formats. + * @param options The options parameters. + */ + Blob.prototype.changeLease = function (leaseId, proposedLeaseId, options) { + var operationArguments = { leaseId: leaseId, proposedLeaseId: proposedLeaseId, - options: options - }, changeLeaseOperationSpec$1, callback); + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, changeLeaseOperationSpec$1); }; - Blob.prototype.breakLease = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, breakLeaseOperationSpec$1, callback); + /** + * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete + * operations + * @param options The options parameters. + */ + Blob.prototype.breakLease = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, breakLeaseOperationSpec$1); }; - Blob.prototype.createSnapshot = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, createSnapshotOperationSpec, callback); + /** + * The Create Snapshot operation creates a read-only snapshot of a blob + * @param options The options parameters. + */ + Blob.prototype.createSnapshot = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, createSnapshotOperationSpec); }; - Blob.prototype.startCopyFromURL = function (copySource, options, callback) { - return this.client.sendOperationRequest({ + /** + * The Start Copy From URL operation copies a blob or an internet resource to a new blob. + * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to + * 2 KB in length that specifies a page blob snapshot. The value should be URL-encoded as it would + * appear in a request URI. The source blob must either be public or must be authenticated via a shared + * access signature. + * @param options The options parameters. + */ + Blob.prototype.startCopyFromURL = function (copySource, options) { + var operationArguments = { copySource: copySource, - options: options - }, startCopyFromURLOperationSpec, callback); + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, startCopyFromURLOperationSpec); }; - Blob.prototype.copyFromURL = function (copySource, options, callback) { - return this.client.sendOperationRequest({ + /** + * The Copy From URL operation copies a blob or an internet resource to a new blob. It will not return + * a response until the copy is complete. + * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to + * 2 KB in length that specifies a page blob snapshot. The value should be URL-encoded as it would + * appear in a request URI. The source blob must either be public or must be authenticated via a shared + * access signature. + * @param options The options parameters. + */ + Blob.prototype.copyFromURL = function (copySource, options) { + var operationArguments = { copySource: copySource, - options: options - }, copyFromURLOperationSpec, callback); + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, copyFromURLOperationSpec); }; - Blob.prototype.abortCopyFromURL = function (copyId, options, callback) { - return this.client.sendOperationRequest({ + /** + * The Abort Copy From URL operation aborts a pending Copy From URL operation, and leaves a destination + * blob with zero length and full metadata. + * @param copyId The copy identifier provided in the x-ms-copy-id header of the original Copy Blob + * operation. + * @param options The options parameters. + */ + Blob.prototype.abortCopyFromURL = function (copyId, options) { + var operationArguments = { copyId: copyId, - options: options - }, abortCopyFromURLOperationSpec, callback); + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, abortCopyFromURLOperationSpec); }; - Blob.prototype.setTier = function (tier, options, callback) { - return this.client.sendOperationRequest({ + /** + * The Set Tier operation sets the tier on a blob. The operation is allowed on a page blob in a premium + * storage account and on a block blob in a blob storage account (locally redundant storage only). A + * premium page blob's tier determines the allowed size, IOPS, and bandwidth of the blob. A block + * blob's tier determines Hot/Cool/Archive storage type. This operation does not update the blob's + * ETag. + * @param tier Indicates the tier to be set on the blob. + * @param options The options parameters. + */ + Blob.prototype.setTier = function (tier, options) { + var operationArguments = { tier: tier, - options: options - }, setTierOperationSpec, callback); + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, setTierOperationSpec); }; - Blob.prototype.getAccountInfo = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, getAccountInfoOperationSpec$2, callback); + /** + * Returns the sku name and account kind + * @param options The options parameters. + */ + Blob.prototype.getAccountInfo = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, getAccountInfoOperationSpec$2); }; - Blob.prototype.query = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, queryOperationSpec, callback); + /** + * The Query operation enables users to select/project on blob data by providing simple query + * expressions. + * @param options The options parameters. + */ + Blob.prototype.query = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, queryOperationSpec); }; - Blob.prototype.getTags = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, getTagsOperationSpec, callback); + /** + * The Get Tags operation enables users to get the tags associated with a blob. + * @param options The options parameters. + */ + Blob.prototype.getTags = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, getTagsOperationSpec); }; - Blob.prototype.setTags = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, setTagsOperationSpec, callback); + /** + * The Set Tags operation enables users to set tags on a blob. + * @param options The options parameters. + */ + Blob.prototype.setTags = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, setTagsOperationSpec); }; return Blob; }()); // Operation Specifications -var serializer$2 = new coreHttp.Serializer(Mappers$2, true); +var xmlSerializer$2 = new coreHttp.Serializer(Mappers, /* isXml */ true); var downloadOperationSpec = { + path: "/{containerName}/{blob}", httpMethod: "GET", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], - queryParameters: [ - snapshot, - versionId, - timeoutInSeconds - ], - headerParameters: [ - range0, - rangeGetContentMD5, - rangeGetContentCRC64, - version, - requestId, - leaseId0, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags - ], responses: { 200: { bodyMapper: { - serializedName: "parsedResponse", - type: { - name: "Stream" - } + type: { name: "Stream" }, + serializedName: "parsedResponse" }, headersMapper: BlobDownloadHeaders }, 206: { bodyMapper: { - serializedName: "parsedResponse", - type: { - name: "Stream" - } + type: { name: "Stream" }, + serializedName: "parsedResponse" }, headersMapper: BlobDownloadHeaders }, default: { bodyMapper: StorageError, - headersMapper: BlobDownloadHeaders + headersMapper: BlobDownloadExceptionHeaders } }, - isXML: true, - serializer: serializer$2 -}; -var getPropertiesOperationSpec$2 = { - httpMethod: "HEAD", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], queryParameters: [ + timeoutInSeconds, snapshot, - versionId, - timeoutInSeconds + versionId ], + urlParameters: [url], headerParameters: [ version, requestId, - leaseId0, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, + accept1, + leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, + range, + rangeGetContentMD5, + rangeGetContentCRC64, + encryptionKey, + encryptionKeySha256, + encryptionAlgorithm, ifTags ], + isXML: true, + serializer: xmlSerializer$2 +}; +var getPropertiesOperationSpec$2 = { + path: "/{containerName}/{blob}", + httpMethod: "HEAD", responses: { 200: { headersMapper: BlobGetPropertiesHeaders }, default: { bodyMapper: StorageError, - headersMapper: BlobGetPropertiesHeaders + headersMapper: BlobGetPropertiesExceptionHeaders } }, - isXML: true, - serializer: serializer$2 -}; -var deleteMethodOperationSpec$1 = { - httpMethod: "DELETE", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], queryParameters: [ - snapshot, - versionId, timeoutInSeconds, - blobDeleteType + snapshot, + versionId ], + urlParameters: [url], headerParameters: [ - deleteSnapshots, version, requestId, - leaseId0, + accept1, + leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, + encryptionKey, + encryptionKeySha256, + encryptionAlgorithm, ifTags ], + isXML: true, + serializer: xmlSerializer$2 +}; +var deleteOperationSpec$1 = { + path: "/{containerName}/{blob}", + httpMethod: "DELETE", responses: { 202: { headersMapper: BlobDeleteHeaders }, default: { bodyMapper: StorageError, - headersMapper: BlobDeleteHeaders + headersMapper: BlobDeleteExceptionHeaders } }, - isXML: true, - serializer: serializer$2 -}; -var setAccessControlOperationSpec = { - httpMethod: "PATCH", - path: "{filesystem}/{path}", - urlParameters: [ - url - ], queryParameters: [ timeoutInSeconds, - action5 + snapshot, + versionId, + blobDeleteType ], + urlParameters: [url], headerParameters: [ - owner, - group, - posixPermissions, - posixAcl, - requestId, version, - leaseId0, + requestId, + accept1, + leaseId, + ifModifiedSince, + ifUnmodifiedSince, ifMatch, ifNoneMatch, - ifModifiedSince, - ifUnmodifiedSince + ifTags, + deleteSnapshots ], + isXML: true, + serializer: xmlSerializer$2 +}; +var setAccessControlOperationSpec = { + path: "/{filesystem}/{path}", + httpMethod: "PATCH", responses: { 200: { headersMapper: BlobSetAccessControlHeaders }, default: { bodyMapper: DataLakeStorageError, - headersMapper: BlobSetAccessControlHeaders + headersMapper: BlobSetAccessControlExceptionHeaders } }, - isXML: true, - serializer: serializer$2 -}; -var getAccessControlOperationSpec = { - httpMethod: "HEAD", - path: "{filesystem}/{path}", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds, - upn, - action6 - ], + queryParameters: [timeoutInSeconds, action5], + urlParameters: [url], headerParameters: [ - requestId, version, - leaseId0, + requestId, + accept1, + leaseId, + ifModifiedSince, + ifUnmodifiedSince, + posixPermissions, ifMatch, ifNoneMatch, - ifModifiedSince, - ifUnmodifiedSince + owner, + group, + posixAcl ], + isXML: true, + serializer: xmlSerializer$2 +}; +var getAccessControlOperationSpec = { + path: "/{filesystem}/{path}", + httpMethod: "HEAD", responses: { 200: { headersMapper: BlobGetAccessControlHeaders }, default: { bodyMapper: DataLakeStorageError, - headersMapper: BlobGetAccessControlHeaders + headersMapper: BlobGetAccessControlExceptionHeaders } }, + queryParameters: [ + timeoutInSeconds, + action6, + upn + ], + urlParameters: [url], + headerParameters: [ + version, + requestId, + accept1, + leaseId, + ifModifiedSince, + ifUnmodifiedSince, + ifMatch, + ifNoneMatch + ], isXML: true, - serializer: serializer$2 + serializer: xmlSerializer$2 }; var renameOperationSpec$1 = { + path: "/{filesystem}/{path}", httpMethod: "PUT", - path: "{filesystem}/{path}", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds, - pathRenameMode - ], + responses: { + 201: { + headersMapper: BlobRenameHeaders + }, + default: { + bodyMapper: DataLakeStorageError, + headersMapper: BlobRenameExceptionHeaders + } + }, + queryParameters: [timeoutInSeconds, pathRenameMode], + urlParameters: [url], headerParameters: [ - renameSource, + version, + requestId, + accept1, + leaseId, + ifModifiedSince, + ifUnmodifiedSince, + sourceLeaseId, directoryProperties, posixPermissions, posixUmask, - sourceLeaseId, - version, - requestId, cacheControl, - contentType, + contentType1, contentEncoding, contentLanguage, contentDisposition, - leaseId0, - ifModifiedSince, - ifUnmodifiedSince, ifMatch, ifNoneMatch, + renameSource, sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatch, sourceIfNoneMatch ], - responses: { - 201: { - headersMapper: BlobRenameHeaders - }, - default: { - bodyMapper: DataLakeStorageError, - headersMapper: BlobRenameHeaders - } - }, isXML: true, - serializer: serializer$2 + serializer: xmlSerializer$2 }; var undeleteOperationSpec = { + path: "/{containerName}/{blob}", httpMethod: "PUT", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds, - comp8 - ], - headerParameters: [ - version, - requestId - ], responses: { 200: { headersMapper: BlobUndeleteHeaders }, default: { bodyMapper: StorageError, - headersMapper: BlobUndeleteHeaders + headersMapper: BlobUndeleteExceptionHeaders } }, - isXML: true, - serializer: serializer$2 -}; -var setExpiryOperationSpec = { - httpMethod: "PUT", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds, - comp11 - ], + queryParameters: [timeoutInSeconds, comp8], + urlParameters: [url], headerParameters: [ version, requestId, - expiryOptions, - expiresOn + accept1 ], + isXML: true, + serializer: xmlSerializer$2 +}; +var setExpiryOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 200: { headersMapper: BlobSetExpiryHeaders }, default: { bodyMapper: StorageError, - headersMapper: BlobSetExpiryHeaders + headersMapper: BlobSetExpiryExceptionHeaders } }, - isXML: true, - serializer: serializer$2 -}; -var setHTTPHeadersOperationSpec = { - httpMethod: "PUT", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds, - comp0 - ], + queryParameters: [timeoutInSeconds, comp11], + urlParameters: [url], headerParameters: [ version, requestId, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - leaseId0, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags + accept1, + expiryOptions, + expiresOn ], + isXML: true, + serializer: xmlSerializer$2 +}; +var setHttpHeadersOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 200: { - headersMapper: BlobSetHTTPHeadersHeaders + headersMapper: BlobSetHttpHeadersHeaders }, default: { bodyMapper: StorageError, - headersMapper: BlobSetHTTPHeadersHeaders + headersMapper: BlobSetHttpHeadersExceptionHeaders } }, - isXML: true, - serializer: serializer$2 -}; -var setMetadataOperationSpec$1 = { - httpMethod: "PUT", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds, - comp6 - ], + queryParameters: [comp, timeoutInSeconds], + urlParameters: [url], headerParameters: [ - metadata, - encryptionScope, version, requestId, - leaseId0, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, + accept1, + leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, - ifTags + ifTags, + blobCacheControl, + blobContentType, + blobContentMD5, + blobContentEncoding, + blobContentLanguage, + blobContentDisposition ], + isXML: true, + serializer: xmlSerializer$2 +}; +var setMetadataOperationSpec$1 = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 200: { headersMapper: BlobSetMetadataHeaders }, default: { bodyMapper: StorageError, - headersMapper: BlobSetMetadataHeaders + headersMapper: BlobSetMetadataExceptionHeaders } }, - isXML: true, - serializer: serializer$2 -}; -var acquireLeaseOperationSpec$1 = { - httpMethod: "PUT", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds, - comp10 - ], + queryParameters: [timeoutInSeconds, comp6], + urlParameters: [url], headerParameters: [ - duration, - proposedLeaseId0, version, requestId, - action0, + accept1, + metadata, + leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, - ifTags + encryptionKey, + encryptionKeySha256, + encryptionAlgorithm, + ifTags, + encryptionScope ], + isXML: true, + serializer: xmlSerializer$2 +}; +var acquireLeaseOperationSpec$1 = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 201: { headersMapper: BlobAcquireLeaseHeaders }, default: { bodyMapper: StorageError, - headersMapper: BlobAcquireLeaseHeaders + headersMapper: BlobAcquireLeaseExceptionHeaders } }, - isXML: true, - serializer: serializer$2 -}; -var releaseLeaseOperationSpec$1 = { - httpMethod: "PUT", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds, - comp10 - ], + queryParameters: [timeoutInSeconds, comp10], + urlParameters: [url], headerParameters: [ - leaseId1, version, requestId, - action1, + accept1, ifModifiedSince, ifUnmodifiedSince, + action, + duration, + proposedLeaseId, ifMatch, ifNoneMatch, ifTags ], + isXML: true, + serializer: xmlSerializer$2 +}; +var releaseLeaseOperationSpec$1 = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 200: { headersMapper: BlobReleaseLeaseHeaders }, default: { bodyMapper: StorageError, - headersMapper: BlobReleaseLeaseHeaders + headersMapper: BlobReleaseLeaseExceptionHeaders } }, - isXML: true, - serializer: serializer$2 -}; -var renewLeaseOperationSpec$1 = { - httpMethod: "PUT", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds, - comp10 - ], + queryParameters: [timeoutInSeconds, comp10], + urlParameters: [url], headerParameters: [ - leaseId1, version, requestId, - action2, + accept1, ifModifiedSince, ifUnmodifiedSince, + action1, + leaseId1, ifMatch, ifNoneMatch, ifTags ], + isXML: true, + serializer: xmlSerializer$2 +}; +var renewLeaseOperationSpec$1 = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 200: { headersMapper: BlobRenewLeaseHeaders }, default: { bodyMapper: StorageError, - headersMapper: BlobRenewLeaseHeaders + headersMapper: BlobRenewLeaseExceptionHeaders } }, - isXML: true, - serializer: serializer$2 -}; -var changeLeaseOperationSpec$1 = { - httpMethod: "PUT", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds, - comp10 - ], + queryParameters: [timeoutInSeconds, comp10], + urlParameters: [url], headerParameters: [ - leaseId1, - proposedLeaseId1, version, requestId, - action4, + accept1, ifModifiedSince, ifUnmodifiedSince, + leaseId1, + action2, ifMatch, ifNoneMatch, ifTags ], + isXML: true, + serializer: xmlSerializer$2 +}; +var changeLeaseOperationSpec$1 = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 200: { headersMapper: BlobChangeLeaseHeaders }, default: { bodyMapper: StorageError, - headersMapper: BlobChangeLeaseHeaders + headersMapper: BlobChangeLeaseExceptionHeaders } }, - isXML: true, - serializer: serializer$2 -}; -var breakLeaseOperationSpec$1 = { - httpMethod: "PUT", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds, - comp10 - ], + queryParameters: [timeoutInSeconds, comp10], + urlParameters: [url], headerParameters: [ - breakPeriod, version, requestId, - action3, + accept1, ifModifiedSince, ifUnmodifiedSince, + leaseId1, + action4, + proposedLeaseId1, ifMatch, ifNoneMatch, ifTags ], + isXML: true, + serializer: xmlSerializer$2 +}; +var breakLeaseOperationSpec$1 = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 202: { headersMapper: BlobBreakLeaseHeaders }, default: { bodyMapper: StorageError, - headersMapper: BlobBreakLeaseHeaders + headersMapper: BlobBreakLeaseExceptionHeaders } }, - isXML: true, - serializer: serializer$2 -}; -var createSnapshotOperationSpec = { - httpMethod: "PUT", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds, - comp12 - ], + queryParameters: [timeoutInSeconds, comp10], + urlParameters: [url], headerParameters: [ - metadata, - encryptionScope, version, requestId, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, + accept1, ifModifiedSince, ifUnmodifiedSince, + action3, + breakPeriod, ifMatch, ifNoneMatch, - ifTags, - leaseId0 + ifTags ], + isXML: true, + serializer: xmlSerializer$2 +}; +var createSnapshotOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 201: { headersMapper: BlobCreateSnapshotHeaders }, default: { bodyMapper: StorageError, - headersMapper: BlobCreateSnapshotHeaders + headersMapper: BlobCreateSnapshotExceptionHeaders } }, - isXML: true, - serializer: serializer$2 -}; -var startCopyFromURLOperationSpec = { - httpMethod: "PUT", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds - ], + queryParameters: [timeoutInSeconds, comp12], + urlParameters: [url], headerParameters: [ - metadata, - tier0, - rehydratePriority, - copySource, version, requestId, - blobTagsString, - sealBlob, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceIfTags, + accept1, + metadata, + leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, + encryptionKey, + encryptionKeySha256, + encryptionAlgorithm, ifTags, - leaseId0 + encryptionScope ], + isXML: true, + serializer: xmlSerializer$2 +}; +var startCopyFromURLOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 202: { headersMapper: BlobStartCopyFromURLHeaders }, default: { bodyMapper: StorageError, - headersMapper: BlobStartCopyFromURLHeaders + headersMapper: BlobStartCopyFromURLExceptionHeaders } }, - isXML: true, - serializer: serializer$2 -}; -var copyFromURLOperationSpec = { - httpMethod: "PUT", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds - ], + queryParameters: [timeoutInSeconds], + urlParameters: [url], headerParameters: [ - metadata, - tier0, - copySource, - version, - requestId, - sourceContentMD5, - blobTagsString, - xMsRequiresSync, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, + version, + requestId, + accept1, + metadata, + leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, + sourceIfModifiedSince, + sourceIfUnmodifiedSince, + sourceIfMatch, + sourceIfNoneMatch, ifTags, - leaseId0 + tier, + rehydratePriority, + sourceIfTags, + copySource, + blobTagsString, + sealBlob ], + isXML: true, + serializer: xmlSerializer$2 +}; +var copyFromURLOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 202: { headersMapper: BlobCopyFromURLHeaders }, default: { bodyMapper: StorageError, - headersMapper: BlobCopyFromURLHeaders + headersMapper: BlobCopyFromURLExceptionHeaders } }, - isXML: true, - serializer: serializer$2 -}; -var abortCopyFromURLOperationSpec = { - httpMethod: "PUT", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], - queryParameters: [ - copyId, - timeoutInSeconds, - comp13 - ], + queryParameters: [timeoutInSeconds], + urlParameters: [url], headerParameters: [ version, requestId, - copyActionAbortConstant, - leaseId0 + accept1, + metadata, + leaseId, + ifModifiedSince, + ifUnmodifiedSince, + ifMatch, + ifNoneMatch, + sourceIfModifiedSince, + sourceIfUnmodifiedSince, + sourceIfMatch, + sourceIfNoneMatch, + ifTags, + tier, + copySource, + blobTagsString, + xMsRequiresSync, + sourceContentMD5 ], + isXML: true, + serializer: xmlSerializer$2 +}; +var abortCopyFromURLOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 204: { headersMapper: BlobAbortCopyFromURLHeaders }, default: { bodyMapper: StorageError, - headersMapper: BlobAbortCopyFromURLHeaders + headersMapper: BlobAbortCopyFromURLExceptionHeaders } }, - isXML: true, - serializer: serializer$2 -}; -var setTierOperationSpec = { - httpMethod: "PUT", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], queryParameters: [ - snapshot, - versionId, timeoutInSeconds, - comp14 + comp13, + copyId ], + urlParameters: [url], headerParameters: [ - tier1, - rehydratePriority, version, requestId, - leaseId0, - ifTags + accept1, + leaseId, + copyActionAbortConstant ], + isXML: true, + serializer: xmlSerializer$2 +}; +var setTierOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 200: { headersMapper: BlobSetTierHeaders @@ -30376,114 +30834,99 @@ var setTierOperationSpec = { }, default: { bodyMapper: StorageError, - headersMapper: BlobSetTierHeaders + headersMapper: BlobSetTierExceptionHeaders } }, - isXML: true, - serializer: serializer$2 -}; -var getAccountInfoOperationSpec$2 = { - httpMethod: "GET", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], queryParameters: [ - restype1, - comp0 + timeoutInSeconds, + snapshot, + versionId, + comp14 ], + urlParameters: [url], headerParameters: [ - version + version, + requestId, + accept1, + leaseId, + ifTags, + rehydratePriority, + tier1 ], + isXML: true, + serializer: xmlSerializer$2 +}; +var getAccountInfoOperationSpec$2 = { + path: "/{containerName}/{blob}", + httpMethod: "GET", responses: { 200: { headersMapper: BlobGetAccountInfoHeaders }, default: { bodyMapper: StorageError, - headersMapper: BlobGetAccountInfoHeaders + headersMapper: BlobGetAccountInfoExceptionHeaders } }, + queryParameters: [comp, restype1], + urlParameters: [url], + headerParameters: [version, accept1], isXML: true, - serializer: serializer$2 + serializer: xmlSerializer$2 }; var queryOperationSpec = { + path: "/{containerName}/{blob}", httpMethod: "POST", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], - queryParameters: [ - snapshot, - timeoutInSeconds, - comp15 - ], - headerParameters: [ - version, - requestId, - leaseId0, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags - ], - requestBody: { - parameterPath: [ - "options", - "queryRequest" - ], - mapper: QueryRequest - }, - contentType: "application/xml; charset=utf-8", responses: { 200: { bodyMapper: { - serializedName: "parsedResponse", - type: { - name: "Stream" - } + type: { name: "Stream" }, + serializedName: "parsedResponse" }, headersMapper: BlobQueryHeaders }, 206: { bodyMapper: { - serializedName: "parsedResponse", - type: { - name: "Stream" - } + type: { name: "Stream" }, + serializedName: "parsedResponse" }, headersMapper: BlobQueryHeaders }, default: { bodyMapper: StorageError, - headersMapper: BlobQueryHeaders + headersMapper: BlobQueryExceptionHeaders } }, - isXML: true, - serializer: serializer$2 -}; -var getTagsOperationSpec = { - httpMethod: "GET", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], + requestBody: queryRequest, queryParameters: [ timeoutInSeconds, snapshot, - versionId, - comp16 + comp15 ], + urlParameters: [url], headerParameters: [ + contentType, + accept, version, requestId, - ifTags, - leaseId0 + leaseId, + ifModifiedSince, + ifUnmodifiedSince, + ifMatch, + ifNoneMatch, + encryptionKey, + encryptionKeySha256, + encryptionAlgorithm, + ifTags ], + isXML: true, + contentType: "application/xml; charset=utf-8", + mediaType: "xml", + serializer: xmlSerializer$2 +}; +var getTagsOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "GET", responses: { 200: { bodyMapper: BlobTags, @@ -30491,373 +30934,386 @@ var getTagsOperationSpec = { }, default: { bodyMapper: StorageError, - headersMapper: BlobGetTagsHeaders + headersMapper: BlobGetTagsExceptionHeaders } }, - isXML: true, - serializer: serializer$2 -}; -var setTagsOperationSpec = { - httpMethod: "PUT", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], queryParameters: [ timeoutInSeconds, + snapshot, versionId, comp16 ], + urlParameters: [url], headerParameters: [ version, - transactionalContentMD5, - transactionalContentCrc64, requestId, - ifTags, - leaseId0 + accept1, + leaseId, + ifTags ], - requestBody: { - parameterPath: [ - "options", - "tags" - ], - mapper: BlobTags - }, - contentType: "application/xml; charset=utf-8", + isXML: true, + serializer: xmlSerializer$2 +}; +var setTagsOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 204: { headersMapper: BlobSetTagsHeaders }, default: { bodyMapper: StorageError, - headersMapper: BlobSetTagsHeaders + headersMapper: BlobSetTagsExceptionHeaders } }, + requestBody: tags, + queryParameters: [ + timeoutInSeconds, + versionId, + comp16 + ], + urlParameters: [url], + headerParameters: [ + contentType, + accept, + version, + requestId, + leaseId, + ifTags, + transactionalContentMD5, + transactionalContentCrc64 + ], isXML: true, - serializer: serializer$2 + contentType: "application/xml; charset=utf-8", + mediaType: "xml", + serializer: xmlSerializer$2 }; /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ - -var Mappers$3 = /*#__PURE__*/Object.freeze({ - __proto__: null, - ClearRange: ClearRange, - PageBlobClearPagesHeaders: PageBlobClearPagesHeaders, - PageBlobCopyIncrementalHeaders: PageBlobCopyIncrementalHeaders, - PageBlobCreateHeaders: PageBlobCreateHeaders, - PageBlobGetPageRangesDiffHeaders: PageBlobGetPageRangesDiffHeaders, - PageBlobGetPageRangesHeaders: PageBlobGetPageRangesHeaders, - PageBlobResizeHeaders: PageBlobResizeHeaders, - PageBlobUpdateSequenceNumberHeaders: PageBlobUpdateSequenceNumberHeaders, - PageBlobUploadPagesFromURLHeaders: PageBlobUploadPagesFromURLHeaders, - PageBlobUploadPagesHeaders: PageBlobUploadPagesHeaders, - PageList: PageList, - PageRange: PageRange, - StorageError: StorageError -}); - -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ /** Class representing a PageBlob. */ var PageBlob = /** @class */ (function () { /** - * Create a PageBlob. - * @param {StorageClientContext} client Reference to the service client. + * Initialize a new instance of the class PageBlob class. + * @param client Reference to the service client */ function PageBlob(client) { this.client = client; } - PageBlob.prototype.create = function (contentLength, blobContentLength, options, callback) { - return this.client.sendOperationRequest({ + /** + * The Create operation creates a new page blob. + * @param contentLength The length of the request. + * @param blobContentLength This header specifies the maximum size for the page blob, up to 1 TB. The + * page blob size must be aligned to a 512-byte boundary. + * @param options The options parameters. + */ + PageBlob.prototype.create = function (contentLength, blobContentLength, options) { + var operationArguments = { contentLength: contentLength, blobContentLength: blobContentLength, - options: options - }, createOperationSpec$1, callback); + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, createOperationSpec$1); }; - PageBlob.prototype.uploadPages = function (body, contentLength, options, callback) { - return this.client.sendOperationRequest({ - body: body, + /** + * The Upload Pages operation writes a range of pages to a page blob + * @param contentLength The length of the request. + * @param body Initial data + * @param options The options parameters. + */ + PageBlob.prototype.uploadPages = function (contentLength, body, options) { + var operationArguments = { contentLength: contentLength, - options: options - }, uploadPagesOperationSpec, callback); + body: body, + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, uploadPagesOperationSpec); }; - PageBlob.prototype.clearPages = function (contentLength, options, callback) { - return this.client.sendOperationRequest({ + /** + * 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. + */ + PageBlob.prototype.clearPages = function (contentLength, options) { + var operationArguments = { contentLength: contentLength, - options: options - }, clearPagesOperationSpec, callback); + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, clearPagesOperationSpec); }; - PageBlob.prototype.uploadPagesFromURL = function (sourceUrl, sourceRange, contentLength, range, options, callback) { - return this.client.sendOperationRequest({ + /** + * The Upload Pages operation writes a range of pages to a page blob where the contents are read from a + * URL + * @param sourceUrl Specify a URL to the copy source. + * @param sourceRange Bytes of source data in the specified range. The length of this range should + * match the ContentLength header and x-ms-range/Range destination range header. + * @param contentLength The length of the request. + * @param range The range of bytes to which the source range would be written. The range should be 512 + * aligned and range-end is required. + * @param options The options parameters. + */ + PageBlob.prototype.uploadPagesFromURL = function (sourceUrl, sourceRange, contentLength, range, options) { + var operationArguments = { sourceUrl: sourceUrl, sourceRange: sourceRange, contentLength: contentLength, range: range, - options: options - }, uploadPagesFromURLOperationSpec, callback); + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, uploadPagesFromURLOperationSpec); }; - PageBlob.prototype.getPageRanges = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, getPageRangesOperationSpec, callback); + /** + * The Get Page Ranges operation returns the list of valid page ranges for a page blob or snapshot of a + * page blob + * @param options The options parameters. + */ + PageBlob.prototype.getPageRanges = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, getPageRangesOperationSpec); }; - PageBlob.prototype.getPageRangesDiff = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, getPageRangesDiffOperationSpec, callback); + /** + * The Get Page Ranges Diff operation returns the list of valid page ranges for a page blob that were + * changed between target blob and previous snapshot. + * @param options The options parameters. + */ + PageBlob.prototype.getPageRangesDiff = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, getPageRangesDiffOperationSpec); }; - PageBlob.prototype.resize = function (blobContentLength, options, callback) { - return this.client.sendOperationRequest({ + /** + * Resize the Blob + * @param blobContentLength This header specifies the maximum size for the page blob, up to 1 TB. The + * page blob size must be aligned to a 512-byte boundary. + * @param options The options parameters. + */ + PageBlob.prototype.resize = function (blobContentLength, options) { + var operationArguments = { blobContentLength: blobContentLength, - options: options - }, resizeOperationSpec, callback); + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, resizeOperationSpec); }; - PageBlob.prototype.updateSequenceNumber = function (sequenceNumberAction, options, callback) { - return this.client.sendOperationRequest({ + /** + * Update the sequence number of the blob + * @param sequenceNumberAction Required if the x-ms-blob-sequence-number header is set for the request. + * This property applies to page blobs only. This property indicates how the service should modify the + * blob's sequence number + * @param options The options parameters. + */ + PageBlob.prototype.updateSequenceNumber = function (sequenceNumberAction, options) { + var operationArguments = { sequenceNumberAction: sequenceNumberAction, - options: options - }, updateSequenceNumberOperationSpec, callback); - }; - PageBlob.prototype.copyIncremental = function (copySource, options, callback) { - return this.client.sendOperationRequest({ + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, updateSequenceNumberOperationSpec); + }; + /** + * The Copy Incremental operation copies a snapshot of the source page blob to a destination page blob. + * The snapshot is copied such that only the differential changes between the previously copied + * snapshot are transferred to the destination. The copied snapshots are complete copies of the + * original snapshot and can be read or copied from as usual. This API is supported since REST version + * 2016-05-31. + * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to + * 2 KB in length that specifies a page blob snapshot. The value should be URL-encoded as it would + * appear in a request URI. The source blob must either be public or must be authenticated via a shared + * access signature. + * @param options The options parameters. + */ + PageBlob.prototype.copyIncremental = function (copySource, options) { + var operationArguments = { copySource: copySource, - options: options - }, copyIncrementalOperationSpec, callback); + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, copyIncrementalOperationSpec); }; return PageBlob; }()); // Operation Specifications -var serializer$3 = new coreHttp.Serializer(Mappers$3, true); +var xmlSerializer$3 = new coreHttp.Serializer(Mappers, /* isXml */ true); +var serializer = new coreHttp.Serializer(Mappers, /* isXml */ false); var createOperationSpec$1 = { + path: "/{containerName}/{blob}", httpMethod: "PUT", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds - ], - headerParameters: [ - contentLength, - tier0, - metadata, - encryptionScope, - blobContentLength, - blobSequenceNumber, - version, - requestId, - blobTagsString, - blobType0, - blobContentType, - blobContentEncoding, - blobContentLanguage, - blobContentMD5, - blobCacheControl, - blobContentDisposition, - leaseId0, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags - ], responses: { 201: { headersMapper: PageBlobCreateHeaders }, default: { bodyMapper: StorageError, - headersMapper: PageBlobCreateHeaders + headersMapper: PageBlobCreateExceptionHeaders } }, - isXML: true, - serializer: serializer$3 -}; -var uploadPagesOperationSpec = { - httpMethod: "PUT", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds, - comp17 - ], + queryParameters: [timeoutInSeconds], + urlParameters: [url], headerParameters: [ - contentLength, - transactionalContentMD5, - transactionalContentCrc64, - range0, - encryptionScope, version, requestId, - pageWrite0, - leaseId0, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifSequenceNumberLessThanOrEqualTo, - ifSequenceNumberLessThan, - ifSequenceNumberEqualTo, + accept1, + contentLength, + metadata, + leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, - ifTags + encryptionKey, + encryptionKeySha256, + encryptionAlgorithm, + ifTags, + blobCacheControl, + blobContentType, + blobContentMD5, + blobContentEncoding, + blobContentLanguage, + blobContentDisposition, + encryptionScope, + tier, + blobTagsString, + blobType, + blobContentLength, + blobSequenceNumber ], - requestBody: { - parameterPath: "body", - mapper: { - required: true, - serializedName: "body", - type: { - name: "Stream" - } - } - }, - contentType: "application/octet-stream", + isXML: true, + serializer: xmlSerializer$3 +}; +var uploadPagesOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 201: { headersMapper: PageBlobUploadPagesHeaders }, default: { bodyMapper: StorageError, - headersMapper: PageBlobUploadPagesHeaders + headersMapper: PageBlobUploadPagesExceptionHeaders } }, - isXML: true, - serializer: serializer$3 -}; -var clearPagesOperationSpec = { - httpMethod: "PUT", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds, - comp17 - ], + requestBody: body1, + queryParameters: [timeoutInSeconds, comp17], + urlParameters: [url], headerParameters: [ - contentLength, - range0, - encryptionScope, version, requestId, - pageWrite1, - leaseId0, + contentLength, + leaseId, + ifModifiedSince, + ifUnmodifiedSince, + ifMatch, + ifNoneMatch, + range, encryptionKey, encryptionKeySha256, encryptionAlgorithm, + ifTags, + encryptionScope, + transactionalContentMD5, + transactionalContentCrc64, + contentType2, + accept2, + pageWrite, ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, - ifSequenceNumberEqualTo, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags + ifSequenceNumberEqualTo ], + mediaType: "binary", + serializer: serializer +}; +var clearPagesOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 201: { headersMapper: PageBlobClearPagesHeaders }, default: { bodyMapper: StorageError, - headersMapper: PageBlobClearPagesHeaders + headersMapper: PageBlobClearPagesExceptionHeaders } }, - isXML: true, - serializer: serializer$3 -}; -var uploadPagesFromURLOperationSpec = { - httpMethod: "PUT", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds, - comp17 - ], + queryParameters: [timeoutInSeconds, comp17], + urlParameters: [url], headerParameters: [ - sourceUrl, - sourceRange0, - sourceContentMD5, - sourceContentCrc64, - contentLength, - range1, - encryptionScope, version, requestId, - pageWrite0, + accept1, + contentLength, + leaseId, + ifModifiedSince, + ifUnmodifiedSince, + ifMatch, + ifNoneMatch, + range, encryptionKey, encryptionKeySha256, encryptionAlgorithm, - leaseId0, + ifTags, + encryptionScope, ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch + pageWrite1 ], + isXML: true, + serializer: xmlSerializer$3 +}; +var uploadPagesFromURLOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 201: { headersMapper: PageBlobUploadPagesFromURLHeaders }, default: { bodyMapper: StorageError, - headersMapper: PageBlobUploadPagesFromURLHeaders + headersMapper: PageBlobUploadPagesFromURLExceptionHeaders } }, - isXML: true, - serializer: serializer$3 -}; -var getPageRangesOperationSpec = { - httpMethod: "GET", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], - queryParameters: [ - snapshot, - timeoutInSeconds, - comp18 - ], + queryParameters: [timeoutInSeconds, comp17], + urlParameters: [url], headerParameters: [ - range0, version, requestId, - leaseId0, + accept1, + contentLength, + leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, - ifTags + sourceIfModifiedSince, + sourceIfUnmodifiedSince, + sourceIfMatch, + sourceIfNoneMatch, + encryptionKey, + encryptionKeySha256, + encryptionAlgorithm, + ifTags, + encryptionScope, + sourceContentMD5, + pageWrite, + ifSequenceNumberLessThanOrEqualTo, + ifSequenceNumberLessThan, + ifSequenceNumberEqualTo, + sourceUrl, + sourceRange, + sourceContentCrc64, + range1 ], + isXML: true, + serializer: xmlSerializer$3 +}; +var getPageRangesOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "GET", responses: { 200: { bodyMapper: PageList, @@ -30865,36 +31321,33 @@ var getPageRangesOperationSpec = { }, default: { bodyMapper: StorageError, - headersMapper: PageBlobGetPageRangesHeaders + headersMapper: PageBlobGetPageRangesExceptionHeaders } }, - isXML: true, - serializer: serializer$3 -}; -var getPageRangesDiffOperationSpec = { - httpMethod: "GET", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], queryParameters: [ - snapshot, timeoutInSeconds, - prevsnapshot, + snapshot, comp18 ], + urlParameters: [url], headerParameters: [ - prevSnapshotUrl, - range0, version, requestId, - leaseId0, + accept1, + leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, + range, ifTags ], + isXML: true, + serializer: xmlSerializer$3 +}; +var getPageRangesDiffOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "GET", responses: { 200: { bodyMapper: PageList, @@ -30902,726 +31355,733 @@ var getPageRangesDiffOperationSpec = { }, default: { bodyMapper: StorageError, - headersMapper: PageBlobGetPageRangesDiffHeaders + headersMapper: PageBlobGetPageRangesDiffExceptionHeaders } }, - isXML: true, - serializer: serializer$3 -}; -var resizeOperationSpec = { - httpMethod: "PUT", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], queryParameters: [ timeoutInSeconds, - comp0 + snapshot, + comp18, + prevsnapshot ], + urlParameters: [url], headerParameters: [ - encryptionScope, - blobContentLength, version, requestId, - leaseId0, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, + accept1, + leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, - ifTags + range, + ifTags, + prevSnapshotUrl ], + isXML: true, + serializer: xmlSerializer$3 +}; +var resizeOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 200: { headersMapper: PageBlobResizeHeaders }, default: { bodyMapper: StorageError, - headersMapper: PageBlobResizeHeaders + headersMapper: PageBlobResizeExceptionHeaders } }, - isXML: true, - serializer: serializer$3 -}; -var updateSequenceNumberOperationSpec = { - httpMethod: "PUT", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds, - comp0 - ], + queryParameters: [comp, timeoutInSeconds], + urlParameters: [url], headerParameters: [ - sequenceNumberAction, - blobSequenceNumber, version, requestId, - leaseId0, + accept1, + leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, - ifTags + encryptionKey, + encryptionKeySha256, + encryptionAlgorithm, + ifTags, + encryptionScope, + blobContentLength ], + isXML: true, + serializer: xmlSerializer$3 +}; +var updateSequenceNumberOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 200: { headersMapper: PageBlobUpdateSequenceNumberHeaders }, default: { bodyMapper: StorageError, - headersMapper: PageBlobUpdateSequenceNumberHeaders + headersMapper: PageBlobUpdateSequenceNumberExceptionHeaders } }, - isXML: true, - serializer: serializer$3 -}; -var copyIncrementalOperationSpec = { - httpMethod: "PUT", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds, - comp19 - ], + queryParameters: [comp, timeoutInSeconds], + urlParameters: [url], headerParameters: [ - copySource, version, requestId, + accept1, + leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, - ifTags + ifTags, + blobSequenceNumber, + sequenceNumberAction ], + isXML: true, + serializer: xmlSerializer$3 +}; +var copyIncrementalOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 202: { headersMapper: PageBlobCopyIncrementalHeaders }, default: { bodyMapper: StorageError, - headersMapper: PageBlobCopyIncrementalHeaders + headersMapper: PageBlobCopyIncrementalExceptionHeaders } }, + queryParameters: [timeoutInSeconds, comp19], + urlParameters: [url], + headerParameters: [ + version, + requestId, + accept1, + ifModifiedSince, + ifUnmodifiedSince, + ifMatch, + ifNoneMatch, + ifTags, + copySource + ], isXML: true, - serializer: serializer$3 + serializer: xmlSerializer$3 }; /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ - -var Mappers$4 = /*#__PURE__*/Object.freeze({ - __proto__: null, - AppendBlobAppendBlockFromUrlHeaders: AppendBlobAppendBlockFromUrlHeaders, - AppendBlobAppendBlockHeaders: AppendBlobAppendBlockHeaders, - AppendBlobCreateHeaders: AppendBlobCreateHeaders, - AppendBlobSealHeaders: AppendBlobSealHeaders, - StorageError: StorageError -}); - -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ /** Class representing a AppendBlob. */ var AppendBlob = /** @class */ (function () { /** - * Create a AppendBlob. - * @param {StorageClientContext} client Reference to the service client. + * Initialize a new instance of the class AppendBlob class. + * @param client Reference to the service client */ function AppendBlob(client) { this.client = client; } - AppendBlob.prototype.create = function (contentLength, options, callback) { - return this.client.sendOperationRequest({ - contentLength: contentLength, - options: options - }, createOperationSpec$2, callback); - }; - AppendBlob.prototype.appendBlock = function (body, contentLength, options, callback) { - return this.client.sendOperationRequest({ - body: body, - contentLength: contentLength, - options: options - }, appendBlockOperationSpec, callback); - }; - AppendBlob.prototype.appendBlockFromUrl = function (sourceUrl, contentLength, options, callback) { - return this.client.sendOperationRequest({ - sourceUrl: sourceUrl, + /** + * The Create Append Blob operation creates a new append blob. + * @param contentLength The length of the request. + * @param options The options parameters. + */ + AppendBlob.prototype.create = function (contentLength, options) { + var operationArguments = { contentLength: contentLength, - options: options - }, appendBlockFromUrlOperationSpec, callback); - }; - AppendBlob.prototype.seal = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, sealOperationSpec, callback); + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, createOperationSpec$2); }; - return AppendBlob; -}()); -// Operation Specifications -var serializer$4 = new coreHttp.Serializer(Mappers$4, true); -var createOperationSpec$2 = { - httpMethod: "PUT", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds - ], - headerParameters: [ - contentLength, - metadata, - encryptionScope, - version, - requestId, - blobTagsString, - blobType1, - blobContentType, - blobContentEncoding, - blobContentLanguage, - blobContentMD5, - blobCacheControl, - blobContentDisposition, - leaseId0, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags - ], + /** + * The Append Block operation commits a new block of data to the end of an existing append blob. The + * Append Block operation is permitted only if the blob was created with x-ms-blob-type set to + * AppendBlob. Append Block is supported only on version 2015-02-21 version or later. + * @param contentLength The length of the request. + * @param body Initial data + * @param options The options parameters. + */ + AppendBlob.prototype.appendBlock = function (contentLength, body, options) { + var operationArguments = { + contentLength: contentLength, + body: body, + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, appendBlockOperationSpec); + }; + /** + * The Append Block operation commits a new block of data to the end of an existing append blob where + * the contents are read from a source url. The Append Block operation is permitted only if the blob + * was created with x-ms-blob-type set to AppendBlob. Append Block is supported only on version + * 2015-02-21 version or later. + * @param sourceUrl Specify a URL to the copy source. + * @param contentLength The length of the request. + * @param options The options parameters. + */ + AppendBlob.prototype.appendBlockFromUrl = function (sourceUrl, contentLength, options) { + var operationArguments = { + sourceUrl: sourceUrl, + contentLength: contentLength, + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, appendBlockFromUrlOperationSpec); + }; + /** + * The Seal operation seals the Append Blob to make it read-only. Seal is supported only on version + * 2019-12-12 version or later. + * @param options The options parameters. + */ + AppendBlob.prototype.seal = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, sealOperationSpec); + }; + return AppendBlob; +}()); +// Operation Specifications +var xmlSerializer$4 = new coreHttp.Serializer(Mappers, /* isXml */ true); +var serializer$1 = new coreHttp.Serializer(Mappers, /* isXml */ false); +var createOperationSpec$2 = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 201: { headersMapper: AppendBlobCreateHeaders }, default: { bodyMapper: StorageError, - headersMapper: AppendBlobCreateHeaders + headersMapper: AppendBlobCreateExceptionHeaders } }, - isXML: true, - serializer: serializer$4 -}; -var appendBlockOperationSpec = { - httpMethod: "PUT", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds, - comp20 - ], + queryParameters: [timeoutInSeconds], + urlParameters: [url], headerParameters: [ - contentLength, - transactionalContentMD5, - transactionalContentCrc64, - encryptionScope, version, requestId, - leaseId0, - maxSize, - appendPosition, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, + accept1, + contentLength, + metadata, + leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, - ifTags + encryptionKey, + encryptionKeySha256, + encryptionAlgorithm, + ifTags, + blobCacheControl, + blobContentType, + blobContentMD5, + blobContentEncoding, + blobContentLanguage, + blobContentDisposition, + encryptionScope, + blobTagsString, + blobType1 ], - requestBody: { - parameterPath: "body", - mapper: { - required: true, - serializedName: "body", - type: { - name: "Stream" - } - } - }, - contentType: "application/octet-stream", + isXML: true, + serializer: xmlSerializer$4 +}; +var appendBlockOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 201: { headersMapper: AppendBlobAppendBlockHeaders }, default: { bodyMapper: StorageError, - headersMapper: AppendBlobAppendBlockHeaders + headersMapper: AppendBlobAppendBlockExceptionHeaders } }, - isXML: true, - serializer: serializer$4 -}; -var appendBlockFromUrlOperationSpec = { - httpMethod: "PUT", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds, - comp20 - ], + requestBody: body1, + queryParameters: [timeoutInSeconds, comp20], + urlParameters: [url], headerParameters: [ - sourceUrl, - sourceRange1, - sourceContentMD5, - sourceContentCrc64, - contentLength, - transactionalContentMD5, - encryptionScope, version, requestId, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - leaseId0, - maxSize, - appendPosition, + contentLength, + leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, + encryptionKey, + encryptionKeySha256, + encryptionAlgorithm, ifTags, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch + encryptionScope, + transactionalContentMD5, + transactionalContentCrc64, + contentType2, + accept2, + maxSize, + appendPosition ], + mediaType: "binary", + serializer: serializer$1 +}; +var appendBlockFromUrlOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 201: { headersMapper: AppendBlobAppendBlockFromUrlHeaders }, default: { bodyMapper: StorageError, - headersMapper: AppendBlobAppendBlockFromUrlHeaders + headersMapper: AppendBlobAppendBlockFromUrlExceptionHeaders } }, - isXML: true, - serializer: serializer$4 -}; -var sealOperationSpec = { - httpMethod: "PUT", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds, - comp21 - ], + queryParameters: [timeoutInSeconds, comp20], + urlParameters: [url], headerParameters: [ version, requestId, - leaseId0, + accept1, + contentLength, + leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, - appendPosition + sourceIfModifiedSince, + sourceIfUnmodifiedSince, + sourceIfMatch, + sourceIfNoneMatch, + encryptionKey, + encryptionKeySha256, + encryptionAlgorithm, + ifTags, + encryptionScope, + sourceContentMD5, + transactionalContentMD5, + sourceUrl, + sourceContentCrc64, + maxSize, + appendPosition, + sourceRange1 ], + isXML: true, + serializer: xmlSerializer$4 +}; +var sealOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 200: { headersMapper: AppendBlobSealHeaders }, default: { bodyMapper: StorageError, - headersMapper: AppendBlobSealHeaders + headersMapper: AppendBlobSealExceptionHeaders } }, + queryParameters: [timeoutInSeconds, comp21], + urlParameters: [url], + headerParameters: [ + version, + requestId, + accept1, + leaseId, + ifModifiedSince, + ifUnmodifiedSince, + ifMatch, + ifNoneMatch, + appendPosition + ], isXML: true, - serializer: serializer$4 + serializer: xmlSerializer$4 }; /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ - -var Mappers$5 = /*#__PURE__*/Object.freeze({ - __proto__: null, - Block: Block, - BlockBlobCommitBlockListHeaders: BlockBlobCommitBlockListHeaders, - BlockBlobGetBlockListHeaders: BlockBlobGetBlockListHeaders, - BlockBlobPutBlobFromUrlHeaders: BlockBlobPutBlobFromUrlHeaders, - BlockBlobStageBlockFromURLHeaders: BlockBlobStageBlockFromURLHeaders, - BlockBlobStageBlockHeaders: BlockBlobStageBlockHeaders, - BlockBlobUploadHeaders: BlockBlobUploadHeaders, - BlockList: BlockList, - BlockLookupList: BlockLookupList, - StorageError: StorageError -}); - -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ /** Class representing a BlockBlob. */ var BlockBlob = /** @class */ (function () { /** - * Create a BlockBlob. - * @param {StorageClientContext} client Reference to the service client. + * Initialize a new instance of the class BlockBlob class. + * @param client Reference to the service client */ function BlockBlob(client) { this.client = client; } - BlockBlob.prototype.upload = function (body, contentLength, options, callback) { - return this.client.sendOperationRequest({ - body: body, + /** + * The Upload Block Blob operation updates the content of an existing block blob. Updating an existing + * block blob overwrites any existing metadata on the blob. Partial updates are not supported with Put + * Blob; the content of the existing blob is overwritten with the content of the new blob. To perform a + * partial update of the content of a block blob, use the Put Block List operation. + * @param contentLength The length of the request. + * @param body Initial data + * @param options The options parameters. + */ + BlockBlob.prototype.upload = function (contentLength, body, options) { + var operationArguments = { contentLength: contentLength, - options: options - }, uploadOperationSpec, callback); - }; - BlockBlob.prototype.putBlobFromUrl = function (contentLength, copySource, options, callback) { - return this.client.sendOperationRequest({ + body: body, + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, uploadOperationSpec); + }; + /** + * The Put Blob from URL operation creates a new Block Blob where the contents of the blob are read + * from a given URL. This API is supported beginning with the 2020-04-08 version. Partial updates are + * not supported with Put Blob from URL; the content of an existing blob is overwritten with the + * content of the new blob. To perform partial updates to a block blob’s contents using a source URL, + * use the Put Block from URL API in conjunction with Put Block List. + * @param contentLength The length of the request. + * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to + * 2 KB in length that specifies a page blob snapshot. The value should be URL-encoded as it would + * appear in a request URI. The source blob must either be public or must be authenticated via a shared + * access signature. + * @param options The options parameters. + */ + BlockBlob.prototype.putBlobFromUrl = function (contentLength, copySource, options) { + var operationArguments = { contentLength: contentLength, copySource: copySource, - options: options - }, putBlobFromUrlOperationSpec, callback); + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, putBlobFromUrlOperationSpec); }; - BlockBlob.prototype.stageBlock = function (blockId, contentLength, body, options, callback) { - return this.client.sendOperationRequest({ + /** + * The Stage Block operation creates a new block to be committed as part of a blob + * @param blockId A valid Base64 string value that identifies the block. Prior to encoding, the string + * must be less than or equal to 64 bytes in size. For a given blob, the length of the value specified + * for the blockid parameter must be the same size for each block. + * @param contentLength The length of the request. + * @param body Initial data + * @param options The options parameters. + */ + BlockBlob.prototype.stageBlock = function (blockId, contentLength, body, options) { + var operationArguments = { blockId: blockId, contentLength: contentLength, body: body, - options: options - }, stageBlockOperationSpec, callback); + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, stageBlockOperationSpec); }; - BlockBlob.prototype.stageBlockFromURL = function (blockId, contentLength, sourceUrl, options, callback) { - return this.client.sendOperationRequest({ + /** + * The Stage Block operation creates a new block to be committed as part of a blob where the contents + * are read from a URL. + * @param blockId A valid Base64 string value that identifies the block. Prior to encoding, the string + * must be less than or equal to 64 bytes in size. For a given blob, the length of the value specified + * for the blockid parameter must be the same size for each block. + * @param contentLength The length of the request. + * @param sourceUrl Specify a URL to the copy source. + * @param options The options parameters. + */ + BlockBlob.prototype.stageBlockFromURL = function (blockId, contentLength, sourceUrl, options) { + var operationArguments = { blockId: blockId, contentLength: contentLength, sourceUrl: sourceUrl, - options: options - }, stageBlockFromURLOperationSpec, callback); + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, stageBlockFromURLOperationSpec); }; - BlockBlob.prototype.commitBlockList = function (blocks, options, callback) { - return this.client.sendOperationRequest({ + /** + * The Commit Block List operation writes a blob by specifying the list of block IDs that make up the + * blob. In order to be written as part of a blob, a block must have been successfully written to the + * server in a prior Put Block operation. You can call Put Block List to update a blob by uploading + * only those blocks that have changed, then committing the new and existing blocks together. You can + * do this by specifying whether to commit a block from the committed block list or from the + * uncommitted block list, or to commit the most recently uploaded version of the block, whichever list + * it may belong to. + * @param blocks + * @param options The options parameters. + */ + BlockBlob.prototype.commitBlockList = function (blocks, options) { + var operationArguments = { blocks: blocks, - options: options - }, commitBlockListOperationSpec, callback); + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, commitBlockListOperationSpec); }; - BlockBlob.prototype.getBlockList = function (listType, options, callback) { - return this.client.sendOperationRequest({ + /** + * The Get Block List operation retrieves the list of blocks that have been uploaded as part of a block + * blob + * @param listType Specifies whether to return the list of committed blocks, the list of uncommitted + * blocks, or both lists together. + * @param options The options parameters. + */ + BlockBlob.prototype.getBlockList = function (listType, options) { + var operationArguments = { listType: listType, - options: options - }, getBlockListOperationSpec, callback); + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, getBlockListOperationSpec); }; return BlockBlob; }()); // Operation Specifications -var serializer$5 = new coreHttp.Serializer(Mappers$5, true); +var xmlSerializer$5 = new coreHttp.Serializer(Mappers, /* isXml */ true); +var serializer$2 = new coreHttp.Serializer(Mappers, /* isXml */ false); var uploadOperationSpec = { + path: "/{containerName}/{blob}", httpMethod: "PUT", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds - ], + responses: { + 201: { + headersMapper: BlockBlobUploadHeaders + }, + default: { + bodyMapper: StorageError, + headersMapper: BlockBlobUploadExceptionHeaders + } + }, + requestBody: body1, + queryParameters: [timeoutInSeconds], + urlParameters: [url], headerParameters: [ - transactionalContentMD5, - contentLength, - metadata, - encryptionScope, - tier0, version, requestId, - blobTagsString, - blobType2, - blobContentType, - blobContentEncoding, - blobContentLanguage, - blobContentMD5, - blobCacheControl, - blobContentDisposition, - leaseId0, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, + contentLength, + metadata, + leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, - ifTags + encryptionKey, + encryptionKeySha256, + encryptionAlgorithm, + ifTags, + blobCacheControl, + blobContentType, + blobContentMD5, + blobContentEncoding, + blobContentLanguage, + blobContentDisposition, + encryptionScope, + tier, + blobTagsString, + transactionalContentMD5, + contentType2, + accept2, + blobType2 ], - requestBody: { - parameterPath: "body", - mapper: { - required: true, - serializedName: "body", - type: { - name: "Stream" - } - } - }, - contentType: "application/octet-stream", + mediaType: "binary", + serializer: serializer$2 +}; +var putBlobFromUrlOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 201: { - headersMapper: BlockBlobUploadHeaders + headersMapper: BlockBlobPutBlobFromUrlHeaders }, default: { bodyMapper: StorageError, - headersMapper: BlockBlobUploadHeaders + headersMapper: BlockBlobPutBlobFromUrlExceptionHeaders } }, - isXML: true, - serializer: serializer$5 -}; -var putBlobFromUrlOperationSpec = { - httpMethod: "PUT", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds - ], + queryParameters: [timeoutInSeconds], + urlParameters: [url], headerParameters: [ - transactionalContentMD5, - contentLength, - metadata, - encryptionScope, - tier0, version, requestId, - sourceContentMD5, - blobTagsString, - copySource, - copySourceBlobProperties, - blobType2, - blobContentType, - blobContentEncoding, - blobContentLanguage, - blobContentMD5, - blobCacheControl, - blobContentDisposition, - leaseId0, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, + accept1, + contentLength, + metadata, + leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, - ifTags, sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatch, sourceIfNoneMatch, - sourceIfTags + encryptionKey, + encryptionKeySha256, + encryptionAlgorithm, + ifTags, + blobCacheControl, + blobContentType, + blobContentMD5, + blobContentEncoding, + blobContentLanguage, + blobContentDisposition, + encryptionScope, + tier, + sourceIfTags, + copySource, + blobTagsString, + sourceContentMD5, + transactionalContentMD5, + blobType2, + copySourceBlobProperties ], + isXML: true, + serializer: xmlSerializer$5 +}; +var stageBlockOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 201: { - headersMapper: BlockBlobPutBlobFromUrlHeaders + headersMapper: BlockBlobStageBlockHeaders }, default: { bodyMapper: StorageError, - headersMapper: BlockBlobPutBlobFromUrlHeaders + headersMapper: BlockBlobStageBlockExceptionHeaders } }, - isXML: true, - serializer: serializer$5 -}; -var stageBlockOperationSpec = { - httpMethod: "PUT", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], + requestBody: body1, queryParameters: [ - blockId, timeoutInSeconds, - comp22 + comp22, + blockId ], + urlParameters: [url], headerParameters: [ - contentLength, - transactionalContentMD5, - transactionalContentCrc64, - encryptionScope, version, requestId, - leaseId0, + contentLength, + leaseId, encryptionKey, encryptionKeySha256, - encryptionAlgorithm + encryptionAlgorithm, + encryptionScope, + transactionalContentMD5, + transactionalContentCrc64, + contentType2, + accept2 ], - requestBody: { - parameterPath: "body", - mapper: { - required: true, - serializedName: "body", - type: { - name: "Stream" - } - } - }, - contentType: "application/octet-stream", + mediaType: "binary", + serializer: serializer$2 +}; +var stageBlockFromURLOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 201: { - headersMapper: BlockBlobStageBlockHeaders + headersMapper: BlockBlobStageBlockFromURLHeaders }, default: { bodyMapper: StorageError, - headersMapper: BlockBlobStageBlockHeaders + headersMapper: BlockBlobStageBlockFromURLExceptionHeaders } }, - isXML: true, - serializer: serializer$5 -}; -var stageBlockFromURLOperationSpec = { - httpMethod: "PUT", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], queryParameters: [ - blockId, timeoutInSeconds, - comp22 + comp22, + blockId ], + urlParameters: [url], headerParameters: [ - contentLength, - sourceUrl, - sourceRange1, - sourceContentMD5, - sourceContentCrc64, - encryptionScope, version, requestId, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - leaseId0, + accept1, + contentLength, + leaseId, sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatch, - sourceIfNoneMatch + sourceIfNoneMatch, + encryptionKey, + encryptionKeySha256, + encryptionAlgorithm, + encryptionScope, + sourceContentMD5, + sourceUrl, + sourceContentCrc64, + sourceRange1 ], + isXML: true, + serializer: xmlSerializer$5 +}; +var commitBlockListOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 201: { - headersMapper: BlockBlobStageBlockFromURLHeaders + headersMapper: BlockBlobCommitBlockListHeaders }, default: { bodyMapper: StorageError, - headersMapper: BlockBlobStageBlockFromURLHeaders + headersMapper: BlockBlobCommitBlockListExceptionHeaders } }, - isXML: true, - serializer: serializer$5 -}; -var commitBlockListOperationSpec = { - httpMethod: "PUT", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds, - comp23 - ], + requestBody: blocks, + queryParameters: [timeoutInSeconds, comp23], + urlParameters: [url], headerParameters: [ - transactionalContentMD5, - transactionalContentCrc64, - metadata, - encryptionScope, - tier0, + contentType, + accept, version, requestId, - blobTagsString, + metadata, + leaseId, + ifModifiedSince, + ifUnmodifiedSince, + ifMatch, + ifNoneMatch, + encryptionKey, + encryptionKeySha256, + encryptionAlgorithm, + ifTags, blobCacheControl, blobContentType, + blobContentMD5, blobContentEncoding, blobContentLanguage, - blobContentMD5, blobContentDisposition, - leaseId0, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags + encryptionScope, + tier, + blobTagsString, + transactionalContentMD5, + transactionalContentCrc64 ], - requestBody: { - parameterPath: "blocks", - mapper: tslib.__assign(tslib.__assign({}, BlockLookupList), { required: true }) - }, + isXML: true, contentType: "application/xml; charset=utf-8", + mediaType: "xml", + serializer: xmlSerializer$5 +}; +var getBlockListOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "GET", responses: { - 201: { - headersMapper: BlockBlobCommitBlockListHeaders + 200: { + bodyMapper: BlockList, + headersMapper: BlockBlobGetBlockListHeaders }, default: { bodyMapper: StorageError, - headersMapper: BlockBlobCommitBlockListHeaders + headersMapper: BlockBlobGetBlockListExceptionHeaders } }, - isXML: true, - serializer: serializer$5 -}; -var getBlockListOperationSpec = { - httpMethod: "GET", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], queryParameters: [ - snapshot, - listType, timeoutInSeconds, - comp23 + snapshot, + comp23, + listType ], + urlParameters: [url], headerParameters: [ version, requestId, - leaseId0, + accept1, + leaseId, ifTags ], - responses: { - 200: { - bodyMapper: BlockList, - headersMapper: BlockBlobGetBlockListHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobGetBlockListHeaders - } - }, isXML: true, - serializer: serializer$5 + serializer: xmlSerializer$5 }; // Copyright (c) Microsoft Corporation. @@ -31632,8 +32092,8 @@ var logger = logger$1.createClientLogger("storage-blob"); // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -var SDK_VERSION = "12.5.0"; -var SERVICE_VERSION = "2020-06-12"; +var SDK_VERSION = "12.6.0"; +var SERVICE_VERSION = "2020-08-04"; var BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES = 256 * 1024 * 1024; // 256MB var BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES = 4000 * 1024 * 1024; // 4000MB var BLOCK_BLOB_MAX_BLOCKS = 50000; @@ -33178,29 +33638,28 @@ var StorageSharedKeyCredential = /** @class */ (function (_super) { }(Credential)); /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ var packageName = "azure-storage-blob"; -var packageVersion = "12.5.0"; +var packageVersion = "12.6.0-beta.1"; var StorageClientContext = /** @class */ (function (_super) { tslib.__extends(StorageClientContext, _super); /** * Initializes a new instance of the StorageClientContext class. * @param url The URL of the service account, container, or blob that is the targe of the desired - * operation. - * @param [options] The parameter options + * operation. + * @param options The parameter options */ function StorageClientContext(url, options) { var _this = this; - if (url == undefined) { - throw new Error("'url' cannot be null."); + if (url === undefined) { + throw new Error("'url' cannot be null"); } + // Initializing default values for options if (!options) { options = {}; } @@ -33209,10 +33668,12 @@ var StorageClientContext = /** @class */ (function (_super) { options.userAgent = packageName + "/" + packageVersion + " " + defaultUserAgent; } _this = _super.call(this, undefined, options) || this; - _this.version = '2020-06-12'; - _this.baseUri = "{url}"; _this.requestContentType = "application/json; charset=utf-8"; + _this.baseUri = options.endpoint || "{url}"; + // Parameter assignments _this.url = url; + // Assigning values to Constant parameters + _this.version = options.version || "2020-08-04"; return _this; } return StorageClientContext; @@ -33273,9 +33734,10 @@ var createSpan = coreTracing.createSpanFunction({ * two separate fields, not just one). */ function convertTracingToRequestOptionsBase(options) { - var _a; + var _a, _b; return { - spanOptions: (_a = options === null || options === void 0 ? void 0 : options.tracingOptions) === null || _a === void 0 ? void 0 : _a.spanOptions + spanOptions: (_a = options === null || options === void 0 ? void 0 : options.tracingOptions) === null || _a === void 0 ? void 0 : _a.spanOptions, + tracingContext: (_b = options === null || options === void 0 ? void 0 : options.tracingOptions) === null || _b === void 0 ? void 0 : _b.tracingContext }; } @@ -34347,7 +34809,8 @@ var BlobLeaseClient = /** @class */ (function () { _g = createSpan("BlobLeaseClient-acquireLease", options), span = _g.span, updatedOptions = _g.updatedOptions; 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))) { + (((_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))) { 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."); } _h.label = 1; @@ -34358,7 +34821,7 @@ var BlobLeaseClient = /** @class */ (function () { case 3: e_1 = _h.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_1.message }); throw e_1; @@ -34391,7 +34854,8 @@ var BlobLeaseClient = /** @class */ (function () { _g = createSpan("BlobLeaseClient-changeLease", options), span = _g.span, updatedOptions = _g.updatedOptions; 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))) { + (((_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))) { 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."); } _h.label = 1; @@ -34405,7 +34869,7 @@ var BlobLeaseClient = /** @class */ (function () { case 3: e_2 = _h.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_2.message }); throw e_2; @@ -34438,7 +34902,8 @@ var BlobLeaseClient = /** @class */ (function () { _g = createSpan("BlobLeaseClient-releaseLease", options), span = _g.span, updatedOptions = _g.updatedOptions; 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))) { + (((_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))) { 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."); } _h.label = 1; @@ -34449,7 +34914,7 @@ var BlobLeaseClient = /** @class */ (function () { case 3: e_3 = _h.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_3.message }); throw e_3; @@ -34481,7 +34946,8 @@ var BlobLeaseClient = /** @class */ (function () { _g = createSpan("BlobLeaseClient-renewLease", options), span = _g.span, updatedOptions = _g.updatedOptions; 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))) { + (((_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))) { 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."); } _h.label = 1; @@ -34492,7 +34958,7 @@ var BlobLeaseClient = /** @class */ (function () { case 3: e_4 = _h.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_4.message }); throw e_4; @@ -34526,7 +34992,8 @@ var BlobLeaseClient = /** @class */ (function () { _g = createSpan("BlobLeaseClient-breakLease", options), span = _g.span, updatedOptions = _g.updatedOptions; 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))) { + (((_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))) { 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."); } _h.label = 1; @@ -34538,7 +35005,7 @@ var BlobLeaseClient = /** @class */ (function () { case 3: e_5 = _h.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_5.message }); throw e_5; @@ -37948,7 +38415,9 @@ var BlobClient = /** @class */ (function (_super) { _c.label = 1; case 1: _c.trys.push([1, 3, 4, 5]); - return [4 /*yield*/, this.blobContext.download(tslib.__assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), onDownloadProgress: coreHttp.isNode ? undefined : options.onProgress, range: offset === 0 && !count ? undefined : rangeToString({ offset: offset, count: count }), rangeGetContentMD5: options.rangeGetContentMD5, rangeGetContentCRC64: options.rangeGetContentCrc64, snapshot: options.snapshot, cpkInfo: options.customerProvidedKey }, convertTracingToRequestOptionsBase(updatedOptions)))]; + return [4 /*yield*/, this.blobContext.download(tslib.__assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), requestOptions: { + onDownloadProgress: coreHttp.isNode ? undefined : options.onProgress // for Node.js, progress is reported by RetriableReadableStream + }, range: offset === 0 && !count ? undefined : rangeToString({ offset: offset, count: count }), rangeGetContentMD5: options.rangeGetContentMD5, rangeGetContentCRC64: options.rangeGetContentCrc64, snapshot: options.snapshot, cpkInfo: options.customerProvidedKey }, convertTracingToRequestOptionsBase(updatedOptions)))]; case 2: res_1 = _c.sent(); wrappedRes = tslib.__assign(tslib.__assign({}, res_1), { _response: res_1._response, objectReplicationDestinationPolicyId: res_1.objectReplicationPolicyId, objectReplicationSourceProperties: parseObjectReplicationRecord(res_1.objectReplicationRules) }); @@ -38009,7 +38478,7 @@ var BlobClient = /** @class */ (function (_super) { case 3: e_1 = _c.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_1.message }); throw e_1; @@ -38055,13 +38524,13 @@ var BlobClient = /** @class */ (function (_super) { e_2 = _b.sent(); if (e_2.statusCode === 404) { span.setStatus({ - code: api.CanonicalCode.NOT_FOUND, + code: coreTracing.SpanStatusCode.ERROR, message: "Expected exception when checking blob existence" }); return [2 /*return*/, false]; } span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_2.message }); throw e_2; @@ -38106,7 +38575,7 @@ var BlobClient = /** @class */ (function (_super) { case 3: e_3 = _c.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_3.message }); throw e_3; @@ -38140,12 +38609,12 @@ var BlobClient = /** @class */ (function (_super) { _c.label = 1; case 1: _c.trys.push([1, 3, 4, 5]); - return [4 /*yield*/, this.blobContext.deleteMethod(tslib.__assign({ abortSignal: options.abortSignal, deleteSnapshots: options.deleteSnapshots, leaseAccessConditions: options.conditions, modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }) }, convertTracingToRequestOptionsBase(updatedOptions)))]; + return [4 /*yield*/, this.blobContext.delete(tslib.__assign({ abortSignal: options.abortSignal, deleteSnapshots: options.deleteSnapshots, leaseAccessConditions: options.conditions, modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }) }, convertTracingToRequestOptionsBase(updatedOptions)))]; case 2: return [2 /*return*/, _c.sent()]; case 3: e_4 = _c.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_4.message }); throw e_4; @@ -38187,13 +38656,13 @@ var BlobClient = /** @class */ (function (_super) { e_5 = _d.sent(); if (((_a = e_5.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobNotFound") { span.setStatus({ - code: api.CanonicalCode.NOT_FOUND, + code: coreTracing.SpanStatusCode.ERROR, message: "Expected exception when deleting a blob or snapshot only if it exists." }); return [2 /*return*/, tslib.__assign(tslib.__assign({ succeeded: false }, (_b = e_5.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e_5.response })]; } span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_5.message }); throw e_5; @@ -38229,7 +38698,7 @@ var BlobClient = /** @class */ (function (_super) { case 3: e_6 = _b.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_6.message }); throw e_6; @@ -38267,12 +38736,12 @@ var BlobClient = /** @class */ (function (_super) { case 1: _c.trys.push([1, 3, 4, 5]); ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return [4 /*yield*/, this.blobContext.setHTTPHeaders(tslib.__assign({ abortSignal: options.abortSignal, blobHTTPHeaders: blobHTTPHeaders, leaseAccessConditions: options.conditions, modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), cpkInfo: options.customerProvidedKey }, convertTracingToRequestOptionsBase(updatedOptions)))]; + return [4 /*yield*/, this.blobContext.setHttpHeaders(tslib.__assign({ abortSignal: options.abortSignal, blobHttpHeaders: blobHTTPHeaders, leaseAccessConditions: options.conditions, modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }) }, convertTracingToRequestOptionsBase(updatedOptions)))]; case 2: return [2 /*return*/, _c.sent()]; case 3: e_7 = _c.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_7.message }); throw e_7; @@ -38314,7 +38783,7 @@ var BlobClient = /** @class */ (function (_super) { case 3: e_8 = _c.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_8.message }); throw e_8; @@ -38352,7 +38821,7 @@ var BlobClient = /** @class */ (function (_super) { case 3: e_9 = _c.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_9.message }); throw e_9; @@ -38389,7 +38858,7 @@ var BlobClient = /** @class */ (function (_super) { case 3: e_10 = _c.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_10.message }); throw e_10; @@ -38435,7 +38904,7 @@ var BlobClient = /** @class */ (function (_super) { case 3: e_11 = _c.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_11.message }); throw e_11; @@ -38594,7 +39063,7 @@ var BlobClient = /** @class */ (function (_super) { case 3: e_12 = _b.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_12.message }); throw e_12; @@ -38638,7 +39107,7 @@ var BlobClient = /** @class */ (function (_super) { case 3: e_13 = _c.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_13.message }); throw e_13; @@ -38678,7 +39147,7 @@ var BlobClient = /** @class */ (function (_super) { case 3: e_14 = _c.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_14.message }); throw e_14; @@ -38802,7 +39271,7 @@ var BlobClient = /** @class */ (function (_super) { case 5: e_15 = _b.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_15.message }); throw e_15; @@ -38857,7 +39326,7 @@ var BlobClient = /** @class */ (function (_super) { case 5: e_16 = _b.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_16.message }); throw e_16; @@ -38956,7 +39425,7 @@ var BlobClient = /** @class */ (function (_super) { case 3: e_17 = _c.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_17.message }); throw e_17; @@ -39096,12 +39565,12 @@ var AppendBlobClient = /** @class */ (function (_super) { case 1: _c.trys.push([1, 3, 4, 5]); ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return [4 /*yield*/, this.appendBlobContext.create(0, tslib.__assign({ abortSignal: options.abortSignal, blobHTTPHeaders: options.blobHTTPHeaders, leaseAccessConditions: options.conditions, metadata: options.metadata, modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, blobTagsString: toBlobTagsString(options.tags) }, convertTracingToRequestOptionsBase(updatedOptions)))]; + return [4 /*yield*/, this.appendBlobContext.create(0, tslib.__assign({ abortSignal: options.abortSignal, blobHttpHeaders: options.blobHTTPHeaders, leaseAccessConditions: options.conditions, metadata: options.metadata, modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, blobTagsString: toBlobTagsString(options.tags) }, convertTracingToRequestOptionsBase(updatedOptions)))]; case 2: return [2 /*return*/, _c.sent()]; case 3: e_18 = _c.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_18.message }); throw e_18; @@ -39142,13 +39611,13 @@ var AppendBlobClient = /** @class */ (function (_super) { e_19 = _d.sent(); if (((_a = e_19.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobAlreadyExists") { span.setStatus({ - code: api.CanonicalCode.ALREADY_EXISTS, + code: coreTracing.SpanStatusCode.ERROR, message: "Expected exception when creating a blob only if it does not already exist." }); return [2 /*return*/, tslib.__assign(tslib.__assign({ succeeded: false }, (_b = e_19.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e_19.response })]; } span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_19.message }); throw e_19; @@ -39183,7 +39652,7 @@ var AppendBlobClient = /** @class */ (function (_super) { case 3: e_20 = _c.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_20.message }); throw e_20; @@ -39233,12 +39702,14 @@ var AppendBlobClient = /** @class */ (function (_super) { case 1: _c.trys.push([1, 3, 4, 5]); ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return [4 /*yield*/, this.appendBlobContext.appendBlock(body, contentLength, tslib.__assign({ abortSignal: options.abortSignal, appendPositionAccessConditions: options.conditions, leaseAccessConditions: options.conditions, modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), onUploadProgress: options.onProgress, transactionalContentMD5: options.transactionalContentMD5, transactionalContentCrc64: options.transactionalContentCrc64, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope }, convertTracingToRequestOptionsBase(updatedOptions)))]; + return [4 /*yield*/, this.appendBlobContext.appendBlock(contentLength, body, tslib.__assign({ abortSignal: options.abortSignal, appendPositionAccessConditions: options.conditions, leaseAccessConditions: options.conditions, modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), requestOptions: { + onUploadProgress: options.onProgress + }, transactionalContentMD5: options.transactionalContentMD5, transactionalContentCrc64: options.transactionalContentCrc64, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope }, convertTracingToRequestOptionsBase(updatedOptions)))]; case 2: return [2 /*return*/, _c.sent()]; case 3: e_21 = _c.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_21.message }); throw e_21; @@ -39289,7 +39760,7 @@ var AppendBlobClient = /** @class */ (function (_super) { case 3: e_22 = _c.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_22.message }); throw e_22; @@ -39425,6 +39896,7 @@ var BlockBlobClient = /** @class */ (function (_super) { case 1: _c.trys.push([1, 3, 4, 5]); return [4 /*yield*/, this._blobContext.query(tslib.__assign({ abortSignal: options.abortSignal, queryRequest: { + queryType: "SQL", expression: query, inputSerialization: toQuerySerialization(options.inputTextConfiguration), outputSerialization: toQuerySerialization(options.outputTextConfiguration) @@ -39439,7 +39911,7 @@ var BlockBlobClient = /** @class */ (function (_super) { case 3: e_23 = _c.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_23.message }); throw e_23; @@ -39492,12 +39964,14 @@ var BlockBlobClient = /** @class */ (function (_super) { case 1: _c.trys.push([1, 3, 4, 5]); ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return [4 /*yield*/, this.blockBlobContext.upload(body, contentLength, tslib.__assign({ abortSignal: options.abortSignal, blobHTTPHeaders: options.blobHTTPHeaders, leaseAccessConditions: options.conditions, metadata: options.metadata, modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), onUploadProgress: options.onProgress, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, tier: toAccessTier(options.tier), blobTagsString: toBlobTagsString(options.tags) }, convertTracingToRequestOptionsBase(updatedOptions)))]; + return [4 /*yield*/, this.blockBlobContext.upload(contentLength, body, tslib.__assign({ abortSignal: options.abortSignal, blobHttpHeaders: options.blobHTTPHeaders, leaseAccessConditions: options.conditions, metadata: options.metadata, modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), requestOptions: { + onUploadProgress: options.onProgress + }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, tier: toAccessTier(options.tier), blobTagsString: toBlobTagsString(options.tags) }, convertTracingToRequestOptionsBase(updatedOptions)))]; case 2: return [2 /*return*/, _c.sent()]; case 3: e_24 = _c.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_24.message }); throw e_24; @@ -39541,7 +40015,7 @@ var BlockBlobClient = /** @class */ (function (_super) { case 1: _g.trys.push([1, 3, 4, 5]); ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return [4 /*yield*/, this.blockBlobContext.putBlobFromUrl(0, sourceURL, tslib.__assign(tslib.__assign(tslib.__assign({}, options), { leaseAccessConditions: options.conditions, modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: options.conditions.tagConditions }), sourceModifiedAccessConditions: { + return [4 /*yield*/, this.blockBlobContext.putBlobFromUrl(0, sourceURL, tslib.__assign(tslib.__assign(tslib.__assign({}, options), { blobHttpHeaders: options.blobHTTPHeaders, leaseAccessConditions: options.conditions, modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: options.conditions.tagConditions }), sourceModifiedAccessConditions: { sourceIfMatch: (_a = options.sourceConditions) === null || _a === void 0 ? void 0 : _a.ifMatch, sourceIfModifiedSince: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifModifiedSince, sourceIfNoneMatch: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch, @@ -39552,7 +40026,7 @@ var BlockBlobClient = /** @class */ (function (_super) { case 3: e_25 = _g.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_25.message }); throw e_25; @@ -39587,12 +40061,14 @@ var BlockBlobClient = /** @class */ (function (_super) { case 1: _b.trys.push([1, 3, 4, 5]); ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return [4 /*yield*/, this.blockBlobContext.stageBlock(blockId, contentLength, body, tslib.__assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, onUploadProgress: options.onProgress, transactionalContentMD5: options.transactionalContentMD5, transactionalContentCrc64: options.transactionalContentCrc64, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope }, convertTracingToRequestOptionsBase(updatedOptions)))]; + return [4 /*yield*/, this.blockBlobContext.stageBlock(blockId, contentLength, body, tslib.__assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, requestOptions: { + onUploadProgress: options.onProgress + }, transactionalContentMD5: options.transactionalContentMD5, transactionalContentCrc64: options.transactionalContentCrc64, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope }, convertTracingToRequestOptionsBase(updatedOptions)))]; case 2: return [2 /*return*/, _b.sent()]; case 3: e_26 = _b.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_26.message }); throw e_26; @@ -39643,7 +40119,7 @@ var BlockBlobClient = /** @class */ (function (_super) { case 3: e_27 = _b.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_27.message }); throw e_27; @@ -39681,12 +40157,12 @@ var BlockBlobClient = /** @class */ (function (_super) { case 1: _c.trys.push([1, 3, 4, 5]); ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return [4 /*yield*/, this.blockBlobContext.commitBlockList({ latest: blocks }, tslib.__assign({ abortSignal: options.abortSignal, blobHTTPHeaders: options.blobHTTPHeaders, leaseAccessConditions: options.conditions, metadata: options.metadata, modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, tier: toAccessTier(options.tier), blobTagsString: toBlobTagsString(options.tags) }, convertTracingToRequestOptionsBase(updatedOptions)))]; + return [4 /*yield*/, this.blockBlobContext.commitBlockList({ latest: blocks }, tslib.__assign({ abortSignal: options.abortSignal, blobHttpHeaders: options.blobHTTPHeaders, leaseAccessConditions: options.conditions, metadata: options.metadata, modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, tier: toAccessTier(options.tier), blobTagsString: toBlobTagsString(options.tags) }, convertTracingToRequestOptionsBase(updatedOptions)))]; case 2: return [2 /*return*/, _c.sent()]; case 3: e_28 = _c.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_28.message }); throw e_28; @@ -39733,7 +40209,7 @@ var BlockBlobClient = /** @class */ (function (_super) { case 3: e_29 = _c.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_29.message }); throw e_29; @@ -39781,7 +40257,7 @@ var BlockBlobClient = /** @class */ (function (_super) { } catch (e) { span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e.message }); throw e; @@ -39825,7 +40301,7 @@ var BlockBlobClient = /** @class */ (function (_super) { case 3: e_30 = _b.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_30.message }); throw e_30; @@ -39949,7 +40425,7 @@ var BlockBlobClient = /** @class */ (function (_super) { case 5: e_31 = _b.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_31.message }); throw e_31; @@ -40001,7 +40477,7 @@ var BlockBlobClient = /** @class */ (function (_super) { case 4: e_32 = _b.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_32.message }); throw e_32; @@ -40090,7 +40566,7 @@ var BlockBlobClient = /** @class */ (function (_super) { case 4: e_33 = _b.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_33.message }); throw e_33; @@ -40204,12 +40680,12 @@ var PageBlobClient = /** @class */ (function (_super) { case 1: _c.trys.push([1, 3, 4, 5]); ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return [4 /*yield*/, this.pageBlobContext.create(0, size, tslib.__assign({ abortSignal: options.abortSignal, blobHTTPHeaders: options.blobHTTPHeaders, blobSequenceNumber: options.blobSequenceNumber, leaseAccessConditions: options.conditions, metadata: options.metadata, modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, tier: toAccessTier(options.tier), blobTagsString: toBlobTagsString(options.tags) }, convertTracingToRequestOptionsBase(updatedOptions)))]; + return [4 /*yield*/, this.pageBlobContext.create(0, size, tslib.__assign({ abortSignal: options.abortSignal, blobHttpHeaders: options.blobHTTPHeaders, blobSequenceNumber: options.blobSequenceNumber, leaseAccessConditions: options.conditions, metadata: options.metadata, modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, tier: toAccessTier(options.tier), blobTagsString: toBlobTagsString(options.tags) }, convertTracingToRequestOptionsBase(updatedOptions)))]; case 2: return [2 /*return*/, _c.sent()]; case 3: e_34 = _c.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_34.message }); throw e_34; @@ -40252,13 +40728,13 @@ var PageBlobClient = /** @class */ (function (_super) { e_35 = _d.sent(); if (((_a = e_35.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobAlreadyExists") { span.setStatus({ - code: api.CanonicalCode.ALREADY_EXISTS, + code: coreTracing.SpanStatusCode.ERROR, message: "Expected exception when creating a blob only if it does not already exist." }); return [2 /*return*/, tslib.__assign(tslib.__assign({ succeeded: false }, (_b = e_35.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e_35.response })]; } span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_35.message }); throw e_35; @@ -40294,12 +40770,14 @@ var PageBlobClient = /** @class */ (function (_super) { case 1: _c.trys.push([1, 3, 4, 5]); ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return [4 /*yield*/, this.pageBlobContext.uploadPages(body, count, tslib.__assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), onUploadProgress: options.onProgress, range: rangeToString({ offset: offset, count: count }), sequenceNumberAccessConditions: options.conditions, transactionalContentMD5: options.transactionalContentMD5, transactionalContentCrc64: options.transactionalContentCrc64, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope }, convertTracingToRequestOptionsBase(updatedOptions)))]; + return [4 /*yield*/, this.pageBlobContext.uploadPages(count, body, tslib.__assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), requestOptions: { + onUploadProgress: options.onProgress + }, range: rangeToString({ offset: offset, count: count }), sequenceNumberAccessConditions: options.conditions, transactionalContentMD5: options.transactionalContentMD5, transactionalContentCrc64: options.transactionalContentCrc64, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope }, convertTracingToRequestOptionsBase(updatedOptions)))]; case 2: return [2 /*return*/, _c.sent()]; case 3: e_36 = _c.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_36.message }); throw e_36; @@ -40347,7 +40825,7 @@ var PageBlobClient = /** @class */ (function (_super) { case 3: e_37 = _c.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_37.message }); throw e_37; @@ -40387,7 +40865,7 @@ var PageBlobClient = /** @class */ (function (_super) { case 3: e_38 = _c.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_38.message }); throw e_38; @@ -40429,7 +40907,7 @@ var PageBlobClient = /** @class */ (function (_super) { case 3: e_39 = _c.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_39.message }); throw e_39; @@ -40471,7 +40949,7 @@ var PageBlobClient = /** @class */ (function (_super) { case 3: e_40 = _c.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_40.message }); throw e_40; @@ -40513,7 +40991,7 @@ var PageBlobClient = /** @class */ (function (_super) { case 3: e_41 = _c.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_41.message }); throw e_41; @@ -40551,7 +41029,7 @@ var PageBlobClient = /** @class */ (function (_super) { case 3: e_42 = _c.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_42.message }); throw e_42; @@ -40590,7 +41068,7 @@ var PageBlobClient = /** @class */ (function (_super) { case 3: e_43 = _c.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_43.message }); throw e_43; @@ -40632,7 +41110,7 @@ var PageBlobClient = /** @class */ (function (_super) { case 3: e_44 = _c.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_44.message }); throw e_44; @@ -41003,7 +41481,7 @@ var BlobBatch = /** @class */ (function () { case 3: e_1 = _b.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_1.message }); throw e_1; @@ -41068,7 +41546,7 @@ var BlobBatch = /** @class */ (function () { case 3: e_2 = _b.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_2.message }); throw e_2; @@ -41379,7 +41857,7 @@ var BlobBatchClient = /** @class */ (function () { case 1: _b.trys.push([1, 4, 5, 6]); batchRequestBody = batchRequest.getHttpRequestBody(); - return [4 /*yield*/, this.serviceOrContainerContext.submitBatch(batchRequestBody, utf8ByteLength(batchRequestBody), batchRequest.getMultiPartContentType(), tslib.__assign(tslib.__assign({}, options), convertTracingToRequestOptionsBase(updatedOptions)))]; + return [4 /*yield*/, this.serviceOrContainerContext.submitBatch(utf8ByteLength(batchRequestBody), batchRequest.getMultiPartContentType(), batchRequestBody, tslib.__assign(tslib.__assign({}, options), convertTracingToRequestOptionsBase(updatedOptions)))]; case 2: rawBatchResponse = _b.sent(); batchResponseParser = new BatchResponseParser(rawBatchResponse, batchRequest.getSubRequests()); @@ -41401,7 +41879,7 @@ var BlobBatchClient = /** @class */ (function () { case 4: e_1 = _b.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_1.message }); throw e_1; @@ -41522,7 +42000,7 @@ var ContainerClient = /** @class */ (function (_super) { case 3: e_1 = _b.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_1.message }); throw e_1; @@ -41562,13 +42040,13 @@ var ContainerClient = /** @class */ (function (_super) { e_2 = _d.sent(); if (((_a = e_2.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ContainerAlreadyExists") { span.setStatus({ - code: api.CanonicalCode.ALREADY_EXISTS, + code: coreTracing.SpanStatusCode.ERROR, message: "Expected exception when creating a container only if it does not already exist." }); return [2 /*return*/, tslib.__assign(tslib.__assign({ succeeded: false }, (_b = e_2.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e_2.response })]; } span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_2.message }); throw e_2; @@ -41611,13 +42089,13 @@ var ContainerClient = /** @class */ (function (_super) { e_3 = _b.sent(); if (e_3.statusCode === 404) { span.setStatus({ - code: api.CanonicalCode.NOT_FOUND, + code: coreTracing.SpanStatusCode.ERROR, message: "Expected exception when checking container existence" }); return [2 /*return*/, false]; } span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_3.message }); throw e_3; @@ -41703,7 +42181,7 @@ var ContainerClient = /** @class */ (function (_super) { case 3: e_4 = _b.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_4.message }); throw e_4; @@ -41736,12 +42214,12 @@ var ContainerClient = /** @class */ (function (_super) { _b.label = 1; case 1: _b.trys.push([1, 3, 4, 5]); - return [4 /*yield*/, this.containerContext.deleteMethod(tslib.__assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: options.conditions }, convertTracingToRequestOptionsBase(updatedOptions)))]; + return [4 /*yield*/, this.containerContext.delete(tslib.__assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: options.conditions }, convertTracingToRequestOptionsBase(updatedOptions)))]; case 2: return [2 /*return*/, _b.sent()]; case 3: e_5 = _b.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_5.message }); throw e_5; @@ -41781,13 +42259,13 @@ var ContainerClient = /** @class */ (function (_super) { e_6 = _d.sent(); if (((_a = e_6.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ContainerNotFound") { span.setStatus({ - code: api.CanonicalCode.NOT_FOUND, + code: coreTracing.SpanStatusCode.ERROR, message: "Expected exception when deleting a container only if it exists." }); return [2 /*return*/, tslib.__assign(tslib.__assign({ succeeded: false }, (_b = e_6.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e_6.response })]; } span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_6.message }); throw e_6; @@ -41833,7 +42311,7 @@ var ContainerClient = /** @class */ (function (_super) { case 3: e_7 = _b.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_7.message }); throw e_7; @@ -41908,7 +42386,7 @@ var ContainerClient = /** @class */ (function (_super) { case 3: e_8 = _b.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_8.message }); throw e_8; @@ -41970,7 +42448,7 @@ var ContainerClient = /** @class */ (function (_super) { case 3: e_9 = _c.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_9.message }); throw e_9; @@ -42035,7 +42513,7 @@ var ContainerClient = /** @class */ (function (_super) { case 3: e_10 = _b.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_10.message }); throw e_10; @@ -42078,7 +42556,7 @@ var ContainerClient = /** @class */ (function (_super) { case 3: e_11 = _b.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_11.message }); throw e_11; @@ -42122,7 +42600,7 @@ var ContainerClient = /** @class */ (function (_super) { case 3: e_12 = _b.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_12.message }); throw e_12; @@ -42167,7 +42645,7 @@ var ContainerClient = /** @class */ (function (_super) { case 3: e_13 = _b.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_13.message }); throw e_13; @@ -43224,7 +43702,7 @@ var BlobServiceClient = /** @class */ (function (_super) { case 3: e_1 = _b.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_1.message }); throw e_1; @@ -43260,7 +43738,7 @@ var BlobServiceClient = /** @class */ (function (_super) { case 3: e_2 = _b.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_2.message }); throw e_2; @@ -43302,7 +43780,7 @@ var BlobServiceClient = /** @class */ (function (_super) { case 3: e_3 = _b.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_3.message }); throw e_3; @@ -43343,7 +43821,7 @@ var BlobServiceClient = /** @class */ (function (_super) { case 3: e_4 = _c.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_4.message }); throw e_4; @@ -43379,7 +43857,7 @@ var BlobServiceClient = /** @class */ (function (_super) { case 3: e_5 = _b.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_5.message }); throw e_5; @@ -43416,7 +43894,7 @@ var BlobServiceClient = /** @class */ (function (_super) { case 3: e_6 = _b.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_6.message }); throw e_6; @@ -43453,7 +43931,7 @@ var BlobServiceClient = /** @class */ (function (_super) { case 3: e_7 = _b.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_7.message }); throw e_7; @@ -43491,7 +43969,7 @@ var BlobServiceClient = /** @class */ (function (_super) { case 3: e_8 = _b.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_8.message }); throw e_8; @@ -43533,7 +44011,7 @@ var BlobServiceClient = /** @class */ (function (_super) { case 3: e_9 = _b.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_9.message }); throw e_9; @@ -43589,7 +44067,7 @@ var BlobServiceClient = /** @class */ (function (_super) { case 3: e_10 = _b.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_10.message }); throw e_10; @@ -44050,7 +44528,7 @@ var BlobServiceClient = /** @class */ (function (_super) { case 3: e_13 = _b.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_13.message }); throw e_13; @@ -44385,10 +44863,14 @@ var __createBinding; return r; }; - __spreadArray = function (to, from) { - for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) - to[j] = from[i]; - return to; + __spreadArray = function (to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || from); }; __await = function (v) { @@ -44486,8 +44968,8 @@ var __createBinding; /***/ }), -/***/ 5560: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 7171: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -44506,11 +44988,19 @@ var __createBinding; * See the License for the specific language governing permissions and * limitations under the License. */ +var __spreadArrays = (this && this.__spreadArrays) || function () { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; +}; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ContextAPI = void 0; -var context_base_1 = __nccwpck_require__(5664); -var global_utils_1 = __nccwpck_require__(3529); -var NOOP_CONTEXT_MANAGER = new context_base_1.NoopContextManager(); +var NoopContextManager_1 = __nccwpck_require__(4118); +var global_utils_1 = __nccwpck_require__(5135); +var API_NAME = 'context'; +var NOOP_CONTEXT_MANAGER = new NoopContextManager_1.NoopContextManager(); /** * Singleton object which represents the entry point to the OpenTelemetry Context API */ @@ -44529,11 +45019,7 @@ var ContextAPI = /** @class */ (function () { * Set the current context manager. Returns the initialized context manager */ ContextAPI.prototype.setGlobalContextManager = function (contextManager) { - if (global_utils_1._global[global_utils_1.GLOBAL_CONTEXT_MANAGER_API_KEY]) { - // global context manager has already been set - return this._getContextManager(); - } - global_utils_1._global[global_utils_1.GLOBAL_CONTEXT_MANAGER_API_KEY] = global_utils_1.makeGetter(global_utils_1.API_BACKWARDS_COMPATIBILITY_VERSION, contextManager, NOOP_CONTEXT_MANAGER); + global_utils_1.registerGlobal(API_NAME, contextManager); return contextManager; }; /** @@ -44547,9 +45033,16 @@ var ContextAPI = /** @class */ (function () { * * @param context context to be active during function execution * @param fn function to execute in a context + * @param thisArg optional receiver to be used for calling fn + * @param args optional arguments forwarded to fn */ - ContextAPI.prototype.with = function (context, fn) { - return this._getContextManager().with(context, fn); + ContextAPI.prototype.with = function (context, fn, thisArg) { + var _a; + var args = []; + for (var _i = 3; _i < arguments.length; _i++) { + args[_i - 3] = arguments[_i]; + } + return (_a = this._getContextManager()).with.apply(_a, __spreadArrays([context, fn, thisArg], args)); }; /** * Bind a context to a target function or event emitter @@ -44562,13 +45055,12 @@ var ContextAPI = /** @class */ (function () { return this._getContextManager().bind(target, context); }; ContextAPI.prototype._getContextManager = function () { - var _a, _b; - return ((_b = (_a = global_utils_1._global[global_utils_1.GLOBAL_CONTEXT_MANAGER_API_KEY]) === null || _a === void 0 ? void 0 : _a.call(global_utils_1._global, global_utils_1.API_BACKWARDS_COMPATIBILITY_VERSION)) !== null && _b !== void 0 ? _b : NOOP_CONTEXT_MANAGER); + return global_utils_1.getGlobal(API_NAME) || NOOP_CONTEXT_MANAGER; }; /** Disable and remove the global context manager */ ContextAPI.prototype.disable = function () { this._getContextManager().disable(); - delete global_utils_1._global[global_utils_1.GLOBAL_CONTEXT_MANAGER_API_KEY]; + global_utils_1.unregisterGlobal(API_NAME); }; return ContextAPI; }()); @@ -44577,61 +45069,7 @@ exports.ContextAPI = ContextAPI; /***/ }), -/***/ 3529: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.API_BACKWARDS_COMPATIBILITY_VERSION = exports.makeGetter = exports._global = exports.GLOBAL_TRACE_API_KEY = exports.GLOBAL_PROPAGATION_API_KEY = exports.GLOBAL_METRICS_API_KEY = exports.GLOBAL_CONTEXT_MANAGER_API_KEY = void 0; -var platform_1 = __nccwpck_require__(9957); -exports.GLOBAL_CONTEXT_MANAGER_API_KEY = Symbol.for('io.opentelemetry.js.api.context'); -exports.GLOBAL_METRICS_API_KEY = Symbol.for('io.opentelemetry.js.api.metrics'); -exports.GLOBAL_PROPAGATION_API_KEY = Symbol.for('io.opentelemetry.js.api.propagation'); -exports.GLOBAL_TRACE_API_KEY = Symbol.for('io.opentelemetry.js.api.trace'); -exports._global = platform_1._globalThis; -/** - * Make a function which accepts a version integer and returns the instance of an API if the version - * is compatible, or a fallback version (usually NOOP) if it is not. - * - * @param requiredVersion Backwards compatibility version which is required to return the instance - * @param instance Instance which should be returned if the required version is compatible - * @param fallback Fallback instance, usually NOOP, which will be returned if the required version is not compatible - */ -function makeGetter(requiredVersion, instance, fallback) { - return function (version) { - return version === requiredVersion ? instance : fallback; - }; -} -exports.makeGetter = makeGetter; -/** - * A number which should be incremented each time a backwards incompatible - * change is made to the API. This number is used when an API package - * attempts to access the global API to ensure it is getting a compatible - * version. If the global API is not compatible with the API package - * attempting to get it, a NOOP API implementation will be returned. - */ -exports.API_BACKWARDS_COMPATIBILITY_VERSION = 0; -//# sourceMappingURL=global-utils.js.map - -/***/ }), - -/***/ 7696: +/***/ 1877: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -44652,55 +45090,69 @@ exports.API_BACKWARDS_COMPATIBILITY_VERSION = 0; * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.MetricsAPI = void 0; -var NoopMeterProvider_1 = __nccwpck_require__(2647); -var global_utils_1 = __nccwpck_require__(3529); +exports.DiagAPI = void 0; +var logLevelLogger_1 = __nccwpck_require__(9639); +var types_1 = __nccwpck_require__(8077); +var global_utils_1 = __nccwpck_require__(5135); +var API_NAME = 'diag'; /** - * Singleton object which represents the entry point to the OpenTelemetry Metrics API + * Singleton object which represents the entry point to the OpenTelemetry internal + * diagnostic API */ -var MetricsAPI = /** @class */ (function () { - /** Empty private constructor prevents end users from constructing a new instance of the API */ - function MetricsAPI() { +var DiagAPI = /** @class */ (function () { + /** + * Private internal constructor + * @private + */ + function DiagAPI() { + function _logProxy(funcName) { + return function () { + var logger = global_utils_1.getGlobal('diag'); + // shortcut if logger not set + if (!logger) + return; + return logger[funcName].apply(logger, + // work around Function.prototype.apply types + // eslint-disable-next-line @typescript-eslint/no-explicit-any + arguments); + }; + } + // Using self local variable for minification purposes as 'this' cannot be minified + var self = this; + // DiagAPI specific functions + self.setLogger = function (logger, logLevel) { + var _a; + if (logLevel === void 0) { logLevel = types_1.DiagLogLevel.INFO; } + if (logger === self) { + // There isn't much we can do here. + // Logging to the console might break the user application. + // Try to log to self. If a logger was previously registered it will receive the log. + var err = new Error('Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation'); + self.error((_a = err.stack) !== null && _a !== void 0 ? _a : err.message); + return; + } + global_utils_1.registerGlobal('diag', logLevelLogger_1.createLogLevelDiagLogger(logLevel, logger), true); + }; + self.disable = function () { + global_utils_1.unregisterGlobal(API_NAME); + }; + self.verbose = _logProxy('verbose'); + self.debug = _logProxy('debug'); + self.info = _logProxy('info'); + self.warn = _logProxy('warn'); + self.error = _logProxy('error'); } - /** Get the singleton instance of the Metrics API */ - MetricsAPI.getInstance = function () { + /** Get the singleton instance of the DiagAPI API */ + DiagAPI.instance = function () { if (!this._instance) { - this._instance = new MetricsAPI(); + this._instance = new DiagAPI(); } return this._instance; }; - /** - * Set the current global meter. Returns the initialized global meter provider. - */ - MetricsAPI.prototype.setGlobalMeterProvider = function (provider) { - if (global_utils_1._global[global_utils_1.GLOBAL_METRICS_API_KEY]) { - // global meter provider has already been set - return this.getMeterProvider(); - } - global_utils_1._global[global_utils_1.GLOBAL_METRICS_API_KEY] = global_utils_1.makeGetter(global_utils_1.API_BACKWARDS_COMPATIBILITY_VERSION, provider, NoopMeterProvider_1.NOOP_METER_PROVIDER); - return provider; - }; - /** - * Returns the global meter provider. - */ - MetricsAPI.prototype.getMeterProvider = function () { - var _a, _b; - return ((_b = (_a = global_utils_1._global[global_utils_1.GLOBAL_METRICS_API_KEY]) === null || _a === void 0 ? void 0 : _a.call(global_utils_1._global, global_utils_1.API_BACKWARDS_COMPATIBILITY_VERSION)) !== null && _b !== void 0 ? _b : NoopMeterProvider_1.NOOP_METER_PROVIDER); - }; - /** - * Returns a meter from the global meter provider. - */ - MetricsAPI.prototype.getMeter = function (name, version) { - return this.getMeterProvider().getMeter(name, version); - }; - /** Remove the global meter provider */ - MetricsAPI.prototype.disable = function () { - delete global_utils_1._global[global_utils_1.GLOBAL_METRICS_API_KEY]; - }; - return MetricsAPI; + return DiagAPI; }()); -exports.MetricsAPI = MetricsAPI; -//# sourceMappingURL=metrics.js.map +exports.DiagAPI = DiagAPI; +//# sourceMappingURL=diag.js.map /***/ }), @@ -44726,12 +45178,10 @@ exports.MetricsAPI = MetricsAPI; */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.PropagationAPI = void 0; -var getter_1 = __nccwpck_require__(3050); -var NoopHttpTextPropagator_1 = __nccwpck_require__(9757); -var setter_1 = __nccwpck_require__(4707); -var context_1 = __nccwpck_require__(5560); -var global_utils_1 = __nccwpck_require__(3529); -var contextApi = context_1.ContextAPI.getInstance(); +var NoopTextMapPropagator_1 = __nccwpck_require__(2368); +var TextMapPropagator_1 = __nccwpck_require__(865); +var global_utils_1 = __nccwpck_require__(5135); +var API_NAME = 'propagation'; /** * Singleton object which represents the entry point to the OpenTelemetry Propagation API */ @@ -44750,44 +45200,43 @@ var PropagationAPI = /** @class */ (function () { * Set the current propagator. Returns the initialized propagator */ PropagationAPI.prototype.setGlobalPropagator = function (propagator) { - if (global_utils_1._global[global_utils_1.GLOBAL_PROPAGATION_API_KEY]) { - // global propagator has already been set - return this._getGlobalPropagator(); - } - global_utils_1._global[global_utils_1.GLOBAL_PROPAGATION_API_KEY] = global_utils_1.makeGetter(global_utils_1.API_BACKWARDS_COMPATIBILITY_VERSION, propagator, NoopHttpTextPropagator_1.NOOP_HTTP_TEXT_PROPAGATOR); + global_utils_1.registerGlobal(API_NAME, propagator); return propagator; }; /** * Inject context into a carrier to be propagated inter-process * + * @param context Context carrying tracing data to inject * @param carrier carrier to inject context into * @param setter Function used to set values on the carrier - * @param context Context carrying tracing data to inject. Defaults to the currently active context. */ - PropagationAPI.prototype.inject = function (carrier, setter, context) { - if (setter === void 0) { setter = setter_1.defaultSetter; } - if (context === void 0) { context = contextApi.active(); } + PropagationAPI.prototype.inject = function (context, carrier, setter) { + if (setter === void 0) { setter = TextMapPropagator_1.defaultTextMapSetter; } return this._getGlobalPropagator().inject(context, carrier, setter); }; /** * Extract context from a carrier * + * @param context Context which the newly created context will inherit from * @param carrier Carrier to extract context from * @param getter Function used to extract keys from a carrier - * @param context Context which the newly created context will inherit from. Defaults to the currently active context. */ - PropagationAPI.prototype.extract = function (carrier, getter, context) { - if (getter === void 0) { getter = getter_1.defaultGetter; } - if (context === void 0) { context = contextApi.active(); } + PropagationAPI.prototype.extract = function (context, carrier, getter) { + if (getter === void 0) { getter = TextMapPropagator_1.defaultTextMapGetter; } return this._getGlobalPropagator().extract(context, carrier, getter); }; + /** + * Return a list of all fields which may be used by the propagator. + */ + PropagationAPI.prototype.fields = function () { + return this._getGlobalPropagator().fields(); + }; /** Remove the global propagator */ PropagationAPI.prototype.disable = function () { - delete global_utils_1._global[global_utils_1.GLOBAL_PROPAGATION_API_KEY]; + global_utils_1.unregisterGlobal(API_NAME); }; PropagationAPI.prototype._getGlobalPropagator = function () { - var _a, _b; - return ((_b = (_a = global_utils_1._global[global_utils_1.GLOBAL_PROPAGATION_API_KEY]) === null || _a === void 0 ? void 0 : _a.call(global_utils_1._global, global_utils_1.API_BACKWARDS_COMPATIBILITY_VERSION)) !== null && _b !== void 0 ? _b : NoopHttpTextPropagator_1.NOOP_HTTP_TEXT_PROPAGATOR); + return global_utils_1.getGlobal(API_NAME) || NoopTextMapPropagator_1.NOOP_TEXT_MAP_PROPAGATOR; }; return PropagationAPI; }()); @@ -44818,14 +45267,18 @@ exports.PropagationAPI = PropagationAPI; */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.TraceAPI = void 0; -var NoopTracerProvider_1 = __nccwpck_require__(3259); -var global_utils_1 = __nccwpck_require__(3529); +var ProxyTracerProvider_1 = __nccwpck_require__(2285); +var spancontext_utils_1 = __nccwpck_require__(9745); +var global_utils_1 = __nccwpck_require__(5135); +var API_NAME = 'trace'; /** * Singleton object which represents the entry point to the OpenTelemetry Tracing API */ var TraceAPI = /** @class */ (function () { /** Empty private constructor prevents end users from constructing a new instance of the API */ function TraceAPI() { + this._proxyTracerProvider = new ProxyTracerProvider_1.ProxyTracerProvider(); + this.isSpanContextValid = spancontext_utils_1.isSpanContextValid; } /** Get the singleton instance of the Trace API */ TraceAPI.getInstance = function () { @@ -44838,19 +45291,15 @@ var TraceAPI = /** @class */ (function () { * Set the current global tracer. Returns the initialized global tracer provider */ TraceAPI.prototype.setGlobalTracerProvider = function (provider) { - if (global_utils_1._global[global_utils_1.GLOBAL_TRACE_API_KEY]) { - // global tracer provider has already been set - return this.getTracerProvider(); - } - global_utils_1._global[global_utils_1.GLOBAL_TRACE_API_KEY] = global_utils_1.makeGetter(global_utils_1.API_BACKWARDS_COMPATIBILITY_VERSION, provider, NoopTracerProvider_1.NOOP_TRACER_PROVIDER); - return this.getTracerProvider(); + this._proxyTracerProvider.setDelegate(provider); + global_utils_1.registerGlobal(API_NAME, this._proxyTracerProvider); + return this._proxyTracerProvider; }; /** * Returns the global tracer provider. */ TraceAPI.prototype.getTracerProvider = function () { - var _a, _b; - return ((_b = (_a = global_utils_1._global[global_utils_1.GLOBAL_TRACE_API_KEY]) === null || _a === void 0 ? void 0 : _a.call(global_utils_1._global, global_utils_1.API_BACKWARDS_COMPATIBILITY_VERSION)) !== null && _b !== void 0 ? _b : NoopTracerProvider_1.NOOP_TRACER_PROVIDER); + return global_utils_1.getGlobal(API_NAME) || this._proxyTracerProvider; }; /** * Returns a tracer from the global tracer provider. @@ -44860,7 +45309,8 @@ var TraceAPI = /** @class */ (function () { }; /** Remove the global tracer provider */ TraceAPI.prototype.disable = function () { - delete global_utils_1._global[global_utils_1.GLOBAL_TRACE_API_KEY]; + global_utils_1.unregisterGlobal(API_NAME); + this._proxyTracerProvider = new ProxyTracerProvider_1.ProxyTracerProvider(); }; return TraceAPI; }()); @@ -44869,7 +45319,7 @@ exports.TraceAPI = TraceAPI; /***/ }), -/***/ 1344: +/***/ 131: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -44890,21 +45340,105 @@ exports.TraceAPI = TraceAPI; * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=Logger.js.map +//# sourceMappingURL=Baggage.js.map /***/ }), -/***/ 2358: +/***/ 719: /***/ ((__unused_webpack_module, exports) => { "use strict"; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=Entry.js.map + +/***/ }), + +/***/ 4967: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=Time.js.map +exports.baggageEntryMetadataFromString = exports.createBaggage = void 0; +var baggage_1 = __nccwpck_require__(8137); +var symbol_1 = __nccwpck_require__(3542); +__exportStar(__nccwpck_require__(131), exports); +__exportStar(__nccwpck_require__(719), exports); +/** + * Create a new Baggage with optional entries + * + * @param entries An array of baggage entries the new baggage should contain + */ +function createBaggage(entries) { + if (entries === void 0) { entries = {}; } + return new baggage_1.BaggageImpl(new Map(Object.entries(entries))); +} +exports.createBaggage = createBaggage; +/** + * Create a serializable BaggageEntryMetadata object from a string. + * + * @param str string metadata. Format is currently not defined by the spec and has no special meaning. + * + */ +function baggageEntryMetadataFromString(str) { + if (typeof str !== 'string') { + // @TODO log diagnostic + str = ''; + } + return { + __TYPE__: symbol_1.baggageEntryMetadataSymbol, + toString: function () { + return str; + }, + }; +} +exports.baggageEntryMetadataFromString = baggageEntryMetadataFromString; +//# sourceMappingURL=index.js.map /***/ }), -/***/ 3422: +/***/ 8137: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -44925,11 +45459,57 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=HttpTextPropagator.js.map +exports.BaggageImpl = void 0; +var BaggageImpl = /** @class */ (function () { + function BaggageImpl(entries) { + this._entries = entries ? new Map(entries) : new Map(); + } + BaggageImpl.prototype.getEntry = function (key) { + var entry = this._entries.get(key); + if (!entry) { + return undefined; + } + return Object.assign({}, entry); + }; + BaggageImpl.prototype.getAllEntries = function () { + return Array.from(this._entries.entries()).map(function (_a) { + var k = _a[0], v = _a[1]; + return [k, v]; + }); + }; + BaggageImpl.prototype.setEntry = function (key, entry) { + var newBaggage = new BaggageImpl(this._entries); + newBaggage._entries.set(key, entry); + return newBaggage; + }; + BaggageImpl.prototype.removeEntry = function (key) { + var newBaggage = new BaggageImpl(this._entries); + newBaggage._entries.delete(key); + return newBaggage; + }; + BaggageImpl.prototype.removeEntries = function () { + var keys = []; + for (var _i = 0; _i < arguments.length; _i++) { + keys[_i] = arguments[_i]; + } + var newBaggage = new BaggageImpl(this._entries); + for (var _a = 0, keys_1 = keys; _a < keys_1.length; _a++) { + var key = keys_1[_a]; + newBaggage._entries.delete(key); + } + return newBaggage; + }; + BaggageImpl.prototype.clear = function () { + return new BaggageImpl(); + }; + return BaggageImpl; +}()); +exports.BaggageImpl = BaggageImpl; +//# sourceMappingURL=baggage.js.map /***/ }), -/***/ 9757: +/***/ 3542: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -44950,28 +45530,292 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NOOP_HTTP_TEXT_PROPAGATOR = exports.NoopHttpTextPropagator = void 0; +exports.baggageEntryMetadataSymbol = void 0; /** - * No-op implementations of {@link HttpTextPropagator}. + * Symbol used to make BaggageEntryMetadata an opaque type + */ +exports.baggageEntryMetadataSymbol = Symbol('BaggageEntryMetadata'); +//# sourceMappingURL=symbol.js.map + +/***/ }), + +/***/ 4447: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=Exception.js.map + +/***/ }), + +/***/ 2358: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=Time.js.map + +/***/ }), + +/***/ 4118: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ -var NoopHttpTextPropagator = /** @class */ (function () { - function NoopHttpTextPropagator() { +var __spreadArrays = (this && this.__spreadArrays) || function () { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.NoopContextManager = void 0; +var context_1 = __nccwpck_require__(8242); +var NoopContextManager = /** @class */ (function () { + function NoopContextManager() { } - /** Noop inject function does nothing */ - NoopHttpTextPropagator.prototype.inject = function (context, carrier, setter) { }; - /** Noop extract function does nothing and returns the input context */ - NoopHttpTextPropagator.prototype.extract = function (context, carrier, getter) { - return context; + NoopContextManager.prototype.active = function () { + return context_1.ROOT_CONTEXT; + }; + NoopContextManager.prototype.with = function (_context, fn, thisArg) { + var args = []; + for (var _i = 3; _i < arguments.length; _i++) { + args[_i - 3] = arguments[_i]; + } + return fn.call.apply(fn, __spreadArrays([thisArg], args)); + }; + NoopContextManager.prototype.bind = function (target, _context) { + return target; }; - return NoopHttpTextPropagator; + NoopContextManager.prototype.enable = function () { + return this; + }; + NoopContextManager.prototype.disable = function () { + return this; + }; + return NoopContextManager; +}()); +exports.NoopContextManager = NoopContextManager; +//# sourceMappingURL=NoopContextManager.js.map + +/***/ }), + +/***/ 8242: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ROOT_CONTEXT = exports.createContextKey = exports.setBaggage = exports.getBaggage = exports.isInstrumentationSuppressed = exports.unsuppressInstrumentation = exports.suppressInstrumentation = exports.getSpanContext = exports.setSpanContext = exports.setSpan = exports.getSpan = void 0; +var NoopSpan_1 = __nccwpck_require__(1169); +/** + * span key + */ +var SPAN_KEY = createContextKey('OpenTelemetry Context Key SPAN'); +/** + * Shared key for indicating if instrumentation should be suppressed beyond + * this current scope. + */ +var SUPPRESS_INSTRUMENTATION_KEY = createContextKey('OpenTelemetry Context Key SUPPRESS_INSTRUMENTATION'); +/** + * Baggage key + */ +var BAGGAGE_KEY = createContextKey('OpenTelemetry Baggage Key'); +/** + * Return the span if one exists + * + * @param context context to get span from + */ +function getSpan(context) { + return context.getValue(SPAN_KEY) || undefined; +} +exports.getSpan = getSpan; +/** + * Set the span on a context + * + * @param context context to use as parent + * @param span span to set active + */ +function setSpan(context, span) { + return context.setValue(SPAN_KEY, span); +} +exports.setSpan = setSpan; +/** + * Wrap span context in a NoopSpan and set as span in a new + * context + * + * @param context context to set active span on + * @param spanContext span context to be wrapped + */ +function setSpanContext(context, spanContext) { + return setSpan(context, new NoopSpan_1.NoopSpan(spanContext)); +} +exports.setSpanContext = setSpanContext; +/** + * Get the span context of the span if it exists. + * + * @param context context to get values from + */ +function getSpanContext(context) { + var _a; + return (_a = getSpan(context)) === null || _a === void 0 ? void 0 : _a.context(); +} +exports.getSpanContext = getSpanContext; +/** + * Sets value on context to indicate that instrumentation should + * be suppressed beyond this current scope. + * + * @param context context to set the suppress instrumentation value on. + */ +function suppressInstrumentation(context) { + return context.setValue(SUPPRESS_INSTRUMENTATION_KEY, true); +} +exports.suppressInstrumentation = suppressInstrumentation; +/** + * Sets value on context to indicate that instrumentation should + * no-longer be suppressed beyond this current scope. + * + * @param context context to set the suppress instrumentation value on. + */ +function unsuppressInstrumentation(context) { + return context.setValue(SUPPRESS_INSTRUMENTATION_KEY, false); +} +exports.unsuppressInstrumentation = unsuppressInstrumentation; +/** + * Return current suppress instrumentation value for the given context, + * if it exists. + * + * @param context context check for the suppress instrumentation value. + */ +function isInstrumentationSuppressed(context) { + return Boolean(context.getValue(SUPPRESS_INSTRUMENTATION_KEY)); +} +exports.isInstrumentationSuppressed = isInstrumentationSuppressed; +/** + * @param {Context} Context that manage all context values + * @returns {Baggage} Extracted baggage from the context + */ +function getBaggage(context) { + return context.getValue(BAGGAGE_KEY) || undefined; +} +exports.getBaggage = getBaggage; +/** + * @param {Context} Context that manage all context values + * @param {Baggage} baggage that will be set in the actual context + */ +function setBaggage(context, baggage) { + return context.setValue(BAGGAGE_KEY, baggage); +} +exports.setBaggage = setBaggage; +/** Get a key to uniquely identify a context value */ +function createContextKey(description) { + return Symbol.for(description); +} +exports.createContextKey = createContextKey; +var BaseContext = /** @class */ (function () { + /** + * Construct a new context which inherits values from an optional parent context. + * + * @param parentContext a context from which to inherit values + */ + function BaseContext(parentContext) { + // for minification + var self = this; + self._currentContext = parentContext ? new Map(parentContext) : new Map(); + self.getValue = function (key) { return self._currentContext.get(key); }; + self.setValue = function (key, value) { + var context = new BaseContext(self._currentContext); + context._currentContext.set(key, value); + return context; + }; + self.deleteValue = function (key) { + var context = new BaseContext(self._currentContext); + context._currentContext.delete(key); + return context; + }; + } + return BaseContext; }()); -exports.NoopHttpTextPropagator = NoopHttpTextPropagator; -exports.NOOP_HTTP_TEXT_PROPAGATOR = new NoopHttpTextPropagator(); -//# sourceMappingURL=NoopHttpTextPropagator.js.map +/** The root context is used as the default parent context when there is no active context */ +exports.ROOT_CONTEXT = new BaseContext(); +//# sourceMappingURL=context.js.map + +/***/ }), + +/***/ 6504: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=types.js.map /***/ }), -/***/ 3050: +/***/ 3041: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -44992,24 +45836,88 @@ exports.NOOP_HTTP_TEXT_PROPAGATOR = new NoopHttpTextPropagator(); * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.defaultGetter = void 0; +exports.DiagConsoleLogger = void 0; +var consoleMap = [ + { n: 'error', c: 'error' }, + { n: 'warn', c: 'warn' }, + { n: 'info', c: 'info' }, + { n: 'debug', c: 'debug' }, + { n: 'verbose', c: 'trace' }, +]; /** - * Default getter which just does a simple property access. Returns - * undefined if the key is not set. + * A simple Immutable Console based diagnostic logger which will output any messages to the Console. + * If you want to limit the amount of logging to a specific level or lower use the + * {@link createLogLevelDiagLogger} + */ +var DiagConsoleLogger = /** @class */ (function () { + function DiagConsoleLogger() { + function _consoleFunc(funcName) { + return function () { + var orgArguments = arguments; + if (console) { + // Some environments only expose the console when the F12 developer console is open + var theFunc = console[funcName]; + if (typeof theFunc !== 'function') { + // Not all environments support all functions + theFunc = console.log; + } + // One last final check + if (typeof theFunc === 'function') { + return theFunc.apply(console, orgArguments); + } + } + }; + } + for (var i = 0; i < consoleMap.length; i++) { + this[consoleMap[i].n] = _consoleFunc(consoleMap[i].c); + } + } + return DiagConsoleLogger; +}()); +exports.DiagConsoleLogger = DiagConsoleLogger; +//# sourceMappingURL=consoleLogger.js.map + +/***/ }), + +/***/ 1634: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 * - * @param carrier - * @param key + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ -function defaultGetter(carrier, key) { - return carrier[key]; -} -exports.defaultGetter = defaultGetter; -//# sourceMappingURL=getter.js.map +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__nccwpck_require__(3041), exports); +__exportStar(__nccwpck_require__(8077), exports); +//# sourceMappingURL=index.js.map /***/ }), -/***/ 4707: -/***/ ((__unused_webpack_module, exports) => { +/***/ 9639: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -45029,22 +45937,38 @@ exports.defaultGetter = defaultGetter; * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.defaultSetter = void 0; -/** - * Default setter which sets value via direct property access - * - * @param carrier - * @param key - */ -function defaultSetter(carrier, key, value) { - carrier[key] = value; +exports.createLogLevelDiagLogger = void 0; +var types_1 = __nccwpck_require__(8077); +function createLogLevelDiagLogger(maxLevel, logger) { + if (maxLevel < types_1.DiagLogLevel.NONE) { + maxLevel = types_1.DiagLogLevel.NONE; + } + else if (maxLevel > types_1.DiagLogLevel.ALL) { + maxLevel = types_1.DiagLogLevel.ALL; + } + // In case the logger is null or undefined + logger = logger || {}; + function _filterFunc(funcName, theLevel) { + var theFunc = logger[funcName]; + if (typeof theFunc === 'function' && maxLevel >= theLevel) { + return theFunc.bind(logger); + } + return function () { }; + } + return { + error: _filterFunc('error', types_1.DiagLogLevel.ERROR), + warn: _filterFunc('warn', types_1.DiagLogLevel.WARN), + info: _filterFunc('info', types_1.DiagLogLevel.INFO), + debug: _filterFunc('debug', types_1.DiagLogLevel.DEBUG), + verbose: _filterFunc('verbose', types_1.DiagLogLevel.VERBOSE), + }; } -exports.defaultSetter = defaultSetter; -//# sourceMappingURL=setter.js.map +exports.createLogLevelDiagLogger = createLogLevelDiagLogger; +//# sourceMappingURL=logLevelLogger.js.map /***/ }), -/***/ 808: +/***/ 8077: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -45065,33 +45989,33 @@ exports.defaultSetter = defaultSetter; * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=CorrelationContext.js.map - -/***/ }), - -/***/ 1809: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.EntryTtl = void 0; +exports.DiagLogLevel = void 0; /** - * EntryTtl is an integer that represents number of hops an entry can propagate. - * - * For now, ONLY special values (0 and -1) are supported. + * Defines the available internal logging levels for the diagnostic logger, the numeric values + * of the levels are defined to match the original values from the initial LogLevel to avoid + * compatibility/migration issues for any implementation that assume the numeric ordering. */ -var EntryTtl; -(function (EntryTtl) { +var DiagLogLevel; +(function (DiagLogLevel) { + /** Diagnostic Logging level setting to disable all logging (except and forced logs) */ + DiagLogLevel[DiagLogLevel["NONE"] = 0] = "NONE"; + /** Identifies an error scenario */ + DiagLogLevel[DiagLogLevel["ERROR"] = 30] = "ERROR"; + /** Identifies a warning scenario */ + DiagLogLevel[DiagLogLevel["WARN"] = 50] = "WARN"; + /** General informational log message */ + DiagLogLevel[DiagLogLevel["INFO"] = 60] = "INFO"; + /** General debug log message */ + DiagLogLevel[DiagLogLevel["DEBUG"] = 70] = "DEBUG"; /** - * NO_PROPAGATION is considered to have local context and is used within the - * process it created. + * Detailed trace level logging should only be used for development, should only be set + * in a development environment. */ - EntryTtl[EntryTtl["NO_PROPAGATION"] = 0] = "NO_PROPAGATION"; - /** UNLIMITED_PROPAGATION can propagate unlimited hops. */ - EntryTtl[EntryTtl["UNLIMITED_PROPAGATION"] = -1] = "UNLIMITED_PROPAGATION"; -})(EntryTtl = exports.EntryTtl || (exports.EntryTtl = {})); -//# sourceMappingURL=EntryValue.js.map + DiagLogLevel[DiagLogLevel["VERBOSE"] = 80] = "VERBOSE"; + /** Used to set the logging level to include all logging */ + DiagLogLevel[DiagLogLevel["ALL"] = 9999] = "ALL"; +})(DiagLogLevel = exports.DiagLogLevel || (exports.DiagLogLevel = {})); +//# sourceMappingURL=types.js.map /***/ }), @@ -45123,35 +46047,24 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi o[k2] = m[k]; })); var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); }; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.propagation = exports.metrics = exports.trace = exports.context = void 0; -__exportStar(__nccwpck_require__(1344), exports); +exports.diag = exports.propagation = exports.trace = exports.context = exports.isValidSpanId = exports.isValidTraceId = exports.isSpanContextValid = exports.INVALID_SPAN_CONTEXT = exports.INVALID_TRACEID = exports.INVALID_SPANID = void 0; +__exportStar(__nccwpck_require__(4967), exports); +__exportStar(__nccwpck_require__(4447), exports); __exportStar(__nccwpck_require__(2358), exports); -__exportStar(__nccwpck_require__(3050), exports); -__exportStar(__nccwpck_require__(3422), exports); -__exportStar(__nccwpck_require__(9757), exports); -__exportStar(__nccwpck_require__(4707), exports); -__exportStar(__nccwpck_require__(808), exports); -__exportStar(__nccwpck_require__(1809), exports); -__exportStar(__nccwpck_require__(2500), exports); -__exportStar(__nccwpck_require__(4931), exports); -__exportStar(__nccwpck_require__(2111), exports); -__exportStar(__nccwpck_require__(7507), exports); -__exportStar(__nccwpck_require__(9999), exports); -__exportStar(__nccwpck_require__(4837), exports); -__exportStar(__nccwpck_require__(2647), exports); -__exportStar(__nccwpck_require__(817), exports); -__exportStar(__nccwpck_require__(3347), exports); +__exportStar(__nccwpck_require__(1634), exports); +__exportStar(__nccwpck_require__(2368), exports); +__exportStar(__nccwpck_require__(865), exports); __exportStar(__nccwpck_require__(7492), exports); __exportStar(__nccwpck_require__(4595), exports); -__exportStar(__nccwpck_require__(6169), exports); __exportStar(__nccwpck_require__(9373), exports); __exportStar(__nccwpck_require__(4023), exports); -__exportStar(__nccwpck_require__(1169), exports); __exportStar(__nccwpck_require__(7606), exports); __exportStar(__nccwpck_require__(3259), exports); +__exportStar(__nccwpck_require__(3503), exports); +__exportStar(__nccwpck_require__(2285), exports); __exportStar(__nccwpck_require__(9671), exports); __exportStar(__nccwpck_require__(3209), exports); __exportStar(__nccwpck_require__(5769), exports); @@ -45164,107 +46077,45 @@ __exportStar(__nccwpck_require__(6905), exports); __exportStar(__nccwpck_require__(8384), exports); __exportStar(__nccwpck_require__(891), exports); __exportStar(__nccwpck_require__(3168), exports); -var context_base_1 = __nccwpck_require__(5664); -Object.defineProperty(exports, "Context", ({ enumerable: true, get: function () { return context_base_1.Context; } })); -var context_1 = __nccwpck_require__(5560); +var spancontext_utils_1 = __nccwpck_require__(9745); +Object.defineProperty(exports, "INVALID_SPANID", ({ enumerable: true, get: function () { return spancontext_utils_1.INVALID_SPANID; } })); +Object.defineProperty(exports, "INVALID_TRACEID", ({ enumerable: true, get: function () { return spancontext_utils_1.INVALID_TRACEID; } })); +Object.defineProperty(exports, "INVALID_SPAN_CONTEXT", ({ enumerable: true, get: function () { return spancontext_utils_1.INVALID_SPAN_CONTEXT; } })); +Object.defineProperty(exports, "isSpanContextValid", ({ enumerable: true, get: function () { return spancontext_utils_1.isSpanContextValid; } })); +Object.defineProperty(exports, "isValidTraceId", ({ enumerable: true, get: function () { return spancontext_utils_1.isValidTraceId; } })); +Object.defineProperty(exports, "isValidSpanId", ({ enumerable: true, get: function () { return spancontext_utils_1.isValidSpanId; } })); +__exportStar(__nccwpck_require__(8242), exports); +__exportStar(__nccwpck_require__(4118), exports); +__exportStar(__nccwpck_require__(6504), exports); +var context_1 = __nccwpck_require__(7171); /** Entrypoint for context API */ exports.context = context_1.ContextAPI.getInstance(); var trace_1 = __nccwpck_require__(1539); /** Entrypoint for trace API */ exports.trace = trace_1.TraceAPI.getInstance(); -var metrics_1 = __nccwpck_require__(7696); -/** Entrypoint for metrics API */ -exports.metrics = metrics_1.MetricsAPI.getInstance(); var propagation_1 = __nccwpck_require__(9909); /** Entrypoint for propagation API */ exports.propagation = propagation_1.PropagationAPI.getInstance(); +var diag_1 = __nccwpck_require__(1877); +/** + * Entrypoint for Diag API. + * Defines Diagnostic handler used for internal diagnostic logging operations. + * The default provides a Noop DiagLogger implementation which may be changed via the + * diag.setLogger(logger: DiagLogger) function. + */ +exports.diag = diag_1.DiagAPI.instance(); exports.default = { trace: exports.trace, - metrics: exports.metrics, context: exports.context, propagation: exports.propagation, + diag: exports.diag, }; //# sourceMappingURL=index.js.map /***/ }), -/***/ 2500: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=BatchObserverResult.js.map - -/***/ }), - -/***/ 4931: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=BoundInstrument.js.map - -/***/ }), - -/***/ 2111: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=Meter.js.map - -/***/ }), - -/***/ 7507: -/***/ ((__unused_webpack_module, exports) => { +/***/ 5135: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -45284,12 +46135,58 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=MeterProvider.js.map +exports.unregisterGlobal = exports.getGlobal = exports.registerGlobal = void 0; +var __1 = __nccwpck_require__(5163); +var platform_1 = __nccwpck_require__(9957); +var version_1 = __nccwpck_require__(8996); +var semver_1 = __nccwpck_require__(1522); +var major = version_1.VERSION.split('.')[0]; +var GLOBAL_OPENTELEMETRY_API_KEY = Symbol.for("io.opentelemetry.js.api." + major); +var _global = platform_1._globalThis; +function registerGlobal(type, instance, allowOverride) { + var _a; + if (allowOverride === void 0) { allowOverride = false; } + _global[GLOBAL_OPENTELEMETRY_API_KEY] = (_a = _global[GLOBAL_OPENTELEMETRY_API_KEY]) !== null && _a !== void 0 ? _a : { + version: version_1.VERSION, + }; + var api = _global[GLOBAL_OPENTELEMETRY_API_KEY]; + if (!allowOverride && api[type]) { + // already registered an API of this type + var err = new Error("@opentelemetry/api: Attempted duplicate registration of API: " + type); + __1.diag.error(err.stack || err.message); + return; + } + if (api.version !== version_1.VERSION) { + // All registered APIs must be of the same version exactly + var err = new Error('@opentelemetry/api: All API registration versions must match'); + __1.diag.error(err.stack || err.message); + return; + } + api[type] = instance; +} +exports.registerGlobal = registerGlobal; +function getGlobal(type) { + var _a, _b; + var globalVersion = (_a = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _a === void 0 ? void 0 : _a.version; + if (!globalVersion || !semver_1.isCompatible(globalVersion)) { + return; + } + return (_b = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _b === void 0 ? void 0 : _b[type]; +} +exports.getGlobal = getGlobal; +function unregisterGlobal(type) { + var api = _global[GLOBAL_OPENTELEMETRY_API_KEY]; + if (api) { + delete api[type]; + } +} +exports.unregisterGlobal = unregisterGlobal; +//# sourceMappingURL=global-utils.js.map /***/ }), -/***/ 9999: -/***/ ((__unused_webpack_module, exports) => { +/***/ 1522: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -45309,267 +46206,104 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ValueType = void 0; -/** The Type of value. It describes how the data is reported. */ -var ValueType; -(function (ValueType) { - ValueType[ValueType["INT"] = 0] = "INT"; - ValueType[ValueType["DOUBLE"] = 1] = "DOUBLE"; -})(ValueType = exports.ValueType || (exports.ValueType = {})); -//# sourceMappingURL=Metric.js.map - -/***/ }), - -/***/ 4837: -/***/ (function(__unused_webpack_module, exports) { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +exports.isCompatible = exports._makeCompatibilityCheck = void 0; +var version_1 = __nccwpck_require__(8996); +var re = /^(\d+)\.(\d+)\.(\d+)(?:-(.*))?$/; +/** + * Create a function to test an API version to see if it is compatible with the provided ownVersion. * - * https://www.apache.org/licenses/LICENSE-2.0 + * The returned function has the following semantics: + * - Exact match is always compatible + * - Major versions must match exactly + * - 1.x package cannot use global 2.x package + * - 2.x package cannot use global 1.x package + * - The minor version of the API module requesting access to the global API must be less than or equal to the minor version of this API + * - 1.3 package may use 1.4 global because the later global contains all functions 1.3 expects + * - 1.4 package may NOT use 1.3 global because it may try to call functions which don't exist on 1.3 + * - If the major version is 0, the minor version is treated as the major and the patch is treated as the minor + * - Patch and build tag differences are not considered at this time * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NOOP_BATCH_OBSERVER_METRIC = exports.NOOP_SUM_OBSERVER_METRIC = exports.NOOP_UP_DOWN_SUM_OBSERVER_METRIC = exports.NOOP_VALUE_OBSERVER_METRIC = exports.NOOP_BOUND_BASE_OBSERVER = exports.NOOP_VALUE_RECORDER_METRIC = exports.NOOP_BOUND_VALUE_RECORDER = exports.NOOP_COUNTER_METRIC = exports.NOOP_BOUND_COUNTER = exports.NOOP_METER = exports.NoopBoundBaseObserver = exports.NoopBoundValueRecorder = exports.NoopBoundCounter = exports.NoopBatchObserverMetric = exports.NoopBaseObserverMetric = exports.NoopValueRecorderMetric = exports.NoopCounterMetric = exports.NoopMetric = exports.NoopMeter = void 0; -/** - * NoopMeter is a noop implementation of the {@link Meter} interface. It reuses - * constant NoopMetrics for all of its methods. + * @param ownVersion version which should be checked against */ -var NoopMeter = /** @class */ (function () { - function NoopMeter() { - } - /** - * Returns constant noop value recorder. - * @param name the name of the metric. - * @param [options] the metric options. - */ - NoopMeter.prototype.createValueRecorder = function (name, options) { - return exports.NOOP_VALUE_RECORDER_METRIC; - }; - /** - * Returns a constant noop counter. - * @param name the name of the metric. - * @param [options] the metric options. - */ - NoopMeter.prototype.createCounter = function (name, options) { - return exports.NOOP_COUNTER_METRIC; - }; - /** - * Returns a constant noop UpDownCounter. - * @param name the name of the metric. - * @param [options] the metric options. - */ - NoopMeter.prototype.createUpDownCounter = function (name, options) { - return exports.NOOP_COUNTER_METRIC; - }; - /** - * Returns constant noop value observer. - * @param name the name of the metric. - * @param [options] the metric options. - * @param [callback] the value observer callback - */ - NoopMeter.prototype.createValueObserver = function (name, options, callback) { - return exports.NOOP_VALUE_OBSERVER_METRIC; - }; - /** - * Returns constant noop batch observer. - * @param name the name of the metric. - * @param callback the batch observer callback - */ - NoopMeter.prototype.createBatchObserver = function (name, callback) { - return exports.NOOP_BATCH_OBSERVER_METRIC; - }; - return NoopMeter; -}()); -exports.NoopMeter = NoopMeter; -var NoopMetric = /** @class */ (function () { - function NoopMetric(instrument) { - this._instrument = instrument; +function _makeCompatibilityCheck(ownVersion) { + var acceptedVersions = new Set([ownVersion]); + var rejectedVersions = new Set(); + var myVersionMatch = ownVersion.match(re); + if (!myVersionMatch) { + // we cannot guarantee compatibility so we always return noop + return function () { return false; }; } - /** - * Returns a Bound Instrument associated with specified Labels. - * It is recommended to keep a reference to the Bound Instrument instead of - * always calling this method for every operations. - * @param labels key-values pairs that are associated with a specific metric - * that you want to record. - */ - NoopMetric.prototype.bind = function (labels) { - return this._instrument; - }; - /** - * Removes the Binding from the metric, if it is present. - * @param labels key-values pairs that are associated with a specific metric. - */ - NoopMetric.prototype.unbind = function (labels) { - return; - }; - /** - * Clears all timeseries from the Metric. - */ - NoopMetric.prototype.clear = function () { - return; + var ownVersionParsed = { + major: +myVersionMatch[1], + minor: +myVersionMatch[2], + patch: +myVersionMatch[3], }; - return NoopMetric; -}()); -exports.NoopMetric = NoopMetric; -var NoopCounterMetric = /** @class */ (function (_super) { - __extends(NoopCounterMetric, _super); - function NoopCounterMetric() { - return _super !== null && _super.apply(this, arguments) || this; + function _reject(v) { + rejectedVersions.add(v); + return false; } - NoopCounterMetric.prototype.add = function (value, labels) { - this.bind(labels).add(value); - }; - return NoopCounterMetric; -}(NoopMetric)); -exports.NoopCounterMetric = NoopCounterMetric; -var NoopValueRecorderMetric = /** @class */ (function (_super) { - __extends(NoopValueRecorderMetric, _super); - function NoopValueRecorderMetric() { - return _super !== null && _super.apply(this, arguments) || this; + function _accept(v) { + acceptedVersions.add(v); + return true; } - NoopValueRecorderMetric.prototype.record = function (value, labels, correlationContext, spanContext) { - if (typeof correlationContext === 'undefined') { - this.bind(labels).record(value); + return function isCompatible(globalVersion) { + if (acceptedVersions.has(globalVersion)) { + return true; } - else if (typeof spanContext === 'undefined') { - this.bind(labels).record(value, correlationContext); + if (rejectedVersions.has(globalVersion)) { + return false; } - else { - this.bind(labels).record(value, correlationContext, spanContext); + var globalVersionMatch = globalVersion.match(re); + if (!globalVersionMatch) { + // cannot parse other version + // we cannot guarantee compatibility so we always noop + return _reject(globalVersion); } - }; - return NoopValueRecorderMetric; -}(NoopMetric)); -exports.NoopValueRecorderMetric = NoopValueRecorderMetric; -var NoopBaseObserverMetric = /** @class */ (function (_super) { - __extends(NoopBaseObserverMetric, _super); - function NoopBaseObserverMetric() { - return _super !== null && _super.apply(this, arguments) || this; - } - NoopBaseObserverMetric.prototype.observation = function () { - return { - observer: this, - value: 0, + var globalVersionParsed = { + major: +globalVersionMatch[1], + minor: +globalVersionMatch[2], + patch: +globalVersionMatch[3], }; + // major versions must match + if (ownVersionParsed.major !== globalVersionParsed.major) { + return _reject(globalVersion); + } + if (ownVersionParsed.major === 0) { + if (ownVersionParsed.minor === globalVersionParsed.minor && + ownVersionParsed.patch <= globalVersionParsed.patch) { + return _accept(globalVersion); + } + return _reject(globalVersion); + } + if (ownVersionParsed.minor <= globalVersionParsed.minor) { + return _accept(globalVersion); + } + return _reject(globalVersion); }; - return NoopBaseObserverMetric; -}(NoopMetric)); -exports.NoopBaseObserverMetric = NoopBaseObserverMetric; -var NoopBatchObserverMetric = /** @class */ (function (_super) { - __extends(NoopBatchObserverMetric, _super); - function NoopBatchObserverMetric() { - return _super !== null && _super.apply(this, arguments) || this; - } - return NoopBatchObserverMetric; -}(NoopMetric)); -exports.NoopBatchObserverMetric = NoopBatchObserverMetric; -var NoopBoundCounter = /** @class */ (function () { - function NoopBoundCounter() { - } - NoopBoundCounter.prototype.add = function (value) { - return; - }; - return NoopBoundCounter; -}()); -exports.NoopBoundCounter = NoopBoundCounter; -var NoopBoundValueRecorder = /** @class */ (function () { - function NoopBoundValueRecorder() { - } - NoopBoundValueRecorder.prototype.record = function (value, correlationContext, spanContext) { - return; - }; - return NoopBoundValueRecorder; -}()); -exports.NoopBoundValueRecorder = NoopBoundValueRecorder; -var NoopBoundBaseObserver = /** @class */ (function () { - function NoopBoundBaseObserver() { - } - NoopBoundBaseObserver.prototype.update = function (value) { }; - return NoopBoundBaseObserver; -}()); -exports.NoopBoundBaseObserver = NoopBoundBaseObserver; -exports.NOOP_METER = new NoopMeter(); -exports.NOOP_BOUND_COUNTER = new NoopBoundCounter(); -exports.NOOP_COUNTER_METRIC = new NoopCounterMetric(exports.NOOP_BOUND_COUNTER); -exports.NOOP_BOUND_VALUE_RECORDER = new NoopBoundValueRecorder(); -exports.NOOP_VALUE_RECORDER_METRIC = new NoopValueRecorderMetric(exports.NOOP_BOUND_VALUE_RECORDER); -exports.NOOP_BOUND_BASE_OBSERVER = new NoopBoundBaseObserver(); -exports.NOOP_VALUE_OBSERVER_METRIC = new NoopBaseObserverMetric(exports.NOOP_BOUND_BASE_OBSERVER); -exports.NOOP_UP_DOWN_SUM_OBSERVER_METRIC = new NoopBaseObserverMetric(exports.NOOP_BOUND_BASE_OBSERVER); -exports.NOOP_SUM_OBSERVER_METRIC = new NoopBaseObserverMetric(exports.NOOP_BOUND_BASE_OBSERVER); -exports.NOOP_BATCH_OBSERVER_METRIC = new NoopBatchObserverMetric(); -//# sourceMappingURL=NoopMeter.js.map - -/***/ }), - -/***/ 2647: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +} +exports._makeCompatibilityCheck = _makeCompatibilityCheck; +/** + * Test an API version to see if it is compatible with this API. * - * https://www.apache.org/licenses/LICENSE-2.0 + * - Exact match is always compatible + * - Major versions must match exactly + * - 1.x package cannot use global 2.x package + * - 2.x package cannot use global 1.x package + * - The minor version of the API module requesting access to the global API must be less than or equal to the minor version of this API + * - 1.3 package may use 1.4 global because the later global contains all functions 1.3 expects + * - 1.4 package may NOT use 1.3 global because it may try to call functions which don't exist on 1.3 + * - If the major version is 0, the minor version is treated as the major and the patch is treated as the minor + * - Patch and build tag differences are not considered at this time * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NOOP_METER_PROVIDER = exports.NoopMeterProvider = void 0; -var NoopMeter_1 = __nccwpck_require__(4837); -/** - * An implementation of the {@link MeterProvider} which returns an impotent Meter - * for all calls to `getMeter` + * @param version version of the API requesting an instance of the global API */ -var NoopMeterProvider = /** @class */ (function () { - function NoopMeterProvider() { - } - NoopMeterProvider.prototype.getMeter = function (_name, _version) { - return NoopMeter_1.NOOP_METER; - }; - return NoopMeterProvider; -}()); -exports.NoopMeterProvider = NoopMeterProvider; -exports.NOOP_METER_PROVIDER = new NoopMeterProvider(); -//# sourceMappingURL=NoopMeterProvider.js.map +exports.isCompatible = _makeCompatibilityCheck(version_1.VERSION); +//# sourceMappingURL=semver.js.map /***/ }), -/***/ 817: -/***/ ((__unused_webpack_module, exports) => { +/***/ 9957: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -45588,12 +46322,23 @@ exports.NOOP_METER_PROVIDER = new NoopMeterProvider(); * See the License for the specific language governing permissions and * limitations under the License. */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=Observation.js.map +__exportStar(__nccwpck_require__(7200), exports); +//# sourceMappingURL=index.js.map /***/ }), -/***/ 3347: +/***/ 9406: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -45614,11 +46359,15 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=ObserverResult.js.map +exports._globalThis = void 0; +/** only globals that common to node and browsers are allowed */ +// eslint-disable-next-line node/no-unsupported-features/es-builtins +exports._globalThis = typeof globalThis === 'object' ? globalThis : global; +//# sourceMappingURL=globalThis.js.map /***/ }), -/***/ 9957: +/***/ 7200: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -45646,15 +46395,15 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi o[k2] = m[k]; })); var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); }; Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__nccwpck_require__(7200), exports); +__exportStar(__nccwpck_require__(9406), exports); //# sourceMappingURL=index.js.map /***/ }), -/***/ 9406: +/***/ 2368: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -45675,16 +46424,32 @@ __exportStar(__nccwpck_require__(7200), exports); * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports._globalThis = void 0; -/** only globals that common to node and browsers are allowed */ -// eslint-disable-next-line node/no-unsupported-features/es-builtins -exports._globalThis = typeof globalThis === 'object' ? globalThis : global; -//# sourceMappingURL=globalThis.js.map +exports.NOOP_TEXT_MAP_PROPAGATOR = exports.NoopTextMapPropagator = void 0; +/** + * No-op implementations of {@link TextMapPropagator}. + */ +var NoopTextMapPropagator = /** @class */ (function () { + function NoopTextMapPropagator() { + } + /** Noop inject function does nothing */ + NoopTextMapPropagator.prototype.inject = function (_context, _carrier) { }; + /** Noop extract function does nothing and returns the input context */ + NoopTextMapPropagator.prototype.extract = function (context, _carrier) { + return context; + }; + NoopTextMapPropagator.prototype.fields = function () { + return []; + }; + return NoopTextMapPropagator; +}()); +exports.NoopTextMapPropagator = NoopTextMapPropagator; +exports.NOOP_TEXT_MAP_PROPAGATOR = new NoopTextMapPropagator(); +//# sourceMappingURL=NoopTextMapPropagator.js.map /***/ }), -/***/ 7200: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 865: +/***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -45703,19 +46468,31 @@ exports._globalThis = typeof globalThis === 'object' ? globalThis : global; * See the License for the specific language governing permissions and * limitations under the License. */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -}; Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__nccwpck_require__(9406), exports); -//# sourceMappingURL=index.js.map +exports.defaultTextMapSetter = exports.defaultTextMapGetter = void 0; +exports.defaultTextMapGetter = { + get: function (carrier, key) { + if (carrier == null) { + return undefined; + } + return carrier[key]; + }, + keys: function (carrier) { + if (carrier == null) { + return []; + } + return Object.keys(carrier); + }, +}; +exports.defaultTextMapSetter = { + set: function (carrier, key, value) { + if (carrier == null) { + return; + } + carrier[key] = value; + }, +}; +//# sourceMappingURL=TextMapPropagator.js.map /***/ }), @@ -45765,15 +46542,8 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NOOP_SPAN = exports.NoopSpan = exports.INVALID_SPAN_ID = exports.INVALID_TRACE_ID = void 0; -var trace_flags_1 = __nccwpck_require__(6905); -exports.INVALID_TRACE_ID = '0'; -exports.INVALID_SPAN_ID = '0'; -var INVALID_SPAN_CONTEXT = { - traceId: exports.INVALID_TRACE_ID, - spanId: exports.INVALID_SPAN_ID, - traceFlags: trace_flags_1.TraceFlags.NONE, -}; +exports.NoopSpan = void 0; +var spancontext_utils_1 = __nccwpck_require__(9745); /** * The NoopSpan is the default {@link Span} that is used when no Span * implementation is available. All operations are no-op including context @@ -45781,7 +46551,7 @@ var INVALID_SPAN_CONTEXT = { */ var NoopSpan = /** @class */ (function () { function NoopSpan(_spanContext) { - if (_spanContext === void 0) { _spanContext = INVALID_SPAN_CONTEXT; } + if (_spanContext === void 0) { _spanContext = spancontext_utils_1.INVALID_SPAN_CONTEXT; } this._spanContext = _spanContext; } // Returns a SpanContext. @@ -45789,35 +46559,36 @@ var NoopSpan = /** @class */ (function () { return this._spanContext; }; // By default does nothing - NoopSpan.prototype.setAttribute = function (key, value) { + NoopSpan.prototype.setAttribute = function (_key, _value) { return this; }; // By default does nothing - NoopSpan.prototype.setAttributes = function (attributes) { + NoopSpan.prototype.setAttributes = function (_attributes) { return this; }; // By default does nothing - NoopSpan.prototype.addEvent = function (name, attributes) { + NoopSpan.prototype.addEvent = function (_name, _attributes) { return this; }; // By default does nothing - NoopSpan.prototype.setStatus = function (status) { + NoopSpan.prototype.setStatus = function (_status) { return this; }; // By default does nothing - NoopSpan.prototype.updateName = function (name) { + NoopSpan.prototype.updateName = function (_name) { return this; }; // By default does nothing - NoopSpan.prototype.end = function (endTime) { }; + NoopSpan.prototype.end = function (_endTime) { }; // isRecording always returns false for noopSpan. NoopSpan.prototype.isRecording = function () { return false; }; + // By default does nothing + NoopSpan.prototype.recordException = function (_exception, _time) { }; return NoopSpan; }()); exports.NoopSpan = NoopSpan; -exports.NOOP_SPAN = new NoopSpan(); //# sourceMappingURL=NoopSpan.js.map /***/ }), @@ -45844,29 +46615,39 @@ exports.NOOP_SPAN = new NoopSpan(); */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.NOOP_TRACER = exports.NoopTracer = void 0; +var context_1 = __nccwpck_require__(8242); var NoopSpan_1 = __nccwpck_require__(1169); +var spancontext_utils_1 = __nccwpck_require__(9745); /** * No-op implementations of {@link Tracer}. */ var NoopTracer = /** @class */ (function () { function NoopTracer() { } - NoopTracer.prototype.getCurrentSpan = function () { - return NoopSpan_1.NOOP_SPAN; - }; // startSpan starts a noop span. - NoopTracer.prototype.startSpan = function (name, options) { - return NoopSpan_1.NOOP_SPAN; - }; - NoopTracer.prototype.withSpan = function (span, fn) { - return fn(); - }; - NoopTracer.prototype.bind = function (target, span) { - return target; + NoopTracer.prototype.startSpan = function (name, options, context) { + var root = Boolean(options === null || options === void 0 ? void 0 : options.root); + if (root) { + return new NoopSpan_1.NoopSpan(); + } + var parentFromContext = context && context_1.getSpanContext(context); + if (isSpanContext(parentFromContext) && + spancontext_utils_1.isSpanContextValid(parentFromContext)) { + return new NoopSpan_1.NoopSpan(parentFromContext); + } + else { + return new NoopSpan_1.NoopSpan(); + } }; return NoopTracer; }()); exports.NoopTracer = NoopTracer; +function isSpanContext(spanContext) { + return (typeof spanContext === 'object' && + typeof spanContext['spanId'] === 'string' && + typeof spanContext['traceId'] === 'string' && + typeof spanContext['traceFlags'] === 'number'); +} exports.NOOP_TRACER = new NoopTracer(); //# sourceMappingURL=NoopTracer.js.map @@ -45915,6 +46696,126 @@ exports.NOOP_TRACER_PROVIDER = new NoopTracerProvider(); /***/ }), +/***/ 3503: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ProxyTracer = void 0; +var NoopTracer_1 = __nccwpck_require__(7606); +/** + * Proxy tracer provided by the proxy tracer provider + */ +var ProxyTracer = /** @class */ (function () { + function ProxyTracer(_provider, name, version) { + this._provider = _provider; + this.name = name; + this.version = version; + } + ProxyTracer.prototype.startSpan = function (name, options, context) { + return this._getTracer().startSpan(name, options, context); + }; + /** + * Try to get a tracer from the proxy tracer provider. + * If the proxy tracer provider has no delegate, return a noop tracer. + */ + ProxyTracer.prototype._getTracer = function () { + if (this._delegate) { + return this._delegate; + } + var tracer = this._provider.getDelegateTracer(this.name, this.version); + if (!tracer) { + return NoopTracer_1.NOOP_TRACER; + } + this._delegate = tracer; + return this._delegate; + }; + return ProxyTracer; +}()); +exports.ProxyTracer = ProxyTracer; +//# sourceMappingURL=ProxyTracer.js.map + +/***/ }), + +/***/ 2285: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ProxyTracerProvider = void 0; +var ProxyTracer_1 = __nccwpck_require__(3503); +var NoopTracerProvider_1 = __nccwpck_require__(3259); +/** + * Tracer provider which provides {@link ProxyTracer}s. + * + * Before a delegate is set, tracers provided are NoOp. + * When a delegate is set, traces are provided from the delegate. + * When a delegate is set after tracers have already been provided, + * all tracers already provided will use the provided delegate implementation. + */ +var ProxyTracerProvider = /** @class */ (function () { + function ProxyTracerProvider() { + } + /** + * Get a {@link ProxyTracer} + */ + ProxyTracerProvider.prototype.getTracer = function (name, version) { + var _a; + return ((_a = this.getDelegateTracer(name, version)) !== null && _a !== void 0 ? _a : new ProxyTracer_1.ProxyTracer(this, name, version)); + }; + ProxyTracerProvider.prototype.getDelegate = function () { + var _a; + return (_a = this._delegate) !== null && _a !== void 0 ? _a : NoopTracerProvider_1.NOOP_TRACER_PROVIDER; + }; + /** + * Set the delegate tracer provider + */ + ProxyTracerProvider.prototype.setDelegate = function (delegate) { + this._delegate = delegate; + }; + ProxyTracerProvider.prototype.getDelegateTracer = function (name, version) { + var _a; + return (_a = this._delegate) === null || _a === void 0 ? void 0 : _a.getTracer(name, version); + }; + return ProxyTracerProvider; +}()); +exports.ProxyTracerProvider = ProxyTracerProvider; +//# sourceMappingURL=ProxyTracerProvider.js.map + +/***/ }), + /***/ 9671: /***/ ((__unused_webpack_module, exports) => { @@ -46043,16 +46944,6 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=attributes.js.map - -/***/ }), - -/***/ 6169: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - /* * Copyright The OpenTelemetry Authors * @@ -46069,7 +46960,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=Plugin.js.map +//# sourceMappingURL=attributes.js.map /***/ }), @@ -46226,150 +47117,69 @@ var SpanKind; /***/ }), +/***/ 9745: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isSpanContextValid = exports.isValidSpanId = exports.isValidTraceId = exports.INVALID_SPAN_CONTEXT = exports.INVALID_TRACEID = exports.INVALID_SPANID = void 0; +var trace_flags_1 = __nccwpck_require__(6905); +var VALID_TRACEID_REGEX = /^([0-9a-f]{32})$/i; +var VALID_SPANID_REGEX = /^[0-9a-f]{16}$/i; +exports.INVALID_SPANID = '0000000000000000'; +exports.INVALID_TRACEID = '00000000000000000000000000000000'; +exports.INVALID_SPAN_CONTEXT = { + traceId: exports.INVALID_TRACEID, + spanId: exports.INVALID_SPANID, + traceFlags: trace_flags_1.TraceFlags.NONE, +}; +function isValidTraceId(traceId) { + return VALID_TRACEID_REGEX.test(traceId) && traceId !== exports.INVALID_TRACEID; +} +exports.isValidTraceId = isValidTraceId; +function isValidSpanId(spanId) { + return VALID_SPANID_REGEX.test(spanId) && spanId !== exports.INVALID_SPANID; +} +exports.isValidSpanId = isValidSpanId; +/** + * Returns true if this {@link SpanContext} is valid. + * @return true if this {@link SpanContext} is valid. + */ +function isSpanContextValid(spanContext) { + return (isValidTraceId(spanContext.traceId) && isValidSpanId(spanContext.spanId)); +} +exports.isSpanContextValid = isSpanContextValid; +//# sourceMappingURL=spancontext-utils.js.map + +/***/ }), + /***/ 8845: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.CanonicalCode = void 0; +exports.SpanStatusCode = void 0; /** - * An enumeration of canonical status codes. + * An enumeration of status codes. */ -var CanonicalCode; -(function (CanonicalCode) { - /** - * Not an error; returned on success - */ - CanonicalCode[CanonicalCode["OK"] = 0] = "OK"; - /** - * The operation was cancelled (typically by the caller). - */ - CanonicalCode[CanonicalCode["CANCELLED"] = 1] = "CANCELLED"; - /** - * Unknown error. An example of where this error may be returned is - * if a status value received from another address space belongs to - * an error-space that is not known in this address space. Also - * errors raised by APIs that do not return enough error information - * may be converted to this error. - */ - CanonicalCode[CanonicalCode["UNKNOWN"] = 2] = "UNKNOWN"; - /** - * Client specified an invalid argument. Note that this differs - * from FAILED_PRECONDITION. INVALID_ARGUMENT indicates arguments - * that are problematic regardless of the state of the system - * (e.g., a malformed file name). - */ - CanonicalCode[CanonicalCode["INVALID_ARGUMENT"] = 3] = "INVALID_ARGUMENT"; - /** - * Deadline expired before operation could complete. For operations - * that change the state of the system, this error may be returned - * even if the operation has completed successfully. For example, a - * successful response from a server could have been delayed long - * enough for the deadline to expire. - */ - CanonicalCode[CanonicalCode["DEADLINE_EXCEEDED"] = 4] = "DEADLINE_EXCEEDED"; - /** - * Some requested entity (e.g., file or directory) was not found. - */ - CanonicalCode[CanonicalCode["NOT_FOUND"] = 5] = "NOT_FOUND"; - /** - * Some entity that we attempted to create (e.g., file or directory) - * already exists. - */ - CanonicalCode[CanonicalCode["ALREADY_EXISTS"] = 6] = "ALREADY_EXISTS"; - /** - * The caller does not have permission to execute the specified - * operation. PERMISSION_DENIED must not be used for rejections - * caused by exhausting some resource (use RESOURCE_EXHAUSTED - * instead for those errors). PERMISSION_DENIED must not be - * used if the caller can not be identified (use UNAUTHENTICATED - * instead for those errors). - */ - CanonicalCode[CanonicalCode["PERMISSION_DENIED"] = 7] = "PERMISSION_DENIED"; - /** - * Some resource has been exhausted, perhaps a per-user quota, or - * perhaps the entire file system is out of space. - */ - CanonicalCode[CanonicalCode["RESOURCE_EXHAUSTED"] = 8] = "RESOURCE_EXHAUSTED"; - /** - * Operation was rejected because the system is not in a state - * required for the operation's execution. For example, directory - * to be deleted may be non-empty, an rmdir operation is applied to - * a non-directory, etc. - * - * A litmus test that may help a service implementor in deciding - * between FAILED_PRECONDITION, ABORTED, and UNAVAILABLE: - * - * - Use UNAVAILABLE if the client can retry just the failing call. - * - Use ABORTED if the client should retry at a higher-level - * (e.g., restarting a read-modify-write sequence). - * - Use FAILED_PRECONDITION if the client should not retry until - * the system state has been explicitly fixed. E.g., if an "rmdir" - * fails because the directory is non-empty, FAILED_PRECONDITION - * should be returned since the client should not retry unless - * they have first fixed up the directory by deleting files from it. - * - Use FAILED_PRECONDITION if the client performs conditional - * REST Get/Update/Delete on a resource and the resource on the - * server does not match the condition. E.g., conflicting - * read-modify-write on the same resource. - */ - CanonicalCode[CanonicalCode["FAILED_PRECONDITION"] = 9] = "FAILED_PRECONDITION"; - /** - * The operation was aborted, typically due to a concurrency issue - * like sequencer check failures, transaction aborts, etc. - * - * See litmus test above for deciding between FAILED_PRECONDITION, - * ABORTED, and UNAVAILABLE. - */ - CanonicalCode[CanonicalCode["ABORTED"] = 10] = "ABORTED"; - /** - * Operation was attempted past the valid range. E.g., seeking or - * reading past end of file. - * - * Unlike INVALID_ARGUMENT, this error indicates a problem that may - * be fixed if the system state changes. For example, a 32-bit file - * system will generate INVALID_ARGUMENT if asked to read at an - * offset that is not in the range [0,2^32-1], but it will generate - * OUT_OF_RANGE if asked to read from an offset past the current - * file size. - * - * There is a fair bit of overlap between FAILED_PRECONDITION and - * OUT_OF_RANGE. We recommend using OUT_OF_RANGE (the more specific - * error) when it applies so that callers who are iterating through - * a space can easily look for an OUT_OF_RANGE error to detect when - * they are done. - */ - CanonicalCode[CanonicalCode["OUT_OF_RANGE"] = 11] = "OUT_OF_RANGE"; - /** - * Operation is not implemented or not supported/enabled in this service. - */ - CanonicalCode[CanonicalCode["UNIMPLEMENTED"] = 12] = "UNIMPLEMENTED"; - /** - * Internal errors. Means some invariants expected by underlying - * system has been broken. If you see one of these errors, - * something is very broken. - */ - CanonicalCode[CanonicalCode["INTERNAL"] = 13] = "INTERNAL"; +var SpanStatusCode; +(function (SpanStatusCode) { /** - * The service is currently unavailable. This is a most likely a - * transient condition and may be corrected by retrying with - * a backoff. - * - * See litmus test above for deciding between FAILED_PRECONDITION, - * ABORTED, and UNAVAILABLE. + * The default status. */ - CanonicalCode[CanonicalCode["UNAVAILABLE"] = 14] = "UNAVAILABLE"; + SpanStatusCode[SpanStatusCode["UNSET"] = 0] = "UNSET"; /** - * Unrecoverable data loss or corruption. + * The operation has been validated by an Application developer or + * Operator to have completed successfully. */ - CanonicalCode[CanonicalCode["DATA_LOSS"] = 15] = "DATA_LOSS"; + SpanStatusCode[SpanStatusCode["OK"] = 1] = "OK"; /** - * The request does not have valid authentication credentials for the - * operation. + * The operation contains an error. */ - CanonicalCode[CanonicalCode["UNAUTHENTICATED"] = 16] = "UNAUTHENTICATED"; -})(CanonicalCode = exports.CanonicalCode || (exports.CanonicalCode = {})); + SpanStatusCode[SpanStatusCode["ERROR"] = 2] = "ERROR"; +})(SpanStatusCode = exports.SpanStatusCode || (exports.SpanStatusCode = {})); //# sourceMappingURL=status.js.map /***/ }), @@ -46412,16 +47222,6 @@ var TraceFlags; "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=trace_state.js.map - -/***/ }), - -/***/ 3168: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - /* * Copyright The OpenTelemetry Authors * @@ -46438,11 +47238,11 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=tracer.js.map +//# sourceMappingURL=trace_state.js.map /***/ }), -/***/ 891: +/***/ 3168: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -46463,145 +47263,15 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=tracer_provider.js.map - -/***/ }), - -/***/ 2331: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NoopContextManager = void 0; -var context_1 = __nccwpck_require__(2678); -var NoopContextManager = /** @class */ (function () { - function NoopContextManager() { - } - NoopContextManager.prototype.active = function () { - return context_1.Context.ROOT_CONTEXT; - }; - NoopContextManager.prototype.with = function (context, fn) { - return fn(); - }; - NoopContextManager.prototype.bind = function (target, context) { - return target; - }; - NoopContextManager.prototype.enable = function () { - return this; - }; - NoopContextManager.prototype.disable = function () { - return this; - }; - return NoopContextManager; -}()); -exports.NoopContextManager = NoopContextManager; -//# sourceMappingURL=NoopContextManager.js.map +//# sourceMappingURL=tracer.js.map /***/ }), -/***/ 2678: +/***/ 891: /***/ ((__unused_webpack_module, exports) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Context = void 0; -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var Context = /** @class */ (function () { - /** - * Construct a new context which inherits values from an optional parent context. - * - * @param parentContext a context from which to inherit values - */ - function Context(parentContext) { - this._currentContext = parentContext ? new Map(parentContext) : new Map(); - } - /** Get a key to uniquely identify a context value */ - Context.createKey = function (description) { - return Symbol(description); - }; - /** - * Get a value from the context. - * - * @param key key which identifies a context value - */ - Context.prototype.getValue = function (key) { - return this._currentContext.get(key); - }; - /** - * Create a new context which inherits from this context and has - * the given key set to the given value. - * - * @param key context key for which to set the value - * @param value value to set for the given key - */ - Context.prototype.setValue = function (key, value) { - var context = new Context(this._currentContext); - context._currentContext.set(key, value); - return context; - }; - /** - * Return a new context which inherits from this context but does - * not contain a value for the given key. - * - * @param key context key for which to clear a value - */ - Context.prototype.deleteValue = function (key) { - var context = new Context(this._currentContext); - context._currentContext.delete(key); - return context; - }; - /** The root context is used as the default parent context when there is no active context */ - Context.ROOT_CONTEXT = new Context(); - /** - * This is another identifier to the root context which allows developers to easily search the - * codebase for direct uses of context which need to be removed in later PRs. - * - * It's existence is temporary and it should be removed when all references are fixed. - */ - Context.TODO = Context.ROOT_CONTEXT; - return Context; -}()); -exports.Context = Context; -//# sourceMappingURL=context.js.map - -/***/ }), - -/***/ 5664: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - /* * Copyright The OpenTelemetry Authors * @@ -46617,25 +47287,12 @@ exports.Context = Context; * See the License for the specific language governing permissions and * limitations under the License. */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -}; Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__nccwpck_require__(5683), exports); -__exportStar(__nccwpck_require__(2678), exports); -__exportStar(__nccwpck_require__(2331), exports); -//# sourceMappingURL=index.js.map +//# sourceMappingURL=tracer_provider.js.map /***/ }), -/***/ 5683: +/***/ 8996: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -46656,7 +47313,10 @@ __exportStar(__nccwpck_require__(2331), exports); * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=types.js.map +exports.VERSION = void 0; +// this is autogenerated file, see scripts/version-update.js +exports.VERSION = '1.0.0-rc.0'; +//# sourceMappingURL=version.js.map /***/ }), @@ -59524,7 +60184,7 @@ module.exports = eval("require")("encoding"); /***/ ((module) => { "use strict"; -module.exports = JSON.parse('{"application/1d-interleaved-parityfec":{"source":"iana"},"application/3gpdash-qoe-report+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/3gpp-ims+xml":{"source":"iana","compressible":true},"application/a2l":{"source":"iana"},"application/activemessage":{"source":"iana"},"application/activity+json":{"source":"iana","compressible":true},"application/alto-costmap+json":{"source":"iana","compressible":true},"application/alto-costmapfilter+json":{"source":"iana","compressible":true},"application/alto-directory+json":{"source":"iana","compressible":true},"application/alto-endpointcost+json":{"source":"iana","compressible":true},"application/alto-endpointcostparams+json":{"source":"iana","compressible":true},"application/alto-endpointprop+json":{"source":"iana","compressible":true},"application/alto-endpointpropparams+json":{"source":"iana","compressible":true},"application/alto-error+json":{"source":"iana","compressible":true},"application/alto-networkmap+json":{"source":"iana","compressible":true},"application/alto-networkmapfilter+json":{"source":"iana","compressible":true},"application/alto-updatestreamcontrol+json":{"source":"iana","compressible":true},"application/alto-updatestreamparams+json":{"source":"iana","compressible":true},"application/aml":{"source":"iana"},"application/andrew-inset":{"source":"iana","extensions":["ez"]},"application/applefile":{"source":"iana"},"application/applixware":{"source":"apache","extensions":["aw"]},"application/atf":{"source":"iana"},"application/atfx":{"source":"iana"},"application/atom+xml":{"source":"iana","compressible":true,"extensions":["atom"]},"application/atomcat+xml":{"source":"iana","compressible":true,"extensions":["atomcat"]},"application/atomdeleted+xml":{"source":"iana","compressible":true,"extensions":["atomdeleted"]},"application/atomicmail":{"source":"iana"},"application/atomsvc+xml":{"source":"iana","compressible":true,"extensions":["atomsvc"]},"application/atsc-dwd+xml":{"source":"iana","compressible":true,"extensions":["dwd"]},"application/atsc-dynamic-event-message":{"source":"iana"},"application/atsc-held+xml":{"source":"iana","compressible":true,"extensions":["held"]},"application/atsc-rdt+json":{"source":"iana","compressible":true},"application/atsc-rsat+xml":{"source":"iana","compressible":true,"extensions":["rsat"]},"application/atxml":{"source":"iana"},"application/auth-policy+xml":{"source":"iana","compressible":true},"application/bacnet-xdd+zip":{"source":"iana","compressible":false},"application/batch-smtp":{"source":"iana"},"application/bdoc":{"compressible":false,"extensions":["bdoc"]},"application/beep+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/calendar+json":{"source":"iana","compressible":true},"application/calendar+xml":{"source":"iana","compressible":true,"extensions":["xcs"]},"application/call-completion":{"source":"iana"},"application/cals-1840":{"source":"iana"},"application/captive+json":{"source":"iana","compressible":true},"application/cbor":{"source":"iana"},"application/cbor-seq":{"source":"iana"},"application/cccex":{"source":"iana"},"application/ccmp+xml":{"source":"iana","compressible":true},"application/ccxml+xml":{"source":"iana","compressible":true,"extensions":["ccxml"]},"application/cdfx+xml":{"source":"iana","compressible":true,"extensions":["cdfx"]},"application/cdmi-capability":{"source":"iana","extensions":["cdmia"]},"application/cdmi-container":{"source":"iana","extensions":["cdmic"]},"application/cdmi-domain":{"source":"iana","extensions":["cdmid"]},"application/cdmi-object":{"source":"iana","extensions":["cdmio"]},"application/cdmi-queue":{"source":"iana","extensions":["cdmiq"]},"application/cdni":{"source":"iana"},"application/cea":{"source":"iana"},"application/cea-2018+xml":{"source":"iana","compressible":true},"application/cellml+xml":{"source":"iana","compressible":true},"application/cfw":{"source":"iana"},"application/clr":{"source":"iana"},"application/clue+xml":{"source":"iana","compressible":true},"application/clue_info+xml":{"source":"iana","compressible":true},"application/cms":{"source":"iana"},"application/cnrp+xml":{"source":"iana","compressible":true},"application/coap-group+json":{"source":"iana","compressible":true},"application/coap-payload":{"source":"iana"},"application/commonground":{"source":"iana"},"application/conference-info+xml":{"source":"iana","compressible":true},"application/cose":{"source":"iana"},"application/cose-key":{"source":"iana"},"application/cose-key-set":{"source":"iana"},"application/cpl+xml":{"source":"iana","compressible":true},"application/csrattrs":{"source":"iana"},"application/csta+xml":{"source":"iana","compressible":true},"application/cstadata+xml":{"source":"iana","compressible":true},"application/csvm+json":{"source":"iana","compressible":true},"application/cu-seeme":{"source":"apache","extensions":["cu"]},"application/cwt":{"source":"iana"},"application/cybercash":{"source":"iana"},"application/dart":{"compressible":true},"application/dash+xml":{"source":"iana","compressible":true,"extensions":["mpd"]},"application/dashdelta":{"source":"iana"},"application/davmount+xml":{"source":"iana","compressible":true,"extensions":["davmount"]},"application/dca-rft":{"source":"iana"},"application/dcd":{"source":"iana"},"application/dec-dx":{"source":"iana"},"application/dialog-info+xml":{"source":"iana","compressible":true},"application/dicom":{"source":"iana"},"application/dicom+json":{"source":"iana","compressible":true},"application/dicom+xml":{"source":"iana","compressible":true},"application/dii":{"source":"iana"},"application/dit":{"source":"iana"},"application/dns":{"source":"iana"},"application/dns+json":{"source":"iana","compressible":true},"application/dns-message":{"source":"iana"},"application/docbook+xml":{"source":"apache","compressible":true,"extensions":["dbk"]},"application/dots+cbor":{"source":"iana"},"application/dskpp+xml":{"source":"iana","compressible":true},"application/dssc+der":{"source":"iana","extensions":["dssc"]},"application/dssc+xml":{"source":"iana","compressible":true,"extensions":["xdssc"]},"application/dvcs":{"source":"iana"},"application/ecmascript":{"source":"iana","compressible":true,"extensions":["es","ecma"]},"application/edi-consent":{"source":"iana"},"application/edi-x12":{"source":"iana","compressible":false},"application/edifact":{"source":"iana","compressible":false},"application/efi":{"source":"iana"},"application/elm+json":{"source":"iana","charset":"UTF-8","compressible":true},"application/elm+xml":{"source":"iana","compressible":true},"application/emergencycalldata.cap+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/emergencycalldata.comment+xml":{"source":"iana","compressible":true},"application/emergencycalldata.control+xml":{"source":"iana","compressible":true},"application/emergencycalldata.deviceinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.ecall.msd":{"source":"iana"},"application/emergencycalldata.providerinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.serviceinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.subscriberinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.veds+xml":{"source":"iana","compressible":true},"application/emma+xml":{"source":"iana","compressible":true,"extensions":["emma"]},"application/emotionml+xml":{"source":"iana","compressible":true,"extensions":["emotionml"]},"application/encaprtp":{"source":"iana"},"application/epp+xml":{"source":"iana","compressible":true},"application/epub+zip":{"source":"iana","compressible":false,"extensions":["epub"]},"application/eshop":{"source":"iana"},"application/exi":{"source":"iana","extensions":["exi"]},"application/expect-ct-report+json":{"source":"iana","compressible":true},"application/fastinfoset":{"source":"iana"},"application/fastsoap":{"source":"iana"},"application/fdt+xml":{"source":"iana","compressible":true,"extensions":["fdt"]},"application/fhir+json":{"source":"iana","charset":"UTF-8","compressible":true},"application/fhir+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/fido.trusted-apps+json":{"compressible":true},"application/fits":{"source":"iana"},"application/flexfec":{"source":"iana"},"application/font-sfnt":{"source":"iana"},"application/font-tdpfr":{"source":"iana","extensions":["pfr"]},"application/font-woff":{"source":"iana","compressible":false},"application/framework-attributes+xml":{"source":"iana","compressible":true},"application/geo+json":{"source":"iana","compressible":true,"extensions":["geojson"]},"application/geo+json-seq":{"source":"iana"},"application/geopackage+sqlite3":{"source":"iana"},"application/geoxacml+xml":{"source":"iana","compressible":true},"application/gltf-buffer":{"source":"iana"},"application/gml+xml":{"source":"iana","compressible":true,"extensions":["gml"]},"application/gpx+xml":{"source":"apache","compressible":true,"extensions":["gpx"]},"application/gxf":{"source":"apache","extensions":["gxf"]},"application/gzip":{"source":"iana","compressible":false,"extensions":["gz"]},"application/h224":{"source":"iana"},"application/held+xml":{"source":"iana","compressible":true},"application/hjson":{"extensions":["hjson"]},"application/http":{"source":"iana"},"application/hyperstudio":{"source":"iana","extensions":["stk"]},"application/ibe-key-request+xml":{"source":"iana","compressible":true},"application/ibe-pkg-reply+xml":{"source":"iana","compressible":true},"application/ibe-pp-data":{"source":"iana"},"application/iges":{"source":"iana"},"application/im-iscomposing+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/index":{"source":"iana"},"application/index.cmd":{"source":"iana"},"application/index.obj":{"source":"iana"},"application/index.response":{"source":"iana"},"application/index.vnd":{"source":"iana"},"application/inkml+xml":{"source":"iana","compressible":true,"extensions":["ink","inkml"]},"application/iotp":{"source":"iana"},"application/ipfix":{"source":"iana","extensions":["ipfix"]},"application/ipp":{"source":"iana"},"application/isup":{"source":"iana"},"application/its+xml":{"source":"iana","compressible":true,"extensions":["its"]},"application/java-archive":{"source":"apache","compressible":false,"extensions":["jar","war","ear"]},"application/java-serialized-object":{"source":"apache","compressible":false,"extensions":["ser"]},"application/java-vm":{"source":"apache","compressible":false,"extensions":["class"]},"application/javascript":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["js","mjs"]},"application/jf2feed+json":{"source":"iana","compressible":true},"application/jose":{"source":"iana"},"application/jose+json":{"source":"iana","compressible":true},"application/jrd+json":{"source":"iana","compressible":true},"application/jscalendar+json":{"source":"iana","compressible":true},"application/json":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["json","map"]},"application/json-patch+json":{"source":"iana","compressible":true},"application/json-seq":{"source":"iana"},"application/json5":{"extensions":["json5"]},"application/jsonml+json":{"source":"apache","compressible":true,"extensions":["jsonml"]},"application/jwk+json":{"source":"iana","compressible":true},"application/jwk-set+json":{"source":"iana","compressible":true},"application/jwt":{"source":"iana"},"application/kpml-request+xml":{"source":"iana","compressible":true},"application/kpml-response+xml":{"source":"iana","compressible":true},"application/ld+json":{"source":"iana","compressible":true,"extensions":["jsonld"]},"application/lgr+xml":{"source":"iana","compressible":true,"extensions":["lgr"]},"application/link-format":{"source":"iana"},"application/load-control+xml":{"source":"iana","compressible":true},"application/lost+xml":{"source":"iana","compressible":true,"extensions":["lostxml"]},"application/lostsync+xml":{"source":"iana","compressible":true},"application/lpf+zip":{"source":"iana","compressible":false},"application/lxf":{"source":"iana"},"application/mac-binhex40":{"source":"iana","extensions":["hqx"]},"application/mac-compactpro":{"source":"apache","extensions":["cpt"]},"application/macwriteii":{"source":"iana"},"application/mads+xml":{"source":"iana","compressible":true,"extensions":["mads"]},"application/manifest+json":{"charset":"UTF-8","compressible":true,"extensions":["webmanifest"]},"application/marc":{"source":"iana","extensions":["mrc"]},"application/marcxml+xml":{"source":"iana","compressible":true,"extensions":["mrcx"]},"application/mathematica":{"source":"iana","extensions":["ma","nb","mb"]},"application/mathml+xml":{"source":"iana","compressible":true,"extensions":["mathml"]},"application/mathml-content+xml":{"source":"iana","compressible":true},"application/mathml-presentation+xml":{"source":"iana","compressible":true},"application/mbms-associated-procedure-description+xml":{"source":"iana","compressible":true},"application/mbms-deregister+xml":{"source":"iana","compressible":true},"application/mbms-envelope+xml":{"source":"iana","compressible":true},"application/mbms-msk+xml":{"source":"iana","compressible":true},"application/mbms-msk-response+xml":{"source":"iana","compressible":true},"application/mbms-protection-description+xml":{"source":"iana","compressible":true},"application/mbms-reception-report+xml":{"source":"iana","compressible":true},"application/mbms-register+xml":{"source":"iana","compressible":true},"application/mbms-register-response+xml":{"source":"iana","compressible":true},"application/mbms-schedule+xml":{"source":"iana","compressible":true},"application/mbms-user-service-description+xml":{"source":"iana","compressible":true},"application/mbox":{"source":"iana","extensions":["mbox"]},"application/media-policy-dataset+xml":{"source":"iana","compressible":true},"application/media_control+xml":{"source":"iana","compressible":true},"application/mediaservercontrol+xml":{"source":"iana","compressible":true,"extensions":["mscml"]},"application/merge-patch+json":{"source":"iana","compressible":true},"application/metalink+xml":{"source":"apache","compressible":true,"extensions":["metalink"]},"application/metalink4+xml":{"source":"iana","compressible":true,"extensions":["meta4"]},"application/mets+xml":{"source":"iana","compressible":true,"extensions":["mets"]},"application/mf4":{"source":"iana"},"application/mikey":{"source":"iana"},"application/mipc":{"source":"iana"},"application/mmt-aei+xml":{"source":"iana","compressible":true,"extensions":["maei"]},"application/mmt-usd+xml":{"source":"iana","compressible":true,"extensions":["musd"]},"application/mods+xml":{"source":"iana","compressible":true,"extensions":["mods"]},"application/moss-keys":{"source":"iana"},"application/moss-signature":{"source":"iana"},"application/mosskey-data":{"source":"iana"},"application/mosskey-request":{"source":"iana"},"application/mp21":{"source":"iana","extensions":["m21","mp21"]},"application/mp4":{"source":"iana","extensions":["mp4s","m4p"]},"application/mpeg4-generic":{"source":"iana"},"application/mpeg4-iod":{"source":"iana"},"application/mpeg4-iod-xmt":{"source":"iana"},"application/mrb-consumer+xml":{"source":"iana","compressible":true},"application/mrb-publish+xml":{"source":"iana","compressible":true},"application/msc-ivr+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/msc-mixer+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/msword":{"source":"iana","compressible":false,"extensions":["doc","dot"]},"application/mud+json":{"source":"iana","compressible":true},"application/multipart-core":{"source":"iana"},"application/mxf":{"source":"iana","extensions":["mxf"]},"application/n-quads":{"source":"iana","extensions":["nq"]},"application/n-triples":{"source":"iana","extensions":["nt"]},"application/nasdata":{"source":"iana"},"application/news-checkgroups":{"source":"iana","charset":"US-ASCII"},"application/news-groupinfo":{"source":"iana","charset":"US-ASCII"},"application/news-transmission":{"source":"iana"},"application/nlsml+xml":{"source":"iana","compressible":true},"application/node":{"source":"iana","extensions":["cjs"]},"application/nss":{"source":"iana"},"application/ocsp-request":{"source":"iana"},"application/ocsp-response":{"source":"iana"},"application/octet-stream":{"source":"iana","compressible":false,"extensions":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{"source":"iana","extensions":["oda"]},"application/odm+xml":{"source":"iana","compressible":true},"application/odx":{"source":"iana"},"application/oebps-package+xml":{"source":"iana","compressible":true,"extensions":["opf"]},"application/ogg":{"source":"iana","compressible":false,"extensions":["ogx"]},"application/omdoc+xml":{"source":"apache","compressible":true,"extensions":["omdoc"]},"application/onenote":{"source":"apache","extensions":["onetoc","onetoc2","onetmp","onepkg"]},"application/opc-nodeset+xml":{"source":"iana","compressible":true},"application/oscore":{"source":"iana"},"application/oxps":{"source":"iana","extensions":["oxps"]},"application/p2p-overlay+xml":{"source":"iana","compressible":true,"extensions":["relo"]},"application/parityfec":{"source":"iana"},"application/passport":{"source":"iana"},"application/patch-ops-error+xml":{"source":"iana","compressible":true,"extensions":["xer"]},"application/pdf":{"source":"iana","compressible":false,"extensions":["pdf"]},"application/pdx":{"source":"iana"},"application/pem-certificate-chain":{"source":"iana"},"application/pgp-encrypted":{"source":"iana","compressible":false,"extensions":["pgp"]},"application/pgp-keys":{"source":"iana"},"application/pgp-signature":{"source":"iana","extensions":["asc","sig"]},"application/pics-rules":{"source":"apache","extensions":["prf"]},"application/pidf+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/pidf-diff+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/pkcs10":{"source":"iana","extensions":["p10"]},"application/pkcs12":{"source":"iana"},"application/pkcs7-mime":{"source":"iana","extensions":["p7m","p7c"]},"application/pkcs7-signature":{"source":"iana","extensions":["p7s"]},"application/pkcs8":{"source":"iana","extensions":["p8"]},"application/pkcs8-encrypted":{"source":"iana"},"application/pkix-attr-cert":{"source":"iana","extensions":["ac"]},"application/pkix-cert":{"source":"iana","extensions":["cer"]},"application/pkix-crl":{"source":"iana","extensions":["crl"]},"application/pkix-pkipath":{"source":"iana","extensions":["pkipath"]},"application/pkixcmp":{"source":"iana","extensions":["pki"]},"application/pls+xml":{"source":"iana","compressible":true,"extensions":["pls"]},"application/poc-settings+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/postscript":{"source":"iana","compressible":true,"extensions":["ai","eps","ps"]},"application/ppsp-tracker+json":{"source":"iana","compressible":true},"application/problem+json":{"source":"iana","compressible":true},"application/problem+xml":{"source":"iana","compressible":true},"application/provenance+xml":{"source":"iana","compressible":true,"extensions":["provx"]},"application/prs.alvestrand.titrax-sheet":{"source":"iana"},"application/prs.cww":{"source":"iana","extensions":["cww"]},"application/prs.cyn":{"source":"iana","charset":"7-BIT"},"application/prs.hpub+zip":{"source":"iana","compressible":false},"application/prs.nprend":{"source":"iana"},"application/prs.plucker":{"source":"iana"},"application/prs.rdf-xml-crypt":{"source":"iana"},"application/prs.xsf+xml":{"source":"iana","compressible":true},"application/pskc+xml":{"source":"iana","compressible":true,"extensions":["pskcxml"]},"application/pvd+json":{"source":"iana","compressible":true},"application/qsig":{"source":"iana"},"application/raml+yaml":{"compressible":true,"extensions":["raml"]},"application/raptorfec":{"source":"iana"},"application/rdap+json":{"source":"iana","compressible":true},"application/rdf+xml":{"source":"iana","compressible":true,"extensions":["rdf","owl"]},"application/reginfo+xml":{"source":"iana","compressible":true,"extensions":["rif"]},"application/relax-ng-compact-syntax":{"source":"iana","extensions":["rnc"]},"application/remote-printing":{"source":"iana"},"application/reputon+json":{"source":"iana","compressible":true},"application/resource-lists+xml":{"source":"iana","compressible":true,"extensions":["rl"]},"application/resource-lists-diff+xml":{"source":"iana","compressible":true,"extensions":["rld"]},"application/rfc+xml":{"source":"iana","compressible":true},"application/riscos":{"source":"iana"},"application/rlmi+xml":{"source":"iana","compressible":true},"application/rls-services+xml":{"source":"iana","compressible":true,"extensions":["rs"]},"application/route-apd+xml":{"source":"iana","compressible":true,"extensions":["rapd"]},"application/route-s-tsid+xml":{"source":"iana","compressible":true,"extensions":["sls"]},"application/route-usd+xml":{"source":"iana","compressible":true,"extensions":["rusd"]},"application/rpki-ghostbusters":{"source":"iana","extensions":["gbr"]},"application/rpki-manifest":{"source":"iana","extensions":["mft"]},"application/rpki-publication":{"source":"iana"},"application/rpki-roa":{"source":"iana","extensions":["roa"]},"application/rpki-updown":{"source":"iana"},"application/rsd+xml":{"source":"apache","compressible":true,"extensions":["rsd"]},"application/rss+xml":{"source":"apache","compressible":true,"extensions":["rss"]},"application/rtf":{"source":"iana","compressible":true,"extensions":["rtf"]},"application/rtploopback":{"source":"iana"},"application/rtx":{"source":"iana"},"application/samlassertion+xml":{"source":"iana","compressible":true},"application/samlmetadata+xml":{"source":"iana","compressible":true},"application/sarif+json":{"source":"iana","compressible":true},"application/sbe":{"source":"iana"},"application/sbml+xml":{"source":"iana","compressible":true,"extensions":["sbml"]},"application/scaip+xml":{"source":"iana","compressible":true},"application/scim+json":{"source":"iana","compressible":true},"application/scvp-cv-request":{"source":"iana","extensions":["scq"]},"application/scvp-cv-response":{"source":"iana","extensions":["scs"]},"application/scvp-vp-request":{"source":"iana","extensions":["spq"]},"application/scvp-vp-response":{"source":"iana","extensions":["spp"]},"application/sdp":{"source":"iana","extensions":["sdp"]},"application/secevent+jwt":{"source":"iana"},"application/senml+cbor":{"source":"iana"},"application/senml+json":{"source":"iana","compressible":true},"application/senml+xml":{"source":"iana","compressible":true,"extensions":["senmlx"]},"application/senml-etch+cbor":{"source":"iana"},"application/senml-etch+json":{"source":"iana","compressible":true},"application/senml-exi":{"source":"iana"},"application/sensml+cbor":{"source":"iana"},"application/sensml+json":{"source":"iana","compressible":true},"application/sensml+xml":{"source":"iana","compressible":true,"extensions":["sensmlx"]},"application/sensml-exi":{"source":"iana"},"application/sep+xml":{"source":"iana","compressible":true},"application/sep-exi":{"source":"iana"},"application/session-info":{"source":"iana"},"application/set-payment":{"source":"iana"},"application/set-payment-initiation":{"source":"iana","extensions":["setpay"]},"application/set-registration":{"source":"iana"},"application/set-registration-initiation":{"source":"iana","extensions":["setreg"]},"application/sgml":{"source":"iana"},"application/sgml-open-catalog":{"source":"iana"},"application/shf+xml":{"source":"iana","compressible":true,"extensions":["shf"]},"application/sieve":{"source":"iana","extensions":["siv","sieve"]},"application/simple-filter+xml":{"source":"iana","compressible":true},"application/simple-message-summary":{"source":"iana"},"application/simplesymbolcontainer":{"source":"iana"},"application/sipc":{"source":"iana"},"application/slate":{"source":"iana"},"application/smil":{"source":"iana"},"application/smil+xml":{"source":"iana","compressible":true,"extensions":["smi","smil"]},"application/smpte336m":{"source":"iana"},"application/soap+fastinfoset":{"source":"iana"},"application/soap+xml":{"source":"iana","compressible":true},"application/sparql-query":{"source":"iana","extensions":["rq"]},"application/sparql-results+xml":{"source":"iana","compressible":true,"extensions":["srx"]},"application/spirits-event+xml":{"source":"iana","compressible":true},"application/sql":{"source":"iana"},"application/srgs":{"source":"iana","extensions":["gram"]},"application/srgs+xml":{"source":"iana","compressible":true,"extensions":["grxml"]},"application/sru+xml":{"source":"iana","compressible":true,"extensions":["sru"]},"application/ssdl+xml":{"source":"apache","compressible":true,"extensions":["ssdl"]},"application/ssml+xml":{"source":"iana","compressible":true,"extensions":["ssml"]},"application/stix+json":{"source":"iana","compressible":true},"application/swid+xml":{"source":"iana","compressible":true,"extensions":["swidtag"]},"application/tamp-apex-update":{"source":"iana"},"application/tamp-apex-update-confirm":{"source":"iana"},"application/tamp-community-update":{"source":"iana"},"application/tamp-community-update-confirm":{"source":"iana"},"application/tamp-error":{"source":"iana"},"application/tamp-sequence-adjust":{"source":"iana"},"application/tamp-sequence-adjust-confirm":{"source":"iana"},"application/tamp-status-query":{"source":"iana"},"application/tamp-status-response":{"source":"iana"},"application/tamp-update":{"source":"iana"},"application/tamp-update-confirm":{"source":"iana"},"application/tar":{"compressible":true},"application/taxii+json":{"source":"iana","compressible":true},"application/td+json":{"source":"iana","compressible":true},"application/tei+xml":{"source":"iana","compressible":true,"extensions":["tei","teicorpus"]},"application/tetra_isi":{"source":"iana"},"application/thraud+xml":{"source":"iana","compressible":true,"extensions":["tfi"]},"application/timestamp-query":{"source":"iana"},"application/timestamp-reply":{"source":"iana"},"application/timestamped-data":{"source":"iana","extensions":["tsd"]},"application/tlsrpt+gzip":{"source":"iana"},"application/tlsrpt+json":{"source":"iana","compressible":true},"application/tnauthlist":{"source":"iana"},"application/toml":{"compressible":true,"extensions":["toml"]},"application/trickle-ice-sdpfrag":{"source":"iana"},"application/trig":{"source":"iana"},"application/ttml+xml":{"source":"iana","compressible":true,"extensions":["ttml"]},"application/tve-trigger":{"source":"iana"},"application/tzif":{"source":"iana"},"application/tzif-leap":{"source":"iana"},"application/ubjson":{"compressible":false,"extensions":["ubj"]},"application/ulpfec":{"source":"iana"},"application/urc-grpsheet+xml":{"source":"iana","compressible":true},"application/urc-ressheet+xml":{"source":"iana","compressible":true,"extensions":["rsheet"]},"application/urc-targetdesc+xml":{"source":"iana","compressible":true,"extensions":["td"]},"application/urc-uisocketdesc+xml":{"source":"iana","compressible":true},"application/vcard+json":{"source":"iana","compressible":true},"application/vcard+xml":{"source":"iana","compressible":true},"application/vemmi":{"source":"iana"},"application/vividence.scriptfile":{"source":"apache"},"application/vnd.1000minds.decision-model+xml":{"source":"iana","compressible":true,"extensions":["1km"]},"application/vnd.3gpp-prose+xml":{"source":"iana","compressible":true},"application/vnd.3gpp-prose-pc3ch+xml":{"source":"iana","compressible":true},"application/vnd.3gpp-v2x-local-service-information":{"source":"iana"},"application/vnd.3gpp.access-transfer-events+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.bsf+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.gmop+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.interworking-data":{"source":"iana"},"application/vnd.3gpp.mc-signalling-ear":{"source":"iana"},"application/vnd.3gpp.mcdata-affiliation-command+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-payload":{"source":"iana"},"application/vnd.3gpp.mcdata-service-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-signalling":{"source":"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-user-profile+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-affiliation-command+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-floor-request+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-location-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-service-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-signed+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-ue-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-ue-init-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-user-profile+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-affiliation-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-location-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-service-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-transmission-request+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-ue-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-user-profile+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mid-call+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.pic-bw-large":{"source":"iana","extensions":["plb"]},"application/vnd.3gpp.pic-bw-small":{"source":"iana","extensions":["psb"]},"application/vnd.3gpp.pic-bw-var":{"source":"iana","extensions":["pvb"]},"application/vnd.3gpp.sms":{"source":"iana"},"application/vnd.3gpp.sms+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.srvcc-ext+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.srvcc-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.state-and-event-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.ussd+xml":{"source":"iana","compressible":true},"application/vnd.3gpp2.bcmcsinfo+xml":{"source":"iana","compressible":true},"application/vnd.3gpp2.sms":{"source":"iana"},"application/vnd.3gpp2.tcap":{"source":"iana","extensions":["tcap"]},"application/vnd.3lightssoftware.imagescal":{"source":"iana"},"application/vnd.3m.post-it-notes":{"source":"iana","extensions":["pwn"]},"application/vnd.accpac.simply.aso":{"source":"iana","extensions":["aso"]},"application/vnd.accpac.simply.imp":{"source":"iana","extensions":["imp"]},"application/vnd.acucobol":{"source":"iana","extensions":["acu"]},"application/vnd.acucorp":{"source":"iana","extensions":["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{"source":"apache","compressible":false,"extensions":["air"]},"application/vnd.adobe.flash.movie":{"source":"iana"},"application/vnd.adobe.formscentral.fcdt":{"source":"iana","extensions":["fcdt"]},"application/vnd.adobe.fxp":{"source":"iana","extensions":["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{"source":"iana"},"application/vnd.adobe.xdp+xml":{"source":"iana","compressible":true,"extensions":["xdp"]},"application/vnd.adobe.xfdf":{"source":"iana","extensions":["xfdf"]},"application/vnd.aether.imp":{"source":"iana"},"application/vnd.afpc.afplinedata":{"source":"iana"},"application/vnd.afpc.afplinedata-pagedef":{"source":"iana"},"application/vnd.afpc.cmoca-cmresource":{"source":"iana"},"application/vnd.afpc.foca-charset":{"source":"iana"},"application/vnd.afpc.foca-codedfont":{"source":"iana"},"application/vnd.afpc.foca-codepage":{"source":"iana"},"application/vnd.afpc.modca":{"source":"iana"},"application/vnd.afpc.modca-cmtable":{"source":"iana"},"application/vnd.afpc.modca-formdef":{"source":"iana"},"application/vnd.afpc.modca-mediummap":{"source":"iana"},"application/vnd.afpc.modca-objectcontainer":{"source":"iana"},"application/vnd.afpc.modca-overlay":{"source":"iana"},"application/vnd.afpc.modca-pagesegment":{"source":"iana"},"application/vnd.ah-barcode":{"source":"iana"},"application/vnd.ahead.space":{"source":"iana","extensions":["ahead"]},"application/vnd.airzip.filesecure.azf":{"source":"iana","extensions":["azf"]},"application/vnd.airzip.filesecure.azs":{"source":"iana","extensions":["azs"]},"application/vnd.amadeus+json":{"source":"iana","compressible":true},"application/vnd.amazon.ebook":{"source":"apache","extensions":["azw"]},"application/vnd.amazon.mobi8-ebook":{"source":"iana"},"application/vnd.americandynamics.acc":{"source":"iana","extensions":["acc"]},"application/vnd.amiga.ami":{"source":"iana","extensions":["ami"]},"application/vnd.amundsen.maze+xml":{"source":"iana","compressible":true},"application/vnd.android.ota":{"source":"iana"},"application/vnd.android.package-archive":{"source":"apache","compressible":false,"extensions":["apk"]},"application/vnd.anki":{"source":"iana"},"application/vnd.anser-web-certificate-issue-initiation":{"source":"iana","extensions":["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{"source":"apache","extensions":["fti"]},"application/vnd.antix.game-component":{"source":"iana","extensions":["atx"]},"application/vnd.apache.thrift.binary":{"source":"iana"},"application/vnd.apache.thrift.compact":{"source":"iana"},"application/vnd.apache.thrift.json":{"source":"iana"},"application/vnd.api+json":{"source":"iana","compressible":true},"application/vnd.aplextor.warrp+json":{"source":"iana","compressible":true},"application/vnd.apothekende.reservation+json":{"source":"iana","compressible":true},"application/vnd.apple.installer+xml":{"source":"iana","compressible":true,"extensions":["mpkg"]},"application/vnd.apple.keynote":{"source":"iana","extensions":["key"]},"application/vnd.apple.mpegurl":{"source":"iana","extensions":["m3u8"]},"application/vnd.apple.numbers":{"source":"iana","extensions":["numbers"]},"application/vnd.apple.pages":{"source":"iana","extensions":["pages"]},"application/vnd.apple.pkpass":{"compressible":false,"extensions":["pkpass"]},"application/vnd.arastra.swi":{"source":"iana"},"application/vnd.aristanetworks.swi":{"source":"iana","extensions":["swi"]},"application/vnd.artisan+json":{"source":"iana","compressible":true},"application/vnd.artsquare":{"source":"iana"},"application/vnd.astraea-software.iota":{"source":"iana","extensions":["iota"]},"application/vnd.audiograph":{"source":"iana","extensions":["aep"]},"application/vnd.autopackage":{"source":"iana"},"application/vnd.avalon+json":{"source":"iana","compressible":true},"application/vnd.avistar+xml":{"source":"iana","compressible":true},"application/vnd.balsamiq.bmml+xml":{"source":"iana","compressible":true,"extensions":["bmml"]},"application/vnd.balsamiq.bmpr":{"source":"iana"},"application/vnd.banana-accounting":{"source":"iana"},"application/vnd.bbf.usp.error":{"source":"iana"},"application/vnd.bbf.usp.msg":{"source":"iana"},"application/vnd.bbf.usp.msg+json":{"source":"iana","compressible":true},"application/vnd.bekitzur-stech+json":{"source":"iana","compressible":true},"application/vnd.bint.med-content":{"source":"iana"},"application/vnd.biopax.rdf+xml":{"source":"iana","compressible":true},"application/vnd.blink-idb-value-wrapper":{"source":"iana"},"application/vnd.blueice.multipass":{"source":"iana","extensions":["mpm"]},"application/vnd.bluetooth.ep.oob":{"source":"iana"},"application/vnd.bluetooth.le.oob":{"source":"iana"},"application/vnd.bmi":{"source":"iana","extensions":["bmi"]},"application/vnd.bpf":{"source":"iana"},"application/vnd.bpf3":{"source":"iana"},"application/vnd.businessobjects":{"source":"iana","extensions":["rep"]},"application/vnd.byu.uapi+json":{"source":"iana","compressible":true},"application/vnd.cab-jscript":{"source":"iana"},"application/vnd.canon-cpdl":{"source":"iana"},"application/vnd.canon-lips":{"source":"iana"},"application/vnd.capasystems-pg+json":{"source":"iana","compressible":true},"application/vnd.cendio.thinlinc.clientconf":{"source":"iana"},"application/vnd.century-systems.tcp_stream":{"source":"iana"},"application/vnd.chemdraw+xml":{"source":"iana","compressible":true,"extensions":["cdxml"]},"application/vnd.chess-pgn":{"source":"iana"},"application/vnd.chipnuts.karaoke-mmd":{"source":"iana","extensions":["mmd"]},"application/vnd.ciedi":{"source":"iana"},"application/vnd.cinderella":{"source":"iana","extensions":["cdy"]},"application/vnd.cirpack.isdn-ext":{"source":"iana"},"application/vnd.citationstyles.style+xml":{"source":"iana","compressible":true,"extensions":["csl"]},"application/vnd.claymore":{"source":"iana","extensions":["cla"]},"application/vnd.cloanto.rp9":{"source":"iana","extensions":["rp9"]},"application/vnd.clonk.c4group":{"source":"iana","extensions":["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{"source":"iana","extensions":["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{"source":"iana","extensions":["c11amz"]},"application/vnd.coffeescript":{"source":"iana"},"application/vnd.collabio.xodocuments.document":{"source":"iana"},"application/vnd.collabio.xodocuments.document-template":{"source":"iana"},"application/vnd.collabio.xodocuments.presentation":{"source":"iana"},"application/vnd.collabio.xodocuments.presentation-template":{"source":"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{"source":"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{"source":"iana"},"application/vnd.collection+json":{"source":"iana","compressible":true},"application/vnd.collection.doc+json":{"source":"iana","compressible":true},"application/vnd.collection.next+json":{"source":"iana","compressible":true},"application/vnd.comicbook+zip":{"source":"iana","compressible":false},"application/vnd.comicbook-rar":{"source":"iana"},"application/vnd.commerce-battelle":{"source":"iana"},"application/vnd.commonspace":{"source":"iana","extensions":["csp"]},"application/vnd.contact.cmsg":{"source":"iana","extensions":["cdbcmsg"]},"application/vnd.coreos.ignition+json":{"source":"iana","compressible":true},"application/vnd.cosmocaller":{"source":"iana","extensions":["cmc"]},"application/vnd.crick.clicker":{"source":"iana","extensions":["clkx"]},"application/vnd.crick.clicker.keyboard":{"source":"iana","extensions":["clkk"]},"application/vnd.crick.clicker.palette":{"source":"iana","extensions":["clkp"]},"application/vnd.crick.clicker.template":{"source":"iana","extensions":["clkt"]},"application/vnd.crick.clicker.wordbank":{"source":"iana","extensions":["clkw"]},"application/vnd.criticaltools.wbs+xml":{"source":"iana","compressible":true,"extensions":["wbs"]},"application/vnd.cryptii.pipe+json":{"source":"iana","compressible":true},"application/vnd.crypto-shade-file":{"source":"iana"},"application/vnd.cryptomator.encrypted":{"source":"iana"},"application/vnd.ctc-posml":{"source":"iana","extensions":["pml"]},"application/vnd.ctct.ws+xml":{"source":"iana","compressible":true},"application/vnd.cups-pdf":{"source":"iana"},"application/vnd.cups-postscript":{"source":"iana"},"application/vnd.cups-ppd":{"source":"iana","extensions":["ppd"]},"application/vnd.cups-raster":{"source":"iana"},"application/vnd.cups-raw":{"source":"iana"},"application/vnd.curl":{"source":"iana"},"application/vnd.curl.car":{"source":"apache","extensions":["car"]},"application/vnd.curl.pcurl":{"source":"apache","extensions":["pcurl"]},"application/vnd.cyan.dean.root+xml":{"source":"iana","compressible":true},"application/vnd.cybank":{"source":"iana"},"application/vnd.cyclonedx+json":{"source":"iana","compressible":true},"application/vnd.cyclonedx+xml":{"source":"iana","compressible":true},"application/vnd.d2l.coursepackage1p0+zip":{"source":"iana","compressible":false},"application/vnd.d3m-dataset":{"source":"iana"},"application/vnd.d3m-problem":{"source":"iana"},"application/vnd.dart":{"source":"iana","compressible":true,"extensions":["dart"]},"application/vnd.data-vision.rdz":{"source":"iana","extensions":["rdz"]},"application/vnd.datapackage+json":{"source":"iana","compressible":true},"application/vnd.dataresource+json":{"source":"iana","compressible":true},"application/vnd.dbf":{"source":"iana","extensions":["dbf"]},"application/vnd.debian.binary-package":{"source":"iana"},"application/vnd.dece.data":{"source":"iana","extensions":["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{"source":"iana","compressible":true,"extensions":["uvt","uvvt"]},"application/vnd.dece.unspecified":{"source":"iana","extensions":["uvx","uvvx"]},"application/vnd.dece.zip":{"source":"iana","extensions":["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{"source":"iana","extensions":["fe_launch"]},"application/vnd.desmume.movie":{"source":"iana"},"application/vnd.dir-bi.plate-dl-nosuffix":{"source":"iana"},"application/vnd.dm.delegation+xml":{"source":"iana","compressible":true},"application/vnd.dna":{"source":"iana","extensions":["dna"]},"application/vnd.document+json":{"source":"iana","compressible":true},"application/vnd.dolby.mlp":{"source":"apache","extensions":["mlp"]},"application/vnd.dolby.mobile.1":{"source":"iana"},"application/vnd.dolby.mobile.2":{"source":"iana"},"application/vnd.doremir.scorecloud-binary-document":{"source":"iana"},"application/vnd.dpgraph":{"source":"iana","extensions":["dpg"]},"application/vnd.dreamfactory":{"source":"iana","extensions":["dfac"]},"application/vnd.drive+json":{"source":"iana","compressible":true},"application/vnd.ds-keypoint":{"source":"apache","extensions":["kpxx"]},"application/vnd.dtg.local":{"source":"iana"},"application/vnd.dtg.local.flash":{"source":"iana"},"application/vnd.dtg.local.html":{"source":"iana"},"application/vnd.dvb.ait":{"source":"iana","extensions":["ait"]},"application/vnd.dvb.dvbisl+xml":{"source":"iana","compressible":true},"application/vnd.dvb.dvbj":{"source":"iana"},"application/vnd.dvb.esgcontainer":{"source":"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{"source":"iana"},"application/vnd.dvb.ipdcesgaccess":{"source":"iana"},"application/vnd.dvb.ipdcesgaccess2":{"source":"iana"},"application/vnd.dvb.ipdcesgpdd":{"source":"iana"},"application/vnd.dvb.ipdcroaming":{"source":"iana"},"application/vnd.dvb.iptv.alfec-base":{"source":"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{"source":"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-container+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-generic+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-ia-msglist+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-ia-registration-request+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-ia-registration-response+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-init+xml":{"source":"iana","compressible":true},"application/vnd.dvb.pfr":{"source":"iana"},"application/vnd.dvb.service":{"source":"iana","extensions":["svc"]},"application/vnd.dxr":{"source":"iana"},"application/vnd.dynageo":{"source":"iana","extensions":["geo"]},"application/vnd.dzr":{"source":"iana"},"application/vnd.easykaraoke.cdgdownload":{"source":"iana"},"application/vnd.ecdis-update":{"source":"iana"},"application/vnd.ecip.rlp":{"source":"iana"},"application/vnd.ecowin.chart":{"source":"iana","extensions":["mag"]},"application/vnd.ecowin.filerequest":{"source":"iana"},"application/vnd.ecowin.fileupdate":{"source":"iana"},"application/vnd.ecowin.series":{"source":"iana"},"application/vnd.ecowin.seriesrequest":{"source":"iana"},"application/vnd.ecowin.seriesupdate":{"source":"iana"},"application/vnd.efi.img":{"source":"iana"},"application/vnd.efi.iso":{"source":"iana"},"application/vnd.emclient.accessrequest+xml":{"source":"iana","compressible":true},"application/vnd.enliven":{"source":"iana","extensions":["nml"]},"application/vnd.enphase.envoy":{"source":"iana"},"application/vnd.eprints.data+xml":{"source":"iana","compressible":true},"application/vnd.epson.esf":{"source":"iana","extensions":["esf"]},"application/vnd.epson.msf":{"source":"iana","extensions":["msf"]},"application/vnd.epson.quickanime":{"source":"iana","extensions":["qam"]},"application/vnd.epson.salt":{"source":"iana","extensions":["slt"]},"application/vnd.epson.ssf":{"source":"iana","extensions":["ssf"]},"application/vnd.ericsson.quickcall":{"source":"iana"},"application/vnd.espass-espass+zip":{"source":"iana","compressible":false},"application/vnd.eszigno3+xml":{"source":"iana","compressible":true,"extensions":["es3","et3"]},"application/vnd.etsi.aoc+xml":{"source":"iana","compressible":true},"application/vnd.etsi.asic-e+zip":{"source":"iana","compressible":false},"application/vnd.etsi.asic-s+zip":{"source":"iana","compressible":false},"application/vnd.etsi.cug+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvcommand+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvdiscovery+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvprofile+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsad-bc+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsad-cod+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsad-npvr+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvservice+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsync+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvueprofile+xml":{"source":"iana","compressible":true},"application/vnd.etsi.mcid+xml":{"source":"iana","compressible":true},"application/vnd.etsi.mheg5":{"source":"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{"source":"iana","compressible":true},"application/vnd.etsi.pstn+xml":{"source":"iana","compressible":true},"application/vnd.etsi.sci+xml":{"source":"iana","compressible":true},"application/vnd.etsi.simservs+xml":{"source":"iana","compressible":true},"application/vnd.etsi.timestamp-token":{"source":"iana"},"application/vnd.etsi.tsl+xml":{"source":"iana","compressible":true},"application/vnd.etsi.tsl.der":{"source":"iana"},"application/vnd.eudora.data":{"source":"iana"},"application/vnd.evolv.ecig.profile":{"source":"iana"},"application/vnd.evolv.ecig.settings":{"source":"iana"},"application/vnd.evolv.ecig.theme":{"source":"iana"},"application/vnd.exstream-empower+zip":{"source":"iana","compressible":false},"application/vnd.exstream-package":{"source":"iana"},"application/vnd.ezpix-album":{"source":"iana","extensions":["ez2"]},"application/vnd.ezpix-package":{"source":"iana","extensions":["ez3"]},"application/vnd.f-secure.mobile":{"source":"iana"},"application/vnd.fastcopy-disk-image":{"source":"iana"},"application/vnd.fdf":{"source":"iana","extensions":["fdf"]},"application/vnd.fdsn.mseed":{"source":"iana","extensions":["mseed"]},"application/vnd.fdsn.seed":{"source":"iana","extensions":["seed","dataless"]},"application/vnd.ffsns":{"source":"iana"},"application/vnd.ficlab.flb+zip":{"source":"iana","compressible":false},"application/vnd.filmit.zfc":{"source":"iana"},"application/vnd.fints":{"source":"iana"},"application/vnd.firemonkeys.cloudcell":{"source":"iana"},"application/vnd.flographit":{"source":"iana","extensions":["gph"]},"application/vnd.fluxtime.clip":{"source":"iana","extensions":["ftc"]},"application/vnd.font-fontforge-sfd":{"source":"iana"},"application/vnd.framemaker":{"source":"iana","extensions":["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{"source":"iana","extensions":["fnc"]},"application/vnd.frogans.ltf":{"source":"iana","extensions":["ltf"]},"application/vnd.fsc.weblaunch":{"source":"iana","extensions":["fsc"]},"application/vnd.fujitsu.oasys":{"source":"iana","extensions":["oas"]},"application/vnd.fujitsu.oasys2":{"source":"iana","extensions":["oa2"]},"application/vnd.fujitsu.oasys3":{"source":"iana","extensions":["oa3"]},"application/vnd.fujitsu.oasysgp":{"source":"iana","extensions":["fg5"]},"application/vnd.fujitsu.oasysprs":{"source":"iana","extensions":["bh2"]},"application/vnd.fujixerox.art-ex":{"source":"iana"},"application/vnd.fujixerox.art4":{"source":"iana"},"application/vnd.fujixerox.ddd":{"source":"iana","extensions":["ddd"]},"application/vnd.fujixerox.docuworks":{"source":"iana","extensions":["xdw"]},"application/vnd.fujixerox.docuworks.binder":{"source":"iana","extensions":["xbd"]},"application/vnd.fujixerox.docuworks.container":{"source":"iana"},"application/vnd.fujixerox.hbpl":{"source":"iana"},"application/vnd.fut-misnet":{"source":"iana"},"application/vnd.futoin+cbor":{"source":"iana"},"application/vnd.futoin+json":{"source":"iana","compressible":true},"application/vnd.fuzzysheet":{"source":"iana","extensions":["fzs"]},"application/vnd.genomatix.tuxedo":{"source":"iana","extensions":["txd"]},"application/vnd.gentics.grd+json":{"source":"iana","compressible":true},"application/vnd.geo+json":{"source":"iana","compressible":true},"application/vnd.geocube+xml":{"source":"iana","compressible":true},"application/vnd.geogebra.file":{"source":"iana","extensions":["ggb"]},"application/vnd.geogebra.slides":{"source":"iana"},"application/vnd.geogebra.tool":{"source":"iana","extensions":["ggt"]},"application/vnd.geometry-explorer":{"source":"iana","extensions":["gex","gre"]},"application/vnd.geonext":{"source":"iana","extensions":["gxt"]},"application/vnd.geoplan":{"source":"iana","extensions":["g2w"]},"application/vnd.geospace":{"source":"iana","extensions":["g3w"]},"application/vnd.gerber":{"source":"iana"},"application/vnd.globalplatform.card-content-mgt":{"source":"iana"},"application/vnd.globalplatform.card-content-mgt-response":{"source":"iana"},"application/vnd.gmx":{"source":"iana","extensions":["gmx"]},"application/vnd.google-apps.document":{"compressible":false,"extensions":["gdoc"]},"application/vnd.google-apps.presentation":{"compressible":false,"extensions":["gslides"]},"application/vnd.google-apps.spreadsheet":{"compressible":false,"extensions":["gsheet"]},"application/vnd.google-earth.kml+xml":{"source":"iana","compressible":true,"extensions":["kml"]},"application/vnd.google-earth.kmz":{"source":"iana","compressible":false,"extensions":["kmz"]},"application/vnd.gov.sk.e-form+xml":{"source":"iana","compressible":true},"application/vnd.gov.sk.e-form+zip":{"source":"iana","compressible":false},"application/vnd.gov.sk.xmldatacontainer+xml":{"source":"iana","compressible":true},"application/vnd.grafeq":{"source":"iana","extensions":["gqf","gqs"]},"application/vnd.gridmp":{"source":"iana"},"application/vnd.groove-account":{"source":"iana","extensions":["gac"]},"application/vnd.groove-help":{"source":"iana","extensions":["ghf"]},"application/vnd.groove-identity-message":{"source":"iana","extensions":["gim"]},"application/vnd.groove-injector":{"source":"iana","extensions":["grv"]},"application/vnd.groove-tool-message":{"source":"iana","extensions":["gtm"]},"application/vnd.groove-tool-template":{"source":"iana","extensions":["tpl"]},"application/vnd.groove-vcard":{"source":"iana","extensions":["vcg"]},"application/vnd.hal+json":{"source":"iana","compressible":true},"application/vnd.hal+xml":{"source":"iana","compressible":true,"extensions":["hal"]},"application/vnd.handheld-entertainment+xml":{"source":"iana","compressible":true,"extensions":["zmm"]},"application/vnd.hbci":{"source":"iana","extensions":["hbci"]},"application/vnd.hc+json":{"source":"iana","compressible":true},"application/vnd.hcl-bireports":{"source":"iana"},"application/vnd.hdt":{"source":"iana"},"application/vnd.heroku+json":{"source":"iana","compressible":true},"application/vnd.hhe.lesson-player":{"source":"iana","extensions":["les"]},"application/vnd.hp-hpgl":{"source":"iana","extensions":["hpgl"]},"application/vnd.hp-hpid":{"source":"iana","extensions":["hpid"]},"application/vnd.hp-hps":{"source":"iana","extensions":["hps"]},"application/vnd.hp-jlyt":{"source":"iana","extensions":["jlt"]},"application/vnd.hp-pcl":{"source":"iana","extensions":["pcl"]},"application/vnd.hp-pclxl":{"source":"iana","extensions":["pclxl"]},"application/vnd.httphone":{"source":"iana"},"application/vnd.hydrostatix.sof-data":{"source":"iana","extensions":["sfd-hdstx"]},"application/vnd.hyper+json":{"source":"iana","compressible":true},"application/vnd.hyper-item+json":{"source":"iana","compressible":true},"application/vnd.hyperdrive+json":{"source":"iana","compressible":true},"application/vnd.hzn-3d-crossword":{"source":"iana"},"application/vnd.ibm.afplinedata":{"source":"iana"},"application/vnd.ibm.electronic-media":{"source":"iana"},"application/vnd.ibm.minipay":{"source":"iana","extensions":["mpy"]},"application/vnd.ibm.modcap":{"source":"iana","extensions":["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{"source":"iana","extensions":["irm"]},"application/vnd.ibm.secure-container":{"source":"iana","extensions":["sc"]},"application/vnd.iccprofile":{"source":"iana","extensions":["icc","icm"]},"application/vnd.ieee.1905":{"source":"iana"},"application/vnd.igloader":{"source":"iana","extensions":["igl"]},"application/vnd.imagemeter.folder+zip":{"source":"iana","compressible":false},"application/vnd.imagemeter.image+zip":{"source":"iana","compressible":false},"application/vnd.immervision-ivp":{"source":"iana","extensions":["ivp"]},"application/vnd.immervision-ivu":{"source":"iana","extensions":["ivu"]},"application/vnd.ims.imsccv1p1":{"source":"iana"},"application/vnd.ims.imsccv1p2":{"source":"iana"},"application/vnd.ims.imsccv1p3":{"source":"iana"},"application/vnd.ims.lis.v2.result+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolproxy+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolproxy.id+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolsettings+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolsettings.simple+json":{"source":"iana","compressible":true},"application/vnd.informedcontrol.rms+xml":{"source":"iana","compressible":true},"application/vnd.informix-visionary":{"source":"iana"},"application/vnd.infotech.project":{"source":"iana"},"application/vnd.infotech.project+xml":{"source":"iana","compressible":true},"application/vnd.innopath.wamp.notification":{"source":"iana"},"application/vnd.insors.igm":{"source":"iana","extensions":["igm"]},"application/vnd.intercon.formnet":{"source":"iana","extensions":["xpw","xpx"]},"application/vnd.intergeo":{"source":"iana","extensions":["i2g"]},"application/vnd.intertrust.digibox":{"source":"iana"},"application/vnd.intertrust.nncp":{"source":"iana"},"application/vnd.intu.qbo":{"source":"iana","extensions":["qbo"]},"application/vnd.intu.qfx":{"source":"iana","extensions":["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.conceptitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.knowledgeitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.newsitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.newsmessage+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.packageitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.planningitem+xml":{"source":"iana","compressible":true},"application/vnd.ipunplugged.rcprofile":{"source":"iana","extensions":["rcprofile"]},"application/vnd.irepository.package+xml":{"source":"iana","compressible":true,"extensions":["irp"]},"application/vnd.is-xpr":{"source":"iana","extensions":["xpr"]},"application/vnd.isac.fcs":{"source":"iana","extensions":["fcs"]},"application/vnd.iso11783-10+zip":{"source":"iana","compressible":false},"application/vnd.jam":{"source":"iana","extensions":["jam"]},"application/vnd.japannet-directory-service":{"source":"iana"},"application/vnd.japannet-jpnstore-wakeup":{"source":"iana"},"application/vnd.japannet-payment-wakeup":{"source":"iana"},"application/vnd.japannet-registration":{"source":"iana"},"application/vnd.japannet-registration-wakeup":{"source":"iana"},"application/vnd.japannet-setstore-wakeup":{"source":"iana"},"application/vnd.japannet-verification":{"source":"iana"},"application/vnd.japannet-verification-wakeup":{"source":"iana"},"application/vnd.jcp.javame.midlet-rms":{"source":"iana","extensions":["rms"]},"application/vnd.jisp":{"source":"iana","extensions":["jisp"]},"application/vnd.joost.joda-archive":{"source":"iana","extensions":["joda"]},"application/vnd.jsk.isdn-ngn":{"source":"iana"},"application/vnd.kahootz":{"source":"iana","extensions":["ktz","ktr"]},"application/vnd.kde.karbon":{"source":"iana","extensions":["karbon"]},"application/vnd.kde.kchart":{"source":"iana","extensions":["chrt"]},"application/vnd.kde.kformula":{"source":"iana","extensions":["kfo"]},"application/vnd.kde.kivio":{"source":"iana","extensions":["flw"]},"application/vnd.kde.kontour":{"source":"iana","extensions":["kon"]},"application/vnd.kde.kpresenter":{"source":"iana","extensions":["kpr","kpt"]},"application/vnd.kde.kspread":{"source":"iana","extensions":["ksp"]},"application/vnd.kde.kword":{"source":"iana","extensions":["kwd","kwt"]},"application/vnd.kenameaapp":{"source":"iana","extensions":["htke"]},"application/vnd.kidspiration":{"source":"iana","extensions":["kia"]},"application/vnd.kinar":{"source":"iana","extensions":["kne","knp"]},"application/vnd.koan":{"source":"iana","extensions":["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{"source":"iana","extensions":["sse"]},"application/vnd.las":{"source":"iana"},"application/vnd.las.las+json":{"source":"iana","compressible":true},"application/vnd.las.las+xml":{"source":"iana","compressible":true,"extensions":["lasxml"]},"application/vnd.laszip":{"source":"iana"},"application/vnd.leap+json":{"source":"iana","compressible":true},"application/vnd.liberty-request+xml":{"source":"iana","compressible":true},"application/vnd.llamagraphics.life-balance.desktop":{"source":"iana","extensions":["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{"source":"iana","compressible":true,"extensions":["lbe"]},"application/vnd.logipipe.circuit+zip":{"source":"iana","compressible":false},"application/vnd.loom":{"source":"iana"},"application/vnd.lotus-1-2-3":{"source":"iana","extensions":["123"]},"application/vnd.lotus-approach":{"source":"iana","extensions":["apr"]},"application/vnd.lotus-freelance":{"source":"iana","extensions":["pre"]},"application/vnd.lotus-notes":{"source":"iana","extensions":["nsf"]},"application/vnd.lotus-organizer":{"source":"iana","extensions":["org"]},"application/vnd.lotus-screencam":{"source":"iana","extensions":["scm"]},"application/vnd.lotus-wordpro":{"source":"iana","extensions":["lwp"]},"application/vnd.macports.portpkg":{"source":"iana","extensions":["portpkg"]},"application/vnd.mapbox-vector-tile":{"source":"iana"},"application/vnd.marlin.drm.actiontoken+xml":{"source":"iana","compressible":true},"application/vnd.marlin.drm.conftoken+xml":{"source":"iana","compressible":true},"application/vnd.marlin.drm.license+xml":{"source":"iana","compressible":true},"application/vnd.marlin.drm.mdcf":{"source":"iana"},"application/vnd.mason+json":{"source":"iana","compressible":true},"application/vnd.maxmind.maxmind-db":{"source":"iana"},"application/vnd.mcd":{"source":"iana","extensions":["mcd"]},"application/vnd.medcalcdata":{"source":"iana","extensions":["mc1"]},"application/vnd.mediastation.cdkey":{"source":"iana","extensions":["cdkey"]},"application/vnd.meridian-slingshot":{"source":"iana"},"application/vnd.mfer":{"source":"iana","extensions":["mwf"]},"application/vnd.mfmp":{"source":"iana","extensions":["mfm"]},"application/vnd.micro+json":{"source":"iana","compressible":true},"application/vnd.micrografx.flo":{"source":"iana","extensions":["flo"]},"application/vnd.micrografx.igx":{"source":"iana","extensions":["igx"]},"application/vnd.microsoft.portable-executable":{"source":"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{"source":"iana"},"application/vnd.miele+json":{"source":"iana","compressible":true},"application/vnd.mif":{"source":"iana","extensions":["mif"]},"application/vnd.minisoft-hp3000-save":{"source":"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{"source":"iana"},"application/vnd.mobius.daf":{"source":"iana","extensions":["daf"]},"application/vnd.mobius.dis":{"source":"iana","extensions":["dis"]},"application/vnd.mobius.mbk":{"source":"iana","extensions":["mbk"]},"application/vnd.mobius.mqy":{"source":"iana","extensions":["mqy"]},"application/vnd.mobius.msl":{"source":"iana","extensions":["msl"]},"application/vnd.mobius.plc":{"source":"iana","extensions":["plc"]},"application/vnd.mobius.txf":{"source":"iana","extensions":["txf"]},"application/vnd.mophun.application":{"source":"iana","extensions":["mpn"]},"application/vnd.mophun.certificate":{"source":"iana","extensions":["mpc"]},"application/vnd.motorola.flexsuite":{"source":"iana"},"application/vnd.motorola.flexsuite.adsi":{"source":"iana"},"application/vnd.motorola.flexsuite.fis":{"source":"iana"},"application/vnd.motorola.flexsuite.gotap":{"source":"iana"},"application/vnd.motorola.flexsuite.kmr":{"source":"iana"},"application/vnd.motorola.flexsuite.ttc":{"source":"iana"},"application/vnd.motorola.flexsuite.wem":{"source":"iana"},"application/vnd.motorola.iprm":{"source":"iana"},"application/vnd.mozilla.xul+xml":{"source":"iana","compressible":true,"extensions":["xul"]},"application/vnd.ms-3mfdocument":{"source":"iana"},"application/vnd.ms-artgalry":{"source":"iana","extensions":["cil"]},"application/vnd.ms-asf":{"source":"iana"},"application/vnd.ms-cab-compressed":{"source":"iana","extensions":["cab"]},"application/vnd.ms-color.iccprofile":{"source":"apache"},"application/vnd.ms-excel":{"source":"iana","compressible":false,"extensions":["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{"source":"iana","extensions":["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{"source":"iana","extensions":["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{"source":"iana","extensions":["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{"source":"iana","extensions":["xltm"]},"application/vnd.ms-fontobject":{"source":"iana","compressible":true,"extensions":["eot"]},"application/vnd.ms-htmlhelp":{"source":"iana","extensions":["chm"]},"application/vnd.ms-ims":{"source":"iana","extensions":["ims"]},"application/vnd.ms-lrm":{"source":"iana","extensions":["lrm"]},"application/vnd.ms-office.activex+xml":{"source":"iana","compressible":true},"application/vnd.ms-officetheme":{"source":"iana","extensions":["thmx"]},"application/vnd.ms-opentype":{"source":"apache","compressible":true},"application/vnd.ms-outlook":{"compressible":false,"extensions":["msg"]},"application/vnd.ms-package.obfuscated-opentype":{"source":"apache"},"application/vnd.ms-pki.seccat":{"source":"apache","extensions":["cat"]},"application/vnd.ms-pki.stl":{"source":"apache","extensions":["stl"]},"application/vnd.ms-playready.initiator+xml":{"source":"iana","compressible":true},"application/vnd.ms-powerpoint":{"source":"iana","compressible":false,"extensions":["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{"source":"iana","extensions":["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{"source":"iana","extensions":["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{"source":"iana","extensions":["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{"source":"iana","extensions":["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{"source":"iana","extensions":["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{"source":"iana","compressible":true},"application/vnd.ms-printing.printticket+xml":{"source":"apache","compressible":true},"application/vnd.ms-printschematicket+xml":{"source":"iana","compressible":true},"application/vnd.ms-project":{"source":"iana","extensions":["mpp","mpt"]},"application/vnd.ms-tnef":{"source":"iana"},"application/vnd.ms-windows.devicepairing":{"source":"iana"},"application/vnd.ms-windows.nwprinting.oob":{"source":"iana"},"application/vnd.ms-windows.printerpairing":{"source":"iana"},"application/vnd.ms-windows.wsd.oob":{"source":"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{"source":"iana"},"application/vnd.ms-wmdrm.lic-resp":{"source":"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{"source":"iana"},"application/vnd.ms-wmdrm.meter-resp":{"source":"iana"},"application/vnd.ms-word.document.macroenabled.12":{"source":"iana","extensions":["docm"]},"application/vnd.ms-word.template.macroenabled.12":{"source":"iana","extensions":["dotm"]},"application/vnd.ms-works":{"source":"iana","extensions":["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{"source":"iana","extensions":["wpl"]},"application/vnd.ms-xpsdocument":{"source":"iana","compressible":false,"extensions":["xps"]},"application/vnd.msa-disk-image":{"source":"iana"},"application/vnd.mseq":{"source":"iana","extensions":["mseq"]},"application/vnd.msign":{"source":"iana"},"application/vnd.multiad.creator":{"source":"iana"},"application/vnd.multiad.creator.cif":{"source":"iana"},"application/vnd.music-niff":{"source":"iana"},"application/vnd.musician":{"source":"iana","extensions":["mus"]},"application/vnd.muvee.style":{"source":"iana","extensions":["msty"]},"application/vnd.mynfc":{"source":"iana","extensions":["taglet"]},"application/vnd.ncd.control":{"source":"iana"},"application/vnd.ncd.reference":{"source":"iana"},"application/vnd.nearst.inv+json":{"source":"iana","compressible":true},"application/vnd.nebumind.line":{"source":"iana"},"application/vnd.nervana":{"source":"iana"},"application/vnd.netfpx":{"source":"iana"},"application/vnd.neurolanguage.nlu":{"source":"iana","extensions":["nlu"]},"application/vnd.nimn":{"source":"iana"},"application/vnd.nintendo.nitro.rom":{"source":"iana"},"application/vnd.nintendo.snes.rom":{"source":"iana"},"application/vnd.nitf":{"source":"iana","extensions":["ntf","nitf"]},"application/vnd.noblenet-directory":{"source":"iana","extensions":["nnd"]},"application/vnd.noblenet-sealer":{"source":"iana","extensions":["nns"]},"application/vnd.noblenet-web":{"source":"iana","extensions":["nnw"]},"application/vnd.nokia.catalogs":{"source":"iana"},"application/vnd.nokia.conml+wbxml":{"source":"iana"},"application/vnd.nokia.conml+xml":{"source":"iana","compressible":true},"application/vnd.nokia.iptv.config+xml":{"source":"iana","compressible":true},"application/vnd.nokia.isds-radio-presets":{"source":"iana"},"application/vnd.nokia.landmark+wbxml":{"source":"iana"},"application/vnd.nokia.landmark+xml":{"source":"iana","compressible":true},"application/vnd.nokia.landmarkcollection+xml":{"source":"iana","compressible":true},"application/vnd.nokia.n-gage.ac+xml":{"source":"iana","compressible":true,"extensions":["ac"]},"application/vnd.nokia.n-gage.data":{"source":"iana","extensions":["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{"source":"iana","extensions":["n-gage"]},"application/vnd.nokia.ncd":{"source":"iana"},"application/vnd.nokia.pcd+wbxml":{"source":"iana"},"application/vnd.nokia.pcd+xml":{"source":"iana","compressible":true},"application/vnd.nokia.radio-preset":{"source":"iana","extensions":["rpst"]},"application/vnd.nokia.radio-presets":{"source":"iana","extensions":["rpss"]},"application/vnd.novadigm.edm":{"source":"iana","extensions":["edm"]},"application/vnd.novadigm.edx":{"source":"iana","extensions":["edx"]},"application/vnd.novadigm.ext":{"source":"iana","extensions":["ext"]},"application/vnd.ntt-local.content-share":{"source":"iana"},"application/vnd.ntt-local.file-transfer":{"source":"iana"},"application/vnd.ntt-local.ogw_remote-access":{"source":"iana"},"application/vnd.ntt-local.sip-ta_remote":{"source":"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{"source":"iana"},"application/vnd.oasis.opendocument.chart":{"source":"iana","extensions":["odc"]},"application/vnd.oasis.opendocument.chart-template":{"source":"iana","extensions":["otc"]},"application/vnd.oasis.opendocument.database":{"source":"iana","extensions":["odb"]},"application/vnd.oasis.opendocument.formula":{"source":"iana","extensions":["odf"]},"application/vnd.oasis.opendocument.formula-template":{"source":"iana","extensions":["odft"]},"application/vnd.oasis.opendocument.graphics":{"source":"iana","compressible":false,"extensions":["odg"]},"application/vnd.oasis.opendocument.graphics-template":{"source":"iana","extensions":["otg"]},"application/vnd.oasis.opendocument.image":{"source":"iana","extensions":["odi"]},"application/vnd.oasis.opendocument.image-template":{"source":"iana","extensions":["oti"]},"application/vnd.oasis.opendocument.presentation":{"source":"iana","compressible":false,"extensions":["odp"]},"application/vnd.oasis.opendocument.presentation-template":{"source":"iana","extensions":["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{"source":"iana","compressible":false,"extensions":["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{"source":"iana","extensions":["ots"]},"application/vnd.oasis.opendocument.text":{"source":"iana","compressible":false,"extensions":["odt"]},"application/vnd.oasis.opendocument.text-master":{"source":"iana","extensions":["odm"]},"application/vnd.oasis.opendocument.text-template":{"source":"iana","extensions":["ott"]},"application/vnd.oasis.opendocument.text-web":{"source":"iana","extensions":["oth"]},"application/vnd.obn":{"source":"iana"},"application/vnd.ocf+cbor":{"source":"iana"},"application/vnd.oci.image.manifest.v1+json":{"source":"iana","compressible":true},"application/vnd.oftn.l10n+json":{"source":"iana","compressible":true},"application/vnd.oipf.contentaccessdownload+xml":{"source":"iana","compressible":true},"application/vnd.oipf.contentaccessstreaming+xml":{"source":"iana","compressible":true},"application/vnd.oipf.cspg-hexbinary":{"source":"iana"},"application/vnd.oipf.dae.svg+xml":{"source":"iana","compressible":true},"application/vnd.oipf.dae.xhtml+xml":{"source":"iana","compressible":true},"application/vnd.oipf.mippvcontrolmessage+xml":{"source":"iana","compressible":true},"application/vnd.oipf.pae.gem":{"source":"iana"},"application/vnd.oipf.spdiscovery+xml":{"source":"iana","compressible":true},"application/vnd.oipf.spdlist+xml":{"source":"iana","compressible":true},"application/vnd.oipf.ueprofile+xml":{"source":"iana","compressible":true},"application/vnd.oipf.userprofile+xml":{"source":"iana","compressible":true},"application/vnd.olpc-sugar":{"source":"iana","extensions":["xo"]},"application/vnd.oma-scws-config":{"source":"iana"},"application/vnd.oma-scws-http-request":{"source":"iana"},"application/vnd.oma-scws-http-response":{"source":"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.drm-trigger+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.imd+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.ltkm":{"source":"iana"},"application/vnd.oma.bcast.notification+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.provisioningtrigger":{"source":"iana"},"application/vnd.oma.bcast.sgboot":{"source":"iana"},"application/vnd.oma.bcast.sgdd+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.sgdu":{"source":"iana"},"application/vnd.oma.bcast.simple-symbol-container":{"source":"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.sprov+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.stkm":{"source":"iana"},"application/vnd.oma.cab-address-book+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-feature-handler+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-pcc+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-subs-invite+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-user-prefs+xml":{"source":"iana","compressible":true},"application/vnd.oma.dcd":{"source":"iana"},"application/vnd.oma.dcdc":{"source":"iana"},"application/vnd.oma.dd2+xml":{"source":"iana","compressible":true,"extensions":["dd2"]},"application/vnd.oma.drm.risd+xml":{"source":"iana","compressible":true},"application/vnd.oma.group-usage-list+xml":{"source":"iana","compressible":true},"application/vnd.oma.lwm2m+cbor":{"source":"iana"},"application/vnd.oma.lwm2m+json":{"source":"iana","compressible":true},"application/vnd.oma.lwm2m+tlv":{"source":"iana"},"application/vnd.oma.pal+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.detailed-progress-report+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.final-report+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.groups+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.invocation-descriptor+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.optimized-progress-report+xml":{"source":"iana","compressible":true},"application/vnd.oma.push":{"source":"iana"},"application/vnd.oma.scidm.messages+xml":{"source":"iana","compressible":true},"application/vnd.oma.xcap-directory+xml":{"source":"iana","compressible":true},"application/vnd.omads-email+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.omads-file+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.omads-folder+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.omaloc-supl-init":{"source":"iana"},"application/vnd.onepager":{"source":"iana"},"application/vnd.onepagertamp":{"source":"iana"},"application/vnd.onepagertamx":{"source":"iana"},"application/vnd.onepagertat":{"source":"iana"},"application/vnd.onepagertatp":{"source":"iana"},"application/vnd.onepagertatx":{"source":"iana"},"application/vnd.openblox.game+xml":{"source":"iana","compressible":true,"extensions":["obgx"]},"application/vnd.openblox.game-binary":{"source":"iana"},"application/vnd.openeye.oeb":{"source":"iana"},"application/vnd.openofficeorg.extension":{"source":"apache","extensions":["oxt"]},"application/vnd.openstreetmap.data+xml":{"source":"iana","compressible":true,"extensions":["osm"]},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawing+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{"source":"iana","compressible":false,"extensions":["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slide":{"source":"iana","extensions":["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{"source":"iana","extensions":["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.template":{"source":"iana","extensions":["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"source":"iana","compressible":false,"extensions":["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{"source":"iana","extensions":["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.theme+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.vmldrawing":{"source":"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{"source":"iana","compressible":false,"extensions":["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{"source":"iana","extensions":["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-package.core-properties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-package.relationships+xml":{"source":"iana","compressible":true},"application/vnd.oracle.resource+json":{"source":"iana","compressible":true},"application/vnd.orange.indata":{"source":"iana"},"application/vnd.osa.netdeploy":{"source":"iana"},"application/vnd.osgeo.mapguide.package":{"source":"iana","extensions":["mgp"]},"application/vnd.osgi.bundle":{"source":"iana"},"application/vnd.osgi.dp":{"source":"iana","extensions":["dp"]},"application/vnd.osgi.subsystem":{"source":"iana","extensions":["esa"]},"application/vnd.otps.ct-kip+xml":{"source":"iana","compressible":true},"application/vnd.oxli.countgraph":{"source":"iana"},"application/vnd.pagerduty+json":{"source":"iana","compressible":true},"application/vnd.palm":{"source":"iana","extensions":["pdb","pqa","oprc"]},"application/vnd.panoply":{"source":"iana"},"application/vnd.paos.xml":{"source":"iana"},"application/vnd.patentdive":{"source":"iana"},"application/vnd.patientecommsdoc":{"source":"iana"},"application/vnd.pawaafile":{"source":"iana","extensions":["paw"]},"application/vnd.pcos":{"source":"iana"},"application/vnd.pg.format":{"source":"iana","extensions":["str"]},"application/vnd.pg.osasli":{"source":"iana","extensions":["ei6"]},"application/vnd.piaccess.application-licence":{"source":"iana"},"application/vnd.picsel":{"source":"iana","extensions":["efif"]},"application/vnd.pmi.widget":{"source":"iana","extensions":["wg"]},"application/vnd.poc.group-advertisement+xml":{"source":"iana","compressible":true},"application/vnd.pocketlearn":{"source":"iana","extensions":["plf"]},"application/vnd.powerbuilder6":{"source":"iana","extensions":["pbd"]},"application/vnd.powerbuilder6-s":{"source":"iana"},"application/vnd.powerbuilder7":{"source":"iana"},"application/vnd.powerbuilder7-s":{"source":"iana"},"application/vnd.powerbuilder75":{"source":"iana"},"application/vnd.powerbuilder75-s":{"source":"iana"},"application/vnd.preminet":{"source":"iana"},"application/vnd.previewsystems.box":{"source":"iana","extensions":["box"]},"application/vnd.proteus.magazine":{"source":"iana","extensions":["mgz"]},"application/vnd.psfs":{"source":"iana"},"application/vnd.publishare-delta-tree":{"source":"iana","extensions":["qps"]},"application/vnd.pvi.ptid1":{"source":"iana","extensions":["ptid"]},"application/vnd.pwg-multiplexed":{"source":"iana"},"application/vnd.pwg-xhtml-print+xml":{"source":"iana","compressible":true},"application/vnd.qualcomm.brew-app-res":{"source":"iana"},"application/vnd.quarantainenet":{"source":"iana"},"application/vnd.quark.quarkxpress":{"source":"iana","extensions":["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{"source":"iana"},"application/vnd.radisys.moml+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-conf+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-conn+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-dialog+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-stream+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-conf+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-base+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-fax-detect+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-group+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-speech+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-transform+xml":{"source":"iana","compressible":true},"application/vnd.rainstor.data":{"source":"iana"},"application/vnd.rapid":{"source":"iana"},"application/vnd.rar":{"source":"iana","extensions":["rar"]},"application/vnd.realvnc.bed":{"source":"iana","extensions":["bed"]},"application/vnd.recordare.musicxml":{"source":"iana","extensions":["mxl"]},"application/vnd.recordare.musicxml+xml":{"source":"iana","compressible":true,"extensions":["musicxml"]},"application/vnd.renlearn.rlprint":{"source":"iana"},"application/vnd.restful+json":{"source":"iana","compressible":true},"application/vnd.rig.cryptonote":{"source":"iana","extensions":["cryptonote"]},"application/vnd.rim.cod":{"source":"apache","extensions":["cod"]},"application/vnd.rn-realmedia":{"source":"apache","extensions":["rm"]},"application/vnd.rn-realmedia-vbr":{"source":"apache","extensions":["rmvb"]},"application/vnd.route66.link66+xml":{"source":"iana","compressible":true,"extensions":["link66"]},"application/vnd.rs-274x":{"source":"iana"},"application/vnd.ruckus.download":{"source":"iana"},"application/vnd.s3sms":{"source":"iana"},"application/vnd.sailingtracker.track":{"source":"iana","extensions":["st"]},"application/vnd.sar":{"source":"iana"},"application/vnd.sbm.cid":{"source":"iana"},"application/vnd.sbm.mid2":{"source":"iana"},"application/vnd.scribus":{"source":"iana"},"application/vnd.sealed.3df":{"source":"iana"},"application/vnd.sealed.csf":{"source":"iana"},"application/vnd.sealed.doc":{"source":"iana"},"application/vnd.sealed.eml":{"source":"iana"},"application/vnd.sealed.mht":{"source":"iana"},"application/vnd.sealed.net":{"source":"iana"},"application/vnd.sealed.ppt":{"source":"iana"},"application/vnd.sealed.tiff":{"source":"iana"},"application/vnd.sealed.xls":{"source":"iana"},"application/vnd.sealedmedia.softseal.html":{"source":"iana"},"application/vnd.sealedmedia.softseal.pdf":{"source":"iana"},"application/vnd.seemail":{"source":"iana","extensions":["see"]},"application/vnd.seis+json":{"source":"iana","compressible":true},"application/vnd.sema":{"source":"iana","extensions":["sema"]},"application/vnd.semd":{"source":"iana","extensions":["semd"]},"application/vnd.semf":{"source":"iana","extensions":["semf"]},"application/vnd.shade-save-file":{"source":"iana"},"application/vnd.shana.informed.formdata":{"source":"iana","extensions":["ifm"]},"application/vnd.shana.informed.formtemplate":{"source":"iana","extensions":["itp"]},"application/vnd.shana.informed.interchange":{"source":"iana","extensions":["iif"]},"application/vnd.shana.informed.package":{"source":"iana","extensions":["ipk"]},"application/vnd.shootproof+json":{"source":"iana","compressible":true},"application/vnd.shopkick+json":{"source":"iana","compressible":true},"application/vnd.shp":{"source":"iana"},"application/vnd.shx":{"source":"iana"},"application/vnd.sigrok.session":{"source":"iana"},"application/vnd.simtech-mindmapper":{"source":"iana","extensions":["twd","twds"]},"application/vnd.siren+json":{"source":"iana","compressible":true},"application/vnd.smaf":{"source":"iana","extensions":["mmf"]},"application/vnd.smart.notebook":{"source":"iana"},"application/vnd.smart.teacher":{"source":"iana","extensions":["teacher"]},"application/vnd.snesdev-page-table":{"source":"iana"},"application/vnd.software602.filler.form+xml":{"source":"iana","compressible":true,"extensions":["fo"]},"application/vnd.software602.filler.form-xml-zip":{"source":"iana"},"application/vnd.solent.sdkm+xml":{"source":"iana","compressible":true,"extensions":["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{"source":"iana","extensions":["dxp"]},"application/vnd.spotfire.sfs":{"source":"iana","extensions":["sfs"]},"application/vnd.sqlite3":{"source":"iana"},"application/vnd.sss-cod":{"source":"iana"},"application/vnd.sss-dtf":{"source":"iana"},"application/vnd.sss-ntf":{"source":"iana"},"application/vnd.stardivision.calc":{"source":"apache","extensions":["sdc"]},"application/vnd.stardivision.draw":{"source":"apache","extensions":["sda"]},"application/vnd.stardivision.impress":{"source":"apache","extensions":["sdd"]},"application/vnd.stardivision.math":{"source":"apache","extensions":["smf"]},"application/vnd.stardivision.writer":{"source":"apache","extensions":["sdw","vor"]},"application/vnd.stardivision.writer-global":{"source":"apache","extensions":["sgl"]},"application/vnd.stepmania.package":{"source":"iana","extensions":["smzip"]},"application/vnd.stepmania.stepchart":{"source":"iana","extensions":["sm"]},"application/vnd.street-stream":{"source":"iana"},"application/vnd.sun.wadl+xml":{"source":"iana","compressible":true,"extensions":["wadl"]},"application/vnd.sun.xml.calc":{"source":"apache","extensions":["sxc"]},"application/vnd.sun.xml.calc.template":{"source":"apache","extensions":["stc"]},"application/vnd.sun.xml.draw":{"source":"apache","extensions":["sxd"]},"application/vnd.sun.xml.draw.template":{"source":"apache","extensions":["std"]},"application/vnd.sun.xml.impress":{"source":"apache","extensions":["sxi"]},"application/vnd.sun.xml.impress.template":{"source":"apache","extensions":["sti"]},"application/vnd.sun.xml.math":{"source":"apache","extensions":["sxm"]},"application/vnd.sun.xml.writer":{"source":"apache","extensions":["sxw"]},"application/vnd.sun.xml.writer.global":{"source":"apache","extensions":["sxg"]},"application/vnd.sun.xml.writer.template":{"source":"apache","extensions":["stw"]},"application/vnd.sus-calendar":{"source":"iana","extensions":["sus","susp"]},"application/vnd.svd":{"source":"iana","extensions":["svd"]},"application/vnd.swiftview-ics":{"source":"iana"},"application/vnd.sycle+xml":{"source":"iana","compressible":true},"application/vnd.symbian.install":{"source":"apache","extensions":["sis","sisx"]},"application/vnd.syncml+xml":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["xsm"]},"application/vnd.syncml.dm+wbxml":{"source":"iana","charset":"UTF-8","extensions":["bdm"]},"application/vnd.syncml.dm+xml":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["xdm"]},"application/vnd.syncml.dm.notification":{"source":"iana"},"application/vnd.syncml.dmddf+wbxml":{"source":"iana"},"application/vnd.syncml.dmddf+xml":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{"source":"iana"},"application/vnd.syncml.dmtnds+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.syncml.ds.notification":{"source":"iana"},"application/vnd.tableschema+json":{"source":"iana","compressible":true},"application/vnd.tao.intent-module-archive":{"source":"iana","extensions":["tao"]},"application/vnd.tcpdump.pcap":{"source":"iana","extensions":["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{"source":"iana","compressible":true},"application/vnd.tmd.mediaflex.api+xml":{"source":"iana","compressible":true},"application/vnd.tml":{"source":"iana"},"application/vnd.tmobile-livetv":{"source":"iana","extensions":["tmo"]},"application/vnd.tri.onesource":{"source":"iana"},"application/vnd.trid.tpt":{"source":"iana","extensions":["tpt"]},"application/vnd.triscape.mxs":{"source":"iana","extensions":["mxs"]},"application/vnd.trueapp":{"source":"iana","extensions":["tra"]},"application/vnd.truedoc":{"source":"iana"},"application/vnd.ubisoft.webplayer":{"source":"iana"},"application/vnd.ufdl":{"source":"iana","extensions":["ufd","ufdl"]},"application/vnd.uiq.theme":{"source":"iana","extensions":["utz"]},"application/vnd.umajin":{"source":"iana","extensions":["umj"]},"application/vnd.unity":{"source":"iana","extensions":["unityweb"]},"application/vnd.uoml+xml":{"source":"iana","compressible":true,"extensions":["uoml"]},"application/vnd.uplanet.alert":{"source":"iana"},"application/vnd.uplanet.alert-wbxml":{"source":"iana"},"application/vnd.uplanet.bearer-choice":{"source":"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{"source":"iana"},"application/vnd.uplanet.cacheop":{"source":"iana"},"application/vnd.uplanet.cacheop-wbxml":{"source":"iana"},"application/vnd.uplanet.channel":{"source":"iana"},"application/vnd.uplanet.channel-wbxml":{"source":"iana"},"application/vnd.uplanet.list":{"source":"iana"},"application/vnd.uplanet.list-wbxml":{"source":"iana"},"application/vnd.uplanet.listcmd":{"source":"iana"},"application/vnd.uplanet.listcmd-wbxml":{"source":"iana"},"application/vnd.uplanet.signal":{"source":"iana"},"application/vnd.uri-map":{"source":"iana"},"application/vnd.valve.source.material":{"source":"iana"},"application/vnd.vcx":{"source":"iana","extensions":["vcx"]},"application/vnd.vd-study":{"source":"iana"},"application/vnd.vectorworks":{"source":"iana"},"application/vnd.vel+json":{"source":"iana","compressible":true},"application/vnd.verimatrix.vcas":{"source":"iana"},"application/vnd.veryant.thin":{"source":"iana"},"application/vnd.ves.encrypted":{"source":"iana"},"application/vnd.vidsoft.vidconference":{"source":"iana"},"application/vnd.visio":{"source":"iana","extensions":["vsd","vst","vss","vsw"]},"application/vnd.visionary":{"source":"iana","extensions":["vis"]},"application/vnd.vividence.scriptfile":{"source":"iana"},"application/vnd.vsf":{"source":"iana","extensions":["vsf"]},"application/vnd.wap.sic":{"source":"iana"},"application/vnd.wap.slc":{"source":"iana"},"application/vnd.wap.wbxml":{"source":"iana","charset":"UTF-8","extensions":["wbxml"]},"application/vnd.wap.wmlc":{"source":"iana","extensions":["wmlc"]},"application/vnd.wap.wmlscriptc":{"source":"iana","extensions":["wmlsc"]},"application/vnd.webturbo":{"source":"iana","extensions":["wtb"]},"application/vnd.wfa.dpp":{"source":"iana"},"application/vnd.wfa.p2p":{"source":"iana"},"application/vnd.wfa.wsc":{"source":"iana"},"application/vnd.windows.devicepairing":{"source":"iana"},"application/vnd.wmc":{"source":"iana"},"application/vnd.wmf.bootstrap":{"source":"iana"},"application/vnd.wolfram.mathematica":{"source":"iana"},"application/vnd.wolfram.mathematica.package":{"source":"iana"},"application/vnd.wolfram.player":{"source":"iana","extensions":["nbp"]},"application/vnd.wordperfect":{"source":"iana","extensions":["wpd"]},"application/vnd.wqd":{"source":"iana","extensions":["wqd"]},"application/vnd.wrq-hp3000-labelled":{"source":"iana"},"application/vnd.wt.stf":{"source":"iana","extensions":["stf"]},"application/vnd.wv.csp+wbxml":{"source":"iana"},"application/vnd.wv.csp+xml":{"source":"iana","compressible":true},"application/vnd.wv.ssp+xml":{"source":"iana","compressible":true},"application/vnd.xacml+json":{"source":"iana","compressible":true},"application/vnd.xara":{"source":"iana","extensions":["xar"]},"application/vnd.xfdl":{"source":"iana","extensions":["xfdl"]},"application/vnd.xfdl.webform":{"source":"iana"},"application/vnd.xmi+xml":{"source":"iana","compressible":true},"application/vnd.xmpie.cpkg":{"source":"iana"},"application/vnd.xmpie.dpkg":{"source":"iana"},"application/vnd.xmpie.plan":{"source":"iana"},"application/vnd.xmpie.ppkg":{"source":"iana"},"application/vnd.xmpie.xlim":{"source":"iana"},"application/vnd.yamaha.hv-dic":{"source":"iana","extensions":["hvd"]},"application/vnd.yamaha.hv-script":{"source":"iana","extensions":["hvs"]},"application/vnd.yamaha.hv-voice":{"source":"iana","extensions":["hvp"]},"application/vnd.yamaha.openscoreformat":{"source":"iana","extensions":["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{"source":"iana","compressible":true,"extensions":["osfpvg"]},"application/vnd.yamaha.remote-setup":{"source":"iana"},"application/vnd.yamaha.smaf-audio":{"source":"iana","extensions":["saf"]},"application/vnd.yamaha.smaf-phrase":{"source":"iana","extensions":["spf"]},"application/vnd.yamaha.through-ngn":{"source":"iana"},"application/vnd.yamaha.tunnel-udpencap":{"source":"iana"},"application/vnd.yaoweme":{"source":"iana"},"application/vnd.yellowriver-custom-menu":{"source":"iana","extensions":["cmp"]},"application/vnd.youtube.yt":{"source":"iana"},"application/vnd.zul":{"source":"iana","extensions":["zir","zirz"]},"application/vnd.zzazz.deck+xml":{"source":"iana","compressible":true,"extensions":["zaz"]},"application/voicexml+xml":{"source":"iana","compressible":true,"extensions":["vxml"]},"application/voucher-cms+json":{"source":"iana","compressible":true},"application/vq-rtcpxr":{"source":"iana"},"application/wasm":{"compressible":true,"extensions":["wasm"]},"application/watcherinfo+xml":{"source":"iana","compressible":true},"application/webpush-options+json":{"source":"iana","compressible":true},"application/whoispp-query":{"source":"iana"},"application/whoispp-response":{"source":"iana"},"application/widget":{"source":"iana","extensions":["wgt"]},"application/winhlp":{"source":"apache","extensions":["hlp"]},"application/wita":{"source":"iana"},"application/wordperfect5.1":{"source":"iana"},"application/wsdl+xml":{"source":"iana","compressible":true,"extensions":["wsdl"]},"application/wspolicy+xml":{"source":"iana","compressible":true,"extensions":["wspolicy"]},"application/x-7z-compressed":{"source":"apache","compressible":false,"extensions":["7z"]},"application/x-abiword":{"source":"apache","extensions":["abw"]},"application/x-ace-compressed":{"source":"apache","extensions":["ace"]},"application/x-amf":{"source":"apache"},"application/x-apple-diskimage":{"source":"apache","extensions":["dmg"]},"application/x-arj":{"compressible":false,"extensions":["arj"]},"application/x-authorware-bin":{"source":"apache","extensions":["aab","x32","u32","vox"]},"application/x-authorware-map":{"source":"apache","extensions":["aam"]},"application/x-authorware-seg":{"source":"apache","extensions":["aas"]},"application/x-bcpio":{"source":"apache","extensions":["bcpio"]},"application/x-bdoc":{"compressible":false,"extensions":["bdoc"]},"application/x-bittorrent":{"source":"apache","extensions":["torrent"]},"application/x-blorb":{"source":"apache","extensions":["blb","blorb"]},"application/x-bzip":{"source":"apache","compressible":false,"extensions":["bz"]},"application/x-bzip2":{"source":"apache","compressible":false,"extensions":["bz2","boz"]},"application/x-cbr":{"source":"apache","extensions":["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{"source":"apache","extensions":["vcd"]},"application/x-cfs-compressed":{"source":"apache","extensions":["cfs"]},"application/x-chat":{"source":"apache","extensions":["chat"]},"application/x-chess-pgn":{"source":"apache","extensions":["pgn"]},"application/x-chrome-extension":{"extensions":["crx"]},"application/x-cocoa":{"source":"nginx","extensions":["cco"]},"application/x-compress":{"source":"apache"},"application/x-conference":{"source":"apache","extensions":["nsc"]},"application/x-cpio":{"source":"apache","extensions":["cpio"]},"application/x-csh":{"source":"apache","extensions":["csh"]},"application/x-deb":{"compressible":false},"application/x-debian-package":{"source":"apache","extensions":["deb","udeb"]},"application/x-dgc-compressed":{"source":"apache","extensions":["dgc"]},"application/x-director":{"source":"apache","extensions":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{"source":"apache","extensions":["wad"]},"application/x-dtbncx+xml":{"source":"apache","compressible":true,"extensions":["ncx"]},"application/x-dtbook+xml":{"source":"apache","compressible":true,"extensions":["dtb"]},"application/x-dtbresource+xml":{"source":"apache","compressible":true,"extensions":["res"]},"application/x-dvi":{"source":"apache","compressible":false,"extensions":["dvi"]},"application/x-envoy":{"source":"apache","extensions":["evy"]},"application/x-eva":{"source":"apache","extensions":["eva"]},"application/x-font-bdf":{"source":"apache","extensions":["bdf"]},"application/x-font-dos":{"source":"apache"},"application/x-font-framemaker":{"source":"apache"},"application/x-font-ghostscript":{"source":"apache","extensions":["gsf"]},"application/x-font-libgrx":{"source":"apache"},"application/x-font-linux-psf":{"source":"apache","extensions":["psf"]},"application/x-font-pcf":{"source":"apache","extensions":["pcf"]},"application/x-font-snf":{"source":"apache","extensions":["snf"]},"application/x-font-speedo":{"source":"apache"},"application/x-font-sunos-news":{"source":"apache"},"application/x-font-type1":{"source":"apache","extensions":["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{"source":"apache"},"application/x-freearc":{"source":"apache","extensions":["arc"]},"application/x-futuresplash":{"source":"apache","extensions":["spl"]},"application/x-gca-compressed":{"source":"apache","extensions":["gca"]},"application/x-glulx":{"source":"apache","extensions":["ulx"]},"application/x-gnumeric":{"source":"apache","extensions":["gnumeric"]},"application/x-gramps-xml":{"source":"apache","extensions":["gramps"]},"application/x-gtar":{"source":"apache","extensions":["gtar"]},"application/x-gzip":{"source":"apache"},"application/x-hdf":{"source":"apache","extensions":["hdf"]},"application/x-httpd-php":{"compressible":true,"extensions":["php"]},"application/x-install-instructions":{"source":"apache","extensions":["install"]},"application/x-iso9660-image":{"source":"apache","extensions":["iso"]},"application/x-java-archive-diff":{"source":"nginx","extensions":["jardiff"]},"application/x-java-jnlp-file":{"source":"apache","compressible":false,"extensions":["jnlp"]},"application/x-javascript":{"compressible":true},"application/x-keepass2":{"extensions":["kdbx"]},"application/x-latex":{"source":"apache","compressible":false,"extensions":["latex"]},"application/x-lua-bytecode":{"extensions":["luac"]},"application/x-lzh-compressed":{"source":"apache","extensions":["lzh","lha"]},"application/x-makeself":{"source":"nginx","extensions":["run"]},"application/x-mie":{"source":"apache","extensions":["mie"]},"application/x-mobipocket-ebook":{"source":"apache","extensions":["prc","mobi"]},"application/x-mpegurl":{"compressible":false},"application/x-ms-application":{"source":"apache","extensions":["application"]},"application/x-ms-shortcut":{"source":"apache","extensions":["lnk"]},"application/x-ms-wmd":{"source":"apache","extensions":["wmd"]},"application/x-ms-wmz":{"source":"apache","extensions":["wmz"]},"application/x-ms-xbap":{"source":"apache","extensions":["xbap"]},"application/x-msaccess":{"source":"apache","extensions":["mdb"]},"application/x-msbinder":{"source":"apache","extensions":["obd"]},"application/x-mscardfile":{"source":"apache","extensions":["crd"]},"application/x-msclip":{"source":"apache","extensions":["clp"]},"application/x-msdos-program":{"extensions":["exe"]},"application/x-msdownload":{"source":"apache","extensions":["exe","dll","com","bat","msi"]},"application/x-msmediaview":{"source":"apache","extensions":["mvb","m13","m14"]},"application/x-msmetafile":{"source":"apache","extensions":["wmf","wmz","emf","emz"]},"application/x-msmoney":{"source":"apache","extensions":["mny"]},"application/x-mspublisher":{"source":"apache","extensions":["pub"]},"application/x-msschedule":{"source":"apache","extensions":["scd"]},"application/x-msterminal":{"source":"apache","extensions":["trm"]},"application/x-mswrite":{"source":"apache","extensions":["wri"]},"application/x-netcdf":{"source":"apache","extensions":["nc","cdf"]},"application/x-ns-proxy-autoconfig":{"compressible":true,"extensions":["pac"]},"application/x-nzb":{"source":"apache","extensions":["nzb"]},"application/x-perl":{"source":"nginx","extensions":["pl","pm"]},"application/x-pilot":{"source":"nginx","extensions":["prc","pdb"]},"application/x-pkcs12":{"source":"apache","compressible":false,"extensions":["p12","pfx"]},"application/x-pkcs7-certificates":{"source":"apache","extensions":["p7b","spc"]},"application/x-pkcs7-certreqresp":{"source":"apache","extensions":["p7r"]},"application/x-pki-message":{"source":"iana"},"application/x-rar-compressed":{"source":"apache","compressible":false,"extensions":["rar"]},"application/x-redhat-package-manager":{"source":"nginx","extensions":["rpm"]},"application/x-research-info-systems":{"source":"apache","extensions":["ris"]},"application/x-sea":{"source":"nginx","extensions":["sea"]},"application/x-sh":{"source":"apache","compressible":true,"extensions":["sh"]},"application/x-shar":{"source":"apache","extensions":["shar"]},"application/x-shockwave-flash":{"source":"apache","compressible":false,"extensions":["swf"]},"application/x-silverlight-app":{"source":"apache","extensions":["xap"]},"application/x-sql":{"source":"apache","extensions":["sql"]},"application/x-stuffit":{"source":"apache","compressible":false,"extensions":["sit"]},"application/x-stuffitx":{"source":"apache","extensions":["sitx"]},"application/x-subrip":{"source":"apache","extensions":["srt"]},"application/x-sv4cpio":{"source":"apache","extensions":["sv4cpio"]},"application/x-sv4crc":{"source":"apache","extensions":["sv4crc"]},"application/x-t3vm-image":{"source":"apache","extensions":["t3"]},"application/x-tads":{"source":"apache","extensions":["gam"]},"application/x-tar":{"source":"apache","compressible":true,"extensions":["tar"]},"application/x-tcl":{"source":"apache","extensions":["tcl","tk"]},"application/x-tex":{"source":"apache","extensions":["tex"]},"application/x-tex-tfm":{"source":"apache","extensions":["tfm"]},"application/x-texinfo":{"source":"apache","extensions":["texinfo","texi"]},"application/x-tgif":{"source":"apache","extensions":["obj"]},"application/x-ustar":{"source":"apache","extensions":["ustar"]},"application/x-virtualbox-hdd":{"compressible":true,"extensions":["hdd"]},"application/x-virtualbox-ova":{"compressible":true,"extensions":["ova"]},"application/x-virtualbox-ovf":{"compressible":true,"extensions":["ovf"]},"application/x-virtualbox-vbox":{"compressible":true,"extensions":["vbox"]},"application/x-virtualbox-vbox-extpack":{"compressible":false,"extensions":["vbox-extpack"]},"application/x-virtualbox-vdi":{"compressible":true,"extensions":["vdi"]},"application/x-virtualbox-vhd":{"compressible":true,"extensions":["vhd"]},"application/x-virtualbox-vmdk":{"compressible":true,"extensions":["vmdk"]},"application/x-wais-source":{"source":"apache","extensions":["src"]},"application/x-web-app-manifest+json":{"compressible":true,"extensions":["webapp"]},"application/x-www-form-urlencoded":{"source":"iana","compressible":true},"application/x-x509-ca-cert":{"source":"iana","extensions":["der","crt","pem"]},"application/x-x509-ca-ra-cert":{"source":"iana"},"application/x-x509-next-ca-cert":{"source":"iana"},"application/x-xfig":{"source":"apache","extensions":["fig"]},"application/x-xliff+xml":{"source":"apache","compressible":true,"extensions":["xlf"]},"application/x-xpinstall":{"source":"apache","compressible":false,"extensions":["xpi"]},"application/x-xz":{"source":"apache","extensions":["xz"]},"application/x-zmachine":{"source":"apache","extensions":["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{"source":"iana"},"application/xacml+xml":{"source":"iana","compressible":true},"application/xaml+xml":{"source":"apache","compressible":true,"extensions":["xaml"]},"application/xcap-att+xml":{"source":"iana","compressible":true,"extensions":["xav"]},"application/xcap-caps+xml":{"source":"iana","compressible":true,"extensions":["xca"]},"application/xcap-diff+xml":{"source":"iana","compressible":true,"extensions":["xdf"]},"application/xcap-el+xml":{"source":"iana","compressible":true,"extensions":["xel"]},"application/xcap-error+xml":{"source":"iana","compressible":true},"application/xcap-ns+xml":{"source":"iana","compressible":true,"extensions":["xns"]},"application/xcon-conference-info+xml":{"source":"iana","compressible":true},"application/xcon-conference-info-diff+xml":{"source":"iana","compressible":true},"application/xenc+xml":{"source":"iana","compressible":true,"extensions":["xenc"]},"application/xhtml+xml":{"source":"iana","compressible":true,"extensions":["xhtml","xht"]},"application/xhtml-voice+xml":{"source":"apache","compressible":true},"application/xliff+xml":{"source":"iana","compressible":true,"extensions":["xlf"]},"application/xml":{"source":"iana","compressible":true,"extensions":["xml","xsl","xsd","rng"]},"application/xml-dtd":{"source":"iana","compressible":true,"extensions":["dtd"]},"application/xml-external-parsed-entity":{"source":"iana"},"application/xml-patch+xml":{"source":"iana","compressible":true},"application/xmpp+xml":{"source":"iana","compressible":true},"application/xop+xml":{"source":"iana","compressible":true,"extensions":["xop"]},"application/xproc+xml":{"source":"apache","compressible":true,"extensions":["xpl"]},"application/xslt+xml":{"source":"iana","compressible":true,"extensions":["xsl","xslt"]},"application/xspf+xml":{"source":"apache","compressible":true,"extensions":["xspf"]},"application/xv+xml":{"source":"iana","compressible":true,"extensions":["mxml","xhvml","xvml","xvm"]},"application/yang":{"source":"iana","extensions":["yang"]},"application/yang-data+json":{"source":"iana","compressible":true},"application/yang-data+xml":{"source":"iana","compressible":true},"application/yang-patch+json":{"source":"iana","compressible":true},"application/yang-patch+xml":{"source":"iana","compressible":true},"application/yin+xml":{"source":"iana","compressible":true,"extensions":["yin"]},"application/zip":{"source":"iana","compressible":false,"extensions":["zip"]},"application/zlib":{"source":"iana"},"application/zstd":{"source":"iana"},"audio/1d-interleaved-parityfec":{"source":"iana"},"audio/32kadpcm":{"source":"iana"},"audio/3gpp":{"source":"iana","compressible":false,"extensions":["3gpp"]},"audio/3gpp2":{"source":"iana"},"audio/aac":{"source":"iana"},"audio/ac3":{"source":"iana"},"audio/adpcm":{"source":"apache","extensions":["adp"]},"audio/amr":{"source":"iana","extensions":["amr"]},"audio/amr-wb":{"source":"iana"},"audio/amr-wb+":{"source":"iana"},"audio/aptx":{"source":"iana"},"audio/asc":{"source":"iana"},"audio/atrac-advanced-lossless":{"source":"iana"},"audio/atrac-x":{"source":"iana"},"audio/atrac3":{"source":"iana"},"audio/basic":{"source":"iana","compressible":false,"extensions":["au","snd"]},"audio/bv16":{"source":"iana"},"audio/bv32":{"source":"iana"},"audio/clearmode":{"source":"iana"},"audio/cn":{"source":"iana"},"audio/dat12":{"source":"iana"},"audio/dls":{"source":"iana"},"audio/dsr-es201108":{"source":"iana"},"audio/dsr-es202050":{"source":"iana"},"audio/dsr-es202211":{"source":"iana"},"audio/dsr-es202212":{"source":"iana"},"audio/dv":{"source":"iana"},"audio/dvi4":{"source":"iana"},"audio/eac3":{"source":"iana"},"audio/encaprtp":{"source":"iana"},"audio/evrc":{"source":"iana"},"audio/evrc-qcp":{"source":"iana"},"audio/evrc0":{"source":"iana"},"audio/evrc1":{"source":"iana"},"audio/evrcb":{"source":"iana"},"audio/evrcb0":{"source":"iana"},"audio/evrcb1":{"source":"iana"},"audio/evrcnw":{"source":"iana"},"audio/evrcnw0":{"source":"iana"},"audio/evrcnw1":{"source":"iana"},"audio/evrcwb":{"source":"iana"},"audio/evrcwb0":{"source":"iana"},"audio/evrcwb1":{"source":"iana"},"audio/evs":{"source":"iana"},"audio/flexfec":{"source":"iana"},"audio/fwdred":{"source":"iana"},"audio/g711-0":{"source":"iana"},"audio/g719":{"source":"iana"},"audio/g722":{"source":"iana"},"audio/g7221":{"source":"iana"},"audio/g723":{"source":"iana"},"audio/g726-16":{"source":"iana"},"audio/g726-24":{"source":"iana"},"audio/g726-32":{"source":"iana"},"audio/g726-40":{"source":"iana"},"audio/g728":{"source":"iana"},"audio/g729":{"source":"iana"},"audio/g7291":{"source":"iana"},"audio/g729d":{"source":"iana"},"audio/g729e":{"source":"iana"},"audio/gsm":{"source":"iana"},"audio/gsm-efr":{"source":"iana"},"audio/gsm-hr-08":{"source":"iana"},"audio/ilbc":{"source":"iana"},"audio/ip-mr_v2.5":{"source":"iana"},"audio/isac":{"source":"apache"},"audio/l16":{"source":"iana"},"audio/l20":{"source":"iana"},"audio/l24":{"source":"iana","compressible":false},"audio/l8":{"source":"iana"},"audio/lpc":{"source":"iana"},"audio/melp":{"source":"iana"},"audio/melp1200":{"source":"iana"},"audio/melp2400":{"source":"iana"},"audio/melp600":{"source":"iana"},"audio/mhas":{"source":"iana"},"audio/midi":{"source":"apache","extensions":["mid","midi","kar","rmi"]},"audio/mobile-xmf":{"source":"iana","extensions":["mxmf"]},"audio/mp3":{"compressible":false,"extensions":["mp3"]},"audio/mp4":{"source":"iana","compressible":false,"extensions":["m4a","mp4a"]},"audio/mp4a-latm":{"source":"iana"},"audio/mpa":{"source":"iana"},"audio/mpa-robust":{"source":"iana"},"audio/mpeg":{"source":"iana","compressible":false,"extensions":["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{"source":"iana"},"audio/musepack":{"source":"apache"},"audio/ogg":{"source":"iana","compressible":false,"extensions":["oga","ogg","spx","opus"]},"audio/opus":{"source":"iana"},"audio/parityfec":{"source":"iana"},"audio/pcma":{"source":"iana"},"audio/pcma-wb":{"source":"iana"},"audio/pcmu":{"source":"iana"},"audio/pcmu-wb":{"source":"iana"},"audio/prs.sid":{"source":"iana"},"audio/qcelp":{"source":"iana"},"audio/raptorfec":{"source":"iana"},"audio/red":{"source":"iana"},"audio/rtp-enc-aescm128":{"source":"iana"},"audio/rtp-midi":{"source":"iana"},"audio/rtploopback":{"source":"iana"},"audio/rtx":{"source":"iana"},"audio/s3m":{"source":"apache","extensions":["s3m"]},"audio/scip":{"source":"iana"},"audio/silk":{"source":"apache","extensions":["sil"]},"audio/smv":{"source":"iana"},"audio/smv-qcp":{"source":"iana"},"audio/smv0":{"source":"iana"},"audio/sofa":{"source":"iana"},"audio/sp-midi":{"source":"iana"},"audio/speex":{"source":"iana"},"audio/t140c":{"source":"iana"},"audio/t38":{"source":"iana"},"audio/telephone-event":{"source":"iana"},"audio/tetra_acelp":{"source":"iana"},"audio/tetra_acelp_bb":{"source":"iana"},"audio/tone":{"source":"iana"},"audio/tsvcis":{"source":"iana"},"audio/uemclip":{"source":"iana"},"audio/ulpfec":{"source":"iana"},"audio/usac":{"source":"iana"},"audio/vdvi":{"source":"iana"},"audio/vmr-wb":{"source":"iana"},"audio/vnd.3gpp.iufp":{"source":"iana"},"audio/vnd.4sb":{"source":"iana"},"audio/vnd.audiokoz":{"source":"iana"},"audio/vnd.celp":{"source":"iana"},"audio/vnd.cisco.nse":{"source":"iana"},"audio/vnd.cmles.radio-events":{"source":"iana"},"audio/vnd.cns.anp1":{"source":"iana"},"audio/vnd.cns.inf1":{"source":"iana"},"audio/vnd.dece.audio":{"source":"iana","extensions":["uva","uvva"]},"audio/vnd.digital-winds":{"source":"iana","extensions":["eol"]},"audio/vnd.dlna.adts":{"source":"iana"},"audio/vnd.dolby.heaac.1":{"source":"iana"},"audio/vnd.dolby.heaac.2":{"source":"iana"},"audio/vnd.dolby.mlp":{"source":"iana"},"audio/vnd.dolby.mps":{"source":"iana"},"audio/vnd.dolby.pl2":{"source":"iana"},"audio/vnd.dolby.pl2x":{"source":"iana"},"audio/vnd.dolby.pl2z":{"source":"iana"},"audio/vnd.dolby.pulse.1":{"source":"iana"},"audio/vnd.dra":{"source":"iana","extensions":["dra"]},"audio/vnd.dts":{"source":"iana","extensions":["dts"]},"audio/vnd.dts.hd":{"source":"iana","extensions":["dtshd"]},"audio/vnd.dts.uhd":{"source":"iana"},"audio/vnd.dvb.file":{"source":"iana"},"audio/vnd.everad.plj":{"source":"iana"},"audio/vnd.hns.audio":{"source":"iana"},"audio/vnd.lucent.voice":{"source":"iana","extensions":["lvp"]},"audio/vnd.ms-playready.media.pya":{"source":"iana","extensions":["pya"]},"audio/vnd.nokia.mobile-xmf":{"source":"iana"},"audio/vnd.nortel.vbk":{"source":"iana"},"audio/vnd.nuera.ecelp4800":{"source":"iana","extensions":["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{"source":"iana","extensions":["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{"source":"iana","extensions":["ecelp9600"]},"audio/vnd.octel.sbc":{"source":"iana"},"audio/vnd.presonus.multitrack":{"source":"iana"},"audio/vnd.qcelp":{"source":"iana"},"audio/vnd.rhetorex.32kadpcm":{"source":"iana"},"audio/vnd.rip":{"source":"iana","extensions":["rip"]},"audio/vnd.rn-realaudio":{"compressible":false},"audio/vnd.sealedmedia.softseal.mpeg":{"source":"iana"},"audio/vnd.vmx.cvsd":{"source":"iana"},"audio/vnd.wave":{"compressible":false},"audio/vorbis":{"source":"iana","compressible":false},"audio/vorbis-config":{"source":"iana"},"audio/wav":{"compressible":false,"extensions":["wav"]},"audio/wave":{"compressible":false,"extensions":["wav"]},"audio/webm":{"source":"apache","compressible":false,"extensions":["weba"]},"audio/x-aac":{"source":"apache","compressible":false,"extensions":["aac"]},"audio/x-aiff":{"source":"apache","extensions":["aif","aiff","aifc"]},"audio/x-caf":{"source":"apache","compressible":false,"extensions":["caf"]},"audio/x-flac":{"source":"apache","extensions":["flac"]},"audio/x-m4a":{"source":"nginx","extensions":["m4a"]},"audio/x-matroska":{"source":"apache","extensions":["mka"]},"audio/x-mpegurl":{"source":"apache","extensions":["m3u"]},"audio/x-ms-wax":{"source":"apache","extensions":["wax"]},"audio/x-ms-wma":{"source":"apache","extensions":["wma"]},"audio/x-pn-realaudio":{"source":"apache","extensions":["ram","ra"]},"audio/x-pn-realaudio-plugin":{"source":"apache","extensions":["rmp"]},"audio/x-realaudio":{"source":"nginx","extensions":["ra"]},"audio/x-tta":{"source":"apache"},"audio/x-wav":{"source":"apache","extensions":["wav"]},"audio/xm":{"source":"apache","extensions":["xm"]},"chemical/x-cdx":{"source":"apache","extensions":["cdx"]},"chemical/x-cif":{"source":"apache","extensions":["cif"]},"chemical/x-cmdf":{"source":"apache","extensions":["cmdf"]},"chemical/x-cml":{"source":"apache","extensions":["cml"]},"chemical/x-csml":{"source":"apache","extensions":["csml"]},"chemical/x-pdb":{"source":"apache"},"chemical/x-xyz":{"source":"apache","extensions":["xyz"]},"font/collection":{"source":"iana","extensions":["ttc"]},"font/otf":{"source":"iana","compressible":true,"extensions":["otf"]},"font/sfnt":{"source":"iana"},"font/ttf":{"source":"iana","compressible":true,"extensions":["ttf"]},"font/woff":{"source":"iana","extensions":["woff"]},"font/woff2":{"source":"iana","extensions":["woff2"]},"image/aces":{"source":"iana","extensions":["exr"]},"image/apng":{"compressible":false,"extensions":["apng"]},"image/avci":{"source":"iana"},"image/avcs":{"source":"iana"},"image/avif":{"source":"iana","compressible":false,"extensions":["avif"]},"image/bmp":{"source":"iana","compressible":true,"extensions":["bmp"]},"image/cgm":{"source":"iana","extensions":["cgm"]},"image/dicom-rle":{"source":"iana","extensions":["drle"]},"image/emf":{"source":"iana","extensions":["emf"]},"image/fits":{"source":"iana","extensions":["fits"]},"image/g3fax":{"source":"iana","extensions":["g3"]},"image/gif":{"source":"iana","compressible":false,"extensions":["gif"]},"image/heic":{"source":"iana","extensions":["heic"]},"image/heic-sequence":{"source":"iana","extensions":["heics"]},"image/heif":{"source":"iana","extensions":["heif"]},"image/heif-sequence":{"source":"iana","extensions":["heifs"]},"image/hej2k":{"source":"iana","extensions":["hej2"]},"image/hsj2":{"source":"iana","extensions":["hsj2"]},"image/ief":{"source":"iana","extensions":["ief"]},"image/jls":{"source":"iana","extensions":["jls"]},"image/jp2":{"source":"iana","compressible":false,"extensions":["jp2","jpg2"]},"image/jpeg":{"source":"iana","compressible":false,"extensions":["jpeg","jpg","jpe"]},"image/jph":{"source":"iana","extensions":["jph"]},"image/jphc":{"source":"iana","extensions":["jhc"]},"image/jpm":{"source":"iana","compressible":false,"extensions":["jpm"]},"image/jpx":{"source":"iana","compressible":false,"extensions":["jpx","jpf"]},"image/jxr":{"source":"iana","extensions":["jxr"]},"image/jxra":{"source":"iana","extensions":["jxra"]},"image/jxrs":{"source":"iana","extensions":["jxrs"]},"image/jxs":{"source":"iana","extensions":["jxs"]},"image/jxsc":{"source":"iana","extensions":["jxsc"]},"image/jxsi":{"source":"iana","extensions":["jxsi"]},"image/jxss":{"source":"iana","extensions":["jxss"]},"image/ktx":{"source":"iana","extensions":["ktx"]},"image/ktx2":{"source":"iana","extensions":["ktx2"]},"image/naplps":{"source":"iana"},"image/pjpeg":{"compressible":false},"image/png":{"source":"iana","compressible":false,"extensions":["png"]},"image/prs.btif":{"source":"iana","extensions":["btif"]},"image/prs.pti":{"source":"iana","extensions":["pti"]},"image/pwg-raster":{"source":"iana"},"image/sgi":{"source":"apache","extensions":["sgi"]},"image/svg+xml":{"source":"iana","compressible":true,"extensions":["svg","svgz"]},"image/t38":{"source":"iana","extensions":["t38"]},"image/tiff":{"source":"iana","compressible":false,"extensions":["tif","tiff"]},"image/tiff-fx":{"source":"iana","extensions":["tfx"]},"image/vnd.adobe.photoshop":{"source":"iana","compressible":true,"extensions":["psd"]},"image/vnd.airzip.accelerator.azv":{"source":"iana","extensions":["azv"]},"image/vnd.cns.inf2":{"source":"iana"},"image/vnd.dece.graphic":{"source":"iana","extensions":["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{"source":"iana","extensions":["djvu","djv"]},"image/vnd.dvb.subtitle":{"source":"iana","extensions":["sub"]},"image/vnd.dwg":{"source":"iana","extensions":["dwg"]},"image/vnd.dxf":{"source":"iana","extensions":["dxf"]},"image/vnd.fastbidsheet":{"source":"iana","extensions":["fbs"]},"image/vnd.fpx":{"source":"iana","extensions":["fpx"]},"image/vnd.fst":{"source":"iana","extensions":["fst"]},"image/vnd.fujixerox.edmics-mmr":{"source":"iana","extensions":["mmr"]},"image/vnd.fujixerox.edmics-rlc":{"source":"iana","extensions":["rlc"]},"image/vnd.globalgraphics.pgb":{"source":"iana"},"image/vnd.microsoft.icon":{"source":"iana","extensions":["ico"]},"image/vnd.mix":{"source":"iana"},"image/vnd.mozilla.apng":{"source":"iana"},"image/vnd.ms-dds":{"extensions":["dds"]},"image/vnd.ms-modi":{"source":"iana","extensions":["mdi"]},"image/vnd.ms-photo":{"source":"apache","extensions":["wdp"]},"image/vnd.net-fpx":{"source":"iana","extensions":["npx"]},"image/vnd.pco.b16":{"source":"iana","extensions":["b16"]},"image/vnd.radiance":{"source":"iana"},"image/vnd.sealed.png":{"source":"iana"},"image/vnd.sealedmedia.softseal.gif":{"source":"iana"},"image/vnd.sealedmedia.softseal.jpg":{"source":"iana"},"image/vnd.svf":{"source":"iana"},"image/vnd.tencent.tap":{"source":"iana","extensions":["tap"]},"image/vnd.valve.source.texture":{"source":"iana","extensions":["vtf"]},"image/vnd.wap.wbmp":{"source":"iana","extensions":["wbmp"]},"image/vnd.xiff":{"source":"iana","extensions":["xif"]},"image/vnd.zbrush.pcx":{"source":"iana","extensions":["pcx"]},"image/webp":{"source":"apache","extensions":["webp"]},"image/wmf":{"source":"iana","extensions":["wmf"]},"image/x-3ds":{"source":"apache","extensions":["3ds"]},"image/x-cmu-raster":{"source":"apache","extensions":["ras"]},"image/x-cmx":{"source":"apache","extensions":["cmx"]},"image/x-freehand":{"source":"apache","extensions":["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{"source":"apache","compressible":true,"extensions":["ico"]},"image/x-jng":{"source":"nginx","extensions":["jng"]},"image/x-mrsid-image":{"source":"apache","extensions":["sid"]},"image/x-ms-bmp":{"source":"nginx","compressible":true,"extensions":["bmp"]},"image/x-pcx":{"source":"apache","extensions":["pcx"]},"image/x-pict":{"source":"apache","extensions":["pic","pct"]},"image/x-portable-anymap":{"source":"apache","extensions":["pnm"]},"image/x-portable-bitmap":{"source":"apache","extensions":["pbm"]},"image/x-portable-graymap":{"source":"apache","extensions":["pgm"]},"image/x-portable-pixmap":{"source":"apache","extensions":["ppm"]},"image/x-rgb":{"source":"apache","extensions":["rgb"]},"image/x-tga":{"source":"apache","extensions":["tga"]},"image/x-xbitmap":{"source":"apache","extensions":["xbm"]},"image/x-xcf":{"compressible":false},"image/x-xpixmap":{"source":"apache","extensions":["xpm"]},"image/x-xwindowdump":{"source":"apache","extensions":["xwd"]},"message/cpim":{"source":"iana"},"message/delivery-status":{"source":"iana"},"message/disposition-notification":{"source":"iana","extensions":["disposition-notification"]},"message/external-body":{"source":"iana"},"message/feedback-report":{"source":"iana"},"message/global":{"source":"iana","extensions":["u8msg"]},"message/global-delivery-status":{"source":"iana","extensions":["u8dsn"]},"message/global-disposition-notification":{"source":"iana","extensions":["u8mdn"]},"message/global-headers":{"source":"iana","extensions":["u8hdr"]},"message/http":{"source":"iana","compressible":false},"message/imdn+xml":{"source":"iana","compressible":true},"message/news":{"source":"iana"},"message/partial":{"source":"iana","compressible":false},"message/rfc822":{"source":"iana","compressible":true,"extensions":["eml","mime"]},"message/s-http":{"source":"iana"},"message/sip":{"source":"iana"},"message/sipfrag":{"source":"iana"},"message/tracking-status":{"source":"iana"},"message/vnd.si.simp":{"source":"iana"},"message/vnd.wfa.wsc":{"source":"iana","extensions":["wsc"]},"model/3mf":{"source":"iana","extensions":["3mf"]},"model/e57":{"source":"iana"},"model/gltf+json":{"source":"iana","compressible":true,"extensions":["gltf"]},"model/gltf-binary":{"source":"iana","compressible":true,"extensions":["glb"]},"model/iges":{"source":"iana","compressible":false,"extensions":["igs","iges"]},"model/mesh":{"source":"iana","compressible":false,"extensions":["msh","mesh","silo"]},"model/mtl":{"source":"iana","extensions":["mtl"]},"model/obj":{"source":"iana","extensions":["obj"]},"model/stl":{"source":"iana","extensions":["stl"]},"model/vnd.collada+xml":{"source":"iana","compressible":true,"extensions":["dae"]},"model/vnd.dwf":{"source":"iana","extensions":["dwf"]},"model/vnd.flatland.3dml":{"source":"iana"},"model/vnd.gdl":{"source":"iana","extensions":["gdl"]},"model/vnd.gs-gdl":{"source":"apache"},"model/vnd.gs.gdl":{"source":"iana"},"model/vnd.gtw":{"source":"iana","extensions":["gtw"]},"model/vnd.moml+xml":{"source":"iana","compressible":true},"model/vnd.mts":{"source":"iana","extensions":["mts"]},"model/vnd.opengex":{"source":"iana","extensions":["ogex"]},"model/vnd.parasolid.transmit.binary":{"source":"iana","extensions":["x_b"]},"model/vnd.parasolid.transmit.text":{"source":"iana","extensions":["x_t"]},"model/vnd.rosette.annotated-data-model":{"source":"iana"},"model/vnd.sap.vds":{"source":"iana","extensions":["vds"]},"model/vnd.usdz+zip":{"source":"iana","compressible":false,"extensions":["usdz"]},"model/vnd.valve.source.compiled-map":{"source":"iana","extensions":["bsp"]},"model/vnd.vtu":{"source":"iana","extensions":["vtu"]},"model/vrml":{"source":"iana","compressible":false,"extensions":["wrl","vrml"]},"model/x3d+binary":{"source":"apache","compressible":false,"extensions":["x3db","x3dbz"]},"model/x3d+fastinfoset":{"source":"iana","extensions":["x3db"]},"model/x3d+vrml":{"source":"apache","compressible":false,"extensions":["x3dv","x3dvz"]},"model/x3d+xml":{"source":"iana","compressible":true,"extensions":["x3d","x3dz"]},"model/x3d-vrml":{"source":"iana","extensions":["x3dv"]},"multipart/alternative":{"source":"iana","compressible":false},"multipart/appledouble":{"source":"iana"},"multipart/byteranges":{"source":"iana"},"multipart/digest":{"source":"iana"},"multipart/encrypted":{"source":"iana","compressible":false},"multipart/form-data":{"source":"iana","compressible":false},"multipart/header-set":{"source":"iana"},"multipart/mixed":{"source":"iana"},"multipart/multilingual":{"source":"iana"},"multipart/parallel":{"source":"iana"},"multipart/related":{"source":"iana","compressible":false},"multipart/report":{"source":"iana"},"multipart/signed":{"source":"iana","compressible":false},"multipart/vnd.bint.med-plus":{"source":"iana"},"multipart/voice-message":{"source":"iana"},"multipart/x-mixed-replace":{"source":"iana"},"text/1d-interleaved-parityfec":{"source":"iana"},"text/cache-manifest":{"source":"iana","compressible":true,"extensions":["appcache","manifest"]},"text/calendar":{"source":"iana","extensions":["ics","ifb"]},"text/calender":{"compressible":true},"text/cmd":{"compressible":true},"text/coffeescript":{"extensions":["coffee","litcoffee"]},"text/cql":{"source":"iana"},"text/cql-expression":{"source":"iana"},"text/cql-identifier":{"source":"iana"},"text/css":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["css"]},"text/csv":{"source":"iana","compressible":true,"extensions":["csv"]},"text/csv-schema":{"source":"iana"},"text/directory":{"source":"iana"},"text/dns":{"source":"iana"},"text/ecmascript":{"source":"iana"},"text/encaprtp":{"source":"iana"},"text/enriched":{"source":"iana"},"text/fhirpath":{"source":"iana"},"text/flexfec":{"source":"iana"},"text/fwdred":{"source":"iana"},"text/gff3":{"source":"iana"},"text/grammar-ref-list":{"source":"iana"},"text/html":{"source":"iana","compressible":true,"extensions":["html","htm","shtml"]},"text/jade":{"extensions":["jade"]},"text/javascript":{"source":"iana","compressible":true},"text/jcr-cnd":{"source":"iana"},"text/jsx":{"compressible":true,"extensions":["jsx"]},"text/less":{"compressible":true,"extensions":["less"]},"text/markdown":{"source":"iana","compressible":true,"extensions":["markdown","md"]},"text/mathml":{"source":"nginx","extensions":["mml"]},"text/mdx":{"compressible":true,"extensions":["mdx"]},"text/mizar":{"source":"iana"},"text/n3":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["n3"]},"text/parameters":{"source":"iana","charset":"UTF-8"},"text/parityfec":{"source":"iana"},"text/plain":{"source":"iana","compressible":true,"extensions":["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{"source":"iana","charset":"UTF-8"},"text/prs.fallenstein.rst":{"source":"iana"},"text/prs.lines.tag":{"source":"iana","extensions":["dsc"]},"text/prs.prop.logic":{"source":"iana"},"text/raptorfec":{"source":"iana"},"text/red":{"source":"iana"},"text/rfc822-headers":{"source":"iana"},"text/richtext":{"source":"iana","compressible":true,"extensions":["rtx"]},"text/rtf":{"source":"iana","compressible":true,"extensions":["rtf"]},"text/rtp-enc-aescm128":{"source":"iana"},"text/rtploopback":{"source":"iana"},"text/rtx":{"source":"iana"},"text/sgml":{"source":"iana","extensions":["sgml","sgm"]},"text/shaclc":{"source":"iana"},"text/shex":{"extensions":["shex"]},"text/slim":{"extensions":["slim","slm"]},"text/spdx":{"source":"iana","extensions":["spdx"]},"text/strings":{"source":"iana"},"text/stylus":{"extensions":["stylus","styl"]},"text/t140":{"source":"iana"},"text/tab-separated-values":{"source":"iana","compressible":true,"extensions":["tsv"]},"text/troff":{"source":"iana","extensions":["t","tr","roff","man","me","ms"]},"text/turtle":{"source":"iana","charset":"UTF-8","extensions":["ttl"]},"text/ulpfec":{"source":"iana"},"text/uri-list":{"source":"iana","compressible":true,"extensions":["uri","uris","urls"]},"text/vcard":{"source":"iana","compressible":true,"extensions":["vcard"]},"text/vnd.a":{"source":"iana"},"text/vnd.abc":{"source":"iana"},"text/vnd.ascii-art":{"source":"iana"},"text/vnd.curl":{"source":"iana","extensions":["curl"]},"text/vnd.curl.dcurl":{"source":"apache","extensions":["dcurl"]},"text/vnd.curl.mcurl":{"source":"apache","extensions":["mcurl"]},"text/vnd.curl.scurl":{"source":"apache","extensions":["scurl"]},"text/vnd.debian.copyright":{"source":"iana","charset":"UTF-8"},"text/vnd.dmclientscript":{"source":"iana"},"text/vnd.dvb.subtitle":{"source":"iana","extensions":["sub"]},"text/vnd.esmertec.theme-descriptor":{"source":"iana","charset":"UTF-8"},"text/vnd.ficlab.flt":{"source":"iana"},"text/vnd.fly":{"source":"iana","extensions":["fly"]},"text/vnd.fmi.flexstor":{"source":"iana","extensions":["flx"]},"text/vnd.gml":{"source":"iana"},"text/vnd.graphviz":{"source":"iana","extensions":["gv"]},"text/vnd.hans":{"source":"iana"},"text/vnd.hgl":{"source":"iana"},"text/vnd.in3d.3dml":{"source":"iana","extensions":["3dml"]},"text/vnd.in3d.spot":{"source":"iana","extensions":["spot"]},"text/vnd.iptc.newsml":{"source":"iana"},"text/vnd.iptc.nitf":{"source":"iana"},"text/vnd.latex-z":{"source":"iana"},"text/vnd.motorola.reflex":{"source":"iana"},"text/vnd.ms-mediapackage":{"source":"iana"},"text/vnd.net2phone.commcenter.command":{"source":"iana"},"text/vnd.radisys.msml-basic-layout":{"source":"iana"},"text/vnd.senx.warpscript":{"source":"iana"},"text/vnd.si.uricatalogue":{"source":"iana"},"text/vnd.sosi":{"source":"iana"},"text/vnd.sun.j2me.app-descriptor":{"source":"iana","charset":"UTF-8","extensions":["jad"]},"text/vnd.trolltech.linguist":{"source":"iana","charset":"UTF-8"},"text/vnd.wap.si":{"source":"iana"},"text/vnd.wap.sl":{"source":"iana"},"text/vnd.wap.wml":{"source":"iana","extensions":["wml"]},"text/vnd.wap.wmlscript":{"source":"iana","extensions":["wmls"]},"text/vtt":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["vtt"]},"text/x-asm":{"source":"apache","extensions":["s","asm"]},"text/x-c":{"source":"apache","extensions":["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{"source":"nginx","extensions":["htc"]},"text/x-fortran":{"source":"apache","extensions":["f","for","f77","f90"]},"text/x-gwt-rpc":{"compressible":true},"text/x-handlebars-template":{"extensions":["hbs"]},"text/x-java-source":{"source":"apache","extensions":["java"]},"text/x-jquery-tmpl":{"compressible":true},"text/x-lua":{"extensions":["lua"]},"text/x-markdown":{"compressible":true,"extensions":["mkd"]},"text/x-nfo":{"source":"apache","extensions":["nfo"]},"text/x-opml":{"source":"apache","extensions":["opml"]},"text/x-org":{"compressible":true,"extensions":["org"]},"text/x-pascal":{"source":"apache","extensions":["p","pas"]},"text/x-processing":{"compressible":true,"extensions":["pde"]},"text/x-sass":{"extensions":["sass"]},"text/x-scss":{"extensions":["scss"]},"text/x-setext":{"source":"apache","extensions":["etx"]},"text/x-sfv":{"source":"apache","extensions":["sfv"]},"text/x-suse-ymp":{"compressible":true,"extensions":["ymp"]},"text/x-uuencode":{"source":"apache","extensions":["uu"]},"text/x-vcalendar":{"source":"apache","extensions":["vcs"]},"text/x-vcard":{"source":"apache","extensions":["vcf"]},"text/xml":{"source":"iana","compressible":true,"extensions":["xml"]},"text/xml-external-parsed-entity":{"source":"iana"},"text/yaml":{"extensions":["yaml","yml"]},"video/1d-interleaved-parityfec":{"source":"iana"},"video/3gpp":{"source":"iana","extensions":["3gp","3gpp"]},"video/3gpp-tt":{"source":"iana"},"video/3gpp2":{"source":"iana","extensions":["3g2"]},"video/av1":{"source":"iana"},"video/bmpeg":{"source":"iana"},"video/bt656":{"source":"iana"},"video/celb":{"source":"iana"},"video/dv":{"source":"iana"},"video/encaprtp":{"source":"iana"},"video/ffv1":{"source":"iana"},"video/flexfec":{"source":"iana"},"video/h261":{"source":"iana","extensions":["h261"]},"video/h263":{"source":"iana","extensions":["h263"]},"video/h263-1998":{"source":"iana"},"video/h263-2000":{"source":"iana"},"video/h264":{"source":"iana","extensions":["h264"]},"video/h264-rcdo":{"source":"iana"},"video/h264-svc":{"source":"iana"},"video/h265":{"source":"iana"},"video/iso.segment":{"source":"iana","extensions":["m4s"]},"video/jpeg":{"source":"iana","extensions":["jpgv"]},"video/jpeg2000":{"source":"iana"},"video/jpm":{"source":"apache","extensions":["jpm","jpgm"]},"video/mj2":{"source":"iana","extensions":["mj2","mjp2"]},"video/mp1s":{"source":"iana"},"video/mp2p":{"source":"iana"},"video/mp2t":{"source":"iana","extensions":["ts"]},"video/mp4":{"source":"iana","compressible":false,"extensions":["mp4","mp4v","mpg4"]},"video/mp4v-es":{"source":"iana"},"video/mpeg":{"source":"iana","compressible":false,"extensions":["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{"source":"iana"},"video/mpv":{"source":"iana"},"video/nv":{"source":"iana"},"video/ogg":{"source":"iana","compressible":false,"extensions":["ogv"]},"video/parityfec":{"source":"iana"},"video/pointer":{"source":"iana"},"video/quicktime":{"source":"iana","compressible":false,"extensions":["qt","mov"]},"video/raptorfec":{"source":"iana"},"video/raw":{"source":"iana"},"video/rtp-enc-aescm128":{"source":"iana"},"video/rtploopback":{"source":"iana"},"video/rtx":{"source":"iana"},"video/scip":{"source":"iana"},"video/smpte291":{"source":"iana"},"video/smpte292m":{"source":"iana"},"video/ulpfec":{"source":"iana"},"video/vc1":{"source":"iana"},"video/vc2":{"source":"iana"},"video/vnd.cctv":{"source":"iana"},"video/vnd.dece.hd":{"source":"iana","extensions":["uvh","uvvh"]},"video/vnd.dece.mobile":{"source":"iana","extensions":["uvm","uvvm"]},"video/vnd.dece.mp4":{"source":"iana"},"video/vnd.dece.pd":{"source":"iana","extensions":["uvp","uvvp"]},"video/vnd.dece.sd":{"source":"iana","extensions":["uvs","uvvs"]},"video/vnd.dece.video":{"source":"iana","extensions":["uvv","uvvv"]},"video/vnd.directv.mpeg":{"source":"iana"},"video/vnd.directv.mpeg-tts":{"source":"iana"},"video/vnd.dlna.mpeg-tts":{"source":"iana"},"video/vnd.dvb.file":{"source":"iana","extensions":["dvb"]},"video/vnd.fvt":{"source":"iana","extensions":["fvt"]},"video/vnd.hns.video":{"source":"iana"},"video/vnd.iptvforum.1dparityfec-1010":{"source":"iana"},"video/vnd.iptvforum.1dparityfec-2005":{"source":"iana"},"video/vnd.iptvforum.2dparityfec-1010":{"source":"iana"},"video/vnd.iptvforum.2dparityfec-2005":{"source":"iana"},"video/vnd.iptvforum.ttsavc":{"source":"iana"},"video/vnd.iptvforum.ttsmpeg2":{"source":"iana"},"video/vnd.motorola.video":{"source":"iana"},"video/vnd.motorola.videop":{"source":"iana"},"video/vnd.mpegurl":{"source":"iana","extensions":["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{"source":"iana","extensions":["pyv"]},"video/vnd.nokia.interleaved-multimedia":{"source":"iana"},"video/vnd.nokia.mp4vr":{"source":"iana"},"video/vnd.nokia.videovoip":{"source":"iana"},"video/vnd.objectvideo":{"source":"iana"},"video/vnd.radgamettools.bink":{"source":"iana"},"video/vnd.radgamettools.smacker":{"source":"iana"},"video/vnd.sealed.mpeg1":{"source":"iana"},"video/vnd.sealed.mpeg4":{"source":"iana"},"video/vnd.sealed.swf":{"source":"iana"},"video/vnd.sealedmedia.softseal.mov":{"source":"iana"},"video/vnd.uvvu.mp4":{"source":"iana","extensions":["uvu","uvvu"]},"video/vnd.vivo":{"source":"iana","extensions":["viv"]},"video/vnd.youtube.yt":{"source":"iana"},"video/vp8":{"source":"iana"},"video/webm":{"source":"apache","compressible":false,"extensions":["webm"]},"video/x-f4v":{"source":"apache","extensions":["f4v"]},"video/x-fli":{"source":"apache","extensions":["fli"]},"video/x-flv":{"source":"apache","compressible":false,"extensions":["flv"]},"video/x-m4v":{"source":"apache","extensions":["m4v"]},"video/x-matroska":{"source":"apache","compressible":false,"extensions":["mkv","mk3d","mks"]},"video/x-mng":{"source":"apache","extensions":["mng"]},"video/x-ms-asf":{"source":"apache","extensions":["asf","asx"]},"video/x-ms-vob":{"source":"apache","extensions":["vob"]},"video/x-ms-wm":{"source":"apache","extensions":["wm"]},"video/x-ms-wmv":{"source":"apache","compressible":false,"extensions":["wmv"]},"video/x-ms-wmx":{"source":"apache","extensions":["wmx"]},"video/x-ms-wvx":{"source":"apache","extensions":["wvx"]},"video/x-msvideo":{"source":"apache","extensions":["avi"]},"video/x-sgi-movie":{"source":"apache","extensions":["movie"]},"video/x-smv":{"source":"apache","extensions":["smv"]},"x-conference/x-cooltalk":{"source":"apache","extensions":["ice"]},"x-shader/x-fragment":{"compressible":true},"x-shader/x-vertex":{"compressible":true}}'); +module.exports = JSON.parse('{"application/1d-interleaved-parityfec":{"source":"iana"},"application/3gpdash-qoe-report+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/3gpp-ims+xml":{"source":"iana","compressible":true},"application/3gpphal+json":{"source":"iana","compressible":true},"application/3gpphalforms+json":{"source":"iana","compressible":true},"application/a2l":{"source":"iana"},"application/activemessage":{"source":"iana"},"application/activity+json":{"source":"iana","compressible":true},"application/alto-costmap+json":{"source":"iana","compressible":true},"application/alto-costmapfilter+json":{"source":"iana","compressible":true},"application/alto-directory+json":{"source":"iana","compressible":true},"application/alto-endpointcost+json":{"source":"iana","compressible":true},"application/alto-endpointcostparams+json":{"source":"iana","compressible":true},"application/alto-endpointprop+json":{"source":"iana","compressible":true},"application/alto-endpointpropparams+json":{"source":"iana","compressible":true},"application/alto-error+json":{"source":"iana","compressible":true},"application/alto-networkmap+json":{"source":"iana","compressible":true},"application/alto-networkmapfilter+json":{"source":"iana","compressible":true},"application/alto-updatestreamcontrol+json":{"source":"iana","compressible":true},"application/alto-updatestreamparams+json":{"source":"iana","compressible":true},"application/aml":{"source":"iana"},"application/andrew-inset":{"source":"iana","extensions":["ez"]},"application/applefile":{"source":"iana"},"application/applixware":{"source":"apache","extensions":["aw"]},"application/atf":{"source":"iana"},"application/atfx":{"source":"iana"},"application/atom+xml":{"source":"iana","compressible":true,"extensions":["atom"]},"application/atomcat+xml":{"source":"iana","compressible":true,"extensions":["atomcat"]},"application/atomdeleted+xml":{"source":"iana","compressible":true,"extensions":["atomdeleted"]},"application/atomicmail":{"source":"iana"},"application/atomsvc+xml":{"source":"iana","compressible":true,"extensions":["atomsvc"]},"application/atsc-dwd+xml":{"source":"iana","compressible":true,"extensions":["dwd"]},"application/atsc-dynamic-event-message":{"source":"iana"},"application/atsc-held+xml":{"source":"iana","compressible":true,"extensions":["held"]},"application/atsc-rdt+json":{"source":"iana","compressible":true},"application/atsc-rsat+xml":{"source":"iana","compressible":true,"extensions":["rsat"]},"application/atxml":{"source":"iana"},"application/auth-policy+xml":{"source":"iana","compressible":true},"application/bacnet-xdd+zip":{"source":"iana","compressible":false},"application/batch-smtp":{"source":"iana"},"application/bdoc":{"compressible":false,"extensions":["bdoc"]},"application/beep+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/calendar+json":{"source":"iana","compressible":true},"application/calendar+xml":{"source":"iana","compressible":true,"extensions":["xcs"]},"application/call-completion":{"source":"iana"},"application/cals-1840":{"source":"iana"},"application/captive+json":{"source":"iana","compressible":true},"application/cbor":{"source":"iana"},"application/cbor-seq":{"source":"iana"},"application/cccex":{"source":"iana"},"application/ccmp+xml":{"source":"iana","compressible":true},"application/ccxml+xml":{"source":"iana","compressible":true,"extensions":["ccxml"]},"application/cdfx+xml":{"source":"iana","compressible":true,"extensions":["cdfx"]},"application/cdmi-capability":{"source":"iana","extensions":["cdmia"]},"application/cdmi-container":{"source":"iana","extensions":["cdmic"]},"application/cdmi-domain":{"source":"iana","extensions":["cdmid"]},"application/cdmi-object":{"source":"iana","extensions":["cdmio"]},"application/cdmi-queue":{"source":"iana","extensions":["cdmiq"]},"application/cdni":{"source":"iana"},"application/cea":{"source":"iana"},"application/cea-2018+xml":{"source":"iana","compressible":true},"application/cellml+xml":{"source":"iana","compressible":true},"application/cfw":{"source":"iana"},"application/clr":{"source":"iana"},"application/clue+xml":{"source":"iana","compressible":true},"application/clue_info+xml":{"source":"iana","compressible":true},"application/cms":{"source":"iana"},"application/cnrp+xml":{"source":"iana","compressible":true},"application/coap-group+json":{"source":"iana","compressible":true},"application/coap-payload":{"source":"iana"},"application/commonground":{"source":"iana"},"application/conference-info+xml":{"source":"iana","compressible":true},"application/cose":{"source":"iana"},"application/cose-key":{"source":"iana"},"application/cose-key-set":{"source":"iana"},"application/cpl+xml":{"source":"iana","compressible":true},"application/csrattrs":{"source":"iana"},"application/csta+xml":{"source":"iana","compressible":true},"application/cstadata+xml":{"source":"iana","compressible":true},"application/csvm+json":{"source":"iana","compressible":true},"application/cu-seeme":{"source":"apache","extensions":["cu"]},"application/cwt":{"source":"iana"},"application/cybercash":{"source":"iana"},"application/dart":{"compressible":true},"application/dash+xml":{"source":"iana","compressible":true,"extensions":["mpd"]},"application/dashdelta":{"source":"iana"},"application/davmount+xml":{"source":"iana","compressible":true,"extensions":["davmount"]},"application/dca-rft":{"source":"iana"},"application/dcd":{"source":"iana"},"application/dec-dx":{"source":"iana"},"application/dialog-info+xml":{"source":"iana","compressible":true},"application/dicom":{"source":"iana"},"application/dicom+json":{"source":"iana","compressible":true},"application/dicom+xml":{"source":"iana","compressible":true},"application/dii":{"source":"iana"},"application/dit":{"source":"iana"},"application/dns":{"source":"iana"},"application/dns+json":{"source":"iana","compressible":true},"application/dns-message":{"source":"iana"},"application/docbook+xml":{"source":"apache","compressible":true,"extensions":["dbk"]},"application/dots+cbor":{"source":"iana"},"application/dskpp+xml":{"source":"iana","compressible":true},"application/dssc+der":{"source":"iana","extensions":["dssc"]},"application/dssc+xml":{"source":"iana","compressible":true,"extensions":["xdssc"]},"application/dvcs":{"source":"iana"},"application/ecmascript":{"source":"iana","compressible":true,"extensions":["es","ecma"]},"application/edi-consent":{"source":"iana"},"application/edi-x12":{"source":"iana","compressible":false},"application/edifact":{"source":"iana","compressible":false},"application/efi":{"source":"iana"},"application/elm+json":{"source":"iana","charset":"UTF-8","compressible":true},"application/elm+xml":{"source":"iana","compressible":true},"application/emergencycalldata.cap+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/emergencycalldata.comment+xml":{"source":"iana","compressible":true},"application/emergencycalldata.control+xml":{"source":"iana","compressible":true},"application/emergencycalldata.deviceinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.ecall.msd":{"source":"iana"},"application/emergencycalldata.providerinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.serviceinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.subscriberinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.veds+xml":{"source":"iana","compressible":true},"application/emma+xml":{"source":"iana","compressible":true,"extensions":["emma"]},"application/emotionml+xml":{"source":"iana","compressible":true,"extensions":["emotionml"]},"application/encaprtp":{"source":"iana"},"application/epp+xml":{"source":"iana","compressible":true},"application/epub+zip":{"source":"iana","compressible":false,"extensions":["epub"]},"application/eshop":{"source":"iana"},"application/exi":{"source":"iana","extensions":["exi"]},"application/expect-ct-report+json":{"source":"iana","compressible":true},"application/fastinfoset":{"source":"iana"},"application/fastsoap":{"source":"iana"},"application/fdt+xml":{"source":"iana","compressible":true,"extensions":["fdt"]},"application/fhir+json":{"source":"iana","charset":"UTF-8","compressible":true},"application/fhir+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/fido.trusted-apps+json":{"compressible":true},"application/fits":{"source":"iana"},"application/flexfec":{"source":"iana"},"application/font-sfnt":{"source":"iana"},"application/font-tdpfr":{"source":"iana","extensions":["pfr"]},"application/font-woff":{"source":"iana","compressible":false},"application/framework-attributes+xml":{"source":"iana","compressible":true},"application/geo+json":{"source":"iana","compressible":true,"extensions":["geojson"]},"application/geo+json-seq":{"source":"iana"},"application/geopackage+sqlite3":{"source":"iana"},"application/geoxacml+xml":{"source":"iana","compressible":true},"application/gltf-buffer":{"source":"iana"},"application/gml+xml":{"source":"iana","compressible":true,"extensions":["gml"]},"application/gpx+xml":{"source":"apache","compressible":true,"extensions":["gpx"]},"application/gxf":{"source":"apache","extensions":["gxf"]},"application/gzip":{"source":"iana","compressible":false,"extensions":["gz"]},"application/h224":{"source":"iana"},"application/held+xml":{"source":"iana","compressible":true},"application/hjson":{"extensions":["hjson"]},"application/http":{"source":"iana"},"application/hyperstudio":{"source":"iana","extensions":["stk"]},"application/ibe-key-request+xml":{"source":"iana","compressible":true},"application/ibe-pkg-reply+xml":{"source":"iana","compressible":true},"application/ibe-pp-data":{"source":"iana"},"application/iges":{"source":"iana"},"application/im-iscomposing+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/index":{"source":"iana"},"application/index.cmd":{"source":"iana"},"application/index.obj":{"source":"iana"},"application/index.response":{"source":"iana"},"application/index.vnd":{"source":"iana"},"application/inkml+xml":{"source":"iana","compressible":true,"extensions":["ink","inkml"]},"application/iotp":{"source":"iana"},"application/ipfix":{"source":"iana","extensions":["ipfix"]},"application/ipp":{"source":"iana"},"application/isup":{"source":"iana"},"application/its+xml":{"source":"iana","compressible":true,"extensions":["its"]},"application/java-archive":{"source":"apache","compressible":false,"extensions":["jar","war","ear"]},"application/java-serialized-object":{"source":"apache","compressible":false,"extensions":["ser"]},"application/java-vm":{"source":"apache","compressible":false,"extensions":["class"]},"application/javascript":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["js","mjs"]},"application/jf2feed+json":{"source":"iana","compressible":true},"application/jose":{"source":"iana"},"application/jose+json":{"source":"iana","compressible":true},"application/jrd+json":{"source":"iana","compressible":true},"application/jscalendar+json":{"source":"iana","compressible":true},"application/json":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["json","map"]},"application/json-patch+json":{"source":"iana","compressible":true},"application/json-seq":{"source":"iana"},"application/json5":{"extensions":["json5"]},"application/jsonml+json":{"source":"apache","compressible":true,"extensions":["jsonml"]},"application/jwk+json":{"source":"iana","compressible":true},"application/jwk-set+json":{"source":"iana","compressible":true},"application/jwt":{"source":"iana"},"application/kpml-request+xml":{"source":"iana","compressible":true},"application/kpml-response+xml":{"source":"iana","compressible":true},"application/ld+json":{"source":"iana","compressible":true,"extensions":["jsonld"]},"application/lgr+xml":{"source":"iana","compressible":true,"extensions":["lgr"]},"application/link-format":{"source":"iana"},"application/load-control+xml":{"source":"iana","compressible":true},"application/lost+xml":{"source":"iana","compressible":true,"extensions":["lostxml"]},"application/lostsync+xml":{"source":"iana","compressible":true},"application/lpf+zip":{"source":"iana","compressible":false},"application/lxf":{"source":"iana"},"application/mac-binhex40":{"source":"iana","extensions":["hqx"]},"application/mac-compactpro":{"source":"apache","extensions":["cpt"]},"application/macwriteii":{"source":"iana"},"application/mads+xml":{"source":"iana","compressible":true,"extensions":["mads"]},"application/manifest+json":{"charset":"UTF-8","compressible":true,"extensions":["webmanifest"]},"application/marc":{"source":"iana","extensions":["mrc"]},"application/marcxml+xml":{"source":"iana","compressible":true,"extensions":["mrcx"]},"application/mathematica":{"source":"iana","extensions":["ma","nb","mb"]},"application/mathml+xml":{"source":"iana","compressible":true,"extensions":["mathml"]},"application/mathml-content+xml":{"source":"iana","compressible":true},"application/mathml-presentation+xml":{"source":"iana","compressible":true},"application/mbms-associated-procedure-description+xml":{"source":"iana","compressible":true},"application/mbms-deregister+xml":{"source":"iana","compressible":true},"application/mbms-envelope+xml":{"source":"iana","compressible":true},"application/mbms-msk+xml":{"source":"iana","compressible":true},"application/mbms-msk-response+xml":{"source":"iana","compressible":true},"application/mbms-protection-description+xml":{"source":"iana","compressible":true},"application/mbms-reception-report+xml":{"source":"iana","compressible":true},"application/mbms-register+xml":{"source":"iana","compressible":true},"application/mbms-register-response+xml":{"source":"iana","compressible":true},"application/mbms-schedule+xml":{"source":"iana","compressible":true},"application/mbms-user-service-description+xml":{"source":"iana","compressible":true},"application/mbox":{"source":"iana","extensions":["mbox"]},"application/media-policy-dataset+xml":{"source":"iana","compressible":true},"application/media_control+xml":{"source":"iana","compressible":true},"application/mediaservercontrol+xml":{"source":"iana","compressible":true,"extensions":["mscml"]},"application/merge-patch+json":{"source":"iana","compressible":true},"application/metalink+xml":{"source":"apache","compressible":true,"extensions":["metalink"]},"application/metalink4+xml":{"source":"iana","compressible":true,"extensions":["meta4"]},"application/mets+xml":{"source":"iana","compressible":true,"extensions":["mets"]},"application/mf4":{"source":"iana"},"application/mikey":{"source":"iana"},"application/mipc":{"source":"iana"},"application/mmt-aei+xml":{"source":"iana","compressible":true,"extensions":["maei"]},"application/mmt-usd+xml":{"source":"iana","compressible":true,"extensions":["musd"]},"application/mods+xml":{"source":"iana","compressible":true,"extensions":["mods"]},"application/moss-keys":{"source":"iana"},"application/moss-signature":{"source":"iana"},"application/mosskey-data":{"source":"iana"},"application/mosskey-request":{"source":"iana"},"application/mp21":{"source":"iana","extensions":["m21","mp21"]},"application/mp4":{"source":"iana","extensions":["mp4s","m4p"]},"application/mpeg4-generic":{"source":"iana"},"application/mpeg4-iod":{"source":"iana"},"application/mpeg4-iod-xmt":{"source":"iana"},"application/mrb-consumer+xml":{"source":"iana","compressible":true},"application/mrb-publish+xml":{"source":"iana","compressible":true},"application/msc-ivr+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/msc-mixer+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/msword":{"source":"iana","compressible":false,"extensions":["doc","dot"]},"application/mud+json":{"source":"iana","compressible":true},"application/multipart-core":{"source":"iana"},"application/mxf":{"source":"iana","extensions":["mxf"]},"application/n-quads":{"source":"iana","extensions":["nq"]},"application/n-triples":{"source":"iana","extensions":["nt"]},"application/nasdata":{"source":"iana"},"application/news-checkgroups":{"source":"iana","charset":"US-ASCII"},"application/news-groupinfo":{"source":"iana","charset":"US-ASCII"},"application/news-transmission":{"source":"iana"},"application/nlsml+xml":{"source":"iana","compressible":true},"application/node":{"source":"iana","extensions":["cjs"]},"application/nss":{"source":"iana"},"application/oauth-authz-req+jwt":{"source":"iana"},"application/ocsp-request":{"source":"iana"},"application/ocsp-response":{"source":"iana"},"application/octet-stream":{"source":"iana","compressible":false,"extensions":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{"source":"iana","extensions":["oda"]},"application/odm+xml":{"source":"iana","compressible":true},"application/odx":{"source":"iana"},"application/oebps-package+xml":{"source":"iana","compressible":true,"extensions":["opf"]},"application/ogg":{"source":"iana","compressible":false,"extensions":["ogx"]},"application/omdoc+xml":{"source":"apache","compressible":true,"extensions":["omdoc"]},"application/onenote":{"source":"apache","extensions":["onetoc","onetoc2","onetmp","onepkg"]},"application/opc-nodeset+xml":{"source":"iana","compressible":true},"application/oscore":{"source":"iana"},"application/oxps":{"source":"iana","extensions":["oxps"]},"application/p2p-overlay+xml":{"source":"iana","compressible":true,"extensions":["relo"]},"application/parityfec":{"source":"iana"},"application/passport":{"source":"iana"},"application/patch-ops-error+xml":{"source":"iana","compressible":true,"extensions":["xer"]},"application/pdf":{"source":"iana","compressible":false,"extensions":["pdf"]},"application/pdx":{"source":"iana"},"application/pem-certificate-chain":{"source":"iana"},"application/pgp-encrypted":{"source":"iana","compressible":false,"extensions":["pgp"]},"application/pgp-keys":{"source":"iana"},"application/pgp-signature":{"source":"iana","extensions":["asc","sig"]},"application/pics-rules":{"source":"apache","extensions":["prf"]},"application/pidf+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/pidf-diff+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/pkcs10":{"source":"iana","extensions":["p10"]},"application/pkcs12":{"source":"iana"},"application/pkcs7-mime":{"source":"iana","extensions":["p7m","p7c"]},"application/pkcs7-signature":{"source":"iana","extensions":["p7s"]},"application/pkcs8":{"source":"iana","extensions":["p8"]},"application/pkcs8-encrypted":{"source":"iana"},"application/pkix-attr-cert":{"source":"iana","extensions":["ac"]},"application/pkix-cert":{"source":"iana","extensions":["cer"]},"application/pkix-crl":{"source":"iana","extensions":["crl"]},"application/pkix-pkipath":{"source":"iana","extensions":["pkipath"]},"application/pkixcmp":{"source":"iana","extensions":["pki"]},"application/pls+xml":{"source":"iana","compressible":true,"extensions":["pls"]},"application/poc-settings+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/postscript":{"source":"iana","compressible":true,"extensions":["ai","eps","ps"]},"application/ppsp-tracker+json":{"source":"iana","compressible":true},"application/problem+json":{"source":"iana","compressible":true},"application/problem+xml":{"source":"iana","compressible":true},"application/provenance+xml":{"source":"iana","compressible":true,"extensions":["provx"]},"application/prs.alvestrand.titrax-sheet":{"source":"iana"},"application/prs.cww":{"source":"iana","extensions":["cww"]},"application/prs.cyn":{"source":"iana","charset":"7-BIT"},"application/prs.hpub+zip":{"source":"iana","compressible":false},"application/prs.nprend":{"source":"iana"},"application/prs.plucker":{"source":"iana"},"application/prs.rdf-xml-crypt":{"source":"iana"},"application/prs.xsf+xml":{"source":"iana","compressible":true},"application/pskc+xml":{"source":"iana","compressible":true,"extensions":["pskcxml"]},"application/pvd+json":{"source":"iana","compressible":true},"application/qsig":{"source":"iana"},"application/raml+yaml":{"compressible":true,"extensions":["raml"]},"application/raptorfec":{"source":"iana"},"application/rdap+json":{"source":"iana","compressible":true},"application/rdf+xml":{"source":"iana","compressible":true,"extensions":["rdf","owl"]},"application/reginfo+xml":{"source":"iana","compressible":true,"extensions":["rif"]},"application/relax-ng-compact-syntax":{"source":"iana","extensions":["rnc"]},"application/remote-printing":{"source":"iana"},"application/reputon+json":{"source":"iana","compressible":true},"application/resource-lists+xml":{"source":"iana","compressible":true,"extensions":["rl"]},"application/resource-lists-diff+xml":{"source":"iana","compressible":true,"extensions":["rld"]},"application/rfc+xml":{"source":"iana","compressible":true},"application/riscos":{"source":"iana"},"application/rlmi+xml":{"source":"iana","compressible":true},"application/rls-services+xml":{"source":"iana","compressible":true,"extensions":["rs"]},"application/route-apd+xml":{"source":"iana","compressible":true,"extensions":["rapd"]},"application/route-s-tsid+xml":{"source":"iana","compressible":true,"extensions":["sls"]},"application/route-usd+xml":{"source":"iana","compressible":true,"extensions":["rusd"]},"application/rpki-ghostbusters":{"source":"iana","extensions":["gbr"]},"application/rpki-manifest":{"source":"iana","extensions":["mft"]},"application/rpki-publication":{"source":"iana"},"application/rpki-roa":{"source":"iana","extensions":["roa"]},"application/rpki-updown":{"source":"iana"},"application/rsd+xml":{"source":"apache","compressible":true,"extensions":["rsd"]},"application/rss+xml":{"source":"apache","compressible":true,"extensions":["rss"]},"application/rtf":{"source":"iana","compressible":true,"extensions":["rtf"]},"application/rtploopback":{"source":"iana"},"application/rtx":{"source":"iana"},"application/samlassertion+xml":{"source":"iana","compressible":true},"application/samlmetadata+xml":{"source":"iana","compressible":true},"application/sarif+json":{"source":"iana","compressible":true},"application/sarif-external-properties+json":{"source":"iana","compressible":true},"application/sbe":{"source":"iana"},"application/sbml+xml":{"source":"iana","compressible":true,"extensions":["sbml"]},"application/scaip+xml":{"source":"iana","compressible":true},"application/scim+json":{"source":"iana","compressible":true},"application/scvp-cv-request":{"source":"iana","extensions":["scq"]},"application/scvp-cv-response":{"source":"iana","extensions":["scs"]},"application/scvp-vp-request":{"source":"iana","extensions":["spq"]},"application/scvp-vp-response":{"source":"iana","extensions":["spp"]},"application/sdp":{"source":"iana","extensions":["sdp"]},"application/secevent+jwt":{"source":"iana"},"application/senml+cbor":{"source":"iana"},"application/senml+json":{"source":"iana","compressible":true},"application/senml+xml":{"source":"iana","compressible":true,"extensions":["senmlx"]},"application/senml-etch+cbor":{"source":"iana"},"application/senml-etch+json":{"source":"iana","compressible":true},"application/senml-exi":{"source":"iana"},"application/sensml+cbor":{"source":"iana"},"application/sensml+json":{"source":"iana","compressible":true},"application/sensml+xml":{"source":"iana","compressible":true,"extensions":["sensmlx"]},"application/sensml-exi":{"source":"iana"},"application/sep+xml":{"source":"iana","compressible":true},"application/sep-exi":{"source":"iana"},"application/session-info":{"source":"iana"},"application/set-payment":{"source":"iana"},"application/set-payment-initiation":{"source":"iana","extensions":["setpay"]},"application/set-registration":{"source":"iana"},"application/set-registration-initiation":{"source":"iana","extensions":["setreg"]},"application/sgml":{"source":"iana"},"application/sgml-open-catalog":{"source":"iana"},"application/shf+xml":{"source":"iana","compressible":true,"extensions":["shf"]},"application/sieve":{"source":"iana","extensions":["siv","sieve"]},"application/simple-filter+xml":{"source":"iana","compressible":true},"application/simple-message-summary":{"source":"iana"},"application/simplesymbolcontainer":{"source":"iana"},"application/sipc":{"source":"iana"},"application/slate":{"source":"iana"},"application/smil":{"source":"iana"},"application/smil+xml":{"source":"iana","compressible":true,"extensions":["smi","smil"]},"application/smpte336m":{"source":"iana"},"application/soap+fastinfoset":{"source":"iana"},"application/soap+xml":{"source":"iana","compressible":true},"application/sparql-query":{"source":"iana","extensions":["rq"]},"application/sparql-results+xml":{"source":"iana","compressible":true,"extensions":["srx"]},"application/spirits-event+xml":{"source":"iana","compressible":true},"application/sql":{"source":"iana"},"application/srgs":{"source":"iana","extensions":["gram"]},"application/srgs+xml":{"source":"iana","compressible":true,"extensions":["grxml"]},"application/sru+xml":{"source":"iana","compressible":true,"extensions":["sru"]},"application/ssdl+xml":{"source":"apache","compressible":true,"extensions":["ssdl"]},"application/ssml+xml":{"source":"iana","compressible":true,"extensions":["ssml"]},"application/stix+json":{"source":"iana","compressible":true},"application/swid+xml":{"source":"iana","compressible":true,"extensions":["swidtag"]},"application/tamp-apex-update":{"source":"iana"},"application/tamp-apex-update-confirm":{"source":"iana"},"application/tamp-community-update":{"source":"iana"},"application/tamp-community-update-confirm":{"source":"iana"},"application/tamp-error":{"source":"iana"},"application/tamp-sequence-adjust":{"source":"iana"},"application/tamp-sequence-adjust-confirm":{"source":"iana"},"application/tamp-status-query":{"source":"iana"},"application/tamp-status-response":{"source":"iana"},"application/tamp-update":{"source":"iana"},"application/tamp-update-confirm":{"source":"iana"},"application/tar":{"compressible":true},"application/taxii+json":{"source":"iana","compressible":true},"application/td+json":{"source":"iana","compressible":true},"application/tei+xml":{"source":"iana","compressible":true,"extensions":["tei","teicorpus"]},"application/tetra_isi":{"source":"iana"},"application/thraud+xml":{"source":"iana","compressible":true,"extensions":["tfi"]},"application/timestamp-query":{"source":"iana"},"application/timestamp-reply":{"source":"iana"},"application/timestamped-data":{"source":"iana","extensions":["tsd"]},"application/tlsrpt+gzip":{"source":"iana"},"application/tlsrpt+json":{"source":"iana","compressible":true},"application/tnauthlist":{"source":"iana"},"application/toml":{"compressible":true,"extensions":["toml"]},"application/trickle-ice-sdpfrag":{"source":"iana"},"application/trig":{"source":"iana"},"application/ttml+xml":{"source":"iana","compressible":true,"extensions":["ttml"]},"application/tve-trigger":{"source":"iana"},"application/tzif":{"source":"iana"},"application/tzif-leap":{"source":"iana"},"application/ubjson":{"compressible":false,"extensions":["ubj"]},"application/ulpfec":{"source":"iana"},"application/urc-grpsheet+xml":{"source":"iana","compressible":true},"application/urc-ressheet+xml":{"source":"iana","compressible":true,"extensions":["rsheet"]},"application/urc-targetdesc+xml":{"source":"iana","compressible":true,"extensions":["td"]},"application/urc-uisocketdesc+xml":{"source":"iana","compressible":true},"application/vcard+json":{"source":"iana","compressible":true},"application/vcard+xml":{"source":"iana","compressible":true},"application/vemmi":{"source":"iana"},"application/vividence.scriptfile":{"source":"apache"},"application/vnd.1000minds.decision-model+xml":{"source":"iana","compressible":true,"extensions":["1km"]},"application/vnd.3gpp-prose+xml":{"source":"iana","compressible":true},"application/vnd.3gpp-prose-pc3ch+xml":{"source":"iana","compressible":true},"application/vnd.3gpp-v2x-local-service-information":{"source":"iana"},"application/vnd.3gpp.5gnas":{"source":"iana"},"application/vnd.3gpp.access-transfer-events+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.bsf+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.gmop+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.gtpc":{"source":"iana"},"application/vnd.3gpp.interworking-data":{"source":"iana"},"application/vnd.3gpp.lpp":{"source":"iana"},"application/vnd.3gpp.mc-signalling-ear":{"source":"iana"},"application/vnd.3gpp.mcdata-affiliation-command+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-payload":{"source":"iana"},"application/vnd.3gpp.mcdata-service-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-signalling":{"source":"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-user-profile+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-affiliation-command+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-floor-request+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-location-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-service-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-signed+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-ue-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-ue-init-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-user-profile+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-affiliation-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-location-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-service-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-transmission-request+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-ue-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-user-profile+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mid-call+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.ngap":{"source":"iana"},"application/vnd.3gpp.pfcp":{"source":"iana"},"application/vnd.3gpp.pic-bw-large":{"source":"iana","extensions":["plb"]},"application/vnd.3gpp.pic-bw-small":{"source":"iana","extensions":["psb"]},"application/vnd.3gpp.pic-bw-var":{"source":"iana","extensions":["pvb"]},"application/vnd.3gpp.s1ap":{"source":"iana"},"application/vnd.3gpp.sms":{"source":"iana"},"application/vnd.3gpp.sms+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.srvcc-ext+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.srvcc-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.state-and-event-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.ussd+xml":{"source":"iana","compressible":true},"application/vnd.3gpp2.bcmcsinfo+xml":{"source":"iana","compressible":true},"application/vnd.3gpp2.sms":{"source":"iana"},"application/vnd.3gpp2.tcap":{"source":"iana","extensions":["tcap"]},"application/vnd.3lightssoftware.imagescal":{"source":"iana"},"application/vnd.3m.post-it-notes":{"source":"iana","extensions":["pwn"]},"application/vnd.accpac.simply.aso":{"source":"iana","extensions":["aso"]},"application/vnd.accpac.simply.imp":{"source":"iana","extensions":["imp"]},"application/vnd.acucobol":{"source":"iana","extensions":["acu"]},"application/vnd.acucorp":{"source":"iana","extensions":["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{"source":"apache","compressible":false,"extensions":["air"]},"application/vnd.adobe.flash.movie":{"source":"iana"},"application/vnd.adobe.formscentral.fcdt":{"source":"iana","extensions":["fcdt"]},"application/vnd.adobe.fxp":{"source":"iana","extensions":["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{"source":"iana"},"application/vnd.adobe.xdp+xml":{"source":"iana","compressible":true,"extensions":["xdp"]},"application/vnd.adobe.xfdf":{"source":"iana","extensions":["xfdf"]},"application/vnd.aether.imp":{"source":"iana"},"application/vnd.afpc.afplinedata":{"source":"iana"},"application/vnd.afpc.afplinedata-pagedef":{"source":"iana"},"application/vnd.afpc.cmoca-cmresource":{"source":"iana"},"application/vnd.afpc.foca-charset":{"source":"iana"},"application/vnd.afpc.foca-codedfont":{"source":"iana"},"application/vnd.afpc.foca-codepage":{"source":"iana"},"application/vnd.afpc.modca":{"source":"iana"},"application/vnd.afpc.modca-cmtable":{"source":"iana"},"application/vnd.afpc.modca-formdef":{"source":"iana"},"application/vnd.afpc.modca-mediummap":{"source":"iana"},"application/vnd.afpc.modca-objectcontainer":{"source":"iana"},"application/vnd.afpc.modca-overlay":{"source":"iana"},"application/vnd.afpc.modca-pagesegment":{"source":"iana"},"application/vnd.ah-barcode":{"source":"iana"},"application/vnd.ahead.space":{"source":"iana","extensions":["ahead"]},"application/vnd.airzip.filesecure.azf":{"source":"iana","extensions":["azf"]},"application/vnd.airzip.filesecure.azs":{"source":"iana","extensions":["azs"]},"application/vnd.amadeus+json":{"source":"iana","compressible":true},"application/vnd.amazon.ebook":{"source":"apache","extensions":["azw"]},"application/vnd.amazon.mobi8-ebook":{"source":"iana"},"application/vnd.americandynamics.acc":{"source":"iana","extensions":["acc"]},"application/vnd.amiga.ami":{"source":"iana","extensions":["ami"]},"application/vnd.amundsen.maze+xml":{"source":"iana","compressible":true},"application/vnd.android.ota":{"source":"iana"},"application/vnd.android.package-archive":{"source":"apache","compressible":false,"extensions":["apk"]},"application/vnd.anki":{"source":"iana"},"application/vnd.anser-web-certificate-issue-initiation":{"source":"iana","extensions":["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{"source":"apache","extensions":["fti"]},"application/vnd.antix.game-component":{"source":"iana","extensions":["atx"]},"application/vnd.apache.thrift.binary":{"source":"iana"},"application/vnd.apache.thrift.compact":{"source":"iana"},"application/vnd.apache.thrift.json":{"source":"iana"},"application/vnd.api+json":{"source":"iana","compressible":true},"application/vnd.aplextor.warrp+json":{"source":"iana","compressible":true},"application/vnd.apothekende.reservation+json":{"source":"iana","compressible":true},"application/vnd.apple.installer+xml":{"source":"iana","compressible":true,"extensions":["mpkg"]},"application/vnd.apple.keynote":{"source":"iana","extensions":["key"]},"application/vnd.apple.mpegurl":{"source":"iana","extensions":["m3u8"]},"application/vnd.apple.numbers":{"source":"iana","extensions":["numbers"]},"application/vnd.apple.pages":{"source":"iana","extensions":["pages"]},"application/vnd.apple.pkpass":{"compressible":false,"extensions":["pkpass"]},"application/vnd.arastra.swi":{"source":"iana"},"application/vnd.aristanetworks.swi":{"source":"iana","extensions":["swi"]},"application/vnd.artisan+json":{"source":"iana","compressible":true},"application/vnd.artsquare":{"source":"iana"},"application/vnd.astraea-software.iota":{"source":"iana","extensions":["iota"]},"application/vnd.audiograph":{"source":"iana","extensions":["aep"]},"application/vnd.autopackage":{"source":"iana"},"application/vnd.avalon+json":{"source":"iana","compressible":true},"application/vnd.avistar+xml":{"source":"iana","compressible":true},"application/vnd.balsamiq.bmml+xml":{"source":"iana","compressible":true,"extensions":["bmml"]},"application/vnd.balsamiq.bmpr":{"source":"iana"},"application/vnd.banana-accounting":{"source":"iana"},"application/vnd.bbf.usp.error":{"source":"iana"},"application/vnd.bbf.usp.msg":{"source":"iana"},"application/vnd.bbf.usp.msg+json":{"source":"iana","compressible":true},"application/vnd.bekitzur-stech+json":{"source":"iana","compressible":true},"application/vnd.bint.med-content":{"source":"iana"},"application/vnd.biopax.rdf+xml":{"source":"iana","compressible":true},"application/vnd.blink-idb-value-wrapper":{"source":"iana"},"application/vnd.blueice.multipass":{"source":"iana","extensions":["mpm"]},"application/vnd.bluetooth.ep.oob":{"source":"iana"},"application/vnd.bluetooth.le.oob":{"source":"iana"},"application/vnd.bmi":{"source":"iana","extensions":["bmi"]},"application/vnd.bpf":{"source":"iana"},"application/vnd.bpf3":{"source":"iana"},"application/vnd.businessobjects":{"source":"iana","extensions":["rep"]},"application/vnd.byu.uapi+json":{"source":"iana","compressible":true},"application/vnd.cab-jscript":{"source":"iana"},"application/vnd.canon-cpdl":{"source":"iana"},"application/vnd.canon-lips":{"source":"iana"},"application/vnd.capasystems-pg+json":{"source":"iana","compressible":true},"application/vnd.cendio.thinlinc.clientconf":{"source":"iana"},"application/vnd.century-systems.tcp_stream":{"source":"iana"},"application/vnd.chemdraw+xml":{"source":"iana","compressible":true,"extensions":["cdxml"]},"application/vnd.chess-pgn":{"source":"iana"},"application/vnd.chipnuts.karaoke-mmd":{"source":"iana","extensions":["mmd"]},"application/vnd.ciedi":{"source":"iana"},"application/vnd.cinderella":{"source":"iana","extensions":["cdy"]},"application/vnd.cirpack.isdn-ext":{"source":"iana"},"application/vnd.citationstyles.style+xml":{"source":"iana","compressible":true,"extensions":["csl"]},"application/vnd.claymore":{"source":"iana","extensions":["cla"]},"application/vnd.cloanto.rp9":{"source":"iana","extensions":["rp9"]},"application/vnd.clonk.c4group":{"source":"iana","extensions":["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{"source":"iana","extensions":["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{"source":"iana","extensions":["c11amz"]},"application/vnd.coffeescript":{"source":"iana"},"application/vnd.collabio.xodocuments.document":{"source":"iana"},"application/vnd.collabio.xodocuments.document-template":{"source":"iana"},"application/vnd.collabio.xodocuments.presentation":{"source":"iana"},"application/vnd.collabio.xodocuments.presentation-template":{"source":"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{"source":"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{"source":"iana"},"application/vnd.collection+json":{"source":"iana","compressible":true},"application/vnd.collection.doc+json":{"source":"iana","compressible":true},"application/vnd.collection.next+json":{"source":"iana","compressible":true},"application/vnd.comicbook+zip":{"source":"iana","compressible":false},"application/vnd.comicbook-rar":{"source":"iana"},"application/vnd.commerce-battelle":{"source":"iana"},"application/vnd.commonspace":{"source":"iana","extensions":["csp"]},"application/vnd.contact.cmsg":{"source":"iana","extensions":["cdbcmsg"]},"application/vnd.coreos.ignition+json":{"source":"iana","compressible":true},"application/vnd.cosmocaller":{"source":"iana","extensions":["cmc"]},"application/vnd.crick.clicker":{"source":"iana","extensions":["clkx"]},"application/vnd.crick.clicker.keyboard":{"source":"iana","extensions":["clkk"]},"application/vnd.crick.clicker.palette":{"source":"iana","extensions":["clkp"]},"application/vnd.crick.clicker.template":{"source":"iana","extensions":["clkt"]},"application/vnd.crick.clicker.wordbank":{"source":"iana","extensions":["clkw"]},"application/vnd.criticaltools.wbs+xml":{"source":"iana","compressible":true,"extensions":["wbs"]},"application/vnd.cryptii.pipe+json":{"source":"iana","compressible":true},"application/vnd.crypto-shade-file":{"source":"iana"},"application/vnd.cryptomator.encrypted":{"source":"iana"},"application/vnd.cryptomator.vault":{"source":"iana"},"application/vnd.ctc-posml":{"source":"iana","extensions":["pml"]},"application/vnd.ctct.ws+xml":{"source":"iana","compressible":true},"application/vnd.cups-pdf":{"source":"iana"},"application/vnd.cups-postscript":{"source":"iana"},"application/vnd.cups-ppd":{"source":"iana","extensions":["ppd"]},"application/vnd.cups-raster":{"source":"iana"},"application/vnd.cups-raw":{"source":"iana"},"application/vnd.curl":{"source":"iana"},"application/vnd.curl.car":{"source":"apache","extensions":["car"]},"application/vnd.curl.pcurl":{"source":"apache","extensions":["pcurl"]},"application/vnd.cyan.dean.root+xml":{"source":"iana","compressible":true},"application/vnd.cybank":{"source":"iana"},"application/vnd.cyclonedx+json":{"source":"iana","compressible":true},"application/vnd.cyclonedx+xml":{"source":"iana","compressible":true},"application/vnd.d2l.coursepackage1p0+zip":{"source":"iana","compressible":false},"application/vnd.d3m-dataset":{"source":"iana"},"application/vnd.d3m-problem":{"source":"iana"},"application/vnd.dart":{"source":"iana","compressible":true,"extensions":["dart"]},"application/vnd.data-vision.rdz":{"source":"iana","extensions":["rdz"]},"application/vnd.datapackage+json":{"source":"iana","compressible":true},"application/vnd.dataresource+json":{"source":"iana","compressible":true},"application/vnd.dbf":{"source":"iana","extensions":["dbf"]},"application/vnd.debian.binary-package":{"source":"iana"},"application/vnd.dece.data":{"source":"iana","extensions":["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{"source":"iana","compressible":true,"extensions":["uvt","uvvt"]},"application/vnd.dece.unspecified":{"source":"iana","extensions":["uvx","uvvx"]},"application/vnd.dece.zip":{"source":"iana","extensions":["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{"source":"iana","extensions":["fe_launch"]},"application/vnd.desmume.movie":{"source":"iana"},"application/vnd.dir-bi.plate-dl-nosuffix":{"source":"iana"},"application/vnd.dm.delegation+xml":{"source":"iana","compressible":true},"application/vnd.dna":{"source":"iana","extensions":["dna"]},"application/vnd.document+json":{"source":"iana","compressible":true},"application/vnd.dolby.mlp":{"source":"apache","extensions":["mlp"]},"application/vnd.dolby.mobile.1":{"source":"iana"},"application/vnd.dolby.mobile.2":{"source":"iana"},"application/vnd.doremir.scorecloud-binary-document":{"source":"iana"},"application/vnd.dpgraph":{"source":"iana","extensions":["dpg"]},"application/vnd.dreamfactory":{"source":"iana","extensions":["dfac"]},"application/vnd.drive+json":{"source":"iana","compressible":true},"application/vnd.ds-keypoint":{"source":"apache","extensions":["kpxx"]},"application/vnd.dtg.local":{"source":"iana"},"application/vnd.dtg.local.flash":{"source":"iana"},"application/vnd.dtg.local.html":{"source":"iana"},"application/vnd.dvb.ait":{"source":"iana","extensions":["ait"]},"application/vnd.dvb.dvbisl+xml":{"source":"iana","compressible":true},"application/vnd.dvb.dvbj":{"source":"iana"},"application/vnd.dvb.esgcontainer":{"source":"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{"source":"iana"},"application/vnd.dvb.ipdcesgaccess":{"source":"iana"},"application/vnd.dvb.ipdcesgaccess2":{"source":"iana"},"application/vnd.dvb.ipdcesgpdd":{"source":"iana"},"application/vnd.dvb.ipdcroaming":{"source":"iana"},"application/vnd.dvb.iptv.alfec-base":{"source":"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{"source":"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-container+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-generic+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-ia-msglist+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-ia-registration-request+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-ia-registration-response+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-init+xml":{"source":"iana","compressible":true},"application/vnd.dvb.pfr":{"source":"iana"},"application/vnd.dvb.service":{"source":"iana","extensions":["svc"]},"application/vnd.dxr":{"source":"iana"},"application/vnd.dynageo":{"source":"iana","extensions":["geo"]},"application/vnd.dzr":{"source":"iana"},"application/vnd.easykaraoke.cdgdownload":{"source":"iana"},"application/vnd.ecdis-update":{"source":"iana"},"application/vnd.ecip.rlp":{"source":"iana"},"application/vnd.ecowin.chart":{"source":"iana","extensions":["mag"]},"application/vnd.ecowin.filerequest":{"source":"iana"},"application/vnd.ecowin.fileupdate":{"source":"iana"},"application/vnd.ecowin.series":{"source":"iana"},"application/vnd.ecowin.seriesrequest":{"source":"iana"},"application/vnd.ecowin.seriesupdate":{"source":"iana"},"application/vnd.efi.img":{"source":"iana"},"application/vnd.efi.iso":{"source":"iana"},"application/vnd.emclient.accessrequest+xml":{"source":"iana","compressible":true},"application/vnd.enliven":{"source":"iana","extensions":["nml"]},"application/vnd.enphase.envoy":{"source":"iana"},"application/vnd.eprints.data+xml":{"source":"iana","compressible":true},"application/vnd.epson.esf":{"source":"iana","extensions":["esf"]},"application/vnd.epson.msf":{"source":"iana","extensions":["msf"]},"application/vnd.epson.quickanime":{"source":"iana","extensions":["qam"]},"application/vnd.epson.salt":{"source":"iana","extensions":["slt"]},"application/vnd.epson.ssf":{"source":"iana","extensions":["ssf"]},"application/vnd.ericsson.quickcall":{"source":"iana"},"application/vnd.espass-espass+zip":{"source":"iana","compressible":false},"application/vnd.eszigno3+xml":{"source":"iana","compressible":true,"extensions":["es3","et3"]},"application/vnd.etsi.aoc+xml":{"source":"iana","compressible":true},"application/vnd.etsi.asic-e+zip":{"source":"iana","compressible":false},"application/vnd.etsi.asic-s+zip":{"source":"iana","compressible":false},"application/vnd.etsi.cug+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvcommand+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvdiscovery+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvprofile+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsad-bc+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsad-cod+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsad-npvr+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvservice+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsync+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvueprofile+xml":{"source":"iana","compressible":true},"application/vnd.etsi.mcid+xml":{"source":"iana","compressible":true},"application/vnd.etsi.mheg5":{"source":"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{"source":"iana","compressible":true},"application/vnd.etsi.pstn+xml":{"source":"iana","compressible":true},"application/vnd.etsi.sci+xml":{"source":"iana","compressible":true},"application/vnd.etsi.simservs+xml":{"source":"iana","compressible":true},"application/vnd.etsi.timestamp-token":{"source":"iana"},"application/vnd.etsi.tsl+xml":{"source":"iana","compressible":true},"application/vnd.etsi.tsl.der":{"source":"iana"},"application/vnd.eudora.data":{"source":"iana"},"application/vnd.evolv.ecig.profile":{"source":"iana"},"application/vnd.evolv.ecig.settings":{"source":"iana"},"application/vnd.evolv.ecig.theme":{"source":"iana"},"application/vnd.exstream-empower+zip":{"source":"iana","compressible":false},"application/vnd.exstream-package":{"source":"iana"},"application/vnd.ezpix-album":{"source":"iana","extensions":["ez2"]},"application/vnd.ezpix-package":{"source":"iana","extensions":["ez3"]},"application/vnd.f-secure.mobile":{"source":"iana"},"application/vnd.fastcopy-disk-image":{"source":"iana"},"application/vnd.fdf":{"source":"iana","extensions":["fdf"]},"application/vnd.fdsn.mseed":{"source":"iana","extensions":["mseed"]},"application/vnd.fdsn.seed":{"source":"iana","extensions":["seed","dataless"]},"application/vnd.ffsns":{"source":"iana"},"application/vnd.ficlab.flb+zip":{"source":"iana","compressible":false},"application/vnd.filmit.zfc":{"source":"iana"},"application/vnd.fints":{"source":"iana"},"application/vnd.firemonkeys.cloudcell":{"source":"iana"},"application/vnd.flographit":{"source":"iana","extensions":["gph"]},"application/vnd.fluxtime.clip":{"source":"iana","extensions":["ftc"]},"application/vnd.font-fontforge-sfd":{"source":"iana"},"application/vnd.framemaker":{"source":"iana","extensions":["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{"source":"iana","extensions":["fnc"]},"application/vnd.frogans.ltf":{"source":"iana","extensions":["ltf"]},"application/vnd.fsc.weblaunch":{"source":"iana","extensions":["fsc"]},"application/vnd.fujifilm.fb.docuworks":{"source":"iana"},"application/vnd.fujifilm.fb.docuworks.binder":{"source":"iana"},"application/vnd.fujifilm.fb.docuworks.container":{"source":"iana"},"application/vnd.fujifilm.fb.jfi+xml":{"source":"iana","compressible":true},"application/vnd.fujitsu.oasys":{"source":"iana","extensions":["oas"]},"application/vnd.fujitsu.oasys2":{"source":"iana","extensions":["oa2"]},"application/vnd.fujitsu.oasys3":{"source":"iana","extensions":["oa3"]},"application/vnd.fujitsu.oasysgp":{"source":"iana","extensions":["fg5"]},"application/vnd.fujitsu.oasysprs":{"source":"iana","extensions":["bh2"]},"application/vnd.fujixerox.art-ex":{"source":"iana"},"application/vnd.fujixerox.art4":{"source":"iana"},"application/vnd.fujixerox.ddd":{"source":"iana","extensions":["ddd"]},"application/vnd.fujixerox.docuworks":{"source":"iana","extensions":["xdw"]},"application/vnd.fujixerox.docuworks.binder":{"source":"iana","extensions":["xbd"]},"application/vnd.fujixerox.docuworks.container":{"source":"iana"},"application/vnd.fujixerox.hbpl":{"source":"iana"},"application/vnd.fut-misnet":{"source":"iana"},"application/vnd.futoin+cbor":{"source":"iana"},"application/vnd.futoin+json":{"source":"iana","compressible":true},"application/vnd.fuzzysheet":{"source":"iana","extensions":["fzs"]},"application/vnd.genomatix.tuxedo":{"source":"iana","extensions":["txd"]},"application/vnd.gentics.grd+json":{"source":"iana","compressible":true},"application/vnd.geo+json":{"source":"iana","compressible":true},"application/vnd.geocube+xml":{"source":"iana","compressible":true},"application/vnd.geogebra.file":{"source":"iana","extensions":["ggb"]},"application/vnd.geogebra.slides":{"source":"iana"},"application/vnd.geogebra.tool":{"source":"iana","extensions":["ggt"]},"application/vnd.geometry-explorer":{"source":"iana","extensions":["gex","gre"]},"application/vnd.geonext":{"source":"iana","extensions":["gxt"]},"application/vnd.geoplan":{"source":"iana","extensions":["g2w"]},"application/vnd.geospace":{"source":"iana","extensions":["g3w"]},"application/vnd.gerber":{"source":"iana"},"application/vnd.globalplatform.card-content-mgt":{"source":"iana"},"application/vnd.globalplatform.card-content-mgt-response":{"source":"iana"},"application/vnd.gmx":{"source":"iana","extensions":["gmx"]},"application/vnd.google-apps.document":{"compressible":false,"extensions":["gdoc"]},"application/vnd.google-apps.presentation":{"compressible":false,"extensions":["gslides"]},"application/vnd.google-apps.spreadsheet":{"compressible":false,"extensions":["gsheet"]},"application/vnd.google-earth.kml+xml":{"source":"iana","compressible":true,"extensions":["kml"]},"application/vnd.google-earth.kmz":{"source":"iana","compressible":false,"extensions":["kmz"]},"application/vnd.gov.sk.e-form+xml":{"source":"iana","compressible":true},"application/vnd.gov.sk.e-form+zip":{"source":"iana","compressible":false},"application/vnd.gov.sk.xmldatacontainer+xml":{"source":"iana","compressible":true},"application/vnd.grafeq":{"source":"iana","extensions":["gqf","gqs"]},"application/vnd.gridmp":{"source":"iana"},"application/vnd.groove-account":{"source":"iana","extensions":["gac"]},"application/vnd.groove-help":{"source":"iana","extensions":["ghf"]},"application/vnd.groove-identity-message":{"source":"iana","extensions":["gim"]},"application/vnd.groove-injector":{"source":"iana","extensions":["grv"]},"application/vnd.groove-tool-message":{"source":"iana","extensions":["gtm"]},"application/vnd.groove-tool-template":{"source":"iana","extensions":["tpl"]},"application/vnd.groove-vcard":{"source":"iana","extensions":["vcg"]},"application/vnd.hal+json":{"source":"iana","compressible":true},"application/vnd.hal+xml":{"source":"iana","compressible":true,"extensions":["hal"]},"application/vnd.handheld-entertainment+xml":{"source":"iana","compressible":true,"extensions":["zmm"]},"application/vnd.hbci":{"source":"iana","extensions":["hbci"]},"application/vnd.hc+json":{"source":"iana","compressible":true},"application/vnd.hcl-bireports":{"source":"iana"},"application/vnd.hdt":{"source":"iana"},"application/vnd.heroku+json":{"source":"iana","compressible":true},"application/vnd.hhe.lesson-player":{"source":"iana","extensions":["les"]},"application/vnd.hp-hpgl":{"source":"iana","extensions":["hpgl"]},"application/vnd.hp-hpid":{"source":"iana","extensions":["hpid"]},"application/vnd.hp-hps":{"source":"iana","extensions":["hps"]},"application/vnd.hp-jlyt":{"source":"iana","extensions":["jlt"]},"application/vnd.hp-pcl":{"source":"iana","extensions":["pcl"]},"application/vnd.hp-pclxl":{"source":"iana","extensions":["pclxl"]},"application/vnd.httphone":{"source":"iana"},"application/vnd.hydrostatix.sof-data":{"source":"iana","extensions":["sfd-hdstx"]},"application/vnd.hyper+json":{"source":"iana","compressible":true},"application/vnd.hyper-item+json":{"source":"iana","compressible":true},"application/vnd.hyperdrive+json":{"source":"iana","compressible":true},"application/vnd.hzn-3d-crossword":{"source":"iana"},"application/vnd.ibm.afplinedata":{"source":"iana"},"application/vnd.ibm.electronic-media":{"source":"iana"},"application/vnd.ibm.minipay":{"source":"iana","extensions":["mpy"]},"application/vnd.ibm.modcap":{"source":"iana","extensions":["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{"source":"iana","extensions":["irm"]},"application/vnd.ibm.secure-container":{"source":"iana","extensions":["sc"]},"application/vnd.iccprofile":{"source":"iana","extensions":["icc","icm"]},"application/vnd.ieee.1905":{"source":"iana"},"application/vnd.igloader":{"source":"iana","extensions":["igl"]},"application/vnd.imagemeter.folder+zip":{"source":"iana","compressible":false},"application/vnd.imagemeter.image+zip":{"source":"iana","compressible":false},"application/vnd.immervision-ivp":{"source":"iana","extensions":["ivp"]},"application/vnd.immervision-ivu":{"source":"iana","extensions":["ivu"]},"application/vnd.ims.imsccv1p1":{"source":"iana"},"application/vnd.ims.imsccv1p2":{"source":"iana"},"application/vnd.ims.imsccv1p3":{"source":"iana"},"application/vnd.ims.lis.v2.result+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolproxy+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolproxy.id+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolsettings+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolsettings.simple+json":{"source":"iana","compressible":true},"application/vnd.informedcontrol.rms+xml":{"source":"iana","compressible":true},"application/vnd.informix-visionary":{"source":"iana"},"application/vnd.infotech.project":{"source":"iana"},"application/vnd.infotech.project+xml":{"source":"iana","compressible":true},"application/vnd.innopath.wamp.notification":{"source":"iana"},"application/vnd.insors.igm":{"source":"iana","extensions":["igm"]},"application/vnd.intercon.formnet":{"source":"iana","extensions":["xpw","xpx"]},"application/vnd.intergeo":{"source":"iana","extensions":["i2g"]},"application/vnd.intertrust.digibox":{"source":"iana"},"application/vnd.intertrust.nncp":{"source":"iana"},"application/vnd.intu.qbo":{"source":"iana","extensions":["qbo"]},"application/vnd.intu.qfx":{"source":"iana","extensions":["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.conceptitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.knowledgeitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.newsitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.newsmessage+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.packageitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.planningitem+xml":{"source":"iana","compressible":true},"application/vnd.ipunplugged.rcprofile":{"source":"iana","extensions":["rcprofile"]},"application/vnd.irepository.package+xml":{"source":"iana","compressible":true,"extensions":["irp"]},"application/vnd.is-xpr":{"source":"iana","extensions":["xpr"]},"application/vnd.isac.fcs":{"source":"iana","extensions":["fcs"]},"application/vnd.iso11783-10+zip":{"source":"iana","compressible":false},"application/vnd.jam":{"source":"iana","extensions":["jam"]},"application/vnd.japannet-directory-service":{"source":"iana"},"application/vnd.japannet-jpnstore-wakeup":{"source":"iana"},"application/vnd.japannet-payment-wakeup":{"source":"iana"},"application/vnd.japannet-registration":{"source":"iana"},"application/vnd.japannet-registration-wakeup":{"source":"iana"},"application/vnd.japannet-setstore-wakeup":{"source":"iana"},"application/vnd.japannet-verification":{"source":"iana"},"application/vnd.japannet-verification-wakeup":{"source":"iana"},"application/vnd.jcp.javame.midlet-rms":{"source":"iana","extensions":["rms"]},"application/vnd.jisp":{"source":"iana","extensions":["jisp"]},"application/vnd.joost.joda-archive":{"source":"iana","extensions":["joda"]},"application/vnd.jsk.isdn-ngn":{"source":"iana"},"application/vnd.kahootz":{"source":"iana","extensions":["ktz","ktr"]},"application/vnd.kde.karbon":{"source":"iana","extensions":["karbon"]},"application/vnd.kde.kchart":{"source":"iana","extensions":["chrt"]},"application/vnd.kde.kformula":{"source":"iana","extensions":["kfo"]},"application/vnd.kde.kivio":{"source":"iana","extensions":["flw"]},"application/vnd.kde.kontour":{"source":"iana","extensions":["kon"]},"application/vnd.kde.kpresenter":{"source":"iana","extensions":["kpr","kpt"]},"application/vnd.kde.kspread":{"source":"iana","extensions":["ksp"]},"application/vnd.kde.kword":{"source":"iana","extensions":["kwd","kwt"]},"application/vnd.kenameaapp":{"source":"iana","extensions":["htke"]},"application/vnd.kidspiration":{"source":"iana","extensions":["kia"]},"application/vnd.kinar":{"source":"iana","extensions":["kne","knp"]},"application/vnd.koan":{"source":"iana","extensions":["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{"source":"iana","extensions":["sse"]},"application/vnd.las":{"source":"iana"},"application/vnd.las.las+json":{"source":"iana","compressible":true},"application/vnd.las.las+xml":{"source":"iana","compressible":true,"extensions":["lasxml"]},"application/vnd.laszip":{"source":"iana"},"application/vnd.leap+json":{"source":"iana","compressible":true},"application/vnd.liberty-request+xml":{"source":"iana","compressible":true},"application/vnd.llamagraphics.life-balance.desktop":{"source":"iana","extensions":["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{"source":"iana","compressible":true,"extensions":["lbe"]},"application/vnd.logipipe.circuit+zip":{"source":"iana","compressible":false},"application/vnd.loom":{"source":"iana"},"application/vnd.lotus-1-2-3":{"source":"iana","extensions":["123"]},"application/vnd.lotus-approach":{"source":"iana","extensions":["apr"]},"application/vnd.lotus-freelance":{"source":"iana","extensions":["pre"]},"application/vnd.lotus-notes":{"source":"iana","extensions":["nsf"]},"application/vnd.lotus-organizer":{"source":"iana","extensions":["org"]},"application/vnd.lotus-screencam":{"source":"iana","extensions":["scm"]},"application/vnd.lotus-wordpro":{"source":"iana","extensions":["lwp"]},"application/vnd.macports.portpkg":{"source":"iana","extensions":["portpkg"]},"application/vnd.mapbox-vector-tile":{"source":"iana","extensions":["mvt"]},"application/vnd.marlin.drm.actiontoken+xml":{"source":"iana","compressible":true},"application/vnd.marlin.drm.conftoken+xml":{"source":"iana","compressible":true},"application/vnd.marlin.drm.license+xml":{"source":"iana","compressible":true},"application/vnd.marlin.drm.mdcf":{"source":"iana"},"application/vnd.mason+json":{"source":"iana","compressible":true},"application/vnd.maxmind.maxmind-db":{"source":"iana"},"application/vnd.mcd":{"source":"iana","extensions":["mcd"]},"application/vnd.medcalcdata":{"source":"iana","extensions":["mc1"]},"application/vnd.mediastation.cdkey":{"source":"iana","extensions":["cdkey"]},"application/vnd.meridian-slingshot":{"source":"iana"},"application/vnd.mfer":{"source":"iana","extensions":["mwf"]},"application/vnd.mfmp":{"source":"iana","extensions":["mfm"]},"application/vnd.micro+json":{"source":"iana","compressible":true},"application/vnd.micrografx.flo":{"source":"iana","extensions":["flo"]},"application/vnd.micrografx.igx":{"source":"iana","extensions":["igx"]},"application/vnd.microsoft.portable-executable":{"source":"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{"source":"iana"},"application/vnd.miele+json":{"source":"iana","compressible":true},"application/vnd.mif":{"source":"iana","extensions":["mif"]},"application/vnd.minisoft-hp3000-save":{"source":"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{"source":"iana"},"application/vnd.mobius.daf":{"source":"iana","extensions":["daf"]},"application/vnd.mobius.dis":{"source":"iana","extensions":["dis"]},"application/vnd.mobius.mbk":{"source":"iana","extensions":["mbk"]},"application/vnd.mobius.mqy":{"source":"iana","extensions":["mqy"]},"application/vnd.mobius.msl":{"source":"iana","extensions":["msl"]},"application/vnd.mobius.plc":{"source":"iana","extensions":["plc"]},"application/vnd.mobius.txf":{"source":"iana","extensions":["txf"]},"application/vnd.mophun.application":{"source":"iana","extensions":["mpn"]},"application/vnd.mophun.certificate":{"source":"iana","extensions":["mpc"]},"application/vnd.motorola.flexsuite":{"source":"iana"},"application/vnd.motorola.flexsuite.adsi":{"source":"iana"},"application/vnd.motorola.flexsuite.fis":{"source":"iana"},"application/vnd.motorola.flexsuite.gotap":{"source":"iana"},"application/vnd.motorola.flexsuite.kmr":{"source":"iana"},"application/vnd.motorola.flexsuite.ttc":{"source":"iana"},"application/vnd.motorola.flexsuite.wem":{"source":"iana"},"application/vnd.motorola.iprm":{"source":"iana"},"application/vnd.mozilla.xul+xml":{"source":"iana","compressible":true,"extensions":["xul"]},"application/vnd.ms-3mfdocument":{"source":"iana"},"application/vnd.ms-artgalry":{"source":"iana","extensions":["cil"]},"application/vnd.ms-asf":{"source":"iana"},"application/vnd.ms-cab-compressed":{"source":"iana","extensions":["cab"]},"application/vnd.ms-color.iccprofile":{"source":"apache"},"application/vnd.ms-excel":{"source":"iana","compressible":false,"extensions":["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{"source":"iana","extensions":["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{"source":"iana","extensions":["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{"source":"iana","extensions":["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{"source":"iana","extensions":["xltm"]},"application/vnd.ms-fontobject":{"source":"iana","compressible":true,"extensions":["eot"]},"application/vnd.ms-htmlhelp":{"source":"iana","extensions":["chm"]},"application/vnd.ms-ims":{"source":"iana","extensions":["ims"]},"application/vnd.ms-lrm":{"source":"iana","extensions":["lrm"]},"application/vnd.ms-office.activex+xml":{"source":"iana","compressible":true},"application/vnd.ms-officetheme":{"source":"iana","extensions":["thmx"]},"application/vnd.ms-opentype":{"source":"apache","compressible":true},"application/vnd.ms-outlook":{"compressible":false,"extensions":["msg"]},"application/vnd.ms-package.obfuscated-opentype":{"source":"apache"},"application/vnd.ms-pki.seccat":{"source":"apache","extensions":["cat"]},"application/vnd.ms-pki.stl":{"source":"apache","extensions":["stl"]},"application/vnd.ms-playready.initiator+xml":{"source":"iana","compressible":true},"application/vnd.ms-powerpoint":{"source":"iana","compressible":false,"extensions":["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{"source":"iana","extensions":["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{"source":"iana","extensions":["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{"source":"iana","extensions":["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{"source":"iana","extensions":["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{"source":"iana","extensions":["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{"source":"iana","compressible":true},"application/vnd.ms-printing.printticket+xml":{"source":"apache","compressible":true},"application/vnd.ms-printschematicket+xml":{"source":"iana","compressible":true},"application/vnd.ms-project":{"source":"iana","extensions":["mpp","mpt"]},"application/vnd.ms-tnef":{"source":"iana"},"application/vnd.ms-windows.devicepairing":{"source":"iana"},"application/vnd.ms-windows.nwprinting.oob":{"source":"iana"},"application/vnd.ms-windows.printerpairing":{"source":"iana"},"application/vnd.ms-windows.wsd.oob":{"source":"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{"source":"iana"},"application/vnd.ms-wmdrm.lic-resp":{"source":"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{"source":"iana"},"application/vnd.ms-wmdrm.meter-resp":{"source":"iana"},"application/vnd.ms-word.document.macroenabled.12":{"source":"iana","extensions":["docm"]},"application/vnd.ms-word.template.macroenabled.12":{"source":"iana","extensions":["dotm"]},"application/vnd.ms-works":{"source":"iana","extensions":["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{"source":"iana","extensions":["wpl"]},"application/vnd.ms-xpsdocument":{"source":"iana","compressible":false,"extensions":["xps"]},"application/vnd.msa-disk-image":{"source":"iana"},"application/vnd.mseq":{"source":"iana","extensions":["mseq"]},"application/vnd.msign":{"source":"iana"},"application/vnd.multiad.creator":{"source":"iana"},"application/vnd.multiad.creator.cif":{"source":"iana"},"application/vnd.music-niff":{"source":"iana"},"application/vnd.musician":{"source":"iana","extensions":["mus"]},"application/vnd.muvee.style":{"source":"iana","extensions":["msty"]},"application/vnd.mynfc":{"source":"iana","extensions":["taglet"]},"application/vnd.ncd.control":{"source":"iana"},"application/vnd.ncd.reference":{"source":"iana"},"application/vnd.nearst.inv+json":{"source":"iana","compressible":true},"application/vnd.nebumind.line":{"source":"iana"},"application/vnd.nervana":{"source":"iana"},"application/vnd.netfpx":{"source":"iana"},"application/vnd.neurolanguage.nlu":{"source":"iana","extensions":["nlu"]},"application/vnd.nimn":{"source":"iana"},"application/vnd.nintendo.nitro.rom":{"source":"iana"},"application/vnd.nintendo.snes.rom":{"source":"iana"},"application/vnd.nitf":{"source":"iana","extensions":["ntf","nitf"]},"application/vnd.noblenet-directory":{"source":"iana","extensions":["nnd"]},"application/vnd.noblenet-sealer":{"source":"iana","extensions":["nns"]},"application/vnd.noblenet-web":{"source":"iana","extensions":["nnw"]},"application/vnd.nokia.catalogs":{"source":"iana"},"application/vnd.nokia.conml+wbxml":{"source":"iana"},"application/vnd.nokia.conml+xml":{"source":"iana","compressible":true},"application/vnd.nokia.iptv.config+xml":{"source":"iana","compressible":true},"application/vnd.nokia.isds-radio-presets":{"source":"iana"},"application/vnd.nokia.landmark+wbxml":{"source":"iana"},"application/vnd.nokia.landmark+xml":{"source":"iana","compressible":true},"application/vnd.nokia.landmarkcollection+xml":{"source":"iana","compressible":true},"application/vnd.nokia.n-gage.ac+xml":{"source":"iana","compressible":true,"extensions":["ac"]},"application/vnd.nokia.n-gage.data":{"source":"iana","extensions":["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{"source":"iana","extensions":["n-gage"]},"application/vnd.nokia.ncd":{"source":"iana"},"application/vnd.nokia.pcd+wbxml":{"source":"iana"},"application/vnd.nokia.pcd+xml":{"source":"iana","compressible":true},"application/vnd.nokia.radio-preset":{"source":"iana","extensions":["rpst"]},"application/vnd.nokia.radio-presets":{"source":"iana","extensions":["rpss"]},"application/vnd.novadigm.edm":{"source":"iana","extensions":["edm"]},"application/vnd.novadigm.edx":{"source":"iana","extensions":["edx"]},"application/vnd.novadigm.ext":{"source":"iana","extensions":["ext"]},"application/vnd.ntt-local.content-share":{"source":"iana"},"application/vnd.ntt-local.file-transfer":{"source":"iana"},"application/vnd.ntt-local.ogw_remote-access":{"source":"iana"},"application/vnd.ntt-local.sip-ta_remote":{"source":"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{"source":"iana"},"application/vnd.oasis.opendocument.chart":{"source":"iana","extensions":["odc"]},"application/vnd.oasis.opendocument.chart-template":{"source":"iana","extensions":["otc"]},"application/vnd.oasis.opendocument.database":{"source":"iana","extensions":["odb"]},"application/vnd.oasis.opendocument.formula":{"source":"iana","extensions":["odf"]},"application/vnd.oasis.opendocument.formula-template":{"source":"iana","extensions":["odft"]},"application/vnd.oasis.opendocument.graphics":{"source":"iana","compressible":false,"extensions":["odg"]},"application/vnd.oasis.opendocument.graphics-template":{"source":"iana","extensions":["otg"]},"application/vnd.oasis.opendocument.image":{"source":"iana","extensions":["odi"]},"application/vnd.oasis.opendocument.image-template":{"source":"iana","extensions":["oti"]},"application/vnd.oasis.opendocument.presentation":{"source":"iana","compressible":false,"extensions":["odp"]},"application/vnd.oasis.opendocument.presentation-template":{"source":"iana","extensions":["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{"source":"iana","compressible":false,"extensions":["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{"source":"iana","extensions":["ots"]},"application/vnd.oasis.opendocument.text":{"source":"iana","compressible":false,"extensions":["odt"]},"application/vnd.oasis.opendocument.text-master":{"source":"iana","extensions":["odm"]},"application/vnd.oasis.opendocument.text-template":{"source":"iana","extensions":["ott"]},"application/vnd.oasis.opendocument.text-web":{"source":"iana","extensions":["oth"]},"application/vnd.obn":{"source":"iana"},"application/vnd.ocf+cbor":{"source":"iana"},"application/vnd.oci.image.manifest.v1+json":{"source":"iana","compressible":true},"application/vnd.oftn.l10n+json":{"source":"iana","compressible":true},"application/vnd.oipf.contentaccessdownload+xml":{"source":"iana","compressible":true},"application/vnd.oipf.contentaccessstreaming+xml":{"source":"iana","compressible":true},"application/vnd.oipf.cspg-hexbinary":{"source":"iana"},"application/vnd.oipf.dae.svg+xml":{"source":"iana","compressible":true},"application/vnd.oipf.dae.xhtml+xml":{"source":"iana","compressible":true},"application/vnd.oipf.mippvcontrolmessage+xml":{"source":"iana","compressible":true},"application/vnd.oipf.pae.gem":{"source":"iana"},"application/vnd.oipf.spdiscovery+xml":{"source":"iana","compressible":true},"application/vnd.oipf.spdlist+xml":{"source":"iana","compressible":true},"application/vnd.oipf.ueprofile+xml":{"source":"iana","compressible":true},"application/vnd.oipf.userprofile+xml":{"source":"iana","compressible":true},"application/vnd.olpc-sugar":{"source":"iana","extensions":["xo"]},"application/vnd.oma-scws-config":{"source":"iana"},"application/vnd.oma-scws-http-request":{"source":"iana"},"application/vnd.oma-scws-http-response":{"source":"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.drm-trigger+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.imd+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.ltkm":{"source":"iana"},"application/vnd.oma.bcast.notification+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.provisioningtrigger":{"source":"iana"},"application/vnd.oma.bcast.sgboot":{"source":"iana"},"application/vnd.oma.bcast.sgdd+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.sgdu":{"source":"iana"},"application/vnd.oma.bcast.simple-symbol-container":{"source":"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.sprov+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.stkm":{"source":"iana"},"application/vnd.oma.cab-address-book+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-feature-handler+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-pcc+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-subs-invite+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-user-prefs+xml":{"source":"iana","compressible":true},"application/vnd.oma.dcd":{"source":"iana"},"application/vnd.oma.dcdc":{"source":"iana"},"application/vnd.oma.dd2+xml":{"source":"iana","compressible":true,"extensions":["dd2"]},"application/vnd.oma.drm.risd+xml":{"source":"iana","compressible":true},"application/vnd.oma.group-usage-list+xml":{"source":"iana","compressible":true},"application/vnd.oma.lwm2m+cbor":{"source":"iana"},"application/vnd.oma.lwm2m+json":{"source":"iana","compressible":true},"application/vnd.oma.lwm2m+tlv":{"source":"iana"},"application/vnd.oma.pal+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.detailed-progress-report+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.final-report+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.groups+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.invocation-descriptor+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.optimized-progress-report+xml":{"source":"iana","compressible":true},"application/vnd.oma.push":{"source":"iana"},"application/vnd.oma.scidm.messages+xml":{"source":"iana","compressible":true},"application/vnd.oma.xcap-directory+xml":{"source":"iana","compressible":true},"application/vnd.omads-email+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.omads-file+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.omads-folder+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.omaloc-supl-init":{"source":"iana"},"application/vnd.onepager":{"source":"iana"},"application/vnd.onepagertamp":{"source":"iana"},"application/vnd.onepagertamx":{"source":"iana"},"application/vnd.onepagertat":{"source":"iana"},"application/vnd.onepagertatp":{"source":"iana"},"application/vnd.onepagertatx":{"source":"iana"},"application/vnd.openblox.game+xml":{"source":"iana","compressible":true,"extensions":["obgx"]},"application/vnd.openblox.game-binary":{"source":"iana"},"application/vnd.openeye.oeb":{"source":"iana"},"application/vnd.openofficeorg.extension":{"source":"apache","extensions":["oxt"]},"application/vnd.openstreetmap.data+xml":{"source":"iana","compressible":true,"extensions":["osm"]},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawing+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{"source":"iana","compressible":false,"extensions":["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slide":{"source":"iana","extensions":["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{"source":"iana","extensions":["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.template":{"source":"iana","extensions":["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"source":"iana","compressible":false,"extensions":["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{"source":"iana","extensions":["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.theme+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.vmldrawing":{"source":"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{"source":"iana","compressible":false,"extensions":["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{"source":"iana","extensions":["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-package.core-properties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-package.relationships+xml":{"source":"iana","compressible":true},"application/vnd.oracle.resource+json":{"source":"iana","compressible":true},"application/vnd.orange.indata":{"source":"iana"},"application/vnd.osa.netdeploy":{"source":"iana"},"application/vnd.osgeo.mapguide.package":{"source":"iana","extensions":["mgp"]},"application/vnd.osgi.bundle":{"source":"iana"},"application/vnd.osgi.dp":{"source":"iana","extensions":["dp"]},"application/vnd.osgi.subsystem":{"source":"iana","extensions":["esa"]},"application/vnd.otps.ct-kip+xml":{"source":"iana","compressible":true},"application/vnd.oxli.countgraph":{"source":"iana"},"application/vnd.pagerduty+json":{"source":"iana","compressible":true},"application/vnd.palm":{"source":"iana","extensions":["pdb","pqa","oprc"]},"application/vnd.panoply":{"source":"iana"},"application/vnd.paos.xml":{"source":"iana"},"application/vnd.patentdive":{"source":"iana"},"application/vnd.patientecommsdoc":{"source":"iana"},"application/vnd.pawaafile":{"source":"iana","extensions":["paw"]},"application/vnd.pcos":{"source":"iana"},"application/vnd.pg.format":{"source":"iana","extensions":["str"]},"application/vnd.pg.osasli":{"source":"iana","extensions":["ei6"]},"application/vnd.piaccess.application-licence":{"source":"iana"},"application/vnd.picsel":{"source":"iana","extensions":["efif"]},"application/vnd.pmi.widget":{"source":"iana","extensions":["wg"]},"application/vnd.poc.group-advertisement+xml":{"source":"iana","compressible":true},"application/vnd.pocketlearn":{"source":"iana","extensions":["plf"]},"application/vnd.powerbuilder6":{"source":"iana","extensions":["pbd"]},"application/vnd.powerbuilder6-s":{"source":"iana"},"application/vnd.powerbuilder7":{"source":"iana"},"application/vnd.powerbuilder7-s":{"source":"iana"},"application/vnd.powerbuilder75":{"source":"iana"},"application/vnd.powerbuilder75-s":{"source":"iana"},"application/vnd.preminet":{"source":"iana"},"application/vnd.previewsystems.box":{"source":"iana","extensions":["box"]},"application/vnd.proteus.magazine":{"source":"iana","extensions":["mgz"]},"application/vnd.psfs":{"source":"iana"},"application/vnd.publishare-delta-tree":{"source":"iana","extensions":["qps"]},"application/vnd.pvi.ptid1":{"source":"iana","extensions":["ptid"]},"application/vnd.pwg-multiplexed":{"source":"iana"},"application/vnd.pwg-xhtml-print+xml":{"source":"iana","compressible":true},"application/vnd.qualcomm.brew-app-res":{"source":"iana"},"application/vnd.quarantainenet":{"source":"iana"},"application/vnd.quark.quarkxpress":{"source":"iana","extensions":["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{"source":"iana"},"application/vnd.radisys.moml+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-conf+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-conn+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-dialog+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-stream+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-conf+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-base+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-fax-detect+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-group+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-speech+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-transform+xml":{"source":"iana","compressible":true},"application/vnd.rainstor.data":{"source":"iana"},"application/vnd.rapid":{"source":"iana"},"application/vnd.rar":{"source":"iana","extensions":["rar"]},"application/vnd.realvnc.bed":{"source":"iana","extensions":["bed"]},"application/vnd.recordare.musicxml":{"source":"iana","extensions":["mxl"]},"application/vnd.recordare.musicxml+xml":{"source":"iana","compressible":true,"extensions":["musicxml"]},"application/vnd.renlearn.rlprint":{"source":"iana"},"application/vnd.restful+json":{"source":"iana","compressible":true},"application/vnd.rig.cryptonote":{"source":"iana","extensions":["cryptonote"]},"application/vnd.rim.cod":{"source":"apache","extensions":["cod"]},"application/vnd.rn-realmedia":{"source":"apache","extensions":["rm"]},"application/vnd.rn-realmedia-vbr":{"source":"apache","extensions":["rmvb"]},"application/vnd.route66.link66+xml":{"source":"iana","compressible":true,"extensions":["link66"]},"application/vnd.rs-274x":{"source":"iana"},"application/vnd.ruckus.download":{"source":"iana"},"application/vnd.s3sms":{"source":"iana"},"application/vnd.sailingtracker.track":{"source":"iana","extensions":["st"]},"application/vnd.sar":{"source":"iana"},"application/vnd.sbm.cid":{"source":"iana"},"application/vnd.sbm.mid2":{"source":"iana"},"application/vnd.scribus":{"source":"iana"},"application/vnd.sealed.3df":{"source":"iana"},"application/vnd.sealed.csf":{"source":"iana"},"application/vnd.sealed.doc":{"source":"iana"},"application/vnd.sealed.eml":{"source":"iana"},"application/vnd.sealed.mht":{"source":"iana"},"application/vnd.sealed.net":{"source":"iana"},"application/vnd.sealed.ppt":{"source":"iana"},"application/vnd.sealed.tiff":{"source":"iana"},"application/vnd.sealed.xls":{"source":"iana"},"application/vnd.sealedmedia.softseal.html":{"source":"iana"},"application/vnd.sealedmedia.softseal.pdf":{"source":"iana"},"application/vnd.seemail":{"source":"iana","extensions":["see"]},"application/vnd.seis+json":{"source":"iana","compressible":true},"application/vnd.sema":{"source":"iana","extensions":["sema"]},"application/vnd.semd":{"source":"iana","extensions":["semd"]},"application/vnd.semf":{"source":"iana","extensions":["semf"]},"application/vnd.shade-save-file":{"source":"iana"},"application/vnd.shana.informed.formdata":{"source":"iana","extensions":["ifm"]},"application/vnd.shana.informed.formtemplate":{"source":"iana","extensions":["itp"]},"application/vnd.shana.informed.interchange":{"source":"iana","extensions":["iif"]},"application/vnd.shana.informed.package":{"source":"iana","extensions":["ipk"]},"application/vnd.shootproof+json":{"source":"iana","compressible":true},"application/vnd.shopkick+json":{"source":"iana","compressible":true},"application/vnd.shp":{"source":"iana"},"application/vnd.shx":{"source":"iana"},"application/vnd.sigrok.session":{"source":"iana"},"application/vnd.simtech-mindmapper":{"source":"iana","extensions":["twd","twds"]},"application/vnd.siren+json":{"source":"iana","compressible":true},"application/vnd.smaf":{"source":"iana","extensions":["mmf"]},"application/vnd.smart.notebook":{"source":"iana"},"application/vnd.smart.teacher":{"source":"iana","extensions":["teacher"]},"application/vnd.snesdev-page-table":{"source":"iana"},"application/vnd.software602.filler.form+xml":{"source":"iana","compressible":true,"extensions":["fo"]},"application/vnd.software602.filler.form-xml-zip":{"source":"iana"},"application/vnd.solent.sdkm+xml":{"source":"iana","compressible":true,"extensions":["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{"source":"iana","extensions":["dxp"]},"application/vnd.spotfire.sfs":{"source":"iana","extensions":["sfs"]},"application/vnd.sqlite3":{"source":"iana"},"application/vnd.sss-cod":{"source":"iana"},"application/vnd.sss-dtf":{"source":"iana"},"application/vnd.sss-ntf":{"source":"iana"},"application/vnd.stardivision.calc":{"source":"apache","extensions":["sdc"]},"application/vnd.stardivision.draw":{"source":"apache","extensions":["sda"]},"application/vnd.stardivision.impress":{"source":"apache","extensions":["sdd"]},"application/vnd.stardivision.math":{"source":"apache","extensions":["smf"]},"application/vnd.stardivision.writer":{"source":"apache","extensions":["sdw","vor"]},"application/vnd.stardivision.writer-global":{"source":"apache","extensions":["sgl"]},"application/vnd.stepmania.package":{"source":"iana","extensions":["smzip"]},"application/vnd.stepmania.stepchart":{"source":"iana","extensions":["sm"]},"application/vnd.street-stream":{"source":"iana"},"application/vnd.sun.wadl+xml":{"source":"iana","compressible":true,"extensions":["wadl"]},"application/vnd.sun.xml.calc":{"source":"apache","extensions":["sxc"]},"application/vnd.sun.xml.calc.template":{"source":"apache","extensions":["stc"]},"application/vnd.sun.xml.draw":{"source":"apache","extensions":["sxd"]},"application/vnd.sun.xml.draw.template":{"source":"apache","extensions":["std"]},"application/vnd.sun.xml.impress":{"source":"apache","extensions":["sxi"]},"application/vnd.sun.xml.impress.template":{"source":"apache","extensions":["sti"]},"application/vnd.sun.xml.math":{"source":"apache","extensions":["sxm"]},"application/vnd.sun.xml.writer":{"source":"apache","extensions":["sxw"]},"application/vnd.sun.xml.writer.global":{"source":"apache","extensions":["sxg"]},"application/vnd.sun.xml.writer.template":{"source":"apache","extensions":["stw"]},"application/vnd.sus-calendar":{"source":"iana","extensions":["sus","susp"]},"application/vnd.svd":{"source":"iana","extensions":["svd"]},"application/vnd.swiftview-ics":{"source":"iana"},"application/vnd.sycle+xml":{"source":"iana","compressible":true},"application/vnd.symbian.install":{"source":"apache","extensions":["sis","sisx"]},"application/vnd.syncml+xml":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["xsm"]},"application/vnd.syncml.dm+wbxml":{"source":"iana","charset":"UTF-8","extensions":["bdm"]},"application/vnd.syncml.dm+xml":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["xdm"]},"application/vnd.syncml.dm.notification":{"source":"iana"},"application/vnd.syncml.dmddf+wbxml":{"source":"iana"},"application/vnd.syncml.dmddf+xml":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{"source":"iana"},"application/vnd.syncml.dmtnds+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.syncml.ds.notification":{"source":"iana"},"application/vnd.tableschema+json":{"source":"iana","compressible":true},"application/vnd.tao.intent-module-archive":{"source":"iana","extensions":["tao"]},"application/vnd.tcpdump.pcap":{"source":"iana","extensions":["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{"source":"iana","compressible":true},"application/vnd.tmd.mediaflex.api+xml":{"source":"iana","compressible":true},"application/vnd.tml":{"source":"iana"},"application/vnd.tmobile-livetv":{"source":"iana","extensions":["tmo"]},"application/vnd.tri.onesource":{"source":"iana"},"application/vnd.trid.tpt":{"source":"iana","extensions":["tpt"]},"application/vnd.triscape.mxs":{"source":"iana","extensions":["mxs"]},"application/vnd.trueapp":{"source":"iana","extensions":["tra"]},"application/vnd.truedoc":{"source":"iana"},"application/vnd.ubisoft.webplayer":{"source":"iana"},"application/vnd.ufdl":{"source":"iana","extensions":["ufd","ufdl"]},"application/vnd.uiq.theme":{"source":"iana","extensions":["utz"]},"application/vnd.umajin":{"source":"iana","extensions":["umj"]},"application/vnd.unity":{"source":"iana","extensions":["unityweb"]},"application/vnd.uoml+xml":{"source":"iana","compressible":true,"extensions":["uoml"]},"application/vnd.uplanet.alert":{"source":"iana"},"application/vnd.uplanet.alert-wbxml":{"source":"iana"},"application/vnd.uplanet.bearer-choice":{"source":"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{"source":"iana"},"application/vnd.uplanet.cacheop":{"source":"iana"},"application/vnd.uplanet.cacheop-wbxml":{"source":"iana"},"application/vnd.uplanet.channel":{"source":"iana"},"application/vnd.uplanet.channel-wbxml":{"source":"iana"},"application/vnd.uplanet.list":{"source":"iana"},"application/vnd.uplanet.list-wbxml":{"source":"iana"},"application/vnd.uplanet.listcmd":{"source":"iana"},"application/vnd.uplanet.listcmd-wbxml":{"source":"iana"},"application/vnd.uplanet.signal":{"source":"iana"},"application/vnd.uri-map":{"source":"iana"},"application/vnd.valve.source.material":{"source":"iana"},"application/vnd.vcx":{"source":"iana","extensions":["vcx"]},"application/vnd.vd-study":{"source":"iana"},"application/vnd.vectorworks":{"source":"iana"},"application/vnd.vel+json":{"source":"iana","compressible":true},"application/vnd.verimatrix.vcas":{"source":"iana"},"application/vnd.veryant.thin":{"source":"iana"},"application/vnd.ves.encrypted":{"source":"iana"},"application/vnd.vidsoft.vidconference":{"source":"iana"},"application/vnd.visio":{"source":"iana","extensions":["vsd","vst","vss","vsw"]},"application/vnd.visionary":{"source":"iana","extensions":["vis"]},"application/vnd.vividence.scriptfile":{"source":"iana"},"application/vnd.vsf":{"source":"iana","extensions":["vsf"]},"application/vnd.wap.sic":{"source":"iana"},"application/vnd.wap.slc":{"source":"iana"},"application/vnd.wap.wbxml":{"source":"iana","charset":"UTF-8","extensions":["wbxml"]},"application/vnd.wap.wmlc":{"source":"iana","extensions":["wmlc"]},"application/vnd.wap.wmlscriptc":{"source":"iana","extensions":["wmlsc"]},"application/vnd.webturbo":{"source":"iana","extensions":["wtb"]},"application/vnd.wfa.dpp":{"source":"iana"},"application/vnd.wfa.p2p":{"source":"iana"},"application/vnd.wfa.wsc":{"source":"iana"},"application/vnd.windows.devicepairing":{"source":"iana"},"application/vnd.wmc":{"source":"iana"},"application/vnd.wmf.bootstrap":{"source":"iana"},"application/vnd.wolfram.mathematica":{"source":"iana"},"application/vnd.wolfram.mathematica.package":{"source":"iana"},"application/vnd.wolfram.player":{"source":"iana","extensions":["nbp"]},"application/vnd.wordperfect":{"source":"iana","extensions":["wpd"]},"application/vnd.wqd":{"source":"iana","extensions":["wqd"]},"application/vnd.wrq-hp3000-labelled":{"source":"iana"},"application/vnd.wt.stf":{"source":"iana","extensions":["stf"]},"application/vnd.wv.csp+wbxml":{"source":"iana"},"application/vnd.wv.csp+xml":{"source":"iana","compressible":true},"application/vnd.wv.ssp+xml":{"source":"iana","compressible":true},"application/vnd.xacml+json":{"source":"iana","compressible":true},"application/vnd.xara":{"source":"iana","extensions":["xar"]},"application/vnd.xfdl":{"source":"iana","extensions":["xfdl"]},"application/vnd.xfdl.webform":{"source":"iana"},"application/vnd.xmi+xml":{"source":"iana","compressible":true},"application/vnd.xmpie.cpkg":{"source":"iana"},"application/vnd.xmpie.dpkg":{"source":"iana"},"application/vnd.xmpie.plan":{"source":"iana"},"application/vnd.xmpie.ppkg":{"source":"iana"},"application/vnd.xmpie.xlim":{"source":"iana"},"application/vnd.yamaha.hv-dic":{"source":"iana","extensions":["hvd"]},"application/vnd.yamaha.hv-script":{"source":"iana","extensions":["hvs"]},"application/vnd.yamaha.hv-voice":{"source":"iana","extensions":["hvp"]},"application/vnd.yamaha.openscoreformat":{"source":"iana","extensions":["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{"source":"iana","compressible":true,"extensions":["osfpvg"]},"application/vnd.yamaha.remote-setup":{"source":"iana"},"application/vnd.yamaha.smaf-audio":{"source":"iana","extensions":["saf"]},"application/vnd.yamaha.smaf-phrase":{"source":"iana","extensions":["spf"]},"application/vnd.yamaha.through-ngn":{"source":"iana"},"application/vnd.yamaha.tunnel-udpencap":{"source":"iana"},"application/vnd.yaoweme":{"source":"iana"},"application/vnd.yellowriver-custom-menu":{"source":"iana","extensions":["cmp"]},"application/vnd.youtube.yt":{"source":"iana"},"application/vnd.zul":{"source":"iana","extensions":["zir","zirz"]},"application/vnd.zzazz.deck+xml":{"source":"iana","compressible":true,"extensions":["zaz"]},"application/voicexml+xml":{"source":"iana","compressible":true,"extensions":["vxml"]},"application/voucher-cms+json":{"source":"iana","compressible":true},"application/vq-rtcpxr":{"source":"iana"},"application/wasm":{"source":"iana","compressible":true,"extensions":["wasm"]},"application/watcherinfo+xml":{"source":"iana","compressible":true},"application/webpush-options+json":{"source":"iana","compressible":true},"application/whoispp-query":{"source":"iana"},"application/whoispp-response":{"source":"iana"},"application/widget":{"source":"iana","extensions":["wgt"]},"application/winhlp":{"source":"apache","extensions":["hlp"]},"application/wita":{"source":"iana"},"application/wordperfect5.1":{"source":"iana"},"application/wsdl+xml":{"source":"iana","compressible":true,"extensions":["wsdl"]},"application/wspolicy+xml":{"source":"iana","compressible":true,"extensions":["wspolicy"]},"application/x-7z-compressed":{"source":"apache","compressible":false,"extensions":["7z"]},"application/x-abiword":{"source":"apache","extensions":["abw"]},"application/x-ace-compressed":{"source":"apache","extensions":["ace"]},"application/x-amf":{"source":"apache"},"application/x-apple-diskimage":{"source":"apache","extensions":["dmg"]},"application/x-arj":{"compressible":false,"extensions":["arj"]},"application/x-authorware-bin":{"source":"apache","extensions":["aab","x32","u32","vox"]},"application/x-authorware-map":{"source":"apache","extensions":["aam"]},"application/x-authorware-seg":{"source":"apache","extensions":["aas"]},"application/x-bcpio":{"source":"apache","extensions":["bcpio"]},"application/x-bdoc":{"compressible":false,"extensions":["bdoc"]},"application/x-bittorrent":{"source":"apache","extensions":["torrent"]},"application/x-blorb":{"source":"apache","extensions":["blb","blorb"]},"application/x-bzip":{"source":"apache","compressible":false,"extensions":["bz"]},"application/x-bzip2":{"source":"apache","compressible":false,"extensions":["bz2","boz"]},"application/x-cbr":{"source":"apache","extensions":["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{"source":"apache","extensions":["vcd"]},"application/x-cfs-compressed":{"source":"apache","extensions":["cfs"]},"application/x-chat":{"source":"apache","extensions":["chat"]},"application/x-chess-pgn":{"source":"apache","extensions":["pgn"]},"application/x-chrome-extension":{"extensions":["crx"]},"application/x-cocoa":{"source":"nginx","extensions":["cco"]},"application/x-compress":{"source":"apache"},"application/x-conference":{"source":"apache","extensions":["nsc"]},"application/x-cpio":{"source":"apache","extensions":["cpio"]},"application/x-csh":{"source":"apache","extensions":["csh"]},"application/x-deb":{"compressible":false},"application/x-debian-package":{"source":"apache","extensions":["deb","udeb"]},"application/x-dgc-compressed":{"source":"apache","extensions":["dgc"]},"application/x-director":{"source":"apache","extensions":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{"source":"apache","extensions":["wad"]},"application/x-dtbncx+xml":{"source":"apache","compressible":true,"extensions":["ncx"]},"application/x-dtbook+xml":{"source":"apache","compressible":true,"extensions":["dtb"]},"application/x-dtbresource+xml":{"source":"apache","compressible":true,"extensions":["res"]},"application/x-dvi":{"source":"apache","compressible":false,"extensions":["dvi"]},"application/x-envoy":{"source":"apache","extensions":["evy"]},"application/x-eva":{"source":"apache","extensions":["eva"]},"application/x-font-bdf":{"source":"apache","extensions":["bdf"]},"application/x-font-dos":{"source":"apache"},"application/x-font-framemaker":{"source":"apache"},"application/x-font-ghostscript":{"source":"apache","extensions":["gsf"]},"application/x-font-libgrx":{"source":"apache"},"application/x-font-linux-psf":{"source":"apache","extensions":["psf"]},"application/x-font-pcf":{"source":"apache","extensions":["pcf"]},"application/x-font-snf":{"source":"apache","extensions":["snf"]},"application/x-font-speedo":{"source":"apache"},"application/x-font-sunos-news":{"source":"apache"},"application/x-font-type1":{"source":"apache","extensions":["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{"source":"apache"},"application/x-freearc":{"source":"apache","extensions":["arc"]},"application/x-futuresplash":{"source":"apache","extensions":["spl"]},"application/x-gca-compressed":{"source":"apache","extensions":["gca"]},"application/x-glulx":{"source":"apache","extensions":["ulx"]},"application/x-gnumeric":{"source":"apache","extensions":["gnumeric"]},"application/x-gramps-xml":{"source":"apache","extensions":["gramps"]},"application/x-gtar":{"source":"apache","extensions":["gtar"]},"application/x-gzip":{"source":"apache"},"application/x-hdf":{"source":"apache","extensions":["hdf"]},"application/x-httpd-php":{"compressible":true,"extensions":["php"]},"application/x-install-instructions":{"source":"apache","extensions":["install"]},"application/x-iso9660-image":{"source":"apache","extensions":["iso"]},"application/x-java-archive-diff":{"source":"nginx","extensions":["jardiff"]},"application/x-java-jnlp-file":{"source":"apache","compressible":false,"extensions":["jnlp"]},"application/x-javascript":{"compressible":true},"application/x-keepass2":{"extensions":["kdbx"]},"application/x-latex":{"source":"apache","compressible":false,"extensions":["latex"]},"application/x-lua-bytecode":{"extensions":["luac"]},"application/x-lzh-compressed":{"source":"apache","extensions":["lzh","lha"]},"application/x-makeself":{"source":"nginx","extensions":["run"]},"application/x-mie":{"source":"apache","extensions":["mie"]},"application/x-mobipocket-ebook":{"source":"apache","extensions":["prc","mobi"]},"application/x-mpegurl":{"compressible":false},"application/x-ms-application":{"source":"apache","extensions":["application"]},"application/x-ms-shortcut":{"source":"apache","extensions":["lnk"]},"application/x-ms-wmd":{"source":"apache","extensions":["wmd"]},"application/x-ms-wmz":{"source":"apache","extensions":["wmz"]},"application/x-ms-xbap":{"source":"apache","extensions":["xbap"]},"application/x-msaccess":{"source":"apache","extensions":["mdb"]},"application/x-msbinder":{"source":"apache","extensions":["obd"]},"application/x-mscardfile":{"source":"apache","extensions":["crd"]},"application/x-msclip":{"source":"apache","extensions":["clp"]},"application/x-msdos-program":{"extensions":["exe"]},"application/x-msdownload":{"source":"apache","extensions":["exe","dll","com","bat","msi"]},"application/x-msmediaview":{"source":"apache","extensions":["mvb","m13","m14"]},"application/x-msmetafile":{"source":"apache","extensions":["wmf","wmz","emf","emz"]},"application/x-msmoney":{"source":"apache","extensions":["mny"]},"application/x-mspublisher":{"source":"apache","extensions":["pub"]},"application/x-msschedule":{"source":"apache","extensions":["scd"]},"application/x-msterminal":{"source":"apache","extensions":["trm"]},"application/x-mswrite":{"source":"apache","extensions":["wri"]},"application/x-netcdf":{"source":"apache","extensions":["nc","cdf"]},"application/x-ns-proxy-autoconfig":{"compressible":true,"extensions":["pac"]},"application/x-nzb":{"source":"apache","extensions":["nzb"]},"application/x-perl":{"source":"nginx","extensions":["pl","pm"]},"application/x-pilot":{"source":"nginx","extensions":["prc","pdb"]},"application/x-pkcs12":{"source":"apache","compressible":false,"extensions":["p12","pfx"]},"application/x-pkcs7-certificates":{"source":"apache","extensions":["p7b","spc"]},"application/x-pkcs7-certreqresp":{"source":"apache","extensions":["p7r"]},"application/x-pki-message":{"source":"iana"},"application/x-rar-compressed":{"source":"apache","compressible":false,"extensions":["rar"]},"application/x-redhat-package-manager":{"source":"nginx","extensions":["rpm"]},"application/x-research-info-systems":{"source":"apache","extensions":["ris"]},"application/x-sea":{"source":"nginx","extensions":["sea"]},"application/x-sh":{"source":"apache","compressible":true,"extensions":["sh"]},"application/x-shar":{"source":"apache","extensions":["shar"]},"application/x-shockwave-flash":{"source":"apache","compressible":false,"extensions":["swf"]},"application/x-silverlight-app":{"source":"apache","extensions":["xap"]},"application/x-sql":{"source":"apache","extensions":["sql"]},"application/x-stuffit":{"source":"apache","compressible":false,"extensions":["sit"]},"application/x-stuffitx":{"source":"apache","extensions":["sitx"]},"application/x-subrip":{"source":"apache","extensions":["srt"]},"application/x-sv4cpio":{"source":"apache","extensions":["sv4cpio"]},"application/x-sv4crc":{"source":"apache","extensions":["sv4crc"]},"application/x-t3vm-image":{"source":"apache","extensions":["t3"]},"application/x-tads":{"source":"apache","extensions":["gam"]},"application/x-tar":{"source":"apache","compressible":true,"extensions":["tar"]},"application/x-tcl":{"source":"apache","extensions":["tcl","tk"]},"application/x-tex":{"source":"apache","extensions":["tex"]},"application/x-tex-tfm":{"source":"apache","extensions":["tfm"]},"application/x-texinfo":{"source":"apache","extensions":["texinfo","texi"]},"application/x-tgif":{"source":"apache","extensions":["obj"]},"application/x-ustar":{"source":"apache","extensions":["ustar"]},"application/x-virtualbox-hdd":{"compressible":true,"extensions":["hdd"]},"application/x-virtualbox-ova":{"compressible":true,"extensions":["ova"]},"application/x-virtualbox-ovf":{"compressible":true,"extensions":["ovf"]},"application/x-virtualbox-vbox":{"compressible":true,"extensions":["vbox"]},"application/x-virtualbox-vbox-extpack":{"compressible":false,"extensions":["vbox-extpack"]},"application/x-virtualbox-vdi":{"compressible":true,"extensions":["vdi"]},"application/x-virtualbox-vhd":{"compressible":true,"extensions":["vhd"]},"application/x-virtualbox-vmdk":{"compressible":true,"extensions":["vmdk"]},"application/x-wais-source":{"source":"apache","extensions":["src"]},"application/x-web-app-manifest+json":{"compressible":true,"extensions":["webapp"]},"application/x-www-form-urlencoded":{"source":"iana","compressible":true},"application/x-x509-ca-cert":{"source":"iana","extensions":["der","crt","pem"]},"application/x-x509-ca-ra-cert":{"source":"iana"},"application/x-x509-next-ca-cert":{"source":"iana"},"application/x-xfig":{"source":"apache","extensions":["fig"]},"application/x-xliff+xml":{"source":"apache","compressible":true,"extensions":["xlf"]},"application/x-xpinstall":{"source":"apache","compressible":false,"extensions":["xpi"]},"application/x-xz":{"source":"apache","extensions":["xz"]},"application/x-zmachine":{"source":"apache","extensions":["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{"source":"iana"},"application/xacml+xml":{"source":"iana","compressible":true},"application/xaml+xml":{"source":"apache","compressible":true,"extensions":["xaml"]},"application/xcap-att+xml":{"source":"iana","compressible":true,"extensions":["xav"]},"application/xcap-caps+xml":{"source":"iana","compressible":true,"extensions":["xca"]},"application/xcap-diff+xml":{"source":"iana","compressible":true,"extensions":["xdf"]},"application/xcap-el+xml":{"source":"iana","compressible":true,"extensions":["xel"]},"application/xcap-error+xml":{"source":"iana","compressible":true},"application/xcap-ns+xml":{"source":"iana","compressible":true,"extensions":["xns"]},"application/xcon-conference-info+xml":{"source":"iana","compressible":true},"application/xcon-conference-info-diff+xml":{"source":"iana","compressible":true},"application/xenc+xml":{"source":"iana","compressible":true,"extensions":["xenc"]},"application/xhtml+xml":{"source":"iana","compressible":true,"extensions":["xhtml","xht"]},"application/xhtml-voice+xml":{"source":"apache","compressible":true},"application/xliff+xml":{"source":"iana","compressible":true,"extensions":["xlf"]},"application/xml":{"source":"iana","compressible":true,"extensions":["xml","xsl","xsd","rng"]},"application/xml-dtd":{"source":"iana","compressible":true,"extensions":["dtd"]},"application/xml-external-parsed-entity":{"source":"iana"},"application/xml-patch+xml":{"source":"iana","compressible":true},"application/xmpp+xml":{"source":"iana","compressible":true},"application/xop+xml":{"source":"iana","compressible":true,"extensions":["xop"]},"application/xproc+xml":{"source":"apache","compressible":true,"extensions":["xpl"]},"application/xslt+xml":{"source":"iana","compressible":true,"extensions":["xsl","xslt"]},"application/xspf+xml":{"source":"apache","compressible":true,"extensions":["xspf"]},"application/xv+xml":{"source":"iana","compressible":true,"extensions":["mxml","xhvml","xvml","xvm"]},"application/yang":{"source":"iana","extensions":["yang"]},"application/yang-data+json":{"source":"iana","compressible":true},"application/yang-data+xml":{"source":"iana","compressible":true},"application/yang-patch+json":{"source":"iana","compressible":true},"application/yang-patch+xml":{"source":"iana","compressible":true},"application/yin+xml":{"source":"iana","compressible":true,"extensions":["yin"]},"application/zip":{"source":"iana","compressible":false,"extensions":["zip"]},"application/zlib":{"source":"iana"},"application/zstd":{"source":"iana"},"audio/1d-interleaved-parityfec":{"source":"iana"},"audio/32kadpcm":{"source":"iana"},"audio/3gpp":{"source":"iana","compressible":false,"extensions":["3gpp"]},"audio/3gpp2":{"source":"iana"},"audio/aac":{"source":"iana"},"audio/ac3":{"source":"iana"},"audio/adpcm":{"source":"apache","extensions":["adp"]},"audio/amr":{"source":"iana","extensions":["amr"]},"audio/amr-wb":{"source":"iana"},"audio/amr-wb+":{"source":"iana"},"audio/aptx":{"source":"iana"},"audio/asc":{"source":"iana"},"audio/atrac-advanced-lossless":{"source":"iana"},"audio/atrac-x":{"source":"iana"},"audio/atrac3":{"source":"iana"},"audio/basic":{"source":"iana","compressible":false,"extensions":["au","snd"]},"audio/bv16":{"source":"iana"},"audio/bv32":{"source":"iana"},"audio/clearmode":{"source":"iana"},"audio/cn":{"source":"iana"},"audio/dat12":{"source":"iana"},"audio/dls":{"source":"iana"},"audio/dsr-es201108":{"source":"iana"},"audio/dsr-es202050":{"source":"iana"},"audio/dsr-es202211":{"source":"iana"},"audio/dsr-es202212":{"source":"iana"},"audio/dv":{"source":"iana"},"audio/dvi4":{"source":"iana"},"audio/eac3":{"source":"iana"},"audio/encaprtp":{"source":"iana"},"audio/evrc":{"source":"iana"},"audio/evrc-qcp":{"source":"iana"},"audio/evrc0":{"source":"iana"},"audio/evrc1":{"source":"iana"},"audio/evrcb":{"source":"iana"},"audio/evrcb0":{"source":"iana"},"audio/evrcb1":{"source":"iana"},"audio/evrcnw":{"source":"iana"},"audio/evrcnw0":{"source":"iana"},"audio/evrcnw1":{"source":"iana"},"audio/evrcwb":{"source":"iana"},"audio/evrcwb0":{"source":"iana"},"audio/evrcwb1":{"source":"iana"},"audio/evs":{"source":"iana"},"audio/flexfec":{"source":"iana"},"audio/fwdred":{"source":"iana"},"audio/g711-0":{"source":"iana"},"audio/g719":{"source":"iana"},"audio/g722":{"source":"iana"},"audio/g7221":{"source":"iana"},"audio/g723":{"source":"iana"},"audio/g726-16":{"source":"iana"},"audio/g726-24":{"source":"iana"},"audio/g726-32":{"source":"iana"},"audio/g726-40":{"source":"iana"},"audio/g728":{"source":"iana"},"audio/g729":{"source":"iana"},"audio/g7291":{"source":"iana"},"audio/g729d":{"source":"iana"},"audio/g729e":{"source":"iana"},"audio/gsm":{"source":"iana"},"audio/gsm-efr":{"source":"iana"},"audio/gsm-hr-08":{"source":"iana"},"audio/ilbc":{"source":"iana"},"audio/ip-mr_v2.5":{"source":"iana"},"audio/isac":{"source":"apache"},"audio/l16":{"source":"iana"},"audio/l20":{"source":"iana"},"audio/l24":{"source":"iana","compressible":false},"audio/l8":{"source":"iana"},"audio/lpc":{"source":"iana"},"audio/melp":{"source":"iana"},"audio/melp1200":{"source":"iana"},"audio/melp2400":{"source":"iana"},"audio/melp600":{"source":"iana"},"audio/mhas":{"source":"iana"},"audio/midi":{"source":"apache","extensions":["mid","midi","kar","rmi"]},"audio/mobile-xmf":{"source":"iana","extensions":["mxmf"]},"audio/mp3":{"compressible":false,"extensions":["mp3"]},"audio/mp4":{"source":"iana","compressible":false,"extensions":["m4a","mp4a"]},"audio/mp4a-latm":{"source":"iana"},"audio/mpa":{"source":"iana"},"audio/mpa-robust":{"source":"iana"},"audio/mpeg":{"source":"iana","compressible":false,"extensions":["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{"source":"iana"},"audio/musepack":{"source":"apache"},"audio/ogg":{"source":"iana","compressible":false,"extensions":["oga","ogg","spx","opus"]},"audio/opus":{"source":"iana"},"audio/parityfec":{"source":"iana"},"audio/pcma":{"source":"iana"},"audio/pcma-wb":{"source":"iana"},"audio/pcmu":{"source":"iana"},"audio/pcmu-wb":{"source":"iana"},"audio/prs.sid":{"source":"iana"},"audio/qcelp":{"source":"iana"},"audio/raptorfec":{"source":"iana"},"audio/red":{"source":"iana"},"audio/rtp-enc-aescm128":{"source":"iana"},"audio/rtp-midi":{"source":"iana"},"audio/rtploopback":{"source":"iana"},"audio/rtx":{"source":"iana"},"audio/s3m":{"source":"apache","extensions":["s3m"]},"audio/scip":{"source":"iana"},"audio/silk":{"source":"apache","extensions":["sil"]},"audio/smv":{"source":"iana"},"audio/smv-qcp":{"source":"iana"},"audio/smv0":{"source":"iana"},"audio/sofa":{"source":"iana"},"audio/sp-midi":{"source":"iana"},"audio/speex":{"source":"iana"},"audio/t140c":{"source":"iana"},"audio/t38":{"source":"iana"},"audio/telephone-event":{"source":"iana"},"audio/tetra_acelp":{"source":"iana"},"audio/tetra_acelp_bb":{"source":"iana"},"audio/tone":{"source":"iana"},"audio/tsvcis":{"source":"iana"},"audio/uemclip":{"source":"iana"},"audio/ulpfec":{"source":"iana"},"audio/usac":{"source":"iana"},"audio/vdvi":{"source":"iana"},"audio/vmr-wb":{"source":"iana"},"audio/vnd.3gpp.iufp":{"source":"iana"},"audio/vnd.4sb":{"source":"iana"},"audio/vnd.audiokoz":{"source":"iana"},"audio/vnd.celp":{"source":"iana"},"audio/vnd.cisco.nse":{"source":"iana"},"audio/vnd.cmles.radio-events":{"source":"iana"},"audio/vnd.cns.anp1":{"source":"iana"},"audio/vnd.cns.inf1":{"source":"iana"},"audio/vnd.dece.audio":{"source":"iana","extensions":["uva","uvva"]},"audio/vnd.digital-winds":{"source":"iana","extensions":["eol"]},"audio/vnd.dlna.adts":{"source":"iana"},"audio/vnd.dolby.heaac.1":{"source":"iana"},"audio/vnd.dolby.heaac.2":{"source":"iana"},"audio/vnd.dolby.mlp":{"source":"iana"},"audio/vnd.dolby.mps":{"source":"iana"},"audio/vnd.dolby.pl2":{"source":"iana"},"audio/vnd.dolby.pl2x":{"source":"iana"},"audio/vnd.dolby.pl2z":{"source":"iana"},"audio/vnd.dolby.pulse.1":{"source":"iana"},"audio/vnd.dra":{"source":"iana","extensions":["dra"]},"audio/vnd.dts":{"source":"iana","extensions":["dts"]},"audio/vnd.dts.hd":{"source":"iana","extensions":["dtshd"]},"audio/vnd.dts.uhd":{"source":"iana"},"audio/vnd.dvb.file":{"source":"iana"},"audio/vnd.everad.plj":{"source":"iana"},"audio/vnd.hns.audio":{"source":"iana"},"audio/vnd.lucent.voice":{"source":"iana","extensions":["lvp"]},"audio/vnd.ms-playready.media.pya":{"source":"iana","extensions":["pya"]},"audio/vnd.nokia.mobile-xmf":{"source":"iana"},"audio/vnd.nortel.vbk":{"source":"iana"},"audio/vnd.nuera.ecelp4800":{"source":"iana","extensions":["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{"source":"iana","extensions":["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{"source":"iana","extensions":["ecelp9600"]},"audio/vnd.octel.sbc":{"source":"iana"},"audio/vnd.presonus.multitrack":{"source":"iana"},"audio/vnd.qcelp":{"source":"iana"},"audio/vnd.rhetorex.32kadpcm":{"source":"iana"},"audio/vnd.rip":{"source":"iana","extensions":["rip"]},"audio/vnd.rn-realaudio":{"compressible":false},"audio/vnd.sealedmedia.softseal.mpeg":{"source":"iana"},"audio/vnd.vmx.cvsd":{"source":"iana"},"audio/vnd.wave":{"compressible":false},"audio/vorbis":{"source":"iana","compressible":false},"audio/vorbis-config":{"source":"iana"},"audio/wav":{"compressible":false,"extensions":["wav"]},"audio/wave":{"compressible":false,"extensions":["wav"]},"audio/webm":{"source":"apache","compressible":false,"extensions":["weba"]},"audio/x-aac":{"source":"apache","compressible":false,"extensions":["aac"]},"audio/x-aiff":{"source":"apache","extensions":["aif","aiff","aifc"]},"audio/x-caf":{"source":"apache","compressible":false,"extensions":["caf"]},"audio/x-flac":{"source":"apache","extensions":["flac"]},"audio/x-m4a":{"source":"nginx","extensions":["m4a"]},"audio/x-matroska":{"source":"apache","extensions":["mka"]},"audio/x-mpegurl":{"source":"apache","extensions":["m3u"]},"audio/x-ms-wax":{"source":"apache","extensions":["wax"]},"audio/x-ms-wma":{"source":"apache","extensions":["wma"]},"audio/x-pn-realaudio":{"source":"apache","extensions":["ram","ra"]},"audio/x-pn-realaudio-plugin":{"source":"apache","extensions":["rmp"]},"audio/x-realaudio":{"source":"nginx","extensions":["ra"]},"audio/x-tta":{"source":"apache"},"audio/x-wav":{"source":"apache","extensions":["wav"]},"audio/xm":{"source":"apache","extensions":["xm"]},"chemical/x-cdx":{"source":"apache","extensions":["cdx"]},"chemical/x-cif":{"source":"apache","extensions":["cif"]},"chemical/x-cmdf":{"source":"apache","extensions":["cmdf"]},"chemical/x-cml":{"source":"apache","extensions":["cml"]},"chemical/x-csml":{"source":"apache","extensions":["csml"]},"chemical/x-pdb":{"source":"apache"},"chemical/x-xyz":{"source":"apache","extensions":["xyz"]},"font/collection":{"source":"iana","extensions":["ttc"]},"font/otf":{"source":"iana","compressible":true,"extensions":["otf"]},"font/sfnt":{"source":"iana"},"font/ttf":{"source":"iana","compressible":true,"extensions":["ttf"]},"font/woff":{"source":"iana","extensions":["woff"]},"font/woff2":{"source":"iana","extensions":["woff2"]},"image/aces":{"source":"iana","extensions":["exr"]},"image/apng":{"compressible":false,"extensions":["apng"]},"image/avci":{"source":"iana"},"image/avcs":{"source":"iana"},"image/avif":{"source":"iana","compressible":false,"extensions":["avif"]},"image/bmp":{"source":"iana","compressible":true,"extensions":["bmp"]},"image/cgm":{"source":"iana","extensions":["cgm"]},"image/dicom-rle":{"source":"iana","extensions":["drle"]},"image/emf":{"source":"iana","extensions":["emf"]},"image/fits":{"source":"iana","extensions":["fits"]},"image/g3fax":{"source":"iana","extensions":["g3"]},"image/gif":{"source":"iana","compressible":false,"extensions":["gif"]},"image/heic":{"source":"iana","extensions":["heic"]},"image/heic-sequence":{"source":"iana","extensions":["heics"]},"image/heif":{"source":"iana","extensions":["heif"]},"image/heif-sequence":{"source":"iana","extensions":["heifs"]},"image/hej2k":{"source":"iana","extensions":["hej2"]},"image/hsj2":{"source":"iana","extensions":["hsj2"]},"image/ief":{"source":"iana","extensions":["ief"]},"image/jls":{"source":"iana","extensions":["jls"]},"image/jp2":{"source":"iana","compressible":false,"extensions":["jp2","jpg2"]},"image/jpeg":{"source":"iana","compressible":false,"extensions":["jpeg","jpg","jpe"]},"image/jph":{"source":"iana","extensions":["jph"]},"image/jphc":{"source":"iana","extensions":["jhc"]},"image/jpm":{"source":"iana","compressible":false,"extensions":["jpm"]},"image/jpx":{"source":"iana","compressible":false,"extensions":["jpx","jpf"]},"image/jxr":{"source":"iana","extensions":["jxr"]},"image/jxra":{"source":"iana","extensions":["jxra"]},"image/jxrs":{"source":"iana","extensions":["jxrs"]},"image/jxs":{"source":"iana","extensions":["jxs"]},"image/jxsc":{"source":"iana","extensions":["jxsc"]},"image/jxsi":{"source":"iana","extensions":["jxsi"]},"image/jxss":{"source":"iana","extensions":["jxss"]},"image/ktx":{"source":"iana","extensions":["ktx"]},"image/ktx2":{"source":"iana","extensions":["ktx2"]},"image/naplps":{"source":"iana"},"image/pjpeg":{"compressible":false},"image/png":{"source":"iana","compressible":false,"extensions":["png"]},"image/prs.btif":{"source":"iana","extensions":["btif"]},"image/prs.pti":{"source":"iana","extensions":["pti"]},"image/pwg-raster":{"source":"iana"},"image/sgi":{"source":"apache","extensions":["sgi"]},"image/svg+xml":{"source":"iana","compressible":true,"extensions":["svg","svgz"]},"image/t38":{"source":"iana","extensions":["t38"]},"image/tiff":{"source":"iana","compressible":false,"extensions":["tif","tiff"]},"image/tiff-fx":{"source":"iana","extensions":["tfx"]},"image/vnd.adobe.photoshop":{"source":"iana","compressible":true,"extensions":["psd"]},"image/vnd.airzip.accelerator.azv":{"source":"iana","extensions":["azv"]},"image/vnd.cns.inf2":{"source":"iana"},"image/vnd.dece.graphic":{"source":"iana","extensions":["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{"source":"iana","extensions":["djvu","djv"]},"image/vnd.dvb.subtitle":{"source":"iana","extensions":["sub"]},"image/vnd.dwg":{"source":"iana","extensions":["dwg"]},"image/vnd.dxf":{"source":"iana","extensions":["dxf"]},"image/vnd.fastbidsheet":{"source":"iana","extensions":["fbs"]},"image/vnd.fpx":{"source":"iana","extensions":["fpx"]},"image/vnd.fst":{"source":"iana","extensions":["fst"]},"image/vnd.fujixerox.edmics-mmr":{"source":"iana","extensions":["mmr"]},"image/vnd.fujixerox.edmics-rlc":{"source":"iana","extensions":["rlc"]},"image/vnd.globalgraphics.pgb":{"source":"iana"},"image/vnd.microsoft.icon":{"source":"iana","extensions":["ico"]},"image/vnd.mix":{"source":"iana"},"image/vnd.mozilla.apng":{"source":"iana"},"image/vnd.ms-dds":{"extensions":["dds"]},"image/vnd.ms-modi":{"source":"iana","extensions":["mdi"]},"image/vnd.ms-photo":{"source":"apache","extensions":["wdp"]},"image/vnd.net-fpx":{"source":"iana","extensions":["npx"]},"image/vnd.pco.b16":{"source":"iana","extensions":["b16"]},"image/vnd.radiance":{"source":"iana"},"image/vnd.sealed.png":{"source":"iana"},"image/vnd.sealedmedia.softseal.gif":{"source":"iana"},"image/vnd.sealedmedia.softseal.jpg":{"source":"iana"},"image/vnd.svf":{"source":"iana"},"image/vnd.tencent.tap":{"source":"iana","extensions":["tap"]},"image/vnd.valve.source.texture":{"source":"iana","extensions":["vtf"]},"image/vnd.wap.wbmp":{"source":"iana","extensions":["wbmp"]},"image/vnd.xiff":{"source":"iana","extensions":["xif"]},"image/vnd.zbrush.pcx":{"source":"iana","extensions":["pcx"]},"image/webp":{"source":"apache","extensions":["webp"]},"image/wmf":{"source":"iana","extensions":["wmf"]},"image/x-3ds":{"source":"apache","extensions":["3ds"]},"image/x-cmu-raster":{"source":"apache","extensions":["ras"]},"image/x-cmx":{"source":"apache","extensions":["cmx"]},"image/x-freehand":{"source":"apache","extensions":["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{"source":"apache","compressible":true,"extensions":["ico"]},"image/x-jng":{"source":"nginx","extensions":["jng"]},"image/x-mrsid-image":{"source":"apache","extensions":["sid"]},"image/x-ms-bmp":{"source":"nginx","compressible":true,"extensions":["bmp"]},"image/x-pcx":{"source":"apache","extensions":["pcx"]},"image/x-pict":{"source":"apache","extensions":["pic","pct"]},"image/x-portable-anymap":{"source":"apache","extensions":["pnm"]},"image/x-portable-bitmap":{"source":"apache","extensions":["pbm"]},"image/x-portable-graymap":{"source":"apache","extensions":["pgm"]},"image/x-portable-pixmap":{"source":"apache","extensions":["ppm"]},"image/x-rgb":{"source":"apache","extensions":["rgb"]},"image/x-tga":{"source":"apache","extensions":["tga"]},"image/x-xbitmap":{"source":"apache","extensions":["xbm"]},"image/x-xcf":{"compressible":false},"image/x-xpixmap":{"source":"apache","extensions":["xpm"]},"image/x-xwindowdump":{"source":"apache","extensions":["xwd"]},"message/cpim":{"source":"iana"},"message/delivery-status":{"source":"iana"},"message/disposition-notification":{"source":"iana","extensions":["disposition-notification"]},"message/external-body":{"source":"iana"},"message/feedback-report":{"source":"iana"},"message/global":{"source":"iana","extensions":["u8msg"]},"message/global-delivery-status":{"source":"iana","extensions":["u8dsn"]},"message/global-disposition-notification":{"source":"iana","extensions":["u8mdn"]},"message/global-headers":{"source":"iana","extensions":["u8hdr"]},"message/http":{"source":"iana","compressible":false},"message/imdn+xml":{"source":"iana","compressible":true},"message/news":{"source":"iana"},"message/partial":{"source":"iana","compressible":false},"message/rfc822":{"source":"iana","compressible":true,"extensions":["eml","mime"]},"message/s-http":{"source":"iana"},"message/sip":{"source":"iana"},"message/sipfrag":{"source":"iana"},"message/tracking-status":{"source":"iana"},"message/vnd.si.simp":{"source":"iana"},"message/vnd.wfa.wsc":{"source":"iana","extensions":["wsc"]},"model/3mf":{"source":"iana","extensions":["3mf"]},"model/e57":{"source":"iana"},"model/gltf+json":{"source":"iana","compressible":true,"extensions":["gltf"]},"model/gltf-binary":{"source":"iana","compressible":true,"extensions":["glb"]},"model/iges":{"source":"iana","compressible":false,"extensions":["igs","iges"]},"model/mesh":{"source":"iana","compressible":false,"extensions":["msh","mesh","silo"]},"model/mtl":{"source":"iana","extensions":["mtl"]},"model/obj":{"source":"iana","extensions":["obj"]},"model/stl":{"source":"iana","extensions":["stl"]},"model/vnd.collada+xml":{"source":"iana","compressible":true,"extensions":["dae"]},"model/vnd.dwf":{"source":"iana","extensions":["dwf"]},"model/vnd.flatland.3dml":{"source":"iana"},"model/vnd.gdl":{"source":"iana","extensions":["gdl"]},"model/vnd.gs-gdl":{"source":"apache"},"model/vnd.gs.gdl":{"source":"iana"},"model/vnd.gtw":{"source":"iana","extensions":["gtw"]},"model/vnd.moml+xml":{"source":"iana","compressible":true},"model/vnd.mts":{"source":"iana","extensions":["mts"]},"model/vnd.opengex":{"source":"iana","extensions":["ogex"]},"model/vnd.parasolid.transmit.binary":{"source":"iana","extensions":["x_b"]},"model/vnd.parasolid.transmit.text":{"source":"iana","extensions":["x_t"]},"model/vnd.pytha.pyox":{"source":"iana"},"model/vnd.rosette.annotated-data-model":{"source":"iana"},"model/vnd.sap.vds":{"source":"iana","extensions":["vds"]},"model/vnd.usdz+zip":{"source":"iana","compressible":false,"extensions":["usdz"]},"model/vnd.valve.source.compiled-map":{"source":"iana","extensions":["bsp"]},"model/vnd.vtu":{"source":"iana","extensions":["vtu"]},"model/vrml":{"source":"iana","compressible":false,"extensions":["wrl","vrml"]},"model/x3d+binary":{"source":"apache","compressible":false,"extensions":["x3db","x3dbz"]},"model/x3d+fastinfoset":{"source":"iana","extensions":["x3db"]},"model/x3d+vrml":{"source":"apache","compressible":false,"extensions":["x3dv","x3dvz"]},"model/x3d+xml":{"source":"iana","compressible":true,"extensions":["x3d","x3dz"]},"model/x3d-vrml":{"source":"iana","extensions":["x3dv"]},"multipart/alternative":{"source":"iana","compressible":false},"multipart/appledouble":{"source":"iana"},"multipart/byteranges":{"source":"iana"},"multipart/digest":{"source":"iana"},"multipart/encrypted":{"source":"iana","compressible":false},"multipart/form-data":{"source":"iana","compressible":false},"multipart/header-set":{"source":"iana"},"multipart/mixed":{"source":"iana"},"multipart/multilingual":{"source":"iana"},"multipart/parallel":{"source":"iana"},"multipart/related":{"source":"iana","compressible":false},"multipart/report":{"source":"iana"},"multipart/signed":{"source":"iana","compressible":false},"multipart/vnd.bint.med-plus":{"source":"iana"},"multipart/voice-message":{"source":"iana"},"multipart/x-mixed-replace":{"source":"iana"},"text/1d-interleaved-parityfec":{"source":"iana"},"text/cache-manifest":{"source":"iana","compressible":true,"extensions":["appcache","manifest"]},"text/calendar":{"source":"iana","extensions":["ics","ifb"]},"text/calender":{"compressible":true},"text/cmd":{"compressible":true},"text/coffeescript":{"extensions":["coffee","litcoffee"]},"text/cql":{"source":"iana"},"text/cql-expression":{"source":"iana"},"text/cql-identifier":{"source":"iana"},"text/css":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["css"]},"text/csv":{"source":"iana","compressible":true,"extensions":["csv"]},"text/csv-schema":{"source":"iana"},"text/directory":{"source":"iana"},"text/dns":{"source":"iana"},"text/ecmascript":{"source":"iana"},"text/encaprtp":{"source":"iana"},"text/enriched":{"source":"iana"},"text/fhirpath":{"source":"iana"},"text/flexfec":{"source":"iana"},"text/fwdred":{"source":"iana"},"text/gff3":{"source":"iana"},"text/grammar-ref-list":{"source":"iana"},"text/html":{"source":"iana","compressible":true,"extensions":["html","htm","shtml"]},"text/jade":{"extensions":["jade"]},"text/javascript":{"source":"iana","compressible":true},"text/jcr-cnd":{"source":"iana"},"text/jsx":{"compressible":true,"extensions":["jsx"]},"text/less":{"compressible":true,"extensions":["less"]},"text/markdown":{"source":"iana","compressible":true,"extensions":["markdown","md"]},"text/mathml":{"source":"nginx","extensions":["mml"]},"text/mdx":{"compressible":true,"extensions":["mdx"]},"text/mizar":{"source":"iana"},"text/n3":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["n3"]},"text/parameters":{"source":"iana","charset":"UTF-8"},"text/parityfec":{"source":"iana"},"text/plain":{"source":"iana","compressible":true,"extensions":["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{"source":"iana","charset":"UTF-8"},"text/prs.fallenstein.rst":{"source":"iana"},"text/prs.lines.tag":{"source":"iana","extensions":["dsc"]},"text/prs.prop.logic":{"source":"iana"},"text/raptorfec":{"source":"iana"},"text/red":{"source":"iana"},"text/rfc822-headers":{"source":"iana"},"text/richtext":{"source":"iana","compressible":true,"extensions":["rtx"]},"text/rtf":{"source":"iana","compressible":true,"extensions":["rtf"]},"text/rtp-enc-aescm128":{"source":"iana"},"text/rtploopback":{"source":"iana"},"text/rtx":{"source":"iana"},"text/sgml":{"source":"iana","extensions":["sgml","sgm"]},"text/shaclc":{"source":"iana"},"text/shex":{"source":"iana","extensions":["shex"]},"text/slim":{"extensions":["slim","slm"]},"text/spdx":{"source":"iana","extensions":["spdx"]},"text/strings":{"source":"iana"},"text/stylus":{"extensions":["stylus","styl"]},"text/t140":{"source":"iana"},"text/tab-separated-values":{"source":"iana","compressible":true,"extensions":["tsv"]},"text/troff":{"source":"iana","extensions":["t","tr","roff","man","me","ms"]},"text/turtle":{"source":"iana","charset":"UTF-8","extensions":["ttl"]},"text/ulpfec":{"source":"iana"},"text/uri-list":{"source":"iana","compressible":true,"extensions":["uri","uris","urls"]},"text/vcard":{"source":"iana","compressible":true,"extensions":["vcard"]},"text/vnd.a":{"source":"iana"},"text/vnd.abc":{"source":"iana"},"text/vnd.ascii-art":{"source":"iana"},"text/vnd.curl":{"source":"iana","extensions":["curl"]},"text/vnd.curl.dcurl":{"source":"apache","extensions":["dcurl"]},"text/vnd.curl.mcurl":{"source":"apache","extensions":["mcurl"]},"text/vnd.curl.scurl":{"source":"apache","extensions":["scurl"]},"text/vnd.debian.copyright":{"source":"iana","charset":"UTF-8"},"text/vnd.dmclientscript":{"source":"iana"},"text/vnd.dvb.subtitle":{"source":"iana","extensions":["sub"]},"text/vnd.esmertec.theme-descriptor":{"source":"iana","charset":"UTF-8"},"text/vnd.ficlab.flt":{"source":"iana"},"text/vnd.fly":{"source":"iana","extensions":["fly"]},"text/vnd.fmi.flexstor":{"source":"iana","extensions":["flx"]},"text/vnd.gml":{"source":"iana"},"text/vnd.graphviz":{"source":"iana","extensions":["gv"]},"text/vnd.hans":{"source":"iana"},"text/vnd.hgl":{"source":"iana"},"text/vnd.in3d.3dml":{"source":"iana","extensions":["3dml"]},"text/vnd.in3d.spot":{"source":"iana","extensions":["spot"]},"text/vnd.iptc.newsml":{"source":"iana"},"text/vnd.iptc.nitf":{"source":"iana"},"text/vnd.latex-z":{"source":"iana"},"text/vnd.motorola.reflex":{"source":"iana"},"text/vnd.ms-mediapackage":{"source":"iana"},"text/vnd.net2phone.commcenter.command":{"source":"iana"},"text/vnd.radisys.msml-basic-layout":{"source":"iana"},"text/vnd.senx.warpscript":{"source":"iana"},"text/vnd.si.uricatalogue":{"source":"iana"},"text/vnd.sosi":{"source":"iana"},"text/vnd.sun.j2me.app-descriptor":{"source":"iana","charset":"UTF-8","extensions":["jad"]},"text/vnd.trolltech.linguist":{"source":"iana","charset":"UTF-8"},"text/vnd.wap.si":{"source":"iana"},"text/vnd.wap.sl":{"source":"iana"},"text/vnd.wap.wml":{"source":"iana","extensions":["wml"]},"text/vnd.wap.wmlscript":{"source":"iana","extensions":["wmls"]},"text/vtt":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["vtt"]},"text/x-asm":{"source":"apache","extensions":["s","asm"]},"text/x-c":{"source":"apache","extensions":["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{"source":"nginx","extensions":["htc"]},"text/x-fortran":{"source":"apache","extensions":["f","for","f77","f90"]},"text/x-gwt-rpc":{"compressible":true},"text/x-handlebars-template":{"extensions":["hbs"]},"text/x-java-source":{"source":"apache","extensions":["java"]},"text/x-jquery-tmpl":{"compressible":true},"text/x-lua":{"extensions":["lua"]},"text/x-markdown":{"compressible":true,"extensions":["mkd"]},"text/x-nfo":{"source":"apache","extensions":["nfo"]},"text/x-opml":{"source":"apache","extensions":["opml"]},"text/x-org":{"compressible":true,"extensions":["org"]},"text/x-pascal":{"source":"apache","extensions":["p","pas"]},"text/x-processing":{"compressible":true,"extensions":["pde"]},"text/x-sass":{"extensions":["sass"]},"text/x-scss":{"extensions":["scss"]},"text/x-setext":{"source":"apache","extensions":["etx"]},"text/x-sfv":{"source":"apache","extensions":["sfv"]},"text/x-suse-ymp":{"compressible":true,"extensions":["ymp"]},"text/x-uuencode":{"source":"apache","extensions":["uu"]},"text/x-vcalendar":{"source":"apache","extensions":["vcs"]},"text/x-vcard":{"source":"apache","extensions":["vcf"]},"text/xml":{"source":"iana","compressible":true,"extensions":["xml"]},"text/xml-external-parsed-entity":{"source":"iana"},"text/yaml":{"compressible":true,"extensions":["yaml","yml"]},"video/1d-interleaved-parityfec":{"source":"iana"},"video/3gpp":{"source":"iana","extensions":["3gp","3gpp"]},"video/3gpp-tt":{"source":"iana"},"video/3gpp2":{"source":"iana","extensions":["3g2"]},"video/av1":{"source":"iana"},"video/bmpeg":{"source":"iana"},"video/bt656":{"source":"iana"},"video/celb":{"source":"iana"},"video/dv":{"source":"iana"},"video/encaprtp":{"source":"iana"},"video/ffv1":{"source":"iana"},"video/flexfec":{"source":"iana"},"video/h261":{"source":"iana","extensions":["h261"]},"video/h263":{"source":"iana","extensions":["h263"]},"video/h263-1998":{"source":"iana"},"video/h263-2000":{"source":"iana"},"video/h264":{"source":"iana","extensions":["h264"]},"video/h264-rcdo":{"source":"iana"},"video/h264-svc":{"source":"iana"},"video/h265":{"source":"iana"},"video/iso.segment":{"source":"iana","extensions":["m4s"]},"video/jpeg":{"source":"iana","extensions":["jpgv"]},"video/jpeg2000":{"source":"iana"},"video/jpm":{"source":"apache","extensions":["jpm","jpgm"]},"video/mj2":{"source":"iana","extensions":["mj2","mjp2"]},"video/mp1s":{"source":"iana"},"video/mp2p":{"source":"iana"},"video/mp2t":{"source":"iana","extensions":["ts"]},"video/mp4":{"source":"iana","compressible":false,"extensions":["mp4","mp4v","mpg4"]},"video/mp4v-es":{"source":"iana"},"video/mpeg":{"source":"iana","compressible":false,"extensions":["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{"source":"iana"},"video/mpv":{"source":"iana"},"video/nv":{"source":"iana"},"video/ogg":{"source":"iana","compressible":false,"extensions":["ogv"]},"video/parityfec":{"source":"iana"},"video/pointer":{"source":"iana"},"video/quicktime":{"source":"iana","compressible":false,"extensions":["qt","mov"]},"video/raptorfec":{"source":"iana"},"video/raw":{"source":"iana"},"video/rtp-enc-aescm128":{"source":"iana"},"video/rtploopback":{"source":"iana"},"video/rtx":{"source":"iana"},"video/scip":{"source":"iana"},"video/smpte291":{"source":"iana"},"video/smpte292m":{"source":"iana"},"video/ulpfec":{"source":"iana"},"video/vc1":{"source":"iana"},"video/vc2":{"source":"iana"},"video/vnd.cctv":{"source":"iana"},"video/vnd.dece.hd":{"source":"iana","extensions":["uvh","uvvh"]},"video/vnd.dece.mobile":{"source":"iana","extensions":["uvm","uvvm"]},"video/vnd.dece.mp4":{"source":"iana"},"video/vnd.dece.pd":{"source":"iana","extensions":["uvp","uvvp"]},"video/vnd.dece.sd":{"source":"iana","extensions":["uvs","uvvs"]},"video/vnd.dece.video":{"source":"iana","extensions":["uvv","uvvv"]},"video/vnd.directv.mpeg":{"source":"iana"},"video/vnd.directv.mpeg-tts":{"source":"iana"},"video/vnd.dlna.mpeg-tts":{"source":"iana"},"video/vnd.dvb.file":{"source":"iana","extensions":["dvb"]},"video/vnd.fvt":{"source":"iana","extensions":["fvt"]},"video/vnd.hns.video":{"source":"iana"},"video/vnd.iptvforum.1dparityfec-1010":{"source":"iana"},"video/vnd.iptvforum.1dparityfec-2005":{"source":"iana"},"video/vnd.iptvforum.2dparityfec-1010":{"source":"iana"},"video/vnd.iptvforum.2dparityfec-2005":{"source":"iana"},"video/vnd.iptvforum.ttsavc":{"source":"iana"},"video/vnd.iptvforum.ttsmpeg2":{"source":"iana"},"video/vnd.motorola.video":{"source":"iana"},"video/vnd.motorola.videop":{"source":"iana"},"video/vnd.mpegurl":{"source":"iana","extensions":["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{"source":"iana","extensions":["pyv"]},"video/vnd.nokia.interleaved-multimedia":{"source":"iana"},"video/vnd.nokia.mp4vr":{"source":"iana"},"video/vnd.nokia.videovoip":{"source":"iana"},"video/vnd.objectvideo":{"source":"iana"},"video/vnd.radgamettools.bink":{"source":"iana"},"video/vnd.radgamettools.smacker":{"source":"iana"},"video/vnd.sealed.mpeg1":{"source":"iana"},"video/vnd.sealed.mpeg4":{"source":"iana"},"video/vnd.sealed.swf":{"source":"iana"},"video/vnd.sealedmedia.softseal.mov":{"source":"iana"},"video/vnd.uvvu.mp4":{"source":"iana","extensions":["uvu","uvvu"]},"video/vnd.vivo":{"source":"iana","extensions":["viv"]},"video/vnd.youtube.yt":{"source":"iana"},"video/vp8":{"source":"iana"},"video/webm":{"source":"apache","compressible":false,"extensions":["webm"]},"video/x-f4v":{"source":"apache","extensions":["f4v"]},"video/x-fli":{"source":"apache","extensions":["fli"]},"video/x-flv":{"source":"apache","compressible":false,"extensions":["flv"]},"video/x-m4v":{"source":"apache","extensions":["m4v"]},"video/x-matroska":{"source":"apache","compressible":false,"extensions":["mkv","mk3d","mks"]},"video/x-mng":{"source":"apache","extensions":["mng"]},"video/x-ms-asf":{"source":"apache","extensions":["asf","asx"]},"video/x-ms-vob":{"source":"apache","extensions":["vob"]},"video/x-ms-wm":{"source":"apache","extensions":["wm"]},"video/x-ms-wmv":{"source":"apache","compressible":false,"extensions":["wmv"]},"video/x-ms-wmx":{"source":"apache","extensions":["wmx"]},"video/x-ms-wvx":{"source":"apache","extensions":["wvx"]},"video/x-msvideo":{"source":"apache","extensions":["avi"]},"video/x-sgi-movie":{"source":"apache","extensions":["movie"]},"video/x-smv":{"source":"apache","extensions":["smv"]},"x-conference/x-cooltalk":{"source":"apache","extensions":["ice"]},"x-shader/x-fragment":{"compressible":true},"x-shader/x-vertex":{"compressible":true}}'); /***/ }), @@ -59804,6 +60464,9 @@ var external_path_default = /*#__PURE__*/__nccwpck_require__.n(external_path_); process.on("uncaughtException", (e) => { core.info(`[warning] ${e.message}`); + if (e.stack) { + core.info(e.stack); + } }); const cwd = core.getInput("working-directory"); // TODO: this could be read from .cargo config file directly @@ -59990,6 +60653,11 @@ async function rm(parent, dirent) { async function run() { try { + var cacheOnFailure = core.getInput("cache-on-failure").toLowerCase(); + if (cacheOnFailure !== "true") { + cacheOnFailure = "false"; + } + core.exportVariable("CACHE_ON_FAILURE", cacheOnFailure); core.exportVariable("CARGO_INCREMENTAL", 0); const { paths, key, restoreKeys } = await getCacheConfig(); const bins = await getCargoBins(); diff --git a/dist/save/index.js b/dist/save/index.js index 76cfd80..44e3d2c 100644 --- a/dist/save/index.js +++ b/dist/save/index.js @@ -416,7 +416,7 @@ var __importStar = (this && this.__importStar) || function (mod) { Object.defineProperty(exports, "__esModule", ({ value: true })); const core = __importStar(__nccwpck_require__(2186)); const exec = __importStar(__nccwpck_require__(1514)); -const glob = __importStar(__nccwpck_require__(8090)); +const glob = __importStar(__nccwpck_require__(1597)); const io = __importStar(__nccwpck_require__(7436)); const fs = __importStar(__nccwpck_require__(5747)); const path = __importStar(__nccwpck_require__(5622)); @@ -1196,7 +1196,40 @@ exports.getDownloadOptions = getDownloadOptions; /***/ }), -/***/ 7351: +/***/ 1597: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.create = void 0; +const internal_globber_1 = __nccwpck_require__(7341); +/** + * Constructs a globber + * + * @param patterns Patterns separated by newlines + * @param options Glob options + */ +function create(patterns, options) { + return __awaiter(this, void 0, void 0, function* () { + return yield internal_globber_1.DefaultGlobber.create(patterns, options); + }); +} +exports.create = create; +//# sourceMappingURL=glob.js.map + +/***/ }), + +/***/ 9350: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -1221,81 +1254,39 @@ var __importStar = (this && this.__importStar) || function (mod) { return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.issue = exports.issueCommand = void 0; -const os = __importStar(__nccwpck_require__(2087)); -const utils_1 = __nccwpck_require__(5278); +exports.getOptions = void 0; +const core = __importStar(__nccwpck_require__(2186)); /** - * Commands - * - * Command Format: - * ::name key=value,key=value::message - * - * Examples: - * ::warning::This is the message - * ::set-env name=MY_VAR::some value + * Returns a copy with defaults filled in. */ -function issueCommand(command, properties, message) { - const cmd = new Command(command, properties, message); - process.stdout.write(cmd.toString() + os.EOL); -} -exports.issueCommand = issueCommand; -function issue(name, message = '') { - issueCommand(name, {}, message); -} -exports.issue = issue; -const CMD_STRING = '::'; -class Command { - constructor(command, properties, message) { - if (!command) { - command = 'missing.command'; +function getOptions(copy) { + const result = { + followSymbolicLinks: true, + implicitDescendants: true, + omitBrokenSymbolicLinks: true + }; + if (copy) { + if (typeof copy.followSymbolicLinks === 'boolean') { + result.followSymbolicLinks = copy.followSymbolicLinks; + core.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`); } - this.command = command; - this.properties = properties; - this.message = message; - } - toString() { - let cmdStr = CMD_STRING + this.command; - if (this.properties && Object.keys(this.properties).length > 0) { - cmdStr += ' '; - let first = true; - for (const key in this.properties) { - if (this.properties.hasOwnProperty(key)) { - const val = this.properties[key]; - if (val) { - if (first) { - first = false; - } - else { - cmdStr += ','; - } - cmdStr += `${key}=${escapeProperty(val)}`; - } - } - } + if (typeof copy.implicitDescendants === 'boolean') { + result.implicitDescendants = copy.implicitDescendants; + core.debug(`implicitDescendants '${result.implicitDescendants}'`); + } + if (typeof copy.omitBrokenSymbolicLinks === 'boolean') { + result.omitBrokenSymbolicLinks = copy.omitBrokenSymbolicLinks; + core.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`); } - cmdStr += `${CMD_STRING}${escapeData(this.message)}`; - return cmdStr; } + return result; } -function escapeData(s) { - return utils_1.toCommandValue(s) - .replace(/%/g, '%25') - .replace(/\r/g, '%0D') - .replace(/\n/g, '%0A'); -} -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'); -} -//# sourceMappingURL=command.js.map +exports.getOptions = getOptions; +//# sourceMappingURL=internal-glob-options-helper.js.map /***/ }), -/***/ 2186: +/***/ 7341: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -1328,265 +1319,450 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; +var __asyncValues = (this && this.__asyncValues) || function (o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } +}; +var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); } +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } +}; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0; -const command_1 = __nccwpck_require__(7351); -const file_command_1 = __nccwpck_require__(717); -const utils_1 = __nccwpck_require__(5278); -const os = __importStar(__nccwpck_require__(2087)); +exports.DefaultGlobber = void 0; +const core = __importStar(__nccwpck_require__(2186)); +const fs = __importStar(__nccwpck_require__(5747)); +const globOptionsHelper = __importStar(__nccwpck_require__(9350)); const path = __importStar(__nccwpck_require__(5622)); -/** - * The code to exit an action - */ -var ExitCode; -(function (ExitCode) { - /** - * A code indicating that the action was successful - */ - ExitCode[ExitCode["Success"] = 0] = "Success"; +const patternHelper = __importStar(__nccwpck_require__(5186)); +const internal_match_kind_1 = __nccwpck_require__(836); +const internal_pattern_1 = __nccwpck_require__(5343); +const internal_search_state_1 = __nccwpck_require__(8530); +const IS_WINDOWS = process.platform === 'win32'; +class DefaultGlobber { + constructor(options) { + this.patterns = []; + this.searchPaths = []; + this.options = globOptionsHelper.getOptions(options); + } + getSearchPaths() { + // Return a copy + return this.searchPaths.slice(); + } + glob() { + var e_1, _a; + return __awaiter(this, void 0, void 0, function* () { + const result = []; + try { + for (var _b = __asyncValues(this.globGenerator()), _c; _c = yield _b.next(), !_c.done;) { + const itemPath = _c.value; + result.push(itemPath); + } + } + catch (e_1_1) { e_1 = { error: e_1_1 }; } + finally { + try { + if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b); + } + finally { if (e_1) throw e_1.error; } + } + return result; + }); + } + globGenerator() { + return __asyncGenerator(this, arguments, function* globGenerator_1() { + // Fill in defaults options + const options = globOptionsHelper.getOptions(this.options); + // Implicit descendants? + const patterns = []; + for (const pattern of this.patterns) { + patterns.push(pattern); + if (options.implicitDescendants && + (pattern.trailingSeparator || + pattern.segments[pattern.segments.length - 1] !== '**')) { + patterns.push(new internal_pattern_1.Pattern(pattern.negate, true, pattern.segments.concat('**'))); + } + } + // Push the search paths + const stack = []; + for (const searchPath of patternHelper.getSearchPaths(patterns)) { + core.debug(`Search path '${searchPath}'`); + // Exists? + try { + // Intentionally using lstat. Detection for broken symlink + // will be performed later (if following symlinks). + yield __await(fs.promises.lstat(searchPath)); + } + catch (err) { + if (err.code === 'ENOENT') { + continue; + } + throw err; + } + stack.unshift(new internal_search_state_1.SearchState(searchPath, 1)); + } + // Search + const traversalChain = []; // used to detect cycles + while (stack.length) { + // Pop + const item = stack.pop(); + // Match? + const match = patternHelper.match(patterns, item.path); + const partialMatch = !!match || patternHelper.partialMatch(patterns, item.path); + if (!match && !partialMatch) { + continue; + } + // Stat + const stats = yield __await(DefaultGlobber.stat(item, options, traversalChain) + // Broken symlink, or symlink cycle detected, or no longer exists + ); + // Broken symlink, or symlink cycle detected, or no longer exists + if (!stats) { + continue; + } + // Directory + if (stats.isDirectory()) { + // Matched + if (match & internal_match_kind_1.MatchKind.Directory) { + yield yield __await(item.path); + } + // Descend? + else if (!partialMatch) { + continue; + } + // Push the child items in reverse + const childLevel = item.level + 1; + const childItems = (yield __await(fs.promises.readdir(item.path))).map(x => new internal_search_state_1.SearchState(path.join(item.path, x), childLevel)); + stack.push(...childItems.reverse()); + } + // File + else if (match & internal_match_kind_1.MatchKind.File) { + yield yield __await(item.path); + } + } + }); + } /** - * A code indicating that the action was a failure + * Constructs a DefaultGlobber */ - ExitCode[ExitCode["Failure"] = 1] = "Failure"; -})(ExitCode = exports.ExitCode || (exports.ExitCode = {})); -//----------------------------------------------------------------------- -// Variables -//----------------------------------------------------------------------- -/** - * Sets env variable for this action and future actions in the job - * @param name the name of the variable to set - * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify - */ -// eslint-disable-next-line @typescript-eslint/no-explicit-any -function exportVariable(name, val) { - const convertedVal = utils_1.toCommandValue(val); - process.env[name] = convertedVal; - const filePath = process.env['GITHUB_ENV'] || ''; - if (filePath) { - const delimiter = '_GitHubActionsFileCommandDelimeter_'; - const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`; - file_command_1.issueCommand('ENV', commandValue); + static create(patterns, options) { + return __awaiter(this, void 0, void 0, function* () { + const result = new DefaultGlobber(options); + if (IS_WINDOWS) { + patterns = patterns.replace(/\r\n/g, '\n'); + patterns = patterns.replace(/\r/g, '\n'); + } + const lines = patterns.split('\n').map(x => x.trim()); + for (const line of lines) { + // Empty or comment + if (!line || line.startsWith('#')) { + continue; + } + // Pattern + else { + result.patterns.push(new internal_pattern_1.Pattern(line)); + } + } + result.searchPaths.push(...patternHelper.getSearchPaths(result.patterns)); + return result; + }); } - else { - command_1.issueCommand('set-env', { name }, convertedVal); + static stat(item, options, traversalChain) { + return __awaiter(this, void 0, void 0, function* () { + // Note: + // `stat` returns info about the target of a symlink (or symlink chain) + // `lstat` returns info about a symlink itself + let stats; + if (options.followSymbolicLinks) { + try { + // Use `stat` (following symlinks) + stats = yield fs.promises.stat(item.path); + } + catch (err) { + if (err.code === 'ENOENT') { + if (options.omitBrokenSymbolicLinks) { + core.debug(`Broken symlink '${item.path}'`); + return undefined; + } + throw new Error(`No information found for the path '${item.path}'. This may indicate a broken symbolic link.`); + } + throw err; + } + } + else { + // Use `lstat` (not following symlinks) + stats = yield fs.promises.lstat(item.path); + } + // Note, isDirectory() returns false for the lstat of a symlink + if (stats.isDirectory() && options.followSymbolicLinks) { + // Get the realpath + const realPath = yield fs.promises.realpath(item.path); + // Fixup the traversal chain to match the item level + while (traversalChain.length >= item.level) { + traversalChain.pop(); + } + // Test for a cycle + if (traversalChain.some((x) => x === realPath)) { + core.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`); + return undefined; + } + // Update the traversal chain + traversalChain.push(realPath); + } + return stats; + }); } } -exports.exportVariable = exportVariable; +exports.DefaultGlobber = DefaultGlobber; +//# sourceMappingURL=internal-globber.js.map + +/***/ }), + +/***/ 836: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.MatchKind = void 0; /** - * Registers a secret which will get masked from logs - * @param secret value of the secret + * Indicates whether a pattern matches a path */ -function setSecret(secret) { - command_1.issueCommand('add-mask', {}, secret); -} -exports.setSecret = setSecret; +var MatchKind; +(function (MatchKind) { + /** Not matched */ + MatchKind[MatchKind["None"] = 0] = "None"; + /** Matched if the path is a directory */ + MatchKind[MatchKind["Directory"] = 1] = "Directory"; + /** Matched if the path is a regular file */ + MatchKind[MatchKind["File"] = 2] = "File"; + /** Matched */ + MatchKind[MatchKind["All"] = 3] = "All"; +})(MatchKind = exports.MatchKind || (exports.MatchKind = {})); +//# sourceMappingURL=internal-match-kind.js.map + +/***/ }), + +/***/ 22: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__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)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.safeTrimTrailingSeparator = exports.normalizeSeparators = exports.hasRoot = exports.hasAbsoluteRoot = exports.ensureAbsoluteRoot = exports.dirname = void 0; +const path = __importStar(__nccwpck_require__(5622)); +const assert_1 = __importDefault(__nccwpck_require__(2357)); +const IS_WINDOWS = process.platform === 'win32'; /** - * Prepends inputPath to the PATH (for this action and future actions) - * @param inputPath + * Similar to path.dirname except normalizes the path separators and slightly better handling for Windows UNC paths. + * + * For example, on Linux/macOS: + * - `/ => /` + * - `/hello => /` + * + * For example, on Windows: + * - `C:\ => C:\` + * - `C:\hello => C:\` + * - `C: => C:` + * - `C:hello => C:` + * - `\ => \` + * - `\hello => \` + * - `\\hello => \\hello` + * - `\\hello\world => \\hello\world` */ -function addPath(inputPath) { - const filePath = process.env['GITHUB_PATH'] || ''; - if (filePath) { - file_command_1.issueCommand('PATH', inputPath); +function dirname(p) { + // Normalize slashes and trim unnecessary trailing slash + p = safeTrimTrailingSeparator(p); + // Windows UNC root, e.g. \\hello or \\hello\world + if (IS_WINDOWS && /^\\\\[^\\]+(\\[^\\]+)?$/.test(p)) { + return p; } - else { - command_1.issueCommand('add-path', {}, inputPath); + // Get dirname + let result = path.dirname(p); + // Trim trailing slash for Windows UNC root, e.g. \\hello\world\ + if (IS_WINDOWS && /^\\\\[^\\]+\\[^\\]+\\$/.test(result)) { + result = safeTrimTrailingSeparator(result); } - process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`; + return result; } -exports.addPath = addPath; +exports.dirname = dirname; /** - * Gets the value of an input. - * Unless trimWhitespace is set to false in InputOptions, the value is also trimmed. - * Returns an empty string if the value is not defined. - * - * @param name name of the input to get - * @param options optional. See InputOptions. - * @returns string + * Roots the path if not already rooted. On Windows, relative roots like `\` + * or `C:` are expanded based on the current working directory. */ -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}`); +function ensureAbsoluteRoot(root, itemPath) { + assert_1.default(root, `ensureAbsoluteRoot parameter 'root' must not be empty`); + assert_1.default(itemPath, `ensureAbsoluteRoot parameter 'itemPath' must not be empty`); + // Already rooted + if (hasAbsoluteRoot(itemPath)) { + return itemPath; } - if (options && options.trimWhitespace === false) { - return val; + // Windows + if (IS_WINDOWS) { + // Check for itemPath like C: or C:foo + if (itemPath.match(/^[A-Z]:[^\\/]|^[A-Z]:$/i)) { + let cwd = process.cwd(); + assert_1.default(cwd.match(/^[A-Z]:\\/i), `Expected current directory to start with an absolute drive root. Actual '${cwd}'`); + // Drive letter matches cwd? Expand to cwd + if (itemPath[0].toUpperCase() === cwd[0].toUpperCase()) { + // Drive only, e.g. C: + if (itemPath.length === 2) { + // Preserve specified drive letter case (upper or lower) + return `${itemPath[0]}:\\${cwd.substr(3)}`; + } + // Drive + path, e.g. C:foo + else { + if (!cwd.endsWith('\\')) { + cwd += '\\'; + } + // Preserve specified drive letter case (upper or lower) + return `${itemPath[0]}:\\${cwd.substr(3)}${itemPath.substr(2)}`; + } + } + // Different drive + else { + return `${itemPath[0]}:\\${itemPath.substr(2)}`; + } + } + // Check for itemPath like \ or \foo + else if (normalizeSeparators(itemPath).match(/^\\$|^\\[^\\]/)) { + const cwd = process.cwd(); + assert_1.default(cwd.match(/^[A-Z]:\\/i), `Expected current directory to start with an absolute drive root. Actual '${cwd}'`); + return `${cwd[0]}:\\${itemPath.substr(1)}`; + } } - return val.trim(); -} -exports.getInput = getInput; -/** - * Gets the input value of the boolean type in the YAML 1.2 "core schema" specification. - * Support boolean input list: `true | True | TRUE | false | False | FALSE` . - * The return value is also in boolean type. - * ref: https://yaml.org/spec/1.2/spec.html#id2804923 - * - * @param name name of the input to get - * @param options optional. See InputOptions. - * @returns boolean - */ -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}\n` + - `Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); -} -exports.getBooleanInput = getBooleanInput; -/** - * Sets the value of an output. - * - * @param name name of the output to set - * @param value value to store. Non-string values will be converted to a string via JSON.stringify - */ -// eslint-disable-next-line @typescript-eslint/no-explicit-any -function setOutput(name, value) { - process.stdout.write(os.EOL); - command_1.issueCommand('set-output', { name }, value); -} -exports.setOutput = setOutput; -/** - * Enables or disables the echoing of commands into stdout for the rest of the step. - * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set. - * - */ -function setCommandEcho(enabled) { - command_1.issue('echo', enabled ? 'on' : 'off'); -} -exports.setCommandEcho = setCommandEcho; -//----------------------------------------------------------------------- -// Results -//----------------------------------------------------------------------- -/** - * Sets the action status to failed. - * When the action exits it will be with an exit code of 1 - * @param message add error issue message - */ -function setFailed(message) { - process.exitCode = ExitCode.Failure; - error(message); -} -exports.setFailed = setFailed; -//----------------------------------------------------------------------- -// Logging Commands -//----------------------------------------------------------------------- -/** - * Gets whether Actions Step Debug is on or not - */ -function isDebug() { - return process.env['RUNNER_DEBUG'] === '1'; -} -exports.isDebug = isDebug; -/** - * Writes debug message to user log - * @param message debug message - */ -function debug(message) { - command_1.issueCommand('debug', {}, message); -} -exports.debug = debug; -/** - * Adds an error issue - * @param message error issue message. Errors will be converted to string via toString() - */ -function error(message) { - command_1.issue('error', message instanceof Error ? message.toString() : message); -} -exports.error = error; -/** - * Adds an warning issue - * @param message warning issue message. Errors will be converted to string via toString() - */ -function warning(message) { - command_1.issue('warning', message instanceof Error ? message.toString() : message); -} -exports.warning = warning; -/** - * Writes info to log with console.log. - * @param message info message - */ -function info(message) { - process.stdout.write(message + os.EOL); -} -exports.info = info; -/** - * Begin an output group. - * - * Output until the next `groupEnd` will be foldable in this group - * - * @param name The name of the output group - */ -function startGroup(name) { - command_1.issue('group', name); + assert_1.default(hasAbsoluteRoot(root), `ensureAbsoluteRoot parameter 'root' must have an absolute root`); + // Otherwise ensure root ends with a separator + if (root.endsWith('/') || (IS_WINDOWS && root.endsWith('\\'))) { + // Intentionally empty + } + else { + // Append separator + root += path.sep; + } + return root + itemPath; } -exports.startGroup = startGroup; +exports.ensureAbsoluteRoot = ensureAbsoluteRoot; /** - * End an output group. + * On Linux/macOS, true if path starts with `/`. On Windows, true for paths like: + * `\\hello\share` and `C:\hello` (and using alternate separator). */ -function endGroup() { - command_1.issue('endgroup'); +function hasAbsoluteRoot(itemPath) { + assert_1.default(itemPath, `hasAbsoluteRoot parameter 'itemPath' must not be empty`); + // Normalize separators + itemPath = normalizeSeparators(itemPath); + // Windows + if (IS_WINDOWS) { + // E.g. \\hello\share or C:\hello + return itemPath.startsWith('\\\\') || /^[A-Z]:\\/i.test(itemPath); + } + // E.g. /hello + return itemPath.startsWith('/'); } -exports.endGroup = endGroup; +exports.hasAbsoluteRoot = hasAbsoluteRoot; /** - * Wrap an asynchronous function call in a group. - * - * Returns the same type as the function itself. - * - * @param name The name of the group - * @param fn The function to wrap in the group + * On Linux/macOS, true if path starts with `/`. On Windows, true for paths like: + * `\`, `\hello`, `\\hello\share`, `C:`, and `C:\hello` (and using alternate separator). */ -function group(name, fn) { - return __awaiter(this, void 0, void 0, function* () { - startGroup(name); - let result; - try { - result = yield fn(); - } - finally { - endGroup(); - } - return result; - }); +function hasRoot(itemPath) { + assert_1.default(itemPath, `isRooted parameter 'itemPath' must not be empty`); + // Normalize separators + itemPath = normalizeSeparators(itemPath); + // Windows + if (IS_WINDOWS) { + // E.g. \ or \hello or \\hello + // E.g. C: or C:\hello + return itemPath.startsWith('\\') || /^[A-Z]:/i.test(itemPath); + } + // E.g. /hello + return itemPath.startsWith('/'); } -exports.group = group; -//----------------------------------------------------------------------- -// Wrapper action state -//----------------------------------------------------------------------- +exports.hasRoot = hasRoot; /** - * Saves state for current action, the state can only be retrieved by this action's post job execution. - * - * @param name name of the state to store - * @param value value to store. Non-string values will be converted to a string via JSON.stringify + * Removes redundant slashes and converts `/` to `\` on Windows */ -// eslint-disable-next-line @typescript-eslint/no-explicit-any -function saveState(name, value) { - command_1.issueCommand('save-state', { name }, value); +function normalizeSeparators(p) { + p = p || ''; + // Windows + if (IS_WINDOWS) { + // Convert slashes on Windows + p = p.replace(/\//g, '\\'); + // Remove redundant slashes + const isUnc = /^\\\\+[^\\]/.test(p); // e.g. \\hello + return (isUnc ? '\\' : '') + p.replace(/\\\\+/g, '\\'); // preserve leading \\ for UNC + } + // Remove redundant slashes + return p.replace(/\/\/+/g, '/'); } -exports.saveState = saveState; +exports.normalizeSeparators = normalizeSeparators; /** - * Gets the value of an state set by this action's main execution. - * - * @param name name of the state to get - * @returns string + * Normalizes the path separators and trims the trailing separator (when safe). + * For example, `/foo/ => /foo` but `/ => /` */ -function getState(name) { - return process.env[`STATE_${name}`] || ''; +function safeTrimTrailingSeparator(p) { + // Short-circuit if empty + if (!p) { + return ''; + } + // Normalize separators + p = normalizeSeparators(p); + // No trailing slash + if (!p.endsWith(path.sep)) { + return p; + } + // Check '/' on Linux/macOS and '\' on Windows + if (p === path.sep) { + return p; + } + // On Windows check if drive root. E.g. C:\ + if (IS_WINDOWS && /^[A-Z]:\\$/i.test(p)) { + return p; + } + // Otherwise trim trailing slash + return p.substr(0, p.length - 1); } -exports.getState = getState; -//# sourceMappingURL=core.js.map +exports.safeTrimTrailingSeparator = safeTrimTrailingSeparator; +//# sourceMappingURL=internal-path-helper.js.map /***/ }), -/***/ 717: +/***/ 9413: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; -// For internal use, subject to change. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); @@ -1606,749 +1782,484 @@ var __importStar = (this && this.__importStar) || function (mod) { __setModuleDefault(result, mod); return result; }; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.issueCommand = void 0; -// We use any as a valid input type -/* eslint-disable @typescript-eslint/no-explicit-any */ -const fs = __importStar(__nccwpck_require__(5747)); -const os = __importStar(__nccwpck_require__(2087)); -const utils_1 = __nccwpck_require__(5278); -function issueCommand(command, message) { - const filePath = process.env[`GITHUB_${command}`]; - if (!filePath) { - throw new Error(`Unable to find environment variable for file command ${command}`); - } - if (!fs.existsSync(filePath)) { - throw new Error(`Missing file at path: ${filePath}`); - } - fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, { - encoding: 'utf8' - }); -} -exports.issueCommand = issueCommand; -//# sourceMappingURL=file-command.js.map - -/***/ }), - -/***/ 5278: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -// We use any as a valid input type -/* eslint-disable @typescript-eslint/no-explicit-any */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.toCommandValue = void 0; +exports.Path = void 0; +const path = __importStar(__nccwpck_require__(5622)); +const pathHelper = __importStar(__nccwpck_require__(22)); +const assert_1 = __importDefault(__nccwpck_require__(2357)); +const IS_WINDOWS = process.platform === 'win32'; /** - * Sanitizes an input into a string so it can be passed into issueCommand safely - * @param input input to sanitize into a string + * Helper class for parsing paths into segments */ -function toCommandValue(input) { - if (input === null || input === undefined) { - return ''; +class Path { + /** + * Constructs a Path + * @param itemPath Path or array of segments + */ + constructor(itemPath) { + this.segments = []; + // String + if (typeof itemPath === 'string') { + assert_1.default(itemPath, `Parameter 'itemPath' must not be empty`); + // Normalize slashes and trim unnecessary trailing slash + itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); + // Not rooted + if (!pathHelper.hasRoot(itemPath)) { + this.segments = itemPath.split(path.sep); + } + // Rooted + else { + // Add all segments, while not at the root + let remaining = itemPath; + let dir = pathHelper.dirname(remaining); + while (dir !== remaining) { + // Add the segment + const basename = path.basename(remaining); + this.segments.unshift(basename); + // Truncate the last segment + remaining = dir; + dir = pathHelper.dirname(remaining); + } + // Remainder is the root + this.segments.unshift(remaining); + } + } + // Array + else { + // Must not be empty + assert_1.default(itemPath.length > 0, `Parameter 'itemPath' must not be an empty array`); + // Each segment + for (let i = 0; i < itemPath.length; i++) { + let segment = itemPath[i]; + // Must not be empty + assert_1.default(segment, `Parameter 'itemPath' must not contain any empty segments`); + // Normalize slashes + segment = pathHelper.normalizeSeparators(itemPath[i]); + // Root segment + if (i === 0 && pathHelper.hasRoot(segment)) { + segment = pathHelper.safeTrimTrailingSeparator(segment); + assert_1.default(segment === pathHelper.dirname(segment), `Parameter 'itemPath' root segment contains information for multiple segments`); + this.segments.push(segment); + } + // All other segments + else { + // Must not contain slash + assert_1.default(!segment.includes(path.sep), `Parameter 'itemPath' contains unexpected path separators`); + this.segments.push(segment); + } + } + } } - else if (typeof input === 'string' || input instanceof String) { - return input; + /** + * Converts the path to it's string representation + */ + toString() { + // First segment + let result = this.segments[0]; + // All others + let skipSlash = result.endsWith(path.sep) || (IS_WINDOWS && /^[A-Z]:$/i.test(result)); + for (let i = 1; i < this.segments.length; i++) { + if (skipSlash) { + skipSlash = false; + } + else { + result += path.sep; + } + result += this.segments[i]; + } + return result; } - return JSON.stringify(input); } -exports.toCommandValue = toCommandValue; -//# sourceMappingURL=utils.js.map +exports.Path = Path; +//# sourceMappingURL=internal-path.js.map /***/ }), -/***/ 1514: +/***/ 5186: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; - result["default"] = mod; + if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -const tr = __importStar(__nccwpck_require__(8159)); +exports.partialMatch = exports.match = exports.getSearchPaths = void 0; +const pathHelper = __importStar(__nccwpck_require__(22)); +const internal_match_kind_1 = __nccwpck_require__(836); +const IS_WINDOWS = process.platform === 'win32'; /** - * Exec a command. - * Output will be streamed to the live console. - * Returns promise with return code - * - * @param commandLine command to execute (can include additional args). Must be correctly escaped. - * @param args optional arguments for tool. Escaping is handled by the lib. - * @param options optional exec options. See ExecOptions - * @returns Promise exit code + * Given an array of patterns, returns an array of paths to search. + * Duplicates and paths under other included paths are filtered out. */ -function exec(commandLine, args, options) { - return __awaiter(this, void 0, void 0, function* () { - const commandArgs = tr.argStringToArray(commandLine); - if (commandArgs.length === 0) { - throw new Error(`Parameter 'commandLine' cannot be null or empty.`); +function getSearchPaths(patterns) { + // Ignore negate patterns + patterns = patterns.filter(x => !x.negate); + // Create a map of all search paths + const searchPathMap = {}; + for (const pattern of patterns) { + const key = IS_WINDOWS + ? pattern.searchPath.toUpperCase() + : pattern.searchPath; + searchPathMap[key] = 'candidate'; + } + const result = []; + for (const pattern of patterns) { + // Check if already included + const key = IS_WINDOWS + ? pattern.searchPath.toUpperCase() + : pattern.searchPath; + if (searchPathMap[key] === 'included') { + continue; } - // Path to tool to execute should be first arg - const toolPath = commandArgs[0]; - args = commandArgs.slice(1).concat(args || []); - const runner = new tr.ToolRunner(toolPath, args, options); - return runner.exec(); - }); + // Check for an ancestor search path + let foundAncestor = false; + let tempKey = key; + let parent = pathHelper.dirname(tempKey); + while (parent !== tempKey) { + if (searchPathMap[parent]) { + foundAncestor = true; + break; + } + tempKey = parent; + parent = pathHelper.dirname(tempKey); + } + // Include the search pattern in the result + if (!foundAncestor) { + result.push(pattern.searchPath); + searchPathMap[key] = 'included'; + } + } + return result; } -exports.exec = exec; -//# sourceMappingURL=exec.js.map +exports.getSearchPaths = getSearchPaths; +/** + * Matches the patterns against the path + */ +function match(patterns, itemPath) { + let result = internal_match_kind_1.MatchKind.None; + for (const pattern of patterns) { + if (pattern.negate) { + result &= ~pattern.match(itemPath); + } + else { + result |= pattern.match(itemPath); + } + } + return result; +} +exports.match = match; +/** + * Checks whether to descend further into the directory + */ +function partialMatch(patterns, itemPath) { + return patterns.some(x => !x.negate && x.partialMatch(itemPath)); +} +exports.partialMatch = partialMatch; +//# sourceMappingURL=internal-pattern-helper.js.map /***/ }), -/***/ 8159: +/***/ 5343: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; - result["default"] = mod; + if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); return result; }; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Pattern = void 0; const os = __importStar(__nccwpck_require__(2087)); -const events = __importStar(__nccwpck_require__(8614)); -const child = __importStar(__nccwpck_require__(3129)); const path = __importStar(__nccwpck_require__(5622)); -const io = __importStar(__nccwpck_require__(7436)); -const ioUtil = __importStar(__nccwpck_require__(1962)); -/* eslint-disable @typescript-eslint/unbound-method */ +const pathHelper = __importStar(__nccwpck_require__(22)); +const assert_1 = __importDefault(__nccwpck_require__(2357)); +const minimatch_1 = __nccwpck_require__(3973); +const internal_match_kind_1 = __nccwpck_require__(836); +const internal_path_1 = __nccwpck_require__(9413); const IS_WINDOWS = process.platform === 'win32'; -/* - * Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way. - */ -class ToolRunner extends events.EventEmitter { - constructor(toolPath, args, options) { - super(); - if (!toolPath) { - throw new Error("Parameter 'toolPath' cannot be null or empty."); - } - this.toolPath = toolPath; - this.args = args || []; - this.options = options || {}; - } - _debug(message) { - if (this.options.listeners && this.options.listeners.debug) { - this.options.listeners.debug(message); - } - } - _getCommandString(options, noPrefix) { - const toolPath = this._getSpawnFileName(); - const args = this._getSpawnArgs(options); - let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool - if (IS_WINDOWS) { - // Windows + cmd file - if (this._isCmdFile()) { - cmd += toolPath; - for (const a of args) { - cmd += ` ${a}`; - } - } - // Windows + verbatim - else if (options.windowsVerbatimArguments) { - cmd += `"${toolPath}"`; - for (const a of args) { - cmd += ` ${a}`; - } - } - // Windows (regular) - else { - cmd += this._windowsQuoteCmdArg(toolPath); - for (const a of args) { - cmd += ` ${this._windowsQuoteCmdArg(a)}`; - } - } +class Pattern { + constructor(patternOrNegate, isImplicitPattern = false, segments, homedir) { + /** + * Indicates whether matches should be excluded from the result set + */ + this.negate = false; + // Pattern overload + let pattern; + if (typeof patternOrNegate === 'string') { + pattern = patternOrNegate.trim(); } + // Segments overload else { - // OSX/Linux - this can likely be improved with some form of quoting. - // creating processes on Unix is fundamentally different than Windows. - // on Unix, execvp() takes an arg array. - cmd += toolPath; - for (const a of args) { - cmd += ` ${a}`; + // Convert to pattern + segments = segments || []; + assert_1.default(segments.length, `Parameter 'segments' must not empty`); + const root = Pattern.getLiteral(segments[0]); + assert_1.default(root && pathHelper.hasAbsoluteRoot(root), `Parameter 'segments' first element must be a root path`); + pattern = new internal_path_1.Path(segments).toString().trim(); + if (patternOrNegate) { + pattern = `!${pattern}`; } } - return cmd; + // Negate + while (pattern.startsWith('!')) { + this.negate = !this.negate; + pattern = pattern.substr(1).trim(); + } + // Normalize slashes and ensures absolute root + pattern = Pattern.fixupPattern(pattern, homedir); + // Segments + this.segments = new internal_path_1.Path(pattern).segments; + // Trailing slash indicates the pattern should only match directories, not regular files + this.trailingSeparator = pathHelper + .normalizeSeparators(pattern) + .endsWith(path.sep); + pattern = pathHelper.safeTrimTrailingSeparator(pattern); + // Search path (literal path prior to the first glob segment) + let foundGlob = false; + const searchSegments = this.segments + .map(x => Pattern.getLiteral(x)) + .filter(x => !foundGlob && !(foundGlob = x === '')); + this.searchPath = new internal_path_1.Path(searchSegments).toString(); + // Root RegExp (required when determining partial match) + this.rootRegExp = new RegExp(Pattern.regExpEscape(searchSegments[0]), IS_WINDOWS ? 'i' : ''); + this.isImplicitPattern = isImplicitPattern; + // Create minimatch + const minimatchOptions = { + dot: true, + nobrace: true, + nocase: IS_WINDOWS, + nocomment: true, + noext: true, + nonegate: true + }; + pattern = IS_WINDOWS ? pattern.replace(/\\/g, '/') : pattern; + this.minimatch = new minimatch_1.Minimatch(pattern, minimatchOptions); } - _processLineBuffer(data, strBuffer, onLine) { - try { - let s = strBuffer + data.toString(); - let n = s.indexOf(os.EOL); - while (n > -1) { - const line = s.substring(0, n); - onLine(line); - // the rest of the string ... - s = s.substring(n + os.EOL.length); - n = s.indexOf(os.EOL); + /** + * Matches the pattern against the specified path + */ + match(itemPath) { + // Last segment is globstar? + if (this.segments[this.segments.length - 1] === '**') { + // Normalize slashes + itemPath = pathHelper.normalizeSeparators(itemPath); + // Append a trailing slash. Otherwise Minimatch will not match the directory immediately + // preceding the globstar. For example, given the pattern `/foo/**`, Minimatch returns + // false for `/foo` but returns true for `/foo/`. Append a trailing slash to handle that quirk. + if (!itemPath.endsWith(path.sep) && this.isImplicitPattern === false) { + // Note, this is safe because the constructor ensures the pattern has an absolute root. + // For example, formats like C: and C:foo on Windows are resolved to an absolute root. + itemPath = `${itemPath}${path.sep}`; } - strBuffer = s; } - catch (err) { - // streaming lines to console is best effort. Don't fail a build. - this._debug(`error processing line. Failed with error ${err}`); + else { + // Normalize slashes and trim unnecessary trailing slash + itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); } - } - _getSpawnFileName() { - if (IS_WINDOWS) { - if (this._isCmdFile()) { - return process.env['COMSPEC'] || 'cmd.exe'; - } + // Match + if (this.minimatch.match(itemPath)) { + return this.trailingSeparator ? internal_match_kind_1.MatchKind.Directory : internal_match_kind_1.MatchKind.All; } - return this.toolPath; + return internal_match_kind_1.MatchKind.None; } - _getSpawnArgs(options) { - if (IS_WINDOWS) { - if (this._isCmdFile()) { - let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`; - for (const a of this.args) { - argline += ' '; - argline += options.windowsVerbatimArguments - ? a - : this._windowsQuoteCmdArg(a); - } - argline += '"'; - return [argline]; - } + /** + * Indicates whether the pattern may match descendants of the specified path + */ + partialMatch(itemPath) { + // Normalize slashes and trim unnecessary trailing slash + itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); + // matchOne does not handle root path correctly + if (pathHelper.dirname(itemPath) === itemPath) { + return this.rootRegExp.test(itemPath); } - return this.args; - } - _endsWith(str, end) { - return str.endsWith(end); + return this.minimatch.matchOne(itemPath.split(IS_WINDOWS ? /\\+/ : /\/+/), this.minimatch.set[0], true); } - _isCmdFile() { - const upperToolPath = this.toolPath.toUpperCase(); - return (this._endsWith(upperToolPath, '.CMD') || - this._endsWith(upperToolPath, '.BAT')); + /** + * Escapes glob patterns within a path + */ + static globEscape(s) { + return (IS_WINDOWS ? s : s.replace(/\\/g, '\\\\')) // escape '\' on Linux/macOS + .replace(/(\[)(?=[^/]+\])/g, '[[]') // escape '[' when ']' follows within the path segment + .replace(/\?/g, '[?]') // escape '?' + .replace(/\*/g, '[*]'); // escape '*' } - _windowsQuoteCmdArg(arg) { - // for .exe, apply the normal quoting rules that libuv applies - if (!this._isCmdFile()) { - return this._uvQuoteCmdArg(arg); + /** + * Normalizes slashes and ensures absolute root + */ + static fixupPattern(pattern, homedir) { + // Empty + assert_1.default(pattern, 'pattern cannot be empty'); + // Must not contain `.` segment, unless first segment + // Must not contain `..` segment + const literalSegments = new internal_path_1.Path(pattern).segments.map(x => Pattern.getLiteral(x)); + assert_1.default(literalSegments.every((x, i) => (x !== '.' || i === 0) && x !== '..'), `Invalid pattern '${pattern}'. Relative pathing '.' and '..' is not allowed.`); + // Must not contain globs in root, e.g. Windows UNC path \\foo\b*r + assert_1.default(!pathHelper.hasRoot(pattern) || literalSegments[0], `Invalid pattern '${pattern}'. Root segment must not contain globs.`); + // Normalize slashes + pattern = pathHelper.normalizeSeparators(pattern); + // Replace leading `.` segment + if (pattern === '.' || pattern.startsWith(`.${path.sep}`)) { + pattern = Pattern.globEscape(process.cwd()) + pattern.substr(1); } - // otherwise apply quoting rules specific to the cmd.exe command line parser. - // the libuv rules are generic and are not designed specifically for cmd.exe - // command line parser. - // - // for a detailed description of the cmd.exe command line parser, refer to - // http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912 - // need quotes for empty arg - if (!arg) { - return '""'; + // Replace leading `~` segment + else if (pattern === '~' || pattern.startsWith(`~${path.sep}`)) { + homedir = homedir || os.homedir(); + assert_1.default(homedir, 'Unable to determine HOME directory'); + assert_1.default(pathHelper.hasAbsoluteRoot(homedir), `Expected HOME directory to be a rooted path. Actual '${homedir}'`); + pattern = Pattern.globEscape(homedir) + pattern.substr(1); } - // determine whether the arg needs to be quoted - const cmdSpecialChars = [ - ' ', - '\t', - '&', - '(', - ')', - '[', - ']', - '{', - '}', - '^', - '=', - ';', - '!', - "'", - '+', - ',', - '`', - '~', - '|', - '<', - '>', - '"' - ]; - let needsQuotes = false; - for (const char of arg) { - if (cmdSpecialChars.some(x => x === char)) { - needsQuotes = true; - break; + // Replace relative drive root, e.g. pattern is C: or C:foo + else if (IS_WINDOWS && + (pattern.match(/^[A-Z]:$/i) || pattern.match(/^[A-Z]:[^\\]/i))) { + let root = pathHelper.ensureAbsoluteRoot('C:\\dummy-root', pattern.substr(0, 2)); + if (pattern.length > 2 && !root.endsWith('\\')) { + root += '\\'; } + pattern = Pattern.globEscape(root) + pattern.substr(2); } - // short-circuit if quotes not needed - if (!needsQuotes) { - return arg; - } - // the following quoting rules are very similar to the rules that by libuv applies. - // - // 1) wrap the string in quotes - // - // 2) double-up quotes - i.e. " => "" - // - // this is different from the libuv quoting rules. libuv replaces " with \", which unfortunately - // doesn't work well with a cmd.exe command line. - // - // note, replacing " with "" also works well if the arg is passed to a downstream .NET console app. - // for example, the command line: - // foo.exe "myarg:""my val""" - // is parsed by a .NET console app into an arg array: - // [ "myarg:\"my val\"" ] - // which is the same end result when applying libuv quoting rules. although the actual - // command line from libuv quoting rules would look like: - // foo.exe "myarg:\"my val\"" - // - // 3) double-up slashes that precede a quote, - // e.g. hello \world => "hello \world" - // hello\"world => "hello\\""world" - // hello\\"world => "hello\\\\""world" - // hello world\ => "hello world\\" - // - // technically this is not required for a cmd.exe command line, or the batch argument parser. - // the reasons for including this as a .cmd quoting rule are: - // - // a) this is optimized for the scenario where the argument is passed from the .cmd file to an - // external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule. - // - // b) it's what we've been doing previously (by deferring to node default behavior) and we - // haven't heard any complaints about that aspect. - // - // note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be - // escaped when used on the command line directly - even though within a .cmd file % can be escaped - // by using %%. - // - // the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts - // the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing. - // - // one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would - // often work, since it is unlikely that var^ would exist, and the ^ character is removed when the - // variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args - // to an external program. - // - // an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file. - // % can be escaped within a .cmd file. - let reverse = '"'; - let quoteHit = true; - for (let i = arg.length; i > 0; i--) { - // walk the string in reverse - reverse += arg[i - 1]; - if (quoteHit && arg[i - 1] === '\\') { - reverse += '\\'; // double the slash - } - else if (arg[i - 1] === '"') { - quoteHit = true; - reverse += '"'; // double the quote - } - else { - quoteHit = false; + // Replace relative root, e.g. pattern is \ or \foo + else if (IS_WINDOWS && (pattern === '\\' || pattern.match(/^\\[^\\]/))) { + let root = pathHelper.ensureAbsoluteRoot('C:\\dummy-root', '\\'); + if (!root.endsWith('\\')) { + root += '\\'; } + pattern = Pattern.globEscape(root) + pattern.substr(1); } - reverse += '"'; - return reverse - .split('') - .reverse() - .join(''); - } - _uvQuoteCmdArg(arg) { - // Tool runner wraps child_process.spawn() and needs to apply the same quoting as - // Node in certain cases where the undocumented spawn option windowsVerbatimArguments - // is used. - // - // Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV, - // see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details), - // pasting copyright notice from Node within this function: - // - // Copyright Joyent, Inc. and other Node contributors. All rights reserved. - // - // Permission is hereby granted, free of charge, to any person obtaining a copy - // of this software and associated documentation files (the "Software"), to - // deal in the Software without restriction, including without limitation the - // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - // sell copies of the Software, and to permit persons to whom the Software is - // furnished to do so, subject to the following conditions: - // - // The above copyright notice and this permission notice shall be included in - // all copies or substantial portions of the Software. - // - // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - // IN THE SOFTWARE. - if (!arg) { - // Need double quotation for empty argument - return '""'; - } - if (!arg.includes(' ') && !arg.includes('\t') && !arg.includes('"')) { - // No quotation needed - return arg; - } - if (!arg.includes('"') && !arg.includes('\\')) { - // No embedded double quotes or backslashes, so I can just wrap - // quote marks around the whole thing. - return `"${arg}"`; + // Otherwise ensure absolute root + else { + pattern = pathHelper.ensureAbsoluteRoot(Pattern.globEscape(process.cwd()), pattern); } - // Expected input/output: - // input : hello"world - // output: "hello\"world" - // input : hello""world - // output: "hello\"\"world" - // input : hello\world - // output: hello\world - // input : hello\\world - // output: hello\\world - // input : hello\"world - // output: "hello\\\"world" - // input : hello\\"world - // output: "hello\\\\\"world" - // input : hello world\ - // output: "hello world\\" - note the comment in libuv actually reads "hello world\" - // but it appears the comment is wrong, it should be "hello world\\" - let reverse = '"'; - let quoteHit = true; - for (let i = arg.length; i > 0; i--) { - // walk the string in reverse - reverse += arg[i - 1]; - if (quoteHit && arg[i - 1] === '\\') { - reverse += '\\'; + return pathHelper.normalizeSeparators(pattern); + } + /** + * Attempts to unescape a pattern segment to create a literal path segment. + * Otherwise returns empty string. + */ + static getLiteral(segment) { + let literal = ''; + for (let i = 0; i < segment.length; i++) { + const c = segment[i]; + // Escape + if (c === '\\' && !IS_WINDOWS && i + 1 < segment.length) { + literal += segment[++i]; + continue; } - else if (arg[i - 1] === '"') { - quoteHit = true; - reverse += '\\'; + // Wildcard + else if (c === '*' || c === '?') { + return ''; } - else { - quoteHit = false; + // Character set + else if (c === '[' && i + 1 < segment.length) { + let set = ''; + let closed = -1; + for (let i2 = i + 1; i2 < segment.length; i2++) { + const c2 = segment[i2]; + // Escape + if (c2 === '\\' && !IS_WINDOWS && i2 + 1 < segment.length) { + set += segment[++i2]; + continue; + } + // Closed + else if (c2 === ']') { + closed = i2; + break; + } + // Otherwise + else { + set += c2; + } + } + // Closed? + if (closed >= 0) { + // Cannot convert + if (set.length > 1) { + return ''; + } + // Convert to literal + if (set) { + literal += set; + i = closed; + continue; + } + } + // Otherwise fall thru } + // Append + literal += c; } - reverse += '"'; - return reverse - .split('') - .reverse() - .join(''); - } - _cloneExecOptions(options) { - options = options || {}; - const result = { - cwd: options.cwd || process.cwd(), - env: options.env || process.env, - silent: options.silent || false, - windowsVerbatimArguments: options.windowsVerbatimArguments || false, - failOnStdErr: options.failOnStdErr || false, - ignoreReturnCode: options.ignoreReturnCode || false, - delay: options.delay || 10000 - }; - result.outStream = options.outStream || process.stdout; - result.errStream = options.errStream || process.stderr; - return result; - } - _getSpawnOptions(options, toolPath) { - options = options || {}; - const result = {}; - result.cwd = options.cwd; - result.env = options.env; - result['windowsVerbatimArguments'] = - options.windowsVerbatimArguments || this._isCmdFile(); - if (options.windowsVerbatimArguments) { - result.argv0 = `"${toolPath}"`; - } - return result; + return literal; } /** - * Exec a tool. - * Output will be streamed to the live console. - * Returns promise with return code - * - * @param tool path to tool to exec - * @param options optional exec options. See ExecOptions - * @returns number + * Escapes regexp special characters + * https://javascript.info/regexp-escaping */ - exec() { - return __awaiter(this, void 0, void 0, function* () { - // root the tool path if it is unrooted and contains relative pathing - if (!ioUtil.isRooted(this.toolPath) && - (this.toolPath.includes('/') || - (IS_WINDOWS && this.toolPath.includes('\\')))) { - // prefer options.cwd if it is specified, however options.cwd may also need to be rooted - this.toolPath = path.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); - } - // if the tool is only a file name, then resolve it from the PATH - // otherwise verify it exists (add extension on Windows if necessary) - this.toolPath = yield io.which(this.toolPath, true); - return new Promise((resolve, reject) => { - this._debug(`exec tool: ${this.toolPath}`); - this._debug('arguments:'); - for (const arg of this.args) { - this._debug(` ${arg}`); - } - const optionsNonNull = this._cloneExecOptions(this.options); - if (!optionsNonNull.silent && optionsNonNull.outStream) { - optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL); - } - const state = new ExecState(optionsNonNull, this.toolPath); - state.on('debug', (message) => { - this._debug(message); - }); - const fileName = this._getSpawnFileName(); - const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName)); - const stdbuffer = ''; - if (cp.stdout) { - cp.stdout.on('data', (data) => { - if (this.options.listeners && this.options.listeners.stdout) { - this.options.listeners.stdout(data); - } - if (!optionsNonNull.silent && optionsNonNull.outStream) { - optionsNonNull.outStream.write(data); - } - this._processLineBuffer(data, stdbuffer, (line) => { - if (this.options.listeners && this.options.listeners.stdline) { - this.options.listeners.stdline(line); - } - }); - }); - } - const errbuffer = ''; - if (cp.stderr) { - cp.stderr.on('data', (data) => { - state.processStderr = true; - if (this.options.listeners && this.options.listeners.stderr) { - this.options.listeners.stderr(data); - } - if (!optionsNonNull.silent && - optionsNonNull.errStream && - optionsNonNull.outStream) { - const s = optionsNonNull.failOnStdErr - ? optionsNonNull.errStream - : optionsNonNull.outStream; - s.write(data); - } - this._processLineBuffer(data, errbuffer, (line) => { - if (this.options.listeners && this.options.listeners.errline) { - this.options.listeners.errline(line); - } - }); - }); - } - cp.on('error', (err) => { - state.processError = err.message; - state.processExited = true; - state.processClosed = true; - state.CheckComplete(); - }); - cp.on('exit', (code) => { - state.processExitCode = code; - state.processExited = true; - this._debug(`Exit code ${code} received from tool '${this.toolPath}'`); - state.CheckComplete(); - }); - cp.on('close', (code) => { - state.processExitCode = code; - state.processExited = true; - state.processClosed = true; - this._debug(`STDIO streams have closed for tool '${this.toolPath}'`); - state.CheckComplete(); - }); - state.on('done', (error, exitCode) => { - if (stdbuffer.length > 0) { - this.emit('stdline', stdbuffer); - } - if (errbuffer.length > 0) { - this.emit('errline', errbuffer); - } - cp.removeAllListeners(); - if (error) { - reject(error); - } - else { - resolve(exitCode); - } - }); - if (this.options.input) { - if (!cp.stdin) { - throw new Error('child process missing stdin'); - } - cp.stdin.end(this.options.input); - } - }); - }); - } -} -exports.ToolRunner = ToolRunner; -/** - * Convert an arg string to an array of args. Handles escaping - * - * @param argString string of arguments - * @returns string[] array of arguments - */ -function argStringToArray(argString) { - const args = []; - let inQuotes = false; - let escaped = false; - let arg = ''; - function append(c) { - // we only escape double quotes. - if (escaped && c !== '"') { - arg += '\\'; - } - arg += c; - escaped = false; - } - for (let i = 0; i < argString.length; i++) { - const c = argString.charAt(i); - if (c === '"') { - if (!escaped) { - inQuotes = !inQuotes; - } - else { - append(c); - } - continue; - } - if (c === '\\' && escaped) { - append(c); - continue; - } - if (c === '\\' && inQuotes) { - escaped = true; - continue; - } - if (c === ' ' && !inQuotes) { - if (arg.length > 0) { - args.push(arg); - arg = ''; - } - continue; - } - append(c); - } - if (arg.length > 0) { - args.push(arg.trim()); - } - return args; -} -exports.argStringToArray = argStringToArray; -class ExecState extends events.EventEmitter { - constructor(options, toolPath) { - super(); - this.processClosed = false; // tracks whether the process has exited and stdio is closed - this.processError = ''; - this.processExitCode = 0; - this.processExited = false; // tracks whether the process has exited - this.processStderr = false; // tracks whether stderr was written to - this.delay = 10000; // 10 seconds - this.done = false; - this.timeout = null; - if (!toolPath) { - throw new Error('toolPath must not be empty'); - } - this.options = options; - this.toolPath = toolPath; - if (options.delay) { - this.delay = options.delay; - } - } - CheckComplete() { - if (this.done) { - return; - } - if (this.processClosed) { - this._setResult(); - } - else if (this.processExited) { - this.timeout = setTimeout(ExecState.HandleTimeout, this.delay, this); - } - } - _debug(message) { - this.emit('debug', message); - } - _setResult() { - // determine whether there is an error - let error; - if (this.processExited) { - if (this.processError) { - error = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`); - } - else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) { - error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`); - } - else if (this.processStderr && this.options.failOnStdErr) { - error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`); - } - } - // clear the timeout - if (this.timeout) { - clearTimeout(this.timeout); - this.timeout = null; - } - this.done = true; - this.emit('done', error, this.processExitCode); - } - static HandleTimeout(state) { - if (state.done) { - return; - } - if (!state.processClosed && state.processExited) { - const message = `The STDIO streams did not close within ${state.delay / - 1000} seconds of the exit event from process '${state.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`; - state._debug(message); - } - state._setResult(); + static regExpEscape(s) { + return s.replace(/[[\\^$.|?*+()]/g, '\\$&'); } } -//# sourceMappingURL=toolrunner.js.map +exports.Pattern = Pattern; +//# sourceMappingURL=internal-pattern.js.map /***/ }), -/***/ 8090: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 8530: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.create = void 0; -const internal_globber_1 = __nccwpck_require__(8298); -/** - * Constructs a globber - * - * @param patterns Patterns separated by newlines - * @param options Glob options - */ -function create(patterns, options) { - return __awaiter(this, void 0, void 0, function* () { - return yield internal_globber_1.DefaultGlobber.create(patterns, options); - }); +exports.SearchState = void 0; +class SearchState { + constructor(path, level) { + this.path = path; + this.level = level; + } } -exports.create = create; -//# sourceMappingURL=glob.js.map +exports.SearchState = SearchState; +//# sourceMappingURL=internal-search-state.js.map /***/ }), -/***/ 1026: +/***/ 7351: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -2373,39 +2284,81 @@ var __importStar = (this && this.__importStar) || function (mod) { return result; }; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getOptions = void 0; -const core = __importStar(__nccwpck_require__(2186)); +exports.issue = exports.issueCommand = void 0; +const os = __importStar(__nccwpck_require__(2087)); +const utils_1 = __nccwpck_require__(5278); /** - * Returns a copy with defaults filled in. + * Commands + * + * Command Format: + * ::name key=value,key=value::message + * + * Examples: + * ::warning::This is the message + * ::set-env name=MY_VAR::some value */ -function getOptions(copy) { - const result = { - followSymbolicLinks: true, - implicitDescendants: true, - omitBrokenSymbolicLinks: true - }; - if (copy) { - if (typeof copy.followSymbolicLinks === 'boolean') { - result.followSymbolicLinks = copy.followSymbolicLinks; - core.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`); - } - if (typeof copy.implicitDescendants === 'boolean') { - result.implicitDescendants = copy.implicitDescendants; - core.debug(`implicitDescendants '${result.implicitDescendants}'`); +function issueCommand(command, properties, message) { + const cmd = new Command(command, properties, message); + process.stdout.write(cmd.toString() + os.EOL); +} +exports.issueCommand = issueCommand; +function issue(name, message = '') { + issueCommand(name, {}, message); +} +exports.issue = issue; +const CMD_STRING = '::'; +class Command { + constructor(command, properties, message) { + if (!command) { + command = 'missing.command'; } - if (typeof copy.omitBrokenSymbolicLinks === 'boolean') { - result.omitBrokenSymbolicLinks = copy.omitBrokenSymbolicLinks; - core.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`); + this.command = command; + this.properties = properties; + this.message = message; + } + toString() { + let cmdStr = CMD_STRING + this.command; + if (this.properties && Object.keys(this.properties).length > 0) { + cmdStr += ' '; + let first = true; + for (const key in this.properties) { + if (this.properties.hasOwnProperty(key)) { + const val = this.properties[key]; + if (val) { + if (first) { + first = false; + } + else { + cmdStr += ','; + } + cmdStr += `${key}=${escapeProperty(val)}`; + } + } + } } + cmdStr += `${CMD_STRING}${escapeData(this.message)}`; + return cmdStr; } - return result; } -exports.getOptions = getOptions; -//# sourceMappingURL=internal-glob-options-helper.js.map +function escapeData(s) { + return utils_1.toCommandValue(s) + .replace(/%/g, '%25') + .replace(/\r/g, '%0D') + .replace(/\n/g, '%0A'); +} +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'); +} +//# sourceMappingURL=command.js.map /***/ }), -/***/ 8298: +/***/ 2186: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -2438,245 +2391,280 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; -var __asyncValues = (this && this.__asyncValues) || function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } -}; -var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); } -var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } -}; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DefaultGlobber = void 0; -const core = __importStar(__nccwpck_require__(2186)); -const fs = __importStar(__nccwpck_require__(5747)); -const globOptionsHelper = __importStar(__nccwpck_require__(1026)); +exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0; +const command_1 = __nccwpck_require__(7351); +const file_command_1 = __nccwpck_require__(717); +const utils_1 = __nccwpck_require__(5278); +const os = __importStar(__nccwpck_require__(2087)); const path = __importStar(__nccwpck_require__(5622)); -const patternHelper = __importStar(__nccwpck_require__(9005)); -const internal_match_kind_1 = __nccwpck_require__(1063); -const internal_pattern_1 = __nccwpck_require__(4536); -const internal_search_state_1 = __nccwpck_require__(9117); -const IS_WINDOWS = process.platform === 'win32'; -class DefaultGlobber { - constructor(options) { - this.patterns = []; - this.searchPaths = []; - this.options = globOptionsHelper.getOptions(options); +/** + * The code to exit an action + */ +var ExitCode; +(function (ExitCode) { + /** + * A code indicating that the action was successful + */ + ExitCode[ExitCode["Success"] = 0] = "Success"; + /** + * A code indicating that the action was a failure + */ + ExitCode[ExitCode["Failure"] = 1] = "Failure"; +})(ExitCode = exports.ExitCode || (exports.ExitCode = {})); +//----------------------------------------------------------------------- +// Variables +//----------------------------------------------------------------------- +/** + * Sets env variable for this action and future actions in the job + * @param name the name of the variable to set + * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function exportVariable(name, val) { + const convertedVal = utils_1.toCommandValue(val); + process.env[name] = convertedVal; + const filePath = process.env['GITHUB_ENV'] || ''; + if (filePath) { + const delimiter = '_GitHubActionsFileCommandDelimeter_'; + const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`; + file_command_1.issueCommand('ENV', commandValue); } - getSearchPaths() { - // Return a copy - return this.searchPaths.slice(); + else { + command_1.issueCommand('set-env', { name }, convertedVal); } - glob() { - var e_1, _a; - return __awaiter(this, void 0, void 0, function* () { - const result = []; - try { - for (var _b = __asyncValues(this.globGenerator()), _c; _c = yield _b.next(), !_c.done;) { - const itemPath = _c.value; - result.push(itemPath); - } - } - catch (e_1_1) { e_1 = { error: e_1_1 }; } - finally { - try { - if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b); - } - finally { if (e_1) throw e_1.error; } - } - return result; - }); +} +exports.exportVariable = exportVariable; +/** + * Registers a secret which will get masked from logs + * @param secret value of the secret + */ +function setSecret(secret) { + command_1.issueCommand('add-mask', {}, secret); +} +exports.setSecret = setSecret; +/** + * Prepends inputPath to the PATH (for this action and future actions) + * @param inputPath + */ +function addPath(inputPath) { + const filePath = process.env['GITHUB_PATH'] || ''; + if (filePath) { + file_command_1.issueCommand('PATH', inputPath); } - globGenerator() { - return __asyncGenerator(this, arguments, function* globGenerator_1() { - // Fill in defaults options - const options = globOptionsHelper.getOptions(this.options); - // Implicit descendants? - const patterns = []; - for (const pattern of this.patterns) { - patterns.push(pattern); - if (options.implicitDescendants && - (pattern.trailingSeparator || - pattern.segments[pattern.segments.length - 1] !== '**')) { - patterns.push(new internal_pattern_1.Pattern(pattern.negate, true, pattern.segments.concat('**'))); - } - } - // Push the search paths - const stack = []; - for (const searchPath of patternHelper.getSearchPaths(patterns)) { - core.debug(`Search path '${searchPath}'`); - // Exists? - try { - // Intentionally using lstat. Detection for broken symlink - // will be performed later (if following symlinks). - yield __await(fs.promises.lstat(searchPath)); - } - catch (err) { - if (err.code === 'ENOENT') { - continue; - } - throw err; - } - stack.unshift(new internal_search_state_1.SearchState(searchPath, 1)); - } - // Search - const traversalChain = []; // used to detect cycles - while (stack.length) { - // Pop - const item = stack.pop(); - // Match? - const match = patternHelper.match(patterns, item.path); - const partialMatch = !!match || patternHelper.partialMatch(patterns, item.path); - if (!match && !partialMatch) { - continue; - } - // Stat - const stats = yield __await(DefaultGlobber.stat(item, options, traversalChain) - // Broken symlink, or symlink cycle detected, or no longer exists - ); - // Broken symlink, or symlink cycle detected, or no longer exists - if (!stats) { - continue; - } - // Directory - if (stats.isDirectory()) { - // Matched - if (match & internal_match_kind_1.MatchKind.Directory) { - yield yield __await(item.path); - } - // Descend? - else if (!partialMatch) { - continue; - } - // Push the child items in reverse - const childLevel = item.level + 1; - const childItems = (yield __await(fs.promises.readdir(item.path))).map(x => new internal_search_state_1.SearchState(path.join(item.path, x), childLevel)); - stack.push(...childItems.reverse()); - } - // File - else if (match & internal_match_kind_1.MatchKind.File) { - yield yield __await(item.path); - } - } - }); + else { + command_1.issueCommand('add-path', {}, inputPath); } - /** - * Constructs a DefaultGlobber - */ - static create(patterns, options) { - return __awaiter(this, void 0, void 0, function* () { - const result = new DefaultGlobber(options); - if (IS_WINDOWS) { - patterns = patterns.replace(/\r\n/g, '\n'); - patterns = patterns.replace(/\r/g, '\n'); - } - const lines = patterns.split('\n').map(x => x.trim()); - for (const line of lines) { - // Empty or comment - if (!line || line.startsWith('#')) { - continue; - } - // Pattern - else { - result.patterns.push(new internal_pattern_1.Pattern(line)); - } - } - result.searchPaths.push(...patternHelper.getSearchPaths(result.patterns)); - return result; - }); + process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`; +} +exports.addPath = addPath; +/** + * Gets the value of an input. + * Unless trimWhitespace is set to false in InputOptions, the value is also trimmed. + * Returns an empty string if the value is not defined. + * + * @param name name of the input to get + * @param options optional. See InputOptions. + * @returns string + */ +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}`); } - static stat(item, options, traversalChain) { - return __awaiter(this, void 0, void 0, function* () { - // Note: - // `stat` returns info about the target of a symlink (or symlink chain) - // `lstat` returns info about a symlink itself - let stats; - if (options.followSymbolicLinks) { - try { - // Use `stat` (following symlinks) - stats = yield fs.promises.stat(item.path); - } - catch (err) { - if (err.code === 'ENOENT') { - if (options.omitBrokenSymbolicLinks) { - core.debug(`Broken symlink '${item.path}'`); - return undefined; - } - throw new Error(`No information found for the path '${item.path}'. This may indicate a broken symbolic link.`); - } - throw err; - } - } - else { - // Use `lstat` (not following symlinks) - stats = yield fs.promises.lstat(item.path); - } - // Note, isDirectory() returns false for the lstat of a symlink - if (stats.isDirectory() && options.followSymbolicLinks) { - // Get the realpath - const realPath = yield fs.promises.realpath(item.path); - // Fixup the traversal chain to match the item level - while (traversalChain.length >= item.level) { - traversalChain.pop(); - } - // Test for a cycle - if (traversalChain.some((x) => x === realPath)) { - core.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`); - return undefined; - } - // Update the traversal chain - traversalChain.push(realPath); - } - return stats; - }); + if (options && options.trimWhitespace === false) { + return val; } + return val.trim(); } -exports.DefaultGlobber = DefaultGlobber; -//# sourceMappingURL=internal-globber.js.map - -/***/ }), - -/***/ 1063: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.MatchKind = void 0; +exports.getInput = getInput; /** - * Indicates whether a pattern matches a path + * Gets the values of an multiline input. Each value is also trimmed. + * + * @param name name of the input to get + * @param options optional. See InputOptions. + * @returns string[] + * */ -var MatchKind; -(function (MatchKind) { - /** Not matched */ - MatchKind[MatchKind["None"] = 0] = "None"; - /** Matched if the path is a directory */ - MatchKind[MatchKind["Directory"] = 1] = "Directory"; - /** Matched if the path is a regular file */ - MatchKind[MatchKind["File"] = 2] = "File"; - /** Matched */ - MatchKind[MatchKind["All"] = 3] = "All"; -})(MatchKind = exports.MatchKind || (exports.MatchKind = {})); -//# sourceMappingURL=internal-match-kind.js.map +function getMultilineInput(name, options) { + const inputs = getInput(name, options) + .split('\n') + .filter(x => x !== ''); + return inputs; +} +exports.getMultilineInput = getMultilineInput; +/** + * Gets the input value of the boolean type in the YAML 1.2 "core schema" specification. + * Support boolean input list: `true | True | TRUE | false | False | FALSE` . + * The return value is also in boolean type. + * ref: https://yaml.org/spec/1.2/spec.html#id2804923 + * + * @param name name of the input to get + * @param options optional. See InputOptions. + * @returns boolean + */ +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}\n` + + `Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); +} +exports.getBooleanInput = getBooleanInput; +/** + * Sets the value of an output. + * + * @param name name of the output to set + * @param value value to store. Non-string values will be converted to a string via JSON.stringify + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function setOutput(name, value) { + process.stdout.write(os.EOL); + command_1.issueCommand('set-output', { name }, value); +} +exports.setOutput = setOutput; +/** + * Enables or disables the echoing of commands into stdout for the rest of the step. + * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set. + * + */ +function setCommandEcho(enabled) { + command_1.issue('echo', enabled ? 'on' : 'off'); +} +exports.setCommandEcho = setCommandEcho; +//----------------------------------------------------------------------- +// Results +//----------------------------------------------------------------------- +/** + * Sets the action status to failed. + * When the action exits it will be with an exit code of 1 + * @param message add error issue message + */ +function setFailed(message) { + process.exitCode = ExitCode.Failure; + error(message); +} +exports.setFailed = setFailed; +//----------------------------------------------------------------------- +// Logging Commands +//----------------------------------------------------------------------- +/** + * Gets whether Actions Step Debug is on or not + */ +function isDebug() { + return process.env['RUNNER_DEBUG'] === '1'; +} +exports.isDebug = isDebug; +/** + * Writes debug message to user log + * @param message debug message + */ +function debug(message) { + command_1.issueCommand('debug', {}, message); +} +exports.debug = debug; +/** + * Adds an error issue + * @param message error issue message. Errors will be converted to string via toString() + */ +function error(message) { + command_1.issue('error', message instanceof Error ? message.toString() : message); +} +exports.error = error; +/** + * Adds an warning issue + * @param message warning issue message. Errors will be converted to string via toString() + */ +function warning(message) { + command_1.issue('warning', message instanceof Error ? message.toString() : message); +} +exports.warning = warning; +/** + * Writes info to log with console.log. + * @param message info message + */ +function info(message) { + process.stdout.write(message + os.EOL); +} +exports.info = info; +/** + * Begin an output group. + * + * Output until the next `groupEnd` will be foldable in this group + * + * @param name The name of the output group + */ +function startGroup(name) { + command_1.issue('group', name); +} +exports.startGroup = startGroup; +/** + * End an output group. + */ +function endGroup() { + command_1.issue('endgroup'); +} +exports.endGroup = endGroup; +/** + * Wrap an asynchronous function call in a group. + * + * Returns the same type as the function itself. + * + * @param name The name of the group + * @param fn The function to wrap in the group + */ +function group(name, fn) { + return __awaiter(this, void 0, void 0, function* () { + startGroup(name); + let result; + try { + result = yield fn(); + } + finally { + endGroup(); + } + return result; + }); +} +exports.group = group; +//----------------------------------------------------------------------- +// Wrapper action state +//----------------------------------------------------------------------- +/** + * Saves state for current action, the state can only be retrieved by this action's post job execution. + * + * @param name name of the state to store + * @param value value to store. Non-string values will be converted to a string via JSON.stringify + */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function saveState(name, value) { + command_1.issueCommand('save-state', { name }, value); +} +exports.saveState = saveState; +/** + * Gets the value of an state set by this action's main execution. + * + * @param name name of the state to get + * @returns string + */ +function getState(name) { + return process.env[`STATE_${name}`] || ''; +} +exports.getState = getState; +//# sourceMappingURL=core.js.map /***/ }), -/***/ 1849: +/***/ 717: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; +// For internal use, subject to change. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); @@ -2696,188 +2684,58 @@ var __importStar = (this && this.__importStar) || function (mod) { __setModuleDefault(result, mod); return result; }; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.safeTrimTrailingSeparator = exports.normalizeSeparators = exports.hasRoot = exports.hasAbsoluteRoot = exports.ensureAbsoluteRoot = exports.dirname = void 0; -const path = __importStar(__nccwpck_require__(5622)); -const assert_1 = __importDefault(__nccwpck_require__(2357)); -const IS_WINDOWS = process.platform === 'win32'; -/** - * Similar to path.dirname except normalizes the path separators and slightly better handling for Windows UNC paths. - * - * For example, on Linux/macOS: - * - `/ => /` - * - `/hello => /` - * - * For example, on Windows: - * - `C:\ => C:\` - * - `C:\hello => C:\` - * - `C: => C:` - * - `C:hello => C:` - * - `\ => \` - * - `\hello => \` - * - `\\hello => \\hello` - * - `\\hello\world => \\hello\world` - */ -function dirname(p) { - // Normalize slashes and trim unnecessary trailing slash - p = safeTrimTrailingSeparator(p); - // Windows UNC root, e.g. \\hello or \\hello\world - if (IS_WINDOWS && /^\\\\[^\\]+(\\[^\\]+)?$/.test(p)) { - return p; - } - // Get dirname - let result = path.dirname(p); - // Trim trailing slash for Windows UNC root, e.g. \\hello\world\ - if (IS_WINDOWS && /^\\\\[^\\]+\\[^\\]+\\$/.test(result)) { - result = safeTrimTrailingSeparator(result); - } - return result; -} -exports.dirname = dirname; -/** - * Roots the path if not already rooted. On Windows, relative roots like `\` - * or `C:` are expanded based on the current working directory. - */ -function ensureAbsoluteRoot(root, itemPath) { - assert_1.default(root, `ensureAbsoluteRoot parameter 'root' must not be empty`); - assert_1.default(itemPath, `ensureAbsoluteRoot parameter 'itemPath' must not be empty`); - // Already rooted - if (hasAbsoluteRoot(itemPath)) { - return itemPath; - } - // Windows - if (IS_WINDOWS) { - // Check for itemPath like C: or C:foo - if (itemPath.match(/^[A-Z]:[^\\/]|^[A-Z]:$/i)) { - let cwd = process.cwd(); - assert_1.default(cwd.match(/^[A-Z]:\\/i), `Expected current directory to start with an absolute drive root. Actual '${cwd}'`); - // Drive letter matches cwd? Expand to cwd - if (itemPath[0].toUpperCase() === cwd[0].toUpperCase()) { - // Drive only, e.g. C: - if (itemPath.length === 2) { - // Preserve specified drive letter case (upper or lower) - return `${itemPath[0]}:\\${cwd.substr(3)}`; - } - // Drive + path, e.g. C:foo - else { - if (!cwd.endsWith('\\')) { - cwd += '\\'; - } - // Preserve specified drive letter case (upper or lower) - return `${itemPath[0]}:\\${cwd.substr(3)}${itemPath.substr(2)}`; - } - } - // Different drive - else { - return `${itemPath[0]}:\\${itemPath.substr(2)}`; - } - } - // Check for itemPath like \ or \foo - else if (normalizeSeparators(itemPath).match(/^\\$|^\\[^\\]/)) { - const cwd = process.cwd(); - assert_1.default(cwd.match(/^[A-Z]:\\/i), `Expected current directory to start with an absolute drive root. Actual '${cwd}'`); - return `${cwd[0]}:\\${itemPath.substr(1)}`; - } - } - assert_1.default(hasAbsoluteRoot(root), `ensureAbsoluteRoot parameter 'root' must have an absolute root`); - // Otherwise ensure root ends with a separator - if (root.endsWith('/') || (IS_WINDOWS && root.endsWith('\\'))) { - // Intentionally empty - } - else { - // Append separator - root += path.sep; - } - return root + itemPath; -} -exports.ensureAbsoluteRoot = ensureAbsoluteRoot; -/** - * On Linux/macOS, true if path starts with `/`. On Windows, true for paths like: - * `\\hello\share` and `C:\hello` (and using alternate separator). - */ -function hasAbsoluteRoot(itemPath) { - assert_1.default(itemPath, `hasAbsoluteRoot parameter 'itemPath' must not be empty`); - // Normalize separators - itemPath = normalizeSeparators(itemPath); - // Windows - if (IS_WINDOWS) { - // E.g. \\hello\share or C:\hello - return itemPath.startsWith('\\\\') || /^[A-Z]:\\/i.test(itemPath); - } - // E.g. /hello - return itemPath.startsWith('/'); -} -exports.hasAbsoluteRoot = hasAbsoluteRoot; -/** - * On Linux/macOS, true if path starts with `/`. On Windows, true for paths like: - * `\`, `\hello`, `\\hello\share`, `C:`, and `C:\hello` (and using alternate separator). - */ -function hasRoot(itemPath) { - assert_1.default(itemPath, `isRooted parameter 'itemPath' must not be empty`); - // Normalize separators - itemPath = normalizeSeparators(itemPath); - // Windows - if (IS_WINDOWS) { - // E.g. \ or \hello or \\hello - // E.g. C: or C:\hello - return itemPath.startsWith('\\') || /^[A-Z]:/i.test(itemPath); +exports.issueCommand = void 0; +// We use any as a valid input type +/* eslint-disable @typescript-eslint/no-explicit-any */ +const fs = __importStar(__nccwpck_require__(5747)); +const os = __importStar(__nccwpck_require__(2087)); +const utils_1 = __nccwpck_require__(5278); +function issueCommand(command, message) { + const filePath = process.env[`GITHUB_${command}`]; + if (!filePath) { + throw new Error(`Unable to find environment variable for file command ${command}`); } - // E.g. /hello - return itemPath.startsWith('/'); -} -exports.hasRoot = hasRoot; -/** - * Removes redundant slashes and converts `/` to `\` on Windows - */ -function normalizeSeparators(p) { - p = p || ''; - // Windows - if (IS_WINDOWS) { - // Convert slashes on Windows - p = p.replace(/\//g, '\\'); - // Remove redundant slashes - const isUnc = /^\\\\+[^\\]/.test(p); // e.g. \\hello - return (isUnc ? '\\' : '') + p.replace(/\\\\+/g, '\\'); // preserve leading \\ for UNC + if (!fs.existsSync(filePath)) { + throw new Error(`Missing file at path: ${filePath}`); } - // Remove redundant slashes - return p.replace(/\/\/+/g, '/'); + fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, { + encoding: 'utf8' + }); } -exports.normalizeSeparators = normalizeSeparators; +exports.issueCommand = issueCommand; +//# sourceMappingURL=file-command.js.map + +/***/ }), + +/***/ 5278: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +// We use any as a valid input type +/* eslint-disable @typescript-eslint/no-explicit-any */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.toCommandValue = void 0; /** - * Normalizes the path separators and trims the trailing separator (when safe). - * For example, `/foo/ => /foo` but `/ => /` + * Sanitizes an input into a string so it can be passed into issueCommand safely + * @param input input to sanitize into a string */ -function safeTrimTrailingSeparator(p) { - // Short-circuit if empty - if (!p) { +function toCommandValue(input) { + if (input === null || input === undefined) { return ''; } - // Normalize separators - p = normalizeSeparators(p); - // No trailing slash - if (!p.endsWith(path.sep)) { - return p; - } - // Check '/' on Linux/macOS and '\' on Windows - if (p === path.sep) { - return p; - } - // On Windows check if drive root. E.g. C:\ - if (IS_WINDOWS && /^[A-Z]:\\$/i.test(p)) { - return p; + else if (typeof input === 'string' || input instanceof String) { + return input; } - // Otherwise trim trailing slash - return p.substr(0, p.length - 1); + return JSON.stringify(input); } -exports.safeTrimTrailingSeparator = safeTrimTrailingSeparator; -//# sourceMappingURL=internal-path-helper.js.map +exports.toCommandValue = toCommandValue; +//# sourceMappingURL=utils.js.map /***/ }), -/***/ 6836: +/***/ 1514: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -2901,204 +2759,93 @@ var __importStar = (this && this.__importStar) || function (mod) { __setModuleDefault(result, mod); return result; }; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Path = void 0; -const path = __importStar(__nccwpck_require__(5622)); -const pathHelper = __importStar(__nccwpck_require__(1849)); -const assert_1 = __importDefault(__nccwpck_require__(2357)); -const IS_WINDOWS = process.platform === 'win32'; -/** - * Helper class for parsing paths into segments - */ -class Path { - /** - * Constructs a Path - * @param itemPath Path or array of segments - */ - constructor(itemPath) { - this.segments = []; - // String - if (typeof itemPath === 'string') { - assert_1.default(itemPath, `Parameter 'itemPath' must not be empty`); - // Normalize slashes and trim unnecessary trailing slash - itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); - // Not rooted - if (!pathHelper.hasRoot(itemPath)) { - this.segments = itemPath.split(path.sep); - } - // Rooted - else { - // Add all segments, while not at the root - let remaining = itemPath; - let dir = pathHelper.dirname(remaining); - while (dir !== remaining) { - // Add the segment - const basename = path.basename(remaining); - this.segments.unshift(basename); - // Truncate the last segment - remaining = dir; - dir = pathHelper.dirname(remaining); - } - // Remainder is the root - this.segments.unshift(remaining); - } - } - // Array - else { - // Must not be empty - assert_1.default(itemPath.length > 0, `Parameter 'itemPath' must not be an empty array`); - // Each segment - for (let i = 0; i < itemPath.length; i++) { - let segment = itemPath[i]; - // Must not be empty - assert_1.default(segment, `Parameter 'itemPath' must not contain any empty segments`); - // Normalize slashes - segment = pathHelper.normalizeSeparators(itemPath[i]); - // Root segment - if (i === 0 && pathHelper.hasRoot(segment)) { - segment = pathHelper.safeTrimTrailingSeparator(segment); - assert_1.default(segment === pathHelper.dirname(segment), `Parameter 'itemPath' root segment contains information for multiple segments`); - this.segments.push(segment); - } - // All other segments - else { - // Must not contain slash - assert_1.default(!segment.includes(path.sep), `Parameter 'itemPath' contains unexpected path separators`); - this.segments.push(segment); - } - } - } - } - /** - * Converts the path to it's string representation - */ - toString() { - // First segment - let result = this.segments[0]; - // All others - let skipSlash = result.endsWith(path.sep) || (IS_WINDOWS && /^[A-Z]:$/i.test(result)); - for (let i = 1; i < this.segments.length; i++) { - if (skipSlash) { - skipSlash = false; - } - else { - result += path.sep; - } - result += this.segments[i]; - } - return result; - } -} -exports.Path = Path; -//# sourceMappingURL=internal-path.js.map - -/***/ }), - -/***/ 9005: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__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)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.partialMatch = exports.match = exports.getSearchPaths = void 0; -const pathHelper = __importStar(__nccwpck_require__(1849)); -const internal_match_kind_1 = __nccwpck_require__(1063); -const IS_WINDOWS = process.platform === 'win32'; -/** - * Given an array of patterns, returns an array of paths to search. - * Duplicates and paths under other included paths are filtered out. - */ -function getSearchPaths(patterns) { - // Ignore negate patterns - patterns = patterns.filter(x => !x.negate); - // Create a map of all search paths - const searchPathMap = {}; - for (const pattern of patterns) { - const key = IS_WINDOWS - ? pattern.searchPath.toUpperCase() - : pattern.searchPath; - searchPathMap[key] = 'candidate'; - } - const result = []; - for (const pattern of patterns) { - // Check if already included - const key = IS_WINDOWS - ? pattern.searchPath.toUpperCase() - : pattern.searchPath; - if (searchPathMap[key] === 'included') { - continue; - } - // Check for an ancestor search path - let foundAncestor = false; - let tempKey = key; - let parent = pathHelper.dirname(tempKey); - while (parent !== tempKey) { - if (searchPathMap[parent]) { - foundAncestor = true; - break; - } - tempKey = parent; - parent = pathHelper.dirname(tempKey); - } - // Include the search pattern in the result - if (!foundAncestor) { - result.push(pattern.searchPath); - searchPathMap[key] = 'included'; - } - } - return result; -} -exports.getSearchPaths = getSearchPaths; +exports.getExecOutput = exports.exec = void 0; +const string_decoder_1 = __nccwpck_require__(4304); +const tr = __importStar(__nccwpck_require__(8159)); /** - * Matches the patterns against the path + * Exec a command. + * Output will be streamed to the live console. + * Returns promise with return code + * + * @param commandLine command to execute (can include additional args). Must be correctly escaped. + * @param args optional arguments for tool. Escaping is handled by the lib. + * @param options optional exec options. See ExecOptions + * @returns Promise exit code */ -function match(patterns, itemPath) { - let result = internal_match_kind_1.MatchKind.None; - for (const pattern of patterns) { - if (pattern.negate) { - result &= ~pattern.match(itemPath); - } - else { - result |= pattern.match(itemPath); +function exec(commandLine, args, options) { + return __awaiter(this, void 0, void 0, function* () { + const commandArgs = tr.argStringToArray(commandLine); + if (commandArgs.length === 0) { + throw new Error(`Parameter 'commandLine' cannot be null or empty.`); } - } - return result; + // Path to tool to execute should be first arg + const toolPath = commandArgs[0]; + args = commandArgs.slice(1).concat(args || []); + const runner = new tr.ToolRunner(toolPath, args, options); + return runner.exec(); + }); } -exports.match = match; +exports.exec = exec; /** - * Checks whether to descend further into the directory + * Exec a command and get the output. + * Output will be streamed to the live console. + * Returns promise with the exit code and collected stdout and stderr + * + * @param commandLine command to execute (can include additional args). Must be correctly escaped. + * @param args optional arguments for tool. Escaping is handled by the lib. + * @param options optional exec options. See ExecOptions + * @returns Promise exit code, stdout, and stderr */ -function partialMatch(patterns, itemPath) { - return patterns.some(x => !x.negate && x.partialMatch(itemPath)); +function getExecOutput(commandLine, args, options) { + var _a, _b; + return __awaiter(this, void 0, void 0, function* () { + let stdout = ''; + let stderr = ''; + //Using string decoder covers the case where a mult-byte character is split + const stdoutDecoder = new string_decoder_1.StringDecoder('utf8'); + const stderrDecoder = new string_decoder_1.StringDecoder('utf8'); + const originalStdoutListener = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.stdout; + const originalStdErrListener = (_b = options === null || options === void 0 ? void 0 : options.listeners) === null || _b === void 0 ? void 0 : _b.stderr; + const stdErrListener = (data) => { + stderr += stderrDecoder.write(data); + if (originalStdErrListener) { + originalStdErrListener(data); + } + }; + const stdOutListener = (data) => { + stdout += stdoutDecoder.write(data); + if (originalStdoutListener) { + originalStdoutListener(data); + } + }; + const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener }); + const exitCode = yield exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); + //flush any remaining characters + stdout += stdoutDecoder.end(); + stderr += stderrDecoder.end(); + return { + exitCode, + stdout, + stderr + }; + }); } -exports.partialMatch = partialMatch; -//# sourceMappingURL=internal-pattern-helper.js.map +exports.getExecOutput = getExecOutput; +//# sourceMappingURL=exec.js.map /***/ }), -/***/ 4536: +/***/ 8159: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -3122,943 +2869,986 @@ var __importStar = (this && this.__importStar) || function (mod) { __setModuleDefault(result, mod); return result; }; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Pattern = void 0; +exports.argStringToArray = exports.ToolRunner = void 0; const os = __importStar(__nccwpck_require__(2087)); +const events = __importStar(__nccwpck_require__(8614)); +const child = __importStar(__nccwpck_require__(3129)); const path = __importStar(__nccwpck_require__(5622)); -const pathHelper = __importStar(__nccwpck_require__(1849)); -const assert_1 = __importDefault(__nccwpck_require__(2357)); -const minimatch_1 = __nccwpck_require__(3973); -const internal_match_kind_1 = __nccwpck_require__(1063); -const internal_path_1 = __nccwpck_require__(6836); +const io = __importStar(__nccwpck_require__(7436)); +const ioUtil = __importStar(__nccwpck_require__(1962)); +const timers_1 = __nccwpck_require__(8213); +/* eslint-disable @typescript-eslint/unbound-method */ const IS_WINDOWS = process.platform === 'win32'; -class Pattern { - constructor(patternOrNegate, isImplicitPattern = false, segments, homedir) { - /** - * Indicates whether matches should be excluded from the result set - */ - this.negate = false; - // Pattern overload - let pattern; - if (typeof patternOrNegate === 'string') { - pattern = patternOrNegate.trim(); +/* + * Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way. + */ +class ToolRunner extends events.EventEmitter { + constructor(toolPath, args, options) { + super(); + if (!toolPath) { + throw new Error("Parameter 'toolPath' cannot be null or empty."); } - // Segments overload - else { - // Convert to pattern - segments = segments || []; - assert_1.default(segments.length, `Parameter 'segments' must not empty`); - const root = Pattern.getLiteral(segments[0]); - assert_1.default(root && pathHelper.hasAbsoluteRoot(root), `Parameter 'segments' first element must be a root path`); - pattern = new internal_path_1.Path(segments).toString().trim(); - if (patternOrNegate) { - pattern = `!${pattern}`; + this.toolPath = toolPath; + this.args = args || []; + this.options = options || {}; + } + _debug(message) { + if (this.options.listeners && this.options.listeners.debug) { + this.options.listeners.debug(message); + } + } + _getCommandString(options, noPrefix) { + const toolPath = this._getSpawnFileName(); + const args = this._getSpawnArgs(options); + let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool + if (IS_WINDOWS) { + // Windows + cmd file + if (this._isCmdFile()) { + cmd += toolPath; + for (const a of args) { + cmd += ` ${a}`; + } + } + // Windows + verbatim + else if (options.windowsVerbatimArguments) { + cmd += `"${toolPath}"`; + for (const a of args) { + cmd += ` ${a}`; + } + } + // Windows (regular) + else { + cmd += this._windowsQuoteCmdArg(toolPath); + for (const a of args) { + cmd += ` ${this._windowsQuoteCmdArg(a)}`; + } } } - // Negate - while (pattern.startsWith('!')) { - this.negate = !this.negate; - pattern = pattern.substr(1).trim(); + else { + // OSX/Linux - this can likely be improved with some form of quoting. + // creating processes on Unix is fundamentally different than Windows. + // on Unix, execvp() takes an arg array. + cmd += toolPath; + for (const a of args) { + cmd += ` ${a}`; + } } - // Normalize slashes and ensures absolute root - pattern = Pattern.fixupPattern(pattern, homedir); - // Segments - this.segments = new internal_path_1.Path(pattern).segments; - // Trailing slash indicates the pattern should only match directories, not regular files - this.trailingSeparator = pathHelper - .normalizeSeparators(pattern) - .endsWith(path.sep); - pattern = pathHelper.safeTrimTrailingSeparator(pattern); - // Search path (literal path prior to the first glob segment) - let foundGlob = false; - const searchSegments = this.segments - .map(x => Pattern.getLiteral(x)) - .filter(x => !foundGlob && !(foundGlob = x === '')); - this.searchPath = new internal_path_1.Path(searchSegments).toString(); - // Root RegExp (required when determining partial match) - this.rootRegExp = new RegExp(Pattern.regExpEscape(searchSegments[0]), IS_WINDOWS ? 'i' : ''); - this.isImplicitPattern = isImplicitPattern; - // Create minimatch - const minimatchOptions = { - dot: true, - nobrace: true, - nocase: IS_WINDOWS, - nocomment: true, - noext: true, - nonegate: true - }; - pattern = IS_WINDOWS ? pattern.replace(/\\/g, '/') : pattern; - this.minimatch = new minimatch_1.Minimatch(pattern, minimatchOptions); + return cmd; } - /** - * Matches the pattern against the specified path - */ - match(itemPath) { - // Last segment is globstar? - if (this.segments[this.segments.length - 1] === '**') { - // Normalize slashes - itemPath = pathHelper.normalizeSeparators(itemPath); - // Append a trailing slash. Otherwise Minimatch will not match the directory immediately - // preceding the globstar. For example, given the pattern `/foo/**`, Minimatch returns - // false for `/foo` but returns true for `/foo/`. Append a trailing slash to handle that quirk. - if (!itemPath.endsWith(path.sep) && this.isImplicitPattern === false) { - // Note, this is safe because the constructor ensures the pattern has an absolute root. - // For example, formats like C: and C:foo on Windows are resolved to an absolute root. - itemPath = `${itemPath}${path.sep}`; + _processLineBuffer(data, strBuffer, onLine) { + try { + let s = strBuffer + data.toString(); + let n = s.indexOf(os.EOL); + while (n > -1) { + const line = s.substring(0, n); + onLine(line); + // the rest of the string ... + s = s.substring(n + os.EOL.length); + n = s.indexOf(os.EOL); } + return s; } - else { - // Normalize slashes and trim unnecessary trailing slash - itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); + catch (err) { + // streaming lines to console is best effort. Don't fail a build. + this._debug(`error processing line. Failed with error ${err}`); + return ''; } - // Match - if (this.minimatch.match(itemPath)) { - return this.trailingSeparator ? internal_match_kind_1.MatchKind.Directory : internal_match_kind_1.MatchKind.All; + } + _getSpawnFileName() { + if (IS_WINDOWS) { + if (this._isCmdFile()) { + return process.env['COMSPEC'] || 'cmd.exe'; + } } - return internal_match_kind_1.MatchKind.None; + return this.toolPath; } - /** - * Indicates whether the pattern may match descendants of the specified path - */ - partialMatch(itemPath) { - // Normalize slashes and trim unnecessary trailing slash - itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); - // matchOne does not handle root path correctly - if (pathHelper.dirname(itemPath) === itemPath) { - return this.rootRegExp.test(itemPath); + _getSpawnArgs(options) { + if (IS_WINDOWS) { + if (this._isCmdFile()) { + let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`; + for (const a of this.args) { + argline += ' '; + argline += options.windowsVerbatimArguments + ? a + : this._windowsQuoteCmdArg(a); + } + argline += '"'; + return [argline]; + } } - return this.minimatch.matchOne(itemPath.split(IS_WINDOWS ? /\\+/ : /\/+/), this.minimatch.set[0], true); + return this.args; } - /** - * Escapes glob patterns within a path - */ - static globEscape(s) { - return (IS_WINDOWS ? s : s.replace(/\\/g, '\\\\')) // escape '\' on Linux/macOS - .replace(/(\[)(?=[^/]+\])/g, '[[]') // escape '[' when ']' follows within the path segment - .replace(/\?/g, '[?]') // escape '?' - .replace(/\*/g, '[*]'); // escape '*' + _endsWith(str, end) { + return str.endsWith(end); } - /** - * Normalizes slashes and ensures absolute root - */ - static fixupPattern(pattern, homedir) { - // Empty - assert_1.default(pattern, 'pattern cannot be empty'); - // Must not contain `.` segment, unless first segment - // Must not contain `..` segment - const literalSegments = new internal_path_1.Path(pattern).segments.map(x => Pattern.getLiteral(x)); - assert_1.default(literalSegments.every((x, i) => (x !== '.' || i === 0) && x !== '..'), `Invalid pattern '${pattern}'. Relative pathing '.' and '..' is not allowed.`); - // Must not contain globs in root, e.g. Windows UNC path \\foo\b*r - assert_1.default(!pathHelper.hasRoot(pattern) || literalSegments[0], `Invalid pattern '${pattern}'. Root segment must not contain globs.`); - // Normalize slashes - pattern = pathHelper.normalizeSeparators(pattern); - // Replace leading `.` segment - if (pattern === '.' || pattern.startsWith(`.${path.sep}`)) { - pattern = Pattern.globEscape(process.cwd()) + pattern.substr(1); + _isCmdFile() { + const upperToolPath = this.toolPath.toUpperCase(); + return (this._endsWith(upperToolPath, '.CMD') || + this._endsWith(upperToolPath, '.BAT')); + } + _windowsQuoteCmdArg(arg) { + // for .exe, apply the normal quoting rules that libuv applies + if (!this._isCmdFile()) { + return this._uvQuoteCmdArg(arg); } - // Replace leading `~` segment - else if (pattern === '~' || pattern.startsWith(`~${path.sep}`)) { - homedir = homedir || os.homedir(); - assert_1.default(homedir, 'Unable to determine HOME directory'); - assert_1.default(pathHelper.hasAbsoluteRoot(homedir), `Expected HOME directory to be a rooted path. Actual '${homedir}'`); - pattern = Pattern.globEscape(homedir) + pattern.substr(1); + // otherwise apply quoting rules specific to the cmd.exe command line parser. + // the libuv rules are generic and are not designed specifically for cmd.exe + // command line parser. + // + // for a detailed description of the cmd.exe command line parser, refer to + // http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912 + // need quotes for empty arg + if (!arg) { + return '""'; } - // Replace relative drive root, e.g. pattern is C: or C:foo - else if (IS_WINDOWS && - (pattern.match(/^[A-Z]:$/i) || pattern.match(/^[A-Z]:[^\\]/i))) { - let root = pathHelper.ensureAbsoluteRoot('C:\\dummy-root', pattern.substr(0, 2)); - if (pattern.length > 2 && !root.endsWith('\\')) { - root += '\\'; + // determine whether the arg needs to be quoted + const cmdSpecialChars = [ + ' ', + '\t', + '&', + '(', + ')', + '[', + ']', + '{', + '}', + '^', + '=', + ';', + '!', + "'", + '+', + ',', + '`', + '~', + '|', + '<', + '>', + '"' + ]; + let needsQuotes = false; + for (const char of arg) { + if (cmdSpecialChars.some(x => x === char)) { + needsQuotes = true; + break; } - pattern = Pattern.globEscape(root) + pattern.substr(2); } - // Replace relative root, e.g. pattern is \ or \foo - else if (IS_WINDOWS && (pattern === '\\' || pattern.match(/^\\[^\\]/))) { - let root = pathHelper.ensureAbsoluteRoot('C:\\dummy-root', '\\'); - if (!root.endsWith('\\')) { - root += '\\'; - } - pattern = Pattern.globEscape(root) + pattern.substr(1); + // short-circuit if quotes not needed + if (!needsQuotes) { + return arg; } - // Otherwise ensure absolute root - else { - pattern = pathHelper.ensureAbsoluteRoot(Pattern.globEscape(process.cwd()), pattern); + // the following quoting rules are very similar to the rules that by libuv applies. + // + // 1) wrap the string in quotes + // + // 2) double-up quotes - i.e. " => "" + // + // this is different from the libuv quoting rules. libuv replaces " with \", which unfortunately + // doesn't work well with a cmd.exe command line. + // + // note, replacing " with "" also works well if the arg is passed to a downstream .NET console app. + // for example, the command line: + // foo.exe "myarg:""my val""" + // is parsed by a .NET console app into an arg array: + // [ "myarg:\"my val\"" ] + // which is the same end result when applying libuv quoting rules. although the actual + // command line from libuv quoting rules would look like: + // foo.exe "myarg:\"my val\"" + // + // 3) double-up slashes that precede a quote, + // e.g. hello \world => "hello \world" + // hello\"world => "hello\\""world" + // hello\\"world => "hello\\\\""world" + // hello world\ => "hello world\\" + // + // technically this is not required for a cmd.exe command line, or the batch argument parser. + // the reasons for including this as a .cmd quoting rule are: + // + // a) this is optimized for the scenario where the argument is passed from the .cmd file to an + // external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule. + // + // b) it's what we've been doing previously (by deferring to node default behavior) and we + // haven't heard any complaints about that aspect. + // + // note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be + // escaped when used on the command line directly - even though within a .cmd file % can be escaped + // by using %%. + // + // the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts + // the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing. + // + // one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would + // often work, since it is unlikely that var^ would exist, and the ^ character is removed when the + // variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args + // to an external program. + // + // an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file. + // % can be escaped within a .cmd file. + let reverse = '"'; + let quoteHit = true; + for (let i = arg.length; i > 0; i--) { + // walk the string in reverse + reverse += arg[i - 1]; + if (quoteHit && arg[i - 1] === '\\') { + reverse += '\\'; // double the slash + } + else if (arg[i - 1] === '"') { + quoteHit = true; + reverse += '"'; // double the quote + } + else { + quoteHit = false; + } } - return pathHelper.normalizeSeparators(pattern); + reverse += '"'; + return reverse + .split('') + .reverse() + .join(''); + } + _uvQuoteCmdArg(arg) { + // Tool runner wraps child_process.spawn() and needs to apply the same quoting as + // Node in certain cases where the undocumented spawn option windowsVerbatimArguments + // is used. + // + // Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV, + // see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details), + // pasting copyright notice from Node within this function: + // + // Copyright Joyent, Inc. and other Node contributors. All rights reserved. + // + // Permission is hereby granted, free of charge, to any person obtaining a copy + // of this software and associated documentation files (the "Software"), to + // deal in the Software without restriction, including without limitation the + // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + // sell copies of the Software, and to permit persons to whom the Software is + // furnished to do so, subject to the following conditions: + // + // The above copyright notice and this permission notice shall be included in + // all copies or substantial portions of the Software. + // + // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + // IN THE SOFTWARE. + if (!arg) { + // Need double quotation for empty argument + return '""'; + } + if (!arg.includes(' ') && !arg.includes('\t') && !arg.includes('"')) { + // No quotation needed + return arg; + } + if (!arg.includes('"') && !arg.includes('\\')) { + // No embedded double quotes or backslashes, so I can just wrap + // quote marks around the whole thing. + return `"${arg}"`; + } + // Expected input/output: + // input : hello"world + // output: "hello\"world" + // input : hello""world + // output: "hello\"\"world" + // input : hello\world + // output: hello\world + // input : hello\\world + // output: hello\\world + // input : hello\"world + // output: "hello\\\"world" + // input : hello\\"world + // output: "hello\\\\\"world" + // input : hello world\ + // output: "hello world\\" - note the comment in libuv actually reads "hello world\" + // but it appears the comment is wrong, it should be "hello world\\" + let reverse = '"'; + let quoteHit = true; + for (let i = arg.length; i > 0; i--) { + // walk the string in reverse + reverse += arg[i - 1]; + if (quoteHit && arg[i - 1] === '\\') { + reverse += '\\'; + } + else if (arg[i - 1] === '"') { + quoteHit = true; + reverse += '\\'; + } + else { + quoteHit = false; + } + } + reverse += '"'; + return reverse + .split('') + .reverse() + .join(''); + } + _cloneExecOptions(options) { + options = options || {}; + const result = { + cwd: options.cwd || process.cwd(), + env: options.env || process.env, + silent: options.silent || false, + windowsVerbatimArguments: options.windowsVerbatimArguments || false, + failOnStdErr: options.failOnStdErr || false, + ignoreReturnCode: options.ignoreReturnCode || false, + delay: options.delay || 10000 + }; + result.outStream = options.outStream || process.stdout; + result.errStream = options.errStream || process.stderr; + return result; + } + _getSpawnOptions(options, toolPath) { + options = options || {}; + const result = {}; + result.cwd = options.cwd; + result.env = options.env; + result['windowsVerbatimArguments'] = + options.windowsVerbatimArguments || this._isCmdFile(); + if (options.windowsVerbatimArguments) { + result.argv0 = `"${toolPath}"`; + } + return result; } /** - * Attempts to unescape a pattern segment to create a literal path segment. - * Otherwise returns empty string. + * Exec a tool. + * Output will be streamed to the live console. + * Returns promise with return code + * + * @param tool path to tool to exec + * @param options optional exec options. See ExecOptions + * @returns number */ - static getLiteral(segment) { - let literal = ''; - for (let i = 0; i < segment.length; i++) { - const c = segment[i]; - // Escape - if (c === '\\' && !IS_WINDOWS && i + 1 < segment.length) { - literal += segment[++i]; - continue; - } - // Wildcard - else if (c === '*' || c === '?') { - return ''; + exec() { + return __awaiter(this, void 0, void 0, function* () { + // root the tool path if it is unrooted and contains relative pathing + if (!ioUtil.isRooted(this.toolPath) && + (this.toolPath.includes('/') || + (IS_WINDOWS && this.toolPath.includes('\\')))) { + // prefer options.cwd if it is specified, however options.cwd may also need to be rooted + this.toolPath = path.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); } - // Character set - else if (c === '[' && i + 1 < segment.length) { - let set = ''; - let closed = -1; - for (let i2 = i + 1; i2 < segment.length; i2++) { - const c2 = segment[i2]; - // Escape - if (c2 === '\\' && !IS_WINDOWS && i2 + 1 < segment.length) { - set += segment[++i2]; - continue; + // if the tool is only a file name, then resolve it from the PATH + // otherwise verify it exists (add extension on Windows if necessary) + this.toolPath = yield io.which(this.toolPath, true); + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + this._debug(`exec tool: ${this.toolPath}`); + this._debug('arguments:'); + for (const arg of this.args) { + this._debug(` ${arg}`); + } + const optionsNonNull = this._cloneExecOptions(this.options); + if (!optionsNonNull.silent && optionsNonNull.outStream) { + optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL); + } + const state = new ExecState(optionsNonNull, this.toolPath); + state.on('debug', (message) => { + this._debug(message); + }); + if (this.options.cwd && !(yield ioUtil.exists(this.options.cwd))) { + return reject(new Error(`The cwd: ${this.options.cwd} does not exist!`)); + } + const fileName = this._getSpawnFileName(); + const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName)); + let stdbuffer = ''; + if (cp.stdout) { + cp.stdout.on('data', (data) => { + if (this.options.listeners && this.options.listeners.stdout) { + this.options.listeners.stdout(data); + } + if (!optionsNonNull.silent && optionsNonNull.outStream) { + optionsNonNull.outStream.write(data); + } + stdbuffer = this._processLineBuffer(data, stdbuffer, (line) => { + if (this.options.listeners && this.options.listeners.stdline) { + this.options.listeners.stdline(line); + } + }); + }); + } + let errbuffer = ''; + if (cp.stderr) { + cp.stderr.on('data', (data) => { + state.processStderr = true; + if (this.options.listeners && this.options.listeners.stderr) { + this.options.listeners.stderr(data); + } + if (!optionsNonNull.silent && + optionsNonNull.errStream && + optionsNonNull.outStream) { + const s = optionsNonNull.failOnStdErr + ? optionsNonNull.errStream + : optionsNonNull.outStream; + s.write(data); + } + errbuffer = this._processLineBuffer(data, errbuffer, (line) => { + if (this.options.listeners && this.options.listeners.errline) { + this.options.listeners.errline(line); + } + }); + }); + } + cp.on('error', (err) => { + state.processError = err.message; + state.processExited = true; + state.processClosed = true; + state.CheckComplete(); + }); + cp.on('exit', (code) => { + state.processExitCode = code; + state.processExited = true; + this._debug(`Exit code ${code} received from tool '${this.toolPath}'`); + state.CheckComplete(); + }); + cp.on('close', (code) => { + state.processExitCode = code; + state.processExited = true; + state.processClosed = true; + this._debug(`STDIO streams have closed for tool '${this.toolPath}'`); + state.CheckComplete(); + }); + state.on('done', (error, exitCode) => { + if (stdbuffer.length > 0) { + this.emit('stdline', stdbuffer); } - // Closed - else if (c2 === ']') { - closed = i2; - break; + if (errbuffer.length > 0) { + this.emit('errline', errbuffer); } - // Otherwise - else { - set += c2; + cp.removeAllListeners(); + if (error) { + reject(error); } - } - // Closed? - if (closed >= 0) { - // Cannot convert - if (set.length > 1) { - return ''; + else { + resolve(exitCode); } - // Convert to literal - if (set) { - literal += set; - i = closed; - continue; + }); + if (this.options.input) { + if (!cp.stdin) { + throw new Error('child process missing stdin'); } + cp.stdin.end(this.options.input); } - // Otherwise fall thru + })); + }); + } +} +exports.ToolRunner = ToolRunner; +/** + * Convert an arg string to an array of args. Handles escaping + * + * @param argString string of arguments + * @returns string[] array of arguments + */ +function argStringToArray(argString) { + const args = []; + let inQuotes = false; + let escaped = false; + let arg = ''; + function append(c) { + // we only escape double quotes. + if (escaped && c !== '"') { + arg += '\\'; + } + arg += c; + escaped = false; + } + for (let i = 0; i < argString.length; i++) { + const c = argString.charAt(i); + if (c === '"') { + if (!escaped) { + inQuotes = !inQuotes; } - // Append - literal += c; + else { + append(c); + } + continue; } - return literal; + if (c === '\\' && escaped) { + append(c); + continue; + } + if (c === '\\' && inQuotes) { + escaped = true; + continue; + } + if (c === ' ' && !inQuotes) { + if (arg.length > 0) { + args.push(arg); + arg = ''; + } + continue; + } + append(c); } - /** - * Escapes regexp special characters - * https://javascript.info/regexp-escaping - */ - static regExpEscape(s) { - return s.replace(/[[\\^$.|?*+()]/g, '\\$&'); + if (arg.length > 0) { + args.push(arg.trim()); } + return args; } -exports.Pattern = Pattern; -//# sourceMappingURL=internal-pattern.js.map +exports.argStringToArray = argStringToArray; +class ExecState extends events.EventEmitter { + constructor(options, toolPath) { + super(); + this.processClosed = false; // tracks whether the process has exited and stdio is closed + this.processError = ''; + this.processExitCode = 0; + this.processExited = false; // tracks whether the process has exited + this.processStderr = false; // tracks whether stderr was written to + this.delay = 10000; // 10 seconds + this.done = false; + this.timeout = null; + if (!toolPath) { + throw new Error('toolPath must not be empty'); + } + this.options = options; + this.toolPath = toolPath; + if (options.delay) { + this.delay = options.delay; + } + } + CheckComplete() { + if (this.done) { + return; + } + if (this.processClosed) { + this._setResult(); + } + else if (this.processExited) { + this.timeout = timers_1.setTimeout(ExecState.HandleTimeout, this.delay, this); + } + } + _debug(message) { + this.emit('debug', message); + } + _setResult() { + // determine whether there is an error + let error; + if (this.processExited) { + if (this.processError) { + error = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`); + } + else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) { + error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`); + } + else if (this.processStderr && this.options.failOnStdErr) { + error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`); + } + } + // clear the timeout + if (this.timeout) { + clearTimeout(this.timeout); + this.timeout = null; + } + this.done = true; + this.emit('done', error, this.processExitCode); + } + static HandleTimeout(state) { + if (state.done) { + return; + } + if (!state.processClosed && state.processExited) { + const message = `The STDIO streams did not close within ${state.delay / + 1000} seconds of the exit event from process '${state.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`; + state._debug(message); + } + state._setResult(); + } +} +//# sourceMappingURL=toolrunner.js.map /***/ }), -/***/ 9117: -/***/ ((__unused_webpack_module, exports) => { +/***/ 8090: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SearchState = void 0; -class SearchState { - constructor(path, level) { - this.path = path; - this.level = level; - } +exports.hashFiles = exports.create = void 0; +const internal_globber_1 = __nccwpck_require__(8298); +const internal_hash_files_1 = __nccwpck_require__(2448); +/** + * Constructs a globber + * + * @param patterns Patterns separated by newlines + * @param options Glob options + */ +function create(patterns, options) { + return __awaiter(this, void 0, void 0, function* () { + return yield internal_globber_1.DefaultGlobber.create(patterns, options); + }); } -exports.SearchState = SearchState; -//# sourceMappingURL=internal-search-state.js.map +exports.create = create; +/** + * Computes the sha256 hash of a glob + * + * @param patterns Patterns separated by newlines + * @param options Glob options + */ +function hashFiles(patterns, options) { + return __awaiter(this, void 0, void 0, function* () { + let followSymbolicLinks = true; + if (options && typeof options.followSymbolicLinks === 'boolean') { + followSymbolicLinks = options.followSymbolicLinks; + } + const globber = yield create(patterns, { followSymbolicLinks }); + return internal_hash_files_1.hashFiles(globber); + }); +} +exports.hashFiles = hashFiles; +//# sourceMappingURL=glob.js.map /***/ }), -/***/ 3702: -/***/ ((__unused_webpack_module, exports) => { +/***/ 1026: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -class BasicCredentialHandler { - constructor(username, password) { - this.username = username; - this.password = password; - } - prepareRequest(options) { - options.headers['Authorization'] = - 'Basic ' + - Buffer.from(this.username + ':' + this.password).toString('base64'); - } - // This handler cannot handle 401 - canHandleAuthentication(response) { - return false; - } - handleAuthentication(httpClient, requestInfo, objs) { - return null; - } -} -exports.BasicCredentialHandler = BasicCredentialHandler; -class BearerCredentialHandler { - constructor(token) { - this.token = token; - } - // currently implements pre-authorization - // TODO: support preAuth = false where it hooks on 401 - prepareRequest(options) { - options.headers['Authorization'] = 'Bearer ' + this.token; - } - // This handler cannot handle 401 - canHandleAuthentication(response) { - return false; - } - handleAuthentication(httpClient, requestInfo, objs) { - return null; - } -} -exports.BearerCredentialHandler = BearerCredentialHandler; -class PersonalAccessTokenCredentialHandler { - constructor(token) { - this.token = token; - } - // currently implements pre-authorization - // TODO: support preAuth = false where it hooks on 401 - prepareRequest(options) { - options.headers['Authorization'] = - 'Basic ' + Buffer.from('PAT:' + this.token).toString('base64'); - } - // This handler cannot handle 401 - canHandleAuthentication(response) { - return false; - } - handleAuthentication(httpClient, requestInfo, objs) { - return null; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__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)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getOptions = void 0; +const core = __importStar(__nccwpck_require__(2186)); +/** + * Returns a copy with defaults filled in. + */ +function getOptions(copy) { + const result = { + followSymbolicLinks: true, + implicitDescendants: true, + matchDirectories: true, + omitBrokenSymbolicLinks: true + }; + if (copy) { + if (typeof copy.followSymbolicLinks === 'boolean') { + result.followSymbolicLinks = copy.followSymbolicLinks; + core.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`); + } + if (typeof copy.implicitDescendants === 'boolean') { + result.implicitDescendants = copy.implicitDescendants; + core.debug(`implicitDescendants '${result.implicitDescendants}'`); + } + if (typeof copy.matchDirectories === 'boolean') { + result.matchDirectories = copy.matchDirectories; + core.debug(`matchDirectories '${result.matchDirectories}'`); + } + if (typeof copy.omitBrokenSymbolicLinks === 'boolean') { + result.omitBrokenSymbolicLinks = copy.omitBrokenSymbolicLinks; + core.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`); + } } + return result; } -exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; - +exports.getOptions = getOptions; +//# sourceMappingURL=internal-glob-options-helper.js.map /***/ }), -/***/ 9925: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 8298: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__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)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __asyncValues = (this && this.__asyncValues) || function (o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } +}; +var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); } +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } +}; Object.defineProperty(exports, "__esModule", ({ value: true })); -const http = __nccwpck_require__(8605); -const https = __nccwpck_require__(7211); -const pm = __nccwpck_require__(6443); -let tunnel; -var HttpCodes; -(function (HttpCodes) { - HttpCodes[HttpCodes["OK"] = 200] = "OK"; - HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices"; - HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently"; - HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved"; - HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther"; - HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified"; - HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy"; - HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy"; - HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect"; - HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect"; - HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest"; - HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized"; - HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired"; - HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden"; - HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound"; - HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed"; - HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable"; - HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired"; - HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout"; - HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict"; - HttpCodes[HttpCodes["Gone"] = 410] = "Gone"; - HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests"; - HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError"; - HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented"; - HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway"; - HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable"; - HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout"; -})(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {})); -var Headers; -(function (Headers) { - Headers["Accept"] = "accept"; - Headers["ContentType"] = "content-type"; -})(Headers = exports.Headers || (exports.Headers = {})); -var MediaTypes; -(function (MediaTypes) { - MediaTypes["ApplicationJson"] = "application/json"; -})(MediaTypes = exports.MediaTypes || (exports.MediaTypes = {})); -/** - * Returns the proxy URL, depending upon the supplied url and proxy environment variables. - * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com - */ -function getProxyUrl(serverUrl) { - let proxyUrl = pm.getProxyUrl(new URL(serverUrl)); - return proxyUrl ? proxyUrl.href : ''; -} -exports.getProxyUrl = getProxyUrl; -const HttpRedirectCodes = [ - HttpCodes.MovedPermanently, - HttpCodes.ResourceMoved, - HttpCodes.SeeOther, - HttpCodes.TemporaryRedirect, - HttpCodes.PermanentRedirect -]; -const HttpResponseRetryCodes = [ - HttpCodes.BadGateway, - HttpCodes.ServiceUnavailable, - HttpCodes.GatewayTimeout -]; -const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD']; -const ExponentialBackoffCeiling = 10; -const ExponentialBackoffTimeSlice = 5; -class HttpClientError extends Error { - constructor(message, statusCode) { - super(message); - this.name = 'HttpClientError'; - this.statusCode = statusCode; - Object.setPrototypeOf(this, HttpClientError.prototype); - } -} -exports.HttpClientError = HttpClientError; -class HttpClientResponse { - constructor(message) { - this.message = message; +exports.DefaultGlobber = void 0; +const core = __importStar(__nccwpck_require__(2186)); +const fs = __importStar(__nccwpck_require__(5747)); +const globOptionsHelper = __importStar(__nccwpck_require__(1026)); +const path = __importStar(__nccwpck_require__(5622)); +const patternHelper = __importStar(__nccwpck_require__(9005)); +const internal_match_kind_1 = __nccwpck_require__(1063); +const internal_pattern_1 = __nccwpck_require__(4536); +const internal_search_state_1 = __nccwpck_require__(9117); +const IS_WINDOWS = process.platform === 'win32'; +class DefaultGlobber { + constructor(options) { + this.patterns = []; + this.searchPaths = []; + this.options = globOptionsHelper.getOptions(options); } - readBody() { - return new Promise(async (resolve, reject) => { - let output = Buffer.alloc(0); - this.message.on('data', (chunk) => { - output = Buffer.concat([output, chunk]); - }); - this.message.on('end', () => { - resolve(output.toString()); - }); - }); + getSearchPaths() { + // Return a copy + return this.searchPaths.slice(); } -} -exports.HttpClientResponse = HttpClientResponse; -function isHttps(requestUrl) { - let parsedUrl = new URL(requestUrl); - return parsedUrl.protocol === 'https:'; -} -exports.isHttps = isHttps; -class HttpClient { - constructor(userAgent, handlers, requestOptions) { - this._ignoreSslError = false; - this._allowRedirects = true; - this._allowRedirectDowngrade = false; - this._maxRedirects = 50; - this._allowRetries = false; - this._maxRetries = 1; - this._keepAlive = false; - this._disposed = false; - this.userAgent = userAgent; - this.handlers = handlers || []; - this.requestOptions = requestOptions; - if (requestOptions) { - if (requestOptions.ignoreSslError != null) { - this._ignoreSslError = requestOptions.ignoreSslError; - } - this._socketTimeout = requestOptions.socketTimeout; - if (requestOptions.allowRedirects != null) { - this._allowRedirects = requestOptions.allowRedirects; - } - if (requestOptions.allowRedirectDowngrade != null) { - this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade; - } - if (requestOptions.maxRedirects != null) { - this._maxRedirects = Math.max(requestOptions.maxRedirects, 0); - } - if (requestOptions.keepAlive != null) { - this._keepAlive = requestOptions.keepAlive; - } - if (requestOptions.allowRetries != null) { - this._allowRetries = requestOptions.allowRetries; + glob() { + var e_1, _a; + return __awaiter(this, void 0, void 0, function* () { + const result = []; + try { + for (var _b = __asyncValues(this.globGenerator()), _c; _c = yield _b.next(), !_c.done;) { + const itemPath = _c.value; + result.push(itemPath); + } } - if (requestOptions.maxRetries != null) { - this._maxRetries = requestOptions.maxRetries; + catch (e_1_1) { e_1 = { error: e_1_1 }; } + finally { + try { + if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b); + } + finally { if (e_1) throw e_1.error; } } - } - } - options(requestUrl, additionalHeaders) { - return this.request('OPTIONS', requestUrl, null, additionalHeaders || {}); - } - get(requestUrl, additionalHeaders) { - return this.request('GET', requestUrl, null, additionalHeaders || {}); - } - del(requestUrl, additionalHeaders) { - return this.request('DELETE', requestUrl, null, additionalHeaders || {}); - } - post(requestUrl, data, additionalHeaders) { - return this.request('POST', requestUrl, data, additionalHeaders || {}); - } - patch(requestUrl, data, additionalHeaders) { - return this.request('PATCH', requestUrl, data, additionalHeaders || {}); - } - put(requestUrl, data, additionalHeaders) { - return this.request('PUT', requestUrl, data, additionalHeaders || {}); - } - head(requestUrl, additionalHeaders) { - return this.request('HEAD', requestUrl, null, additionalHeaders || {}); - } - sendStream(verb, requestUrl, stream, additionalHeaders) { - return this.request(verb, requestUrl, stream, additionalHeaders); - } - /** - * Gets a typed object from an endpoint - * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise - */ - async getJson(requestUrl, additionalHeaders = {}) { - additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); - let res = await this.get(requestUrl, additionalHeaders); - return this._processResponse(res, this.requestOptions); - } - async postJson(requestUrl, obj, additionalHeaders = {}) { - let data = JSON.stringify(obj, null, 2); - additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); - additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); - let res = await this.post(requestUrl, data, additionalHeaders); - return this._processResponse(res, this.requestOptions); - } - async putJson(requestUrl, obj, additionalHeaders = {}) { - let data = JSON.stringify(obj, null, 2); - additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); - additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); - let res = await this.put(requestUrl, data, additionalHeaders); - return this._processResponse(res, this.requestOptions); - } - async patchJson(requestUrl, obj, additionalHeaders = {}) { - let data = JSON.stringify(obj, null, 2); - additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); - additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); - let res = await this.patch(requestUrl, data, additionalHeaders); - return this._processResponse(res, this.requestOptions); + return result; + }); } - /** - * Makes a raw http request. - * All other methods such as get, post, patch, and request ultimately call this. - * Prefer get, del, post and patch - */ - async request(verb, requestUrl, data, headers) { - if (this._disposed) { - throw new Error('Client has already been disposed.'); - } - let parsedUrl = new URL(requestUrl); - let info = this._prepareRequest(verb, parsedUrl, headers); - // Only perform retries on reads since writes may not be idempotent. - let maxTries = this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1 - ? this._maxRetries + 1 - : 1; - let numTries = 0; - let response; - while (numTries < maxTries) { - response = await this.requestRaw(info, data); - // Check if it's an authentication challenge - if (response && - response.message && - response.message.statusCode === HttpCodes.Unauthorized) { - let authenticationHandler; - for (let i = 0; i < this.handlers.length; i++) { - if (this.handlers[i].canHandleAuthentication(response)) { - authenticationHandler = this.handlers[i]; - break; - } + globGenerator() { + return __asyncGenerator(this, arguments, function* globGenerator_1() { + // Fill in defaults options + const options = globOptionsHelper.getOptions(this.options); + // Implicit descendants? + const patterns = []; + for (const pattern of this.patterns) { + patterns.push(pattern); + if (options.implicitDescendants && + (pattern.trailingSeparator || + pattern.segments[pattern.segments.length - 1] !== '**')) { + patterns.push(new internal_pattern_1.Pattern(pattern.negate, true, pattern.segments.concat('**'))); } - if (authenticationHandler) { - return authenticationHandler.handleAuthentication(this, info, data); + } + // Push the search paths + const stack = []; + for (const searchPath of patternHelper.getSearchPaths(patterns)) { + core.debug(`Search path '${searchPath}'`); + // Exists? + try { + // Intentionally using lstat. Detection for broken symlink + // will be performed later (if following symlinks). + yield __await(fs.promises.lstat(searchPath)); } - else { - // We have received an unauthorized response but have no handlers to handle it. - // Let the response return to the caller. - return response; + catch (err) { + if (err.code === 'ENOENT') { + continue; + } + throw err; } + stack.unshift(new internal_search_state_1.SearchState(searchPath, 1)); } - let redirectsRemaining = this._maxRedirects; - while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1 && - this._allowRedirects && - redirectsRemaining > 0) { - const redirectUrl = response.message.headers['location']; - if (!redirectUrl) { - // if there's no location to redirect to, we won't - break; + // Search + const traversalChain = []; // used to detect cycles + while (stack.length) { + // Pop + const item = stack.pop(); + // Match? + const match = patternHelper.match(patterns, item.path); + const partialMatch = !!match || patternHelper.partialMatch(patterns, item.path); + if (!match && !partialMatch) { + continue; } - let parsedRedirectUrl = new URL(redirectUrl); - if (parsedUrl.protocol == 'https:' && - parsedUrl.protocol != parsedRedirectUrl.protocol && - !this._allowRedirectDowngrade) { - throw new Error('Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.'); + // Stat + const stats = yield __await(DefaultGlobber.stat(item, options, traversalChain) + // Broken symlink, or symlink cycle detected, or no longer exists + ); + // Broken symlink, or symlink cycle detected, or no longer exists + if (!stats) { + continue; } - // we need to finish reading the response before reassigning response - // which will leak the open socket. - await response.readBody(); - // strip authorization header if redirected to a different hostname - if (parsedRedirectUrl.hostname !== parsedUrl.hostname) { - for (let header in headers) { - // header names are case insensitive - if (header.toLowerCase() === 'authorization') { - delete headers[header]; - } + // Directory + if (stats.isDirectory()) { + // Matched + if (match & internal_match_kind_1.MatchKind.Directory && options.matchDirectories) { + yield yield __await(item.path); + } + // Descend? + else if (!partialMatch) { + continue; } + // Push the child items in reverse + const childLevel = item.level + 1; + const childItems = (yield __await(fs.promises.readdir(item.path))).map(x => new internal_search_state_1.SearchState(path.join(item.path, x), childLevel)); + stack.push(...childItems.reverse()); + } + // File + else if (match & internal_match_kind_1.MatchKind.File) { + yield yield __await(item.path); } - // let's make the request with the new redirectUrl - info = this._prepareRequest(verb, parsedRedirectUrl, headers); - response = await this.requestRaw(info, data); - redirectsRemaining--; - } - if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) { - // If not a retry code, return immediately instead of retrying - return response; - } - numTries += 1; - if (numTries < maxTries) { - await response.readBody(); - await this._performExponentialBackoff(numTries); } - } - return response; - } - /** - * Needs to be called if keepAlive is set to true in request options. - */ - dispose() { - if (this._agent) { - this._agent.destroy(); - } - this._disposed = true; + }); } /** - * Raw request. - * @param info - * @param data + * Constructs a DefaultGlobber */ - requestRaw(info, data) { - return new Promise((resolve, reject) => { - let callbackForResult = function (err, res) { - if (err) { - reject(err); - } - resolve(res); - }; - this.requestRawWithCallback(info, data, callbackForResult); - }); - } - /** - * Raw request with callback. - * @param info - * @param data - * @param onResult - */ - requestRawWithCallback(info, data, onResult) { - let socket; - if (typeof data === 'string') { - info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8'); - } - let callbackCalled = false; - let handleResult = (err, res) => { - if (!callbackCalled) { - callbackCalled = true; - onResult(err, res); + static create(patterns, options) { + return __awaiter(this, void 0, void 0, function* () { + const result = new DefaultGlobber(options); + if (IS_WINDOWS) { + patterns = patterns.replace(/\r\n/g, '\n'); + patterns = patterns.replace(/\r/g, '\n'); } - }; - let req = info.httpModule.request(info.options, (msg) => { - let res = new HttpClientResponse(msg); - handleResult(null, res); - }); - req.on('socket', sock => { - socket = sock; - }); - // If we ever get disconnected, we want the socket to timeout eventually - req.setTimeout(this._socketTimeout || 3 * 60000, () => { - if (socket) { - socket.end(); + const lines = patterns.split('\n').map(x => x.trim()); + for (const line of lines) { + // Empty or comment + if (!line || line.startsWith('#')) { + continue; + } + // Pattern + else { + result.patterns.push(new internal_pattern_1.Pattern(line)); + } } - handleResult(new Error('Request timeout: ' + info.options.path), null); - }); - req.on('error', function (err) { - // err has statusCode property - // res should have headers - handleResult(err, null); + result.searchPaths.push(...patternHelper.getSearchPaths(result.patterns)); + return result; }); - if (data && typeof data === 'string') { - req.write(data, 'utf8'); - } - if (data && typeof data !== 'string') { - data.on('close', function () { - req.end(); - }); - data.pipe(req); - } - else { - req.end(); - } - } - /** - * Gets an http agent. This function is useful when you need an http agent that handles - * routing through a proxy server - depending upon the url and proxy environment variables. - * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com - */ - getAgent(serverUrl) { - let parsedUrl = new URL(serverUrl); - return this._getAgent(parsedUrl); - } - _prepareRequest(method, requestUrl, headers) { - const info = {}; - info.parsedUrl = requestUrl; - const usingSsl = info.parsedUrl.protocol === 'https:'; - info.httpModule = usingSsl ? https : http; - const defaultPort = usingSsl ? 443 : 80; - info.options = {}; - info.options.host = info.parsedUrl.hostname; - info.options.port = info.parsedUrl.port - ? parseInt(info.parsedUrl.port) - : defaultPort; - info.options.path = - (info.parsedUrl.pathname || '') + (info.parsedUrl.search || ''); - info.options.method = method; - info.options.headers = this._mergeHeaders(headers); - if (this.userAgent != null) { - info.options.headers['user-agent'] = this.userAgent; - } - info.options.agent = this._getAgent(info.parsedUrl); - // gives handlers an opportunity to participate - if (this.handlers) { - this.handlers.forEach(handler => { - handler.prepareRequest(info.options); - }); - } - return info; - } - _mergeHeaders(headers) { - const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {}); - if (this.requestOptions && this.requestOptions.headers) { - return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers)); - } - return lowercaseKeys(headers || {}); - } - _getExistingOrDefaultHeader(additionalHeaders, header, _default) { - const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {}); - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; - } - return additionalHeaders[header] || clientHeader || _default; } - _getAgent(parsedUrl) { - let agent; - let proxyUrl = pm.getProxyUrl(parsedUrl); - let useProxy = proxyUrl && proxyUrl.hostname; - if (this._keepAlive && useProxy) { - agent = this._proxyAgent; - } - if (this._keepAlive && !useProxy) { - agent = this._agent; - } - // if agent is already assigned use that agent. - if (!!agent) { - return agent; - } - const usingSsl = parsedUrl.protocol === 'https:'; - let maxSockets = 100; - if (!!this.requestOptions) { - maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets; - } - if (useProxy) { - // If using proxy, need tunnel - if (!tunnel) { - tunnel = __nccwpck_require__(4294); - } - const agentOptions = { - maxSockets: maxSockets, - keepAlive: this._keepAlive, - proxy: { - ...((proxyUrl.username || proxyUrl.password) && { - proxyAuth: `${proxyUrl.username}:${proxyUrl.password}` - }), - host: proxyUrl.hostname, - port: proxyUrl.port + static stat(item, options, traversalChain) { + return __awaiter(this, void 0, void 0, function* () { + // Note: + // `stat` returns info about the target of a symlink (or symlink chain) + // `lstat` returns info about a symlink itself + let stats; + if (options.followSymbolicLinks) { + try { + // Use `stat` (following symlinks) + stats = yield fs.promises.stat(item.path); } - }; - let tunnelAgent; - const overHttps = proxyUrl.protocol === 'https:'; - if (usingSsl) { - tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp; - } - else { - tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp; - } - agent = tunnelAgent(agentOptions); - this._proxyAgent = agent; - } - // if reusing agent across request and tunneling agent isn't assigned create a new agent - if (this._keepAlive && !agent) { - const options = { keepAlive: this._keepAlive, maxSockets: maxSockets }; - agent = usingSsl ? new https.Agent(options) : new http.Agent(options); - this._agent = agent; - } - // if not using private agent and tunnel agent isn't setup then use global agent - if (!agent) { - agent = usingSsl ? https.globalAgent : http.globalAgent; - } - if (usingSsl && this._ignoreSslError) { - // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process - // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options - // we have to cast it to any and change it directly - agent.options = Object.assign(agent.options || {}, { - rejectUnauthorized: false - }); - } - return agent; - } - _performExponentialBackoff(retryNumber) { - retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); - const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); - return new Promise(resolve => setTimeout(() => resolve(), ms)); - } - static dateTimeDeserializer(key, value) { - if (typeof value === 'string') { - let a = new Date(value); - if (!isNaN(a.valueOf())) { - return a; - } - } - return value; - } - async _processResponse(res, options) { - return new Promise(async (resolve, reject) => { - const statusCode = res.message.statusCode; - const response = { - statusCode: statusCode, - result: null, - headers: {} - }; - // not found leads to null obj returned - if (statusCode == HttpCodes.NotFound) { - resolve(response); - } - let obj; - let contents; - // get the result from the body - try { - contents = await res.readBody(); - if (contents && contents.length > 0) { - if (options && options.deserializeDates) { - obj = JSON.parse(contents, HttpClient.dateTimeDeserializer); - } - else { - obj = JSON.parse(contents); + catch (err) { + if (err.code === 'ENOENT') { + if (options.omitBrokenSymbolicLinks) { + core.debug(`Broken symlink '${item.path}'`); + return undefined; + } + throw new Error(`No information found for the path '${item.path}'. This may indicate a broken symbolic link.`); } - response.result = obj; + throw err; } - response.headers = res.message.headers; } - catch (err) { - // Invalid resource (contents not json); leaving result obj null + else { + // Use `lstat` (not following symlinks) + stats = yield fs.promises.lstat(item.path); } - // note that 3xx redirects are handled by the http layer. - if (statusCode > 299) { - let msg; - // if exception/error in body, attempt to get better error - if (obj && obj.message) { - msg = obj.message; - } - else if (contents && contents.length > 0) { - // it may be the case that the exception is in the body message as string - msg = contents; + // Note, isDirectory() returns false for the lstat of a symlink + if (stats.isDirectory() && options.followSymbolicLinks) { + // Get the realpath + const realPath = yield fs.promises.realpath(item.path); + // Fixup the traversal chain to match the item level + while (traversalChain.length >= item.level) { + traversalChain.pop(); } - else { - msg = 'Failed request: (' + statusCode + ')'; + // Test for a cycle + if (traversalChain.some((x) => x === realPath)) { + core.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`); + return undefined; } - let err = new HttpClientError(msg, statusCode); - err.result = response.result; - reject(err); - } - else { - resolve(response); + // Update the traversal chain + traversalChain.push(realPath); } + return stats; }); } } -exports.HttpClient = HttpClient; - - -/***/ }), - -/***/ 6443: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -function getProxyUrl(reqUrl) { - let usingSsl = reqUrl.protocol === 'https:'; - let proxyUrl; - if (checkBypass(reqUrl)) { - return proxyUrl; - } - let proxyVar; - if (usingSsl) { - proxyVar = process.env['https_proxy'] || process.env['HTTPS_PROXY']; - } - else { - proxyVar = process.env['http_proxy'] || process.env['HTTP_PROXY']; - } - if (proxyVar) { - proxyUrl = new URL(proxyVar); - } - return proxyUrl; -} -exports.getProxyUrl = getProxyUrl; -function checkBypass(reqUrl) { - if (!reqUrl.hostname) { - return false; - } - let noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || ''; - if (!noProxy) { - return false; - } - // Determine the request port - let reqPort; - if (reqUrl.port) { - reqPort = Number(reqUrl.port); - } - else if (reqUrl.protocol === 'http:') { - reqPort = 80; - } - else if (reqUrl.protocol === 'https:') { - reqPort = 443; - } - // Format the request hostname and hostname with port - let upperReqHosts = [reqUrl.hostname.toUpperCase()]; - if (typeof reqPort === 'number') { - upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); - } - // Compare request host against noproxy - for (let upperNoProxyItem of noProxy - .split(',') - .map(x => x.trim().toUpperCase()) - .filter(x => x)) { - if (upperReqHosts.some(x => x === upperNoProxyItem)) { - return true; - } - } - return false; -} -exports.checkBypass = checkBypass; - +exports.DefaultGlobber = DefaultGlobber; +//# sourceMappingURL=internal-globber.js.map /***/ }), -/***/ 1962: +/***/ 2448: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__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)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { @@ -4068,9947 +3858,8318 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; - result["default"] = mod; - return result; +var __asyncValues = (this && this.__asyncValues) || function (o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } }; -var _a; Object.defineProperty(exports, "__esModule", ({ value: true })); -const assert_1 = __nccwpck_require__(2357); +exports.hashFiles = void 0; +const crypto = __importStar(__nccwpck_require__(6417)); +const core = __importStar(__nccwpck_require__(2186)); const fs = __importStar(__nccwpck_require__(5747)); +const stream = __importStar(__nccwpck_require__(2413)); +const util = __importStar(__nccwpck_require__(1669)); const path = __importStar(__nccwpck_require__(5622)); -_a = fs.promises, exports.chmod = _a.chmod, exports.copyFile = _a.copyFile, exports.lstat = _a.lstat, exports.mkdir = _a.mkdir, exports.readdir = _a.readdir, exports.readlink = _a.readlink, exports.rename = _a.rename, exports.rmdir = _a.rmdir, exports.stat = _a.stat, exports.symlink = _a.symlink, exports.unlink = _a.unlink; -exports.IS_WINDOWS = process.platform === 'win32'; -function exists(fsPath) { +function hashFiles(globber) { + var e_1, _a; + var _b; return __awaiter(this, void 0, void 0, function* () { + let hasMatch = false; + const githubWorkspace = (_b = process.env['GITHUB_WORKSPACE']) !== null && _b !== void 0 ? _b : process.cwd(); + const result = crypto.createHash('sha256'); + let count = 0; try { - yield exports.stat(fsPath); + for (var _c = __asyncValues(globber.globGenerator()), _d; _d = yield _c.next(), !_d.done;) { + const file = _d.value; + core.debug(file); + if (!file.startsWith(`${githubWorkspace}${path.sep}`)) { + core.debug(`Ignore '${file}' since it is not under GITHUB_WORKSPACE.`); + continue; + } + if (fs.statSync(file).isDirectory()) { + core.debug(`Skip directory '${file}'.`); + continue; + } + const hash = crypto.createHash('sha256'); + const pipeline = util.promisify(stream.pipeline); + yield pipeline(fs.createReadStream(file), hash); + result.write(hash.digest()); + count++; + if (!hasMatch) { + hasMatch = true; + } + } } - catch (err) { - if (err.code === 'ENOENT') { - return false; + catch (e_1_1) { e_1 = { error: e_1_1 }; } + finally { + try { + if (_d && !_d.done && (_a = _c.return)) yield _a.call(_c); } - throw err; + finally { if (e_1) throw e_1.error; } + } + result.end(); + if (hasMatch) { + core.debug(`Found ${count} files to hash.`); + return result.digest('hex'); + } + else { + core.debug(`No matches found for glob`); + return ''; } - return true; - }); -} -exports.exists = exists; -function isDirectory(fsPath, useStat = false) { - return __awaiter(this, void 0, void 0, function* () { - const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath); - return stats.isDirectory(); }); } -exports.isDirectory = isDirectory; +exports.hashFiles = hashFiles; +//# sourceMappingURL=internal-hash-files.js.map + +/***/ }), + +/***/ 1063: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.MatchKind = void 0; /** - * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like: - * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases). + * Indicates whether a pattern matches a path */ -function isRooted(p) { - p = normalizeSeparators(p); - if (!p) { - throw new Error('isRooted() parameter "p" cannot be empty'); - } - if (exports.IS_WINDOWS) { - return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello - ); // e.g. C: or C:\hello - } - return p.startsWith('/'); -} -exports.isRooted = isRooted; +var MatchKind; +(function (MatchKind) { + /** Not matched */ + MatchKind[MatchKind["None"] = 0] = "None"; + /** Matched if the path is a directory */ + MatchKind[MatchKind["Directory"] = 1] = "Directory"; + /** Matched if the path is a regular file */ + MatchKind[MatchKind["File"] = 2] = "File"; + /** Matched */ + MatchKind[MatchKind["All"] = 3] = "All"; +})(MatchKind = exports.MatchKind || (exports.MatchKind = {})); +//# sourceMappingURL=internal-match-kind.js.map + +/***/ }), + +/***/ 1849: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__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)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.safeTrimTrailingSeparator = exports.normalizeSeparators = exports.hasRoot = exports.hasAbsoluteRoot = exports.ensureAbsoluteRoot = exports.dirname = void 0; +const path = __importStar(__nccwpck_require__(5622)); +const assert_1 = __importDefault(__nccwpck_require__(2357)); +const IS_WINDOWS = process.platform === 'win32'; /** - * Recursively create a directory at `fsPath`. + * Similar to path.dirname except normalizes the path separators and slightly better handling for Windows UNC paths. * - * This implementation is optimistic, meaning it attempts to create the full - * path first, and backs up the path stack from there. + * For example, on Linux/macOS: + * - `/ => /` + * - `/hello => /` * - * @param fsPath The path to create - * @param maxDepth The maximum recursion depth - * @param depth The current recursion depth + * For example, on Windows: + * - `C:\ => C:\` + * - `C:\hello => C:\` + * - `C: => C:` + * - `C:hello => C:` + * - `\ => \` + * - `\hello => \` + * - `\\hello => \\hello` + * - `\\hello\world => \\hello\world` */ -function mkdirP(fsPath, maxDepth = 1000, depth = 1) { - return __awaiter(this, void 0, void 0, function* () { - assert_1.ok(fsPath, 'a path argument must be provided'); - fsPath = path.resolve(fsPath); - if (depth >= maxDepth) - return exports.mkdir(fsPath); - try { - yield exports.mkdir(fsPath); - return; - } - catch (err) { - switch (err.code) { - case 'ENOENT': { - yield mkdirP(path.dirname(fsPath), maxDepth, depth + 1); - yield exports.mkdir(fsPath); - return; - } - default: { - let stats; - try { - stats = yield exports.stat(fsPath); - } - catch (err2) { - throw err; - } - if (!stats.isDirectory()) - throw err; - } - } - } - }); +function dirname(p) { + // Normalize slashes and trim unnecessary trailing slash + p = safeTrimTrailingSeparator(p); + // Windows UNC root, e.g. \\hello or \\hello\world + if (IS_WINDOWS && /^\\\\[^\\]+(\\[^\\]+)?$/.test(p)) { + return p; + } + // Get dirname + let result = path.dirname(p); + // Trim trailing slash for Windows UNC root, e.g. \\hello\world\ + if (IS_WINDOWS && /^\\\\[^\\]+\\[^\\]+\\$/.test(result)) { + result = safeTrimTrailingSeparator(result); + } + return result; } -exports.mkdirP = mkdirP; +exports.dirname = dirname; /** - * Best effort attempt to determine whether a file exists and is executable. - * @param filePath file path to check - * @param extensions additional file extensions to try - * @return if file exists and is executable, returns the file path. otherwise empty string. + * Roots the path if not already rooted. On Windows, relative roots like `\` + * or `C:` are expanded based on the current working directory. */ -function tryGetExecutablePath(filePath, extensions) { - return __awaiter(this, void 0, void 0, function* () { - let stats = undefined; - try { - // test file exists - stats = yield exports.stat(filePath); - } - catch (err) { - if (err.code !== 'ENOENT') { - // eslint-disable-next-line no-console - console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`); - } - } - if (stats && stats.isFile()) { - if (exports.IS_WINDOWS) { - // on Windows, test for valid extension - const upperExt = path.extname(filePath).toUpperCase(); - if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) { - return filePath; - } - } - else { - if (isUnixExecutable(stats)) { - return filePath; - } - } - } - // try each extension - const originalFilePath = filePath; - for (const extension of extensions) { - filePath = originalFilePath + extension; - stats = undefined; - try { - stats = yield exports.stat(filePath); - } - catch (err) { - if (err.code !== 'ENOENT') { - // eslint-disable-next-line no-console - console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`); - } - } - if (stats && stats.isFile()) { - if (exports.IS_WINDOWS) { - // preserve the case of the actual file (since an extension was appended) - try { - const directory = path.dirname(filePath); - const upperName = path.basename(filePath).toUpperCase(); - for (const actualName of yield exports.readdir(directory)) { - if (upperName === actualName.toUpperCase()) { - filePath = path.join(directory, actualName); - break; - } - } - } - catch (err) { - // eslint-disable-next-line no-console - console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`); - } - return filePath; +function ensureAbsoluteRoot(root, itemPath) { + assert_1.default(root, `ensureAbsoluteRoot parameter 'root' must not be empty`); + assert_1.default(itemPath, `ensureAbsoluteRoot parameter 'itemPath' must not be empty`); + // Already rooted + if (hasAbsoluteRoot(itemPath)) { + return itemPath; + } + // Windows + if (IS_WINDOWS) { + // Check for itemPath like C: or C:foo + if (itemPath.match(/^[A-Z]:[^\\/]|^[A-Z]:$/i)) { + let cwd = process.cwd(); + assert_1.default(cwd.match(/^[A-Z]:\\/i), `Expected current directory to start with an absolute drive root. Actual '${cwd}'`); + // Drive letter matches cwd? Expand to cwd + if (itemPath[0].toUpperCase() === cwd[0].toUpperCase()) { + // Drive only, e.g. C: + if (itemPath.length === 2) { + // Preserve specified drive letter case (upper or lower) + return `${itemPath[0]}:\\${cwd.substr(3)}`; } + // Drive + path, e.g. C:foo else { - if (isUnixExecutable(stats)) { - return filePath; + if (!cwd.endsWith('\\')) { + cwd += '\\'; } + // Preserve specified drive letter case (upper or lower) + return `${itemPath[0]}:\\${cwd.substr(3)}${itemPath.substr(2)}`; } } + // Different drive + else { + return `${itemPath[0]}:\\${itemPath.substr(2)}`; + } } - return ''; - }); + // Check for itemPath like \ or \foo + else if (normalizeSeparators(itemPath).match(/^\\$|^\\[^\\]/)) { + const cwd = process.cwd(); + assert_1.default(cwd.match(/^[A-Z]:\\/i), `Expected current directory to start with an absolute drive root. Actual '${cwd}'`); + return `${cwd[0]}:\\${itemPath.substr(1)}`; + } + } + assert_1.default(hasAbsoluteRoot(root), `ensureAbsoluteRoot parameter 'root' must have an absolute root`); + // Otherwise ensure root ends with a separator + if (root.endsWith('/') || (IS_WINDOWS && root.endsWith('\\'))) { + // Intentionally empty + } + else { + // Append separator + root += path.sep; + } + return root + itemPath; } -exports.tryGetExecutablePath = tryGetExecutablePath; +exports.ensureAbsoluteRoot = ensureAbsoluteRoot; +/** + * On Linux/macOS, true if path starts with `/`. On Windows, true for paths like: + * `\\hello\share` and `C:\hello` (and using alternate separator). + */ +function hasAbsoluteRoot(itemPath) { + assert_1.default(itemPath, `hasAbsoluteRoot parameter 'itemPath' must not be empty`); + // Normalize separators + itemPath = normalizeSeparators(itemPath); + // Windows + if (IS_WINDOWS) { + // E.g. \\hello\share or C:\hello + return itemPath.startsWith('\\\\') || /^[A-Z]:\\/i.test(itemPath); + } + // E.g. /hello + return itemPath.startsWith('/'); +} +exports.hasAbsoluteRoot = hasAbsoluteRoot; +/** + * On Linux/macOS, true if path starts with `/`. On Windows, true for paths like: + * `\`, `\hello`, `\\hello\share`, `C:`, and `C:\hello` (and using alternate separator). + */ +function hasRoot(itemPath) { + assert_1.default(itemPath, `isRooted parameter 'itemPath' must not be empty`); + // Normalize separators + itemPath = normalizeSeparators(itemPath); + // Windows + if (IS_WINDOWS) { + // E.g. \ or \hello or \\hello + // E.g. C: or C:\hello + return itemPath.startsWith('\\') || /^[A-Z]:/i.test(itemPath); + } + // E.g. /hello + return itemPath.startsWith('/'); +} +exports.hasRoot = hasRoot; +/** + * Removes redundant slashes and converts `/` to `\` on Windows + */ function normalizeSeparators(p) { p = p || ''; - if (exports.IS_WINDOWS) { - // convert slashes on Windows + // Windows + if (IS_WINDOWS) { + // Convert slashes on Windows p = p.replace(/\//g, '\\'); - // remove redundant slashes - return p.replace(/\\\\+/g, '\\'); + // Remove redundant slashes + const isUnc = /^\\\\+[^\\]/.test(p); // e.g. \\hello + return (isUnc ? '\\' : '') + p.replace(/\\\\+/g, '\\'); // preserve leading \\ for UNC } - // remove redundant slashes + // Remove redundant slashes return p.replace(/\/\/+/g, '/'); } -// on Mac/Linux, test the execute bit -// R W X R W X R W X -// 256 128 64 32 16 8 4 2 1 -function isUnixExecutable(stats) { - return ((stats.mode & 1) > 0 || - ((stats.mode & 8) > 0 && stats.gid === process.getgid()) || - ((stats.mode & 64) > 0 && stats.uid === process.getuid())); +exports.normalizeSeparators = normalizeSeparators; +/** + * Normalizes the path separators and trims the trailing separator (when safe). + * For example, `/foo/ => /foo` but `/ => /` + */ +function safeTrimTrailingSeparator(p) { + // Short-circuit if empty + if (!p) { + return ''; + } + // Normalize separators + p = normalizeSeparators(p); + // No trailing slash + if (!p.endsWith(path.sep)) { + return p; + } + // Check '/' on Linux/macOS and '\' on Windows + if (p === path.sep) { + return p; + } + // On Windows check if drive root. E.g. C:\ + if (IS_WINDOWS && /^[A-Z]:\\$/i.test(p)) { + return p; + } + // Otherwise trim trailing slash + return p.substr(0, p.length - 1); } -//# sourceMappingURL=io-util.js.map +exports.safeTrimTrailingSeparator = safeTrimTrailingSeparator; +//# sourceMappingURL=internal-path-helper.js.map /***/ }), -/***/ 7436: +/***/ 6836: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; - result["default"] = mod; + if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); return result; }; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; Object.defineProperty(exports, "__esModule", ({ value: true })); -const childProcess = __importStar(__nccwpck_require__(3129)); +exports.Path = void 0; const path = __importStar(__nccwpck_require__(5622)); -const util_1 = __nccwpck_require__(1669); -const ioUtil = __importStar(__nccwpck_require__(1962)); -const exec = util_1.promisify(childProcess.exec); +const pathHelper = __importStar(__nccwpck_require__(1849)); +const assert_1 = __importDefault(__nccwpck_require__(2357)); +const IS_WINDOWS = process.platform === 'win32'; /** - * Copies a file or folder. - * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js - * - * @param source source path - * @param dest destination path - * @param options optional. See CopyOptions. + * Helper class for parsing paths into segments */ -function cp(source, dest, options = {}) { - return __awaiter(this, void 0, void 0, function* () { - const { force, recursive } = readCopyOptions(options); - const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null; - // Dest is an existing file, but not forcing - if (destStat && destStat.isFile() && !force) { - return; - } - // If dest is an existing directory, should copy inside. - const newDest = destStat && destStat.isDirectory() - ? path.join(dest, path.basename(source)) - : dest; - if (!(yield ioUtil.exists(source))) { - throw new Error(`no such file or directory: ${source}`); - } - const sourceStat = yield ioUtil.stat(source); - if (sourceStat.isDirectory()) { - if (!recursive) { - throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`); +class Path { + /** + * Constructs a Path + * @param itemPath Path or array of segments + */ + constructor(itemPath) { + this.segments = []; + // String + if (typeof itemPath === 'string') { + assert_1.default(itemPath, `Parameter 'itemPath' must not be empty`); + // Normalize slashes and trim unnecessary trailing slash + itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); + // Not rooted + if (!pathHelper.hasRoot(itemPath)) { + this.segments = itemPath.split(path.sep); } + // Rooted else { - yield cpDirRecursive(source, newDest, 0, force); - } - } - else { - if (path.relative(source, newDest) === '') { - // a file cannot be copied to itself - throw new Error(`'${newDest}' and '${source}' are the same file`); - } - yield copyFile(source, newDest, force); - } - }); -} -exports.cp = cp; -/** - * Moves a path. - * - * @param source source path - * @param dest destination path - * @param options optional. See MoveOptions. - */ -function mv(source, dest, options = {}) { - return __awaiter(this, void 0, void 0, function* () { - if (yield ioUtil.exists(dest)) { - let destExists = true; - if (yield ioUtil.isDirectory(dest)) { - // If dest is directory copy src into dest - dest = path.join(dest, path.basename(source)); - destExists = yield ioUtil.exists(dest); - } - if (destExists) { - if (options.force == null || options.force) { - yield rmRF(dest); - } - else { - throw new Error('Destination already exists'); + // Add all segments, while not at the root + let remaining = itemPath; + let dir = pathHelper.dirname(remaining); + while (dir !== remaining) { + // Add the segment + const basename = path.basename(remaining); + this.segments.unshift(basename); + // Truncate the last segment + remaining = dir; + dir = pathHelper.dirname(remaining); } + // Remainder is the root + this.segments.unshift(remaining); } } - yield mkdirP(path.dirname(dest)); - yield ioUtil.rename(source, dest); - }); -} -exports.mv = mv; -/** - * Remove a path recursively with force - * - * @param inputPath path to remove - */ -function rmRF(inputPath) { - return __awaiter(this, void 0, void 0, function* () { - if (ioUtil.IS_WINDOWS) { - // Node doesn't provide a delete operation, only an unlink function. This means that if the file is being used by another - // program (e.g. antivirus), it won't be deleted. To address this, we shell out the work to rd/del. - try { - if (yield ioUtil.isDirectory(inputPath, true)) { - yield exec(`rd /s /q "${inputPath}"`); + // Array + else { + // Must not be empty + assert_1.default(itemPath.length > 0, `Parameter 'itemPath' must not be an empty array`); + // Each segment + for (let i = 0; i < itemPath.length; i++) { + let segment = itemPath[i]; + // Must not be empty + assert_1.default(segment, `Parameter 'itemPath' must not contain any empty segments`); + // Normalize slashes + segment = pathHelper.normalizeSeparators(itemPath[i]); + // Root segment + if (i === 0 && pathHelper.hasRoot(segment)) { + segment = pathHelper.safeTrimTrailingSeparator(segment); + assert_1.default(segment === pathHelper.dirname(segment), `Parameter 'itemPath' root segment contains information for multiple segments`); + this.segments.push(segment); } + // All other segments else { - yield exec(`del /f /a "${inputPath}"`); + // Must not contain slash + assert_1.default(!segment.includes(path.sep), `Parameter 'itemPath' contains unexpected path separators`); + this.segments.push(segment); } } - catch (err) { - // if you try to delete a file that doesn't exist, desired result is achieved - // other errors are valid - if (err.code !== 'ENOENT') - throw err; - } - // Shelling out fails to remove a symlink folder with missing source, this unlink catches that - try { - yield ioUtil.unlink(inputPath); - } - catch (err) { - // if you try to delete a file that doesn't exist, desired result is achieved - // other errors are valid - if (err.code !== 'ENOENT') - throw err; - } } - else { - let isDir = false; - try { - isDir = yield ioUtil.isDirectory(inputPath); - } - catch (err) { - // if you try to delete a file that doesn't exist, desired result is achieved - // other errors are valid - if (err.code !== 'ENOENT') - throw err; - return; - } - if (isDir) { - yield exec(`rm -rf "${inputPath}"`); + } + /** + * Converts the path to it's string representation + */ + toString() { + // First segment + let result = this.segments[0]; + // All others + let skipSlash = result.endsWith(path.sep) || (IS_WINDOWS && /^[A-Z]:$/i.test(result)); + for (let i = 1; i < this.segments.length; i++) { + if (skipSlash) { + skipSlash = false; } else { - yield ioUtil.unlink(inputPath); + result += path.sep; } + result += this.segments[i]; } - }); -} -exports.rmRF = rmRF; -/** - * Make a directory. Creates the full path with folders in between - * Will throw if it fails - * - * @param fsPath path to create - * @returns Promise - */ -function mkdirP(fsPath) { - return __awaiter(this, void 0, void 0, function* () { - yield ioUtil.mkdirP(fsPath); - }); + return result; + } } -exports.mkdirP = mkdirP; +exports.Path = Path; +//# sourceMappingURL=internal-path.js.map + +/***/ }), + +/***/ 9005: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__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)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.partialMatch = exports.match = exports.getSearchPaths = void 0; +const pathHelper = __importStar(__nccwpck_require__(1849)); +const internal_match_kind_1 = __nccwpck_require__(1063); +const IS_WINDOWS = process.platform === 'win32'; /** - * Returns path of a tool had the tool actually been invoked. Resolves via paths. - * If you check and the tool does not exist, it will throw. - * - * @param tool name of the tool - * @param check whether to check if tool exists - * @returns Promise path to tool + * Given an array of patterns, returns an array of paths to search. + * Duplicates and paths under other included paths are filtered out. */ -function which(tool, check) { - return __awaiter(this, void 0, void 0, function* () { - if (!tool) { - throw new Error("parameter 'tool' is required"); - } - // recursive when check=true - if (check) { - const result = yield which(tool, false); - if (!result) { - if (ioUtil.IS_WINDOWS) { - throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`); - } - else { - throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`); - } +function getSearchPaths(patterns) { + // Ignore negate patterns + patterns = patterns.filter(x => !x.negate); + // Create a map of all search paths + const searchPathMap = {}; + for (const pattern of patterns) { + const key = IS_WINDOWS + ? pattern.searchPath.toUpperCase() + : pattern.searchPath; + searchPathMap[key] = 'candidate'; + } + const result = []; + for (const pattern of patterns) { + // Check if already included + const key = IS_WINDOWS + ? pattern.searchPath.toUpperCase() + : pattern.searchPath; + if (searchPathMap[key] === 'included') { + continue; + } + // Check for an ancestor search path + let foundAncestor = false; + let tempKey = key; + let parent = pathHelper.dirname(tempKey); + while (parent !== tempKey) { + if (searchPathMap[parent]) { + foundAncestor = true; + break; } - return result; + tempKey = parent; + parent = pathHelper.dirname(tempKey); } - const matches = yield findInPath(tool); - if (matches && matches.length > 0) { - return matches[0]; + // Include the search pattern in the result + if (!foundAncestor) { + result.push(pattern.searchPath); + searchPathMap[key] = 'included'; } - return ''; - }); + } + return result; } -exports.which = which; +exports.getSearchPaths = getSearchPaths; /** - * Returns a list of all occurrences of the given tool on the system path. - * - * @returns Promise the paths of the tool + * Matches the patterns against the path */ -function findInPath(tool) { - return __awaiter(this, void 0, void 0, function* () { - if (!tool) { - throw new Error("parameter 'tool' is required"); - } - // build the list of extensions to try - const extensions = []; - if (ioUtil.IS_WINDOWS && process.env['PATHEXT']) { - for (const extension of process.env['PATHEXT'].split(path.delimiter)) { - if (extension) { - extensions.push(extension); - } - } - } - // if it's rooted, return it if exists. otherwise return empty. - if (ioUtil.isRooted(tool)) { - const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions); - if (filePath) { - return [filePath]; - } - return []; - } - // if any path separators, return empty - if (tool.includes(path.sep)) { - return []; - } - // build the list of directories - // - // Note, technically "where" checks the current directory on Windows. From a toolkit perspective, - // it feels like we should not do this. Checking the current directory seems like more of a use - // case of a shell, and the which() function exposed by the toolkit should strive for consistency - // across platforms. - const directories = []; - if (process.env.PATH) { - for (const p of process.env.PATH.split(path.delimiter)) { - if (p) { - directories.push(p); - } - } - } - // find all matches - const matches = []; - for (const directory of directories) { - const filePath = yield ioUtil.tryGetExecutablePath(path.join(directory, tool), extensions); - if (filePath) { - matches.push(filePath); - } +function match(patterns, itemPath) { + let result = internal_match_kind_1.MatchKind.None; + for (const pattern of patterns) { + if (pattern.negate) { + result &= ~pattern.match(itemPath); } - return matches; - }); -} -exports.findInPath = findInPath; -function readCopyOptions(options) { - const force = options.force == null ? true : options.force; - const recursive = Boolean(options.recursive); - return { force, recursive }; -} -function cpDirRecursive(sourceDir, destDir, currentDepth, force) { - return __awaiter(this, void 0, void 0, function* () { - // Ensure there is not a run away recursive copy - if (currentDepth >= 255) - return; - currentDepth++; - yield mkdirP(destDir); - const files = yield ioUtil.readdir(sourceDir); - for (const fileName of files) { - const srcFile = `${sourceDir}/${fileName}`; - const destFile = `${destDir}/${fileName}`; - const srcFileStat = yield ioUtil.lstat(srcFile); - if (srcFileStat.isDirectory()) { - // Recurse - yield cpDirRecursive(srcFile, destFile, currentDepth, force); - } - else { - yield copyFile(srcFile, destFile, force); - } + else { + result |= pattern.match(itemPath); } - // Change the mode for the newly created directory - yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); - }); + } + return result; } -// Buffered file copy -function copyFile(srcFile, destFile, force) { - return __awaiter(this, void 0, void 0, function* () { - if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) { - // unlink/re-link it - try { - yield ioUtil.lstat(destFile); - yield ioUtil.unlink(destFile); - } - catch (e) { - // Try to override file permission - if (e.code === 'EPERM') { - yield ioUtil.chmod(destFile, '0666'); - yield ioUtil.unlink(destFile); - } - // other errors = it doesn't exist, no work to do - } - // Copy over symlink - const symlinkFull = yield ioUtil.readlink(srcFile); - yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? 'junction' : null); - } - else if (!(yield ioUtil.exists(destFile)) || force) { - yield ioUtil.copyFile(srcFile, destFile); - } - }); +exports.match = match; +/** + * Checks whether to descend further into the directory + */ +function partialMatch(patterns, itemPath) { + return patterns.some(x => !x.negate && x.partialMatch(itemPath)); } -//# sourceMappingURL=io.js.map +exports.partialMatch = partialMatch; +//# sourceMappingURL=internal-pattern-helper.js.map /***/ }), -/***/ 2557: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 4536: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; - +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__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)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; Object.defineProperty(exports, "__esModule", ({ value: true })); - -var tslib = __nccwpck_require__(9268); - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -var listenersMap = new WeakMap(); -var abortedMap = new WeakMap(); -/** - * An aborter instance implements AbortSignal interface, can abort HTTP requests. - * - * - Call AbortSignal.none to create a new AbortSignal instance that cannot be cancelled. - * Use `AbortSignal.none` when you are required to pass a cancellation token but the operation - * cannot or will not ever be cancelled. - * - * @example - * Abort without timeout - * ```ts - * await doAsyncWork(AbortSignal.none); - * ``` - */ -var AbortSignal = /** @class */ (function () { - function AbortSignal() { +exports.Pattern = void 0; +const os = __importStar(__nccwpck_require__(2087)); +const path = __importStar(__nccwpck_require__(5622)); +const pathHelper = __importStar(__nccwpck_require__(1849)); +const assert_1 = __importDefault(__nccwpck_require__(2357)); +const minimatch_1 = __nccwpck_require__(3973); +const internal_match_kind_1 = __nccwpck_require__(1063); +const internal_path_1 = __nccwpck_require__(6836); +const IS_WINDOWS = process.platform === 'win32'; +class Pattern { + constructor(patternOrNegate, isImplicitPattern = false, segments, homedir) { /** - * onabort event listener. + * Indicates whether matches should be excluded from the result set */ - this.onabort = null; - listenersMap.set(this, []); - abortedMap.set(this, false); + this.negate = false; + // Pattern overload + let pattern; + if (typeof patternOrNegate === 'string') { + pattern = patternOrNegate.trim(); + } + // Segments overload + else { + // Convert to pattern + segments = segments || []; + assert_1.default(segments.length, `Parameter 'segments' must not empty`); + const root = Pattern.getLiteral(segments[0]); + assert_1.default(root && pathHelper.hasAbsoluteRoot(root), `Parameter 'segments' first element must be a root path`); + pattern = new internal_path_1.Path(segments).toString().trim(); + if (patternOrNegate) { + pattern = `!${pattern}`; + } + } + // Negate + while (pattern.startsWith('!')) { + this.negate = !this.negate; + pattern = pattern.substr(1).trim(); + } + // Normalize slashes and ensures absolute root + pattern = Pattern.fixupPattern(pattern, homedir); + // Segments + this.segments = new internal_path_1.Path(pattern).segments; + // Trailing slash indicates the pattern should only match directories, not regular files + this.trailingSeparator = pathHelper + .normalizeSeparators(pattern) + .endsWith(path.sep); + pattern = pathHelper.safeTrimTrailingSeparator(pattern); + // Search path (literal path prior to the first glob segment) + let foundGlob = false; + const searchSegments = this.segments + .map(x => Pattern.getLiteral(x)) + .filter(x => !foundGlob && !(foundGlob = x === '')); + this.searchPath = new internal_path_1.Path(searchSegments).toString(); + // Root RegExp (required when determining partial match) + this.rootRegExp = new RegExp(Pattern.regExpEscape(searchSegments[0]), IS_WINDOWS ? 'i' : ''); + this.isImplicitPattern = isImplicitPattern; + // Create minimatch + const minimatchOptions = { + dot: true, + nobrace: true, + nocase: IS_WINDOWS, + nocomment: true, + noext: true, + nonegate: true + }; + pattern = IS_WINDOWS ? pattern.replace(/\\/g, '/') : pattern; + this.minimatch = new minimatch_1.Minimatch(pattern, minimatchOptions); } - Object.defineProperty(AbortSignal.prototype, "aborted", { - /** - * Status of whether aborted or not. - * - * @readonly - */ - get: function () { - if (!abortedMap.has(this)) { - throw new TypeError("Expected `this` to be an instance of AbortSignal."); + /** + * Matches the pattern against the specified path + */ + match(itemPath) { + // Last segment is globstar? + if (this.segments[this.segments.length - 1] === '**') { + // Normalize slashes + itemPath = pathHelper.normalizeSeparators(itemPath); + // Append a trailing slash. Otherwise Minimatch will not match the directory immediately + // preceding the globstar. For example, given the pattern `/foo/**`, Minimatch returns + // false for `/foo` but returns true for `/foo/`. Append a trailing slash to handle that quirk. + if (!itemPath.endsWith(path.sep) && this.isImplicitPattern === false) { + // Note, this is safe because the constructor ensures the pattern has an absolute root. + // For example, formats like C: and C:foo on Windows are resolved to an absolute root. + itemPath = `${itemPath}${path.sep}`; } - return abortedMap.get(this); - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(AbortSignal, "none", { - /** - * Creates a new AbortSignal instance that will never be aborted. - * - * @readonly - */ - get: function () { - return new AbortSignal(); - }, - enumerable: false, - configurable: true - }); + } + else { + // Normalize slashes and trim unnecessary trailing slash + itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); + } + // Match + if (this.minimatch.match(itemPath)) { + return this.trailingSeparator ? internal_match_kind_1.MatchKind.Directory : internal_match_kind_1.MatchKind.All; + } + return internal_match_kind_1.MatchKind.None; + } /** - * Added new "abort" event listener, only support "abort" event. - * - * @param _type - Only support "abort" event - * @param listener - The listener to be added + * Indicates whether the pattern may match descendants of the specified path */ - AbortSignal.prototype.addEventListener = function ( - // tslint:disable-next-line:variable-name - _type, listener) { - if (!listenersMap.has(this)) { - throw new TypeError("Expected `this` to be an instance of AbortSignal."); + partialMatch(itemPath) { + // Normalize slashes and trim unnecessary trailing slash + itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); + // matchOne does not handle root path correctly + if (pathHelper.dirname(itemPath) === itemPath) { + return this.rootRegExp.test(itemPath); } - var listeners = listenersMap.get(this); - listeners.push(listener); - }; + return this.minimatch.matchOne(itemPath.split(IS_WINDOWS ? /\\+/ : /\/+/), this.minimatch.set[0], true); + } /** - * Remove "abort" event listener, only support "abort" event. - * - * @param _type - Only support "abort" event - * @param listener - The listener to be removed + * Escapes glob patterns within a path */ - AbortSignal.prototype.removeEventListener = function ( - // tslint:disable-next-line:variable-name - _type, listener) { - if (!listenersMap.has(this)) { - throw new TypeError("Expected `this` to be an instance of AbortSignal."); + static globEscape(s) { + return (IS_WINDOWS ? s : s.replace(/\\/g, '\\\\')) // escape '\' on Linux/macOS + .replace(/(\[)(?=[^/]+\])/g, '[[]') // escape '[' when ']' follows within the path segment + .replace(/\?/g, '[?]') // escape '?' + .replace(/\*/g, '[*]'); // escape '*' + } + /** + * Normalizes slashes and ensures absolute root + */ + static fixupPattern(pattern, homedir) { + // Empty + assert_1.default(pattern, 'pattern cannot be empty'); + // Must not contain `.` segment, unless first segment + // Must not contain `..` segment + const literalSegments = new internal_path_1.Path(pattern).segments.map(x => Pattern.getLiteral(x)); + assert_1.default(literalSegments.every((x, i) => (x !== '.' || i === 0) && x !== '..'), `Invalid pattern '${pattern}'. Relative pathing '.' and '..' is not allowed.`); + // Must not contain globs in root, e.g. Windows UNC path \\foo\b*r + assert_1.default(!pathHelper.hasRoot(pattern) || literalSegments[0], `Invalid pattern '${pattern}'. Root segment must not contain globs.`); + // Normalize slashes + pattern = pathHelper.normalizeSeparators(pattern); + // Replace leading `.` segment + if (pattern === '.' || pattern.startsWith(`.${path.sep}`)) { + pattern = Pattern.globEscape(process.cwd()) + pattern.substr(1); } - var listeners = listenersMap.get(this); - var index = listeners.indexOf(listener); - if (index > -1) { - listeners.splice(index, 1); + // Replace leading `~` segment + else if (pattern === '~' || pattern.startsWith(`~${path.sep}`)) { + homedir = homedir || os.homedir(); + assert_1.default(homedir, 'Unable to determine HOME directory'); + assert_1.default(pathHelper.hasAbsoluteRoot(homedir), `Expected HOME directory to be a rooted path. Actual '${homedir}'`); + pattern = Pattern.globEscape(homedir) + pattern.substr(1); } - }; + // Replace relative drive root, e.g. pattern is C: or C:foo + else if (IS_WINDOWS && + (pattern.match(/^[A-Z]:$/i) || pattern.match(/^[A-Z]:[^\\]/i))) { + let root = pathHelper.ensureAbsoluteRoot('C:\\dummy-root', pattern.substr(0, 2)); + if (pattern.length > 2 && !root.endsWith('\\')) { + root += '\\'; + } + pattern = Pattern.globEscape(root) + pattern.substr(2); + } + // Replace relative root, e.g. pattern is \ or \foo + else if (IS_WINDOWS && (pattern === '\\' || pattern.match(/^\\[^\\]/))) { + let root = pathHelper.ensureAbsoluteRoot('C:\\dummy-root', '\\'); + if (!root.endsWith('\\')) { + root += '\\'; + } + pattern = Pattern.globEscape(root) + pattern.substr(1); + } + // Otherwise ensure absolute root + else { + pattern = pathHelper.ensureAbsoluteRoot(Pattern.globEscape(process.cwd()), pattern); + } + return pathHelper.normalizeSeparators(pattern); + } /** - * Dispatches a synthetic event to the AbortSignal. + * Attempts to unescape a pattern segment to create a literal path segment. + * Otherwise returns empty string. */ - AbortSignal.prototype.dispatchEvent = function (_event) { - throw new Error("This is a stub dispatchEvent implementation that should not be used. It only exists for type-checking purposes."); - }; - return AbortSignal; -}()); -/** - * Helper to trigger an abort event immediately, the onabort and all abort event listeners will be triggered. - * Will try to trigger abort event for all linked AbortSignal nodes. - * - * - If there is a timeout, the timer will be cancelled. - * - If aborted is true, nothing will happen. - * - * @internal - */ -// eslint-disable-next-line @azure/azure-sdk/ts-use-interface-parameters -function abortSignal(signal) { - if (signal.aborted) { - return; + static getLiteral(segment) { + let literal = ''; + for (let i = 0; i < segment.length; i++) { + const c = segment[i]; + // Escape + if (c === '\\' && !IS_WINDOWS && i + 1 < segment.length) { + literal += segment[++i]; + continue; + } + // Wildcard + else if (c === '*' || c === '?') { + return ''; + } + // Character set + else if (c === '[' && i + 1 < segment.length) { + let set = ''; + let closed = -1; + for (let i2 = i + 1; i2 < segment.length; i2++) { + const c2 = segment[i2]; + // Escape + if (c2 === '\\' && !IS_WINDOWS && i2 + 1 < segment.length) { + set += segment[++i2]; + continue; + } + // Closed + else if (c2 === ']') { + closed = i2; + break; + } + // Otherwise + else { + set += c2; + } + } + // Closed? + if (closed >= 0) { + // Cannot convert + if (set.length > 1) { + return ''; + } + // Convert to literal + if (set) { + literal += set; + i = closed; + continue; + } + } + // Otherwise fall thru + } + // Append + literal += c; + } + return literal; } - if (signal.onabort) { - signal.onabort.call(signal); + /** + * Escapes regexp special characters + * https://javascript.info/regexp-escaping + */ + static regExpEscape(s) { + return s.replace(/[[\\^$.|?*+()]/g, '\\$&'); } - var listeners = listenersMap.get(signal); - if (listeners) { - // Create a copy of listeners so mutations to the array - // (e.g. via removeListener calls) don't affect the listeners - // we invoke. - listeners.slice().forEach(function (listener) { - listener.call(signal, { type: "abort" }); - }); - } - abortedMap.set(signal, true); } - -// Copyright (c) Microsoft Corporation. -/** - * This error is thrown when an asynchronous operation has been aborted. - * Check for this error by testing the `name` that the name property of the - * error matches `"AbortError"`. - * - * @example - * ```ts - * const controller = new AbortController(); - * controller.abort(); - * try { - * doAsyncWork(controller.signal) - * } catch (e) { - * if (e.name === 'AbortError') { - * // handle abort error here. - * } - * } - * ``` - */ -var AbortError = /** @class */ (function (_super) { - tslib.__extends(AbortError, _super); - function AbortError(message) { - var _this = _super.call(this, message) || this; - _this.name = "AbortError"; - return _this; - } - return AbortError; -}(Error)); -/** - * An AbortController provides an AbortSignal and the associated controls to signal - * that an asynchronous operation should be aborted. - * - * @example - * Abort an operation when another event fires - * ```ts - * const controller = new AbortController(); - * const signal = controller.signal; - * doAsyncWork(signal); - * button.addEventListener('click', () => controller.abort()); - * ``` - * - * @example - * Share aborter cross multiple operations in 30s - * ```ts - * // Upload the same data to 2 different data centers at the same time, - * // abort another when any of them is finished - * const controller = AbortController.withTimeout(30 * 1000); - * doAsyncWork(controller.signal).then(controller.abort); - * doAsyncWork(controller.signal).then(controller.abort); - *``` - * - * @example - * Cascaded aborting - * ```ts - * // All operations can't take more than 30 seconds - * const aborter = Aborter.timeout(30 * 1000); - * - * // Following 2 operations can't take more than 25 seconds - * await doAsyncWork(aborter.withTimeout(25 * 1000)); - * await doAsyncWork(aborter.withTimeout(25 * 1000)); - * ``` - */ -var AbortController = /** @class */ (function () { - // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types - function AbortController(parentSignals) { - var _this = this; - this._signal = new AbortSignal(); - if (!parentSignals) { - return; - } - // coerce parentSignals into an array - if (!Array.isArray(parentSignals)) { - // eslint-disable-next-line prefer-rest-params - parentSignals = arguments; - } - for (var _i = 0, parentSignals_1 = parentSignals; _i < parentSignals_1.length; _i++) { - var parentSignal = parentSignals_1[_i]; - // if the parent signal has already had abort() called, - // then call abort on this signal as well. - if (parentSignal.aborted) { - this.abort(); - } - else { - // when the parent signal aborts, this signal should as well. - parentSignal.addEventListener("abort", function () { - _this.abort(); - }); - } - } - } - Object.defineProperty(AbortController.prototype, "signal", { - /** - * The AbortSignal associated with this controller that will signal aborted - * when the abort method is called on this controller. - * - * @readonly - */ - get: function () { - return this._signal; - }, - enumerable: false, - configurable: true - }); - /** - * Signal that any operations passed this controller's associated abort signal - * to cancel any remaining work and throw an `AbortError`. - */ - AbortController.prototype.abort = function () { - abortSignal(this._signal); - }; - /** - * Creates a new AbortSignal instance that will abort after the provided ms. - * @param ms - Elapsed time in milliseconds to trigger an abort. - */ - AbortController.timeout = function (ms) { - var signal = new AbortSignal(); - var timer = setTimeout(abortSignal, ms, signal); - // Prevent the active Timer from keeping the Node.js event loop active. - if (typeof timer.unref === "function") { - timer.unref(); - } - return signal; - }; - return AbortController; -}()); - -exports.AbortController = AbortController; -exports.AbortError = AbortError; -exports.AbortSignal = AbortSignal; -//# sourceMappingURL=index.js.map - - -/***/ }), - -/***/ 9268: -/***/ ((module) => { - -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global global, define, System, Reflect, Promise */ -var __extends; -var __assign; -var __rest; -var __decorate; -var __param; -var __metadata; -var __awaiter; -var __generator; -var __exportStar; -var __values; -var __read; -var __spread; -var __spreadArrays; -var __spreadArray; -var __await; -var __asyncGenerator; -var __asyncDelegator; -var __asyncValues; -var __makeTemplateObject; -var __importStar; -var __importDefault; -var __classPrivateFieldGet; -var __classPrivateFieldSet; -var __createBinding; -(function (factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); - } - else if ( true && typeof module.exports === "object") { - factory(createExporter(root, createExporter(module.exports))); - } - else { - factory(createExporter(root)); - } - function createExporter(exports, previous) { - if (exports !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports, "__esModule", { value: true }); - } - else { - exports.__esModule = true; - } - } - return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; - } -}) -(function (exporter) { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - - __extends = function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - - __assign = Object.assign || function (t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - }; - - __rest = function (s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; - - __decorate = function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - - __param = function (paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } - }; - - __metadata = function (metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); - }; - - __awaiter = function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - - __generator = function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - }; - - __exportStar = function(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); - }; - - __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); - }) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); - - __values = function (o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - - __read = function (o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; - }; - - /** @deprecated */ - __spread = function () { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; - }; - - /** @deprecated */ - __spreadArrays = function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; - - __spreadArray = function (to, from) { - for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) - to[j] = from[i]; - return to; - }; - - __await = function (v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); - }; - - __asyncGenerator = function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - }; - - __asyncDelegator = function (o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } - }; - - __asyncValues = function (o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } - }; - - __makeTemplateObject = function (cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; - }; - - var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - - __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)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; - - __importDefault = function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; - }; - - __classPrivateFieldGet = function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - - __classPrivateFieldSet = function (receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; - }; - - exporter("__extends", __extends); - exporter("__assign", __assign); - exporter("__rest", __rest); - exporter("__decorate", __decorate); - exporter("__param", __param); - exporter("__metadata", __metadata); - exporter("__awaiter", __awaiter); - exporter("__generator", __generator); - exporter("__exportStar", __exportStar); - exporter("__createBinding", __createBinding); - exporter("__values", __values); - exporter("__read", __read); - exporter("__spread", __spread); - exporter("__spreadArrays", __spreadArrays); - exporter("__spreadArray", __spreadArray); - exporter("__await", __await); - exporter("__asyncGenerator", __asyncGenerator); - exporter("__asyncDelegator", __asyncDelegator); - exporter("__asyncValues", __asyncValues); - exporter("__makeTemplateObject", __makeTemplateObject); - exporter("__importStar", __importStar); - exporter("__importDefault", __importDefault); - exporter("__classPrivateFieldGet", __classPrivateFieldGet); - exporter("__classPrivateFieldSet", __classPrivateFieldSet); -}); - +exports.Pattern = Pattern; +//# sourceMappingURL=internal-pattern.js.map /***/ }), -/***/ 6821: -/***/ (() => { +/***/ 9117: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -if (typeof Symbol === undefined || !Symbol.asyncIterator) { - Symbol.asyncIterator = Symbol.for("Symbol.asyncIterator"); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.SearchState = void 0; +class SearchState { + constructor(path, level) { + this.path = path; + this.level = level; + } } -//# sourceMappingURL=index.js.map +exports.SearchState = SearchState; +//# sourceMappingURL=internal-search-state.js.map /***/ }), -/***/ 9645: +/***/ 3702: /***/ ((__unused_webpack_module, exports) => { "use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * A static-key-based credential that supports updating - * the underlying key value. - */ -var AzureKeyCredential = /** @class */ (function () { - /** - * Create an instance of an AzureKeyCredential for use - * with a service client. - * - * @param key - The initial value of the key to use in authentication - */ - function AzureKeyCredential(key) { - if (!key) { - throw new Error("key must be a non-empty string"); - } - this._key = key; +class BasicCredentialHandler { + constructor(username, password) { + this.username = username; + this.password = password; } - Object.defineProperty(AzureKeyCredential.prototype, "key", { - /** - * The value of the key to be used in authentication - */ - get: function () { - return this._key; - }, - enumerable: false, - configurable: true - }); - /** - * Change the value of the key. - * - * Updates will take effect upon the next request after - * updating the key value. - * - * @param newKey - The new key value to be used - */ - AzureKeyCredential.prototype.update = function (newKey) { - this._key = newKey; - }; - return AzureKeyCredential; -}()); - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * Helper TypeGuard that checks if something is defined or not. - * @param thing - Anything - * @internal - */ -function isDefined(thing) { - return typeof thing !== "undefined" && thing !== null; -} -/** - * Helper TypeGuard that checks if the input is an object with the specified properties. - * Note: The properties may be inherited. - * @param thing - Anything. - * @param properties - The name of the properties that should appear in the object. - * @internal - */ -function isObjectWithProperties(thing, properties) { - if (!isDefined(thing) || typeof thing !== "object") { + prepareRequest(options) { + options.headers['Authorization'] = + 'Basic ' + + Buffer.from(this.username + ':' + this.password).toString('base64'); + } + // This handler cannot handle 401 + canHandleAuthentication(response) { return false; } - for (var _i = 0, properties_1 = properties; _i < properties_1.length; _i++) { - var property = properties_1[_i]; - if (!objectHasProperty(thing, property)) { - return false; - } + handleAuthentication(httpClient, requestInfo, objs) { + return null; } - return true; } -/** - * Helper TypeGuard that checks if the input is an object with the specified property. - * Note: The property may be inherited. - * @param thing - Any object. - * @param property - The name of the property that should appear in the object. - * @internal - */ -function objectHasProperty(thing, property) { - return typeof thing === "object" && property in thing; -} - -// Copyright (c) Microsoft Corporation. -/** - * A static name/key-based credential that supports updating - * the underlying name and key values. - */ -var AzureNamedKeyCredential = /** @class */ (function () { - /** - * Create an instance of an AzureNamedKeyCredential for use - * with a service client. - * - * @param name - The initial value of the name to use in authentication. - * @param key - The initial value of the key to use in authentication. - */ - function AzureNamedKeyCredential(name, key) { - if (!name || !key) { - throw new TypeError("name and key must be non-empty strings"); - } - this._name = name; - this._key = key; +exports.BasicCredentialHandler = BasicCredentialHandler; +class BearerCredentialHandler { + constructor(token) { + this.token = token; } - Object.defineProperty(AzureNamedKeyCredential.prototype, "key", { - /** - * The value of the key to be used in authentication. - */ - get: function () { - return this._key; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(AzureNamedKeyCredential.prototype, "name", { - /** - * The value of the name to be used in authentication. - */ - get: function () { - return this._name; - }, - enumerable: false, - configurable: true - }); - /** - * Change the value of the key. - * - * Updates will take effect upon the next request after - * updating the key value. - * - * @param newName - The new name value to be used. - * @param newKey - The new key value to be used. - */ - AzureNamedKeyCredential.prototype.update = function (newName, newKey) { - if (!newName || !newKey) { - throw new TypeError("newName and newKey must be non-empty strings"); - } - this._name = newName; - this._key = newKey; - }; - return AzureNamedKeyCredential; -}()); -/** - * Tests an object to determine whether it implements NamedKeyCredential. - * - * @param credential - The assumed NamedKeyCredential to be tested. - */ -function isNamedKeyCredential(credential) { - return (isObjectWithProperties(credential, ["name", "key"]) && - typeof credential.key === "string" && - typeof credential.name === "string"); -} - -// Copyright (c) Microsoft Corporation. -/** - * A static-signature-based credential that supports updating - * the underlying signature value. - */ -var AzureSASCredential = /** @class */ (function () { - /** - * Create an instance of an AzureSASCredential for use - * with a service client. - * - * @param signature - The initial value of the shared access signature to use in authentication - */ - function AzureSASCredential(signature) { - if (!signature) { - throw new Error("shared access signature must be a non-empty string"); - } - this._signature = signature; + // currently implements pre-authorization + // TODO: support preAuth = false where it hooks on 401 + prepareRequest(options) { + options.headers['Authorization'] = 'Bearer ' + this.token; + } + // This handler cannot handle 401 + canHandleAuthentication(response) { + return false; + } + handleAuthentication(httpClient, requestInfo, objs) { + return null; } - Object.defineProperty(AzureSASCredential.prototype, "signature", { - /** - * The value of the shared access signature to be used in authentication - */ - get: function () { - return this._signature; - }, - enumerable: false, - configurable: true - }); - /** - * Change the value of the signature. - * - * Updates will take effect upon the next request after - * updating the signature value. - * - * @param newSignature - The new shared access signature value to be used - */ - AzureSASCredential.prototype.update = function (newSignature) { - if (!newSignature) { - throw new Error("shared access signature must be a non-empty string"); - } - this._signature = newSignature; - }; - return AzureSASCredential; -}()); -/** - * Tests an object to determine whether it implements SASCredential. - * - * @param credential - The assumed SASCredential to be tested. - */ -function isSASCredential(credential) { - return (isObjectWithProperties(credential, ["signature"]) && typeof credential.signature === "string"); } - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * Tests an object to determine whether it implements TokenCredential. - * - * @param credential - The assumed TokenCredential to be tested. - */ -function isTokenCredential(credential) { - // Check for an object with a 'getToken' function and possibly with - // a 'signRequest' function. We do this check to make sure that - // a ServiceClientCredentials implementor (like TokenClientCredentials - // in ms-rest-nodeauth) doesn't get mistaken for a TokenCredential if - // it doesn't actually implement TokenCredential also. - var castCredential = credential; - return (castCredential && - typeof castCredential.getToken === "function" && - (castCredential.signRequest === undefined || castCredential.getToken.length > 0)); +exports.BearerCredentialHandler = BearerCredentialHandler; +class PersonalAccessTokenCredentialHandler { + constructor(token) { + this.token = token; + } + // currently implements pre-authorization + // TODO: support preAuth = false where it hooks on 401 + prepareRequest(options) { + options.headers['Authorization'] = + 'Basic ' + Buffer.from('PAT:' + this.token).toString('base64'); + } + // This handler cannot handle 401 + canHandleAuthentication(response) { + return false; + } + handleAuthentication(httpClient, requestInfo, objs) { + return null; + } } - -exports.AzureKeyCredential = AzureKeyCredential; -exports.AzureNamedKeyCredential = AzureNamedKeyCredential; -exports.AzureSASCredential = AzureSASCredential; -exports.isNamedKeyCredential = isNamedKeyCredential; -exports.isSASCredential = isSASCredential; -exports.isTokenCredential = isTokenCredential; -//# sourceMappingURL=index.js.map +exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; /***/ }), -/***/ 4607: +/***/ 9925: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); - -function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } - -var tslib = __nccwpck_require__(2107); -var uuid = __nccwpck_require__(3415); -var tough = __nccwpck_require__(8165); -var http = __nccwpck_require__(8605); -var https = __nccwpck_require__(7211); -var node_fetch = _interopDefault(__nccwpck_require__(467)); -var abortController = __nccwpck_require__(2557); -var FormData = _interopDefault(__nccwpck_require__(6279)); -var util = __nccwpck_require__(1669); -var url = __nccwpck_require__(8835); -var stream = __nccwpck_require__(2413); -var logger$1 = __nccwpck_require__(3233); -var tunnel = __nccwpck_require__(4294); -var coreAuth = __nccwpck_require__(9645); -var xml2js = __nccwpck_require__(6189); -var os = __nccwpck_require__(2087); -var coreTracing = __nccwpck_require__(1754); -__nccwpck_require__(6821); - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. +const http = __nccwpck_require__(8605); +const https = __nccwpck_require__(7211); +const pm = __nccwpck_require__(6443); +let tunnel; +var HttpCodes; +(function (HttpCodes) { + HttpCodes[HttpCodes["OK"] = 200] = "OK"; + HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices"; + HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently"; + HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved"; + HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther"; + HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified"; + HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy"; + HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy"; + HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect"; + HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect"; + HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest"; + HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized"; + HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired"; + HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden"; + HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound"; + HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed"; + HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable"; + HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired"; + HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout"; + HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict"; + HttpCodes[HttpCodes["Gone"] = 410] = "Gone"; + HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests"; + HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError"; + HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented"; + HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway"; + HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable"; + HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout"; +})(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {})); +var Headers; +(function (Headers) { + Headers["Accept"] = "accept"; + Headers["ContentType"] = "content-type"; +})(Headers = exports.Headers || (exports.Headers = {})); +var MediaTypes; +(function (MediaTypes) { + MediaTypes["ApplicationJson"] = "application/json"; +})(MediaTypes = exports.MediaTypes || (exports.MediaTypes = {})); /** - * A collection of HttpHeaders that can be sent with a HTTP request. + * Returns the proxy URL, depending upon the supplied url and proxy environment variables. + * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com */ -function getHeaderKey(headerName) { - return headerName.toLowerCase(); +function getProxyUrl(serverUrl) { + let proxyUrl = pm.getProxyUrl(new URL(serverUrl)); + return proxyUrl ? proxyUrl.href : ''; } -function isHttpHeadersLike(object) { - if (object && typeof object === "object") { - var castObject = object; - if (typeof castObject.rawHeaders === "function" && - typeof castObject.clone === "function" && - typeof castObject.get === "function" && - typeof castObject.set === "function" && - typeof castObject.contains === "function" && - typeof castObject.remove === "function" && - typeof castObject.headersArray === "function" && - typeof castObject.headerValues === "function" && - typeof castObject.headerNames === "function" && - typeof castObject.toJson === "function") { - return true; - } +exports.getProxyUrl = getProxyUrl; +const HttpRedirectCodes = [ + HttpCodes.MovedPermanently, + HttpCodes.ResourceMoved, + HttpCodes.SeeOther, + HttpCodes.TemporaryRedirect, + HttpCodes.PermanentRedirect +]; +const HttpResponseRetryCodes = [ + HttpCodes.BadGateway, + HttpCodes.ServiceUnavailable, + HttpCodes.GatewayTimeout +]; +const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD']; +const ExponentialBackoffCeiling = 10; +const ExponentialBackoffTimeSlice = 5; +class HttpClientError extends Error { + constructor(message, statusCode) { + super(message); + this.name = 'HttpClientError'; + this.statusCode = statusCode; + Object.setPrototypeOf(this, HttpClientError.prototype); } - return false; } -/** - * A collection of HTTP header key/value pairs. - */ -var HttpHeaders = /** @class */ (function () { - function HttpHeaders(rawHeaders) { - this._headersMap = {}; - if (rawHeaders) { - for (var headerName in rawHeaders) { - this.set(headerName, rawHeaders[headerName]); +exports.HttpClientError = HttpClientError; +class HttpClientResponse { + constructor(message) { + this.message = message; + } + readBody() { + return new Promise(async (resolve, reject) => { + let output = Buffer.alloc(0); + this.message.on('data', (chunk) => { + output = Buffer.concat([output, chunk]); + }); + this.message.on('end', () => { + resolve(output.toString()); + }); + }); + } +} +exports.HttpClientResponse = HttpClientResponse; +function isHttps(requestUrl) { + let parsedUrl = new URL(requestUrl); + return parsedUrl.protocol === 'https:'; +} +exports.isHttps = isHttps; +class HttpClient { + constructor(userAgent, handlers, requestOptions) { + this._ignoreSslError = false; + this._allowRedirects = true; + this._allowRedirectDowngrade = false; + this._maxRedirects = 50; + this._allowRetries = false; + this._maxRetries = 1; + this._keepAlive = false; + this._disposed = false; + this.userAgent = userAgent; + this.handlers = handlers || []; + this.requestOptions = requestOptions; + if (requestOptions) { + if (requestOptions.ignoreSslError != null) { + this._ignoreSslError = requestOptions.ignoreSslError; + } + this._socketTimeout = requestOptions.socketTimeout; + if (requestOptions.allowRedirects != null) { + this._allowRedirects = requestOptions.allowRedirects; + } + if (requestOptions.allowRedirectDowngrade != null) { + this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade; + } + if (requestOptions.maxRedirects != null) { + this._maxRedirects = Math.max(requestOptions.maxRedirects, 0); + } + if (requestOptions.keepAlive != null) { + this._keepAlive = requestOptions.keepAlive; + } + if (requestOptions.allowRetries != null) { + this._allowRetries = requestOptions.allowRetries; + } + if (requestOptions.maxRetries != null) { + this._maxRetries = requestOptions.maxRetries; } } } + options(requestUrl, additionalHeaders) { + return this.request('OPTIONS', requestUrl, null, additionalHeaders || {}); + } + get(requestUrl, additionalHeaders) { + return this.request('GET', requestUrl, null, additionalHeaders || {}); + } + del(requestUrl, additionalHeaders) { + return this.request('DELETE', requestUrl, null, additionalHeaders || {}); + } + post(requestUrl, data, additionalHeaders) { + return this.request('POST', requestUrl, data, additionalHeaders || {}); + } + patch(requestUrl, data, additionalHeaders) { + return this.request('PATCH', requestUrl, data, additionalHeaders || {}); + } + put(requestUrl, data, additionalHeaders) { + return this.request('PUT', requestUrl, data, additionalHeaders || {}); + } + head(requestUrl, additionalHeaders) { + return this.request('HEAD', requestUrl, null, additionalHeaders || {}); + } + sendStream(verb, requestUrl, stream, additionalHeaders) { + return this.request(verb, requestUrl, stream, additionalHeaders); + } /** - * Set a header in this collection with the provided name and value. The name is - * case-insensitive. - * @param headerName - The name of the header to set. This value is case-insensitive. - * @param headerValue - The value of the header to set. - */ - HttpHeaders.prototype.set = function (headerName, headerValue) { - this._headersMap[getHeaderKey(headerName)] = { - name: headerName, - value: headerValue.toString() - }; - }; - /** - * Get the header value for the provided header name, or undefined if no header exists in this - * collection with the provided name. - * @param headerName - The name of the header. - */ - HttpHeaders.prototype.get = function (headerName) { - var header = this._headersMap[getHeaderKey(headerName)]; - return !header ? undefined : header.value; - }; - /** - * Get whether or not this header collection contains a header entry for the provided header name. - */ - HttpHeaders.prototype.contains = function (headerName) { - return !!this._headersMap[getHeaderKey(headerName)]; - }; - /** - * Remove the header with the provided headerName. Return whether or not the header existed and - * was removed. - * @param headerName - The name of the header to remove. - */ - HttpHeaders.prototype.remove = function (headerName) { - var result = this.contains(headerName); - delete this._headersMap[getHeaderKey(headerName)]; - return result; - }; - /** - * Get the headers that are contained this collection as an object. + * Gets a typed object from an endpoint + * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise */ - HttpHeaders.prototype.rawHeaders = function () { - var result = {}; - for (var headerKey in this._headersMap) { - var header = this._headersMap[headerKey]; - result[header.name.toLowerCase()] = header.value; - } - return result; - }; + async getJson(requestUrl, additionalHeaders = {}) { + additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); + let res = await this.get(requestUrl, additionalHeaders); + return this._processResponse(res, this.requestOptions); + } + async postJson(requestUrl, obj, additionalHeaders = {}) { + let data = JSON.stringify(obj, null, 2); + additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); + additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); + let res = await this.post(requestUrl, data, additionalHeaders); + return this._processResponse(res, this.requestOptions); + } + async putJson(requestUrl, obj, additionalHeaders = {}) { + let data = JSON.stringify(obj, null, 2); + additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); + additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); + let res = await this.put(requestUrl, data, additionalHeaders); + return this._processResponse(res, this.requestOptions); + } + async patchJson(requestUrl, obj, additionalHeaders = {}) { + let data = JSON.stringify(obj, null, 2); + additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); + additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); + let res = await this.patch(requestUrl, data, additionalHeaders); + return this._processResponse(res, this.requestOptions); + } /** - * Get the headers that are contained in this collection as an array. + * Makes a raw http request. + * All other methods such as get, post, patch, and request ultimately call this. + * Prefer get, del, post and patch */ - HttpHeaders.prototype.headersArray = function () { - var headers = []; - for (var headerKey in this._headersMap) { - headers.push(this._headersMap[headerKey]); + async request(verb, requestUrl, data, headers) { + if (this._disposed) { + throw new Error('Client has already been disposed.'); } - return headers; - }; - /** - * Get the header names that are contained in this collection. - */ - HttpHeaders.prototype.headerNames = function () { - var headerNames = []; - var headers = this.headersArray(); - for (var i = 0; i < headers.length; ++i) { - headerNames.push(headers[i].name); + let parsedUrl = new URL(requestUrl); + let info = this._prepareRequest(verb, parsedUrl, headers); + // Only perform retries on reads since writes may not be idempotent. + let maxTries = this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1 + ? this._maxRetries + 1 + : 1; + let numTries = 0; + let response; + while (numTries < maxTries) { + response = await this.requestRaw(info, data); + // Check if it's an authentication challenge + if (response && + response.message && + response.message.statusCode === HttpCodes.Unauthorized) { + let authenticationHandler; + for (let i = 0; i < this.handlers.length; i++) { + if (this.handlers[i].canHandleAuthentication(response)) { + authenticationHandler = this.handlers[i]; + break; + } + } + if (authenticationHandler) { + return authenticationHandler.handleAuthentication(this, info, data); + } + else { + // We have received an unauthorized response but have no handlers to handle it. + // Let the response return to the caller. + return response; + } + } + let redirectsRemaining = this._maxRedirects; + while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1 && + this._allowRedirects && + redirectsRemaining > 0) { + const redirectUrl = response.message.headers['location']; + if (!redirectUrl) { + // if there's no location to redirect to, we won't + break; + } + let parsedRedirectUrl = new URL(redirectUrl); + if (parsedUrl.protocol == 'https:' && + parsedUrl.protocol != parsedRedirectUrl.protocol && + !this._allowRedirectDowngrade) { + throw new Error('Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.'); + } + // we need to finish reading the response before reassigning response + // which will leak the open socket. + await response.readBody(); + // strip authorization header if redirected to a different hostname + if (parsedRedirectUrl.hostname !== parsedUrl.hostname) { + for (let header in headers) { + // header names are case insensitive + if (header.toLowerCase() === 'authorization') { + delete headers[header]; + } + } + } + // let's make the request with the new redirectUrl + info = this._prepareRequest(verb, parsedRedirectUrl, headers); + response = await this.requestRaw(info, data); + redirectsRemaining--; + } + if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) { + // If not a retry code, return immediately instead of retrying + return response; + } + numTries += 1; + if (numTries < maxTries) { + await response.readBody(); + await this._performExponentialBackoff(numTries); + } } - return headerNames; - }; + return response; + } /** - * Get the header values that are contained in this collection. + * Needs to be called if keepAlive is set to true in request options. */ - HttpHeaders.prototype.headerValues = function () { - var headerValues = []; - var headers = this.headersArray(); - for (var i = 0; i < headers.length; ++i) { - headerValues.push(headers[i].value); + dispose() { + if (this._agent) { + this._agent.destroy(); } - return headerValues; - }; - /** - * Get the JSON object representation of this HTTP header collection. - */ - HttpHeaders.prototype.toJson = function () { - return this.rawHeaders(); - }; - /** - * Get the string representation of this HTTP header collection. - */ - HttpHeaders.prototype.toString = function () { - return JSON.stringify(this.toJson()); - }; - /** - * Create a deep clone/copy of this HttpHeaders collection. - */ - HttpHeaders.prototype.clone = function () { - return new HttpHeaders(this.rawHeaders()); - }; - return HttpHeaders; -}()); - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * Encodes a string in base64 format. - * @param value - The string to encode - */ -function encodeString(value) { - return Buffer.from(value).toString("base64"); -} -/** - * Encodes a byte array in base64 format. - * @param value - The Uint8Aray to encode - */ -function encodeByteArray(value) { - // Buffer.from accepts | -- the TypeScript definition is off here - // https://nodejs.org/api/buffer.html#buffer_class_method_buffer_from_arraybuffer_byteoffset_length - var bufferValue = value instanceof Buffer ? value : Buffer.from(value.buffer); - return bufferValue.toString("base64"); -} -/** - * Decodes a base64 string into a byte array. - * @param value - The base64 string to decode - */ -function decodeString(value) { - return Buffer.from(value, "base64"); -} - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -var Constants = { - /** - * The core-http version - */ - coreHttpVersion: "1.2.4", - /** - * Specifies HTTP. - */ - HTTP: "http:", - /** - * Specifies HTTPS. - */ - HTTPS: "https:", - /** - * Specifies HTTP Proxy. - */ - HTTP_PROXY: "HTTP_PROXY", - /** - * Specifies HTTPS Proxy. - */ - HTTPS_PROXY: "HTTPS_PROXY", + this._disposed = true; + } /** - * Specifies NO Proxy. + * Raw request. + * @param info + * @param data */ - NO_PROXY: "NO_PROXY", + requestRaw(info, data) { + return new Promise((resolve, reject) => { + let callbackForResult = function (err, res) { + if (err) { + reject(err); + } + resolve(res); + }; + this.requestRawWithCallback(info, data, callbackForResult); + }); + } /** - * Specifies ALL Proxy. + * Raw request with callback. + * @param info + * @param data + * @param onResult */ - ALL_PROXY: "ALL_PROXY", - HttpConstants: { - /** - * Http Verbs - */ - HttpVerbs: { - PUT: "PUT", - GET: "GET", - DELETE: "DELETE", - POST: "POST", - MERGE: "MERGE", - HEAD: "HEAD", - PATCH: "PATCH" - }, - StatusCodes: { - TooManyRequests: 429 + requestRawWithCallback(info, data, onResult) { + let socket; + if (typeof data === 'string') { + info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8'); } - }, - /** - * Defines constants for use with HTTP headers. - */ - HeaderConstants: { - /** - * The Authorization header. - */ - AUTHORIZATION: "authorization", - AUTHORIZATION_SCHEME: "Bearer", - /** - * The Retry-After response-header field can be used with a 503 (Service - * Unavailable) or 349 (Too Many Requests) responses to indicate how long - * the service is expected to be unavailable to the requesting client. - */ - RETRY_AFTER: "Retry-After", - /** - * The UserAgent header. - */ - USER_AGENT: "User-Agent" - } -}; - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * Default key used to access the XML attributes. - */ -var XML_ATTRKEY = "$"; -/** - * Default key used to access the XML value content. - */ -var XML_CHARKEY = "_"; - -// Copyright (c) Microsoft Corporation. -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; -/** - * A constant that indicates whether the environment is node.js or browser based. - */ -var isNode = typeof process !== "undefined" && - !!process.version && - !!process.versions && - !!process.versions.node; -/** - * Encodes an URI. - * - * @param uri - The URI to be encoded. - * @returns The encoded URI. - */ -function encodeUri(uri) { - return encodeURIComponent(uri) - .replace(/!/g, "%21") - .replace(/"/g, "%27") - .replace(/\(/g, "%28") - .replace(/\)/g, "%29") - .replace(/\*/g, "%2A"); -} -/** - * Returns a stripped version of the Http Response which only contains body, - * headers and the status. - * - * @param response - The Http Response - * @returns The stripped version of Http Response. - */ -function stripResponse(response) { - var strippedResponse = {}; - strippedResponse.body = response.bodyAsText; - strippedResponse.headers = response.headers; - strippedResponse.status = response.status; - return strippedResponse; -} -/** - * Returns a stripped version of the Http Request that does not contain the - * Authorization header. - * - * @param request - The Http Request object - * @returns The stripped version of Http Request. - */ -function stripRequest(request) { - var strippedRequest = request.clone(); - if (strippedRequest.headers) { - strippedRequest.headers.remove("authorization"); - } - return strippedRequest; -} -/** - * Validates the given uuid as a string - * - * @param uuid - The uuid as a string that needs to be validated - * @returns True if the uuid is valid; false otherwise. - */ -function isValidUuid(uuid) { - return validUuidRegex.test(uuid); -} -/** - * Generated UUID - * - * @returns RFC4122 v4 UUID. - */ -function generateUuid() { - return uuid.v4(); -} -/** - * Executes an array of promises sequentially. Inspiration of this method is here: - * https://pouchdb.com/2015/05/18/we-have-a-problem-with-promises.html. An awesome blog on promises! - * - * @param promiseFactories - An array of promise factories(A function that return a promise) - * @param kickstart - Input to the first promise that is used to kickstart the promise chain. - * If not provided then the promise chain starts with undefined. - * @returns A chain of resolved or rejected promises - */ -function executePromisesSequentially(promiseFactories, kickstart) { - var result = Promise.resolve(kickstart); - promiseFactories.forEach(function (promiseFactory) { - result = result.then(promiseFactory); - }); - return result; -} -/** - * A wrapper for setTimeout that resolves a promise after t milliseconds. - * @param t - The number of milliseconds to be delayed. - * @param value - The value to be resolved with after a timeout of t milliseconds. - * @returns Resolved promise - */ -function delay(t, value) { - return new Promise(function (resolve) { return setTimeout(function () { return resolve(value); }, t); }); -} -/** - * Converts a Promise to a callback. - * @param promise - The Promise to be converted to a callback - * @returns A function that takes the callback `(cb: Function) => void` - * @deprecated generated code should instead depend on responseToBody - */ -// eslint-disable-next-line @typescript-eslint/ban-types -function promiseToCallback(promise) { - if (typeof promise.then !== "function") { - throw new Error("The provided input is not a Promise."); - } - // eslint-disable-next-line @typescript-eslint/ban-types - return function (cb) { - promise - .then(function (data) { - // eslint-disable-next-line promise/no-callback-in-promise - return cb(undefined, data); - }) - .catch(function (err) { - // eslint-disable-next-line promise/no-callback-in-promise - cb(err); + let callbackCalled = false; + let handleResult = (err, res) => { + if (!callbackCalled) { + callbackCalled = true; + onResult(err, res); + } + }; + let req = info.httpModule.request(info.options, (msg) => { + let res = new HttpClientResponse(msg); + handleResult(null, res); }); - }; -} -/** - * Converts a Promise to a service callback. - * @param promise - The Promise of HttpOperationResponse to be converted to a service callback - * @returns A function that takes the service callback (cb: ServiceCallback): void - */ -function promiseToServiceCallback(promise) { - if (typeof promise.then !== "function") { - throw new Error("The provided input is not a Promise."); - } - return function (cb) { - promise - .then(function (data) { - return process.nextTick(cb, undefined, data.parsedBody, data.request, data); - }) - .catch(function (err) { - process.nextTick(cb, err); + req.on('socket', sock => { + socket = sock; }); - }; -} -function prepareXMLRootList(obj, elementName, xmlNamespaceKey, xmlNamespace) { - var _a, _b, _c; - if (!Array.isArray(obj)) { - obj = [obj]; + // If we ever get disconnected, we want the socket to timeout eventually + req.setTimeout(this._socketTimeout || 3 * 60000, () => { + if (socket) { + socket.end(); + } + handleResult(new Error('Request timeout: ' + info.options.path), null); + }); + req.on('error', function (err) { + // err has statusCode property + // res should have headers + handleResult(err, null); + }); + if (data && typeof data === 'string') { + req.write(data, 'utf8'); + } + if (data && typeof data !== 'string') { + data.on('close', function () { + req.end(); + }); + data.pipe(req); + } + else { + req.end(); + } } - if (!xmlNamespaceKey || !xmlNamespace) { - return _a = {}, _a[elementName] = obj, _a; + /** + * Gets an http agent. This function is useful when you need an http agent that handles + * routing through a proxy server - depending upon the url and proxy environment variables. + * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com + */ + getAgent(serverUrl) { + let parsedUrl = new URL(serverUrl); + return this._getAgent(parsedUrl); } - var result = (_b = {}, _b[elementName] = obj, _b); - result[XML_ATTRKEY] = (_c = {}, _c[xmlNamespaceKey] = xmlNamespace, _c); - return result; -} -/** - * Applies the properties on the prototype of sourceCtors to the prototype of targetCtor - * @param targetCtor - The target object on which the properties need to be applied. - * @param sourceCtors - An array of source objects from which the properties need to be taken. - */ -function applyMixins(targetCtorParam, sourceCtors) { - var castTargetCtorParam = targetCtorParam; - sourceCtors.forEach(function (sourceCtor) { - Object.getOwnPropertyNames(sourceCtor.prototype).forEach(function (name) { - castTargetCtorParam.prototype[name] = sourceCtor.prototype[name]; - }); - }); -} -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)?)?$/; -/** - * Indicates whether the given string is in ISO 8601 format. - * @param value - The value to be validated for ISO 8601 duration format. - * @returns `true` if valid, `false` otherwise. - */ -function isDuration(value) { - return validateISODuration.test(value); -} -/** - * Replace all of the instances of searchValue in value with the provided replaceValue. - * @param value - The value to search and replace in. - * @param searchValue - The value to search for in the value argument. - * @param replaceValue - The value to replace searchValue with in the value argument. - * @returns The value where each instance of searchValue was replaced with replacedValue. - */ -function replaceAll(value, searchValue, replaceValue) { - return !value || !searchValue ? value : value.split(searchValue).join(replaceValue || ""); -} -/** - * Determines whether the given entity is a basic/primitive type - * (string, number, boolean, null, undefined). - * @param value - Any entity - * @returns true is it is primitive type, false otherwise. - */ -function isPrimitiveType(value) { - return (typeof value !== "object" && typeof value !== "function") || value === null; -} -function getEnvironmentValue(name) { - if (process.env[name]) { - return process.env[name]; + _prepareRequest(method, requestUrl, headers) { + const info = {}; + info.parsedUrl = requestUrl; + const usingSsl = info.parsedUrl.protocol === 'https:'; + info.httpModule = usingSsl ? https : http; + const defaultPort = usingSsl ? 443 : 80; + info.options = {}; + info.options.host = info.parsedUrl.hostname; + info.options.port = info.parsedUrl.port + ? parseInt(info.parsedUrl.port) + : defaultPort; + info.options.path = + (info.parsedUrl.pathname || '') + (info.parsedUrl.search || ''); + info.options.method = method; + info.options.headers = this._mergeHeaders(headers); + if (this.userAgent != null) { + info.options.headers['user-agent'] = this.userAgent; + } + info.options.agent = this._getAgent(info.parsedUrl); + // gives handlers an opportunity to participate + if (this.handlers) { + this.handlers.forEach(handler => { + handler.prepareRequest(info.options); + }); + } + return info; } - else if (process.env[name.toLowerCase()]) { - return process.env[name.toLowerCase()]; + _mergeHeaders(headers) { + const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {}); + if (this.requestOptions && this.requestOptions.headers) { + return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers)); + } + return lowercaseKeys(headers || {}); } - return undefined; -} - -// Copyright (c) Microsoft Corporation. -var Serializer = /** @class */ (function () { - function Serializer(modelMappers, isXML) { - if (modelMappers === void 0) { modelMappers = {}; } - this.modelMappers = modelMappers; - this.isXML = isXML; - } - Serializer.prototype.validateConstraints = function (mapper, value, objectName) { - var failValidation = function (constraintName, constraintValue) { - throw new Error("\"" + objectName + "\" with value \"" + value + "\" should satisfy the constraint \"" + constraintName + "\": " + constraintValue + "."); - }; - if (mapper.constraints && value != undefined) { - var valueAsNumber = value; - var _a = mapper.constraints, ExclusiveMaximum = _a.ExclusiveMaximum, ExclusiveMinimum = _a.ExclusiveMinimum, InclusiveMaximum = _a.InclusiveMaximum, InclusiveMinimum = _a.InclusiveMinimum, MaxItems = _a.MaxItems, MaxLength = _a.MaxLength, MinItems = _a.MinItems, MinLength = _a.MinLength, MultipleOf = _a.MultipleOf, Pattern = _a.Pattern, UniqueItems = _a.UniqueItems; - if (ExclusiveMaximum != undefined && valueAsNumber >= ExclusiveMaximum) { - failValidation("ExclusiveMaximum", ExclusiveMaximum); - } - if (ExclusiveMinimum != undefined && valueAsNumber <= ExclusiveMinimum) { - failValidation("ExclusiveMinimum", ExclusiveMinimum); - } - if (InclusiveMaximum != undefined && valueAsNumber > InclusiveMaximum) { - failValidation("InclusiveMaximum", InclusiveMaximum); - } - if (InclusiveMinimum != undefined && valueAsNumber < InclusiveMinimum) { - failValidation("InclusiveMinimum", InclusiveMinimum); - } - var valueAsArray = value; - if (MaxItems != undefined && valueAsArray.length > MaxItems) { - failValidation("MaxItems", MaxItems); - } - if (MaxLength != undefined && valueAsArray.length > MaxLength) { - failValidation("MaxLength", MaxLength); - } - if (MinItems != undefined && valueAsArray.length < MinItems) { - failValidation("MinItems", MinItems); - } - if (MinLength != undefined && valueAsArray.length < MinLength) { - failValidation("MinLength", MinLength); - } - if (MultipleOf != undefined && valueAsNumber % MultipleOf !== 0) { - failValidation("MultipleOf", MultipleOf); - } - if (Pattern) { - var pattern = typeof Pattern === "string" ? new RegExp(Pattern) : Pattern; - if (typeof value !== "string" || value.match(pattern) === null) { - failValidation("Pattern", Pattern); - } - } - if (UniqueItems && - valueAsArray.some(function (item, i, ar) { return ar.indexOf(item) !== i; })) { - failValidation("UniqueItems", UniqueItems); - } - } - }; - /** - * Serialize the given object based on its metadata defined in the mapper - * - * @param mapper - The mapper which defines the metadata of the serializable object - * @param object - A valid Javascript object to be serialized - * @param objectName - Name of the serialized object - * @param options - additional options to deserialization - * @returns A valid serialized Javascript object - */ - Serializer.prototype.serialize = function (mapper, object, objectName, options) { - var _a, _b, _c; - if (options === void 0) { options = {}; } - var updatedOptions = { - rootName: (_a = options.rootName) !== null && _a !== void 0 ? _a : "", - includeRoot: (_b = options.includeRoot) !== null && _b !== void 0 ? _b : false, - xmlCharKey: (_c = options.xmlCharKey) !== null && _c !== void 0 ? _c : XML_CHARKEY - }; - var payload = {}; - var mapperType = mapper.type.name; - if (!objectName) { - objectName = mapper.serializedName; - } - if (mapperType.match(/^Sequence$/i) !== null) { - payload = []; - } - if (mapper.isConstant) { - object = mapper.defaultValue; + _getExistingOrDefaultHeader(additionalHeaders, header, _default) { + const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {}); + let clientHeader; + if (this.requestOptions && this.requestOptions.headers) { + clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; } - // This table of allowed values should help explain - // the mapper.required and mapper.nullable properties. - // X means "neither undefined or null are allowed". - // || required - // || true | false - // nullable || ========================== - // true || null | undefined/null - // false || X | undefined - // undefined || X | undefined/null - var required = mapper.required, nullable = mapper.nullable; - if (required && nullable && object === undefined) { - throw new Error(objectName + " cannot be undefined."); + return additionalHeaders[header] || clientHeader || _default; + } + _getAgent(parsedUrl) { + let agent; + let proxyUrl = pm.getProxyUrl(parsedUrl); + let useProxy = proxyUrl && proxyUrl.hostname; + if (this._keepAlive && useProxy) { + agent = this._proxyAgent; } - if (required && !nullable && object == undefined) { - throw new Error(objectName + " cannot be null or undefined."); + if (this._keepAlive && !useProxy) { + agent = this._agent; } - if (!required && nullable === false && object === null) { - throw new Error(objectName + " cannot be null."); + // if agent is already assigned use that agent. + if (!!agent) { + return agent; } - if (object == undefined) { - payload = object; + const usingSsl = parsedUrl.protocol === 'https:'; + let maxSockets = 100; + if (!!this.requestOptions) { + maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets; } - else { - // Validate Constraints if any - this.validateConstraints(mapper, object, objectName); - if (mapperType.match(/^any$/i) !== null) { - payload = object; - } - else if (mapperType.match(/^(Number|String|Boolean|Object|Stream|Uuid)$/i) !== null) { - payload = serializeBasicTypes(mapperType, objectName, object); - } - else if (mapperType.match(/^Enum$/i) !== null) { - var enumMapper = mapper; - payload = serializeEnumType(objectName, enumMapper.type.allowedValues, object); - } - else if (mapperType.match(/^(Date|DateTime|TimeSpan|DateTimeRfc1123|UnixTime)$/i) !== null) { - payload = serializeDateTypes(mapperType, object, objectName); - } - else if (mapperType.match(/^ByteArray$/i) !== null) { - payload = serializeByteArrayType(objectName, object); - } - else if (mapperType.match(/^Base64Url$/i) !== null) { - payload = serializeBase64UrlType(objectName, object); - } - else if (mapperType.match(/^Sequence$/i) !== null) { - payload = serializeSequenceType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); + if (useProxy) { + // If using proxy, need tunnel + if (!tunnel) { + tunnel = __nccwpck_require__(4294); } - else if (mapperType.match(/^Dictionary$/i) !== null) { - payload = serializeDictionaryType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); + const agentOptions = { + maxSockets: maxSockets, + keepAlive: this._keepAlive, + proxy: { + ...((proxyUrl.username || proxyUrl.password) && { + proxyAuth: `${proxyUrl.username}:${proxyUrl.password}` + }), + host: proxyUrl.hostname, + port: proxyUrl.port + } + }; + let tunnelAgent; + const overHttps = proxyUrl.protocol === 'https:'; + if (usingSsl) { + tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp; } - else if (mapperType.match(/^Composite$/i) !== null) { - payload = serializeCompositeType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); + else { + tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp; } + agent = tunnelAgent(agentOptions); + this._proxyAgent = agent; } - return payload; - }; - /** - * Deserialize the given object based on its metadata defined in the mapper - * - * @param mapper - The mapper which defines the metadata of the serializable object - * @param responseBody - A valid Javascript entity to be deserialized - * @param objectName - Name of the deserialized object - * @param options - Controls behavior of XML parser and builder. - * @returns A valid deserialized Javascript object - */ - Serializer.prototype.deserialize = function (mapper, responseBody, objectName, options) { - var _a, _b, _c; - if (options === void 0) { options = {}; } - var updatedOptions = { - rootName: (_a = options.rootName) !== null && _a !== void 0 ? _a : "", - includeRoot: (_b = options.includeRoot) !== null && _b !== void 0 ? _b : false, - xmlCharKey: (_c = options.xmlCharKey) !== null && _c !== void 0 ? _c : XML_CHARKEY - }; - if (responseBody == undefined) { - if (this.isXML && mapper.type.name === "Sequence" && !mapper.xmlIsWrapped) { - // Edge case for empty XML non-wrapped lists. xml2js can't distinguish - // between the list being empty versus being missing, - // so let's do the more user-friendly thing and return an empty list. - responseBody = []; - } - // specifically check for undefined as default value can be a falsey value `0, "", false, null` - if (mapper.defaultValue !== undefined) { - responseBody = mapper.defaultValue; - } - return responseBody; + // if reusing agent across request and tunneling agent isn't assigned create a new agent + if (this._keepAlive && !agent) { + const options = { keepAlive: this._keepAlive, maxSockets: maxSockets }; + agent = usingSsl ? new https.Agent(options) : new http.Agent(options); + this._agent = agent; } - var payload; - var mapperType = mapper.type.name; - if (!objectName) { - objectName = mapper.serializedName; + // if not using private agent and tunnel agent isn't setup then use global agent + if (!agent) { + agent = usingSsl ? https.globalAgent : http.globalAgent; } - if (mapperType.match(/^Composite$/i) !== null) { - payload = deserializeCompositeType(this, mapper, responseBody, objectName, updatedOptions); + if (usingSsl && this._ignoreSslError) { + // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process + // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options + // we have to cast it to any and change it directly + agent.options = Object.assign(agent.options || {}, { + rejectUnauthorized: false + }); } - else { - if (this.isXML) { - var xmlCharKey = updatedOptions.xmlCharKey; - var castResponseBody = responseBody; - /** - * If the mapper specifies this as a non-composite type value but the responseBody contains - * both header ("$" i.e., XML_ATTRKEY) and body ("#" i.e., XML_CHARKEY) properties, - * then just reduce the responseBody value to the body ("#" i.e., XML_CHARKEY) property. - */ - if (castResponseBody[XML_ATTRKEY] != undefined && - castResponseBody[xmlCharKey] != undefined) { - responseBody = castResponseBody[xmlCharKey]; - } + return agent; + } + _performExponentialBackoff(retryNumber) { + retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); + const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); + return new Promise(resolve => setTimeout(() => resolve(), ms)); + } + static dateTimeDeserializer(key, value) { + if (typeof value === 'string') { + let a = new Date(value); + if (!isNaN(a.valueOf())) { + return a; } - if (mapperType.match(/^Number$/i) !== null) { - payload = parseFloat(responseBody); - if (isNaN(payload)) { - payload = responseBody; + } + return value; + } + async _processResponse(res, options) { + return new Promise(async (resolve, reject) => { + const statusCode = res.message.statusCode; + const response = { + statusCode: statusCode, + result: null, + headers: {} + }; + // not found leads to null obj returned + if (statusCode == HttpCodes.NotFound) { + resolve(response); + } + let obj; + let contents; + // get the result from the body + try { + contents = await res.readBody(); + if (contents && contents.length > 0) { + if (options && options.deserializeDates) { + obj = JSON.parse(contents, HttpClient.dateTimeDeserializer); + } + else { + obj = JSON.parse(contents); + } + response.result = obj; } + response.headers = res.message.headers; } - else if (mapperType.match(/^Boolean$/i) !== null) { - if (responseBody === "true") { - payload = true; + catch (err) { + // Invalid resource (contents not json); leaving result obj null + } + // note that 3xx redirects are handled by the http layer. + if (statusCode > 299) { + let msg; + // if exception/error in body, attempt to get better error + if (obj && obj.message) { + msg = obj.message; } - else if (responseBody === "false") { - payload = false; + else if (contents && contents.length > 0) { + // it may be the case that the exception is in the body message as string + msg = contents; } else { - payload = responseBody; + msg = 'Failed request: (' + statusCode + ')'; } + let err = new HttpClientError(msg, statusCode); + err.result = response.result; + reject(err); } - else if (mapperType.match(/^(String|Enum|Object|Stream|Uuid|TimeSpan|any)$/i) !== null) { - payload = responseBody; - } - else if (mapperType.match(/^(Date|DateTime|DateTimeRfc1123)$/i) !== null) { - payload = new Date(responseBody); - } - else if (mapperType.match(/^UnixTime$/i) !== null) { - payload = unixTimeToDate(responseBody); - } - else if (mapperType.match(/^ByteArray$/i) !== null) { - payload = decodeString(responseBody); - } - else if (mapperType.match(/^Base64Url$/i) !== null) { - payload = base64UrlToByteArray(responseBody); - } - else if (mapperType.match(/^Sequence$/i) !== null) { - payload = deserializeSequenceType(this, mapper, responseBody, objectName, updatedOptions); - } - else if (mapperType.match(/^Dictionary$/i) !== null) { - payload = deserializeDictionaryType(this, mapper, responseBody, objectName, updatedOptions); + else { + resolve(response); } - } - if (mapper.isConstant) { - payload = mapper.defaultValue; - } - return payload; - }; - return Serializer; -}()); -function trimEnd(str, ch) { - var len = str.length; - while (len - 1 >= 0 && str[len - 1] === ch) { - --len; + }); } - return str.substr(0, len); } -function bufferToBase64Url(buffer) { - if (!buffer) { - return undefined; - } - if (!(buffer instanceof Uint8Array)) { - throw new Error("Please provide an input of type Uint8Array for converting to Base64Url."); +exports.HttpClient = HttpClient; + + +/***/ }), + +/***/ 6443: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +function getProxyUrl(reqUrl) { + let usingSsl = reqUrl.protocol === 'https:'; + let proxyUrl; + if (checkBypass(reqUrl)) { + return proxyUrl; } - // Uint8Array to Base64. - var str = encodeByteArray(buffer); - // Base64 to Base64Url. - return trimEnd(str, "=") - .replace(/\+/g, "-") - .replace(/\//g, "_"); -} -function base64UrlToByteArray(str) { - if (!str) { - return undefined; + let proxyVar; + if (usingSsl) { + proxyVar = process.env['https_proxy'] || process.env['HTTPS_PROXY']; } - if (str && typeof str.valueOf() !== "string") { - throw new Error("Please provide an input of type string for converting to Uint8Array"); + else { + proxyVar = process.env['http_proxy'] || process.env['HTTP_PROXY']; } - // Base64Url to Base64. - str = str.replace(/-/g, "+").replace(/_/g, "/"); - // Base64 to Uint8Array. - return decodeString(str); -} -function splitSerializeName(prop) { - var classes = []; - var partialclass = ""; - if (prop) { - var subwords = prop.split("."); - for (var _i = 0, subwords_1 = subwords; _i < subwords_1.length; _i++) { - var item = subwords_1[_i]; - if (item.charAt(item.length - 1) === "\\") { - partialclass += item.substr(0, item.length - 1) + "."; - } - else { - partialclass += item; - classes.push(partialclass); - partialclass = ""; - } - } + if (proxyVar) { + proxyUrl = new URL(proxyVar); } - return classes; + return proxyUrl; } -function dateToUnixTime(d) { - if (!d) { - return undefined; - } - if (typeof d.valueOf() === "string") { - d = new Date(d); +exports.getProxyUrl = getProxyUrl; +function checkBypass(reqUrl) { + if (!reqUrl.hostname) { + return false; } - return Math.floor(d.getTime() / 1000); -} -function unixTimeToDate(n) { - if (!n) { - return undefined; + let noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || ''; + if (!noProxy) { + return false; } - return new Date(n * 1000); -} -function serializeBasicTypes(typeName, objectName, value) { - if (value !== null && value !== undefined) { - if (typeName.match(/^Number$/i) !== null) { - if (typeof value !== "number") { - throw new Error(objectName + " with value " + value + " must be of type number."); - } - } - else if (typeName.match(/^String$/i) !== null) { - if (typeof value.valueOf() !== "string") { - throw new Error(objectName + " with value \"" + value + "\" must be of type string."); - } - } - else if (typeName.match(/^Uuid$/i) !== null) { - if (!(typeof value.valueOf() === "string" && isValidUuid(value))) { - throw new Error(objectName + " with value \"" + value + "\" must be of type string and a valid uuid."); - } - } - else if (typeName.match(/^Boolean$/i) !== null) { - if (typeof value !== "boolean") { - throw new Error(objectName + " with value " + value + " must be of type boolean."); - } - } - else if (typeName.match(/^Stream$/i) !== null) { - var objectType = typeof value; - if (objectType !== "string" && - objectType !== "function" && - !(value instanceof ArrayBuffer) && - !ArrayBuffer.isView(value) && - !((typeof Blob === "function" || typeof Blob === "object") && value instanceof Blob)) { - throw new Error(objectName + " must be a string, Blob, ArrayBuffer, ArrayBufferView, or a function returning NodeJS.ReadableStream."); - } - } + // Determine the request port + let reqPort; + if (reqUrl.port) { + reqPort = Number(reqUrl.port); } - return value; -} -function serializeEnumType(objectName, allowedValues, value) { - if (!allowedValues) { - throw new Error("Please provide a set of allowedValues to validate " + objectName + " as an Enum Type."); + else if (reqUrl.protocol === 'http:') { + reqPort = 80; } - var isPresent = allowedValues.some(function (item) { - if (typeof item.valueOf() === "string") { - return item.toLowerCase() === value.toLowerCase(); - } - return item === value; - }); - if (!isPresent) { - throw new Error(value + " is not a valid value for " + objectName + ". The valid values are: " + JSON.stringify(allowedValues) + "."); + else if (reqUrl.protocol === 'https:') { + reqPort = 443; } - return value; -} -function serializeByteArrayType(objectName, value) { - var returnValue = ""; - if (value != undefined) { - if (!(value instanceof Uint8Array)) { - throw new Error(objectName + " must be of type Uint8Array."); - } - returnValue = encodeByteArray(value); + // Format the request hostname and hostname with port + let upperReqHosts = [reqUrl.hostname.toUpperCase()]; + if (typeof reqPort === 'number') { + upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); } - return returnValue; -} -function serializeBase64UrlType(objectName, value) { - var returnValue = ""; - if (value != undefined) { - if (!(value instanceof Uint8Array)) { - throw new Error(objectName + " must be of type Uint8Array."); + // Compare request host against noproxy + for (let upperNoProxyItem of noProxy + .split(',') + .map(x => x.trim().toUpperCase()) + .filter(x => x)) { + if (upperReqHosts.some(x => x === upperNoProxyItem)) { + return true; } - returnValue = bufferToBase64Url(value) || ""; } - return returnValue; + return false; } -function serializeDateTypes(typeName, value, objectName) { - if (value != undefined) { - if (typeName.match(/^Date$/i) !== null) { - if (!(value instanceof Date || - (typeof value.valueOf() === "string" && !isNaN(Date.parse(value))))) { - throw new Error(objectName + " must be an instanceof Date or a string in ISO8601 format."); - } - value = - value instanceof Date - ? value.toISOString().substring(0, 10) - : new Date(value).toISOString().substring(0, 10); - } - else if (typeName.match(/^DateTime$/i) !== null) { - if (!(value instanceof Date || - (typeof value.valueOf() === "string" && !isNaN(Date.parse(value))))) { - throw new Error(objectName + " must be an instanceof Date or a string in ISO8601 format."); - } - value = value instanceof Date ? value.toISOString() : new Date(value).toISOString(); - } - else if (typeName.match(/^DateTimeRfc1123$/i) !== null) { - if (!(value instanceof Date || - (typeof value.valueOf() === "string" && !isNaN(Date.parse(value))))) { - throw new Error(objectName + " must be an instanceof Date or a string in RFC-1123 format."); - } - value = value instanceof Date ? value.toUTCString() : new Date(value).toUTCString(); - } - else if (typeName.match(/^UnixTime$/i) !== null) { - if (!(value instanceof Date || - (typeof value.valueOf() === "string" && !isNaN(Date.parse(value))))) { - throw new Error(objectName + " must be an instanceof Date or a string in RFC-1123/ISO8601 format " + - "for it to be serialized in UnixTime/Epoch format."); - } - value = dateToUnixTime(value); - } - else if (typeName.match(/^TimeSpan$/i) !== null) { - if (!isDuration(value)) { - throw new Error(objectName + " must be a string in ISO 8601 format. Instead was \"" + value + "\"."); - } +exports.checkBypass = checkBypass; + + +/***/ }), + +/***/ 1962: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__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)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var _a; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.getCmdPath = exports.tryGetExecutablePath = exports.isRooted = exports.isDirectory = exports.exists = exports.IS_WINDOWS = exports.unlink = exports.symlink = exports.stat = exports.rmdir = exports.rename = exports.readlink = exports.readdir = exports.mkdir = exports.lstat = exports.copyFile = exports.chmod = void 0; +const fs = __importStar(__nccwpck_require__(5747)); +const path = __importStar(__nccwpck_require__(5622)); +_a = fs.promises, exports.chmod = _a.chmod, exports.copyFile = _a.copyFile, exports.lstat = _a.lstat, exports.mkdir = _a.mkdir, exports.readdir = _a.readdir, exports.readlink = _a.readlink, exports.rename = _a.rename, exports.rmdir = _a.rmdir, exports.stat = _a.stat, exports.symlink = _a.symlink, exports.unlink = _a.unlink; +exports.IS_WINDOWS = process.platform === 'win32'; +function exists(fsPath) { + return __awaiter(this, void 0, void 0, function* () { + try { + yield exports.stat(fsPath); } - } - return value; -} -function serializeSequenceType(serializer, mapper, object, objectName, isXml, options) { - var _a, _b; - if (!Array.isArray(object)) { - throw new Error(objectName + " must be of type Array."); - } - var elementType = mapper.type.element; - if (!elementType || typeof elementType !== "object") { - throw new Error("element\" metadata for an Array must be defined in the " + - ("mapper and it must of type \"object\" in " + objectName + ".")); - } - var tempArray = []; - for (var i = 0; i < object.length; i++) { - var serializedValue = serializer.serialize(elementType, object[i], objectName, options); - if (isXml && elementType.xmlNamespace) { - var xmlnsKey = elementType.xmlNamespacePrefix - ? "xmlns:" + elementType.xmlNamespacePrefix - : "xmlns"; - if (elementType.type.name === "Composite") { - tempArray[i] = tslib.__assign({}, serializedValue); - tempArray[i][XML_ATTRKEY] = (_a = {}, _a[xmlnsKey] = elementType.xmlNamespace, _a); - } - else { - tempArray[i] = {}; - tempArray[i][options.xmlCharKey] = serializedValue; - tempArray[i][XML_ATTRKEY] = (_b = {}, _b[xmlnsKey] = elementType.xmlNamespace, _b); + catch (err) { + if (err.code === 'ENOENT') { + return false; } + throw err; } - else { - tempArray[i] = serializedValue; - } - } - return tempArray; + return true; + }); } -function serializeDictionaryType(serializer, mapper, object, objectName, isXml, options) { - var _a; - if (typeof object !== "object") { - throw new Error(objectName + " must be of type object."); - } - var valueType = mapper.type.value; - if (!valueType || typeof valueType !== "object") { - throw new Error("\"value\" metadata for a Dictionary must be defined in the " + - ("mapper and it must of type \"object\" in " + objectName + ".")); - } - var tempDictionary = {}; - for (var _i = 0, _b = Object.keys(object); _i < _b.length; _i++) { - var key = _b[_i]; - var serializedValue = serializer.serialize(valueType, object[key], objectName, options); - // If the element needs an XML namespace we need to add it within the $ property - tempDictionary[key] = getXmlObjectValue(valueType, serializedValue, isXml, options); - } - // Add the namespace to the root element if needed - if (isXml && mapper.xmlNamespace) { - var xmlnsKey = mapper.xmlNamespacePrefix ? "xmlns:" + mapper.xmlNamespacePrefix : "xmlns"; - var result = tempDictionary; - result[XML_ATTRKEY] = (_a = {}, _a[xmlnsKey] = mapper.xmlNamespace, _a); - return result; - } - return tempDictionary; +exports.exists = exists; +function isDirectory(fsPath, useStat = false) { + return __awaiter(this, void 0, void 0, function* () { + const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath); + return stats.isDirectory(); + }); } +exports.isDirectory = isDirectory; /** - * Resolves the additionalProperties property from a referenced mapper - * @param serializer - The serializer containing the entire set of mappers - * @param mapper - The composite mapper to resolve - * @param objectName - Name of the object being serialized + * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like: + * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases). */ -function resolveAdditionalProperties(serializer, mapper, objectName) { - var additionalProperties = mapper.type.additionalProperties; - if (!additionalProperties && mapper.type.className) { - var modelMapper = resolveReferencedMapper(serializer, mapper, objectName); - return modelMapper === null || modelMapper === void 0 ? void 0 : modelMapper.type.additionalProperties; +function isRooted(p) { + p = normalizeSeparators(p); + if (!p) { + throw new Error('isRooted() parameter "p" cannot be empty'); } - return additionalProperties; -} -/** - * Finds the mapper referenced by className - * @param serializer - The serializer containing the entire set of mappers - * @param mapper - The composite mapper to resolve - * @param objectName - Name of the object being serialized - */ -function resolveReferencedMapper(serializer, mapper, objectName) { - var className = mapper.type.className; - if (!className) { - throw new Error("Class name for model \"" + objectName + "\" is not provided in the mapper \"" + JSON.stringify(mapper, undefined, 2) + "\"."); + if (exports.IS_WINDOWS) { + return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello + ); // e.g. C: or C:\hello } - return serializer.modelMappers[className]; + return p.startsWith('/'); } +exports.isRooted = isRooted; /** - * Resolves a composite mapper's modelProperties. - * @param serializer - The serializer containing the entire set of mappers - * @param mapper - The composite mapper to resolve + * Best effort attempt to determine whether a file exists and is executable. + * @param filePath file path to check + * @param extensions additional file extensions to try + * @return if file exists and is executable, returns the file path. otherwise empty string. */ -function resolveModelProperties(serializer, mapper, objectName) { - var modelProps = mapper.type.modelProperties; - if (!modelProps) { - var modelMapper = resolveReferencedMapper(serializer, mapper, objectName); - if (!modelMapper) { - throw new Error("mapper() cannot be null or undefined for model \"" + mapper.type.className + "\"."); - } - modelProps = modelMapper === null || modelMapper === void 0 ? void 0 : modelMapper.type.modelProperties; - if (!modelProps) { - throw new Error("modelProperties cannot be null or undefined in the " + - ("mapper \"" + JSON.stringify(modelMapper) + "\" of type \"" + mapper.type.className + "\" for object \"" + objectName + "\".")); +function tryGetExecutablePath(filePath, extensions) { + return __awaiter(this, void 0, void 0, function* () { + let stats = undefined; + try { + // test file exists + stats = yield exports.stat(filePath); } - } - return modelProps; -} -function serializeCompositeType(serializer, mapper, object, objectName, isXml, options) { - var _a, _b; - if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) { - mapper = getPolymorphicMapper(serializer, mapper, object, "clientName"); - } - if (object != undefined) { - var payload = {}; - var modelProps = resolveModelProperties(serializer, mapper, objectName); - for (var _i = 0, _c = Object.keys(modelProps); _i < _c.length; _i++) { - var key = _c[_i]; - var propertyMapper = modelProps[key]; - if (propertyMapper.readOnly) { - continue; + catch (err) { + if (err.code !== 'ENOENT') { + // eslint-disable-next-line no-console + console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`); } - var propName = void 0; - var parentObject = payload; - if (serializer.isXML) { - if (propertyMapper.xmlIsWrapped) { - propName = propertyMapper.xmlName; - } - else { - propName = propertyMapper.xmlElementName || propertyMapper.xmlName; + } + if (stats && stats.isFile()) { + if (exports.IS_WINDOWS) { + // on Windows, test for valid extension + const upperExt = path.extname(filePath).toUpperCase(); + if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) { + return filePath; } } else { - var paths = splitSerializeName(propertyMapper.serializedName); - propName = paths.pop(); - for (var _d = 0, paths_1 = paths; _d < paths_1.length; _d++) { - var pathName = paths_1[_d]; - var childObject = parentObject[pathName]; - if (childObject == undefined && - (object[key] != undefined || propertyMapper.defaultValue !== undefined)) { - parentObject[pathName] = {}; - } - parentObject = parentObject[pathName]; + if (isUnixExecutable(stats)) { + return filePath; } } - if (parentObject != undefined) { - if (isXml && mapper.xmlNamespace) { - var xmlnsKey = mapper.xmlNamespacePrefix - ? "xmlns:" + mapper.xmlNamespacePrefix - : "xmlns"; - parentObject[XML_ATTRKEY] = tslib.__assign(tslib.__assign({}, parentObject[XML_ATTRKEY]), (_a = {}, _a[xmlnsKey] = mapper.xmlNamespace, _a)); - } - var propertyObjectName = propertyMapper.serializedName !== "" - ? objectName + "." + propertyMapper.serializedName - : objectName; - var toSerialize = object[key]; - var polymorphicDiscriminator = getPolymorphicDiscriminatorRecursively(serializer, mapper); - if (polymorphicDiscriminator && - polymorphicDiscriminator.clientName === key && - toSerialize == undefined) { - toSerialize = mapper.serializedName; + } + // try each extension + const originalFilePath = filePath; + for (const extension of extensions) { + filePath = originalFilePath + extension; + stats = undefined; + try { + stats = yield exports.stat(filePath); + } + catch (err) { + if (err.code !== 'ENOENT') { + // eslint-disable-next-line no-console + console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`); } - var serializedValue = serializer.serialize(propertyMapper, toSerialize, propertyObjectName, options); - if (serializedValue !== undefined && propName != undefined) { - var value = getXmlObjectValue(propertyMapper, serializedValue, isXml, options); - if (isXml && propertyMapper.xmlIsAttribute) { - // XML_ATTRKEY, i.e., $ is the key attributes are kept under in xml2js. - // This keeps things simple while preventing name collision - // with names in user documents. - parentObject[XML_ATTRKEY] = parentObject[XML_ATTRKEY] || {}; - parentObject[XML_ATTRKEY][propName] = serializedValue; - } - else if (isXml && propertyMapper.xmlIsWrapped) { - parentObject[propName] = (_b = {}, _b[propertyMapper.xmlElementName] = value, _b); + } + if (stats && stats.isFile()) { + if (exports.IS_WINDOWS) { + // preserve the case of the actual file (since an extension was appended) + try { + const directory = path.dirname(filePath); + const upperName = path.basename(filePath).toUpperCase(); + for (const actualName of yield exports.readdir(directory)) { + if (upperName === actualName.toUpperCase()) { + filePath = path.join(directory, actualName); + break; + } + } } - else { - parentObject[propName] = value; + catch (err) { + // eslint-disable-next-line no-console + console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`); } + return filePath; } - } - } - var additionalPropertiesMapper = resolveAdditionalProperties(serializer, mapper, objectName); - if (additionalPropertiesMapper) { - var propNames = Object.keys(modelProps); - var _loop_1 = function (clientPropName) { - var isAdditionalProperty = propNames.every(function (pn) { return pn !== clientPropName; }); - if (isAdditionalProperty) { - payload[clientPropName] = serializer.serialize(additionalPropertiesMapper, object[clientPropName], objectName + '["' + clientPropName + '"]', options); + else { + if (isUnixExecutable(stats)) { + return filePath; + } } - }; - for (var clientPropName in object) { - _loop_1(clientPropName); } } - return payload; - } - return object; + return ''; + }); } -function getXmlObjectValue(propertyMapper, serializedValue, isXml, options) { - var _a; - if (!isXml || !propertyMapper.xmlNamespace) { - return serializedValue; - } - var xmlnsKey = propertyMapper.xmlNamespacePrefix - ? "xmlns:" + propertyMapper.xmlNamespacePrefix - : "xmlns"; - var xmlNamespace = (_a = {}, _a[xmlnsKey] = propertyMapper.xmlNamespace, _a); - if (["Composite"].includes(propertyMapper.type.name)) { - if (serializedValue[XML_ATTRKEY]) { - return serializedValue; - } - else { - var result_1 = tslib.__assign({}, serializedValue); - result_1[XML_ATTRKEY] = xmlNamespace; - return result_1; - } +exports.tryGetExecutablePath = tryGetExecutablePath; +function normalizeSeparators(p) { + p = p || ''; + if (exports.IS_WINDOWS) { + // convert slashes on Windows + p = p.replace(/\//g, '\\'); + // remove redundant slashes + return p.replace(/\\\\+/g, '\\'); } - var result = {}; - result[options.xmlCharKey] = serializedValue; - result[XML_ATTRKEY] = xmlNamespace; - return result; + // remove redundant slashes + return p.replace(/\/\/+/g, '/'); } -function isSpecialXmlProperty(propertyName, options) { - return [XML_ATTRKEY, options.xmlCharKey].includes(propertyName); +// on Mac/Linux, test the execute bit +// R W X R W X R W X +// 256 128 64 32 16 8 4 2 1 +function isUnixExecutable(stats) { + return ((stats.mode & 1) > 0 || + ((stats.mode & 8) > 0 && stats.gid === process.getgid()) || + ((stats.mode & 64) > 0 && stats.uid === process.getuid())); } -function deserializeCompositeType(serializer, mapper, responseBody, objectName, options) { +// Get the path of cmd.exe in windows +function getCmdPath() { var _a; - if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) { - mapper = getPolymorphicMapper(serializer, mapper, responseBody, "serializedName"); - } - var modelProps = resolveModelProperties(serializer, mapper, objectName); - var instance = {}; - var handledPropertyNames = []; - for (var _i = 0, _b = Object.keys(modelProps); _i < _b.length; _i++) { - var key = _b[_i]; - var propertyMapper = modelProps[key]; - var paths = splitSerializeName(modelProps[key].serializedName); - handledPropertyNames.push(paths[0]); - var serializedName = propertyMapper.serializedName, xmlName = propertyMapper.xmlName, xmlElementName = propertyMapper.xmlElementName; - var propertyObjectName = objectName; - if (serializedName !== "" && serializedName !== undefined) { - propertyObjectName = objectName + "." + serializedName; + return (_a = process.env['COMSPEC']) !== null && _a !== void 0 ? _a : `cmd.exe`; +} +exports.getCmdPath = getCmdPath; +//# sourceMappingURL=io-util.js.map + +/***/ }), + +/***/ 7436: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__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)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.findInPath = exports.which = exports.mkdirP = exports.rmRF = exports.mv = exports.cp = void 0; +const assert_1 = __nccwpck_require__(2357); +const childProcess = __importStar(__nccwpck_require__(3129)); +const path = __importStar(__nccwpck_require__(5622)); +const util_1 = __nccwpck_require__(1669); +const ioUtil = __importStar(__nccwpck_require__(1962)); +const exec = util_1.promisify(childProcess.exec); +const execFile = util_1.promisify(childProcess.execFile); +/** + * Copies a file or folder. + * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js + * + * @param source source path + * @param dest destination path + * @param options optional. See CopyOptions. + */ +function cp(source, dest, options = {}) { + return __awaiter(this, void 0, void 0, function* () { + const { force, recursive, copySourceDirectory } = readCopyOptions(options); + const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null; + // Dest is an existing file, but not forcing + if (destStat && destStat.isFile() && !force) { + return; } - var headerCollectionPrefix = propertyMapper.headerCollectionPrefix; - if (headerCollectionPrefix) { - var dictionary = {}; - for (var _c = 0, _d = Object.keys(responseBody); _c < _d.length; _c++) { - var headerKey = _d[_c]; - if (headerKey.startsWith(headerCollectionPrefix)) { - dictionary[headerKey.substring(headerCollectionPrefix.length)] = serializer.deserialize(propertyMapper.type.value, responseBody[headerKey], propertyObjectName, options); - } - handledPropertyNames.push(headerKey); - } - instance[key] = dictionary; + // If dest is an existing directory, should copy inside. + const newDest = destStat && destStat.isDirectory() && copySourceDirectory + ? path.join(dest, path.basename(source)) + : dest; + if (!(yield ioUtil.exists(source))) { + throw new Error(`no such file or directory: ${source}`); } - else if (serializer.isXML) { - if (propertyMapper.xmlIsAttribute && responseBody[XML_ATTRKEY]) { - instance[key] = serializer.deserialize(propertyMapper, responseBody[XML_ATTRKEY][xmlName], propertyObjectName, options); + const sourceStat = yield ioUtil.stat(source); + if (sourceStat.isDirectory()) { + if (!recursive) { + throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`); } else { - var propertyName = xmlElementName || xmlName || serializedName; - if (propertyMapper.xmlIsWrapped) { - /* a list of wrapped by - For the xml example below - - ... - ... - - the responseBody has - { - Cors: { - CorsRule: [{...}, {...}] - } - } - xmlName is "Cors" and xmlElementName is"CorsRule". - */ - var wrapped = responseBody[xmlName]; - var elementList = (_a = wrapped === null || wrapped === void 0 ? void 0 : wrapped[xmlElementName]) !== null && _a !== void 0 ? _a : []; - instance[key] = serializer.deserialize(propertyMapper, elementList, propertyObjectName, options); - } - else { - var property = responseBody[propertyName]; - instance[key] = serializer.deserialize(propertyMapper, property, propertyObjectName, options); - } + yield cpDirRecursive(source, newDest, 0, force); } } else { - // deserialize the property if it is present in the provided responseBody instance - var propertyInstance = void 0; - var res = responseBody; - // traversing the object step by step. - for (var _e = 0, paths_2 = paths; _e < paths_2.length; _e++) { - var item = paths_2[_e]; - if (!res) - break; - res = res[item]; - } - propertyInstance = res; - var polymorphicDiscriminator = mapper.type.polymorphicDiscriminator; - // checking that the model property name (key)(ex: "fishtype") and the - // clientName of the polymorphicDiscriminator {metadata} (ex: "fishtype") - // instead of the serializedName of the polymorphicDiscriminator (ex: "fish.type") - // is a better approach. The generator is not consistent with escaping '\.' in the - // serializedName of the property (ex: "fish\.type") that is marked as polymorphic discriminator - // and the serializedName of the metadata polymorphicDiscriminator (ex: "fish.type"). However, - // the clientName transformation of the polymorphicDiscriminator (ex: "fishtype") and - // the transformation of model property name (ex: "fishtype") is done consistently. - // Hence, it is a safer bet to rely on the clientName of the polymorphicDiscriminator. - if (polymorphicDiscriminator && - key === polymorphicDiscriminator.clientName && - propertyInstance == undefined) { - propertyInstance = mapper.serializedName; + if (path.relative(source, newDest) === '') { + // a file cannot be copied to itself + throw new Error(`'${newDest}' and '${source}' are the same file`); } - var serializedValue = void 0; - // paging - if (Array.isArray(responseBody[key]) && modelProps[key].serializedName === "") { - propertyInstance = responseBody[key]; - instance = serializer.deserialize(propertyMapper, propertyInstance, propertyObjectName, options); + yield copyFile(source, newDest, force); + } + }); +} +exports.cp = cp; +/** + * Moves a path. + * + * @param source source path + * @param dest destination path + * @param options optional. See MoveOptions. + */ +function mv(source, dest, options = {}) { + return __awaiter(this, void 0, void 0, function* () { + if (yield ioUtil.exists(dest)) { + let destExists = true; + if (yield ioUtil.isDirectory(dest)) { + // If dest is directory copy src into dest + dest = path.join(dest, path.basename(source)); + destExists = yield ioUtil.exists(dest); } - else if (propertyInstance !== undefined || propertyMapper.defaultValue !== undefined) { - serializedValue = serializer.deserialize(propertyMapper, propertyInstance, propertyObjectName, options); - instance[key] = serializedValue; + if (destExists) { + if (options.force == null || options.force) { + yield rmRF(dest); + } + else { + throw new Error('Destination already exists'); + } } } - } - var additionalPropertiesMapper = mapper.type.additionalProperties; - if (additionalPropertiesMapper) { - var isAdditionalProperty = function (responsePropName) { - for (var clientPropName in modelProps) { - var paths = splitSerializeName(modelProps[clientPropName].serializedName); - if (paths[0] === responsePropName) { - return false; + yield mkdirP(path.dirname(dest)); + yield ioUtil.rename(source, dest); + }); +} +exports.mv = mv; +/** + * Remove a path recursively with force + * + * @param inputPath path to remove + */ +function rmRF(inputPath) { + return __awaiter(this, void 0, void 0, function* () { + if (ioUtil.IS_WINDOWS) { + // Node doesn't provide a delete operation, only an unlink function. This means that if the file is being used by another + // program (e.g. antivirus), it won't be deleted. To address this, we shell out the work to rd/del. + // Check for invalid characters + // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file + if (/[*"<>|]/.test(inputPath)) { + throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows'); + } + try { + const cmdPath = ioUtil.getCmdPath(); + if (yield ioUtil.isDirectory(inputPath, true)) { + yield exec(`${cmdPath} /s /c "rd /s /q "%inputPath%""`, { + env: { inputPath } + }); + } + else { + yield exec(`${cmdPath} /s /c "del /f /a "%inputPath%""`, { + env: { inputPath } + }); } } - return true; - }; - for (var responsePropName in responseBody) { - if (isAdditionalProperty(responsePropName)) { - instance[responsePropName] = serializer.deserialize(additionalPropertiesMapper, responseBody[responsePropName], objectName + '["' + responsePropName + '"]', options); + catch (err) { + // if you try to delete a file that doesn't exist, desired result is achieved + // other errors are valid + if (err.code !== 'ENOENT') + throw err; + } + // Shelling out fails to remove a symlink folder with missing source, this unlink catches that + try { + yield ioUtil.unlink(inputPath); + } + catch (err) { + // if you try to delete a file that doesn't exist, desired result is achieved + // other errors are valid + if (err.code !== 'ENOENT') + throw err; } } - } - else if (responseBody) { - for (var _f = 0, _g = Object.keys(responseBody); _f < _g.length; _f++) { - var key = _g[_f]; - if (instance[key] === undefined && - !handledPropertyNames.includes(key) && - !isSpecialXmlProperty(key, options)) { - instance[key] = responseBody[key]; + else { + let isDir = false; + try { + isDir = yield ioUtil.isDirectory(inputPath); + } + catch (err) { + // if you try to delete a file that doesn't exist, desired result is achieved + // other errors are valid + if (err.code !== 'ENOENT') + throw err; + return; + } + if (isDir) { + yield execFile(`rm`, [`-rf`, `${inputPath}`]); + } + else { + yield ioUtil.unlink(inputPath); } } - } - return instance; + }); } -function deserializeDictionaryType(serializer, mapper, responseBody, objectName, options) { - var value = mapper.type.value; - if (!value || typeof value !== "object") { - throw new Error("\"value\" metadata for a Dictionary must be defined in the " + - ("mapper and it must of type \"object\" in " + objectName)); - } - if (responseBody) { - var tempDictionary = {}; - for (var _i = 0, _a = Object.keys(responseBody); _i < _a.length; _i++) { - var key = _a[_i]; - tempDictionary[key] = serializer.deserialize(value, responseBody[key], objectName, options); - } - return tempDictionary; - } - return responseBody; +exports.rmRF = rmRF; +/** + * Make a directory. Creates the full path with folders in between + * Will throw if it fails + * + * @param fsPath path to create + * @returns Promise + */ +function mkdirP(fsPath) { + return __awaiter(this, void 0, void 0, function* () { + assert_1.ok(fsPath, 'a path argument must be provided'); + yield ioUtil.mkdir(fsPath, { recursive: true }); + }); } -function deserializeSequenceType(serializer, mapper, responseBody, objectName, options) { - var element = mapper.type.element; - if (!element || typeof element !== "object") { - throw new Error("element\" metadata for an Array must be defined in the " + - ("mapper and it must of type \"object\" in " + objectName)); - } - if (responseBody) { - if (!Array.isArray(responseBody)) { - // xml2js will interpret a single element array as just the element, so force it to be an array - responseBody = [responseBody]; +exports.mkdirP = mkdirP; +/** + * Returns path of a tool had the tool actually been invoked. Resolves via paths. + * If you check and the tool does not exist, it will throw. + * + * @param tool name of the tool + * @param check whether to check if tool exists + * @returns Promise path to tool + */ +function which(tool, check) { + return __awaiter(this, void 0, void 0, function* () { + if (!tool) { + throw new Error("parameter 'tool' is required"); } - var tempArray = []; - for (var i = 0; i < responseBody.length; i++) { - tempArray[i] = serializer.deserialize(element, responseBody[i], objectName + "[" + i + "]", options); + // recursive when check=true + if (check) { + const result = yield which(tool, false); + if (!result) { + if (ioUtil.IS_WINDOWS) { + throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`); + } + else { + throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`); + } + } + return result; } - return tempArray; - } - return responseBody; + const matches = yield findInPath(tool); + if (matches && matches.length > 0) { + return matches[0]; + } + return ''; + }); } -function getPolymorphicMapper(serializer, mapper, object, polymorphicPropertyName) { - var polymorphicDiscriminator = getPolymorphicDiscriminatorRecursively(serializer, mapper); - if (polymorphicDiscriminator) { - var discriminatorName = polymorphicDiscriminator[polymorphicPropertyName]; - if (discriminatorName != undefined) { - var discriminatorValue = object[discriminatorName]; - if (discriminatorValue != undefined) { - var typeName = mapper.type.uberParent || mapper.type.className; - var indexDiscriminator = discriminatorValue === typeName - ? discriminatorValue - : typeName + "." + discriminatorValue; - var polymorphicMapper = serializer.modelMappers.discriminators[indexDiscriminator]; - if (polymorphicMapper) { - mapper = polymorphicMapper; +exports.which = which; +/** + * Returns a list of all occurrences of the given tool on the system path. + * + * @returns Promise the paths of the tool + */ +function findInPath(tool) { + return __awaiter(this, void 0, void 0, function* () { + if (!tool) { + throw new Error("parameter 'tool' is required"); + } + // build the list of extensions to try + const extensions = []; + if (ioUtil.IS_WINDOWS && process.env['PATHEXT']) { + for (const extension of process.env['PATHEXT'].split(path.delimiter)) { + if (extension) { + extensions.push(extension); } } } - } - return mapper; + // if it's rooted, return it if exists. otherwise return empty. + if (ioUtil.isRooted(tool)) { + const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions); + if (filePath) { + return [filePath]; + } + return []; + } + // if any path separators, return empty + if (tool.includes(path.sep)) { + return []; + } + // build the list of directories + // + // Note, technically "where" checks the current directory on Windows. From a toolkit perspective, + // it feels like we should not do this. Checking the current directory seems like more of a use + // case of a shell, and the which() function exposed by the toolkit should strive for consistency + // across platforms. + const directories = []; + if (process.env.PATH) { + for (const p of process.env.PATH.split(path.delimiter)) { + if (p) { + directories.push(p); + } + } + } + // find all matches + const matches = []; + for (const directory of directories) { + const filePath = yield ioUtil.tryGetExecutablePath(path.join(directory, tool), extensions); + if (filePath) { + matches.push(filePath); + } + } + return matches; + }); } -function getPolymorphicDiscriminatorRecursively(serializer, mapper) { - return (mapper.type.polymorphicDiscriminator || - getPolymorphicDiscriminatorSafely(serializer, mapper.type.uberParent) || - getPolymorphicDiscriminatorSafely(serializer, mapper.type.className)); +exports.findInPath = findInPath; +function readCopyOptions(options) { + const force = options.force == null ? true : options.force; + const recursive = Boolean(options.recursive); + const copySourceDirectory = options.copySourceDirectory == null + ? true + : Boolean(options.copySourceDirectory); + return { force, recursive, copySourceDirectory }; } -function getPolymorphicDiscriminatorSafely(serializer, typeName) { - return (typeName && - serializer.modelMappers[typeName] && - serializer.modelMappers[typeName].type.polymorphicDiscriminator); +function cpDirRecursive(sourceDir, destDir, currentDepth, force) { + return __awaiter(this, void 0, void 0, function* () { + // Ensure there is not a run away recursive copy + if (currentDepth >= 255) + return; + currentDepth++; + yield mkdirP(destDir); + const files = yield ioUtil.readdir(sourceDir); + for (const fileName of files) { + const srcFile = `${sourceDir}/${fileName}`; + const destFile = `${destDir}/${fileName}`; + const srcFileStat = yield ioUtil.lstat(srcFile); + if (srcFileStat.isDirectory()) { + // Recurse + yield cpDirRecursive(srcFile, destFile, currentDepth, force); + } + else { + yield copyFile(srcFile, destFile, force); + } + } + // Change the mode for the newly created directory + yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); + }); } -// TODO: why is this here? -function serializeObject(toSerialize) { - var castToSerialize = toSerialize; - if (toSerialize == undefined) - return undefined; - if (toSerialize instanceof Uint8Array) { - toSerialize = encodeByteArray(toSerialize); - return toSerialize; - } - else if (toSerialize instanceof Date) { - return toSerialize.toISOString(); - } - else if (Array.isArray(toSerialize)) { - var array = []; - for (var i = 0; i < toSerialize.length; i++) { - array.push(serializeObject(toSerialize[i])); +// Buffered file copy +function copyFile(srcFile, destFile, force) { + return __awaiter(this, void 0, void 0, function* () { + if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) { + // unlink/re-link it + try { + yield ioUtil.lstat(destFile); + yield ioUtil.unlink(destFile); + } + catch (e) { + // Try to override file permission + if (e.code === 'EPERM') { + yield ioUtil.chmod(destFile, '0666'); + yield ioUtil.unlink(destFile); + } + // other errors = it doesn't exist, no work to do + } + // Copy over symlink + const symlinkFull = yield ioUtil.readlink(srcFile); + yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? 'junction' : null); } - return array; - } - else if (typeof toSerialize === "object") { - var dictionary = {}; - for (var property in toSerialize) { - dictionary[property] = serializeObject(castToSerialize[property]); + else if (!(yield ioUtil.exists(destFile)) || force) { + yield ioUtil.copyFile(srcFile, destFile); } - return dictionary; - } - return toSerialize; -} -/** - * Utility function to create a K:V from a list of strings - */ -function strEnum(o) { - var result = {}; - for (var _i = 0, o_1 = o; _i < o_1.length; _i++) { - var key = o_1[_i]; - result[key] = key; - } - return result; + }); } -// eslint-disable-next-line @typescript-eslint/no-redeclare -var MapperType = strEnum([ - "Base64Url", - "Boolean", - "ByteArray", - "Composite", - "Date", - "DateTime", - "DateTimeRfc1123", - "Dictionary", - "Enum", - "Number", - "Object", - "Sequence", - "String", - "Stream", - "TimeSpan", - "UnixTime" -]); +//# sourceMappingURL=io.js.map + +/***/ }), + +/***/ 2557: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +var tslib = __nccwpck_require__(9268); // Copyright (c) Microsoft Corporation. -function isWebResourceLike(object) { - if (object && typeof object === "object") { - var castObject = object; - if (typeof castObject.url === "string" && - typeof castObject.method === "string" && - typeof castObject.headers === "object" && - isHttpHeadersLike(castObject.headers) && - typeof castObject.validateRequestProperties === "function" && - typeof castObject.prepare === "function" && - typeof castObject.clone === "function") { - return true; - } - } - return false; -} +// Licensed under the MIT license. +var listenersMap = new WeakMap(); +var abortedMap = new WeakMap(); /** - * Creates a new WebResource object. + * An aborter instance implements AbortSignal interface, can abort HTTP requests. * - * This class provides an abstraction over a REST call by being library / implementation agnostic and wrapping the necessary - * properties to initiate a request. + * - Call AbortSignal.none to create a new AbortSignal instance that cannot be cancelled. + * Use `AbortSignal.none` when you are required to pass a cancellation token but the operation + * cannot or will not ever be cancelled. + * + * @example + * Abort without timeout + * ```ts + * await doAsyncWork(AbortSignal.none); + * ``` */ -var WebResource = /** @class */ (function () { - function WebResource(url, method, body, query, headers, streamResponseBody, withCredentials, abortSignal, timeout, onUploadProgress, onDownloadProgress, proxySettings, keepAlive, decompressResponse, streamResponseStatusCodes) { - this.streamResponseBody = streamResponseBody; - this.streamResponseStatusCodes = streamResponseStatusCodes; - this.url = url || ""; - this.method = method || "GET"; - this.headers = isHttpHeadersLike(headers) ? headers : new HttpHeaders(headers); - this.body = body; - this.query = query; - this.formData = undefined; - this.withCredentials = withCredentials || false; - this.abortSignal = abortSignal; - this.timeout = timeout || 0; - this.onUploadProgress = onUploadProgress; - this.onDownloadProgress = onDownloadProgress; - this.proxySettings = proxySettings; - this.keepAlive = keepAlive; - this.decompressResponse = decompressResponse; - this.requestId = this.headers.get("x-ms-client-request-id") || generateUuid(); +var AbortSignal = /** @class */ (function () { + function AbortSignal() { + /** + * onabort event listener. + */ + this.onabort = null; + listenersMap.set(this, []); + abortedMap.set(this, false); } + Object.defineProperty(AbortSignal.prototype, "aborted", { + /** + * Status of whether aborted or not. + * + * @readonly + */ + get: function () { + if (!abortedMap.has(this)) { + throw new TypeError("Expected `this` to be an instance of AbortSignal."); + } + return abortedMap.get(this); + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(AbortSignal, "none", { + /** + * Creates a new AbortSignal instance that will never be aborted. + * + * @readonly + */ + get: function () { + return new AbortSignal(); + }, + enumerable: false, + configurable: true + }); /** - * Validates that the required properties such as method, url, headers["Content-Type"], - * headers["accept-language"] are defined. It will throw an error if one of the above - * mentioned properties are not defined. + * Added new "abort" event listener, only support "abort" event. + * + * @param _type - Only support "abort" event + * @param listener - The listener to be added */ - WebResource.prototype.validateRequestProperties = function () { - if (!this.method) { - throw new Error("WebResource.method is required."); - } - if (!this.url) { - throw new Error("WebResource.url is required."); + AbortSignal.prototype.addEventListener = function ( + // tslint:disable-next-line:variable-name + _type, listener) { + if (!listenersMap.has(this)) { + throw new TypeError("Expected `this` to be an instance of AbortSignal."); } + var listeners = listenersMap.get(this); + listeners.push(listener); }; /** - * Prepares the request. - * @param options - Options to provide for preparing the request. - * @returns Returns the prepared WebResource (HTTP Request) object that needs to be given to the request pipeline. + * Remove "abort" event listener, only support "abort" event. + * + * @param _type - Only support "abort" event + * @param listener - The listener to be removed */ - WebResource.prototype.prepare = function (options) { - if (!options) { - throw new Error("options object is required"); - } - if (options.method === undefined || - options.method === null || - typeof options.method.valueOf() !== "string") { - throw new Error("options.method must be a string."); - } - if (options.url && options.pathTemplate) { - throw new Error("options.url and options.pathTemplate are mutually exclusive. Please provide exactly one of them."); - } - if ((options.pathTemplate === undefined || - options.pathTemplate === null || - typeof options.pathTemplate.valueOf() !== "string") && - (options.url === undefined || - options.url === null || - typeof options.url.valueOf() !== "string")) { - throw new Error("Please provide exactly one of options.pathTemplate or options.url."); - } - // set the url if it is provided. - if (options.url) { - if (typeof options.url !== "string") { - throw new Error('options.url must be of type "string".'); - } - this.url = options.url; - } - // set the method - if (options.method) { - var validMethods = ["GET", "PUT", "HEAD", "DELETE", "OPTIONS", "POST", "PATCH", "TRACE"]; - if (validMethods.indexOf(options.method.toUpperCase()) === -1) { - throw new Error('The provided method "' + - options.method + - '" is invalid. Supported HTTP methods are: ' + - JSON.stringify(validMethods)); - } - } - this.method = options.method.toUpperCase(); - // construct the url if path template is provided - if (options.pathTemplate) { - var pathTemplate_1 = options.pathTemplate, pathParameters_1 = options.pathParameters; - if (typeof pathTemplate_1 !== "string") { - throw new Error('options.pathTemplate must be of type "string".'); - } - if (!options.baseUrl) { - options.baseUrl = "https://management.azure.com"; - } - var baseUrl = options.baseUrl; - var url_1 = baseUrl + - (baseUrl.endsWith("/") ? "" : "/") + - (pathTemplate_1.startsWith("/") ? pathTemplate_1.slice(1) : pathTemplate_1); - var segments = url_1.match(/({[\w-]*\s*[\w-]*})/gi); - if (segments && segments.length) { - if (!pathParameters_1) { - throw new Error("pathTemplate: " + pathTemplate_1 + " has been provided. Hence, options.pathParameters must also be provided."); - } - segments.forEach(function (item) { - var pathParamName = item.slice(1, -1); - var pathParam = pathParameters_1[pathParamName]; - if (pathParam === null || - pathParam === undefined || - !(typeof pathParam === "string" || typeof pathParam === "object")) { - var stringifiedPathParameters = JSON.stringify(pathParameters_1, undefined, 2); - throw new Error("pathTemplate: " + pathTemplate_1 + " contains the path parameter " + pathParamName + - (" however, it is not present in parameters: " + stringifiedPathParameters + ".") + - ("The value of the path parameter can either be a \"string\" of the form { " + pathParamName + ": \"some sample value\" } or ") + - ("it can be an \"object\" of the form { \"" + pathParamName + "\": { value: \"some sample value\", skipUrlEncoding: true } }.")); - } - if (typeof pathParam.valueOf() === "string") { - url_1 = url_1.replace(item, encodeURIComponent(pathParam)); - } - if (typeof pathParam.valueOf() === "object") { - if (!pathParam.value) { - throw new Error("options.pathParameters[" + pathParamName + "] is of type \"object\" but it does not contain a \"value\" property."); - } - if (pathParam.skipUrlEncoding) { - url_1 = url_1.replace(item, pathParam.value); - } - else { - url_1 = url_1.replace(item, encodeURIComponent(pathParam.value)); - } - } - }); - } - this.url = url_1; - } - // append query parameters to the url if they are provided. They can be provided with pathTemplate or url option. - if (options.queryParameters) { - var queryParameters = options.queryParameters; - if (typeof queryParameters !== "object") { - throw new Error("options.queryParameters must be of type object. It should be a JSON object " + - "of \"query-parameter-name\" as the key and the \"query-parameter-value\" as the value. " + - "The \"query-parameter-value\" may be fo type \"string\" or an \"object\" of the form { value: \"query-parameter-value\", skipUrlEncoding: true }."); - } - // append question mark if it is not present in the url - if (this.url && this.url.indexOf("?") === -1) { - this.url += "?"; - } - // construct queryString - var queryParams = []; - // We need to populate this.query as a dictionary if the request is being used for Sway's validateRequest(). - this.query = {}; - for (var queryParamName in queryParameters) { - var queryParam = queryParameters[queryParamName]; - if (queryParam) { - if (typeof queryParam === "string") { - queryParams.push(queryParamName + "=" + encodeURIComponent(queryParam)); - this.query[queryParamName] = encodeURIComponent(queryParam); - } - else if (typeof queryParam === "object") { - if (!queryParam.value) { - throw new Error("options.queryParameters[" + queryParamName + "] is of type \"object\" but it does not contain a \"value\" property."); - } - if (queryParam.skipUrlEncoding) { - queryParams.push(queryParamName + "=" + queryParam.value); - this.query[queryParamName] = queryParam.value; - } - else { - queryParams.push(queryParamName + "=" + encodeURIComponent(queryParam.value)); - this.query[queryParamName] = encodeURIComponent(queryParam.value); - } - } - } - } // end-of-for - // append the queryString - this.url += queryParams.join("&"); - } - // add headers to the request if they are provided - if (options.headers) { - var headers = options.headers; - for (var _i = 0, _a = Object.keys(options.headers); _i < _a.length; _i++) { - var headerName = _a[_i]; - this.headers.set(headerName, headers[headerName]); - } - } - // ensure accept-language is set correctly - if (!this.headers.get("accept-language")) { - this.headers.set("accept-language", "en-US"); - } - // ensure the request-id is set correctly - if (!this.headers.get("x-ms-client-request-id") && !options.disableClientRequestId) { - this.headers.set("x-ms-client-request-id", this.requestId); - } - // default - if (!this.headers.get("Content-Type")) { - this.headers.set("Content-Type", "application/json; charset=utf-8"); - } - // set the request body. request.js automatically sets the Content-Length request header, so we need not set it explicitly - this.body = options.body; - if (options.body !== undefined && options.body !== null) { - // body as a stream special case. set the body as-is and check for some special request headers specific to sending a stream. - if (options.bodyIsStream) { - if (!this.headers.get("Transfer-Encoding")) { - this.headers.set("Transfer-Encoding", "chunked"); - } - if (this.headers.get("Content-Type") !== "application/octet-stream") { - this.headers.set("Content-Type", "application/octet-stream"); - } - } - else { - if (options.serializationMapper) { - this.body = new Serializer(options.mappers).serialize(options.serializationMapper, options.body, "requestBody"); - } - if (!options.disableJsonStringifyOnBody) { - this.body = JSON.stringify(options.body); - } - } - } - if (options.spanOptions) { - this.spanOptions = options.spanOptions; + AbortSignal.prototype.removeEventListener = function ( + // tslint:disable-next-line:variable-name + _type, listener) { + if (!listenersMap.has(this)) { + throw new TypeError("Expected `this` to be an instance of AbortSignal."); } - if (options.tracingContext) { - this.tracingContext = options.tracingContext; + var listeners = listenersMap.get(this); + var index = listeners.indexOf(listener); + if (index > -1) { + listeners.splice(index, 1); } - this.abortSignal = options.abortSignal; - this.onDownloadProgress = options.onDownloadProgress; - this.onUploadProgress = options.onUploadProgress; - return this; }; /** - * Clone this WebResource HTTP request object. - * @returns The clone of this WebResource HTTP request object. + * Dispatches a synthetic event to the AbortSignal. */ - WebResource.prototype.clone = function () { - var result = new WebResource(this.url, this.method, this.body, this.query, this.headers && this.headers.clone(), this.streamResponseBody, this.withCredentials, this.abortSignal, this.timeout, this.onUploadProgress, this.onDownloadProgress, this.proxySettings, this.keepAlive, this.decompressResponse, this.streamResponseStatusCodes); - if (this.formData) { - result.formData = this.formData; - } - if (this.operationSpec) { - result.operationSpec = this.operationSpec; - } - if (this.shouldDeserialize) { - result.shouldDeserialize = this.shouldDeserialize; - } - if (this.operationResponseGetter) { - result.operationResponseGetter = this.operationResponseGetter; - } - return result; + AbortSignal.prototype.dispatchEvent = function (_event) { + throw new Error("This is a stub dispatchEvent implementation that should not be used. It only exists for type-checking purposes."); }; - return WebResource; + return AbortSignal; }()); - -// Copyright (c) Microsoft Corporation. -var custom = util.inspect.custom; +/** + * Helper to trigger an abort event immediately, the onabort and all abort event listeners will be triggered. + * Will try to trigger abort event for all linked AbortSignal nodes. + * + * - If there is a timeout, the timer will be cancelled. + * - If aborted is true, nothing will happen. + * + * @internal + */ +// eslint-disable-next-line @azure/azure-sdk/ts-use-interface-parameters +function abortSignal(signal) { + if (signal.aborted) { + return; + } + if (signal.onabort) { + signal.onabort.call(signal); + } + var listeners = listenersMap.get(signal); + if (listeners) { + // Create a copy of listeners so mutations to the array + // (e.g. via removeListener calls) don't affect the listeners + // we invoke. + listeners.slice().forEach(function (listener) { + listener.call(signal, { type: "abort" }); + }); + } + abortedMap.set(signal, true); +} // Copyright (c) Microsoft Corporation. /** - * A class that handles the query portion of a URLBuilder. + * This error is thrown when an asynchronous operation has been aborted. + * Check for this error by testing the `name` that the name property of the + * error matches `"AbortError"`. + * + * @example + * ```ts + * const controller = new AbortController(); + * controller.abort(); + * try { + * doAsyncWork(controller.signal) + * } catch (e) { + * if (e.name === 'AbortError') { + * // handle abort error here. + * } + * } + * ``` */ -var URLQuery = /** @class */ (function () { - function URLQuery() { - this._rawQuery = {}; +var AbortError = /** @class */ (function (_super) { + tslib.__extends(AbortError, _super); + function AbortError(message) { + var _this = _super.call(this, message) || this; + _this.name = "AbortError"; + return _this; } - /** - * Get whether or not there any query parameters in this URLQuery. - */ - URLQuery.prototype.any = function () { - return Object.keys(this._rawQuery).length > 0; - }; - /** - * Get the keys of the query string. - */ - URLQuery.prototype.keys = function () { - return Object.keys(this._rawQuery); - }; - /** - * Set a query parameter with the provided name and value. If the parameterValue is undefined or - * empty, then this will attempt to remove an existing query parameter with the provided - * parameterName. - */ - URLQuery.prototype.set = function (parameterName, parameterValue) { - var caseParameterValue = parameterValue; - if (parameterName) { - if (caseParameterValue !== undefined && caseParameterValue !== null) { - var newValue = Array.isArray(caseParameterValue) - ? caseParameterValue - : caseParameterValue.toString(); - this._rawQuery[parameterName] = newValue; - } - else { - delete this._rawQuery[parameterName]; - } + return AbortError; +}(Error)); +/** + * An AbortController provides an AbortSignal and the associated controls to signal + * that an asynchronous operation should be aborted. + * + * @example + * Abort an operation when another event fires + * ```ts + * const controller = new AbortController(); + * const signal = controller.signal; + * doAsyncWork(signal); + * button.addEventListener('click', () => controller.abort()); + * ``` + * + * @example + * Share aborter cross multiple operations in 30s + * ```ts + * // Upload the same data to 2 different data centers at the same time, + * // abort another when any of them is finished + * const controller = AbortController.withTimeout(30 * 1000); + * doAsyncWork(controller.signal).then(controller.abort); + * doAsyncWork(controller.signal).then(controller.abort); + *``` + * + * @example + * Cascaded aborting + * ```ts + * // All operations can't take more than 30 seconds + * const aborter = Aborter.timeout(30 * 1000); + * + * // Following 2 operations can't take more than 25 seconds + * await doAsyncWork(aborter.withTimeout(25 * 1000)); + * await doAsyncWork(aborter.withTimeout(25 * 1000)); + * ``` + */ +var AbortController = /** @class */ (function () { + // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types + function AbortController(parentSignals) { + var _this = this; + this._signal = new AbortSignal(); + if (!parentSignals) { + return; } - }; - /** - * Get the value of the query parameter with the provided name. If no parameter exists with the - * provided parameter name, then undefined will be returned. - */ - URLQuery.prototype.get = function (parameterName) { - return parameterName ? this._rawQuery[parameterName] : undefined; - }; - /** - * Get the string representation of this query. The return value will not start with a "?". - */ - URLQuery.prototype.toString = function () { - var result = ""; - for (var parameterName in this._rawQuery) { - if (result) { - result += "&"; - } - var parameterValue = this._rawQuery[parameterName]; - if (Array.isArray(parameterValue)) { - var parameterStrings = []; - for (var _i = 0, parameterValue_1 = parameterValue; _i < parameterValue_1.length; _i++) { - var parameterValueElement = parameterValue_1[_i]; - parameterStrings.push(parameterName + "=" + parameterValueElement); - } - result += parameterStrings.join("&"); - } - else { - result += parameterName + "=" + parameterValue; - } + // coerce parentSignals into an array + if (!Array.isArray(parentSignals)) { + // eslint-disable-next-line prefer-rest-params + parentSignals = arguments; } - return result; - }; - /** - * Parse a URLQuery from the provided text. - */ - URLQuery.parse = function (text) { - var result = new URLQuery(); - if (text) { - if (text.startsWith("?")) { - text = text.substring(1); - } - var currentState = "ParameterName"; - var parameterName = ""; - var parameterValue = ""; - for (var i = 0; i < text.length; ++i) { - var currentCharacter = text[i]; - switch (currentState) { - case "ParameterName": - switch (currentCharacter) { - case "=": - currentState = "ParameterValue"; - break; - case "&": - parameterName = ""; - parameterValue = ""; - break; - default: - parameterName += currentCharacter; - break; - } - break; - case "ParameterValue": - switch (currentCharacter) { - case "&": - result.set(parameterName, parameterValue); - parameterName = ""; - parameterValue = ""; - currentState = "ParameterName"; - break; - default: - parameterValue += currentCharacter; - break; - } - break; - default: - throw new Error("Unrecognized URLQuery parse state: " + currentState); - } + for (var _i = 0, parentSignals_1 = parentSignals; _i < parentSignals_1.length; _i++) { + var parentSignal = parentSignals_1[_i]; + // if the parent signal has already had abort() called, + // then call abort on this signal as well. + if (parentSignal.aborted) { + this.abort(); } - if (currentState === "ParameterValue") { - result.set(parameterName, parameterValue); + else { + // when the parent signal aborts, this signal should as well. + parentSignal.addEventListener("abort", function () { + _this.abort(); + }); } } - return result; - }; - return URLQuery; -}()); -/** - * A class that handles creating, modifying, and parsing URLs. - */ -var URLBuilder = /** @class */ (function () { - function URLBuilder() { } + Object.defineProperty(AbortController.prototype, "signal", { + /** + * The AbortSignal associated with this controller that will signal aborted + * when the abort method is called on this controller. + * + * @readonly + */ + get: function () { + return this._signal; + }, + enumerable: false, + configurable: true + }); /** - * Set the scheme/protocol for this URL. If the provided scheme contains other parts of a URL - * (such as a host, port, path, or query), those parts will be added to this URL as well. - */ - URLBuilder.prototype.setScheme = function (scheme) { - if (!scheme) { - this._scheme = undefined; - } - else { - this.set(scheme, "SCHEME"); - } - }; - /** - * Get the scheme that has been set in this URL. - */ - URLBuilder.prototype.getScheme = function () { - return this._scheme; - }; - /** - * Set the host for this URL. If the provided host contains other parts of a URL (such as a - * port, path, or query), those parts will be added to this URL as well. - */ - URLBuilder.prototype.setHost = function (host) { - if (!host) { - this._host = undefined; - } - else { - this.set(host, "SCHEME_OR_HOST"); - } - }; - /** - * Get the host that has been set in this URL. + * Signal that any operations passed this controller's associated abort signal + * to cancel any remaining work and throw an `AbortError`. */ - URLBuilder.prototype.getHost = function () { - return this._host; + AbortController.prototype.abort = function () { + abortSignal(this._signal); }; /** - * Set the port for this URL. If the provided port contains other parts of a URL (such as a - * path or query), those parts will be added to this URL as well. + * Creates a new AbortSignal instance that will abort after the provided ms. + * @param ms - Elapsed time in milliseconds to trigger an abort. */ - URLBuilder.prototype.setPort = function (port) { - if (port === undefined || port === null || port === "") { - this._port = undefined; - } - else { - this.set(port.toString(), "PORT"); + AbortController.timeout = function (ms) { + var signal = new AbortSignal(); + var timer = setTimeout(abortSignal, ms, signal); + // Prevent the active Timer from keeping the Node.js event loop active. + if (typeof timer.unref === "function") { + timer.unref(); } + return signal; }; - /** - * Get the port that has been set in this URL. - */ - URLBuilder.prototype.getPort = function () { - return this._port; - }; - /** - * Set the path for this URL. If the provided path contains a query, then it will be added to - * this URL as well. - */ - URLBuilder.prototype.setPath = function (path) { - if (!path) { - this._path = undefined; - } - else { - var schemeIndex = path.indexOf("://"); - if (schemeIndex !== -1) { - var schemeStart = path.lastIndexOf("/", schemeIndex); - // Make sure to only grab the URL part of the path before setting the state back to SCHEME - // this will handle cases such as "/a/b/c/https://microsoft.com" => "https://microsoft.com" - this.set(schemeStart === -1 ? path : path.substr(schemeStart + 1), "SCHEME"); - } - else { - this.set(path, "PATH"); - } - } - }; - /** - * Append the provided path to this URL's existing path. If the provided path contains a query, - * then it will be added to this URL as well. - */ - URLBuilder.prototype.appendPath = function (path) { - if (path) { - var currentPath = this.getPath(); - if (currentPath) { - if (!currentPath.endsWith("/")) { - currentPath += "/"; - } - if (path.startsWith("/")) { - path = path.substring(1); - } - path = currentPath + path; - } - this.set(path, "PATH"); - } - }; - /** - * Get the path that has been set in this URL. - */ - URLBuilder.prototype.getPath = function () { - return this._path; - }; - /** - * Set the query in this URL. - */ - URLBuilder.prototype.setQuery = function (query) { - if (!query) { - this._query = undefined; - } - else { - this._query = URLQuery.parse(query); - } - }; - /** - * Set a query parameter with the provided name and value in this URL's query. If the provided - * query parameter value is undefined or empty, then the query parameter will be removed if it - * existed. - */ - URLBuilder.prototype.setQueryParameter = function (queryParameterName, queryParameterValue) { - if (queryParameterName) { - if (!this._query) { - this._query = new URLQuery(); - } - this._query.set(queryParameterName, queryParameterValue); - } - }; - /** - * Get the value of the query parameter with the provided query parameter name. If no query - * parameter exists with the provided name, then undefined will be returned. - */ - URLBuilder.prototype.getQueryParameterValue = function (queryParameterName) { - return this._query ? this._query.get(queryParameterName) : undefined; - }; - /** - * Get the query in this URL. - */ - URLBuilder.prototype.getQuery = function () { - return this._query ? this._query.toString() : undefined; - }; - /** - * Set the parts of this URL by parsing the provided text using the provided startState. - */ - URLBuilder.prototype.set = function (text, startState) { - var tokenizer = new URLTokenizer(text, startState); - while (tokenizer.next()) { - var token = tokenizer.current(); - var tokenPath = void 0; - if (token) { - switch (token.type) { - case "SCHEME": - this._scheme = token.text || undefined; - break; - case "HOST": - this._host = token.text || undefined; - break; - case "PORT": - this._port = token.text || undefined; - break; - case "PATH": - tokenPath = token.text || undefined; - if (!this._path || this._path === "/" || tokenPath !== "/") { - this._path = tokenPath; - } - break; - case "QUERY": - this._query = URLQuery.parse(token.text); - break; - default: - throw new Error("Unrecognized URLTokenType: " + token.type); - } - } - } - }; - URLBuilder.prototype.toString = function () { - var result = ""; - if (this._scheme) { - result += this._scheme + "://"; - } - if (this._host) { - result += this._host; - } - if (this._port) { - result += ":" + this._port; - } - if (this._path) { - if (!this._path.startsWith("/")) { - result += "/"; - } - result += this._path; - } - if (this._query && this._query.any()) { - result += "?" + this._query.toString(); - } - return result; - }; - /** - * If the provided searchValue is found in this URLBuilder, then replace it with the provided - * replaceValue. - */ - URLBuilder.prototype.replaceAll = function (searchValue, replaceValue) { - if (searchValue) { - this.setScheme(replaceAll(this.getScheme(), searchValue, replaceValue)); - this.setHost(replaceAll(this.getHost(), searchValue, replaceValue)); - this.setPort(replaceAll(this.getPort(), searchValue, replaceValue)); - this.setPath(replaceAll(this.getPath(), searchValue, replaceValue)); - this.setQuery(replaceAll(this.getQuery(), searchValue, replaceValue)); - } - }; - URLBuilder.parse = function (text) { - var result = new URLBuilder(); - result.set(text, "SCHEME_OR_HOST"); - return result; - }; - return URLBuilder; -}()); -var URLToken = /** @class */ (function () { - function URLToken(text, type) { - this.text = text; - this.type = type; - } - URLToken.scheme = function (text) { - return new URLToken(text, "SCHEME"); - }; - URLToken.host = function (text) { - return new URLToken(text, "HOST"); - }; - URLToken.port = function (text) { - return new URLToken(text, "PORT"); - }; - URLToken.path = function (text) { - return new URLToken(text, "PATH"); - }; - URLToken.query = function (text) { - return new URLToken(text, "QUERY"); - }; - return URLToken; -}()); -/** - * Get whether or not the provided character (single character string) is an alphanumeric (letter or - * digit) character. - */ -function isAlphaNumericCharacter(character) { - var characterCode = character.charCodeAt(0); - return ((48 /* '0' */ <= characterCode && characterCode <= 57) /* '9' */ || - (65 /* 'A' */ <= characterCode && characterCode <= 90) /* 'Z' */ || - (97 /* 'a' */ <= characterCode && characterCode <= 122) /* 'z' */); -} -/** - * A class that tokenizes URL strings. - */ -var URLTokenizer = /** @class */ (function () { - function URLTokenizer(_text, state) { - this._text = _text; - this._textLength = _text ? _text.length : 0; - this._currentState = state !== undefined && state !== null ? state : "SCHEME_OR_HOST"; - this._currentIndex = 0; - } - /** - * Get the current URLToken this URLTokenizer is pointing at, or undefined if the URLTokenizer - * hasn't started or has finished tokenizing. - */ - URLTokenizer.prototype.current = function () { - return this._currentToken; - }; - /** - * Advance to the next URLToken and return whether or not a URLToken was found. - */ - URLTokenizer.prototype.next = function () { - if (!hasCurrentCharacter(this)) { - this._currentToken = undefined; - } - else { - switch (this._currentState) { - case "SCHEME": - nextScheme(this); - break; - case "SCHEME_OR_HOST": - nextSchemeOrHost(this); - break; - case "HOST": - nextHost(this); - break; - case "PORT": - nextPort(this); - break; - case "PATH": - nextPath(this); - break; - case "QUERY": - nextQuery(this); - break; - default: - throw new Error("Unrecognized URLTokenizerState: " + this._currentState); - } - } - return !!this._currentToken; - }; - return URLTokenizer; + return AbortController; }()); -/** - * Read the remaining characters from this Tokenizer's character stream. - */ -function readRemaining(tokenizer) { - var result = ""; - if (tokenizer._currentIndex < tokenizer._textLength) { - result = tokenizer._text.substring(tokenizer._currentIndex); - tokenizer._currentIndex = tokenizer._textLength; - } - return result; -} -/** - * Whether or not this URLTokenizer has a current character. - */ -function hasCurrentCharacter(tokenizer) { - return tokenizer._currentIndex < tokenizer._textLength; -} -/** - * Get the character in the text string at the current index. - */ -function getCurrentCharacter(tokenizer) { - return tokenizer._text[tokenizer._currentIndex]; -} -/** - * Advance to the character in text that is "step" characters ahead. If no step value is provided, - * then step will default to 1. - */ -function nextCharacter(tokenizer, step) { - if (hasCurrentCharacter(tokenizer)) { - if (!step) { - step = 1; - } - tokenizer._currentIndex += step; - } -} -/** - * Starting with the current character, peek "charactersToPeek" number of characters ahead in this - * Tokenizer's stream of characters. - */ -function peekCharacters(tokenizer, charactersToPeek) { - var endIndex = tokenizer._currentIndex + charactersToPeek; - if (tokenizer._textLength < endIndex) { - endIndex = tokenizer._textLength; - } - return tokenizer._text.substring(tokenizer._currentIndex, endIndex); -} -/** - * Read characters from this Tokenizer until the end of the stream or until the provided condition - * is false when provided the current character. - */ -function readWhile(tokenizer, condition) { - var result = ""; - while (hasCurrentCharacter(tokenizer)) { - var currentCharacter = getCurrentCharacter(tokenizer); - if (!condition(currentCharacter)) { - break; - } - else { - result += currentCharacter; - nextCharacter(tokenizer); - } - } - return result; -} -/** - * Read characters from this Tokenizer until a non-alphanumeric character or the end of the - * character stream is reached. - */ -function readWhileLetterOrDigit(tokenizer) { - return readWhile(tokenizer, function (character) { return isAlphaNumericCharacter(character); }); -} -/** - * Read characters from this Tokenizer until one of the provided terminating characters is read or - * the end of the character stream is reached. - */ -function readUntilCharacter(tokenizer) { - var terminatingCharacters = []; - for (var _i = 1; _i < arguments.length; _i++) { - terminatingCharacters[_i - 1] = arguments[_i]; - } - return readWhile(tokenizer, function (character) { return terminatingCharacters.indexOf(character) === -1; }); -} -function nextScheme(tokenizer) { - var scheme = readWhileLetterOrDigit(tokenizer); - tokenizer._currentToken = URLToken.scheme(scheme); - if (!hasCurrentCharacter(tokenizer)) { - tokenizer._currentState = "DONE"; - } - else { - tokenizer._currentState = "HOST"; - } -} -function nextSchemeOrHost(tokenizer) { - var schemeOrHost = readUntilCharacter(tokenizer, ":", "/", "?"); - if (!hasCurrentCharacter(tokenizer)) { - tokenizer._currentToken = URLToken.host(schemeOrHost); - tokenizer._currentState = "DONE"; - } - else if (getCurrentCharacter(tokenizer) === ":") { - if (peekCharacters(tokenizer, 3) === "://") { - tokenizer._currentToken = URLToken.scheme(schemeOrHost); - tokenizer._currentState = "HOST"; - } - else { - tokenizer._currentToken = URLToken.host(schemeOrHost); - tokenizer._currentState = "PORT"; - } - } - else { - tokenizer._currentToken = URLToken.host(schemeOrHost); - if (getCurrentCharacter(tokenizer) === "/") { - tokenizer._currentState = "PATH"; - } - else { - tokenizer._currentState = "QUERY"; - } - } -} -function nextHost(tokenizer) { - if (peekCharacters(tokenizer, 3) === "://") { - nextCharacter(tokenizer, 3); - } - var host = readUntilCharacter(tokenizer, ":", "/", "?"); - tokenizer._currentToken = URLToken.host(host); - if (!hasCurrentCharacter(tokenizer)) { - tokenizer._currentState = "DONE"; - } - else if (getCurrentCharacter(tokenizer) === ":") { - tokenizer._currentState = "PORT"; - } - else if (getCurrentCharacter(tokenizer) === "/") { - tokenizer._currentState = "PATH"; - } - else { - tokenizer._currentState = "QUERY"; - } -} -function nextPort(tokenizer) { - if (getCurrentCharacter(tokenizer) === ":") { - nextCharacter(tokenizer); - } - var port = readUntilCharacter(tokenizer, "/", "?"); - tokenizer._currentToken = URLToken.port(port); - if (!hasCurrentCharacter(tokenizer)) { - tokenizer._currentState = "DONE"; - } - else if (getCurrentCharacter(tokenizer) === "/") { - tokenizer._currentState = "PATH"; - } - else { - tokenizer._currentState = "QUERY"; - } -} -function nextPath(tokenizer) { - var path = readUntilCharacter(tokenizer, "?"); - tokenizer._currentToken = URLToken.path(path); - if (!hasCurrentCharacter(tokenizer)) { - tokenizer._currentState = "DONE"; - } - else { - tokenizer._currentState = "QUERY"; - } -} -function nextQuery(tokenizer) { - if (getCurrentCharacter(tokenizer) === "?") { - nextCharacter(tokenizer); - } - var query = readRemaining(tokenizer); - tokenizer._currentToken = URLToken.query(query); - tokenizer._currentState = "DONE"; -} -// Copyright (c) Microsoft Corporation. -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", - "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" -]; -var defaultAllowedQueryParameters = ["api-version"]; -var Sanitizer = /** @class */ (function () { - function Sanitizer(_a) { - var _b = _a === void 0 ? {} : _a, _c = _b.allowedHeaderNames, allowedHeaderNames = _c === void 0 ? [] : _c, _d = _b.allowedQueryParameters, allowedQueryParameters = _d === void 0 ? [] : _d; - allowedHeaderNames = Array.isArray(allowedHeaderNames) - ? defaultAllowedHeaderNames.concat(allowedHeaderNames) - : defaultAllowedHeaderNames; - allowedQueryParameters = Array.isArray(allowedQueryParameters) - ? defaultAllowedQueryParameters.concat(allowedQueryParameters) - : defaultAllowedQueryParameters; - this.allowedHeaderNames = new Set(allowedHeaderNames.map(function (n) { return n.toLowerCase(); })); - this.allowedQueryParameters = new Set(allowedQueryParameters.map(function (p) { return p.toLowerCase(); })); - } - Sanitizer.prototype.sanitize = function (obj) { - return JSON.stringify(obj, this.replacer.bind(this), 2); - }; - Sanitizer.prototype.replacer = function (key, value) { - // Ensure Errors include their interesting non-enumerable members - if (value instanceof Error) { - return tslib.__assign(tslib.__assign({}, value), { name: value.name, message: value.message }); - } - if (key === "_headersMap") { - return this.sanitizeHeaders(key, value); - } - else if (key === "url") { - return this.sanitizeUrl(value); - } - else if (key === "query") { - return this.sanitizeQuery(value); - } - else if (key === "body") { - // Don't log the request body - return undefined; - } - else if (key === "response") { - // Don't log response again - return undefined; - } - else if (key === "operationSpec") { - // When using sendOperationRequest, the request carries a massive - // field with the autorest spec. No need to log it. - return undefined; - } - return value; - }; - Sanitizer.prototype.sanitizeHeaders = function (_, value) { - return this.sanitizeObject(value, this.allowedHeaderNames, function (v, k) { return v[k].value; }); - }; - Sanitizer.prototype.sanitizeQuery = function (value) { - return this.sanitizeObject(value, this.allowedQueryParameters, function (v, k) { return v[k]; }); - }; - Sanitizer.prototype.sanitizeObject = function (value, allowedKeys, accessor) { - if (typeof value !== "object" || value === null) { - return value; - } - var sanitized = {}; - for (var _i = 0, _a = Object.keys(value); _i < _a.length; _i++) { - var k = _a[_i]; - if (allowedKeys.has(k.toLowerCase())) { - sanitized[k] = accessor(value, k); - } - else { - sanitized[k] = RedactedString; - } - } - return sanitized; - }; - Sanitizer.prototype.sanitizeUrl = function (value) { - if (typeof value !== "string" || value === null) { - return value; - } - var urlBuilder = URLBuilder.parse(value); - var queryString = urlBuilder.getQuery(); - if (!queryString) { - return value; - } - var query = URLQuery.parse(queryString); - for (var _i = 0, _a = query.keys(); _i < _a.length; _i++) { - var k = _a[_i]; - if (!this.allowedQueryParameters.has(k.toLowerCase())) { - query.set(k, RedactedString); - } - } - urlBuilder.setQuery(query.toString()); - return urlBuilder.toString(); - }; - return Sanitizer; -}()); +exports.AbortController = AbortController; +exports.AbortError = AbortError; +exports.AbortSignal = AbortSignal; +//# sourceMappingURL=index.js.map -// Copyright (c) Microsoft Corporation. -var errorSanitizer = new Sanitizer(); -var RestError = /** @class */ (function (_super) { - tslib.__extends(RestError, _super); - function RestError(message, code, statusCode, request, response) { - var _this = _super.call(this, message) || this; - _this.name = "RestError"; - _this.code = code; - _this.statusCode = statusCode; - _this.request = request; - _this.response = response; - Object.setPrototypeOf(_this, RestError.prototype); - return _this; - } - /** - * Logging method for util.inspect in Node - */ - RestError.prototype[custom] = function () { - return "RestError: " + this.message + " \n " + errorSanitizer.sanitize(this); - }; - RestError.REQUEST_SEND_ERROR = "REQUEST_SEND_ERROR"; - RestError.PARSE_ERROR = "PARSE_ERROR"; - return RestError; -}(Error)); -// Copyright (c) Microsoft Corporation. -var logger = logger$1.createClientLogger("core-http"); +/***/ }), -// Copyright (c) Microsoft Corporation. -var ReportTransform = /** @class */ (function (_super) { - tslib.__extends(ReportTransform, _super); - function ReportTransform(progressCallback) { - var _this = _super.call(this) || this; - _this.progressCallback = progressCallback; - _this.loadedBytes = 0; - return _this; - } - ReportTransform.prototype._transform = function (chunk, _encoding, callback) { - this.push(chunk); - this.loadedBytes += chunk.length; - this.progressCallback({ loadedBytes: this.loadedBytes }); - callback(undefined); - }; - return ReportTransform; -}(stream.Transform)); -var FetchHttpClient = /** @class */ (function () { - function FetchHttpClient() { - } - FetchHttpClient.prototype.sendRequest = function (httpRequest) { - var _a; - return tslib.__awaiter(this, void 0, void 0, function () { - var abortController$1, abortListener, formData, requestForm_1, appendFormValue, _i, _b, formKey, formValue, j, contentType, body, onUploadProgress, uploadReportStream, platformSpecificRequestInit, requestInit, operationResponse, response, headers, streaming, _c, onDownloadProgress, responseBody, downloadReportStream, length_1, error_1, fetchError, uploadStreamDone, downloadStreamDone; - var _d; - return tslib.__generator(this, function (_e) { - switch (_e.label) { - case 0: - if (!httpRequest && typeof httpRequest !== "object") { - throw new Error("'httpRequest' (WebResourceLike) cannot be null or undefined and must be of type object."); - } - abortController$1 = new abortController.AbortController(); - if (httpRequest.abortSignal) { - if (httpRequest.abortSignal.aborted) { - throw new abortController.AbortError("The operation was aborted."); - } - abortListener = function (event) { - if (event.type === "abort") { - abortController$1.abort(); - } - }; - httpRequest.abortSignal.addEventListener("abort", abortListener); - } - if (httpRequest.timeout) { - setTimeout(function () { - abortController$1.abort(); - }, httpRequest.timeout); - } - if (httpRequest.formData) { - formData = httpRequest.formData; - requestForm_1 = new FormData(); - appendFormValue = function (key, value) { - // value function probably returns a stream so we can provide a fresh stream on each retry - if (typeof value === "function") { - value = value(); - } - if (value && - Object.prototype.hasOwnProperty.call(value, "value") && - Object.prototype.hasOwnProperty.call(value, "options")) { - requestForm_1.append(key, value.value, value.options); - } - else { - requestForm_1.append(key, value); - } - }; - for (_i = 0, _b = Object.keys(formData); _i < _b.length; _i++) { - formKey = _b[_i]; - formValue = formData[formKey]; - if (Array.isArray(formValue)) { - for (j = 0; j < formValue.length; j++) { - appendFormValue(formKey, formValue[j]); - } - } - else { - appendFormValue(formKey, formValue); - } - } - httpRequest.body = requestForm_1; - httpRequest.formData = undefined; - contentType = httpRequest.headers.get("Content-Type"); - if (contentType && contentType.indexOf("multipart/form-data") !== -1) { - if (typeof requestForm_1.getBoundary === "function") { - httpRequest.headers.set("Content-Type", "multipart/form-data; boundary=" + requestForm_1.getBoundary()); - } - else { - // browser will automatically apply a suitable content-type header - httpRequest.headers.remove("Content-Type"); - } - } - } - body = httpRequest.body - ? typeof httpRequest.body === "function" - ? httpRequest.body() - : httpRequest.body - : undefined; - if (httpRequest.onUploadProgress && httpRequest.body) { - onUploadProgress = httpRequest.onUploadProgress; - uploadReportStream = new ReportTransform(onUploadProgress); - if (isReadableStream(body)) { - body.pipe(uploadReportStream); - } - else { - uploadReportStream.end(body); - } - body = uploadReportStream; - } - return [4 /*yield*/, this.prepareRequest(httpRequest)]; - case 1: - platformSpecificRequestInit = _e.sent(); - requestInit = tslib.__assign({ body: body, headers: httpRequest.headers.rawHeaders(), method: httpRequest.method, signal: abortController$1.signal, redirect: "manual" }, platformSpecificRequestInit); - _e.label = 2; - case 2: - _e.trys.push([2, 8, 9, 10]); - return [4 /*yield*/, this.fetch(httpRequest.url, requestInit)]; - case 3: - response = _e.sent(); - headers = parseHeaders(response.headers); - streaming = ((_a = httpRequest.streamResponseStatusCodes) === null || _a === void 0 ? void 0 : _a.has(response.status)) || - httpRequest.streamResponseBody; - _d = { - headers: headers, - request: httpRequest, - status: response.status, - readableStreamBody: streaming - ? response.body - : undefined - }; - if (!!streaming) return [3 /*break*/, 5]; - return [4 /*yield*/, response.text()]; - case 4: - _c = _e.sent(); - return [3 /*break*/, 6]; - case 5: - _c = undefined; - _e.label = 6; - case 6: - operationResponse = (_d.bodyAsText = _c, - _d); - onDownloadProgress = httpRequest.onDownloadProgress; - if (onDownloadProgress) { - responseBody = response.body || undefined; - if (isReadableStream(responseBody)) { - downloadReportStream = new ReportTransform(onDownloadProgress); - responseBody.pipe(downloadReportStream); - operationResponse.readableStreamBody = downloadReportStream; - } - else { - length_1 = parseInt(headers.get("Content-Length")) || undefined; - if (length_1) { - // Calling callback for non-stream response for consistency with browser - onDownloadProgress({ loadedBytes: length_1 }); - } - } - } - return [4 /*yield*/, this.processRequest(operationResponse)]; - case 7: - _e.sent(); - return [2 /*return*/, operationResponse]; - case 8: - error_1 = _e.sent(); - fetchError = error_1; - if (fetchError.code === "ENOTFOUND") { - throw new RestError(fetchError.message, RestError.REQUEST_SEND_ERROR, undefined, httpRequest); - } - else if (fetchError.type === "aborted") { - throw new abortController.AbortError("The operation was aborted."); - } - throw fetchError; - case 9: - // clean up event listener - if (httpRequest.abortSignal && abortListener) { - uploadStreamDone = Promise.resolve(); - if (isReadableStream(body)) { - uploadStreamDone = isStreamComplete(body); - } - downloadStreamDone = Promise.resolve(); - if (isReadableStream(operationResponse === null || operationResponse === void 0 ? void 0 : operationResponse.readableStreamBody)) { - downloadStreamDone = isStreamComplete(operationResponse.readableStreamBody); - } - Promise.all([uploadStreamDone, downloadStreamDone]) - .then(function () { - var _a; - (_a = httpRequest.abortSignal) === null || _a === void 0 ? void 0 : _a.removeEventListener("abort", abortListener); - return; - }) - .catch(function (e) { - logger.warning("Error when cleaning up abortListener on httpRequest", e); - }); - } - return [7 /*endfinally*/]; - case 10: return [2 /*return*/]; - } - }); - }); - }; - return FetchHttpClient; -}()); -function isReadableStream(body) { - return body && typeof body.pipe === "function"; -} -function isStreamComplete(stream) { - return new Promise(function (resolve) { - stream.on("close", resolve); - stream.on("end", resolve); - stream.on("error", resolve); - }); -} -function parseHeaders(headers) { - var httpHeaders = new HttpHeaders(); - headers.forEach(function (value, key) { - httpHeaders.set(key, value); - }); - return httpHeaders; -} +/***/ 9268: +/***/ ((module) => { + +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ +/* global global, define, System, Reflect, Promise */ +var __extends; +var __assign; +var __rest; +var __decorate; +var __param; +var __metadata; +var __awaiter; +var __generator; +var __exportStar; +var __values; +var __read; +var __spread; +var __spreadArrays; +var __spreadArray; +var __await; +var __asyncGenerator; +var __asyncDelegator; +var __asyncValues; +var __makeTemplateObject; +var __importStar; +var __importDefault; +var __classPrivateFieldGet; +var __classPrivateFieldSet; +var __createBinding; +(function (factory) { + var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; + if (typeof define === "function" && define.amd) { + define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); }); + } + else if ( true && typeof module.exports === "object") { + factory(createExporter(root, createExporter(module.exports))); + } + else { + factory(createExporter(root)); + } + function createExporter(exports, previous) { + if (exports !== root) { + if (typeof Object.create === "function") { + Object.defineProperty(exports, "__esModule", { value: true }); + } + else { + exports.__esModule = true; + } + } + return function (id, v) { return exports[id] = previous ? previous(id, v) : v; }; + } +}) +(function (exporter) { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + + __extends = function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + + __assign = Object.assign || function (t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + }; + + __rest = function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; + }; + + __decorate = function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + + __param = function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } + }; + + __metadata = function (metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); + }; + + __awaiter = function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + + __generator = function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } + }; + + __exportStar = function(m, o) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); + }; + + __createBinding = Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); + }) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); + + __values = function (o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) return m.call(o); + if (o && typeof o.length === "number") return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); + }; + + __read = function (o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; + }; + + /** @deprecated */ + __spread = function () { + for (var ar = [], i = 0; i < arguments.length; i++) + ar = ar.concat(__read(arguments[i])); + return ar; + }; + + /** @deprecated */ + __spreadArrays = function () { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; + }; + + __spreadArray = function (to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || from); + }; + + __await = function (v) { + return this instanceof __await ? (this.v = v, this) : new __await(v); + }; + + __asyncGenerator = function (thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } + }; + + __asyncDelegator = function (o) { + var i, p; + return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; + function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } + }; + + __asyncValues = function (o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } + }; + + __makeTemplateObject = function (cooked, raw) { + if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } + return cooked; + }; + + var __setModuleDefault = Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + }) : function(o, v) { + o["default"] = v; + }; + + __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)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; + }; + + __importDefault = function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; + }; + + __classPrivateFieldGet = function (receiver, state, kind, f) { + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); + }; + + __classPrivateFieldSet = function (receiver, state, value, kind, f) { + if (kind === "m") throw new TypeError("Private method is not writable"); + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; + }; + + exporter("__extends", __extends); + exporter("__assign", __assign); + exporter("__rest", __rest); + exporter("__decorate", __decorate); + exporter("__param", __param); + exporter("__metadata", __metadata); + exporter("__awaiter", __awaiter); + exporter("__generator", __generator); + exporter("__exportStar", __exportStar); + exporter("__createBinding", __createBinding); + exporter("__values", __values); + exporter("__read", __read); + exporter("__spread", __spread); + exporter("__spreadArrays", __spreadArrays); + exporter("__spreadArray", __spreadArray); + exporter("__await", __await); + exporter("__asyncGenerator", __asyncGenerator); + exporter("__asyncDelegator", __asyncDelegator); + exporter("__asyncValues", __asyncValues); + exporter("__makeTemplateObject", __makeTemplateObject); + exporter("__importStar", __importStar); + exporter("__importDefault", __importDefault); + exporter("__classPrivateFieldGet", __classPrivateFieldGet); + exporter("__classPrivateFieldSet", __classPrivateFieldSet); +}); -// Copyright (c) Microsoft Corporation. -function createProxyAgent(requestUrl, proxySettings, headers) { - var host = URLBuilder.parse(proxySettings.host).getHost(); - if (!host) { - throw new Error("Expecting a non-empty host in proxy settings."); - } - if (!isValidPort(proxySettings.port)) { - throw new Error("Expecting a valid port number in the range of [0, 65535] in proxy settings."); - } - var tunnelOptions = { - proxy: { - host: host, - port: proxySettings.port, - headers: (headers && headers.rawHeaders()) || {} - } - }; - if (proxySettings.username && proxySettings.password) { - tunnelOptions.proxy.proxyAuth = proxySettings.username + ":" + proxySettings.password; - } - var isRequestHttps = isUrlHttps(requestUrl); - var isProxyHttps = isUrlHttps(proxySettings.host); - var proxyAgent = { - isHttps: isRequestHttps, - agent: createTunnel(isRequestHttps, isProxyHttps, tunnelOptions) - }; - return proxyAgent; -} -function isUrlHttps(url) { - var urlScheme = URLBuilder.parse(url).getScheme() || ""; - return urlScheme.toLowerCase() === "https"; -} -function createTunnel(isRequestHttps, isProxyHttps, tunnelOptions) { - if (isRequestHttps && isProxyHttps) { - return tunnel.httpsOverHttps(tunnelOptions); - } - else if (isRequestHttps && !isProxyHttps) { - return tunnel.httpsOverHttp(tunnelOptions); - } - else if (!isRequestHttps && isProxyHttps) { - return tunnel.httpOverHttps(tunnelOptions); - } - else { - return tunnel.httpOverHttp(tunnelOptions); - } -} -function isValidPort(port) { - // any port in 0-65535 range is valid (RFC 793) even though almost all implementations - // will reserve 0 for a specific purpose, and a range of numbers for ephemeral ports - return 0 <= port && port <= 65535; -} -// Copyright (c) Microsoft Corporation. -function getCachedAgent(isHttps, agentCache) { - return isHttps ? agentCache.httpsAgent : agentCache.httpAgent; -} -var NodeFetchHttpClient = /** @class */ (function (_super) { - tslib.__extends(NodeFetchHttpClient, _super); - function NodeFetchHttpClient() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.proxyAgents = {}; - _this.keepAliveAgents = {}; - _this.cookieJar = new tough.CookieJar(undefined, { looseMode: true }); - return _this; - } - NodeFetchHttpClient.prototype.getOrCreateAgent = function (httpRequest) { - var isHttps = isUrlHttps(httpRequest.url); - // At the moment, proxy settings and keepAlive are mutually - // exclusive because the 'tunnel' library currently lacks the - // ability to create a proxy with keepAlive turned on. - if (httpRequest.proxySettings) { - var agent = getCachedAgent(isHttps, this.proxyAgents); - if (agent) { - return agent; - } - var tunnel = createProxyAgent(httpRequest.url, httpRequest.proxySettings, httpRequest.headers); - agent = tunnel.agent; - if (tunnel.isHttps) { - this.proxyAgents.httpsAgent = tunnel.agent; - } - else { - this.proxyAgents.httpAgent = tunnel.agent; - } - return agent; - } - else if (httpRequest.keepAlive) { - var agent = getCachedAgent(isHttps, this.keepAliveAgents); - if (agent) { - return agent; - } - var agentOptions = { - keepAlive: httpRequest.keepAlive - }; - if (isHttps) { - agent = this.keepAliveAgents.httpsAgent = new https.Agent(agentOptions); - } - else { - agent = this.keepAliveAgents.httpAgent = new http.Agent(agentOptions); - } - return agent; - } - else { - return isHttps ? https.globalAgent : http.globalAgent; - } - }; - // eslint-disable-next-line @azure/azure-sdk/ts-apisurface-standardized-verbs - NodeFetchHttpClient.prototype.fetch = function (input, init) { - return tslib.__awaiter(this, void 0, void 0, function () { - return tslib.__generator(this, function (_a) { - return [2 /*return*/, node_fetch(input, init)]; - }); - }); - }; - NodeFetchHttpClient.prototype.prepareRequest = function (httpRequest) { - return tslib.__awaiter(this, void 0, void 0, function () { - var requestInit, cookieString; - var _this = this; - return tslib.__generator(this, function (_a) { - switch (_a.label) { - case 0: - requestInit = {}; - if (!(this.cookieJar && !httpRequest.headers.get("Cookie"))) return [3 /*break*/, 2]; - return [4 /*yield*/, new Promise(function (resolve, reject) { - _this.cookieJar.getCookieString(httpRequest.url, function (err, cookie) { - if (err) { - reject(err); - } - else { - resolve(cookie); - } - }); - })]; - case 1: - cookieString = _a.sent(); - httpRequest.headers.set("Cookie", cookieString); - _a.label = 2; - case 2: - // Set the http(s) agent - requestInit.agent = this.getOrCreateAgent(httpRequest); - requestInit.compress = httpRequest.decompressResponse; - return [2 /*return*/, requestInit]; - } - }); - }); - }; - NodeFetchHttpClient.prototype.processRequest = function (operationResponse) { - return tslib.__awaiter(this, void 0, void 0, function () { - var setCookieHeader_1; - var _this = this; - return tslib.__generator(this, function (_a) { - switch (_a.label) { - case 0: - if (!this.cookieJar) return [3 /*break*/, 2]; - setCookieHeader_1 = operationResponse.headers.get("Set-Cookie"); - if (!(setCookieHeader_1 !== undefined)) return [3 /*break*/, 2]; - return [4 /*yield*/, new Promise(function (resolve, reject) { - _this.cookieJar.setCookie(setCookieHeader_1, operationResponse.request.url, { ignoreError: true }, function (err) { - if (err) { - reject(err); - } - else { - resolve(); - } - }); - })]; - case 1: - _a.sent(); - _a.label = 2; - case 2: return [2 /*return*/]; - } - }); - }); - }; - return NodeFetchHttpClient; -}(FetchHttpClient)); +/***/ }), -// Copyright (c) Microsoft Corporation. -(function (HttpPipelineLogLevel) { - /** - * A log level that indicates that no logs will be logged. - */ - HttpPipelineLogLevel[HttpPipelineLogLevel["OFF"] = 0] = "OFF"; - /** - * An error log. - */ - HttpPipelineLogLevel[HttpPipelineLogLevel["ERROR"] = 1] = "ERROR"; - /** - * A warning log. - */ - HttpPipelineLogLevel[HttpPipelineLogLevel["WARNING"] = 2] = "WARNING"; - /** - * An information log. - */ - HttpPipelineLogLevel[HttpPipelineLogLevel["INFO"] = 3] = "INFO"; -})(exports.HttpPipelineLogLevel || (exports.HttpPipelineLogLevel = {})); +/***/ 6821: +/***/ (() => { -/** - * Converts an OperationOptions to a RequestOptionsBase - * - * @param opts - OperationOptions object to convert to RequestOptionsBase - */ -function operationOptionsToRequestOptionsBase(opts) { - var requestOptions = opts.requestOptions, tracingOptions = opts.tracingOptions, additionalOptions = tslib.__rest(opts, ["requestOptions", "tracingOptions"]); - var result = additionalOptions; - if (requestOptions) { - result = tslib.__assign(tslib.__assign({}, result), requestOptions); - } - if (tracingOptions) { - result.spanOptions = tracingOptions.spanOptions; - result.tracingContext = tracingOptions.tracingContext; - } - return result; +"use strict"; + +if (typeof Symbol === undefined || !Symbol.asyncIterator) { + Symbol.asyncIterator = Symbol.for("Symbol.asyncIterator"); } +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 9645: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ value: true })); // Copyright (c) Microsoft Corporation. -var BaseRequestPolicy = /** @class */ (function () { - function BaseRequestPolicy(_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. - */ - BaseRequestPolicy.prototype.shouldLog = function (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. - */ - BaseRequestPolicy.prototype.log = function (logLevel, message) { - this._options.log(logLevel, message); - }; - return BaseRequestPolicy; -}()); +// Licensed under the MIT license. /** - * Optional properties that can be used when creating a RequestPolicy. + * A static-key-based credential that supports updating + * the underlying key value. */ -var RequestPolicyOptions = /** @class */ (function () { - function RequestPolicyOptions(_logger) { - this._logger = _logger; - } - /** - * 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. - */ - RequestPolicyOptions.prototype.shouldLog = function (logLevel) { - return (!!this._logger && - logLevel !== exports.HttpPipelineLogLevel.OFF && - logLevel <= this._logger.minimumLogLevel); - }; +var AzureKeyCredential = /** @class */ (function () { /** - * Attempt to log the provided message to the provided logger. If no logger was provided or if - * the log level does not meet the logger's threshold, then nothing will be logged. - * @param logLevel - The log level of this log. - * @param message - The message of this log. - */ - RequestPolicyOptions.prototype.log = function (logLevel, message) { - if (this._logger && this.shouldLog(logLevel)) { - this._logger.log(logLevel, message); - } - }; - return RequestPolicyOptions; -}()); - -// Copyright (c) Microsoft Corporation. -function logPolicy(loggingOptions) { - if (loggingOptions === void 0) { loggingOptions = {}; } - return { - create: function (nextPolicy, options) { - return new LogPolicy(nextPolicy, options, loggingOptions); - } - }; -} -var LogPolicy = /** @class */ (function (_super) { - tslib.__extends(LogPolicy, _super); - function LogPolicy(nextPolicy, options, _a) { - var _b = _a === void 0 ? {} : _a, _c = _b.logger, logger$1 = _c === void 0 ? logger.info : _c, _d = _b.allowedHeaderNames, allowedHeaderNames = _d === void 0 ? [] : _d, _e = _b.allowedQueryParameters, allowedQueryParameters = _e === void 0 ? [] : _e; - var _this = _super.call(this, nextPolicy, options) || this; - _this.logger = logger$1; - _this.sanitizer = new Sanitizer({ allowedHeaderNames: allowedHeaderNames, allowedQueryParameters: allowedQueryParameters }); - return _this; - } - Object.defineProperty(LogPolicy.prototype, "allowedHeaderNames", { - /** - * Header names whose values will be logged when logging is enabled. Defaults to - * Date, traceparent, x-ms-client-request-id, and x-ms-request id. Any headers - * specified in this field will be added to that list. Any other values will - * be written to logs as "REDACTED". - * @deprecated Pass these into the constructor instead. - */ - get: function () { - return this.sanitizer.allowedHeaderNames; - }, - /** - * Header names whose values will be logged when logging is enabled. Defaults to - * Date, traceparent, x-ms-client-request-id, and x-ms-request id. Any headers - * specified in this field will be added to that list. Any other values will - * be written to logs as "REDACTED". - * @deprecated Pass these into the constructor instead. - */ - set: function (allowedHeaderNames) { - this.sanitizer.allowedHeaderNames = allowedHeaderNames; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(LogPolicy.prototype, "allowedQueryParameters", { + * Create an instance of an AzureKeyCredential for use + * with a service client. + * + * @param key - The initial value of the key to use in authentication + */ + function AzureKeyCredential(key) { + if (!key) { + throw new Error("key must be a non-empty string"); + } + this._key = key; + } + Object.defineProperty(AzureKeyCredential.prototype, "key", { /** - * Query string names whose values will be logged when logging is enabled. By default no - * query string values are logged. - * @deprecated Pass these into the constructor instead. + * The value of the key to be used in authentication */ get: function () { - return this.sanitizer.allowedQueryParameters; - }, - /** - * Query string names whose values will be logged when logging is enabled. By default no - * query string values are logged. - * @deprecated Pass these into the constructor instead. - */ - set: function (allowedQueryParameters) { - this.sanitizer.allowedQueryParameters = allowedQueryParameters; + return this._key; }, enumerable: false, configurable: true }); - LogPolicy.prototype.sendRequest = function (request) { - var _this = this; - if (!this.logger.enabled) - return this._nextPolicy.sendRequest(request); - this.logRequest(request); - return this._nextPolicy.sendRequest(request).then(function (response) { return _this.logResponse(response); }); - }; - LogPolicy.prototype.logRequest = function (request) { - this.logger("Request: " + this.sanitizer.sanitize(request)); - }; - LogPolicy.prototype.logResponse = function (response) { - this.logger("Response status code: " + response.status); - this.logger("Headers: " + this.sanitizer.sanitize(response.headers)); - return response; + /** + * Change the value of the key. + * + * Updates will take effect upon the next request after + * updating the key value. + * + * @param newKey - The new key value to be used + */ + AzureKeyCredential.prototype.update = function (newKey) { + this._key = newKey; }; - return LogPolicy; -}(BaseRequestPolicy)); + return AzureKeyCredential; +}()); // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. /** - * Get the path to this parameter's value as a dotted string (a.b.c). - * @param parameter - The parameter to get the path string for. - * @returns The path to this parameter's value as a dotted string. + * Helper TypeGuard that checks if something is defined or not. + * @param thing - Anything + * @internal */ -function getPathStringFromParameter(parameter) { - return getPathStringFromParameterPath(parameter.parameterPath, parameter.mapper); -} -function getPathStringFromParameterPath(parameterPath, mapper) { - var result; - if (typeof parameterPath === "string") { - result = parameterPath; - } - else if (Array.isArray(parameterPath)) { - result = parameterPath.join("."); - } - else { - result = mapper.serializedName; - } - return result; +function isDefined(thing) { + return typeof thing !== "undefined" && thing !== null; } - -// Copyright (c) Microsoft Corporation. /** - * Gets the list of status codes for streaming responses. + * Helper TypeGuard that checks if the input is an object with the specified properties. + * Note: The properties may be inherited. + * @param thing - Anything. + * @param properties - The name of the properties that should appear in the object. * @internal */ -function getStreamResponseStatusCodes(operationSpec) { - var result = new Set(); - for (var statusCode in operationSpec.responses) { - var operationResponse = operationSpec.responses[statusCode]; - if (operationResponse.bodyMapper && - operationResponse.bodyMapper.type.name === MapperType.Stream) { - result.add(Number(statusCode)); +function isObjectWithProperties(thing, properties) { + if (!isDefined(thing) || typeof thing !== "object") { + return false; + } + for (var _i = 0, properties_1 = properties; _i < properties_1.length; _i++) { + var property = properties_1[_i]; + if (!objectHasProperty(thing, property)) { + return false; } } - return result; -} - -// Copyright (c) Microsoft Corporation. -// Note: The reason we re-define all of the xml2js default settings (version 2.0) here is because the default settings object exposed -// by the xm2js library is mutable. See https://github.com/Leonidas-from-XIV/node-xml2js/issues/536 -// By creating a new copy of the settings each time we instantiate the parser, -// we are safeguarding against the possibility of the default settings being mutated elsewhere unintentionally. -var xml2jsDefaultOptionsV2 = { - explicitCharkey: false, - trim: false, - normalize: false, - normalizeTags: false, - attrkey: XML_ATTRKEY, - explicitArray: true, - ignoreAttrs: false, - mergeAttrs: false, - explicitRoot: true, - validator: undefined, - xmlns: false, - explicitChildren: false, - preserveChildrenOrder: false, - childkey: "$$", - charsAsChildren: false, - includeWhiteChars: false, - async: false, - strict: true, - attrNameProcessors: undefined, - attrValueProcessors: undefined, - tagNameProcessors: undefined, - valueProcessors: undefined, - rootName: "root", - xmldec: { - version: "1.0", - encoding: "UTF-8", - standalone: true - }, - doctype: undefined, - renderOpts: { - pretty: true, - indent: " ", - newline: "\n" - }, - headless: false, - chunkSize: 10000, - emptyTag: "", - cdata: false -}; -// The xml2js settings for general XML parsing operations. -var xml2jsParserSettings = Object.assign({}, xml2jsDefaultOptionsV2); -xml2jsParserSettings.explicitArray = false; -// The xml2js settings for general XML building operations. -var xml2jsBuilderSettings = Object.assign({}, xml2jsDefaultOptionsV2); -xml2jsBuilderSettings.explicitArray = false; -xml2jsBuilderSettings.renderOpts = { - pretty: false -}; -/** - * Converts given JSON object to XML string - * @param obj - JSON object to be converted into XML string - * @param opts - Options that govern the parsing of given JSON object - */ -function stringifyXML(obj, opts) { - var _a; - if (opts === void 0) { opts = {}; } - xml2jsBuilderSettings.rootName = opts.rootName; - xml2jsBuilderSettings.charkey = (_a = opts.xmlCharKey) !== null && _a !== void 0 ? _a : XML_CHARKEY; - var builder = new xml2js.Builder(xml2jsBuilderSettings); - return builder.buildObject(obj); + return true; } /** - * Converts given XML string into JSON - * @param str - String containing the XML content to be parsed into JSON - * @param opts - Options that govern the parsing of given xml string + * Helper TypeGuard that checks if the input is an object with the specified property. + * Note: The property may be inherited. + * @param thing - Any object. + * @param property - The name of the property that should appear in the object. + * @internal */ -function parseXML(str, opts) { - var _a; - if (opts === void 0) { opts = {}; } - xml2jsParserSettings.explicitRoot = !!opts.includeRoot; - xml2jsParserSettings.charkey = (_a = opts.xmlCharKey) !== null && _a !== void 0 ? _a : XML_CHARKEY; - var xmlParser = new xml2js.Parser(xml2jsParserSettings); - return new Promise(function (resolve, reject) { - if (!str) { - reject(new Error("Document is empty")); - } - else { - xmlParser.parseString(str, function (err, res) { - if (err) { - reject(err); - } - else { - resolve(res); - } - }); - } - }); +function objectHasProperty(thing, property) { + return typeof thing === "object" && property in thing; } // Copyright (c) Microsoft Corporation. /** - * Create a new serialization RequestPolicyCreator that will serialized HTTP request bodies as they - * pass through the HTTP pipeline. + * A static name/key-based credential that supports updating + * the underlying name and key values. */ -function deserializationPolicy(deserializationContentTypes, parsingOptions) { - return { - create: function (nextPolicy, options) { - return new DeserializationPolicy(nextPolicy, options, deserializationContentTypes, parsingOptions); +var AzureNamedKeyCredential = /** @class */ (function () { + /** + * Create an instance of an AzureNamedKeyCredential for use + * with a service client. + * + * @param name - The initial value of the name to use in authentication. + * @param key - The initial value of the key to use in authentication. + */ + function AzureNamedKeyCredential(name, key) { + if (!name || !key) { + throw new TypeError("name and key must be non-empty strings"); + } + this._name = name; + this._key = key; + } + Object.defineProperty(AzureNamedKeyCredential.prototype, "key", { + /** + * The value of the key to be used in authentication. + */ + get: function () { + return this._key; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(AzureNamedKeyCredential.prototype, "name", { + /** + * The value of the name to be used in authentication. + */ + get: function () { + return this._name; + }, + enumerable: false, + configurable: true + }); + /** + * Change the value of the key. + * + * Updates will take effect upon the next request after + * updating the key value. + * + * @param newName - The new name value to be used. + * @param newKey - The new key value to be used. + */ + AzureNamedKeyCredential.prototype.update = function (newName, newKey) { + if (!newName || !newKey) { + throw new TypeError("newName and newKey must be non-empty strings"); } + this._name = newName; + this._key = newKey; }; + return AzureNamedKeyCredential; +}()); +/** + * Tests an object to determine whether it implements NamedKeyCredential. + * + * @param credential - The assumed NamedKeyCredential to be tested. + */ +function isNamedKeyCredential(credential) { + return (isObjectWithProperties(credential, ["name", "key"]) && + typeof credential.key === "string" && + typeof credential.name === "string"); } -var defaultJsonContentTypes = ["application/json", "text/json"]; -var defaultXmlContentTypes = ["application/xml", "application/atom+xml"]; -var DefaultDeserializationOptions = { - expectedContentTypes: { - json: defaultJsonContentTypes, - xml: defaultXmlContentTypes - } -}; + +// Copyright (c) Microsoft Corporation. /** - * A RequestPolicy that will deserialize HTTP response bodies and headers as they pass through the - * HTTP pipeline. + * A static-signature-based credential that supports updating + * the underlying signature value. */ -var DeserializationPolicy = /** @class */ (function (_super) { - tslib.__extends(DeserializationPolicy, _super); - function DeserializationPolicy(nextPolicy, requestPolicyOptions, deserializationContentTypes, parsingOptions) { - if (parsingOptions === void 0) { parsingOptions = {}; } - var _a; - var _this = _super.call(this, nextPolicy, requestPolicyOptions) || this; - _this.jsonContentTypes = - (deserializationContentTypes && deserializationContentTypes.json) || defaultJsonContentTypes; - _this.xmlContentTypes = - (deserializationContentTypes && deserializationContentTypes.xml) || defaultXmlContentTypes; - _this.xmlCharKey = (_a = parsingOptions.xmlCharKey) !== null && _a !== void 0 ? _a : XML_CHARKEY; - return _this; - } - DeserializationPolicy.prototype.sendRequest = function (request) { - return tslib.__awaiter(this, void 0, void 0, function () { - var _this = this; - return tslib.__generator(this, function (_a) { - return [2 /*return*/, this._nextPolicy.sendRequest(request).then(function (response) { - return deserializeResponseBody(_this.jsonContentTypes, _this.xmlContentTypes, response, { - xmlCharKey: _this.xmlCharKey - }); - })]; - }); - }); - }; - return DeserializationPolicy; -}(BaseRequestPolicy)); -function getOperationResponse(parsedResponse) { - var result; - var request = parsedResponse.request; - var operationSpec = request.operationSpec; - if (operationSpec) { - var operationResponseGetter = request.operationResponseGetter; - if (!operationResponseGetter) { - result = operationSpec.responses[parsedResponse.status]; - } - else { - result = operationResponseGetter(operationSpec, parsedResponse); +var AzureSASCredential = /** @class */ (function () { + /** + * Create an instance of an AzureSASCredential for use + * with a service client. + * + * @param signature - The initial value of the shared access signature to use in authentication + */ + function AzureSASCredential(signature) { + if (!signature) { + throw new Error("shared access signature must be a non-empty string"); } + this._signature = signature; } - return result; -} -function shouldDeserializeResponse(parsedResponse) { - var shouldDeserialize = parsedResponse.request.shouldDeserialize; - var result; - if (shouldDeserialize === undefined) { - result = true; - } - else if (typeof shouldDeserialize === "boolean") { - result = shouldDeserialize; - } - else { - result = shouldDeserialize(parsedResponse); - } - return result; -} -function deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, options) { - var _a, _b, _c; - if (options === void 0) { options = {}; } - var updatedOptions = { - rootName: (_a = options.rootName) !== null && _a !== void 0 ? _a : "", - includeRoot: (_b = options.includeRoot) !== null && _b !== void 0 ? _b : false, - xmlCharKey: (_c = options.xmlCharKey) !== null && _c !== void 0 ? _c : XML_CHARKEY - }; - return parse(jsonContentTypes, xmlContentTypes, response, updatedOptions).then(function (parsedResponse) { - if (!shouldDeserializeResponse(parsedResponse)) { - return parsedResponse; - } - var operationSpec = parsedResponse.request.operationSpec; - if (!operationSpec || !operationSpec.responses) { - return parsedResponse; - } - var responseSpec = getOperationResponse(parsedResponse); - var _a = handleErrorResponse(parsedResponse, operationSpec, responseSpec), error = _a.error, shouldReturnResponse = _a.shouldReturnResponse; - if (error) { - throw error; - } - else if (shouldReturnResponse) { - return parsedResponse; - } - // An operation response spec does exist for current status code, so - // use it to deserialize the response. - if (responseSpec) { - if (responseSpec.bodyMapper) { - var valueToDeserialize = parsedResponse.parsedBody; - if (operationSpec.isXML && responseSpec.bodyMapper.type.name === MapperType.Sequence) { - valueToDeserialize = - typeof valueToDeserialize === "object" - ? valueToDeserialize[responseSpec.bodyMapper.xmlElementName] - : []; - } - try { - parsedResponse.parsedBody = operationSpec.serializer.deserialize(responseSpec.bodyMapper, valueToDeserialize, "operationRes.parsedBody", options); - } - catch (innerError) { - var restError = new RestError("Error " + innerError + " occurred in deserializing the responseBody - " + parsedResponse.bodyAsText, undefined, parsedResponse.status, parsedResponse.request, parsedResponse); - throw restError; - } - } - else if (operationSpec.httpMethod === "HEAD") { - // head methods never have a body, but we return a boolean to indicate presence/absence of the resource - parsedResponse.parsedBody = response.status >= 200 && response.status < 300; - } - if (responseSpec.headersMapper) { - parsedResponse.parsedHeaders = operationSpec.serializer.deserialize(responseSpec.headersMapper, parsedResponse.headers.rawHeaders(), "operationRes.parsedHeaders", options); - } - } - return parsedResponse; + Object.defineProperty(AzureSASCredential.prototype, "signature", { + /** + * The value of the shared access signature to be used in authentication + */ + get: function () { + return this._signature; + }, + enumerable: false, + configurable: true }); -} -function isOperationSpecEmpty(operationSpec) { - var expectedStatusCodes = Object.keys(operationSpec.responses); - return (expectedStatusCodes.length === 0 || - (expectedStatusCodes.length === 1 && expectedStatusCodes[0] === "default")); -} -function handleErrorResponse(parsedResponse, operationSpec, responseSpec) { - var _a; - var isSuccessByStatus = 200 <= parsedResponse.status && parsedResponse.status < 300; - var isExpectedStatusCode = isOperationSpecEmpty(operationSpec) - ? isSuccessByStatus - : !!responseSpec; - if (isExpectedStatusCode) { - if (responseSpec) { - if (!responseSpec.isError) { - return { error: null, shouldReturnResponse: false }; - } - } - else { - return { error: null, shouldReturnResponse: false }; - } - } - var errorResponseSpec = responseSpec !== null && responseSpec !== void 0 ? responseSpec : operationSpec.responses.default; - var streaming = ((_a = parsedResponse.request.streamResponseStatusCodes) === null || _a === void 0 ? void 0 : _a.has(parsedResponse.status)) || - parsedResponse.request.streamResponseBody; - var initialErrorMessage = streaming - ? "Unexpected status code: " + parsedResponse.status - : parsedResponse.bodyAsText; - var error = new RestError(initialErrorMessage, undefined, parsedResponse.status, parsedResponse.request, parsedResponse); - // If the item failed but there's no error spec or default spec to deserialize the error, - // we should fail so we just throw the parsed response - if (!errorResponseSpec) { - throw error; - } - var defaultBodyMapper = errorResponseSpec.bodyMapper; - var defaultHeadersMapper = errorResponseSpec.headersMapper; - try { - // If error response has a body, try to deserialize it using default body mapper. - // Then try to extract error code & message from it - if (parsedResponse.parsedBody) { - var parsedBody = parsedResponse.parsedBody; - var parsedError = void 0; - if (defaultBodyMapper) { - var valueToDeserialize = parsedBody; - if (operationSpec.isXML && defaultBodyMapper.type.name === MapperType.Sequence) { - valueToDeserialize = - typeof parsedBody === "object" ? parsedBody[defaultBodyMapper.xmlElementName] : []; - } - parsedError = operationSpec.serializer.deserialize(defaultBodyMapper, valueToDeserialize, "error.response.parsedBody"); - } - var internalError = parsedBody.error || parsedError || parsedBody; - error.code = internalError.code; - if (internalError.message) { - error.message = internalError.message; - } - if (defaultBodyMapper) { - error.response.parsedBody = parsedError; - } - } - // If error response has headers, try to deserialize it using default header mapper - if (parsedResponse.headers && defaultHeadersMapper) { - error.response.parsedHeaders = operationSpec.serializer.deserialize(defaultHeadersMapper, parsedResponse.headers.rawHeaders(), "operationRes.parsedHeaders"); - } - } - catch (defaultError) { - error.message = "Error \"" + defaultError.message + "\" occurred in deserializing the responseBody - \"" + parsedResponse.bodyAsText + "\" for the default response."; - } - return { error: error, shouldReturnResponse: false }; -} -function parse(jsonContentTypes, xmlContentTypes, operationResponse, opts) { - var _a; - var errorHandler = function (err) { - var msg = "Error \"" + err + "\" occurred while parsing the response body - " + operationResponse.bodyAsText + "."; - var errCode = err.code || RestError.PARSE_ERROR; - var e = new RestError(msg, errCode, operationResponse.status, operationResponse.request, operationResponse); - return Promise.reject(e); - }; - var streaming = ((_a = operationResponse.request.streamResponseStatusCodes) === null || _a === void 0 ? void 0 : _a.has(operationResponse.status)) || - operationResponse.request.streamResponseBody; - if (!streaming && operationResponse.bodyAsText) { - var text_1 = operationResponse.bodyAsText; - var contentType = operationResponse.headers.get("Content-Type") || ""; - var contentComponents = !contentType - ? [] - : contentType.split(";").map(function (component) { return component.toLowerCase(); }); - if (contentComponents.length === 0 || - contentComponents.some(function (component) { return jsonContentTypes.indexOf(component) !== -1; })) { - return new Promise(function (resolve) { - operationResponse.parsedBody = JSON.parse(text_1); - resolve(operationResponse); - }).catch(errorHandler); - } - else if (contentComponents.some(function (component) { return xmlContentTypes.indexOf(component) !== -1; })) { - return parseXML(text_1, opts) - .then(function (body) { - operationResponse.parsedBody = body; - return operationResponse; - }) - .catch(errorHandler); + /** + * Change the value of the signature. + * + * Updates will take effect upon the next request after + * updating the signature value. + * + * @param newSignature - The new shared access signature value to be used + */ + AzureSASCredential.prototype.update = function (newSignature) { + if (!newSignature) { + throw new Error("shared access signature must be a non-empty string"); } - } - return Promise.resolve(operationResponse); + this._signature = newSignature; + }; + return AzureSASCredential; +}()); +/** + * Tests an object to determine whether it implements SASCredential. + * + * @param credential - The assumed SASCredential to be tested. + */ +function isSASCredential(credential) { + return (isObjectWithProperties(credential, ["signature"]) && typeof credential.signature === "string"); } // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -var DEFAULT_CLIENT_RETRY_COUNT = 3; -// intervals are in ms -var DEFAULT_CLIENT_RETRY_INTERVAL = 1000 * 30; -var DEFAULT_CLIENT_MAX_RETRY_INTERVAL = 1000 * 90; -var DEFAULT_CLIENT_MIN_RETRY_INTERVAL = 1000 * 3; -function isNumber(n) { - return typeof n === "number"; -} /** - * @internal - * Determines if the operation should be retried. + * Tests an object to determine whether it implements TokenCredential. * - * @param retryLimit - Specifies the max number of retries. - * @param predicate - Initial chekck on whether to retry based on given responses or errors - * @param retryData - The retry data. - * @returns True if the operation qualifies for a retry; false otherwise. + * @param credential - The assumed TokenCredential to be tested. */ -function shouldRetry(retryLimit, predicate, retryData, response, error) { - if (!predicate(response, error)) { - return false; - } - return retryData.retryCount < retryLimit; +function isTokenCredential(credential) { + // Check for an object with a 'getToken' function and possibly with + // a 'signRequest' function. We do this check to make sure that + // a ServiceClientCredentials implementor (like TokenClientCredentials + // in ms-rest-nodeauth) doesn't get mistaken for a TokenCredential if + // it doesn't actually implement TokenCredential also. + var castCredential = credential; + return (castCredential && + typeof castCredential.getToken === "function" && + (castCredential.signRequest === undefined || castCredential.getToken.length > 0)); } + +exports.AzureKeyCredential = AzureKeyCredential; +exports.AzureNamedKeyCredential = AzureNamedKeyCredential; +exports.AzureSASCredential = AzureSASCredential; +exports.isNamedKeyCredential = isNamedKeyCredential; +exports.isSASCredential = isSASCredential; +exports.isTokenCredential = isTokenCredential; +//# sourceMappingURL=index.js.map + + +/***/ }), + +/***/ 4607: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } + +var tslib = __nccwpck_require__(2107); +var uuid = __nccwpck_require__(3415); +var tough = __nccwpck_require__(8165); +var http = __nccwpck_require__(8605); +var https = __nccwpck_require__(7211); +var node_fetch = _interopDefault(__nccwpck_require__(467)); +var abortController = __nccwpck_require__(2557); +var FormData = _interopDefault(__nccwpck_require__(6279)); +var util = __nccwpck_require__(1669); +var url = __nccwpck_require__(8835); +var stream = __nccwpck_require__(2413); +var logger$1 = __nccwpck_require__(3233); +var tunnel = __nccwpck_require__(4294); +var coreAuth = __nccwpck_require__(9645); +var xml2js = __nccwpck_require__(6189); +var os = __nccwpck_require__(2087); +var coreTracing = __nccwpck_require__(4175); +__nccwpck_require__(6821); + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. /** - * @internal - * Updates the retry data for the next attempt. - * - * @param retryOptions - specifies retry interval, and its lower bound and upper bound. - * @param retryData - The retry data. - * @param err - The operation"s error, if any. + * A collection of HttpHeaders that can be sent with a HTTP request. */ -function updateRetryData(retryOptions, retryData, err) { - if (retryData === void 0) { retryData = { retryCount: 0, retryInterval: 0 }; } - if (err) { - if (retryData.error) { - err.innerError = retryData.error; - } - retryData.error = err; - } - // Adjust retry count - retryData.retryCount++; - // Adjust retry interval - var incrementDelta = Math.pow(2, retryData.retryCount - 1) - 1; - var boundedRandDelta = retryOptions.retryInterval * 0.8 + - Math.floor(Math.random() * (retryOptions.retryInterval * 0.4)); - incrementDelta *= boundedRandDelta; - retryData.retryInterval = Math.min(retryOptions.minRetryInterval + incrementDelta, retryOptions.maxRetryInterval); - return retryData; +function getHeaderKey(headerName) { + return headerName.toLowerCase(); } - -// Copyright (c) Microsoft Corporation. -function exponentialRetryPolicy(retryCount, retryInterval, maxRetryInterval) { - return { - create: function (nextPolicy, options) { - return new ExponentialRetryPolicy(nextPolicy, options, retryCount, retryInterval, maxRetryInterval); +function isHttpHeadersLike(object) { + if (object && typeof object === "object") { + var castObject = object; + if (typeof castObject.rawHeaders === "function" && + typeof castObject.clone === "function" && + typeof castObject.get === "function" && + typeof castObject.set === "function" && + typeof castObject.contains === "function" && + typeof castObject.remove === "function" && + typeof castObject.headersArray === "function" && + typeof castObject.headerValues === "function" && + typeof castObject.headerNames === "function" && + typeof castObject.toJson === "function") { + return true; } - }; + } + return false; } -(function (RetryMode) { - RetryMode[RetryMode["Exponential"] = 0] = "Exponential"; -})(exports.RetryMode || (exports.RetryMode = {})); -var DefaultRetryOptions = { - maxRetries: DEFAULT_CLIENT_RETRY_COUNT, - retryDelayInMs: DEFAULT_CLIENT_RETRY_INTERVAL, - maxRetryDelayInMs: DEFAULT_CLIENT_MAX_RETRY_INTERVAL -}; /** - * Instantiates a new "ExponentialRetryPolicyFilter" instance. + * A collection of HTTP header key/value pairs. */ -var ExponentialRetryPolicy = /** @class */ (function (_super) { - tslib.__extends(ExponentialRetryPolicy, _super); - /** - * @param nextPolicy - The next RequestPolicy in the pipeline chain. - * @param options - The options for this RequestPolicy. - * @param retryCount - The client retry count. - * @param retryInterval - The client retry interval, in milliseconds. - * @param minRetryInterval - The minimum retry interval, in milliseconds. - * @param maxRetryInterval - The maximum retry interval, in milliseconds. - */ - function ExponentialRetryPolicy(nextPolicy, options, retryCount, retryInterval, maxRetryInterval) { - var _this = _super.call(this, nextPolicy, options) || this; - _this.retryCount = isNumber(retryCount) ? retryCount : DEFAULT_CLIENT_RETRY_COUNT; - _this.retryInterval = isNumber(retryInterval) ? retryInterval : DEFAULT_CLIENT_RETRY_INTERVAL; - _this.maxRetryInterval = isNumber(maxRetryInterval) - ? maxRetryInterval - : DEFAULT_CLIENT_MAX_RETRY_INTERVAL; - return _this; - } - ExponentialRetryPolicy.prototype.sendRequest = function (request) { - var _this = this; - return this._nextPolicy - .sendRequest(request.clone()) - .then(function (response) { return retry(_this, request, response); }) - .catch(function (error) { return retry(_this, request, error.response, undefined, error); }); - }; - return ExponentialRetryPolicy; -}(BaseRequestPolicy)); -function retry(policy, request, response, retryData, requestError) { - return tslib.__awaiter(this, void 0, void 0, function () { - function shouldPolicyRetry(responseParam) { - var statusCode = responseParam === null || responseParam === void 0 ? void 0 : responseParam.status; - if (statusCode === undefined || - (statusCode < 500 && statusCode !== 408) || - statusCode === 501 || - statusCode === 505) { - return false; - } - return true; - } - var isAborted, res, err_1, err; - return tslib.__generator(this, function (_a) { - switch (_a.label) { - case 0: - retryData = updateRetryData({ - retryInterval: policy.retryInterval, - minRetryInterval: 0, - maxRetryInterval: policy.maxRetryInterval - }, retryData, requestError); - isAborted = request.abortSignal && request.abortSignal.aborted; - if (!(!isAborted && shouldRetry(policy.retryCount, shouldPolicyRetry, retryData, response))) return [3 /*break*/, 6]; - logger.info("Retrying request in " + retryData.retryInterval); - _a.label = 1; - case 1: - _a.trys.push([1, 4, , 5]); - return [4 /*yield*/, delay(retryData.retryInterval)]; - case 2: - _a.sent(); - return [4 /*yield*/, policy._nextPolicy.sendRequest(request.clone())]; - case 3: - res = _a.sent(); - return [2 /*return*/, retry(policy, request, res, retryData)]; - case 4: - err_1 = _a.sent(); - return [2 /*return*/, retry(policy, request, response, retryData, err_1)]; - case 5: return [3 /*break*/, 7]; - case 6: - if (isAborted || requestError || !response) { - err = retryData.error || - new RestError("Failed to send the request.", RestError.REQUEST_SEND_ERROR, response && response.status, response && response.request, response); - throw err; - } - else { - return [2 /*return*/, response]; - } - case 7: return [2 /*return*/]; +var HttpHeaders = /** @class */ (function () { + function HttpHeaders(rawHeaders) { + this._headersMap = {}; + if (rawHeaders) { + for (var headerName in rawHeaders) { + this.set(headerName, rawHeaders[headerName]); } - }); - }); -} - -// Copyright (c) Microsoft Corporation. -function generateClientRequestIdPolicy(requestIdHeaderName) { - if (requestIdHeaderName === void 0) { requestIdHeaderName = "x-ms-client-request-id"; } - return { - create: function (nextPolicy, options) { - return new GenerateClientRequestIdPolicy(nextPolicy, options, requestIdHeaderName); } - }; -} -var GenerateClientRequestIdPolicy = /** @class */ (function (_super) { - tslib.__extends(GenerateClientRequestIdPolicy, _super); - function GenerateClientRequestIdPolicy(nextPolicy, options, _requestIdHeaderName) { - var _this = _super.call(this, nextPolicy, options) || this; - _this._requestIdHeaderName = _requestIdHeaderName; - return _this; } - GenerateClientRequestIdPolicy.prototype.sendRequest = function (request) { - if (!request.headers.contains(this._requestIdHeaderName)) { - request.headers.set(this._requestIdHeaderName, request.requestId); - } - return this._nextPolicy.sendRequest(request); + /** + * Set a header in this collection with the provided name and value. The name is + * case-insensitive. + * @param headerName - The name of the header to set. This value is case-insensitive. + * @param headerValue - The value of the header to set. + */ + HttpHeaders.prototype.set = function (headerName, headerValue) { + this._headersMap[getHeaderKey(headerName)] = { + name: headerName, + value: headerValue.toString() + }; }; - return GenerateClientRequestIdPolicy; -}(BaseRequestPolicy)); - -// Copyright (c) Microsoft Corporation. -function getDefaultUserAgentKey() { - return Constants.HeaderConstants.USER_AGENT; -} -function getPlatformSpecificData() { - var runtimeInfo = { - key: "Node", - value: process.version + /** + * Get the header value for the provided header name, or undefined if no header exists in this + * collection with the provided name. + * @param headerName - The name of the header. + */ + HttpHeaders.prototype.get = function (headerName) { + var header = this._headersMap[getHeaderKey(headerName)]; + return !header ? undefined : header.value; }; - var osInfo = { - key: "OS", - value: "(" + os.arch() + "-" + os.type() + "-" + os.release() + ")" + /** + * Get whether or not this header collection contains a header entry for the provided header name. + */ + HttpHeaders.prototype.contains = function (headerName) { + return !!this._headersMap[getHeaderKey(headerName)]; }; - return [runtimeInfo, osInfo]; -} - -// Copyright (c) Microsoft Corporation. -function getRuntimeInfo() { - var msRestRuntime = { - key: "core-http", - value: Constants.coreHttpVersion + /** + * Remove the header with the provided headerName. Return whether or not the header existed and + * was removed. + * @param headerName - The name of the header to remove. + */ + HttpHeaders.prototype.remove = function (headerName) { + var result = this.contains(headerName); + delete this._headersMap[getHeaderKey(headerName)]; + return result; }; - return [msRestRuntime]; -} -function getUserAgentString(telemetryInfo, keySeparator, valueSeparator) { - if (keySeparator === void 0) { keySeparator = " "; } - if (valueSeparator === void 0) { valueSeparator = "/"; } - return telemetryInfo - .map(function (info) { - var value = info.value ? "" + valueSeparator + info.value : ""; - return "" + info.key + value; - }) - .join(keySeparator); -} -var getDefaultUserAgentHeaderName = getDefaultUserAgentKey; -function getDefaultUserAgentValue() { - var runtimeInfo = getRuntimeInfo(); - var platformSpecificData = getPlatformSpecificData(); - var userAgent = getUserAgentString(runtimeInfo.concat(platformSpecificData)); - return userAgent; -} -function userAgentPolicy(userAgentData) { - var key = !userAgentData || userAgentData.key === undefined || userAgentData.key === null - ? getDefaultUserAgentKey() - : userAgentData.key; - var value = !userAgentData || userAgentData.value === undefined || userAgentData.value === null - ? getDefaultUserAgentValue() - : userAgentData.value; - return { - create: function (nextPolicy, options) { - return new UserAgentPolicy(nextPolicy, options, key, value); + /** + * Get the headers that are contained this collection as an object. + */ + HttpHeaders.prototype.rawHeaders = function () { + var result = {}; + for (var headerKey in this._headersMap) { + var header = this._headersMap[headerKey]; + result[header.name.toLowerCase()] = header.value; } + return result; }; -} -var UserAgentPolicy = /** @class */ (function (_super) { - tslib.__extends(UserAgentPolicy, _super); - function UserAgentPolicy(_nextPolicy, _options, headerKey, headerValue) { - var _this = _super.call(this, _nextPolicy, _options) || this; - _this._nextPolicy = _nextPolicy; - _this._options = _options; - _this.headerKey = headerKey; - _this.headerValue = headerValue; - return _this; - } - UserAgentPolicy.prototype.sendRequest = function (request) { - this.addUserAgentHeader(request); - return this._nextPolicy.sendRequest(request); + /** + * Get the headers that are contained in this collection as an array. + */ + HttpHeaders.prototype.headersArray = function () { + var headers = []; + for (var headerKey in this._headersMap) { + headers.push(this._headersMap[headerKey]); + } + return headers; }; - UserAgentPolicy.prototype.addUserAgentHeader = function (request) { - if (!request.headers) { - request.headers = new HttpHeaders(); + /** + * Get the header names that are contained in this collection. + */ + HttpHeaders.prototype.headerNames = function () { + var headerNames = []; + var headers = this.headersArray(); + for (var i = 0; i < headers.length; ++i) { + headerNames.push(headers[i].name); } - if (!request.headers.get(this.headerKey) && this.headerValue) { - request.headers.set(this.headerKey, this.headerValue); + return headerNames; + }; + /** + * Get the header values that are contained in this collection. + */ + HttpHeaders.prototype.headerValues = function () { + var headerValues = []; + var headers = this.headersArray(); + for (var i = 0; i < headers.length; ++i) { + headerValues.push(headers[i].value); } + return headerValues; }; - return UserAgentPolicy; -}(BaseRequestPolicy)); + /** + * Get the JSON object representation of this HTTP header collection. + */ + HttpHeaders.prototype.toJson = function () { + return this.rawHeaders(); + }; + /** + * Get the string representation of this HTTP header collection. + */ + HttpHeaders.prototype.toString = function () { + return JSON.stringify(this.toJson()); + }; + /** + * Create a deep clone/copy of this HttpHeaders collection. + */ + HttpHeaders.prototype.clone = function () { + return new HttpHeaders(this.rawHeaders()); + }; + return HttpHeaders; +}()); // Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. /** - * Methods that are allowed to follow redirects 301 and 302 + * Encodes a string in base64 format. + * @param value - The string to encode */ -var allowedRedirect = ["GET", "HEAD"]; -var DefaultRedirectOptions = { - handleRedirects: true, - maxRetries: 20 -}; -function redirectPolicy(maximumRetries) { - if (maximumRetries === void 0) { maximumRetries = 20; } - return { - create: function (nextPolicy, options) { - return new RedirectPolicy(nextPolicy, options, maximumRetries); - } - }; +function encodeString(value) { + return Buffer.from(value).toString("base64"); } -var RedirectPolicy = /** @class */ (function (_super) { - tslib.__extends(RedirectPolicy, _super); - function RedirectPolicy(nextPolicy, options, maxRetries) { - if (maxRetries === void 0) { maxRetries = 20; } - var _this = _super.call(this, nextPolicy, options) || this; - _this.maxRetries = maxRetries; - return _this; - } - RedirectPolicy.prototype.sendRequest = function (request) { - var _this = this; - return this._nextPolicy - .sendRequest(request) - .then(function (response) { return handleRedirect(_this, response, 0); }); - }; - return RedirectPolicy; -}(BaseRequestPolicy)); -function handleRedirect(policy, response, currentRetries) { - var request = response.request, status = response.status; - var locationHeader = response.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) && - (!policy.maxRetries || currentRetries < policy.maxRetries)) { - var builder = URLBuilder.parse(request.url); - builder.setPath(locationHeader); - request.url = builder.toString(); - // POST request with Status code 303 should be converted into a - // redirected GET request if the redirect url is present in the location header - if (status === 303) { - request.method = "GET"; - delete request.body; +/** + * Encodes a byte array in base64 format. + * @param value - The Uint8Aray to encode + */ +function encodeByteArray(value) { + // Buffer.from accepts | -- the TypeScript definition is off here + // https://nodejs.org/api/buffer.html#buffer_class_method_buffer_from_arraybuffer_byteoffset_length + var bufferValue = value instanceof Buffer ? value : Buffer.from(value.buffer); + return bufferValue.toString("base64"); +} +/** + * Decodes a base64 string into a byte array. + * @param value - The base64 string to decode + */ +function decodeString(value) { + return Buffer.from(value, "base64"); +} + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +var Constants = { + /** + * The core-http version + */ + coreHttpVersion: "1.2.6", + /** + * Specifies HTTP. + */ + HTTP: "http:", + /** + * Specifies HTTPS. + */ + HTTPS: "https:", + /** + * Specifies HTTP Proxy. + */ + HTTP_PROXY: "HTTP_PROXY", + /** + * Specifies HTTPS Proxy. + */ + HTTPS_PROXY: "HTTPS_PROXY", + /** + * Specifies NO Proxy. + */ + NO_PROXY: "NO_PROXY", + /** + * Specifies ALL Proxy. + */ + ALL_PROXY: "ALL_PROXY", + HttpConstants: { + /** + * Http Verbs + */ + HttpVerbs: { + PUT: "PUT", + GET: "GET", + DELETE: "DELETE", + POST: "POST", + MERGE: "MERGE", + HEAD: "HEAD", + PATCH: "PATCH" + }, + StatusCodes: { + TooManyRequests: 429 } - return policy._nextPolicy - .sendRequest(request) - .then(function (res) { return handleRedirect(policy, res, currentRetries + 1); }); + }, + /** + * Defines constants for use with HTTP headers. + */ + HeaderConstants: { + /** + * The Authorization header. + */ + AUTHORIZATION: "authorization", + AUTHORIZATION_SCHEME: "Bearer", + /** + * The Retry-After response-header field can be used with a 503 (Service + * Unavailable) or 349 (Too Many Requests) responses to indicate how long + * the service is expected to be unavailable to the requesting client. + */ + RETRY_AFTER: "Retry-After", + /** + * The UserAgent header. + */ + USER_AGENT: "User-Agent" } - return Promise.resolve(response); -} +}; // Copyright (c) Microsoft Corporation. -function rpRegistrationPolicy(retryTimeout) { - if (retryTimeout === void 0) { retryTimeout = 30; } - return { - create: function (nextPolicy, options) { - return new RPRegistrationPolicy(nextPolicy, options, retryTimeout); - } - }; +// Licensed under the MIT license. +/** + * Default key used to access the XML attributes. + */ +var XML_ATTRKEY = "$"; +/** + * Default key used to access the XML value content. + */ +var XML_CHARKEY = "_"; + +// Copyright (c) Microsoft Corporation. +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; +/** + * A constant that indicates whether the environment is node.js or browser based. + */ +var isNode = typeof process !== "undefined" && + !!process.version && + !!process.versions && + !!process.versions.node; +/** + * Encodes an URI. + * + * @param uri - The URI to be encoded. + * @returns The encoded URI. + */ +function encodeUri(uri) { + return encodeURIComponent(uri) + .replace(/!/g, "%21") + .replace(/"/g, "%27") + .replace(/\(/g, "%28") + .replace(/\)/g, "%29") + .replace(/\*/g, "%2A"); } -var RPRegistrationPolicy = /** @class */ (function (_super) { - tslib.__extends(RPRegistrationPolicy, _super); - function RPRegistrationPolicy(nextPolicy, options, _retryTimeout) { - if (_retryTimeout === void 0) { _retryTimeout = 30; } - var _this = _super.call(this, nextPolicy, options) || this; - _this._retryTimeout = _retryTimeout; - return _this; - } - RPRegistrationPolicy.prototype.sendRequest = function (request) { - var _this = this; - return this._nextPolicy - .sendRequest(request.clone()) - .then(function (response) { return registerIfNeeded(_this, request, response); }); - }; - return RPRegistrationPolicy; -}(BaseRequestPolicy)); -function registerIfNeeded(policy, request, response) { - if (response.status === 409) { - var rpName = checkRPNotRegisteredError(response.bodyAsText); - if (rpName) { - var urlPrefix = extractSubscriptionUrl(request.url); - return (registerRP(policy, urlPrefix, rpName, request) - // Autoregistration of ${provider} failed for some reason. We will not return this error - // instead will return the initial response with 409 status code back to the user. - // do nothing here as we are returning the original response at the end of this method. - .catch(function () { return false; }) - .then(function (registrationStatus) { - if (registrationStatus) { - // Retry the original request. We have to change the x-ms-client-request-id - // otherwise Azure endpoint will return the initial 409 (cached) response. - request.headers.set("x-ms-client-request-id", generateUuid()); - return policy._nextPolicy.sendRequest(request.clone()); - } - return response; - })); - } - } - return Promise.resolve(response); +/** + * Returns a stripped version of the Http Response which only contains body, + * headers and the status. + * + * @param response - The Http Response + * @returns The stripped version of Http Response. + */ +function stripResponse(response) { + var strippedResponse = {}; + strippedResponse.body = response.bodyAsText; + strippedResponse.headers = response.headers; + strippedResponse.status = response.status; + return strippedResponse; } /** - * Reuses the headers of the original request and url (if specified). - * @param originalRequest - The original request - * @param reuseUrlToo - Should the url from the original request be reused as well. Default false. - * @returns A new request object with desired headers. + * Returns a stripped version of the Http Request that does not contain the + * Authorization header. + * + * @param request - The Http Request object + * @returns The stripped version of Http Request. */ -function getRequestEssentials(originalRequest, reuseUrlToo) { - if (reuseUrlToo === void 0) { reuseUrlToo = false; } - var reqOptions = originalRequest.clone(); - if (reuseUrlToo) { - reqOptions.url = originalRequest.url; +function stripRequest(request) { + var strippedRequest = request.clone(); + if (strippedRequest.headers) { + strippedRequest.headers.remove("authorization"); } - // We have to change the x-ms-client-request-id otherwise Azure endpoint - // will return the initial 409 (cached) response. - reqOptions.headers.set("x-ms-client-request-id", generateUuid()); - // Set content-type to application/json - reqOptions.headers.set("Content-Type", "application/json; charset=utf-8"); - return reqOptions; + return strippedRequest; } /** - * Validates the error code and message associated with 409 response status code. If it matches to that of - * RP not registered then it returns the name of the RP else returns undefined. - * @param body - The response body received after making the original request. - * @returns The name of the RP if condition is satisfied else undefined. + * Validates the given uuid as a string + * + * @param uuid - The uuid as a string that needs to be validated + * @returns True if the uuid is valid; false otherwise. */ -function checkRPNotRegisteredError(body) { - var result, responseBody; - if (body) { - try { - responseBody = JSON.parse(body); - } - catch (err) { - // do nothing; - } - if (responseBody && - responseBody.error && - responseBody.error.message && - responseBody.error.code && - responseBody.error.code === "MissingSubscriptionRegistration") { - var matchRes = responseBody.error.message.match(/.*'(.*)'/i); - if (matchRes) { - result = matchRes.pop(); - } - } - } - return result; +function isValidUuid(uuid) { + return validUuidRegex.test(uuid); } /** - * Extracts the first part of the URL, just after subscription: - * https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/ - * @param url - The original request url - * @returns The url prefix as explained above. + * Generated UUID + * + * @returns RFC4122 v4 UUID. */ -function extractSubscriptionUrl(url) { - var result; - var matchRes = url.match(/.*\/subscriptions\/[a-f0-9-]+\//gi); - if (matchRes && matchRes[0]) { - result = matchRes[0]; - } - else { - throw new Error("Unable to extract subscriptionId from the given url - " + url + "."); - } - return result; +function generateUuid() { + return uuid.v4(); } /** - * Registers the given provider. - * @param policy - The RPRegistrationPolicy this function is being called against. - * @param urlPrefix - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/ - * @param provider - The provider name to be registered. - * @param originalRequest - The original request sent by the user that returned a 409 response - * with a message that the provider is not registered. - * @param callback - The callback that handles the RP registration + * Executes an array of promises sequentially. Inspiration of this method is here: + * https://pouchdb.com/2015/05/18/we-have-a-problem-with-promises.html. An awesome blog on promises! + * + * @param promiseFactories - An array of promise factories(A function that return a promise) + * @param kickstart - Input to the first promise that is used to kickstart the promise chain. + * If not provided then the promise chain starts with undefined. + * @returns A chain of resolved or rejected promises */ -function registerRP(policy, urlPrefix, provider, originalRequest) { - var postUrl = urlPrefix + "providers/" + provider + "/register?api-version=2016-02-01"; - var getUrl = urlPrefix + "providers/" + provider + "?api-version=2016-02-01"; - var reqOptions = getRequestEssentials(originalRequest); - reqOptions.method = "POST"; - reqOptions.url = postUrl; - return policy._nextPolicy.sendRequest(reqOptions).then(function (response) { - if (response.status !== 200) { - throw new Error("Autoregistration of " + provider + " failed. Please try registering manually."); - } - return getRegistrationStatus(policy, getUrl, originalRequest); +function executePromisesSequentially(promiseFactories, kickstart) { + var result = Promise.resolve(kickstart); + promiseFactories.forEach(function (promiseFactory) { + result = result.then(promiseFactory); }); + return result; } /** - * Polls the registration status of the provider that was registered. Polling happens at an interval of 30 seconds. - * Polling will happen till the registrationState property of the response body is "Registered". - * @param policy - The RPRegistrationPolicy this function is being called against. - * @param url - The request url for polling - * @param originalRequest - The original request sent by the user that returned a 409 response - * with a message that the provider is not registered. - * @returns True if RP Registration is successful. + * A wrapper for setTimeout that resolves a promise after t milliseconds. + * @param t - The number of milliseconds to be delayed. + * @param value - The value to be resolved with after a timeout of t milliseconds. + * @returns Resolved promise */ -function getRegistrationStatus(policy, url, originalRequest) { - var reqOptions = getRequestEssentials(originalRequest); - reqOptions.url = url; - reqOptions.method = "GET"; - return policy._nextPolicy.sendRequest(reqOptions).then(function (res) { - var obj = res.parsedBody; - if (res.parsedBody && obj.registrationState && obj.registrationState === "Registered") { - return true; - } - else { - return delay(policy._retryTimeout * 1000) - .then(function () { return getRegistrationStatus(policy, url, originalRequest); }); - } - }); +function delay(t, value) { + return new Promise(function (resolve) { return setTimeout(function () { return resolve(value); }, t); }); } - -// Copyright (c) Microsoft Corporation. -// Default options for the cycler if none are provided -var DEFAULT_CYCLER_OPTIONS = { - forcedRefreshWindowInMs: 1000, - retryIntervalInMs: 3000, - refreshWindowInMs: 1000 * 60 * 2 // Start refreshing 2m before expiry -}; /** - * Converts an an unreliable access token getter (which may resolve with null) - * into an AccessTokenGetter by retrying the unreliable getter in a regular - * interval. - * - * @param getAccessToken - a function that produces a promise of an access - * token that may fail by returning null - * @param retryIntervalInMs - the time (in milliseconds) to wait between retry - * attempts - * @param timeoutInMs - the timestamp after which the refresh attempt will fail, - * throwing an exception - * @returns - a promise that, if it resolves, will resolve with an access token + * Converts a Promise to a callback. + * @param promise - The Promise to be converted to a callback + * @returns A function that takes the callback `(cb: Function) => void` + * @deprecated generated code should instead depend on responseToBody */ -function beginRefresh(getAccessToken, retryIntervalInMs, timeoutInMs) { - return tslib.__awaiter(this, void 0, void 0, function () { - // This wrapper handles exceptions gracefully as long as we haven't exceeded - // the timeout. - function tryGetAccessToken() { - return tslib.__awaiter(this, void 0, void 0, function () { - var _a, finalToken; - return tslib.__generator(this, function (_b) { - switch (_b.label) { - case 0: - if (!(Date.now() < timeoutInMs)) return [3 /*break*/, 5]; - _b.label = 1; - case 1: - _b.trys.push([1, 3, , 4]); - return [4 /*yield*/, getAccessToken()]; - case 2: return [2 /*return*/, _b.sent()]; - case 3: - _a = _b.sent(); - return [2 /*return*/, null]; - case 4: return [3 /*break*/, 7]; - case 5: return [4 /*yield*/, getAccessToken()]; - case 6: - finalToken = _b.sent(); - // Timeout is up, so throw if it's still null - if (finalToken === null) { - throw new Error("Failed to refresh access token."); - } - return [2 /*return*/, finalToken]; - case 7: return [2 /*return*/]; - } - }); - }); - } - var token; - return tslib.__generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, tryGetAccessToken()]; - case 1: - token = _a.sent(); - _a.label = 2; - case 2: - if (!(token === null)) return [3 /*break*/, 5]; - return [4 /*yield*/, delay(retryIntervalInMs)]; - case 3: - _a.sent(); - return [4 /*yield*/, tryGetAccessToken()]; - case 4: - token = _a.sent(); - return [3 /*break*/, 2]; - case 5: return [2 /*return*/, token]; - } +// eslint-disable-next-line @typescript-eslint/ban-types +function promiseToCallback(promise) { + if (typeof promise.then !== "function") { + throw new Error("The provided input is not a Promise."); + } + // eslint-disable-next-line @typescript-eslint/ban-types + return function (cb) { + promise + .then(function (data) { + // eslint-disable-next-line promise/no-callback-in-promise + return cb(undefined, data); + }) + .catch(function (err) { + // eslint-disable-next-line promise/no-callback-in-promise + cb(err); }); - }); + }; } /** - * Creates a token cycler from a credential, scopes, and optional settings. - * - * A token cycler represents a way to reliably retrieve a valid access token - * from a TokenCredential. It will handle initializing the token, refreshing it - * when it nears expiration, and synchronizes refresh attempts to avoid - * concurrency hazards. - * - * @param credential - the underlying TokenCredential that provides the access - * token - * @param scopes - the scopes to request authorization for - * @param tokenCyclerOptions - optionally override default settings for the cycler - * - * @returns - a function that reliably produces a valid access token + * Converts a Promise to a service callback. + * @param promise - The Promise of HttpOperationResponse to be converted to a service callback + * @returns A function that takes the service callback (cb: ServiceCallback): void */ -function createTokenCycler(credential, scopes, tokenCyclerOptions) { - var _this = this; - var refreshWorker = null; - var token = null; - var options = tslib.__assign(tslib.__assign({}, DEFAULT_CYCLER_OPTIONS), tokenCyclerOptions); - /** - * This little holder defines several predicates that we use to construct - * the rules of refreshing the token. - */ - var cycler = { - /** - * Produces true if a refresh job is currently in progress. - */ - get isRefreshing() { - return refreshWorker !== null; - }, - /** - * Produces true if the cycler SHOULD refresh (we are within the refresh - * window and not already refreshing) - */ - get shouldRefresh() { - var _a; - return (!cycler.isRefreshing && - ((_a = token === null || token === void 0 ? void 0 : token.expiresOnTimestamp) !== null && _a !== void 0 ? _a : 0) - options.refreshWindowInMs < Date.now()); - }, - /** - * Produces true if the cycler MUST refresh (null or nearly-expired - * token). - */ - get mustRefresh() { - return (token === null || token.expiresOnTimestamp - options.forcedRefreshWindowInMs < Date.now()); - } +function promiseToServiceCallback(promise) { + if (typeof promise.then !== "function") { + throw new Error("The provided input is not a Promise."); + } + return function (cb) { + promise + .then(function (data) { + return process.nextTick(cb, undefined, data.parsedBody, data.request, data); + }) + .catch(function (err) { + process.nextTick(cb, err); + }); }; - /** - * Starts a refresh job or returns the existing job if one is already - * running. - */ - function refresh(getTokenOptions) { - var _a; - if (!cycler.isRefreshing) { - // We bind `scopes` here to avoid passing it around a lot - var tryGetAccessToken = function () { - return credential.getToken(scopes, getTokenOptions); - }; - // Take advantage of promise chaining to insert an assignment to `token` - // before the refresh can be considered done. - 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()) - .then(function (_token) { - refreshWorker = null; - token = _token; - return token; - }) - .catch(function (reason) { - // We also should reset the refresher if we enter a failed state. All - // existing awaiters will throw, but subsequent requests will start a - // new retry chain. - refreshWorker = null; - token = null; - throw reason; - }); - } - return refreshWorker; +} +function prepareXMLRootList(obj, elementName, xmlNamespaceKey, xmlNamespace) { + var _a, _b, _c; + if (!Array.isArray(obj)) { + obj = [obj]; } - return function (tokenOptions) { return tslib.__awaiter(_this, void 0, void 0, function () { - return tslib.__generator(this, function (_a) { - // - // Simple rules: - // - If we MUST refresh, then return the refresh task, blocking - // the pipeline until a token is available. - // - If we SHOULD refresh, then run refresh but don't return it - // (we can still use the cached token). - // - Return the token, since it's fine if we didn't return in - // step 1. - // - if (cycler.mustRefresh) - return [2 /*return*/, refresh(tokenOptions)]; - if (cycler.shouldRefresh) { - refresh(tokenOptions); - } - return [2 /*return*/, token]; + if (!xmlNamespaceKey || !xmlNamespace) { + return _a = {}, _a[elementName] = obj, _a; + } + var result = (_b = {}, _b[elementName] = obj, _b); + result[XML_ATTRKEY] = (_c = {}, _c[xmlNamespaceKey] = xmlNamespace, _c); + return result; +} +/** + * Applies the properties on the prototype of sourceCtors to the prototype of targetCtor + * @param targetCtor - The target object on which the properties need to be applied. + * @param sourceCtors - An array of source objects from which the properties need to be taken. + */ +function applyMixins(targetCtorParam, sourceCtors) { + var castTargetCtorParam = targetCtorParam; + sourceCtors.forEach(function (sourceCtor) { + Object.getOwnPropertyNames(sourceCtor.prototype).forEach(function (name) { + castTargetCtorParam.prototype[name] = sourceCtor.prototype[name]; }); - }); }; + }); +} +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)?)?$/; +/** + * Indicates whether the given string is in ISO 8601 format. + * @param value - The value to be validated for ISO 8601 duration format. + * @returns `true` if valid, `false` otherwise. + */ +function isDuration(value) { + return validateISODuration.test(value); +} +/** + * Replace all of the instances of searchValue in value with the provided replaceValue. + * @param value - The value to search and replace in. + * @param searchValue - The value to search for in the value argument. + * @param replaceValue - The value to replace searchValue with in the value argument. + * @returns The value where each instance of searchValue was replaced with replacedValue. + */ +function replaceAll(value, searchValue, replaceValue) { + return !value || !searchValue ? value : value.split(searchValue).join(replaceValue || ""); } -// #endregion /** - * Creates a new factory for a RequestPolicy that applies a bearer token to - * the requests' `Authorization` headers. - * - * @param credential - The TokenCredential implementation that can supply the bearer token. - * @param scopes - The scopes for which the bearer token applies. + * Determines whether the given entity is a basic/primitive type + * (string, number, boolean, null, undefined). + * @param value - Any entity + * @returns true is it is primitive type, false otherwise. */ -function bearerTokenAuthenticationPolicy(credential, scopes) { - // This simple function encapsulates the entire process of reliably retrieving the token - var getToken = createTokenCycler(credential, scopes /* , options */); - var BearerTokenAuthenticationPolicy = /** @class */ (function (_super) { - tslib.__extends(BearerTokenAuthenticationPolicy, _super); - function BearerTokenAuthenticationPolicy(nextPolicy, options) { - return _super.call(this, nextPolicy, options) || this; - } - BearerTokenAuthenticationPolicy.prototype.sendRequest = function (webResource) { - return tslib.__awaiter(this, void 0, void 0, function () { - var token; - return tslib.__generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, getToken({ - abortSignal: webResource.abortSignal, - tracingOptions: { - spanOptions: webResource.spanOptions, - tracingContext: webResource.tracingContext - } - })]; - case 1: - token = (_a.sent()).token; - webResource.headers.set(Constants.HeaderConstants.AUTHORIZATION, "Bearer " + token); - return [2 /*return*/, this._nextPolicy.sendRequest(webResource)]; - } - }); - }); - }; - return BearerTokenAuthenticationPolicy; - }(BaseRequestPolicy)); - return { - create: function (nextPolicy, options) { - return new BearerTokenAuthenticationPolicy(nextPolicy, options); - } - }; +function isPrimitiveType(value) { + return (typeof value !== "object" && typeof value !== "function") || value === null; } - -// Copyright (c) Microsoft Corporation. -function systemErrorRetryPolicy(retryCount, retryInterval, minRetryInterval, maxRetryInterval) { - return { - create: function (nextPolicy, options) { - return new SystemErrorRetryPolicy(nextPolicy, options, retryCount, retryInterval, minRetryInterval, maxRetryInterval); - } - }; +function getEnvironmentValue(name) { + if (process.env[name]) { + return process.env[name]; + } + else if (process.env[name.toLowerCase()]) { + return process.env[name.toLowerCase()]; + } + return undefined; } /** - * @param retryCount - The client retry count. - * @param retryInterval - The client retry interval, in milliseconds. - * @param minRetryInterval - The minimum retry interval, in milliseconds. - * @param maxRetryInterval - The maximum retry interval, in milliseconds. + * @internal + * @returns true when input is an object type that is not null, Array, RegExp, or Date. */ -var SystemErrorRetryPolicy = /** @class */ (function (_super) { - tslib.__extends(SystemErrorRetryPolicy, _super); - function SystemErrorRetryPolicy(nextPolicy, options, retryCount, retryInterval, minRetryInterval, maxRetryInterval) { - var _this = _super.call(this, nextPolicy, options) || this; - _this.retryCount = isNumber(retryCount) ? retryCount : DEFAULT_CLIENT_RETRY_COUNT; - _this.retryInterval = isNumber(retryInterval) ? retryInterval : DEFAULT_CLIENT_RETRY_INTERVAL; - _this.minRetryInterval = isNumber(minRetryInterval) - ? minRetryInterval - : DEFAULT_CLIENT_MIN_RETRY_INTERVAL; - _this.maxRetryInterval = isNumber(maxRetryInterval) - ? maxRetryInterval - : DEFAULT_CLIENT_MAX_RETRY_INTERVAL; - return _this; +function isObject(input) { + return (typeof input === "object" && + input !== null && + !Array.isArray(input) && + !(input instanceof RegExp) && + !(input instanceof Date)); +} + +// Copyright (c) Microsoft Corporation. +var Serializer = /** @class */ (function () { + function Serializer(modelMappers, isXML) { + if (modelMappers === void 0) { modelMappers = {}; } + this.modelMappers = modelMappers; + this.isXML = isXML; } - SystemErrorRetryPolicy.prototype.sendRequest = function (request) { - var _this = this; - return this._nextPolicy - .sendRequest(request.clone()) - .catch(function (error) { return retry$1(_this, request, error.response, error); }); + Serializer.prototype.validateConstraints = function (mapper, value, objectName) { + var failValidation = function (constraintName, constraintValue) { + throw new Error("\"" + objectName + "\" with value \"" + value + "\" should satisfy the constraint \"" + constraintName + "\": " + constraintValue + "."); + }; + if (mapper.constraints && value != undefined) { + var valueAsNumber = value; + var _a = mapper.constraints, ExclusiveMaximum = _a.ExclusiveMaximum, ExclusiveMinimum = _a.ExclusiveMinimum, InclusiveMaximum = _a.InclusiveMaximum, InclusiveMinimum = _a.InclusiveMinimum, MaxItems = _a.MaxItems, MaxLength = _a.MaxLength, MinItems = _a.MinItems, MinLength = _a.MinLength, MultipleOf = _a.MultipleOf, Pattern = _a.Pattern, UniqueItems = _a.UniqueItems; + if (ExclusiveMaximum != undefined && valueAsNumber >= ExclusiveMaximum) { + failValidation("ExclusiveMaximum", ExclusiveMaximum); + } + if (ExclusiveMinimum != undefined && valueAsNumber <= ExclusiveMinimum) { + failValidation("ExclusiveMinimum", ExclusiveMinimum); + } + if (InclusiveMaximum != undefined && valueAsNumber > InclusiveMaximum) { + failValidation("InclusiveMaximum", InclusiveMaximum); + } + if (InclusiveMinimum != undefined && valueAsNumber < InclusiveMinimum) { + failValidation("InclusiveMinimum", InclusiveMinimum); + } + var valueAsArray = value; + if (MaxItems != undefined && valueAsArray.length > MaxItems) { + failValidation("MaxItems", MaxItems); + } + if (MaxLength != undefined && valueAsArray.length > MaxLength) { + failValidation("MaxLength", MaxLength); + } + if (MinItems != undefined && valueAsArray.length < MinItems) { + failValidation("MinItems", MinItems); + } + if (MinLength != undefined && valueAsArray.length < MinLength) { + failValidation("MinLength", MinLength); + } + if (MultipleOf != undefined && valueAsNumber % MultipleOf !== 0) { + failValidation("MultipleOf", MultipleOf); + } + if (Pattern) { + var pattern = typeof Pattern === "string" ? new RegExp(Pattern) : Pattern; + if (typeof value !== "string" || value.match(pattern) === null) { + failValidation("Pattern", Pattern); + } + } + if (UniqueItems && + valueAsArray.some(function (item, i, ar) { return ar.indexOf(item) !== i; })) { + failValidation("UniqueItems", UniqueItems); + } + } }; - return SystemErrorRetryPolicy; -}(BaseRequestPolicy)); -function retry$1(policy, request, operationResponse, err, retryData) { - return tslib.__awaiter(this, void 0, void 0, function () { - function shouldPolicyRetry(_response, error) { - if (error && - error.code && - (error.code === "ETIMEDOUT" || - error.code === "ESOCKETTIMEDOUT" || - error.code === "ECONNREFUSED" || - error.code === "ECONNRESET" || - error.code === "ENOENT")) { - return true; + /** + * Serialize the given object based on its metadata defined in the mapper + * + * @param mapper - The mapper which defines the metadata of the serializable object + * @param object - A valid Javascript object to be serialized + * @param objectName - Name of the serialized object + * @param options - additional options to deserialization + * @returns A valid serialized Javascript object + */ + Serializer.prototype.serialize = function (mapper, object, objectName, options) { + var _a, _b, _c; + if (options === void 0) { options = {}; } + var updatedOptions = { + rootName: (_a = options.rootName) !== null && _a !== void 0 ? _a : "", + includeRoot: (_b = options.includeRoot) !== null && _b !== void 0 ? _b : false, + xmlCharKey: (_c = options.xmlCharKey) !== null && _c !== void 0 ? _c : XML_CHARKEY + }; + var payload = {}; + var mapperType = mapper.type.name; + if (!objectName) { + objectName = mapper.serializedName; + } + if (mapperType.match(/^Sequence$/i) !== null) { + payload = []; + } + if (mapper.isConstant) { + object = mapper.defaultValue; + } + // This table of allowed values should help explain + // the mapper.required and mapper.nullable properties. + // X means "neither undefined or null are allowed". + // || required + // || true | false + // nullable || ========================== + // true || null | undefined/null + // false || X | undefined + // undefined || X | undefined/null + var required = mapper.required, nullable = mapper.nullable; + if (required && nullable && object === undefined) { + throw new Error(objectName + " cannot be undefined."); + } + if (required && !nullable && object == undefined) { + throw new Error(objectName + " cannot be null or undefined."); + } + if (!required && nullable === false && object === null) { + throw new Error(objectName + " cannot be null."); + } + if (object == undefined) { + payload = object; + } + else { + // Validate Constraints if any + this.validateConstraints(mapper, object, objectName); + if (mapperType.match(/^any$/i) !== null) { + payload = object; + } + else if (mapperType.match(/^(Number|String|Boolean|Object|Stream|Uuid)$/i) !== null) { + payload = serializeBasicTypes(mapperType, objectName, object); + } + else if (mapperType.match(/^Enum$/i) !== null) { + var enumMapper = mapper; + payload = serializeEnumType(objectName, enumMapper.type.allowedValues, object); + } + else if (mapperType.match(/^(Date|DateTime|TimeSpan|DateTimeRfc1123|UnixTime)$/i) !== null) { + payload = serializeDateTypes(mapperType, object, objectName); + } + else if (mapperType.match(/^ByteArray$/i) !== null) { + payload = serializeByteArrayType(objectName, object); + } + else if (mapperType.match(/^Base64Url$/i) !== null) { + payload = serializeBase64UrlType(objectName, object); + } + else if (mapperType.match(/^Sequence$/i) !== null) { + payload = serializeSequenceType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); + } + else if (mapperType.match(/^Dictionary$/i) !== null) { + payload = serializeDictionaryType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); + } + else if (mapperType.match(/^Composite$/i) !== null) { + payload = serializeCompositeType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); } - return false; } - var nestedErr_1; - return tslib.__generator(this, function (_a) { - switch (_a.label) { - case 0: - retryData = updateRetryData(policy, retryData, err); - if (!shouldRetry(policy.retryCount, shouldPolicyRetry, retryData, operationResponse, err)) return [3 /*break*/, 5]; - _a.label = 1; - case 1: - _a.trys.push([1, 3, , 4]); - return [4 /*yield*/, delay(retryData.retryInterval)]; - case 2: - _a.sent(); - return [2 /*return*/, policy._nextPolicy.sendRequest(request.clone())]; - case 3: - nestedErr_1 = _a.sent(); - return [2 /*return*/, retry$1(policy, request, operationResponse, nestedErr_1, retryData)]; - case 4: return [3 /*break*/, 6]; - case 5: - if (err) { - // If the operation failed in the end, return all errors instead of just the last one - return [2 /*return*/, Promise.reject(retryData.error)]; - } - return [2 /*return*/, operationResponse]; - case 6: return [2 /*return*/]; + return payload; + }; + /** + * Deserialize the given object based on its metadata defined in the mapper + * + * @param mapper - The mapper which defines the metadata of the serializable object + * @param responseBody - A valid Javascript entity to be deserialized + * @param objectName - Name of the deserialized object + * @param options - Controls behavior of XML parser and builder. + * @returns A valid deserialized Javascript object + */ + Serializer.prototype.deserialize = function (mapper, responseBody, objectName, options) { + var _a, _b, _c; + if (options === void 0) { options = {}; } + var updatedOptions = { + rootName: (_a = options.rootName) !== null && _a !== void 0 ? _a : "", + includeRoot: (_b = options.includeRoot) !== null && _b !== void 0 ? _b : false, + xmlCharKey: (_c = options.xmlCharKey) !== null && _c !== void 0 ? _c : XML_CHARKEY + }; + if (responseBody == undefined) { + if (this.isXML && mapper.type.name === "Sequence" && !mapper.xmlIsWrapped) { + // Edge case for empty XML non-wrapped lists. xml2js can't distinguish + // between the list being empty versus being missing, + // so let's do the more user-friendly thing and return an empty list. + responseBody = []; } - }); - }); + // specifically check for undefined as default value can be a falsey value `0, "", false, null` + if (mapper.defaultValue !== undefined) { + responseBody = mapper.defaultValue; + } + return responseBody; + } + var payload; + var mapperType = mapper.type.name; + if (!objectName) { + objectName = mapper.serializedName; + } + if (mapperType.match(/^Composite$/i) !== null) { + payload = deserializeCompositeType(this, mapper, responseBody, objectName, updatedOptions); + } + else { + if (this.isXML) { + var xmlCharKey = updatedOptions.xmlCharKey; + var castResponseBody = responseBody; + /** + * If the mapper specifies this as a non-composite type value but the responseBody contains + * both header ("$" i.e., XML_ATTRKEY) and body ("#" i.e., XML_CHARKEY) properties, + * then just reduce the responseBody value to the body ("#" i.e., XML_CHARKEY) property. + */ + if (castResponseBody[XML_ATTRKEY] != undefined && + castResponseBody[xmlCharKey] != undefined) { + responseBody = castResponseBody[xmlCharKey]; + } + } + if (mapperType.match(/^Number$/i) !== null) { + payload = parseFloat(responseBody); + if (isNaN(payload)) { + payload = responseBody; + } + } + else if (mapperType.match(/^Boolean$/i) !== null) { + if (responseBody === "true") { + payload = true; + } + else if (responseBody === "false") { + payload = false; + } + else { + payload = responseBody; + } + } + else if (mapperType.match(/^(String|Enum|Object|Stream|Uuid|TimeSpan|any)$/i) !== null) { + payload = responseBody; + } + else if (mapperType.match(/^(Date|DateTime|DateTimeRfc1123)$/i) !== null) { + payload = new Date(responseBody); + } + else if (mapperType.match(/^UnixTime$/i) !== null) { + payload = unixTimeToDate(responseBody); + } + else if (mapperType.match(/^ByteArray$/i) !== null) { + payload = decodeString(responseBody); + } + else if (mapperType.match(/^Base64Url$/i) !== null) { + payload = base64UrlToByteArray(responseBody); + } + else if (mapperType.match(/^Sequence$/i) !== null) { + payload = deserializeSequenceType(this, mapper, responseBody, objectName, updatedOptions); + } + else if (mapperType.match(/^Dictionary$/i) !== null) { + payload = deserializeDictionaryType(this, mapper, responseBody, objectName, updatedOptions); + } + } + if (mapper.isConstant) { + payload = mapper.defaultValue; + } + return payload; + }; + return Serializer; +}()); +function trimEnd(str, ch) { + var len = str.length; + while (len - 1 >= 0 && str[len - 1] === ch) { + --len; + } + return str.substr(0, len); } - -// Copyright (c) Microsoft Corporation. -(function (QueryCollectionFormat) { - QueryCollectionFormat["Csv"] = ","; - QueryCollectionFormat["Ssv"] = " "; - QueryCollectionFormat["Tsv"] = "\t"; - QueryCollectionFormat["Pipes"] = "|"; - QueryCollectionFormat["Multi"] = "Multi"; -})(exports.QueryCollectionFormat || (exports.QueryCollectionFormat = {})); - -// Copyright (c) Microsoft Corporation. -/** - * @internal - */ -var noProxyList = loadNoProxy(); -var byPassedList = new Map(); -function loadEnvironmentProxyValue() { - if (!process) { +function bufferToBase64Url(buffer) { + if (!buffer) { return undefined; } - var httpsProxy = getEnvironmentValue(Constants.HTTPS_PROXY); - var allProxy = getEnvironmentValue(Constants.ALL_PROXY); - var httpProxy = getEnvironmentValue(Constants.HTTP_PROXY); - return httpsProxy || allProxy || httpProxy; + if (!(buffer instanceof Uint8Array)) { + throw new Error("Please provide an input of type Uint8Array for converting to Base64Url."); + } + // Uint8Array to Base64. + var str = encodeByteArray(buffer); + // Base64 to Base64Url. + return trimEnd(str, "=") + .replace(/\+/g, "-") + .replace(/\//g, "_"); } -// Check whether the host of a given `uri` is in the noProxyList. -// If there's a match, any request sent to the same host won't have the proxy settings set. -// This implementation is a port of https://github.com/Azure/azure-sdk-for-net/blob/8cca811371159e527159c7eb65602477898683e2/sdk/core/Azure.Core/src/Pipeline/Internal/HttpEnvironmentProxy.cs#L210 -function isBypassed(uri) { - if (noProxyList.length === 0) { - return false; +function base64UrlToByteArray(str) { + if (!str) { + return undefined; } - var host = URLBuilder.parse(uri).getHost(); - if (byPassedList.has(host)) { - return byPassedList.get(host); + if (str && typeof str.valueOf() !== "string") { + throw new Error("Please provide an input of type string for converting to Uint8Array"); } - var isBypassedFlag = false; - for (var _i = 0, noProxyList_1 = noProxyList; _i < noProxyList_1.length; _i++) { - var pattern = noProxyList_1[_i]; - if (pattern[0] === ".") { - // This should match either domain it self or any subdomain or host - // .foo.com will match foo.com it self or *.foo.com - if (host.endsWith(pattern)) { - isBypassedFlag = true; + // Base64Url to Base64. + str = str.replace(/-/g, "+").replace(/_/g, "/"); + // Base64 to Uint8Array. + return decodeString(str); +} +function splitSerializeName(prop) { + var classes = []; + var partialclass = ""; + if (prop) { + var subwords = prop.split("."); + for (var _i = 0, subwords_1 = subwords; _i < subwords_1.length; _i++) { + var item = subwords_1[_i]; + if (item.charAt(item.length - 1) === "\\") { + partialclass += item.substr(0, item.length - 1) + "."; } else { - if (host.length === pattern.length - 1 && host === pattern.slice(1)) { - isBypassedFlag = true; - } - } - } - else { - if (host === pattern) { - isBypassedFlag = true; + partialclass += item; + classes.push(partialclass); + partialclass = ""; } } } - byPassedList.set(host, isBypassedFlag); - return isBypassedFlag; + return classes; } -/** - * @internal - */ -function loadNoProxy() { - var noProxy = getEnvironmentValue(Constants.NO_PROXY); - if (noProxy) { - return noProxy - .split(",") - .map(function (item) { return item.trim(); }) - .filter(function (item) { return item.length; }); +function dateToUnixTime(d) { + if (!d) { + return undefined; } - return []; -} -function getDefaultProxySettings(proxyUrl) { - if (!proxyUrl) { - proxyUrl = loadEnvironmentProxyValue(); - if (!proxyUrl) { - return undefined; - } + if (typeof d.valueOf() === "string") { + d = new Date(d); } - var _a = extractAuthFromUrl(proxyUrl), username = _a.username, password = _a.password, urlWithoutAuth = _a.urlWithoutAuth; - var parsedUrl = URLBuilder.parse(urlWithoutAuth); - var schema = parsedUrl.getScheme() ? parsedUrl.getScheme() + "://" : ""; - return { - host: schema + parsedUrl.getHost(), - port: Number.parseInt(parsedUrl.getPort() || "80"), - username: username, - password: password - }; + return Math.floor(d.getTime() / 1000); } -function proxyPolicy(proxySettings) { - if (!proxySettings) { - proxySettings = getDefaultProxySettings(); +function unixTimeToDate(n) { + if (!n) { + return undefined; } - return { - create: function (nextPolicy, options) { - return new ProxyPolicy(nextPolicy, options, proxySettings); + return new Date(n * 1000); +} +function serializeBasicTypes(typeName, objectName, value) { + if (value !== null && value !== undefined) { + if (typeName.match(/^Number$/i) !== null) { + if (typeof value !== "number") { + throw new Error(objectName + " with value " + value + " must be of type number."); + } + } + else if (typeName.match(/^String$/i) !== null) { + if (typeof value.valueOf() !== "string") { + throw new Error(objectName + " with value \"" + value + "\" must be of type string."); + } + } + else if (typeName.match(/^Uuid$/i) !== null) { + if (!(typeof value.valueOf() === "string" && isValidUuid(value))) { + throw new Error(objectName + " with value \"" + value + "\" must be of type string and a valid uuid."); + } + } + else if (typeName.match(/^Boolean$/i) !== null) { + if (typeof value !== "boolean") { + throw new Error(objectName + " with value " + value + " must be of type boolean."); + } + } + else if (typeName.match(/^Stream$/i) !== null) { + var objectType = typeof value; + if (objectType !== "string" && + objectType !== "function" && + !(value instanceof ArrayBuffer) && + !ArrayBuffer.isView(value) && + !((typeof Blob === "function" || typeof Blob === "object") && value instanceof Blob)) { + throw new Error(objectName + " must be a string, Blob, ArrayBuffer, ArrayBufferView, or a function returning NodeJS.ReadableStream."); + } } - }; -} -function extractAuthFromUrl(url) { - var atIndex = url.indexOf("@"); - if (atIndex === -1) { - return { urlWithoutAuth: url }; } - var schemeIndex = url.indexOf("://"); - var authStart = schemeIndex !== -1 ? schemeIndex + 3 : 0; - var auth = url.substring(authStart, atIndex); - var colonIndex = auth.indexOf(":"); - var hasPassword = colonIndex !== -1; - var username = hasPassword ? auth.substring(0, colonIndex) : auth; - var password = hasPassword ? auth.substring(colonIndex + 1) : undefined; - var urlWithoutAuth = url.substring(0, authStart) + url.substring(atIndex + 1); - return { - username: username, - password: password, - urlWithoutAuth: urlWithoutAuth - }; + return value; } -var ProxyPolicy = /** @class */ (function (_super) { - tslib.__extends(ProxyPolicy, _super); - function ProxyPolicy(nextPolicy, options, proxySettings) { - var _this = _super.call(this, nextPolicy, options) || this; - _this.proxySettings = proxySettings; - return _this; +function serializeEnumType(objectName, allowedValues, value) { + if (!allowedValues) { + throw new Error("Please provide a set of allowedValues to validate " + objectName + " as an Enum Type."); } - ProxyPolicy.prototype.sendRequest = function (request) { - if (!request.proxySettings && !isBypassed(request.url)) { - request.proxySettings = this.proxySettings; + var isPresent = allowedValues.some(function (item) { + if (typeof item.valueOf() === "string") { + return item.toLowerCase() === value.toLowerCase(); } - return this._nextPolicy.sendRequest(request); - }; - return ProxyPolicy; -}(BaseRequestPolicy)); - -// Copyright (c) Microsoft Corporation. -var StatusCodes = Constants.HttpConstants.StatusCodes; -function throttlingRetryPolicy() { - return { - create: function (nextPolicy, options) { - return new ThrottlingRetryPolicy(nextPolicy, options); + return item === value; + }); + if (!isPresent) { + throw new Error(value + " is not a valid value for " + objectName + ". The valid values are: " + JSON.stringify(allowedValues) + "."); + } + return value; +} +function serializeByteArrayType(objectName, value) { + var returnValue = ""; + if (value != undefined) { + if (!(value instanceof Uint8Array)) { + throw new Error(objectName + " must be of type Uint8Array."); } - }; + returnValue = encodeByteArray(value); + } + return returnValue; } -/** - * To learn more, please refer to - * https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-request-limits, - * https://docs.microsoft.com/en-us/azure/azure-subscription-service-limits and - * https://docs.microsoft.com/en-us/azure/virtual-machines/troubleshooting/troubleshooting-throttling-errors - */ -var ThrottlingRetryPolicy = /** @class */ (function (_super) { - tslib.__extends(ThrottlingRetryPolicy, _super); - function ThrottlingRetryPolicy(nextPolicy, options, _handleResponse) { - var _this = _super.call(this, nextPolicy, options) || this; - _this._handleResponse = _handleResponse || _this._defaultResponseHandler; - return _this; +function serializeBase64UrlType(objectName, value) { + var returnValue = ""; + if (value != undefined) { + if (!(value instanceof Uint8Array)) { + throw new Error(objectName + " must be of type Uint8Array."); + } + returnValue = bufferToBase64Url(value) || ""; } - ThrottlingRetryPolicy.prototype.sendRequest = function (httpRequest) { - return tslib.__awaiter(this, void 0, void 0, function () { - var _this = this; - return tslib.__generator(this, function (_a) { - return [2 /*return*/, this._nextPolicy.sendRequest(httpRequest.clone()).then(function (response) { - if (response.status !== StatusCodes.TooManyRequests) { - return response; - } - else { - return _this._handleResponse(httpRequest, response); - } - })]; - }); - }); - }; - ThrottlingRetryPolicy.prototype._defaultResponseHandler = function (httpRequest, httpResponse) { - return tslib.__awaiter(this, void 0, void 0, function () { - var retryAfterHeader, delayInMs; - var _this = this; - return tslib.__generator(this, function (_a) { - retryAfterHeader = httpResponse.headers.get(Constants.HeaderConstants.RETRY_AFTER); - if (retryAfterHeader) { - delayInMs = ThrottlingRetryPolicy.parseRetryAfterHeader(retryAfterHeader); - if (delayInMs) { - return [2 /*return*/, delay(delayInMs).then(function (_) { return _this._nextPolicy.sendRequest(httpRequest); })]; - } - } - return [2 /*return*/, httpResponse]; - }); - }); - }; - ThrottlingRetryPolicy.parseRetryAfterHeader = function (headerValue) { - var retryAfterInSeconds = Number(headerValue); - if (Number.isNaN(retryAfterInSeconds)) { - return ThrottlingRetryPolicy.parseDateRetryAfterHeader(headerValue); + return returnValue; +} +function serializeDateTypes(typeName, value, objectName) { + if (value != undefined) { + if (typeName.match(/^Date$/i) !== null) { + if (!(value instanceof Date || + (typeof value.valueOf() === "string" && !isNaN(Date.parse(value))))) { + throw new Error(objectName + " must be an instanceof Date or a string in ISO8601 format."); + } + value = + value instanceof Date + ? value.toISOString().substring(0, 10) + : new Date(value).toISOString().substring(0, 10); } - else { - return retryAfterInSeconds * 1000; + else if (typeName.match(/^DateTime$/i) !== null) { + if (!(value instanceof Date || + (typeof value.valueOf() === "string" && !isNaN(Date.parse(value))))) { + throw new Error(objectName + " must be an instanceof Date or a string in ISO8601 format."); + } + value = value instanceof Date ? value.toISOString() : new Date(value).toISOString(); } - }; - ThrottlingRetryPolicy.parseDateRetryAfterHeader = function (headerValue) { - try { - var now = Date.now(); - var date = Date.parse(headerValue); - var diff = date - now; - return Number.isNaN(diff) ? undefined : diff; + else if (typeName.match(/^DateTimeRfc1123$/i) !== null) { + if (!(value instanceof Date || + (typeof value.valueOf() === "string" && !isNaN(Date.parse(value))))) { + throw new Error(objectName + " must be an instanceof Date or a string in RFC-1123 format."); + } + value = value instanceof Date ? value.toUTCString() : new Date(value).toUTCString(); } - catch (error) { - return undefined; + else if (typeName.match(/^UnixTime$/i) !== null) { + if (!(value instanceof Date || + (typeof value.valueOf() === "string" && !isNaN(Date.parse(value))))) { + throw new Error(objectName + " must be an instanceof Date or a string in RFC-1123/ISO8601 format " + + "for it to be serialized in UnixTime/Epoch format."); + } + value = dateToUnixTime(value); } - }; - return ThrottlingRetryPolicy; -}(BaseRequestPolicy)); - -// Copyright (c) Microsoft Corporation. -function signingPolicy(authenticationProvider) { - return { - create: function (nextPolicy, options) { - return new SigningPolicy(nextPolicy, options, authenticationProvider); + else if (typeName.match(/^TimeSpan$/i) !== null) { + if (!isDuration(value)) { + throw new Error(objectName + " must be a string in ISO 8601 format. Instead was \"" + value + "\"."); + } } - }; -} -var SigningPolicy = /** @class */ (function (_super) { - tslib.__extends(SigningPolicy, _super); - function SigningPolicy(nextPolicy, options, authenticationProvider) { - var _this = _super.call(this, nextPolicy, options) || this; - _this.authenticationProvider = authenticationProvider; - return _this; } - SigningPolicy.prototype.signRequest = function (request) { - return this.authenticationProvider.signRequest(request); - }; - SigningPolicy.prototype.sendRequest = function (request) { - var _this = this; - return this.signRequest(request).then(function (nextRequest) { - return _this._nextPolicy.sendRequest(nextRequest); - }); - }; - return SigningPolicy; -}(BaseRequestPolicy)); - -// Copyright (c) Microsoft Corporation. -var DefaultKeepAliveOptions = { - enable: true -}; -function keepAlivePolicy(keepAliveOptions) { - return { - create: function (nextPolicy, options) { - return new KeepAlivePolicy(nextPolicy, options, keepAliveOptions || DefaultKeepAliveOptions); - } - }; + return value; } -/** - * KeepAlivePolicy is a policy used to control keep alive settings for every request. - */ -var KeepAlivePolicy = /** @class */ (function (_super) { - tslib.__extends(KeepAlivePolicy, _super); - /** - * Creates an instance of KeepAlivePolicy. - * - * @param nextPolicy - - * @param options - - * @param keepAliveOptions - - */ - function KeepAlivePolicy(nextPolicy, options, keepAliveOptions) { - var _this = _super.call(this, nextPolicy, options) || this; - _this.keepAliveOptions = keepAliveOptions; - return _this; +function serializeSequenceType(serializer, mapper, object, objectName, isXml, options) { + var _a, _b; + if (!Array.isArray(object)) { + throw new Error(objectName + " must be of type Array."); } - /** - * Sends out request. - * - * @param request - - * @returns - */ - KeepAlivePolicy.prototype.sendRequest = function (request) { - return tslib.__awaiter(this, void 0, void 0, function () { - return tslib.__generator(this, function (_a) { - request.keepAlive = this.keepAliveOptions.enable; - return [2 /*return*/, this._nextPolicy.sendRequest(request)]; - }); - }); - }; - return KeepAlivePolicy; -}(BaseRequestPolicy)); - -// Copyright (c) Microsoft Corporation. -var createSpan = coreTracing.createSpanFunction({ - packagePrefix: "", - namespace: "" -}); -function tracingPolicy(tracingOptions) { - if (tracingOptions === void 0) { tracingOptions = {}; } - return { - create: function (nextPolicy, options) { - return new TracingPolicy(nextPolicy, options, tracingOptions); + var elementType = mapper.type.element; + if (!elementType || typeof elementType !== "object") { + throw new Error("element\" metadata for an Array must be defined in the " + + ("mapper and it must of type \"object\" in " + objectName + ".")); + } + var tempArray = []; + for (var i = 0; i < object.length; i++) { + var serializedValue = serializer.serialize(elementType, object[i], objectName, options); + if (isXml && elementType.xmlNamespace) { + var xmlnsKey = elementType.xmlNamespacePrefix + ? "xmlns:" + elementType.xmlNamespacePrefix + : "xmlns"; + if (elementType.type.name === "Composite") { + tempArray[i] = tslib.__assign({}, serializedValue); + tempArray[i][XML_ATTRKEY] = (_a = {}, _a[xmlnsKey] = elementType.xmlNamespace, _a); + } + else { + tempArray[i] = {}; + tempArray[i][options.xmlCharKey] = serializedValue; + tempArray[i][XML_ATTRKEY] = (_b = {}, _b[xmlnsKey] = elementType.xmlNamespace, _b); + } } - }; + else { + tempArray[i] = serializedValue; + } + } + return tempArray; } -var TracingPolicy = /** @class */ (function (_super) { - tslib.__extends(TracingPolicy, _super); - function TracingPolicy(nextPolicy, options, tracingOptions) { - var _this = _super.call(this, nextPolicy, options) || this; - _this.userAgent = tracingOptions.userAgent; - return _this; +function serializeDictionaryType(serializer, mapper, object, objectName, isXml, options) { + var _a; + if (typeof object !== "object") { + throw new Error(objectName + " must be of type object."); } - TracingPolicy.prototype.sendRequest = function (request) { - return tslib.__awaiter(this, void 0, void 0, function () { - var path, span, spanContext, traceParentHeader, traceState, response, serviceRequestId, err_1; - return tslib.__generator(this, function (_a) { - switch (_a.label) { - case 0: - if (!request.tracingContext) { - return [2 /*return*/, this._nextPolicy.sendRequest(request)]; - } - path = URLBuilder.parse(request.url).getPath() || "/"; - span = createSpan(path, { - tracingOptions: { - spanOptions: tslib.__assign(tslib.__assign({}, request.spanOptions), { kind: coreTracing.SpanKind.CLIENT }), - tracingContext: request.tracingContext - } - }).span; - span.setAttributes({ - "http.method": request.method, - "http.url": request.url, - requestId: request.requestId - }); - if (this.userAgent) { - span.setAttribute("http.user_agent", this.userAgent); - } - _a.label = 1; - case 1: - _a.trys.push([1, 3, , 4]); - spanContext = span.context(); - traceParentHeader = coreTracing.getTraceParentHeader(spanContext); - if (traceParentHeader) { - request.headers.set("traceparent", traceParentHeader); - traceState = spanContext.traceState && spanContext.traceState.serialize(); - // if tracestate is set, traceparent MUST be set, so only set tracestate after traceparent - if (traceState) { - request.headers.set("tracestate", traceState); - } - } - return [4 /*yield*/, this._nextPolicy.sendRequest(request)]; - case 2: - response = _a.sent(); - span.setAttribute("http.status_code", response.status); - serviceRequestId = response.headers.get("x-ms-request-id"); - if (serviceRequestId) { - span.setAttribute("serviceRequestId", serviceRequestId); - } - span.end(); - return [2 /*return*/, response]; - case 3: - err_1 = _a.sent(); - span.end(); - throw err_1; - case 4: return [2 /*return*/]; - } - }); - }); - }; - return TracingPolicy; -}(BaseRequestPolicy)); - -// Copyright (c) Microsoft Corporation. -/** - * Returns a request policy factory that can be used to create an instance of - * {@link DisableResponseDecompressionPolicy}. - */ -function disableResponseDecompressionPolicy() { - return { - create: function (nextPolicy, options) { - return new DisableResponseDecompressionPolicy(nextPolicy, options); - } - }; + var valueType = mapper.type.value; + if (!valueType || typeof valueType !== "object") { + throw new Error("\"value\" metadata for a Dictionary must be defined in the " + + ("mapper and it must of type \"object\" in " + objectName + ".")); + } + var tempDictionary = {}; + for (var _i = 0, _b = Object.keys(object); _i < _b.length; _i++) { + var key = _b[_i]; + var serializedValue = serializer.serialize(valueType, object[key], objectName, options); + // If the element needs an XML namespace we need to add it within the $ property + tempDictionary[key] = getXmlObjectValue(valueType, serializedValue, isXml, options); + } + // Add the namespace to the root element if needed + if (isXml && mapper.xmlNamespace) { + var xmlnsKey = mapper.xmlNamespacePrefix ? "xmlns:" + mapper.xmlNamespacePrefix : "xmlns"; + var result = tempDictionary; + result[XML_ATTRKEY] = (_a = {}, _a[xmlnsKey] = mapper.xmlNamespace, _a); + return result; + } + return tempDictionary; } /** - * A policy to disable response decompression according to Accept-Encoding header - * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Encoding + * Resolves the additionalProperties property from a referenced mapper + * @param serializer - The serializer containing the entire set of mappers + * @param mapper - The composite mapper to resolve + * @param objectName - Name of the object being serialized */ -var DisableResponseDecompressionPolicy = /** @class */ (function (_super) { - tslib.__extends(DisableResponseDecompressionPolicy, _super); - /** - * Creates an instance of DisableResponseDecompressionPolicy. - * - * @param nextPolicy - - * @param options - - */ - // The parent constructor is protected. - /* eslint-disable-next-line @typescript-eslint/no-useless-constructor */ - function DisableResponseDecompressionPolicy(nextPolicy, options) { - return _super.call(this, nextPolicy, options) || this; +function resolveAdditionalProperties(serializer, mapper, objectName) { + var additionalProperties = mapper.type.additionalProperties; + if (!additionalProperties && mapper.type.className) { + var modelMapper = resolveReferencedMapper(serializer, mapper, objectName); + return modelMapper === null || modelMapper === void 0 ? void 0 : modelMapper.type.additionalProperties; } - /** - * Sends out request. - * - * @param request - - * @returns - */ - DisableResponseDecompressionPolicy.prototype.sendRequest = function (request) { - return tslib.__awaiter(this, void 0, void 0, function () { - return tslib.__generator(this, function (_a) { - request.decompressResponse = false; - return [2 /*return*/, this._nextPolicy.sendRequest(request)]; - }); - }); - }; - return DisableResponseDecompressionPolicy; -}(BaseRequestPolicy)); - -// Copyright (c) Microsoft Corporation. -function ndJsonPolicy() { - return { - create: function (nextPolicy, options) { - return new NdJsonPolicy(nextPolicy, options); - } - }; + return additionalProperties; } /** - * NdJsonPolicy that formats a JSON array as newline-delimited JSON + * Finds the mapper referenced by className + * @param serializer - The serializer containing the entire set of mappers + * @param mapper - The composite mapper to resolve + * @param objectName - Name of the object being serialized */ -var NdJsonPolicy = /** @class */ (function (_super) { - tslib.__extends(NdJsonPolicy, _super); - /** - * Creates an instance of KeepAlivePolicy. - */ - function NdJsonPolicy(nextPolicy, options) { - return _super.call(this, nextPolicy, options) || this; - } - /** - * Sends a request. - */ - NdJsonPolicy.prototype.sendRequest = function (request) { - return tslib.__awaiter(this, void 0, void 0, function () { - var body; - return tslib.__generator(this, function (_a) { - // There currently isn't a good way to bypass the serializer - if (typeof request.body === "string" && request.body.startsWith("[")) { - body = JSON.parse(request.body); - if (Array.isArray(body)) { - request.body = body.map(function (item) { return JSON.stringify(item) + "\n"; }).join(""); - } - } - return [2 /*return*/, this._nextPolicy.sendRequest(request)]; - }); - }); - }; - return NdJsonPolicy; -}(BaseRequestPolicy)); - -// Copyright (c) Microsoft Corporation. -var cachedHttpClient; -function getCachedDefaultHttpClient() { - if (!cachedHttpClient) { - cachedHttpClient = new NodeFetchHttpClient(); +function resolveReferencedMapper(serializer, mapper, objectName) { + var className = mapper.type.className; + if (!className) { + throw new Error("Class name for model \"" + objectName + "\" is not provided in the mapper \"" + JSON.stringify(mapper, undefined, 2) + "\"."); } - return cachedHttpClient; + return serializer.modelMappers[className]; } - -// Copyright (c) Microsoft Corporation. /** - * ServiceClient sends service requests and receives responses. + * Resolves a composite mapper's modelProperties. + * @param serializer - The serializer containing the entire set of mappers + * @param mapper - The composite mapper to resolve */ -var ServiceClient = /** @class */ (function () { - /** - * The ServiceClient constructor - * @param credentials - The credentials used for authentication with the service. - * @param options - The service client options that govern the behavior of the client. - */ - function ServiceClient(credentials, - /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */ - options) { - var _this = this; - if (!options) { - options = {}; - } - this._withCredentials = options.withCredentials || false; - this._httpClient = options.httpClient || getCachedDefaultHttpClient(); - this._requestPolicyOptions = new RequestPolicyOptions(options.httpPipelineLogger); - var requestPolicyFactories; - if (Array.isArray(options.requestPolicyFactories)) { - logger.info("ServiceClient: using custom request policies"); - requestPolicyFactories = options.requestPolicyFactories; +function resolveModelProperties(serializer, mapper, objectName) { + var modelProps = mapper.type.modelProperties; + if (!modelProps) { + var modelMapper = resolveReferencedMapper(serializer, mapper, objectName); + if (!modelMapper) { + throw new Error("mapper() cannot be null or undefined for model \"" + mapper.type.className + "\"."); } - else { - var authPolicyFactory = undefined; - if (coreAuth.isTokenCredential(credentials)) { - logger.info("ServiceClient: creating bearer token authentication policy from provided credentials"); - // Create a wrapped RequestPolicyFactory here so that we can provide the - // correct scope to the BearerTokenAuthenticationPolicy at the first time - // one is requested. This is needed because generated ServiceClient - // implementations do not set baseUri until after ServiceClient's constructor - // is finished, leaving baseUri empty at the time when it is needed to - // build the correct scope name. - var wrappedPolicyFactory = function () { - var bearerTokenPolicyFactory = undefined; - // eslint-disable-next-line @typescript-eslint/no-this-alias - var serviceClient = _this; - var serviceClientOptions = options; - return { - create: function (nextPolicy, createOptions) { - var credentialScopes = getCredentialScopes(serviceClientOptions, serviceClient.baseUri); - if (!credentialScopes) { - throw new Error("When using credential, the ServiceClient must contain a baseUri or a credentialScopes in ServiceClientOptions. Unable to create a bearerTokenAuthenticationPolicy"); - } - if (bearerTokenPolicyFactory === undefined || bearerTokenPolicyFactory === null) { - bearerTokenPolicyFactory = bearerTokenAuthenticationPolicy(credentials, credentialScopes); - } - return bearerTokenPolicyFactory.create(nextPolicy, createOptions); - } - }; - }; - authPolicyFactory = wrappedPolicyFactory(); + modelProps = modelMapper === null || modelMapper === void 0 ? void 0 : modelMapper.type.modelProperties; + if (!modelProps) { + throw new Error("modelProperties cannot be null or undefined in the " + + ("mapper \"" + JSON.stringify(modelMapper) + "\" of type \"" + mapper.type.className + "\" for object \"" + objectName + "\".")); + } + } + return modelProps; +} +function serializeCompositeType(serializer, mapper, object, objectName, isXml, options) { + var _a, _b; + if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) { + mapper = getPolymorphicMapper(serializer, mapper, object, "clientName"); + } + if (object != undefined) { + var payload = {}; + var modelProps = resolveModelProperties(serializer, mapper, objectName); + for (var _i = 0, _c = Object.keys(modelProps); _i < _c.length; _i++) { + var key = _c[_i]; + var propertyMapper = modelProps[key]; + if (propertyMapper.readOnly) { + continue; } - else if (credentials && typeof credentials.signRequest === "function") { - logger.info("ServiceClient: creating signing policy from provided credentials"); - authPolicyFactory = signingPolicy(credentials); + var propName = void 0; + var parentObject = payload; + if (serializer.isXML) { + if (propertyMapper.xmlIsWrapped) { + propName = propertyMapper.xmlName; + } + else { + propName = propertyMapper.xmlElementName || propertyMapper.xmlName; + } } - else if (credentials !== undefined && credentials !== null) { - throw new Error("The credentials argument must implement the TokenCredential interface"); + else { + var paths = splitSerializeName(propertyMapper.serializedName); + propName = paths.pop(); + for (var _d = 0, paths_1 = paths; _d < paths_1.length; _d++) { + var pathName = paths_1[_d]; + var childObject = parentObject[pathName]; + if (childObject == undefined && + (object[key] != undefined || propertyMapper.defaultValue !== undefined)) { + parentObject[pathName] = {}; + } + parentObject = parentObject[pathName]; + } } - logger.info("ServiceClient: using default request policies"); - requestPolicyFactories = createDefaultRequestPolicyFactories(authPolicyFactory, options); - if (options.requestPolicyFactories) { - // options.requestPolicyFactories can also be a function that manipulates - // the default requestPolicyFactories array - var newRequestPolicyFactories = options.requestPolicyFactories(requestPolicyFactories); - if (newRequestPolicyFactories) { - requestPolicyFactories = newRequestPolicyFactories; + if (parentObject != undefined) { + if (isXml && mapper.xmlNamespace) { + var xmlnsKey = mapper.xmlNamespacePrefix + ? "xmlns:" + mapper.xmlNamespacePrefix + : "xmlns"; + parentObject[XML_ATTRKEY] = tslib.__assign(tslib.__assign({}, parentObject[XML_ATTRKEY]), (_a = {}, _a[xmlnsKey] = mapper.xmlNamespace, _a)); + } + var propertyObjectName = propertyMapper.serializedName !== "" + ? objectName + "." + propertyMapper.serializedName + : objectName; + var toSerialize = object[key]; + var polymorphicDiscriminator = getPolymorphicDiscriminatorRecursively(serializer, mapper); + if (polymorphicDiscriminator && + polymorphicDiscriminator.clientName === key && + toSerialize == undefined) { + toSerialize = mapper.serializedName; + } + var serializedValue = serializer.serialize(propertyMapper, toSerialize, propertyObjectName, options); + if (serializedValue !== undefined && propName != undefined) { + var value = getXmlObjectValue(propertyMapper, serializedValue, isXml, options); + if (isXml && propertyMapper.xmlIsAttribute) { + // XML_ATTRKEY, i.e., $ is the key attributes are kept under in xml2js. + // This keeps things simple while preventing name collision + // with names in user documents. + parentObject[XML_ATTRKEY] = parentObject[XML_ATTRKEY] || {}; + parentObject[XML_ATTRKEY][propName] = serializedValue; + } + else if (isXml && propertyMapper.xmlIsWrapped) { + parentObject[propName] = (_b = {}, _b[propertyMapper.xmlElementName] = value, _b); + } + else { + parentObject[propName] = value; + } } } } - this._requestPolicyFactories = requestPolicyFactories; + var additionalPropertiesMapper = resolveAdditionalProperties(serializer, mapper, objectName); + if (additionalPropertiesMapper) { + var propNames = Object.keys(modelProps); + var _loop_1 = function (clientPropName) { + var isAdditionalProperty = propNames.every(function (pn) { return pn !== clientPropName; }); + if (isAdditionalProperty) { + payload[clientPropName] = serializer.serialize(additionalPropertiesMapper, object[clientPropName], objectName + '["' + clientPropName + '"]', options); + } + }; + for (var clientPropName in object) { + _loop_1(clientPropName); + } + } + return payload; } - /** - * Send the provided httpRequest. - */ - ServiceClient.prototype.sendRequest = function (options) { - if (options === null || options === undefined || typeof options !== "object") { - throw new Error("options cannot be null or undefined and it must be of type object."); + return object; +} +function getXmlObjectValue(propertyMapper, serializedValue, isXml, options) { + var _a; + if (!isXml || !propertyMapper.xmlNamespace) { + return serializedValue; + } + var xmlnsKey = propertyMapper.xmlNamespacePrefix + ? "xmlns:" + propertyMapper.xmlNamespacePrefix + : "xmlns"; + var xmlNamespace = (_a = {}, _a[xmlnsKey] = propertyMapper.xmlNamespace, _a); + if (["Composite"].includes(propertyMapper.type.name)) { + if (serializedValue[XML_ATTRKEY]) { + return serializedValue; } - var httpRequest; - try { - if (isWebResourceLike(options)) { - options.validateRequestProperties(); - httpRequest = options; - } - else { - httpRequest = new WebResource(); - httpRequest = httpRequest.prepare(options); - } + else { + var result_1 = tslib.__assign({}, serializedValue); + result_1[XML_ATTRKEY] = xmlNamespace; + return result_1; } - catch (error) { - return Promise.reject(error); + } + var result = {}; + result[options.xmlCharKey] = serializedValue; + result[XML_ATTRKEY] = xmlNamespace; + return result; +} +function isSpecialXmlProperty(propertyName, options) { + return [XML_ATTRKEY, options.xmlCharKey].includes(propertyName); +} +function deserializeCompositeType(serializer, mapper, responseBody, objectName, options) { + var _a; + if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) { + mapper = getPolymorphicMapper(serializer, mapper, responseBody, "serializedName"); + } + var modelProps = resolveModelProperties(serializer, mapper, objectName); + var instance = {}; + var handledPropertyNames = []; + for (var _i = 0, _b = Object.keys(modelProps); _i < _b.length; _i++) { + var key = _b[_i]; + var propertyMapper = modelProps[key]; + var paths = splitSerializeName(modelProps[key].serializedName); + handledPropertyNames.push(paths[0]); + var serializedName = propertyMapper.serializedName, xmlName = propertyMapper.xmlName, xmlElementName = propertyMapper.xmlElementName; + var propertyObjectName = objectName; + if (serializedName !== "" && serializedName !== undefined) { + propertyObjectName = objectName + "." + serializedName; } - var httpPipeline = this._httpClient; - if (this._requestPolicyFactories && this._requestPolicyFactories.length > 0) { - for (var i = this._requestPolicyFactories.length - 1; i >= 0; --i) { - httpPipeline = this._requestPolicyFactories[i].create(httpPipeline, this._requestPolicyOptions); + var headerCollectionPrefix = propertyMapper.headerCollectionPrefix; + if (headerCollectionPrefix) { + var dictionary = {}; + for (var _c = 0, _d = Object.keys(responseBody); _c < _d.length; _c++) { + var headerKey = _d[_c]; + if (headerKey.startsWith(headerCollectionPrefix)) { + dictionary[headerKey.substring(headerCollectionPrefix.length)] = serializer.deserialize(propertyMapper.type.value, responseBody[headerKey], propertyObjectName, options); + } + handledPropertyNames.push(headerKey); } + instance[key] = dictionary; } - return httpPipeline.sendRequest(httpRequest); - }; - /** - * Send an HTTP request that is populated using the provided OperationSpec. - * @param operationArguments - The arguments that the HTTP request's templated values will be populated from. - * @param operationSpec - The OperationSpec to use to populate the httpRequest. - * @param callback - The callback to call when the response is received. - */ - ServiceClient.prototype.sendOperationRequest = function (operationArguments, operationSpec, callback) { - var _a; - return tslib.__awaiter(this, void 0, void 0, function () { - var serializerOptions, httpRequest, result, baseUri, requestUrl, _i, _b, urlParameter, urlParameterValue, _c, _d, queryParameter, queryParameterValue, index, item, index, contentType, _e, _f, headerParameter, headerValue, headerCollectionPrefix, _g, _h, key, options, customHeaderName, rawResponse, sendRequestError, error_1, error_2, cb; - return tslib.__generator(this, function (_j) { - switch (_j.label) { - case 0: - if (typeof operationArguments.options === "function") { - callback = operationArguments.options; - operationArguments.options = undefined; - } - serializerOptions = (_a = operationArguments.options) === null || _a === void 0 ? void 0 : _a.serializerOptions; - httpRequest = new WebResource(); - _j.label = 1; - case 1: - _j.trys.push([1, 6, , 7]); - baseUri = operationSpec.baseUrl || this.baseUri; - if (!baseUri) { - throw new Error("If operationSpec.baseUrl is not specified, then the ServiceClient must have a baseUri string property that contains the base URL to use."); - } - httpRequest.method = operationSpec.httpMethod; - httpRequest.operationSpec = operationSpec; - requestUrl = URLBuilder.parse(baseUri); - if (operationSpec.path) { - requestUrl.appendPath(operationSpec.path); - } - if (operationSpec.urlParameters && operationSpec.urlParameters.length > 0) { - for (_i = 0, _b = operationSpec.urlParameters; _i < _b.length; _i++) { - urlParameter = _b[_i]; - urlParameterValue = getOperationArgumentValueFromParameter(this, operationArguments, urlParameter, operationSpec.serializer); - urlParameterValue = operationSpec.serializer.serialize(urlParameter.mapper, urlParameterValue, getPathStringFromParameter(urlParameter), serializerOptions); - if (!urlParameter.skipEncoding) { - urlParameterValue = encodeURIComponent(urlParameterValue); - } - requestUrl.replaceAll("{" + (urlParameter.mapper.serializedName || getPathStringFromParameter(urlParameter)) + "}", urlParameterValue); - } - } - if (operationSpec.queryParameters && operationSpec.queryParameters.length > 0) { - for (_c = 0, _d = operationSpec.queryParameters; _c < _d.length; _c++) { - queryParameter = _d[_c]; - queryParameterValue = getOperationArgumentValueFromParameter(this, operationArguments, queryParameter, operationSpec.serializer); - if (queryParameterValue !== undefined && queryParameterValue !== null) { - queryParameterValue = operationSpec.serializer.serialize(queryParameter.mapper, queryParameterValue, getPathStringFromParameter(queryParameter), serializerOptions); - if (queryParameter.collectionFormat !== undefined && - queryParameter.collectionFormat !== null) { - if (queryParameter.collectionFormat === exports.QueryCollectionFormat.Multi) { - if (queryParameterValue.length === 0) { - // The collection is empty, no need to try serializing the current queryParam - continue; - } - else { - for (index in queryParameterValue) { - item = queryParameterValue[index]; - queryParameterValue[index] = - item === undefined || item === null ? "" : item.toString(); - } - } - } - else if (queryParameter.collectionFormat === exports.QueryCollectionFormat.Ssv || - queryParameter.collectionFormat === exports.QueryCollectionFormat.Tsv) { - queryParameterValue = queryParameterValue.join(queryParameter.collectionFormat); - } - } - if (!queryParameter.skipEncoding) { - if (Array.isArray(queryParameterValue)) { - for (index in queryParameterValue) { - if (queryParameterValue[index] !== undefined && - queryParameterValue[index] !== null) { - queryParameterValue[index] = encodeURIComponent(queryParameterValue[index]); - } - } - } - else { - queryParameterValue = encodeURIComponent(queryParameterValue); - } - } - if (queryParameter.collectionFormat !== undefined && - queryParameter.collectionFormat !== null && - queryParameter.collectionFormat !== exports.QueryCollectionFormat.Multi && - queryParameter.collectionFormat !== exports.QueryCollectionFormat.Ssv && - queryParameter.collectionFormat !== exports.QueryCollectionFormat.Tsv) { - queryParameterValue = queryParameterValue.join(queryParameter.collectionFormat); - } - requestUrl.setQueryParameter(queryParameter.mapper.serializedName || getPathStringFromParameter(queryParameter), queryParameterValue); - } - } - } - httpRequest.url = requestUrl.toString(); - contentType = operationSpec.contentType || this.requestContentType; - if (contentType && operationSpec.requestBody) { - httpRequest.headers.set("Content-Type", contentType); - } - if (operationSpec.headerParameters) { - for (_e = 0, _f = operationSpec.headerParameters; _e < _f.length; _e++) { - headerParameter = _f[_e]; - headerValue = getOperationArgumentValueFromParameter(this, operationArguments, headerParameter, operationSpec.serializer); - if (headerValue !== undefined && headerValue !== null) { - headerValue = operationSpec.serializer.serialize(headerParameter.mapper, headerValue, getPathStringFromParameter(headerParameter), serializerOptions); - headerCollectionPrefix = headerParameter.mapper - .headerCollectionPrefix; - if (headerCollectionPrefix) { - for (_g = 0, _h = Object.keys(headerValue); _g < _h.length; _g++) { - key = _h[_g]; - httpRequest.headers.set(headerCollectionPrefix + key, headerValue[key]); - } - } - else { - httpRequest.headers.set(headerParameter.mapper.serializedName || - getPathStringFromParameter(headerParameter), headerValue); - } - } - } - } - options = operationArguments.options; - if (options) { - if (options.customHeaders) { - for (customHeaderName in options.customHeaders) { - httpRequest.headers.set(customHeaderName, options.customHeaders[customHeaderName]); - } - } - if (options.abortSignal) { - httpRequest.abortSignal = options.abortSignal; - } - if (options.timeout) { - httpRequest.timeout = options.timeout; - } - if (options.onUploadProgress) { - httpRequest.onUploadProgress = options.onUploadProgress; - } - if (options.onDownloadProgress) { - httpRequest.onDownloadProgress = options.onDownloadProgress; - } - if (options.spanOptions) { - httpRequest.spanOptions = options.spanOptions; - } - if (options.tracingContext) { - httpRequest.tracingContext = options.tracingContext; - } - if (options.shouldDeserialize !== undefined && options.shouldDeserialize !== null) { - httpRequest.shouldDeserialize = options.shouldDeserialize; - } - } - httpRequest.withCredentials = this._withCredentials; - serializeRequestBody(this, httpRequest, operationArguments, operationSpec); - if (httpRequest.streamResponseStatusCodes === undefined) { - httpRequest.streamResponseStatusCodes = getStreamResponseStatusCodes(operationSpec); - } - rawResponse = void 0; - sendRequestError = void 0; - _j.label = 2; - case 2: - _j.trys.push([2, 4, , 5]); - return [4 /*yield*/, this.sendRequest(httpRequest)]; - case 3: - rawResponse = _j.sent(); - return [3 /*break*/, 5]; - case 4: - error_1 = _j.sent(); - sendRequestError = error_1; - return [3 /*break*/, 5]; - case 5: - if (sendRequestError) { - if (sendRequestError.response) { - sendRequestError.details = flattenResponse(sendRequestError.response, operationSpec.responses[sendRequestError.statusCode] || - operationSpec.responses["default"]); - } - result = Promise.reject(sendRequestError); - } - else { - result = Promise.resolve(flattenResponse(rawResponse, operationSpec.responses[rawResponse.status])); - } - return [3 /*break*/, 7]; - case 6: - error_2 = _j.sent(); - result = Promise.reject(error_2); - return [3 /*break*/, 7]; - case 7: - cb = callback; - if (cb) { - result - .then(function (res) { return cb(null, res._response.parsedBody, res._response.request, res._response); }) - .catch(function (err) { return cb(err); }); + else if (serializer.isXML) { + if (propertyMapper.xmlIsAttribute && responseBody[XML_ATTRKEY]) { + instance[key] = serializer.deserialize(propertyMapper, responseBody[XML_ATTRKEY][xmlName], propertyObjectName, options); + } + else { + var propertyName = xmlElementName || xmlName || serializedName; + if (propertyMapper.xmlIsWrapped) { + /* a list of wrapped by + For the xml example below + + ... + ... + + the responseBody has + { + Cors: { + CorsRule: [{...}, {...}] + } } - return [2 /*return*/, result]; + xmlName is "Cors" and xmlElementName is"CorsRule". + */ + var wrapped = responseBody[xmlName]; + var elementList = (_a = wrapped === null || wrapped === void 0 ? void 0 : wrapped[xmlElementName]) !== null && _a !== void 0 ? _a : []; + instance[key] = serializer.deserialize(propertyMapper, elementList, propertyObjectName, options); } - }); - }); - }; - return ServiceClient; -}()); -function serializeRequestBody(serviceClient, httpRequest, operationArguments, operationSpec) { - var _a, _b, _c, _d, _e, _f; - var serializerOptions = (_b = (_a = operationArguments.options) === null || _a === void 0 ? void 0 : _a.serializerOptions) !== null && _b !== void 0 ? _b : {}; - var updatedOptions = { - rootName: (_c = serializerOptions.rootName) !== null && _c !== void 0 ? _c : "", - includeRoot: (_d = serializerOptions.includeRoot) !== null && _d !== void 0 ? _d : false, - xmlCharKey: (_e = serializerOptions.xmlCharKey) !== null && _e !== void 0 ? _e : XML_CHARKEY - }; - var xmlCharKey = serializerOptions.xmlCharKey; - if (operationSpec.requestBody && operationSpec.requestBody.mapper) { - httpRequest.body = getOperationArgumentValueFromParameter(serviceClient, operationArguments, operationSpec.requestBody, operationSpec.serializer); - var bodyMapper = operationSpec.requestBody.mapper; - var required = bodyMapper.required, xmlName = bodyMapper.xmlName, xmlElementName = bodyMapper.xmlElementName, serializedName = bodyMapper.serializedName, xmlNamespace = bodyMapper.xmlNamespace, xmlNamespacePrefix = bodyMapper.xmlNamespacePrefix; - var typeName = bodyMapper.type.name; - try { - if ((httpRequest.body !== undefined && httpRequest.body !== null) || required) { - var requestBodyParameterPathString = getPathStringFromParameter(operationSpec.requestBody); - httpRequest.body = operationSpec.serializer.serialize(bodyMapper, httpRequest.body, requestBodyParameterPathString, updatedOptions); - var isStream = typeName === MapperType.Stream; - if (operationSpec.isXML) { - var xmlnsKey = xmlNamespacePrefix ? "xmlns:" + xmlNamespacePrefix : "xmlns"; - var value = getXmlValueWithNamespace(xmlNamespace, xmlnsKey, typeName, httpRequest.body, updatedOptions); - if (typeName === MapperType.Sequence) { - httpRequest.body = stringifyXML(prepareXMLRootList(value, xmlElementName || xmlName || serializedName, xmlnsKey, xmlNamespace), { - rootName: xmlName || serializedName, - xmlCharKey: xmlCharKey - }); - } - else if (!isStream) { - httpRequest.body = stringifyXML(value, { - rootName: xmlName || serializedName, - xmlCharKey: xmlCharKey - }); - } + else { + var property = responseBody[propertyName]; + instance[key] = serializer.deserialize(propertyMapper, property, propertyObjectName, options); } - else if (typeName === MapperType.String && - (((_f = operationSpec.contentType) === null || _f === void 0 ? void 0 : _f.match("text/plain")) || operationSpec.mediaType === "text")) { - // the String serializer has validated that request body is a string - // so just send the string. - return; + } + } + else { + // deserialize the property if it is present in the provided responseBody instance + var propertyInstance = void 0; + var res = responseBody; + // traversing the object step by step. + for (var _e = 0, paths_2 = paths; _e < paths_2.length; _e++) { + var item = paths_2[_e]; + if (!res) + break; + res = res[item]; + } + propertyInstance = res; + var polymorphicDiscriminator = mapper.type.polymorphicDiscriminator; + // checking that the model property name (key)(ex: "fishtype") and the + // clientName of the polymorphicDiscriminator {metadata} (ex: "fishtype") + // instead of the serializedName of the polymorphicDiscriminator (ex: "fish.type") + // is a better approach. The generator is not consistent with escaping '\.' in the + // serializedName of the property (ex: "fish\.type") that is marked as polymorphic discriminator + // and the serializedName of the metadata polymorphicDiscriminator (ex: "fish.type"). However, + // the clientName transformation of the polymorphicDiscriminator (ex: "fishtype") and + // the transformation of model property name (ex: "fishtype") is done consistently. + // Hence, it is a safer bet to rely on the clientName of the polymorphicDiscriminator. + if (polymorphicDiscriminator && + key === polymorphicDiscriminator.clientName && + propertyInstance == undefined) { + propertyInstance = mapper.serializedName; + } + var serializedValue = void 0; + // paging + if (Array.isArray(responseBody[key]) && modelProps[key].serializedName === "") { + propertyInstance = responseBody[key]; + var arrayInstance = serializer.deserialize(propertyMapper, propertyInstance, propertyObjectName, options); + // Copy over any properties that have already been added into the instance, where they do + // not exist on the newly de-serialized array + for (var _f = 0, _g = Object.entries(instance); _f < _g.length; _f++) { + var _h = _g[_f], k = _h[0], v = _h[1]; + if (!Object.prototype.hasOwnProperty.call(arrayInstance, k)) { + arrayInstance[k] = v; + } } - else if (!isStream) { - httpRequest.body = JSON.stringify(httpRequest.body); + instance = arrayInstance; + } + else if (propertyInstance !== undefined || propertyMapper.defaultValue !== undefined) { + serializedValue = serializer.deserialize(propertyMapper, propertyInstance, propertyObjectName, options); + instance[key] = serializedValue; + } + } + } + var additionalPropertiesMapper = mapper.type.additionalProperties; + if (additionalPropertiesMapper) { + var isAdditionalProperty = function (responsePropName) { + for (var clientPropName in modelProps) { + var paths = splitSerializeName(modelProps[clientPropName].serializedName); + if (paths[0] === responsePropName) { + return false; } } - } - catch (error) { - throw new Error("Error \"" + error.message + "\" occurred in serializing the payload - " + JSON.stringify(serializedName, undefined, " ") + "."); + return true; + }; + for (var responsePropName in responseBody) { + if (isAdditionalProperty(responsePropName)) { + instance[responsePropName] = serializer.deserialize(additionalPropertiesMapper, responseBody[responsePropName], objectName + '["' + responsePropName + '"]', options); + } } } - else if (operationSpec.formDataParameters && operationSpec.formDataParameters.length > 0) { - httpRequest.formData = {}; - for (var _i = 0, _g = operationSpec.formDataParameters; _i < _g.length; _i++) { - var formDataParameter = _g[_i]; - var formDataParameterValue = getOperationArgumentValueFromParameter(serviceClient, operationArguments, formDataParameter, operationSpec.serializer); - if (formDataParameterValue !== undefined && formDataParameterValue !== null) { - var formDataParameterPropertyName = formDataParameter.mapper.serializedName || getPathStringFromParameter(formDataParameter); - httpRequest.formData[formDataParameterPropertyName] = operationSpec.serializer.serialize(formDataParameter.mapper, formDataParameterValue, getPathStringFromParameter(formDataParameter), updatedOptions); + else if (responseBody) { + for (var _j = 0, _k = Object.keys(responseBody); _j < _k.length; _j++) { + var key = _k[_j]; + if (instance[key] === undefined && + !handledPropertyNames.includes(key) && + !isSpecialXmlProperty(key, options)) { + instance[key] = responseBody[key]; } } } + return instance; } -/** - * Adds an xml namespace to the xml serialized object if needed, otherwise it just returns the value itself - */ -function getXmlValueWithNamespace(xmlNamespace, xmlnsKey, typeName, serializedValue, options) { - var _a; - // Composite and Sequence schemas already got their root namespace set during serialization - // We just need to add xmlns to the other schema types - if (xmlNamespace && !["Composite", "Sequence", "Dictionary"].includes(typeName)) { - var result = {}; - result[options.xmlCharKey] = serializedValue; - result[XML_ATTRKEY] = (_a = {}, _a[xmlnsKey] = xmlNamespace, _a); - return result; +function deserializeDictionaryType(serializer, mapper, responseBody, objectName, options) { + var value = mapper.type.value; + if (!value || typeof value !== "object") { + throw new Error("\"value\" metadata for a Dictionary must be defined in the " + + ("mapper and it must of type \"object\" in " + objectName)); } - return serializedValue; + if (responseBody) { + var tempDictionary = {}; + for (var _i = 0, _a = Object.keys(responseBody); _i < _a.length; _i++) { + var key = _a[_i]; + tempDictionary[key] = serializer.deserialize(value, responseBody[key], objectName, options); + } + return tempDictionary; + } + return responseBody; } -function getValueOrFunctionResult(value, defaultValueCreator) { - var result; - if (typeof value === "string") { - result = value; +function deserializeSequenceType(serializer, mapper, responseBody, objectName, options) { + var 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)); } - else { - result = defaultValueCreator(); - if (typeof value === "function") { - result = value(result); + if (responseBody) { + if (!Array.isArray(responseBody)) { + // xml2js will interpret a single element array as just the element, so force it to be an array + responseBody = [responseBody]; + } + var tempArray = []; + for (var i = 0; i < responseBody.length; i++) { + tempArray[i] = serializer.deserialize(element, responseBody[i], objectName + "[" + i + "]", options); } + return tempArray; } - return result; + return responseBody; } -function createDefaultRequestPolicyFactories(authPolicyFactory, options) { - var factories = []; - if (options.generateClientRequestIdHeader) { - factories.push(generateClientRequestIdPolicy(options.clientRequestIdHeaderName)); +function getPolymorphicMapper(serializer, mapper, object, polymorphicPropertyName) { + var polymorphicDiscriminator = getPolymorphicDiscriminatorRecursively(serializer, mapper); + if (polymorphicDiscriminator) { + var discriminatorName = polymorphicDiscriminator[polymorphicPropertyName]; + if (discriminatorName != undefined) { + var discriminatorValue = object[discriminatorName]; + if (discriminatorValue != undefined) { + var typeName = mapper.type.uberParent || mapper.type.className; + var indexDiscriminator = discriminatorValue === typeName + ? discriminatorValue + : typeName + "." + discriminatorValue; + var polymorphicMapper = serializer.modelMappers.discriminators[indexDiscriminator]; + if (polymorphicMapper) { + mapper = polymorphicMapper; + } + } + } } - if (authPolicyFactory) { - factories.push(authPolicyFactory); + return mapper; +} +function getPolymorphicDiscriminatorRecursively(serializer, mapper) { + return (mapper.type.polymorphicDiscriminator || + getPolymorphicDiscriminatorSafely(serializer, mapper.type.uberParent) || + getPolymorphicDiscriminatorSafely(serializer, mapper.type.className)); +} +function getPolymorphicDiscriminatorSafely(serializer, typeName) { + return (typeName && + serializer.modelMappers[typeName] && + serializer.modelMappers[typeName].type.polymorphicDiscriminator); +} +// TODO: why is this here? +function serializeObject(toSerialize) { + var castToSerialize = toSerialize; + if (toSerialize == undefined) + return undefined; + if (toSerialize instanceof Uint8Array) { + toSerialize = encodeByteArray(toSerialize); + return toSerialize; } - var userAgentHeaderName = getValueOrFunctionResult(options.userAgentHeaderName, getDefaultUserAgentHeaderName); - var userAgentHeaderValue = getValueOrFunctionResult(options.userAgent, getDefaultUserAgentValue); - if (userAgentHeaderName && userAgentHeaderValue) { - factories.push(userAgentPolicy({ key: userAgentHeaderName, value: userAgentHeaderValue })); + else if (toSerialize instanceof Date) { + return toSerialize.toISOString(); } - factories.push(redirectPolicy()); - factories.push(rpRegistrationPolicy(options.rpRegistrationRetryTimeout)); - if (!options.noRetryPolicy) { - factories.push(exponentialRetryPolicy()); - factories.push(systemErrorRetryPolicy()); - factories.push(throttlingRetryPolicy()); + else if (Array.isArray(toSerialize)) { + var array = []; + for (var i = 0; i < toSerialize.length; i++) { + array.push(serializeObject(toSerialize[i])); + } + return array; } - factories.push(deserializationPolicy(options.deserializationContentTypes)); - { - factories.push(proxyPolicy(options.proxySettings)); + else if (typeof toSerialize === "object") { + var dictionary = {}; + for (var property in toSerialize) { + dictionary[property] = serializeObject(castToSerialize[property]); + } + return dictionary; } - factories.push(logPolicy({ logger: logger.info })); - return factories; + return toSerialize; } -function createPipelineFromOptions(pipelineOptions, authPolicyFactory) { - var requestPolicyFactories = []; - if (pipelineOptions.sendStreamingJson) { - requestPolicyFactories.push(ndJsonPolicy()); +/** + * Utility function to create a K:V from a list of strings + */ +function strEnum(o) { + var result = {}; + for (var _i = 0, o_1 = o; _i < o_1.length; _i++) { + var key = o_1[_i]; + result[key] = key; } - var userAgentValue = undefined; - if (pipelineOptions.userAgentOptions && pipelineOptions.userAgentOptions.userAgentPrefix) { - var userAgentInfo = []; - userAgentInfo.push(pipelineOptions.userAgentOptions.userAgentPrefix); - // Add the default user agent value if it isn't already specified - // by the userAgentPrefix option. - var defaultUserAgentInfo = getDefaultUserAgentValue(); - if (userAgentInfo.indexOf(defaultUserAgentInfo) === -1) { - userAgentInfo.push(defaultUserAgentInfo); + return result; +} +// eslint-disable-next-line @typescript-eslint/no-redeclare +var MapperType = strEnum([ + "Base64Url", + "Boolean", + "ByteArray", + "Composite", + "Date", + "DateTime", + "DateTimeRfc1123", + "Dictionary", + "Enum", + "Number", + "Object", + "Sequence", + "String", + "Stream", + "TimeSpan", + "UnixTime" +]); + +// Copyright (c) Microsoft Corporation. +function isWebResourceLike(object) { + if (object && typeof object === "object") { + var castObject = object; + if (typeof castObject.url === "string" && + typeof castObject.method === "string" && + typeof castObject.headers === "object" && + isHttpHeadersLike(castObject.headers) && + typeof castObject.validateRequestProperties === "function" && + typeof castObject.prepare === "function" && + typeof castObject.clone === "function") { + return true; } - userAgentValue = userAgentInfo.join(" "); - } - var keepAliveOptions = tslib.__assign(tslib.__assign({}, DefaultKeepAliveOptions), pipelineOptions.keepAliveOptions); - var retryOptions = tslib.__assign(tslib.__assign({}, DefaultRetryOptions), pipelineOptions.retryOptions); - var redirectOptions = tslib.__assign(tslib.__assign({}, DefaultRedirectOptions), pipelineOptions.redirectOptions); - { - requestPolicyFactories.push(proxyPolicy(pipelineOptions.proxyOptions)); - } - var deserializationOptions = tslib.__assign(tslib.__assign({}, DefaultDeserializationOptions), pipelineOptions.deserializationOptions); - var loggingOptions = tslib.__assign({}, pipelineOptions.loggingOptions); - requestPolicyFactories.push(tracingPolicy({ userAgent: userAgentValue }), keepAlivePolicy(keepAliveOptions), userAgentPolicy({ value: userAgentValue }), generateClientRequestIdPolicy(), deserializationPolicy(deserializationOptions.expectedContentTypes), throttlingRetryPolicy(), systemErrorRetryPolicy(), exponentialRetryPolicy(retryOptions.maxRetries, retryOptions.retryDelayInMs, retryOptions.maxRetryDelayInMs)); - if (redirectOptions.handleRedirects) { - requestPolicyFactories.push(redirectPolicy(redirectOptions.maxRetries)); - } - if (authPolicyFactory) { - requestPolicyFactories.push(authPolicyFactory); - } - requestPolicyFactories.push(logPolicy(loggingOptions)); - if (isNode && pipelineOptions.decompressResponse === false) { - requestPolicyFactories.push(disableResponseDecompressionPolicy()); } - return { - httpClient: pipelineOptions.httpClient, - requestPolicyFactories: requestPolicyFactories - }; -} -function getOperationArgumentValueFromParameter(serviceClient, operationArguments, parameter, serializer) { - return getOperationArgumentValueFromParameterPath(serviceClient, operationArguments, parameter.parameterPath, parameter.mapper, serializer); + return false; } -function getOperationArgumentValueFromParameterPath(serviceClient, operationArguments, parameterPath, parameterMapper, serializer) { - var _a; - var value; - if (typeof parameterPath === "string") { - parameterPath = [parameterPath]; +/** + * Creates a new WebResource object. + * + * This class provides an abstraction over a REST call by being library / implementation agnostic and wrapping the necessary + * properties to initiate a request. + */ +var WebResource = /** @class */ (function () { + function WebResource(url, method, body, query, headers, streamResponseBody, withCredentials, abortSignal, timeout, onUploadProgress, onDownloadProgress, proxySettings, keepAlive, decompressResponse, streamResponseStatusCodes) { + this.streamResponseBody = streamResponseBody; + this.streamResponseStatusCodes = streamResponseStatusCodes; + this.url = url || ""; + this.method = method || "GET"; + this.headers = isHttpHeadersLike(headers) ? headers : new HttpHeaders(headers); + this.body = body; + this.query = query; + this.formData = undefined; + this.withCredentials = withCredentials || false; + this.abortSignal = abortSignal; + this.timeout = timeout || 0; + this.onUploadProgress = onUploadProgress; + this.onDownloadProgress = onDownloadProgress; + this.proxySettings = proxySettings; + this.keepAlive = keepAlive; + this.decompressResponse = decompressResponse; + this.requestId = this.headers.get("x-ms-client-request-id") || generateUuid(); } - var serializerOptions = (_a = operationArguments.options) === null || _a === void 0 ? void 0 : _a.serializerOptions; - if (Array.isArray(parameterPath)) { - if (parameterPath.length > 0) { - if (parameterMapper.isConstant) { - value = parameterMapper.defaultValue; + /** + * Validates that the required properties such as method, url, headers["Content-Type"], + * headers["accept-language"] are defined. It will throw an error if one of the above + * mentioned properties are not defined. + */ + WebResource.prototype.validateRequestProperties = function () { + if (!this.method) { + throw new Error("WebResource.method is required."); + } + if (!this.url) { + throw new Error("WebResource.url is required."); + } + }; + /** + * Prepares the request. + * @param options - Options to provide for preparing the request. + * @returns Returns the prepared WebResource (HTTP Request) object that needs to be given to the request pipeline. + */ + WebResource.prototype.prepare = function (options) { + if (!options) { + throw new Error("options object is required"); + } + if (options.method === undefined || + options.method === null || + typeof options.method.valueOf() !== "string") { + throw new Error("options.method must be a string."); + } + if (options.url && options.pathTemplate) { + throw new Error("options.url and options.pathTemplate are mutually exclusive. Please provide exactly one of them."); + } + if ((options.pathTemplate === undefined || + options.pathTemplate === null || + typeof options.pathTemplate.valueOf() !== "string") && + (options.url === undefined || + options.url === null || + typeof options.url.valueOf() !== "string")) { + throw new Error("Please provide exactly one of options.pathTemplate or options.url."); + } + // set the url if it is provided. + if (options.url) { + if (typeof options.url !== "string") { + throw new Error('options.url must be of type "string".'); } - else { - var propertySearchResult = getPropertyFromParameterPath(operationArguments, parameterPath); - if (!propertySearchResult.propertyFound) { - propertySearchResult = getPropertyFromParameterPath(serviceClient, parameterPath); - } - var useDefaultValue = false; - if (!propertySearchResult.propertyFound) { - useDefaultValue = - parameterMapper.required || - (parameterPath[0] === "options" && parameterPath.length === 2); - } - value = useDefaultValue ? parameterMapper.defaultValue : propertySearchResult.propertyValue; + this.url = options.url; + } + // set the method + if (options.method) { + var validMethods = ["GET", "PUT", "HEAD", "DELETE", "OPTIONS", "POST", "PATCH", "TRACE"]; + if (validMethods.indexOf(options.method.toUpperCase()) === -1) { + throw new Error('The provided method "' + + options.method + + '" is invalid. Supported HTTP methods are: ' + + JSON.stringify(validMethods)); } - // Serialize just for validation purposes. - var parameterPathString = getPathStringFromParameterPath(parameterPath, parameterMapper); - serializer.serialize(parameterMapper, value, parameterPathString, serializerOptions); } - } - else { - if (parameterMapper.required) { - value = {}; + this.method = options.method.toUpperCase(); + // construct the url if path template is provided + if (options.pathTemplate) { + var pathTemplate_1 = options.pathTemplate, pathParameters_1 = options.pathParameters; + if (typeof pathTemplate_1 !== "string") { + throw new Error('options.pathTemplate must be of type "string".'); + } + if (!options.baseUrl) { + options.baseUrl = "https://management.azure.com"; + } + var baseUrl = options.baseUrl; + var url_1 = baseUrl + + (baseUrl.endsWith("/") ? "" : "/") + + (pathTemplate_1.startsWith("/") ? pathTemplate_1.slice(1) : pathTemplate_1); + var segments = url_1.match(/({[\w-]*\s*[\w-]*})/gi); + if (segments && segments.length) { + if (!pathParameters_1) { + throw new Error("pathTemplate: " + pathTemplate_1 + " has been provided. Hence, options.pathParameters must also be provided."); + } + segments.forEach(function (item) { + var pathParamName = item.slice(1, -1); + var pathParam = pathParameters_1[pathParamName]; + if (pathParam === null || + pathParam === undefined || + !(typeof pathParam === "string" || typeof pathParam === "object")) { + var stringifiedPathParameters = JSON.stringify(pathParameters_1, undefined, 2); + throw new Error("pathTemplate: " + pathTemplate_1 + " contains the path parameter " + pathParamName + + (" however, it is not present in parameters: " + stringifiedPathParameters + ".") + + ("The value of the path parameter can either be a \"string\" of the form { " + pathParamName + ": \"some sample value\" } or ") + + ("it can be an \"object\" of the form { \"" + pathParamName + "\": { value: \"some sample value\", skipUrlEncoding: true } }.")); + } + if (typeof pathParam.valueOf() === "string") { + url_1 = url_1.replace(item, encodeURIComponent(pathParam)); + } + if (typeof pathParam.valueOf() === "object") { + if (!pathParam.value) { + throw new Error("options.pathParameters[" + pathParamName + "] is of type \"object\" but it does not contain a \"value\" property."); + } + if (pathParam.skipUrlEncoding) { + url_1 = url_1.replace(item, pathParam.value); + } + else { + url_1 = url_1.replace(item, encodeURIComponent(pathParam.value)); + } + } + }); + } + this.url = url_1; } - for (var propertyName in parameterPath) { - var propertyMapper = parameterMapper.type.modelProperties[propertyName]; - var propertyPath = parameterPath[propertyName]; - var propertyValue = getOperationArgumentValueFromParameterPath(serviceClient, operationArguments, propertyPath, propertyMapper, serializer); - // Serialize just for validation purposes. - var propertyPathString = getPathStringFromParameterPath(propertyPath, propertyMapper); - serializer.serialize(propertyMapper, propertyValue, propertyPathString, serializerOptions); - if (propertyValue !== undefined && propertyValue !== null) { - if (!value) { - value = {}; + // append query parameters to the url if they are provided. They can be provided with pathTemplate or url option. + if (options.queryParameters) { + var queryParameters = options.queryParameters; + if (typeof queryParameters !== "object") { + throw new Error("options.queryParameters must be of type object. It should be a JSON object " + + "of \"query-parameter-name\" as the key and the \"query-parameter-value\" as the value. " + + "The \"query-parameter-value\" may be fo type \"string\" or an \"object\" of the form { value: \"query-parameter-value\", skipUrlEncoding: true }."); + } + // append question mark if it is not present in the url + if (this.url && this.url.indexOf("?") === -1) { + this.url += "?"; + } + // construct queryString + var queryParams = []; + // We need to populate this.query as a dictionary if the request is being used for Sway's validateRequest(). + this.query = {}; + for (var queryParamName in queryParameters) { + var queryParam = queryParameters[queryParamName]; + if (queryParam) { + if (typeof queryParam === "string") { + queryParams.push(queryParamName + "=" + encodeURIComponent(queryParam)); + this.query[queryParamName] = encodeURIComponent(queryParam); + } + else if (typeof queryParam === "object") { + if (!queryParam.value) { + throw new Error("options.queryParameters[" + queryParamName + "] is of type \"object\" but it does not contain a \"value\" property."); + } + if (queryParam.skipUrlEncoding) { + queryParams.push(queryParamName + "=" + queryParam.value); + this.query[queryParamName] = queryParam.value; + } + else { + queryParams.push(queryParamName + "=" + encodeURIComponent(queryParam.value)); + this.query[queryParamName] = encodeURIComponent(queryParam.value); + } + } } - value[propertyName] = propertyValue; + } // end-of-for + // append the queryString + this.url += queryParams.join("&"); + } + // add headers to the request if they are provided + if (options.headers) { + var headers = options.headers; + for (var _i = 0, _a = Object.keys(options.headers); _i < _a.length; _i++) { + var headerName = _a[_i]; + this.headers.set(headerName, headers[headerName]); } } - } - return value; -} -function getPropertyFromParameterPath(parent, parameterPath) { - var result = { propertyFound: false }; - var i = 0; - for (; i < parameterPath.length; ++i) { - var parameterPathPart = parameterPath[i]; - // Make sure to check inherited properties too, so don't use hasOwnProperty(). - if (parent !== undefined && parent !== null && parameterPathPart in parent) { - parent = parent[parameterPathPart]; + // ensure accept-language is set correctly + if (!this.headers.get("accept-language")) { + this.headers.set("accept-language", "en-US"); } - else { - break; + // ensure the request-id is set correctly + if (!this.headers.get("x-ms-client-request-id") && !options.disableClientRequestId) { + this.headers.set("x-ms-client-request-id", this.requestId); } - } - if (i === parameterPath.length) { - result.propertyValue = parent; - result.propertyFound = true; - } - return result; -} -function flattenResponse(_response, responseSpec) { - var parsedHeaders = _response.parsedHeaders; - var bodyMapper = responseSpec && responseSpec.bodyMapper; - var addOperationResponse = function (obj) { - return Object.defineProperty(obj, "_response", { - value: _response - }); - }; - if (bodyMapper) { - var typeName = bodyMapper.type.name; - if (typeName === "Stream") { - return addOperationResponse(tslib.__assign(tslib.__assign({}, parsedHeaders), { blobBody: _response.blobBody, readableStreamBody: _response.readableStreamBody })); + // default + if (!this.headers.get("Content-Type")) { + this.headers.set("Content-Type", "application/json; charset=utf-8"); } - var modelProperties_1 = (typeName === "Composite" && bodyMapper.type.modelProperties) || {}; - var isPageableResponse = Object.keys(modelProperties_1).some(function (k) { return modelProperties_1[k].serializedName === ""; }); - if (typeName === "Sequence" || isPageableResponse) { - var arrayResponse = tslib.__spreadArray([], (_response.parsedBody || [])); - for (var _i = 0, _a = Object.keys(modelProperties_1); _i < _a.length; _i++) { - var key = _a[_i]; - if (modelProperties_1[key].serializedName) { - arrayResponse[key] = _response.parsedBody[key]; + // set the request body. request.js automatically sets the Content-Length request header, so we need not set it explicitly + this.body = options.body; + if (options.body !== undefined && options.body !== null) { + // body as a stream special case. set the body as-is and check for some special request headers specific to sending a stream. + if (options.bodyIsStream) { + if (!this.headers.get("Transfer-Encoding")) { + this.headers.set("Transfer-Encoding", "chunked"); + } + if (this.headers.get("Content-Type") !== "application/octet-stream") { + this.headers.set("Content-Type", "application/octet-stream"); } } - if (parsedHeaders) { - for (var _b = 0, _c = Object.keys(parsedHeaders); _b < _c.length; _b++) { - var key = _c[_b]; - arrayResponse[key] = parsedHeaders[key]; + else { + if (options.serializationMapper) { + this.body = new Serializer(options.mappers).serialize(options.serializationMapper, options.body, "requestBody"); + } + if (!options.disableJsonStringifyOnBody) { + this.body = JSON.stringify(options.body); } } - addOperationResponse(arrayResponse); - return arrayResponse; } - if (typeName === "Composite" || typeName === "Dictionary") { - return addOperationResponse(tslib.__assign(tslib.__assign({}, parsedHeaders), _response.parsedBody)); + if (options.spanOptions) { + this.spanOptions = options.spanOptions; } - } - if (bodyMapper || - _response.request.method === "HEAD" || - isPrimitiveType(_response.parsedBody)) { - // primitive body types and HEAD booleans - return addOperationResponse(tslib.__assign(tslib.__assign({}, parsedHeaders), { body: _response.parsedBody })); - } - return addOperationResponse(tslib.__assign(tslib.__assign({}, parsedHeaders), _response.parsedBody)); -} -function getCredentialScopes(options, baseUri) { - if (options === null || options === void 0 ? void 0 : options.credentialScopes) { - var scopes = options.credentialScopes; - return Array.isArray(scopes) - ? scopes.map(function (scope) { return new url.URL(scope).toString(); }) - : new url.URL(scopes).toString(); - } - if (baseUri) { - return baseUri + "/.default"; - } - return undefined; -} - -// Copyright (c) Microsoft Corporation. -/** - * This function is only here for compatibility. Use createSpanFunction in core-tracing. - * - * @deprecated This function is only here for compatibility. Use createSpanFunction in core-tracing. - * @hidden - - * @param spanConfig - The name of the operation being performed. - * @param tracingOptions - The options for the underlying http request. - */ -function createSpanFunction(args) { - return coreTracing.createSpanFunction(args); -} - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * Defines the default token refresh buffer duration. - */ -var TokenRefreshBufferMs = 2 * 60 * 1000; // 2 Minutes -/** - * Provides an {@link AccessTokenCache} implementation which clears - * the cached {@link AccessToken}'s after the expiresOnTimestamp has - * passed. - * - * @deprecated No longer used in the bearer authorization policy. - */ -var ExpiringAccessTokenCache = /** @class */ (function () { + if (options.tracingContext) { + this.tracingContext = options.tracingContext; + } + this.abortSignal = options.abortSignal; + this.onDownloadProgress = options.onDownloadProgress; + this.onUploadProgress = options.onUploadProgress; + return this; + }; /** - * Constructs an instance of {@link ExpiringAccessTokenCache} with - * an optional expiration buffer time. + * Clone this WebResource HTTP request object. + * @returns The clone of this WebResource HTTP request object. */ - function ExpiringAccessTokenCache(tokenRefreshBufferMs) { - if (tokenRefreshBufferMs === void 0) { tokenRefreshBufferMs = TokenRefreshBufferMs; } - this.cachedToken = undefined; - this.tokenRefreshBufferMs = tokenRefreshBufferMs; - } - ExpiringAccessTokenCache.prototype.setCachedToken = function (accessToken) { - this.cachedToken = accessToken; - }; - ExpiringAccessTokenCache.prototype.getCachedToken = function () { - if (this.cachedToken && - Date.now() + this.tokenRefreshBufferMs >= this.cachedToken.expiresOnTimestamp) { - this.cachedToken = undefined; + WebResource.prototype.clone = function () { + var result = new WebResource(this.url, this.method, this.body, this.query, this.headers && this.headers.clone(), this.streamResponseBody, this.withCredentials, this.abortSignal, this.timeout, this.onUploadProgress, this.onDownloadProgress, this.proxySettings, this.keepAlive, this.decompressResponse, this.streamResponseStatusCodes); + if (this.formData) { + result.formData = this.formData; } - return this.cachedToken; + if (this.operationSpec) { + result.operationSpec = this.operationSpec; + } + if (this.shouldDeserialize) { + result.shouldDeserialize = this.shouldDeserialize; + } + if (this.operationResponseGetter) { + result.operationResponseGetter = this.operationResponseGetter; + } + return result; }; - return ExpiringAccessTokenCache; + return WebResource; }()); +// Copyright (c) Microsoft Corporation. +var custom = util.inspect.custom; + // Copyright (c) Microsoft Corporation. /** - * Helps the core-http token authentication policies with requesting a new token if we're not currently waiting for a new token. - * - * @deprecated No longer used in the bearer authorization policy. + * A class that handles the query portion of a URLBuilder. */ -var AccessTokenRefresher = /** @class */ (function () { - function AccessTokenRefresher(credential, scopes, requiredMillisecondsBeforeNewRefresh) { - if (requiredMillisecondsBeforeNewRefresh === void 0) { requiredMillisecondsBeforeNewRefresh = 30000; } - this.credential = credential; - this.scopes = scopes; - this.requiredMillisecondsBeforeNewRefresh = requiredMillisecondsBeforeNewRefresh; - this.lastCalled = 0; +var URLQuery = /** @class */ (function () { + function URLQuery() { + this._rawQuery = {}; } /** - * Returns true if the required milliseconds(defaulted to 30000) have been passed signifying - * that we are ready for a new refresh. + * Get whether or not there any query parameters in this URLQuery. */ - AccessTokenRefresher.prototype.isReady = function () { - // We're only ready for a new refresh if the required milliseconds have passed. - return (!this.lastCalled || Date.now() - this.lastCalled > this.requiredMillisecondsBeforeNewRefresh); + URLQuery.prototype.any = function () { + return Object.keys(this._rawQuery).length > 0; }; /** - * Stores the time in which it is called, - * then requests a new token, - * then sets this.promise to undefined, - * then returns the token. + * Get the keys of the query string. */ - AccessTokenRefresher.prototype.getToken = function (options) { - return tslib.__awaiter(this, void 0, void 0, function () { - var token; - return tslib.__generator(this, function (_a) { - switch (_a.label) { - case 0: - this.lastCalled = Date.now(); - return [4 /*yield*/, this.credential.getToken(this.scopes, options)]; - case 1: - token = _a.sent(); - this.promise = undefined; - return [2 /*return*/, token || undefined]; - } - }); - }); + URLQuery.prototype.keys = function () { + return Object.keys(this._rawQuery); }; /** - * Requests a new token if we're not currently waiting for a new token. - * Returns null if the required time between each call hasn't been reached. + * Set a query parameter with the provided name and value. If the parameterValue is undefined or + * empty, then this will attempt to remove an existing query parameter with the provided + * parameterName. */ - AccessTokenRefresher.prototype.refresh = function (options) { - if (!this.promise) { - this.promise = this.getToken(options); + URLQuery.prototype.set = function (parameterName, parameterValue) { + var caseParameterValue = parameterValue; + if (parameterName) { + if (caseParameterValue !== undefined && caseParameterValue !== null) { + var newValue = Array.isArray(caseParameterValue) + ? caseParameterValue + : caseParameterValue.toString(); + this._rawQuery[parameterName] = newValue; + } + else { + delete this._rawQuery[parameterName]; + } } - return this.promise; }; - return AccessTokenRefresher; -}()); - -// Copyright (c) Microsoft Corporation. -var HeaderConstants = Constants.HeaderConstants; -var DEFAULT_AUTHORIZATION_SCHEME = "Basic"; -var BasicAuthenticationCredentials = /** @class */ (function () { /** - * Creates a new BasicAuthenticationCredentials object. - * - * @param userName - User name. - * @param password - Password. - * @param authorizationScheme - The authorization scheme. + * Get the value of the query parameter with the provided name. If no parameter exists with the + * provided parameter name, then undefined will be returned. */ - function BasicAuthenticationCredentials(userName, password, authorizationScheme) { - if (authorizationScheme === void 0) { authorizationScheme = DEFAULT_AUTHORIZATION_SCHEME; } - this.authorizationScheme = DEFAULT_AUTHORIZATION_SCHEME; - if (userName === null || userName === undefined || typeof userName.valueOf() !== "string") { - throw new Error("userName cannot be null or undefined and must be of type string."); - } - if (password === null || password === undefined || typeof password.valueOf() !== "string") { - throw new Error("password cannot be null or undefined and must be of type string."); + URLQuery.prototype.get = function (parameterName) { + return parameterName ? this._rawQuery[parameterName] : undefined; + }; + /** + * Get the string representation of this query. The return value will not start with a "?". + */ + URLQuery.prototype.toString = function () { + var result = ""; + for (var parameterName in this._rawQuery) { + if (result) { + result += "&"; + } + var parameterValue = this._rawQuery[parameterName]; + if (Array.isArray(parameterValue)) { + var parameterStrings = []; + for (var _i = 0, parameterValue_1 = parameterValue; _i < parameterValue_1.length; _i++) { + var parameterValueElement = parameterValue_1[_i]; + parameterStrings.push(parameterName + "=" + parameterValueElement); + } + result += parameterStrings.join("&"); + } + else { + result += parameterName + "=" + parameterValue; + } } - this.userName = userName; - this.password = password; - this.authorizationScheme = authorizationScheme; - } + return result; + }; /** - * Signs a request with the Authentication header. - * - * @param webResource - The WebResourceLike to be signed. - * @returns The signed request object. + * Parse a URLQuery from the provided text. */ - BasicAuthenticationCredentials.prototype.signRequest = function (webResource) { - var credentials = this.userName + ":" + this.password; - var encodedCredentials = this.authorizationScheme + " " + encodeString(credentials); - if (!webResource.headers) - webResource.headers = new HttpHeaders(); - webResource.headers.set(HeaderConstants.AUTHORIZATION, encodedCredentials); - return Promise.resolve(webResource); + URLQuery.parse = function (text) { + var result = new URLQuery(); + if (text) { + if (text.startsWith("?")) { + text = text.substring(1); + } + var currentState = "ParameterName"; + var parameterName = ""; + var parameterValue = ""; + for (var i = 0; i < text.length; ++i) { + var currentCharacter = text[i]; + switch (currentState) { + case "ParameterName": + switch (currentCharacter) { + case "=": + currentState = "ParameterValue"; + break; + case "&": + parameterName = ""; + parameterValue = ""; + break; + default: + parameterName += currentCharacter; + break; + } + break; + case "ParameterValue": + switch (currentCharacter) { + case "&": + result.set(parameterName, parameterValue); + parameterName = ""; + parameterValue = ""; + currentState = "ParameterName"; + break; + default: + parameterValue += currentCharacter; + break; + } + break; + default: + throw new Error("Unrecognized URLQuery parse state: " + currentState); + } + } + if (currentState === "ParameterValue") { + result.set(parameterName, parameterValue); + } + } + return result; }; - return BasicAuthenticationCredentials; + return URLQuery; }()); - -// Copyright (c) Microsoft Corporation. /** - * Authenticates to a service using an API key. + * A class that handles creating, modifying, and parsing URLs. */ -var ApiKeyCredentials = /** @class */ (function () { +var URLBuilder = /** @class */ (function () { + function URLBuilder() { + } /** - * @param options - Specifies the options to be provided for auth. Either header or query needs to be provided. + * Set the scheme/protocol for this URL. If the provided scheme contains other parts of a URL + * (such as a host, port, path, or query), those parts will be added to this URL as well. */ - function ApiKeyCredentials(options) { - if (!options || (options && !options.inHeader && !options.inQuery)) { - throw new Error("options cannot be null or undefined. Either \"inHeader\" or \"inQuery\" property of the options object needs to be provided."); + URLBuilder.prototype.setScheme = function (scheme) { + if (!scheme) { + this._scheme = undefined; } - this.inHeader = options.inHeader; - this.inQuery = options.inQuery; - } + else { + this.set(scheme, "SCHEME"); + } + }; /** - * Signs a request with the values provided in the inHeader and inQuery parameter. - * - * @param webResource - The WebResourceLike to be signed. - * @returns The signed request object. + * Get the scheme that has been set in this URL. */ - ApiKeyCredentials.prototype.signRequest = function (webResource) { - if (!webResource) { - return Promise.reject(new Error("webResource cannot be null or undefined and must be of type \"object\".")); + URLBuilder.prototype.getScheme = function () { + return this._scheme; + }; + /** + * Set the host for this URL. If the provided host contains other parts of a URL (such as a + * port, path, or query), those parts will be added to this URL as well. + */ + URLBuilder.prototype.setHost = function (host) { + if (!host) { + this._host = undefined; } - if (this.inHeader) { - if (!webResource.headers) { - webResource.headers = new HttpHeaders(); - } - for (var headerName in this.inHeader) { - webResource.headers.set(headerName, this.inHeader[headerName]); - } + else { + this.set(host, "SCHEME_OR_HOST"); } - if (this.inQuery) { - if (!webResource.url) { - return Promise.reject(new Error("url cannot be null in the request object.")); - } - if (webResource.url.indexOf("?") < 0) { - webResource.url += "?"; - } - for (var key in this.inQuery) { - if (!webResource.url.endsWith("?")) { - webResource.url += "&"; - } - webResource.url += key + "=" + this.inQuery[key]; - } + }; + /** + * Get the host that has been set in this URL. + */ + URLBuilder.prototype.getHost = function () { + return this._host; + }; + /** + * Set the port for this URL. If the provided port contains other parts of a URL (such as a + * path or query), those parts will be added to this URL as well. + */ + URLBuilder.prototype.setPort = function (port) { + if (port === undefined || port === null || port === "") { + this._port = undefined; + } + else { + this.set(port.toString(), "PORT"); } - return Promise.resolve(webResource); }; - return ApiKeyCredentials; -}()); - -// Copyright (c) Microsoft Corporation. -var TopicCredentials = /** @class */ (function (_super) { - tslib.__extends(TopicCredentials, _super); /** - * Creates a new EventGrid TopicCredentials object. - * - * @param topicKey - The EventGrid topic key + * Get the port that has been set in this URL. */ - function TopicCredentials(topicKey) { - var _this = this; - if (!topicKey || (topicKey && typeof topicKey !== "string")) { - throw new Error("topicKey cannot be null or undefined and must be of type string."); + URLBuilder.prototype.getPort = function () { + return this._port; + }; + /** + * Set the path for this URL. If the provided path contains a query, then it will be added to + * this URL as well. + */ + URLBuilder.prototype.setPath = function (path) { + if (!path) { + this._path = undefined; } - var options = { - inHeader: { - "aeg-sas-key": topicKey + else { + var schemeIndex = path.indexOf("://"); + if (schemeIndex !== -1) { + var schemeStart = path.lastIndexOf("/", schemeIndex); + // Make sure to only grab the URL part of the path before setting the state back to SCHEME + // this will handle cases such as "/a/b/c/https://microsoft.com" => "https://microsoft.com" + this.set(schemeStart === -1 ? path : path.substr(schemeStart + 1), "SCHEME"); } - }; - _this = _super.call(this, options) || this; - return _this; - } - return TopicCredentials; -}(ApiKeyCredentials)); - -Object.defineProperty(exports, "isTokenCredential", ({ - enumerable: true, - get: function () { - return coreAuth.isTokenCredential; - } -})); -exports.AccessTokenRefresher = AccessTokenRefresher; -exports.ApiKeyCredentials = ApiKeyCredentials; -exports.BaseRequestPolicy = BaseRequestPolicy; -exports.BasicAuthenticationCredentials = BasicAuthenticationCredentials; -exports.Constants = Constants; -exports.DefaultHttpClient = NodeFetchHttpClient; -exports.ExpiringAccessTokenCache = ExpiringAccessTokenCache; -exports.HttpHeaders = HttpHeaders; -exports.MapperType = MapperType; -exports.RequestPolicyOptions = RequestPolicyOptions; -exports.RestError = RestError; -exports.Serializer = Serializer; -exports.ServiceClient = ServiceClient; -exports.TopicCredentials = TopicCredentials; -exports.URLBuilder = URLBuilder; -exports.URLQuery = URLQuery; -exports.WebResource = WebResource; -exports.XML_ATTRKEY = XML_ATTRKEY; -exports.XML_CHARKEY = XML_CHARKEY; -exports.applyMixins = applyMixins; -exports.bearerTokenAuthenticationPolicy = bearerTokenAuthenticationPolicy; -exports.createPipelineFromOptions = createPipelineFromOptions; -exports.createSpanFunction = createSpanFunction; -exports.delay = delay; -exports.deserializationPolicy = deserializationPolicy; -exports.deserializeResponseBody = deserializeResponseBody; -exports.disableResponseDecompressionPolicy = disableResponseDecompressionPolicy; -exports.encodeUri = encodeUri; -exports.executePromisesSequentially = executePromisesSequentially; -exports.exponentialRetryPolicy = exponentialRetryPolicy; -exports.flattenResponse = flattenResponse; -exports.generateClientRequestIdPolicy = generateClientRequestIdPolicy; -exports.generateUuid = generateUuid; -exports.getDefaultProxySettings = getDefaultProxySettings; -exports.getDefaultUserAgentValue = getDefaultUserAgentValue; -exports.isDuration = isDuration; -exports.isNode = isNode; -exports.isValidUuid = isValidUuid; -exports.keepAlivePolicy = keepAlivePolicy; -exports.logPolicy = logPolicy; -exports.operationOptionsToRequestOptionsBase = operationOptionsToRequestOptionsBase; -exports.parseXML = parseXML; -exports.promiseToCallback = promiseToCallback; -exports.promiseToServiceCallback = promiseToServiceCallback; -exports.proxyPolicy = proxyPolicy; -exports.redirectPolicy = redirectPolicy; -exports.serializeObject = serializeObject; -exports.signingPolicy = signingPolicy; -exports.stringifyXML = stringifyXML; -exports.stripRequest = stripRequest; -exports.stripResponse = stripResponse; -exports.systemErrorRetryPolicy = systemErrorRetryPolicy; -exports.throttlingRetryPolicy = throttlingRetryPolicy; -exports.tracingPolicy = tracingPolicy; -exports.userAgentPolicy = userAgentPolicy; -//# sourceMappingURL=index.js.map - - -/***/ }), - -/***/ 1754: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -var api = __nccwpck_require__(6865); -var tslib = __nccwpck_require__(2107); - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -/** - * A no-op implementation of Span that can safely be used without side-effects. - */ -var NoOpSpan = /** @class */ (function () { - function NoOpSpan() { - } + else { + this.set(path, "PATH"); + } + } + }; /** - * Returns the SpanContext associated with this Span. + * Append the provided path to this URL's existing path. If the provided path contains a query, + * then it will be added to this URL as well. */ - NoOpSpan.prototype.context = function () { - return { - spanId: "", - traceId: "", - traceFlags: 0 /* NONE */ - }; + URLBuilder.prototype.appendPath = function (path) { + if (path) { + var currentPath = this.getPath(); + if (currentPath) { + if (!currentPath.endsWith("/")) { + currentPath += "/"; + } + if (path.startsWith("/")) { + path = path.substring(1); + } + path = currentPath + path; + } + this.set(path, "PATH"); + } }; /** - * Marks the end of Span execution. - * @param _endTime - The time to use as the Span's end time. Defaults to - * the current time. + * Get the path that has been set in this URL. */ - NoOpSpan.prototype.end = function (_endTime) { - /* Noop */ + URLBuilder.prototype.getPath = function () { + return this._path; }; /** - * Sets an attribute on the Span - * @param _key - The attribute key - * @param _value - The attribute value + * Set the query in this URL. */ - NoOpSpan.prototype.setAttribute = function (_key, _value) { - return this; + URLBuilder.prototype.setQuery = function (query) { + if (!query) { + this._query = undefined; + } + else { + this._query = URLQuery.parse(query); + } }; /** - * Sets attributes on the Span - * @param _attributes - The attributes to add + * Set a query parameter with the provided name and value in this URL's query. If the provided + * query parameter value is undefined or empty, then the query parameter will be removed if it + * existed. */ - NoOpSpan.prototype.setAttributes = function (_attributes) { - return this; + URLBuilder.prototype.setQueryParameter = function (queryParameterName, queryParameterValue) { + if (queryParameterName) { + if (!this._query) { + this._query = new URLQuery(); + } + this._query.set(queryParameterName, queryParameterValue); + } }; /** - * Adds an event to the Span - * @param _name - The name of the event - * @param _attributes - The associated attributes to add for this event + * Get the value of the query parameter with the provided query parameter name. If no query + * parameter exists with the provided name, then undefined will be returned. */ - NoOpSpan.prototype.addEvent = function (_name, _attributes) { - return this; + URLBuilder.prototype.getQueryParameterValue = function (queryParameterName) { + return this._query ? this._query.get(queryParameterName) : undefined; }; /** - * Sets a status on the span. Overrides the default of SpanStatusCode.OK. - * @param _status - The status to set. + * Get the query in this URL. */ - NoOpSpan.prototype.setStatus = function (_status) { - return this; + URLBuilder.prototype.getQuery = function () { + return this._query ? this._query.toString() : undefined; }; /** - * Updates the name of the Span - * @param _name - the new Span name + * Set the parts of this URL by parsing the provided text using the provided startState. */ - NoOpSpan.prototype.updateName = function (_name) { - return this; + URLBuilder.prototype.set = function (text, startState) { + var tokenizer = new URLTokenizer(text, startState); + while (tokenizer.next()) { + var token = tokenizer.current(); + var tokenPath = void 0; + if (token) { + switch (token.type) { + case "SCHEME": + this._scheme = token.text || undefined; + break; + case "HOST": + this._host = token.text || undefined; + break; + case "PORT": + this._port = token.text || undefined; + break; + case "PATH": + tokenPath = token.text || undefined; + if (!this._path || this._path === "/" || tokenPath !== "/") { + this._path = tokenPath; + } + break; + case "QUERY": + this._query = URLQuery.parse(token.text); + break; + default: + throw new Error("Unrecognized URLTokenType: " + token.type); + } + } + } }; - /** - * Returns whether this span will be recorded - */ - NoOpSpan.prototype.isRecording = function () { - return false; + URLBuilder.prototype.toString = function () { + var result = ""; + if (this._scheme) { + result += this._scheme + "://"; + } + if (this._host) { + result += this._host; + } + if (this._port) { + result += ":" + this._port; + } + if (this._path) { + if (!this._path.startsWith("/")) { + result += "/"; + } + result += this._path; + } + if (this._query && this._query.any()) { + result += "?" + this._query.toString(); + } + return result; }; /** - * Sets exception as a span event - * @param exception - the exception the only accepted values are string or Error - * @param time - the time to set as Span's event time. If not provided, - * use the current time. + * If the provided searchValue is found in this URLBuilder, then replace it with the provided + * replaceValue. */ - NoOpSpan.prototype.recordException = function (_exception, _time) { - /* do nothing */ + URLBuilder.prototype.replaceAll = function (searchValue, replaceValue) { + if (searchValue) { + this.setScheme(replaceAll(this.getScheme(), searchValue, replaceValue)); + this.setHost(replaceAll(this.getHost(), searchValue, replaceValue)); + this.setPort(replaceAll(this.getPort(), searchValue, replaceValue)); + this.setPath(replaceAll(this.getPath(), searchValue, replaceValue)); + this.setQuery(replaceAll(this.getQuery(), searchValue, replaceValue)); + } }; - return NoOpSpan; + URLBuilder.parse = function (text) { + var result = new URLBuilder(); + result.set(text, "SCHEME_OR_HOST"); + return result; + }; + return URLBuilder; }()); - -// Copyright (c) Microsoft Corporation. -/** - * A no-op implementation of Tracer that can be used when tracing - * is disabled. - */ -var NoOpTracer = /** @class */ (function () { - function NoOpTracer() { +var URLToken = /** @class */ (function () { + function URLToken(text, type) { + this.text = text; + this.type = type; } - /** - * Starts a new Span. - * @param _name - The name of the span. - * @param _options - The SpanOptions used during Span creation. - */ - NoOpTracer.prototype.startSpan = function (_name, _options) { - return new NoOpSpan(); + URLToken.scheme = function (text) { + return new URLToken(text, "SCHEME"); }; - /** - * Returns the current Span from the current context, if available. - */ - NoOpTracer.prototype.getCurrentSpan = function () { - return new NoOpSpan(); + URLToken.host = function (text) { + return new URLToken(text, "HOST"); + }; + URLToken.port = function (text) { + return new URLToken(text, "PORT"); + }; + URLToken.path = function (text) { + return new URLToken(text, "PATH"); + }; + URLToken.query = function (text) { + return new URLToken(text, "QUERY"); }; + return URLToken; +}()); +/** + * Get whether or not the provided character (single character string) is an alphanumeric (letter or + * digit) character. + */ +function isAlphaNumericCharacter(character) { + var characterCode = character.charCodeAt(0); + return ((48 /* '0' */ <= characterCode && characterCode <= 57) /* '9' */ || + (65 /* 'A' */ <= characterCode && characterCode <= 90) /* 'Z' */ || + (97 /* 'a' */ <= characterCode && characterCode <= 122) /* 'z' */); +} +/** + * A class that tokenizes URL strings. + */ +var URLTokenizer = /** @class */ (function () { + function URLTokenizer(_text, state) { + this._text = _text; + this._textLength = _text ? _text.length : 0; + this._currentState = state !== undefined && state !== null ? state : "SCHEME_OR_HOST"; + this._currentIndex = 0; + } /** - * Executes the given function within the context provided by a Span. - * @param _span - The span that provides the context. - * @param fn - The function to be executed. + * Get the current URLToken this URLTokenizer is pointing at, or undefined if the URLTokenizer + * hasn't started or has finished tokenizing. */ - NoOpTracer.prototype.withSpan = function (_span, fn) { - return fn(); + URLTokenizer.prototype.current = function () { + return this._currentToken; }; /** - * Bind a Span as the target's scope - * @param target - An object to bind the scope. - * @param _span - A specific Span to use. Otherwise, use the current one. + * Advance to the next URLToken and return whether or not a URLToken was found. */ - NoOpTracer.prototype.bind = function (target, _span) { - return target; - }; - return NoOpTracer; -}()); - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -function getGlobalObject() { - return global; -} - -// Copyright (c) Microsoft Corporation. -// V1 = OpenTelemetry 0.1 -// V2 = OpenTelemetry 0.2 -// V3 = OpenTelemetry 0.6.1 -// V4 = OpenTelemetry 1.0.0-rc.0 -var GLOBAL_TRACER_VERSION = 4; -// preview5 shipped with @azure/core-tracing.tracerCache -// and didn't have smart detection for collisions -var GLOBAL_TRACER_SYMBOL = Symbol.for("@azure/core-tracing.tracerCache3"); -var cache; -function loadTracerCache() { - var globalObj = getGlobalObject(); - var existingCache = globalObj[GLOBAL_TRACER_SYMBOL]; - var setGlobalCache = true; - if (existingCache) { - if (existingCache.version === GLOBAL_TRACER_VERSION) { - cache = existingCache; + URLTokenizer.prototype.next = function () { + if (!hasCurrentCharacter(this)) { + this._currentToken = undefined; } else { - setGlobalCache = false; - if (existingCache.tracer) { - throw new Error("Two incompatible versions of @azure/core-tracing have been loaded.\n This library is " + GLOBAL_TRACER_VERSION + ", existing is " + existingCache.version + "."); + switch (this._currentState) { + case "SCHEME": + nextScheme(this); + break; + case "SCHEME_OR_HOST": + nextSchemeOrHost(this); + break; + case "HOST": + nextHost(this); + break; + case "PORT": + nextPort(this); + break; + case "PATH": + nextPath(this); + break; + case "QUERY": + nextQuery(this); + break; + default: + throw new Error("Unrecognized URLTokenizerState: " + this._currentState); } } + return !!this._currentToken; + }; + return URLTokenizer; +}()); +/** + * Read the remaining characters from this Tokenizer's character stream. + */ +function readRemaining(tokenizer) { + var result = ""; + if (tokenizer._currentIndex < tokenizer._textLength) { + result = tokenizer._text.substring(tokenizer._currentIndex); + tokenizer._currentIndex = tokenizer._textLength; } - if (!cache) { - cache = { - tracer: undefined, - version: GLOBAL_TRACER_VERSION - }; - } - if (setGlobalCache) { - globalObj[GLOBAL_TRACER_SYMBOL] = cache; - } -} -function getCache() { - if (!cache) { - loadTracerCache(); - } - return cache; -} - -// Copyright (c) Microsoft Corporation. -var defaultTracer; -function getDefaultTracer() { - if (!defaultTracer) { - defaultTracer = new NoOpTracer(); - } - return defaultTracer; + return result; } /** - * Sets the global tracer, enabling tracing for the Azure SDK. - * @param tracer - An OpenTelemetry Tracer instance. + * Whether or not this URLTokenizer has a current character. */ -function setTracer(tracer) { - var cache = getCache(); - cache.tracer = tracer; +function hasCurrentCharacter(tokenizer) { + return tokenizer._currentIndex < tokenizer._textLength; } /** - * Retrieves the active tracer, or returns a - * no-op implementation if one is not set. + * Get the character in the text string at the current index. */ -function getTracer() { - var cache = getCache(); - if (!cache.tracer) { - return getDefaultTracer(); - } - return cache.tracer; +function getCurrentCharacter(tokenizer) { + return tokenizer._text[tokenizer._currentIndex]; } - -// Copyright (c) Microsoft Corporation. -(function (SpanKind) { - /** Default value. Indicates that the span is used internally. */ - SpanKind[SpanKind["INTERNAL"] = 0] = "INTERNAL"; - /** - * Indicates that the span covers server-side handling of an RPC or other - * remote request. - */ - SpanKind[SpanKind["SERVER"] = 1] = "SERVER"; - /** - * Indicates that the span covers the client-side wrapper around an RPC or - * other remote request. - */ - SpanKind[SpanKind["CLIENT"] = 2] = "CLIENT"; - /** - * Indicates that the span describes producer sending a message to a - * broker. Unlike client and server, there is no direct critical path latency - * relationship between producer and consumer spans. - */ - SpanKind[SpanKind["PRODUCER"] = 3] = "PRODUCER"; - /** - * Indicates that the span describes consumer receiving a message from a - * broker. Unlike client and server, there is no direct critical path latency - * relationship between producer and consumer spans. - */ - SpanKind[SpanKind["CONSUMER"] = 4] = "CONSUMER"; -})(exports.SpanKind || (exports.SpanKind = {})); /** - * Return the span if one exists - * - * @param context - context to get span from + * Advance to the character in text that is "step" characters ahead. If no step value is provided, + * then step will default to 1. */ -function getSpan(context) { - return api.getSpan(context); +function nextCharacter(tokenizer, step) { + if (hasCurrentCharacter(tokenizer)) { + if (!step) { + step = 1; + } + tokenizer._currentIndex += step; + } } /** - * Set the span on a context - * - * @param context - context to use as parent - * @param span - span to set active + * Starting with the current character, peek "charactersToPeek" number of characters ahead in this + * Tokenizer's stream of characters. */ -function setSpan(context, span) { - return api.setSpan(context, span); +function peekCharacters(tokenizer, charactersToPeek) { + var endIndex = tokenizer._currentIndex + charactersToPeek; + if (tokenizer._textLength < endIndex) { + endIndex = tokenizer._textLength; + } + return tokenizer._text.substring(tokenizer._currentIndex, endIndex); } /** - * Wrap span context in a NoopSpan and set as span in a new - * context - * - * @param context - context to set active span on - * @param spanContext - span context to be wrapped + * Read characters from this Tokenizer until the end of the stream or until the provided condition + * is false when provided the current character. */ -function setSpanContext(context, spanContext) { - return api.setSpanContext(context, spanContext); +function readWhile(tokenizer, condition) { + var result = ""; + while (hasCurrentCharacter(tokenizer)) { + var currentCharacter = getCurrentCharacter(tokenizer); + if (!condition(currentCharacter)) { + break; + } + else { + result += currentCharacter; + nextCharacter(tokenizer); + } + } + return result; } /** - * Get the span context of the span if it exists. - * - * @param context - context to get values from + * Read characters from this Tokenizer until a non-alphanumeric character or the end of the + * character stream is reached. */ -function getSpanContext(context) { - return api.getSpanContext(context); +function readWhileLetterOrDigit(tokenizer) { + return readWhile(tokenizer, function (character) { return isAlphaNumericCharacter(character); }); } -/** Entrypoint for context API */ -var context = api.context; -(function (SpanStatusCode) { - /** - * The default status. - */ - SpanStatusCode[SpanStatusCode["UNSET"] = 0] = "UNSET"; - /** - * The operation has been validated by an Application developer or - * Operator to have completed successfully. - */ - SpanStatusCode[SpanStatusCode["OK"] = 1] = "OK"; - /** - * The operation contains an error. - */ - SpanStatusCode[SpanStatusCode["ERROR"] = 2] = "ERROR"; -})(exports.SpanStatusCode || (exports.SpanStatusCode = {})); - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. /** - * @internal + * Read characters from this Tokenizer until one of the provided terminating characters is read or + * the end of the character stream is reached. */ -var OpenCensusTraceStateWrapper = /** @class */ (function () { - function OpenCensusTraceStateWrapper(state) { - this._state = state; +function readUntilCharacter(tokenizer) { + var terminatingCharacters = []; + for (var _i = 1; _i < arguments.length; _i++) { + terminatingCharacters[_i - 1] = arguments[_i]; + } + return readWhile(tokenizer, function (character) { return terminatingCharacters.indexOf(character) === -1; }); +} +function nextScheme(tokenizer) { + var scheme = readWhileLetterOrDigit(tokenizer); + tokenizer._currentToken = URLToken.scheme(scheme); + if (!hasCurrentCharacter(tokenizer)) { + tokenizer._currentState = "DONE"; + } + else { + tokenizer._currentState = "HOST"; + } +} +function nextSchemeOrHost(tokenizer) { + var schemeOrHost = readUntilCharacter(tokenizer, ":", "/", "?"); + if (!hasCurrentCharacter(tokenizer)) { + tokenizer._currentToken = URLToken.host(schemeOrHost); + tokenizer._currentState = "DONE"; + } + else if (getCurrentCharacter(tokenizer) === ":") { + if (peekCharacters(tokenizer, 3) === "://") { + tokenizer._currentToken = URLToken.scheme(schemeOrHost); + tokenizer._currentState = "HOST"; + } + else { + tokenizer._currentToken = URLToken.host(schemeOrHost); + tokenizer._currentState = "PORT"; + } + } + else { + tokenizer._currentToken = URLToken.host(schemeOrHost); + if (getCurrentCharacter(tokenizer) === "/") { + tokenizer._currentState = "PATH"; + } + else { + tokenizer._currentState = "QUERY"; + } + } +} +function nextHost(tokenizer) { + if (peekCharacters(tokenizer, 3) === "://") { + nextCharacter(tokenizer, 3); + } + var host = readUntilCharacter(tokenizer, ":", "/", "?"); + tokenizer._currentToken = URLToken.host(host); + if (!hasCurrentCharacter(tokenizer)) { + tokenizer._currentState = "DONE"; + } + else if (getCurrentCharacter(tokenizer) === ":") { + tokenizer._currentState = "PORT"; + } + else if (getCurrentCharacter(tokenizer) === "/") { + tokenizer._currentState = "PATH"; + } + else { + tokenizer._currentState = "QUERY"; + } +} +function nextPort(tokenizer) { + if (getCurrentCharacter(tokenizer) === ":") { + nextCharacter(tokenizer); + } + var port = readUntilCharacter(tokenizer, "/", "?"); + tokenizer._currentToken = URLToken.port(port); + if (!hasCurrentCharacter(tokenizer)) { + tokenizer._currentState = "DONE"; + } + else if (getCurrentCharacter(tokenizer) === "/") { + tokenizer._currentState = "PATH"; + } + else { + tokenizer._currentState = "QUERY"; } - OpenCensusTraceStateWrapper.prototype.get = function (_key) { - throw new Error("Method not implemented."); - }; - OpenCensusTraceStateWrapper.prototype.set = function (_key, _value) { - throw new Error("Method not implemented."); - }; - OpenCensusTraceStateWrapper.prototype.unset = function (_key) { - throw new Error("Method not implemented"); - }; - OpenCensusTraceStateWrapper.prototype.serialize = function () { - return this._state || ""; - }; - return OpenCensusTraceStateWrapper; -}()); - -// Copyright (c) Microsoft Corporation. -/** An enumeration of canonical status codes. */ -var CanonicalCode; -(function (CanonicalCode) { - /** - * Not an error; returned on success - */ - CanonicalCode[CanonicalCode["OK"] = 0] = "OK"; - /** - * Internal errors. Means some invariants expected by underlying - * system has been broken. If you see one of these errors, - * something is very broken. - */ - CanonicalCode[CanonicalCode["INTERNAL"] = 13] = "INTERNAL"; -})(CanonicalCode || (CanonicalCode = {})); -function isWrappedSpan(span) { - return !!span && span.getWrappedSpan !== undefined; } -function isTracer(tracerOrSpan) { - return tracerOrSpan.getWrappedTracer !== undefined; +function nextPath(tokenizer) { + var path = readUntilCharacter(tokenizer, "?"); + tokenizer._currentToken = URLToken.path(path); + if (!hasCurrentCharacter(tokenizer)) { + tokenizer._currentState = "DONE"; + } + else { + tokenizer._currentState = "QUERY"; + } } -/** - * An implementation of OpenTelemetry Span that wraps an OpenCensus Span. - */ -var OpenCensusSpanWrapper = /** @class */ (function () { - function OpenCensusSpanWrapper(tracerOrSpan, name, options, context$1) { - if (name === void 0) { name = ""; } - if (options === void 0) { options = {}; } - if (isTracer(tracerOrSpan)) { - var span = getSpan(context$1 !== null && context$1 !== void 0 ? context$1 : context.active()); - var parent = isWrappedSpan(span) ? span.getWrappedSpan() : undefined; - this._span = tracerOrSpan.getWrappedTracer().startChildSpan({ - name: name, - childOf: parent - }); - this._span.start(); - if (options.links) { - for (var _i = 0, _a = options.links; _i < _a.length; _i++) { - var link = _a[_i]; - // Since there is no way to set the link relationship, leave it as Unspecified. - this._span.addLink(link.context.traceId, link.context.spanId, 0 /* LinkType.UNSPECIFIED */, link.attributes); +function nextQuery(tokenizer) { + if (getCurrentCharacter(tokenizer) === "?") { + nextCharacter(tokenizer); + } + var query = readRemaining(tokenizer); + tokenizer._currentToken = URLToken.query(query); + tokenizer._currentState = "DONE"; +} + +// Copyright (c) Microsoft Corporation. +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" +]; +var defaultAllowedQueryParameters = ["api-version"]; +var Sanitizer = /** @class */ (function () { + function Sanitizer(_a) { + var _b = _a === void 0 ? {} : _a, _c = _b.allowedHeaderNames, allowedHeaderNames = _c === void 0 ? [] : _c, _d = _b.allowedQueryParameters, allowedQueryParameters = _d === void 0 ? [] : _d; + allowedHeaderNames = Array.isArray(allowedHeaderNames) + ? defaultAllowedHeaderNames.concat(allowedHeaderNames) + : defaultAllowedHeaderNames; + allowedQueryParameters = Array.isArray(allowedQueryParameters) + ? defaultAllowedQueryParameters.concat(allowedQueryParameters) + : defaultAllowedQueryParameters; + this.allowedHeaderNames = new Set(allowedHeaderNames.map(function (n) { return n.toLowerCase(); })); + this.allowedQueryParameters = new Set(allowedQueryParameters.map(function (p) { return p.toLowerCase(); })); + } + Sanitizer.prototype.sanitize = function (obj) { + var _this = this; + var seen = new Set(); + return JSON.stringify(obj, function (key, value) { + // Ensure Errors include their interesting non-enumerable members + if (value instanceof Error) { + return tslib.__assign(tslib.__assign({}, value), { name: value.name, message: value.message }); + } + if (key === "_headersMap") { + return _this.sanitizeHeaders(value); + } + else if (key === "url") { + return _this.sanitizeUrl(value); + } + else if (key === "query") { + return _this.sanitizeQuery(value); + } + else if (key === "body") { + // Don't log the request body + return undefined; + } + else if (key === "response") { + // Don't log response again + return undefined; + } + else if (key === "operationSpec") { + // When using sendOperationRequest, the request carries a massive + // field with the autorest spec. No need to log it. + return undefined; + } + else if (Array.isArray(value) || isObject(value)) { + if (seen.has(value)) { + return "[Circular]"; } + seen.add(value); } - } - else { - this._span = tracerOrSpan; - } - } - /** - * The underlying OpenCensus Span - */ - OpenCensusSpanWrapper.prototype.getWrappedSpan = function () { - return this._span; - }; - /** - * Marks the end of Span execution. - * @param endTime - The time to use as the Span's end time. Defaults to - * the current time. - */ - OpenCensusSpanWrapper.prototype.end = function (_endTime) { - this._span.end(); - }; - /** - * Returns the SpanContext associated with this Span. - */ - OpenCensusSpanWrapper.prototype.context = function () { - var openCensusSpanContext = this._span.spanContext; - return { - spanId: openCensusSpanContext.spanId, - traceId: openCensusSpanContext.traceId, - traceFlags: openCensusSpanContext.options, - traceState: new OpenCensusTraceStateWrapper(openCensusSpanContext.traceState) - }; - }; - /** - * Sets an attribute on the Span - * @param key - The attribute key - * @param value - The attribute value - */ - OpenCensusSpanWrapper.prototype.setAttribute = function (key, value) { - this._span.addAttribute(key, value); - return this; + return value; + }, 2); }; - /** - * Sets attributes on the Span - * @param attributes - The attributes to add - */ - OpenCensusSpanWrapper.prototype.setAttributes = function (attributes) { - this._span.attributes = attributes; - return this; + Sanitizer.prototype.sanitizeHeaders = function (value) { + return this.sanitizeObject(value, this.allowedHeaderNames, function (v, k) { return v[k].value; }); }; - /** - * Adds an event to the Span - * @param name - The name of the event - * @param attributes - The associated attributes to add for this event - */ - OpenCensusSpanWrapper.prototype.addEvent = function (_name, _attributes) { - throw new Error("Method not implemented."); + Sanitizer.prototype.sanitizeQuery = function (value) { + return this.sanitizeObject(value, this.allowedQueryParameters, function (v, k) { return v[k]; }); }; - /** - * Sets a status on the span. Overrides the default of SpanStatusCode.OK. - * @param status - The status to set. - */ - OpenCensusSpanWrapper.prototype.setStatus = function (status) { - switch (status.code) { - case exports.SpanStatusCode.ERROR: { - this._span.setStatus(CanonicalCode.INTERNAL, status.message); - break; - } - case exports.SpanStatusCode.OK: { - this._span.setStatus(CanonicalCode.OK, status.message); - break; + Sanitizer.prototype.sanitizeObject = function (value, allowedKeys, accessor) { + if (typeof value !== "object" || value === null) { + return value; + } + var sanitized = {}; + for (var _i = 0, _a = Object.keys(value); _i < _a.length; _i++) { + var k = _a[_i]; + if (allowedKeys.has(k.toLowerCase())) { + sanitized[k] = accessor(value, k); } - case exports.SpanStatusCode.UNSET: { - break; + else { + sanitized[k] = RedactedString; } } - return this; - }; - /** - * Updates the name of the Span - * @param name - The new Span name - */ - OpenCensusSpanWrapper.prototype.updateName = function (name) { - this._span.name = name; - return this; - }; - /** - * Returns whether this span will be recorded - */ - OpenCensusSpanWrapper.prototype.isRecording = function () { - // NoRecordSpans have an empty traceId - return !!this._span.traceId; + return sanitized; }; - /** - * Sets exception as a span event - * @param exception - the exception the only accepted values are string or Error - * @param time - the time to set as Span's event time. If not provided, - * use the current time. - */ - OpenCensusSpanWrapper.prototype.recordException = function (_exception, _time) { - throw new Error("Method not implemented"); + Sanitizer.prototype.sanitizeUrl = function (value) { + if (typeof value !== "string" || value === null) { + return value; + } + var urlBuilder = URLBuilder.parse(value); + var queryString = urlBuilder.getQuery(); + if (!queryString) { + return value; + } + var query = URLQuery.parse(queryString); + for (var _i = 0, _a = query.keys(); _i < _a.length; _i++) { + var k = _a[_i]; + if (!this.allowedQueryParameters.has(k.toLowerCase())) { + query.set(k, RedactedString); + } + } + urlBuilder.setQuery(query.toString()); + return urlBuilder.toString(); }; - return OpenCensusSpanWrapper; + return Sanitizer; }()); // Copyright (c) Microsoft Corporation. -/** - * An implementation of OpenTelemetry Tracer that wraps an OpenCensus Tracer. - */ -var OpenCensusTracerWrapper = /** @class */ (function () { - /** - * Create a new wrapper around a given OpenCensus Tracer. - * @param tracer - The OpenCensus Tracer to wrap. - */ - function OpenCensusTracerWrapper(tracer) { - this._tracer = tracer; +var errorSanitizer = new Sanitizer(); +var RestError = /** @class */ (function (_super) { + tslib.__extends(RestError, _super); + function RestError(message, code, statusCode, request, response) { + var _this = _super.call(this, message) || this; + _this.name = "RestError"; + _this.code = code; + _this.statusCode = statusCode; + _this.request = request; + _this.response = response; + Object.setPrototypeOf(_this, RestError.prototype); + return _this; } /** - * The wrapped OpenCensus Tracer - */ - OpenCensusTracerWrapper.prototype.getWrappedTracer = function () { - return this._tracer; - }; - /** - * Starts a new Span. - * @param name - The name of the span. - * @param options - The SpanOptions used during Span creation. - */ - OpenCensusTracerWrapper.prototype.startSpan = function (name, options) { - return new OpenCensusSpanWrapper(this, name, options); - }; - /** - * Returns the current Span from the current context, if available. + * Logging method for util.inspect in Node */ - OpenCensusTracerWrapper.prototype.getCurrentSpan = function () { - return undefined; + RestError.prototype[custom] = function () { + return "RestError: " + this.message + " \n " + errorSanitizer.sanitize(this); }; - /** - * Executes the given function within the context provided by a Span. - * @param _span - The span that provides the context. - * @param _fn - The function to be executed. - */ - OpenCensusTracerWrapper.prototype.withSpan = function (_span, _fn) { - throw new Error("Method not implemented."); + RestError.REQUEST_SEND_ERROR = "REQUEST_SEND_ERROR"; + RestError.PARSE_ERROR = "PARSE_ERROR"; + return RestError; +}(Error)); + +// Copyright (c) Microsoft Corporation. +var logger = logger$1.createClientLogger("core-http"); + +// Copyright (c) Microsoft Corporation. +var ReportTransform = /** @class */ (function (_super) { + tslib.__extends(ReportTransform, _super); + function ReportTransform(progressCallback) { + var _this = _super.call(this) || this; + _this.progressCallback = progressCallback; + _this.loadedBytes = 0; + return _this; + } + ReportTransform.prototype._transform = function (chunk, _encoding, callback) { + this.push(chunk); + this.loadedBytes += chunk.length; + this.progressCallback({ loadedBytes: this.loadedBytes }); + callback(undefined); }; - /** - * Bind a Span as the target's scope - * @param target - An object to bind the scope. - * @param _span - A specific Span to use. Otherwise, use the current one. - */ - OpenCensusTracerWrapper.prototype.bind = function (_target, _span) { - throw new Error("Method not implemented."); + return ReportTransform; +}(stream.Transform)); +var FetchHttpClient = /** @class */ (function () { + function FetchHttpClient() { + } + FetchHttpClient.prototype.sendRequest = function (httpRequest) { + var _a; + return tslib.__awaiter(this, void 0, void 0, function () { + var abortController$1, abortListener, formData, requestForm_1, appendFormValue, _i, _b, formKey, formValue, j, contentType, body, onUploadProgress, uploadReportStream, platformSpecificRequestInit, requestInit, operationResponse, response, headers, streaming, _c, onDownloadProgress, responseBody, downloadReportStream, length_1, error_1, fetchError, uploadStreamDone, downloadStreamDone; + var _d; + return tslib.__generator(this, function (_e) { + switch (_e.label) { + case 0: + if (!httpRequest && typeof httpRequest !== "object") { + throw new Error("'httpRequest' (WebResourceLike) cannot be null or undefined and must be of type object."); + } + abortController$1 = new abortController.AbortController(); + if (httpRequest.abortSignal) { + if (httpRequest.abortSignal.aborted) { + throw new abortController.AbortError("The operation was aborted."); + } + abortListener = function (event) { + if (event.type === "abort") { + abortController$1.abort(); + } + }; + httpRequest.abortSignal.addEventListener("abort", abortListener); + } + if (httpRequest.timeout) { + setTimeout(function () { + abortController$1.abort(); + }, httpRequest.timeout); + } + if (httpRequest.formData) { + formData = httpRequest.formData; + requestForm_1 = new FormData(); + appendFormValue = function (key, value) { + // value function probably returns a stream so we can provide a fresh stream on each retry + if (typeof value === "function") { + value = value(); + } + if (value && + Object.prototype.hasOwnProperty.call(value, "value") && + Object.prototype.hasOwnProperty.call(value, "options")) { + requestForm_1.append(key, value.value, value.options); + } + else { + requestForm_1.append(key, value); + } + }; + for (_i = 0, _b = Object.keys(formData); _i < _b.length; _i++) { + formKey = _b[_i]; + formValue = formData[formKey]; + if (Array.isArray(formValue)) { + for (j = 0; j < formValue.length; j++) { + appendFormValue(formKey, formValue[j]); + } + } + else { + appendFormValue(formKey, formValue); + } + } + httpRequest.body = requestForm_1; + httpRequest.formData = undefined; + contentType = httpRequest.headers.get("Content-Type"); + if (contentType && contentType.indexOf("multipart/form-data") !== -1) { + if (typeof requestForm_1.getBoundary === "function") { + httpRequest.headers.set("Content-Type", "multipart/form-data; boundary=" + requestForm_1.getBoundary()); + } + else { + // browser will automatically apply a suitable content-type header + httpRequest.headers.remove("Content-Type"); + } + } + } + body = httpRequest.body + ? typeof httpRequest.body === "function" + ? httpRequest.body() + : httpRequest.body + : undefined; + if (httpRequest.onUploadProgress && httpRequest.body) { + onUploadProgress = httpRequest.onUploadProgress; + uploadReportStream = new ReportTransform(onUploadProgress); + if (isReadableStream(body)) { + body.pipe(uploadReportStream); + } + else { + uploadReportStream.end(body); + } + body = uploadReportStream; + } + return [4 /*yield*/, this.prepareRequest(httpRequest)]; + case 1: + platformSpecificRequestInit = _e.sent(); + requestInit = tslib.__assign({ body: body, headers: httpRequest.headers.rawHeaders(), method: httpRequest.method, signal: abortController$1.signal, redirect: "manual" }, platformSpecificRequestInit); + _e.label = 2; + case 2: + _e.trys.push([2, 8, 9, 10]); + return [4 /*yield*/, this.fetch(httpRequest.url, requestInit)]; + case 3: + response = _e.sent(); + headers = parseHeaders(response.headers); + streaming = ((_a = httpRequest.streamResponseStatusCodes) === null || _a === void 0 ? void 0 : _a.has(response.status)) || + httpRequest.streamResponseBody; + _d = { + headers: headers, + request: httpRequest, + status: response.status, + readableStreamBody: streaming + ? response.body + : undefined + }; + if (!!streaming) return [3 /*break*/, 5]; + return [4 /*yield*/, response.text()]; + case 4: + _c = _e.sent(); + return [3 /*break*/, 6]; + case 5: + _c = undefined; + _e.label = 6; + case 6: + operationResponse = (_d.bodyAsText = _c, + _d); + onDownloadProgress = httpRequest.onDownloadProgress; + if (onDownloadProgress) { + responseBody = response.body || undefined; + if (isReadableStream(responseBody)) { + downloadReportStream = new ReportTransform(onDownloadProgress); + responseBody.pipe(downloadReportStream); + operationResponse.readableStreamBody = downloadReportStream; + } + else { + length_1 = parseInt(headers.get("Content-Length")) || undefined; + if (length_1) { + // Calling callback for non-stream response for consistency with browser + onDownloadProgress({ loadedBytes: length_1 }); + } + } + } + return [4 /*yield*/, this.processRequest(operationResponse)]; + case 7: + _e.sent(); + return [2 /*return*/, operationResponse]; + case 8: + error_1 = _e.sent(); + fetchError = error_1; + if (fetchError.code === "ENOTFOUND") { + throw new RestError(fetchError.message, RestError.REQUEST_SEND_ERROR, undefined, httpRequest); + } + else if (fetchError.type === "aborted") { + throw new abortController.AbortError("The operation was aborted."); + } + throw fetchError; + case 9: + // clean up event listener + if (httpRequest.abortSignal && abortListener) { + uploadStreamDone = Promise.resolve(); + if (isReadableStream(body)) { + uploadStreamDone = isStreamComplete(body); + } + downloadStreamDone = Promise.resolve(); + if (isReadableStream(operationResponse === null || operationResponse === void 0 ? void 0 : operationResponse.readableStreamBody)) { + downloadStreamDone = isStreamComplete(operationResponse.readableStreamBody); + } + Promise.all([uploadStreamDone, downloadStreamDone]) + .then(function () { + var _a; + (_a = httpRequest.abortSignal) === null || _a === void 0 ? void 0 : _a.removeEventListener("abort", abortListener); + return; + }) + .catch(function (e) { + logger.warning("Error when cleaning up abortListener on httpRequest", e); + }); + } + return [7 /*endfinally*/]; + case 10: return [2 /*return*/]; + } + }); + }); }; - return OpenCensusTracerWrapper; + return FetchHttpClient; }()); +function isReadableStream(body) { + return body && typeof body.pipe === "function"; +} +function isStreamComplete(stream) { + return new Promise(function (resolve) { + stream.on("close", resolve); + stream.on("end", resolve); + stream.on("error", resolve); + }); +} +function parseHeaders(headers) { + var httpHeaders = new HttpHeaders(); + headers.forEach(function (value, key) { + httpHeaders.set(key, value); + }); + return httpHeaders; +} // Copyright (c) Microsoft Corporation. -/** - * A mock span useful for testing. - */ -var TestSpan = /** @class */ (function (_super) { - tslib.__extends(TestSpan, _super); - /** - * Starts a new Span. - * @param parentTracer- The tracer that created this Span - * @param name - The name of the span. - * @param context - The SpanContext this span belongs to - * @param kind - The SpanKind of this Span - * @param parentSpanId - The identifier of the parent Span - * @param startTime - The startTime of the event (defaults to now) - */ - function TestSpan(parentTracer, name, context, kind, parentSpanId, startTime) { - if (startTime === void 0) { startTime = Date.now(); } - var _this = _super.call(this) || this; - _this._tracer = parentTracer; - _this.name = name; - _this.kind = kind; - _this.startTime = startTime; - _this.parentSpanId = parentSpanId; - _this.status = { - code: exports.SpanStatusCode.OK - }; - _this.endCalled = false; - _this._context = context; - _this.attributes = {}; - return _this; +function createProxyAgent(requestUrl, proxySettings, headers) { + var host = URLBuilder.parse(proxySettings.host).getHost(); + if (!host) { + throw new Error("Expecting a non-empty host in proxy settings."); } - /** - * Returns the Tracer that created this Span - */ - TestSpan.prototype.tracer = function () { - return this._tracer; - }; - /** - * Returns the SpanContext associated with this Span. - */ - TestSpan.prototype.context = function () { - return this._context; - }; - /** - * Marks the end of Span execution. - * @param _endTime - The time to use as the Span's end time. Defaults to - * the current time. - */ - TestSpan.prototype.end = function (_endTime) { - this.endCalled = true; - }; - /** - * Sets a status on the span. Overrides the default of SpanStatusCode.OK. - * @param status - The status to set. - */ - TestSpan.prototype.setStatus = function (status) { - this.status = status; - return this; - }; - /** - * Returns whether this span will be recorded - */ - TestSpan.prototype.isRecording = function () { - return true; - }; - /** - * Sets an attribute on the Span - * @param key - The attribute key - * @param value - The attribute value - */ - TestSpan.prototype.setAttribute = function (key, value) { - this.attributes[key] = value; - return this; - }; - /** - * Sets attributes on the Span - * @param attributes - The attributes to add - */ - TestSpan.prototype.setAttributes = function (attributes) { - for (var _i = 0, _a = Object.keys(attributes); _i < _a.length; _i++) { - var key = _a[_i]; - this.attributes[key] = attributes[key]; + if (!isValidPort(proxySettings.port)) { + throw new Error("Expecting a valid port number in the range of [0, 65535] in proxy settings."); + } + var tunnelOptions = { + proxy: { + host: host, + port: proxySettings.port, + headers: (headers && headers.rawHeaders()) || {} } - return this; }; - return TestSpan; -}(NoOpSpan)); + if (proxySettings.username && proxySettings.password) { + tunnelOptions.proxy.proxyAuth = proxySettings.username + ":" + proxySettings.password; + } + var isRequestHttps = isUrlHttps(requestUrl); + var isProxyHttps = isUrlHttps(proxySettings.host); + var proxyAgent = { + isHttps: isRequestHttps, + agent: createTunnel(isRequestHttps, isProxyHttps, tunnelOptions) + }; + return proxyAgent; +} +function isUrlHttps(url) { + var urlScheme = URLBuilder.parse(url).getScheme() || ""; + return urlScheme.toLowerCase() === "https"; +} +function createTunnel(isRequestHttps, isProxyHttps, tunnelOptions) { + if (isRequestHttps && isProxyHttps) { + return tunnel.httpsOverHttps(tunnelOptions); + } + else if (isRequestHttps && !isProxyHttps) { + return tunnel.httpsOverHttp(tunnelOptions); + } + else if (!isRequestHttps && isProxyHttps) { + return tunnel.httpOverHttps(tunnelOptions); + } + else { + return tunnel.httpOverHttp(tunnelOptions); + } +} +function isValidPort(port) { + // any port in 0-65535 range is valid (RFC 793) even though almost all implementations + // will reserve 0 for a specific purpose, and a range of numbers for ephemeral ports + return 0 <= port && port <= 65535; +} // Copyright (c) Microsoft Corporation. -/** - * A mock tracer useful for testing - */ -var TestTracer = /** @class */ (function (_super) { - tslib.__extends(TestTracer, _super); - function TestTracer() { +function getCachedAgent(isHttps, agentCache) { + return isHttps ? agentCache.httpsAgent : agentCache.httpAgent; +} +var NodeFetchHttpClient = /** @class */ (function (_super) { + tslib.__extends(NodeFetchHttpClient, _super); + function NodeFetchHttpClient() { var _this = _super !== null && _super.apply(this, arguments) || this; - _this.traceIdCounter = 0; - _this.spanIdCounter = 0; - _this.rootSpans = []; - _this.knownSpans = []; + _this.proxyAgents = {}; + _this.keepAliveAgents = {}; + _this.cookieJar = new tough.CookieJar(undefined, { looseMode: true }); return _this; } - TestTracer.prototype.getNextTraceId = function () { - this.traceIdCounter++; - return String(this.traceIdCounter); - }; - TestTracer.prototype.getNextSpanId = function () { - this.spanIdCounter++; - return String(this.spanIdCounter); - }; - /** - * Returns all Spans that were created without a parent - */ - TestTracer.prototype.getRootSpans = function () { - return this.rootSpans; - }; - /** - * Returns all Spans this Tracer knows about - */ - TestTracer.prototype.getKnownSpans = function () { - return this.knownSpans; - }; - /** - * Returns all Spans where end() has not been called - */ - TestTracer.prototype.getActiveSpans = function () { - return this.knownSpans.filter(function (span) { - return !span.endCalled; - }); - }; - /** - * Return all Spans for a particular trace, grouped by their - * parent Span in a tree-like structure - * @param traceId - The traceId to return the graph for - */ - TestTracer.prototype.getSpanGraph = function (traceId) { - var traceSpans = this.knownSpans.filter(function (span) { - return span.context().traceId === traceId; - }); - var roots = []; - var nodeMap = new Map(); - for (var _i = 0, traceSpans_1 = traceSpans; _i < traceSpans_1.length; _i++) { - var span = traceSpans_1[_i]; - var spanId = span.context().spanId; - var node = { - name: span.name, - children: [] - }; - nodeMap.set(spanId, node); - if (span.parentSpanId) { - var parent = nodeMap.get(span.parentSpanId); - if (!parent) { - throw new Error("Span with name " + node.name + " has an unknown parentSpan with id " + span.parentSpanId); - } - parent.children.push(node); + NodeFetchHttpClient.prototype.getOrCreateAgent = function (httpRequest) { + var isHttps = isUrlHttps(httpRequest.url); + // At the moment, proxy settings and keepAlive are mutually + // exclusive because the 'tunnel' library currently lacks the + // ability to create a proxy with keepAlive turned on. + if (httpRequest.proxySettings) { + var agent = getCachedAgent(isHttps, this.proxyAgents); + if (agent) { + return agent; + } + var tunnel = createProxyAgent(httpRequest.url, httpRequest.proxySettings, httpRequest.headers); + agent = tunnel.agent; + if (tunnel.isHttps) { + this.proxyAgents.httpsAgent = tunnel.agent; } else { - roots.push(node); + this.proxyAgents.httpAgent = tunnel.agent; } + return agent; } - return { - roots: roots - }; - }; - /** - * Starts a new Span. - * @param name - The name of the span. - * @param options - The SpanOptions used during Span creation. - */ - TestTracer.prototype.startSpan = function (name, options, context$1) { - var parentContext = getSpanContext(context$1 || context.active()); - var traceId; - var isRootSpan = false; - if (parentContext && parentContext.traceId) { - traceId = parentContext.traceId; + else if (httpRequest.keepAlive) { + var agent = getCachedAgent(isHttps, this.keepAliveAgents); + if (agent) { + return agent; + } + var agentOptions = { + keepAlive: httpRequest.keepAlive + }; + if (isHttps) { + agent = this.keepAliveAgents.httpsAgent = new https.Agent(agentOptions); + } + else { + agent = this.keepAliveAgents.httpAgent = new http.Agent(agentOptions); + } + return agent; } else { - traceId = this.getNextTraceId(); - isRootSpan = true; - } - var spanContext = { - traceId: traceId, - spanId: this.getNextSpanId(), - traceFlags: 0 /* NONE */ - }; - var span = new TestSpan(this, name, spanContext, (options === null || options === void 0 ? void 0 : options.kind) || exports.SpanKind.INTERNAL, parentContext ? parentContext.spanId : undefined, options === null || options === void 0 ? void 0 : options.startTime); - this.knownSpans.push(span); - if (isRootSpan) { - this.rootSpans.push(span); + return isHttps ? https.globalAgent : http.globalAgent; } - return span; }; - return TestTracer; -}(NoOpTracer)); - -// Copyright (c) Microsoft Corporation. -/** - * Creates a function that can be used to create spans using the global tracer. - * - * Usage: - * - * ```typescript - * // once - * const createSpan = createSpanFunction({ packagePrefix: "Azure.Data.AppConfiguration", namespace: "Microsoft.AppConfiguration" }); - * - * // in each operation - * const span = createSpan("deleteConfigurationSetting", operationOptions); - * // code... - * span.end(); - * ``` - * - * @hidden - * @param args - allows configuration of the prefix for each span as well as the az.namespace field. - */ -function createSpanFunction(args) { - return function (operationName, operationOptions) { - var tracer = getTracer(); - var tracingOptions = (operationOptions === null || operationOptions === void 0 ? void 0 : operationOptions.tracingOptions) || {}; - var spanOptions = tslib.__assign({ kind: exports.SpanKind.INTERNAL }, tracingOptions.spanOptions); - var spanName = args.packagePrefix ? args.packagePrefix + "." + operationName : operationName; - var span = tracer.startSpan(spanName, spanOptions, tracingOptions.tracingContext); - if (args.namespace) { - span.setAttribute("az.namespace", args.namespace); - } - var newSpanOptions = tracingOptions.spanOptions || {}; - if (span.isRecording() && args.namespace) { - newSpanOptions = tslib.__assign(tslib.__assign({}, tracingOptions.spanOptions), { attributes: tslib.__assign(tslib.__assign({}, spanOptions.attributes), { "az.namespace": args.namespace }) }); - } - var newTracingOptions = tslib.__assign(tslib.__assign({}, tracingOptions), { spanOptions: newSpanOptions, tracingContext: setSpan(tracingOptions.tracingContext || context.active(), span) }); - var newOperationOptions = tslib.__assign(tslib.__assign({}, operationOptions), { tracingOptions: newTracingOptions }); - return { - span: span, - updatedOptions: newOperationOptions - }; + // eslint-disable-next-line @azure/azure-sdk/ts-apisurface-standardized-verbs + NodeFetchHttpClient.prototype.fetch = function (input, init) { + return tslib.__awaiter(this, void 0, void 0, function () { + return tslib.__generator(this, function (_a) { + return [2 /*return*/, node_fetch(input, init)]; + }); + }); }; -} - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. -var VERSION = "00"; -/** - * Generates a `SpanContext` given a `traceparent` header value. - * @param traceParent - Serialized span context data as a `traceparent` header value. - * @returns The `SpanContext` generated from the `traceparent` value. - */ -function extractSpanContextFromTraceParentHeader(traceParentHeader) { - var parts = traceParentHeader.split("-"); - if (parts.length !== 4) { - return; - } - var version = parts[0], traceId = parts[1], spanId = parts[2], traceOptions = parts[3]; - if (version !== VERSION) { - return; - } - var traceFlags = parseInt(traceOptions, 16); - var spanContext = { - spanId: spanId, - traceId: traceId, - traceFlags: traceFlags + NodeFetchHttpClient.prototype.prepareRequest = function (httpRequest) { + return tslib.__awaiter(this, void 0, void 0, function () { + var requestInit, cookieString; + var _this = this; + return tslib.__generator(this, function (_a) { + switch (_a.label) { + case 0: + requestInit = {}; + if (!(this.cookieJar && !httpRequest.headers.get("Cookie"))) return [3 /*break*/, 2]; + return [4 /*yield*/, new Promise(function (resolve, reject) { + _this.cookieJar.getCookieString(httpRequest.url, function (err, cookie) { + if (err) { + reject(err); + } + else { + resolve(cookie); + } + }); + })]; + case 1: + cookieString = _a.sent(); + httpRequest.headers.set("Cookie", cookieString); + _a.label = 2; + case 2: + // Set the http(s) agent + requestInit.agent = this.getOrCreateAgent(httpRequest); + requestInit.compress = httpRequest.decompressResponse; + return [2 /*return*/, requestInit]; + } + }); + }); }; - return spanContext; -} -/** - * Generates a `traceparent` value given a span context. - * @param spanContext - Contains context for a specific span. - * @returns The `spanContext` represented as a `traceparent` value. - */ -function getTraceParentHeader(spanContext) { - var missingFields = []; - if (!spanContext.traceId) { - missingFields.push("traceId"); - } - if (!spanContext.spanId) { - missingFields.push("spanId"); - } - if (missingFields.length) { - return; - } - var flags = spanContext.traceFlags || 0 /* NONE */; - var hexFlags = flags.toString(16); - var traceFlags = hexFlags.length === 1 ? "0" + hexFlags : hexFlags; - // https://www.w3.org/TR/trace-context/#traceparent-header-field-values - return VERSION + "-" + spanContext.traceId + "-" + spanContext.spanId + "-" + traceFlags; -} - -exports.NoOpSpan = NoOpSpan; -exports.NoOpTracer = NoOpTracer; -exports.OpenCensusSpanWrapper = OpenCensusSpanWrapper; -exports.OpenCensusTracerWrapper = OpenCensusTracerWrapper; -exports.TestSpan = TestSpan; -exports.TestTracer = TestTracer; -exports.context = context; -exports.createSpanFunction = createSpanFunction; -exports.extractSpanContextFromTraceParentHeader = extractSpanContextFromTraceParentHeader; -exports.getSpan = getSpan; -exports.getSpanContext = getSpanContext; -exports.getTraceParentHeader = getTraceParentHeader; -exports.getTracer = getTracer; -exports.setSpan = setSpan; -exports.setSpanContext = setSpanContext; -exports.setTracer = setTracer; -//# sourceMappingURL=index.js.map - - -/***/ }), - -/***/ 7407: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var __spreadArrays = (this && this.__spreadArrays) || function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ContextAPI = void 0; -var NoopContextManager_1 = __nccwpck_require__(469); -var global_utils_1 = __nccwpck_require__(6965); -var API_NAME = 'context'; -var NOOP_CONTEXT_MANAGER = new NoopContextManager_1.NoopContextManager(); -/** - * Singleton object which represents the entry point to the OpenTelemetry Context API - */ -var ContextAPI = /** @class */ (function () { - /** Empty private constructor prevents end users from constructing a new instance of the API */ - function ContextAPI() { - } - /** Get the singleton instance of the Context API */ - ContextAPI.getInstance = function () { - if (!this._instance) { - this._instance = new ContextAPI(); - } - return this._instance; + NodeFetchHttpClient.prototype.processRequest = function (operationResponse) { + return tslib.__awaiter(this, void 0, void 0, function () { + var setCookieHeader_1; + var _this = this; + return tslib.__generator(this, function (_a) { + switch (_a.label) { + case 0: + if (!this.cookieJar) return [3 /*break*/, 2]; + setCookieHeader_1 = operationResponse.headers.get("Set-Cookie"); + if (!(setCookieHeader_1 !== undefined)) return [3 /*break*/, 2]; + return [4 /*yield*/, new Promise(function (resolve, reject) { + _this.cookieJar.setCookie(setCookieHeader_1, operationResponse.request.url, { ignoreError: true }, function (err) { + if (err) { + reject(err); + } + else { + resolve(); + } + }); + })]; + case 1: + _a.sent(); + _a.label = 2; + case 2: return [2 /*return*/]; + } + }); + }); }; + return NodeFetchHttpClient; +}(FetchHttpClient)); + +// Copyright (c) Microsoft Corporation. +(function (HttpPipelineLogLevel) { /** - * Set the current context manager. Returns the initialized context manager + * A log level that indicates that no logs will be logged. */ - ContextAPI.prototype.setGlobalContextManager = function (contextManager) { - global_utils_1.registerGlobal(API_NAME, contextManager); - return contextManager; - }; + HttpPipelineLogLevel[HttpPipelineLogLevel["OFF"] = 0] = "OFF"; /** - * Get the currently active context + * An error log. */ - ContextAPI.prototype.active = function () { - return this._getContextManager().active(); - }; + HttpPipelineLogLevel[HttpPipelineLogLevel["ERROR"] = 1] = "ERROR"; /** - * Execute a function with an active context - * - * @param context context to be active during function execution - * @param fn function to execute in a context - * @param thisArg optional receiver to be used for calling fn - * @param args optional arguments forwarded to fn + * A warning log. */ - ContextAPI.prototype.with = function (context, fn, thisArg) { - var _a; - var args = []; - for (var _i = 3; _i < arguments.length; _i++) { - args[_i - 3] = arguments[_i]; - } - return (_a = this._getContextManager()).with.apply(_a, __spreadArrays([context, fn, thisArg], args)); - }; + HttpPipelineLogLevel[HttpPipelineLogLevel["WARNING"] = 2] = "WARNING"; /** - * Bind a context to a target function or event emitter - * - * @param target function or event emitter to bind - * @param context context to bind to the event emitter or function. Defaults to the currently active context + * An information log. */ - ContextAPI.prototype.bind = function (target, context) { - if (context === void 0) { context = this.active(); } - return this._getContextManager().bind(target, context); - }; - ContextAPI.prototype._getContextManager = function () { - return global_utils_1.getGlobal(API_NAME) || NOOP_CONTEXT_MANAGER; - }; - /** Disable and remove the global context manager */ - ContextAPI.prototype.disable = function () { - this._getContextManager().disable(); - global_utils_1.unregisterGlobal(API_NAME); - }; - return ContextAPI; -}()); -exports.ContextAPI = ContextAPI; -//# sourceMappingURL=context.js.map - -/***/ }), - -/***/ 4658: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; + HttpPipelineLogLevel[HttpPipelineLogLevel["INFO"] = 3] = "INFO"; +})(exports.HttpPipelineLogLevel || (exports.HttpPipelineLogLevel = {})); -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DiagAPI = void 0; -var logLevelLogger_1 = __nccwpck_require__(6430); -var types_1 = __nccwpck_require__(2339); -var global_utils_1 = __nccwpck_require__(6965); -var API_NAME = 'diag'; /** - * Singleton object which represents the entry point to the OpenTelemetry internal - * diagnostic API + * Converts an OperationOptions to a RequestOptionsBase + * + * @param opts - OperationOptions object to convert to RequestOptionsBase */ -var DiagAPI = /** @class */ (function () { - /** - * Private internal constructor - * @private - */ - function DiagAPI() { - function _logProxy(funcName) { - return function () { - var logger = global_utils_1.getGlobal('diag'); - // shortcut if logger not set - if (!logger) - return; - return logger[funcName].apply(logger, - // work around Function.prototype.apply types - // eslint-disable-next-line @typescript-eslint/no-explicit-any - arguments); - }; - } - // Using self local variable for minification purposes as 'this' cannot be minified - var self = this; - // DiagAPI specific functions - self.setLogger = function (logger, logLevel) { - var _a; - if (logLevel === void 0) { logLevel = types_1.DiagLogLevel.INFO; } - if (logger === self) { - // There isn't much we can do here. - // Logging to the console might break the user application. - // Try to log to self. If a logger was previously registered it will receive the log. - var err = new Error('Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation'); - self.error((_a = err.stack) !== null && _a !== void 0 ? _a : err.message); - return; - } - global_utils_1.registerGlobal('diag', logLevelLogger_1.createLogLevelDiagLogger(logLevel, logger), true); - }; - self.disable = function () { - global_utils_1.unregisterGlobal(API_NAME); - }; - self.verbose = _logProxy('verbose'); - self.debug = _logProxy('debug'); - self.info = _logProxy('info'); - self.warn = _logProxy('warn'); - self.error = _logProxy('error'); +function operationOptionsToRequestOptionsBase(opts) { + var requestOptions = opts.requestOptions, tracingOptions = opts.tracingOptions, additionalOptions = tslib.__rest(opts, ["requestOptions", "tracingOptions"]); + var result = additionalOptions; + if (requestOptions) { + result = tslib.__assign(tslib.__assign({}, result), requestOptions); } - /** Get the singleton instance of the DiagAPI API */ - DiagAPI.instance = function () { - if (!this._instance) { - this._instance = new DiagAPI(); - } - return this._instance; - }; - return DiagAPI; -}()); -exports.DiagAPI = DiagAPI; -//# sourceMappingURL=diag.js.map - -/***/ }), - -/***/ 9362: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; + if (tracingOptions) { + result.spanOptions = tracingOptions.spanOptions; + result.tracingContext = tracingOptions.tracingContext; + } + return result; +} -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PropagationAPI = void 0; -var NoopTextMapPropagator_1 = __nccwpck_require__(3848); -var TextMapPropagator_1 = __nccwpck_require__(9017); -var global_utils_1 = __nccwpck_require__(6965); -var API_NAME = 'propagation'; -/** - * Singleton object which represents the entry point to the OpenTelemetry Propagation API - */ -var PropagationAPI = /** @class */ (function () { - /** Empty private constructor prevents end users from constructing a new instance of the API */ - function PropagationAPI() { +// Copyright (c) Microsoft Corporation. +var BaseRequestPolicy = /** @class */ (function () { + function BaseRequestPolicy(_nextPolicy, _options) { + this._nextPolicy = _nextPolicy; + this._options = _options; } - /** Get the singleton instance of the Propagator API */ - PropagationAPI.getInstance = function () { - if (!this._instance) { - this._instance = new PropagationAPI(); - } - return this._instance; - }; /** - * Set the current propagator. Returns the initialized propagator + * 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. */ - PropagationAPI.prototype.setGlobalPropagator = function (propagator) { - global_utils_1.registerGlobal(API_NAME, propagator); - return propagator; + BaseRequestPolicy.prototype.shouldLog = function (logLevel) { + return this._options.shouldLog(logLevel); }; /** - * Inject context into a carrier to be propagated inter-process - * - * @param context Context carrying tracing data to inject - * @param carrier carrier to inject context into - * @param setter Function used to set values on the carrier + * 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. */ - PropagationAPI.prototype.inject = function (context, carrier, setter) { - if (setter === void 0) { setter = TextMapPropagator_1.defaultTextMapSetter; } - return this._getGlobalPropagator().inject(context, carrier, setter); + BaseRequestPolicy.prototype.log = function (logLevel, message) { + this._options.log(logLevel, message); }; + return BaseRequestPolicy; +}()); +/** + * Optional properties that can be used when creating a RequestPolicy. + */ +var RequestPolicyOptions = /** @class */ (function () { + function RequestPolicyOptions(_logger) { + this._logger = _logger; + } /** - * Extract context from a carrier - * - * @param context Context which the newly created context will inherit from - * @param carrier Carrier to extract context from - * @param getter Function used to extract keys from a carrier + * 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. */ - PropagationAPI.prototype.extract = function (context, carrier, getter) { - if (getter === void 0) { getter = TextMapPropagator_1.defaultTextMapGetter; } - return this._getGlobalPropagator().extract(context, carrier, getter); + RequestPolicyOptions.prototype.shouldLog = function (logLevel) { + return (!!this._logger && + logLevel !== exports.HttpPipelineLogLevel.OFF && + logLevel <= this._logger.minimumLogLevel); }; /** - * Return a list of all fields which may be used by the propagator. + * Attempt to log the provided message to the provided logger. If no logger was provided or if + * the log level does not meet the logger's threshold, then nothing will be logged. + * @param logLevel - The log level of this log. + * @param message - The message of this log. */ - PropagationAPI.prototype.fields = function () { - return this._getGlobalPropagator().fields(); + RequestPolicyOptions.prototype.log = function (logLevel, message) { + if (this._logger && this.shouldLog(logLevel)) { + this._logger.log(logLevel, message); + } }; - /** Remove the global propagator */ - PropagationAPI.prototype.disable = function () { - global_utils_1.unregisterGlobal(API_NAME); + return RequestPolicyOptions; +}()); + +// Copyright (c) Microsoft Corporation. +function logPolicy(loggingOptions) { + if (loggingOptions === void 0) { loggingOptions = {}; } + return { + create: function (nextPolicy, options) { + return new LogPolicy(nextPolicy, options, loggingOptions); + } }; - PropagationAPI.prototype._getGlobalPropagator = function () { - return global_utils_1.getGlobal(API_NAME) || NoopTextMapPropagator_1.NOOP_TEXT_MAP_PROPAGATOR; +} +var LogPolicy = /** @class */ (function (_super) { + tslib.__extends(LogPolicy, _super); + function LogPolicy(nextPolicy, options, _a) { + var _b = _a === void 0 ? {} : _a, _c = _b.logger, logger$1 = _c === void 0 ? logger.info : _c, _d = _b.allowedHeaderNames, allowedHeaderNames = _d === void 0 ? [] : _d, _e = _b.allowedQueryParameters, allowedQueryParameters = _e === void 0 ? [] : _e; + var _this = _super.call(this, nextPolicy, options) || this; + _this.logger = logger$1; + _this.sanitizer = new Sanitizer({ allowedHeaderNames: allowedHeaderNames, allowedQueryParameters: allowedQueryParameters }); + return _this; + } + Object.defineProperty(LogPolicy.prototype, "allowedHeaderNames", { + /** + * Header names whose values will be logged when logging is enabled. Defaults to + * Date, traceparent, x-ms-client-request-id, and x-ms-request id. Any headers + * specified in this field will be added to that list. Any other values will + * be written to logs as "REDACTED". + * @deprecated Pass these into the constructor instead. + */ + get: function () { + return this.sanitizer.allowedHeaderNames; + }, + /** + * Header names whose values will be logged when logging is enabled. Defaults to + * Date, traceparent, x-ms-client-request-id, and x-ms-request id. Any headers + * specified in this field will be added to that list. Any other values will + * be written to logs as "REDACTED". + * @deprecated Pass these into the constructor instead. + */ + set: function (allowedHeaderNames) { + this.sanitizer.allowedHeaderNames = allowedHeaderNames; + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(LogPolicy.prototype, "allowedQueryParameters", { + /** + * Query string names whose values will be logged when logging is enabled. By default no + * query string values are logged. + * @deprecated Pass these into the constructor instead. + */ + get: function () { + return this.sanitizer.allowedQueryParameters; + }, + /** + * Query string names whose values will be logged when logging is enabled. By default no + * query string values are logged. + * @deprecated Pass these into the constructor instead. + */ + set: function (allowedQueryParameters) { + this.sanitizer.allowedQueryParameters = allowedQueryParameters; + }, + enumerable: false, + configurable: true + }); + LogPolicy.prototype.sendRequest = function (request) { + var _this = this; + if (!this.logger.enabled) + return this._nextPolicy.sendRequest(request); + this.logRequest(request); + return this._nextPolicy.sendRequest(request).then(function (response) { return _this.logResponse(response); }); }; - return PropagationAPI; -}()); -exports.PropagationAPI = PropagationAPI; -//# sourceMappingURL=propagation.js.map + LogPolicy.prototype.logRequest = function (request) { + this.logger("Request: " + this.sanitizer.sanitize(request)); + }; + LogPolicy.prototype.logResponse = function (response) { + this.logger("Response status code: " + response.status); + this.logger("Headers: " + this.sanitizer.sanitize(response.headers)); + return response; + }; + return LogPolicy; +}(BaseRequestPolicy)); -/***/ }), +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +/** + * Get the path to this parameter's value as a dotted string (a.b.c). + * @param parameter - The parameter to get the path string for. + * @returns The path to this parameter's value as a dotted string. + */ +function getPathStringFromParameter(parameter) { + return getPathStringFromParameterPath(parameter.parameterPath, parameter.mapper); +} +function getPathStringFromParameterPath(parameterPath, mapper) { + var result; + if (typeof parameterPath === "string") { + result = parameterPath; + } + else if (Array.isArray(parameterPath)) { + result = parameterPath.join("."); + } + else { + result = mapper.serializedName; + } + return result; +} -/***/ 9857: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +// Copyright (c) Microsoft Corporation. +/** + * Gets the list of status codes for streaming responses. + * @internal + */ +function getStreamResponseStatusCodes(operationSpec) { + var result = new Set(); + for (var statusCode in operationSpec.responses) { + var operationResponse = operationSpec.responses[statusCode]; + if (operationResponse.bodyMapper && + operationResponse.bodyMapper.type.name === MapperType.Stream) { + result.add(Number(statusCode)); + } + } + return result; +} -"use strict"; +// Copyright (c) Microsoft Corporation. +// Note: The reason we re-define all of the xml2js default settings (version 2.0) here is because the default settings object exposed +// by the xm2js library is mutable. See https://github.com/Leonidas-from-XIV/node-xml2js/issues/536 +// By creating a new copy of the settings each time we instantiate the parser, +// we are safeguarding against the possibility of the default settings being mutated elsewhere unintentionally. +var xml2jsDefaultOptionsV2 = { + explicitCharkey: false, + trim: false, + normalize: false, + normalizeTags: false, + attrkey: XML_ATTRKEY, + explicitArray: true, + ignoreAttrs: false, + mergeAttrs: false, + explicitRoot: true, + validator: undefined, + xmlns: false, + explicitChildren: false, + preserveChildrenOrder: false, + childkey: "$$", + charsAsChildren: false, + includeWhiteChars: false, + async: false, + strict: true, + attrNameProcessors: undefined, + attrValueProcessors: undefined, + tagNameProcessors: undefined, + valueProcessors: undefined, + rootName: "root", + xmldec: { + version: "1.0", + encoding: "UTF-8", + standalone: true + }, + doctype: undefined, + renderOpts: { + pretty: true, + indent: " ", + newline: "\n" + }, + headless: false, + chunkSize: 10000, + emptyTag: "", + cdata: false +}; +// The xml2js settings for general XML parsing operations. +var xml2jsParserSettings = Object.assign({}, xml2jsDefaultOptionsV2); +xml2jsParserSettings.explicitArray = false; +// The xml2js settings for general XML building operations. +var xml2jsBuilderSettings = Object.assign({}, xml2jsDefaultOptionsV2); +xml2jsBuilderSettings.explicitArray = false; +xml2jsBuilderSettings.renderOpts = { + pretty: false +}; +/** + * Converts given JSON object to XML string + * @param obj - JSON object to be converted into XML string + * @param opts - Options that govern the parsing of given JSON object + */ +function stringifyXML(obj, opts) { + var _a; + if (opts === void 0) { opts = {}; } + xml2jsBuilderSettings.rootName = opts.rootName; + xml2jsBuilderSettings.charkey = (_a = opts.xmlCharKey) !== null && _a !== void 0 ? _a : XML_CHARKEY; + var builder = new xml2js.Builder(xml2jsBuilderSettings); + return builder.buildObject(obj); +} +/** + * Converts given XML string into JSON + * @param str - String containing the XML content to be parsed into JSON + * @param opts - Options that govern the parsing of given xml string + */ +function parseXML(str, opts) { + var _a; + if (opts === void 0) { opts = {}; } + xml2jsParserSettings.explicitRoot = !!opts.includeRoot; + xml2jsParserSettings.charkey = (_a = opts.xmlCharKey) !== null && _a !== void 0 ? _a : XML_CHARKEY; + var xmlParser = new xml2js.Parser(xml2jsParserSettings); + return new Promise(function (resolve, reject) { + if (!str) { + reject(new Error("Document is empty")); + } + else { + xmlParser.parseString(str, function (err, res) { + if (err) { + reject(err); + } + else { + resolve(res); + } + }); + } + }); +} -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. +// Copyright (c) Microsoft Corporation. +/** + * Create a new serialization RequestPolicyCreator that will serialized HTTP request bodies as they + * pass through the HTTP pipeline. */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TraceAPI = void 0; -var ProxyTracerProvider_1 = __nccwpck_require__(9483); -var spancontext_utils_1 = __nccwpck_require__(541); -var global_utils_1 = __nccwpck_require__(6965); -var API_NAME = 'trace'; +function deserializationPolicy(deserializationContentTypes, parsingOptions) { + return { + create: function (nextPolicy, options) { + return new DeserializationPolicy(nextPolicy, options, deserializationContentTypes, parsingOptions); + } + }; +} +var defaultJsonContentTypes = ["application/json", "text/json"]; +var defaultXmlContentTypes = ["application/xml", "application/atom+xml"]; +var DefaultDeserializationOptions = { + expectedContentTypes: { + json: defaultJsonContentTypes, + xml: defaultXmlContentTypes + } +}; /** - * Singleton object which represents the entry point to the OpenTelemetry Tracing API + * A RequestPolicy that will deserialize HTTP response bodies and headers as they pass through the + * HTTP pipeline. */ -var TraceAPI = /** @class */ (function () { - /** Empty private constructor prevents end users from constructing a new instance of the API */ - function TraceAPI() { - this._proxyTracerProvider = new ProxyTracerProvider_1.ProxyTracerProvider(); - this.isSpanContextValid = spancontext_utils_1.isSpanContextValid; +var DeserializationPolicy = /** @class */ (function (_super) { + tslib.__extends(DeserializationPolicy, _super); + function DeserializationPolicy(nextPolicy, requestPolicyOptions, deserializationContentTypes, parsingOptions) { + if (parsingOptions === void 0) { parsingOptions = {}; } + var _a; + var _this = _super.call(this, nextPolicy, requestPolicyOptions) || this; + _this.jsonContentTypes = + (deserializationContentTypes && deserializationContentTypes.json) || defaultJsonContentTypes; + _this.xmlContentTypes = + (deserializationContentTypes && deserializationContentTypes.xml) || defaultXmlContentTypes; + _this.xmlCharKey = (_a = parsingOptions.xmlCharKey) !== null && _a !== void 0 ? _a : XML_CHARKEY; + return _this; } - /** Get the singleton instance of the Trace API */ - TraceAPI.getInstance = function () { - if (!this._instance) { - this._instance = new TraceAPI(); - } - return this._instance; - }; - /** - * Set the current global tracer. Returns the initialized global tracer provider - */ - TraceAPI.prototype.setGlobalTracerProvider = function (provider) { - this._proxyTracerProvider.setDelegate(provider); - global_utils_1.registerGlobal(API_NAME, this._proxyTracerProvider); - return this._proxyTracerProvider; - }; - /** - * Returns the global tracer provider. - */ - TraceAPI.prototype.getTracerProvider = function () { - return global_utils_1.getGlobal(API_NAME) || this._proxyTracerProvider; + DeserializationPolicy.prototype.sendRequest = function (request) { + return tslib.__awaiter(this, void 0, void 0, function () { + var _this = this; + return tslib.__generator(this, function (_a) { + return [2 /*return*/, this._nextPolicy.sendRequest(request).then(function (response) { + return deserializeResponseBody(_this.jsonContentTypes, _this.xmlContentTypes, response, { + xmlCharKey: _this.xmlCharKey + }); + })]; + }); + }); }; - /** - * Returns a tracer from the global tracer provider. - */ - TraceAPI.prototype.getTracer = function (name, version) { - return this.getTracerProvider().getTracer(name, version); + return DeserializationPolicy; +}(BaseRequestPolicy)); +function getOperationResponse(parsedResponse) { + var result; + var request = parsedResponse.request; + var operationSpec = request.operationSpec; + if (operationSpec) { + var operationResponseGetter = request.operationResponseGetter; + if (!operationResponseGetter) { + result = operationSpec.responses[parsedResponse.status]; + } + else { + result = operationResponseGetter(operationSpec, parsedResponse); + } + } + return result; +} +function shouldDeserializeResponse(parsedResponse) { + var shouldDeserialize = parsedResponse.request.shouldDeserialize; + var result; + if (shouldDeserialize === undefined) { + result = true; + } + else if (typeof shouldDeserialize === "boolean") { + result = shouldDeserialize; + } + else { + result = shouldDeserialize(parsedResponse); + } + return result; +} +function deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, options) { + var _a, _b, _c; + if (options === void 0) { options = {}; } + var updatedOptions = { + rootName: (_a = options.rootName) !== null && _a !== void 0 ? _a : "", + includeRoot: (_b = options.includeRoot) !== null && _b !== void 0 ? _b : false, + xmlCharKey: (_c = options.xmlCharKey) !== null && _c !== void 0 ? _c : XML_CHARKEY }; - /** Remove the global tracer provider */ - TraceAPI.prototype.disable = function () { - global_utils_1.unregisterGlobal(API_NAME); - this._proxyTracerProvider = new ProxyTracerProvider_1.ProxyTracerProvider(); + return parse(jsonContentTypes, xmlContentTypes, response, updatedOptions).then(function (parsedResponse) { + if (!shouldDeserializeResponse(parsedResponse)) { + return parsedResponse; + } + var operationSpec = parsedResponse.request.operationSpec; + if (!operationSpec || !operationSpec.responses) { + return parsedResponse; + } + var responseSpec = getOperationResponse(parsedResponse); + var _a = handleErrorResponse(parsedResponse, operationSpec, responseSpec), error = _a.error, shouldReturnResponse = _a.shouldReturnResponse; + if (error) { + throw error; + } + else if (shouldReturnResponse) { + return parsedResponse; + } + // An operation response spec does exist for current status code, so + // use it to deserialize the response. + if (responseSpec) { + if (responseSpec.bodyMapper) { + var valueToDeserialize = parsedResponse.parsedBody; + if (operationSpec.isXML && responseSpec.bodyMapper.type.name === MapperType.Sequence) { + valueToDeserialize = + typeof valueToDeserialize === "object" + ? valueToDeserialize[responseSpec.bodyMapper.xmlElementName] + : []; + } + try { + parsedResponse.parsedBody = operationSpec.serializer.deserialize(responseSpec.bodyMapper, valueToDeserialize, "operationRes.parsedBody", options); + } + catch (innerError) { + var restError = new RestError("Error " + innerError + " occurred in deserializing the responseBody - " + parsedResponse.bodyAsText, undefined, parsedResponse.status, parsedResponse.request, parsedResponse); + throw restError; + } + } + else if (operationSpec.httpMethod === "HEAD") { + // head methods never have a body, but we return a boolean to indicate presence/absence of the resource + parsedResponse.parsedBody = response.status >= 200 && response.status < 300; + } + if (responseSpec.headersMapper) { + parsedResponse.parsedHeaders = operationSpec.serializer.deserialize(responseSpec.headersMapper, parsedResponse.headers.rawHeaders(), "operationRes.parsedHeaders", options); + } + } + return parsedResponse; + }); +} +function isOperationSpecEmpty(operationSpec) { + var expectedStatusCodes = Object.keys(operationSpec.responses); + return (expectedStatusCodes.length === 0 || + (expectedStatusCodes.length === 1 && expectedStatusCodes[0] === "default")); +} +function handleErrorResponse(parsedResponse, operationSpec, responseSpec) { + var _a; + var isSuccessByStatus = 200 <= parsedResponse.status && parsedResponse.status < 300; + var isExpectedStatusCode = isOperationSpecEmpty(operationSpec) + ? isSuccessByStatus + : !!responseSpec; + if (isExpectedStatusCode) { + if (responseSpec) { + if (!responseSpec.isError) { + return { error: null, shouldReturnResponse: false }; + } + } + else { + return { error: null, shouldReturnResponse: false }; + } + } + var errorResponseSpec = responseSpec !== null && responseSpec !== void 0 ? responseSpec : operationSpec.responses.default; + var streaming = ((_a = parsedResponse.request.streamResponseStatusCodes) === null || _a === void 0 ? void 0 : _a.has(parsedResponse.status)) || + parsedResponse.request.streamResponseBody; + var initialErrorMessage = streaming + ? "Unexpected status code: " + parsedResponse.status + : parsedResponse.bodyAsText; + var error = new RestError(initialErrorMessage, undefined, parsedResponse.status, parsedResponse.request, parsedResponse); + // If the item failed but there's no error spec or default spec to deserialize the error, + // we should fail so we just throw the parsed response + if (!errorResponseSpec) { + throw error; + } + var defaultBodyMapper = errorResponseSpec.bodyMapper; + var defaultHeadersMapper = errorResponseSpec.headersMapper; + try { + // If error response has a body, try to deserialize it using default body mapper. + // Then try to extract error code & message from it + if (parsedResponse.parsedBody) { + var parsedBody = parsedResponse.parsedBody; + var parsedError = void 0; + if (defaultBodyMapper) { + var valueToDeserialize = parsedBody; + if (operationSpec.isXML && defaultBodyMapper.type.name === MapperType.Sequence) { + valueToDeserialize = + typeof parsedBody === "object" ? parsedBody[defaultBodyMapper.xmlElementName] : []; + } + parsedError = operationSpec.serializer.deserialize(defaultBodyMapper, valueToDeserialize, "error.response.parsedBody"); + } + var internalError = parsedBody.error || parsedError || parsedBody; + error.code = internalError.code; + if (internalError.message) { + error.message = internalError.message; + } + if (defaultBodyMapper) { + error.response.parsedBody = parsedError; + } + } + // If error response has headers, try to deserialize it using default header mapper + if (parsedResponse.headers && defaultHeadersMapper) { + error.response.parsedHeaders = operationSpec.serializer.deserialize(defaultHeadersMapper, parsedResponse.headers.rawHeaders(), "operationRes.parsedHeaders"); + } + } + catch (defaultError) { + error.message = "Error \"" + defaultError.message + "\" occurred in deserializing the responseBody - \"" + parsedResponse.bodyAsText + "\" for the default response."; + } + return { error: error, shouldReturnResponse: false }; +} +function parse(jsonContentTypes, xmlContentTypes, operationResponse, opts) { + var _a; + var errorHandler = function (err) { + var msg = "Error \"" + err + "\" occurred while parsing the response body - " + operationResponse.bodyAsText + "."; + var errCode = err.code || RestError.PARSE_ERROR; + var e = new RestError(msg, errCode, operationResponse.status, operationResponse.request, operationResponse); + return Promise.reject(e); }; - return TraceAPI; -}()); -exports.TraceAPI = TraceAPI; -//# sourceMappingURL=trace.js.map - -/***/ }), - -/***/ 1301: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=Baggage.js.map - -/***/ }), - -/***/ 100: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=Entry.js.map - -/***/ }), - -/***/ 6196: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; + var streaming = ((_a = operationResponse.request.streamResponseStatusCodes) === null || _a === void 0 ? void 0 : _a.has(operationResponse.status)) || + operationResponse.request.streamResponseBody; + if (!streaming && operationResponse.bodyAsText) { + var text_1 = operationResponse.bodyAsText; + var contentType = operationResponse.headers.get("Content-Type") || ""; + var contentComponents = !contentType + ? [] + : contentType.split(";").map(function (component) { return component.toLowerCase(); }); + if (contentComponents.length === 0 || + contentComponents.some(function (component) { return jsonContentTypes.indexOf(component) !== -1; })) { + return new Promise(function (resolve) { + operationResponse.parsedBody = JSON.parse(text_1); + resolve(operationResponse); + }).catch(errorHandler); + } + else if (contentComponents.some(function (component) { return xmlContentTypes.indexOf(component) !== -1; })) { + return parseXML(text_1, opts) + .then(function (body) { + operationResponse.parsedBody = body; + return operationResponse; + }) + .catch(errorHandler); + } + } + return Promise.resolve(operationResponse); +} -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.baggageEntryMetadataFromString = exports.createBaggage = void 0; -var baggage_1 = __nccwpck_require__(6393); -var symbol_1 = __nccwpck_require__(8256); -__exportStar(__nccwpck_require__(1301), exports); -__exportStar(__nccwpck_require__(100), exports); +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +var DEFAULT_CLIENT_RETRY_COUNT = 3; +// intervals are in ms +var DEFAULT_CLIENT_RETRY_INTERVAL = 1000 * 30; +var DEFAULT_CLIENT_MAX_RETRY_INTERVAL = 1000 * 90; +var DEFAULT_CLIENT_MIN_RETRY_INTERVAL = 1000 * 3; +function isNumber(n) { + return typeof n === "number"; +} /** - * Create a new Baggage with optional entries + * @internal + * Determines if the operation should be retried. * - * @param entries An array of baggage entries the new baggage should contain + * @param retryLimit - Specifies the max number of retries. + * @param predicate - Initial chekck on whether to retry based on given responses or errors + * @param retryData - The retry data. + * @returns True if the operation qualifies for a retry; false otherwise. */ -function createBaggage(entries) { - if (entries === void 0) { entries = {}; } - return new baggage_1.BaggageImpl(new Map(Object.entries(entries))); +function shouldRetry(retryLimit, predicate, retryData, response, error) { + if (!predicate(response, error)) { + return false; + } + return retryData.retryCount < retryLimit; } -exports.createBaggage = createBaggage; /** - * Create a serializable BaggageEntryMetadata object from a string. - * - * @param str string metadata. Format is currently not defined by the spec and has no special meaning. + * @internal + * Updates the retry data for the next attempt. * + * @param retryOptions - specifies retry interval, and its lower bound and upper bound. + * @param retryData - The retry data. + * @param err - The operation"s error, if any. */ -function baggageEntryMetadataFromString(str) { - if (typeof str !== 'string') { - // @TODO log diagnostic - str = ''; +function updateRetryData(retryOptions, retryData, err) { + if (retryData === void 0) { retryData = { retryCount: 0, retryInterval: 0 }; } + if (err) { + if (retryData.error) { + err.innerError = retryData.error; + } + retryData.error = err; } + // Adjust retry count + retryData.retryCount++; + // Adjust retry interval + var incrementDelta = Math.pow(2, retryData.retryCount - 1) - 1; + var boundedRandDelta = retryOptions.retryInterval * 0.8 + + Math.floor(Math.random() * (retryOptions.retryInterval * 0.4)); + incrementDelta *= boundedRandDelta; + retryData.retryInterval = Math.min(retryOptions.minRetryInterval + incrementDelta, retryOptions.maxRetryInterval); + return retryData; +} + +// Copyright (c) Microsoft Corporation. +function exponentialRetryPolicy(retryCount, retryInterval, maxRetryInterval) { return { - __TYPE__: symbol_1.baggageEntryMetadataSymbol, - toString: function () { - return str; - }, + create: function (nextPolicy, options) { + return new ExponentialRetryPolicy(nextPolicy, options, retryCount, retryInterval, maxRetryInterval); + } }; } -exports.baggageEntryMetadataFromString = baggageEntryMetadataFromString; -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 6393: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. +(function (RetryMode) { + RetryMode[RetryMode["Exponential"] = 0] = "Exponential"; +})(exports.RetryMode || (exports.RetryMode = {})); +var DefaultRetryOptions = { + maxRetries: DEFAULT_CLIENT_RETRY_COUNT, + retryDelayInMs: DEFAULT_CLIENT_RETRY_INTERVAL, + maxRetryDelayInMs: DEFAULT_CLIENT_MAX_RETRY_INTERVAL +}; +/** + * Instantiates a new "ExponentialRetryPolicyFilter" instance. */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.BaggageImpl = void 0; -var BaggageImpl = /** @class */ (function () { - function BaggageImpl(entries) { - this._entries = entries ? new Map(entries) : new Map(); +var ExponentialRetryPolicy = /** @class */ (function (_super) { + tslib.__extends(ExponentialRetryPolicy, _super); + /** + * @param nextPolicy - The next RequestPolicy in the pipeline chain. + * @param options - The options for this RequestPolicy. + * @param retryCount - The client retry count. + * @param retryInterval - The client retry interval, in milliseconds. + * @param minRetryInterval - The minimum retry interval, in milliseconds. + * @param maxRetryInterval - The maximum retry interval, in milliseconds. + */ + function ExponentialRetryPolicy(nextPolicy, options, retryCount, retryInterval, maxRetryInterval) { + var _this = _super.call(this, nextPolicy, options) || this; + _this.retryCount = isNumber(retryCount) ? retryCount : DEFAULT_CLIENT_RETRY_COUNT; + _this.retryInterval = isNumber(retryInterval) ? retryInterval : DEFAULT_CLIENT_RETRY_INTERVAL; + _this.maxRetryInterval = isNumber(maxRetryInterval) + ? maxRetryInterval + : DEFAULT_CLIENT_MAX_RETRY_INTERVAL; + return _this; + } + ExponentialRetryPolicy.prototype.sendRequest = function (request) { + var _this = this; + return this._nextPolicy + .sendRequest(request.clone()) + .then(function (response) { return retry(_this, request, response); }) + .catch(function (error) { return retry(_this, request, error.response, undefined, error); }); + }; + return ExponentialRetryPolicy; +}(BaseRequestPolicy)); +function retry(policy, request, response, retryData, requestError) { + return tslib.__awaiter(this, void 0, void 0, function () { + function shouldPolicyRetry(responseParam) { + var statusCode = responseParam === null || responseParam === void 0 ? void 0 : responseParam.status; + if (statusCode === undefined || + (statusCode < 500 && statusCode !== 408) || + statusCode === 501 || + statusCode === 505) { + return false; + } + return true; + } + var isAborted, res, err_1, err; + return tslib.__generator(this, function (_a) { + switch (_a.label) { + case 0: + retryData = updateRetryData({ + retryInterval: policy.retryInterval, + minRetryInterval: 0, + maxRetryInterval: policy.maxRetryInterval + }, retryData, requestError); + isAborted = request.abortSignal && request.abortSignal.aborted; + if (!(!isAborted && shouldRetry(policy.retryCount, shouldPolicyRetry, retryData, response))) return [3 /*break*/, 6]; + logger.info("Retrying request in " + retryData.retryInterval); + _a.label = 1; + case 1: + _a.trys.push([1, 4, , 5]); + return [4 /*yield*/, delay(retryData.retryInterval)]; + case 2: + _a.sent(); + return [4 /*yield*/, policy._nextPolicy.sendRequest(request.clone())]; + case 3: + res = _a.sent(); + return [2 /*return*/, retry(policy, request, res, retryData)]; + case 4: + err_1 = _a.sent(); + return [2 /*return*/, retry(policy, request, response, retryData, err_1)]; + case 5: return [3 /*break*/, 7]; + case 6: + if (isAborted || requestError || !response) { + err = retryData.error || + new RestError("Failed to send the request.", RestError.REQUEST_SEND_ERROR, response && response.status, response && response.request, response); + throw err; + } + else { + return [2 /*return*/, response]; + } + case 7: return [2 /*return*/]; + } + }); + }); +} + +// Copyright (c) Microsoft Corporation. +function generateClientRequestIdPolicy(requestIdHeaderName) { + if (requestIdHeaderName === void 0) { requestIdHeaderName = "x-ms-client-request-id"; } + return { + create: function (nextPolicy, options) { + return new GenerateClientRequestIdPolicy(nextPolicy, options, requestIdHeaderName); + } + }; +} +var GenerateClientRequestIdPolicy = /** @class */ (function (_super) { + tslib.__extends(GenerateClientRequestIdPolicy, _super); + function GenerateClientRequestIdPolicy(nextPolicy, options, _requestIdHeaderName) { + var _this = _super.call(this, nextPolicy, options) || this; + _this._requestIdHeaderName = _requestIdHeaderName; + return _this; } - BaggageImpl.prototype.getEntry = function (key) { - var entry = this._entries.get(key); - if (!entry) { - return undefined; + GenerateClientRequestIdPolicy.prototype.sendRequest = function (request) { + if (!request.headers.contains(this._requestIdHeaderName)) { + request.headers.set(this._requestIdHeaderName, request.requestId); } - return Object.assign({}, entry); + return this._nextPolicy.sendRequest(request); }; - BaggageImpl.prototype.getAllEntries = function () { - return Array.from(this._entries.entries()).map(function (_a) { - var k = _a[0], v = _a[1]; - return [k, v]; - }); + return GenerateClientRequestIdPolicy; +}(BaseRequestPolicy)); + +// Copyright (c) Microsoft Corporation. +function getDefaultUserAgentKey() { + return Constants.HeaderConstants.USER_AGENT; +} +function getPlatformSpecificData() { + var runtimeInfo = { + key: "Node", + value: process.version }; - BaggageImpl.prototype.setEntry = function (key, entry) { - var newBaggage = new BaggageImpl(this._entries); - newBaggage._entries.set(key, entry); - return newBaggage; + var osInfo = { + key: "OS", + value: "(" + os.arch() + "-" + os.type() + "-" + os.release() + ")" }; - BaggageImpl.prototype.removeEntry = function (key) { - var newBaggage = new BaggageImpl(this._entries); - newBaggage._entries.delete(key); - return newBaggage; + return [runtimeInfo, osInfo]; +} + +// Copyright (c) Microsoft Corporation. +function getRuntimeInfo() { + var msRestRuntime = { + key: "core-http", + value: Constants.coreHttpVersion }; - BaggageImpl.prototype.removeEntries = function () { - var keys = []; - for (var _i = 0; _i < arguments.length; _i++) { - keys[_i] = arguments[_i]; - } - var newBaggage = new BaggageImpl(this._entries); - for (var _a = 0, keys_1 = keys; _a < keys_1.length; _a++) { - var key = keys_1[_a]; - newBaggage._entries.delete(key); + return [msRestRuntime]; +} +function getUserAgentString(telemetryInfo, keySeparator, valueSeparator) { + if (keySeparator === void 0) { keySeparator = " "; } + if (valueSeparator === void 0) { valueSeparator = "/"; } + return telemetryInfo + .map(function (info) { + var value = info.value ? "" + valueSeparator + info.value : ""; + return "" + info.key + value; + }) + .join(keySeparator); +} +var getDefaultUserAgentHeaderName = getDefaultUserAgentKey; +function getDefaultUserAgentValue() { + var runtimeInfo = getRuntimeInfo(); + var platformSpecificData = getPlatformSpecificData(); + var userAgent = getUserAgentString(runtimeInfo.concat(platformSpecificData)); + return userAgent; +} +function userAgentPolicy(userAgentData) { + var key = !userAgentData || userAgentData.key === undefined || userAgentData.key === null + ? getDefaultUserAgentKey() + : userAgentData.key; + var value = !userAgentData || userAgentData.value === undefined || userAgentData.value === null + ? getDefaultUserAgentValue() + : userAgentData.value; + return { + create: function (nextPolicy, options) { + return new UserAgentPolicy(nextPolicy, options, key, value); } - return newBaggage; }; - BaggageImpl.prototype.clear = function () { - return new BaggageImpl(); +} +var UserAgentPolicy = /** @class */ (function (_super) { + tslib.__extends(UserAgentPolicy, _super); + function UserAgentPolicy(_nextPolicy, _options, headerKey, headerValue) { + var _this = _super.call(this, _nextPolicy, _options) || this; + _this._nextPolicy = _nextPolicy; + _this._options = _options; + _this.headerKey = headerKey; + _this.headerValue = headerValue; + return _this; + } + UserAgentPolicy.prototype.sendRequest = function (request) { + this.addUserAgentHeader(request); + return this._nextPolicy.sendRequest(request); }; - return BaggageImpl; -}()); -exports.BaggageImpl = BaggageImpl; -//# sourceMappingURL=baggage.js.map - -/***/ }), - -/***/ 8256: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; + UserAgentPolicy.prototype.addUserAgentHeader = function (request) { + if (!request.headers) { + request.headers = new HttpHeaders(); + } + if (!request.headers.get(this.headerKey) && this.headerValue) { + request.headers.set(this.headerKey, this.headerValue); + } + }; + return UserAgentPolicy; +}(BaseRequestPolicy)); -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.baggageEntryMetadataSymbol = void 0; +// Copyright (c) Microsoft Corporation. /** - * Symbol used to make BaggageEntryMetadata an opaque type - */ -exports.baggageEntryMetadataSymbol = Symbol('BaggageEntryMetadata'); -//# sourceMappingURL=symbol.js.map - -/***/ }), - -/***/ 9777: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=Exception.js.map - -/***/ }), - -/***/ 7413: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=Time.js.map - -/***/ }), - -/***/ 469: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Methods that are allowed to follow redirects 301 and 302 */ -var __spreadArrays = (this && this.__spreadArrays) || function () { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; +var allowedRedirect = ["GET", "HEAD"]; +var DefaultRedirectOptions = { + handleRedirects: true, + maxRetries: 20 }; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NoopContextManager = void 0; -var context_1 = __nccwpck_require__(7135); -var NoopContextManager = /** @class */ (function () { - function NoopContextManager() { - } - NoopContextManager.prototype.active = function () { - return context_1.ROOT_CONTEXT; - }; - NoopContextManager.prototype.with = function (_context, fn, thisArg) { - var args = []; - for (var _i = 3; _i < arguments.length; _i++) { - args[_i - 3] = arguments[_i]; +function redirectPolicy(maximumRetries) { + if (maximumRetries === void 0) { maximumRetries = 20; } + return { + create: function (nextPolicy, options) { + return new RedirectPolicy(nextPolicy, options, maximumRetries); } - return fn.call.apply(fn, __spreadArrays([thisArg], args)); }; - NoopContextManager.prototype.bind = function (target, _context) { - return target; +} +var RedirectPolicy = /** @class */ (function (_super) { + tslib.__extends(RedirectPolicy, _super); + function RedirectPolicy(nextPolicy, options, maxRetries) { + if (maxRetries === void 0) { maxRetries = 20; } + var _this = _super.call(this, nextPolicy, options) || this; + _this.maxRetries = maxRetries; + return _this; + } + RedirectPolicy.prototype.sendRequest = function (request) { + var _this = this; + return this._nextPolicy + .sendRequest(request) + .then(function (response) { return handleRedirect(_this, response, 0); }); }; - NoopContextManager.prototype.enable = function () { - return this; + return RedirectPolicy; +}(BaseRequestPolicy)); +function handleRedirect(policy, response, currentRetries) { + var request = response.request, status = response.status; + var locationHeader = response.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) && + (!policy.maxRetries || currentRetries < policy.maxRetries)) { + var builder = URLBuilder.parse(request.url); + builder.setPath(locationHeader); + request.url = builder.toString(); + // POST request with Status code 303 should be converted into a + // redirected GET request if the redirect url is present in the location header + if (status === 303) { + request.method = "GET"; + delete request.body; + } + return policy._nextPolicy + .sendRequest(request) + .then(function (res) { return handleRedirect(policy, res, currentRetries + 1); }); + } + return Promise.resolve(response); +} + +// Copyright (c) Microsoft Corporation. +function rpRegistrationPolicy(retryTimeout) { + if (retryTimeout === void 0) { retryTimeout = 30; } + return { + create: function (nextPolicy, options) { + return new RPRegistrationPolicy(nextPolicy, options, retryTimeout); + } }; - NoopContextManager.prototype.disable = function () { - return this; +} +var RPRegistrationPolicy = /** @class */ (function (_super) { + tslib.__extends(RPRegistrationPolicy, _super); + function RPRegistrationPolicy(nextPolicy, options, _retryTimeout) { + if (_retryTimeout === void 0) { _retryTimeout = 30; } + var _this = _super.call(this, nextPolicy, options) || this; + _this._retryTimeout = _retryTimeout; + return _this; + } + RPRegistrationPolicy.prototype.sendRequest = function (request) { + var _this = this; + return this._nextPolicy + .sendRequest(request.clone()) + .then(function (response) { return registerIfNeeded(_this, request, response); }); }; - return NoopContextManager; -}()); -exports.NoopContextManager = NoopContextManager; -//# sourceMappingURL=NoopContextManager.js.map - -/***/ }), - -/***/ 7135: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ROOT_CONTEXT = exports.createContextKey = exports.setBaggage = exports.getBaggage = exports.isInstrumentationSuppressed = exports.unsuppressInstrumentation = exports.suppressInstrumentation = exports.getSpanContext = exports.setSpanContext = exports.setSpan = exports.getSpan = void 0; -var NoopSpan_1 = __nccwpck_require__(3116); -/** - * span key - */ -var SPAN_KEY = createContextKey('OpenTelemetry Context Key SPAN'); -/** - * Shared key for indicating if instrumentation should be suppressed beyond - * this current scope. - */ -var SUPPRESS_INSTRUMENTATION_KEY = createContextKey('OpenTelemetry Context Key SUPPRESS_INSTRUMENTATION'); + return RPRegistrationPolicy; +}(BaseRequestPolicy)); +function registerIfNeeded(policy, request, response) { + if (response.status === 409) { + var rpName = checkRPNotRegisteredError(response.bodyAsText); + if (rpName) { + var urlPrefix = extractSubscriptionUrl(request.url); + return (registerRP(policy, urlPrefix, rpName, request) + // Autoregistration of ${provider} failed for some reason. We will not return this error + // instead will return the initial response with 409 status code back to the user. + // do nothing here as we are returning the original response at the end of this method. + .catch(function () { return false; }) + .then(function (registrationStatus) { + if (registrationStatus) { + // Retry the original request. We have to change the x-ms-client-request-id + // otherwise Azure endpoint will return the initial 409 (cached) response. + request.headers.set("x-ms-client-request-id", generateUuid()); + return policy._nextPolicy.sendRequest(request.clone()); + } + return response; + })); + } + } + return Promise.resolve(response); +} /** - * Baggage key + * Reuses the headers of the original request and url (if specified). + * @param originalRequest - The original request + * @param reuseUrlToo - Should the url from the original request be reused as well. Default false. + * @returns A new request object with desired headers. */ -var BAGGAGE_KEY = createContextKey('OpenTelemetry Baggage Key'); +function getRequestEssentials(originalRequest, reuseUrlToo) { + if (reuseUrlToo === void 0) { reuseUrlToo = false; } + var reqOptions = originalRequest.clone(); + if (reuseUrlToo) { + reqOptions.url = originalRequest.url; + } + // We have to change the x-ms-client-request-id otherwise Azure endpoint + // will return the initial 409 (cached) response. + reqOptions.headers.set("x-ms-client-request-id", generateUuid()); + // Set content-type to application/json + reqOptions.headers.set("Content-Type", "application/json; charset=utf-8"); + return reqOptions; +} /** - * Return the span if one exists - * - * @param context context to get span from + * Validates the error code and message associated with 409 response status code. If it matches to that of + * RP not registered then it returns the name of the RP else returns undefined. + * @param body - The response body received after making the original request. + * @returns The name of the RP if condition is satisfied else undefined. */ -function getSpan(context) { - return context.getValue(SPAN_KEY) || undefined; +function checkRPNotRegisteredError(body) { + var result, responseBody; + if (body) { + try { + responseBody = JSON.parse(body); + } + catch (err) { + // do nothing; + } + if (responseBody && + responseBody.error && + responseBody.error.message && + responseBody.error.code && + responseBody.error.code === "MissingSubscriptionRegistration") { + var matchRes = responseBody.error.message.match(/.*'(.*)'/i); + if (matchRes) { + result = matchRes.pop(); + } + } + } + return result; } -exports.getSpan = getSpan; /** - * Set the span on a context - * - * @param context context to use as parent - * @param span span to set active + * Extracts the first part of the URL, just after subscription: + * https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/ + * @param url - The original request url + * @returns The url prefix as explained above. */ -function setSpan(context, span) { - return context.setValue(SPAN_KEY, span); +function extractSubscriptionUrl(url) { + var result; + var matchRes = url.match(/.*\/subscriptions\/[a-f0-9-]+\//gi); + if (matchRes && matchRes[0]) { + result = matchRes[0]; + } + else { + throw new Error("Unable to extract subscriptionId from the given url - " + url + "."); + } + return result; } -exports.setSpan = setSpan; /** - * Wrap span context in a NoopSpan and set as span in a new - * context - * - * @param context context to set active span on - * @param spanContext span context to be wrapped + * Registers the given provider. + * @param policy - The RPRegistrationPolicy this function is being called against. + * @param urlPrefix - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/ + * @param provider - The provider name to be registered. + * @param originalRequest - The original request sent by the user that returned a 409 response + * with a message that the provider is not registered. + * @param callback - The callback that handles the RP registration */ -function setSpanContext(context, spanContext) { - return setSpan(context, new NoopSpan_1.NoopSpan(spanContext)); +function registerRP(policy, urlPrefix, provider, originalRequest) { + var postUrl = urlPrefix + "providers/" + provider + "/register?api-version=2016-02-01"; + var getUrl = urlPrefix + "providers/" + provider + "?api-version=2016-02-01"; + var reqOptions = getRequestEssentials(originalRequest); + reqOptions.method = "POST"; + reqOptions.url = postUrl; + return policy._nextPolicy.sendRequest(reqOptions).then(function (response) { + if (response.status !== 200) { + throw new Error("Autoregistration of " + provider + " failed. Please try registering manually."); + } + return getRegistrationStatus(policy, getUrl, originalRequest); + }); } -exports.setSpanContext = setSpanContext; /** - * Get the span context of the span if it exists. - * - * @param context context to get values from + * Polls the registration status of the provider that was registered. Polling happens at an interval of 30 seconds. + * Polling will happen till the registrationState property of the response body is "Registered". + * @param policy - The RPRegistrationPolicy this function is being called against. + * @param url - The request url for polling + * @param originalRequest - The original request sent by the user that returned a 409 response + * with a message that the provider is not registered. + * @returns True if RP Registration is successful. */ -function getSpanContext(context) { - var _a; - return (_a = getSpan(context)) === null || _a === void 0 ? void 0 : _a.context(); +function getRegistrationStatus(policy, url, originalRequest) { + var reqOptions = getRequestEssentials(originalRequest); + reqOptions.url = url; + reqOptions.method = "GET"; + return policy._nextPolicy.sendRequest(reqOptions).then(function (res) { + var obj = res.parsedBody; + if (res.parsedBody && obj.registrationState && obj.registrationState === "Registered") { + return true; + } + else { + return delay(policy._retryTimeout * 1000) + .then(function () { return getRegistrationStatus(policy, url, originalRequest); }); + } + }); } -exports.getSpanContext = getSpanContext; + +// Copyright (c) Microsoft Corporation. +// Default options for the cycler if none are provided +var DEFAULT_CYCLER_OPTIONS = { + forcedRefreshWindowInMs: 1000, + retryIntervalInMs: 3000, + refreshWindowInMs: 1000 * 60 * 2 // Start refreshing 2m before expiry +}; /** - * Sets value on context to indicate that instrumentation should - * be suppressed beyond this current scope. + * Converts an an unreliable access token getter (which may resolve with null) + * into an AccessTokenGetter by retrying the unreliable getter in a regular + * interval. * - * @param context context to set the suppress instrumentation value on. + * @param getAccessToken - a function that produces a promise of an access + * token that may fail by returning null + * @param retryIntervalInMs - the time (in milliseconds) to wait between retry + * attempts + * @param timeoutInMs - the timestamp after which the refresh attempt will fail, + * throwing an exception + * @returns - a promise that, if it resolves, will resolve with an access token */ -function suppressInstrumentation(context) { - return context.setValue(SUPPRESS_INSTRUMENTATION_KEY, true); +function beginRefresh(getAccessToken, retryIntervalInMs, timeoutInMs) { + return tslib.__awaiter(this, void 0, void 0, function () { + // This wrapper handles exceptions gracefully as long as we haven't exceeded + // the timeout. + function tryGetAccessToken() { + return tslib.__awaiter(this, void 0, void 0, function () { + var _a, finalToken; + return tslib.__generator(this, function (_b) { + switch (_b.label) { + case 0: + if (!(Date.now() < timeoutInMs)) return [3 /*break*/, 5]; + _b.label = 1; + case 1: + _b.trys.push([1, 3, , 4]); + return [4 /*yield*/, getAccessToken()]; + case 2: return [2 /*return*/, _b.sent()]; + case 3: + _a = _b.sent(); + return [2 /*return*/, null]; + case 4: return [3 /*break*/, 7]; + case 5: return [4 /*yield*/, getAccessToken()]; + case 6: + finalToken = _b.sent(); + // Timeout is up, so throw if it's still null + if (finalToken === null) { + throw new Error("Failed to refresh access token."); + } + return [2 /*return*/, finalToken]; + case 7: return [2 /*return*/]; + } + }); + }); + } + var token; + return tslib.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, tryGetAccessToken()]; + case 1: + token = _a.sent(); + _a.label = 2; + case 2: + if (!(token === null)) return [3 /*break*/, 5]; + return [4 /*yield*/, delay(retryIntervalInMs)]; + case 3: + _a.sent(); + return [4 /*yield*/, tryGetAccessToken()]; + case 4: + token = _a.sent(); + return [3 /*break*/, 2]; + case 5: return [2 /*return*/, token]; + } + }); + }); } -exports.suppressInstrumentation = suppressInstrumentation; /** - * Sets value on context to indicate that instrumentation should - * no-longer be suppressed beyond this current scope. + * Creates a token cycler from a credential, scopes, and optional settings. * - * @param context context to set the suppress instrumentation value on. + * A token cycler represents a way to reliably retrieve a valid access token + * from a TokenCredential. It will handle initializing the token, refreshing it + * when it nears expiration, and synchronizes refresh attempts to avoid + * concurrency hazards. + * + * @param credential - the underlying TokenCredential that provides the access + * token + * @param scopes - the scopes to request authorization for + * @param tokenCyclerOptions - optionally override default settings for the cycler + * + * @returns - a function that reliably produces a valid access token */ -function unsuppressInstrumentation(context) { - return context.setValue(SUPPRESS_INSTRUMENTATION_KEY, false); +function createTokenCycler(credential, scopes, tokenCyclerOptions) { + var _this = this; + var refreshWorker = null; + var token = null; + var options = tslib.__assign(tslib.__assign({}, DEFAULT_CYCLER_OPTIONS), tokenCyclerOptions); + /** + * This little holder defines several predicates that we use to construct + * the rules of refreshing the token. + */ + var cycler = { + /** + * Produces true if a refresh job is currently in progress. + */ + get isRefreshing() { + return refreshWorker !== null; + }, + /** + * Produces true if the cycler SHOULD refresh (we are within the refresh + * window and not already refreshing) + */ + get shouldRefresh() { + var _a; + return (!cycler.isRefreshing && + ((_a = token === null || token === void 0 ? void 0 : token.expiresOnTimestamp) !== null && _a !== void 0 ? _a : 0) - options.refreshWindowInMs < Date.now()); + }, + /** + * Produces true if the cycler MUST refresh (null or nearly-expired + * token). + */ + get mustRefresh() { + return (token === null || token.expiresOnTimestamp - options.forcedRefreshWindowInMs < Date.now()); + } + }; + /** + * Starts a refresh job or returns the existing job if one is already + * running. + */ + function refresh(getTokenOptions) { + var _a; + if (!cycler.isRefreshing) { + // We bind `scopes` here to avoid passing it around a lot + var tryGetAccessToken = function () { + return credential.getToken(scopes, getTokenOptions); + }; + // Take advantage of promise chaining to insert an assignment to `token` + // before the refresh can be considered done. + 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()) + .then(function (_token) { + refreshWorker = null; + token = _token; + return token; + }) + .catch(function (reason) { + // We also should reset the refresher if we enter a failed state. All + // existing awaiters will throw, but subsequent requests will start a + // new retry chain. + refreshWorker = null; + token = null; + throw reason; + }); + } + return refreshWorker; + } + return function (tokenOptions) { return tslib.__awaiter(_this, void 0, void 0, function () { + return tslib.__generator(this, function (_a) { + // + // Simple rules: + // - If we MUST refresh, then return the refresh task, blocking + // the pipeline until a token is available. + // - If we SHOULD refresh, then run refresh but don't return it + // (we can still use the cached token). + // - Return the token, since it's fine if we didn't return in + // step 1. + // + if (cycler.mustRefresh) + return [2 /*return*/, refresh(tokenOptions)]; + if (cycler.shouldRefresh) { + refresh(tokenOptions); + } + return [2 /*return*/, token]; + }); + }); }; } -exports.unsuppressInstrumentation = unsuppressInstrumentation; +// #endregion /** - * Return current suppress instrumentation value for the given context, - * if it exists. + * Creates a new factory for a RequestPolicy that applies a bearer token to + * the requests' `Authorization` headers. * - * @param context context check for the suppress instrumentation value. + * @param credential - The TokenCredential implementation that can supply the bearer token. + * @param scopes - The scopes for which the bearer token applies. */ -function isInstrumentationSuppressed(context) { - return Boolean(context.getValue(SUPPRESS_INSTRUMENTATION_KEY)); +function bearerTokenAuthenticationPolicy(credential, scopes) { + // This simple function encapsulates the entire process of reliably retrieving the token + var getToken = createTokenCycler(credential, scopes /* , options */); + var BearerTokenAuthenticationPolicy = /** @class */ (function (_super) { + tslib.__extends(BearerTokenAuthenticationPolicy, _super); + function BearerTokenAuthenticationPolicy(nextPolicy, options) { + return _super.call(this, nextPolicy, options) || this; + } + BearerTokenAuthenticationPolicy.prototype.sendRequest = function (webResource) { + return tslib.__awaiter(this, void 0, void 0, function () { + var token; + return tslib.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, getToken({ + abortSignal: webResource.abortSignal, + tracingOptions: { + spanOptions: webResource.spanOptions, + tracingContext: webResource.tracingContext + } + })]; + case 1: + token = (_a.sent()).token; + webResource.headers.set(Constants.HeaderConstants.AUTHORIZATION, "Bearer " + token); + return [2 /*return*/, this._nextPolicy.sendRequest(webResource)]; + } + }); + }); + }; + return BearerTokenAuthenticationPolicy; + }(BaseRequestPolicy)); + return { + create: function (nextPolicy, options) { + return new BearerTokenAuthenticationPolicy(nextPolicy, options); + } + }; } -exports.isInstrumentationSuppressed = isInstrumentationSuppressed; -/** - * @param {Context} Context that manage all context values - * @returns {Baggage} Extracted baggage from the context - */ -function getBaggage(context) { - return context.getValue(BAGGAGE_KEY) || undefined; + +// Copyright (c) Microsoft Corporation. +function systemErrorRetryPolicy(retryCount, retryInterval, minRetryInterval, maxRetryInterval) { + return { + create: function (nextPolicy, options) { + return new SystemErrorRetryPolicy(nextPolicy, options, retryCount, retryInterval, minRetryInterval, maxRetryInterval); + } + }; } -exports.getBaggage = getBaggage; /** - * @param {Context} Context that manage all context values - * @param {Baggage} baggage that will be set in the actual context + * @param retryCount - The client retry count. + * @param retryInterval - The client retry interval, in milliseconds. + * @param minRetryInterval - The minimum retry interval, in milliseconds. + * @param maxRetryInterval - The maximum retry interval, in milliseconds. */ -function setBaggage(context, baggage) { - return context.setValue(BAGGAGE_KEY, baggage); -} -exports.setBaggage = setBaggage; -/** Get a key to uniquely identify a context value */ -function createContextKey(description) { - return Symbol.for(description); -} -exports.createContextKey = createContextKey; -var BaseContext = /** @class */ (function () { - /** - * Construct a new context which inherits values from an optional parent context. - * - * @param parentContext a context from which to inherit values - */ - function BaseContext(parentContext) { - // for minification - var self = this; - self._currentContext = parentContext ? new Map(parentContext) : new Map(); - self.getValue = function (key) { return self._currentContext.get(key); }; - self.setValue = function (key, value) { - var context = new BaseContext(self._currentContext); - context._currentContext.set(key, value); - return context; - }; - self.deleteValue = function (key) { - var context = new BaseContext(self._currentContext); - context._currentContext.delete(key); - return context; - }; +var SystemErrorRetryPolicy = /** @class */ (function (_super) { + tslib.__extends(SystemErrorRetryPolicy, _super); + function SystemErrorRetryPolicy(nextPolicy, options, retryCount, retryInterval, minRetryInterval, maxRetryInterval) { + var _this = _super.call(this, nextPolicy, options) || this; + _this.retryCount = isNumber(retryCount) ? retryCount : DEFAULT_CLIENT_RETRY_COUNT; + _this.retryInterval = isNumber(retryInterval) ? retryInterval : DEFAULT_CLIENT_RETRY_INTERVAL; + _this.minRetryInterval = isNumber(minRetryInterval) + ? minRetryInterval + : DEFAULT_CLIENT_MIN_RETRY_INTERVAL; + _this.maxRetryInterval = isNumber(maxRetryInterval) + ? maxRetryInterval + : DEFAULT_CLIENT_MAX_RETRY_INTERVAL; + return _this; } - return BaseContext; -}()); -/** The root context is used as the default parent context when there is no active context */ -exports.ROOT_CONTEXT = new BaseContext(); -//# sourceMappingURL=context.js.map - -/***/ }), - -/***/ 5658: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=types.js.map - -/***/ }), - -/***/ 7171: -/***/ ((__unused_webpack_module, exports) => { + SystemErrorRetryPolicy.prototype.sendRequest = function (request) { + var _this = this; + return this._nextPolicy + .sendRequest(request.clone()) + .catch(function (error) { return retry$1(_this, request, error.response, error); }); + }; + return SystemErrorRetryPolicy; +}(BaseRequestPolicy)); +function retry$1(policy, request, operationResponse, err, retryData) { + return tslib.__awaiter(this, void 0, void 0, function () { + function shouldPolicyRetry(_response, error) { + if (error && + error.code && + (error.code === "ETIMEDOUT" || + error.code === "ESOCKETTIMEDOUT" || + error.code === "ECONNREFUSED" || + error.code === "ECONNRESET" || + error.code === "ENOENT")) { + return true; + } + return false; + } + var nestedErr_1; + return tslib.__generator(this, function (_a) { + switch (_a.label) { + case 0: + retryData = updateRetryData(policy, retryData, err); + if (!shouldRetry(policy.retryCount, shouldPolicyRetry, retryData, operationResponse, err)) return [3 /*break*/, 5]; + _a.label = 1; + case 1: + _a.trys.push([1, 3, , 4]); + return [4 /*yield*/, delay(retryData.retryInterval)]; + case 2: + _a.sent(); + return [2 /*return*/, policy._nextPolicy.sendRequest(request.clone())]; + case 3: + nestedErr_1 = _a.sent(); + return [2 /*return*/, retry$1(policy, request, operationResponse, nestedErr_1, retryData)]; + case 4: return [3 /*break*/, 6]; + case 5: + if (err) { + // If the operation failed in the end, return all errors instead of just the last one + return [2 /*return*/, Promise.reject(retryData.error)]; + } + return [2 /*return*/, operationResponse]; + case 6: return [2 /*return*/]; + } + }); + }); +} -"use strict"; +// Copyright (c) Microsoft Corporation. +(function (QueryCollectionFormat) { + QueryCollectionFormat["Csv"] = ","; + QueryCollectionFormat["Ssv"] = " "; + QueryCollectionFormat["Tsv"] = "\t"; + QueryCollectionFormat["Pipes"] = "|"; + QueryCollectionFormat["Multi"] = "Multi"; +})(exports.QueryCollectionFormat || (exports.QueryCollectionFormat = {})); -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DiagConsoleLogger = void 0; -var consoleMap = [ - { n: 'error', c: 'error' }, - { n: 'warn', c: 'warn' }, - { n: 'info', c: 'info' }, - { n: 'debug', c: 'debug' }, - { n: 'verbose', c: 'trace' }, -]; +// Copyright (c) Microsoft Corporation. /** - * A simple Immutable Console based diagnostic logger which will output any messages to the Console. - * If you want to limit the amount of logging to a specific level or lower use the - * {@link createLogLevelDiagLogger} + * @internal */ -var DiagConsoleLogger = /** @class */ (function () { - function DiagConsoleLogger() { - function _consoleFunc(funcName) { - return function () { - var orgArguments = arguments; - if (console) { - // Some environments only expose the console when the F12 developer console is open - var theFunc = console[funcName]; - if (typeof theFunc !== 'function') { - // Not all environments support all functions - theFunc = console.log; - } - // One last final check - if (typeof theFunc === 'function') { - return theFunc.apply(console, orgArguments); - } - } - }; - } - for (var i = 0; i < consoleMap.length; i++) { - this[consoleMap[i].n] = _consoleFunc(consoleMap[i].c); - } +var noProxyList = []; +var noProxyListLoaded = false; +var byPassedList = new Map(); +function loadEnvironmentProxyValue() { + if (!process) { + return undefined; } - return DiagConsoleLogger; -}()); -exports.DiagConsoleLogger = DiagConsoleLogger; -//# sourceMappingURL=consoleLogger.js.map - -/***/ }), - -/***/ 8266: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__nccwpck_require__(7171), exports); -__exportStar(__nccwpck_require__(2339), exports); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 6430: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + var httpsProxy = getEnvironmentValue(Constants.HTTPS_PROXY); + var allProxy = getEnvironmentValue(Constants.ALL_PROXY); + var httpProxy = getEnvironmentValue(Constants.HTTP_PROXY); + return httpsProxy || allProxy || httpProxy; +} +// Check whether the host of a given `uri` is in the noProxyList. +// If there's a match, any request sent to the same host won't have the proxy settings set. +// This implementation is a port of https://github.com/Azure/azure-sdk-for-net/blob/8cca811371159e527159c7eb65602477898683e2/sdk/core/Azure.Core/src/Pipeline/Internal/HttpEnvironmentProxy.cs#L210 +function isBypassed(uri) { + if (noProxyList.length === 0) { + return false; + } + var host = URLBuilder.parse(uri).getHost(); + if (byPassedList.has(host)) { + return byPassedList.get(host); + } + var isBypassedFlag = false; + for (var _i = 0, noProxyList_1 = noProxyList; _i < noProxyList_1.length; _i++) { + var pattern = noProxyList_1[_i]; + if (pattern[0] === ".") { + // This should match either domain it self or any subdomain or host + // .foo.com will match foo.com it self or *.foo.com + if (host.endsWith(pattern)) { + isBypassedFlag = true; + } + else { + if (host.length === pattern.length - 1 && host === pattern.slice(1)) { + isBypassedFlag = true; + } + } + } + else { + if (host === pattern) { + isBypassedFlag = true; + } + } + } + byPassedList.set(host, isBypassedFlag); + return isBypassedFlag; +} +/** + * @internal */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.createLogLevelDiagLogger = void 0; -var types_1 = __nccwpck_require__(2339); -function createLogLevelDiagLogger(maxLevel, logger) { - if (maxLevel < types_1.DiagLogLevel.NONE) { - maxLevel = types_1.DiagLogLevel.NONE; +function loadNoProxy() { + var noProxy = getEnvironmentValue(Constants.NO_PROXY); + noProxyListLoaded = true; + if (noProxy) { + return noProxy + .split(",") + .map(function (item) { return item.trim(); }) + .filter(function (item) { return item.length; }); } - else if (maxLevel > types_1.DiagLogLevel.ALL) { - maxLevel = types_1.DiagLogLevel.ALL; + return []; +} +function getDefaultProxySettings(proxyUrl) { + if (!proxyUrl) { + proxyUrl = loadEnvironmentProxyValue(); + if (!proxyUrl) { + return undefined; + } } - // In case the logger is null or undefined - logger = logger || {}; - function _filterFunc(funcName, theLevel) { - var theFunc = logger[funcName]; - if (typeof theFunc === 'function' && maxLevel >= theLevel) { - return theFunc.bind(logger); + var _a = extractAuthFromUrl(proxyUrl), username = _a.username, password = _a.password, urlWithoutAuth = _a.urlWithoutAuth; + var parsedUrl = URLBuilder.parse(urlWithoutAuth); + var schema = parsedUrl.getScheme() ? parsedUrl.getScheme() + "://" : ""; + return { + host: schema + parsedUrl.getHost(), + port: Number.parseInt(parsedUrl.getPort() || "80"), + username: username, + password: password + }; +} +function proxyPolicy(proxySettings) { + if (!proxySettings) { + proxySettings = getDefaultProxySettings(); + } + if (!noProxyListLoaded) { + noProxyList.push.apply(noProxyList, loadNoProxy()); + } + return { + create: function (nextPolicy, options) { + return new ProxyPolicy(nextPolicy, options, proxySettings); } - return function () { }; + }; +} +function extractAuthFromUrl(url) { + var atIndex = url.indexOf("@"); + if (atIndex === -1) { + return { urlWithoutAuth: url }; } + var schemeIndex = url.indexOf("://"); + var authStart = schemeIndex !== -1 ? schemeIndex + 3 : 0; + var auth = url.substring(authStart, atIndex); + var colonIndex = auth.indexOf(":"); + var hasPassword = colonIndex !== -1; + var username = hasPassword ? auth.substring(0, colonIndex) : auth; + var password = hasPassword ? auth.substring(colonIndex + 1) : undefined; + var urlWithoutAuth = url.substring(0, authStart) + url.substring(atIndex + 1); return { - error: _filterFunc('error', types_1.DiagLogLevel.ERROR), - warn: _filterFunc('warn', types_1.DiagLogLevel.WARN), - info: _filterFunc('info', types_1.DiagLogLevel.INFO), - debug: _filterFunc('debug', types_1.DiagLogLevel.DEBUG), - verbose: _filterFunc('verbose', types_1.DiagLogLevel.VERBOSE), + username: username, + password: password, + urlWithoutAuth: urlWithoutAuth }; } -exports.createLogLevelDiagLogger = createLogLevelDiagLogger; -//# sourceMappingURL=logLevelLogger.js.map - -/***/ }), - -/***/ 2339: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; +var ProxyPolicy = /** @class */ (function (_super) { + tslib.__extends(ProxyPolicy, _super); + function ProxyPolicy(nextPolicy, options, proxySettings) { + var _this = _super.call(this, nextPolicy, options) || this; + _this.proxySettings = proxySettings; + return _this; + } + ProxyPolicy.prototype.sendRequest = function (request) { + if (!request.proxySettings && !isBypassed(request.url)) { + request.proxySettings = this.proxySettings; + } + return this._nextPolicy.sendRequest(request); + }; + return ProxyPolicy; +}(BaseRequestPolicy)); -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DiagLogLevel = void 0; +// Copyright (c) Microsoft Corporation. +var StatusCodes = Constants.HttpConstants.StatusCodes; +function throttlingRetryPolicy() { + return { + create: function (nextPolicy, options) { + return new ThrottlingRetryPolicy(nextPolicy, options); + } + }; +} /** - * Defines the available internal logging levels for the diagnostic logger, the numeric values - * of the levels are defined to match the original values from the initial LogLevel to avoid - * compatibility/migration issues for any implementation that assume the numeric ordering. + * To learn more, please refer to + * https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-request-limits, + * https://docs.microsoft.com/en-us/azure/azure-subscription-service-limits and + * https://docs.microsoft.com/en-us/azure/virtual-machines/troubleshooting/troubleshooting-throttling-errors */ -var DiagLogLevel; -(function (DiagLogLevel) { - /** Diagnostic Logging level setting to disable all logging (except and forced logs) */ - DiagLogLevel[DiagLogLevel["NONE"] = 0] = "NONE"; - /** Identifies an error scenario */ - DiagLogLevel[DiagLogLevel["ERROR"] = 30] = "ERROR"; - /** Identifies a warning scenario */ - DiagLogLevel[DiagLogLevel["WARN"] = 50] = "WARN"; - /** General informational log message */ - DiagLogLevel[DiagLogLevel["INFO"] = 60] = "INFO"; - /** General debug log message */ - DiagLogLevel[DiagLogLevel["DEBUG"] = 70] = "DEBUG"; - /** - * Detailed trace level logging should only be used for development, should only be set - * in a development environment. - */ - DiagLogLevel[DiagLogLevel["VERBOSE"] = 80] = "VERBOSE"; - /** Used to set the logging level to include all logging */ - DiagLogLevel[DiagLogLevel["ALL"] = 9999] = "ALL"; -})(DiagLogLevel = exports.DiagLogLevel || (exports.DiagLogLevel = {})); -//# sourceMappingURL=types.js.map - -/***/ }), - -/***/ 6865: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +var ThrottlingRetryPolicy = /** @class */ (function (_super) { + tslib.__extends(ThrottlingRetryPolicy, _super); + function ThrottlingRetryPolicy(nextPolicy, options, _handleResponse) { + var _this = _super.call(this, nextPolicy, options) || this; + _this._handleResponse = _handleResponse || _this._defaultResponseHandler; + return _this; + } + ThrottlingRetryPolicy.prototype.sendRequest = function (httpRequest) { + return tslib.__awaiter(this, void 0, void 0, function () { + var _this = this; + return tslib.__generator(this, function (_a) { + return [2 /*return*/, this._nextPolicy.sendRequest(httpRequest.clone()).then(function (response) { + if (response.status !== StatusCodes.TooManyRequests) { + return response; + } + else { + return _this._handleResponse(httpRequest, response); + } + })]; + }); + }); + }; + ThrottlingRetryPolicy.prototype._defaultResponseHandler = function (httpRequest, httpResponse) { + return tslib.__awaiter(this, void 0, void 0, function () { + var retryAfterHeader, delayInMs; + var _this = this; + return tslib.__generator(this, function (_a) { + retryAfterHeader = httpResponse.headers.get(Constants.HeaderConstants.RETRY_AFTER); + if (retryAfterHeader) { + delayInMs = ThrottlingRetryPolicy.parseRetryAfterHeader(retryAfterHeader); + if (delayInMs) { + return [2 /*return*/, delay(delayInMs).then(function (_) { return _this._nextPolicy.sendRequest(httpRequest); })]; + } + } + return [2 /*return*/, httpResponse]; + }); + }); + }; + ThrottlingRetryPolicy.parseRetryAfterHeader = function (headerValue) { + var retryAfterInSeconds = Number(headerValue); + if (Number.isNaN(retryAfterInSeconds)) { + return ThrottlingRetryPolicy.parseDateRetryAfterHeader(headerValue); + } + else { + return retryAfterInSeconds * 1000; + } + }; + ThrottlingRetryPolicy.parseDateRetryAfterHeader = function (headerValue) { + try { + var now = Date.now(); + var date = Date.parse(headerValue); + var diff = date - now; + return Number.isNaN(diff) ? undefined : diff; + } + catch (error) { + return undefined; + } + }; + return ThrottlingRetryPolicy; +}(BaseRequestPolicy)); -"use strict"; +// Copyright (c) Microsoft Corporation. +function signingPolicy(authenticationProvider) { + return { + create: function (nextPolicy, options) { + return new SigningPolicy(nextPolicy, options, authenticationProvider); + } + }; +} +var SigningPolicy = /** @class */ (function (_super) { + tslib.__extends(SigningPolicy, _super); + function SigningPolicy(nextPolicy, options, authenticationProvider) { + var _this = _super.call(this, nextPolicy, options) || this; + _this.authenticationProvider = authenticationProvider; + return _this; + } + SigningPolicy.prototype.signRequest = function (request) { + return this.authenticationProvider.signRequest(request); + }; + SigningPolicy.prototype.sendRequest = function (request) { + var _this = this; + return this.signRequest(request).then(function (nextRequest) { + return _this._nextPolicy.sendRequest(nextRequest); + }); + }; + return SigningPolicy; +}(BaseRequestPolicy)); -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +// Copyright (c) Microsoft Corporation. +var DefaultKeepAliveOptions = { + enable: true }; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.diag = exports.propagation = exports.trace = exports.context = exports.isValidSpanId = exports.isValidTraceId = exports.isSpanContextValid = exports.INVALID_SPAN_CONTEXT = exports.INVALID_TRACEID = exports.INVALID_SPANID = void 0; -__exportStar(__nccwpck_require__(6196), exports); -__exportStar(__nccwpck_require__(9777), exports); -__exportStar(__nccwpck_require__(7413), exports); -__exportStar(__nccwpck_require__(8266), exports); -__exportStar(__nccwpck_require__(3848), exports); -__exportStar(__nccwpck_require__(9017), exports); -__exportStar(__nccwpck_require__(761), exports); -__exportStar(__nccwpck_require__(9217), exports); -__exportStar(__nccwpck_require__(8984), exports); -__exportStar(__nccwpck_require__(9067), exports); -__exportStar(__nccwpck_require__(913), exports); -__exportStar(__nccwpck_require__(2793), exports); -__exportStar(__nccwpck_require__(5159), exports); -__exportStar(__nccwpck_require__(9483), exports); -__exportStar(__nccwpck_require__(1569), exports); -__exportStar(__nccwpck_require__(7502), exports); -__exportStar(__nccwpck_require__(9955), exports); -__exportStar(__nccwpck_require__(3107), exports); -__exportStar(__nccwpck_require__(8052), exports); -__exportStar(__nccwpck_require__(9618), exports); -__exportStar(__nccwpck_require__(1997), exports); -__exportStar(__nccwpck_require__(886), exports); -__exportStar(__nccwpck_require__(8434), exports); -__exportStar(__nccwpck_require__(2749), exports); -__exportStar(__nccwpck_require__(9824), exports); -__exportStar(__nccwpck_require__(3833), exports); -var spancontext_utils_1 = __nccwpck_require__(541); -Object.defineProperty(exports, "INVALID_SPANID", ({ enumerable: true, get: function () { return spancontext_utils_1.INVALID_SPANID; } })); -Object.defineProperty(exports, "INVALID_TRACEID", ({ enumerable: true, get: function () { return spancontext_utils_1.INVALID_TRACEID; } })); -Object.defineProperty(exports, "INVALID_SPAN_CONTEXT", ({ enumerable: true, get: function () { return spancontext_utils_1.INVALID_SPAN_CONTEXT; } })); -Object.defineProperty(exports, "isSpanContextValid", ({ enumerable: true, get: function () { return spancontext_utils_1.isSpanContextValid; } })); -Object.defineProperty(exports, "isValidTraceId", ({ enumerable: true, get: function () { return spancontext_utils_1.isValidTraceId; } })); -Object.defineProperty(exports, "isValidSpanId", ({ enumerable: true, get: function () { return spancontext_utils_1.isValidSpanId; } })); -__exportStar(__nccwpck_require__(7135), exports); -__exportStar(__nccwpck_require__(469), exports); -__exportStar(__nccwpck_require__(5658), exports); -var context_1 = __nccwpck_require__(7407); -/** Entrypoint for context API */ -exports.context = context_1.ContextAPI.getInstance(); -var trace_1 = __nccwpck_require__(9857); -/** Entrypoint for trace API */ -exports.trace = trace_1.TraceAPI.getInstance(); -var propagation_1 = __nccwpck_require__(9362); -/** Entrypoint for propagation API */ -exports.propagation = propagation_1.PropagationAPI.getInstance(); -var diag_1 = __nccwpck_require__(4658); +function keepAlivePolicy(keepAliveOptions) { + return { + create: function (nextPolicy, options) { + return new KeepAlivePolicy(nextPolicy, options, keepAliveOptions || DefaultKeepAliveOptions); + } + }; +} /** - * Entrypoint for Diag API. - * Defines Diagnostic handler used for internal diagnostic logging operations. - * The default provides a Noop DiagLogger implementation which may be changed via the - * diag.setLogger(logger: DiagLogger) function. + * KeepAlivePolicy is a policy used to control keep alive settings for every request. */ -exports.diag = diag_1.DiagAPI.instance(); -exports.default = { - trace: exports.trace, - context: exports.context, - propagation: exports.propagation, - diag: exports.diag, -}; -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 6965: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; +var KeepAlivePolicy = /** @class */ (function (_super) { + tslib.__extends(KeepAlivePolicy, _super); + /** + * Creates an instance of KeepAlivePolicy. + * + * @param nextPolicy - + * @param options - + * @param keepAliveOptions - + */ + function KeepAlivePolicy(nextPolicy, options, keepAliveOptions) { + var _this = _super.call(this, nextPolicy, options) || this; + _this.keepAliveOptions = keepAliveOptions; + return _this; + } + /** + * Sends out request. + * + * @param request - + * @returns + */ + KeepAlivePolicy.prototype.sendRequest = function (request) { + return tslib.__awaiter(this, void 0, void 0, function () { + return tslib.__generator(this, function (_a) { + request.keepAlive = this.keepAliveOptions.enable; + return [2 /*return*/, this._nextPolicy.sendRequest(request)]; + }); + }); + }; + return KeepAlivePolicy; +}(BaseRequestPolicy)); -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.unregisterGlobal = exports.getGlobal = exports.registerGlobal = void 0; -var __1 = __nccwpck_require__(6865); -var platform_1 = __nccwpck_require__(4730); -var version_1 = __nccwpck_require__(4044); -var semver_1 = __nccwpck_require__(5149); -var major = version_1.VERSION.split('.')[0]; -var GLOBAL_OPENTELEMETRY_API_KEY = Symbol.for("io.opentelemetry.js.api." + major); -var _global = platform_1._globalThis; -function registerGlobal(type, instance, allowOverride) { - var _a; - if (allowOverride === void 0) { allowOverride = false; } - _global[GLOBAL_OPENTELEMETRY_API_KEY] = (_a = _global[GLOBAL_OPENTELEMETRY_API_KEY]) !== null && _a !== void 0 ? _a : { - version: version_1.VERSION, +// Copyright (c) Microsoft Corporation. +var createSpan = coreTracing.createSpanFunction({ + packagePrefix: "", + namespace: "" +}); +function tracingPolicy(tracingOptions) { + if (tracingOptions === void 0) { tracingOptions = {}; } + return { + create: function (nextPolicy, options) { + return new TracingPolicy(nextPolicy, options, tracingOptions); + } }; - var api = _global[GLOBAL_OPENTELEMETRY_API_KEY]; - if (!allowOverride && api[type]) { - // already registered an API of this type - var err = new Error("@opentelemetry/api: Attempted duplicate registration of API: " + type); - __1.diag.error(err.stack || err.message); - return; - } - if (api.version !== version_1.VERSION) { - // All registered APIs must be of the same version exactly - var err = new Error('@opentelemetry/api: All API registration versions must match'); - __1.diag.error(err.stack || err.message); - return; - } - api[type] = instance; -} -exports.registerGlobal = registerGlobal; -function getGlobal(type) { - var _a, _b; - var globalVersion = (_a = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _a === void 0 ? void 0 : _a.version; - if (!globalVersion || !semver_1.isCompatible(globalVersion)) { - return; - } - return (_b = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _b === void 0 ? void 0 : _b[type]; } -exports.getGlobal = getGlobal; -function unregisterGlobal(type) { - var api = _global[GLOBAL_OPENTELEMETRY_API_KEY]; - if (api) { - delete api[type]; +var TracingPolicy = /** @class */ (function (_super) { + tslib.__extends(TracingPolicy, _super); + function TracingPolicy(nextPolicy, options, tracingOptions) { + var _this = _super.call(this, nextPolicy, options) || this; + _this.userAgent = tracingOptions.userAgent; + return _this; } -} -exports.unregisterGlobal = unregisterGlobal; -//# sourceMappingURL=global-utils.js.map - -/***/ }), - -/***/ 5149: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; + TracingPolicy.prototype.sendRequest = function (request) { + return tslib.__awaiter(this, void 0, void 0, function () { + var path, span, spanContext, traceParentHeader, traceState, response, serviceRequestId, err_1; + return tslib.__generator(this, function (_a) { + switch (_a.label) { + case 0: + if (!request.tracingContext) { + return [2 /*return*/, this._nextPolicy.sendRequest(request)]; + } + path = URLBuilder.parse(request.url).getPath() || "/"; + span = createSpan(path, { + tracingOptions: { + spanOptions: tslib.__assign(tslib.__assign({}, request.spanOptions), { kind: coreTracing.SpanKind.CLIENT }), + tracingContext: request.tracingContext + } + }).span; + span.setAttributes({ + "http.method": request.method, + "http.url": request.url, + requestId: request.requestId + }); + if (this.userAgent) { + span.setAttribute("http.user_agent", this.userAgent); + } + _a.label = 1; + case 1: + _a.trys.push([1, 3, 4, 5]); + spanContext = span.context(); + traceParentHeader = coreTracing.getTraceParentHeader(spanContext); + if (traceParentHeader) { + request.headers.set("traceparent", traceParentHeader); + traceState = spanContext.traceState && spanContext.traceState.serialize(); + // if tracestate is set, traceparent MUST be set, so only set tracestate after traceparent + if (traceState) { + request.headers.set("tracestate", traceState); + } + } + return [4 /*yield*/, this._nextPolicy.sendRequest(request)]; + case 2: + response = _a.sent(); + span.setAttribute("http.status_code", response.status); + serviceRequestId = response.headers.get("x-ms-request-id"); + if (serviceRequestId) { + span.setAttribute("serviceRequestId", serviceRequestId); + } + span.setStatus({ + code: coreTracing.SpanStatusCode.OK + }); + return [2 /*return*/, response]; + case 3: + err_1 = _a.sent(); + span.setStatus({ + code: coreTracing.SpanStatusCode.ERROR, + message: err_1.message + }); + span.setAttribute("http.status_code", err_1.statusCode); + throw err_1; + case 4: + span.end(); + return [7 /*endfinally*/]; + case 5: return [2 /*return*/]; + } + }); + }); + }; + return TracingPolicy; +}(BaseRequestPolicy)); -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. +// Copyright (c) Microsoft Corporation. +/** + * Returns a request policy factory that can be used to create an instance of + * {@link DisableResponseDecompressionPolicy}. */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isCompatible = exports._makeCompatibilityCheck = void 0; -var version_1 = __nccwpck_require__(4044); -var re = /^(\d+)\.(\d+)\.(\d+)(?:-(.*))?$/; +function disableResponseDecompressionPolicy() { + return { + create: function (nextPolicy, options) { + return new DisableResponseDecompressionPolicy(nextPolicy, options); + } + }; +} /** - * Create a function to test an API version to see if it is compatible with the provided ownVersion. - * - * The returned function has the following semantics: - * - Exact match is always compatible - * - Major versions must match exactly - * - 1.x package cannot use global 2.x package - * - 2.x package cannot use global 1.x package - * - The minor version of the API module requesting access to the global API must be less than or equal to the minor version of this API - * - 1.3 package may use 1.4 global because the later global contains all functions 1.3 expects - * - 1.4 package may NOT use 1.3 global because it may try to call functions which don't exist on 1.3 - * - If the major version is 0, the minor version is treated as the major and the patch is treated as the minor - * - Patch and build tag differences are not considered at this time - * - * @param ownVersion version which should be checked against + * A policy to disable response decompression according to Accept-Encoding header + * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Encoding */ -function _makeCompatibilityCheck(ownVersion) { - var acceptedVersions = new Set([ownVersion]); - var rejectedVersions = new Set(); - var myVersionMatch = ownVersion.match(re); - if (!myVersionMatch) { - // we cannot guarantee compatibility so we always return noop - return function () { return false; }; +var DisableResponseDecompressionPolicy = /** @class */ (function (_super) { + tslib.__extends(DisableResponseDecompressionPolicy, _super); + /** + * Creates an instance of DisableResponseDecompressionPolicy. + * + * @param nextPolicy - + * @param options - + */ + // The parent constructor is protected. + /* eslint-disable-next-line @typescript-eslint/no-useless-constructor */ + function DisableResponseDecompressionPolicy(nextPolicy, options) { + return _super.call(this, nextPolicy, options) || this; } - var ownVersionParsed = { - major: +myVersionMatch[1], - minor: +myVersionMatch[2], - patch: +myVersionMatch[3], + /** + * Sends out request. + * + * @param request - + * @returns + */ + DisableResponseDecompressionPolicy.prototype.sendRequest = function (request) { + return tslib.__awaiter(this, void 0, void 0, function () { + return tslib.__generator(this, function (_a) { + request.decompressResponse = false; + return [2 /*return*/, this._nextPolicy.sendRequest(request)]; + }); + }); }; - function _reject(v) { - rejectedVersions.add(v); - return false; - } - function _accept(v) { - acceptedVersions.add(v); - return true; - } - return function isCompatible(globalVersion) { - if (acceptedVersions.has(globalVersion)) { - return true; - } - if (rejectedVersions.has(globalVersion)) { - return false; - } - var globalVersionMatch = globalVersion.match(re); - if (!globalVersionMatch) { - // cannot parse other version - // we cannot guarantee compatibility so we always noop - return _reject(globalVersion); - } - var globalVersionParsed = { - major: +globalVersionMatch[1], - minor: +globalVersionMatch[2], - patch: +globalVersionMatch[3], - }; - // major versions must match - if (ownVersionParsed.major !== globalVersionParsed.major) { - return _reject(globalVersion); - } - if (ownVersionParsed.major === 0) { - if (ownVersionParsed.minor === globalVersionParsed.minor && - ownVersionParsed.patch <= globalVersionParsed.patch) { - return _accept(globalVersion); - } - return _reject(globalVersion); - } - if (ownVersionParsed.minor <= globalVersionParsed.minor) { - return _accept(globalVersion); + return DisableResponseDecompressionPolicy; +}(BaseRequestPolicy)); + +// Copyright (c) Microsoft Corporation. +function ndJsonPolicy() { + return { + create: function (nextPolicy, options) { + return new NdJsonPolicy(nextPolicy, options); } - return _reject(globalVersion); }; } -exports._makeCompatibilityCheck = _makeCompatibilityCheck; /** - * Test an API version to see if it is compatible with this API. - * - * - Exact match is always compatible - * - Major versions must match exactly - * - 1.x package cannot use global 2.x package - * - 2.x package cannot use global 1.x package - * - The minor version of the API module requesting access to the global API must be less than or equal to the minor version of this API - * - 1.3 package may use 1.4 global because the later global contains all functions 1.3 expects - * - 1.4 package may NOT use 1.3 global because it may try to call functions which don't exist on 1.3 - * - If the major version is 0, the minor version is treated as the major and the patch is treated as the minor - * - Patch and build tag differences are not considered at this time - * - * @param version version of the API requesting an instance of the global API - */ -exports.isCompatible = _makeCompatibilityCheck(version_1.VERSION); -//# sourceMappingURL=semver.js.map - -/***/ }), - -/***/ 4730: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__nccwpck_require__(6819), exports); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 9164: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports._globalThis = void 0; -/** only globals that common to node and browsers are allowed */ -// eslint-disable-next-line node/no-unsupported-features/es-builtins -exports._globalThis = typeof globalThis === 'object' ? globalThis : global; -//# sourceMappingURL=globalThis.js.map - -/***/ }), - -/***/ 6819: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * NdJsonPolicy that formats a JSON array as newline-delimited JSON */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__nccwpck_require__(9164), exports); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 3848: -/***/ ((__unused_webpack_module, exports) => { +var NdJsonPolicy = /** @class */ (function (_super) { + tslib.__extends(NdJsonPolicy, _super); + /** + * Creates an instance of KeepAlivePolicy. + */ + function NdJsonPolicy(nextPolicy, options) { + return _super.call(this, nextPolicy, options) || this; + } + /** + * Sends a request. + */ + NdJsonPolicy.prototype.sendRequest = function (request) { + return tslib.__awaiter(this, void 0, void 0, function () { + var body; + return tslib.__generator(this, function (_a) { + // There currently isn't a good way to bypass the serializer + if (typeof request.body === "string" && request.body.startsWith("[")) { + body = JSON.parse(request.body); + if (Array.isArray(body)) { + request.body = body.map(function (item) { return JSON.stringify(item) + "\n"; }).join(""); + } + } + return [2 /*return*/, this._nextPolicy.sendRequest(request)]; + }); + }); + }; + return NdJsonPolicy; +}(BaseRequestPolicy)); -"use strict"; +// Copyright (c) Microsoft Corporation. +var cachedHttpClient; +function getCachedDefaultHttpClient() { + if (!cachedHttpClient) { + cachedHttpClient = new NodeFetchHttpClient(); + } + return cachedHttpClient; +} -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NOOP_TEXT_MAP_PROPAGATOR = exports.NoopTextMapPropagator = void 0; +// Copyright (c) Microsoft Corporation. /** - * No-op implementations of {@link TextMapPropagator}. + * ServiceClient sends service requests and receives responses. */ -var NoopTextMapPropagator = /** @class */ (function () { - function NoopTextMapPropagator() { +var ServiceClient = /** @class */ (function () { + /** + * The ServiceClient constructor + * @param credentials - The credentials used for authentication with the service. + * @param options - The service client options that govern the behavior of the client. + */ + function ServiceClient(credentials, + /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */ + options) { + var _this = this; + if (!options) { + options = {}; + } + this._withCredentials = options.withCredentials || false; + this._httpClient = options.httpClient || getCachedDefaultHttpClient(); + this._requestPolicyOptions = new RequestPolicyOptions(options.httpPipelineLogger); + var requestPolicyFactories; + if (Array.isArray(options.requestPolicyFactories)) { + logger.info("ServiceClient: using custom request policies"); + requestPolicyFactories = options.requestPolicyFactories; + } + else { + var authPolicyFactory = undefined; + if (coreAuth.isTokenCredential(credentials)) { + logger.info("ServiceClient: creating bearer token authentication policy from provided credentials"); + // Create a wrapped RequestPolicyFactory here so that we can provide the + // correct scope to the BearerTokenAuthenticationPolicy at the first time + // one is requested. This is needed because generated ServiceClient + // implementations do not set baseUri until after ServiceClient's constructor + // is finished, leaving baseUri empty at the time when it is needed to + // build the correct scope name. + var wrappedPolicyFactory = function () { + var bearerTokenPolicyFactory = undefined; + // eslint-disable-next-line @typescript-eslint/no-this-alias + var serviceClient = _this; + var serviceClientOptions = options; + return { + create: function (nextPolicy, createOptions) { + var credentialScopes = getCredentialScopes(serviceClientOptions, serviceClient.baseUri); + if (!credentialScopes) { + throw new Error("When using credential, the ServiceClient must contain a baseUri or a credentialScopes in ServiceClientOptions. Unable to create a bearerTokenAuthenticationPolicy"); + } + if (bearerTokenPolicyFactory === undefined || bearerTokenPolicyFactory === null) { + bearerTokenPolicyFactory = bearerTokenAuthenticationPolicy(credentials, credentialScopes); + } + return bearerTokenPolicyFactory.create(nextPolicy, createOptions); + } + }; + }; + authPolicyFactory = wrappedPolicyFactory(); + } + else if (credentials && typeof credentials.signRequest === "function") { + logger.info("ServiceClient: creating signing policy from provided credentials"); + authPolicyFactory = signingPolicy(credentials); + } + else if (credentials !== undefined && credentials !== null) { + throw new Error("The credentials argument must implement the TokenCredential interface"); + } + logger.info("ServiceClient: using default request policies"); + requestPolicyFactories = createDefaultRequestPolicyFactories(authPolicyFactory, options); + if (options.requestPolicyFactories) { + // options.requestPolicyFactories can also be a function that manipulates + // the default requestPolicyFactories array + var newRequestPolicyFactories = options.requestPolicyFactories(requestPolicyFactories); + if (newRequestPolicyFactories) { + requestPolicyFactories = newRequestPolicyFactories; + } + } + } + this._requestPolicyFactories = requestPolicyFactories; } - /** Noop inject function does nothing */ - NoopTextMapPropagator.prototype.inject = function (_context, _carrier) { }; - /** Noop extract function does nothing and returns the input context */ - NoopTextMapPropagator.prototype.extract = function (context, _carrier) { - return context; + /** + * Send the provided httpRequest. + */ + ServiceClient.prototype.sendRequest = function (options) { + if (options === null || options === undefined || typeof options !== "object") { + throw new Error("options cannot be null or undefined and it must be of type object."); + } + var httpRequest; + try { + if (isWebResourceLike(options)) { + options.validateRequestProperties(); + httpRequest = options; + } + else { + httpRequest = new WebResource(); + httpRequest = httpRequest.prepare(options); + } + } + catch (error) { + return Promise.reject(error); + } + var httpPipeline = this._httpClient; + if (this._requestPolicyFactories && this._requestPolicyFactories.length > 0) { + for (var i = this._requestPolicyFactories.length - 1; i >= 0; --i) { + httpPipeline = this._requestPolicyFactories[i].create(httpPipeline, this._requestPolicyOptions); + } + } + return httpPipeline.sendRequest(httpRequest); }; - NoopTextMapPropagator.prototype.fields = function () { - return []; + /** + * Send an HTTP request that is populated using the provided OperationSpec. + * @param operationArguments - The arguments that the HTTP request's templated values will be populated from. + * @param operationSpec - The OperationSpec to use to populate the httpRequest. + * @param callback - The callback to call when the response is received. + */ + ServiceClient.prototype.sendOperationRequest = function (operationArguments, operationSpec, callback) { + var _a; + return tslib.__awaiter(this, void 0, void 0, function () { + var serializerOptions, httpRequest, result, baseUri, requestUrl, _i, _b, urlParameter, urlParameterValue, _c, _d, queryParameter, queryParameterValue, index, item, index, contentType, _e, _f, headerParameter, headerValue, headerCollectionPrefix, _g, _h, key, options, customHeaderName, rawResponse, sendRequestError, error_1, error_2, cb; + return tslib.__generator(this, function (_j) { + switch (_j.label) { + case 0: + if (typeof operationArguments.options === "function") { + callback = operationArguments.options; + operationArguments.options = undefined; + } + serializerOptions = (_a = operationArguments.options) === null || _a === void 0 ? void 0 : _a.serializerOptions; + httpRequest = new WebResource(); + _j.label = 1; + case 1: + _j.trys.push([1, 6, , 7]); + baseUri = operationSpec.baseUrl || this.baseUri; + if (!baseUri) { + throw new Error("If operationSpec.baseUrl is not specified, then the ServiceClient must have a baseUri string property that contains the base URL to use."); + } + httpRequest.method = operationSpec.httpMethod; + httpRequest.operationSpec = operationSpec; + requestUrl = URLBuilder.parse(baseUri); + if (operationSpec.path) { + requestUrl.appendPath(operationSpec.path); + } + if (operationSpec.urlParameters && operationSpec.urlParameters.length > 0) { + for (_i = 0, _b = operationSpec.urlParameters; _i < _b.length; _i++) { + urlParameter = _b[_i]; + urlParameterValue = getOperationArgumentValueFromParameter(this, operationArguments, urlParameter, operationSpec.serializer); + urlParameterValue = operationSpec.serializer.serialize(urlParameter.mapper, urlParameterValue, getPathStringFromParameter(urlParameter), serializerOptions); + if (!urlParameter.skipEncoding) { + urlParameterValue = encodeURIComponent(urlParameterValue); + } + requestUrl.replaceAll("{" + (urlParameter.mapper.serializedName || getPathStringFromParameter(urlParameter)) + "}", urlParameterValue); + } + } + if (operationSpec.queryParameters && operationSpec.queryParameters.length > 0) { + for (_c = 0, _d = operationSpec.queryParameters; _c < _d.length; _c++) { + queryParameter = _d[_c]; + queryParameterValue = getOperationArgumentValueFromParameter(this, operationArguments, queryParameter, operationSpec.serializer); + if (queryParameterValue !== undefined && queryParameterValue !== null) { + queryParameterValue = operationSpec.serializer.serialize(queryParameter.mapper, queryParameterValue, getPathStringFromParameter(queryParameter), serializerOptions); + if (queryParameter.collectionFormat !== undefined && + queryParameter.collectionFormat !== null) { + if (queryParameter.collectionFormat === exports.QueryCollectionFormat.Multi) { + if (queryParameterValue.length === 0) { + // The collection is empty, no need to try serializing the current queryParam + continue; + } + else { + for (index in queryParameterValue) { + item = queryParameterValue[index]; + queryParameterValue[index] = + item === undefined || item === null ? "" : item.toString(); + } + } + } + else if (queryParameter.collectionFormat === exports.QueryCollectionFormat.Ssv || + queryParameter.collectionFormat === exports.QueryCollectionFormat.Tsv) { + queryParameterValue = queryParameterValue.join(queryParameter.collectionFormat); + } + } + if (!queryParameter.skipEncoding) { + if (Array.isArray(queryParameterValue)) { + for (index in queryParameterValue) { + if (queryParameterValue[index] !== undefined && + queryParameterValue[index] !== null) { + queryParameterValue[index] = encodeURIComponent(queryParameterValue[index]); + } + } + } + else { + queryParameterValue = encodeURIComponent(queryParameterValue); + } + } + if (queryParameter.collectionFormat !== undefined && + queryParameter.collectionFormat !== null && + queryParameter.collectionFormat !== exports.QueryCollectionFormat.Multi && + queryParameter.collectionFormat !== exports.QueryCollectionFormat.Ssv && + queryParameter.collectionFormat !== exports.QueryCollectionFormat.Tsv) { + queryParameterValue = queryParameterValue.join(queryParameter.collectionFormat); + } + requestUrl.setQueryParameter(queryParameter.mapper.serializedName || getPathStringFromParameter(queryParameter), queryParameterValue); + } + } + } + httpRequest.url = requestUrl.toString(); + contentType = operationSpec.contentType || this.requestContentType; + if (contentType && operationSpec.requestBody) { + httpRequest.headers.set("Content-Type", contentType); + } + if (operationSpec.headerParameters) { + for (_e = 0, _f = operationSpec.headerParameters; _e < _f.length; _e++) { + headerParameter = _f[_e]; + headerValue = getOperationArgumentValueFromParameter(this, operationArguments, headerParameter, operationSpec.serializer); + if (headerValue !== undefined && headerValue !== null) { + headerValue = operationSpec.serializer.serialize(headerParameter.mapper, headerValue, getPathStringFromParameter(headerParameter), serializerOptions); + headerCollectionPrefix = headerParameter.mapper + .headerCollectionPrefix; + if (headerCollectionPrefix) { + for (_g = 0, _h = Object.keys(headerValue); _g < _h.length; _g++) { + key = _h[_g]; + httpRequest.headers.set(headerCollectionPrefix + key, headerValue[key]); + } + } + else { + httpRequest.headers.set(headerParameter.mapper.serializedName || + getPathStringFromParameter(headerParameter), headerValue); + } + } + } + } + options = operationArguments.options; + if (options) { + if (options.customHeaders) { + for (customHeaderName in options.customHeaders) { + httpRequest.headers.set(customHeaderName, options.customHeaders[customHeaderName]); + } + } + if (options.abortSignal) { + httpRequest.abortSignal = options.abortSignal; + } + if (options.timeout) { + httpRequest.timeout = options.timeout; + } + if (options.onUploadProgress) { + httpRequest.onUploadProgress = options.onUploadProgress; + } + if (options.onDownloadProgress) { + httpRequest.onDownloadProgress = options.onDownloadProgress; + } + if (options.spanOptions) { + httpRequest.spanOptions = options.spanOptions; + } + if (options.tracingContext) { + httpRequest.tracingContext = options.tracingContext; + } + if (options.shouldDeserialize !== undefined && options.shouldDeserialize !== null) { + httpRequest.shouldDeserialize = options.shouldDeserialize; + } + } + httpRequest.withCredentials = this._withCredentials; + serializeRequestBody(this, httpRequest, operationArguments, operationSpec); + if (httpRequest.streamResponseStatusCodes === undefined) { + httpRequest.streamResponseStatusCodes = getStreamResponseStatusCodes(operationSpec); + } + rawResponse = void 0; + sendRequestError = void 0; + _j.label = 2; + case 2: + _j.trys.push([2, 4, , 5]); + return [4 /*yield*/, this.sendRequest(httpRequest)]; + case 3: + rawResponse = _j.sent(); + return [3 /*break*/, 5]; + case 4: + error_1 = _j.sent(); + sendRequestError = error_1; + return [3 /*break*/, 5]; + case 5: + if (sendRequestError) { + if (sendRequestError.response) { + sendRequestError.details = flattenResponse(sendRequestError.response, operationSpec.responses[sendRequestError.statusCode] || + operationSpec.responses["default"]); + } + result = Promise.reject(sendRequestError); + } + else { + result = Promise.resolve(flattenResponse(rawResponse, operationSpec.responses[rawResponse.status])); + } + return [3 /*break*/, 7]; + case 6: + error_2 = _j.sent(); + result = Promise.reject(error_2); + return [3 /*break*/, 7]; + case 7: + cb = callback; + if (cb) { + result + .then(function (res) { return cb(null, res._response.parsedBody, res._response.request, res._response); }) + .catch(function (err) { return cb(err); }); + } + return [2 /*return*/, result]; + } + }); + }); }; - return NoopTextMapPropagator; + return ServiceClient; }()); -exports.NoopTextMapPropagator = NoopTextMapPropagator; -exports.NOOP_TEXT_MAP_PROPAGATOR = new NoopTextMapPropagator(); -//# sourceMappingURL=NoopTextMapPropagator.js.map - -/***/ }), - -/***/ 9017: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.defaultTextMapSetter = exports.defaultTextMapGetter = void 0; -exports.defaultTextMapGetter = { - get: function (carrier, key) { - if (carrier == null) { - return undefined; +function serializeRequestBody(serviceClient, httpRequest, operationArguments, operationSpec) { + var _a, _b, _c, _d, _e, _f; + var serializerOptions = (_b = (_a = operationArguments.options) === null || _a === void 0 ? void 0 : _a.serializerOptions) !== null && _b !== void 0 ? _b : {}; + var updatedOptions = { + rootName: (_c = serializerOptions.rootName) !== null && _c !== void 0 ? _c : "", + includeRoot: (_d = serializerOptions.includeRoot) !== null && _d !== void 0 ? _d : false, + xmlCharKey: (_e = serializerOptions.xmlCharKey) !== null && _e !== void 0 ? _e : XML_CHARKEY + }; + var xmlCharKey = serializerOptions.xmlCharKey; + if (operationSpec.requestBody && operationSpec.requestBody.mapper) { + httpRequest.body = getOperationArgumentValueFromParameter(serviceClient, operationArguments, operationSpec.requestBody, operationSpec.serializer); + var bodyMapper = operationSpec.requestBody.mapper; + var required = bodyMapper.required, xmlName = bodyMapper.xmlName, xmlElementName = bodyMapper.xmlElementName, serializedName = bodyMapper.serializedName, xmlNamespace = bodyMapper.xmlNamespace, xmlNamespacePrefix = bodyMapper.xmlNamespacePrefix; + var typeName = bodyMapper.type.name; + try { + if ((httpRequest.body !== undefined && httpRequest.body !== null) || required) { + var requestBodyParameterPathString = getPathStringFromParameter(operationSpec.requestBody); + httpRequest.body = operationSpec.serializer.serialize(bodyMapper, httpRequest.body, requestBodyParameterPathString, updatedOptions); + var isStream = typeName === MapperType.Stream; + if (operationSpec.isXML) { + var xmlnsKey = xmlNamespacePrefix ? "xmlns:" + xmlNamespacePrefix : "xmlns"; + var value = getXmlValueWithNamespace(xmlNamespace, xmlnsKey, typeName, httpRequest.body, updatedOptions); + if (typeName === MapperType.Sequence) { + httpRequest.body = stringifyXML(prepareXMLRootList(value, xmlElementName || xmlName || serializedName, xmlnsKey, xmlNamespace), { + rootName: xmlName || serializedName, + xmlCharKey: xmlCharKey + }); + } + else if (!isStream) { + httpRequest.body = stringifyXML(value, { + rootName: xmlName || serializedName, + xmlCharKey: xmlCharKey + }); + } + } + else if (typeName === MapperType.String && + (((_f = operationSpec.contentType) === null || _f === void 0 ? void 0 : _f.match("text/plain")) || operationSpec.mediaType === "text")) { + // the String serializer has validated that request body is a string + // so just send the string. + return; + } + else if (!isStream) { + httpRequest.body = JSON.stringify(httpRequest.body); + } + } } - return carrier[key]; - }, - keys: function (carrier) { - if (carrier == null) { - return []; + catch (error) { + throw new Error("Error \"" + error.message + "\" occurred in serializing the payload - " + JSON.stringify(serializedName, undefined, " ") + "."); } - return Object.keys(carrier); - }, -}; -exports.defaultTextMapSetter = { - set: function (carrier, key, value) { - if (carrier == null) { - return; + } + else if (operationSpec.formDataParameters && operationSpec.formDataParameters.length > 0) { + httpRequest.formData = {}; + for (var _i = 0, _g = operationSpec.formDataParameters; _i < _g.length; _i++) { + var formDataParameter = _g[_i]; + var formDataParameterValue = getOperationArgumentValueFromParameter(serviceClient, operationArguments, formDataParameter, operationSpec.serializer); + if (formDataParameterValue !== undefined && formDataParameterValue !== null) { + var formDataParameterPropertyName = formDataParameter.mapper.serializedName || getPathStringFromParameter(formDataParameter); + httpRequest.formData[formDataParameterPropertyName] = operationSpec.serializer.serialize(formDataParameter.mapper, formDataParameterValue, getPathStringFromParameter(formDataParameter), updatedOptions); + } } - carrier[key] = value; - }, -}; -//# sourceMappingURL=TextMapPropagator.js.map - -/***/ }), - -/***/ 9217: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=Event.js.map - -/***/ }), - -/***/ 3116: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NoopSpan = void 0; -var spancontext_utils_1 = __nccwpck_require__(541); + } +} /** - * The NoopSpan is the default {@link Span} that is used when no Span - * implementation is available. All operations are no-op including context - * propagation. + * Adds an xml namespace to the xml serialized object if needed, otherwise it just returns the value itself */ -var NoopSpan = /** @class */ (function () { - function NoopSpan(_spanContext) { - if (_spanContext === void 0) { _spanContext = spancontext_utils_1.INVALID_SPAN_CONTEXT; } - this._spanContext = _spanContext; +function getXmlValueWithNamespace(xmlNamespace, xmlnsKey, typeName, serializedValue, options) { + var _a; + // Composite and Sequence schemas already got their root namespace set during serialization + // We just need to add xmlns to the other schema types + if (xmlNamespace && !["Composite", "Sequence", "Dictionary"].includes(typeName)) { + var result = {}; + result[options.xmlCharKey] = serializedValue; + result[XML_ATTRKEY] = (_a = {}, _a[xmlnsKey] = xmlNamespace, _a); + return result; } - // Returns a SpanContext. - NoopSpan.prototype.context = function () { - return this._spanContext; - }; - // By default does nothing - NoopSpan.prototype.setAttribute = function (_key, _value) { - return this; - }; - // By default does nothing - NoopSpan.prototype.setAttributes = function (_attributes) { - return this; - }; - // By default does nothing - NoopSpan.prototype.addEvent = function (_name, _attributes) { - return this; - }; - // By default does nothing - NoopSpan.prototype.setStatus = function (_status) { - return this; - }; - // By default does nothing - NoopSpan.prototype.updateName = function (_name) { - return this; - }; - // By default does nothing - NoopSpan.prototype.end = function (_endTime) { }; - // isRecording always returns false for noopSpan. - NoopSpan.prototype.isRecording = function () { - return false; + return serializedValue; +} +function getValueOrFunctionResult(value, defaultValueCreator) { + var result; + if (typeof value === "string") { + result = value; + } + else { + result = defaultValueCreator(); + if (typeof value === "function") { + result = value(result); + } + } + return result; +} +function createDefaultRequestPolicyFactories(authPolicyFactory, options) { + var factories = []; + if (options.generateClientRequestIdHeader) { + factories.push(generateClientRequestIdPolicy(options.clientRequestIdHeaderName)); + } + if (authPolicyFactory) { + factories.push(authPolicyFactory); + } + var userAgentHeaderName = getValueOrFunctionResult(options.userAgentHeaderName, getDefaultUserAgentHeaderName); + var userAgentHeaderValue = getValueOrFunctionResult(options.userAgent, getDefaultUserAgentValue); + if (userAgentHeaderName && userAgentHeaderValue) { + factories.push(userAgentPolicy({ key: userAgentHeaderName, value: userAgentHeaderValue })); + } + factories.push(redirectPolicy()); + factories.push(rpRegistrationPolicy(options.rpRegistrationRetryTimeout)); + if (!options.noRetryPolicy) { + factories.push(exponentialRetryPolicy()); + factories.push(systemErrorRetryPolicy()); + factories.push(throttlingRetryPolicy()); + } + factories.push(deserializationPolicy(options.deserializationContentTypes)); + { + factories.push(proxyPolicy(options.proxySettings)); + } + factories.push(logPolicy({ logger: logger.info })); + return factories; +} +function createPipelineFromOptions(pipelineOptions, authPolicyFactory) { + var requestPolicyFactories = []; + if (pipelineOptions.sendStreamingJson) { + requestPolicyFactories.push(ndJsonPolicy()); + } + var userAgentValue = undefined; + if (pipelineOptions.userAgentOptions && pipelineOptions.userAgentOptions.userAgentPrefix) { + var userAgentInfo = []; + userAgentInfo.push(pipelineOptions.userAgentOptions.userAgentPrefix); + // Add the default user agent value if it isn't already specified + // by the userAgentPrefix option. + var defaultUserAgentInfo = getDefaultUserAgentValue(); + if (userAgentInfo.indexOf(defaultUserAgentInfo) === -1) { + userAgentInfo.push(defaultUserAgentInfo); + } + userAgentValue = userAgentInfo.join(" "); + } + var keepAliveOptions = tslib.__assign(tslib.__assign({}, DefaultKeepAliveOptions), pipelineOptions.keepAliveOptions); + var retryOptions = tslib.__assign(tslib.__assign({}, DefaultRetryOptions), pipelineOptions.retryOptions); + var redirectOptions = tslib.__assign(tslib.__assign({}, DefaultRedirectOptions), pipelineOptions.redirectOptions); + { + requestPolicyFactories.push(proxyPolicy(pipelineOptions.proxyOptions)); + } + var deserializationOptions = tslib.__assign(tslib.__assign({}, DefaultDeserializationOptions), pipelineOptions.deserializationOptions); + var loggingOptions = tslib.__assign({}, pipelineOptions.loggingOptions); + requestPolicyFactories.push(tracingPolicy({ userAgent: userAgentValue }), keepAlivePolicy(keepAliveOptions), userAgentPolicy({ value: userAgentValue }), generateClientRequestIdPolicy(), deserializationPolicy(deserializationOptions.expectedContentTypes), throttlingRetryPolicy(), systemErrorRetryPolicy(), exponentialRetryPolicy(retryOptions.maxRetries, retryOptions.retryDelayInMs, retryOptions.maxRetryDelayInMs)); + if (redirectOptions.handleRedirects) { + requestPolicyFactories.push(redirectPolicy(redirectOptions.maxRetries)); + } + if (authPolicyFactory) { + requestPolicyFactories.push(authPolicyFactory); + } + requestPolicyFactories.push(logPolicy(loggingOptions)); + if (isNode && pipelineOptions.decompressResponse === false) { + requestPolicyFactories.push(disableResponseDecompressionPolicy()); + } + return { + httpClient: pipelineOptions.httpClient, + requestPolicyFactories: requestPolicyFactories }; - // By default does nothing - NoopSpan.prototype.recordException = function (_exception, _time) { }; - return NoopSpan; -}()); -exports.NoopSpan = NoopSpan; -//# sourceMappingURL=NoopSpan.js.map - -/***/ }), - -/***/ 913: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NOOP_TRACER = exports.NoopTracer = void 0; -var context_1 = __nccwpck_require__(7135); -var NoopSpan_1 = __nccwpck_require__(3116); -var spancontext_utils_1 = __nccwpck_require__(541); -/** - * No-op implementations of {@link Tracer}. - */ -var NoopTracer = /** @class */ (function () { - function NoopTracer() { +} +function getOperationArgumentValueFromParameter(serviceClient, operationArguments, parameter, serializer) { + return getOperationArgumentValueFromParameterPath(serviceClient, operationArguments, parameter.parameterPath, parameter.mapper, serializer); +} +function getOperationArgumentValueFromParameterPath(serviceClient, operationArguments, parameterPath, parameterMapper, serializer) { + var _a; + var value; + if (typeof parameterPath === "string") { + parameterPath = [parameterPath]; } - // startSpan starts a noop span. - NoopTracer.prototype.startSpan = function (name, options, context) { - var root = Boolean(options === null || options === void 0 ? void 0 : options.root); - if (root) { - return new NoopSpan_1.NoopSpan(); + var serializerOptions = (_a = operationArguments.options) === null || _a === void 0 ? void 0 : _a.serializerOptions; + if (Array.isArray(parameterPath)) { + if (parameterPath.length > 0) { + if (parameterMapper.isConstant) { + value = parameterMapper.defaultValue; + } + else { + var propertySearchResult = getPropertyFromParameterPath(operationArguments, parameterPath); + if (!propertySearchResult.propertyFound) { + propertySearchResult = getPropertyFromParameterPath(serviceClient, parameterPath); + } + var useDefaultValue = false; + if (!propertySearchResult.propertyFound) { + useDefaultValue = + parameterMapper.required || + (parameterPath[0] === "options" && parameterPath.length === 2); + } + value = useDefaultValue ? parameterMapper.defaultValue : propertySearchResult.propertyValue; + } + // Serialize just for validation purposes. + var parameterPathString = getPathStringFromParameterPath(parameterPath, parameterMapper); + serializer.serialize(parameterMapper, value, parameterPathString, serializerOptions); } - var parentFromContext = context && context_1.getSpanContext(context); - if (isSpanContext(parentFromContext) && - spancontext_utils_1.isSpanContextValid(parentFromContext)) { - return new NoopSpan_1.NoopSpan(parentFromContext); + } + else { + if (parameterMapper.required) { + value = {}; + } + for (var propertyName in parameterPath) { + var propertyMapper = parameterMapper.type.modelProperties[propertyName]; + var propertyPath = parameterPath[propertyName]; + var propertyValue = getOperationArgumentValueFromParameterPath(serviceClient, operationArguments, propertyPath, propertyMapper, serializer); + // Serialize just for validation purposes. + var propertyPathString = getPathStringFromParameterPath(propertyPath, propertyMapper); + serializer.serialize(propertyMapper, propertyValue, propertyPathString, serializerOptions); + if (propertyValue !== undefined && propertyValue !== null) { + if (!value) { + value = {}; + } + value[propertyName] = propertyValue; + } + } + } + return value; +} +function getPropertyFromParameterPath(parent, parameterPath) { + var result = { propertyFound: false }; + var i = 0; + for (; i < parameterPath.length; ++i) { + var parameterPathPart = parameterPath[i]; + // Make sure to check inherited properties too, so don't use hasOwnProperty(). + if (parent !== undefined && parent !== null && parameterPathPart in parent) { + parent = parent[parameterPathPart]; } else { - return new NoopSpan_1.NoopSpan(); + break; } + } + if (i === parameterPath.length) { + result.propertyValue = parent; + result.propertyFound = true; + } + return result; +} +function flattenResponse(_response, responseSpec) { + var parsedHeaders = _response.parsedHeaders; + var bodyMapper = responseSpec && responseSpec.bodyMapper; + var addOperationResponse = function (obj) { + return Object.defineProperty(obj, "_response", { + value: _response + }); }; - return NoopTracer; -}()); -exports.NoopTracer = NoopTracer; -function isSpanContext(spanContext) { - return (typeof spanContext === 'object' && - typeof spanContext['spanId'] === 'string' && - typeof spanContext['traceId'] === 'string' && - typeof spanContext['traceFlags'] === 'number'); + if (bodyMapper) { + var typeName = bodyMapper.type.name; + if (typeName === "Stream") { + return addOperationResponse(tslib.__assign(tslib.__assign({}, parsedHeaders), { blobBody: _response.blobBody, readableStreamBody: _response.readableStreamBody })); + } + var modelProperties_1 = (typeName === "Composite" && bodyMapper.type.modelProperties) || {}; + var isPageableResponse = Object.keys(modelProperties_1).some(function (k) { return modelProperties_1[k].serializedName === ""; }); + if (typeName === "Sequence" || isPageableResponse) { + var arrayResponse = tslib.__spreadArray([], (_response.parsedBody || [])); + for (var _i = 0, _a = Object.keys(modelProperties_1); _i < _a.length; _i++) { + var key = _a[_i]; + if (modelProperties_1[key].serializedName) { + arrayResponse[key] = _response.parsedBody[key]; + } + } + if (parsedHeaders) { + for (var _b = 0, _c = Object.keys(parsedHeaders); _b < _c.length; _b++) { + var key = _c[_b]; + arrayResponse[key] = parsedHeaders[key]; + } + } + addOperationResponse(arrayResponse); + return arrayResponse; + } + if (typeName === "Composite" || typeName === "Dictionary") { + return addOperationResponse(tslib.__assign(tslib.__assign({}, parsedHeaders), _response.parsedBody)); + } + } + if (bodyMapper || + _response.request.method === "HEAD" || + isPrimitiveType(_response.parsedBody)) { + // primitive body types and HEAD booleans + return addOperationResponse(tslib.__assign(tslib.__assign({}, parsedHeaders), { body: _response.parsedBody })); + } + return addOperationResponse(tslib.__assign(tslib.__assign({}, parsedHeaders), _response.parsedBody)); +} +function getCredentialScopes(options, baseUri) { + if (options === null || options === void 0 ? void 0 : options.credentialScopes) { + var scopes = options.credentialScopes; + return Array.isArray(scopes) + ? scopes.map(function (scope) { return new url.URL(scope).toString(); }) + : new url.URL(scopes).toString(); + } + if (baseUri) { + return baseUri + "/.default"; + } + return undefined; } -exports.NOOP_TRACER = new NoopTracer(); -//# sourceMappingURL=NoopTracer.js.map - -/***/ }), - -/***/ 2793: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NOOP_TRACER_PROVIDER = exports.NoopTracerProvider = void 0; -var NoopTracer_1 = __nccwpck_require__(913); +// Copyright (c) Microsoft Corporation. /** - * An implementation of the {@link TracerProvider} which returns an impotent - * Tracer for all calls to `getTracer`. + * This function is only here for compatibility. Use createSpanFunction in core-tracing. * - * All operations are no-op. - */ -var NoopTracerProvider = /** @class */ (function () { - function NoopTracerProvider() { - } - NoopTracerProvider.prototype.getTracer = function (_name, _version) { - return NoopTracer_1.NOOP_TRACER; - }; - return NoopTracerProvider; -}()); -exports.NoopTracerProvider = NoopTracerProvider; -exports.NOOP_TRACER_PROVIDER = new NoopTracerProvider(); -//# sourceMappingURL=NoopTracerProvider.js.map - -/***/ }), - -/***/ 5159: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + * @deprecated This function is only here for compatibility. Use createSpanFunction in core-tracing. + * @hidden -"use strict"; + * @param spanConfig - The name of the operation being performed. + * @param tracingOptions - The options for the underlying http request. + */ +function createSpanFunction(args) { + return coreTracing.createSpanFunction(args); +} -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +/** + * Defines the default token refresh buffer duration. */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ProxyTracer = void 0; -var NoopTracer_1 = __nccwpck_require__(913); +var TokenRefreshBufferMs = 2 * 60 * 1000; // 2 Minutes /** - * Proxy tracer provided by the proxy tracer provider + * Provides an {@link AccessTokenCache} implementation which clears + * the cached {@link AccessToken}'s after the expiresOnTimestamp has + * passed. + * + * @deprecated No longer used in the bearer authorization policy. */ -var ProxyTracer = /** @class */ (function () { - function ProxyTracer(_provider, name, version) { - this._provider = _provider; - this.name = name; - this.version = version; - } - ProxyTracer.prototype.startSpan = function (name, options, context) { - return this._getTracer().startSpan(name, options, context); - }; +var ExpiringAccessTokenCache = /** @class */ (function () { /** - * Try to get a tracer from the proxy tracer provider. - * If the proxy tracer provider has no delegate, return a noop tracer. + * Constructs an instance of {@link ExpiringAccessTokenCache} with + * an optional expiration buffer time. */ - ProxyTracer.prototype._getTracer = function () { - if (this._delegate) { - return this._delegate; - } - var tracer = this._provider.getDelegateTracer(this.name, this.version); - if (!tracer) { - return NoopTracer_1.NOOP_TRACER; + function ExpiringAccessTokenCache(tokenRefreshBufferMs) { + if (tokenRefreshBufferMs === void 0) { tokenRefreshBufferMs = TokenRefreshBufferMs; } + this.cachedToken = undefined; + this.tokenRefreshBufferMs = tokenRefreshBufferMs; + } + ExpiringAccessTokenCache.prototype.setCachedToken = function (accessToken) { + this.cachedToken = accessToken; + }; + ExpiringAccessTokenCache.prototype.getCachedToken = function () { + if (this.cachedToken && + Date.now() + this.tokenRefreshBufferMs >= this.cachedToken.expiresOnTimestamp) { + this.cachedToken = undefined; } - this._delegate = tracer; - return this._delegate; + return this.cachedToken; }; - return ProxyTracer; + return ExpiringAccessTokenCache; }()); -exports.ProxyTracer = ProxyTracer; -//# sourceMappingURL=ProxyTracer.js.map -/***/ }), - -/***/ 9483: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ProxyTracerProvider = void 0; -var ProxyTracer_1 = __nccwpck_require__(5159); -var NoopTracerProvider_1 = __nccwpck_require__(2793); +// Copyright (c) Microsoft Corporation. /** - * Tracer provider which provides {@link ProxyTracer}s. + * Helps the core-http token authentication policies with requesting a new token if we're not currently waiting for a new token. * - * Before a delegate is set, tracers provided are NoOp. - * When a delegate is set, traces are provided from the delegate. - * When a delegate is set after tracers have already been provided, - * all tracers already provided will use the provided delegate implementation. + * @deprecated No longer used in the bearer authorization policy. */ -var ProxyTracerProvider = /** @class */ (function () { - function ProxyTracerProvider() { +var AccessTokenRefresher = /** @class */ (function () { + function AccessTokenRefresher(credential, scopes, requiredMillisecondsBeforeNewRefresh) { + if (requiredMillisecondsBeforeNewRefresh === void 0) { requiredMillisecondsBeforeNewRefresh = 30000; } + this.credential = credential; + this.scopes = scopes; + this.requiredMillisecondsBeforeNewRefresh = requiredMillisecondsBeforeNewRefresh; + this.lastCalled = 0; } /** - * Get a {@link ProxyTracer} + * Returns true if the required milliseconds(defaulted to 30000) have been passed signifying + * that we are ready for a new refresh. */ - ProxyTracerProvider.prototype.getTracer = function (name, version) { - var _a; - return ((_a = this.getDelegateTracer(name, version)) !== null && _a !== void 0 ? _a : new ProxyTracer_1.ProxyTracer(this, name, version)); - }; - ProxyTracerProvider.prototype.getDelegate = function () { - var _a; - return (_a = this._delegate) !== null && _a !== void 0 ? _a : NoopTracerProvider_1.NOOP_TRACER_PROVIDER; + AccessTokenRefresher.prototype.isReady = function () { + // We're only ready for a new refresh if the required milliseconds have passed. + return (!this.lastCalled || Date.now() - this.lastCalled > this.requiredMillisecondsBeforeNewRefresh); }; /** - * Set the delegate tracer provider + * Stores the time in which it is called, + * then requests a new token, + * then sets this.promise to undefined, + * then returns the token. */ - ProxyTracerProvider.prototype.setDelegate = function (delegate) { - this._delegate = delegate; - }; - ProxyTracerProvider.prototype.getDelegateTracer = function (name, version) { - var _a; - return (_a = this._delegate) === null || _a === void 0 ? void 0 : _a.getTracer(name, version); + AccessTokenRefresher.prototype.getToken = function (options) { + return tslib.__awaiter(this, void 0, void 0, function () { + var token; + return tslib.__generator(this, function (_a) { + switch (_a.label) { + case 0: + this.lastCalled = Date.now(); + return [4 /*yield*/, this.credential.getToken(this.scopes, options)]; + case 1: + token = _a.sent(); + this.promise = undefined; + return [2 /*return*/, token || undefined]; + } + }); + }); }; - return ProxyTracerProvider; -}()); -exports.ProxyTracerProvider = ProxyTracerProvider; -//# sourceMappingURL=ProxyTracerProvider.js.map - -/***/ }), - -/***/ 1569: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=Sampler.js.map - -/***/ }), - -/***/ 7502: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SamplingDecision = void 0; -/** - * A sampling decision that determines how a {@link Span} will be recorded - * and collected. - */ -var SamplingDecision; -(function (SamplingDecision) { - /** - * `Span.isRecording() === false`, span will not be recorded and all events - * and attributes will be dropped. - */ - SamplingDecision[SamplingDecision["NOT_RECORD"] = 0] = "NOT_RECORD"; - /** - * `Span.isRecording() === true`, but `Sampled` flag in {@link TraceFlags} - * MUST NOT be set. - */ - SamplingDecision[SamplingDecision["RECORD"] = 1] = "RECORD"; /** - * `Span.isRecording() === true` AND `Sampled` flag in {@link TraceFlags} - * MUST be set. + * Requests a new token if we're not currently waiting for a new token. + * Returns null if the required time between each call hasn't been reached. */ - SamplingDecision[SamplingDecision["RECORD_AND_SAMPLED"] = 2] = "RECORD_AND_SAMPLED"; -})(SamplingDecision = exports.SamplingDecision || (exports.SamplingDecision = {})); -//# sourceMappingURL=SamplingResult.js.map - -/***/ }), - -/***/ 9618: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=SpanOptions.js.map - -/***/ }), - -/***/ 886: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=TimedEvent.js.map - -/***/ }), - -/***/ 761: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=attributes.js.map - -/***/ }), - -/***/ 9067: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=link.js.map - -/***/ }), - -/***/ 8984: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=link_context.js.map - -/***/ }), - -/***/ 8052: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=span.js.map - -/***/ }), - -/***/ 9955: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=span_context.js.map - -/***/ }), - -/***/ 3107: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; + AccessTokenRefresher.prototype.refresh = function (options) { + if (!this.promise) { + this.promise = this.getToken(options); + } + return this.promise; + }; + return AccessTokenRefresher; +}()); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SpanKind = void 0; -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var SpanKind; -(function (SpanKind) { - /** Default value. Indicates that the span is used internally. */ - SpanKind[SpanKind["INTERNAL"] = 0] = "INTERNAL"; - /** - * Indicates that the span covers server-side handling of an RPC or other - * remote request. - */ - SpanKind[SpanKind["SERVER"] = 1] = "SERVER"; - /** - * Indicates that the span covers the client-side wrapper around an RPC or - * other remote request. - */ - SpanKind[SpanKind["CLIENT"] = 2] = "CLIENT"; +// Copyright (c) Microsoft Corporation. +var HeaderConstants = Constants.HeaderConstants; +var DEFAULT_AUTHORIZATION_SCHEME = "Basic"; +var BasicAuthenticationCredentials = /** @class */ (function () { /** - * Indicates that the span describes producer sending a message to a - * broker. Unlike client and server, there is no direct critical path latency - * relationship between producer and consumer spans. + * Creates a new BasicAuthenticationCredentials object. + * + * @param userName - User name. + * @param password - Password. + * @param authorizationScheme - The authorization scheme. */ - SpanKind[SpanKind["PRODUCER"] = 3] = "PRODUCER"; + function BasicAuthenticationCredentials(userName, password, authorizationScheme) { + if (authorizationScheme === void 0) { authorizationScheme = DEFAULT_AUTHORIZATION_SCHEME; } + this.authorizationScheme = DEFAULT_AUTHORIZATION_SCHEME; + if (userName === null || userName === undefined || typeof userName.valueOf() !== "string") { + throw new Error("userName cannot be null or undefined and must be of type string."); + } + if (password === null || password === undefined || typeof password.valueOf() !== "string") { + throw new Error("password cannot be null or undefined and must be of type string."); + } + this.userName = userName; + this.password = password; + this.authorizationScheme = authorizationScheme; + } /** - * Indicates that the span describes consumer receiving a message from a - * broker. Unlike client and server, there is no direct critical path latency - * relationship between producer and consumer spans. + * Signs a request with the Authentication header. + * + * @param webResource - The WebResourceLike to be signed. + * @returns The signed request object. */ - SpanKind[SpanKind["CONSUMER"] = 4] = "CONSUMER"; -})(SpanKind = exports.SpanKind || (exports.SpanKind = {})); -//# sourceMappingURL=span_kind.js.map - -/***/ }), - -/***/ 541: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isSpanContextValid = exports.isValidSpanId = exports.isValidTraceId = exports.INVALID_SPAN_CONTEXT = exports.INVALID_TRACEID = exports.INVALID_SPANID = void 0; -var trace_flags_1 = __nccwpck_require__(8434); -var VALID_TRACEID_REGEX = /^([0-9a-f]{32})$/i; -var VALID_SPANID_REGEX = /^[0-9a-f]{16}$/i; -exports.INVALID_SPANID = '0000000000000000'; -exports.INVALID_TRACEID = '00000000000000000000000000000000'; -exports.INVALID_SPAN_CONTEXT = { - traceId: exports.INVALID_TRACEID, - spanId: exports.INVALID_SPANID, - traceFlags: trace_flags_1.TraceFlags.NONE, -}; -function isValidTraceId(traceId) { - return VALID_TRACEID_REGEX.test(traceId) && traceId !== exports.INVALID_TRACEID; -} -exports.isValidTraceId = isValidTraceId; -function isValidSpanId(spanId) { - return VALID_SPANID_REGEX.test(spanId) && spanId !== exports.INVALID_SPANID; -} -exports.isValidSpanId = isValidSpanId; -/** - * Returns true if this {@link SpanContext} is valid. - * @return true if this {@link SpanContext} is valid. - */ -function isSpanContextValid(spanContext) { - return (isValidTraceId(spanContext.traceId) && isValidSpanId(spanContext.spanId)); -} -exports.isSpanContextValid = isSpanContextValid; -//# sourceMappingURL=spancontext-utils.js.map - -/***/ }), - -/***/ 1997: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; + BasicAuthenticationCredentials.prototype.signRequest = function (webResource) { + var credentials = this.userName + ":" + this.password; + var encodedCredentials = this.authorizationScheme + " " + encodeString(credentials); + if (!webResource.headers) + webResource.headers = new HttpHeaders(); + webResource.headers.set(HeaderConstants.AUTHORIZATION, encodedCredentials); + return Promise.resolve(webResource); + }; + return BasicAuthenticationCredentials; +}()); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SpanStatusCode = void 0; +// Copyright (c) Microsoft Corporation. /** - * An enumeration of status codes. + * Authenticates to a service using an API key. */ -var SpanStatusCode; -(function (SpanStatusCode) { +var ApiKeyCredentials = /** @class */ (function () { /** - * The default status. + * @param options - Specifies the options to be provided for auth. Either header or query needs to be provided. */ - SpanStatusCode[SpanStatusCode["UNSET"] = 0] = "UNSET"; + function ApiKeyCredentials(options) { + if (!options || (options && !options.inHeader && !options.inQuery)) { + throw new Error("options cannot be null or undefined. Either \"inHeader\" or \"inQuery\" property of the options object needs to be provided."); + } + this.inHeader = options.inHeader; + this.inQuery = options.inQuery; + } /** - * The operation has been validated by an Application developer or - * Operator to have completed successfully. + * Signs a request with the values provided in the inHeader and inQuery parameter. + * + * @param webResource - The WebResourceLike to be signed. + * @returns The signed request object. */ - SpanStatusCode[SpanStatusCode["OK"] = 1] = "OK"; + ApiKeyCredentials.prototype.signRequest = function (webResource) { + if (!webResource) { + return Promise.reject(new Error("webResource cannot be null or undefined and must be of type \"object\".")); + } + if (this.inHeader) { + if (!webResource.headers) { + webResource.headers = new HttpHeaders(); + } + for (var headerName in this.inHeader) { + webResource.headers.set(headerName, this.inHeader[headerName]); + } + } + if (this.inQuery) { + if (!webResource.url) { + return Promise.reject(new Error("url cannot be null in the request object.")); + } + if (webResource.url.indexOf("?") < 0) { + webResource.url += "?"; + } + for (var key in this.inQuery) { + if (!webResource.url.endsWith("?")) { + webResource.url += "&"; + } + webResource.url += key + "=" + this.inQuery[key]; + } + } + return Promise.resolve(webResource); + }; + return ApiKeyCredentials; +}()); + +// Copyright (c) Microsoft Corporation. +var TopicCredentials = /** @class */ (function (_super) { + tslib.__extends(TopicCredentials, _super); /** - * The operation contains an error. + * Creates a new EventGrid TopicCredentials object. + * + * @param topicKey - The EventGrid topic key */ - SpanStatusCode[SpanStatusCode["ERROR"] = 2] = "ERROR"; -})(SpanStatusCode = exports.SpanStatusCode || (exports.SpanStatusCode = {})); -//# sourceMappingURL=status.js.map - -/***/ }), - -/***/ 8434: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TraceFlags = void 0; -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var TraceFlags; -(function (TraceFlags) { - /** Represents no flag set. */ - TraceFlags[TraceFlags["NONE"] = 0] = "NONE"; - /** Bit to represent whether trace is sampled in trace flags. */ - TraceFlags[TraceFlags["SAMPLED"] = 1] = "SAMPLED"; -})(TraceFlags = exports.TraceFlags || (exports.TraceFlags = {})); -//# sourceMappingURL=trace_flags.js.map - -/***/ }), - -/***/ 2749: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=trace_state.js.map - -/***/ }), - -/***/ 3833: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=tracer.js.map - -/***/ }), - -/***/ 9824: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=tracer_provider.js.map - -/***/ }), - -/***/ 4044: -/***/ ((__unused_webpack_module, exports) => { + function TopicCredentials(topicKey) { + var _this = this; + if (!topicKey || (topicKey && typeof topicKey !== "string")) { + throw new Error("topicKey cannot be null or undefined and must be of type string."); + } + var options = { + inHeader: { + "aeg-sas-key": topicKey + } + }; + _this = _super.call(this, options) || this; + return _this; + } + return TopicCredentials; +}(ApiKeyCredentials)); -"use strict"; +Object.defineProperty(exports, "isTokenCredential", ({ + enumerable: true, + get: function () { + return coreAuth.isTokenCredential; + } +})); +exports.AccessTokenRefresher = AccessTokenRefresher; +exports.ApiKeyCredentials = ApiKeyCredentials; +exports.BaseRequestPolicy = BaseRequestPolicy; +exports.BasicAuthenticationCredentials = BasicAuthenticationCredentials; +exports.Constants = Constants; +exports.DefaultHttpClient = NodeFetchHttpClient; +exports.ExpiringAccessTokenCache = ExpiringAccessTokenCache; +exports.HttpHeaders = HttpHeaders; +exports.MapperType = MapperType; +exports.RequestPolicyOptions = RequestPolicyOptions; +exports.RestError = RestError; +exports.Serializer = Serializer; +exports.ServiceClient = ServiceClient; +exports.TopicCredentials = TopicCredentials; +exports.URLBuilder = URLBuilder; +exports.URLQuery = URLQuery; +exports.WebResource = WebResource; +exports.XML_ATTRKEY = XML_ATTRKEY; +exports.XML_CHARKEY = XML_CHARKEY; +exports.applyMixins = applyMixins; +exports.bearerTokenAuthenticationPolicy = bearerTokenAuthenticationPolicy; +exports.createPipelineFromOptions = createPipelineFromOptions; +exports.createSpanFunction = createSpanFunction; +exports.delay = delay; +exports.deserializationPolicy = deserializationPolicy; +exports.deserializeResponseBody = deserializeResponseBody; +exports.disableResponseDecompressionPolicy = disableResponseDecompressionPolicy; +exports.encodeUri = encodeUri; +exports.executePromisesSequentially = executePromisesSequentially; +exports.exponentialRetryPolicy = exponentialRetryPolicy; +exports.flattenResponse = flattenResponse; +exports.generateClientRequestIdPolicy = generateClientRequestIdPolicy; +exports.generateUuid = generateUuid; +exports.getDefaultProxySettings = getDefaultProxySettings; +exports.getDefaultUserAgentValue = getDefaultUserAgentValue; +exports.isDuration = isDuration; +exports.isNode = isNode; +exports.isValidUuid = isValidUuid; +exports.keepAlivePolicy = keepAlivePolicy; +exports.logPolicy = logPolicy; +exports.operationOptionsToRequestOptionsBase = operationOptionsToRequestOptionsBase; +exports.parseXML = parseXML; +exports.promiseToCallback = promiseToCallback; +exports.promiseToServiceCallback = promiseToServiceCallback; +exports.proxyPolicy = proxyPolicy; +exports.redirectPolicy = redirectPolicy; +exports.serializeObject = serializeObject; +exports.signingPolicy = signingPolicy; +exports.stringifyXML = stringifyXML; +exports.stripRequest = stripRequest; +exports.stripResponse = stripResponse; +exports.systemErrorRetryPolicy = systemErrorRetryPolicy; +exports.throttlingRetryPolicy = throttlingRetryPolicy; +exports.tracingPolicy = tracingPolicy; +exports.userAgentPolicy = userAgentPolicy; +//# sourceMappingURL=index.js.map -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.VERSION = void 0; -// this is autogenerated file, see scripts/version-update.js -exports.VERSION = '1.0.0-rc.0'; -//# sourceMappingURL=version.js.map /***/ }), @@ -16905,10 +15066,14 @@ var __createBinding; return r; }; - __spreadArray = function (to, from) { - for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) - to[j] = from[i]; - return to; + __spreadArray = function (to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || from); }; __await = function (v) { @@ -18335,10 +16500,14 @@ var __createBinding; return r; }; - __spreadArray = function (to, from) { - for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) - to[j] = from[i]; - return to; + __spreadArray = function (to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || from); }; __await = function (v) { @@ -18461,6 +16630,7 @@ var api = __nccwpck_require__(5163); var tslib = __nccwpck_require__(1027); // Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. /** * A no-op implementation of Span that can safely be used without side-effects. */ @@ -18474,7 +16644,7 @@ var NoOpSpan = /** @class */ (function () { return { spanId: "", traceId: "", - traceFlags: api.TraceFlags.NONE + traceFlags: 0 /* NONE */ }; }; /** @@ -18509,7 +16679,7 @@ var NoOpSpan = /** @class */ (function () { return this; }; /** - * Sets a status on the span. Overrides the default of CanonicalCode.OK. + * Sets a status on the span. Overrides the default of SpanStatusCode.OK. * @param _status - The status to set. */ NoOpSpan.prototype.setStatus = function (_status) { @@ -18528,6 +16698,15 @@ var NoOpSpan = /** @class */ (function () { NoOpSpan.prototype.isRecording = function () { return false; }; + /** + * Sets exception as a span event + * @param exception - the exception the only accepted values are string or Error + * @param time - the time to set as Span's event time. If not provided, + * use the current time. + */ + NoOpSpan.prototype.recordException = function (_exception, _time) { + /* do nothing */ + }; return NoOpSpan; }()); @@ -18582,10 +16761,11 @@ function getGlobalObject() { // V1 = OpenTelemetry 0.1 // V2 = OpenTelemetry 0.2 // V3 = OpenTelemetry 0.6.1 -var GLOBAL_TRACER_VERSION = 3; +// V4 = OpenTelemetry 1.0.0-rc.0 +var GLOBAL_TRACER_VERSION = 4; // preview5 shipped with @azure/core-tracing.tracerCache // and didn't have smart detection for collisions -var GLOBAL_TRACER_SYMBOL = Symbol.for("@azure/core-tracing.tracerCache2"); +var GLOBAL_TRACER_SYMBOL = Symbol.for("@azure/core-tracing.tracerCache3"); var cache; function loadTracerCache() { var globalObj = getGlobalObject(); @@ -18647,6 +16827,86 @@ function getTracer() { return cache.tracer; } +// Copyright (c) Microsoft Corporation. +(function (SpanKind) { + /** Default value. Indicates that the span is used internally. */ + SpanKind[SpanKind["INTERNAL"] = 0] = "INTERNAL"; + /** + * Indicates that the span covers server-side handling of an RPC or other + * remote request. + */ + SpanKind[SpanKind["SERVER"] = 1] = "SERVER"; + /** + * Indicates that the span covers the client-side wrapper around an RPC or + * other remote request. + */ + SpanKind[SpanKind["CLIENT"] = 2] = "CLIENT"; + /** + * Indicates that the span describes producer sending a message to a + * broker. Unlike client and server, there is no direct critical path latency + * relationship between producer and consumer spans. + */ + SpanKind[SpanKind["PRODUCER"] = 3] = "PRODUCER"; + /** + * Indicates that the span describes consumer receiving a message from a + * broker. Unlike client and server, there is no direct critical path latency + * relationship between producer and consumer spans. + */ + SpanKind[SpanKind["CONSUMER"] = 4] = "CONSUMER"; +})(exports.SpanKind || (exports.SpanKind = {})); +/** + * Return the span if one exists + * + * @param context - context to get span from + */ +function getSpan(context) { + return api.getSpan(context); +} +/** + * Set the span on a context + * + * @param context - context to use as parent + * @param span - span to set active + */ +function setSpan(context, span) { + return api.setSpan(context, span); +} +/** + * Wrap span context in a NoopSpan and set as span in a new + * context + * + * @param context - context to set active span on + * @param spanContext - span context to be wrapped + */ +function setSpanContext(context, spanContext) { + return api.setSpanContext(context, spanContext); +} +/** + * Get the span context of the span if it exists. + * + * @param context - context to get values from + */ +function getSpanContext(context) { + return api.getSpanContext(context); +} +/** Entrypoint for context API */ +var context = api.context; +(function (SpanStatusCode) { + /** + * The default status. + */ + SpanStatusCode[SpanStatusCode["UNSET"] = 0] = "UNSET"; + /** + * The operation has been validated by an Application developer or + * Operator to have completed successfully. + */ + SpanStatusCode[SpanStatusCode["OK"] = 1] = "OK"; + /** + * The operation contains an error. + */ + SpanStatusCode[SpanStatusCode["ERROR"] = 2] = "ERROR"; +})(exports.SpanStatusCode || (exports.SpanStatusCode = {})); + // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. /** @@ -18672,6 +16932,20 @@ var OpenCensusTraceStateWrapper = /** @class */ (function () { }()); // Copyright (c) Microsoft Corporation. +/** An enumeration of canonical status codes. */ +var CanonicalCode; +(function (CanonicalCode) { + /** + * Not an error; returned on success + */ + CanonicalCode[CanonicalCode["OK"] = 0] = "OK"; + /** + * Internal errors. Means some invariants expected by underlying + * system has been broken. If you see one of these errors, + * something is very broken. + */ + CanonicalCode[CanonicalCode["INTERNAL"] = 13] = "INTERNAL"; +})(CanonicalCode || (CanonicalCode = {})); function isWrappedSpan(span) { return !!span && span.getWrappedSpan !== undefined; } @@ -18682,11 +16956,12 @@ function isTracer(tracerOrSpan) { * An implementation of OpenTelemetry Span that wraps an OpenCensus Span. */ var OpenCensusSpanWrapper = /** @class */ (function () { - function OpenCensusSpanWrapper(tracerOrSpan, name, options) { + function OpenCensusSpanWrapper(tracerOrSpan, name, options, context$1) { if (name === void 0) { name = ""; } if (options === void 0) { options = {}; } if (isTracer(tracerOrSpan)) { - var parent = isWrappedSpan(options.parent) ? options.parent.getWrappedSpan() : undefined; + var span = getSpan(context$1 !== null && context$1 !== void 0 ? context$1 : context.active()); + var parent = isWrappedSpan(span) ? span.getWrappedSpan() : undefined; this._span = tracerOrSpan.getWrappedTracer().startChildSpan({ name: name, childOf: parent @@ -18756,11 +17031,23 @@ var OpenCensusSpanWrapper = /** @class */ (function () { throw new Error("Method not implemented."); }; /** - * Sets a status on the span. Overrides the default of CanonicalCode.OK. + * Sets a status on the span. Overrides the default of SpanStatusCode.OK. * @param status - The status to set. */ OpenCensusSpanWrapper.prototype.setStatus = function (status) { - this._span.setStatus(status.code, status.message); + switch (status.code) { + case exports.SpanStatusCode.ERROR: { + this._span.setStatus(CanonicalCode.INTERNAL, status.message); + break; + } + case exports.SpanStatusCode.OK: { + this._span.setStatus(CanonicalCode.OK, status.message); + break; + } + case exports.SpanStatusCode.UNSET: { + break; + } + } return this; }; /** @@ -18778,6 +17065,15 @@ var OpenCensusSpanWrapper = /** @class */ (function () { // NoRecordSpans have an empty traceId return !!this._span.traceId; }; + /** + * Sets exception as a span event + * @param exception - the exception the only accepted values are string or Error + * @param time - the time to set as Span's event time. If not provided, + * use the current time. + */ + OpenCensusSpanWrapper.prototype.recordException = function (_exception, _time) { + throw new Error("Method not implemented"); + }; return OpenCensusSpanWrapper; }()); @@ -18856,7 +17152,7 @@ var TestSpan = /** @class */ (function (_super) { _this.startTime = startTime; _this.parentSpanId = parentSpanId; _this.status = { - code: api.CanonicalCode.OK + code: exports.SpanStatusCode.OK }; _this.endCalled = false; _this._context = context; @@ -18884,7 +17180,7 @@ var TestSpan = /** @class */ (function (_super) { this.endCalled = true; }; /** - * Sets a status on the span. Overrides the default of CanonicalCode.OK. + * Sets a status on the span. Overrides the default of SpanStatusCode.OK. * @param status - The status to set. */ TestSpan.prototype.setStatus = function (status) { @@ -19001,9 +17297,8 @@ var TestTracer = /** @class */ (function (_super) { * @param name - The name of the span. * @param options - The SpanOptions used during Span creation. */ - TestTracer.prototype.startSpan = function (name, options) { - if (options === void 0) { options = {}; } - var parentContext = this._getParentContext(options); + TestTracer.prototype.startSpan = function (name, options, context$1) { + var parentContext = getSpanContext(context$1 || context.active()); var traceId; var isRootSpan = false; if (parentContext && parentContext.traceId) { @@ -19013,31 +17308,18 @@ var TestTracer = /** @class */ (function (_super) { traceId = this.getNextTraceId(); isRootSpan = true; } - var context = { + var spanContext = { traceId: traceId, spanId: this.getNextSpanId(), - traceFlags: api.TraceFlags.NONE + traceFlags: 0 /* NONE */ }; - var span = new TestSpan(this, name, context, options.kind || api.SpanKind.INTERNAL, parentContext ? parentContext.spanId : undefined, options.startTime); + var span = new TestSpan(this, name, spanContext, (options === null || options === void 0 ? void 0 : options.kind) || exports.SpanKind.INTERNAL, parentContext ? parentContext.spanId : undefined, options === null || options === void 0 ? void 0 : options.startTime); this.knownSpans.push(span); if (isRootSpan) { this.rootSpans.push(span); } return span; }; - TestTracer.prototype._getParentContext = function (options) { - var parent = options.parent; - var result; - if (parent) { - if ("traceId" in parent) { - result = parent; - } - else { - result = parent.context(); - } - } - return result; - }; return TestTracer; }(NoOpTracer)); @@ -19064,17 +17346,17 @@ function createSpanFunction(args) { return function (operationName, operationOptions) { var tracer = getTracer(); var tracingOptions = (operationOptions === null || operationOptions === void 0 ? void 0 : operationOptions.tracingOptions) || {}; - var spanOptions = tslib.__assign({ kind: api.SpanKind.INTERNAL }, tracingOptions.spanOptions); + var spanOptions = tslib.__assign({ kind: exports.SpanKind.INTERNAL }, tracingOptions.spanOptions); var spanName = args.packagePrefix ? args.packagePrefix + "." + operationName : operationName; - var span = tracer.startSpan(spanName, spanOptions); + var span = tracer.startSpan(spanName, spanOptions, tracingOptions.tracingContext); if (args.namespace) { span.setAttribute("az.namespace", args.namespace); } var newSpanOptions = tracingOptions.spanOptions || {}; if (span.isRecording() && args.namespace) { - newSpanOptions = tslib.__assign(tslib.__assign({}, tracingOptions.spanOptions), { parent: span.context(), attributes: tslib.__assign(tslib.__assign({}, spanOptions.attributes), { "az.namespace": args.namespace }) }); + newSpanOptions = tslib.__assign(tslib.__assign({}, tracingOptions.spanOptions), { attributes: tslib.__assign(tslib.__assign({}, spanOptions.attributes), { "az.namespace": args.namespace }) }); } - var newTracingOptions = tslib.__assign(tslib.__assign({}, tracingOptions), { spanOptions: newSpanOptions }); + var newTracingOptions = tslib.__assign(tslib.__assign({}, tracingOptions), { spanOptions: newSpanOptions, tracingContext: setSpan(tracingOptions.tracingContext || context.active(), span) }); var newOperationOptions = tslib.__assign(tslib.__assign({}, operationOptions), { tracingOptions: newTracingOptions }); return { span: span, @@ -19137,10 +17419,15 @@ exports.OpenCensusSpanWrapper = OpenCensusSpanWrapper; exports.OpenCensusTracerWrapper = OpenCensusTracerWrapper; exports.TestSpan = TestSpan; exports.TestTracer = TestTracer; +exports.context = context; exports.createSpanFunction = createSpanFunction; exports.extractSpanContextFromTraceParentHeader = extractSpanContextFromTraceParentHeader; +exports.getSpan = getSpan; +exports.getSpanContext = getSpanContext; exports.getTraceParentHeader = getTraceParentHeader; exports.getTracer = getTracer; +exports.setSpan = setSpan; +exports.setSpanContext = setSpanContext; exports.setTracer = setTracer; //# sourceMappingURL=index.js.map @@ -19355,10 +17642,14 @@ var __createBinding; return r; }; - __spreadArray = function (to, from) { - for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) - to[j] = from[i]; - return to; + __spreadArray = function (to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || from); }; __await = function (v) { @@ -19952,10 +18243,14 @@ var __createBinding; return r; }; - __spreadArray = function (to, from) { - for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) - to[j] = from[i]; - return to; + __spreadArray = function (to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || from); }; __await = function (v) { @@ -20063,12 +18358,11 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); var coreHttp = __nccwpck_require__(4607); var tslib = __nccwpck_require__(679); -var api = __nccwpck_require__(5163); +var coreTracing = __nccwpck_require__(4175); var logger$1 = __nccwpck_require__(3233); var abortController = __nccwpck_require__(2557); var os = __nccwpck_require__(2087); var crypto = __nccwpck_require__(6417); -var coreTracing = __nccwpck_require__(4175); var stream = __nccwpck_require__(2413); __nccwpck_require__(4559); var coreLro = __nccwpck_require__(7094); @@ -20077,12 +18371,572 @@ var fs = __nccwpck_require__(5747); var util = __nccwpck_require__(1669); /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +var BlobServiceProperties = { + serializedName: "BlobServiceProperties", + xmlName: "StorageServiceProperties", + type: { + name: "Composite", + className: "BlobServiceProperties", + modelProperties: { + blobAnalyticsLogging: { + serializedName: "Logging", + xmlName: "Logging", + type: { + name: "Composite", + className: "Logging" + } + }, + hourMetrics: { + serializedName: "HourMetrics", + xmlName: "HourMetrics", + type: { + name: "Composite", + className: "Metrics" + } + }, + minuteMetrics: { + serializedName: "MinuteMetrics", + xmlName: "MinuteMetrics", + type: { + name: "Composite", + className: "Metrics" + } + }, + cors: { + serializedName: "Cors", + xmlName: "Cors", + xmlIsWrapped: true, + xmlElementName: "CorsRule", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "CorsRule" + } + } + } + }, + defaultServiceVersion: { + serializedName: "DefaultServiceVersion", + xmlName: "DefaultServiceVersion", + type: { + name: "String" + } + }, + deleteRetentionPolicy: { + serializedName: "DeleteRetentionPolicy", + xmlName: "DeleteRetentionPolicy", + type: { + name: "Composite", + className: "RetentionPolicy" + } + }, + staticWebsite: { + serializedName: "StaticWebsite", + xmlName: "StaticWebsite", + type: { + name: "Composite", + className: "StaticWebsite" + } + } + } + } +}; +var Logging = { + serializedName: "Logging", + type: { + name: "Composite", + className: "Logging", + modelProperties: { + version: { + serializedName: "Version", + required: true, + xmlName: "Version", + type: { + name: "String" + } + }, + deleteProperty: { + serializedName: "Delete", + required: true, + xmlName: "Delete", + type: { + name: "Boolean" + } + }, + read: { + serializedName: "Read", + required: true, + xmlName: "Read", + type: { + name: "Boolean" + } + }, + write: { + serializedName: "Write", + required: true, + xmlName: "Write", + type: { + name: "Boolean" + } + }, + retentionPolicy: { + serializedName: "RetentionPolicy", + xmlName: "RetentionPolicy", + type: { + name: "Composite", + className: "RetentionPolicy" + } + } + } + } +}; +var RetentionPolicy = { + serializedName: "RetentionPolicy", + type: { + name: "Composite", + className: "RetentionPolicy", + modelProperties: { + enabled: { + serializedName: "Enabled", + required: true, + xmlName: "Enabled", + type: { + name: "Boolean" + } + }, + days: { + constraints: { + InclusiveMinimum: 1 + }, + serializedName: "Days", + xmlName: "Days", + type: { + name: "Number" + } + } + } + } +}; +var Metrics = { + serializedName: "Metrics", + type: { + name: "Composite", + className: "Metrics", + modelProperties: { + version: { + serializedName: "Version", + xmlName: "Version", + type: { + name: "String" + } + }, + enabled: { + serializedName: "Enabled", + required: true, + xmlName: "Enabled", + type: { + name: "Boolean" + } + }, + includeAPIs: { + serializedName: "IncludeAPIs", + xmlName: "IncludeAPIs", + type: { + name: "Boolean" + } + }, + retentionPolicy: { + serializedName: "RetentionPolicy", + xmlName: "RetentionPolicy", + type: { + name: "Composite", + className: "RetentionPolicy" + } + } + } + } +}; +var CorsRule = { + serializedName: "CorsRule", + type: { + name: "Composite", + className: "CorsRule", + modelProperties: { + allowedOrigins: { + serializedName: "AllowedOrigins", + required: true, + xmlName: "AllowedOrigins", + type: { + name: "String" + } + }, + allowedMethods: { + serializedName: "AllowedMethods", + required: true, + xmlName: "AllowedMethods", + type: { + name: "String" + } + }, + allowedHeaders: { + serializedName: "AllowedHeaders", + required: true, + xmlName: "AllowedHeaders", + type: { + name: "String" + } + }, + exposedHeaders: { + serializedName: "ExposedHeaders", + required: true, + xmlName: "ExposedHeaders", + type: { + name: "String" + } + }, + maxAgeInSeconds: { + constraints: { + InclusiveMinimum: 0 + }, + serializedName: "MaxAgeInSeconds", + required: true, + xmlName: "MaxAgeInSeconds", + type: { + name: "Number" + } + } + } + } +}; +var StaticWebsite = { + serializedName: "StaticWebsite", + type: { + name: "Composite", + className: "StaticWebsite", + modelProperties: { + enabled: { + serializedName: "Enabled", + required: true, + xmlName: "Enabled", + type: { + name: "Boolean" + } + }, + indexDocument: { + serializedName: "IndexDocument", + xmlName: "IndexDocument", + type: { + name: "String" + } + }, + errorDocument404Path: { + serializedName: "ErrorDocument404Path", + xmlName: "ErrorDocument404Path", + type: { + name: "String" + } + }, + defaultIndexDocumentPath: { + serializedName: "DefaultIndexDocumentPath", + xmlName: "DefaultIndexDocumentPath", + type: { + name: "String" + } + } + } + } +}; +var StorageError = { + serializedName: "StorageError", + type: { + name: "Composite", + className: "StorageError", + modelProperties: { + message: { + serializedName: "Message", + xmlName: "Message", + type: { + name: "String" + } + }, + code: { + serializedName: "Code", + xmlName: "Code", + type: { + name: "String" + } + } + } + } +}; +var BlobServiceStatistics = { + serializedName: "BlobServiceStatistics", + xmlName: "StorageServiceStats", + type: { + name: "Composite", + className: "BlobServiceStatistics", + modelProperties: { + geoReplication: { + serializedName: "GeoReplication", + xmlName: "GeoReplication", + type: { + name: "Composite", + className: "GeoReplication" + } + } + } + } +}; +var GeoReplication = { + serializedName: "GeoReplication", + type: { + name: "Composite", + className: "GeoReplication", + modelProperties: { + status: { + serializedName: "Status", + required: true, + xmlName: "Status", + type: { + name: "Enum", + allowedValues: ["live", "bootstrap", "unavailable"] + } + }, + lastSyncOn: { + serializedName: "LastSyncTime", + required: true, + xmlName: "LastSyncTime", + type: { + name: "DateTimeRfc1123" + } + } + } + } +}; +var ListContainersSegmentResponse = { + serializedName: "ListContainersSegmentResponse", + xmlName: "EnumerationResults", + type: { + name: "Composite", + className: "ListContainersSegmentResponse", + modelProperties: { + serviceEndpoint: { + serializedName: "ServiceEndpoint", + required: true, + xmlName: "ServiceEndpoint", + xmlIsAttribute: true, + type: { + name: "String" + } + }, + prefix: { + serializedName: "Prefix", + xmlName: "Prefix", + type: { + name: "String" + } + }, + marker: { + serializedName: "Marker", + xmlName: "Marker", + type: { + name: "String" + } + }, + maxPageSize: { + serializedName: "MaxResults", + xmlName: "MaxResults", + type: { + name: "Number" + } + }, + containerItems: { + serializedName: "ContainerItems", + required: true, + xmlName: "Containers", + xmlIsWrapped: true, + xmlElementName: "Container", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ContainerItem" + } + } + } + }, + continuationToken: { + serializedName: "NextMarker", + xmlName: "NextMarker", + type: { + name: "String" + } + } + } + } +}; +var ContainerItem = { + serializedName: "ContainerItem", + xmlName: "Container", + type: { + name: "Composite", + className: "ContainerItem", + modelProperties: { + name: { + serializedName: "Name", + required: true, + xmlName: "Name", + type: { + name: "String" + } + }, + deleted: { + serializedName: "Deleted", + xmlName: "Deleted", + type: { + name: "Boolean" + } + }, + version: { + serializedName: "Version", + xmlName: "Version", + type: { + name: "String" + } + }, + properties: { + serializedName: "Properties", + xmlName: "Properties", + type: { + name: "Composite", + className: "ContainerProperties" + } + }, + metadata: { + serializedName: "Metadata", + xmlName: "Metadata", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + } + } + } +}; +var ContainerProperties = { + serializedName: "ContainerProperties", + type: { + name: "Composite", + className: "ContainerProperties", + modelProperties: { + lastModified: { + serializedName: "Last-Modified", + required: true, + xmlName: "Last-Modified", + type: { + name: "DateTimeRfc1123" + } + }, + etag: { + serializedName: "Etag", + required: true, + xmlName: "Etag", + type: { + name: "String" + } + }, + leaseStatus: { + serializedName: "LeaseStatus", + xmlName: "LeaseStatus", + type: { + name: "Enum", + allowedValues: ["locked", "unlocked"] + } + }, + leaseState: { + serializedName: "LeaseState", + xmlName: "LeaseState", + type: { + name: "Enum", + allowedValues: [ + "available", + "leased", + "expired", + "breaking", + "broken" + ] + } + }, + leaseDuration: { + serializedName: "LeaseDuration", + xmlName: "LeaseDuration", + type: { + name: "Enum", + allowedValues: ["infinite", "fixed"] + } + }, + publicAccess: { + serializedName: "PublicAccess", + xmlName: "PublicAccess", + type: { + name: "Enum", + allowedValues: ["container", "blob"] + } + }, + hasImmutabilityPolicy: { + serializedName: "HasImmutabilityPolicy", + xmlName: "HasImmutabilityPolicy", + type: { + name: "Boolean" + } + }, + hasLegalHold: { + serializedName: "HasLegalHold", + xmlName: "HasLegalHold", + type: { + name: "Boolean" + } + }, + defaultEncryptionScope: { + serializedName: "DefaultEncryptionScope", + xmlName: "DefaultEncryptionScope", + type: { + name: "String" + } + }, + preventEncryptionScopeOverride: { + serializedName: "DenyEncryptionScopeOverride", + xmlName: "DenyEncryptionScopeOverride", + type: { + name: "Boolean" + } + }, + deletedOn: { + serializedName: "DeletedTime", + xmlName: "DeletedTime", + type: { + name: "DateTimeRfc1123" + } + }, + remainingRetentionDays: { + serializedName: "RemainingRetentionDays", + xmlName: "RemainingRetentionDays", + type: { + name: "Number" + } + } + } + } +}; var KeyInfo = { serializedName: "KeyInfo", type: { @@ -20090,17 +18944,17 @@ var KeyInfo = { className: "KeyInfo", modelProperties: { startsOn: { - xmlName: "Start", - required: true, serializedName: "Start", + required: true, + xmlName: "Start", type: { name: "String" } }, expiresOn: { - xmlName: "Expiry", - required: true, serializedName: "Expiry", + required: true, + xmlName: "Expiry", type: { name: "String" } @@ -20115,57 +18969,107 @@ var UserDelegationKey = { className: "UserDelegationKey", modelProperties: { signedObjectId: { - xmlName: "SignedOid", - required: true, serializedName: "SignedOid", + required: true, + xmlName: "SignedOid", type: { name: "String" } }, signedTenantId: { - xmlName: "SignedTid", - required: true, serializedName: "SignedTid", + required: true, + xmlName: "SignedTid", type: { name: "String" } }, signedStartsOn: { - xmlName: "SignedStart", - required: true, serializedName: "SignedStart", + required: true, + xmlName: "SignedStart", type: { name: "String" } }, signedExpiresOn: { - xmlName: "SignedExpiry", - required: true, serializedName: "SignedExpiry", + required: true, + xmlName: "SignedExpiry", type: { name: "String" } }, signedService: { - xmlName: "SignedService", - required: true, serializedName: "SignedService", + required: true, + xmlName: "SignedService", type: { name: "String" } }, signedVersion: { - xmlName: "SignedVersion", - required: true, serializedName: "SignedVersion", + required: true, + xmlName: "SignedVersion", type: { name: "String" } }, value: { + serializedName: "Value", + required: true, xmlName: "Value", + type: { + name: "String" + } + } + } + } +}; +var FilterBlobSegment = { + serializedName: "FilterBlobSegment", + xmlName: "EnumerationResults", + type: { + name: "Composite", + className: "FilterBlobSegment", + modelProperties: { + serviceEndpoint: { + serializedName: "ServiceEndpoint", required: true, - serializedName: "Value", + xmlName: "ServiceEndpoint", + xmlIsAttribute: true, + type: { + name: "String" + } + }, + where: { + serializedName: "Where", + required: true, + xmlName: "Where", + type: { + name: "String" + } + }, + blobs: { + serializedName: "Blobs", + required: true, + xmlName: "Blobs", + xmlIsWrapped: true, + xmlElementName: "Blob", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "FilterBlobItem" + } + } + } + }, + continuationToken: { + serializedName: "NextMarker", + xmlName: "NextMarker", type: { name: "String" } @@ -20173,45 +19077,85 @@ var UserDelegationKey = { } } }; -var StorageError = { - serializedName: "StorageError", +var FilterBlobItem = { + serializedName: "FilterBlobItem", + xmlName: "Blob", type: { name: "Composite", - className: "StorageError", + className: "FilterBlobItem", modelProperties: { - message: { - xmlName: "Message", - serializedName: "Message", + name: { + serializedName: "Name", + required: true, + xmlName: "Name", type: { name: "String" } }, - code: { - xmlName: "Code", - serializedName: "Code", + containerName: { + serializedName: "ContainerName", + required: true, + xmlName: "ContainerName", type: { name: "String" } + }, + tags: { + serializedName: "Tags", + xmlName: "Tags", + type: { + name: "Composite", + className: "BlobTags" + } } } } }; -var DataLakeStorageErrorError = { - serializedName: "DataLakeStorageError_error", +var BlobTags = { + serializedName: "BlobTags", + xmlName: "Tags", type: { name: "Composite", - className: "DataLakeStorageErrorError", + className: "BlobTags", modelProperties: { - code: { - xmlName: "Code", - serializedName: "Code", + blobTagSet: { + serializedName: "BlobTagSet", + required: true, + xmlName: "TagSet", + xmlIsWrapped: true, + xmlElementName: "Tag", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "BlobTag" + } + } + } + } + } + } +}; +var BlobTag = { + serializedName: "BlobTag", + xmlName: "Tag", + type: { + name: "Composite", + className: "BlobTag", + modelProperties: { + key: { + serializedName: "Key", + required: true, + xmlName: "Key", type: { name: "String" } }, - message: { - xmlName: "Message", - serializedName: "Message", + value: { + serializedName: "Value", + required: true, + xmlName: "Value", type: { name: "String" } @@ -20219,18 +19163,27 @@ var DataLakeStorageErrorError = { } } }; -var DataLakeStorageError = { - serializedName: "DataLakeStorageError", +var SignedIdentifier = { + serializedName: "SignedIdentifier", + xmlName: "SignedIdentifier", type: { name: "Composite", - className: "DataLakeStorageError", + className: "SignedIdentifier", modelProperties: { - dataLakeStorageErrorDetails: { - xmlName: "error", - serializedName: "error", + id: { + serializedName: "Id", + required: true, + xmlName: "Id", + type: { + name: "String" + } + }, + accessPolicy: { + serializedName: "AccessPolicy", + xmlName: "AccessPolicy", type: { name: "Composite", - className: "DataLakeStorageErrorError" + className: "AccessPolicy" } } } @@ -20243,141 +19196,303 @@ var AccessPolicy = { className: "AccessPolicy", modelProperties: { startsOn: { - xmlName: "Start", serializedName: "Start", + xmlName: "Start", type: { name: "String" } }, expiresOn: { - xmlName: "Expiry", serializedName: "Expiry", + xmlName: "Expiry", type: { name: "String" } }, permissions: { - xmlName: "Permission", serializedName: "Permission", + xmlName: "Permission", + type: { + name: "String" + } + } + } + } +}; +var ListBlobsFlatSegmentResponse = { + serializedName: "ListBlobsFlatSegmentResponse", + xmlName: "EnumerationResults", + type: { + name: "Composite", + className: "ListBlobsFlatSegmentResponse", + modelProperties: { + serviceEndpoint: { + serializedName: "ServiceEndpoint", + required: true, + xmlName: "ServiceEndpoint", + xmlIsAttribute: true, + type: { + name: "String" + } + }, + containerName: { + serializedName: "ContainerName", + required: true, + xmlName: "ContainerName", + xmlIsAttribute: true, + type: { + name: "String" + } + }, + prefix: { + serializedName: "Prefix", + xmlName: "Prefix", + type: { + name: "String" + } + }, + marker: { + serializedName: "Marker", + xmlName: "Marker", + type: { + name: "String" + } + }, + maxPageSize: { + serializedName: "MaxResults", + xmlName: "MaxResults", + type: { + name: "Number" + } + }, + segment: { + serializedName: "Segment", + xmlName: "Blobs", + type: { + name: "Composite", + className: "BlobFlatListSegment" + } + }, + continuationToken: { + serializedName: "NextMarker", + xmlName: "NextMarker", + type: { + name: "String" + } + } + } + } +}; +var BlobFlatListSegment = { + serializedName: "BlobFlatListSegment", + xmlName: "Blobs", + type: { + name: "Composite", + className: "BlobFlatListSegment", + modelProperties: { + blobItems: { + serializedName: "BlobItems", + required: true, + xmlName: "BlobItems", + xmlElementName: "Blob", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "BlobItemInternal" + } + } + } + } + } + } +}; +var BlobItemInternal = { + serializedName: "BlobItemInternal", + xmlName: "Blob", + type: { + name: "Composite", + className: "BlobItemInternal", + modelProperties: { + name: { + serializedName: "Name", + required: true, + xmlName: "Name", + type: { + name: "String" + } + }, + deleted: { + serializedName: "Deleted", + required: true, + xmlName: "Deleted", + type: { + name: "Boolean" + } + }, + snapshot: { + serializedName: "Snapshot", + required: true, + xmlName: "Snapshot", + type: { + name: "String" + } + }, + versionId: { + serializedName: "VersionId", + xmlName: "VersionId", + type: { + name: "String" + } + }, + isCurrentVersion: { + serializedName: "IsCurrentVersion", + xmlName: "IsCurrentVersion", + type: { + name: "Boolean" + } + }, + properties: { + serializedName: "Properties", + xmlName: "Properties", + type: { + name: "Composite", + className: "BlobPropertiesInternal" + } + }, + metadata: { + serializedName: "Metadata", + xmlName: "Metadata", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + blobTags: { + serializedName: "BlobTags", + xmlName: "Tags", + type: { + name: "Composite", + className: "BlobTags" + } + }, + objectReplicationMetadata: { + serializedName: "ObjectReplicationMetadata", + xmlName: "OrMetadata", type: { - name: "String" + name: "Dictionary", + value: { type: { name: "String" } } } } } } }; var BlobPropertiesInternal = { - xmlName: "Properties", serializedName: "BlobPropertiesInternal", + xmlName: "Properties", type: { name: "Composite", className: "BlobPropertiesInternal", modelProperties: { createdOn: { - xmlName: "Creation-Time", serializedName: "Creation-Time", + xmlName: "Creation-Time", type: { name: "DateTimeRfc1123" } }, lastModified: { - xmlName: "Last-Modified", - required: true, serializedName: "Last-Modified", + required: true, + xmlName: "Last-Modified", type: { name: "DateTimeRfc1123" } }, etag: { - xmlName: "Etag", - required: true, serializedName: "Etag", + required: true, + xmlName: "Etag", type: { name: "String" } }, contentLength: { - xmlName: "Content-Length", serializedName: "Content-Length", + xmlName: "Content-Length", type: { name: "Number" } }, contentType: { - xmlName: "Content-Type", serializedName: "Content-Type", + xmlName: "Content-Type", type: { name: "String" } }, contentEncoding: { - xmlName: "Content-Encoding", serializedName: "Content-Encoding", + xmlName: "Content-Encoding", type: { name: "String" } }, contentLanguage: { - xmlName: "Content-Language", serializedName: "Content-Language", + xmlName: "Content-Language", type: { name: "String" } }, contentMD5: { - xmlName: "Content-MD5", serializedName: "Content-MD5", + xmlName: "Content-MD5", type: { name: "ByteArray" } }, contentDisposition: { - xmlName: "Content-Disposition", serializedName: "Content-Disposition", + xmlName: "Content-Disposition", type: { name: "String" } }, cacheControl: { - xmlName: "Cache-Control", serializedName: "Cache-Control", + xmlName: "Cache-Control", type: { name: "String" } }, blobSequenceNumber: { - xmlName: "x-ms-blob-sequence-number", serializedName: "x-ms-blob-sequence-number", + xmlName: "x-ms-blob-sequence-number", type: { name: "Number" } }, blobType: { - xmlName: "BlobType", serializedName: "BlobType", + xmlName: "BlobType", type: { name: "Enum", - allowedValues: [ - "BlockBlob", - "PageBlob", - "AppendBlob" - ] + allowedValues: ["BlockBlob", "PageBlob", "AppendBlob"] } }, leaseStatus: { - xmlName: "LeaseStatus", serializedName: "LeaseStatus", + xmlName: "LeaseStatus", type: { name: "Enum", - allowedValues: [ - "locked", - "unlocked" - ] + allowedValues: ["locked", "unlocked"] } }, leaseState: { - xmlName: "LeaseState", serializedName: "LeaseState", + xmlName: "LeaseState", type: { name: "Enum", allowedValues: [ @@ -20390,172 +19505,185 @@ var BlobPropertiesInternal = { } }, leaseDuration: { - xmlName: "LeaseDuration", serializedName: "LeaseDuration", + xmlName: "LeaseDuration", type: { name: "Enum", - allowedValues: [ - "infinite", - "fixed" - ] + allowedValues: ["infinite", "fixed"] } }, copyId: { - xmlName: "CopyId", serializedName: "CopyId", + xmlName: "CopyId", type: { name: "String" } }, copyStatus: { - xmlName: "CopyStatus", serializedName: "CopyStatus", + xmlName: "CopyStatus", type: { name: "Enum", - allowedValues: [ - "pending", - "success", - "aborted", - "failed" - ] + allowedValues: ["pending", "success", "aborted", "failed"] } }, copySource: { - xmlName: "CopySource", serializedName: "CopySource", + xmlName: "CopySource", type: { name: "String" } }, copyProgress: { - xmlName: "CopyProgress", serializedName: "CopyProgress", + xmlName: "CopyProgress", type: { name: "String" } }, copyCompletedOn: { - xmlName: "CopyCompletionTime", serializedName: "CopyCompletionTime", + xmlName: "CopyCompletionTime", type: { name: "DateTimeRfc1123" } }, copyStatusDescription: { - xmlName: "CopyStatusDescription", serializedName: "CopyStatusDescription", + xmlName: "CopyStatusDescription", type: { name: "String" } }, serverEncrypted: { - xmlName: "ServerEncrypted", serializedName: "ServerEncrypted", + xmlName: "ServerEncrypted", type: { name: "Boolean" } }, incrementalCopy: { - xmlName: "IncrementalCopy", serializedName: "IncrementalCopy", + xmlName: "IncrementalCopy", type: { name: "Boolean" } }, destinationSnapshot: { - xmlName: "DestinationSnapshot", serializedName: "DestinationSnapshot", + xmlName: "DestinationSnapshot", type: { name: "String" } }, deletedOn: { - xmlName: "DeletedTime", serializedName: "DeletedTime", + xmlName: "DeletedTime", type: { name: "DateTimeRfc1123" } }, remainingRetentionDays: { - xmlName: "RemainingRetentionDays", serializedName: "RemainingRetentionDays", + xmlName: "RemainingRetentionDays", type: { name: "Number" } }, accessTier: { - xmlName: "AccessTier", serializedName: "AccessTier", + xmlName: "AccessTier", type: { - name: "String" + name: "Enum", + allowedValues: [ + "P4", + "P6", + "P10", + "P15", + "P20", + "P30", + "P40", + "P50", + "P60", + "P70", + "P80", + "Hot", + "Cool", + "Archive" + ] } }, accessTierInferred: { - xmlName: "AccessTierInferred", serializedName: "AccessTierInferred", + xmlName: "AccessTierInferred", type: { name: "Boolean" } }, archiveStatus: { - xmlName: "ArchiveStatus", serializedName: "ArchiveStatus", + xmlName: "ArchiveStatus", type: { - name: "String" + name: "Enum", + allowedValues: [ + "rehydrate-pending-to-hot", + "rehydrate-pending-to-cool" + ] } }, customerProvidedKeySha256: { - xmlName: "CustomerProvidedKeySha256", serializedName: "CustomerProvidedKeySha256", + xmlName: "CustomerProvidedKeySha256", type: { name: "String" } }, encryptionScope: { - xmlName: "EncryptionScope", serializedName: "EncryptionScope", + xmlName: "EncryptionScope", type: { name: "String" } }, accessTierChangedOn: { - xmlName: "AccessTierChangeTime", serializedName: "AccessTierChangeTime", + xmlName: "AccessTierChangeTime", type: { name: "DateTimeRfc1123" } }, tagCount: { - xmlName: "TagCount", serializedName: "TagCount", + xmlName: "TagCount", type: { name: "Number" } }, expiresOn: { - xmlName: "Expiry-Time", serializedName: "Expiry-Time", + xmlName: "Expiry-Time", type: { name: "DateTimeRfc1123" } }, isSealed: { - xmlName: "Sealed", serializedName: "Sealed", + xmlName: "Sealed", type: { name: "Boolean" } }, rehydratePriority: { - xmlName: "RehydratePriority", serializedName: "RehydratePriority", + xmlName: "RehydratePriority", type: { - name: "String" + name: "Enum", + allowedValues: ["High", "Standard"] } }, lastAccessedOn: { - xmlName: "LastAccessTime", serializedName: "LastAccessTime", + xmlName: "LastAccessTime", type: { name: "DateTimeRfc1123" } @@ -20563,247 +19691,70 @@ var BlobPropertiesInternal = { } } }; -var BlobTag = { - xmlName: "Tag", - serializedName: "BlobTag", - type: { - name: "Composite", - className: "BlobTag", - modelProperties: { - key: { - xmlName: "Key", - required: true, - serializedName: "Key", - type: { - name: "String" - } - }, - value: { - xmlName: "Value", - required: true, - serializedName: "Value", - type: { - name: "String" - } - } - } - } -}; -var BlobTags = { - xmlName: "Tags", - serializedName: "BlobTags", - type: { - name: "Composite", - className: "BlobTags", - modelProperties: { - blobTagSet: { - xmlIsWrapped: true, - xmlName: "TagSet", - xmlElementName: "Tag", - required: true, - serializedName: "BlobTagSet", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "BlobTag" - } - } - } - } - } - } -}; -var BlobItemInternal = { - xmlName: "Blob", - serializedName: "BlobItemInternal", - type: { - name: "Composite", - className: "BlobItemInternal", - modelProperties: { - name: { - xmlName: "Name", - required: true, - serializedName: "Name", - type: { - name: "String" - } - }, - deleted: { - xmlName: "Deleted", - required: true, - serializedName: "Deleted", - type: { - name: "Boolean" - } - }, - snapshot: { - xmlName: "Snapshot", - required: true, - serializedName: "Snapshot", - type: { - name: "String" - } - }, - versionId: { - xmlName: "VersionId", - serializedName: "VersionId", - type: { - name: "String" - } - }, - isCurrentVersion: { - xmlName: "IsCurrentVersion", - serializedName: "IsCurrentVersion", - type: { - name: "Boolean" - } - }, - properties: { - xmlName: "Properties", - required: true, - serializedName: "Properties", - type: { - name: "Composite", - className: "BlobPropertiesInternal" - } - }, - metadata: { - xmlName: "Metadata", - serializedName: "Metadata", - type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } - } - }, - blobTags: { - xmlName: "Tags", - serializedName: "BlobTags", - type: { - name: "Composite", - className: "BlobTags" - } - }, - objectReplicationMetadata: { - xmlName: "OrMetadata", - serializedName: "ObjectReplicationMetadata", - type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } - } - } - } - } -}; -var BlobFlatListSegment = { - xmlName: "Blobs", - serializedName: "BlobFlatListSegment", - type: { - name: "Composite", - className: "BlobFlatListSegment", - modelProperties: { - blobItems: { - xmlName: "BlobItems", - xmlElementName: "Blob", - required: true, - serializedName: "BlobItems", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "BlobItemInternal" - } - } - } - } - } - } -}; -var ListBlobsFlatSegmentResponse = { +var ListBlobsHierarchySegmentResponse = { + serializedName: "ListBlobsHierarchySegmentResponse", xmlName: "EnumerationResults", - serializedName: "ListBlobsFlatSegmentResponse", type: { name: "Composite", - className: "ListBlobsFlatSegmentResponse", + className: "ListBlobsHierarchySegmentResponse", modelProperties: { serviceEndpoint: { - xmlIsAttribute: true, - xmlName: "ServiceEndpoint", - required: true, serializedName: "ServiceEndpoint", + required: true, + xmlName: "ServiceEndpoint", + xmlIsAttribute: true, type: { name: "String" } }, containerName: { - xmlIsAttribute: true, - xmlName: "ContainerName", - required: true, serializedName: "ContainerName", + required: true, + xmlName: "ContainerName", + xmlIsAttribute: true, type: { name: "String" } }, prefix: { - xmlName: "Prefix", serializedName: "Prefix", + xmlName: "Prefix", type: { name: "String" } }, marker: { - xmlName: "Marker", serializedName: "Marker", + xmlName: "Marker", type: { name: "String" } }, maxPageSize: { - xmlName: "MaxResults", serializedName: "MaxResults", + xmlName: "MaxResults", type: { name: "Number" } }, + delimiter: { + serializedName: "Delimiter", + xmlName: "Delimiter", + type: { + name: "String" + } + }, segment: { - xmlName: "Blobs", - required: true, serializedName: "Segment", + xmlName: "Blobs", type: { name: "Composite", - className: "BlobFlatListSegment" + className: "BlobHierarchyListSegment" } }, continuationToken: { - xmlName: "NextMarker", serializedName: "NextMarker", - type: { - name: "String" - } - } - } - } -}; -var BlobPrefix = { - serializedName: "BlobPrefix", - type: { - name: "Composite", - className: "BlobPrefix", - modelProperties: { - name: { - xmlName: "Name", - required: true, - serializedName: "Name", + xmlName: "NextMarker", type: { name: "String" } @@ -20812,16 +19763,16 @@ var BlobPrefix = { } }; var BlobHierarchyListSegment = { - xmlName: "Blobs", serializedName: "BlobHierarchyListSegment", + xmlName: "Blobs", type: { name: "Composite", className: "BlobHierarchyListSegment", modelProperties: { blobPrefixes: { + serializedName: "BlobPrefixes", xmlName: "BlobPrefixes", xmlElementName: "BlobPrefix", - serializedName: "BlobPrefixes", type: { name: "Sequence", element: { @@ -20833,10 +19784,10 @@ var BlobHierarchyListSegment = { } }, blobItems: { + serializedName: "BlobItems", + required: true, xmlName: "BlobItems", xmlElementName: "Blob", - required: true, - serializedName: "BlobItems", type: { name: "Sequence", element: { @@ -20850,71 +19801,56 @@ var BlobHierarchyListSegment = { } } }; -var ListBlobsHierarchySegmentResponse = { - xmlName: "EnumerationResults", - serializedName: "ListBlobsHierarchySegmentResponse", +var BlobPrefix = { + serializedName: "BlobPrefix", type: { name: "Composite", - className: "ListBlobsHierarchySegmentResponse", + className: "BlobPrefix", modelProperties: { - serviceEndpoint: { - xmlIsAttribute: true, - xmlName: "ServiceEndpoint", - required: true, - serializedName: "ServiceEndpoint", - type: { - name: "String" - } - }, - containerName: { - xmlIsAttribute: true, - xmlName: "ContainerName", + name: { + serializedName: "Name", required: true, - serializedName: "ContainerName", - type: { - name: "String" - } - }, - prefix: { - xmlName: "Prefix", - serializedName: "Prefix", - type: { - name: "String" - } - }, - marker: { - xmlName: "Marker", - serializedName: "Marker", + xmlName: "Name", type: { name: "String" } - }, - maxPageSize: { - xmlName: "MaxResults", - serializedName: "MaxResults", + } + } + } +}; +var DataLakeStorageError = { + serializedName: "DataLakeStorageError", + type: { + name: "Composite", + className: "DataLakeStorageError", + modelProperties: { + dataLakeStorageErrorDetails: { + serializedName: "error", + xmlName: "error", type: { - name: "Number" + name: "Composite", + className: "DataLakeStorageErrorError" } - }, - delimiter: { - xmlName: "Delimiter", - serializedName: "Delimiter", + } + } + } +}; +var DataLakeStorageErrorError = { + serializedName: "DataLakeStorageErrorError", + type: { + name: "Composite", + className: "DataLakeStorageErrorError", + modelProperties: { + code: { + serializedName: "Code", + xmlName: "Code", type: { name: "String" } }, - segment: { - xmlName: "Blobs", - required: true, - serializedName: "Segment", - type: { - name: "Composite", - className: "BlobHierarchyListSegment" - } - }, - continuationToken: { - xmlName: "NextMarker", - serializedName: "NextMarker", + message: { + serializedName: "Message", + xmlName: "Message", type: { name: "String" } @@ -20922,26 +19858,50 @@ var ListBlobsHierarchySegmentResponse = { } } }; -var Block = { - serializedName: "Block", +var BlockLookupList = { + serializedName: "BlockLookupList", + xmlName: "BlockList", type: { name: "Composite", - className: "Block", + className: "BlockLookupList", modelProperties: { - name: { - xmlName: "Name", - required: true, - serializedName: "Name", + committed: { + serializedName: "Committed", + xmlName: "Committed", + xmlElementName: "Committed", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "String" + } + } } }, - size: { - xmlName: "Size", - required: true, - serializedName: "Size", + uncommitted: { + serializedName: "Uncommitted", + xmlName: "Uncommitted", + xmlElementName: "Uncommitted", type: { - name: "Number" + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + latest: { + serializedName: "Latest", + xmlName: "Latest", + xmlElementName: "Latest", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } } } } @@ -20954,10 +19914,10 @@ var BlockList = { className: "BlockList", modelProperties: { committedBlocks: { - xmlIsWrapped: true, + serializedName: "CommittedBlocks", xmlName: "CommittedBlocks", + xmlIsWrapped: true, xmlElementName: "Block", - serializedName: "CommittedBlocks", type: { name: "Sequence", element: { @@ -20969,10 +19929,10 @@ var BlockList = { } }, uncommittedBlocks: { - xmlIsWrapped: true, + serializedName: "UncommittedBlocks", xmlName: "UncommittedBlocks", + xmlIsWrapped: true, xmlElementName: "Block", - serializedName: "UncommittedBlocks", type: { name: "Sequence", element: { @@ -20986,48 +19946,61 @@ var BlockList = { } } }; -var BlockLookupList = { - xmlName: "BlockList", - serializedName: "BlockLookupList", +var Block = { + serializedName: "Block", type: { name: "Composite", - className: "BlockLookupList", + className: "Block", modelProperties: { - committed: { - xmlName: "Committed", - xmlElementName: "Committed", - serializedName: "Committed", + name: { + serializedName: "Name", + required: true, + xmlName: "Name", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" } }, - uncommitted: { - xmlName: "Uncommitted", - xmlElementName: "Uncommitted", - serializedName: "Uncommitted", + size: { + serializedName: "Size", + required: true, + xmlName: "Size", + type: { + name: "Number" + } + } + } + } +}; +var PageList = { + serializedName: "PageList", + type: { + name: "Composite", + className: "PageList", + modelProperties: { + pageRange: { + serializedName: "PageRange", + xmlName: "PageRange", + xmlElementName: "PageRange", type: { name: "Sequence", element: { type: { - name: "String" + name: "Composite", + className: "PageRange" } } } }, - latest: { - xmlName: "Latest", - xmlElementName: "Latest", - serializedName: "Latest", + clearRange: { + serializedName: "ClearRange", + xmlName: "ClearRange", + xmlElementName: "ClearRange", type: { name: "Sequence", element: { type: { - name: "String" + name: "Composite", + className: "ClearRange" } } } @@ -21035,164 +20008,153 @@ var BlockLookupList = { } } }; -var ContainerProperties = { - serializedName: "ContainerProperties", +var PageRange = { + serializedName: "PageRange", + xmlName: "PageRange", type: { name: "Composite", - className: "ContainerProperties", + className: "PageRange", modelProperties: { - lastModified: { - xmlName: "Last-Modified", + start: { + serializedName: "Start", required: true, - serializedName: "Last-Modified", + xmlName: "Start", type: { - name: "DateTimeRfc1123" + name: "Number" } }, - etag: { - xmlName: "Etag", + end: { + serializedName: "End", required: true, - serializedName: "Etag", - type: { - name: "String" - } - }, - leaseStatus: { - xmlName: "LeaseStatus", - serializedName: "LeaseStatus", + xmlName: "End", type: { - name: "Enum", - allowedValues: [ - "locked", - "unlocked" - ] + name: "Number" } - }, - leaseState: { - xmlName: "LeaseState", - serializedName: "LeaseState", + } + } + } +}; +var ClearRange = { + serializedName: "ClearRange", + xmlName: "ClearRange", + type: { + name: "Composite", + className: "ClearRange", + modelProperties: { + start: { + serializedName: "Start", + required: true, + xmlName: "Start", type: { - name: "Enum", - allowedValues: [ - "available", - "leased", - "expired", - "breaking", - "broken" - ] + name: "Number" } }, - leaseDuration: { - xmlName: "LeaseDuration", - serializedName: "LeaseDuration", + end: { + serializedName: "End", + required: true, + xmlName: "End", type: { - name: "Enum", - allowedValues: [ - "infinite", - "fixed" - ] + name: "Number" } - }, - publicAccess: { - xmlName: "PublicAccess", - serializedName: "PublicAccess", + } + } + } +}; +var QueryRequest = { + serializedName: "QueryRequest", + xmlName: "QueryRequest", + type: { + name: "Composite", + className: "QueryRequest", + modelProperties: { + queryType: { + serializedName: "QueryType", + required: true, + xmlName: "QueryType", type: { name: "String" } }, - hasImmutabilityPolicy: { - xmlName: "HasImmutabilityPolicy", - serializedName: "HasImmutabilityPolicy", - type: { - name: "Boolean" - } - }, - hasLegalHold: { - xmlName: "HasLegalHold", - serializedName: "HasLegalHold", - type: { - name: "Boolean" - } - }, - defaultEncryptionScope: { - xmlName: "DefaultEncryptionScope", - serializedName: "DefaultEncryptionScope", + expression: { + serializedName: "Expression", + required: true, + xmlName: "Expression", type: { name: "String" } }, - preventEncryptionScopeOverride: { - xmlName: "DenyEncryptionScopeOverride", - serializedName: "DenyEncryptionScopeOverride", - type: { - name: "Boolean" - } - }, - deletedOn: { - xmlName: "DeletedTime", - serializedName: "DeletedTime", + inputSerialization: { + serializedName: "InputSerialization", + xmlName: "InputSerialization", type: { - name: "DateTimeRfc1123" + name: "Composite", + className: "QuerySerialization" } }, - remainingRetentionDays: { - xmlName: "RemainingRetentionDays", - serializedName: "RemainingRetentionDays", + outputSerialization: { + serializedName: "OutputSerialization", + xmlName: "OutputSerialization", type: { - name: "Number" + name: "Composite", + className: "QuerySerialization" } } } } }; -var ContainerItem = { - xmlName: "Container", - serializedName: "ContainerItem", +var QuerySerialization = { + serializedName: "QuerySerialization", type: { name: "Composite", - className: "ContainerItem", + className: "QuerySerialization", modelProperties: { - name: { - xmlName: "Name", - required: true, - serializedName: "Name", + format: { + serializedName: "Format", + xmlName: "Format", type: { - name: "String" + name: "Composite", + className: "QueryFormat" } - }, - deleted: { - xmlName: "Deleted", - serializedName: "Deleted", + } + } + } +}; +var QueryFormat = { + serializedName: "QueryFormat", + type: { + name: "Composite", + className: "QueryFormat", + modelProperties: { + type: { + serializedName: "Type", + xmlName: "Type", type: { - name: "Boolean" + name: "Enum", + allowedValues: ["delimited", "json", "arrow"] } }, - version: { - xmlName: "Version", - serializedName: "Version", + delimitedTextConfiguration: { + serializedName: "DelimitedTextConfiguration", + xmlName: "DelimitedTextConfiguration", type: { - name: "String" + name: "Composite", + className: "DelimitedTextConfiguration" } }, - properties: { - xmlName: "Properties", - required: true, - serializedName: "Properties", + jsonTextConfiguration: { + serializedName: "JsonTextConfiguration", + xmlName: "JsonTextConfiguration", type: { name: "Composite", - className: "ContainerProperties" + className: "JsonTextConfiguration" } }, - metadata: { - xmlName: "Metadata", - serializedName: "Metadata", + arrowConfiguration: { + serializedName: "ArrowConfiguration", + xmlName: "ArrowConfiguration", type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } + name: "Composite", + className: "ArrowConfiguration" } } } @@ -21200,46 +20162,47 @@ var ContainerItem = { }; var DelimitedTextConfiguration = { serializedName: "DelimitedTextConfiguration", + xmlName: "DelimitedTextConfiguration", type: { name: "Composite", className: "DelimitedTextConfiguration", modelProperties: { columnSeparator: { - xmlName: "ColumnSeparator", - required: true, serializedName: "ColumnSeparator", + required: true, + xmlName: "ColumnSeparator", type: { name: "String" } }, fieldQuote: { - xmlName: "FieldQuote", - required: true, serializedName: "FieldQuote", + required: true, + xmlName: "FieldQuote", type: { name: "String" } }, recordSeparator: { - xmlName: "RecordSeparator", - required: true, serializedName: "RecordSeparator", + required: true, + xmlName: "RecordSeparator", type: { name: "String" } }, escapeChar: { - xmlName: "EscapeChar", - required: true, serializedName: "EscapeChar", + required: true, + xmlName: "EscapeChar", type: { name: "String" } }, headersPresent: { - xmlName: "HasHeaders", - required: true, serializedName: "HeadersPresent", + required: true, + xmlName: "HasHeaders", type: { name: "Boolean" } @@ -21249,14 +20212,15 @@ var DelimitedTextConfiguration = { }; var JsonTextConfiguration = { serializedName: "JsonTextConfiguration", + xmlName: "JsonTextConfiguration", type: { name: "Composite", className: "JsonTextConfiguration", modelProperties: { recordSeparator: { - xmlName: "RecordSeparator", - required: true, serializedName: "RecordSeparator", + required: true, + xmlName: "RecordSeparator", type: { name: "String" } @@ -21264,38 +20228,64 @@ var JsonTextConfiguration = { } } }; +var ArrowConfiguration = { + serializedName: "ArrowConfiguration", + xmlName: "ArrowConfiguration", + type: { + name: "Composite", + className: "ArrowConfiguration", + modelProperties: { + schema: { + serializedName: "Schema", + required: true, + xmlName: "Schema", + xmlIsWrapped: true, + xmlElementName: "Field", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ArrowField" + } + } + } + } + } + } +}; var ArrowField = { - xmlName: "Field", serializedName: "ArrowField", + xmlName: "Field", type: { name: "Composite", className: "ArrowField", modelProperties: { type: { - xmlName: "Type", - required: true, serializedName: "Type", + required: true, + xmlName: "Type", type: { name: "String" } }, name: { - xmlName: "Name", serializedName: "Name", + xmlName: "Name", type: { name: "String" } }, precision: { - xmlName: "Precision", serializedName: "Precision", + xmlName: "Precision", type: { name: "Number" } }, scale: { - xmlName: "Scale", serializedName: "Scale", + xmlName: "Scale", type: { name: "Number" } @@ -21303,87 +20293,36 @@ var ArrowField = { } } }; -var ArrowConfiguration = { - serializedName: "ArrowConfiguration", - type: { - name: "Composite", - className: "ArrowConfiguration", - modelProperties: { - schema: { - xmlIsWrapped: true, - xmlName: "Schema", - xmlElementName: "Field", - required: true, - serializedName: "Schema", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ArrowField" - } - } - } - } - } - } -}; -var ListContainersSegmentResponse = { - xmlName: "EnumerationResults", - serializedName: "ListContainersSegmentResponse", +var ServiceSetPropertiesHeaders = { + serializedName: "Service_setPropertiesHeaders", type: { name: "Composite", - className: "ListContainersSegmentResponse", + className: "ServiceSetPropertiesHeaders", modelProperties: { - serviceEndpoint: { - xmlIsAttribute: true, - xmlName: "ServiceEndpoint", - required: true, - serializedName: "ServiceEndpoint", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - prefix: { - xmlName: "Prefix", - serializedName: "Prefix", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - marker: { - xmlName: "Marker", - serializedName: "Marker", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - maxPageSize: { - xmlName: "MaxResults", - serializedName: "MaxResults", - type: { - name: "Number" - } - }, - containerItems: { - xmlIsWrapped: true, - xmlName: "Containers", - xmlElementName: "Container", - required: true, - serializedName: "ContainerItems", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ContainerItem" - } - } - } - }, - continuationToken: { - xmlName: "NextMarker", - serializedName: "NextMarker", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -21391,135 +20330,112 @@ var ListContainersSegmentResponse = { } } }; -var CorsRule = { - serializedName: "CorsRule", +var ServiceSetPropertiesExceptionHeaders = { + serializedName: "Service_setPropertiesExceptionHeaders", type: { name: "Composite", - className: "CorsRule", + className: "ServiceSetPropertiesExceptionHeaders", modelProperties: { - allowedOrigins: { - xmlName: "AllowedOrigins", - required: true, - serializedName: "AllowedOrigins", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, - allowedMethods: { - xmlName: "AllowedMethods", - required: true, - serializedName: "AllowedMethods", + } + } + } +}; +var ServiceGetPropertiesHeaders = { + serializedName: "Service_getPropertiesHeaders", + type: { + name: "Composite", + className: "ServiceGetPropertiesHeaders", + modelProperties: { + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - allowedHeaders: { - xmlName: "AllowedHeaders", - required: true, - serializedName: "AllowedHeaders", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - exposedHeaders: { - xmlName: "ExposedHeaders", - required: true, - serializedName: "ExposedHeaders", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - maxAgeInSeconds: { - xmlName: "MaxAgeInSeconds", - required: true, - serializedName: "MaxAgeInSeconds", - constraints: { - InclusiveMinimum: 0 - }, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Number" + name: "String" } } } } }; -var FilterBlobItem = { - xmlName: "Blob", - serializedName: "FilterBlobItem", +var ServiceGetPropertiesExceptionHeaders = { + serializedName: "Service_getPropertiesExceptionHeaders", type: { name: "Composite", - className: "FilterBlobItem", + className: "ServiceGetPropertiesExceptionHeaders", modelProperties: { - name: { - xmlName: "Name", - required: true, - serializedName: "Name", - type: { - name: "String" - } - }, - containerName: { - xmlName: "ContainerName", - required: true, - serializedName: "ContainerName", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, - tags: { - xmlName: "Tags", - serializedName: "Tags", - type: { - name: "Composite", - className: "BlobTags" - } } } } }; -var FilterBlobSegment = { - xmlName: "EnumerationResults", - serializedName: "FilterBlobSegment", +var ServiceGetStatisticsHeaders = { + serializedName: "Service_getStatisticsHeaders", type: { name: "Composite", - className: "FilterBlobSegment", + className: "ServiceGetStatisticsHeaders", modelProperties: { - serviceEndpoint: { - xmlIsAttribute: true, - xmlName: "ServiceEndpoint", - required: true, - serializedName: "ServiceEndpoint", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - where: { - xmlName: "Where", - required: true, - serializedName: "Where", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - blobs: { - xmlIsWrapped: true, - xmlName: "Blobs", - xmlElementName: "Blob", - required: true, - serializedName: "Blobs", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "FilterBlobItem" - } - } + name: "String" } }, - continuationToken: { - xmlName: "NextMarker", - serializedName: "NextMarker", + date: { + serializedName: "date", + xmlName: "date", + type: { + name: "DateTimeRfc1123" + } + }, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -21527,520 +20443,610 @@ var FilterBlobSegment = { } } }; -var GeoReplication = { - serializedName: "GeoReplication", +var ServiceGetStatisticsExceptionHeaders = { + serializedName: "Service_getStatisticsExceptionHeaders", type: { name: "Composite", - className: "GeoReplication", + className: "ServiceGetStatisticsExceptionHeaders", modelProperties: { - status: { - xmlName: "Status", - required: true, - serializedName: "Status", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var ServiceListContainersSegmentHeaders = { + serializedName: "Service_listContainersSegmentHeaders", + type: { + name: "Composite", + className: "ServiceListContainersSegmentHeaders", + modelProperties: { + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", + type: { + name: "String" + } + }, + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - lastSyncOn: { - xmlName: "LastSyncTime", - required: true, - serializedName: "LastSyncTime", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "DateTimeRfc1123" + name: "String" + } + }, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" } } } } }; -var RetentionPolicy = { - serializedName: "RetentionPolicy", +var ServiceListContainersSegmentExceptionHeaders = { + serializedName: "Service_listContainersSegmentExceptionHeaders", type: { name: "Composite", - className: "RetentionPolicy", + className: "ServiceListContainersSegmentExceptionHeaders", modelProperties: { - enabled: { - xmlName: "Enabled", - required: true, - serializedName: "Enabled", - type: { - name: "Boolean" - } - }, - days: { - xmlName: "Days", - serializedName: "Days", - constraints: { - InclusiveMinimum: 1 - }, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Number" + name: "String" } } } } }; -var Logging = { - serializedName: "Logging", +var ServiceGetUserDelegationKeyHeaders = { + serializedName: "Service_getUserDelegationKeyHeaders", type: { name: "Composite", - className: "Logging", + className: "ServiceGetUserDelegationKeyHeaders", modelProperties: { - version: { - xmlName: "Version", - required: true, - serializedName: "Version", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - deleteProperty: { - xmlName: "Delete", - required: true, - serializedName: "Delete", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Boolean" + name: "String" } }, - read: { - xmlName: "Read", - required: true, - serializedName: "Read", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Boolean" + name: "String" } }, - write: { - xmlName: "Write", - required: true, - serializedName: "Write", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Boolean" + name: "DateTimeRfc1123" } }, - retentionPolicy: { - xmlName: "RetentionPolicy", - required: true, - serializedName: "RetentionPolicy", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Composite", - className: "RetentionPolicy" + name: "String" } } } } }; -var Metrics = { - serializedName: "Metrics", +var ServiceGetUserDelegationKeyExceptionHeaders = { + serializedName: "Service_getUserDelegationKeyExceptionHeaders", type: { name: "Composite", - className: "Metrics", + className: "ServiceGetUserDelegationKeyExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var ServiceGetAccountInfoHeaders = { + serializedName: "Service_getAccountInfoHeaders", + type: { + name: "Composite", + className: "ServiceGetAccountInfoHeaders", modelProperties: { + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", + type: { + name: "String" + } + }, + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", + type: { + name: "String" + } + }, version: { - xmlName: "Version", - serializedName: "Version", + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - enabled: { - xmlName: "Enabled", - required: true, - serializedName: "Enabled", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Boolean" + name: "DateTimeRfc1123" } }, - includeAPIs: { - xmlName: "IncludeAPIs", - serializedName: "IncludeAPIs", + skuName: { + serializedName: "x-ms-sku-name", + xmlName: "x-ms-sku-name", + type: { + name: "Enum", + allowedValues: [ + "Standard_LRS", + "Standard_GRS", + "Standard_RAGRS", + "Standard_ZRS", + "Premium_LRS" + ] + } + }, + accountKind: { + serializedName: "x-ms-account-kind", + xmlName: "x-ms-account-kind", + type: { + name: "Enum", + allowedValues: [ + "Storage", + "BlobStorage", + "StorageV2", + "FileStorage", + "BlockBlobStorage" + ] + } + }, + isHierarchicalNamespaceEnabled: { + serializedName: "x-ms-is-hns-enabled", + xmlName: "x-ms-is-hns-enabled", type: { name: "Boolean" } }, - retentionPolicy: { - xmlName: "RetentionPolicy", - serializedName: "RetentionPolicy", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Composite", - className: "RetentionPolicy" + name: "String" } } } } }; -var PageRange = { - serializedName: "PageRange", +var ServiceGetAccountInfoExceptionHeaders = { + serializedName: "Service_getAccountInfoExceptionHeaders", type: { name: "Composite", - className: "PageRange", + className: "ServiceGetAccountInfoExceptionHeaders", modelProperties: { - start: { - xmlName: "Start", - required: true, - serializedName: "Start", - type: { - name: "Number" - } - }, - end: { - xmlName: "End", - required: true, - serializedName: "End", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Number" + name: "String" } } } } }; -var ClearRange = { - serializedName: "ClearRange", +var ServiceSubmitBatchHeaders = { + serializedName: "Service_submitBatchHeaders", type: { name: "Composite", - className: "ClearRange", + className: "ServiceSubmitBatchHeaders", modelProperties: { - start: { - xmlName: "Start", - required: true, - serializedName: "Start", + contentType: { + serializedName: "content-type", + xmlName: "content-type", type: { - name: "Number" + name: "String" } }, - end: { - xmlName: "End", - required: true, - serializedName: "End", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Number" + name: "String" + } + }, + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", + type: { + name: "String" + } + }, + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", + type: { + name: "String" + } + }, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" } } } } }; -var PageList = { - serializedName: "PageList", +var ServiceSubmitBatchExceptionHeaders = { + serializedName: "Service_submitBatchExceptionHeaders", type: { name: "Composite", - className: "PageList", + className: "ServiceSubmitBatchExceptionHeaders", modelProperties: { - pageRange: { - xmlName: "PageRange", - xmlElementName: "PageRange", - serializedName: "PageRange", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PageRange" - } - } - } - }, - clearRange: { - xmlName: "ClearRange", - xmlElementName: "ClearRange", - serializedName: "ClearRange", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ClearRange" - } - } + name: "String" } } } } }; -var QueryFormat = { - serializedName: "QueryFormat", +var ServiceFilterBlobsHeaders = { + serializedName: "Service_filterBlobsHeaders", type: { name: "Composite", - className: "QueryFormat", + className: "ServiceFilterBlobsHeaders", modelProperties: { - type: { - xmlName: "Type", - serializedName: "Type", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { - name: "Enum", - allowedValues: [ - "delimited", - "json", - "arrow" - ] + name: "String" } }, - delimitedTextConfiguration: { - xmlName: "DelimitedTextConfiguration", - serializedName: "DelimitedTextConfiguration", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Composite", - className: "DelimitedTextConfiguration" + name: "String" } }, - jsonTextConfiguration: { - xmlName: "JsonTextConfiguration", - serializedName: "JsonTextConfiguration", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Composite", - className: "JsonTextConfiguration" + name: "String" } }, - arrowConfiguration: { - xmlName: "ArrowConfiguration", - serializedName: "ArrowConfiguration", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Composite", - className: "ArrowConfiguration" + name: "DateTimeRfc1123" + } + }, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" } } } } }; -var QuerySerialization = { - serializedName: "QuerySerialization", +var ServiceFilterBlobsExceptionHeaders = { + serializedName: "Service_filterBlobsExceptionHeaders", type: { name: "Composite", - className: "QuerySerialization", + className: "ServiceFilterBlobsExceptionHeaders", modelProperties: { - format: { - xmlName: "Format", - required: true, - serializedName: "Format", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Composite", - className: "QueryFormat" + name: "String" } } } } }; -var QueryRequest = { - serializedName: "QueryRequest", +var ContainerCreateHeaders = { + serializedName: "Container_createHeaders", type: { name: "Composite", - className: "QueryRequest", + className: "ContainerCreateHeaders", modelProperties: { - queryType: { - xmlName: "QueryType", - required: true, - isConstant: true, - serializedName: "QueryType", - defaultValue: 'SQL', + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - expression: { - xmlName: "Expression", - required: true, - serializedName: "Expression", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", + type: { + name: "DateTimeRfc1123" + } + }, + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - inputSerialization: { - xmlName: "InputSerialization", - serializedName: "InputSerialization", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Composite", - className: "QuerySerialization" + name: "String" } }, - outputSerialization: { - xmlName: "OutputSerialization", - serializedName: "OutputSerialization", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Composite", - className: "QuerySerialization" + name: "String" + } + }, + date: { + serializedName: "date", + xmlName: "date", + type: { + name: "DateTimeRfc1123" + } + }, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" } } } } }; -var SignedIdentifier = { - serializedName: "SignedIdentifier", +var ContainerCreateExceptionHeaders = { + serializedName: "Container_createExceptionHeaders", type: { name: "Composite", - className: "SignedIdentifier", + className: "ContainerCreateExceptionHeaders", modelProperties: { - id: { - xmlName: "Id", - required: true, - serializedName: "Id", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, - accessPolicy: { - xmlName: "AccessPolicy", - required: true, - serializedName: "AccessPolicy", - type: { - name: "Composite", - className: "AccessPolicy" - } } } } }; -var StaticWebsite = { - serializedName: "StaticWebsite", +var ContainerGetPropertiesHeaders = { + serializedName: "Container_getPropertiesHeaders", type: { name: "Composite", - className: "StaticWebsite", + className: "ContainerGetPropertiesHeaders", modelProperties: { - enabled: { - xmlName: "Enabled", - required: true, - serializedName: "Enabled", + metadata: { + serializedName: "x-ms-meta", + xmlName: "x-ms-meta", type: { - name: "Boolean" + name: "Dictionary", + value: { type: { name: "String" } } + }, + headerCollectionPrefix: "x-ms-meta-" + }, + etag: { + serializedName: "etag", + xmlName: "etag", + type: { + name: "String" } }, - indexDocument: { - xmlName: "IndexDocument", - serializedName: "IndexDocument", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", + type: { + name: "DateTimeRfc1123" + } + }, + leaseDuration: { + serializedName: "x-ms-lease-duration", + xmlName: "x-ms-lease-duration", + type: { + name: "Enum", + allowedValues: ["infinite", "fixed"] + } + }, + leaseState: { + serializedName: "x-ms-lease-state", + xmlName: "x-ms-lease-state", + type: { + name: "Enum", + allowedValues: [ + "available", + "leased", + "expired", + "breaking", + "broken" + ] + } + }, + leaseStatus: { + serializedName: "x-ms-lease-status", + xmlName: "x-ms-lease-status", + type: { + name: "Enum", + allowedValues: ["locked", "unlocked"] + } + }, + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - errorDocument404Path: { - xmlName: "ErrorDocument404Path", - serializedName: "ErrorDocument404Path", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - defaultIndexDocumentPath: { - xmlName: "DefaultIndexDocumentPath", - serializedName: "DefaultIndexDocumentPath", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } - } - } - } -}; -var BlobServiceProperties = { - xmlName: "StorageServiceProperties", - serializedName: "BlobServiceProperties", - type: { - name: "Composite", - className: "BlobServiceProperties", - modelProperties: { - blobAnalyticsLogging: { - xmlName: "Logging", - serializedName: "Logging", + }, + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Composite", - className: "Logging" + name: "DateTimeRfc1123" } }, - hourMetrics: { - xmlName: "HourMetrics", - serializedName: "HourMetrics", + blobPublicAccess: { + serializedName: "x-ms-blob-public-access", + xmlName: "x-ms-blob-public-access", type: { - name: "Composite", - className: "Metrics" + name: "Enum", + allowedValues: ["container", "blob"] } }, - minuteMetrics: { - xmlName: "MinuteMetrics", - serializedName: "MinuteMetrics", + hasImmutabilityPolicy: { + serializedName: "x-ms-has-immutability-policy", + xmlName: "x-ms-has-immutability-policy", type: { - name: "Composite", - className: "Metrics" + name: "Boolean" } }, - cors: { - xmlIsWrapped: true, - xmlName: "Cors", - xmlElementName: "CorsRule", - serializedName: "Cors", + hasLegalHold: { + serializedName: "x-ms-has-legal-hold", + xmlName: "x-ms-has-legal-hold", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "CorsRule" - } - } + name: "Boolean" } }, - defaultServiceVersion: { - xmlName: "DefaultServiceVersion", - serializedName: "DefaultServiceVersion", + defaultEncryptionScope: { + serializedName: "x-ms-default-encryption-scope", + xmlName: "x-ms-default-encryption-scope", type: { name: "String" } }, - deleteRetentionPolicy: { - xmlName: "DeleteRetentionPolicy", - serializedName: "DeleteRetentionPolicy", + denyEncryptionScopeOverride: { + serializedName: "x-ms-deny-encryption-scope-override", + xmlName: "x-ms-deny-encryption-scope-override", type: { - name: "Composite", - className: "RetentionPolicy" + name: "Boolean" } }, - staticWebsite: { - xmlName: "StaticWebsite", - serializedName: "StaticWebsite", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Composite", - className: "StaticWebsite" + name: "String" } } } } }; -var BlobServiceStatistics = { - xmlName: "StorageServiceStats", - serializedName: "BlobServiceStatistics", +var ContainerGetPropertiesExceptionHeaders = { + serializedName: "Container_getPropertiesExceptionHeaders", type: { name: "Composite", - className: "BlobServiceStatistics", + className: "ContainerGetPropertiesExceptionHeaders", modelProperties: { - geoReplication: { - xmlName: "GeoReplication", - serializedName: "GeoReplication", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Composite", - className: "GeoReplication" + name: "String" } } } } }; -var ServiceSetPropertiesHeaders = { - serializedName: "service-setproperties-headers", +var ContainerDeleteHeaders = { + serializedName: "Container_deleteHeaders", type: { name: "Composite", - className: "ServiceSetPropertiesHeaders", + className: "ContainerDeleteHeaders", modelProperties: { clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, + date: { + serializedName: "date", + xmlName: "date", + type: { + name: "DateTimeRfc1123" + } + }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -22048,32 +21054,15 @@ var ServiceSetPropertiesHeaders = { } } }; -var ServiceGetPropertiesHeaders = { - serializedName: "service-getproperties-headers", +var ContainerDeleteExceptionHeaders = { + serializedName: "Container_deleteExceptionHeaders", type: { name: "Composite", - className: "ServiceGetPropertiesHeaders", + className: "ContainerDeleteExceptionHeaders", modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - type: { - name: "String" - } - }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -22081,38 +21070,57 @@ var ServiceGetPropertiesHeaders = { } } }; -var ServiceGetStatisticsHeaders = { - serializedName: "service-getstatistics-headers", +var ContainerSetMetadataHeaders = { + serializedName: "Container_setMetadataHeaders", type: { name: "Composite", - className: "ServiceGetStatisticsHeaders", + className: "ContainerSetMetadataHeaders", modelProperties: { + etag: { + serializedName: "etag", + xmlName: "etag", + type: { + name: "String" + } + }, + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", + type: { + name: "DateTimeRfc1123" + } + }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -22120,32 +21128,15 @@ var ServiceGetStatisticsHeaders = { } } }; -var ServiceListContainersSegmentHeaders = { - serializedName: "service-listcontainerssegment-headers", +var ContainerSetMetadataExceptionHeaders = { + serializedName: "Container_setMetadataExceptionHeaders", type: { name: "Composite", - className: "ServiceListContainersSegmentHeaders", + className: "ContainerSetMetadataExceptionHeaders", modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - type: { - name: "String" - } - }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -22153,38 +21144,65 @@ var ServiceListContainersSegmentHeaders = { } } }; -var ServiceGetUserDelegationKeyHeaders = { - serializedName: "service-getuserdelegationkey-headers", +var ContainerGetAccessPolicyHeaders = { + serializedName: "Container_getAccessPolicyHeaders", type: { name: "Composite", - className: "ServiceGetUserDelegationKeyHeaders", + className: "ContainerGetAccessPolicyHeaders", modelProperties: { + blobPublicAccess: { + serializedName: "x-ms-blob-public-access", + xmlName: "x-ms-blob-public-access", + type: { + name: "Enum", + allowedValues: ["container", "blob"] + } + }, + etag: { + serializedName: "etag", + xmlName: "etag", + type: { + name: "String" + } + }, + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", + type: { + name: "DateTimeRfc1123" + } + }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -22192,70 +21210,89 @@ var ServiceGetUserDelegationKeyHeaders = { } } }; -var ServiceGetAccountInfoHeaders = { - serializedName: "service-getaccountinfo-headers", +var ContainerGetAccessPolicyExceptionHeaders = { + serializedName: "Container_getAccessPolicyExceptionHeaders", type: { name: "Composite", - className: "ServiceGetAccountInfoHeaders", + className: "ContainerGetAccessPolicyExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var ContainerSetAccessPolicyHeaders = { + serializedName: "Container_setAccessPolicyHeaders", + type: { + name: "Composite", + className: "ContainerSetAccessPolicyHeaders", modelProperties: { + etag: { + serializedName: "etag", + xmlName: "etag", + type: { + name: "String" + } + }, + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", + type: { + name: "DateTimeRfc1123" + } + }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, - skuName: { - serializedName: "x-ms-sku-name", - type: { - name: "Enum", - allowedValues: [ - "Standard_LRS", - "Standard_GRS", - "Standard_RAGRS", - "Standard_ZRS", - "Premium_LRS" - ] - } - }, - accountKind: { - serializedName: "x-ms-account-kind", - type: { - name: "Enum", - allowedValues: [ - "Storage", - "BlobStorage", - "StorageV2", - "FileStorage", - "BlockBlobStorage" - ] - } - }, - isHierarchicalNamespaceEnabled: { - serializedName: "x-ms-is-hns-enabled", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Boolean" + name: "String" } - }, + } + } + } +}; +var ContainerSetAccessPolicyExceptionHeaders = { + serializedName: "Container_setAccessPolicyExceptionHeaders", + type: { + name: "Composite", + className: "ContainerSetAccessPolicyExceptionHeaders", + modelProperties: { errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -22263,38 +21300,43 @@ var ServiceGetAccountInfoHeaders = { } } }; -var ServiceSubmitBatchHeaders = { - serializedName: "service-submitbatch-headers", +var ContainerRestoreHeaders = { + serializedName: "Container_restoreHeaders", type: { name: "Composite", - className: "ServiceSubmitBatchHeaders", + className: "ContainerRestoreHeaders", modelProperties: { - contentType: { - serializedName: "content-type", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - clientRequestId: { - serializedName: "x-ms-client-request-id", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "String" + name: "DateTimeRfc1123" } }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -22302,38 +21344,59 @@ var ServiceSubmitBatchHeaders = { } } }; -var ServiceFilterBlobsHeaders = { - serializedName: "service-filterblobs-headers", +var ContainerRestoreExceptionHeaders = { + serializedName: "Container_restoreExceptionHeaders", type: { name: "Composite", - className: "ServiceFilterBlobsHeaders", + className: "ContainerRestoreExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var ContainerRenameHeaders = { + serializedName: "Container_renameHeaders", + type: { + name: "Composite", + className: "ContainerRenameHeaders", modelProperties: { clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -22341,50 +21404,61 @@ var ServiceFilterBlobsHeaders = { } } }; -var ContainerCreateHeaders = { - serializedName: "container-create-headers", +var ContainerRenameExceptionHeaders = { + serializedName: "Container_renameExceptionHeaders", type: { name: "Composite", - className: "ContainerCreateHeaders", + className: "ContainerRenameExceptionHeaders", modelProperties: { - etag: { - serializedName: "etag", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, - lastModified: { - serializedName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", + } + } + } +}; +var ContainerSubmitBatchHeaders = { + serializedName: "Container_submitBatchHeaders", + type: { + name: "Composite", + className: "ContainerSubmitBatchHeaders", + modelProperties: { + contentType: { + serializedName: "content-type", + xmlName: "content-type", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } - }, - date: { - serializedName: "date", - type: { - name: "DateTimeRfc1123" - } - }, + } + } + } +}; +var ContainerSubmitBatchExceptionHeaders = { + serializedName: "Container_submitBatchExceptionHeaders", + type: { + name: "Composite", + className: "ContainerSubmitBatchExceptionHeaders", + modelProperties: { errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -22392,125 +21466,73 @@ var ContainerCreateHeaders = { } } }; -var ContainerGetPropertiesHeaders = { - serializedName: "container-getproperties-headers", +var ContainerAcquireLeaseHeaders = { + serializedName: "Container_acquireLeaseHeaders", type: { name: "Composite", - className: "ContainerGetPropertiesHeaders", + className: "ContainerAcquireLeaseHeaders", modelProperties: { - metadata: { - serializedName: "x-ms-meta", - type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } - }, - headerCollectionPrefix: "x-ms-meta-" - }, etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, - leaseDuration: { - serializedName: "x-ms-lease-duration", - type: { - name: "Enum", - allowedValues: [ - "infinite", - "fixed" - ] - } - }, - leaseState: { - serializedName: "x-ms-lease-state", - type: { - name: "Enum", - allowedValues: [ - "available", - "leased", - "expired", - "breaking", - "broken" - ] - } - }, - leaseStatus: { - serializedName: "x-ms-lease-status", + leaseId: { + serializedName: "x-ms-lease-id", + xmlName: "x-ms-lease-id", type: { - name: "Enum", - allowedValues: [ - "locked", - "unlocked" - ] + name: "String" } }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } - }, - blobPublicAccess: { - serializedName: "x-ms-blob-public-access", - type: { - name: "String" - } - }, - hasImmutabilityPolicy: { - serializedName: "x-ms-has-immutability-policy", - type: { - name: "Boolean" - } - }, - hasLegalHold: { - serializedName: "x-ms-has-legal-hold", - type: { - name: "Boolean" - } - }, - defaultEncryptionScope: { - serializedName: "x-ms-default-encryption-scope", - type: { - name: "String" - } - }, - denyEncryptionScopeOverride: { - serializedName: "x-ms-deny-encryption-scope-override", - type: { - name: "Boolean" - } - }, + } + } + } +}; +var ContainerAcquireLeaseExceptionHeaders = { + serializedName: "Container_acquireLeaseExceptionHeaders", + type: { + name: "Composite", + className: "ContainerAcquireLeaseExceptionHeaders", + modelProperties: { errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -22518,38 +21540,66 @@ var ContainerGetPropertiesHeaders = { } } }; -var ContainerDeleteHeaders = { - serializedName: "container-delete-headers", +var ContainerReleaseLeaseHeaders = { + serializedName: "Container_releaseLeaseHeaders", type: { name: "Composite", - className: "ContainerDeleteHeaders", + className: "ContainerReleaseLeaseHeaders", modelProperties: { + etag: { + serializedName: "etag", + xmlName: "etag", + type: { + name: "String" + } + }, + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", + type: { + name: "DateTimeRfc1123" + } + }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } - }, + } + } + } +}; +var ContainerReleaseLeaseExceptionHeaders = { + serializedName: "Container_releaseLeaseExceptionHeaders", + type: { + name: "Composite", + className: "ContainerReleaseLeaseExceptionHeaders", + modelProperties: { errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -22557,50 +21607,73 @@ var ContainerDeleteHeaders = { } } }; -var ContainerSetMetadataHeaders = { - serializedName: "container-setmetadata-headers", +var ContainerRenewLeaseHeaders = { + serializedName: "Container_renewLeaseHeaders", type: { name: "Composite", - className: "ContainerSetMetadataHeaders", + className: "ContainerRenewLeaseHeaders", modelProperties: { etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, + leaseId: { + serializedName: "x-ms-lease-id", + xmlName: "x-ms-lease-id", + type: { + name: "String" + } + }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } - }, + } + } + } +}; +var ContainerRenewLeaseExceptionHeaders = { + serializedName: "Container_renewLeaseExceptionHeaders", + type: { + name: "Composite", + className: "ContainerRenewLeaseExceptionHeaders", + modelProperties: { errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -22608,56 +21681,73 @@ var ContainerSetMetadataHeaders = { } } }; -var ContainerGetAccessPolicyHeaders = { - serializedName: "container-getaccesspolicy-headers", +var ContainerBreakLeaseHeaders = { + serializedName: "Container_breakLeaseHeaders", type: { name: "Composite", - className: "ContainerGetAccessPolicyHeaders", + className: "ContainerBreakLeaseHeaders", modelProperties: { - blobPublicAccess: { - serializedName: "x-ms-blob-public-access", - type: { - name: "String" - } - }, etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, + leaseTime: { + serializedName: "x-ms-lease-time", + xmlName: "x-ms-lease-time", + type: { + name: "Number" + } + }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } - }, + } + } + } +}; +var ContainerBreakLeaseExceptionHeaders = { + serializedName: "Container_breakLeaseExceptionHeaders", + type: { + name: "Composite", + className: "ContainerBreakLeaseExceptionHeaders", + modelProperties: { errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -22665,50 +21755,73 @@ var ContainerGetAccessPolicyHeaders = { } } }; -var ContainerSetAccessPolicyHeaders = { - serializedName: "container-setaccesspolicy-headers", +var ContainerChangeLeaseHeaders = { + serializedName: "Container_changeLeaseHeaders", type: { name: "Composite", - className: "ContainerSetAccessPolicyHeaders", + className: "ContainerChangeLeaseHeaders", modelProperties: { etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, + leaseId: { + serializedName: "x-ms-lease-id", + xmlName: "x-ms-lease-id", + type: { + name: "String" + } + }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } - }, + } + } + } +}; +var ContainerChangeLeaseExceptionHeaders = { + serializedName: "Container_changeLeaseExceptionHeaders", + type: { + name: "Composite", + className: "ContainerChangeLeaseExceptionHeaders", + modelProperties: { errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -22716,38 +21829,50 @@ var ContainerSetAccessPolicyHeaders = { } } }; -var ContainerRestoreHeaders = { - serializedName: "container-restore-headers", +var ContainerListBlobFlatSegmentHeaders = { + serializedName: "Container_listBlobFlatSegmentHeaders", type: { name: "Composite", - className: "ContainerRestoreHeaders", + className: "ContainerListBlobFlatSegmentHeaders", modelProperties: { + contentType: { + serializedName: "content-type", + xmlName: "content-type", + type: { + name: "String" + } + }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -22755,38 +21880,66 @@ var ContainerRestoreHeaders = { } } }; -var ContainerRenameHeaders = { - serializedName: "container-rename-headers", +var ContainerListBlobFlatSegmentExceptionHeaders = { + serializedName: "Container_listBlobFlatSegmentExceptionHeaders", type: { name: "Composite", - className: "ContainerRenameHeaders", + className: "ContainerListBlobFlatSegmentExceptionHeaders", modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var ContainerListBlobHierarchySegmentHeaders = { + serializedName: "Container_listBlobHierarchySegmentHeaders", + type: { + name: "Composite", + className: "ContainerListBlobHierarchySegmentHeaders", + modelProperties: { + contentType: { + serializedName: "content-type", + xmlName: "content-type", + type: { + name: "String" + } + }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -22794,32 +21947,15 @@ var ContainerRenameHeaders = { } } }; -var ContainerSubmitBatchHeaders = { - serializedName: "container-submitbatch-headers", +var ContainerListBlobHierarchySegmentExceptionHeaders = { + serializedName: "Container_listBlobHierarchySegmentExceptionHeaders", type: { name: "Composite", - className: "ContainerSubmitBatchHeaders", + className: "ContainerListBlobHierarchySegmentExceptionHeaders", modelProperties: { - contentType: { - serializedName: "content-type", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - type: { - name: "String" - } - }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -22827,56 +21963,80 @@ var ContainerSubmitBatchHeaders = { } } }; -var ContainerAcquireLeaseHeaders = { - serializedName: "container-acquirelease-headers", +var ContainerGetAccountInfoHeaders = { + serializedName: "Container_getAccountInfoHeaders", type: { name: "Composite", - className: "ContainerAcquireLeaseHeaders", + className: "ContainerGetAccountInfoHeaders", modelProperties: { - etag: { - serializedName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - leaseId: { - serializedName: "x-ms-lease-id", - type: { - name: "String" - } - }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, + skuName: { + serializedName: "x-ms-sku-name", + xmlName: "x-ms-sku-name", + type: { + name: "Enum", + allowedValues: [ + "Standard_LRS", + "Standard_GRS", + "Standard_RAGRS", + "Standard_ZRS", + "Premium_LRS" + ] + } + }, + accountKind: { + serializedName: "x-ms-account-kind", + xmlName: "x-ms-account-kind", + type: { + name: "Enum", + allowedValues: [ + "Storage", + "BlobStorage", + "StorageV2", + "FileStorage", + "BlockBlobStorage" + ] + } + } + } + } +}; +var ContainerGetAccountInfoExceptionHeaders = { + serializedName: "Container_getAccountInfoExceptionHeaders", + type: { + name: "Composite", + className: "ContainerGetAccountInfoExceptionHeaders", + modelProperties: { errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -22884,50 +22044,87 @@ var ContainerAcquireLeaseHeaders = { } } }; -var ContainerReleaseLeaseHeaders = { - serializedName: "container-releaselease-headers", +var DirectoryCreateHeaders = { + serializedName: "Directory_createHeaders", type: { name: "Composite", - className: "ContainerReleaseLeaseHeaders", + className: "DirectoryCreateHeaders", modelProperties: { etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, + contentLength: { + serializedName: "content-length", + xmlName: "content-length", + type: { + name: "Number" + } + }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } + } + } + } +}; +var DirectoryCreateExceptionHeaders = { + serializedName: "Directory_createExceptionHeaders", + type: { + name: "Composite", + className: "DirectoryCreateExceptionHeaders", + modelProperties: { + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", + type: { + name: "String" + } }, - errorCode: { - serializedName: "x-ms-error-code", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", + type: { + name: "String" + } + }, + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } @@ -22935,113 +22132,168 @@ var ContainerReleaseLeaseHeaders = { } } }; -var ContainerRenewLeaseHeaders = { - serializedName: "container-renewlease-headers", +var DirectoryRenameHeaders = { + serializedName: "Directory_renameHeaders", type: { name: "Composite", - className: "ContainerRenewLeaseHeaders", + className: "DirectoryRenameHeaders", modelProperties: { + marker: { + serializedName: "x-ms-continuation", + xmlName: "x-ms-continuation", + type: { + name: "String" + } + }, etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, - leaseId: { - serializedName: "x-ms-lease-id", - type: { - name: "String" - } - }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - date: { - serializedName: "date", + contentLength: { + serializedName: "content-length", + xmlName: "content-length", type: { - name: "DateTimeRfc1123" + name: "Number" } }, - errorCode: { - serializedName: "x-ms-error-code", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "String" + name: "DateTimeRfc1123" } } } } }; -var ContainerBreakLeaseHeaders = { - serializedName: "container-breaklease-headers", +var DirectoryRenameExceptionHeaders = { + serializedName: "Directory_renameExceptionHeaders", type: { name: "Composite", - className: "ContainerBreakLeaseHeaders", + className: "DirectoryRenameExceptionHeaders", modelProperties: { - etag: { - serializedName: "etag", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - lastModified: { - serializedName: "last-modified", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "DateTimeRfc1123" + name: "String" } }, - leaseTime: { - serializedName: "x-ms-lease-time", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Number" + name: "String" + } + } + } + } +}; +var DirectoryDeleteHeaders = { + serializedName: "Directory_deleteHeaders", + type: { + name: "Composite", + className: "DirectoryDeleteHeaders", + modelProperties: { + marker: { + serializedName: "x-ms-continuation", + xmlName: "x-ms-continuation", + type: { + name: "String" } }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } + } + } + } +}; +var DirectoryDeleteExceptionHeaders = { + serializedName: "Directory_deleteExceptionHeaders", + type: { + name: "Composite", + className: "DirectoryDeleteExceptionHeaders", + modelProperties: { + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", + type: { + name: "String" + } }, - errorCode: { - serializedName: "x-ms-error-code", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", + type: { + name: "String" + } + }, + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } @@ -23049,56 +22301,43 @@ var ContainerBreakLeaseHeaders = { } } }; -var ContainerChangeLeaseHeaders = { - serializedName: "container-changelease-headers", +var DirectorySetAccessControlHeaders = { + serializedName: "Directory_setAccessControlHeaders", type: { name: "Composite", - className: "ContainerChangeLeaseHeaders", + className: "DirectorySetAccessControlHeaders", modelProperties: { + date: { + serializedName: "date", + xmlName: "date", + type: { + name: "DateTimeRfc1123" + } + }, etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, - leaseId: { - serializedName: "x-ms-lease-id", - type: { - name: "String" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - type: { - name: "String" - } - }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - errorCode: { - serializedName: "x-ms-error-code", + xmlName: "x-ms-version", type: { name: "String" } @@ -23106,89 +22345,101 @@ var ContainerChangeLeaseHeaders = { } } }; -var ContainerListBlobFlatSegmentHeaders = { - serializedName: "container-listblobflatsegment-headers", +var DirectorySetAccessControlExceptionHeaders = { + serializedName: "Directory_setAccessControlExceptionHeaders", type: { name: "Composite", - className: "ContainerListBlobFlatSegmentHeaders", + className: "DirectorySetAccessControlExceptionHeaders", modelProperties: { - contentType: { - serializedName: "content-type", - type: { - name: "String" - } - }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } - }, + } + } + } +}; +var DirectoryGetAccessControlHeaders = { + serializedName: "Directory_getAccessControlHeaders", + type: { + name: "Composite", + className: "DirectoryGetAccessControlHeaders", + modelProperties: { date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, - errorCode: { - serializedName: "x-ms-error-code", + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } - } - } - } -}; -var ContainerListBlobHierarchySegmentHeaders = { - serializedName: "container-listblobhierarchysegment-headers", - type: { - name: "Composite", - className: "ContainerListBlobHierarchySegmentHeaders", - modelProperties: { - contentType: { - serializedName: "content-type", + }, + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", + type: { + name: "DateTimeRfc1123" + } + }, + xMsOwner: { + serializedName: "x-ms-owner", + xmlName: "x-ms-owner", type: { name: "String" } }, - clientRequestId: { - serializedName: "x-ms-client-request-id", + xMsGroup: { + serializedName: "x-ms-group", + xmlName: "x-ms-group", type: { name: "String" } }, - requestId: { - serializedName: "x-ms-request-id", + xMsPermissions: { + serializedName: "x-ms-permissions", + xmlName: "x-ms-permissions", type: { name: "String" } }, - version: { - serializedName: "x-ms-version", + xMsAcl: { + serializedName: "x-ms-acl", + xmlName: "x-ms-acl", type: { name: "String" } }, - date: { - serializedName: "date", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "DateTimeRfc1123" + name: "String" } }, - errorCode: { - serializedName: "x-ms-error-code", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } @@ -23196,64 +22447,29 @@ var ContainerListBlobHierarchySegmentHeaders = { } } }; -var ContainerGetAccountInfoHeaders = { - serializedName: "container-getaccountinfo-headers", +var DirectoryGetAccessControlExceptionHeaders = { + serializedName: "Directory_getAccessControlExceptionHeaders", type: { name: "Composite", - className: "ContainerGetAccountInfoHeaders", + className: "DirectoryGetAccessControlExceptionHeaders", modelProperties: { clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - skuName: { - serializedName: "x-ms-sku-name", - type: { - name: "Enum", - allowedValues: [ - "Standard_LRS", - "Standard_GRS", - "Standard_RAGRS", - "Standard_ZRS", - "Premium_LRS" - ] - } - }, - accountKind: { - serializedName: "x-ms-account-kind", - type: { - name: "Enum", - allowedValues: [ - "Storage", - "BlobStorage", - "StorageV2", - "FileStorage", - "BlockBlobStorage" - ] - } - }, - errorCode: { - serializedName: "x-ms-error-code", + xmlName: "x-ms-version", type: { name: "String" } @@ -23262,172 +22478,175 @@ var ContainerGetAccountInfoHeaders = { } }; var BlobDownloadHeaders = { - serializedName: "blob-download-headers", + serializedName: "Blob_downloadHeaders", type: { name: "Composite", className: "BlobDownloadHeaders", modelProperties: { lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, metadata: { serializedName: "x-ms-meta", + xmlName: "x-ms-meta", type: { name: "Dictionary", - value: { - type: { - name: "String" - } - } + value: { type: { name: "String" } } }, headerCollectionPrefix: "x-ms-meta-" }, objectReplicationPolicyId: { serializedName: "x-ms-or-policy-id", + xmlName: "x-ms-or-policy-id", type: { name: "String" } }, objectReplicationRules: { serializedName: "x-ms-or", + xmlName: "x-ms-or", type: { name: "Dictionary", - value: { - type: { - name: "String" - } - } + value: { type: { name: "String" } } }, headerCollectionPrefix: "x-ms-or-" }, contentLength: { serializedName: "content-length", + xmlName: "content-length", type: { name: "Number" } }, contentType: { serializedName: "content-type", + xmlName: "content-type", type: { name: "String" } }, contentRange: { serializedName: "content-range", + xmlName: "content-range", type: { name: "String" } }, etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, contentMD5: { serializedName: "content-md5", + xmlName: "content-md5", type: { name: "ByteArray" } }, contentEncoding: { serializedName: "content-encoding", + xmlName: "content-encoding", type: { name: "String" } }, cacheControl: { serializedName: "cache-control", + xmlName: "cache-control", type: { name: "String" } }, contentDisposition: { serializedName: "content-disposition", + xmlName: "content-disposition", type: { name: "String" } }, contentLanguage: { serializedName: "content-language", + xmlName: "content-language", type: { name: "String" } }, blobSequenceNumber: { serializedName: "x-ms-blob-sequence-number", + xmlName: "x-ms-blob-sequence-number", type: { name: "Number" } }, blobType: { serializedName: "x-ms-blob-type", + xmlName: "x-ms-blob-type", type: { name: "Enum", - allowedValues: [ - "BlockBlob", - "PageBlob", - "AppendBlob" - ] + allowedValues: ["BlockBlob", "PageBlob", "AppendBlob"] } }, copyCompletedOn: { serializedName: "x-ms-copy-completion-time", + xmlName: "x-ms-copy-completion-time", type: { name: "DateTimeRfc1123" } }, copyStatusDescription: { serializedName: "x-ms-copy-status-description", + xmlName: "x-ms-copy-status-description", type: { name: "String" } }, copyId: { serializedName: "x-ms-copy-id", + xmlName: "x-ms-copy-id", type: { name: "String" } }, copyProgress: { serializedName: "x-ms-copy-progress", + xmlName: "x-ms-copy-progress", type: { name: "String" } }, copySource: { serializedName: "x-ms-copy-source", + xmlName: "x-ms-copy-source", type: { name: "String" } }, copyStatus: { serializedName: "x-ms-copy-status", + xmlName: "x-ms-copy-status", type: { name: "Enum", - allowedValues: [ - "pending", - "success", - "aborted", - "failed" - ] + allowedValues: ["pending", "success", "aborted", "failed"] } }, leaseDuration: { serializedName: "x-ms-lease-duration", + xmlName: "x-ms-lease-duration", type: { name: "Enum", - allowedValues: [ - "infinite", - "fixed" - ] + allowedValues: ["infinite", "fixed"] } }, leaseState: { serializedName: "x-ms-lease-state", + xmlName: "x-ms-lease-state", type: { name: "Enum", allowedValues: [ @@ -23441,112 +22660,143 @@ var BlobDownloadHeaders = { }, leaseStatus: { serializedName: "x-ms-lease-status", + xmlName: "x-ms-lease-status", type: { name: "Enum", - allowedValues: [ - "locked", - "unlocked" - ] + allowedValues: ["locked", "unlocked"] } }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, versionId: { serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", type: { name: "String" } }, isCurrentVersion: { serializedName: "x-ms-is-current-version", + xmlName: "x-ms-is-current-version", type: { name: "Boolean" } }, acceptRanges: { serializedName: "accept-ranges", + xmlName: "accept-ranges", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, blobCommittedBlockCount: { serializedName: "x-ms-blob-committed-block-count", + xmlName: "x-ms-blob-committed-block-count", type: { name: "Number" } }, isServerEncrypted: { serializedName: "x-ms-server-encrypted", + xmlName: "x-ms-server-encrypted", type: { name: "Boolean" } }, encryptionKeySha256: { serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { name: "String" } }, encryptionScope: { serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { name: "String" } }, blobContentMD5: { serializedName: "x-ms-blob-content-md5", + xmlName: "x-ms-blob-content-md5", type: { name: "ByteArray" } }, tagCount: { serializedName: "x-ms-tag-count", + xmlName: "x-ms-tag-count", type: { name: "Number" } }, isSealed: { serializedName: "x-ms-blob-sealed", + xmlName: "x-ms-blob-sealed", type: { name: "Boolean" } }, lastAccessed: { serializedName: "x-ms-last-access-time", + xmlName: "x-ms-last-access-time", type: { name: "DateTimeRfc1123" } }, contentCrc64: { serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { name: "ByteArray" } }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var BlobDownloadExceptionHeaders = { + serializedName: "Blob_downloadExceptionHeaders", + type: { + name: "Composite", + className: "BlobDownloadExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -23555,130 +22805,126 @@ var BlobDownloadHeaders = { } }; var BlobGetPropertiesHeaders = { - serializedName: "blob-getproperties-headers", + serializedName: "Blob_getPropertiesHeaders", type: { name: "Composite", className: "BlobGetPropertiesHeaders", modelProperties: { lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, createdOn: { serializedName: "x-ms-creation-time", + xmlName: "x-ms-creation-time", type: { name: "DateTimeRfc1123" } }, metadata: { serializedName: "x-ms-meta", + xmlName: "x-ms-meta", type: { name: "Dictionary", - value: { - type: { - name: "String" - } - } + value: { type: { name: "String" } } }, headerCollectionPrefix: "x-ms-meta-" }, objectReplicationPolicyId: { serializedName: "x-ms-or-policy-id", + xmlName: "x-ms-or-policy-id", type: { name: "String" } }, objectReplicationRules: { serializedName: "x-ms-or", + xmlName: "x-ms-or", type: { name: "Dictionary", - value: { - type: { - name: "String" - } - } + value: { type: { name: "String" } } }, headerCollectionPrefix: "x-ms-or-" }, blobType: { serializedName: "x-ms-blob-type", + xmlName: "x-ms-blob-type", type: { name: "Enum", - allowedValues: [ - "BlockBlob", - "PageBlob", - "AppendBlob" - ] + allowedValues: ["BlockBlob", "PageBlob", "AppendBlob"] } }, copyCompletedOn: { serializedName: "x-ms-copy-completion-time", + xmlName: "x-ms-copy-completion-time", type: { name: "DateTimeRfc1123" } }, copyStatusDescription: { serializedName: "x-ms-copy-status-description", + xmlName: "x-ms-copy-status-description", type: { name: "String" } }, copyId: { serializedName: "x-ms-copy-id", + xmlName: "x-ms-copy-id", type: { name: "String" } }, copyProgress: { serializedName: "x-ms-copy-progress", + xmlName: "x-ms-copy-progress", type: { name: "String" } }, copySource: { serializedName: "x-ms-copy-source", + xmlName: "x-ms-copy-source", type: { name: "String" } }, copyStatus: { serializedName: "x-ms-copy-status", + xmlName: "x-ms-copy-status", type: { name: "Enum", - allowedValues: [ - "pending", - "success", - "aborted", - "failed" - ] + allowedValues: ["pending", "success", "aborted", "failed"] } }, isIncrementalCopy: { serializedName: "x-ms-incremental-copy", + xmlName: "x-ms-incremental-copy", type: { name: "Boolean" } }, destinationSnapshot: { serializedName: "x-ms-copy-destination-snapshot", + xmlName: "x-ms-copy-destination-snapshot", type: { name: "String" } }, leaseDuration: { serializedName: "x-ms-lease-duration", + xmlName: "x-ms-lease-duration", type: { name: "Enum", - allowedValues: [ - "infinite", - "fixed" - ] + allowedValues: ["infinite", "fixed"] } }, leaseState: { serializedName: "x-ms-lease-state", + xmlName: "x-ms-lease-state", type: { name: "Enum", allowedValues: [ @@ -23692,190 +22938,235 @@ var BlobGetPropertiesHeaders = { }, leaseStatus: { serializedName: "x-ms-lease-status", + xmlName: "x-ms-lease-status", type: { name: "Enum", - allowedValues: [ - "locked", - "unlocked" - ] + allowedValues: ["locked", "unlocked"] } }, contentLength: { serializedName: "content-length", + xmlName: "content-length", type: { name: "Number" } }, contentType: { serializedName: "content-type", + xmlName: "content-type", type: { name: "String" } }, etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, contentMD5: { serializedName: "content-md5", + xmlName: "content-md5", type: { name: "ByteArray" } }, contentEncoding: { serializedName: "content-encoding", + xmlName: "content-encoding", type: { name: "String" } }, contentDisposition: { serializedName: "content-disposition", + xmlName: "content-disposition", type: { name: "String" } }, contentLanguage: { serializedName: "content-language", + xmlName: "content-language", type: { name: "String" } }, cacheControl: { serializedName: "cache-control", + xmlName: "cache-control", type: { name: "String" } }, blobSequenceNumber: { serializedName: "x-ms-blob-sequence-number", + xmlName: "x-ms-blob-sequence-number", type: { name: "Number" } }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, acceptRanges: { serializedName: "accept-ranges", + xmlName: "accept-ranges", type: { name: "String" } }, blobCommittedBlockCount: { serializedName: "x-ms-blob-committed-block-count", + xmlName: "x-ms-blob-committed-block-count", type: { name: "Number" } }, isServerEncrypted: { serializedName: "x-ms-server-encrypted", + xmlName: "x-ms-server-encrypted", type: { name: "Boolean" } }, encryptionKeySha256: { serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { name: "String" } }, encryptionScope: { serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { name: "String" } }, accessTier: { serializedName: "x-ms-access-tier", + xmlName: "x-ms-access-tier", type: { name: "String" } }, accessTierInferred: { serializedName: "x-ms-access-tier-inferred", + xmlName: "x-ms-access-tier-inferred", type: { name: "Boolean" } }, archiveStatus: { serializedName: "x-ms-archive-status", + xmlName: "x-ms-archive-status", type: { name: "String" } }, accessTierChangedOn: { serializedName: "x-ms-access-tier-change-time", + xmlName: "x-ms-access-tier-change-time", type: { name: "DateTimeRfc1123" } }, versionId: { serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", type: { name: "String" } }, isCurrentVersion: { serializedName: "x-ms-is-current-version", + xmlName: "x-ms-is-current-version", type: { name: "Boolean" } }, tagCount: { serializedName: "x-ms-tag-count", + xmlName: "x-ms-tag-count", type: { name: "Number" } }, expiresOn: { serializedName: "x-ms-expiry-time", + xmlName: "x-ms-expiry-time", type: { name: "DateTimeRfc1123" } }, isSealed: { serializedName: "x-ms-blob-sealed", + xmlName: "x-ms-blob-sealed", type: { name: "Boolean" } }, rehydratePriority: { serializedName: "x-ms-rehydrate-priority", + xmlName: "x-ms-rehydrate-priority", type: { - name: "String" + name: "Enum", + allowedValues: ["High", "Standard"] } }, lastAccessed: { serializedName: "x-ms-last-access-time", + xmlName: "x-ms-last-access-time", type: { name: "DateTimeRfc1123" } }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var BlobGetPropertiesExceptionHeaders = { + serializedName: "Blob_getPropertiesExceptionHeaders", + type: { + name: "Composite", + className: "BlobGetPropertiesExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -23884,37 +23175,58 @@ var BlobGetPropertiesHeaders = { } }; var BlobDeleteHeaders = { - serializedName: "blob-delete-headers", + serializedName: "Blob_deleteHeaders", type: { name: "Composite", className: "BlobDeleteHeaders", modelProperties: { clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var BlobDeleteExceptionHeaders = { + serializedName: "Blob_deleteExceptionHeaders", + type: { + name: "Composite", + className: "BlobDeleteExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -23923,43 +23235,72 @@ var BlobDeleteHeaders = { } }; var BlobSetAccessControlHeaders = { - serializedName: "blob-setaccesscontrol-headers", + serializedName: "Blob_setAccessControlHeaders", type: { name: "Composite", className: "BlobSetAccessControlHeaders", modelProperties: { date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } - }, + } + } + } +}; +var BlobSetAccessControlExceptionHeaders = { + serializedName: "Blob_setAccessControlExceptionHeaders", + type: { + name: "Composite", + className: "BlobSetAccessControlExceptionHeaders", + modelProperties: { clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", + type: { + name: "String" + } + }, + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", + type: { + name: "String" + } + }, + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } @@ -23968,67 +23309,70 @@ var BlobSetAccessControlHeaders = { } }; var BlobGetAccessControlHeaders = { - serializedName: "blob-getaccesscontrol-headers", + serializedName: "Blob_getAccessControlHeaders", type: { name: "Composite", className: "BlobGetAccessControlHeaders", modelProperties: { date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, xMsOwner: { serializedName: "x-ms-owner", + xmlName: "x-ms-owner", type: { name: "String" } }, xMsGroup: { serializedName: "x-ms-group", + xmlName: "x-ms-group", type: { name: "String" } }, xMsPermissions: { serializedName: "x-ms-permissions", + xmlName: "x-ms-permissions", type: { name: "String" } }, xMsAcl: { serializedName: "x-ms-acl", + xmlName: "x-ms-acl", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", - type: { - name: "String" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", + xmlName: "x-ms-version", type: { name: "String" } @@ -24036,212 +23380,117 @@ var BlobGetAccessControlHeaders = { } } }; -var BlobRenameHeaders = { - serializedName: "blob-rename-headers", +var BlobGetAccessControlExceptionHeaders = { + serializedName: "Blob_getAccessControlExceptionHeaders", type: { name: "Composite", - className: "BlobRenameHeaders", + className: "BlobGetAccessControlExceptionHeaders", modelProperties: { - etag: { - serializedName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } - }, - contentLength: { - serializedName: "content-length", - type: { - name: "Number" - } - }, - date: { - serializedName: "date", - type: { - name: "DateTimeRfc1123" - } } } } }; -var PageBlobCreateHeaders = { - serializedName: "pageblob-create-headers", +var BlobRenameHeaders = { + serializedName: "Blob_renameHeaders", type: { name: "Composite", - className: "PageBlobCreateHeaders", + className: "BlobRenameHeaders", modelProperties: { etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, - contentMD5: { - serializedName: "content-md5", - type: { - name: "ByteArray" - } - }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - versionId: { - serializedName: "x-ms-version-id", + contentLength: { + serializedName: "content-length", + xmlName: "content-length", type: { - name: "String" + name: "Number" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } - }, - isServerEncrypted: { - serializedName: "x-ms-request-server-encrypted", - type: { - name: "Boolean" - } - }, - encryptionKeySha256: { - serializedName: "x-ms-encryption-key-sha256", - type: { - name: "String" - } - }, - encryptionScope: { - serializedName: "x-ms-encryption-scope", - type: { - name: "String" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - type: { - name: "String" - } } } } }; -var AppendBlobCreateHeaders = { - serializedName: "appendblob-create-headers", +var BlobRenameExceptionHeaders = { + serializedName: "Blob_renameExceptionHeaders", type: { name: "Composite", - className: "AppendBlobCreateHeaders", + className: "BlobRenameExceptionHeaders", modelProperties: { - etag: { - serializedName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - contentMD5: { - serializedName: "content-md5", - type: { - name: "ByteArray" - } - }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", - type: { - name: "String" - } - }, - versionId: { - serializedName: "x-ms-version-id", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - isServerEncrypted: { - serializedName: "x-ms-request-server-encrypted", - type: { - name: "Boolean" - } - }, - encryptionKeySha256: { - serializedName: "x-ms-encryption-key-sha256", - type: { - name: "String" - } - }, - encryptionScope: { - serializedName: "x-ms-encryption-scope", - type: { - name: "String" - } - }, - errorCode: { - serializedName: "x-ms-error-code", + xmlName: "x-ms-version", type: { name: "String" } @@ -24249,80 +23498,59 @@ var AppendBlobCreateHeaders = { } } }; -var BlockBlobUploadHeaders = { - serializedName: "blockblob-upload-headers", +var BlobUndeleteHeaders = { + serializedName: "Blob_undeleteHeaders", type: { name: "Composite", - className: "BlockBlobUploadHeaders", + className: "BlobUndeleteHeaders", modelProperties: { - etag: { - serializedName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - contentMD5: { - serializedName: "content-md5", - type: { - name: "ByteArray" - } - }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", - type: { - name: "String" - } - }, - versionId: { - serializedName: "x-ms-version-id", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, - isServerEncrypted: { - serializedName: "x-ms-request-server-encrypted", - type: { - name: "Boolean" - } - }, - encryptionKeySha256: { - serializedName: "x-ms-encryption-key-sha256", - type: { - name: "String" - } - }, - encryptionScope: { - serializedName: "x-ms-encryption-scope", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, + } + } + } +}; +var BlobUndeleteExceptionHeaders = { + serializedName: "Blob_undeleteExceptionHeaders", + type: { + name: "Composite", + className: "BlobUndeleteExceptionHeaders", + modelProperties: { errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -24330,119 +23558,66 @@ var BlockBlobUploadHeaders = { } } }; -var BlockBlobPutBlobFromUrlHeaders = { - serializedName: "blockblob-putblobfromurl-headers", +var BlobSetExpiryHeaders = { + serializedName: "Blob_setExpiryHeaders", type: { name: "Composite", - className: "BlockBlobPutBlobFromUrlHeaders", + className: "BlobSetExpiryHeaders", modelProperties: { etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, - contentMD5: { - serializedName: "content-md5", - type: { - name: "ByteArray" - } - }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", - type: { - name: "String" - } - }, - versionId: { - serializedName: "x-ms-version-id", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } - }, - isServerEncrypted: { - serializedName: "x-ms-request-server-encrypted", - type: { - name: "Boolean" - } - }, - encryptionKeySha256: { - serializedName: "x-ms-encryption-key-sha256", - type: { - name: "String" - } - }, - encryptionScope: { - serializedName: "x-ms-encryption-scope", - type: { - name: "String" - } - }, - errorCode: { - serializedName: "x-ms-error-code", - type: { - name: "String" - } } } } }; -var BlobUndeleteHeaders = { - serializedName: "blob-undelete-headers", +var BlobSetExpiryExceptionHeaders = { + serializedName: "Blob_setExpiryExceptionHeaders", type: { name: "Composite", - className: "BlobUndeleteHeaders", + className: "BlobSetExpiryExceptionHeaders", modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - type: { - name: "DateTimeRfc1123" - } - }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -24450,50 +23625,64 @@ var BlobUndeleteHeaders = { } } }; -var BlobSetExpiryHeaders = { - serializedName: "blob-setexpiry-headers", +var BlobSetHttpHeadersHeaders = { + serializedName: "Blob_setHttpHeadersHeaders", type: { name: "Composite", - className: "BlobSetExpiryHeaders", + className: "BlobSetHttpHeadersHeaders", modelProperties: { etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, + blobSequenceNumber: { + serializedName: "x-ms-blob-sequence-number", + xmlName: "x-ms-blob-sequence-number", + type: { + name: "Number" + } + }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -24501,56 +23690,15 @@ var BlobSetExpiryHeaders = { } } }; -var BlobSetHTTPHeadersHeaders = { - serializedName: "blob-sethttpheaders-headers", +var BlobSetHttpHeadersExceptionHeaders = { + serializedName: "Blob_setHttpHeadersExceptionHeaders", type: { name: "Composite", - className: "BlobSetHTTPHeadersHeaders", + className: "BlobSetHttpHeadersExceptionHeaders", modelProperties: { - etag: { - serializedName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - blobSequenceNumber: { - serializedName: "x-ms-blob-sequence-number", - type: { - name: "Number" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - type: { - name: "DateTimeRfc1123" - } - }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -24559,73 +23707,100 @@ var BlobSetHTTPHeadersHeaders = { } }; var BlobSetMetadataHeaders = { - serializedName: "blob-setmetadata-headers", + serializedName: "Blob_setMetadataHeaders", type: { name: "Composite", className: "BlobSetMetadataHeaders", modelProperties: { etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, versionId: { serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, isServerEncrypted: { serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { name: "Boolean" } }, encryptionKeySha256: { serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { name: "String" } }, encryptionScope: { serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { name: "String" } }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var BlobSetMetadataExceptionHeaders = { + serializedName: "Blob_setMetadataExceptionHeaders", + type: { + name: "Composite", + className: "BlobSetMetadataExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -24634,55 +23809,72 @@ var BlobSetMetadataHeaders = { } }; var BlobAcquireLeaseHeaders = { - serializedName: "blob-acquirelease-headers", + serializedName: "Blob_acquireLeaseHeaders", type: { name: "Composite", className: "BlobAcquireLeaseHeaders", modelProperties: { etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, leaseId: { serializedName: "x-ms-lease-id", + xmlName: "x-ms-lease-id", type: { name: "String" } }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } - }, + } + } + } +}; +var BlobAcquireLeaseExceptionHeaders = { + serializedName: "Blob_acquireLeaseExceptionHeaders", + type: { + name: "Composite", + className: "BlobAcquireLeaseExceptionHeaders", + modelProperties: { errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -24691,49 +23883,65 @@ var BlobAcquireLeaseHeaders = { } }; var BlobReleaseLeaseHeaders = { - serializedName: "blob-releaselease-headers", + serializedName: "Blob_releaseLeaseHeaders", type: { name: "Composite", className: "BlobReleaseLeaseHeaders", modelProperties: { etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } - }, + } + } + } +}; +var BlobReleaseLeaseExceptionHeaders = { + serializedName: "Blob_releaseLeaseExceptionHeaders", + type: { + name: "Composite", + className: "BlobReleaseLeaseExceptionHeaders", + modelProperties: { errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -24742,55 +23950,72 @@ var BlobReleaseLeaseHeaders = { } }; var BlobRenewLeaseHeaders = { - serializedName: "blob-renewlease-headers", + serializedName: "Blob_renewLeaseHeaders", type: { name: "Composite", className: "BlobRenewLeaseHeaders", modelProperties: { etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, leaseId: { serializedName: "x-ms-lease-id", + xmlName: "x-ms-lease-id", type: { name: "String" } }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } - }, + } + } + } +}; +var BlobRenewLeaseExceptionHeaders = { + serializedName: "Blob_renewLeaseExceptionHeaders", + type: { + name: "Composite", + className: "BlobRenewLeaseExceptionHeaders", + modelProperties: { errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -24799,55 +24024,72 @@ var BlobRenewLeaseHeaders = { } }; var BlobChangeLeaseHeaders = { - serializedName: "blob-changelease-headers", + serializedName: "Blob_changeLeaseHeaders", type: { name: "Composite", className: "BlobChangeLeaseHeaders", modelProperties: { etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, leaseId: { serializedName: "x-ms-lease-id", + xmlName: "x-ms-lease-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } - }, + } + } + } +}; +var BlobChangeLeaseExceptionHeaders = { + serializedName: "Blob_changeLeaseExceptionHeaders", + type: { + name: "Composite", + className: "BlobChangeLeaseExceptionHeaders", + modelProperties: { errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -24856,55 +24098,72 @@ var BlobChangeLeaseHeaders = { } }; var BlobBreakLeaseHeaders = { - serializedName: "blob-breaklease-headers", + serializedName: "Blob_breakLeaseHeaders", type: { name: "Composite", className: "BlobBreakLeaseHeaders", modelProperties: { etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, leaseTime: { serializedName: "x-ms-lease-time", + xmlName: "x-ms-lease-time", type: { name: "Number" } }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } - }, + } + } + } +}; +var BlobBreakLeaseExceptionHeaders = { + serializedName: "Blob_breakLeaseExceptionHeaders", + type: { + name: "Composite", + className: "BlobBreakLeaseExceptionHeaders", + modelProperties: { errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -24913,67 +24172,93 @@ var BlobBreakLeaseHeaders = { } }; var BlobCreateSnapshotHeaders = { - serializedName: "blob-createsnapshot-headers", + serializedName: "Blob_createSnapshotHeaders", type: { name: "Composite", className: "BlobCreateSnapshotHeaders", modelProperties: { snapshot: { serializedName: "x-ms-snapshot", + xmlName: "x-ms-snapshot", type: { name: "String" } }, etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, versionId: { serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, isServerEncrypted: { serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { name: "Boolean" } }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var BlobCreateSnapshotExceptionHeaders = { + serializedName: "Blob_createSnapshotExceptionHeaders", + type: { + name: "Composite", + className: "BlobCreateSnapshotExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -24982,73 +24267,94 @@ var BlobCreateSnapshotHeaders = { } }; var BlobStartCopyFromURLHeaders = { - serializedName: "blob-startcopyfromurl-headers", + serializedName: "Blob_startCopyFromURLHeaders", type: { name: "Composite", className: "BlobStartCopyFromURLHeaders", modelProperties: { etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, versionId: { serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, copyId: { serializedName: "x-ms-copy-id", + xmlName: "x-ms-copy-id", type: { name: "String" } }, copyStatus: { serializedName: "x-ms-copy-status", + xmlName: "x-ms-copy-status", type: { name: "Enum", - allowedValues: [ - "pending", - "success", - "aborted", - "failed" - ] + allowedValues: ["pending", "success", "aborted", "failed"] } }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var BlobStartCopyFromURLExceptionHeaders = { + serializedName: "Blob_startCopyFromURLExceptionHeaders", + type: { + name: "Composite", + className: "BlobStartCopyFromURLExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -25057,82 +24363,108 @@ var BlobStartCopyFromURLHeaders = { } }; var BlobCopyFromURLHeaders = { - serializedName: "blob-copyfromurl-headers", + serializedName: "Blob_copyFromURLHeaders", type: { name: "Composite", className: "BlobCopyFromURLHeaders", modelProperties: { etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, versionId: { serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, copyId: { serializedName: "x-ms-copy-id", + xmlName: "x-ms-copy-id", type: { name: "String" } }, copyStatus: { + defaultValue: "success", + isConstant: true, serializedName: "x-ms-copy-status", type: { - name: "Enum", - allowedValues: [ - "success" - ] + name: "String" } }, contentMD5: { serializedName: "content-md5", + xmlName: "content-md5", type: { name: "ByteArray" } }, xMsContentCrc64: { serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { name: "ByteArray" } }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var BlobCopyFromURLExceptionHeaders = { + serializedName: "Blob_copyFromURLExceptionHeaders", + type: { + name: "Composite", + className: "BlobCopyFromURLExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -25141,37 +24473,58 @@ var BlobCopyFromURLHeaders = { } }; var BlobAbortCopyFromURLHeaders = { - serializedName: "blob-abortcopyfromurl-headers", + serializedName: "Blob_abortCopyFromURLHeaders", type: { name: "Composite", className: "BlobAbortCopyFromURLHeaders", modelProperties: { clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var BlobAbortCopyFromURLExceptionHeaders = { + serializedName: "Blob_abortCopyFromURLExceptionHeaders", + type: { + name: "Composite", + className: "BlobAbortCopyFromURLExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -25180,31 +24533,51 @@ var BlobAbortCopyFromURLHeaders = { } }; var BlobSetTierHeaders = { - serializedName: "blob-settier-headers", + serializedName: "Blob_setTierHeaders", type: { name: "Composite", className: "BlobSetTierHeaders", modelProperties: { clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var BlobSetTierExceptionHeaders = { + serializedName: "Blob_setTierExceptionHeaders", + type: { + name: "Composite", + className: "BlobSetTierExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -25213,37 +24586,42 @@ var BlobSetTierHeaders = { } }; var BlobGetAccountInfoHeaders = { - serializedName: "blob-getaccountinfo-headers", + serializedName: "Blob_getAccountInfoHeaders", type: { name: "Composite", className: "BlobGetAccountInfoHeaders", modelProperties: { clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, skuName: { serializedName: "x-ms-sku-name", + xmlName: "x-ms-sku-name", type: { name: "Enum", allowedValues: [ @@ -25257,6 +24635,7 @@ var BlobGetAccountInfoHeaders = { }, accountKind: { serializedName: "x-ms-account-kind", + xmlName: "x-ms-account-kind", type: { name: "Enum", allowedValues: [ @@ -25267,9 +24646,19 @@ var BlobGetAccountInfoHeaders = { "BlockBlobStorage" ] } - }, + } + } + } +}; +var BlobGetAccountInfoExceptionHeaders = { + serializedName: "Blob_getAccountInfoExceptionHeaders", + type: { + name: "Composite", + className: "BlobGetAccountInfoExceptionHeaders", + modelProperties: { errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -25277,68 +24666,334 @@ var BlobGetAccountInfoHeaders = { } } }; -var BlockBlobStageBlockHeaders = { - serializedName: "blockblob-stageblock-headers", +var BlobQueryHeaders = { + serializedName: "Blob_queryHeaders", type: { name: "Composite", - className: "BlockBlobStageBlockHeaders", + className: "BlobQueryHeaders", modelProperties: { + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", + type: { + name: "DateTimeRfc1123" + } + }, + metadata: { + serializedName: "x-ms-meta", + xmlName: "x-ms-meta", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + contentLength: { + serializedName: "content-length", + xmlName: "content-length", + type: { + name: "Number" + } + }, + contentType: { + serializedName: "content-type", + xmlName: "content-type", + type: { + name: "String" + } + }, + contentRange: { + serializedName: "content-range", + xmlName: "content-range", + type: { + name: "String" + } + }, + etag: { + serializedName: "etag", + xmlName: "etag", + type: { + name: "String" + } + }, contentMD5: { serializedName: "content-md5", + xmlName: "content-md5", type: { name: "ByteArray" } }, + contentEncoding: { + serializedName: "content-encoding", + xmlName: "content-encoding", + type: { + name: "String" + } + }, + cacheControl: { + serializedName: "cache-control", + xmlName: "cache-control", + type: { + name: "String" + } + }, + contentDisposition: { + serializedName: "content-disposition", + xmlName: "content-disposition", + type: { + name: "String" + } + }, + contentLanguage: { + serializedName: "content-language", + xmlName: "content-language", + type: { + name: "String" + } + }, + blobSequenceNumber: { + serializedName: "x-ms-blob-sequence-number", + xmlName: "x-ms-blob-sequence-number", + type: { + name: "Number" + } + }, + blobType: { + serializedName: "x-ms-blob-type", + xmlName: "x-ms-blob-type", + type: { + name: "Enum", + allowedValues: ["BlockBlob", "PageBlob", "AppendBlob"] + } + }, + copyCompletionTime: { + serializedName: "x-ms-copy-completion-time", + xmlName: "x-ms-copy-completion-time", + type: { + name: "DateTimeRfc1123" + } + }, + copyStatusDescription: { + serializedName: "x-ms-copy-status-description", + xmlName: "x-ms-copy-status-description", + type: { + name: "String" + } + }, + copyId: { + serializedName: "x-ms-copy-id", + xmlName: "x-ms-copy-id", + type: { + name: "String" + } + }, + copyProgress: { + serializedName: "x-ms-copy-progress", + xmlName: "x-ms-copy-progress", + type: { + name: "String" + } + }, + copySource: { + serializedName: "x-ms-copy-source", + xmlName: "x-ms-copy-source", + type: { + name: "String" + } + }, + copyStatus: { + serializedName: "x-ms-copy-status", + xmlName: "x-ms-copy-status", + type: { + name: "Enum", + allowedValues: ["pending", "success", "aborted", "failed"] + } + }, + leaseDuration: { + serializedName: "x-ms-lease-duration", + xmlName: "x-ms-lease-duration", + type: { + name: "Enum", + allowedValues: ["infinite", "fixed"] + } + }, + leaseState: { + serializedName: "x-ms-lease-state", + xmlName: "x-ms-lease-state", + type: { + name: "Enum", + allowedValues: [ + "available", + "leased", + "expired", + "breaking", + "broken" + ] + } + }, + leaseStatus: { + serializedName: "x-ms-lease-status", + xmlName: "x-ms-lease-status", + type: { + name: "Enum", + allowedValues: ["locked", "unlocked"] + } + }, + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", + type: { + name: "String" + } + }, + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", + type: { + name: "String" + } + }, + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", + type: { + name: "String" + } + }, + acceptRanges: { + serializedName: "accept-ranges", + xmlName: "accept-ranges", + type: { + name: "String" + } + }, + date: { + serializedName: "date", + xmlName: "date", + type: { + name: "DateTimeRfc1123" + } + }, + blobCommittedBlockCount: { + serializedName: "x-ms-blob-committed-block-count", + xmlName: "x-ms-blob-committed-block-count", + type: { + name: "Number" + } + }, + isServerEncrypted: { + serializedName: "x-ms-server-encrypted", + xmlName: "x-ms-server-encrypted", + type: { + name: "Boolean" + } + }, + encryptionKeySha256: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", + type: { + name: "String" + } + }, + encryptionScope: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", + type: { + name: "String" + } + }, + blobContentMD5: { + serializedName: "x-ms-blob-content-md5", + xmlName: "x-ms-blob-content-md5", + type: { + name: "ByteArray" + } + }, + contentCrc64: { + serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", + type: { + name: "ByteArray" + } + }, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var BlobQueryExceptionHeaders = { + serializedName: "Blob_queryExceptionHeaders", + type: { + name: "Composite", + className: "BlobQueryExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var BlobGetTagsHeaders = { + serializedName: "Blob_getTagsHeaders", + type: { + name: "Composite", + className: "BlobGetTagsHeaders", + modelProperties: { clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, - xMsContentCrc64: { - serializedName: "x-ms-content-crc64", - type: { - name: "ByteArray" - } - }, - isServerEncrypted: { - serializedName: "x-ms-request-server-encrypted", - type: { - name: "Boolean" - } - }, - encryptionKeySha256: { - serializedName: "x-ms-encryption-key-sha256", - type: { - name: "String" - } - }, - encryptionScope: { - serializedName: "x-ms-encryption-scope", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, + } + } + } +}; +var BlobGetTagsExceptionHeaders = { + serializedName: "Blob_getTagsExceptionHeaders", + type: { + name: "Composite", + className: "BlobGetTagsExceptionHeaders", + modelProperties: { errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -25346,68 +25001,59 @@ var BlockBlobStageBlockHeaders = { } } }; -var BlockBlobStageBlockFromURLHeaders = { - serializedName: "blockblob-stageblockfromurl-headers", +var BlobSetTagsHeaders = { + serializedName: "Blob_setTagsHeaders", type: { name: "Composite", - className: "BlockBlobStageBlockFromURLHeaders", + className: "BlobSetTagsHeaders", modelProperties: { - contentMD5: { - serializedName: "content-md5", - type: { - name: "ByteArray" - } - }, - xMsContentCrc64: { - serializedName: "x-ms-content-crc64", - type: { - name: "ByteArray" - } - }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, - isServerEncrypted: { - serializedName: "x-ms-request-server-encrypted", - type: { - name: "Boolean" - } - }, - encryptionKeySha256: { - serializedName: "x-ms-encryption-key-sha256", - type: { - name: "String" - } - }, - encryptionScope: { - serializedName: "x-ms-encryption-scope", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, + } + } + } +}; +var BlobSetTagsExceptionHeaders = { + serializedName: "Blob_setTagsExceptionHeaders", + type: { + name: "Composite", + className: "BlobSetTagsExceptionHeaders", + modelProperties: { errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -25415,86 +25061,92 @@ var BlockBlobStageBlockFromURLHeaders = { } } }; -var BlockBlobCommitBlockListHeaders = { - serializedName: "blockblob-commitblocklist-headers", +var PageBlobCreateHeaders = { + serializedName: "PageBlob_createHeaders", type: { name: "Composite", - className: "BlockBlobCommitBlockListHeaders", + className: "PageBlobCreateHeaders", modelProperties: { etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, contentMD5: { serializedName: "content-md5", - type: { - name: "ByteArray" - } - }, - xMsContentCrc64: { - serializedName: "x-ms-content-crc64", + xmlName: "content-md5", type: { name: "ByteArray" } }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, versionId: { serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, isServerEncrypted: { serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { name: "Boolean" } }, encryptionKeySha256: { serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { name: "String" } }, encryptionScope: { serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { name: "String" } }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -25502,62 +25154,15 @@ var BlockBlobCommitBlockListHeaders = { } } }; -var BlockBlobGetBlockListHeaders = { - serializedName: "blockblob-getblocklist-headers", +var PageBlobCreateExceptionHeaders = { + serializedName: "PageBlob_createExceptionHeaders", type: { name: "Composite", - className: "BlockBlobGetBlockListHeaders", + className: "PageBlobCreateExceptionHeaders", modelProperties: { - lastModified: { - serializedName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - etag: { - serializedName: "etag", - type: { - name: "String" - } - }, - contentType: { - serializedName: "content-type", - type: { - name: "String" - } - }, - blobContentLength: { - serializedName: "x-ms-blob-content-length", - type: { - name: "Number" - } - }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - type: { - name: "String" - } - }, - version: { - serializedName: "x-ms-version", - type: { - name: "String" - } - }, - date: { - serializedName: "date", - type: { - name: "DateTimeRfc1123" - } - }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -25566,85 +25171,114 @@ var BlockBlobGetBlockListHeaders = { } }; var PageBlobUploadPagesHeaders = { - serializedName: "pageblob-uploadpages-headers", + serializedName: "PageBlob_uploadPagesHeaders", type: { name: "Composite", className: "PageBlobUploadPagesHeaders", modelProperties: { etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, contentMD5: { serializedName: "content-md5", + xmlName: "content-md5", type: { name: "ByteArray" } }, xMsContentCrc64: { serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { name: "ByteArray" } }, blobSequenceNumber: { serializedName: "x-ms-blob-sequence-number", + xmlName: "x-ms-blob-sequence-number", type: { name: "Number" } }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, isServerEncrypted: { serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { name: "Boolean" } }, encryptionKeySha256: { serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { name: "String" } }, encryptionScope: { serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { name: "String" } }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var PageBlobUploadPagesExceptionHeaders = { + serializedName: "PageBlob_uploadPagesExceptionHeaders", + type: { + name: "Composite", + className: "PageBlobUploadPagesExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -25653,67 +25287,93 @@ var PageBlobUploadPagesHeaders = { } }; var PageBlobClearPagesHeaders = { - serializedName: "pageblob-clearpages-headers", + serializedName: "PageBlob_clearPagesHeaders", type: { name: "Composite", className: "PageBlobClearPagesHeaders", modelProperties: { etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, contentMD5: { serializedName: "content-md5", + xmlName: "content-md5", type: { name: "ByteArray" } }, xMsContentCrc64: { serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { name: "ByteArray" } }, blobSequenceNumber: { serializedName: "x-ms-blob-sequence-number", + xmlName: "x-ms-blob-sequence-number", type: { name: "Number" } }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var PageBlobClearPagesExceptionHeaders = { + serializedName: "PageBlob_clearPagesExceptionHeaders", + type: { + name: "Composite", + className: "PageBlobClearPagesExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -25722,79 +25382,107 @@ var PageBlobClearPagesHeaders = { } }; var PageBlobUploadPagesFromURLHeaders = { - serializedName: "pageblob-uploadpagesfromurl-headers", + serializedName: "PageBlob_uploadPagesFromURLHeaders", type: { name: "Composite", className: "PageBlobUploadPagesFromURLHeaders", modelProperties: { etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, contentMD5: { serializedName: "content-md5", + xmlName: "content-md5", type: { name: "ByteArray" } }, xMsContentCrc64: { serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { name: "ByteArray" } }, blobSequenceNumber: { serializedName: "x-ms-blob-sequence-number", + xmlName: "x-ms-blob-sequence-number", type: { name: "Number" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, isServerEncrypted: { serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { name: "Boolean" } }, encryptionKeySha256: { serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { name: "String" } }, encryptionScope: { serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { name: "String" } }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var PageBlobUploadPagesFromURLExceptionHeaders = { + serializedName: "PageBlob_uploadPagesFromURLExceptionHeaders", + type: { + name: "Composite", + className: "PageBlobUploadPagesFromURLExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -25803,55 +25491,79 @@ var PageBlobUploadPagesFromURLHeaders = { } }; var PageBlobGetPageRangesHeaders = { - serializedName: "pageblob-getpageranges-headers", + serializedName: "PageBlob_getPageRangesHeaders", type: { name: "Composite", className: "PageBlobGetPageRangesHeaders", modelProperties: { lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, blobContentLength: { serializedName: "x-ms-blob-content-length", + xmlName: "x-ms-blob-content-length", type: { name: "Number" } }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var PageBlobGetPageRangesExceptionHeaders = { + serializedName: "PageBlob_getPageRangesExceptionHeaders", + type: { + name: "Composite", + className: "PageBlobGetPageRangesExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -25860,55 +25572,79 @@ var PageBlobGetPageRangesHeaders = { } }; var PageBlobGetPageRangesDiffHeaders = { - serializedName: "pageblob-getpagerangesdiff-headers", + serializedName: "PageBlob_getPageRangesDiffHeaders", type: { name: "Composite", className: "PageBlobGetPageRangesDiffHeaders", modelProperties: { lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, blobContentLength: { serializedName: "x-ms-blob-content-length", + xmlName: "x-ms-blob-content-length", type: { name: "Number" } }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var PageBlobGetPageRangesDiffExceptionHeaders = { + serializedName: "PageBlob_getPageRangesDiffExceptionHeaders", + type: { + name: "Composite", + className: "PageBlobGetPageRangesDiffExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -25917,55 +25653,144 @@ var PageBlobGetPageRangesDiffHeaders = { } }; var PageBlobResizeHeaders = { - serializedName: "pageblob-resize-headers", + serializedName: "PageBlob_resizeHeaders", type: { name: "Composite", className: "PageBlobResizeHeaders", modelProperties: { etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, blobSequenceNumber: { serializedName: "x-ms-blob-sequence-number", + xmlName: "x-ms-blob-sequence-number", + type: { + name: "Number" + } + }, + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", + type: { + name: "String" + } + }, + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", + type: { + name: "String" + } + }, + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", + type: { + name: "String" + } + }, + date: { + serializedName: "date", + xmlName: "date", + type: { + name: "DateTimeRfc1123" + } + }, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var PageBlobResizeExceptionHeaders = { + serializedName: "PageBlob_resizeExceptionHeaders", + type: { + name: "Composite", + className: "PageBlobResizeExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var PageBlobUpdateSequenceNumberHeaders = { + serializedName: "PageBlob_updateSequenceNumberHeaders", + type: { + name: "Composite", + className: "PageBlobUpdateSequenceNumberHeaders", + modelProperties: { + etag: { + serializedName: "etag", + xmlName: "etag", + type: { + name: "String" + } + }, + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", + type: { + name: "DateTimeRfc1123" + } + }, + blobSequenceNumber: { + serializedName: "x-ms-blob-sequence-number", + xmlName: "x-ms-blob-sequence-number", type: { name: "Number" } }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -25973,56 +25798,88 @@ var PageBlobResizeHeaders = { } } }; -var PageBlobUpdateSequenceNumberHeaders = { - serializedName: "pageblob-updatesequencenumber-headers", +var PageBlobUpdateSequenceNumberExceptionHeaders = { + serializedName: "PageBlob_updateSequenceNumberExceptionHeaders", type: { name: "Composite", - className: "PageBlobUpdateSequenceNumberHeaders", + className: "PageBlobUpdateSequenceNumberExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var PageBlobCopyIncrementalHeaders = { + serializedName: "PageBlob_copyIncrementalHeaders", + type: { + name: "Composite", + className: "PageBlobCopyIncrementalHeaders", modelProperties: { etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, - blobSequenceNumber: { - serializedName: "x-ms-blob-sequence-number", - type: { - name: "Number" - } - }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, + copyId: { + serializedName: "x-ms-copy-id", + xmlName: "x-ms-copy-id", + type: { + name: "String" + } + }, + copyStatus: { + serializedName: "x-ms-copy-status", + xmlName: "x-ms-copy-status", + type: { + name: "Enum", + allowedValues: ["pending", "success", "aborted", "failed"] + } + }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -26030,68 +25887,124 @@ var PageBlobUpdateSequenceNumberHeaders = { } } }; -var PageBlobCopyIncrementalHeaders = { - serializedName: "pageblob-copyincremental-headers", +var PageBlobCopyIncrementalExceptionHeaders = { + serializedName: "PageBlob_copyIncrementalExceptionHeaders", type: { name: "Composite", - className: "PageBlobCopyIncrementalHeaders", + className: "PageBlobCopyIncrementalExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var AppendBlobCreateHeaders = { + serializedName: "AppendBlob_createHeaders", + type: { + name: "Composite", + className: "AppendBlobCreateHeaders", modelProperties: { etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", + type: { + name: "ByteArray" + } + }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", + type: { + name: "String" + } + }, + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, - copyId: { - serializedName: "x-ms-copy-id", + isServerEncrypted: { + serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", + type: { + name: "Boolean" + } + }, + encryptionKeySha256: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { name: "String" } }, - copyStatus: { - serializedName: "x-ms-copy-status", + encryptionScope: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { - name: "Enum", - allowedValues: [ - "pending", - "success", - "aborted", - "failed" - ] + name: "String" } }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var AppendBlobCreateExceptionHeaders = { + serializedName: "AppendBlob_createExceptionHeaders", + type: { + name: "Composite", + className: "AppendBlobCreateExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -26100,91 +26013,121 @@ var PageBlobCopyIncrementalHeaders = { } }; var AppendBlobAppendBlockHeaders = { - serializedName: "appendblob-appendblock-headers", + serializedName: "AppendBlob_appendBlockHeaders", type: { name: "Composite", className: "AppendBlobAppendBlockHeaders", modelProperties: { etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, contentMD5: { serializedName: "content-md5", + xmlName: "content-md5", type: { name: "ByteArray" } }, xMsContentCrc64: { serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { name: "ByteArray" } }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, blobAppendOffset: { serializedName: "x-ms-blob-append-offset", + xmlName: "x-ms-blob-append-offset", type: { name: "String" } }, blobCommittedBlockCount: { serializedName: "x-ms-blob-committed-block-count", + xmlName: "x-ms-blob-committed-block-count", type: { name: "Number" } }, isServerEncrypted: { serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { name: "Boolean" } }, encryptionKeySha256: { serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { name: "String" } }, encryptionScope: { serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { name: "String" } }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var AppendBlobAppendBlockExceptionHeaders = { + serializedName: "AppendBlob_appendBlockExceptionHeaders", + type: { + name: "Composite", + className: "AppendBlobAppendBlockExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -26193,85 +26136,114 @@ var AppendBlobAppendBlockHeaders = { } }; var AppendBlobAppendBlockFromUrlHeaders = { - serializedName: "appendblob-appendblockfromurl-headers", + serializedName: "AppendBlob_appendBlockFromUrlHeaders", type: { name: "Composite", className: "AppendBlobAppendBlockFromUrlHeaders", modelProperties: { etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, contentMD5: { serializedName: "content-md5", + xmlName: "content-md5", type: { name: "ByteArray" } }, xMsContentCrc64: { serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { name: "ByteArray" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, blobAppendOffset: { serializedName: "x-ms-blob-append-offset", + xmlName: "x-ms-blob-append-offset", type: { name: "String" } }, blobCommittedBlockCount: { serializedName: "x-ms-blob-committed-block-count", + xmlName: "x-ms-blob-committed-block-count", type: { name: "Number" } }, encryptionKeySha256: { serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { name: "String" } }, encryptionScope: { serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { name: "String" } }, isServerEncrypted: { serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { name: "Boolean" } }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var AppendBlobAppendBlockFromUrlExceptionHeaders = { + serializedName: "AppendBlob_appendBlockFromUrlExceptionHeaders", + type: { + name: "Composite", + className: "AppendBlobAppendBlockFromUrlExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -26280,55 +26252,72 @@ var AppendBlobAppendBlockFromUrlHeaders = { } }; var AppendBlobSealHeaders = { - serializedName: "appendblob-seal-headers", + serializedName: "AppendBlob_sealHeaders", type: { name: "Composite", className: "AppendBlobSealHeaders", modelProperties: { etag: { serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, isSealed: { serializedName: "x-ms-blob-sealed", + xmlName: "x-ms-blob-sealed", type: { name: "Boolean" } - }, + } + } + } +}; +var AppendBlobSealExceptionHeaders = { + serializedName: "AppendBlob_sealExceptionHeaders", + type: { + name: "Composite", + className: "AppendBlobSealExceptionHeaders", + modelProperties: { errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -26336,244 +26325,391 @@ var AppendBlobSealHeaders = { } } }; -var BlobQueryHeaders = { - serializedName: "blob-query-headers", +var BlockBlobUploadHeaders = { + serializedName: "BlockBlob_uploadHeaders", type: { name: "Composite", - className: "BlobQueryHeaders", + className: "BlockBlobUploadHeaders", modelProperties: { + etag: { + serializedName: "etag", + xmlName: "etag", + type: { + name: "String" + } + }, lastModified: { serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, - metadata: { - serializedName: "x-ms-meta", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } - }, - headerCollectionPrefix: "x-ms-meta-" + name: "ByteArray" + } }, - contentLength: { - serializedName: "content-length", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { - name: "Number" + name: "String" } }, - contentType: { - serializedName: "content-type", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - contentRange: { - serializedName: "content-range", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - etag: { - serializedName: "etag", + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", type: { name: "String" } }, - contentMD5: { - serializedName: "content-md5", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "ByteArray" + name: "DateTimeRfc1123" } }, - contentEncoding: { - serializedName: "content-encoding", + isServerEncrypted: { + serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { - name: "String" + name: "Boolean" } }, - cacheControl: { - serializedName: "cache-control", + encryptionKeySha256: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { name: "String" } }, - contentDisposition: { - serializedName: "content-disposition", + encryptionScope: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { name: "String" } }, - contentLanguage: { - serializedName: "content-language", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, - blobSequenceNumber: { - serializedName: "x-ms-blob-sequence-number", + } + } + } +}; +var BlockBlobUploadExceptionHeaders = { + serializedName: "BlockBlob_uploadExceptionHeaders", + type: { + name: "Composite", + className: "BlockBlobUploadExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Number" + name: "String" } - }, - blobType: { - serializedName: "x-ms-blob-type", + } + } + } +}; +var BlockBlobPutBlobFromUrlHeaders = { + serializedName: "BlockBlob_putBlobFromUrlHeaders", + type: { + name: "Composite", + className: "BlockBlobPutBlobFromUrlHeaders", + modelProperties: { + etag: { + serializedName: "etag", + xmlName: "etag", type: { - name: "Enum", - allowedValues: [ - "BlockBlob", - "PageBlob", - "AppendBlob" - ] + name: "String" } }, - copyCompletionTime: { - serializedName: "x-ms-copy-completion-time", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, - copyStatusDescription: { - serializedName: "x-ms-copy-status-description", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", + type: { + name: "ByteArray" + } + }, + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - copyId: { - serializedName: "x-ms-copy-id", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - copyProgress: { - serializedName: "x-ms-copy-progress", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - copySource: { - serializedName: "x-ms-copy-source", + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", type: { name: "String" } }, - copyStatus: { - serializedName: "x-ms-copy-status", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Enum", - allowedValues: [ - "pending", - "success", - "aborted", - "failed" - ] + name: "DateTimeRfc1123" } }, - leaseDuration: { - serializedName: "x-ms-lease-duration", + isServerEncrypted: { + serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { - name: "Enum", - allowedValues: [ - "infinite", - "fixed" - ] + name: "Boolean" } }, - leaseState: { - serializedName: "x-ms-lease-state", + encryptionKeySha256: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { - name: "Enum", - allowedValues: [ - "available", - "leased", - "expired", - "breaking", - "broken" - ] + name: "String" } }, - leaseStatus: { - serializedName: "x-ms-lease-status", + encryptionScope: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { - name: "Enum", - allowedValues: [ - "locked", - "unlocked" - ] + name: "String" + } + }, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var BlockBlobPutBlobFromUrlExceptionHeaders = { + serializedName: "BlockBlob_putBlobFromUrlExceptionHeaders", + type: { + name: "Composite", + className: "BlockBlobPutBlobFromUrlExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var BlockBlobStageBlockHeaders = { + serializedName: "BlockBlob_stageBlockHeaders", + type: { + name: "Composite", + className: "BlockBlobStageBlockHeaders", + modelProperties: { + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", + type: { + name: "ByteArray" } }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", - type: { - name: "String" - } - }, - acceptRanges: { - serializedName: "accept-ranges", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, - blobCommittedBlockCount: { - serializedName: "x-ms-blob-committed-block-count", + xMsContentCrc64: { + serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { - name: "Number" + name: "ByteArray" } }, isServerEncrypted: { - serializedName: "x-ms-server-encrypted", + serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { name: "Boolean" } }, encryptionKeySha256: { serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { name: "String" } }, encryptionScope: { serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { name: "String" } }, - blobContentMD5: { - serializedName: "x-ms-blob-content-md5", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var BlockBlobStageBlockExceptionHeaders = { + serializedName: "BlockBlob_stageBlockExceptionHeaders", + type: { + name: "Composite", + className: "BlockBlobStageBlockExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var BlockBlobStageBlockFromURLHeaders = { + serializedName: "BlockBlob_stageBlockFromURLHeaders", + type: { + name: "Composite", + className: "BlockBlobStageBlockFromURLHeaders", + modelProperties: { + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { name: "ByteArray" } }, - contentCrc64: { + xMsContentCrc64: { serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { name: "ByteArray" } }, + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", + type: { + name: "String" + } + }, + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", + type: { + name: "String" + } + }, + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", + type: { + name: "String" + } + }, + date: { + serializedName: "date", + xmlName: "date", + type: { + name: "DateTimeRfc1123" + } + }, + isServerEncrypted: { + serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", + type: { + name: "Boolean" + } + }, + encryptionKeySha256: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", + type: { + name: "String" + } + }, + encryptionScope: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", + type: { + name: "String" + } + }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -26581,77 +26717,219 @@ var BlobQueryHeaders = { } } }; -var BlobGetTagsHeaders = { - serializedName: "blob-gettags-headers", +var BlockBlobStageBlockFromURLExceptionHeaders = { + serializedName: "BlockBlob_stageBlockFromURLExceptionHeaders", type: { name: "Composite", - className: "BlobGetTagsHeaders", + className: "BlockBlobStageBlockFromURLExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var BlockBlobCommitBlockListHeaders = { + serializedName: "BlockBlob_commitBlockListHeaders", + type: { + name: "Composite", + className: "BlockBlobCommitBlockListHeaders", modelProperties: { + etag: { + serializedName: "etag", + xmlName: "etag", + type: { + name: "String" + } + }, + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", + type: { + name: "DateTimeRfc1123" + } + }, + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", + type: { + name: "ByteArray" + } + }, + xMsContentCrc64: { + serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", + type: { + name: "ByteArray" + } + }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", + type: { + name: "String" + } + }, + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, + isServerEncrypted: { + serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", + type: { + name: "Boolean" + } + }, + encryptionKeySha256: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", + type: { + name: "String" + } + }, + encryptionScope: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", + type: { + name: "String" + } + }, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var BlockBlobCommitBlockListExceptionHeaders = { + serializedName: "BlockBlob_commitBlockListExceptionHeaders", + type: { + name: "Composite", + className: "BlockBlobCommitBlockListExceptionHeaders", + modelProperties: { errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var BlockBlobGetBlockListHeaders = { + serializedName: "BlockBlob_getBlockListHeaders", + type: { + name: "Composite", + className: "BlockBlobGetBlockListHeaders", + modelProperties: { + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", + type: { + name: "DateTimeRfc1123" + } + }, + etag: { + serializedName: "etag", + xmlName: "etag", + type: { + name: "String" + } + }, + contentType: { + serializedName: "content-type", + xmlName: "content-type", + type: { + name: "String" + } + }, + blobContentLength: { + serializedName: "x-ms-blob-content-length", + xmlName: "x-ms-blob-content-length", type: { - name: "String" + name: "Number" } - } - } - } -}; -var BlobSetTagsHeaders = { - serializedName: "blob-settags-headers", - type: { - name: "Composite", - className: "BlobSetTagsHeaders", - modelProperties: { + }, clientRequestId: { serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, requestId: { serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, version: { serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, date: { serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, errorCode: { serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } + } +}; +var BlockBlobGetBlockListExceptionHeaders = { + serializedName: "BlockBlob_getBlockListExceptionHeaders", + type: { + name: "Composite", + className: "BlockBlobGetBlockListExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -26659,1894 +26937,2033 @@ var BlobSetTagsHeaders = { } } }; - -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ var Mappers = /*#__PURE__*/Object.freeze({ __proto__: null, BlobServiceProperties: BlobServiceProperties, + Logging: Logging, + RetentionPolicy: RetentionPolicy, + Metrics: Metrics, + CorsRule: CorsRule, + StaticWebsite: StaticWebsite, + StorageError: StorageError, BlobServiceStatistics: BlobServiceStatistics, - BlobTag: BlobTag, - BlobTags: BlobTags, + GeoReplication: GeoReplication, + ListContainersSegmentResponse: ListContainersSegmentResponse, ContainerItem: ContainerItem, ContainerProperties: ContainerProperties, - CorsRule: CorsRule, - FilterBlobItem: FilterBlobItem, - FilterBlobSegment: FilterBlobSegment, - GeoReplication: GeoReplication, KeyInfo: KeyInfo, - ListContainersSegmentResponse: ListContainersSegmentResponse, - Logging: Logging, - Metrics: Metrics, - RetentionPolicy: RetentionPolicy, - ServiceFilterBlobsHeaders: ServiceFilterBlobsHeaders, - ServiceGetAccountInfoHeaders: ServiceGetAccountInfoHeaders, + UserDelegationKey: UserDelegationKey, + FilterBlobSegment: FilterBlobSegment, + FilterBlobItem: FilterBlobItem, + BlobTags: BlobTags, + BlobTag: BlobTag, + SignedIdentifier: SignedIdentifier, + AccessPolicy: AccessPolicy, + ListBlobsFlatSegmentResponse: ListBlobsFlatSegmentResponse, + BlobFlatListSegment: BlobFlatListSegment, + BlobItemInternal: BlobItemInternal, + BlobPropertiesInternal: BlobPropertiesInternal, + ListBlobsHierarchySegmentResponse: ListBlobsHierarchySegmentResponse, + BlobHierarchyListSegment: BlobHierarchyListSegment, + BlobPrefix: BlobPrefix, + DataLakeStorageError: DataLakeStorageError, + DataLakeStorageErrorError: DataLakeStorageErrorError, + BlockLookupList: BlockLookupList, + BlockList: BlockList, + Block: Block, + PageList: PageList, + PageRange: PageRange, + ClearRange: ClearRange, + QueryRequest: QueryRequest, + QuerySerialization: QuerySerialization, + QueryFormat: QueryFormat, + DelimitedTextConfiguration: DelimitedTextConfiguration, + JsonTextConfiguration: JsonTextConfiguration, + ArrowConfiguration: ArrowConfiguration, + ArrowField: ArrowField, + ServiceSetPropertiesHeaders: ServiceSetPropertiesHeaders, + ServiceSetPropertiesExceptionHeaders: ServiceSetPropertiesExceptionHeaders, ServiceGetPropertiesHeaders: ServiceGetPropertiesHeaders, + ServiceGetPropertiesExceptionHeaders: ServiceGetPropertiesExceptionHeaders, ServiceGetStatisticsHeaders: ServiceGetStatisticsHeaders, - ServiceGetUserDelegationKeyHeaders: ServiceGetUserDelegationKeyHeaders, + ServiceGetStatisticsExceptionHeaders: ServiceGetStatisticsExceptionHeaders, ServiceListContainersSegmentHeaders: ServiceListContainersSegmentHeaders, - ServiceSetPropertiesHeaders: ServiceSetPropertiesHeaders, + ServiceListContainersSegmentExceptionHeaders: ServiceListContainersSegmentExceptionHeaders, + ServiceGetUserDelegationKeyHeaders: ServiceGetUserDelegationKeyHeaders, + ServiceGetUserDelegationKeyExceptionHeaders: ServiceGetUserDelegationKeyExceptionHeaders, + ServiceGetAccountInfoHeaders: ServiceGetAccountInfoHeaders, + ServiceGetAccountInfoExceptionHeaders: ServiceGetAccountInfoExceptionHeaders, ServiceSubmitBatchHeaders: ServiceSubmitBatchHeaders, - StaticWebsite: StaticWebsite, - StorageError: StorageError, - UserDelegationKey: UserDelegationKey + ServiceSubmitBatchExceptionHeaders: ServiceSubmitBatchExceptionHeaders, + ServiceFilterBlobsHeaders: ServiceFilterBlobsHeaders, + ServiceFilterBlobsExceptionHeaders: ServiceFilterBlobsExceptionHeaders, + ContainerCreateHeaders: ContainerCreateHeaders, + ContainerCreateExceptionHeaders: ContainerCreateExceptionHeaders, + ContainerGetPropertiesHeaders: ContainerGetPropertiesHeaders, + ContainerGetPropertiesExceptionHeaders: ContainerGetPropertiesExceptionHeaders, + ContainerDeleteHeaders: ContainerDeleteHeaders, + ContainerDeleteExceptionHeaders: ContainerDeleteExceptionHeaders, + ContainerSetMetadataHeaders: ContainerSetMetadataHeaders, + ContainerSetMetadataExceptionHeaders: ContainerSetMetadataExceptionHeaders, + ContainerGetAccessPolicyHeaders: ContainerGetAccessPolicyHeaders, + ContainerGetAccessPolicyExceptionHeaders: ContainerGetAccessPolicyExceptionHeaders, + ContainerSetAccessPolicyHeaders: ContainerSetAccessPolicyHeaders, + ContainerSetAccessPolicyExceptionHeaders: ContainerSetAccessPolicyExceptionHeaders, + ContainerRestoreHeaders: ContainerRestoreHeaders, + ContainerRestoreExceptionHeaders: ContainerRestoreExceptionHeaders, + ContainerRenameHeaders: ContainerRenameHeaders, + ContainerRenameExceptionHeaders: ContainerRenameExceptionHeaders, + ContainerSubmitBatchHeaders: ContainerSubmitBatchHeaders, + ContainerSubmitBatchExceptionHeaders: ContainerSubmitBatchExceptionHeaders, + ContainerAcquireLeaseHeaders: ContainerAcquireLeaseHeaders, + ContainerAcquireLeaseExceptionHeaders: ContainerAcquireLeaseExceptionHeaders, + ContainerReleaseLeaseHeaders: ContainerReleaseLeaseHeaders, + ContainerReleaseLeaseExceptionHeaders: ContainerReleaseLeaseExceptionHeaders, + ContainerRenewLeaseHeaders: ContainerRenewLeaseHeaders, + ContainerRenewLeaseExceptionHeaders: ContainerRenewLeaseExceptionHeaders, + ContainerBreakLeaseHeaders: ContainerBreakLeaseHeaders, + ContainerBreakLeaseExceptionHeaders: ContainerBreakLeaseExceptionHeaders, + ContainerChangeLeaseHeaders: ContainerChangeLeaseHeaders, + ContainerChangeLeaseExceptionHeaders: ContainerChangeLeaseExceptionHeaders, + ContainerListBlobFlatSegmentHeaders: ContainerListBlobFlatSegmentHeaders, + ContainerListBlobFlatSegmentExceptionHeaders: ContainerListBlobFlatSegmentExceptionHeaders, + ContainerListBlobHierarchySegmentHeaders: ContainerListBlobHierarchySegmentHeaders, + ContainerListBlobHierarchySegmentExceptionHeaders: ContainerListBlobHierarchySegmentExceptionHeaders, + ContainerGetAccountInfoHeaders: ContainerGetAccountInfoHeaders, + ContainerGetAccountInfoExceptionHeaders: ContainerGetAccountInfoExceptionHeaders, + DirectoryCreateHeaders: DirectoryCreateHeaders, + DirectoryCreateExceptionHeaders: DirectoryCreateExceptionHeaders, + DirectoryRenameHeaders: DirectoryRenameHeaders, + DirectoryRenameExceptionHeaders: DirectoryRenameExceptionHeaders, + DirectoryDeleteHeaders: DirectoryDeleteHeaders, + DirectoryDeleteExceptionHeaders: DirectoryDeleteExceptionHeaders, + DirectorySetAccessControlHeaders: DirectorySetAccessControlHeaders, + DirectorySetAccessControlExceptionHeaders: DirectorySetAccessControlExceptionHeaders, + DirectoryGetAccessControlHeaders: DirectoryGetAccessControlHeaders, + DirectoryGetAccessControlExceptionHeaders: DirectoryGetAccessControlExceptionHeaders, + BlobDownloadHeaders: BlobDownloadHeaders, + BlobDownloadExceptionHeaders: BlobDownloadExceptionHeaders, + BlobGetPropertiesHeaders: BlobGetPropertiesHeaders, + BlobGetPropertiesExceptionHeaders: BlobGetPropertiesExceptionHeaders, + BlobDeleteHeaders: BlobDeleteHeaders, + BlobDeleteExceptionHeaders: BlobDeleteExceptionHeaders, + BlobSetAccessControlHeaders: BlobSetAccessControlHeaders, + BlobSetAccessControlExceptionHeaders: BlobSetAccessControlExceptionHeaders, + BlobGetAccessControlHeaders: BlobGetAccessControlHeaders, + BlobGetAccessControlExceptionHeaders: BlobGetAccessControlExceptionHeaders, + BlobRenameHeaders: BlobRenameHeaders, + BlobRenameExceptionHeaders: BlobRenameExceptionHeaders, + BlobUndeleteHeaders: BlobUndeleteHeaders, + BlobUndeleteExceptionHeaders: BlobUndeleteExceptionHeaders, + BlobSetExpiryHeaders: BlobSetExpiryHeaders, + BlobSetExpiryExceptionHeaders: BlobSetExpiryExceptionHeaders, + BlobSetHttpHeadersHeaders: BlobSetHttpHeadersHeaders, + BlobSetHttpHeadersExceptionHeaders: BlobSetHttpHeadersExceptionHeaders, + BlobSetMetadataHeaders: BlobSetMetadataHeaders, + BlobSetMetadataExceptionHeaders: BlobSetMetadataExceptionHeaders, + BlobAcquireLeaseHeaders: BlobAcquireLeaseHeaders, + BlobAcquireLeaseExceptionHeaders: BlobAcquireLeaseExceptionHeaders, + BlobReleaseLeaseHeaders: BlobReleaseLeaseHeaders, + BlobReleaseLeaseExceptionHeaders: BlobReleaseLeaseExceptionHeaders, + BlobRenewLeaseHeaders: BlobRenewLeaseHeaders, + BlobRenewLeaseExceptionHeaders: BlobRenewLeaseExceptionHeaders, + BlobChangeLeaseHeaders: BlobChangeLeaseHeaders, + BlobChangeLeaseExceptionHeaders: BlobChangeLeaseExceptionHeaders, + BlobBreakLeaseHeaders: BlobBreakLeaseHeaders, + BlobBreakLeaseExceptionHeaders: BlobBreakLeaseExceptionHeaders, + BlobCreateSnapshotHeaders: BlobCreateSnapshotHeaders, + BlobCreateSnapshotExceptionHeaders: BlobCreateSnapshotExceptionHeaders, + BlobStartCopyFromURLHeaders: BlobStartCopyFromURLHeaders, + BlobStartCopyFromURLExceptionHeaders: BlobStartCopyFromURLExceptionHeaders, + BlobCopyFromURLHeaders: BlobCopyFromURLHeaders, + BlobCopyFromURLExceptionHeaders: BlobCopyFromURLExceptionHeaders, + BlobAbortCopyFromURLHeaders: BlobAbortCopyFromURLHeaders, + BlobAbortCopyFromURLExceptionHeaders: BlobAbortCopyFromURLExceptionHeaders, + BlobSetTierHeaders: BlobSetTierHeaders, + BlobSetTierExceptionHeaders: BlobSetTierExceptionHeaders, + BlobGetAccountInfoHeaders: BlobGetAccountInfoHeaders, + BlobGetAccountInfoExceptionHeaders: BlobGetAccountInfoExceptionHeaders, + BlobQueryHeaders: BlobQueryHeaders, + BlobQueryExceptionHeaders: BlobQueryExceptionHeaders, + BlobGetTagsHeaders: BlobGetTagsHeaders, + BlobGetTagsExceptionHeaders: BlobGetTagsExceptionHeaders, + BlobSetTagsHeaders: BlobSetTagsHeaders, + BlobSetTagsExceptionHeaders: BlobSetTagsExceptionHeaders, + PageBlobCreateHeaders: PageBlobCreateHeaders, + PageBlobCreateExceptionHeaders: PageBlobCreateExceptionHeaders, + PageBlobUploadPagesHeaders: PageBlobUploadPagesHeaders, + PageBlobUploadPagesExceptionHeaders: PageBlobUploadPagesExceptionHeaders, + PageBlobClearPagesHeaders: PageBlobClearPagesHeaders, + PageBlobClearPagesExceptionHeaders: PageBlobClearPagesExceptionHeaders, + PageBlobUploadPagesFromURLHeaders: PageBlobUploadPagesFromURLHeaders, + PageBlobUploadPagesFromURLExceptionHeaders: PageBlobUploadPagesFromURLExceptionHeaders, + PageBlobGetPageRangesHeaders: PageBlobGetPageRangesHeaders, + PageBlobGetPageRangesExceptionHeaders: PageBlobGetPageRangesExceptionHeaders, + PageBlobGetPageRangesDiffHeaders: PageBlobGetPageRangesDiffHeaders, + PageBlobGetPageRangesDiffExceptionHeaders: PageBlobGetPageRangesDiffExceptionHeaders, + PageBlobResizeHeaders: PageBlobResizeHeaders, + PageBlobResizeExceptionHeaders: PageBlobResizeExceptionHeaders, + PageBlobUpdateSequenceNumberHeaders: PageBlobUpdateSequenceNumberHeaders, + PageBlobUpdateSequenceNumberExceptionHeaders: PageBlobUpdateSequenceNumberExceptionHeaders, + PageBlobCopyIncrementalHeaders: PageBlobCopyIncrementalHeaders, + PageBlobCopyIncrementalExceptionHeaders: PageBlobCopyIncrementalExceptionHeaders, + AppendBlobCreateHeaders: AppendBlobCreateHeaders, + AppendBlobCreateExceptionHeaders: AppendBlobCreateExceptionHeaders, + AppendBlobAppendBlockHeaders: AppendBlobAppendBlockHeaders, + AppendBlobAppendBlockExceptionHeaders: AppendBlobAppendBlockExceptionHeaders, + AppendBlobAppendBlockFromUrlHeaders: AppendBlobAppendBlockFromUrlHeaders, + AppendBlobAppendBlockFromUrlExceptionHeaders: AppendBlobAppendBlockFromUrlExceptionHeaders, + AppendBlobSealHeaders: AppendBlobSealHeaders, + AppendBlobSealExceptionHeaders: AppendBlobSealExceptionHeaders, + BlockBlobUploadHeaders: BlockBlobUploadHeaders, + BlockBlobUploadExceptionHeaders: BlockBlobUploadExceptionHeaders, + BlockBlobPutBlobFromUrlHeaders: BlockBlobPutBlobFromUrlHeaders, + BlockBlobPutBlobFromUrlExceptionHeaders: BlockBlobPutBlobFromUrlExceptionHeaders, + BlockBlobStageBlockHeaders: BlockBlobStageBlockHeaders, + BlockBlobStageBlockExceptionHeaders: BlockBlobStageBlockExceptionHeaders, + BlockBlobStageBlockFromURLHeaders: BlockBlobStageBlockFromURLHeaders, + BlockBlobStageBlockFromURLExceptionHeaders: BlockBlobStageBlockFromURLExceptionHeaders, + BlockBlobCommitBlockListHeaders: BlockBlobCommitBlockListHeaders, + BlockBlobCommitBlockListExceptionHeaders: BlockBlobCommitBlockListExceptionHeaders, + BlockBlobGetBlockListHeaders: BlockBlobGetBlockListHeaders, + BlockBlobGetBlockListExceptionHeaders: BlockBlobGetBlockListExceptionHeaders }); /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -var access = { - parameterPath: [ - "options", - "access" - ], +var contentType = { + parameterPath: ["options", "contentType"], mapper: { - serializedName: "x-ms-blob-public-access", + defaultValue: "application/xml", + isConstant: true, + serializedName: "Content-Type", type: { name: "String" } } }; -var action0 = { - parameterPath: "action", +var blobServiceProperties = { + parameterPath: "blobServiceProperties", + mapper: BlobServiceProperties +}; +var accept = { + parameterPath: "accept", mapper: { - required: true, + defaultValue: "application/xml", isConstant: true, - serializedName: "x-ms-lease-action", - defaultValue: 'acquire', + serializedName: "Accept", type: { name: "String" } } }; -var action1 = { - parameterPath: "action", +var url = { + parameterPath: "url", mapper: { + serializedName: "url", required: true, - isConstant: true, - serializedName: "x-ms-lease-action", - defaultValue: 'release', + xmlName: "url", type: { name: "String" } - } + }, + skipEncoding: true }; -var action2 = { - parameterPath: "action", +var restype = { + parameterPath: "restype", mapper: { - required: true, + defaultValue: "service", isConstant: true, - serializedName: "x-ms-lease-action", - defaultValue: 'renew', + serializedName: "restype", type: { name: "String" } } }; -var action3 = { - parameterPath: "action", +var comp = { + parameterPath: "comp", mapper: { - required: true, + defaultValue: "properties", isConstant: true, - serializedName: "x-ms-lease-action", - defaultValue: 'break', + serializedName: "comp", type: { name: "String" } } }; -var action4 = { - parameterPath: "action", +var timeoutInSeconds = { + parameterPath: ["options", "timeoutInSeconds"], mapper: { - required: true, - isConstant: true, - serializedName: "x-ms-lease-action", - defaultValue: 'change', + constraints: { + InclusiveMinimum: 0 + }, + serializedName: "timeout", + xmlName: "timeout", type: { - name: "String" + name: "Number" } } }; -var action5 = { - parameterPath: "action", +var version = { + parameterPath: "version", mapper: { - required: true, + defaultValue: "2020-08-04", isConstant: true, - serializedName: "action", - defaultValue: 'setAccessControl', + serializedName: "x-ms-version", type: { name: "String" } } }; -var action6 = { - parameterPath: "action", +var requestId = { + parameterPath: ["options", "requestId"], mapper: { - required: true, - isConstant: true, - serializedName: "action", - defaultValue: 'getAccessControl', + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } } }; -var appendPosition = { - parameterPath: [ - "options", - "appendPositionAccessConditions", - "appendPosition" - ], +var accept1 = { + parameterPath: "accept", mapper: { - serializedName: "x-ms-blob-condition-appendpos", + defaultValue: "application/xml", + isConstant: true, + serializedName: "Accept", type: { - name: "Number" + name: "String" } } }; -var blobCacheControl = { - parameterPath: [ - "options", - "blobHTTPHeaders", - "blobCacheControl" - ], +var comp1 = { + parameterPath: "comp", mapper: { - serializedName: "x-ms-blob-cache-control", + defaultValue: "stats", + isConstant: true, + serializedName: "comp", type: { name: "String" } } }; -var blobContentDisposition = { - parameterPath: [ - "options", - "blobHTTPHeaders", - "blobContentDisposition" - ], +var comp2 = { + parameterPath: "comp", mapper: { - serializedName: "x-ms-blob-content-disposition", + defaultValue: "list", + isConstant: true, + serializedName: "comp", type: { name: "String" } } }; -var blobContentEncoding = { - parameterPath: [ - "options", - "blobHTTPHeaders", - "blobContentEncoding" - ], +var prefix = { + parameterPath: ["options", "prefix"], mapper: { - serializedName: "x-ms-blob-content-encoding", + serializedName: "prefix", + xmlName: "prefix", type: { name: "String" } } }; -var blobContentLanguage = { - parameterPath: [ - "options", - "blobHTTPHeaders", - "blobContentLanguage" - ], +var marker = { + parameterPath: ["options", "marker"], mapper: { - serializedName: "x-ms-blob-content-language", + serializedName: "marker", + xmlName: "marker", type: { name: "String" } } }; -var blobContentLength = { - parameterPath: "blobContentLength", +var maxPageSize = { + parameterPath: ["options", "maxPageSize"], mapper: { - required: true, - serializedName: "x-ms-blob-content-length", + constraints: { + InclusiveMinimum: 1 + }, + serializedName: "maxresults", + xmlName: "maxresults", type: { name: "Number" } } }; -var blobContentMD5 = { - parameterPath: [ - "options", - "blobHTTPHeaders", - "blobContentMD5" - ], +var include = { + parameterPath: ["options", "include"], mapper: { - serializedName: "x-ms-blob-content-md5", + serializedName: "include", + xmlName: "include", + xmlElementName: "ListContainersIncludeType", type: { - name: "ByteArray" + name: "Sequence", + element: { + type: { + name: "Enum", + allowedValues: ["metadata", "deleted"] + } + } + } + }, + collectionFormat: coreHttp.QueryCollectionFormat.Csv +}; +var keyInfo = { + parameterPath: "keyInfo", + mapper: KeyInfo +}; +var comp3 = { + parameterPath: "comp", + mapper: { + defaultValue: "userdelegationkey", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; -var blobContentType = { - parameterPath: [ - "options", - "blobHTTPHeaders", - "blobContentType" - ], +var restype1 = { + parameterPath: "restype", mapper: { - serializedName: "x-ms-blob-content-type", + defaultValue: "account", + isConstant: true, + serializedName: "restype", type: { name: "String" } } }; -var blobDeleteType = { - parameterPath: [ - "options", - "blobDeleteType" - ], +var body = { + parameterPath: "body", mapper: { - serializedName: "deletetype", + serializedName: "body", + required: true, + xmlName: "body", type: { - name: "Enum", - allowedValues: [ - "Permanent" - ] + name: "Stream" } } }; -var blobSequenceNumber = { - parameterPath: [ - "options", - "blobSequenceNumber" - ], +var comp4 = { + parameterPath: "comp", mapper: { - serializedName: "x-ms-blob-sequence-number", - defaultValue: 0, + defaultValue: "batch", + isConstant: true, + serializedName: "comp", + type: { + name: "String" + } + } +}; +var contentLength = { + parameterPath: "contentLength", + mapper: { + serializedName: "Content-Length", + required: true, + xmlName: "Content-Length", type: { name: "Number" } } }; -var blobTagsString = { - parameterPath: [ - "options", - "blobTagsString" - ], +var multipartContentType = { + parameterPath: "multipartContentType", mapper: { - serializedName: "x-ms-tags", + serializedName: "Content-Type", + required: true, + xmlName: "Content-Type", type: { name: "String" } } }; -var blobType0 = { - parameterPath: "blobType", +var comp5 = { + parameterPath: "comp", mapper: { - required: true, + defaultValue: "blobs", isConstant: true, - serializedName: "x-ms-blob-type", - defaultValue: 'PageBlob', + serializedName: "comp", type: { name: "String" } } }; -var blobType1 = { - parameterPath: "blobType", +var where = { + parameterPath: ["options", "where"], mapper: { - required: true, - isConstant: true, - serializedName: "x-ms-blob-type", - defaultValue: 'AppendBlob', + serializedName: "where", + xmlName: "where", type: { name: "String" } } }; -var blobType2 = { - parameterPath: "blobType", +var restype2 = { + parameterPath: "restype", mapper: { - required: true, + defaultValue: "container", isConstant: true, - serializedName: "x-ms-blob-type", - defaultValue: 'BlockBlob', + serializedName: "restype", type: { name: "String" } } }; -var blockId = { - parameterPath: "blockId", +var metadata = { + parameterPath: ["options", "metadata"], mapper: { - required: true, - serializedName: "blockid", + serializedName: "x-ms-meta", + xmlName: "x-ms-meta", type: { - name: "String" + name: "Dictionary", + value: { type: { name: "String" } } + }, + headerCollectionPrefix: "x-ms-meta-" + } +}; +var access = { + parameterPath: ["options", "access"], + mapper: { + serializedName: "x-ms-blob-public-access", + xmlName: "x-ms-blob-public-access", + type: { + name: "Enum", + allowedValues: ["container", "blob"] } } }; -var breakPeriod = { +var defaultEncryptionScope = { parameterPath: [ "options", - "breakPeriod" + "containerEncryptionScope", + "defaultEncryptionScope" ], mapper: { - serializedName: "x-ms-lease-break-period", + serializedName: "x-ms-default-encryption-scope", + xmlName: "x-ms-default-encryption-scope", type: { - name: "Number" + name: "String" } } }; -var cacheControl = { +var preventEncryptionScopeOverride = { parameterPath: [ "options", - "directoryHttpHeaders", - "cacheControl" + "containerEncryptionScope", + "preventEncryptionScopeOverride" ], mapper: { - serializedName: "x-ms-cache-control", + serializedName: "x-ms-deny-encryption-scope-override", + xmlName: "x-ms-deny-encryption-scope-override", type: { - name: "String" + name: "Boolean" } } }; -var comp0 = { - parameterPath: "comp", +var leaseId = { + parameterPath: ["options", "leaseAccessConditions", "leaseId"], mapper: { - required: true, - isConstant: true, - serializedName: "comp", - defaultValue: 'properties', + serializedName: "x-ms-lease-id", + xmlName: "x-ms-lease-id", type: { name: "String" } } }; -var comp1 = { +var ifModifiedSince = { + parameterPath: ["options", "modifiedAccessConditions", "ifModifiedSince"], + mapper: { + serializedName: "If-Modified-Since", + xmlName: "If-Modified-Since", + type: { + name: "DateTimeRfc1123" + } + } +}; +var ifUnmodifiedSince = { + parameterPath: ["options", "modifiedAccessConditions", "ifUnmodifiedSince"], + mapper: { + serializedName: "If-Unmodified-Since", + xmlName: "If-Unmodified-Since", + type: { + name: "DateTimeRfc1123" + } + } +}; +var comp6 = { parameterPath: "comp", mapper: { - required: true, + defaultValue: "metadata", isConstant: true, serializedName: "comp", - defaultValue: 'stats', type: { name: "String" } } }; -var comp10 = { +var comp7 = { parameterPath: "comp", mapper: { - required: true, + defaultValue: "acl", isConstant: true, serializedName: "comp", - defaultValue: 'lease', type: { name: "String" } } }; -var comp11 = { +var containerAcl = { + parameterPath: ["options", "containerAcl"], + mapper: { + serializedName: "containerAcl", + xmlName: "SignedIdentifiers", + xmlIsWrapped: true, + xmlElementName: "SignedIdentifier", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SignedIdentifier" + } + } + } + } +}; +var comp8 = { parameterPath: "comp", mapper: { - required: true, + defaultValue: "undelete", isConstant: true, serializedName: "comp", - defaultValue: 'expiry', type: { name: "String" } } }; -var comp12 = { - parameterPath: "comp", +var deletedContainerName = { + parameterPath: ["options", "deletedContainerName"], mapper: { - required: true, - isConstant: true, - serializedName: "comp", - defaultValue: 'snapshot', + serializedName: "x-ms-deleted-container-name", + xmlName: "x-ms-deleted-container-name", type: { name: "String" } } }; -var comp13 = { - parameterPath: "comp", +var deletedContainerVersion = { + parameterPath: ["options", "deletedContainerVersion"], mapper: { - required: true, - isConstant: true, - serializedName: "comp", - defaultValue: 'copy', + serializedName: "x-ms-deleted-container-version", + xmlName: "x-ms-deleted-container-version", type: { name: "String" } } }; -var comp14 = { +var comp9 = { parameterPath: "comp", mapper: { - required: true, + defaultValue: "rename", isConstant: true, serializedName: "comp", - defaultValue: 'tier', type: { name: "String" } } }; -var comp15 = { - parameterPath: "comp", +var sourceContainerName = { + parameterPath: "sourceContainerName", mapper: { + serializedName: "x-ms-source-container-name", required: true, - isConstant: true, - serializedName: "comp", - defaultValue: 'query', + xmlName: "x-ms-source-container-name", type: { name: "String" } } }; -var comp16 = { - parameterPath: "comp", +var sourceLeaseId = { + parameterPath: ["options", "sourceLeaseId"], mapper: { - required: true, - isConstant: true, - serializedName: "comp", - defaultValue: 'tags', + serializedName: "x-ms-source-lease-id", + xmlName: "x-ms-source-lease-id", type: { name: "String" } } }; -var comp17 = { +var comp10 = { parameterPath: "comp", mapper: { - required: true, + defaultValue: "lease", isConstant: true, serializedName: "comp", - defaultValue: 'page', type: { name: "String" } } }; -var comp18 = { - parameterPath: "comp", +var action = { + parameterPath: "action", mapper: { - required: true, + defaultValue: "acquire", isConstant: true, - serializedName: "comp", - defaultValue: 'pagelist', + serializedName: "x-ms-lease-action", type: { name: "String" } } }; -var comp19 = { - parameterPath: "comp", +var duration = { + parameterPath: ["options", "duration"], mapper: { - required: true, - isConstant: true, - serializedName: "comp", - defaultValue: 'incrementalcopy', + serializedName: "x-ms-lease-duration", + xmlName: "x-ms-lease-duration", + type: { + name: "Number" + } + } +}; +var proposedLeaseId = { + parameterPath: ["options", "proposedLeaseId"], + mapper: { + serializedName: "x-ms-proposed-lease-id", + xmlName: "x-ms-proposed-lease-id", type: { name: "String" } } }; -var comp2 = { - parameterPath: "comp", +var action1 = { + parameterPath: "action", mapper: { - required: true, + defaultValue: "release", isConstant: true, - serializedName: "comp", - defaultValue: 'list', + serializedName: "x-ms-lease-action", type: { name: "String" } } }; -var comp20 = { - parameterPath: "comp", +var leaseId1 = { + parameterPath: "leaseId", mapper: { + serializedName: "x-ms-lease-id", required: true, - isConstant: true, - serializedName: "comp", - defaultValue: 'appendblock', + xmlName: "x-ms-lease-id", type: { name: "String" } } }; -var comp21 = { - parameterPath: "comp", +var action2 = { + parameterPath: "action", mapper: { - required: true, + defaultValue: "renew", isConstant: true, - serializedName: "comp", - defaultValue: 'seal', + serializedName: "x-ms-lease-action", type: { name: "String" } } }; -var comp22 = { - parameterPath: "comp", +var action3 = { + parameterPath: "action", mapper: { - required: true, + defaultValue: "break", isConstant: true, - serializedName: "comp", - defaultValue: 'block', + serializedName: "x-ms-lease-action", type: { name: "String" } } }; -var comp23 = { - parameterPath: "comp", +var breakPeriod = { + parameterPath: ["options", "breakPeriod"], mapper: { - required: true, - isConstant: true, - serializedName: "comp", - defaultValue: 'blocklist', + serializedName: "x-ms-lease-break-period", + xmlName: "x-ms-lease-break-period", type: { - name: "String" + name: "Number" } } }; -var comp3 = { - parameterPath: "comp", +var action4 = { + parameterPath: "action", mapper: { - required: true, + defaultValue: "change", isConstant: true, - serializedName: "comp", - defaultValue: 'userdelegationkey', + serializedName: "x-ms-lease-action", type: { name: "String" } } }; -var comp4 = { - parameterPath: "comp", +var proposedLeaseId1 = { + parameterPath: "proposedLeaseId", mapper: { + serializedName: "x-ms-proposed-lease-id", required: true, - isConstant: true, - serializedName: "comp", - defaultValue: 'batch', + xmlName: "x-ms-proposed-lease-id", type: { name: "String" } } }; -var comp5 = { - parameterPath: "comp", +var include1 = { + parameterPath: ["options", "include"], + mapper: { + serializedName: "include", + xmlName: "include", + xmlElementName: "ListBlobsIncludeItem", + type: { + name: "Sequence", + element: { + type: { + name: "Enum", + allowedValues: [ + "copy", + "deleted", + "metadata", + "snapshots", + "uncommittedblobs", + "versions", + "tags" + ] + } + } + } + }, + collectionFormat: coreHttp.QueryCollectionFormat.Csv +}; +var delimiter = { + parameterPath: "delimiter", mapper: { + serializedName: "delimiter", required: true, - isConstant: true, - serializedName: "comp", - defaultValue: 'blobs', + xmlName: "delimiter", type: { name: "String" } } }; -var comp6 = { - parameterPath: "comp", +var directoryProperties = { + parameterPath: ["options", "directoryProperties"], mapper: { - required: true, - isConstant: true, - serializedName: "comp", - defaultValue: 'metadata', + serializedName: "x-ms-properties", + xmlName: "x-ms-properties", type: { name: "String" } } }; -var comp7 = { - parameterPath: "comp", +var posixPermissions = { + parameterPath: ["options", "posixPermissions"], mapper: { - required: true, - isConstant: true, - serializedName: "comp", - defaultValue: 'acl', + serializedName: "x-ms-permissions", + xmlName: "x-ms-permissions", type: { name: "String" } } }; -var comp8 = { - parameterPath: "comp", +var posixUmask = { + parameterPath: ["options", "posixUmask"], mapper: { - required: true, - isConstant: true, - serializedName: "comp", - defaultValue: 'undelete', + serializedName: "x-ms-umask", + xmlName: "x-ms-umask", type: { name: "String" } } }; -var comp9 = { - parameterPath: "comp", +var cacheControl = { + parameterPath: ["options", "directoryHttpHeaders", "cacheControl"], mapper: { - required: true, - isConstant: true, - serializedName: "comp", - defaultValue: 'rename', + serializedName: "x-ms-cache-control", + xmlName: "x-ms-cache-control", type: { name: "String" } } }; -var contentDisposition = { - parameterPath: [ - "options", - "directoryHttpHeaders", - "contentDisposition" - ], +var contentType1 = { + parameterPath: ["options", "directoryHttpHeaders", "contentType"], mapper: { - serializedName: "x-ms-content-disposition", + serializedName: "x-ms-content-type", + xmlName: "x-ms-content-type", type: { name: "String" } } }; var contentEncoding = { - parameterPath: [ - "options", - "directoryHttpHeaders", - "contentEncoding" - ], + parameterPath: ["options", "directoryHttpHeaders", "contentEncoding"], mapper: { serializedName: "x-ms-content-encoding", + xmlName: "x-ms-content-encoding", type: { name: "String" } } }; var contentLanguage = { - parameterPath: [ - "options", - "directoryHttpHeaders", - "contentLanguage" - ], + parameterPath: ["options", "directoryHttpHeaders", "contentLanguage"], mapper: { serializedName: "x-ms-content-language", + xmlName: "x-ms-content-language", type: { name: "String" } } }; -var contentLength = { - parameterPath: "contentLength", +var contentDisposition = { + parameterPath: ["options", "directoryHttpHeaders", "contentDisposition"], mapper: { - required: true, - serializedName: "Content-Length", + serializedName: "x-ms-content-disposition", + xmlName: "x-ms-content-disposition", type: { - name: "Number" + name: "String" } } }; -var contentType = { - parameterPath: [ - "options", - "directoryHttpHeaders", - "contentType" - ], +var ifMatch = { + parameterPath: ["options", "modifiedAccessConditions", "ifMatch"], mapper: { - serializedName: "x-ms-content-type", + serializedName: "If-Match", + xmlName: "If-Match", type: { name: "String" } } }; -var copyActionAbortConstant = { - parameterPath: "copyActionAbortConstant", +var ifNoneMatch = { + parameterPath: ["options", "modifiedAccessConditions", "ifNoneMatch"], mapper: { - required: true, - isConstant: true, - serializedName: "x-ms-copy-action", - defaultValue: 'abort', + serializedName: "If-None-Match", + xmlName: "If-None-Match", type: { name: "String" } } }; -var copyId = { - parameterPath: "copyId", +var pathRenameMode = { + parameterPath: ["options", "pathRenameMode"], mapper: { - required: true, - serializedName: "copyid", + serializedName: "mode", + xmlName: "mode", type: { - name: "String" + name: "Enum", + allowedValues: ["legacy", "posix"] } } }; -var copySource = { - parameterPath: "copySource", +var renameSource = { + parameterPath: "renameSource", mapper: { + serializedName: "x-ms-rename-source", required: true, - serializedName: "x-ms-copy-source", + xmlName: "x-ms-rename-source", type: { name: "String" } } }; -var copySourceBlobProperties = { +var sourceIfModifiedSince = { parameterPath: [ "options", - "copySourceBlobProperties" + "sourceModifiedAccessConditions", + "sourceIfModifiedSince" ], mapper: { - serializedName: "x-ms-copy-source-blob-properties", + serializedName: "x-ms-source-if-modified-since", + xmlName: "x-ms-source-if-modified-since", type: { - name: "Boolean" + name: "DateTimeRfc1123" } } }; -var defaultEncryptionScope = { +var sourceIfUnmodifiedSince = { parameterPath: [ "options", - "containerEncryptionScope", - "defaultEncryptionScope" + "sourceModifiedAccessConditions", + "sourceIfUnmodifiedSince" ], mapper: { - serializedName: "x-ms-default-encryption-scope", + serializedName: "x-ms-source-if-unmodified-since", + xmlName: "x-ms-source-if-unmodified-since", type: { - name: "String" + name: "DateTimeRfc1123" } } }; -var deletedContainerName = { - parameterPath: [ - "options", - "deletedContainerName" - ], +var sourceIfMatch = { + parameterPath: ["options", "sourceModifiedAccessConditions", "sourceIfMatch"], mapper: { - serializedName: "x-ms-deleted-container-name", + serializedName: "x-ms-source-if-match", + xmlName: "x-ms-source-if-match", type: { name: "String" } } }; -var deletedContainerVersion = { +var sourceIfNoneMatch = { parameterPath: [ "options", - "deletedContainerVersion" + "sourceModifiedAccessConditions", + "sourceIfNoneMatch" ], mapper: { - serializedName: "x-ms-deleted-container-version", + serializedName: "x-ms-source-if-none-match", + xmlName: "x-ms-source-if-none-match", type: { name: "String" } } }; -var deleteSnapshots = { - parameterPath: [ - "options", - "deleteSnapshots" - ], +var action5 = { + parameterPath: "action", mapper: { - serializedName: "x-ms-delete-snapshots", + defaultValue: "setAccessControl", + isConstant: true, + serializedName: "action", type: { - name: "Enum", - allowedValues: [ - "include", - "only" - ] + name: "String" } } }; -var delimiter = { - parameterPath: "delimiter", +var owner = { + parameterPath: ["options", "owner"], mapper: { - required: true, - serializedName: "delimiter", + serializedName: "x-ms-owner", + xmlName: "x-ms-owner", type: { name: "String" } } }; -var directoryProperties = { - parameterPath: [ - "options", - "directoryProperties" - ], +var group = { + parameterPath: ["options", "group"], mapper: { - serializedName: "x-ms-properties", + serializedName: "x-ms-group", + xmlName: "x-ms-group", type: { name: "String" } } }; -var duration = { - parameterPath: [ - "options", - "duration" - ], +var posixAcl = { + parameterPath: ["options", "posixAcl"], mapper: { - serializedName: "x-ms-lease-duration", + serializedName: "x-ms-acl", + xmlName: "x-ms-acl", type: { - name: "Number" + name: "String" } } }; -var encryptionAlgorithm = { - parameterPath: [ - "options", - "cpkInfo", - "encryptionAlgorithm" - ], +var action6 = { + parameterPath: "action", mapper: { - serializedName: "x-ms-encryption-algorithm", + defaultValue: "getAccessControl", + isConstant: true, + serializedName: "action", type: { - name: "Enum", - allowedValues: [ - "AES256" - ] + name: "String" } } }; -var encryptionKey = { - parameterPath: [ - "options", - "cpkInfo", - "encryptionKey" - ], +var upn = { + parameterPath: ["options", "upn"], mapper: { - serializedName: "x-ms-encryption-key", + serializedName: "upn", + xmlName: "upn", type: { - name: "String" + name: "Boolean" } } }; -var encryptionKeySha256 = { - parameterPath: [ - "options", - "cpkInfo", - "encryptionKeySha256" - ], +var snapshot = { + parameterPath: ["options", "snapshot"], mapper: { - serializedName: "x-ms-encryption-key-sha256", + serializedName: "snapshot", + xmlName: "snapshot", type: { name: "String" } } }; -var encryptionScope = { - parameterPath: [ - "options", - "encryptionScope" - ], +var versionId = { + parameterPath: ["options", "versionId"], mapper: { - serializedName: "x-ms-encryption-scope", + serializedName: "versionid", + xmlName: "versionid", type: { name: "String" } } }; -var expiresOn = { - parameterPath: [ - "options", - "expiresOn" - ], +var range = { + parameterPath: ["options", "range"], mapper: { - serializedName: "x-ms-expiry-time", + serializedName: "x-ms-range", + xmlName: "x-ms-range", type: { name: "String" } } }; -var expiryOptions = { - parameterPath: "expiryOptions", +var rangeGetContentMD5 = { + parameterPath: ["options", "rangeGetContentMD5"], mapper: { - required: true, - serializedName: "x-ms-expiry-option", + serializedName: "x-ms-range-get-content-md5", + xmlName: "x-ms-range-get-content-md5", type: { - name: "String" + name: "Boolean" } } }; -var group = { - parameterPath: [ - "options", - "group" - ], +var rangeGetContentCRC64 = { + parameterPath: ["options", "rangeGetContentCRC64"], mapper: { - serializedName: "x-ms-group", + serializedName: "x-ms-range-get-content-crc64", + xmlName: "x-ms-range-get-content-crc64", type: { - name: "String" + name: "Boolean" } } }; -var ifMatch = { - parameterPath: [ - "options", - "modifiedAccessConditions", - "ifMatch" - ], +var encryptionKey = { + parameterPath: ["options", "cpkInfo", "encryptionKey"], mapper: { - serializedName: "If-Match", + serializedName: "x-ms-encryption-key", + xmlName: "x-ms-encryption-key", type: { name: "String" } } }; -var ifModifiedSince = { - parameterPath: [ - "options", - "modifiedAccessConditions", - "ifModifiedSince" - ], +var encryptionKeySha256 = { + parameterPath: ["options", "cpkInfo", "encryptionKeySha256"], mapper: { - serializedName: "If-Modified-Since", + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { - name: "DateTimeRfc1123" + name: "String" } } }; -var ifNoneMatch = { - parameterPath: [ - "options", - "modifiedAccessConditions", - "ifNoneMatch" - ], +var encryptionAlgorithm = { + parameterPath: ["options", "encryptionAlgorithm"], mapper: { - serializedName: "If-None-Match", + defaultValue: "AES256", + isConstant: true, + serializedName: "x-ms-encryption-algorithm", type: { name: "String" } } }; -var ifSequenceNumberEqualTo = { - parameterPath: [ - "options", - "sequenceNumberAccessConditions", - "ifSequenceNumberEqualTo" - ], +var ifTags = { + parameterPath: ["options", "modifiedAccessConditions", "ifTags"], mapper: { - serializedName: "x-ms-if-sequence-number-eq", + serializedName: "x-ms-if-tags", + xmlName: "x-ms-if-tags", type: { - name: "Number" + name: "String" } } }; -var ifSequenceNumberLessThan = { - parameterPath: [ - "options", - "sequenceNumberAccessConditions", - "ifSequenceNumberLessThan" - ], +var deleteSnapshots = { + parameterPath: ["options", "deleteSnapshots"], mapper: { - serializedName: "x-ms-if-sequence-number-lt", + serializedName: "x-ms-delete-snapshots", + xmlName: "x-ms-delete-snapshots", type: { - name: "Number" + name: "Enum", + allowedValues: ["include", "only"] } } }; -var ifSequenceNumberLessThanOrEqualTo = { - parameterPath: [ - "options", - "sequenceNumberAccessConditions", - "ifSequenceNumberLessThanOrEqualTo" - ], +var blobDeleteType = { + parameterPath: ["options", "blobDeleteType"], mapper: { - serializedName: "x-ms-if-sequence-number-le", + serializedName: "deletetype", + xmlName: "deletetype", type: { - name: "Number" + name: "String" } } }; -var ifTags = { - parameterPath: [ - "options", - "modifiedAccessConditions", - "ifTags" - ], +var comp11 = { + parameterPath: "comp", mapper: { - serializedName: "x-ms-if-tags", + defaultValue: "expiry", + isConstant: true, + serializedName: "comp", type: { name: "String" } } }; -var ifUnmodifiedSince = { - parameterPath: [ - "options", - "modifiedAccessConditions", - "ifUnmodifiedSince" - ], +var expiryOptions = { + parameterPath: "expiryOptions", mapper: { - serializedName: "If-Unmodified-Since", + serializedName: "x-ms-expiry-option", + required: true, + xmlName: "x-ms-expiry-option", type: { - name: "DateTimeRfc1123" + name: "String" } } }; -var include0 = { - parameterPath: [ - "options", - "include" - ], - mapper: { - serializedName: "include", - type: { - name: "Sequence", - element: { - type: { - name: "Enum", - allowedValues: [ - "metadata", - "deleted" - ] - } - } - } - }, - collectionFormat: coreHttp.QueryCollectionFormat.Csv -}; -var include1 = { - parameterPath: [ - "options", - "include" - ], +var expiresOn = { + parameterPath: ["options", "expiresOn"], mapper: { - serializedName: "include", + serializedName: "x-ms-expiry-time", + xmlName: "x-ms-expiry-time", type: { - name: "Sequence", - element: { - type: { - name: "Enum", - allowedValues: [ - "copy", - "deleted", - "metadata", - "snapshots", - "uncommittedblobs", - "versions", - "tags" - ] - } - } + name: "String" } - }, - collectionFormat: coreHttp.QueryCollectionFormat.Csv + } }; -var leaseId0 = { - parameterPath: [ - "options", - "leaseAccessConditions", - "leaseId" - ], +var blobCacheControl = { + parameterPath: ["options", "blobHttpHeaders", "blobCacheControl"], mapper: { - serializedName: "x-ms-lease-id", + serializedName: "x-ms-blob-cache-control", + xmlName: "x-ms-blob-cache-control", type: { name: "String" } } }; -var leaseId1 = { - parameterPath: "leaseId", +var blobContentType = { + parameterPath: ["options", "blobHttpHeaders", "blobContentType"], mapper: { - required: true, - serializedName: "x-ms-lease-id", + serializedName: "x-ms-blob-content-type", + xmlName: "x-ms-blob-content-type", type: { name: "String" } } }; -var listType = { - parameterPath: "listType", +var blobContentMD5 = { + parameterPath: ["options", "blobHttpHeaders", "blobContentMD5"], mapper: { - required: true, - serializedName: "blocklisttype", - defaultValue: 'committed', + serializedName: "x-ms-blob-content-md5", + xmlName: "x-ms-blob-content-md5", type: { - name: "Enum", - allowedValues: [ - "committed", - "uncommitted", - "all" - ] + name: "ByteArray" } } }; -var marker0 = { - parameterPath: [ - "options", - "marker" - ], +var blobContentEncoding = { + parameterPath: ["options", "blobHttpHeaders", "blobContentEncoding"], mapper: { - serializedName: "marker", + serializedName: "x-ms-blob-content-encoding", + xmlName: "x-ms-blob-content-encoding", type: { name: "String" } } }; -var maxPageSize = { - parameterPath: [ - "options", - "maxPageSize" - ], +var blobContentLanguage = { + parameterPath: ["options", "blobHttpHeaders", "blobContentLanguage"], mapper: { - serializedName: "maxresults", - constraints: { - InclusiveMinimum: 1 - }, + serializedName: "x-ms-blob-content-language", + xmlName: "x-ms-blob-content-language", type: { - name: "Number" + name: "String" } } }; -var maxSize = { - parameterPath: [ - "options", - "appendPositionAccessConditions", - "maxSize" - ], +var blobContentDisposition = { + parameterPath: ["options", "blobHttpHeaders", "blobContentDisposition"], mapper: { - serializedName: "x-ms-blob-condition-maxsize", + serializedName: "x-ms-blob-content-disposition", + xmlName: "x-ms-blob-content-disposition", type: { - name: "Number" + name: "String" } } }; -var metadata = { - parameterPath: [ - "options", - "metadata" - ], +var encryptionScope = { + parameterPath: ["options", "encryptionScope"], mapper: { - serializedName: "x-ms-meta", + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { - name: "Dictionary", - value: { - type: { - name: "String" - } - } - }, - headerCollectionPrefix: "x-ms-meta-" + name: "String" + } } }; -var multipartContentType = { - parameterPath: "multipartContentType", +var comp12 = { + parameterPath: "comp", mapper: { - required: true, - serializedName: "Content-Type", + defaultValue: "snapshot", + isConstant: true, + serializedName: "comp", type: { name: "String" } } }; -var owner = { - parameterPath: [ - "options", - "owner" - ], +var tier = { + parameterPath: ["options", "tier"], mapper: { - serializedName: "x-ms-owner", + serializedName: "x-ms-access-tier", + xmlName: "x-ms-access-tier", type: { - name: "String" + name: "Enum", + allowedValues: [ + "P4", + "P6", + "P10", + "P15", + "P20", + "P30", + "P40", + "P50", + "P60", + "P70", + "P80", + "Hot", + "Cool", + "Archive" + ] } } }; -var pageWrite0 = { - parameterPath: "pageWrite", +var rehydratePriority = { + parameterPath: ["options", "rehydratePriority"], mapper: { - required: true, - isConstant: true, - serializedName: "x-ms-page-write", - defaultValue: 'update', + serializedName: "x-ms-rehydrate-priority", + xmlName: "x-ms-rehydrate-priority", type: { - name: "String" + name: "Enum", + allowedValues: ["High", "Standard"] } } }; -var pageWrite1 = { - parameterPath: "pageWrite", +var sourceIfTags = { + parameterPath: ["options", "sourceModifiedAccessConditions", "sourceIfTags"], mapper: { - required: true, - isConstant: true, - serializedName: "x-ms-page-write", - defaultValue: 'clear', + serializedName: "x-ms-source-if-tags", + xmlName: "x-ms-source-if-tags", type: { name: "String" } } }; -var pathRenameMode = { - parameterPath: [ - "options", - "pathRenameMode" - ], +var copySource = { + parameterPath: "copySource", mapper: { - serializedName: "mode", + serializedName: "x-ms-copy-source", + required: true, + xmlName: "x-ms-copy-source", type: { - name: "Enum", - allowedValues: [ - "legacy", - "posix" - ] + name: "String" } } }; -var posixAcl = { - parameterPath: [ - "options", - "posixAcl" - ], +var blobTagsString = { + parameterPath: ["options", "blobTagsString"], mapper: { - serializedName: "x-ms-acl", + serializedName: "x-ms-tags", + xmlName: "x-ms-tags", type: { name: "String" } } }; -var posixPermissions = { - parameterPath: [ - "options", - "posixPermissions" - ], +var sealBlob = { + parameterPath: ["options", "sealBlob"], mapper: { - serializedName: "x-ms-permissions", + serializedName: "x-ms-seal-blob", + xmlName: "x-ms-seal-blob", type: { - name: "String" + name: "Boolean" } } }; -var posixUmask = { - parameterPath: [ - "options", - "posixUmask" - ], +var xMsRequiresSync = { + parameterPath: "xMsRequiresSync", mapper: { - serializedName: "x-ms-umask", + defaultValue: "true", + isConstant: true, + serializedName: "x-ms-requires-sync", type: { name: "String" } } }; -var prefix = { - parameterPath: [ - "options", - "prefix" - ], +var sourceContentMD5 = { + parameterPath: ["options", "sourceContentMD5"], mapper: { - serializedName: "prefix", + serializedName: "x-ms-source-content-md5", + xmlName: "x-ms-source-content-md5", type: { - name: "String" + name: "ByteArray" } } }; -var preventEncryptionScopeOverride = { - parameterPath: [ - "options", - "containerEncryptionScope", - "preventEncryptionScopeOverride" - ], +var comp13 = { + parameterPath: "comp", mapper: { - serializedName: "x-ms-deny-encryption-scope-override", + defaultValue: "copy", + isConstant: true, + serializedName: "comp", type: { - name: "Boolean" + name: "String" } } }; -var prevsnapshot = { - parameterPath: [ - "options", - "prevsnapshot" - ], +var copyActionAbortConstant = { + parameterPath: "copyActionAbortConstant", mapper: { - serializedName: "prevsnapshot", + defaultValue: "abort", + isConstant: true, + serializedName: "x-ms-copy-action", type: { name: "String" } } }; -var prevSnapshotUrl = { - parameterPath: [ - "options", - "prevSnapshotUrl" - ], +var copyId = { + parameterPath: "copyId", mapper: { - serializedName: "x-ms-previous-snapshot-url", + serializedName: "copyid", + required: true, + xmlName: "copyid", type: { name: "String" } } }; -var proposedLeaseId0 = { - parameterPath: [ - "options", - "proposedLeaseId" - ], +var comp14 = { + parameterPath: "comp", mapper: { - serializedName: "x-ms-proposed-lease-id", + defaultValue: "tier", + isConstant: true, + serializedName: "comp", type: { name: "String" } } }; -var proposedLeaseId1 = { - parameterPath: "proposedLeaseId", +var tier1 = { + parameterPath: "tier", mapper: { + serializedName: "x-ms-access-tier", required: true, - serializedName: "x-ms-proposed-lease-id", + xmlName: "x-ms-access-tier", type: { - name: "String" + name: "Enum", + allowedValues: [ + "P4", + "P6", + "P10", + "P15", + "P20", + "P30", + "P40", + "P50", + "P60", + "P70", + "P80", + "Hot", + "Cool", + "Archive" + ] } } }; -var range0 = { - parameterPath: [ - "options", - "range" - ], +var queryRequest = { + parameterPath: ["options", "queryRequest"], + mapper: QueryRequest +}; +var comp15 = { + parameterPath: "comp", mapper: { - serializedName: "x-ms-range", + defaultValue: "query", + isConstant: true, + serializedName: "comp", type: { name: "String" } } }; -var range1 = { - parameterPath: "range", +var comp16 = { + parameterPath: "comp", mapper: { - required: true, - serializedName: "x-ms-range", + defaultValue: "tags", + isConstant: true, + serializedName: "comp", type: { name: "String" } } }; -var rangeGetContentCRC64 = { - parameterPath: [ - "options", - "rangeGetContentCRC64" - ], +var tags = { + parameterPath: ["options", "tags"], + mapper: BlobTags +}; +var transactionalContentMD5 = { + parameterPath: ["options", "transactionalContentMD5"], mapper: { - serializedName: "x-ms-range-get-content-crc64", + serializedName: "Content-MD5", + xmlName: "Content-MD5", type: { - name: "Boolean" + name: "ByteArray" } } }; -var rangeGetContentMD5 = { - parameterPath: [ - "options", - "rangeGetContentMD5" - ], +var transactionalContentCrc64 = { + parameterPath: ["options", "transactionalContentCrc64"], mapper: { - serializedName: "x-ms-range-get-content-md5", + serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { - name: "Boolean" + name: "ByteArray" } } }; -var rehydratePriority = { - parameterPath: [ - "options", - "rehydratePriority" - ], +var blobType = { + parameterPath: "blobType", mapper: { - serializedName: "x-ms-rehydrate-priority", + defaultValue: "PageBlob", + isConstant: true, + serializedName: "x-ms-blob-type", type: { name: "String" } } }; -var renameSource = { - parameterPath: "renameSource", +var blobContentLength = { + parameterPath: "blobContentLength", mapper: { + serializedName: "x-ms-blob-content-length", required: true, - serializedName: "x-ms-rename-source", + xmlName: "x-ms-blob-content-length", type: { - name: "String" + name: "Number" } } }; -var requestId = { - parameterPath: [ - "options", - "requestId" - ], +var blobSequenceNumber = { + parameterPath: ["options", "blobSequenceNumber"], mapper: { - serializedName: "x-ms-client-request-id", + serializedName: "x-ms-blob-sequence-number", + xmlName: "x-ms-blob-sequence-number", type: { - name: "String" + name: "Number" } } }; -var restype0 = { - parameterPath: "restype", +var contentType2 = { + parameterPath: ["options", "contentType"], mapper: { - required: true, + defaultValue: "application/octet-stream", isConstant: true, - serializedName: "restype", - defaultValue: 'service', + serializedName: "Content-Type", type: { name: "String" } } }; -var restype1 = { - parameterPath: "restype", +var body1 = { + parameterPath: "body", mapper: { + serializedName: "body", required: true, - isConstant: true, - serializedName: "restype", - defaultValue: 'account', + xmlName: "body", type: { - name: "String" + name: "Stream" } } }; -var restype2 = { - parameterPath: "restype", +var accept2 = { + parameterPath: "accept", mapper: { - required: true, + defaultValue: "application/xml", isConstant: true, - serializedName: "restype", - defaultValue: 'container', + serializedName: "Accept", type: { name: "String" } } }; -var sealBlob = { - parameterPath: [ - "options", - "sealBlob" - ], +var comp17 = { + parameterPath: "comp", mapper: { - serializedName: "x-ms-seal-blob", + defaultValue: "page", + isConstant: true, + serializedName: "comp", type: { - name: "Boolean" + name: "String" } } }; -var sequenceNumberAction = { - parameterPath: "sequenceNumberAction", +var pageWrite = { + parameterPath: "pageWrite", mapper: { - required: true, - serializedName: "x-ms-sequence-number-action", + defaultValue: "update", + isConstant: true, + serializedName: "x-ms-page-write", type: { - name: "Enum", - allowedValues: [ - "max", - "update", - "increment" - ] + name: "String" } } }; -var snapshot = { +var ifSequenceNumberLessThanOrEqualTo = { parameterPath: [ "options", - "snapshot" + "sequenceNumberAccessConditions", + "ifSequenceNumberLessThanOrEqualTo" ], mapper: { - serializedName: "snapshot", - type: { - name: "String" - } - } -}; -var sourceContainerName = { - parameterPath: "sourceContainerName", - mapper: { - required: true, - serializedName: "x-ms-source-container-name", + serializedName: "x-ms-if-sequence-number-le", + xmlName: "x-ms-if-sequence-number-le", type: { - name: "String" + name: "Number" } } }; -var sourceContentCrc64 = { +var ifSequenceNumberLessThan = { parameterPath: [ "options", - "sourceContentCrc64" + "sequenceNumberAccessConditions", + "ifSequenceNumberLessThan" ], mapper: { - serializedName: "x-ms-source-content-crc64", + serializedName: "x-ms-if-sequence-number-lt", + xmlName: "x-ms-if-sequence-number-lt", type: { - name: "ByteArray" + name: "Number" } } }; -var sourceContentMD5 = { +var ifSequenceNumberEqualTo = { parameterPath: [ "options", - "sourceContentMD5" + "sequenceNumberAccessConditions", + "ifSequenceNumberEqualTo" ], mapper: { - serializedName: "x-ms-source-content-md5", + serializedName: "x-ms-if-sequence-number-eq", + xmlName: "x-ms-if-sequence-number-eq", type: { - name: "ByteArray" + name: "Number" } } }; -var sourceIfMatch = { - parameterPath: [ - "options", - "sourceModifiedAccessConditions", - "sourceIfMatch" - ], +var pageWrite1 = { + parameterPath: "pageWrite", mapper: { - serializedName: "x-ms-source-if-match", + defaultValue: "clear", + isConstant: true, + serializedName: "x-ms-page-write", type: { name: "String" } } }; -var sourceIfModifiedSince = { - parameterPath: [ - "options", - "sourceModifiedAccessConditions", - "sourceIfModifiedSince" - ], +var sourceUrl = { + parameterPath: "sourceUrl", mapper: { - serializedName: "x-ms-source-if-modified-since", + serializedName: "x-ms-copy-source", + required: true, + xmlName: "x-ms-copy-source", type: { - name: "DateTimeRfc1123" + name: "String" } } }; -var sourceIfNoneMatch = { - parameterPath: [ - "options", - "sourceModifiedAccessConditions", - "sourceIfNoneMatch" - ], +var sourceRange = { + parameterPath: "sourceRange", mapper: { - serializedName: "x-ms-source-if-none-match", + serializedName: "x-ms-source-range", + required: true, + xmlName: "x-ms-source-range", type: { name: "String" } } }; -var sourceIfTags = { - parameterPath: [ - "options", - "sourceModifiedAccessConditions", - "sourceIfTags" - ], +var sourceContentCrc64 = { + parameterPath: ["options", "sourceContentCrc64"], mapper: { - serializedName: "x-ms-source-if-tags", + serializedName: "x-ms-source-content-crc64", + xmlName: "x-ms-source-content-crc64", type: { - name: "String" + name: "ByteArray" } } }; -var sourceIfUnmodifiedSince = { - parameterPath: [ - "options", - "sourceModifiedAccessConditions", - "sourceIfUnmodifiedSince" - ], +var range1 = { + parameterPath: "range", mapper: { - serializedName: "x-ms-source-if-unmodified-since", + serializedName: "x-ms-range", + required: true, + xmlName: "x-ms-range", type: { - name: "DateTimeRfc1123" + name: "String" } } }; -var sourceLeaseId = { - parameterPath: [ - "options", - "sourceLeaseId" - ], +var comp18 = { + parameterPath: "comp", mapper: { - serializedName: "x-ms-source-lease-id", + defaultValue: "pagelist", + isConstant: true, + serializedName: "comp", type: { name: "String" } } }; -var sourceRange0 = { - parameterPath: "sourceRange", +var prevsnapshot = { + parameterPath: ["options", "prevsnapshot"], mapper: { - required: true, - serializedName: "x-ms-source-range", + serializedName: "prevsnapshot", + xmlName: "prevsnapshot", type: { name: "String" } } }; -var sourceRange1 = { - parameterPath: [ - "options", - "sourceRange" - ], +var prevSnapshotUrl = { + parameterPath: ["options", "prevSnapshotUrl"], mapper: { - serializedName: "x-ms-source-range", + serializedName: "x-ms-previous-snapshot-url", + xmlName: "x-ms-previous-snapshot-url", type: { name: "String" } } }; -var sourceUrl = { - parameterPath: "sourceUrl", +var sequenceNumberAction = { + parameterPath: "sequenceNumberAction", mapper: { + serializedName: "x-ms-sequence-number-action", required: true, - serializedName: "x-ms-copy-source", + xmlName: "x-ms-sequence-number-action", + type: { + name: "Enum", + allowedValues: ["max", "update", "increment"] + } + } +}; +var comp19 = { + parameterPath: "comp", + mapper: { + defaultValue: "incrementalcopy", + isConstant: true, + serializedName: "comp", type: { name: "String" } } }; -var tier0 = { - parameterPath: [ - "options", - "tier" - ], +var blobType1 = { + parameterPath: "blobType", mapper: { - serializedName: "x-ms-access-tier", + defaultValue: "AppendBlob", + isConstant: true, + serializedName: "x-ms-blob-type", type: { name: "String" } } }; -var tier1 = { - parameterPath: "tier", +var comp20 = { + parameterPath: "comp", mapper: { - required: true, - serializedName: "x-ms-access-tier", + defaultValue: "appendblock", + isConstant: true, + serializedName: "comp", type: { name: "String" } } }; -var timeoutInSeconds = { - parameterPath: [ - "options", - "timeoutInSeconds" - ], +var maxSize = { + parameterPath: ["options", "appendPositionAccessConditions", "maxSize"], mapper: { - serializedName: "timeout", - constraints: { - InclusiveMinimum: 0 - }, + serializedName: "x-ms-blob-condition-maxsize", + xmlName: "x-ms-blob-condition-maxsize", type: { name: "Number" } } }; -var transactionalContentCrc64 = { +var appendPosition = { parameterPath: [ "options", - "transactionalContentCrc64" + "appendPositionAccessConditions", + "appendPosition" ], mapper: { - serializedName: "x-ms-content-crc64", + serializedName: "x-ms-blob-condition-appendpos", + xmlName: "x-ms-blob-condition-appendpos", type: { - name: "ByteArray" + name: "Number" } } }; -var transactionalContentMD5 = { - parameterPath: [ - "options", - "transactionalContentMD5" - ], +var sourceRange1 = { + parameterPath: ["options", "sourceRange"], mapper: { - serializedName: "Content-MD5", + serializedName: "x-ms-source-range", + xmlName: "x-ms-source-range", type: { - name: "ByteArray" + name: "String" } } }; -var upn = { - parameterPath: [ - "options", - "upn" - ], +var comp21 = { + parameterPath: "comp", mapper: { - serializedName: "upn", + defaultValue: "seal", + isConstant: true, + serializedName: "comp", type: { - name: "Boolean" + name: "String" } } }; -var url = { - parameterPath: "url", +var blobType2 = { + parameterPath: "blobType", mapper: { - required: true, - serializedName: "url", - defaultValue: '', + defaultValue: "BlockBlob", + isConstant: true, + serializedName: "x-ms-blob-type", type: { name: "String" } - }, - skipEncoding: true + } }; -var version = { - parameterPath: "version", +var copySourceBlobProperties = { + parameterPath: ["options", "copySourceBlobProperties"], mapper: { - required: true, + serializedName: "x-ms-copy-source-blob-properties", + xmlName: "x-ms-copy-source-blob-properties", + type: { + name: "Boolean" + } + } +}; +var comp22 = { + parameterPath: "comp", + mapper: { + defaultValue: "block", isConstant: true, - serializedName: "x-ms-version", - defaultValue: '2020-06-12', + serializedName: "comp", type: { name: "String" } } }; -var versionId = { - parameterPath: [ - "options", - "versionId" - ], +var blockId = { + parameterPath: "blockId", mapper: { - serializedName: "versionid", + serializedName: "blockid", + required: true, + xmlName: "blockid", type: { name: "String" } } }; -var where = { - parameterPath: [ - "options", - "where" - ], +var blocks = { + parameterPath: "blocks", + mapper: BlockLookupList +}; +var comp23 = { + parameterPath: "comp", mapper: { - serializedName: "where", + defaultValue: "blocklist", + isConstant: true, + serializedName: "comp", type: { name: "String" } } }; -var xMsRequiresSync = { - parameterPath: "xMsRequiresSync", +var listType = { + parameterPath: "listType", mapper: { + defaultValue: "committed", + serializedName: "blocklisttype", required: true, - isConstant: true, - serializedName: "x-ms-requires-sync", - defaultValue: 'true', + xmlName: "blocklisttype", type: { - name: "String" + name: "Enum", + allowedValues: ["committed", "uncommitted", "all"] } } }; /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ /** Class representing a Service. */ var Service = /** @class */ (function () { /** - * Create a Service. - * @param {StorageClientContext} client Reference to the service client. + * Initialize a new instance of the class Service class. + * @param client Reference to the service client */ function Service(client) { this.client = client; } - Service.prototype.setProperties = function (blobServiceProperties, options, callback) { - return this.client.sendOperationRequest({ + /** + * Sets properties for a storage account's Blob service endpoint, including properties for Storage + * Analytics and CORS (Cross-Origin Resource Sharing) rules + * @param blobServiceProperties The StorageService properties. + * @param options The options parameters. + */ + Service.prototype.setProperties = function (blobServiceProperties, options) { + var operationArguments = { blobServiceProperties: blobServiceProperties, - options: options - }, setPropertiesOperationSpec, callback); - }; - Service.prototype.getProperties = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, getPropertiesOperationSpec, callback); - }; - Service.prototype.getStatistics = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, getStatisticsOperationSpec, callback); - }; - Service.prototype.listContainersSegment = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, listContainersSegmentOperationSpec, callback); - }; - Service.prototype.getUserDelegationKey = function (keyInfo, options, callback) { - return this.client.sendOperationRequest({ + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, setPropertiesOperationSpec); + }; + /** + * gets the properties of a storage account's Blob service, including properties for Storage Analytics + * and CORS (Cross-Origin Resource Sharing) rules. + * @param options The options parameters. + */ + Service.prototype.getProperties = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, getPropertiesOperationSpec); + }; + /** + * Retrieves statistics related to replication for the Blob service. It is only available on the + * secondary location endpoint when read-access geo-redundant replication is enabled for the storage + * account. + * @param options The options parameters. + */ + Service.prototype.getStatistics = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, getStatisticsOperationSpec); + }; + /** + * The List Containers Segment operation returns a list of the containers under the specified account + * @param options The options parameters. + */ + Service.prototype.listContainersSegment = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, listContainersSegmentOperationSpec); + }; + /** + * Retrieves a user delegation key for the Blob service. This is only a valid operation when using + * bearer token authentication. + * @param keyInfo Key information + * @param options The options parameters. + */ + Service.prototype.getUserDelegationKey = function (keyInfo, options) { + var operationArguments = { keyInfo: keyInfo, - options: options - }, getUserDelegationKeyOperationSpec, callback); + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, getUserDelegationKeyOperationSpec); }; - Service.prototype.getAccountInfo = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, getAccountInfoOperationSpec, callback); + /** + * Returns the sku name and account kind + * @param options The options parameters. + */ + Service.prototype.getAccountInfo = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, getAccountInfoOperationSpec); }; - Service.prototype.submitBatch = function (body, contentLength, multipartContentType, options, callback) { - return this.client.sendOperationRequest({ - body: body, + /** + * The Batch operation allows multiple API calls to be embedded into a single HTTP request. + * @param contentLength The length of the request. + * @param multipartContentType Required. The value of this header must be multipart/mixed with a batch + * boundary. Example header value: multipart/mixed; boundary=batch_ + * @param body Initial data + * @param options The options parameters. + */ + Service.prototype.submitBatch = function (contentLength, multipartContentType, body, options) { + var operationArguments = { contentLength: contentLength, multipartContentType: multipartContentType, - options: options - }, submitBatchOperationSpec, callback); + body: body, + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, submitBatchOperationSpec); }; - Service.prototype.filterBlobs = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, filterBlobsOperationSpec, callback); + /** + * The Filter Blobs operation enables callers to list blobs across all containers whose tags match a + * given search expression. Filter blobs searches across all containers within a storage account but + * can be scoped within the expression to a single container. + * @param options The options parameters. + */ + Service.prototype.filterBlobs = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, filterBlobsOperationSpec); }; return Service; }()); // Operation Specifications -var serializer = new coreHttp.Serializer(Mappers, true); +var xmlSerializer = new coreHttp.Serializer(Mappers, /* isXml */ true); var setPropertiesOperationSpec = { + path: "/", httpMethod: "PUT", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds, - restype0, - comp0 - ], - headerParameters: [ - version, - requestId - ], - requestBody: { - parameterPath: "blobServiceProperties", - mapper: tslib.__assign(tslib.__assign({}, BlobServiceProperties), { required: true }) - }, - contentType: "application/xml; charset=utf-8", responses: { 202: { headersMapper: ServiceSetPropertiesHeaders }, default: { bodyMapper: StorageError, - headersMapper: ServiceSetPropertiesHeaders + headersMapper: ServiceSetPropertiesExceptionHeaders } }, - isXML: true, - serializer: serializer -}; -var getPropertiesOperationSpec = { - httpMethod: "GET", - urlParameters: [ - url - ], + requestBody: blobServiceProperties, queryParameters: [ - timeoutInSeconds, - restype0, - comp0 + restype, + comp, + timeoutInSeconds ], + urlParameters: [url], headerParameters: [ + contentType, + accept, version, requestId ], + isXML: true, + contentType: "application/xml; charset=utf-8", + mediaType: "xml", + serializer: xmlSerializer +}; +var getPropertiesOperationSpec = { + path: "/", + httpMethod: "GET", responses: { 200: { bodyMapper: BlobServiceProperties, @@ -28554,26 +28971,26 @@ var getPropertiesOperationSpec = { }, default: { bodyMapper: StorageError, - headersMapper: ServiceGetPropertiesHeaders + headersMapper: ServiceGetPropertiesExceptionHeaders } }, - isXML: true, - serializer: serializer -}; -var getStatisticsOperationSpec = { - httpMethod: "GET", - urlParameters: [ - url - ], queryParameters: [ - timeoutInSeconds, - restype0, - comp1 + restype, + comp, + timeoutInSeconds ], + urlParameters: [url], headerParameters: [ version, - requestId + requestId, + accept1 ], + isXML: true, + serializer: xmlSerializer +}; +var getStatisticsOperationSpec = { + path: "/", + httpMethod: "GET", responses: { 200: { bodyMapper: BlobServiceStatistics, @@ -28581,29 +28998,26 @@ var getStatisticsOperationSpec = { }, default: { bodyMapper: StorageError, - headersMapper: ServiceGetStatisticsHeaders + headersMapper: ServiceGetStatisticsExceptionHeaders } }, - isXML: true, - serializer: serializer -}; -var listContainersSegmentOperationSpec = { - httpMethod: "GET", - urlParameters: [ - url - ], queryParameters: [ - prefix, - marker0, - maxPageSize, - include0, + restype, timeoutInSeconds, - comp2 + comp1 ], + urlParameters: [url], headerParameters: [ version, - requestId + requestId, + accept1 ], + isXML: true, + serializer: xmlSerializer +}; +var listContainersSegmentOperationSpec = { + path: "/", + httpMethod: "GET", responses: { 200: { bodyMapper: ListContainersSegmentResponse, @@ -28611,31 +29025,29 @@ var listContainersSegmentOperationSpec = { }, default: { bodyMapper: StorageError, - headersMapper: ServiceListContainersSegmentHeaders + headersMapper: ServiceListContainersSegmentExceptionHeaders } }, - isXML: true, - serializer: serializer -}; -var getUserDelegationKeyOperationSpec = { - httpMethod: "POST", - urlParameters: [ - url - ], queryParameters: [ timeoutInSeconds, - restype0, - comp3 + comp2, + prefix, + marker, + maxPageSize, + include ], + urlParameters: [url], headerParameters: [ version, - requestId + requestId, + accept1 ], - requestBody: { - parameterPath: "keyInfo", - mapper: tslib.__assign(tslib.__assign({}, KeyInfo), { required: true }) - }, - contentType: "application/xml; charset=utf-8", + isXML: true, + serializer: xmlSerializer +}; +var getUserDelegationKeyOperationSpec = { + path: "/", + httpMethod: "POST", responses: { 200: { bodyMapper: UserDelegationKey, @@ -28643,96 +29055,80 @@ var getUserDelegationKeyOperationSpec = { }, default: { bodyMapper: StorageError, - headersMapper: ServiceGetUserDelegationKeyHeaders + headersMapper: ServiceGetUserDelegationKeyExceptionHeaders } }, - isXML: true, - serializer: serializer -}; -var getAccountInfoOperationSpec = { - httpMethod: "GET", - urlParameters: [ - url - ], + requestBody: keyInfo, queryParameters: [ - restype1, - comp0 + restype, + timeoutInSeconds, + comp3 ], + urlParameters: [url], headerParameters: [ - version + contentType, + accept, + version, + requestId ], + isXML: true, + contentType: "application/xml; charset=utf-8", + mediaType: "xml", + serializer: xmlSerializer +}; +var getAccountInfoOperationSpec = { + path: "/", + httpMethod: "GET", responses: { 200: { headersMapper: ServiceGetAccountInfoHeaders }, default: { bodyMapper: StorageError, - headersMapper: ServiceGetAccountInfoHeaders + headersMapper: ServiceGetAccountInfoExceptionHeaders } }, + queryParameters: [comp, restype1], + urlParameters: [url], + headerParameters: [version, accept1], isXML: true, - serializer: serializer + serializer: xmlSerializer }; var submitBatchOperationSpec = { + path: "/", httpMethod: "POST", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds, - comp4 - ], - headerParameters: [ - contentLength, - multipartContentType, - version, - requestId - ], - requestBody: { - parameterPath: "body", - mapper: { - required: true, - serializedName: "body", - type: { - name: "Stream" - } - } - }, - contentType: "application/xml; charset=utf-8", responses: { 202: { bodyMapper: { - serializedName: "parsedResponse", - type: { - name: "Stream" - } + type: { name: "Stream" }, + serializedName: "parsedResponse" }, headersMapper: ServiceSubmitBatchHeaders }, default: { bodyMapper: StorageError, - headersMapper: ServiceSubmitBatchHeaders + headersMapper: ServiceSubmitBatchExceptionHeaders } }, + requestBody: body, + queryParameters: [timeoutInSeconds, comp4], + urlParameters: [url], + headerParameters: [ + contentType, + accept, + version, + requestId, + contentLength, + multipartContentType + ], isXML: true, - serializer: serializer + contentType: "application/xml; charset=utf-8", + mediaType: "xml", + serializer: xmlSerializer }; var filterBlobsOperationSpec = { + path: "/", httpMethod: "GET", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds, - where, - marker0, - maxPageSize, - comp5 - ], - headerParameters: [ - version, - requestId - ], responses: { 200: { bodyMapper: FilterBlobSegment, @@ -28740,659 +29136,673 @@ var filterBlobsOperationSpec = { }, default: { bodyMapper: StorageError, - headersMapper: ServiceFilterBlobsHeaders + headersMapper: ServiceFilterBlobsExceptionHeaders } }, + queryParameters: [ + timeoutInSeconds, + marker, + maxPageSize, + comp5, + where + ], + urlParameters: [url], + headerParameters: [ + version, + requestId, + accept1 + ], isXML: true, - serializer: serializer + serializer: xmlSerializer }; /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ - -var Mappers$1 = /*#__PURE__*/Object.freeze({ - __proto__: null, - AccessPolicy: AccessPolicy, - BlobFlatListSegment: BlobFlatListSegment, - BlobHierarchyListSegment: BlobHierarchyListSegment, - BlobItemInternal: BlobItemInternal, - BlobPrefix: BlobPrefix, - BlobPropertiesInternal: BlobPropertiesInternal, - BlobTag: BlobTag, - BlobTags: BlobTags, - ContainerAcquireLeaseHeaders: ContainerAcquireLeaseHeaders, - ContainerBreakLeaseHeaders: ContainerBreakLeaseHeaders, - ContainerChangeLeaseHeaders: ContainerChangeLeaseHeaders, - ContainerCreateHeaders: ContainerCreateHeaders, - ContainerDeleteHeaders: ContainerDeleteHeaders, - ContainerGetAccessPolicyHeaders: ContainerGetAccessPolicyHeaders, - ContainerGetAccountInfoHeaders: ContainerGetAccountInfoHeaders, - ContainerGetPropertiesHeaders: ContainerGetPropertiesHeaders, - ContainerListBlobFlatSegmentHeaders: ContainerListBlobFlatSegmentHeaders, - ContainerListBlobHierarchySegmentHeaders: ContainerListBlobHierarchySegmentHeaders, - ContainerReleaseLeaseHeaders: ContainerReleaseLeaseHeaders, - ContainerRenameHeaders: ContainerRenameHeaders, - ContainerRenewLeaseHeaders: ContainerRenewLeaseHeaders, - ContainerRestoreHeaders: ContainerRestoreHeaders, - ContainerSetAccessPolicyHeaders: ContainerSetAccessPolicyHeaders, - ContainerSetMetadataHeaders: ContainerSetMetadataHeaders, - ContainerSubmitBatchHeaders: ContainerSubmitBatchHeaders, - ListBlobsFlatSegmentResponse: ListBlobsFlatSegmentResponse, - ListBlobsHierarchySegmentResponse: ListBlobsHierarchySegmentResponse, - SignedIdentifier: SignedIdentifier, - StorageError: StorageError -}); - -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ /** Class representing a Container. */ var Container = /** @class */ (function () { /** - * Create a Container. - * @param {StorageClientContext} client Reference to the service client. + * Initialize a new instance of the class Container class. + * @param client Reference to the service client */ function Container(client) { this.client = client; } - Container.prototype.create = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, createOperationSpec, callback); - }; - Container.prototype.getProperties = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, getPropertiesOperationSpec$1, callback); - }; - Container.prototype.deleteMethod = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, deleteMethodOperationSpec, callback); - }; - Container.prototype.setMetadata = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, setMetadataOperationSpec, callback); - }; - Container.prototype.getAccessPolicy = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, getAccessPolicyOperationSpec, callback); - }; - Container.prototype.setAccessPolicy = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, setAccessPolicyOperationSpec, callback); - }; - Container.prototype.restore = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, restoreOperationSpec, callback); - }; - Container.prototype.rename = function (sourceContainerName, options, callback) { - return this.client.sendOperationRequest({ + /** + * creates a new container under the specified account. If the container with the same name already + * exists, the operation fails + * @param options The options parameters. + */ + Container.prototype.create = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, createOperationSpec); + }; + /** + * returns all user-defined metadata and system properties for the specified container. The data + * returned does not include the container's list of blobs + * @param options The options parameters. + */ + Container.prototype.getProperties = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, getPropertiesOperationSpec$1); + }; + /** + * operation marks the specified container for deletion. The container and any blobs contained within + * it are later deleted during garbage collection + * @param options The options parameters. + */ + Container.prototype.delete = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, deleteOperationSpec); + }; + /** + * operation sets one or more user-defined name-value pairs for the specified container. + * @param options The options parameters. + */ + Container.prototype.setMetadata = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, setMetadataOperationSpec); + }; + /** + * gets the permissions for the specified container. The permissions indicate whether container data + * may be accessed publicly. + * @param options The options parameters. + */ + Container.prototype.getAccessPolicy = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, getAccessPolicyOperationSpec); + }; + /** + * sets the permissions for the specified container. The permissions indicate whether blobs in a + * container may be accessed publicly. + * @param options The options parameters. + */ + Container.prototype.setAccessPolicy = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, setAccessPolicyOperationSpec); + }; + /** + * Restores a previously-deleted container. + * @param options The options parameters. + */ + Container.prototype.restore = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, restoreOperationSpec); + }; + /** + * Renames an existing container. + * @param sourceContainerName Required. Specifies the name of the container to rename. + * @param options The options parameters. + */ + Container.prototype.rename = function (sourceContainerName, options) { + var operationArguments = { sourceContainerName: sourceContainerName, - options: options - }, renameOperationSpec, callback); + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, renameOperationSpec); }; - Container.prototype.submitBatch = function (body, contentLength, multipartContentType, options, callback) { - return this.client.sendOperationRequest({ - body: body, + /** + * The Batch operation allows multiple API calls to be embedded into a single HTTP request. + * @param contentLength The length of the request. + * @param multipartContentType Required. The value of this header must be multipart/mixed with a batch + * boundary. Example header value: multipart/mixed; boundary=batch_ + * @param body Initial data + * @param options The options parameters. + */ + Container.prototype.submitBatch = function (contentLength, multipartContentType, body, options) { + var operationArguments = { contentLength: contentLength, multipartContentType: multipartContentType, - options: options - }, submitBatchOperationSpec$1, callback); + body: body, + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, submitBatchOperationSpec$1); }; - Container.prototype.acquireLease = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, acquireLeaseOperationSpec, callback); + /** + * [Update] establishes and manages a lock on a container for delete operations. The lock duration can + * be 15 to 60 seconds, or can be infinite + * @param options The options parameters. + */ + Container.prototype.acquireLease = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, acquireLeaseOperationSpec); }; - Container.prototype.releaseLease = function (leaseId, options, callback) { - return this.client.sendOperationRequest({ + /** + * [Update] establishes and manages a lock on a container for delete operations. The lock duration can + * be 15 to 60 seconds, or can be infinite + * @param leaseId Specifies the current lease ID on the resource. + * @param options The options parameters. + */ + Container.prototype.releaseLease = function (leaseId, options) { + var operationArguments = { leaseId: leaseId, - options: options - }, releaseLeaseOperationSpec, callback); + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, releaseLeaseOperationSpec); }; - Container.prototype.renewLease = function (leaseId, options, callback) { - return this.client.sendOperationRequest({ + /** + * [Update] establishes and manages a lock on a container for delete operations. The lock duration can + * be 15 to 60 seconds, or can be infinite + * @param leaseId Specifies the current lease ID on the resource. + * @param options The options parameters. + */ + Container.prototype.renewLease = function (leaseId, options) { + var operationArguments = { leaseId: leaseId, - options: options - }, renewLeaseOperationSpec, callback); + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, renewLeaseOperationSpec); }; - Container.prototype.breakLease = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, breakLeaseOperationSpec, callback); + /** + * [Update] establishes and manages a lock on a container for delete operations. The lock duration can + * be 15 to 60 seconds, or can be infinite + * @param options The options parameters. + */ + Container.prototype.breakLease = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, breakLeaseOperationSpec); }; - Container.prototype.changeLease = function (leaseId, proposedLeaseId, options, callback) { - return this.client.sendOperationRequest({ + /** + * [Update] establishes and manages a lock on a container for delete operations. The lock duration can + * be 15 to 60 seconds, or can be infinite + * @param leaseId Specifies the current lease ID on the resource. + * @param proposedLeaseId Proposed lease ID, in a GUID string format. The Blob service returns 400 + * (Invalid request) if the proposed lease ID is not in the correct format. See Guid Constructor + * (String) for a list of valid GUID string formats. + * @param options The options parameters. + */ + Container.prototype.changeLease = function (leaseId, proposedLeaseId, options) { + var operationArguments = { leaseId: leaseId, proposedLeaseId: proposedLeaseId, - options: options - }, changeLeaseOperationSpec, callback); + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, changeLeaseOperationSpec); }; - Container.prototype.listBlobFlatSegment = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, listBlobFlatSegmentOperationSpec, callback); + /** + * [Update] The List Blobs operation returns a list of the blobs under the specified container + * @param options The options parameters. + */ + Container.prototype.listBlobFlatSegment = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, listBlobFlatSegmentOperationSpec); }; - Container.prototype.listBlobHierarchySegment = function (delimiter, options, callback) { - return this.client.sendOperationRequest({ + /** + * [Update] The List Blobs operation returns a list of the blobs under the specified container + * @param delimiter When the request includes this parameter, the operation returns a BlobPrefix + * element in the response body that acts as a placeholder for all blobs whose names begin with the + * same substring up to the appearance of the delimiter character. The delimiter may be a single + * character or a string. + * @param options The options parameters. + */ + Container.prototype.listBlobHierarchySegment = function (delimiter, options) { + var operationArguments = { delimiter: delimiter, - options: options - }, listBlobHierarchySegmentOperationSpec, callback); + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, listBlobHierarchySegmentOperationSpec); }; - Container.prototype.getAccountInfo = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, getAccountInfoOperationSpec$1, callback); + /** + * Returns the sku name and account kind + * @param options The options parameters. + */ + Container.prototype.getAccountInfo = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, getAccountInfoOperationSpec$1); }; return Container; }()); // Operation Specifications -var serializer$1 = new coreHttp.Serializer(Mappers$1, true); +var xmlSerializer$1 = new coreHttp.Serializer(Mappers, /* isXml */ true); var createOperationSpec = { + path: "/{containerName}", httpMethod: "PUT", - path: "{containerName}", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds, - restype2 - ], - headerParameters: [ - metadata, - access, - version, - requestId, - defaultEncryptionScope, - preventEncryptionScopeOverride - ], responses: { 201: { headersMapper: ContainerCreateHeaders }, default: { bodyMapper: StorageError, - headersMapper: ContainerCreateHeaders + headersMapper: ContainerCreateExceptionHeaders } }, - isXML: true, - serializer: serializer$1 -}; -var getPropertiesOperationSpec$1 = { - httpMethod: "GET", - path: "{containerName}", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds, - restype2 - ], + queryParameters: [timeoutInSeconds, restype2], + urlParameters: [url], headerParameters: [ version, requestId, - leaseId0 + accept1, + metadata, + access, + defaultEncryptionScope, + preventEncryptionScopeOverride ], + isXML: true, + serializer: xmlSerializer$1 +}; +var getPropertiesOperationSpec$1 = { + path: "/{containerName}", + httpMethod: "GET", responses: { 200: { headersMapper: ContainerGetPropertiesHeaders }, default: { bodyMapper: StorageError, - headersMapper: ContainerGetPropertiesHeaders + headersMapper: ContainerGetPropertiesExceptionHeaders } }, - isXML: true, - serializer: serializer$1 -}; -var deleteMethodOperationSpec = { - httpMethod: "DELETE", - path: "{containerName}", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds, - restype2 - ], + queryParameters: [timeoutInSeconds, restype2], + urlParameters: [url], headerParameters: [ version, requestId, - leaseId0, - ifModifiedSince, - ifUnmodifiedSince + accept1, + leaseId ], + isXML: true, + serializer: xmlSerializer$1 +}; +var deleteOperationSpec = { + path: "/{containerName}", + httpMethod: "DELETE", responses: { 202: { headersMapper: ContainerDeleteHeaders }, default: { bodyMapper: StorageError, - headersMapper: ContainerDeleteHeaders + headersMapper: ContainerDeleteExceptionHeaders } }, - isXML: true, - serializer: serializer$1 -}; -var setMetadataOperationSpec = { - httpMethod: "PUT", - path: "{containerName}", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds, - restype2, - comp6 - ], + queryParameters: [timeoutInSeconds, restype2], + urlParameters: [url], headerParameters: [ - metadata, version, requestId, - leaseId0, - ifModifiedSince + accept1, + leaseId, + ifModifiedSince, + ifUnmodifiedSince ], + isXML: true, + serializer: xmlSerializer$1 +}; +var setMetadataOperationSpec = { + path: "/{containerName}", + httpMethod: "PUT", responses: { 200: { headersMapper: ContainerSetMetadataHeaders }, default: { bodyMapper: StorageError, - headersMapper: ContainerSetMetadataHeaders + headersMapper: ContainerSetMetadataExceptionHeaders } }, - isXML: true, - serializer: serializer$1 -}; -var getAccessPolicyOperationSpec = { - httpMethod: "GET", - path: "{containerName}", - urlParameters: [ - url - ], queryParameters: [ timeoutInSeconds, restype2, - comp7 + comp6 ], + urlParameters: [url], headerParameters: [ version, requestId, - leaseId0 + accept1, + metadata, + leaseId, + ifModifiedSince ], + isXML: true, + serializer: xmlSerializer$1 +}; +var getAccessPolicyOperationSpec = { + path: "/{containerName}", + httpMethod: "GET", responses: { 200: { bodyMapper: { - xmlElementName: "SignedIdentifier", - serializedName: "parsedResponse", type: { name: "Sequence", element: { - type: { - name: "Composite", - className: "SignedIdentifier" - } + type: { name: "Composite", className: "SignedIdentifier" } } - } + }, + serializedName: "SignedIdentifiers", + xmlName: "SignedIdentifiers", + xmlIsWrapped: true, + xmlElementName: "SignedIdentifier" }, headersMapper: ContainerGetAccessPolicyHeaders }, default: { bodyMapper: StorageError, - headersMapper: ContainerGetAccessPolicyHeaders + headersMapper: ContainerGetAccessPolicyExceptionHeaders } }, - isXML: true, - serializer: serializer$1 -}; -var setAccessPolicyOperationSpec = { - httpMethod: "PUT", - path: "{containerName}", - urlParameters: [ - url - ], queryParameters: [ timeoutInSeconds, restype2, comp7 ], + urlParameters: [url], headerParameters: [ - access, version, requestId, - leaseId0, - ifModifiedSince, - ifUnmodifiedSince + accept1, + leaseId ], - requestBody: { - parameterPath: [ - "options", - "containerAcl" - ], - mapper: { - xmlName: "SignedIdentifiers", - xmlElementName: "SignedIdentifier", - serializedName: "containerAcl", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SignedIdentifier" - } - } - } - } - }, - contentType: "application/xml; charset=utf-8", + isXML: true, + serializer: xmlSerializer$1 +}; +var setAccessPolicyOperationSpec = { + path: "/{containerName}", + httpMethod: "PUT", responses: { 200: { headersMapper: ContainerSetAccessPolicyHeaders }, default: { bodyMapper: StorageError, - headersMapper: ContainerSetAccessPolicyHeaders + headersMapper: ContainerSetAccessPolicyExceptionHeaders } }, - isXML: true, - serializer: serializer$1 -}; -var restoreOperationSpec = { - httpMethod: "PUT", - path: "{containerName}", - urlParameters: [ - url - ], + requestBody: containerAcl, queryParameters: [ timeoutInSeconds, restype2, - comp8 + comp7 ], + urlParameters: [url], headerParameters: [ + contentType, + accept, version, requestId, - deletedContainerName, - deletedContainerVersion + access, + leaseId, + ifModifiedSince, + ifUnmodifiedSince ], + isXML: true, + contentType: "application/xml; charset=utf-8", + mediaType: "xml", + serializer: xmlSerializer$1 +}; +var restoreOperationSpec = { + path: "/{containerName}", + httpMethod: "PUT", responses: { 201: { headersMapper: ContainerRestoreHeaders }, default: { bodyMapper: StorageError, - headersMapper: ContainerRestoreHeaders + headersMapper: ContainerRestoreExceptionHeaders } }, - isXML: true, - serializer: serializer$1 -}; -var renameOperationSpec = { - httpMethod: "PUT", - path: "{containerName}", - urlParameters: [ - url - ], queryParameters: [ timeoutInSeconds, restype2, - comp9 + comp8 ], + urlParameters: [url], headerParameters: [ version, requestId, - sourceContainerName, - sourceLeaseId + accept1, + deletedContainerName, + deletedContainerVersion ], + isXML: true, + serializer: xmlSerializer$1 +}; +var renameOperationSpec = { + path: "/{containerName}", + httpMethod: "PUT", responses: { 200: { headersMapper: ContainerRenameHeaders }, default: { bodyMapper: StorageError, - headersMapper: ContainerRenameHeaders + headersMapper: ContainerRenameExceptionHeaders } }, - isXML: true, - serializer: serializer$1 -}; -var submitBatchOperationSpec$1 = { - httpMethod: "POST", - path: "{containerName}", - urlParameters: [ - url - ], queryParameters: [ timeoutInSeconds, restype2, - comp4 + comp9 ], + urlParameters: [url], headerParameters: [ - contentLength, - multipartContentType, version, - requestId + requestId, + accept1, + sourceContainerName, + sourceLeaseId ], - requestBody: { - parameterPath: "body", - mapper: { - required: true, - serializedName: "body", - type: { - name: "Stream" - } - } - }, - contentType: "application/xml; charset=utf-8", + isXML: true, + serializer: xmlSerializer$1 +}; +var submitBatchOperationSpec$1 = { + path: "/{containerName}", + httpMethod: "POST", responses: { 202: { bodyMapper: { - serializedName: "parsedResponse", - type: { - name: "Stream" - } + type: { name: "Stream" }, + serializedName: "parsedResponse" }, headersMapper: ContainerSubmitBatchHeaders }, default: { bodyMapper: StorageError, - headersMapper: ContainerSubmitBatchHeaders + headersMapper: ContainerSubmitBatchExceptionHeaders } }, - isXML: true, - serializer: serializer$1 -}; -var acquireLeaseOperationSpec = { - httpMethod: "PUT", - path: "{containerName}", - urlParameters: [ - url - ], + requestBody: body, queryParameters: [ timeoutInSeconds, - comp10, + comp4, restype2 ], + urlParameters: [url], headerParameters: [ - duration, - proposedLeaseId0, + contentType, + accept, version, requestId, - action0, - ifModifiedSince, - ifUnmodifiedSince + contentLength, + multipartContentType ], + isXML: true, + contentType: "application/xml; charset=utf-8", + mediaType: "xml", + serializer: xmlSerializer$1 +}; +var acquireLeaseOperationSpec = { + path: "/{containerName}", + httpMethod: "PUT", responses: { 201: { headersMapper: ContainerAcquireLeaseHeaders }, default: { bodyMapper: StorageError, - headersMapper: ContainerAcquireLeaseHeaders + headersMapper: ContainerAcquireLeaseExceptionHeaders } }, - isXML: true, - serializer: serializer$1 -}; -var releaseLeaseOperationSpec = { - httpMethod: "PUT", - path: "{containerName}", - urlParameters: [ - url - ], queryParameters: [ timeoutInSeconds, - comp10, - restype2 + restype2, + comp10 ], + urlParameters: [url], headerParameters: [ - leaseId1, version, requestId, - action1, + accept1, ifModifiedSince, - ifUnmodifiedSince + ifUnmodifiedSince, + action, + duration, + proposedLeaseId ], + isXML: true, + serializer: xmlSerializer$1 +}; +var releaseLeaseOperationSpec = { + path: "/{containerName}", + httpMethod: "PUT", responses: { 200: { headersMapper: ContainerReleaseLeaseHeaders }, default: { bodyMapper: StorageError, - headersMapper: ContainerReleaseLeaseHeaders + headersMapper: ContainerReleaseLeaseExceptionHeaders } }, - isXML: true, - serializer: serializer$1 -}; -var renewLeaseOperationSpec = { - httpMethod: "PUT", - path: "{containerName}", - urlParameters: [ - url - ], queryParameters: [ timeoutInSeconds, - comp10, - restype2 + restype2, + comp10 ], + urlParameters: [url], headerParameters: [ - leaseId1, version, requestId, - action2, + accept1, ifModifiedSince, - ifUnmodifiedSince + ifUnmodifiedSince, + action1, + leaseId1 ], + isXML: true, + serializer: xmlSerializer$1 +}; +var renewLeaseOperationSpec = { + path: "/{containerName}", + httpMethod: "PUT", responses: { 200: { headersMapper: ContainerRenewLeaseHeaders }, default: { bodyMapper: StorageError, - headersMapper: ContainerRenewLeaseHeaders + headersMapper: ContainerRenewLeaseExceptionHeaders } }, - isXML: true, - serializer: serializer$1 -}; -var breakLeaseOperationSpec = { - httpMethod: "PUT", - path: "{containerName}", - urlParameters: [ - url - ], queryParameters: [ timeoutInSeconds, - comp10, - restype2 + restype2, + comp10 ], + urlParameters: [url], headerParameters: [ - breakPeriod, version, requestId, - action3, + accept1, ifModifiedSince, - ifUnmodifiedSince + ifUnmodifiedSince, + leaseId1, + action2 ], + isXML: true, + serializer: xmlSerializer$1 +}; +var breakLeaseOperationSpec = { + path: "/{containerName}", + httpMethod: "PUT", responses: { 202: { headersMapper: ContainerBreakLeaseHeaders }, default: { bodyMapper: StorageError, - headersMapper: ContainerBreakLeaseHeaders + headersMapper: ContainerBreakLeaseExceptionHeaders } }, - isXML: true, - serializer: serializer$1 -}; -var changeLeaseOperationSpec = { - httpMethod: "PUT", - path: "{containerName}", - urlParameters: [ - url - ], queryParameters: [ timeoutInSeconds, - comp10, - restype2 + restype2, + comp10 ], + urlParameters: [url], headerParameters: [ - leaseId1, - proposedLeaseId1, version, requestId, - action4, + accept1, ifModifiedSince, - ifUnmodifiedSince + ifUnmodifiedSince, + action3, + breakPeriod ], + isXML: true, + serializer: xmlSerializer$1 +}; +var changeLeaseOperationSpec = { + path: "/{containerName}", + httpMethod: "PUT", responses: { 200: { headersMapper: ContainerChangeLeaseHeaders }, default: { bodyMapper: StorageError, - headersMapper: ContainerChangeLeaseHeaders + headersMapper: ContainerChangeLeaseExceptionHeaders } }, - isXML: true, - serializer: serializer$1 -}; -var listBlobFlatSegmentOperationSpec = { - httpMethod: "GET", - path: "{containerName}", - urlParameters: [ - url - ], queryParameters: [ - prefix, - marker0, - maxPageSize, - include1, timeoutInSeconds, restype2, - comp2 + comp10 ], + urlParameters: [url], headerParameters: [ version, - requestId + requestId, + accept1, + ifModifiedSince, + ifUnmodifiedSince, + leaseId1, + action4, + proposedLeaseId1 ], + isXML: true, + serializer: xmlSerializer$1 +}; +var listBlobFlatSegmentOperationSpec = { + path: "/{containerName}", + httpMethod: "GET", responses: { 200: { bodyMapper: ListBlobsFlatSegmentResponse, @@ -29400,973 +29810,1021 @@ var listBlobFlatSegmentOperationSpec = { }, default: { bodyMapper: StorageError, - headersMapper: ContainerListBlobFlatSegmentHeaders + headersMapper: ContainerListBlobFlatSegmentExceptionHeaders } }, - isXML: true, - serializer: serializer$1 -}; -var listBlobHierarchySegmentOperationSpec = { - httpMethod: "GET", - path: "{containerName}", - urlParameters: [ - url - ], queryParameters: [ + timeoutInSeconds, + comp2, prefix, - delimiter, - marker0, + marker, maxPageSize, - include1, - timeoutInSeconds, restype2, - comp2 + include1 ], + urlParameters: [url], headerParameters: [ version, - requestId + requestId, + accept1 ], - responses: { - 200: { - bodyMapper: ListBlobsHierarchySegmentResponse, - headersMapper: ContainerListBlobHierarchySegmentHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerListBlobHierarchySegmentHeaders - } - }, isXML: true, - serializer: serializer$1 + serializer: xmlSerializer$1 }; -var getAccountInfoOperationSpec$1 = { +var listBlobHierarchySegmentOperationSpec = { + path: "/{containerName}", httpMethod: "GET", - path: "{containerName}", - urlParameters: [ - url - ], - queryParameters: [ - restype1, - comp0 - ], - headerParameters: [ - version - ], responses: { 200: { - headersMapper: ContainerGetAccountInfoHeaders + bodyMapper: ListBlobsHierarchySegmentResponse, + headersMapper: ContainerListBlobHierarchySegmentHeaders }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerGetAccountInfoHeaders - } - }, - isXML: true, - serializer: serializer$1 -}; - -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -var Mappers$2 = /*#__PURE__*/Object.freeze({ - __proto__: null, - ArrowConfiguration: ArrowConfiguration, - ArrowField: ArrowField, - BlobAbortCopyFromURLHeaders: BlobAbortCopyFromURLHeaders, - BlobAcquireLeaseHeaders: BlobAcquireLeaseHeaders, - BlobBreakLeaseHeaders: BlobBreakLeaseHeaders, - BlobChangeLeaseHeaders: BlobChangeLeaseHeaders, - BlobCopyFromURLHeaders: BlobCopyFromURLHeaders, - BlobCreateSnapshotHeaders: BlobCreateSnapshotHeaders, - BlobDeleteHeaders: BlobDeleteHeaders, - BlobDownloadHeaders: BlobDownloadHeaders, - BlobGetAccessControlHeaders: BlobGetAccessControlHeaders, - BlobGetAccountInfoHeaders: BlobGetAccountInfoHeaders, - BlobGetPropertiesHeaders: BlobGetPropertiesHeaders, - BlobGetTagsHeaders: BlobGetTagsHeaders, - BlobQueryHeaders: BlobQueryHeaders, - BlobReleaseLeaseHeaders: BlobReleaseLeaseHeaders, - BlobRenameHeaders: BlobRenameHeaders, - BlobRenewLeaseHeaders: BlobRenewLeaseHeaders, - BlobSetAccessControlHeaders: BlobSetAccessControlHeaders, - BlobSetExpiryHeaders: BlobSetExpiryHeaders, - BlobSetHTTPHeadersHeaders: BlobSetHTTPHeadersHeaders, - BlobSetMetadataHeaders: BlobSetMetadataHeaders, - BlobSetTagsHeaders: BlobSetTagsHeaders, - BlobSetTierHeaders: BlobSetTierHeaders, - BlobStartCopyFromURLHeaders: BlobStartCopyFromURLHeaders, - BlobTag: BlobTag, - BlobTags: BlobTags, - BlobUndeleteHeaders: BlobUndeleteHeaders, - DataLakeStorageError: DataLakeStorageError, - DataLakeStorageErrorError: DataLakeStorageErrorError, - DelimitedTextConfiguration: DelimitedTextConfiguration, - JsonTextConfiguration: JsonTextConfiguration, - QueryFormat: QueryFormat, - QueryRequest: QueryRequest, - QuerySerialization: QuerySerialization, - StorageError: StorageError -}); + default: { + bodyMapper: StorageError, + headersMapper: ContainerListBlobHierarchySegmentExceptionHeaders + } + }, + queryParameters: [ + timeoutInSeconds, + comp2, + prefix, + marker, + maxPageSize, + restype2, + include1, + delimiter + ], + urlParameters: [url], + headerParameters: [ + version, + requestId, + accept1 + ], + isXML: true, + serializer: xmlSerializer$1 +}; +var getAccountInfoOperationSpec$1 = { + path: "/{containerName}", + httpMethod: "GET", + responses: { + 200: { + headersMapper: ContainerGetAccountInfoHeaders + }, + default: { + bodyMapper: StorageError, + headersMapper: ContainerGetAccountInfoExceptionHeaders + } + }, + queryParameters: [comp, restype1], + urlParameters: [url], + headerParameters: [version, accept1], + isXML: true, + serializer: xmlSerializer$1 +}; /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ /** Class representing a Blob. */ var Blob$1 = /** @class */ (function () { /** - * Create a Blob. - * @param {StorageClientContext} client Reference to the service client. + * Initialize a new instance of the class Blob class. + * @param client Reference to the service client */ function Blob(client) { this.client = client; } - Blob.prototype.download = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, downloadOperationSpec, callback); - }; - Blob.prototype.getProperties = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, getPropertiesOperationSpec$2, callback); - }; - Blob.prototype.deleteMethod = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, deleteMethodOperationSpec$1, callback); - }; - Blob.prototype.setAccessControl = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, setAccessControlOperationSpec, callback); - }; - Blob.prototype.getAccessControl = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, getAccessControlOperationSpec, callback); - }; - Blob.prototype.rename = function (renameSource, options, callback) { - return this.client.sendOperationRequest({ + /** + * The Download operation reads or downloads a blob from the system, including its metadata and + * properties. You can also call Download to read a snapshot. + * @param options The options parameters. + */ + Blob.prototype.download = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, downloadOperationSpec); + }; + /** + * The Get Properties operation returns all user-defined metadata, standard HTTP properties, and system + * properties for the blob. It does not return the content of the blob. + * @param options The options parameters. + */ + Blob.prototype.getProperties = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, getPropertiesOperationSpec$2); + }; + /** + * If the storage account's soft delete feature is disabled then, when a blob is deleted, it is + * permanently removed from the storage account. If the storage account's soft delete feature is + * enabled, then, when a blob is deleted, it is marked for deletion and becomes inaccessible + * immediately. However, the blob service retains the blob or snapshot for the number of days specified + * by the DeleteRetentionPolicy section of [Storage service properties] + * (Set-Blob-Service-Properties.md). After the specified number of days has passed, the blob's data is + * permanently removed from the storage account. Note that you continue to be charged for the + * soft-deleted blob's storage until it is permanently removed. Use the List Blobs API and specify the + * "include=deleted" query parameter to discover which blobs and snapshots have been soft deleted. You + * can then use the Undelete Blob API to restore a soft-deleted blob. All other operations on a + * soft-deleted blob or snapshot causes the service to return an HTTP status code of 404 + * (ResourceNotFound). + * @param options The options parameters. + */ + Blob.prototype.delete = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, deleteOperationSpec$1); + }; + /** + * Set the owner, group, permissions, or access control list for a blob. + * @param options The options parameters. + */ + Blob.prototype.setAccessControl = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, setAccessControlOperationSpec); + }; + /** + * Get the owner, group, permissions, or access control list for a blob. + * @param options The options parameters. + */ + Blob.prototype.getAccessControl = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, getAccessControlOperationSpec); + }; + /** + * Rename a blob/file. By default, the destination is overwritten and if the destination already + * exists and has a lease the lease is broken. This operation supports conditional HTTP requests. For + * more information, see [Specifying Conditional Headers for Blob Service + * Operations](https://docs.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations). + * To fail if the destination already exists, use a conditional request with If-None-Match: "*". + * @param renameSource The file or directory to be renamed. The value must have the following format: + * "/{filesysystem}/{path}". If "x-ms-properties" is specified, the properties will overwrite the + * existing properties; otherwise, the existing properties will be preserved. + * @param options The options parameters. + */ + Blob.prototype.rename = function (renameSource, options) { + var operationArguments = { renameSource: renameSource, - options: options - }, renameOperationSpec$1, callback); + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, renameOperationSpec$1); }; - Blob.prototype.undelete = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, undeleteOperationSpec, callback); + /** + * Undelete a blob that was previously soft deleted + * @param options The options parameters. + */ + Blob.prototype.undelete = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, undeleteOperationSpec); }; - Blob.prototype.setExpiry = function (expiryOptions, options, callback) { - return this.client.sendOperationRequest({ + /** + * Sets the time a blob will expire and be deleted. + * @param expiryOptions Required. Indicates mode of the expiry time + * @param options The options parameters. + */ + Blob.prototype.setExpiry = function (expiryOptions, options) { + var operationArguments = { expiryOptions: expiryOptions, - options: options - }, setExpiryOperationSpec, callback); - }; - Blob.prototype.setHTTPHeaders = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, setHTTPHeadersOperationSpec, callback); - }; - Blob.prototype.setMetadata = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, setMetadataOperationSpec$1, callback); - }; - Blob.prototype.acquireLease = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, acquireLeaseOperationSpec$1, callback); - }; - Blob.prototype.releaseLease = function (leaseId, options, callback) { - return this.client.sendOperationRequest({ + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, setExpiryOperationSpec); + }; + /** + * The Set HTTP Headers operation sets system properties on the blob + * @param options The options parameters. + */ + Blob.prototype.setHttpHeaders = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, setHttpHeadersOperationSpec); + }; + /** + * The Set Blob Metadata operation sets user-defined metadata for the specified blob as one or more + * name-value pairs + * @param options The options parameters. + */ + Blob.prototype.setMetadata = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, setMetadataOperationSpec$1); + }; + /** + * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete + * operations + * @param options The options parameters. + */ + Blob.prototype.acquireLease = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, acquireLeaseOperationSpec$1); + }; + /** + * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete + * operations + * @param leaseId Specifies the current lease ID on the resource. + * @param options The options parameters. + */ + Blob.prototype.releaseLease = function (leaseId, options) { + var operationArguments = { leaseId: leaseId, - options: options - }, releaseLeaseOperationSpec$1, callback); + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, releaseLeaseOperationSpec$1); }; - Blob.prototype.renewLease = function (leaseId, options, callback) { - return this.client.sendOperationRequest({ + /** + * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete + * operations + * @param leaseId Specifies the current lease ID on the resource. + * @param options The options parameters. + */ + Blob.prototype.renewLease = function (leaseId, options) { + var operationArguments = { leaseId: leaseId, - options: options - }, renewLeaseOperationSpec$1, callback); + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, renewLeaseOperationSpec$1); }; - Blob.prototype.changeLease = function (leaseId, proposedLeaseId, options, callback) { - return this.client.sendOperationRequest({ + /** + * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete + * operations + * @param leaseId Specifies the current lease ID on the resource. + * @param proposedLeaseId Proposed lease ID, in a GUID string format. The Blob service returns 400 + * (Invalid request) if the proposed lease ID is not in the correct format. See Guid Constructor + * (String) for a list of valid GUID string formats. + * @param options The options parameters. + */ + Blob.prototype.changeLease = function (leaseId, proposedLeaseId, options) { + var operationArguments = { leaseId: leaseId, proposedLeaseId: proposedLeaseId, - options: options - }, changeLeaseOperationSpec$1, callback); + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, changeLeaseOperationSpec$1); }; - Blob.prototype.breakLease = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, breakLeaseOperationSpec$1, callback); + /** + * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete + * operations + * @param options The options parameters. + */ + Blob.prototype.breakLease = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, breakLeaseOperationSpec$1); }; - Blob.prototype.createSnapshot = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, createSnapshotOperationSpec, callback); + /** + * The Create Snapshot operation creates a read-only snapshot of a blob + * @param options The options parameters. + */ + Blob.prototype.createSnapshot = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, createSnapshotOperationSpec); }; - Blob.prototype.startCopyFromURL = function (copySource, options, callback) { - return this.client.sendOperationRequest({ + /** + * The Start Copy From URL operation copies a blob or an internet resource to a new blob. + * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to + * 2 KB in length that specifies a page blob snapshot. The value should be URL-encoded as it would + * appear in a request URI. The source blob must either be public or must be authenticated via a shared + * access signature. + * @param options The options parameters. + */ + Blob.prototype.startCopyFromURL = function (copySource, options) { + var operationArguments = { copySource: copySource, - options: options - }, startCopyFromURLOperationSpec, callback); + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, startCopyFromURLOperationSpec); }; - Blob.prototype.copyFromURL = function (copySource, options, callback) { - return this.client.sendOperationRequest({ + /** + * The Copy From URL operation copies a blob or an internet resource to a new blob. It will not return + * a response until the copy is complete. + * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to + * 2 KB in length that specifies a page blob snapshot. The value should be URL-encoded as it would + * appear in a request URI. The source blob must either be public or must be authenticated via a shared + * access signature. + * @param options The options parameters. + */ + Blob.prototype.copyFromURL = function (copySource, options) { + var operationArguments = { copySource: copySource, - options: options - }, copyFromURLOperationSpec, callback); + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, copyFromURLOperationSpec); }; - Blob.prototype.abortCopyFromURL = function (copyId, options, callback) { - return this.client.sendOperationRequest({ + /** + * The Abort Copy From URL operation aborts a pending Copy From URL operation, and leaves a destination + * blob with zero length and full metadata. + * @param copyId The copy identifier provided in the x-ms-copy-id header of the original Copy Blob + * operation. + * @param options The options parameters. + */ + Blob.prototype.abortCopyFromURL = function (copyId, options) { + var operationArguments = { copyId: copyId, - options: options - }, abortCopyFromURLOperationSpec, callback); + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, abortCopyFromURLOperationSpec); }; - Blob.prototype.setTier = function (tier, options, callback) { - return this.client.sendOperationRequest({ + /** + * The Set Tier operation sets the tier on a blob. The operation is allowed on a page blob in a premium + * storage account and on a block blob in a blob storage account (locally redundant storage only). A + * premium page blob's tier determines the allowed size, IOPS, and bandwidth of the blob. A block + * blob's tier determines Hot/Cool/Archive storage type. This operation does not update the blob's + * ETag. + * @param tier Indicates the tier to be set on the blob. + * @param options The options parameters. + */ + Blob.prototype.setTier = function (tier, options) { + var operationArguments = { tier: tier, - options: options - }, setTierOperationSpec, callback); + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, setTierOperationSpec); }; - Blob.prototype.getAccountInfo = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, getAccountInfoOperationSpec$2, callback); + /** + * Returns the sku name and account kind + * @param options The options parameters. + */ + Blob.prototype.getAccountInfo = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, getAccountInfoOperationSpec$2); }; - Blob.prototype.query = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, queryOperationSpec, callback); + /** + * The Query operation enables users to select/project on blob data by providing simple query + * expressions. + * @param options The options parameters. + */ + Blob.prototype.query = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, queryOperationSpec); }; - Blob.prototype.getTags = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, getTagsOperationSpec, callback); + /** + * The Get Tags operation enables users to get the tags associated with a blob. + * @param options The options parameters. + */ + Blob.prototype.getTags = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, getTagsOperationSpec); }; - Blob.prototype.setTags = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, setTagsOperationSpec, callback); + /** + * The Set Tags operation enables users to set tags on a blob. + * @param options The options parameters. + */ + Blob.prototype.setTags = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, setTagsOperationSpec); }; return Blob; }()); // Operation Specifications -var serializer$2 = new coreHttp.Serializer(Mappers$2, true); +var xmlSerializer$2 = new coreHttp.Serializer(Mappers, /* isXml */ true); var downloadOperationSpec = { + path: "/{containerName}/{blob}", httpMethod: "GET", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], - queryParameters: [ - snapshot, - versionId, - timeoutInSeconds - ], - headerParameters: [ - range0, - rangeGetContentMD5, - rangeGetContentCRC64, - version, - requestId, - leaseId0, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags - ], responses: { 200: { bodyMapper: { - serializedName: "parsedResponse", - type: { - name: "Stream" - } + type: { name: "Stream" }, + serializedName: "parsedResponse" }, headersMapper: BlobDownloadHeaders }, 206: { bodyMapper: { - serializedName: "parsedResponse", - type: { - name: "Stream" - } + type: { name: "Stream" }, + serializedName: "parsedResponse" }, headersMapper: BlobDownloadHeaders }, default: { bodyMapper: StorageError, - headersMapper: BlobDownloadHeaders + headersMapper: BlobDownloadExceptionHeaders } }, - isXML: true, - serializer: serializer$2 -}; -var getPropertiesOperationSpec$2 = { - httpMethod: "HEAD", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], queryParameters: [ + timeoutInSeconds, snapshot, - versionId, - timeoutInSeconds + versionId ], + urlParameters: [url], headerParameters: [ version, requestId, - leaseId0, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, + accept1, + leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, + range, + rangeGetContentMD5, + rangeGetContentCRC64, + encryptionKey, + encryptionKeySha256, + encryptionAlgorithm, ifTags ], + isXML: true, + serializer: xmlSerializer$2 +}; +var getPropertiesOperationSpec$2 = { + path: "/{containerName}/{blob}", + httpMethod: "HEAD", responses: { 200: { headersMapper: BlobGetPropertiesHeaders }, default: { bodyMapper: StorageError, - headersMapper: BlobGetPropertiesHeaders + headersMapper: BlobGetPropertiesExceptionHeaders } }, - isXML: true, - serializer: serializer$2 -}; -var deleteMethodOperationSpec$1 = { - httpMethod: "DELETE", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], queryParameters: [ - snapshot, - versionId, timeoutInSeconds, - blobDeleteType + snapshot, + versionId ], + urlParameters: [url], headerParameters: [ - deleteSnapshots, version, requestId, - leaseId0, + accept1, + leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, + encryptionKey, + encryptionKeySha256, + encryptionAlgorithm, ifTags ], + isXML: true, + serializer: xmlSerializer$2 +}; +var deleteOperationSpec$1 = { + path: "/{containerName}/{blob}", + httpMethod: "DELETE", responses: { 202: { headersMapper: BlobDeleteHeaders }, default: { bodyMapper: StorageError, - headersMapper: BlobDeleteHeaders + headersMapper: BlobDeleteExceptionHeaders } }, - isXML: true, - serializer: serializer$2 -}; -var setAccessControlOperationSpec = { - httpMethod: "PATCH", - path: "{filesystem}/{path}", - urlParameters: [ - url - ], queryParameters: [ timeoutInSeconds, - action5 + snapshot, + versionId, + blobDeleteType ], + urlParameters: [url], headerParameters: [ - owner, - group, - posixPermissions, - posixAcl, - requestId, version, - leaseId0, + requestId, + accept1, + leaseId, + ifModifiedSince, + ifUnmodifiedSince, ifMatch, ifNoneMatch, - ifModifiedSince, - ifUnmodifiedSince + ifTags, + deleteSnapshots ], + isXML: true, + serializer: xmlSerializer$2 +}; +var setAccessControlOperationSpec = { + path: "/{filesystem}/{path}", + httpMethod: "PATCH", responses: { 200: { headersMapper: BlobSetAccessControlHeaders }, default: { bodyMapper: DataLakeStorageError, - headersMapper: BlobSetAccessControlHeaders + headersMapper: BlobSetAccessControlExceptionHeaders } }, - isXML: true, - serializer: serializer$2 -}; -var getAccessControlOperationSpec = { - httpMethod: "HEAD", - path: "{filesystem}/{path}", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds, - upn, - action6 - ], + queryParameters: [timeoutInSeconds, action5], + urlParameters: [url], headerParameters: [ - requestId, version, - leaseId0, + requestId, + accept1, + leaseId, + ifModifiedSince, + ifUnmodifiedSince, + posixPermissions, ifMatch, ifNoneMatch, - ifModifiedSince, - ifUnmodifiedSince + owner, + group, + posixAcl ], + isXML: true, + serializer: xmlSerializer$2 +}; +var getAccessControlOperationSpec = { + path: "/{filesystem}/{path}", + httpMethod: "HEAD", responses: { 200: { headersMapper: BlobGetAccessControlHeaders }, default: { bodyMapper: DataLakeStorageError, - headersMapper: BlobGetAccessControlHeaders + headersMapper: BlobGetAccessControlExceptionHeaders } }, + queryParameters: [ + timeoutInSeconds, + action6, + upn + ], + urlParameters: [url], + headerParameters: [ + version, + requestId, + accept1, + leaseId, + ifModifiedSince, + ifUnmodifiedSince, + ifMatch, + ifNoneMatch + ], isXML: true, - serializer: serializer$2 + serializer: xmlSerializer$2 }; var renameOperationSpec$1 = { + path: "/{filesystem}/{path}", httpMethod: "PUT", - path: "{filesystem}/{path}", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds, - pathRenameMode - ], + responses: { + 201: { + headersMapper: BlobRenameHeaders + }, + default: { + bodyMapper: DataLakeStorageError, + headersMapper: BlobRenameExceptionHeaders + } + }, + queryParameters: [timeoutInSeconds, pathRenameMode], + urlParameters: [url], headerParameters: [ - renameSource, + version, + requestId, + accept1, + leaseId, + ifModifiedSince, + ifUnmodifiedSince, + sourceLeaseId, directoryProperties, posixPermissions, posixUmask, - sourceLeaseId, - version, - requestId, cacheControl, - contentType, + contentType1, contentEncoding, contentLanguage, contentDisposition, - leaseId0, - ifModifiedSince, - ifUnmodifiedSince, ifMatch, ifNoneMatch, + renameSource, sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatch, sourceIfNoneMatch ], - responses: { - 201: { - headersMapper: BlobRenameHeaders - }, - default: { - bodyMapper: DataLakeStorageError, - headersMapper: BlobRenameHeaders - } - }, isXML: true, - serializer: serializer$2 + serializer: xmlSerializer$2 }; var undeleteOperationSpec = { + path: "/{containerName}/{blob}", httpMethod: "PUT", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds, - comp8 - ], - headerParameters: [ - version, - requestId - ], responses: { 200: { headersMapper: BlobUndeleteHeaders }, default: { bodyMapper: StorageError, - headersMapper: BlobUndeleteHeaders + headersMapper: BlobUndeleteExceptionHeaders } }, - isXML: true, - serializer: serializer$2 -}; -var setExpiryOperationSpec = { - httpMethod: "PUT", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds, - comp11 - ], + queryParameters: [timeoutInSeconds, comp8], + urlParameters: [url], headerParameters: [ version, requestId, - expiryOptions, - expiresOn + accept1 ], + isXML: true, + serializer: xmlSerializer$2 +}; +var setExpiryOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 200: { headersMapper: BlobSetExpiryHeaders }, default: { bodyMapper: StorageError, - headersMapper: BlobSetExpiryHeaders + headersMapper: BlobSetExpiryExceptionHeaders } }, - isXML: true, - serializer: serializer$2 -}; -var setHTTPHeadersOperationSpec = { - httpMethod: "PUT", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds, - comp0 - ], + queryParameters: [timeoutInSeconds, comp11], + urlParameters: [url], headerParameters: [ version, requestId, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - leaseId0, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags + accept1, + expiryOptions, + expiresOn ], + isXML: true, + serializer: xmlSerializer$2 +}; +var setHttpHeadersOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 200: { - headersMapper: BlobSetHTTPHeadersHeaders + headersMapper: BlobSetHttpHeadersHeaders }, default: { bodyMapper: StorageError, - headersMapper: BlobSetHTTPHeadersHeaders + headersMapper: BlobSetHttpHeadersExceptionHeaders } }, - isXML: true, - serializer: serializer$2 -}; -var setMetadataOperationSpec$1 = { - httpMethod: "PUT", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds, - comp6 - ], + queryParameters: [comp, timeoutInSeconds], + urlParameters: [url], headerParameters: [ - metadata, - encryptionScope, version, requestId, - leaseId0, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, + accept1, + leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, - ifTags + ifTags, + blobCacheControl, + blobContentType, + blobContentMD5, + blobContentEncoding, + blobContentLanguage, + blobContentDisposition ], + isXML: true, + serializer: xmlSerializer$2 +}; +var setMetadataOperationSpec$1 = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 200: { headersMapper: BlobSetMetadataHeaders }, default: { bodyMapper: StorageError, - headersMapper: BlobSetMetadataHeaders + headersMapper: BlobSetMetadataExceptionHeaders } }, - isXML: true, - serializer: serializer$2 -}; -var acquireLeaseOperationSpec$1 = { - httpMethod: "PUT", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds, - comp10 - ], + queryParameters: [timeoutInSeconds, comp6], + urlParameters: [url], headerParameters: [ - duration, - proposedLeaseId0, version, requestId, - action0, + accept1, + metadata, + leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, - ifTags + encryptionKey, + encryptionKeySha256, + encryptionAlgorithm, + ifTags, + encryptionScope ], + isXML: true, + serializer: xmlSerializer$2 +}; +var acquireLeaseOperationSpec$1 = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 201: { headersMapper: BlobAcquireLeaseHeaders }, default: { bodyMapper: StorageError, - headersMapper: BlobAcquireLeaseHeaders + headersMapper: BlobAcquireLeaseExceptionHeaders } }, - isXML: true, - serializer: serializer$2 -}; -var releaseLeaseOperationSpec$1 = { - httpMethod: "PUT", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds, - comp10 - ], + queryParameters: [timeoutInSeconds, comp10], + urlParameters: [url], headerParameters: [ - leaseId1, version, requestId, - action1, + accept1, ifModifiedSince, ifUnmodifiedSince, + action, + duration, + proposedLeaseId, ifMatch, ifNoneMatch, ifTags ], + isXML: true, + serializer: xmlSerializer$2 +}; +var releaseLeaseOperationSpec$1 = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 200: { headersMapper: BlobReleaseLeaseHeaders }, default: { bodyMapper: StorageError, - headersMapper: BlobReleaseLeaseHeaders + headersMapper: BlobReleaseLeaseExceptionHeaders } }, - isXML: true, - serializer: serializer$2 -}; -var renewLeaseOperationSpec$1 = { - httpMethod: "PUT", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds, - comp10 - ], + queryParameters: [timeoutInSeconds, comp10], + urlParameters: [url], headerParameters: [ - leaseId1, version, requestId, - action2, + accept1, ifModifiedSince, ifUnmodifiedSince, + action1, + leaseId1, ifMatch, ifNoneMatch, ifTags ], + isXML: true, + serializer: xmlSerializer$2 +}; +var renewLeaseOperationSpec$1 = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 200: { headersMapper: BlobRenewLeaseHeaders }, default: { bodyMapper: StorageError, - headersMapper: BlobRenewLeaseHeaders + headersMapper: BlobRenewLeaseExceptionHeaders } }, - isXML: true, - serializer: serializer$2 -}; -var changeLeaseOperationSpec$1 = { - httpMethod: "PUT", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds, - comp10 - ], + queryParameters: [timeoutInSeconds, comp10], + urlParameters: [url], headerParameters: [ - leaseId1, - proposedLeaseId1, version, requestId, - action4, + accept1, ifModifiedSince, ifUnmodifiedSince, + leaseId1, + action2, ifMatch, ifNoneMatch, ifTags ], + isXML: true, + serializer: xmlSerializer$2 +}; +var changeLeaseOperationSpec$1 = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 200: { headersMapper: BlobChangeLeaseHeaders }, default: { bodyMapper: StorageError, - headersMapper: BlobChangeLeaseHeaders + headersMapper: BlobChangeLeaseExceptionHeaders } }, - isXML: true, - serializer: serializer$2 -}; -var breakLeaseOperationSpec$1 = { - httpMethod: "PUT", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds, - comp10 - ], + queryParameters: [timeoutInSeconds, comp10], + urlParameters: [url], headerParameters: [ - breakPeriod, version, requestId, - action3, + accept1, ifModifiedSince, ifUnmodifiedSince, + leaseId1, + action4, + proposedLeaseId1, ifMatch, ifNoneMatch, ifTags ], + isXML: true, + serializer: xmlSerializer$2 +}; +var breakLeaseOperationSpec$1 = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 202: { headersMapper: BlobBreakLeaseHeaders }, default: { bodyMapper: StorageError, - headersMapper: BlobBreakLeaseHeaders + headersMapper: BlobBreakLeaseExceptionHeaders } }, - isXML: true, - serializer: serializer$2 -}; -var createSnapshotOperationSpec = { - httpMethod: "PUT", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds, - comp12 - ], + queryParameters: [timeoutInSeconds, comp10], + urlParameters: [url], headerParameters: [ - metadata, - encryptionScope, version, requestId, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, + accept1, ifModifiedSince, ifUnmodifiedSince, + action3, + breakPeriod, ifMatch, ifNoneMatch, - ifTags, - leaseId0 + ifTags ], + isXML: true, + serializer: xmlSerializer$2 +}; +var createSnapshotOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 201: { headersMapper: BlobCreateSnapshotHeaders }, default: { bodyMapper: StorageError, - headersMapper: BlobCreateSnapshotHeaders + headersMapper: BlobCreateSnapshotExceptionHeaders } }, - isXML: true, - serializer: serializer$2 -}; -var startCopyFromURLOperationSpec = { - httpMethod: "PUT", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds - ], + queryParameters: [timeoutInSeconds, comp12], + urlParameters: [url], headerParameters: [ - metadata, - tier0, - rehydratePriority, - copySource, version, requestId, - blobTagsString, - sealBlob, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceIfTags, + accept1, + metadata, + leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, + encryptionKey, + encryptionKeySha256, + encryptionAlgorithm, ifTags, - leaseId0 + encryptionScope ], + isXML: true, + serializer: xmlSerializer$2 +}; +var startCopyFromURLOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 202: { headersMapper: BlobStartCopyFromURLHeaders }, default: { bodyMapper: StorageError, - headersMapper: BlobStartCopyFromURLHeaders + headersMapper: BlobStartCopyFromURLExceptionHeaders } }, - isXML: true, - serializer: serializer$2 -}; -var copyFromURLOperationSpec = { - httpMethod: "PUT", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds - ], + queryParameters: [timeoutInSeconds], + urlParameters: [url], headerParameters: [ - metadata, - tier0, - copySource, - version, - requestId, - sourceContentMD5, - blobTagsString, - xMsRequiresSync, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, + version, + requestId, + accept1, + metadata, + leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, + sourceIfModifiedSince, + sourceIfUnmodifiedSince, + sourceIfMatch, + sourceIfNoneMatch, ifTags, - leaseId0 + tier, + rehydratePriority, + sourceIfTags, + copySource, + blobTagsString, + sealBlob ], + isXML: true, + serializer: xmlSerializer$2 +}; +var copyFromURLOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 202: { headersMapper: BlobCopyFromURLHeaders }, default: { bodyMapper: StorageError, - headersMapper: BlobCopyFromURLHeaders + headersMapper: BlobCopyFromURLExceptionHeaders } }, - isXML: true, - serializer: serializer$2 -}; -var abortCopyFromURLOperationSpec = { - httpMethod: "PUT", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], - queryParameters: [ - copyId, - timeoutInSeconds, - comp13 - ], + queryParameters: [timeoutInSeconds], + urlParameters: [url], headerParameters: [ version, requestId, - copyActionAbortConstant, - leaseId0 + accept1, + metadata, + leaseId, + ifModifiedSince, + ifUnmodifiedSince, + ifMatch, + ifNoneMatch, + sourceIfModifiedSince, + sourceIfUnmodifiedSince, + sourceIfMatch, + sourceIfNoneMatch, + ifTags, + tier, + copySource, + blobTagsString, + xMsRequiresSync, + sourceContentMD5 ], + isXML: true, + serializer: xmlSerializer$2 +}; +var abortCopyFromURLOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 204: { headersMapper: BlobAbortCopyFromURLHeaders }, default: { bodyMapper: StorageError, - headersMapper: BlobAbortCopyFromURLHeaders + headersMapper: BlobAbortCopyFromURLExceptionHeaders } }, - isXML: true, - serializer: serializer$2 -}; -var setTierOperationSpec = { - httpMethod: "PUT", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], queryParameters: [ - snapshot, - versionId, timeoutInSeconds, - comp14 + comp13, + copyId ], + urlParameters: [url], headerParameters: [ - tier1, - rehydratePriority, version, requestId, - leaseId0, - ifTags + accept1, + leaseId, + copyActionAbortConstant ], + isXML: true, + serializer: xmlSerializer$2 +}; +var setTierOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 200: { headersMapper: BlobSetTierHeaders @@ -30376,114 +30834,99 @@ var setTierOperationSpec = { }, default: { bodyMapper: StorageError, - headersMapper: BlobSetTierHeaders + headersMapper: BlobSetTierExceptionHeaders } }, - isXML: true, - serializer: serializer$2 -}; -var getAccountInfoOperationSpec$2 = { - httpMethod: "GET", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], queryParameters: [ - restype1, - comp0 + timeoutInSeconds, + snapshot, + versionId, + comp14 ], + urlParameters: [url], headerParameters: [ - version + version, + requestId, + accept1, + leaseId, + ifTags, + rehydratePriority, + tier1 ], + isXML: true, + serializer: xmlSerializer$2 +}; +var getAccountInfoOperationSpec$2 = { + path: "/{containerName}/{blob}", + httpMethod: "GET", responses: { 200: { headersMapper: BlobGetAccountInfoHeaders }, default: { bodyMapper: StorageError, - headersMapper: BlobGetAccountInfoHeaders + headersMapper: BlobGetAccountInfoExceptionHeaders } }, + queryParameters: [comp, restype1], + urlParameters: [url], + headerParameters: [version, accept1], isXML: true, - serializer: serializer$2 + serializer: xmlSerializer$2 }; var queryOperationSpec = { + path: "/{containerName}/{blob}", httpMethod: "POST", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], - queryParameters: [ - snapshot, - timeoutInSeconds, - comp15 - ], - headerParameters: [ - version, - requestId, - leaseId0, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags - ], - requestBody: { - parameterPath: [ - "options", - "queryRequest" - ], - mapper: QueryRequest - }, - contentType: "application/xml; charset=utf-8", responses: { 200: { bodyMapper: { - serializedName: "parsedResponse", - type: { - name: "Stream" - } + type: { name: "Stream" }, + serializedName: "parsedResponse" }, headersMapper: BlobQueryHeaders }, 206: { bodyMapper: { - serializedName: "parsedResponse", - type: { - name: "Stream" - } + type: { name: "Stream" }, + serializedName: "parsedResponse" }, headersMapper: BlobQueryHeaders }, default: { bodyMapper: StorageError, - headersMapper: BlobQueryHeaders + headersMapper: BlobQueryExceptionHeaders } }, - isXML: true, - serializer: serializer$2 -}; -var getTagsOperationSpec = { - httpMethod: "GET", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], + requestBody: queryRequest, queryParameters: [ timeoutInSeconds, snapshot, - versionId, - comp16 + comp15 ], + urlParameters: [url], headerParameters: [ + contentType, + accept, version, requestId, - ifTags, - leaseId0 + leaseId, + ifModifiedSince, + ifUnmodifiedSince, + ifMatch, + ifNoneMatch, + encryptionKey, + encryptionKeySha256, + encryptionAlgorithm, + ifTags ], + isXML: true, + contentType: "application/xml; charset=utf-8", + mediaType: "xml", + serializer: xmlSerializer$2 +}; +var getTagsOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "GET", responses: { 200: { bodyMapper: BlobTags, @@ -30491,373 +30934,386 @@ var getTagsOperationSpec = { }, default: { bodyMapper: StorageError, - headersMapper: BlobGetTagsHeaders + headersMapper: BlobGetTagsExceptionHeaders } }, - isXML: true, - serializer: serializer$2 -}; -var setTagsOperationSpec = { - httpMethod: "PUT", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], queryParameters: [ timeoutInSeconds, + snapshot, versionId, comp16 ], + urlParameters: [url], headerParameters: [ version, - transactionalContentMD5, - transactionalContentCrc64, requestId, - ifTags, - leaseId0 + accept1, + leaseId, + ifTags ], - requestBody: { - parameterPath: [ - "options", - "tags" - ], - mapper: BlobTags - }, - contentType: "application/xml; charset=utf-8", + isXML: true, + serializer: xmlSerializer$2 +}; +var setTagsOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 204: { headersMapper: BlobSetTagsHeaders }, default: { bodyMapper: StorageError, - headersMapper: BlobSetTagsHeaders + headersMapper: BlobSetTagsExceptionHeaders } }, + requestBody: tags, + queryParameters: [ + timeoutInSeconds, + versionId, + comp16 + ], + urlParameters: [url], + headerParameters: [ + contentType, + accept, + version, + requestId, + leaseId, + ifTags, + transactionalContentMD5, + transactionalContentCrc64 + ], isXML: true, - serializer: serializer$2 + contentType: "application/xml; charset=utf-8", + mediaType: "xml", + serializer: xmlSerializer$2 }; /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ - -var Mappers$3 = /*#__PURE__*/Object.freeze({ - __proto__: null, - ClearRange: ClearRange, - PageBlobClearPagesHeaders: PageBlobClearPagesHeaders, - PageBlobCopyIncrementalHeaders: PageBlobCopyIncrementalHeaders, - PageBlobCreateHeaders: PageBlobCreateHeaders, - PageBlobGetPageRangesDiffHeaders: PageBlobGetPageRangesDiffHeaders, - PageBlobGetPageRangesHeaders: PageBlobGetPageRangesHeaders, - PageBlobResizeHeaders: PageBlobResizeHeaders, - PageBlobUpdateSequenceNumberHeaders: PageBlobUpdateSequenceNumberHeaders, - PageBlobUploadPagesFromURLHeaders: PageBlobUploadPagesFromURLHeaders, - PageBlobUploadPagesHeaders: PageBlobUploadPagesHeaders, - PageList: PageList, - PageRange: PageRange, - StorageError: StorageError -}); - -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ /** Class representing a PageBlob. */ var PageBlob = /** @class */ (function () { /** - * Create a PageBlob. - * @param {StorageClientContext} client Reference to the service client. + * Initialize a new instance of the class PageBlob class. + * @param client Reference to the service client */ function PageBlob(client) { this.client = client; } - PageBlob.prototype.create = function (contentLength, blobContentLength, options, callback) { - return this.client.sendOperationRequest({ + /** + * The Create operation creates a new page blob. + * @param contentLength The length of the request. + * @param blobContentLength This header specifies the maximum size for the page blob, up to 1 TB. The + * page blob size must be aligned to a 512-byte boundary. + * @param options The options parameters. + */ + PageBlob.prototype.create = function (contentLength, blobContentLength, options) { + var operationArguments = { contentLength: contentLength, blobContentLength: blobContentLength, - options: options - }, createOperationSpec$1, callback); + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, createOperationSpec$1); }; - PageBlob.prototype.uploadPages = function (body, contentLength, options, callback) { - return this.client.sendOperationRequest({ - body: body, + /** + * The Upload Pages operation writes a range of pages to a page blob + * @param contentLength The length of the request. + * @param body Initial data + * @param options The options parameters. + */ + PageBlob.prototype.uploadPages = function (contentLength, body, options) { + var operationArguments = { contentLength: contentLength, - options: options - }, uploadPagesOperationSpec, callback); + body: body, + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, uploadPagesOperationSpec); }; - PageBlob.prototype.clearPages = function (contentLength, options, callback) { - return this.client.sendOperationRequest({ + /** + * 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. + */ + PageBlob.prototype.clearPages = function (contentLength, options) { + var operationArguments = { contentLength: contentLength, - options: options - }, clearPagesOperationSpec, callback); + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, clearPagesOperationSpec); }; - PageBlob.prototype.uploadPagesFromURL = function (sourceUrl, sourceRange, contentLength, range, options, callback) { - return this.client.sendOperationRequest({ + /** + * The Upload Pages operation writes a range of pages to a page blob where the contents are read from a + * URL + * @param sourceUrl Specify a URL to the copy source. + * @param sourceRange Bytes of source data in the specified range. The length of this range should + * match the ContentLength header and x-ms-range/Range destination range header. + * @param contentLength The length of the request. + * @param range The range of bytes to which the source range would be written. The range should be 512 + * aligned and range-end is required. + * @param options The options parameters. + */ + PageBlob.prototype.uploadPagesFromURL = function (sourceUrl, sourceRange, contentLength, range, options) { + var operationArguments = { sourceUrl: sourceUrl, sourceRange: sourceRange, contentLength: contentLength, range: range, - options: options - }, uploadPagesFromURLOperationSpec, callback); + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, uploadPagesFromURLOperationSpec); }; - PageBlob.prototype.getPageRanges = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, getPageRangesOperationSpec, callback); + /** + * The Get Page Ranges operation returns the list of valid page ranges for a page blob or snapshot of a + * page blob + * @param options The options parameters. + */ + PageBlob.prototype.getPageRanges = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, getPageRangesOperationSpec); }; - PageBlob.prototype.getPageRangesDiff = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, getPageRangesDiffOperationSpec, callback); + /** + * The Get Page Ranges Diff operation returns the list of valid page ranges for a page blob that were + * changed between target blob and previous snapshot. + * @param options The options parameters. + */ + PageBlob.prototype.getPageRangesDiff = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, getPageRangesDiffOperationSpec); }; - PageBlob.prototype.resize = function (blobContentLength, options, callback) { - return this.client.sendOperationRequest({ + /** + * Resize the Blob + * @param blobContentLength This header specifies the maximum size for the page blob, up to 1 TB. The + * page blob size must be aligned to a 512-byte boundary. + * @param options The options parameters. + */ + PageBlob.prototype.resize = function (blobContentLength, options) { + var operationArguments = { blobContentLength: blobContentLength, - options: options - }, resizeOperationSpec, callback); + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, resizeOperationSpec); }; - PageBlob.prototype.updateSequenceNumber = function (sequenceNumberAction, options, callback) { - return this.client.sendOperationRequest({ + /** + * Update the sequence number of the blob + * @param sequenceNumberAction Required if the x-ms-blob-sequence-number header is set for the request. + * This property applies to page blobs only. This property indicates how the service should modify the + * blob's sequence number + * @param options The options parameters. + */ + PageBlob.prototype.updateSequenceNumber = function (sequenceNumberAction, options) { + var operationArguments = { sequenceNumberAction: sequenceNumberAction, - options: options - }, updateSequenceNumberOperationSpec, callback); - }; - PageBlob.prototype.copyIncremental = function (copySource, options, callback) { - return this.client.sendOperationRequest({ + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, updateSequenceNumberOperationSpec); + }; + /** + * The Copy Incremental operation copies a snapshot of the source page blob to a destination page blob. + * The snapshot is copied such that only the differential changes between the previously copied + * snapshot are transferred to the destination. The copied snapshots are complete copies of the + * original snapshot and can be read or copied from as usual. This API is supported since REST version + * 2016-05-31. + * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to + * 2 KB in length that specifies a page blob snapshot. The value should be URL-encoded as it would + * appear in a request URI. The source blob must either be public or must be authenticated via a shared + * access signature. + * @param options The options parameters. + */ + PageBlob.prototype.copyIncremental = function (copySource, options) { + var operationArguments = { copySource: copySource, - options: options - }, copyIncrementalOperationSpec, callback); + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, copyIncrementalOperationSpec); }; return PageBlob; }()); // Operation Specifications -var serializer$3 = new coreHttp.Serializer(Mappers$3, true); +var xmlSerializer$3 = new coreHttp.Serializer(Mappers, /* isXml */ true); +var serializer = new coreHttp.Serializer(Mappers, /* isXml */ false); var createOperationSpec$1 = { + path: "/{containerName}/{blob}", httpMethod: "PUT", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds - ], - headerParameters: [ - contentLength, - tier0, - metadata, - encryptionScope, - blobContentLength, - blobSequenceNumber, - version, - requestId, - blobTagsString, - blobType0, - blobContentType, - blobContentEncoding, - blobContentLanguage, - blobContentMD5, - blobCacheControl, - blobContentDisposition, - leaseId0, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags - ], responses: { 201: { headersMapper: PageBlobCreateHeaders }, default: { bodyMapper: StorageError, - headersMapper: PageBlobCreateHeaders + headersMapper: PageBlobCreateExceptionHeaders } }, - isXML: true, - serializer: serializer$3 -}; -var uploadPagesOperationSpec = { - httpMethod: "PUT", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds, - comp17 - ], + queryParameters: [timeoutInSeconds], + urlParameters: [url], headerParameters: [ - contentLength, - transactionalContentMD5, - transactionalContentCrc64, - range0, - encryptionScope, version, requestId, - pageWrite0, - leaseId0, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifSequenceNumberLessThanOrEqualTo, - ifSequenceNumberLessThan, - ifSequenceNumberEqualTo, + accept1, + contentLength, + metadata, + leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, - ifTags + encryptionKey, + encryptionKeySha256, + encryptionAlgorithm, + ifTags, + blobCacheControl, + blobContentType, + blobContentMD5, + blobContentEncoding, + blobContentLanguage, + blobContentDisposition, + encryptionScope, + tier, + blobTagsString, + blobType, + blobContentLength, + blobSequenceNumber ], - requestBody: { - parameterPath: "body", - mapper: { - required: true, - serializedName: "body", - type: { - name: "Stream" - } - } - }, - contentType: "application/octet-stream", + isXML: true, + serializer: xmlSerializer$3 +}; +var uploadPagesOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 201: { headersMapper: PageBlobUploadPagesHeaders }, default: { bodyMapper: StorageError, - headersMapper: PageBlobUploadPagesHeaders + headersMapper: PageBlobUploadPagesExceptionHeaders } }, - isXML: true, - serializer: serializer$3 -}; -var clearPagesOperationSpec = { - httpMethod: "PUT", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds, - comp17 - ], + requestBody: body1, + queryParameters: [timeoutInSeconds, comp17], + urlParameters: [url], headerParameters: [ - contentLength, - range0, - encryptionScope, version, requestId, - pageWrite1, - leaseId0, + contentLength, + leaseId, + ifModifiedSince, + ifUnmodifiedSince, + ifMatch, + ifNoneMatch, + range, encryptionKey, encryptionKeySha256, encryptionAlgorithm, + ifTags, + encryptionScope, + transactionalContentMD5, + transactionalContentCrc64, + contentType2, + accept2, + pageWrite, ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, - ifSequenceNumberEqualTo, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags + ifSequenceNumberEqualTo ], + mediaType: "binary", + serializer: serializer +}; +var clearPagesOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 201: { headersMapper: PageBlobClearPagesHeaders }, default: { bodyMapper: StorageError, - headersMapper: PageBlobClearPagesHeaders + headersMapper: PageBlobClearPagesExceptionHeaders } }, - isXML: true, - serializer: serializer$3 -}; -var uploadPagesFromURLOperationSpec = { - httpMethod: "PUT", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds, - comp17 - ], + queryParameters: [timeoutInSeconds, comp17], + urlParameters: [url], headerParameters: [ - sourceUrl, - sourceRange0, - sourceContentMD5, - sourceContentCrc64, - contentLength, - range1, - encryptionScope, version, requestId, - pageWrite0, + accept1, + contentLength, + leaseId, + ifModifiedSince, + ifUnmodifiedSince, + ifMatch, + ifNoneMatch, + range, encryptionKey, encryptionKeySha256, encryptionAlgorithm, - leaseId0, + ifTags, + encryptionScope, ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch + pageWrite1 ], + isXML: true, + serializer: xmlSerializer$3 +}; +var uploadPagesFromURLOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 201: { headersMapper: PageBlobUploadPagesFromURLHeaders }, default: { bodyMapper: StorageError, - headersMapper: PageBlobUploadPagesFromURLHeaders + headersMapper: PageBlobUploadPagesFromURLExceptionHeaders } }, - isXML: true, - serializer: serializer$3 -}; -var getPageRangesOperationSpec = { - httpMethod: "GET", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], - queryParameters: [ - snapshot, - timeoutInSeconds, - comp18 - ], + queryParameters: [timeoutInSeconds, comp17], + urlParameters: [url], headerParameters: [ - range0, version, requestId, - leaseId0, + accept1, + contentLength, + leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, - ifTags + sourceIfModifiedSince, + sourceIfUnmodifiedSince, + sourceIfMatch, + sourceIfNoneMatch, + encryptionKey, + encryptionKeySha256, + encryptionAlgorithm, + ifTags, + encryptionScope, + sourceContentMD5, + pageWrite, + ifSequenceNumberLessThanOrEqualTo, + ifSequenceNumberLessThan, + ifSequenceNumberEqualTo, + sourceUrl, + sourceRange, + sourceContentCrc64, + range1 ], + isXML: true, + serializer: xmlSerializer$3 +}; +var getPageRangesOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "GET", responses: { 200: { bodyMapper: PageList, @@ -30865,36 +31321,33 @@ var getPageRangesOperationSpec = { }, default: { bodyMapper: StorageError, - headersMapper: PageBlobGetPageRangesHeaders + headersMapper: PageBlobGetPageRangesExceptionHeaders } }, - isXML: true, - serializer: serializer$3 -}; -var getPageRangesDiffOperationSpec = { - httpMethod: "GET", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], queryParameters: [ - snapshot, timeoutInSeconds, - prevsnapshot, + snapshot, comp18 ], + urlParameters: [url], headerParameters: [ - prevSnapshotUrl, - range0, version, requestId, - leaseId0, + accept1, + leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, + range, ifTags ], + isXML: true, + serializer: xmlSerializer$3 +}; +var getPageRangesDiffOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "GET", responses: { 200: { bodyMapper: PageList, @@ -30902,726 +31355,733 @@ var getPageRangesDiffOperationSpec = { }, default: { bodyMapper: StorageError, - headersMapper: PageBlobGetPageRangesDiffHeaders + headersMapper: PageBlobGetPageRangesDiffExceptionHeaders } }, - isXML: true, - serializer: serializer$3 -}; -var resizeOperationSpec = { - httpMethod: "PUT", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], queryParameters: [ timeoutInSeconds, - comp0 + snapshot, + comp18, + prevsnapshot ], + urlParameters: [url], headerParameters: [ - encryptionScope, - blobContentLength, version, requestId, - leaseId0, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, + accept1, + leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, - ifTags + range, + ifTags, + prevSnapshotUrl ], + isXML: true, + serializer: xmlSerializer$3 +}; +var resizeOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 200: { headersMapper: PageBlobResizeHeaders }, default: { bodyMapper: StorageError, - headersMapper: PageBlobResizeHeaders + headersMapper: PageBlobResizeExceptionHeaders } }, - isXML: true, - serializer: serializer$3 -}; -var updateSequenceNumberOperationSpec = { - httpMethod: "PUT", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds, - comp0 - ], + queryParameters: [comp, timeoutInSeconds], + urlParameters: [url], headerParameters: [ - sequenceNumberAction, - blobSequenceNumber, version, requestId, - leaseId0, + accept1, + leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, - ifTags + encryptionKey, + encryptionKeySha256, + encryptionAlgorithm, + ifTags, + encryptionScope, + blobContentLength ], + isXML: true, + serializer: xmlSerializer$3 +}; +var updateSequenceNumberOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 200: { headersMapper: PageBlobUpdateSequenceNumberHeaders }, default: { bodyMapper: StorageError, - headersMapper: PageBlobUpdateSequenceNumberHeaders + headersMapper: PageBlobUpdateSequenceNumberExceptionHeaders } }, - isXML: true, - serializer: serializer$3 -}; -var copyIncrementalOperationSpec = { - httpMethod: "PUT", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds, - comp19 - ], + queryParameters: [comp, timeoutInSeconds], + urlParameters: [url], headerParameters: [ - copySource, version, requestId, + accept1, + leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, - ifTags + ifTags, + blobSequenceNumber, + sequenceNumberAction ], + isXML: true, + serializer: xmlSerializer$3 +}; +var copyIncrementalOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 202: { headersMapper: PageBlobCopyIncrementalHeaders }, default: { bodyMapper: StorageError, - headersMapper: PageBlobCopyIncrementalHeaders + headersMapper: PageBlobCopyIncrementalExceptionHeaders } }, + queryParameters: [timeoutInSeconds, comp19], + urlParameters: [url], + headerParameters: [ + version, + requestId, + accept1, + ifModifiedSince, + ifUnmodifiedSince, + ifMatch, + ifNoneMatch, + ifTags, + copySource + ], isXML: true, - serializer: serializer$3 + serializer: xmlSerializer$3 }; /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ - -var Mappers$4 = /*#__PURE__*/Object.freeze({ - __proto__: null, - AppendBlobAppendBlockFromUrlHeaders: AppendBlobAppendBlockFromUrlHeaders, - AppendBlobAppendBlockHeaders: AppendBlobAppendBlockHeaders, - AppendBlobCreateHeaders: AppendBlobCreateHeaders, - AppendBlobSealHeaders: AppendBlobSealHeaders, - StorageError: StorageError -}); - -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ /** Class representing a AppendBlob. */ var AppendBlob = /** @class */ (function () { /** - * Create a AppendBlob. - * @param {StorageClientContext} client Reference to the service client. + * Initialize a new instance of the class AppendBlob class. + * @param client Reference to the service client */ function AppendBlob(client) { this.client = client; } - AppendBlob.prototype.create = function (contentLength, options, callback) { - return this.client.sendOperationRequest({ - contentLength: contentLength, - options: options - }, createOperationSpec$2, callback); - }; - AppendBlob.prototype.appendBlock = function (body, contentLength, options, callback) { - return this.client.sendOperationRequest({ - body: body, - contentLength: contentLength, - options: options - }, appendBlockOperationSpec, callback); - }; - AppendBlob.prototype.appendBlockFromUrl = function (sourceUrl, contentLength, options, callback) { - return this.client.sendOperationRequest({ - sourceUrl: sourceUrl, + /** + * The Create Append Blob operation creates a new append blob. + * @param contentLength The length of the request. + * @param options The options parameters. + */ + AppendBlob.prototype.create = function (contentLength, options) { + var operationArguments = { contentLength: contentLength, - options: options - }, appendBlockFromUrlOperationSpec, callback); - }; - AppendBlob.prototype.seal = function (options, callback) { - return this.client.sendOperationRequest({ - options: options - }, sealOperationSpec, callback); + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, createOperationSpec$2); }; - return AppendBlob; -}()); -// Operation Specifications -var serializer$4 = new coreHttp.Serializer(Mappers$4, true); -var createOperationSpec$2 = { - httpMethod: "PUT", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds - ], - headerParameters: [ - contentLength, - metadata, - encryptionScope, - version, - requestId, - blobTagsString, - blobType1, - blobContentType, - blobContentEncoding, - blobContentLanguage, - blobContentMD5, - blobCacheControl, - blobContentDisposition, - leaseId0, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags - ], + /** + * The Append Block operation commits a new block of data to the end of an existing append blob. The + * Append Block operation is permitted only if the blob was created with x-ms-blob-type set to + * AppendBlob. Append Block is supported only on version 2015-02-21 version or later. + * @param contentLength The length of the request. + * @param body Initial data + * @param options The options parameters. + */ + AppendBlob.prototype.appendBlock = function (contentLength, body, options) { + var operationArguments = { + contentLength: contentLength, + body: body, + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, appendBlockOperationSpec); + }; + /** + * The Append Block operation commits a new block of data to the end of an existing append blob where + * the contents are read from a source url. The Append Block operation is permitted only if the blob + * was created with x-ms-blob-type set to AppendBlob. Append Block is supported only on version + * 2015-02-21 version or later. + * @param sourceUrl Specify a URL to the copy source. + * @param contentLength The length of the request. + * @param options The options parameters. + */ + AppendBlob.prototype.appendBlockFromUrl = function (sourceUrl, contentLength, options) { + var operationArguments = { + sourceUrl: sourceUrl, + contentLength: contentLength, + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, appendBlockFromUrlOperationSpec); + }; + /** + * The Seal operation seals the Append Blob to make it read-only. Seal is supported only on version + * 2019-12-12 version or later. + * @param options The options parameters. + */ + AppendBlob.prototype.seal = function (options) { + var operationArguments = { + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, sealOperationSpec); + }; + return AppendBlob; +}()); +// Operation Specifications +var xmlSerializer$4 = new coreHttp.Serializer(Mappers, /* isXml */ true); +var serializer$1 = new coreHttp.Serializer(Mappers, /* isXml */ false); +var createOperationSpec$2 = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 201: { headersMapper: AppendBlobCreateHeaders }, default: { bodyMapper: StorageError, - headersMapper: AppendBlobCreateHeaders + headersMapper: AppendBlobCreateExceptionHeaders } }, - isXML: true, - serializer: serializer$4 -}; -var appendBlockOperationSpec = { - httpMethod: "PUT", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds, - comp20 - ], + queryParameters: [timeoutInSeconds], + urlParameters: [url], headerParameters: [ - contentLength, - transactionalContentMD5, - transactionalContentCrc64, - encryptionScope, version, requestId, - leaseId0, - maxSize, - appendPosition, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, + accept1, + contentLength, + metadata, + leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, - ifTags + encryptionKey, + encryptionKeySha256, + encryptionAlgorithm, + ifTags, + blobCacheControl, + blobContentType, + blobContentMD5, + blobContentEncoding, + blobContentLanguage, + blobContentDisposition, + encryptionScope, + blobTagsString, + blobType1 ], - requestBody: { - parameterPath: "body", - mapper: { - required: true, - serializedName: "body", - type: { - name: "Stream" - } - } - }, - contentType: "application/octet-stream", + isXML: true, + serializer: xmlSerializer$4 +}; +var appendBlockOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 201: { headersMapper: AppendBlobAppendBlockHeaders }, default: { bodyMapper: StorageError, - headersMapper: AppendBlobAppendBlockHeaders + headersMapper: AppendBlobAppendBlockExceptionHeaders } }, - isXML: true, - serializer: serializer$4 -}; -var appendBlockFromUrlOperationSpec = { - httpMethod: "PUT", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds, - comp20 - ], + requestBody: body1, + queryParameters: [timeoutInSeconds, comp20], + urlParameters: [url], headerParameters: [ - sourceUrl, - sourceRange1, - sourceContentMD5, - sourceContentCrc64, - contentLength, - transactionalContentMD5, - encryptionScope, version, requestId, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - leaseId0, - maxSize, - appendPosition, + contentLength, + leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, + encryptionKey, + encryptionKeySha256, + encryptionAlgorithm, ifTags, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch + encryptionScope, + transactionalContentMD5, + transactionalContentCrc64, + contentType2, + accept2, + maxSize, + appendPosition ], + mediaType: "binary", + serializer: serializer$1 +}; +var appendBlockFromUrlOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 201: { headersMapper: AppendBlobAppendBlockFromUrlHeaders }, default: { bodyMapper: StorageError, - headersMapper: AppendBlobAppendBlockFromUrlHeaders + headersMapper: AppendBlobAppendBlockFromUrlExceptionHeaders } }, - isXML: true, - serializer: serializer$4 -}; -var sealOperationSpec = { - httpMethod: "PUT", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds, - comp21 - ], + queryParameters: [timeoutInSeconds, comp20], + urlParameters: [url], headerParameters: [ version, requestId, - leaseId0, + accept1, + contentLength, + leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, - appendPosition + sourceIfModifiedSince, + sourceIfUnmodifiedSince, + sourceIfMatch, + sourceIfNoneMatch, + encryptionKey, + encryptionKeySha256, + encryptionAlgorithm, + ifTags, + encryptionScope, + sourceContentMD5, + transactionalContentMD5, + sourceUrl, + sourceContentCrc64, + maxSize, + appendPosition, + sourceRange1 ], + isXML: true, + serializer: xmlSerializer$4 +}; +var sealOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 200: { headersMapper: AppendBlobSealHeaders }, default: { bodyMapper: StorageError, - headersMapper: AppendBlobSealHeaders + headersMapper: AppendBlobSealExceptionHeaders } }, + queryParameters: [timeoutInSeconds, comp21], + urlParameters: [url], + headerParameters: [ + version, + requestId, + accept1, + leaseId, + ifModifiedSince, + ifUnmodifiedSince, + ifMatch, + ifNoneMatch, + appendPosition + ], isXML: true, - serializer: serializer$4 + serializer: xmlSerializer$4 }; /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ - -var Mappers$5 = /*#__PURE__*/Object.freeze({ - __proto__: null, - Block: Block, - BlockBlobCommitBlockListHeaders: BlockBlobCommitBlockListHeaders, - BlockBlobGetBlockListHeaders: BlockBlobGetBlockListHeaders, - BlockBlobPutBlobFromUrlHeaders: BlockBlobPutBlobFromUrlHeaders, - BlockBlobStageBlockFromURLHeaders: BlockBlobStageBlockFromURLHeaders, - BlockBlobStageBlockHeaders: BlockBlobStageBlockHeaders, - BlockBlobUploadHeaders: BlockBlobUploadHeaders, - BlockList: BlockList, - BlockLookupList: BlockLookupList, - StorageError: StorageError -}); - -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ /** Class representing a BlockBlob. */ var BlockBlob = /** @class */ (function () { /** - * Create a BlockBlob. - * @param {StorageClientContext} client Reference to the service client. + * Initialize a new instance of the class BlockBlob class. + * @param client Reference to the service client */ function BlockBlob(client) { this.client = client; } - BlockBlob.prototype.upload = function (body, contentLength, options, callback) { - return this.client.sendOperationRequest({ - body: body, + /** + * The Upload Block Blob operation updates the content of an existing block blob. Updating an existing + * block blob overwrites any existing metadata on the blob. Partial updates are not supported with Put + * Blob; the content of the existing blob is overwritten with the content of the new blob. To perform a + * partial update of the content of a block blob, use the Put Block List operation. + * @param contentLength The length of the request. + * @param body Initial data + * @param options The options parameters. + */ + BlockBlob.prototype.upload = function (contentLength, body, options) { + var operationArguments = { contentLength: contentLength, - options: options - }, uploadOperationSpec, callback); - }; - BlockBlob.prototype.putBlobFromUrl = function (contentLength, copySource, options, callback) { - return this.client.sendOperationRequest({ + body: body, + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, uploadOperationSpec); + }; + /** + * The Put Blob from URL operation creates a new Block Blob where the contents of the blob are read + * from a given URL. This API is supported beginning with the 2020-04-08 version. Partial updates are + * not supported with Put Blob from URL; the content of an existing blob is overwritten with the + * content of the new blob. To perform partial updates to a block blob’s contents using a source URL, + * use the Put Block from URL API in conjunction with Put Block List. + * @param contentLength The length of the request. + * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to + * 2 KB in length that specifies a page blob snapshot. The value should be URL-encoded as it would + * appear in a request URI. The source blob must either be public or must be authenticated via a shared + * access signature. + * @param options The options parameters. + */ + BlockBlob.prototype.putBlobFromUrl = function (contentLength, copySource, options) { + var operationArguments = { contentLength: contentLength, copySource: copySource, - options: options - }, putBlobFromUrlOperationSpec, callback); + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, putBlobFromUrlOperationSpec); }; - BlockBlob.prototype.stageBlock = function (blockId, contentLength, body, options, callback) { - return this.client.sendOperationRequest({ + /** + * The Stage Block operation creates a new block to be committed as part of a blob + * @param blockId A valid Base64 string value that identifies the block. Prior to encoding, the string + * must be less than or equal to 64 bytes in size. For a given blob, the length of the value specified + * for the blockid parameter must be the same size for each block. + * @param contentLength The length of the request. + * @param body Initial data + * @param options The options parameters. + */ + BlockBlob.prototype.stageBlock = function (blockId, contentLength, body, options) { + var operationArguments = { blockId: blockId, contentLength: contentLength, body: body, - options: options - }, stageBlockOperationSpec, callback); + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, stageBlockOperationSpec); }; - BlockBlob.prototype.stageBlockFromURL = function (blockId, contentLength, sourceUrl, options, callback) { - return this.client.sendOperationRequest({ + /** + * The Stage Block operation creates a new block to be committed as part of a blob where the contents + * are read from a URL. + * @param blockId A valid Base64 string value that identifies the block. Prior to encoding, the string + * must be less than or equal to 64 bytes in size. For a given blob, the length of the value specified + * for the blockid parameter must be the same size for each block. + * @param contentLength The length of the request. + * @param sourceUrl Specify a URL to the copy source. + * @param options The options parameters. + */ + BlockBlob.prototype.stageBlockFromURL = function (blockId, contentLength, sourceUrl, options) { + var operationArguments = { blockId: blockId, contentLength: contentLength, sourceUrl: sourceUrl, - options: options - }, stageBlockFromURLOperationSpec, callback); + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, stageBlockFromURLOperationSpec); }; - BlockBlob.prototype.commitBlockList = function (blocks, options, callback) { - return this.client.sendOperationRequest({ + /** + * The Commit Block List operation writes a blob by specifying the list of block IDs that make up the + * blob. In order to be written as part of a blob, a block must have been successfully written to the + * server in a prior Put Block operation. You can call Put Block List to update a blob by uploading + * only those blocks that have changed, then committing the new and existing blocks together. You can + * do this by specifying whether to commit a block from the committed block list or from the + * uncommitted block list, or to commit the most recently uploaded version of the block, whichever list + * it may belong to. + * @param blocks + * @param options The options parameters. + */ + BlockBlob.prototype.commitBlockList = function (blocks, options) { + var operationArguments = { blocks: blocks, - options: options - }, commitBlockListOperationSpec, callback); + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, commitBlockListOperationSpec); }; - BlockBlob.prototype.getBlockList = function (listType, options, callback) { - return this.client.sendOperationRequest({ + /** + * The Get Block List operation retrieves the list of blocks that have been uploaded as part of a block + * blob + * @param listType Specifies whether to return the list of committed blocks, the list of uncommitted + * blocks, or both lists together. + * @param options The options parameters. + */ + BlockBlob.prototype.getBlockList = function (listType, options) { + var operationArguments = { listType: listType, - options: options - }, getBlockListOperationSpec, callback); + options: coreHttp.operationOptionsToRequestOptionsBase(options || {}) + }; + return this.client.sendOperationRequest(operationArguments, getBlockListOperationSpec); }; return BlockBlob; }()); // Operation Specifications -var serializer$5 = new coreHttp.Serializer(Mappers$5, true); +var xmlSerializer$5 = new coreHttp.Serializer(Mappers, /* isXml */ true); +var serializer$2 = new coreHttp.Serializer(Mappers, /* isXml */ false); var uploadOperationSpec = { + path: "/{containerName}/{blob}", httpMethod: "PUT", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds - ], + responses: { + 201: { + headersMapper: BlockBlobUploadHeaders + }, + default: { + bodyMapper: StorageError, + headersMapper: BlockBlobUploadExceptionHeaders + } + }, + requestBody: body1, + queryParameters: [timeoutInSeconds], + urlParameters: [url], headerParameters: [ - transactionalContentMD5, - contentLength, - metadata, - encryptionScope, - tier0, version, requestId, - blobTagsString, - blobType2, - blobContentType, - blobContentEncoding, - blobContentLanguage, - blobContentMD5, - blobCacheControl, - blobContentDisposition, - leaseId0, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, + contentLength, + metadata, + leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, - ifTags + encryptionKey, + encryptionKeySha256, + encryptionAlgorithm, + ifTags, + blobCacheControl, + blobContentType, + blobContentMD5, + blobContentEncoding, + blobContentLanguage, + blobContentDisposition, + encryptionScope, + tier, + blobTagsString, + transactionalContentMD5, + contentType2, + accept2, + blobType2 ], - requestBody: { - parameterPath: "body", - mapper: { - required: true, - serializedName: "body", - type: { - name: "Stream" - } - } - }, - contentType: "application/octet-stream", + mediaType: "binary", + serializer: serializer$2 +}; +var putBlobFromUrlOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 201: { - headersMapper: BlockBlobUploadHeaders + headersMapper: BlockBlobPutBlobFromUrlHeaders }, default: { bodyMapper: StorageError, - headersMapper: BlockBlobUploadHeaders + headersMapper: BlockBlobPutBlobFromUrlExceptionHeaders } }, - isXML: true, - serializer: serializer$5 -}; -var putBlobFromUrlOperationSpec = { - httpMethod: "PUT", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds - ], + queryParameters: [timeoutInSeconds], + urlParameters: [url], headerParameters: [ - transactionalContentMD5, - contentLength, - metadata, - encryptionScope, - tier0, version, requestId, - sourceContentMD5, - blobTagsString, - copySource, - copySourceBlobProperties, - blobType2, - blobContentType, - blobContentEncoding, - blobContentLanguage, - blobContentMD5, - blobCacheControl, - blobContentDisposition, - leaseId0, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, + accept1, + contentLength, + metadata, + leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, - ifTags, sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatch, sourceIfNoneMatch, - sourceIfTags + encryptionKey, + encryptionKeySha256, + encryptionAlgorithm, + ifTags, + blobCacheControl, + blobContentType, + blobContentMD5, + blobContentEncoding, + blobContentLanguage, + blobContentDisposition, + encryptionScope, + tier, + sourceIfTags, + copySource, + blobTagsString, + sourceContentMD5, + transactionalContentMD5, + blobType2, + copySourceBlobProperties ], + isXML: true, + serializer: xmlSerializer$5 +}; +var stageBlockOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 201: { - headersMapper: BlockBlobPutBlobFromUrlHeaders + headersMapper: BlockBlobStageBlockHeaders }, default: { bodyMapper: StorageError, - headersMapper: BlockBlobPutBlobFromUrlHeaders + headersMapper: BlockBlobStageBlockExceptionHeaders } }, - isXML: true, - serializer: serializer$5 -}; -var stageBlockOperationSpec = { - httpMethod: "PUT", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], + requestBody: body1, queryParameters: [ - blockId, timeoutInSeconds, - comp22 + comp22, + blockId ], + urlParameters: [url], headerParameters: [ - contentLength, - transactionalContentMD5, - transactionalContentCrc64, - encryptionScope, version, requestId, - leaseId0, + contentLength, + leaseId, encryptionKey, encryptionKeySha256, - encryptionAlgorithm + encryptionAlgorithm, + encryptionScope, + transactionalContentMD5, + transactionalContentCrc64, + contentType2, + accept2 ], - requestBody: { - parameterPath: "body", - mapper: { - required: true, - serializedName: "body", - type: { - name: "Stream" - } - } - }, - contentType: "application/octet-stream", + mediaType: "binary", + serializer: serializer$2 +}; +var stageBlockFromURLOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 201: { - headersMapper: BlockBlobStageBlockHeaders + headersMapper: BlockBlobStageBlockFromURLHeaders }, default: { bodyMapper: StorageError, - headersMapper: BlockBlobStageBlockHeaders + headersMapper: BlockBlobStageBlockFromURLExceptionHeaders } }, - isXML: true, - serializer: serializer$5 -}; -var stageBlockFromURLOperationSpec = { - httpMethod: "PUT", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], queryParameters: [ - blockId, timeoutInSeconds, - comp22 + comp22, + blockId ], + urlParameters: [url], headerParameters: [ - contentLength, - sourceUrl, - sourceRange1, - sourceContentMD5, - sourceContentCrc64, - encryptionScope, version, requestId, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - leaseId0, + accept1, + contentLength, + leaseId, sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatch, - sourceIfNoneMatch + sourceIfNoneMatch, + encryptionKey, + encryptionKeySha256, + encryptionAlgorithm, + encryptionScope, + sourceContentMD5, + sourceUrl, + sourceContentCrc64, + sourceRange1 ], + isXML: true, + serializer: xmlSerializer$5 +}; +var commitBlockListOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 201: { - headersMapper: BlockBlobStageBlockFromURLHeaders + headersMapper: BlockBlobCommitBlockListHeaders }, default: { bodyMapper: StorageError, - headersMapper: BlockBlobStageBlockFromURLHeaders + headersMapper: BlockBlobCommitBlockListExceptionHeaders } }, - isXML: true, - serializer: serializer$5 -}; -var commitBlockListOperationSpec = { - httpMethod: "PUT", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], - queryParameters: [ - timeoutInSeconds, - comp23 - ], + requestBody: blocks, + queryParameters: [timeoutInSeconds, comp23], + urlParameters: [url], headerParameters: [ - transactionalContentMD5, - transactionalContentCrc64, - metadata, - encryptionScope, - tier0, + contentType, + accept, version, requestId, - blobTagsString, + metadata, + leaseId, + ifModifiedSince, + ifUnmodifiedSince, + ifMatch, + ifNoneMatch, + encryptionKey, + encryptionKeySha256, + encryptionAlgorithm, + ifTags, blobCacheControl, blobContentType, + blobContentMD5, blobContentEncoding, blobContentLanguage, - blobContentMD5, blobContentDisposition, - leaseId0, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags + encryptionScope, + tier, + blobTagsString, + transactionalContentMD5, + transactionalContentCrc64 ], - requestBody: { - parameterPath: "blocks", - mapper: tslib.__assign(tslib.__assign({}, BlockLookupList), { required: true }) - }, + isXML: true, contentType: "application/xml; charset=utf-8", + mediaType: "xml", + serializer: xmlSerializer$5 +}; +var getBlockListOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "GET", responses: { - 201: { - headersMapper: BlockBlobCommitBlockListHeaders + 200: { + bodyMapper: BlockList, + headersMapper: BlockBlobGetBlockListHeaders }, default: { bodyMapper: StorageError, - headersMapper: BlockBlobCommitBlockListHeaders + headersMapper: BlockBlobGetBlockListExceptionHeaders } }, - isXML: true, - serializer: serializer$5 -}; -var getBlockListOperationSpec = { - httpMethod: "GET", - path: "{containerName}/{blob}", - urlParameters: [ - url - ], queryParameters: [ - snapshot, - listType, timeoutInSeconds, - comp23 + snapshot, + comp23, + listType ], + urlParameters: [url], headerParameters: [ version, requestId, - leaseId0, + accept1, + leaseId, ifTags ], - responses: { - 200: { - bodyMapper: BlockList, - headersMapper: BlockBlobGetBlockListHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobGetBlockListHeaders - } - }, isXML: true, - serializer: serializer$5 + serializer: xmlSerializer$5 }; // Copyright (c) Microsoft Corporation. @@ -31632,8 +32092,8 @@ var logger = logger$1.createClientLogger("storage-blob"); // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -var SDK_VERSION = "12.5.0"; -var SERVICE_VERSION = "2020-06-12"; +var SDK_VERSION = "12.6.0"; +var SERVICE_VERSION = "2020-08-04"; var BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES = 256 * 1024 * 1024; // 256MB var BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES = 4000 * 1024 * 1024; // 4000MB var BLOCK_BLOB_MAX_BLOCKS = 50000; @@ -33178,29 +33638,28 @@ var StorageSharedKeyCredential = /** @class */ (function (_super) { }(Credential)); /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ var packageName = "azure-storage-blob"; -var packageVersion = "12.5.0"; +var packageVersion = "12.6.0-beta.1"; var StorageClientContext = /** @class */ (function (_super) { tslib.__extends(StorageClientContext, _super); /** * Initializes a new instance of the StorageClientContext class. * @param url The URL of the service account, container, or blob that is the targe of the desired - * operation. - * @param [options] The parameter options + * operation. + * @param options The parameter options */ function StorageClientContext(url, options) { var _this = this; - if (url == undefined) { - throw new Error("'url' cannot be null."); + if (url === undefined) { + throw new Error("'url' cannot be null"); } + // Initializing default values for options if (!options) { options = {}; } @@ -33209,10 +33668,12 @@ var StorageClientContext = /** @class */ (function (_super) { options.userAgent = packageName + "/" + packageVersion + " " + defaultUserAgent; } _this = _super.call(this, undefined, options) || this; - _this.version = '2020-06-12'; - _this.baseUri = "{url}"; _this.requestContentType = "application/json; charset=utf-8"; + _this.baseUri = options.endpoint || "{url}"; + // Parameter assignments _this.url = url; + // Assigning values to Constant parameters + _this.version = options.version || "2020-08-04"; return _this; } return StorageClientContext; @@ -33273,9 +33734,10 @@ var createSpan = coreTracing.createSpanFunction({ * two separate fields, not just one). */ function convertTracingToRequestOptionsBase(options) { - var _a; + var _a, _b; return { - spanOptions: (_a = options === null || options === void 0 ? void 0 : options.tracingOptions) === null || _a === void 0 ? void 0 : _a.spanOptions + spanOptions: (_a = options === null || options === void 0 ? void 0 : options.tracingOptions) === null || _a === void 0 ? void 0 : _a.spanOptions, + tracingContext: (_b = options === null || options === void 0 ? void 0 : options.tracingOptions) === null || _b === void 0 ? void 0 : _b.tracingContext }; } @@ -34347,7 +34809,8 @@ var BlobLeaseClient = /** @class */ (function () { _g = createSpan("BlobLeaseClient-acquireLease", options), span = _g.span, updatedOptions = _g.updatedOptions; 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))) { + (((_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))) { 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."); } _h.label = 1; @@ -34358,7 +34821,7 @@ var BlobLeaseClient = /** @class */ (function () { case 3: e_1 = _h.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_1.message }); throw e_1; @@ -34391,7 +34854,8 @@ var BlobLeaseClient = /** @class */ (function () { _g = createSpan("BlobLeaseClient-changeLease", options), span = _g.span, updatedOptions = _g.updatedOptions; 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))) { + (((_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))) { 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."); } _h.label = 1; @@ -34405,7 +34869,7 @@ var BlobLeaseClient = /** @class */ (function () { case 3: e_2 = _h.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_2.message }); throw e_2; @@ -34438,7 +34902,8 @@ var BlobLeaseClient = /** @class */ (function () { _g = createSpan("BlobLeaseClient-releaseLease", options), span = _g.span, updatedOptions = _g.updatedOptions; 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))) { + (((_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))) { 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."); } _h.label = 1; @@ -34449,7 +34914,7 @@ var BlobLeaseClient = /** @class */ (function () { case 3: e_3 = _h.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_3.message }); throw e_3; @@ -34481,7 +34946,8 @@ var BlobLeaseClient = /** @class */ (function () { _g = createSpan("BlobLeaseClient-renewLease", options), span = _g.span, updatedOptions = _g.updatedOptions; 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))) { + (((_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))) { 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."); } _h.label = 1; @@ -34492,7 +34958,7 @@ var BlobLeaseClient = /** @class */ (function () { case 3: e_4 = _h.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_4.message }); throw e_4; @@ -34526,7 +34992,8 @@ var BlobLeaseClient = /** @class */ (function () { _g = createSpan("BlobLeaseClient-breakLease", options), span = _g.span, updatedOptions = _g.updatedOptions; 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))) { + (((_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))) { 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."); } _h.label = 1; @@ -34538,7 +35005,7 @@ var BlobLeaseClient = /** @class */ (function () { case 3: e_5 = _h.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_5.message }); throw e_5; @@ -37948,7 +38415,9 @@ var BlobClient = /** @class */ (function (_super) { _c.label = 1; case 1: _c.trys.push([1, 3, 4, 5]); - return [4 /*yield*/, this.blobContext.download(tslib.__assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), onDownloadProgress: coreHttp.isNode ? undefined : options.onProgress, range: offset === 0 && !count ? undefined : rangeToString({ offset: offset, count: count }), rangeGetContentMD5: options.rangeGetContentMD5, rangeGetContentCRC64: options.rangeGetContentCrc64, snapshot: options.snapshot, cpkInfo: options.customerProvidedKey }, convertTracingToRequestOptionsBase(updatedOptions)))]; + return [4 /*yield*/, this.blobContext.download(tslib.__assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), requestOptions: { + onDownloadProgress: coreHttp.isNode ? undefined : options.onProgress // for Node.js, progress is reported by RetriableReadableStream + }, range: offset === 0 && !count ? undefined : rangeToString({ offset: offset, count: count }), rangeGetContentMD5: options.rangeGetContentMD5, rangeGetContentCRC64: options.rangeGetContentCrc64, snapshot: options.snapshot, cpkInfo: options.customerProvidedKey }, convertTracingToRequestOptionsBase(updatedOptions)))]; case 2: res_1 = _c.sent(); wrappedRes = tslib.__assign(tslib.__assign({}, res_1), { _response: res_1._response, objectReplicationDestinationPolicyId: res_1.objectReplicationPolicyId, objectReplicationSourceProperties: parseObjectReplicationRecord(res_1.objectReplicationRules) }); @@ -38009,7 +38478,7 @@ var BlobClient = /** @class */ (function (_super) { case 3: e_1 = _c.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_1.message }); throw e_1; @@ -38055,13 +38524,13 @@ var BlobClient = /** @class */ (function (_super) { e_2 = _b.sent(); if (e_2.statusCode === 404) { span.setStatus({ - code: api.CanonicalCode.NOT_FOUND, + code: coreTracing.SpanStatusCode.ERROR, message: "Expected exception when checking blob existence" }); return [2 /*return*/, false]; } span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_2.message }); throw e_2; @@ -38106,7 +38575,7 @@ var BlobClient = /** @class */ (function (_super) { case 3: e_3 = _c.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_3.message }); throw e_3; @@ -38140,12 +38609,12 @@ var BlobClient = /** @class */ (function (_super) { _c.label = 1; case 1: _c.trys.push([1, 3, 4, 5]); - return [4 /*yield*/, this.blobContext.deleteMethod(tslib.__assign({ abortSignal: options.abortSignal, deleteSnapshots: options.deleteSnapshots, leaseAccessConditions: options.conditions, modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }) }, convertTracingToRequestOptionsBase(updatedOptions)))]; + return [4 /*yield*/, this.blobContext.delete(tslib.__assign({ abortSignal: options.abortSignal, deleteSnapshots: options.deleteSnapshots, leaseAccessConditions: options.conditions, modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }) }, convertTracingToRequestOptionsBase(updatedOptions)))]; case 2: return [2 /*return*/, _c.sent()]; case 3: e_4 = _c.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_4.message }); throw e_4; @@ -38187,13 +38656,13 @@ var BlobClient = /** @class */ (function (_super) { e_5 = _d.sent(); if (((_a = e_5.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobNotFound") { span.setStatus({ - code: api.CanonicalCode.NOT_FOUND, + code: coreTracing.SpanStatusCode.ERROR, message: "Expected exception when deleting a blob or snapshot only if it exists." }); return [2 /*return*/, tslib.__assign(tslib.__assign({ succeeded: false }, (_b = e_5.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e_5.response })]; } span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_5.message }); throw e_5; @@ -38229,7 +38698,7 @@ var BlobClient = /** @class */ (function (_super) { case 3: e_6 = _b.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_6.message }); throw e_6; @@ -38267,12 +38736,12 @@ var BlobClient = /** @class */ (function (_super) { case 1: _c.trys.push([1, 3, 4, 5]); ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return [4 /*yield*/, this.blobContext.setHTTPHeaders(tslib.__assign({ abortSignal: options.abortSignal, blobHTTPHeaders: blobHTTPHeaders, leaseAccessConditions: options.conditions, modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), cpkInfo: options.customerProvidedKey }, convertTracingToRequestOptionsBase(updatedOptions)))]; + return [4 /*yield*/, this.blobContext.setHttpHeaders(tslib.__assign({ abortSignal: options.abortSignal, blobHttpHeaders: blobHTTPHeaders, leaseAccessConditions: options.conditions, modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }) }, convertTracingToRequestOptionsBase(updatedOptions)))]; case 2: return [2 /*return*/, _c.sent()]; case 3: e_7 = _c.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_7.message }); throw e_7; @@ -38314,7 +38783,7 @@ var BlobClient = /** @class */ (function (_super) { case 3: e_8 = _c.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_8.message }); throw e_8; @@ -38352,7 +38821,7 @@ var BlobClient = /** @class */ (function (_super) { case 3: e_9 = _c.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_9.message }); throw e_9; @@ -38389,7 +38858,7 @@ var BlobClient = /** @class */ (function (_super) { case 3: e_10 = _c.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_10.message }); throw e_10; @@ -38435,7 +38904,7 @@ var BlobClient = /** @class */ (function (_super) { case 3: e_11 = _c.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_11.message }); throw e_11; @@ -38594,7 +39063,7 @@ var BlobClient = /** @class */ (function (_super) { case 3: e_12 = _b.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_12.message }); throw e_12; @@ -38638,7 +39107,7 @@ var BlobClient = /** @class */ (function (_super) { case 3: e_13 = _c.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_13.message }); throw e_13; @@ -38678,7 +39147,7 @@ var BlobClient = /** @class */ (function (_super) { case 3: e_14 = _c.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_14.message }); throw e_14; @@ -38802,7 +39271,7 @@ var BlobClient = /** @class */ (function (_super) { case 5: e_15 = _b.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_15.message }); throw e_15; @@ -38857,7 +39326,7 @@ var BlobClient = /** @class */ (function (_super) { case 5: e_16 = _b.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_16.message }); throw e_16; @@ -38956,7 +39425,7 @@ var BlobClient = /** @class */ (function (_super) { case 3: e_17 = _c.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_17.message }); throw e_17; @@ -39096,12 +39565,12 @@ var AppendBlobClient = /** @class */ (function (_super) { case 1: _c.trys.push([1, 3, 4, 5]); ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return [4 /*yield*/, this.appendBlobContext.create(0, tslib.__assign({ abortSignal: options.abortSignal, blobHTTPHeaders: options.blobHTTPHeaders, leaseAccessConditions: options.conditions, metadata: options.metadata, modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, blobTagsString: toBlobTagsString(options.tags) }, convertTracingToRequestOptionsBase(updatedOptions)))]; + return [4 /*yield*/, this.appendBlobContext.create(0, tslib.__assign({ abortSignal: options.abortSignal, blobHttpHeaders: options.blobHTTPHeaders, leaseAccessConditions: options.conditions, metadata: options.metadata, modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, blobTagsString: toBlobTagsString(options.tags) }, convertTracingToRequestOptionsBase(updatedOptions)))]; case 2: return [2 /*return*/, _c.sent()]; case 3: e_18 = _c.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_18.message }); throw e_18; @@ -39142,13 +39611,13 @@ var AppendBlobClient = /** @class */ (function (_super) { e_19 = _d.sent(); if (((_a = e_19.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobAlreadyExists") { span.setStatus({ - code: api.CanonicalCode.ALREADY_EXISTS, + code: coreTracing.SpanStatusCode.ERROR, message: "Expected exception when creating a blob only if it does not already exist." }); return [2 /*return*/, tslib.__assign(tslib.__assign({ succeeded: false }, (_b = e_19.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e_19.response })]; } span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_19.message }); throw e_19; @@ -39183,7 +39652,7 @@ var AppendBlobClient = /** @class */ (function (_super) { case 3: e_20 = _c.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_20.message }); throw e_20; @@ -39233,12 +39702,14 @@ var AppendBlobClient = /** @class */ (function (_super) { case 1: _c.trys.push([1, 3, 4, 5]); ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return [4 /*yield*/, this.appendBlobContext.appendBlock(body, contentLength, tslib.__assign({ abortSignal: options.abortSignal, appendPositionAccessConditions: options.conditions, leaseAccessConditions: options.conditions, modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), onUploadProgress: options.onProgress, transactionalContentMD5: options.transactionalContentMD5, transactionalContentCrc64: options.transactionalContentCrc64, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope }, convertTracingToRequestOptionsBase(updatedOptions)))]; + return [4 /*yield*/, this.appendBlobContext.appendBlock(contentLength, body, tslib.__assign({ abortSignal: options.abortSignal, appendPositionAccessConditions: options.conditions, leaseAccessConditions: options.conditions, modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), requestOptions: { + onUploadProgress: options.onProgress + }, transactionalContentMD5: options.transactionalContentMD5, transactionalContentCrc64: options.transactionalContentCrc64, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope }, convertTracingToRequestOptionsBase(updatedOptions)))]; case 2: return [2 /*return*/, _c.sent()]; case 3: e_21 = _c.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_21.message }); throw e_21; @@ -39289,7 +39760,7 @@ var AppendBlobClient = /** @class */ (function (_super) { case 3: e_22 = _c.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_22.message }); throw e_22; @@ -39425,6 +39896,7 @@ var BlockBlobClient = /** @class */ (function (_super) { case 1: _c.trys.push([1, 3, 4, 5]); return [4 /*yield*/, this._blobContext.query(tslib.__assign({ abortSignal: options.abortSignal, queryRequest: { + queryType: "SQL", expression: query, inputSerialization: toQuerySerialization(options.inputTextConfiguration), outputSerialization: toQuerySerialization(options.outputTextConfiguration) @@ -39439,7 +39911,7 @@ var BlockBlobClient = /** @class */ (function (_super) { case 3: e_23 = _c.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_23.message }); throw e_23; @@ -39492,12 +39964,14 @@ var BlockBlobClient = /** @class */ (function (_super) { case 1: _c.trys.push([1, 3, 4, 5]); ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return [4 /*yield*/, this.blockBlobContext.upload(body, contentLength, tslib.__assign({ abortSignal: options.abortSignal, blobHTTPHeaders: options.blobHTTPHeaders, leaseAccessConditions: options.conditions, metadata: options.metadata, modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), onUploadProgress: options.onProgress, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, tier: toAccessTier(options.tier), blobTagsString: toBlobTagsString(options.tags) }, convertTracingToRequestOptionsBase(updatedOptions)))]; + return [4 /*yield*/, this.blockBlobContext.upload(contentLength, body, tslib.__assign({ abortSignal: options.abortSignal, blobHttpHeaders: options.blobHTTPHeaders, leaseAccessConditions: options.conditions, metadata: options.metadata, modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), requestOptions: { + onUploadProgress: options.onProgress + }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, tier: toAccessTier(options.tier), blobTagsString: toBlobTagsString(options.tags) }, convertTracingToRequestOptionsBase(updatedOptions)))]; case 2: return [2 /*return*/, _c.sent()]; case 3: e_24 = _c.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_24.message }); throw e_24; @@ -39541,7 +40015,7 @@ var BlockBlobClient = /** @class */ (function (_super) { case 1: _g.trys.push([1, 3, 4, 5]); ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return [4 /*yield*/, this.blockBlobContext.putBlobFromUrl(0, sourceURL, tslib.__assign(tslib.__assign(tslib.__assign({}, options), { leaseAccessConditions: options.conditions, modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: options.conditions.tagConditions }), sourceModifiedAccessConditions: { + return [4 /*yield*/, this.blockBlobContext.putBlobFromUrl(0, sourceURL, tslib.__assign(tslib.__assign(tslib.__assign({}, options), { blobHttpHeaders: options.blobHTTPHeaders, leaseAccessConditions: options.conditions, modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: options.conditions.tagConditions }), sourceModifiedAccessConditions: { sourceIfMatch: (_a = options.sourceConditions) === null || _a === void 0 ? void 0 : _a.ifMatch, sourceIfModifiedSince: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifModifiedSince, sourceIfNoneMatch: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch, @@ -39552,7 +40026,7 @@ var BlockBlobClient = /** @class */ (function (_super) { case 3: e_25 = _g.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_25.message }); throw e_25; @@ -39587,12 +40061,14 @@ var BlockBlobClient = /** @class */ (function (_super) { case 1: _b.trys.push([1, 3, 4, 5]); ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return [4 /*yield*/, this.blockBlobContext.stageBlock(blockId, contentLength, body, tslib.__assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, onUploadProgress: options.onProgress, transactionalContentMD5: options.transactionalContentMD5, transactionalContentCrc64: options.transactionalContentCrc64, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope }, convertTracingToRequestOptionsBase(updatedOptions)))]; + return [4 /*yield*/, this.blockBlobContext.stageBlock(blockId, contentLength, body, tslib.__assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, requestOptions: { + onUploadProgress: options.onProgress + }, transactionalContentMD5: options.transactionalContentMD5, transactionalContentCrc64: options.transactionalContentCrc64, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope }, convertTracingToRequestOptionsBase(updatedOptions)))]; case 2: return [2 /*return*/, _b.sent()]; case 3: e_26 = _b.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_26.message }); throw e_26; @@ -39643,7 +40119,7 @@ var BlockBlobClient = /** @class */ (function (_super) { case 3: e_27 = _b.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_27.message }); throw e_27; @@ -39681,12 +40157,12 @@ var BlockBlobClient = /** @class */ (function (_super) { case 1: _c.trys.push([1, 3, 4, 5]); ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return [4 /*yield*/, this.blockBlobContext.commitBlockList({ latest: blocks }, tslib.__assign({ abortSignal: options.abortSignal, blobHTTPHeaders: options.blobHTTPHeaders, leaseAccessConditions: options.conditions, metadata: options.metadata, modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, tier: toAccessTier(options.tier), blobTagsString: toBlobTagsString(options.tags) }, convertTracingToRequestOptionsBase(updatedOptions)))]; + return [4 /*yield*/, this.blockBlobContext.commitBlockList({ latest: blocks }, tslib.__assign({ abortSignal: options.abortSignal, blobHttpHeaders: options.blobHTTPHeaders, leaseAccessConditions: options.conditions, metadata: options.metadata, modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, tier: toAccessTier(options.tier), blobTagsString: toBlobTagsString(options.tags) }, convertTracingToRequestOptionsBase(updatedOptions)))]; case 2: return [2 /*return*/, _c.sent()]; case 3: e_28 = _c.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_28.message }); throw e_28; @@ -39733,7 +40209,7 @@ var BlockBlobClient = /** @class */ (function (_super) { case 3: e_29 = _c.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_29.message }); throw e_29; @@ -39781,7 +40257,7 @@ var BlockBlobClient = /** @class */ (function (_super) { } catch (e) { span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e.message }); throw e; @@ -39825,7 +40301,7 @@ var BlockBlobClient = /** @class */ (function (_super) { case 3: e_30 = _b.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_30.message }); throw e_30; @@ -39949,7 +40425,7 @@ var BlockBlobClient = /** @class */ (function (_super) { case 5: e_31 = _b.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_31.message }); throw e_31; @@ -40001,7 +40477,7 @@ var BlockBlobClient = /** @class */ (function (_super) { case 4: e_32 = _b.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_32.message }); throw e_32; @@ -40090,7 +40566,7 @@ var BlockBlobClient = /** @class */ (function (_super) { case 4: e_33 = _b.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_33.message }); throw e_33; @@ -40204,12 +40680,12 @@ var PageBlobClient = /** @class */ (function (_super) { case 1: _c.trys.push([1, 3, 4, 5]); ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return [4 /*yield*/, this.pageBlobContext.create(0, size, tslib.__assign({ abortSignal: options.abortSignal, blobHTTPHeaders: options.blobHTTPHeaders, blobSequenceNumber: options.blobSequenceNumber, leaseAccessConditions: options.conditions, metadata: options.metadata, modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, tier: toAccessTier(options.tier), blobTagsString: toBlobTagsString(options.tags) }, convertTracingToRequestOptionsBase(updatedOptions)))]; + return [4 /*yield*/, this.pageBlobContext.create(0, size, tslib.__assign({ abortSignal: options.abortSignal, blobHttpHeaders: options.blobHTTPHeaders, blobSequenceNumber: options.blobSequenceNumber, leaseAccessConditions: options.conditions, metadata: options.metadata, modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, tier: toAccessTier(options.tier), blobTagsString: toBlobTagsString(options.tags) }, convertTracingToRequestOptionsBase(updatedOptions)))]; case 2: return [2 /*return*/, _c.sent()]; case 3: e_34 = _c.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_34.message }); throw e_34; @@ -40252,13 +40728,13 @@ var PageBlobClient = /** @class */ (function (_super) { e_35 = _d.sent(); if (((_a = e_35.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobAlreadyExists") { span.setStatus({ - code: api.CanonicalCode.ALREADY_EXISTS, + code: coreTracing.SpanStatusCode.ERROR, message: "Expected exception when creating a blob only if it does not already exist." }); return [2 /*return*/, tslib.__assign(tslib.__assign({ succeeded: false }, (_b = e_35.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e_35.response })]; } span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_35.message }); throw e_35; @@ -40294,12 +40770,14 @@ var PageBlobClient = /** @class */ (function (_super) { case 1: _c.trys.push([1, 3, 4, 5]); ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return [4 /*yield*/, this.pageBlobContext.uploadPages(body, count, tslib.__assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), onUploadProgress: options.onProgress, range: rangeToString({ offset: offset, count: count }), sequenceNumberAccessConditions: options.conditions, transactionalContentMD5: options.transactionalContentMD5, transactionalContentCrc64: options.transactionalContentCrc64, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope }, convertTracingToRequestOptionsBase(updatedOptions)))]; + return [4 /*yield*/, this.pageBlobContext.uploadPages(count, body, tslib.__assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: tslib.__assign(tslib.__assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), requestOptions: { + onUploadProgress: options.onProgress + }, range: rangeToString({ offset: offset, count: count }), sequenceNumberAccessConditions: options.conditions, transactionalContentMD5: options.transactionalContentMD5, transactionalContentCrc64: options.transactionalContentCrc64, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope }, convertTracingToRequestOptionsBase(updatedOptions)))]; case 2: return [2 /*return*/, _c.sent()]; case 3: e_36 = _c.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_36.message }); throw e_36; @@ -40347,7 +40825,7 @@ var PageBlobClient = /** @class */ (function (_super) { case 3: e_37 = _c.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_37.message }); throw e_37; @@ -40387,7 +40865,7 @@ var PageBlobClient = /** @class */ (function (_super) { case 3: e_38 = _c.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_38.message }); throw e_38; @@ -40429,7 +40907,7 @@ var PageBlobClient = /** @class */ (function (_super) { case 3: e_39 = _c.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_39.message }); throw e_39; @@ -40471,7 +40949,7 @@ var PageBlobClient = /** @class */ (function (_super) { case 3: e_40 = _c.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_40.message }); throw e_40; @@ -40513,7 +40991,7 @@ var PageBlobClient = /** @class */ (function (_super) { case 3: e_41 = _c.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_41.message }); throw e_41; @@ -40551,7 +41029,7 @@ var PageBlobClient = /** @class */ (function (_super) { case 3: e_42 = _c.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_42.message }); throw e_42; @@ -40590,7 +41068,7 @@ var PageBlobClient = /** @class */ (function (_super) { case 3: e_43 = _c.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_43.message }); throw e_43; @@ -40632,7 +41110,7 @@ var PageBlobClient = /** @class */ (function (_super) { case 3: e_44 = _c.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_44.message }); throw e_44; @@ -41003,7 +41481,7 @@ var BlobBatch = /** @class */ (function () { case 3: e_1 = _b.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_1.message }); throw e_1; @@ -41068,7 +41546,7 @@ var BlobBatch = /** @class */ (function () { case 3: e_2 = _b.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_2.message }); throw e_2; @@ -41379,7 +41857,7 @@ var BlobBatchClient = /** @class */ (function () { case 1: _b.trys.push([1, 4, 5, 6]); batchRequestBody = batchRequest.getHttpRequestBody(); - return [4 /*yield*/, this.serviceOrContainerContext.submitBatch(batchRequestBody, utf8ByteLength(batchRequestBody), batchRequest.getMultiPartContentType(), tslib.__assign(tslib.__assign({}, options), convertTracingToRequestOptionsBase(updatedOptions)))]; + return [4 /*yield*/, this.serviceOrContainerContext.submitBatch(utf8ByteLength(batchRequestBody), batchRequest.getMultiPartContentType(), batchRequestBody, tslib.__assign(tslib.__assign({}, options), convertTracingToRequestOptionsBase(updatedOptions)))]; case 2: rawBatchResponse = _b.sent(); batchResponseParser = new BatchResponseParser(rawBatchResponse, batchRequest.getSubRequests()); @@ -41401,7 +41879,7 @@ var BlobBatchClient = /** @class */ (function () { case 4: e_1 = _b.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_1.message }); throw e_1; @@ -41522,7 +42000,7 @@ var ContainerClient = /** @class */ (function (_super) { case 3: e_1 = _b.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_1.message }); throw e_1; @@ -41562,13 +42040,13 @@ var ContainerClient = /** @class */ (function (_super) { e_2 = _d.sent(); if (((_a = e_2.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ContainerAlreadyExists") { span.setStatus({ - code: api.CanonicalCode.ALREADY_EXISTS, + code: coreTracing.SpanStatusCode.ERROR, message: "Expected exception when creating a container only if it does not already exist." }); return [2 /*return*/, tslib.__assign(tslib.__assign({ succeeded: false }, (_b = e_2.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e_2.response })]; } span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_2.message }); throw e_2; @@ -41611,13 +42089,13 @@ var ContainerClient = /** @class */ (function (_super) { e_3 = _b.sent(); if (e_3.statusCode === 404) { span.setStatus({ - code: api.CanonicalCode.NOT_FOUND, + code: coreTracing.SpanStatusCode.ERROR, message: "Expected exception when checking container existence" }); return [2 /*return*/, false]; } span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_3.message }); throw e_3; @@ -41703,7 +42181,7 @@ var ContainerClient = /** @class */ (function (_super) { case 3: e_4 = _b.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_4.message }); throw e_4; @@ -41736,12 +42214,12 @@ var ContainerClient = /** @class */ (function (_super) { _b.label = 1; case 1: _b.trys.push([1, 3, 4, 5]); - return [4 /*yield*/, this.containerContext.deleteMethod(tslib.__assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: options.conditions }, convertTracingToRequestOptionsBase(updatedOptions)))]; + return [4 /*yield*/, this.containerContext.delete(tslib.__assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: options.conditions }, convertTracingToRequestOptionsBase(updatedOptions)))]; case 2: return [2 /*return*/, _b.sent()]; case 3: e_5 = _b.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_5.message }); throw e_5; @@ -41781,13 +42259,13 @@ var ContainerClient = /** @class */ (function (_super) { e_6 = _d.sent(); if (((_a = e_6.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ContainerNotFound") { span.setStatus({ - code: api.CanonicalCode.NOT_FOUND, + code: coreTracing.SpanStatusCode.ERROR, message: "Expected exception when deleting a container only if it exists." }); return [2 /*return*/, tslib.__assign(tslib.__assign({ succeeded: false }, (_b = e_6.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e_6.response })]; } span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_6.message }); throw e_6; @@ -41833,7 +42311,7 @@ var ContainerClient = /** @class */ (function (_super) { case 3: e_7 = _b.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_7.message }); throw e_7; @@ -41908,7 +42386,7 @@ var ContainerClient = /** @class */ (function (_super) { case 3: e_8 = _b.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_8.message }); throw e_8; @@ -41970,7 +42448,7 @@ var ContainerClient = /** @class */ (function (_super) { case 3: e_9 = _c.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_9.message }); throw e_9; @@ -42035,7 +42513,7 @@ var ContainerClient = /** @class */ (function (_super) { case 3: e_10 = _b.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_10.message }); throw e_10; @@ -42078,7 +42556,7 @@ var ContainerClient = /** @class */ (function (_super) { case 3: e_11 = _b.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_11.message }); throw e_11; @@ -42122,7 +42600,7 @@ var ContainerClient = /** @class */ (function (_super) { case 3: e_12 = _b.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_12.message }); throw e_12; @@ -42167,7 +42645,7 @@ var ContainerClient = /** @class */ (function (_super) { case 3: e_13 = _b.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_13.message }); throw e_13; @@ -43224,7 +43702,7 @@ var BlobServiceClient = /** @class */ (function (_super) { case 3: e_1 = _b.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_1.message }); throw e_1; @@ -43260,7 +43738,7 @@ var BlobServiceClient = /** @class */ (function (_super) { case 3: e_2 = _b.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_2.message }); throw e_2; @@ -43302,7 +43780,7 @@ var BlobServiceClient = /** @class */ (function (_super) { case 3: e_3 = _b.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_3.message }); throw e_3; @@ -43343,7 +43821,7 @@ var BlobServiceClient = /** @class */ (function (_super) { case 3: e_4 = _c.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_4.message }); throw e_4; @@ -43379,7 +43857,7 @@ var BlobServiceClient = /** @class */ (function (_super) { case 3: e_5 = _b.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_5.message }); throw e_5; @@ -43416,7 +43894,7 @@ var BlobServiceClient = /** @class */ (function (_super) { case 3: e_6 = _b.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_6.message }); throw e_6; @@ -43453,7 +43931,7 @@ var BlobServiceClient = /** @class */ (function (_super) { case 3: e_7 = _b.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_7.message }); throw e_7; @@ -43491,7 +43969,7 @@ var BlobServiceClient = /** @class */ (function (_super) { case 3: e_8 = _b.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_8.message }); throw e_8; @@ -43533,7 +44011,7 @@ var BlobServiceClient = /** @class */ (function (_super) { case 3: e_9 = _b.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_9.message }); throw e_9; @@ -43589,7 +44067,7 @@ var BlobServiceClient = /** @class */ (function (_super) { case 3: e_10 = _b.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_10.message }); throw e_10; @@ -44050,7 +44528,7 @@ var BlobServiceClient = /** @class */ (function (_super) { case 3: e_13 = _b.sent(); span.setStatus({ - code: api.CanonicalCode.UNKNOWN, + code: coreTracing.SpanStatusCode.ERROR, message: e_13.message }); throw e_13; @@ -44385,10 +44863,14 @@ var __createBinding; return r; }; - __spreadArray = function (to, from) { - for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) - to[j] = from[i]; - return to; + __spreadArray = function (to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || from); }; __await = function (v) { @@ -44486,8 +44968,8 @@ var __createBinding; /***/ }), -/***/ 5560: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 7171: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -44506,11 +44988,19 @@ var __createBinding; * See the License for the specific language governing permissions and * limitations under the License. */ +var __spreadArrays = (this && this.__spreadArrays) || function () { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; +}; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ContextAPI = void 0; -var context_base_1 = __nccwpck_require__(5664); -var global_utils_1 = __nccwpck_require__(3529); -var NOOP_CONTEXT_MANAGER = new context_base_1.NoopContextManager(); +var NoopContextManager_1 = __nccwpck_require__(4118); +var global_utils_1 = __nccwpck_require__(5135); +var API_NAME = 'context'; +var NOOP_CONTEXT_MANAGER = new NoopContextManager_1.NoopContextManager(); /** * Singleton object which represents the entry point to the OpenTelemetry Context API */ @@ -44529,11 +45019,7 @@ var ContextAPI = /** @class */ (function () { * Set the current context manager. Returns the initialized context manager */ ContextAPI.prototype.setGlobalContextManager = function (contextManager) { - if (global_utils_1._global[global_utils_1.GLOBAL_CONTEXT_MANAGER_API_KEY]) { - // global context manager has already been set - return this._getContextManager(); - } - global_utils_1._global[global_utils_1.GLOBAL_CONTEXT_MANAGER_API_KEY] = global_utils_1.makeGetter(global_utils_1.API_BACKWARDS_COMPATIBILITY_VERSION, contextManager, NOOP_CONTEXT_MANAGER); + global_utils_1.registerGlobal(API_NAME, contextManager); return contextManager; }; /** @@ -44547,9 +45033,16 @@ var ContextAPI = /** @class */ (function () { * * @param context context to be active during function execution * @param fn function to execute in a context + * @param thisArg optional receiver to be used for calling fn + * @param args optional arguments forwarded to fn */ - ContextAPI.prototype.with = function (context, fn) { - return this._getContextManager().with(context, fn); + ContextAPI.prototype.with = function (context, fn, thisArg) { + var _a; + var args = []; + for (var _i = 3; _i < arguments.length; _i++) { + args[_i - 3] = arguments[_i]; + } + return (_a = this._getContextManager()).with.apply(_a, __spreadArrays([context, fn, thisArg], args)); }; /** * Bind a context to a target function or event emitter @@ -44562,13 +45055,12 @@ var ContextAPI = /** @class */ (function () { return this._getContextManager().bind(target, context); }; ContextAPI.prototype._getContextManager = function () { - var _a, _b; - return ((_b = (_a = global_utils_1._global[global_utils_1.GLOBAL_CONTEXT_MANAGER_API_KEY]) === null || _a === void 0 ? void 0 : _a.call(global_utils_1._global, global_utils_1.API_BACKWARDS_COMPATIBILITY_VERSION)) !== null && _b !== void 0 ? _b : NOOP_CONTEXT_MANAGER); + return global_utils_1.getGlobal(API_NAME) || NOOP_CONTEXT_MANAGER; }; /** Disable and remove the global context manager */ ContextAPI.prototype.disable = function () { this._getContextManager().disable(); - delete global_utils_1._global[global_utils_1.GLOBAL_CONTEXT_MANAGER_API_KEY]; + global_utils_1.unregisterGlobal(API_NAME); }; return ContextAPI; }()); @@ -44577,61 +45069,7 @@ exports.ContextAPI = ContextAPI; /***/ }), -/***/ 3529: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.API_BACKWARDS_COMPATIBILITY_VERSION = exports.makeGetter = exports._global = exports.GLOBAL_TRACE_API_KEY = exports.GLOBAL_PROPAGATION_API_KEY = exports.GLOBAL_METRICS_API_KEY = exports.GLOBAL_CONTEXT_MANAGER_API_KEY = void 0; -var platform_1 = __nccwpck_require__(9957); -exports.GLOBAL_CONTEXT_MANAGER_API_KEY = Symbol.for('io.opentelemetry.js.api.context'); -exports.GLOBAL_METRICS_API_KEY = Symbol.for('io.opentelemetry.js.api.metrics'); -exports.GLOBAL_PROPAGATION_API_KEY = Symbol.for('io.opentelemetry.js.api.propagation'); -exports.GLOBAL_TRACE_API_KEY = Symbol.for('io.opentelemetry.js.api.trace'); -exports._global = platform_1._globalThis; -/** - * Make a function which accepts a version integer and returns the instance of an API if the version - * is compatible, or a fallback version (usually NOOP) if it is not. - * - * @param requiredVersion Backwards compatibility version which is required to return the instance - * @param instance Instance which should be returned if the required version is compatible - * @param fallback Fallback instance, usually NOOP, which will be returned if the required version is not compatible - */ -function makeGetter(requiredVersion, instance, fallback) { - return function (version) { - return version === requiredVersion ? instance : fallback; - }; -} -exports.makeGetter = makeGetter; -/** - * A number which should be incremented each time a backwards incompatible - * change is made to the API. This number is used when an API package - * attempts to access the global API to ensure it is getting a compatible - * version. If the global API is not compatible with the API package - * attempting to get it, a NOOP API implementation will be returned. - */ -exports.API_BACKWARDS_COMPATIBILITY_VERSION = 0; -//# sourceMappingURL=global-utils.js.map - -/***/ }), - -/***/ 7696: +/***/ 1877: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -44652,55 +45090,69 @@ exports.API_BACKWARDS_COMPATIBILITY_VERSION = 0; * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.MetricsAPI = void 0; -var NoopMeterProvider_1 = __nccwpck_require__(2647); -var global_utils_1 = __nccwpck_require__(3529); +exports.DiagAPI = void 0; +var logLevelLogger_1 = __nccwpck_require__(9639); +var types_1 = __nccwpck_require__(8077); +var global_utils_1 = __nccwpck_require__(5135); +var API_NAME = 'diag'; /** - * Singleton object which represents the entry point to the OpenTelemetry Metrics API + * Singleton object which represents the entry point to the OpenTelemetry internal + * diagnostic API */ -var MetricsAPI = /** @class */ (function () { - /** Empty private constructor prevents end users from constructing a new instance of the API */ - function MetricsAPI() { +var DiagAPI = /** @class */ (function () { + /** + * Private internal constructor + * @private + */ + function DiagAPI() { + function _logProxy(funcName) { + return function () { + var logger = global_utils_1.getGlobal('diag'); + // shortcut if logger not set + if (!logger) + return; + return logger[funcName].apply(logger, + // work around Function.prototype.apply types + // eslint-disable-next-line @typescript-eslint/no-explicit-any + arguments); + }; + } + // Using self local variable for minification purposes as 'this' cannot be minified + var self = this; + // DiagAPI specific functions + self.setLogger = function (logger, logLevel) { + var _a; + if (logLevel === void 0) { logLevel = types_1.DiagLogLevel.INFO; } + if (logger === self) { + // There isn't much we can do here. + // Logging to the console might break the user application. + // Try to log to self. If a logger was previously registered it will receive the log. + var err = new Error('Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation'); + self.error((_a = err.stack) !== null && _a !== void 0 ? _a : err.message); + return; + } + global_utils_1.registerGlobal('diag', logLevelLogger_1.createLogLevelDiagLogger(logLevel, logger), true); + }; + self.disable = function () { + global_utils_1.unregisterGlobal(API_NAME); + }; + self.verbose = _logProxy('verbose'); + self.debug = _logProxy('debug'); + self.info = _logProxy('info'); + self.warn = _logProxy('warn'); + self.error = _logProxy('error'); } - /** Get the singleton instance of the Metrics API */ - MetricsAPI.getInstance = function () { + /** Get the singleton instance of the DiagAPI API */ + DiagAPI.instance = function () { if (!this._instance) { - this._instance = new MetricsAPI(); + this._instance = new DiagAPI(); } return this._instance; }; - /** - * Set the current global meter. Returns the initialized global meter provider. - */ - MetricsAPI.prototype.setGlobalMeterProvider = function (provider) { - if (global_utils_1._global[global_utils_1.GLOBAL_METRICS_API_KEY]) { - // global meter provider has already been set - return this.getMeterProvider(); - } - global_utils_1._global[global_utils_1.GLOBAL_METRICS_API_KEY] = global_utils_1.makeGetter(global_utils_1.API_BACKWARDS_COMPATIBILITY_VERSION, provider, NoopMeterProvider_1.NOOP_METER_PROVIDER); - return provider; - }; - /** - * Returns the global meter provider. - */ - MetricsAPI.prototype.getMeterProvider = function () { - var _a, _b; - return ((_b = (_a = global_utils_1._global[global_utils_1.GLOBAL_METRICS_API_KEY]) === null || _a === void 0 ? void 0 : _a.call(global_utils_1._global, global_utils_1.API_BACKWARDS_COMPATIBILITY_VERSION)) !== null && _b !== void 0 ? _b : NoopMeterProvider_1.NOOP_METER_PROVIDER); - }; - /** - * Returns a meter from the global meter provider. - */ - MetricsAPI.prototype.getMeter = function (name, version) { - return this.getMeterProvider().getMeter(name, version); - }; - /** Remove the global meter provider */ - MetricsAPI.prototype.disable = function () { - delete global_utils_1._global[global_utils_1.GLOBAL_METRICS_API_KEY]; - }; - return MetricsAPI; + return DiagAPI; }()); -exports.MetricsAPI = MetricsAPI; -//# sourceMappingURL=metrics.js.map +exports.DiagAPI = DiagAPI; +//# sourceMappingURL=diag.js.map /***/ }), @@ -44726,12 +45178,10 @@ exports.MetricsAPI = MetricsAPI; */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.PropagationAPI = void 0; -var getter_1 = __nccwpck_require__(3050); -var NoopHttpTextPropagator_1 = __nccwpck_require__(9757); -var setter_1 = __nccwpck_require__(4707); -var context_1 = __nccwpck_require__(5560); -var global_utils_1 = __nccwpck_require__(3529); -var contextApi = context_1.ContextAPI.getInstance(); +var NoopTextMapPropagator_1 = __nccwpck_require__(2368); +var TextMapPropagator_1 = __nccwpck_require__(865); +var global_utils_1 = __nccwpck_require__(5135); +var API_NAME = 'propagation'; /** * Singleton object which represents the entry point to the OpenTelemetry Propagation API */ @@ -44750,44 +45200,43 @@ var PropagationAPI = /** @class */ (function () { * Set the current propagator. Returns the initialized propagator */ PropagationAPI.prototype.setGlobalPropagator = function (propagator) { - if (global_utils_1._global[global_utils_1.GLOBAL_PROPAGATION_API_KEY]) { - // global propagator has already been set - return this._getGlobalPropagator(); - } - global_utils_1._global[global_utils_1.GLOBAL_PROPAGATION_API_KEY] = global_utils_1.makeGetter(global_utils_1.API_BACKWARDS_COMPATIBILITY_VERSION, propagator, NoopHttpTextPropagator_1.NOOP_HTTP_TEXT_PROPAGATOR); + global_utils_1.registerGlobal(API_NAME, propagator); return propagator; }; /** * Inject context into a carrier to be propagated inter-process * + * @param context Context carrying tracing data to inject * @param carrier carrier to inject context into * @param setter Function used to set values on the carrier - * @param context Context carrying tracing data to inject. Defaults to the currently active context. */ - PropagationAPI.prototype.inject = function (carrier, setter, context) { - if (setter === void 0) { setter = setter_1.defaultSetter; } - if (context === void 0) { context = contextApi.active(); } + PropagationAPI.prototype.inject = function (context, carrier, setter) { + if (setter === void 0) { setter = TextMapPropagator_1.defaultTextMapSetter; } return this._getGlobalPropagator().inject(context, carrier, setter); }; /** * Extract context from a carrier * + * @param context Context which the newly created context will inherit from * @param carrier Carrier to extract context from * @param getter Function used to extract keys from a carrier - * @param context Context which the newly created context will inherit from. Defaults to the currently active context. */ - PropagationAPI.prototype.extract = function (carrier, getter, context) { - if (getter === void 0) { getter = getter_1.defaultGetter; } - if (context === void 0) { context = contextApi.active(); } + PropagationAPI.prototype.extract = function (context, carrier, getter) { + if (getter === void 0) { getter = TextMapPropagator_1.defaultTextMapGetter; } return this._getGlobalPropagator().extract(context, carrier, getter); }; + /** + * Return a list of all fields which may be used by the propagator. + */ + PropagationAPI.prototype.fields = function () { + return this._getGlobalPropagator().fields(); + }; /** Remove the global propagator */ PropagationAPI.prototype.disable = function () { - delete global_utils_1._global[global_utils_1.GLOBAL_PROPAGATION_API_KEY]; + global_utils_1.unregisterGlobal(API_NAME); }; PropagationAPI.prototype._getGlobalPropagator = function () { - var _a, _b; - return ((_b = (_a = global_utils_1._global[global_utils_1.GLOBAL_PROPAGATION_API_KEY]) === null || _a === void 0 ? void 0 : _a.call(global_utils_1._global, global_utils_1.API_BACKWARDS_COMPATIBILITY_VERSION)) !== null && _b !== void 0 ? _b : NoopHttpTextPropagator_1.NOOP_HTTP_TEXT_PROPAGATOR); + return global_utils_1.getGlobal(API_NAME) || NoopTextMapPropagator_1.NOOP_TEXT_MAP_PROPAGATOR; }; return PropagationAPI; }()); @@ -44818,14 +45267,18 @@ exports.PropagationAPI = PropagationAPI; */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.TraceAPI = void 0; -var NoopTracerProvider_1 = __nccwpck_require__(3259); -var global_utils_1 = __nccwpck_require__(3529); +var ProxyTracerProvider_1 = __nccwpck_require__(2285); +var spancontext_utils_1 = __nccwpck_require__(9745); +var global_utils_1 = __nccwpck_require__(5135); +var API_NAME = 'trace'; /** * Singleton object which represents the entry point to the OpenTelemetry Tracing API */ var TraceAPI = /** @class */ (function () { /** Empty private constructor prevents end users from constructing a new instance of the API */ function TraceAPI() { + this._proxyTracerProvider = new ProxyTracerProvider_1.ProxyTracerProvider(); + this.isSpanContextValid = spancontext_utils_1.isSpanContextValid; } /** Get the singleton instance of the Trace API */ TraceAPI.getInstance = function () { @@ -44838,19 +45291,15 @@ var TraceAPI = /** @class */ (function () { * Set the current global tracer. Returns the initialized global tracer provider */ TraceAPI.prototype.setGlobalTracerProvider = function (provider) { - if (global_utils_1._global[global_utils_1.GLOBAL_TRACE_API_KEY]) { - // global tracer provider has already been set - return this.getTracerProvider(); - } - global_utils_1._global[global_utils_1.GLOBAL_TRACE_API_KEY] = global_utils_1.makeGetter(global_utils_1.API_BACKWARDS_COMPATIBILITY_VERSION, provider, NoopTracerProvider_1.NOOP_TRACER_PROVIDER); - return this.getTracerProvider(); + this._proxyTracerProvider.setDelegate(provider); + global_utils_1.registerGlobal(API_NAME, this._proxyTracerProvider); + return this._proxyTracerProvider; }; /** * Returns the global tracer provider. */ TraceAPI.prototype.getTracerProvider = function () { - var _a, _b; - return ((_b = (_a = global_utils_1._global[global_utils_1.GLOBAL_TRACE_API_KEY]) === null || _a === void 0 ? void 0 : _a.call(global_utils_1._global, global_utils_1.API_BACKWARDS_COMPATIBILITY_VERSION)) !== null && _b !== void 0 ? _b : NoopTracerProvider_1.NOOP_TRACER_PROVIDER); + return global_utils_1.getGlobal(API_NAME) || this._proxyTracerProvider; }; /** * Returns a tracer from the global tracer provider. @@ -44860,7 +45309,8 @@ var TraceAPI = /** @class */ (function () { }; /** Remove the global tracer provider */ TraceAPI.prototype.disable = function () { - delete global_utils_1._global[global_utils_1.GLOBAL_TRACE_API_KEY]; + global_utils_1.unregisterGlobal(API_NAME); + this._proxyTracerProvider = new ProxyTracerProvider_1.ProxyTracerProvider(); }; return TraceAPI; }()); @@ -44869,7 +45319,7 @@ exports.TraceAPI = TraceAPI; /***/ }), -/***/ 1344: +/***/ 131: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -44890,21 +45340,105 @@ exports.TraceAPI = TraceAPI; * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=Logger.js.map +//# sourceMappingURL=Baggage.js.map /***/ }), -/***/ 2358: +/***/ 719: /***/ ((__unused_webpack_module, exports) => { "use strict"; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=Entry.js.map + +/***/ }), + +/***/ 4967: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=Time.js.map +exports.baggageEntryMetadataFromString = exports.createBaggage = void 0; +var baggage_1 = __nccwpck_require__(8137); +var symbol_1 = __nccwpck_require__(3542); +__exportStar(__nccwpck_require__(131), exports); +__exportStar(__nccwpck_require__(719), exports); +/** + * Create a new Baggage with optional entries + * + * @param entries An array of baggage entries the new baggage should contain + */ +function createBaggage(entries) { + if (entries === void 0) { entries = {}; } + return new baggage_1.BaggageImpl(new Map(Object.entries(entries))); +} +exports.createBaggage = createBaggage; +/** + * Create a serializable BaggageEntryMetadata object from a string. + * + * @param str string metadata. Format is currently not defined by the spec and has no special meaning. + * + */ +function baggageEntryMetadataFromString(str) { + if (typeof str !== 'string') { + // @TODO log diagnostic + str = ''; + } + return { + __TYPE__: symbol_1.baggageEntryMetadataSymbol, + toString: function () { + return str; + }, + }; +} +exports.baggageEntryMetadataFromString = baggageEntryMetadataFromString; +//# sourceMappingURL=index.js.map /***/ }), -/***/ 3422: +/***/ 8137: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -44925,11 +45459,57 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=HttpTextPropagator.js.map +exports.BaggageImpl = void 0; +var BaggageImpl = /** @class */ (function () { + function BaggageImpl(entries) { + this._entries = entries ? new Map(entries) : new Map(); + } + BaggageImpl.prototype.getEntry = function (key) { + var entry = this._entries.get(key); + if (!entry) { + return undefined; + } + return Object.assign({}, entry); + }; + BaggageImpl.prototype.getAllEntries = function () { + return Array.from(this._entries.entries()).map(function (_a) { + var k = _a[0], v = _a[1]; + return [k, v]; + }); + }; + BaggageImpl.prototype.setEntry = function (key, entry) { + var newBaggage = new BaggageImpl(this._entries); + newBaggage._entries.set(key, entry); + return newBaggage; + }; + BaggageImpl.prototype.removeEntry = function (key) { + var newBaggage = new BaggageImpl(this._entries); + newBaggage._entries.delete(key); + return newBaggage; + }; + BaggageImpl.prototype.removeEntries = function () { + var keys = []; + for (var _i = 0; _i < arguments.length; _i++) { + keys[_i] = arguments[_i]; + } + var newBaggage = new BaggageImpl(this._entries); + for (var _a = 0, keys_1 = keys; _a < keys_1.length; _a++) { + var key = keys_1[_a]; + newBaggage._entries.delete(key); + } + return newBaggage; + }; + BaggageImpl.prototype.clear = function () { + return new BaggageImpl(); + }; + return BaggageImpl; +}()); +exports.BaggageImpl = BaggageImpl; +//# sourceMappingURL=baggage.js.map /***/ }), -/***/ 9757: +/***/ 3542: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -44950,28 +45530,292 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NOOP_HTTP_TEXT_PROPAGATOR = exports.NoopHttpTextPropagator = void 0; +exports.baggageEntryMetadataSymbol = void 0; /** - * No-op implementations of {@link HttpTextPropagator}. + * Symbol used to make BaggageEntryMetadata an opaque type + */ +exports.baggageEntryMetadataSymbol = Symbol('BaggageEntryMetadata'); +//# sourceMappingURL=symbol.js.map + +/***/ }), + +/***/ 4447: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=Exception.js.map + +/***/ }), + +/***/ 2358: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=Time.js.map + +/***/ }), + +/***/ 4118: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ -var NoopHttpTextPropagator = /** @class */ (function () { - function NoopHttpTextPropagator() { +var __spreadArrays = (this && this.__spreadArrays) || function () { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.NoopContextManager = void 0; +var context_1 = __nccwpck_require__(8242); +var NoopContextManager = /** @class */ (function () { + function NoopContextManager() { } - /** Noop inject function does nothing */ - NoopHttpTextPropagator.prototype.inject = function (context, carrier, setter) { }; - /** Noop extract function does nothing and returns the input context */ - NoopHttpTextPropagator.prototype.extract = function (context, carrier, getter) { - return context; + NoopContextManager.prototype.active = function () { + return context_1.ROOT_CONTEXT; + }; + NoopContextManager.prototype.with = function (_context, fn, thisArg) { + var args = []; + for (var _i = 3; _i < arguments.length; _i++) { + args[_i - 3] = arguments[_i]; + } + return fn.call.apply(fn, __spreadArrays([thisArg], args)); + }; + NoopContextManager.prototype.bind = function (target, _context) { + return target; }; - return NoopHttpTextPropagator; + NoopContextManager.prototype.enable = function () { + return this; + }; + NoopContextManager.prototype.disable = function () { + return this; + }; + return NoopContextManager; +}()); +exports.NoopContextManager = NoopContextManager; +//# sourceMappingURL=NoopContextManager.js.map + +/***/ }), + +/***/ 8242: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ROOT_CONTEXT = exports.createContextKey = exports.setBaggage = exports.getBaggage = exports.isInstrumentationSuppressed = exports.unsuppressInstrumentation = exports.suppressInstrumentation = exports.getSpanContext = exports.setSpanContext = exports.setSpan = exports.getSpan = void 0; +var NoopSpan_1 = __nccwpck_require__(1169); +/** + * span key + */ +var SPAN_KEY = createContextKey('OpenTelemetry Context Key SPAN'); +/** + * Shared key for indicating if instrumentation should be suppressed beyond + * this current scope. + */ +var SUPPRESS_INSTRUMENTATION_KEY = createContextKey('OpenTelemetry Context Key SUPPRESS_INSTRUMENTATION'); +/** + * Baggage key + */ +var BAGGAGE_KEY = createContextKey('OpenTelemetry Baggage Key'); +/** + * Return the span if one exists + * + * @param context context to get span from + */ +function getSpan(context) { + return context.getValue(SPAN_KEY) || undefined; +} +exports.getSpan = getSpan; +/** + * Set the span on a context + * + * @param context context to use as parent + * @param span span to set active + */ +function setSpan(context, span) { + return context.setValue(SPAN_KEY, span); +} +exports.setSpan = setSpan; +/** + * Wrap span context in a NoopSpan and set as span in a new + * context + * + * @param context context to set active span on + * @param spanContext span context to be wrapped + */ +function setSpanContext(context, spanContext) { + return setSpan(context, new NoopSpan_1.NoopSpan(spanContext)); +} +exports.setSpanContext = setSpanContext; +/** + * Get the span context of the span if it exists. + * + * @param context context to get values from + */ +function getSpanContext(context) { + var _a; + return (_a = getSpan(context)) === null || _a === void 0 ? void 0 : _a.context(); +} +exports.getSpanContext = getSpanContext; +/** + * Sets value on context to indicate that instrumentation should + * be suppressed beyond this current scope. + * + * @param context context to set the suppress instrumentation value on. + */ +function suppressInstrumentation(context) { + return context.setValue(SUPPRESS_INSTRUMENTATION_KEY, true); +} +exports.suppressInstrumentation = suppressInstrumentation; +/** + * Sets value on context to indicate that instrumentation should + * no-longer be suppressed beyond this current scope. + * + * @param context context to set the suppress instrumentation value on. + */ +function unsuppressInstrumentation(context) { + return context.setValue(SUPPRESS_INSTRUMENTATION_KEY, false); +} +exports.unsuppressInstrumentation = unsuppressInstrumentation; +/** + * Return current suppress instrumentation value for the given context, + * if it exists. + * + * @param context context check for the suppress instrumentation value. + */ +function isInstrumentationSuppressed(context) { + return Boolean(context.getValue(SUPPRESS_INSTRUMENTATION_KEY)); +} +exports.isInstrumentationSuppressed = isInstrumentationSuppressed; +/** + * @param {Context} Context that manage all context values + * @returns {Baggage} Extracted baggage from the context + */ +function getBaggage(context) { + return context.getValue(BAGGAGE_KEY) || undefined; +} +exports.getBaggage = getBaggage; +/** + * @param {Context} Context that manage all context values + * @param {Baggage} baggage that will be set in the actual context + */ +function setBaggage(context, baggage) { + return context.setValue(BAGGAGE_KEY, baggage); +} +exports.setBaggage = setBaggage; +/** Get a key to uniquely identify a context value */ +function createContextKey(description) { + return Symbol.for(description); +} +exports.createContextKey = createContextKey; +var BaseContext = /** @class */ (function () { + /** + * Construct a new context which inherits values from an optional parent context. + * + * @param parentContext a context from which to inherit values + */ + function BaseContext(parentContext) { + // for minification + var self = this; + self._currentContext = parentContext ? new Map(parentContext) : new Map(); + self.getValue = function (key) { return self._currentContext.get(key); }; + self.setValue = function (key, value) { + var context = new BaseContext(self._currentContext); + context._currentContext.set(key, value); + return context; + }; + self.deleteValue = function (key) { + var context = new BaseContext(self._currentContext); + context._currentContext.delete(key); + return context; + }; + } + return BaseContext; }()); -exports.NoopHttpTextPropagator = NoopHttpTextPropagator; -exports.NOOP_HTTP_TEXT_PROPAGATOR = new NoopHttpTextPropagator(); -//# sourceMappingURL=NoopHttpTextPropagator.js.map +/** The root context is used as the default parent context when there is no active context */ +exports.ROOT_CONTEXT = new BaseContext(); +//# sourceMappingURL=context.js.map + +/***/ }), + +/***/ 6504: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=types.js.map /***/ }), -/***/ 3050: +/***/ 3041: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -44992,24 +45836,88 @@ exports.NOOP_HTTP_TEXT_PROPAGATOR = new NoopHttpTextPropagator(); * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.defaultGetter = void 0; +exports.DiagConsoleLogger = void 0; +var consoleMap = [ + { n: 'error', c: 'error' }, + { n: 'warn', c: 'warn' }, + { n: 'info', c: 'info' }, + { n: 'debug', c: 'debug' }, + { n: 'verbose', c: 'trace' }, +]; /** - * Default getter which just does a simple property access. Returns - * undefined if the key is not set. + * A simple Immutable Console based diagnostic logger which will output any messages to the Console. + * If you want to limit the amount of logging to a specific level or lower use the + * {@link createLogLevelDiagLogger} + */ +var DiagConsoleLogger = /** @class */ (function () { + function DiagConsoleLogger() { + function _consoleFunc(funcName) { + return function () { + var orgArguments = arguments; + if (console) { + // Some environments only expose the console when the F12 developer console is open + var theFunc = console[funcName]; + if (typeof theFunc !== 'function') { + // Not all environments support all functions + theFunc = console.log; + } + // One last final check + if (typeof theFunc === 'function') { + return theFunc.apply(console, orgArguments); + } + } + }; + } + for (var i = 0; i < consoleMap.length; i++) { + this[consoleMap[i].n] = _consoleFunc(consoleMap[i].c); + } + } + return DiagConsoleLogger; +}()); +exports.DiagConsoleLogger = DiagConsoleLogger; +//# sourceMappingURL=consoleLogger.js.map + +/***/ }), + +/***/ 1634: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 * - * @param carrier - * @param key + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ -function defaultGetter(carrier, key) { - return carrier[key]; -} -exports.defaultGetter = defaultGetter; -//# sourceMappingURL=getter.js.map +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__nccwpck_require__(3041), exports); +__exportStar(__nccwpck_require__(8077), exports); +//# sourceMappingURL=index.js.map /***/ }), -/***/ 4707: -/***/ ((__unused_webpack_module, exports) => { +/***/ 9639: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -45029,22 +45937,38 @@ exports.defaultGetter = defaultGetter; * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.defaultSetter = void 0; -/** - * Default setter which sets value via direct property access - * - * @param carrier - * @param key - */ -function defaultSetter(carrier, key, value) { - carrier[key] = value; +exports.createLogLevelDiagLogger = void 0; +var types_1 = __nccwpck_require__(8077); +function createLogLevelDiagLogger(maxLevel, logger) { + if (maxLevel < types_1.DiagLogLevel.NONE) { + maxLevel = types_1.DiagLogLevel.NONE; + } + else if (maxLevel > types_1.DiagLogLevel.ALL) { + maxLevel = types_1.DiagLogLevel.ALL; + } + // In case the logger is null or undefined + logger = logger || {}; + function _filterFunc(funcName, theLevel) { + var theFunc = logger[funcName]; + if (typeof theFunc === 'function' && maxLevel >= theLevel) { + return theFunc.bind(logger); + } + return function () { }; + } + return { + error: _filterFunc('error', types_1.DiagLogLevel.ERROR), + warn: _filterFunc('warn', types_1.DiagLogLevel.WARN), + info: _filterFunc('info', types_1.DiagLogLevel.INFO), + debug: _filterFunc('debug', types_1.DiagLogLevel.DEBUG), + verbose: _filterFunc('verbose', types_1.DiagLogLevel.VERBOSE), + }; } -exports.defaultSetter = defaultSetter; -//# sourceMappingURL=setter.js.map +exports.createLogLevelDiagLogger = createLogLevelDiagLogger; +//# sourceMappingURL=logLevelLogger.js.map /***/ }), -/***/ 808: +/***/ 8077: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -45065,33 +45989,33 @@ exports.defaultSetter = defaultSetter; * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=CorrelationContext.js.map - -/***/ }), - -/***/ 1809: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.EntryTtl = void 0; +exports.DiagLogLevel = void 0; /** - * EntryTtl is an integer that represents number of hops an entry can propagate. - * - * For now, ONLY special values (0 and -1) are supported. + * Defines the available internal logging levels for the diagnostic logger, the numeric values + * of the levels are defined to match the original values from the initial LogLevel to avoid + * compatibility/migration issues for any implementation that assume the numeric ordering. */ -var EntryTtl; -(function (EntryTtl) { +var DiagLogLevel; +(function (DiagLogLevel) { + /** Diagnostic Logging level setting to disable all logging (except and forced logs) */ + DiagLogLevel[DiagLogLevel["NONE"] = 0] = "NONE"; + /** Identifies an error scenario */ + DiagLogLevel[DiagLogLevel["ERROR"] = 30] = "ERROR"; + /** Identifies a warning scenario */ + DiagLogLevel[DiagLogLevel["WARN"] = 50] = "WARN"; + /** General informational log message */ + DiagLogLevel[DiagLogLevel["INFO"] = 60] = "INFO"; + /** General debug log message */ + DiagLogLevel[DiagLogLevel["DEBUG"] = 70] = "DEBUG"; /** - * NO_PROPAGATION is considered to have local context and is used within the - * process it created. + * Detailed trace level logging should only be used for development, should only be set + * in a development environment. */ - EntryTtl[EntryTtl["NO_PROPAGATION"] = 0] = "NO_PROPAGATION"; - /** UNLIMITED_PROPAGATION can propagate unlimited hops. */ - EntryTtl[EntryTtl["UNLIMITED_PROPAGATION"] = -1] = "UNLIMITED_PROPAGATION"; -})(EntryTtl = exports.EntryTtl || (exports.EntryTtl = {})); -//# sourceMappingURL=EntryValue.js.map + DiagLogLevel[DiagLogLevel["VERBOSE"] = 80] = "VERBOSE"; + /** Used to set the logging level to include all logging */ + DiagLogLevel[DiagLogLevel["ALL"] = 9999] = "ALL"; +})(DiagLogLevel = exports.DiagLogLevel || (exports.DiagLogLevel = {})); +//# sourceMappingURL=types.js.map /***/ }), @@ -45123,35 +46047,24 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi o[k2] = m[k]; })); var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); }; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.propagation = exports.metrics = exports.trace = exports.context = void 0; -__exportStar(__nccwpck_require__(1344), exports); +exports.diag = exports.propagation = exports.trace = exports.context = exports.isValidSpanId = exports.isValidTraceId = exports.isSpanContextValid = exports.INVALID_SPAN_CONTEXT = exports.INVALID_TRACEID = exports.INVALID_SPANID = void 0; +__exportStar(__nccwpck_require__(4967), exports); +__exportStar(__nccwpck_require__(4447), exports); __exportStar(__nccwpck_require__(2358), exports); -__exportStar(__nccwpck_require__(3050), exports); -__exportStar(__nccwpck_require__(3422), exports); -__exportStar(__nccwpck_require__(9757), exports); -__exportStar(__nccwpck_require__(4707), exports); -__exportStar(__nccwpck_require__(808), exports); -__exportStar(__nccwpck_require__(1809), exports); -__exportStar(__nccwpck_require__(2500), exports); -__exportStar(__nccwpck_require__(4931), exports); -__exportStar(__nccwpck_require__(2111), exports); -__exportStar(__nccwpck_require__(7507), exports); -__exportStar(__nccwpck_require__(9999), exports); -__exportStar(__nccwpck_require__(4837), exports); -__exportStar(__nccwpck_require__(2647), exports); -__exportStar(__nccwpck_require__(817), exports); -__exportStar(__nccwpck_require__(3347), exports); +__exportStar(__nccwpck_require__(1634), exports); +__exportStar(__nccwpck_require__(2368), exports); +__exportStar(__nccwpck_require__(865), exports); __exportStar(__nccwpck_require__(7492), exports); __exportStar(__nccwpck_require__(4595), exports); -__exportStar(__nccwpck_require__(6169), exports); __exportStar(__nccwpck_require__(9373), exports); __exportStar(__nccwpck_require__(4023), exports); -__exportStar(__nccwpck_require__(1169), exports); __exportStar(__nccwpck_require__(7606), exports); __exportStar(__nccwpck_require__(3259), exports); +__exportStar(__nccwpck_require__(3503), exports); +__exportStar(__nccwpck_require__(2285), exports); __exportStar(__nccwpck_require__(9671), exports); __exportStar(__nccwpck_require__(3209), exports); __exportStar(__nccwpck_require__(5769), exports); @@ -45164,107 +46077,45 @@ __exportStar(__nccwpck_require__(6905), exports); __exportStar(__nccwpck_require__(8384), exports); __exportStar(__nccwpck_require__(891), exports); __exportStar(__nccwpck_require__(3168), exports); -var context_base_1 = __nccwpck_require__(5664); -Object.defineProperty(exports, "Context", ({ enumerable: true, get: function () { return context_base_1.Context; } })); -var context_1 = __nccwpck_require__(5560); +var spancontext_utils_1 = __nccwpck_require__(9745); +Object.defineProperty(exports, "INVALID_SPANID", ({ enumerable: true, get: function () { return spancontext_utils_1.INVALID_SPANID; } })); +Object.defineProperty(exports, "INVALID_TRACEID", ({ enumerable: true, get: function () { return spancontext_utils_1.INVALID_TRACEID; } })); +Object.defineProperty(exports, "INVALID_SPAN_CONTEXT", ({ enumerable: true, get: function () { return spancontext_utils_1.INVALID_SPAN_CONTEXT; } })); +Object.defineProperty(exports, "isSpanContextValid", ({ enumerable: true, get: function () { return spancontext_utils_1.isSpanContextValid; } })); +Object.defineProperty(exports, "isValidTraceId", ({ enumerable: true, get: function () { return spancontext_utils_1.isValidTraceId; } })); +Object.defineProperty(exports, "isValidSpanId", ({ enumerable: true, get: function () { return spancontext_utils_1.isValidSpanId; } })); +__exportStar(__nccwpck_require__(8242), exports); +__exportStar(__nccwpck_require__(4118), exports); +__exportStar(__nccwpck_require__(6504), exports); +var context_1 = __nccwpck_require__(7171); /** Entrypoint for context API */ exports.context = context_1.ContextAPI.getInstance(); var trace_1 = __nccwpck_require__(1539); /** Entrypoint for trace API */ exports.trace = trace_1.TraceAPI.getInstance(); -var metrics_1 = __nccwpck_require__(7696); -/** Entrypoint for metrics API */ -exports.metrics = metrics_1.MetricsAPI.getInstance(); var propagation_1 = __nccwpck_require__(9909); /** Entrypoint for propagation API */ exports.propagation = propagation_1.PropagationAPI.getInstance(); +var diag_1 = __nccwpck_require__(1877); +/** + * Entrypoint for Diag API. + * Defines Diagnostic handler used for internal diagnostic logging operations. + * The default provides a Noop DiagLogger implementation which may be changed via the + * diag.setLogger(logger: DiagLogger) function. + */ +exports.diag = diag_1.DiagAPI.instance(); exports.default = { trace: exports.trace, - metrics: exports.metrics, context: exports.context, propagation: exports.propagation, + diag: exports.diag, }; //# sourceMappingURL=index.js.map /***/ }), -/***/ 2500: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=BatchObserverResult.js.map - -/***/ }), - -/***/ 4931: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=BoundInstrument.js.map - -/***/ }), - -/***/ 2111: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=Meter.js.map - -/***/ }), - -/***/ 7507: -/***/ ((__unused_webpack_module, exports) => { +/***/ 5135: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -45284,12 +46135,58 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=MeterProvider.js.map +exports.unregisterGlobal = exports.getGlobal = exports.registerGlobal = void 0; +var __1 = __nccwpck_require__(5163); +var platform_1 = __nccwpck_require__(9957); +var version_1 = __nccwpck_require__(8996); +var semver_1 = __nccwpck_require__(1522); +var major = version_1.VERSION.split('.')[0]; +var GLOBAL_OPENTELEMETRY_API_KEY = Symbol.for("io.opentelemetry.js.api." + major); +var _global = platform_1._globalThis; +function registerGlobal(type, instance, allowOverride) { + var _a; + if (allowOverride === void 0) { allowOverride = false; } + _global[GLOBAL_OPENTELEMETRY_API_KEY] = (_a = _global[GLOBAL_OPENTELEMETRY_API_KEY]) !== null && _a !== void 0 ? _a : { + version: version_1.VERSION, + }; + var api = _global[GLOBAL_OPENTELEMETRY_API_KEY]; + if (!allowOverride && api[type]) { + // already registered an API of this type + var err = new Error("@opentelemetry/api: Attempted duplicate registration of API: " + type); + __1.diag.error(err.stack || err.message); + return; + } + if (api.version !== version_1.VERSION) { + // All registered APIs must be of the same version exactly + var err = new Error('@opentelemetry/api: All API registration versions must match'); + __1.diag.error(err.stack || err.message); + return; + } + api[type] = instance; +} +exports.registerGlobal = registerGlobal; +function getGlobal(type) { + var _a, _b; + var globalVersion = (_a = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _a === void 0 ? void 0 : _a.version; + if (!globalVersion || !semver_1.isCompatible(globalVersion)) { + return; + } + return (_b = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _b === void 0 ? void 0 : _b[type]; +} +exports.getGlobal = getGlobal; +function unregisterGlobal(type) { + var api = _global[GLOBAL_OPENTELEMETRY_API_KEY]; + if (api) { + delete api[type]; + } +} +exports.unregisterGlobal = unregisterGlobal; +//# sourceMappingURL=global-utils.js.map /***/ }), -/***/ 9999: -/***/ ((__unused_webpack_module, exports) => { +/***/ 1522: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -45309,267 +46206,104 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ValueType = void 0; -/** The Type of value. It describes how the data is reported. */ -var ValueType; -(function (ValueType) { - ValueType[ValueType["INT"] = 0] = "INT"; - ValueType[ValueType["DOUBLE"] = 1] = "DOUBLE"; -})(ValueType = exports.ValueType || (exports.ValueType = {})); -//# sourceMappingURL=Metric.js.map - -/***/ }), - -/***/ 4837: -/***/ (function(__unused_webpack_module, exports) { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +exports.isCompatible = exports._makeCompatibilityCheck = void 0; +var version_1 = __nccwpck_require__(8996); +var re = /^(\d+)\.(\d+)\.(\d+)(?:-(.*))?$/; +/** + * Create a function to test an API version to see if it is compatible with the provided ownVersion. * - * https://www.apache.org/licenses/LICENSE-2.0 + * The returned function has the following semantics: + * - Exact match is always compatible + * - Major versions must match exactly + * - 1.x package cannot use global 2.x package + * - 2.x package cannot use global 1.x package + * - The minor version of the API module requesting access to the global API must be less than or equal to the minor version of this API + * - 1.3 package may use 1.4 global because the later global contains all functions 1.3 expects + * - 1.4 package may NOT use 1.3 global because it may try to call functions which don't exist on 1.3 + * - If the major version is 0, the minor version is treated as the major and the patch is treated as the minor + * - Patch and build tag differences are not considered at this time * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NOOP_BATCH_OBSERVER_METRIC = exports.NOOP_SUM_OBSERVER_METRIC = exports.NOOP_UP_DOWN_SUM_OBSERVER_METRIC = exports.NOOP_VALUE_OBSERVER_METRIC = exports.NOOP_BOUND_BASE_OBSERVER = exports.NOOP_VALUE_RECORDER_METRIC = exports.NOOP_BOUND_VALUE_RECORDER = exports.NOOP_COUNTER_METRIC = exports.NOOP_BOUND_COUNTER = exports.NOOP_METER = exports.NoopBoundBaseObserver = exports.NoopBoundValueRecorder = exports.NoopBoundCounter = exports.NoopBatchObserverMetric = exports.NoopBaseObserverMetric = exports.NoopValueRecorderMetric = exports.NoopCounterMetric = exports.NoopMetric = exports.NoopMeter = void 0; -/** - * NoopMeter is a noop implementation of the {@link Meter} interface. It reuses - * constant NoopMetrics for all of its methods. + * @param ownVersion version which should be checked against */ -var NoopMeter = /** @class */ (function () { - function NoopMeter() { - } - /** - * Returns constant noop value recorder. - * @param name the name of the metric. - * @param [options] the metric options. - */ - NoopMeter.prototype.createValueRecorder = function (name, options) { - return exports.NOOP_VALUE_RECORDER_METRIC; - }; - /** - * Returns a constant noop counter. - * @param name the name of the metric. - * @param [options] the metric options. - */ - NoopMeter.prototype.createCounter = function (name, options) { - return exports.NOOP_COUNTER_METRIC; - }; - /** - * Returns a constant noop UpDownCounter. - * @param name the name of the metric. - * @param [options] the metric options. - */ - NoopMeter.prototype.createUpDownCounter = function (name, options) { - return exports.NOOP_COUNTER_METRIC; - }; - /** - * Returns constant noop value observer. - * @param name the name of the metric. - * @param [options] the metric options. - * @param [callback] the value observer callback - */ - NoopMeter.prototype.createValueObserver = function (name, options, callback) { - return exports.NOOP_VALUE_OBSERVER_METRIC; - }; - /** - * Returns constant noop batch observer. - * @param name the name of the metric. - * @param callback the batch observer callback - */ - NoopMeter.prototype.createBatchObserver = function (name, callback) { - return exports.NOOP_BATCH_OBSERVER_METRIC; - }; - return NoopMeter; -}()); -exports.NoopMeter = NoopMeter; -var NoopMetric = /** @class */ (function () { - function NoopMetric(instrument) { - this._instrument = instrument; +function _makeCompatibilityCheck(ownVersion) { + var acceptedVersions = new Set([ownVersion]); + var rejectedVersions = new Set(); + var myVersionMatch = ownVersion.match(re); + if (!myVersionMatch) { + // we cannot guarantee compatibility so we always return noop + return function () { return false; }; } - /** - * Returns a Bound Instrument associated with specified Labels. - * It is recommended to keep a reference to the Bound Instrument instead of - * always calling this method for every operations. - * @param labels key-values pairs that are associated with a specific metric - * that you want to record. - */ - NoopMetric.prototype.bind = function (labels) { - return this._instrument; - }; - /** - * Removes the Binding from the metric, if it is present. - * @param labels key-values pairs that are associated with a specific metric. - */ - NoopMetric.prototype.unbind = function (labels) { - return; - }; - /** - * Clears all timeseries from the Metric. - */ - NoopMetric.prototype.clear = function () { - return; + var ownVersionParsed = { + major: +myVersionMatch[1], + minor: +myVersionMatch[2], + patch: +myVersionMatch[3], }; - return NoopMetric; -}()); -exports.NoopMetric = NoopMetric; -var NoopCounterMetric = /** @class */ (function (_super) { - __extends(NoopCounterMetric, _super); - function NoopCounterMetric() { - return _super !== null && _super.apply(this, arguments) || this; + function _reject(v) { + rejectedVersions.add(v); + return false; } - NoopCounterMetric.prototype.add = function (value, labels) { - this.bind(labels).add(value); - }; - return NoopCounterMetric; -}(NoopMetric)); -exports.NoopCounterMetric = NoopCounterMetric; -var NoopValueRecorderMetric = /** @class */ (function (_super) { - __extends(NoopValueRecorderMetric, _super); - function NoopValueRecorderMetric() { - return _super !== null && _super.apply(this, arguments) || this; + function _accept(v) { + acceptedVersions.add(v); + return true; } - NoopValueRecorderMetric.prototype.record = function (value, labels, correlationContext, spanContext) { - if (typeof correlationContext === 'undefined') { - this.bind(labels).record(value); + return function isCompatible(globalVersion) { + if (acceptedVersions.has(globalVersion)) { + return true; } - else if (typeof spanContext === 'undefined') { - this.bind(labels).record(value, correlationContext); + if (rejectedVersions.has(globalVersion)) { + return false; } - else { - this.bind(labels).record(value, correlationContext, spanContext); + var globalVersionMatch = globalVersion.match(re); + if (!globalVersionMatch) { + // cannot parse other version + // we cannot guarantee compatibility so we always noop + return _reject(globalVersion); } - }; - return NoopValueRecorderMetric; -}(NoopMetric)); -exports.NoopValueRecorderMetric = NoopValueRecorderMetric; -var NoopBaseObserverMetric = /** @class */ (function (_super) { - __extends(NoopBaseObserverMetric, _super); - function NoopBaseObserverMetric() { - return _super !== null && _super.apply(this, arguments) || this; - } - NoopBaseObserverMetric.prototype.observation = function () { - return { - observer: this, - value: 0, + var globalVersionParsed = { + major: +globalVersionMatch[1], + minor: +globalVersionMatch[2], + patch: +globalVersionMatch[3], }; + // major versions must match + if (ownVersionParsed.major !== globalVersionParsed.major) { + return _reject(globalVersion); + } + if (ownVersionParsed.major === 0) { + if (ownVersionParsed.minor === globalVersionParsed.minor && + ownVersionParsed.patch <= globalVersionParsed.patch) { + return _accept(globalVersion); + } + return _reject(globalVersion); + } + if (ownVersionParsed.minor <= globalVersionParsed.minor) { + return _accept(globalVersion); + } + return _reject(globalVersion); }; - return NoopBaseObserverMetric; -}(NoopMetric)); -exports.NoopBaseObserverMetric = NoopBaseObserverMetric; -var NoopBatchObserverMetric = /** @class */ (function (_super) { - __extends(NoopBatchObserverMetric, _super); - function NoopBatchObserverMetric() { - return _super !== null && _super.apply(this, arguments) || this; - } - return NoopBatchObserverMetric; -}(NoopMetric)); -exports.NoopBatchObserverMetric = NoopBatchObserverMetric; -var NoopBoundCounter = /** @class */ (function () { - function NoopBoundCounter() { - } - NoopBoundCounter.prototype.add = function (value) { - return; - }; - return NoopBoundCounter; -}()); -exports.NoopBoundCounter = NoopBoundCounter; -var NoopBoundValueRecorder = /** @class */ (function () { - function NoopBoundValueRecorder() { - } - NoopBoundValueRecorder.prototype.record = function (value, correlationContext, spanContext) { - return; - }; - return NoopBoundValueRecorder; -}()); -exports.NoopBoundValueRecorder = NoopBoundValueRecorder; -var NoopBoundBaseObserver = /** @class */ (function () { - function NoopBoundBaseObserver() { - } - NoopBoundBaseObserver.prototype.update = function (value) { }; - return NoopBoundBaseObserver; -}()); -exports.NoopBoundBaseObserver = NoopBoundBaseObserver; -exports.NOOP_METER = new NoopMeter(); -exports.NOOP_BOUND_COUNTER = new NoopBoundCounter(); -exports.NOOP_COUNTER_METRIC = new NoopCounterMetric(exports.NOOP_BOUND_COUNTER); -exports.NOOP_BOUND_VALUE_RECORDER = new NoopBoundValueRecorder(); -exports.NOOP_VALUE_RECORDER_METRIC = new NoopValueRecorderMetric(exports.NOOP_BOUND_VALUE_RECORDER); -exports.NOOP_BOUND_BASE_OBSERVER = new NoopBoundBaseObserver(); -exports.NOOP_VALUE_OBSERVER_METRIC = new NoopBaseObserverMetric(exports.NOOP_BOUND_BASE_OBSERVER); -exports.NOOP_UP_DOWN_SUM_OBSERVER_METRIC = new NoopBaseObserverMetric(exports.NOOP_BOUND_BASE_OBSERVER); -exports.NOOP_SUM_OBSERVER_METRIC = new NoopBaseObserverMetric(exports.NOOP_BOUND_BASE_OBSERVER); -exports.NOOP_BATCH_OBSERVER_METRIC = new NoopBatchObserverMetric(); -//# sourceMappingURL=NoopMeter.js.map - -/***/ }), - -/***/ 2647: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +} +exports._makeCompatibilityCheck = _makeCompatibilityCheck; +/** + * Test an API version to see if it is compatible with this API. * - * https://www.apache.org/licenses/LICENSE-2.0 + * - Exact match is always compatible + * - Major versions must match exactly + * - 1.x package cannot use global 2.x package + * - 2.x package cannot use global 1.x package + * - The minor version of the API module requesting access to the global API must be less than or equal to the minor version of this API + * - 1.3 package may use 1.4 global because the later global contains all functions 1.3 expects + * - 1.4 package may NOT use 1.3 global because it may try to call functions which don't exist on 1.3 + * - If the major version is 0, the minor version is treated as the major and the patch is treated as the minor + * - Patch and build tag differences are not considered at this time * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NOOP_METER_PROVIDER = exports.NoopMeterProvider = void 0; -var NoopMeter_1 = __nccwpck_require__(4837); -/** - * An implementation of the {@link MeterProvider} which returns an impotent Meter - * for all calls to `getMeter` + * @param version version of the API requesting an instance of the global API */ -var NoopMeterProvider = /** @class */ (function () { - function NoopMeterProvider() { - } - NoopMeterProvider.prototype.getMeter = function (_name, _version) { - return NoopMeter_1.NOOP_METER; - }; - return NoopMeterProvider; -}()); -exports.NoopMeterProvider = NoopMeterProvider; -exports.NOOP_METER_PROVIDER = new NoopMeterProvider(); -//# sourceMappingURL=NoopMeterProvider.js.map +exports.isCompatible = _makeCompatibilityCheck(version_1.VERSION); +//# sourceMappingURL=semver.js.map /***/ }), -/***/ 817: -/***/ ((__unused_webpack_module, exports) => { +/***/ 9957: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -45588,12 +46322,23 @@ exports.NOOP_METER_PROVIDER = new NoopMeterProvider(); * See the License for the specific language governing permissions and * limitations under the License. */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=Observation.js.map +__exportStar(__nccwpck_require__(7200), exports); +//# sourceMappingURL=index.js.map /***/ }), -/***/ 3347: +/***/ 9406: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -45614,11 +46359,15 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=ObserverResult.js.map +exports._globalThis = void 0; +/** only globals that common to node and browsers are allowed */ +// eslint-disable-next-line node/no-unsupported-features/es-builtins +exports._globalThis = typeof globalThis === 'object' ? globalThis : global; +//# sourceMappingURL=globalThis.js.map /***/ }), -/***/ 9957: +/***/ 7200: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -45646,15 +46395,15 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi o[k2] = m[k]; })); var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); }; Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__nccwpck_require__(7200), exports); +__exportStar(__nccwpck_require__(9406), exports); //# sourceMappingURL=index.js.map /***/ }), -/***/ 9406: +/***/ 2368: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -45675,16 +46424,32 @@ __exportStar(__nccwpck_require__(7200), exports); * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports._globalThis = void 0; -/** only globals that common to node and browsers are allowed */ -// eslint-disable-next-line node/no-unsupported-features/es-builtins -exports._globalThis = typeof globalThis === 'object' ? globalThis : global; -//# sourceMappingURL=globalThis.js.map +exports.NOOP_TEXT_MAP_PROPAGATOR = exports.NoopTextMapPropagator = void 0; +/** + * No-op implementations of {@link TextMapPropagator}. + */ +var NoopTextMapPropagator = /** @class */ (function () { + function NoopTextMapPropagator() { + } + /** Noop inject function does nothing */ + NoopTextMapPropagator.prototype.inject = function (_context, _carrier) { }; + /** Noop extract function does nothing and returns the input context */ + NoopTextMapPropagator.prototype.extract = function (context, _carrier) { + return context; + }; + NoopTextMapPropagator.prototype.fields = function () { + return []; + }; + return NoopTextMapPropagator; +}()); +exports.NoopTextMapPropagator = NoopTextMapPropagator; +exports.NOOP_TEXT_MAP_PROPAGATOR = new NoopTextMapPropagator(); +//# sourceMappingURL=NoopTextMapPropagator.js.map /***/ }), -/***/ 7200: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 865: +/***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -45703,19 +46468,31 @@ exports._globalThis = typeof globalThis === 'object' ? globalThis : global; * See the License for the specific language governing permissions and * limitations under the License. */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -}; Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__nccwpck_require__(9406), exports); -//# sourceMappingURL=index.js.map +exports.defaultTextMapSetter = exports.defaultTextMapGetter = void 0; +exports.defaultTextMapGetter = { + get: function (carrier, key) { + if (carrier == null) { + return undefined; + } + return carrier[key]; + }, + keys: function (carrier) { + if (carrier == null) { + return []; + } + return Object.keys(carrier); + }, +}; +exports.defaultTextMapSetter = { + set: function (carrier, key, value) { + if (carrier == null) { + return; + } + carrier[key] = value; + }, +}; +//# sourceMappingURL=TextMapPropagator.js.map /***/ }), @@ -45765,15 +46542,8 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NOOP_SPAN = exports.NoopSpan = exports.INVALID_SPAN_ID = exports.INVALID_TRACE_ID = void 0; -var trace_flags_1 = __nccwpck_require__(6905); -exports.INVALID_TRACE_ID = '0'; -exports.INVALID_SPAN_ID = '0'; -var INVALID_SPAN_CONTEXT = { - traceId: exports.INVALID_TRACE_ID, - spanId: exports.INVALID_SPAN_ID, - traceFlags: trace_flags_1.TraceFlags.NONE, -}; +exports.NoopSpan = void 0; +var spancontext_utils_1 = __nccwpck_require__(9745); /** * The NoopSpan is the default {@link Span} that is used when no Span * implementation is available. All operations are no-op including context @@ -45781,7 +46551,7 @@ var INVALID_SPAN_CONTEXT = { */ var NoopSpan = /** @class */ (function () { function NoopSpan(_spanContext) { - if (_spanContext === void 0) { _spanContext = INVALID_SPAN_CONTEXT; } + if (_spanContext === void 0) { _spanContext = spancontext_utils_1.INVALID_SPAN_CONTEXT; } this._spanContext = _spanContext; } // Returns a SpanContext. @@ -45789,35 +46559,36 @@ var NoopSpan = /** @class */ (function () { return this._spanContext; }; // By default does nothing - NoopSpan.prototype.setAttribute = function (key, value) { + NoopSpan.prototype.setAttribute = function (_key, _value) { return this; }; // By default does nothing - NoopSpan.prototype.setAttributes = function (attributes) { + NoopSpan.prototype.setAttributes = function (_attributes) { return this; }; // By default does nothing - NoopSpan.prototype.addEvent = function (name, attributes) { + NoopSpan.prototype.addEvent = function (_name, _attributes) { return this; }; // By default does nothing - NoopSpan.prototype.setStatus = function (status) { + NoopSpan.prototype.setStatus = function (_status) { return this; }; // By default does nothing - NoopSpan.prototype.updateName = function (name) { + NoopSpan.prototype.updateName = function (_name) { return this; }; // By default does nothing - NoopSpan.prototype.end = function (endTime) { }; + NoopSpan.prototype.end = function (_endTime) { }; // isRecording always returns false for noopSpan. NoopSpan.prototype.isRecording = function () { return false; }; + // By default does nothing + NoopSpan.prototype.recordException = function (_exception, _time) { }; return NoopSpan; }()); exports.NoopSpan = NoopSpan; -exports.NOOP_SPAN = new NoopSpan(); //# sourceMappingURL=NoopSpan.js.map /***/ }), @@ -45844,29 +46615,39 @@ exports.NOOP_SPAN = new NoopSpan(); */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.NOOP_TRACER = exports.NoopTracer = void 0; +var context_1 = __nccwpck_require__(8242); var NoopSpan_1 = __nccwpck_require__(1169); +var spancontext_utils_1 = __nccwpck_require__(9745); /** * No-op implementations of {@link Tracer}. */ var NoopTracer = /** @class */ (function () { function NoopTracer() { } - NoopTracer.prototype.getCurrentSpan = function () { - return NoopSpan_1.NOOP_SPAN; - }; // startSpan starts a noop span. - NoopTracer.prototype.startSpan = function (name, options) { - return NoopSpan_1.NOOP_SPAN; - }; - NoopTracer.prototype.withSpan = function (span, fn) { - return fn(); - }; - NoopTracer.prototype.bind = function (target, span) { - return target; + NoopTracer.prototype.startSpan = function (name, options, context) { + var root = Boolean(options === null || options === void 0 ? void 0 : options.root); + if (root) { + return new NoopSpan_1.NoopSpan(); + } + var parentFromContext = context && context_1.getSpanContext(context); + if (isSpanContext(parentFromContext) && + spancontext_utils_1.isSpanContextValid(parentFromContext)) { + return new NoopSpan_1.NoopSpan(parentFromContext); + } + else { + return new NoopSpan_1.NoopSpan(); + } }; return NoopTracer; }()); exports.NoopTracer = NoopTracer; +function isSpanContext(spanContext) { + return (typeof spanContext === 'object' && + typeof spanContext['spanId'] === 'string' && + typeof spanContext['traceId'] === 'string' && + typeof spanContext['traceFlags'] === 'number'); +} exports.NOOP_TRACER = new NoopTracer(); //# sourceMappingURL=NoopTracer.js.map @@ -45915,6 +46696,126 @@ exports.NOOP_TRACER_PROVIDER = new NoopTracerProvider(); /***/ }), +/***/ 3503: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ProxyTracer = void 0; +var NoopTracer_1 = __nccwpck_require__(7606); +/** + * Proxy tracer provided by the proxy tracer provider + */ +var ProxyTracer = /** @class */ (function () { + function ProxyTracer(_provider, name, version) { + this._provider = _provider; + this.name = name; + this.version = version; + } + ProxyTracer.prototype.startSpan = function (name, options, context) { + return this._getTracer().startSpan(name, options, context); + }; + /** + * Try to get a tracer from the proxy tracer provider. + * If the proxy tracer provider has no delegate, return a noop tracer. + */ + ProxyTracer.prototype._getTracer = function () { + if (this._delegate) { + return this._delegate; + } + var tracer = this._provider.getDelegateTracer(this.name, this.version); + if (!tracer) { + return NoopTracer_1.NOOP_TRACER; + } + this._delegate = tracer; + return this._delegate; + }; + return ProxyTracer; +}()); +exports.ProxyTracer = ProxyTracer; +//# sourceMappingURL=ProxyTracer.js.map + +/***/ }), + +/***/ 2285: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ProxyTracerProvider = void 0; +var ProxyTracer_1 = __nccwpck_require__(3503); +var NoopTracerProvider_1 = __nccwpck_require__(3259); +/** + * Tracer provider which provides {@link ProxyTracer}s. + * + * Before a delegate is set, tracers provided are NoOp. + * When a delegate is set, traces are provided from the delegate. + * When a delegate is set after tracers have already been provided, + * all tracers already provided will use the provided delegate implementation. + */ +var ProxyTracerProvider = /** @class */ (function () { + function ProxyTracerProvider() { + } + /** + * Get a {@link ProxyTracer} + */ + ProxyTracerProvider.prototype.getTracer = function (name, version) { + var _a; + return ((_a = this.getDelegateTracer(name, version)) !== null && _a !== void 0 ? _a : new ProxyTracer_1.ProxyTracer(this, name, version)); + }; + ProxyTracerProvider.prototype.getDelegate = function () { + var _a; + return (_a = this._delegate) !== null && _a !== void 0 ? _a : NoopTracerProvider_1.NOOP_TRACER_PROVIDER; + }; + /** + * Set the delegate tracer provider + */ + ProxyTracerProvider.prototype.setDelegate = function (delegate) { + this._delegate = delegate; + }; + ProxyTracerProvider.prototype.getDelegateTracer = function (name, version) { + var _a; + return (_a = this._delegate) === null || _a === void 0 ? void 0 : _a.getTracer(name, version); + }; + return ProxyTracerProvider; +}()); +exports.ProxyTracerProvider = ProxyTracerProvider; +//# sourceMappingURL=ProxyTracerProvider.js.map + +/***/ }), + /***/ 9671: /***/ ((__unused_webpack_module, exports) => { @@ -46043,16 +46944,6 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=attributes.js.map - -/***/ }), - -/***/ 6169: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - /* * Copyright The OpenTelemetry Authors * @@ -46069,7 +46960,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=Plugin.js.map +//# sourceMappingURL=attributes.js.map /***/ }), @@ -46226,150 +47117,69 @@ var SpanKind; /***/ }), +/***/ 9745: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isSpanContextValid = exports.isValidSpanId = exports.isValidTraceId = exports.INVALID_SPAN_CONTEXT = exports.INVALID_TRACEID = exports.INVALID_SPANID = void 0; +var trace_flags_1 = __nccwpck_require__(6905); +var VALID_TRACEID_REGEX = /^([0-9a-f]{32})$/i; +var VALID_SPANID_REGEX = /^[0-9a-f]{16}$/i; +exports.INVALID_SPANID = '0000000000000000'; +exports.INVALID_TRACEID = '00000000000000000000000000000000'; +exports.INVALID_SPAN_CONTEXT = { + traceId: exports.INVALID_TRACEID, + spanId: exports.INVALID_SPANID, + traceFlags: trace_flags_1.TraceFlags.NONE, +}; +function isValidTraceId(traceId) { + return VALID_TRACEID_REGEX.test(traceId) && traceId !== exports.INVALID_TRACEID; +} +exports.isValidTraceId = isValidTraceId; +function isValidSpanId(spanId) { + return VALID_SPANID_REGEX.test(spanId) && spanId !== exports.INVALID_SPANID; +} +exports.isValidSpanId = isValidSpanId; +/** + * Returns true if this {@link SpanContext} is valid. + * @return true if this {@link SpanContext} is valid. + */ +function isSpanContextValid(spanContext) { + return (isValidTraceId(spanContext.traceId) && isValidSpanId(spanContext.spanId)); +} +exports.isSpanContextValid = isSpanContextValid; +//# sourceMappingURL=spancontext-utils.js.map + +/***/ }), + /***/ 8845: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.CanonicalCode = void 0; +exports.SpanStatusCode = void 0; /** - * An enumeration of canonical status codes. + * An enumeration of status codes. */ -var CanonicalCode; -(function (CanonicalCode) { - /** - * Not an error; returned on success - */ - CanonicalCode[CanonicalCode["OK"] = 0] = "OK"; - /** - * The operation was cancelled (typically by the caller). - */ - CanonicalCode[CanonicalCode["CANCELLED"] = 1] = "CANCELLED"; - /** - * Unknown error. An example of where this error may be returned is - * if a status value received from another address space belongs to - * an error-space that is not known in this address space. Also - * errors raised by APIs that do not return enough error information - * may be converted to this error. - */ - CanonicalCode[CanonicalCode["UNKNOWN"] = 2] = "UNKNOWN"; - /** - * Client specified an invalid argument. Note that this differs - * from FAILED_PRECONDITION. INVALID_ARGUMENT indicates arguments - * that are problematic regardless of the state of the system - * (e.g., a malformed file name). - */ - CanonicalCode[CanonicalCode["INVALID_ARGUMENT"] = 3] = "INVALID_ARGUMENT"; - /** - * Deadline expired before operation could complete. For operations - * that change the state of the system, this error may be returned - * even if the operation has completed successfully. For example, a - * successful response from a server could have been delayed long - * enough for the deadline to expire. - */ - CanonicalCode[CanonicalCode["DEADLINE_EXCEEDED"] = 4] = "DEADLINE_EXCEEDED"; - /** - * Some requested entity (e.g., file or directory) was not found. - */ - CanonicalCode[CanonicalCode["NOT_FOUND"] = 5] = "NOT_FOUND"; - /** - * Some entity that we attempted to create (e.g., file or directory) - * already exists. - */ - CanonicalCode[CanonicalCode["ALREADY_EXISTS"] = 6] = "ALREADY_EXISTS"; - /** - * The caller does not have permission to execute the specified - * operation. PERMISSION_DENIED must not be used for rejections - * caused by exhausting some resource (use RESOURCE_EXHAUSTED - * instead for those errors). PERMISSION_DENIED must not be - * used if the caller can not be identified (use UNAUTHENTICATED - * instead for those errors). - */ - CanonicalCode[CanonicalCode["PERMISSION_DENIED"] = 7] = "PERMISSION_DENIED"; - /** - * Some resource has been exhausted, perhaps a per-user quota, or - * perhaps the entire file system is out of space. - */ - CanonicalCode[CanonicalCode["RESOURCE_EXHAUSTED"] = 8] = "RESOURCE_EXHAUSTED"; - /** - * Operation was rejected because the system is not in a state - * required for the operation's execution. For example, directory - * to be deleted may be non-empty, an rmdir operation is applied to - * a non-directory, etc. - * - * A litmus test that may help a service implementor in deciding - * between FAILED_PRECONDITION, ABORTED, and UNAVAILABLE: - * - * - Use UNAVAILABLE if the client can retry just the failing call. - * - Use ABORTED if the client should retry at a higher-level - * (e.g., restarting a read-modify-write sequence). - * - Use FAILED_PRECONDITION if the client should not retry until - * the system state has been explicitly fixed. E.g., if an "rmdir" - * fails because the directory is non-empty, FAILED_PRECONDITION - * should be returned since the client should not retry unless - * they have first fixed up the directory by deleting files from it. - * - Use FAILED_PRECONDITION if the client performs conditional - * REST Get/Update/Delete on a resource and the resource on the - * server does not match the condition. E.g., conflicting - * read-modify-write on the same resource. - */ - CanonicalCode[CanonicalCode["FAILED_PRECONDITION"] = 9] = "FAILED_PRECONDITION"; - /** - * The operation was aborted, typically due to a concurrency issue - * like sequencer check failures, transaction aborts, etc. - * - * See litmus test above for deciding between FAILED_PRECONDITION, - * ABORTED, and UNAVAILABLE. - */ - CanonicalCode[CanonicalCode["ABORTED"] = 10] = "ABORTED"; - /** - * Operation was attempted past the valid range. E.g., seeking or - * reading past end of file. - * - * Unlike INVALID_ARGUMENT, this error indicates a problem that may - * be fixed if the system state changes. For example, a 32-bit file - * system will generate INVALID_ARGUMENT if asked to read at an - * offset that is not in the range [0,2^32-1], but it will generate - * OUT_OF_RANGE if asked to read from an offset past the current - * file size. - * - * There is a fair bit of overlap between FAILED_PRECONDITION and - * OUT_OF_RANGE. We recommend using OUT_OF_RANGE (the more specific - * error) when it applies so that callers who are iterating through - * a space can easily look for an OUT_OF_RANGE error to detect when - * they are done. - */ - CanonicalCode[CanonicalCode["OUT_OF_RANGE"] = 11] = "OUT_OF_RANGE"; - /** - * Operation is not implemented or not supported/enabled in this service. - */ - CanonicalCode[CanonicalCode["UNIMPLEMENTED"] = 12] = "UNIMPLEMENTED"; - /** - * Internal errors. Means some invariants expected by underlying - * system has been broken. If you see one of these errors, - * something is very broken. - */ - CanonicalCode[CanonicalCode["INTERNAL"] = 13] = "INTERNAL"; +var SpanStatusCode; +(function (SpanStatusCode) { /** - * The service is currently unavailable. This is a most likely a - * transient condition and may be corrected by retrying with - * a backoff. - * - * See litmus test above for deciding between FAILED_PRECONDITION, - * ABORTED, and UNAVAILABLE. + * The default status. */ - CanonicalCode[CanonicalCode["UNAVAILABLE"] = 14] = "UNAVAILABLE"; + SpanStatusCode[SpanStatusCode["UNSET"] = 0] = "UNSET"; /** - * Unrecoverable data loss or corruption. + * The operation has been validated by an Application developer or + * Operator to have completed successfully. */ - CanonicalCode[CanonicalCode["DATA_LOSS"] = 15] = "DATA_LOSS"; + SpanStatusCode[SpanStatusCode["OK"] = 1] = "OK"; /** - * The request does not have valid authentication credentials for the - * operation. + * The operation contains an error. */ - CanonicalCode[CanonicalCode["UNAUTHENTICATED"] = 16] = "UNAUTHENTICATED"; -})(CanonicalCode = exports.CanonicalCode || (exports.CanonicalCode = {})); + SpanStatusCode[SpanStatusCode["ERROR"] = 2] = "ERROR"; +})(SpanStatusCode = exports.SpanStatusCode || (exports.SpanStatusCode = {})); //# sourceMappingURL=status.js.map /***/ }), @@ -46412,16 +47222,6 @@ var TraceFlags; "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=trace_state.js.map - -/***/ }), - -/***/ 3168: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - /* * Copyright The OpenTelemetry Authors * @@ -46438,11 +47238,11 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=tracer.js.map +//# sourceMappingURL=trace_state.js.map /***/ }), -/***/ 891: +/***/ 3168: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -46463,65 +47263,15 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=tracer_provider.js.map - -/***/ }), - -/***/ 2331: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NoopContextManager = void 0; -var context_1 = __nccwpck_require__(2678); -var NoopContextManager = /** @class */ (function () { - function NoopContextManager() { - } - NoopContextManager.prototype.active = function () { - return context_1.Context.ROOT_CONTEXT; - }; - NoopContextManager.prototype.with = function (context, fn) { - return fn(); - }; - NoopContextManager.prototype.bind = function (target, context) { - return target; - }; - NoopContextManager.prototype.enable = function () { - return this; - }; - NoopContextManager.prototype.disable = function () { - return this; - }; - return NoopContextManager; -}()); -exports.NoopContextManager = NoopContextManager; -//# sourceMappingURL=NoopContextManager.js.map +//# sourceMappingURL=tracer.js.map /***/ }), -/***/ 2678: +/***/ 891: /***/ ((__unused_webpack_module, exports) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Context = void 0; /* * Copyright The OpenTelemetry Authors * @@ -46537,105 +47287,12 @@ exports.Context = void 0; * See the License for the specific language governing permissions and * limitations under the License. */ -var Context = /** @class */ (function () { - /** - * Construct a new context which inherits values from an optional parent context. - * - * @param parentContext a context from which to inherit values - */ - function Context(parentContext) { - this._currentContext = parentContext ? new Map(parentContext) : new Map(); - } - /** Get a key to uniquely identify a context value */ - Context.createKey = function (description) { - return Symbol(description); - }; - /** - * Get a value from the context. - * - * @param key key which identifies a context value - */ - Context.prototype.getValue = function (key) { - return this._currentContext.get(key); - }; - /** - * Create a new context which inherits from this context and has - * the given key set to the given value. - * - * @param key context key for which to set the value - * @param value value to set for the given key - */ - Context.prototype.setValue = function (key, value) { - var context = new Context(this._currentContext); - context._currentContext.set(key, value); - return context; - }; - /** - * Return a new context which inherits from this context but does - * not contain a value for the given key. - * - * @param key context key for which to clear a value - */ - Context.prototype.deleteValue = function (key) { - var context = new Context(this._currentContext); - context._currentContext.delete(key); - return context; - }; - /** The root context is used as the default parent context when there is no active context */ - Context.ROOT_CONTEXT = new Context(); - /** - * This is another identifier to the root context which allows developers to easily search the - * codebase for direct uses of context which need to be removed in later PRs. - * - * It's existence is temporary and it should be removed when all references are fixed. - */ - Context.TODO = Context.ROOT_CONTEXT; - return Context; -}()); -exports.Context = Context; -//# sourceMappingURL=context.js.map - -/***/ }), - -/***/ 5664: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -}; Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__nccwpck_require__(5683), exports); -__exportStar(__nccwpck_require__(2678), exports); -__exportStar(__nccwpck_require__(2331), exports); -//# sourceMappingURL=index.js.map +//# sourceMappingURL=tracer_provider.js.map /***/ }), -/***/ 5683: +/***/ 8996: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -46656,7 +47313,10 @@ __exportStar(__nccwpck_require__(2331), exports); * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=types.js.map +exports.VERSION = void 0; +// this is autogenerated file, see scripts/version-update.js +exports.VERSION = '1.0.0-rc.0'; +//# sourceMappingURL=version.js.map /***/ }), @@ -59524,7 +60184,7 @@ module.exports = eval("require")("encoding"); /***/ ((module) => { "use strict"; -module.exports = JSON.parse('{"application/1d-interleaved-parityfec":{"source":"iana"},"application/3gpdash-qoe-report+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/3gpp-ims+xml":{"source":"iana","compressible":true},"application/a2l":{"source":"iana"},"application/activemessage":{"source":"iana"},"application/activity+json":{"source":"iana","compressible":true},"application/alto-costmap+json":{"source":"iana","compressible":true},"application/alto-costmapfilter+json":{"source":"iana","compressible":true},"application/alto-directory+json":{"source":"iana","compressible":true},"application/alto-endpointcost+json":{"source":"iana","compressible":true},"application/alto-endpointcostparams+json":{"source":"iana","compressible":true},"application/alto-endpointprop+json":{"source":"iana","compressible":true},"application/alto-endpointpropparams+json":{"source":"iana","compressible":true},"application/alto-error+json":{"source":"iana","compressible":true},"application/alto-networkmap+json":{"source":"iana","compressible":true},"application/alto-networkmapfilter+json":{"source":"iana","compressible":true},"application/alto-updatestreamcontrol+json":{"source":"iana","compressible":true},"application/alto-updatestreamparams+json":{"source":"iana","compressible":true},"application/aml":{"source":"iana"},"application/andrew-inset":{"source":"iana","extensions":["ez"]},"application/applefile":{"source":"iana"},"application/applixware":{"source":"apache","extensions":["aw"]},"application/atf":{"source":"iana"},"application/atfx":{"source":"iana"},"application/atom+xml":{"source":"iana","compressible":true,"extensions":["atom"]},"application/atomcat+xml":{"source":"iana","compressible":true,"extensions":["atomcat"]},"application/atomdeleted+xml":{"source":"iana","compressible":true,"extensions":["atomdeleted"]},"application/atomicmail":{"source":"iana"},"application/atomsvc+xml":{"source":"iana","compressible":true,"extensions":["atomsvc"]},"application/atsc-dwd+xml":{"source":"iana","compressible":true,"extensions":["dwd"]},"application/atsc-dynamic-event-message":{"source":"iana"},"application/atsc-held+xml":{"source":"iana","compressible":true,"extensions":["held"]},"application/atsc-rdt+json":{"source":"iana","compressible":true},"application/atsc-rsat+xml":{"source":"iana","compressible":true,"extensions":["rsat"]},"application/atxml":{"source":"iana"},"application/auth-policy+xml":{"source":"iana","compressible":true},"application/bacnet-xdd+zip":{"source":"iana","compressible":false},"application/batch-smtp":{"source":"iana"},"application/bdoc":{"compressible":false,"extensions":["bdoc"]},"application/beep+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/calendar+json":{"source":"iana","compressible":true},"application/calendar+xml":{"source":"iana","compressible":true,"extensions":["xcs"]},"application/call-completion":{"source":"iana"},"application/cals-1840":{"source":"iana"},"application/captive+json":{"source":"iana","compressible":true},"application/cbor":{"source":"iana"},"application/cbor-seq":{"source":"iana"},"application/cccex":{"source":"iana"},"application/ccmp+xml":{"source":"iana","compressible":true},"application/ccxml+xml":{"source":"iana","compressible":true,"extensions":["ccxml"]},"application/cdfx+xml":{"source":"iana","compressible":true,"extensions":["cdfx"]},"application/cdmi-capability":{"source":"iana","extensions":["cdmia"]},"application/cdmi-container":{"source":"iana","extensions":["cdmic"]},"application/cdmi-domain":{"source":"iana","extensions":["cdmid"]},"application/cdmi-object":{"source":"iana","extensions":["cdmio"]},"application/cdmi-queue":{"source":"iana","extensions":["cdmiq"]},"application/cdni":{"source":"iana"},"application/cea":{"source":"iana"},"application/cea-2018+xml":{"source":"iana","compressible":true},"application/cellml+xml":{"source":"iana","compressible":true},"application/cfw":{"source":"iana"},"application/clr":{"source":"iana"},"application/clue+xml":{"source":"iana","compressible":true},"application/clue_info+xml":{"source":"iana","compressible":true},"application/cms":{"source":"iana"},"application/cnrp+xml":{"source":"iana","compressible":true},"application/coap-group+json":{"source":"iana","compressible":true},"application/coap-payload":{"source":"iana"},"application/commonground":{"source":"iana"},"application/conference-info+xml":{"source":"iana","compressible":true},"application/cose":{"source":"iana"},"application/cose-key":{"source":"iana"},"application/cose-key-set":{"source":"iana"},"application/cpl+xml":{"source":"iana","compressible":true},"application/csrattrs":{"source":"iana"},"application/csta+xml":{"source":"iana","compressible":true},"application/cstadata+xml":{"source":"iana","compressible":true},"application/csvm+json":{"source":"iana","compressible":true},"application/cu-seeme":{"source":"apache","extensions":["cu"]},"application/cwt":{"source":"iana"},"application/cybercash":{"source":"iana"},"application/dart":{"compressible":true},"application/dash+xml":{"source":"iana","compressible":true,"extensions":["mpd"]},"application/dashdelta":{"source":"iana"},"application/davmount+xml":{"source":"iana","compressible":true,"extensions":["davmount"]},"application/dca-rft":{"source":"iana"},"application/dcd":{"source":"iana"},"application/dec-dx":{"source":"iana"},"application/dialog-info+xml":{"source":"iana","compressible":true},"application/dicom":{"source":"iana"},"application/dicom+json":{"source":"iana","compressible":true},"application/dicom+xml":{"source":"iana","compressible":true},"application/dii":{"source":"iana"},"application/dit":{"source":"iana"},"application/dns":{"source":"iana"},"application/dns+json":{"source":"iana","compressible":true},"application/dns-message":{"source":"iana"},"application/docbook+xml":{"source":"apache","compressible":true,"extensions":["dbk"]},"application/dots+cbor":{"source":"iana"},"application/dskpp+xml":{"source":"iana","compressible":true},"application/dssc+der":{"source":"iana","extensions":["dssc"]},"application/dssc+xml":{"source":"iana","compressible":true,"extensions":["xdssc"]},"application/dvcs":{"source":"iana"},"application/ecmascript":{"source":"iana","compressible":true,"extensions":["es","ecma"]},"application/edi-consent":{"source":"iana"},"application/edi-x12":{"source":"iana","compressible":false},"application/edifact":{"source":"iana","compressible":false},"application/efi":{"source":"iana"},"application/elm+json":{"source":"iana","charset":"UTF-8","compressible":true},"application/elm+xml":{"source":"iana","compressible":true},"application/emergencycalldata.cap+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/emergencycalldata.comment+xml":{"source":"iana","compressible":true},"application/emergencycalldata.control+xml":{"source":"iana","compressible":true},"application/emergencycalldata.deviceinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.ecall.msd":{"source":"iana"},"application/emergencycalldata.providerinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.serviceinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.subscriberinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.veds+xml":{"source":"iana","compressible":true},"application/emma+xml":{"source":"iana","compressible":true,"extensions":["emma"]},"application/emotionml+xml":{"source":"iana","compressible":true,"extensions":["emotionml"]},"application/encaprtp":{"source":"iana"},"application/epp+xml":{"source":"iana","compressible":true},"application/epub+zip":{"source":"iana","compressible":false,"extensions":["epub"]},"application/eshop":{"source":"iana"},"application/exi":{"source":"iana","extensions":["exi"]},"application/expect-ct-report+json":{"source":"iana","compressible":true},"application/fastinfoset":{"source":"iana"},"application/fastsoap":{"source":"iana"},"application/fdt+xml":{"source":"iana","compressible":true,"extensions":["fdt"]},"application/fhir+json":{"source":"iana","charset":"UTF-8","compressible":true},"application/fhir+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/fido.trusted-apps+json":{"compressible":true},"application/fits":{"source":"iana"},"application/flexfec":{"source":"iana"},"application/font-sfnt":{"source":"iana"},"application/font-tdpfr":{"source":"iana","extensions":["pfr"]},"application/font-woff":{"source":"iana","compressible":false},"application/framework-attributes+xml":{"source":"iana","compressible":true},"application/geo+json":{"source":"iana","compressible":true,"extensions":["geojson"]},"application/geo+json-seq":{"source":"iana"},"application/geopackage+sqlite3":{"source":"iana"},"application/geoxacml+xml":{"source":"iana","compressible":true},"application/gltf-buffer":{"source":"iana"},"application/gml+xml":{"source":"iana","compressible":true,"extensions":["gml"]},"application/gpx+xml":{"source":"apache","compressible":true,"extensions":["gpx"]},"application/gxf":{"source":"apache","extensions":["gxf"]},"application/gzip":{"source":"iana","compressible":false,"extensions":["gz"]},"application/h224":{"source":"iana"},"application/held+xml":{"source":"iana","compressible":true},"application/hjson":{"extensions":["hjson"]},"application/http":{"source":"iana"},"application/hyperstudio":{"source":"iana","extensions":["stk"]},"application/ibe-key-request+xml":{"source":"iana","compressible":true},"application/ibe-pkg-reply+xml":{"source":"iana","compressible":true},"application/ibe-pp-data":{"source":"iana"},"application/iges":{"source":"iana"},"application/im-iscomposing+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/index":{"source":"iana"},"application/index.cmd":{"source":"iana"},"application/index.obj":{"source":"iana"},"application/index.response":{"source":"iana"},"application/index.vnd":{"source":"iana"},"application/inkml+xml":{"source":"iana","compressible":true,"extensions":["ink","inkml"]},"application/iotp":{"source":"iana"},"application/ipfix":{"source":"iana","extensions":["ipfix"]},"application/ipp":{"source":"iana"},"application/isup":{"source":"iana"},"application/its+xml":{"source":"iana","compressible":true,"extensions":["its"]},"application/java-archive":{"source":"apache","compressible":false,"extensions":["jar","war","ear"]},"application/java-serialized-object":{"source":"apache","compressible":false,"extensions":["ser"]},"application/java-vm":{"source":"apache","compressible":false,"extensions":["class"]},"application/javascript":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["js","mjs"]},"application/jf2feed+json":{"source":"iana","compressible":true},"application/jose":{"source":"iana"},"application/jose+json":{"source":"iana","compressible":true},"application/jrd+json":{"source":"iana","compressible":true},"application/jscalendar+json":{"source":"iana","compressible":true},"application/json":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["json","map"]},"application/json-patch+json":{"source":"iana","compressible":true},"application/json-seq":{"source":"iana"},"application/json5":{"extensions":["json5"]},"application/jsonml+json":{"source":"apache","compressible":true,"extensions":["jsonml"]},"application/jwk+json":{"source":"iana","compressible":true},"application/jwk-set+json":{"source":"iana","compressible":true},"application/jwt":{"source":"iana"},"application/kpml-request+xml":{"source":"iana","compressible":true},"application/kpml-response+xml":{"source":"iana","compressible":true},"application/ld+json":{"source":"iana","compressible":true,"extensions":["jsonld"]},"application/lgr+xml":{"source":"iana","compressible":true,"extensions":["lgr"]},"application/link-format":{"source":"iana"},"application/load-control+xml":{"source":"iana","compressible":true},"application/lost+xml":{"source":"iana","compressible":true,"extensions":["lostxml"]},"application/lostsync+xml":{"source":"iana","compressible":true},"application/lpf+zip":{"source":"iana","compressible":false},"application/lxf":{"source":"iana"},"application/mac-binhex40":{"source":"iana","extensions":["hqx"]},"application/mac-compactpro":{"source":"apache","extensions":["cpt"]},"application/macwriteii":{"source":"iana"},"application/mads+xml":{"source":"iana","compressible":true,"extensions":["mads"]},"application/manifest+json":{"charset":"UTF-8","compressible":true,"extensions":["webmanifest"]},"application/marc":{"source":"iana","extensions":["mrc"]},"application/marcxml+xml":{"source":"iana","compressible":true,"extensions":["mrcx"]},"application/mathematica":{"source":"iana","extensions":["ma","nb","mb"]},"application/mathml+xml":{"source":"iana","compressible":true,"extensions":["mathml"]},"application/mathml-content+xml":{"source":"iana","compressible":true},"application/mathml-presentation+xml":{"source":"iana","compressible":true},"application/mbms-associated-procedure-description+xml":{"source":"iana","compressible":true},"application/mbms-deregister+xml":{"source":"iana","compressible":true},"application/mbms-envelope+xml":{"source":"iana","compressible":true},"application/mbms-msk+xml":{"source":"iana","compressible":true},"application/mbms-msk-response+xml":{"source":"iana","compressible":true},"application/mbms-protection-description+xml":{"source":"iana","compressible":true},"application/mbms-reception-report+xml":{"source":"iana","compressible":true},"application/mbms-register+xml":{"source":"iana","compressible":true},"application/mbms-register-response+xml":{"source":"iana","compressible":true},"application/mbms-schedule+xml":{"source":"iana","compressible":true},"application/mbms-user-service-description+xml":{"source":"iana","compressible":true},"application/mbox":{"source":"iana","extensions":["mbox"]},"application/media-policy-dataset+xml":{"source":"iana","compressible":true},"application/media_control+xml":{"source":"iana","compressible":true},"application/mediaservercontrol+xml":{"source":"iana","compressible":true,"extensions":["mscml"]},"application/merge-patch+json":{"source":"iana","compressible":true},"application/metalink+xml":{"source":"apache","compressible":true,"extensions":["metalink"]},"application/metalink4+xml":{"source":"iana","compressible":true,"extensions":["meta4"]},"application/mets+xml":{"source":"iana","compressible":true,"extensions":["mets"]},"application/mf4":{"source":"iana"},"application/mikey":{"source":"iana"},"application/mipc":{"source":"iana"},"application/mmt-aei+xml":{"source":"iana","compressible":true,"extensions":["maei"]},"application/mmt-usd+xml":{"source":"iana","compressible":true,"extensions":["musd"]},"application/mods+xml":{"source":"iana","compressible":true,"extensions":["mods"]},"application/moss-keys":{"source":"iana"},"application/moss-signature":{"source":"iana"},"application/mosskey-data":{"source":"iana"},"application/mosskey-request":{"source":"iana"},"application/mp21":{"source":"iana","extensions":["m21","mp21"]},"application/mp4":{"source":"iana","extensions":["mp4s","m4p"]},"application/mpeg4-generic":{"source":"iana"},"application/mpeg4-iod":{"source":"iana"},"application/mpeg4-iod-xmt":{"source":"iana"},"application/mrb-consumer+xml":{"source":"iana","compressible":true},"application/mrb-publish+xml":{"source":"iana","compressible":true},"application/msc-ivr+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/msc-mixer+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/msword":{"source":"iana","compressible":false,"extensions":["doc","dot"]},"application/mud+json":{"source":"iana","compressible":true},"application/multipart-core":{"source":"iana"},"application/mxf":{"source":"iana","extensions":["mxf"]},"application/n-quads":{"source":"iana","extensions":["nq"]},"application/n-triples":{"source":"iana","extensions":["nt"]},"application/nasdata":{"source":"iana"},"application/news-checkgroups":{"source":"iana","charset":"US-ASCII"},"application/news-groupinfo":{"source":"iana","charset":"US-ASCII"},"application/news-transmission":{"source":"iana"},"application/nlsml+xml":{"source":"iana","compressible":true},"application/node":{"source":"iana","extensions":["cjs"]},"application/nss":{"source":"iana"},"application/ocsp-request":{"source":"iana"},"application/ocsp-response":{"source":"iana"},"application/octet-stream":{"source":"iana","compressible":false,"extensions":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{"source":"iana","extensions":["oda"]},"application/odm+xml":{"source":"iana","compressible":true},"application/odx":{"source":"iana"},"application/oebps-package+xml":{"source":"iana","compressible":true,"extensions":["opf"]},"application/ogg":{"source":"iana","compressible":false,"extensions":["ogx"]},"application/omdoc+xml":{"source":"apache","compressible":true,"extensions":["omdoc"]},"application/onenote":{"source":"apache","extensions":["onetoc","onetoc2","onetmp","onepkg"]},"application/opc-nodeset+xml":{"source":"iana","compressible":true},"application/oscore":{"source":"iana"},"application/oxps":{"source":"iana","extensions":["oxps"]},"application/p2p-overlay+xml":{"source":"iana","compressible":true,"extensions":["relo"]},"application/parityfec":{"source":"iana"},"application/passport":{"source":"iana"},"application/patch-ops-error+xml":{"source":"iana","compressible":true,"extensions":["xer"]},"application/pdf":{"source":"iana","compressible":false,"extensions":["pdf"]},"application/pdx":{"source":"iana"},"application/pem-certificate-chain":{"source":"iana"},"application/pgp-encrypted":{"source":"iana","compressible":false,"extensions":["pgp"]},"application/pgp-keys":{"source":"iana"},"application/pgp-signature":{"source":"iana","extensions":["asc","sig"]},"application/pics-rules":{"source":"apache","extensions":["prf"]},"application/pidf+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/pidf-diff+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/pkcs10":{"source":"iana","extensions":["p10"]},"application/pkcs12":{"source":"iana"},"application/pkcs7-mime":{"source":"iana","extensions":["p7m","p7c"]},"application/pkcs7-signature":{"source":"iana","extensions":["p7s"]},"application/pkcs8":{"source":"iana","extensions":["p8"]},"application/pkcs8-encrypted":{"source":"iana"},"application/pkix-attr-cert":{"source":"iana","extensions":["ac"]},"application/pkix-cert":{"source":"iana","extensions":["cer"]},"application/pkix-crl":{"source":"iana","extensions":["crl"]},"application/pkix-pkipath":{"source":"iana","extensions":["pkipath"]},"application/pkixcmp":{"source":"iana","extensions":["pki"]},"application/pls+xml":{"source":"iana","compressible":true,"extensions":["pls"]},"application/poc-settings+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/postscript":{"source":"iana","compressible":true,"extensions":["ai","eps","ps"]},"application/ppsp-tracker+json":{"source":"iana","compressible":true},"application/problem+json":{"source":"iana","compressible":true},"application/problem+xml":{"source":"iana","compressible":true},"application/provenance+xml":{"source":"iana","compressible":true,"extensions":["provx"]},"application/prs.alvestrand.titrax-sheet":{"source":"iana"},"application/prs.cww":{"source":"iana","extensions":["cww"]},"application/prs.cyn":{"source":"iana","charset":"7-BIT"},"application/prs.hpub+zip":{"source":"iana","compressible":false},"application/prs.nprend":{"source":"iana"},"application/prs.plucker":{"source":"iana"},"application/prs.rdf-xml-crypt":{"source":"iana"},"application/prs.xsf+xml":{"source":"iana","compressible":true},"application/pskc+xml":{"source":"iana","compressible":true,"extensions":["pskcxml"]},"application/pvd+json":{"source":"iana","compressible":true},"application/qsig":{"source":"iana"},"application/raml+yaml":{"compressible":true,"extensions":["raml"]},"application/raptorfec":{"source":"iana"},"application/rdap+json":{"source":"iana","compressible":true},"application/rdf+xml":{"source":"iana","compressible":true,"extensions":["rdf","owl"]},"application/reginfo+xml":{"source":"iana","compressible":true,"extensions":["rif"]},"application/relax-ng-compact-syntax":{"source":"iana","extensions":["rnc"]},"application/remote-printing":{"source":"iana"},"application/reputon+json":{"source":"iana","compressible":true},"application/resource-lists+xml":{"source":"iana","compressible":true,"extensions":["rl"]},"application/resource-lists-diff+xml":{"source":"iana","compressible":true,"extensions":["rld"]},"application/rfc+xml":{"source":"iana","compressible":true},"application/riscos":{"source":"iana"},"application/rlmi+xml":{"source":"iana","compressible":true},"application/rls-services+xml":{"source":"iana","compressible":true,"extensions":["rs"]},"application/route-apd+xml":{"source":"iana","compressible":true,"extensions":["rapd"]},"application/route-s-tsid+xml":{"source":"iana","compressible":true,"extensions":["sls"]},"application/route-usd+xml":{"source":"iana","compressible":true,"extensions":["rusd"]},"application/rpki-ghostbusters":{"source":"iana","extensions":["gbr"]},"application/rpki-manifest":{"source":"iana","extensions":["mft"]},"application/rpki-publication":{"source":"iana"},"application/rpki-roa":{"source":"iana","extensions":["roa"]},"application/rpki-updown":{"source":"iana"},"application/rsd+xml":{"source":"apache","compressible":true,"extensions":["rsd"]},"application/rss+xml":{"source":"apache","compressible":true,"extensions":["rss"]},"application/rtf":{"source":"iana","compressible":true,"extensions":["rtf"]},"application/rtploopback":{"source":"iana"},"application/rtx":{"source":"iana"},"application/samlassertion+xml":{"source":"iana","compressible":true},"application/samlmetadata+xml":{"source":"iana","compressible":true},"application/sarif+json":{"source":"iana","compressible":true},"application/sbe":{"source":"iana"},"application/sbml+xml":{"source":"iana","compressible":true,"extensions":["sbml"]},"application/scaip+xml":{"source":"iana","compressible":true},"application/scim+json":{"source":"iana","compressible":true},"application/scvp-cv-request":{"source":"iana","extensions":["scq"]},"application/scvp-cv-response":{"source":"iana","extensions":["scs"]},"application/scvp-vp-request":{"source":"iana","extensions":["spq"]},"application/scvp-vp-response":{"source":"iana","extensions":["spp"]},"application/sdp":{"source":"iana","extensions":["sdp"]},"application/secevent+jwt":{"source":"iana"},"application/senml+cbor":{"source":"iana"},"application/senml+json":{"source":"iana","compressible":true},"application/senml+xml":{"source":"iana","compressible":true,"extensions":["senmlx"]},"application/senml-etch+cbor":{"source":"iana"},"application/senml-etch+json":{"source":"iana","compressible":true},"application/senml-exi":{"source":"iana"},"application/sensml+cbor":{"source":"iana"},"application/sensml+json":{"source":"iana","compressible":true},"application/sensml+xml":{"source":"iana","compressible":true,"extensions":["sensmlx"]},"application/sensml-exi":{"source":"iana"},"application/sep+xml":{"source":"iana","compressible":true},"application/sep-exi":{"source":"iana"},"application/session-info":{"source":"iana"},"application/set-payment":{"source":"iana"},"application/set-payment-initiation":{"source":"iana","extensions":["setpay"]},"application/set-registration":{"source":"iana"},"application/set-registration-initiation":{"source":"iana","extensions":["setreg"]},"application/sgml":{"source":"iana"},"application/sgml-open-catalog":{"source":"iana"},"application/shf+xml":{"source":"iana","compressible":true,"extensions":["shf"]},"application/sieve":{"source":"iana","extensions":["siv","sieve"]},"application/simple-filter+xml":{"source":"iana","compressible":true},"application/simple-message-summary":{"source":"iana"},"application/simplesymbolcontainer":{"source":"iana"},"application/sipc":{"source":"iana"},"application/slate":{"source":"iana"},"application/smil":{"source":"iana"},"application/smil+xml":{"source":"iana","compressible":true,"extensions":["smi","smil"]},"application/smpte336m":{"source":"iana"},"application/soap+fastinfoset":{"source":"iana"},"application/soap+xml":{"source":"iana","compressible":true},"application/sparql-query":{"source":"iana","extensions":["rq"]},"application/sparql-results+xml":{"source":"iana","compressible":true,"extensions":["srx"]},"application/spirits-event+xml":{"source":"iana","compressible":true},"application/sql":{"source":"iana"},"application/srgs":{"source":"iana","extensions":["gram"]},"application/srgs+xml":{"source":"iana","compressible":true,"extensions":["grxml"]},"application/sru+xml":{"source":"iana","compressible":true,"extensions":["sru"]},"application/ssdl+xml":{"source":"apache","compressible":true,"extensions":["ssdl"]},"application/ssml+xml":{"source":"iana","compressible":true,"extensions":["ssml"]},"application/stix+json":{"source":"iana","compressible":true},"application/swid+xml":{"source":"iana","compressible":true,"extensions":["swidtag"]},"application/tamp-apex-update":{"source":"iana"},"application/tamp-apex-update-confirm":{"source":"iana"},"application/tamp-community-update":{"source":"iana"},"application/tamp-community-update-confirm":{"source":"iana"},"application/tamp-error":{"source":"iana"},"application/tamp-sequence-adjust":{"source":"iana"},"application/tamp-sequence-adjust-confirm":{"source":"iana"},"application/tamp-status-query":{"source":"iana"},"application/tamp-status-response":{"source":"iana"},"application/tamp-update":{"source":"iana"},"application/tamp-update-confirm":{"source":"iana"},"application/tar":{"compressible":true},"application/taxii+json":{"source":"iana","compressible":true},"application/td+json":{"source":"iana","compressible":true},"application/tei+xml":{"source":"iana","compressible":true,"extensions":["tei","teicorpus"]},"application/tetra_isi":{"source":"iana"},"application/thraud+xml":{"source":"iana","compressible":true,"extensions":["tfi"]},"application/timestamp-query":{"source":"iana"},"application/timestamp-reply":{"source":"iana"},"application/timestamped-data":{"source":"iana","extensions":["tsd"]},"application/tlsrpt+gzip":{"source":"iana"},"application/tlsrpt+json":{"source":"iana","compressible":true},"application/tnauthlist":{"source":"iana"},"application/toml":{"compressible":true,"extensions":["toml"]},"application/trickle-ice-sdpfrag":{"source":"iana"},"application/trig":{"source":"iana"},"application/ttml+xml":{"source":"iana","compressible":true,"extensions":["ttml"]},"application/tve-trigger":{"source":"iana"},"application/tzif":{"source":"iana"},"application/tzif-leap":{"source":"iana"},"application/ubjson":{"compressible":false,"extensions":["ubj"]},"application/ulpfec":{"source":"iana"},"application/urc-grpsheet+xml":{"source":"iana","compressible":true},"application/urc-ressheet+xml":{"source":"iana","compressible":true,"extensions":["rsheet"]},"application/urc-targetdesc+xml":{"source":"iana","compressible":true,"extensions":["td"]},"application/urc-uisocketdesc+xml":{"source":"iana","compressible":true},"application/vcard+json":{"source":"iana","compressible":true},"application/vcard+xml":{"source":"iana","compressible":true},"application/vemmi":{"source":"iana"},"application/vividence.scriptfile":{"source":"apache"},"application/vnd.1000minds.decision-model+xml":{"source":"iana","compressible":true,"extensions":["1km"]},"application/vnd.3gpp-prose+xml":{"source":"iana","compressible":true},"application/vnd.3gpp-prose-pc3ch+xml":{"source":"iana","compressible":true},"application/vnd.3gpp-v2x-local-service-information":{"source":"iana"},"application/vnd.3gpp.access-transfer-events+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.bsf+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.gmop+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.interworking-data":{"source":"iana"},"application/vnd.3gpp.mc-signalling-ear":{"source":"iana"},"application/vnd.3gpp.mcdata-affiliation-command+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-payload":{"source":"iana"},"application/vnd.3gpp.mcdata-service-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-signalling":{"source":"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-user-profile+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-affiliation-command+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-floor-request+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-location-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-service-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-signed+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-ue-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-ue-init-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-user-profile+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-affiliation-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-location-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-service-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-transmission-request+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-ue-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-user-profile+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mid-call+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.pic-bw-large":{"source":"iana","extensions":["plb"]},"application/vnd.3gpp.pic-bw-small":{"source":"iana","extensions":["psb"]},"application/vnd.3gpp.pic-bw-var":{"source":"iana","extensions":["pvb"]},"application/vnd.3gpp.sms":{"source":"iana"},"application/vnd.3gpp.sms+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.srvcc-ext+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.srvcc-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.state-and-event-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.ussd+xml":{"source":"iana","compressible":true},"application/vnd.3gpp2.bcmcsinfo+xml":{"source":"iana","compressible":true},"application/vnd.3gpp2.sms":{"source":"iana"},"application/vnd.3gpp2.tcap":{"source":"iana","extensions":["tcap"]},"application/vnd.3lightssoftware.imagescal":{"source":"iana"},"application/vnd.3m.post-it-notes":{"source":"iana","extensions":["pwn"]},"application/vnd.accpac.simply.aso":{"source":"iana","extensions":["aso"]},"application/vnd.accpac.simply.imp":{"source":"iana","extensions":["imp"]},"application/vnd.acucobol":{"source":"iana","extensions":["acu"]},"application/vnd.acucorp":{"source":"iana","extensions":["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{"source":"apache","compressible":false,"extensions":["air"]},"application/vnd.adobe.flash.movie":{"source":"iana"},"application/vnd.adobe.formscentral.fcdt":{"source":"iana","extensions":["fcdt"]},"application/vnd.adobe.fxp":{"source":"iana","extensions":["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{"source":"iana"},"application/vnd.adobe.xdp+xml":{"source":"iana","compressible":true,"extensions":["xdp"]},"application/vnd.adobe.xfdf":{"source":"iana","extensions":["xfdf"]},"application/vnd.aether.imp":{"source":"iana"},"application/vnd.afpc.afplinedata":{"source":"iana"},"application/vnd.afpc.afplinedata-pagedef":{"source":"iana"},"application/vnd.afpc.cmoca-cmresource":{"source":"iana"},"application/vnd.afpc.foca-charset":{"source":"iana"},"application/vnd.afpc.foca-codedfont":{"source":"iana"},"application/vnd.afpc.foca-codepage":{"source":"iana"},"application/vnd.afpc.modca":{"source":"iana"},"application/vnd.afpc.modca-cmtable":{"source":"iana"},"application/vnd.afpc.modca-formdef":{"source":"iana"},"application/vnd.afpc.modca-mediummap":{"source":"iana"},"application/vnd.afpc.modca-objectcontainer":{"source":"iana"},"application/vnd.afpc.modca-overlay":{"source":"iana"},"application/vnd.afpc.modca-pagesegment":{"source":"iana"},"application/vnd.ah-barcode":{"source":"iana"},"application/vnd.ahead.space":{"source":"iana","extensions":["ahead"]},"application/vnd.airzip.filesecure.azf":{"source":"iana","extensions":["azf"]},"application/vnd.airzip.filesecure.azs":{"source":"iana","extensions":["azs"]},"application/vnd.amadeus+json":{"source":"iana","compressible":true},"application/vnd.amazon.ebook":{"source":"apache","extensions":["azw"]},"application/vnd.amazon.mobi8-ebook":{"source":"iana"},"application/vnd.americandynamics.acc":{"source":"iana","extensions":["acc"]},"application/vnd.amiga.ami":{"source":"iana","extensions":["ami"]},"application/vnd.amundsen.maze+xml":{"source":"iana","compressible":true},"application/vnd.android.ota":{"source":"iana"},"application/vnd.android.package-archive":{"source":"apache","compressible":false,"extensions":["apk"]},"application/vnd.anki":{"source":"iana"},"application/vnd.anser-web-certificate-issue-initiation":{"source":"iana","extensions":["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{"source":"apache","extensions":["fti"]},"application/vnd.antix.game-component":{"source":"iana","extensions":["atx"]},"application/vnd.apache.thrift.binary":{"source":"iana"},"application/vnd.apache.thrift.compact":{"source":"iana"},"application/vnd.apache.thrift.json":{"source":"iana"},"application/vnd.api+json":{"source":"iana","compressible":true},"application/vnd.aplextor.warrp+json":{"source":"iana","compressible":true},"application/vnd.apothekende.reservation+json":{"source":"iana","compressible":true},"application/vnd.apple.installer+xml":{"source":"iana","compressible":true,"extensions":["mpkg"]},"application/vnd.apple.keynote":{"source":"iana","extensions":["key"]},"application/vnd.apple.mpegurl":{"source":"iana","extensions":["m3u8"]},"application/vnd.apple.numbers":{"source":"iana","extensions":["numbers"]},"application/vnd.apple.pages":{"source":"iana","extensions":["pages"]},"application/vnd.apple.pkpass":{"compressible":false,"extensions":["pkpass"]},"application/vnd.arastra.swi":{"source":"iana"},"application/vnd.aristanetworks.swi":{"source":"iana","extensions":["swi"]},"application/vnd.artisan+json":{"source":"iana","compressible":true},"application/vnd.artsquare":{"source":"iana"},"application/vnd.astraea-software.iota":{"source":"iana","extensions":["iota"]},"application/vnd.audiograph":{"source":"iana","extensions":["aep"]},"application/vnd.autopackage":{"source":"iana"},"application/vnd.avalon+json":{"source":"iana","compressible":true},"application/vnd.avistar+xml":{"source":"iana","compressible":true},"application/vnd.balsamiq.bmml+xml":{"source":"iana","compressible":true,"extensions":["bmml"]},"application/vnd.balsamiq.bmpr":{"source":"iana"},"application/vnd.banana-accounting":{"source":"iana"},"application/vnd.bbf.usp.error":{"source":"iana"},"application/vnd.bbf.usp.msg":{"source":"iana"},"application/vnd.bbf.usp.msg+json":{"source":"iana","compressible":true},"application/vnd.bekitzur-stech+json":{"source":"iana","compressible":true},"application/vnd.bint.med-content":{"source":"iana"},"application/vnd.biopax.rdf+xml":{"source":"iana","compressible":true},"application/vnd.blink-idb-value-wrapper":{"source":"iana"},"application/vnd.blueice.multipass":{"source":"iana","extensions":["mpm"]},"application/vnd.bluetooth.ep.oob":{"source":"iana"},"application/vnd.bluetooth.le.oob":{"source":"iana"},"application/vnd.bmi":{"source":"iana","extensions":["bmi"]},"application/vnd.bpf":{"source":"iana"},"application/vnd.bpf3":{"source":"iana"},"application/vnd.businessobjects":{"source":"iana","extensions":["rep"]},"application/vnd.byu.uapi+json":{"source":"iana","compressible":true},"application/vnd.cab-jscript":{"source":"iana"},"application/vnd.canon-cpdl":{"source":"iana"},"application/vnd.canon-lips":{"source":"iana"},"application/vnd.capasystems-pg+json":{"source":"iana","compressible":true},"application/vnd.cendio.thinlinc.clientconf":{"source":"iana"},"application/vnd.century-systems.tcp_stream":{"source":"iana"},"application/vnd.chemdraw+xml":{"source":"iana","compressible":true,"extensions":["cdxml"]},"application/vnd.chess-pgn":{"source":"iana"},"application/vnd.chipnuts.karaoke-mmd":{"source":"iana","extensions":["mmd"]},"application/vnd.ciedi":{"source":"iana"},"application/vnd.cinderella":{"source":"iana","extensions":["cdy"]},"application/vnd.cirpack.isdn-ext":{"source":"iana"},"application/vnd.citationstyles.style+xml":{"source":"iana","compressible":true,"extensions":["csl"]},"application/vnd.claymore":{"source":"iana","extensions":["cla"]},"application/vnd.cloanto.rp9":{"source":"iana","extensions":["rp9"]},"application/vnd.clonk.c4group":{"source":"iana","extensions":["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{"source":"iana","extensions":["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{"source":"iana","extensions":["c11amz"]},"application/vnd.coffeescript":{"source":"iana"},"application/vnd.collabio.xodocuments.document":{"source":"iana"},"application/vnd.collabio.xodocuments.document-template":{"source":"iana"},"application/vnd.collabio.xodocuments.presentation":{"source":"iana"},"application/vnd.collabio.xodocuments.presentation-template":{"source":"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{"source":"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{"source":"iana"},"application/vnd.collection+json":{"source":"iana","compressible":true},"application/vnd.collection.doc+json":{"source":"iana","compressible":true},"application/vnd.collection.next+json":{"source":"iana","compressible":true},"application/vnd.comicbook+zip":{"source":"iana","compressible":false},"application/vnd.comicbook-rar":{"source":"iana"},"application/vnd.commerce-battelle":{"source":"iana"},"application/vnd.commonspace":{"source":"iana","extensions":["csp"]},"application/vnd.contact.cmsg":{"source":"iana","extensions":["cdbcmsg"]},"application/vnd.coreos.ignition+json":{"source":"iana","compressible":true},"application/vnd.cosmocaller":{"source":"iana","extensions":["cmc"]},"application/vnd.crick.clicker":{"source":"iana","extensions":["clkx"]},"application/vnd.crick.clicker.keyboard":{"source":"iana","extensions":["clkk"]},"application/vnd.crick.clicker.palette":{"source":"iana","extensions":["clkp"]},"application/vnd.crick.clicker.template":{"source":"iana","extensions":["clkt"]},"application/vnd.crick.clicker.wordbank":{"source":"iana","extensions":["clkw"]},"application/vnd.criticaltools.wbs+xml":{"source":"iana","compressible":true,"extensions":["wbs"]},"application/vnd.cryptii.pipe+json":{"source":"iana","compressible":true},"application/vnd.crypto-shade-file":{"source":"iana"},"application/vnd.cryptomator.encrypted":{"source":"iana"},"application/vnd.ctc-posml":{"source":"iana","extensions":["pml"]},"application/vnd.ctct.ws+xml":{"source":"iana","compressible":true},"application/vnd.cups-pdf":{"source":"iana"},"application/vnd.cups-postscript":{"source":"iana"},"application/vnd.cups-ppd":{"source":"iana","extensions":["ppd"]},"application/vnd.cups-raster":{"source":"iana"},"application/vnd.cups-raw":{"source":"iana"},"application/vnd.curl":{"source":"iana"},"application/vnd.curl.car":{"source":"apache","extensions":["car"]},"application/vnd.curl.pcurl":{"source":"apache","extensions":["pcurl"]},"application/vnd.cyan.dean.root+xml":{"source":"iana","compressible":true},"application/vnd.cybank":{"source":"iana"},"application/vnd.cyclonedx+json":{"source":"iana","compressible":true},"application/vnd.cyclonedx+xml":{"source":"iana","compressible":true},"application/vnd.d2l.coursepackage1p0+zip":{"source":"iana","compressible":false},"application/vnd.d3m-dataset":{"source":"iana"},"application/vnd.d3m-problem":{"source":"iana"},"application/vnd.dart":{"source":"iana","compressible":true,"extensions":["dart"]},"application/vnd.data-vision.rdz":{"source":"iana","extensions":["rdz"]},"application/vnd.datapackage+json":{"source":"iana","compressible":true},"application/vnd.dataresource+json":{"source":"iana","compressible":true},"application/vnd.dbf":{"source":"iana","extensions":["dbf"]},"application/vnd.debian.binary-package":{"source":"iana"},"application/vnd.dece.data":{"source":"iana","extensions":["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{"source":"iana","compressible":true,"extensions":["uvt","uvvt"]},"application/vnd.dece.unspecified":{"source":"iana","extensions":["uvx","uvvx"]},"application/vnd.dece.zip":{"source":"iana","extensions":["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{"source":"iana","extensions":["fe_launch"]},"application/vnd.desmume.movie":{"source":"iana"},"application/vnd.dir-bi.plate-dl-nosuffix":{"source":"iana"},"application/vnd.dm.delegation+xml":{"source":"iana","compressible":true},"application/vnd.dna":{"source":"iana","extensions":["dna"]},"application/vnd.document+json":{"source":"iana","compressible":true},"application/vnd.dolby.mlp":{"source":"apache","extensions":["mlp"]},"application/vnd.dolby.mobile.1":{"source":"iana"},"application/vnd.dolby.mobile.2":{"source":"iana"},"application/vnd.doremir.scorecloud-binary-document":{"source":"iana"},"application/vnd.dpgraph":{"source":"iana","extensions":["dpg"]},"application/vnd.dreamfactory":{"source":"iana","extensions":["dfac"]},"application/vnd.drive+json":{"source":"iana","compressible":true},"application/vnd.ds-keypoint":{"source":"apache","extensions":["kpxx"]},"application/vnd.dtg.local":{"source":"iana"},"application/vnd.dtg.local.flash":{"source":"iana"},"application/vnd.dtg.local.html":{"source":"iana"},"application/vnd.dvb.ait":{"source":"iana","extensions":["ait"]},"application/vnd.dvb.dvbisl+xml":{"source":"iana","compressible":true},"application/vnd.dvb.dvbj":{"source":"iana"},"application/vnd.dvb.esgcontainer":{"source":"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{"source":"iana"},"application/vnd.dvb.ipdcesgaccess":{"source":"iana"},"application/vnd.dvb.ipdcesgaccess2":{"source":"iana"},"application/vnd.dvb.ipdcesgpdd":{"source":"iana"},"application/vnd.dvb.ipdcroaming":{"source":"iana"},"application/vnd.dvb.iptv.alfec-base":{"source":"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{"source":"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-container+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-generic+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-ia-msglist+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-ia-registration-request+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-ia-registration-response+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-init+xml":{"source":"iana","compressible":true},"application/vnd.dvb.pfr":{"source":"iana"},"application/vnd.dvb.service":{"source":"iana","extensions":["svc"]},"application/vnd.dxr":{"source":"iana"},"application/vnd.dynageo":{"source":"iana","extensions":["geo"]},"application/vnd.dzr":{"source":"iana"},"application/vnd.easykaraoke.cdgdownload":{"source":"iana"},"application/vnd.ecdis-update":{"source":"iana"},"application/vnd.ecip.rlp":{"source":"iana"},"application/vnd.ecowin.chart":{"source":"iana","extensions":["mag"]},"application/vnd.ecowin.filerequest":{"source":"iana"},"application/vnd.ecowin.fileupdate":{"source":"iana"},"application/vnd.ecowin.series":{"source":"iana"},"application/vnd.ecowin.seriesrequest":{"source":"iana"},"application/vnd.ecowin.seriesupdate":{"source":"iana"},"application/vnd.efi.img":{"source":"iana"},"application/vnd.efi.iso":{"source":"iana"},"application/vnd.emclient.accessrequest+xml":{"source":"iana","compressible":true},"application/vnd.enliven":{"source":"iana","extensions":["nml"]},"application/vnd.enphase.envoy":{"source":"iana"},"application/vnd.eprints.data+xml":{"source":"iana","compressible":true},"application/vnd.epson.esf":{"source":"iana","extensions":["esf"]},"application/vnd.epson.msf":{"source":"iana","extensions":["msf"]},"application/vnd.epson.quickanime":{"source":"iana","extensions":["qam"]},"application/vnd.epson.salt":{"source":"iana","extensions":["slt"]},"application/vnd.epson.ssf":{"source":"iana","extensions":["ssf"]},"application/vnd.ericsson.quickcall":{"source":"iana"},"application/vnd.espass-espass+zip":{"source":"iana","compressible":false},"application/vnd.eszigno3+xml":{"source":"iana","compressible":true,"extensions":["es3","et3"]},"application/vnd.etsi.aoc+xml":{"source":"iana","compressible":true},"application/vnd.etsi.asic-e+zip":{"source":"iana","compressible":false},"application/vnd.etsi.asic-s+zip":{"source":"iana","compressible":false},"application/vnd.etsi.cug+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvcommand+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvdiscovery+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvprofile+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsad-bc+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsad-cod+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsad-npvr+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvservice+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsync+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvueprofile+xml":{"source":"iana","compressible":true},"application/vnd.etsi.mcid+xml":{"source":"iana","compressible":true},"application/vnd.etsi.mheg5":{"source":"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{"source":"iana","compressible":true},"application/vnd.etsi.pstn+xml":{"source":"iana","compressible":true},"application/vnd.etsi.sci+xml":{"source":"iana","compressible":true},"application/vnd.etsi.simservs+xml":{"source":"iana","compressible":true},"application/vnd.etsi.timestamp-token":{"source":"iana"},"application/vnd.etsi.tsl+xml":{"source":"iana","compressible":true},"application/vnd.etsi.tsl.der":{"source":"iana"},"application/vnd.eudora.data":{"source":"iana"},"application/vnd.evolv.ecig.profile":{"source":"iana"},"application/vnd.evolv.ecig.settings":{"source":"iana"},"application/vnd.evolv.ecig.theme":{"source":"iana"},"application/vnd.exstream-empower+zip":{"source":"iana","compressible":false},"application/vnd.exstream-package":{"source":"iana"},"application/vnd.ezpix-album":{"source":"iana","extensions":["ez2"]},"application/vnd.ezpix-package":{"source":"iana","extensions":["ez3"]},"application/vnd.f-secure.mobile":{"source":"iana"},"application/vnd.fastcopy-disk-image":{"source":"iana"},"application/vnd.fdf":{"source":"iana","extensions":["fdf"]},"application/vnd.fdsn.mseed":{"source":"iana","extensions":["mseed"]},"application/vnd.fdsn.seed":{"source":"iana","extensions":["seed","dataless"]},"application/vnd.ffsns":{"source":"iana"},"application/vnd.ficlab.flb+zip":{"source":"iana","compressible":false},"application/vnd.filmit.zfc":{"source":"iana"},"application/vnd.fints":{"source":"iana"},"application/vnd.firemonkeys.cloudcell":{"source":"iana"},"application/vnd.flographit":{"source":"iana","extensions":["gph"]},"application/vnd.fluxtime.clip":{"source":"iana","extensions":["ftc"]},"application/vnd.font-fontforge-sfd":{"source":"iana"},"application/vnd.framemaker":{"source":"iana","extensions":["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{"source":"iana","extensions":["fnc"]},"application/vnd.frogans.ltf":{"source":"iana","extensions":["ltf"]},"application/vnd.fsc.weblaunch":{"source":"iana","extensions":["fsc"]},"application/vnd.fujitsu.oasys":{"source":"iana","extensions":["oas"]},"application/vnd.fujitsu.oasys2":{"source":"iana","extensions":["oa2"]},"application/vnd.fujitsu.oasys3":{"source":"iana","extensions":["oa3"]},"application/vnd.fujitsu.oasysgp":{"source":"iana","extensions":["fg5"]},"application/vnd.fujitsu.oasysprs":{"source":"iana","extensions":["bh2"]},"application/vnd.fujixerox.art-ex":{"source":"iana"},"application/vnd.fujixerox.art4":{"source":"iana"},"application/vnd.fujixerox.ddd":{"source":"iana","extensions":["ddd"]},"application/vnd.fujixerox.docuworks":{"source":"iana","extensions":["xdw"]},"application/vnd.fujixerox.docuworks.binder":{"source":"iana","extensions":["xbd"]},"application/vnd.fujixerox.docuworks.container":{"source":"iana"},"application/vnd.fujixerox.hbpl":{"source":"iana"},"application/vnd.fut-misnet":{"source":"iana"},"application/vnd.futoin+cbor":{"source":"iana"},"application/vnd.futoin+json":{"source":"iana","compressible":true},"application/vnd.fuzzysheet":{"source":"iana","extensions":["fzs"]},"application/vnd.genomatix.tuxedo":{"source":"iana","extensions":["txd"]},"application/vnd.gentics.grd+json":{"source":"iana","compressible":true},"application/vnd.geo+json":{"source":"iana","compressible":true},"application/vnd.geocube+xml":{"source":"iana","compressible":true},"application/vnd.geogebra.file":{"source":"iana","extensions":["ggb"]},"application/vnd.geogebra.slides":{"source":"iana"},"application/vnd.geogebra.tool":{"source":"iana","extensions":["ggt"]},"application/vnd.geometry-explorer":{"source":"iana","extensions":["gex","gre"]},"application/vnd.geonext":{"source":"iana","extensions":["gxt"]},"application/vnd.geoplan":{"source":"iana","extensions":["g2w"]},"application/vnd.geospace":{"source":"iana","extensions":["g3w"]},"application/vnd.gerber":{"source":"iana"},"application/vnd.globalplatform.card-content-mgt":{"source":"iana"},"application/vnd.globalplatform.card-content-mgt-response":{"source":"iana"},"application/vnd.gmx":{"source":"iana","extensions":["gmx"]},"application/vnd.google-apps.document":{"compressible":false,"extensions":["gdoc"]},"application/vnd.google-apps.presentation":{"compressible":false,"extensions":["gslides"]},"application/vnd.google-apps.spreadsheet":{"compressible":false,"extensions":["gsheet"]},"application/vnd.google-earth.kml+xml":{"source":"iana","compressible":true,"extensions":["kml"]},"application/vnd.google-earth.kmz":{"source":"iana","compressible":false,"extensions":["kmz"]},"application/vnd.gov.sk.e-form+xml":{"source":"iana","compressible":true},"application/vnd.gov.sk.e-form+zip":{"source":"iana","compressible":false},"application/vnd.gov.sk.xmldatacontainer+xml":{"source":"iana","compressible":true},"application/vnd.grafeq":{"source":"iana","extensions":["gqf","gqs"]},"application/vnd.gridmp":{"source":"iana"},"application/vnd.groove-account":{"source":"iana","extensions":["gac"]},"application/vnd.groove-help":{"source":"iana","extensions":["ghf"]},"application/vnd.groove-identity-message":{"source":"iana","extensions":["gim"]},"application/vnd.groove-injector":{"source":"iana","extensions":["grv"]},"application/vnd.groove-tool-message":{"source":"iana","extensions":["gtm"]},"application/vnd.groove-tool-template":{"source":"iana","extensions":["tpl"]},"application/vnd.groove-vcard":{"source":"iana","extensions":["vcg"]},"application/vnd.hal+json":{"source":"iana","compressible":true},"application/vnd.hal+xml":{"source":"iana","compressible":true,"extensions":["hal"]},"application/vnd.handheld-entertainment+xml":{"source":"iana","compressible":true,"extensions":["zmm"]},"application/vnd.hbci":{"source":"iana","extensions":["hbci"]},"application/vnd.hc+json":{"source":"iana","compressible":true},"application/vnd.hcl-bireports":{"source":"iana"},"application/vnd.hdt":{"source":"iana"},"application/vnd.heroku+json":{"source":"iana","compressible":true},"application/vnd.hhe.lesson-player":{"source":"iana","extensions":["les"]},"application/vnd.hp-hpgl":{"source":"iana","extensions":["hpgl"]},"application/vnd.hp-hpid":{"source":"iana","extensions":["hpid"]},"application/vnd.hp-hps":{"source":"iana","extensions":["hps"]},"application/vnd.hp-jlyt":{"source":"iana","extensions":["jlt"]},"application/vnd.hp-pcl":{"source":"iana","extensions":["pcl"]},"application/vnd.hp-pclxl":{"source":"iana","extensions":["pclxl"]},"application/vnd.httphone":{"source":"iana"},"application/vnd.hydrostatix.sof-data":{"source":"iana","extensions":["sfd-hdstx"]},"application/vnd.hyper+json":{"source":"iana","compressible":true},"application/vnd.hyper-item+json":{"source":"iana","compressible":true},"application/vnd.hyperdrive+json":{"source":"iana","compressible":true},"application/vnd.hzn-3d-crossword":{"source":"iana"},"application/vnd.ibm.afplinedata":{"source":"iana"},"application/vnd.ibm.electronic-media":{"source":"iana"},"application/vnd.ibm.minipay":{"source":"iana","extensions":["mpy"]},"application/vnd.ibm.modcap":{"source":"iana","extensions":["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{"source":"iana","extensions":["irm"]},"application/vnd.ibm.secure-container":{"source":"iana","extensions":["sc"]},"application/vnd.iccprofile":{"source":"iana","extensions":["icc","icm"]},"application/vnd.ieee.1905":{"source":"iana"},"application/vnd.igloader":{"source":"iana","extensions":["igl"]},"application/vnd.imagemeter.folder+zip":{"source":"iana","compressible":false},"application/vnd.imagemeter.image+zip":{"source":"iana","compressible":false},"application/vnd.immervision-ivp":{"source":"iana","extensions":["ivp"]},"application/vnd.immervision-ivu":{"source":"iana","extensions":["ivu"]},"application/vnd.ims.imsccv1p1":{"source":"iana"},"application/vnd.ims.imsccv1p2":{"source":"iana"},"application/vnd.ims.imsccv1p3":{"source":"iana"},"application/vnd.ims.lis.v2.result+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolproxy+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolproxy.id+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolsettings+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolsettings.simple+json":{"source":"iana","compressible":true},"application/vnd.informedcontrol.rms+xml":{"source":"iana","compressible":true},"application/vnd.informix-visionary":{"source":"iana"},"application/vnd.infotech.project":{"source":"iana"},"application/vnd.infotech.project+xml":{"source":"iana","compressible":true},"application/vnd.innopath.wamp.notification":{"source":"iana"},"application/vnd.insors.igm":{"source":"iana","extensions":["igm"]},"application/vnd.intercon.formnet":{"source":"iana","extensions":["xpw","xpx"]},"application/vnd.intergeo":{"source":"iana","extensions":["i2g"]},"application/vnd.intertrust.digibox":{"source":"iana"},"application/vnd.intertrust.nncp":{"source":"iana"},"application/vnd.intu.qbo":{"source":"iana","extensions":["qbo"]},"application/vnd.intu.qfx":{"source":"iana","extensions":["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.conceptitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.knowledgeitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.newsitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.newsmessage+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.packageitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.planningitem+xml":{"source":"iana","compressible":true},"application/vnd.ipunplugged.rcprofile":{"source":"iana","extensions":["rcprofile"]},"application/vnd.irepository.package+xml":{"source":"iana","compressible":true,"extensions":["irp"]},"application/vnd.is-xpr":{"source":"iana","extensions":["xpr"]},"application/vnd.isac.fcs":{"source":"iana","extensions":["fcs"]},"application/vnd.iso11783-10+zip":{"source":"iana","compressible":false},"application/vnd.jam":{"source":"iana","extensions":["jam"]},"application/vnd.japannet-directory-service":{"source":"iana"},"application/vnd.japannet-jpnstore-wakeup":{"source":"iana"},"application/vnd.japannet-payment-wakeup":{"source":"iana"},"application/vnd.japannet-registration":{"source":"iana"},"application/vnd.japannet-registration-wakeup":{"source":"iana"},"application/vnd.japannet-setstore-wakeup":{"source":"iana"},"application/vnd.japannet-verification":{"source":"iana"},"application/vnd.japannet-verification-wakeup":{"source":"iana"},"application/vnd.jcp.javame.midlet-rms":{"source":"iana","extensions":["rms"]},"application/vnd.jisp":{"source":"iana","extensions":["jisp"]},"application/vnd.joost.joda-archive":{"source":"iana","extensions":["joda"]},"application/vnd.jsk.isdn-ngn":{"source":"iana"},"application/vnd.kahootz":{"source":"iana","extensions":["ktz","ktr"]},"application/vnd.kde.karbon":{"source":"iana","extensions":["karbon"]},"application/vnd.kde.kchart":{"source":"iana","extensions":["chrt"]},"application/vnd.kde.kformula":{"source":"iana","extensions":["kfo"]},"application/vnd.kde.kivio":{"source":"iana","extensions":["flw"]},"application/vnd.kde.kontour":{"source":"iana","extensions":["kon"]},"application/vnd.kde.kpresenter":{"source":"iana","extensions":["kpr","kpt"]},"application/vnd.kde.kspread":{"source":"iana","extensions":["ksp"]},"application/vnd.kde.kword":{"source":"iana","extensions":["kwd","kwt"]},"application/vnd.kenameaapp":{"source":"iana","extensions":["htke"]},"application/vnd.kidspiration":{"source":"iana","extensions":["kia"]},"application/vnd.kinar":{"source":"iana","extensions":["kne","knp"]},"application/vnd.koan":{"source":"iana","extensions":["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{"source":"iana","extensions":["sse"]},"application/vnd.las":{"source":"iana"},"application/vnd.las.las+json":{"source":"iana","compressible":true},"application/vnd.las.las+xml":{"source":"iana","compressible":true,"extensions":["lasxml"]},"application/vnd.laszip":{"source":"iana"},"application/vnd.leap+json":{"source":"iana","compressible":true},"application/vnd.liberty-request+xml":{"source":"iana","compressible":true},"application/vnd.llamagraphics.life-balance.desktop":{"source":"iana","extensions":["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{"source":"iana","compressible":true,"extensions":["lbe"]},"application/vnd.logipipe.circuit+zip":{"source":"iana","compressible":false},"application/vnd.loom":{"source":"iana"},"application/vnd.lotus-1-2-3":{"source":"iana","extensions":["123"]},"application/vnd.lotus-approach":{"source":"iana","extensions":["apr"]},"application/vnd.lotus-freelance":{"source":"iana","extensions":["pre"]},"application/vnd.lotus-notes":{"source":"iana","extensions":["nsf"]},"application/vnd.lotus-organizer":{"source":"iana","extensions":["org"]},"application/vnd.lotus-screencam":{"source":"iana","extensions":["scm"]},"application/vnd.lotus-wordpro":{"source":"iana","extensions":["lwp"]},"application/vnd.macports.portpkg":{"source":"iana","extensions":["portpkg"]},"application/vnd.mapbox-vector-tile":{"source":"iana"},"application/vnd.marlin.drm.actiontoken+xml":{"source":"iana","compressible":true},"application/vnd.marlin.drm.conftoken+xml":{"source":"iana","compressible":true},"application/vnd.marlin.drm.license+xml":{"source":"iana","compressible":true},"application/vnd.marlin.drm.mdcf":{"source":"iana"},"application/vnd.mason+json":{"source":"iana","compressible":true},"application/vnd.maxmind.maxmind-db":{"source":"iana"},"application/vnd.mcd":{"source":"iana","extensions":["mcd"]},"application/vnd.medcalcdata":{"source":"iana","extensions":["mc1"]},"application/vnd.mediastation.cdkey":{"source":"iana","extensions":["cdkey"]},"application/vnd.meridian-slingshot":{"source":"iana"},"application/vnd.mfer":{"source":"iana","extensions":["mwf"]},"application/vnd.mfmp":{"source":"iana","extensions":["mfm"]},"application/vnd.micro+json":{"source":"iana","compressible":true},"application/vnd.micrografx.flo":{"source":"iana","extensions":["flo"]},"application/vnd.micrografx.igx":{"source":"iana","extensions":["igx"]},"application/vnd.microsoft.portable-executable":{"source":"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{"source":"iana"},"application/vnd.miele+json":{"source":"iana","compressible":true},"application/vnd.mif":{"source":"iana","extensions":["mif"]},"application/vnd.minisoft-hp3000-save":{"source":"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{"source":"iana"},"application/vnd.mobius.daf":{"source":"iana","extensions":["daf"]},"application/vnd.mobius.dis":{"source":"iana","extensions":["dis"]},"application/vnd.mobius.mbk":{"source":"iana","extensions":["mbk"]},"application/vnd.mobius.mqy":{"source":"iana","extensions":["mqy"]},"application/vnd.mobius.msl":{"source":"iana","extensions":["msl"]},"application/vnd.mobius.plc":{"source":"iana","extensions":["plc"]},"application/vnd.mobius.txf":{"source":"iana","extensions":["txf"]},"application/vnd.mophun.application":{"source":"iana","extensions":["mpn"]},"application/vnd.mophun.certificate":{"source":"iana","extensions":["mpc"]},"application/vnd.motorola.flexsuite":{"source":"iana"},"application/vnd.motorola.flexsuite.adsi":{"source":"iana"},"application/vnd.motorola.flexsuite.fis":{"source":"iana"},"application/vnd.motorola.flexsuite.gotap":{"source":"iana"},"application/vnd.motorola.flexsuite.kmr":{"source":"iana"},"application/vnd.motorola.flexsuite.ttc":{"source":"iana"},"application/vnd.motorola.flexsuite.wem":{"source":"iana"},"application/vnd.motorola.iprm":{"source":"iana"},"application/vnd.mozilla.xul+xml":{"source":"iana","compressible":true,"extensions":["xul"]},"application/vnd.ms-3mfdocument":{"source":"iana"},"application/vnd.ms-artgalry":{"source":"iana","extensions":["cil"]},"application/vnd.ms-asf":{"source":"iana"},"application/vnd.ms-cab-compressed":{"source":"iana","extensions":["cab"]},"application/vnd.ms-color.iccprofile":{"source":"apache"},"application/vnd.ms-excel":{"source":"iana","compressible":false,"extensions":["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{"source":"iana","extensions":["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{"source":"iana","extensions":["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{"source":"iana","extensions":["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{"source":"iana","extensions":["xltm"]},"application/vnd.ms-fontobject":{"source":"iana","compressible":true,"extensions":["eot"]},"application/vnd.ms-htmlhelp":{"source":"iana","extensions":["chm"]},"application/vnd.ms-ims":{"source":"iana","extensions":["ims"]},"application/vnd.ms-lrm":{"source":"iana","extensions":["lrm"]},"application/vnd.ms-office.activex+xml":{"source":"iana","compressible":true},"application/vnd.ms-officetheme":{"source":"iana","extensions":["thmx"]},"application/vnd.ms-opentype":{"source":"apache","compressible":true},"application/vnd.ms-outlook":{"compressible":false,"extensions":["msg"]},"application/vnd.ms-package.obfuscated-opentype":{"source":"apache"},"application/vnd.ms-pki.seccat":{"source":"apache","extensions":["cat"]},"application/vnd.ms-pki.stl":{"source":"apache","extensions":["stl"]},"application/vnd.ms-playready.initiator+xml":{"source":"iana","compressible":true},"application/vnd.ms-powerpoint":{"source":"iana","compressible":false,"extensions":["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{"source":"iana","extensions":["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{"source":"iana","extensions":["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{"source":"iana","extensions":["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{"source":"iana","extensions":["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{"source":"iana","extensions":["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{"source":"iana","compressible":true},"application/vnd.ms-printing.printticket+xml":{"source":"apache","compressible":true},"application/vnd.ms-printschematicket+xml":{"source":"iana","compressible":true},"application/vnd.ms-project":{"source":"iana","extensions":["mpp","mpt"]},"application/vnd.ms-tnef":{"source":"iana"},"application/vnd.ms-windows.devicepairing":{"source":"iana"},"application/vnd.ms-windows.nwprinting.oob":{"source":"iana"},"application/vnd.ms-windows.printerpairing":{"source":"iana"},"application/vnd.ms-windows.wsd.oob":{"source":"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{"source":"iana"},"application/vnd.ms-wmdrm.lic-resp":{"source":"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{"source":"iana"},"application/vnd.ms-wmdrm.meter-resp":{"source":"iana"},"application/vnd.ms-word.document.macroenabled.12":{"source":"iana","extensions":["docm"]},"application/vnd.ms-word.template.macroenabled.12":{"source":"iana","extensions":["dotm"]},"application/vnd.ms-works":{"source":"iana","extensions":["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{"source":"iana","extensions":["wpl"]},"application/vnd.ms-xpsdocument":{"source":"iana","compressible":false,"extensions":["xps"]},"application/vnd.msa-disk-image":{"source":"iana"},"application/vnd.mseq":{"source":"iana","extensions":["mseq"]},"application/vnd.msign":{"source":"iana"},"application/vnd.multiad.creator":{"source":"iana"},"application/vnd.multiad.creator.cif":{"source":"iana"},"application/vnd.music-niff":{"source":"iana"},"application/vnd.musician":{"source":"iana","extensions":["mus"]},"application/vnd.muvee.style":{"source":"iana","extensions":["msty"]},"application/vnd.mynfc":{"source":"iana","extensions":["taglet"]},"application/vnd.ncd.control":{"source":"iana"},"application/vnd.ncd.reference":{"source":"iana"},"application/vnd.nearst.inv+json":{"source":"iana","compressible":true},"application/vnd.nebumind.line":{"source":"iana"},"application/vnd.nervana":{"source":"iana"},"application/vnd.netfpx":{"source":"iana"},"application/vnd.neurolanguage.nlu":{"source":"iana","extensions":["nlu"]},"application/vnd.nimn":{"source":"iana"},"application/vnd.nintendo.nitro.rom":{"source":"iana"},"application/vnd.nintendo.snes.rom":{"source":"iana"},"application/vnd.nitf":{"source":"iana","extensions":["ntf","nitf"]},"application/vnd.noblenet-directory":{"source":"iana","extensions":["nnd"]},"application/vnd.noblenet-sealer":{"source":"iana","extensions":["nns"]},"application/vnd.noblenet-web":{"source":"iana","extensions":["nnw"]},"application/vnd.nokia.catalogs":{"source":"iana"},"application/vnd.nokia.conml+wbxml":{"source":"iana"},"application/vnd.nokia.conml+xml":{"source":"iana","compressible":true},"application/vnd.nokia.iptv.config+xml":{"source":"iana","compressible":true},"application/vnd.nokia.isds-radio-presets":{"source":"iana"},"application/vnd.nokia.landmark+wbxml":{"source":"iana"},"application/vnd.nokia.landmark+xml":{"source":"iana","compressible":true},"application/vnd.nokia.landmarkcollection+xml":{"source":"iana","compressible":true},"application/vnd.nokia.n-gage.ac+xml":{"source":"iana","compressible":true,"extensions":["ac"]},"application/vnd.nokia.n-gage.data":{"source":"iana","extensions":["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{"source":"iana","extensions":["n-gage"]},"application/vnd.nokia.ncd":{"source":"iana"},"application/vnd.nokia.pcd+wbxml":{"source":"iana"},"application/vnd.nokia.pcd+xml":{"source":"iana","compressible":true},"application/vnd.nokia.radio-preset":{"source":"iana","extensions":["rpst"]},"application/vnd.nokia.radio-presets":{"source":"iana","extensions":["rpss"]},"application/vnd.novadigm.edm":{"source":"iana","extensions":["edm"]},"application/vnd.novadigm.edx":{"source":"iana","extensions":["edx"]},"application/vnd.novadigm.ext":{"source":"iana","extensions":["ext"]},"application/vnd.ntt-local.content-share":{"source":"iana"},"application/vnd.ntt-local.file-transfer":{"source":"iana"},"application/vnd.ntt-local.ogw_remote-access":{"source":"iana"},"application/vnd.ntt-local.sip-ta_remote":{"source":"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{"source":"iana"},"application/vnd.oasis.opendocument.chart":{"source":"iana","extensions":["odc"]},"application/vnd.oasis.opendocument.chart-template":{"source":"iana","extensions":["otc"]},"application/vnd.oasis.opendocument.database":{"source":"iana","extensions":["odb"]},"application/vnd.oasis.opendocument.formula":{"source":"iana","extensions":["odf"]},"application/vnd.oasis.opendocument.formula-template":{"source":"iana","extensions":["odft"]},"application/vnd.oasis.opendocument.graphics":{"source":"iana","compressible":false,"extensions":["odg"]},"application/vnd.oasis.opendocument.graphics-template":{"source":"iana","extensions":["otg"]},"application/vnd.oasis.opendocument.image":{"source":"iana","extensions":["odi"]},"application/vnd.oasis.opendocument.image-template":{"source":"iana","extensions":["oti"]},"application/vnd.oasis.opendocument.presentation":{"source":"iana","compressible":false,"extensions":["odp"]},"application/vnd.oasis.opendocument.presentation-template":{"source":"iana","extensions":["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{"source":"iana","compressible":false,"extensions":["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{"source":"iana","extensions":["ots"]},"application/vnd.oasis.opendocument.text":{"source":"iana","compressible":false,"extensions":["odt"]},"application/vnd.oasis.opendocument.text-master":{"source":"iana","extensions":["odm"]},"application/vnd.oasis.opendocument.text-template":{"source":"iana","extensions":["ott"]},"application/vnd.oasis.opendocument.text-web":{"source":"iana","extensions":["oth"]},"application/vnd.obn":{"source":"iana"},"application/vnd.ocf+cbor":{"source":"iana"},"application/vnd.oci.image.manifest.v1+json":{"source":"iana","compressible":true},"application/vnd.oftn.l10n+json":{"source":"iana","compressible":true},"application/vnd.oipf.contentaccessdownload+xml":{"source":"iana","compressible":true},"application/vnd.oipf.contentaccessstreaming+xml":{"source":"iana","compressible":true},"application/vnd.oipf.cspg-hexbinary":{"source":"iana"},"application/vnd.oipf.dae.svg+xml":{"source":"iana","compressible":true},"application/vnd.oipf.dae.xhtml+xml":{"source":"iana","compressible":true},"application/vnd.oipf.mippvcontrolmessage+xml":{"source":"iana","compressible":true},"application/vnd.oipf.pae.gem":{"source":"iana"},"application/vnd.oipf.spdiscovery+xml":{"source":"iana","compressible":true},"application/vnd.oipf.spdlist+xml":{"source":"iana","compressible":true},"application/vnd.oipf.ueprofile+xml":{"source":"iana","compressible":true},"application/vnd.oipf.userprofile+xml":{"source":"iana","compressible":true},"application/vnd.olpc-sugar":{"source":"iana","extensions":["xo"]},"application/vnd.oma-scws-config":{"source":"iana"},"application/vnd.oma-scws-http-request":{"source":"iana"},"application/vnd.oma-scws-http-response":{"source":"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.drm-trigger+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.imd+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.ltkm":{"source":"iana"},"application/vnd.oma.bcast.notification+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.provisioningtrigger":{"source":"iana"},"application/vnd.oma.bcast.sgboot":{"source":"iana"},"application/vnd.oma.bcast.sgdd+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.sgdu":{"source":"iana"},"application/vnd.oma.bcast.simple-symbol-container":{"source":"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.sprov+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.stkm":{"source":"iana"},"application/vnd.oma.cab-address-book+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-feature-handler+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-pcc+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-subs-invite+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-user-prefs+xml":{"source":"iana","compressible":true},"application/vnd.oma.dcd":{"source":"iana"},"application/vnd.oma.dcdc":{"source":"iana"},"application/vnd.oma.dd2+xml":{"source":"iana","compressible":true,"extensions":["dd2"]},"application/vnd.oma.drm.risd+xml":{"source":"iana","compressible":true},"application/vnd.oma.group-usage-list+xml":{"source":"iana","compressible":true},"application/vnd.oma.lwm2m+cbor":{"source":"iana"},"application/vnd.oma.lwm2m+json":{"source":"iana","compressible":true},"application/vnd.oma.lwm2m+tlv":{"source":"iana"},"application/vnd.oma.pal+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.detailed-progress-report+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.final-report+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.groups+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.invocation-descriptor+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.optimized-progress-report+xml":{"source":"iana","compressible":true},"application/vnd.oma.push":{"source":"iana"},"application/vnd.oma.scidm.messages+xml":{"source":"iana","compressible":true},"application/vnd.oma.xcap-directory+xml":{"source":"iana","compressible":true},"application/vnd.omads-email+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.omads-file+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.omads-folder+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.omaloc-supl-init":{"source":"iana"},"application/vnd.onepager":{"source":"iana"},"application/vnd.onepagertamp":{"source":"iana"},"application/vnd.onepagertamx":{"source":"iana"},"application/vnd.onepagertat":{"source":"iana"},"application/vnd.onepagertatp":{"source":"iana"},"application/vnd.onepagertatx":{"source":"iana"},"application/vnd.openblox.game+xml":{"source":"iana","compressible":true,"extensions":["obgx"]},"application/vnd.openblox.game-binary":{"source":"iana"},"application/vnd.openeye.oeb":{"source":"iana"},"application/vnd.openofficeorg.extension":{"source":"apache","extensions":["oxt"]},"application/vnd.openstreetmap.data+xml":{"source":"iana","compressible":true,"extensions":["osm"]},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawing+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{"source":"iana","compressible":false,"extensions":["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slide":{"source":"iana","extensions":["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{"source":"iana","extensions":["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.template":{"source":"iana","extensions":["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"source":"iana","compressible":false,"extensions":["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{"source":"iana","extensions":["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.theme+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.vmldrawing":{"source":"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{"source":"iana","compressible":false,"extensions":["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{"source":"iana","extensions":["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-package.core-properties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-package.relationships+xml":{"source":"iana","compressible":true},"application/vnd.oracle.resource+json":{"source":"iana","compressible":true},"application/vnd.orange.indata":{"source":"iana"},"application/vnd.osa.netdeploy":{"source":"iana"},"application/vnd.osgeo.mapguide.package":{"source":"iana","extensions":["mgp"]},"application/vnd.osgi.bundle":{"source":"iana"},"application/vnd.osgi.dp":{"source":"iana","extensions":["dp"]},"application/vnd.osgi.subsystem":{"source":"iana","extensions":["esa"]},"application/vnd.otps.ct-kip+xml":{"source":"iana","compressible":true},"application/vnd.oxli.countgraph":{"source":"iana"},"application/vnd.pagerduty+json":{"source":"iana","compressible":true},"application/vnd.palm":{"source":"iana","extensions":["pdb","pqa","oprc"]},"application/vnd.panoply":{"source":"iana"},"application/vnd.paos.xml":{"source":"iana"},"application/vnd.patentdive":{"source":"iana"},"application/vnd.patientecommsdoc":{"source":"iana"},"application/vnd.pawaafile":{"source":"iana","extensions":["paw"]},"application/vnd.pcos":{"source":"iana"},"application/vnd.pg.format":{"source":"iana","extensions":["str"]},"application/vnd.pg.osasli":{"source":"iana","extensions":["ei6"]},"application/vnd.piaccess.application-licence":{"source":"iana"},"application/vnd.picsel":{"source":"iana","extensions":["efif"]},"application/vnd.pmi.widget":{"source":"iana","extensions":["wg"]},"application/vnd.poc.group-advertisement+xml":{"source":"iana","compressible":true},"application/vnd.pocketlearn":{"source":"iana","extensions":["plf"]},"application/vnd.powerbuilder6":{"source":"iana","extensions":["pbd"]},"application/vnd.powerbuilder6-s":{"source":"iana"},"application/vnd.powerbuilder7":{"source":"iana"},"application/vnd.powerbuilder7-s":{"source":"iana"},"application/vnd.powerbuilder75":{"source":"iana"},"application/vnd.powerbuilder75-s":{"source":"iana"},"application/vnd.preminet":{"source":"iana"},"application/vnd.previewsystems.box":{"source":"iana","extensions":["box"]},"application/vnd.proteus.magazine":{"source":"iana","extensions":["mgz"]},"application/vnd.psfs":{"source":"iana"},"application/vnd.publishare-delta-tree":{"source":"iana","extensions":["qps"]},"application/vnd.pvi.ptid1":{"source":"iana","extensions":["ptid"]},"application/vnd.pwg-multiplexed":{"source":"iana"},"application/vnd.pwg-xhtml-print+xml":{"source":"iana","compressible":true},"application/vnd.qualcomm.brew-app-res":{"source":"iana"},"application/vnd.quarantainenet":{"source":"iana"},"application/vnd.quark.quarkxpress":{"source":"iana","extensions":["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{"source":"iana"},"application/vnd.radisys.moml+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-conf+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-conn+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-dialog+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-stream+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-conf+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-base+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-fax-detect+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-group+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-speech+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-transform+xml":{"source":"iana","compressible":true},"application/vnd.rainstor.data":{"source":"iana"},"application/vnd.rapid":{"source":"iana"},"application/vnd.rar":{"source":"iana","extensions":["rar"]},"application/vnd.realvnc.bed":{"source":"iana","extensions":["bed"]},"application/vnd.recordare.musicxml":{"source":"iana","extensions":["mxl"]},"application/vnd.recordare.musicxml+xml":{"source":"iana","compressible":true,"extensions":["musicxml"]},"application/vnd.renlearn.rlprint":{"source":"iana"},"application/vnd.restful+json":{"source":"iana","compressible":true},"application/vnd.rig.cryptonote":{"source":"iana","extensions":["cryptonote"]},"application/vnd.rim.cod":{"source":"apache","extensions":["cod"]},"application/vnd.rn-realmedia":{"source":"apache","extensions":["rm"]},"application/vnd.rn-realmedia-vbr":{"source":"apache","extensions":["rmvb"]},"application/vnd.route66.link66+xml":{"source":"iana","compressible":true,"extensions":["link66"]},"application/vnd.rs-274x":{"source":"iana"},"application/vnd.ruckus.download":{"source":"iana"},"application/vnd.s3sms":{"source":"iana"},"application/vnd.sailingtracker.track":{"source":"iana","extensions":["st"]},"application/vnd.sar":{"source":"iana"},"application/vnd.sbm.cid":{"source":"iana"},"application/vnd.sbm.mid2":{"source":"iana"},"application/vnd.scribus":{"source":"iana"},"application/vnd.sealed.3df":{"source":"iana"},"application/vnd.sealed.csf":{"source":"iana"},"application/vnd.sealed.doc":{"source":"iana"},"application/vnd.sealed.eml":{"source":"iana"},"application/vnd.sealed.mht":{"source":"iana"},"application/vnd.sealed.net":{"source":"iana"},"application/vnd.sealed.ppt":{"source":"iana"},"application/vnd.sealed.tiff":{"source":"iana"},"application/vnd.sealed.xls":{"source":"iana"},"application/vnd.sealedmedia.softseal.html":{"source":"iana"},"application/vnd.sealedmedia.softseal.pdf":{"source":"iana"},"application/vnd.seemail":{"source":"iana","extensions":["see"]},"application/vnd.seis+json":{"source":"iana","compressible":true},"application/vnd.sema":{"source":"iana","extensions":["sema"]},"application/vnd.semd":{"source":"iana","extensions":["semd"]},"application/vnd.semf":{"source":"iana","extensions":["semf"]},"application/vnd.shade-save-file":{"source":"iana"},"application/vnd.shana.informed.formdata":{"source":"iana","extensions":["ifm"]},"application/vnd.shana.informed.formtemplate":{"source":"iana","extensions":["itp"]},"application/vnd.shana.informed.interchange":{"source":"iana","extensions":["iif"]},"application/vnd.shana.informed.package":{"source":"iana","extensions":["ipk"]},"application/vnd.shootproof+json":{"source":"iana","compressible":true},"application/vnd.shopkick+json":{"source":"iana","compressible":true},"application/vnd.shp":{"source":"iana"},"application/vnd.shx":{"source":"iana"},"application/vnd.sigrok.session":{"source":"iana"},"application/vnd.simtech-mindmapper":{"source":"iana","extensions":["twd","twds"]},"application/vnd.siren+json":{"source":"iana","compressible":true},"application/vnd.smaf":{"source":"iana","extensions":["mmf"]},"application/vnd.smart.notebook":{"source":"iana"},"application/vnd.smart.teacher":{"source":"iana","extensions":["teacher"]},"application/vnd.snesdev-page-table":{"source":"iana"},"application/vnd.software602.filler.form+xml":{"source":"iana","compressible":true,"extensions":["fo"]},"application/vnd.software602.filler.form-xml-zip":{"source":"iana"},"application/vnd.solent.sdkm+xml":{"source":"iana","compressible":true,"extensions":["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{"source":"iana","extensions":["dxp"]},"application/vnd.spotfire.sfs":{"source":"iana","extensions":["sfs"]},"application/vnd.sqlite3":{"source":"iana"},"application/vnd.sss-cod":{"source":"iana"},"application/vnd.sss-dtf":{"source":"iana"},"application/vnd.sss-ntf":{"source":"iana"},"application/vnd.stardivision.calc":{"source":"apache","extensions":["sdc"]},"application/vnd.stardivision.draw":{"source":"apache","extensions":["sda"]},"application/vnd.stardivision.impress":{"source":"apache","extensions":["sdd"]},"application/vnd.stardivision.math":{"source":"apache","extensions":["smf"]},"application/vnd.stardivision.writer":{"source":"apache","extensions":["sdw","vor"]},"application/vnd.stardivision.writer-global":{"source":"apache","extensions":["sgl"]},"application/vnd.stepmania.package":{"source":"iana","extensions":["smzip"]},"application/vnd.stepmania.stepchart":{"source":"iana","extensions":["sm"]},"application/vnd.street-stream":{"source":"iana"},"application/vnd.sun.wadl+xml":{"source":"iana","compressible":true,"extensions":["wadl"]},"application/vnd.sun.xml.calc":{"source":"apache","extensions":["sxc"]},"application/vnd.sun.xml.calc.template":{"source":"apache","extensions":["stc"]},"application/vnd.sun.xml.draw":{"source":"apache","extensions":["sxd"]},"application/vnd.sun.xml.draw.template":{"source":"apache","extensions":["std"]},"application/vnd.sun.xml.impress":{"source":"apache","extensions":["sxi"]},"application/vnd.sun.xml.impress.template":{"source":"apache","extensions":["sti"]},"application/vnd.sun.xml.math":{"source":"apache","extensions":["sxm"]},"application/vnd.sun.xml.writer":{"source":"apache","extensions":["sxw"]},"application/vnd.sun.xml.writer.global":{"source":"apache","extensions":["sxg"]},"application/vnd.sun.xml.writer.template":{"source":"apache","extensions":["stw"]},"application/vnd.sus-calendar":{"source":"iana","extensions":["sus","susp"]},"application/vnd.svd":{"source":"iana","extensions":["svd"]},"application/vnd.swiftview-ics":{"source":"iana"},"application/vnd.sycle+xml":{"source":"iana","compressible":true},"application/vnd.symbian.install":{"source":"apache","extensions":["sis","sisx"]},"application/vnd.syncml+xml":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["xsm"]},"application/vnd.syncml.dm+wbxml":{"source":"iana","charset":"UTF-8","extensions":["bdm"]},"application/vnd.syncml.dm+xml":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["xdm"]},"application/vnd.syncml.dm.notification":{"source":"iana"},"application/vnd.syncml.dmddf+wbxml":{"source":"iana"},"application/vnd.syncml.dmddf+xml":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{"source":"iana"},"application/vnd.syncml.dmtnds+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.syncml.ds.notification":{"source":"iana"},"application/vnd.tableschema+json":{"source":"iana","compressible":true},"application/vnd.tao.intent-module-archive":{"source":"iana","extensions":["tao"]},"application/vnd.tcpdump.pcap":{"source":"iana","extensions":["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{"source":"iana","compressible":true},"application/vnd.tmd.mediaflex.api+xml":{"source":"iana","compressible":true},"application/vnd.tml":{"source":"iana"},"application/vnd.tmobile-livetv":{"source":"iana","extensions":["tmo"]},"application/vnd.tri.onesource":{"source":"iana"},"application/vnd.trid.tpt":{"source":"iana","extensions":["tpt"]},"application/vnd.triscape.mxs":{"source":"iana","extensions":["mxs"]},"application/vnd.trueapp":{"source":"iana","extensions":["tra"]},"application/vnd.truedoc":{"source":"iana"},"application/vnd.ubisoft.webplayer":{"source":"iana"},"application/vnd.ufdl":{"source":"iana","extensions":["ufd","ufdl"]},"application/vnd.uiq.theme":{"source":"iana","extensions":["utz"]},"application/vnd.umajin":{"source":"iana","extensions":["umj"]},"application/vnd.unity":{"source":"iana","extensions":["unityweb"]},"application/vnd.uoml+xml":{"source":"iana","compressible":true,"extensions":["uoml"]},"application/vnd.uplanet.alert":{"source":"iana"},"application/vnd.uplanet.alert-wbxml":{"source":"iana"},"application/vnd.uplanet.bearer-choice":{"source":"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{"source":"iana"},"application/vnd.uplanet.cacheop":{"source":"iana"},"application/vnd.uplanet.cacheop-wbxml":{"source":"iana"},"application/vnd.uplanet.channel":{"source":"iana"},"application/vnd.uplanet.channel-wbxml":{"source":"iana"},"application/vnd.uplanet.list":{"source":"iana"},"application/vnd.uplanet.list-wbxml":{"source":"iana"},"application/vnd.uplanet.listcmd":{"source":"iana"},"application/vnd.uplanet.listcmd-wbxml":{"source":"iana"},"application/vnd.uplanet.signal":{"source":"iana"},"application/vnd.uri-map":{"source":"iana"},"application/vnd.valve.source.material":{"source":"iana"},"application/vnd.vcx":{"source":"iana","extensions":["vcx"]},"application/vnd.vd-study":{"source":"iana"},"application/vnd.vectorworks":{"source":"iana"},"application/vnd.vel+json":{"source":"iana","compressible":true},"application/vnd.verimatrix.vcas":{"source":"iana"},"application/vnd.veryant.thin":{"source":"iana"},"application/vnd.ves.encrypted":{"source":"iana"},"application/vnd.vidsoft.vidconference":{"source":"iana"},"application/vnd.visio":{"source":"iana","extensions":["vsd","vst","vss","vsw"]},"application/vnd.visionary":{"source":"iana","extensions":["vis"]},"application/vnd.vividence.scriptfile":{"source":"iana"},"application/vnd.vsf":{"source":"iana","extensions":["vsf"]},"application/vnd.wap.sic":{"source":"iana"},"application/vnd.wap.slc":{"source":"iana"},"application/vnd.wap.wbxml":{"source":"iana","charset":"UTF-8","extensions":["wbxml"]},"application/vnd.wap.wmlc":{"source":"iana","extensions":["wmlc"]},"application/vnd.wap.wmlscriptc":{"source":"iana","extensions":["wmlsc"]},"application/vnd.webturbo":{"source":"iana","extensions":["wtb"]},"application/vnd.wfa.dpp":{"source":"iana"},"application/vnd.wfa.p2p":{"source":"iana"},"application/vnd.wfa.wsc":{"source":"iana"},"application/vnd.windows.devicepairing":{"source":"iana"},"application/vnd.wmc":{"source":"iana"},"application/vnd.wmf.bootstrap":{"source":"iana"},"application/vnd.wolfram.mathematica":{"source":"iana"},"application/vnd.wolfram.mathematica.package":{"source":"iana"},"application/vnd.wolfram.player":{"source":"iana","extensions":["nbp"]},"application/vnd.wordperfect":{"source":"iana","extensions":["wpd"]},"application/vnd.wqd":{"source":"iana","extensions":["wqd"]},"application/vnd.wrq-hp3000-labelled":{"source":"iana"},"application/vnd.wt.stf":{"source":"iana","extensions":["stf"]},"application/vnd.wv.csp+wbxml":{"source":"iana"},"application/vnd.wv.csp+xml":{"source":"iana","compressible":true},"application/vnd.wv.ssp+xml":{"source":"iana","compressible":true},"application/vnd.xacml+json":{"source":"iana","compressible":true},"application/vnd.xara":{"source":"iana","extensions":["xar"]},"application/vnd.xfdl":{"source":"iana","extensions":["xfdl"]},"application/vnd.xfdl.webform":{"source":"iana"},"application/vnd.xmi+xml":{"source":"iana","compressible":true},"application/vnd.xmpie.cpkg":{"source":"iana"},"application/vnd.xmpie.dpkg":{"source":"iana"},"application/vnd.xmpie.plan":{"source":"iana"},"application/vnd.xmpie.ppkg":{"source":"iana"},"application/vnd.xmpie.xlim":{"source":"iana"},"application/vnd.yamaha.hv-dic":{"source":"iana","extensions":["hvd"]},"application/vnd.yamaha.hv-script":{"source":"iana","extensions":["hvs"]},"application/vnd.yamaha.hv-voice":{"source":"iana","extensions":["hvp"]},"application/vnd.yamaha.openscoreformat":{"source":"iana","extensions":["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{"source":"iana","compressible":true,"extensions":["osfpvg"]},"application/vnd.yamaha.remote-setup":{"source":"iana"},"application/vnd.yamaha.smaf-audio":{"source":"iana","extensions":["saf"]},"application/vnd.yamaha.smaf-phrase":{"source":"iana","extensions":["spf"]},"application/vnd.yamaha.through-ngn":{"source":"iana"},"application/vnd.yamaha.tunnel-udpencap":{"source":"iana"},"application/vnd.yaoweme":{"source":"iana"},"application/vnd.yellowriver-custom-menu":{"source":"iana","extensions":["cmp"]},"application/vnd.youtube.yt":{"source":"iana"},"application/vnd.zul":{"source":"iana","extensions":["zir","zirz"]},"application/vnd.zzazz.deck+xml":{"source":"iana","compressible":true,"extensions":["zaz"]},"application/voicexml+xml":{"source":"iana","compressible":true,"extensions":["vxml"]},"application/voucher-cms+json":{"source":"iana","compressible":true},"application/vq-rtcpxr":{"source":"iana"},"application/wasm":{"compressible":true,"extensions":["wasm"]},"application/watcherinfo+xml":{"source":"iana","compressible":true},"application/webpush-options+json":{"source":"iana","compressible":true},"application/whoispp-query":{"source":"iana"},"application/whoispp-response":{"source":"iana"},"application/widget":{"source":"iana","extensions":["wgt"]},"application/winhlp":{"source":"apache","extensions":["hlp"]},"application/wita":{"source":"iana"},"application/wordperfect5.1":{"source":"iana"},"application/wsdl+xml":{"source":"iana","compressible":true,"extensions":["wsdl"]},"application/wspolicy+xml":{"source":"iana","compressible":true,"extensions":["wspolicy"]},"application/x-7z-compressed":{"source":"apache","compressible":false,"extensions":["7z"]},"application/x-abiword":{"source":"apache","extensions":["abw"]},"application/x-ace-compressed":{"source":"apache","extensions":["ace"]},"application/x-amf":{"source":"apache"},"application/x-apple-diskimage":{"source":"apache","extensions":["dmg"]},"application/x-arj":{"compressible":false,"extensions":["arj"]},"application/x-authorware-bin":{"source":"apache","extensions":["aab","x32","u32","vox"]},"application/x-authorware-map":{"source":"apache","extensions":["aam"]},"application/x-authorware-seg":{"source":"apache","extensions":["aas"]},"application/x-bcpio":{"source":"apache","extensions":["bcpio"]},"application/x-bdoc":{"compressible":false,"extensions":["bdoc"]},"application/x-bittorrent":{"source":"apache","extensions":["torrent"]},"application/x-blorb":{"source":"apache","extensions":["blb","blorb"]},"application/x-bzip":{"source":"apache","compressible":false,"extensions":["bz"]},"application/x-bzip2":{"source":"apache","compressible":false,"extensions":["bz2","boz"]},"application/x-cbr":{"source":"apache","extensions":["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{"source":"apache","extensions":["vcd"]},"application/x-cfs-compressed":{"source":"apache","extensions":["cfs"]},"application/x-chat":{"source":"apache","extensions":["chat"]},"application/x-chess-pgn":{"source":"apache","extensions":["pgn"]},"application/x-chrome-extension":{"extensions":["crx"]},"application/x-cocoa":{"source":"nginx","extensions":["cco"]},"application/x-compress":{"source":"apache"},"application/x-conference":{"source":"apache","extensions":["nsc"]},"application/x-cpio":{"source":"apache","extensions":["cpio"]},"application/x-csh":{"source":"apache","extensions":["csh"]},"application/x-deb":{"compressible":false},"application/x-debian-package":{"source":"apache","extensions":["deb","udeb"]},"application/x-dgc-compressed":{"source":"apache","extensions":["dgc"]},"application/x-director":{"source":"apache","extensions":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{"source":"apache","extensions":["wad"]},"application/x-dtbncx+xml":{"source":"apache","compressible":true,"extensions":["ncx"]},"application/x-dtbook+xml":{"source":"apache","compressible":true,"extensions":["dtb"]},"application/x-dtbresource+xml":{"source":"apache","compressible":true,"extensions":["res"]},"application/x-dvi":{"source":"apache","compressible":false,"extensions":["dvi"]},"application/x-envoy":{"source":"apache","extensions":["evy"]},"application/x-eva":{"source":"apache","extensions":["eva"]},"application/x-font-bdf":{"source":"apache","extensions":["bdf"]},"application/x-font-dos":{"source":"apache"},"application/x-font-framemaker":{"source":"apache"},"application/x-font-ghostscript":{"source":"apache","extensions":["gsf"]},"application/x-font-libgrx":{"source":"apache"},"application/x-font-linux-psf":{"source":"apache","extensions":["psf"]},"application/x-font-pcf":{"source":"apache","extensions":["pcf"]},"application/x-font-snf":{"source":"apache","extensions":["snf"]},"application/x-font-speedo":{"source":"apache"},"application/x-font-sunos-news":{"source":"apache"},"application/x-font-type1":{"source":"apache","extensions":["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{"source":"apache"},"application/x-freearc":{"source":"apache","extensions":["arc"]},"application/x-futuresplash":{"source":"apache","extensions":["spl"]},"application/x-gca-compressed":{"source":"apache","extensions":["gca"]},"application/x-glulx":{"source":"apache","extensions":["ulx"]},"application/x-gnumeric":{"source":"apache","extensions":["gnumeric"]},"application/x-gramps-xml":{"source":"apache","extensions":["gramps"]},"application/x-gtar":{"source":"apache","extensions":["gtar"]},"application/x-gzip":{"source":"apache"},"application/x-hdf":{"source":"apache","extensions":["hdf"]},"application/x-httpd-php":{"compressible":true,"extensions":["php"]},"application/x-install-instructions":{"source":"apache","extensions":["install"]},"application/x-iso9660-image":{"source":"apache","extensions":["iso"]},"application/x-java-archive-diff":{"source":"nginx","extensions":["jardiff"]},"application/x-java-jnlp-file":{"source":"apache","compressible":false,"extensions":["jnlp"]},"application/x-javascript":{"compressible":true},"application/x-keepass2":{"extensions":["kdbx"]},"application/x-latex":{"source":"apache","compressible":false,"extensions":["latex"]},"application/x-lua-bytecode":{"extensions":["luac"]},"application/x-lzh-compressed":{"source":"apache","extensions":["lzh","lha"]},"application/x-makeself":{"source":"nginx","extensions":["run"]},"application/x-mie":{"source":"apache","extensions":["mie"]},"application/x-mobipocket-ebook":{"source":"apache","extensions":["prc","mobi"]},"application/x-mpegurl":{"compressible":false},"application/x-ms-application":{"source":"apache","extensions":["application"]},"application/x-ms-shortcut":{"source":"apache","extensions":["lnk"]},"application/x-ms-wmd":{"source":"apache","extensions":["wmd"]},"application/x-ms-wmz":{"source":"apache","extensions":["wmz"]},"application/x-ms-xbap":{"source":"apache","extensions":["xbap"]},"application/x-msaccess":{"source":"apache","extensions":["mdb"]},"application/x-msbinder":{"source":"apache","extensions":["obd"]},"application/x-mscardfile":{"source":"apache","extensions":["crd"]},"application/x-msclip":{"source":"apache","extensions":["clp"]},"application/x-msdos-program":{"extensions":["exe"]},"application/x-msdownload":{"source":"apache","extensions":["exe","dll","com","bat","msi"]},"application/x-msmediaview":{"source":"apache","extensions":["mvb","m13","m14"]},"application/x-msmetafile":{"source":"apache","extensions":["wmf","wmz","emf","emz"]},"application/x-msmoney":{"source":"apache","extensions":["mny"]},"application/x-mspublisher":{"source":"apache","extensions":["pub"]},"application/x-msschedule":{"source":"apache","extensions":["scd"]},"application/x-msterminal":{"source":"apache","extensions":["trm"]},"application/x-mswrite":{"source":"apache","extensions":["wri"]},"application/x-netcdf":{"source":"apache","extensions":["nc","cdf"]},"application/x-ns-proxy-autoconfig":{"compressible":true,"extensions":["pac"]},"application/x-nzb":{"source":"apache","extensions":["nzb"]},"application/x-perl":{"source":"nginx","extensions":["pl","pm"]},"application/x-pilot":{"source":"nginx","extensions":["prc","pdb"]},"application/x-pkcs12":{"source":"apache","compressible":false,"extensions":["p12","pfx"]},"application/x-pkcs7-certificates":{"source":"apache","extensions":["p7b","spc"]},"application/x-pkcs7-certreqresp":{"source":"apache","extensions":["p7r"]},"application/x-pki-message":{"source":"iana"},"application/x-rar-compressed":{"source":"apache","compressible":false,"extensions":["rar"]},"application/x-redhat-package-manager":{"source":"nginx","extensions":["rpm"]},"application/x-research-info-systems":{"source":"apache","extensions":["ris"]},"application/x-sea":{"source":"nginx","extensions":["sea"]},"application/x-sh":{"source":"apache","compressible":true,"extensions":["sh"]},"application/x-shar":{"source":"apache","extensions":["shar"]},"application/x-shockwave-flash":{"source":"apache","compressible":false,"extensions":["swf"]},"application/x-silverlight-app":{"source":"apache","extensions":["xap"]},"application/x-sql":{"source":"apache","extensions":["sql"]},"application/x-stuffit":{"source":"apache","compressible":false,"extensions":["sit"]},"application/x-stuffitx":{"source":"apache","extensions":["sitx"]},"application/x-subrip":{"source":"apache","extensions":["srt"]},"application/x-sv4cpio":{"source":"apache","extensions":["sv4cpio"]},"application/x-sv4crc":{"source":"apache","extensions":["sv4crc"]},"application/x-t3vm-image":{"source":"apache","extensions":["t3"]},"application/x-tads":{"source":"apache","extensions":["gam"]},"application/x-tar":{"source":"apache","compressible":true,"extensions":["tar"]},"application/x-tcl":{"source":"apache","extensions":["tcl","tk"]},"application/x-tex":{"source":"apache","extensions":["tex"]},"application/x-tex-tfm":{"source":"apache","extensions":["tfm"]},"application/x-texinfo":{"source":"apache","extensions":["texinfo","texi"]},"application/x-tgif":{"source":"apache","extensions":["obj"]},"application/x-ustar":{"source":"apache","extensions":["ustar"]},"application/x-virtualbox-hdd":{"compressible":true,"extensions":["hdd"]},"application/x-virtualbox-ova":{"compressible":true,"extensions":["ova"]},"application/x-virtualbox-ovf":{"compressible":true,"extensions":["ovf"]},"application/x-virtualbox-vbox":{"compressible":true,"extensions":["vbox"]},"application/x-virtualbox-vbox-extpack":{"compressible":false,"extensions":["vbox-extpack"]},"application/x-virtualbox-vdi":{"compressible":true,"extensions":["vdi"]},"application/x-virtualbox-vhd":{"compressible":true,"extensions":["vhd"]},"application/x-virtualbox-vmdk":{"compressible":true,"extensions":["vmdk"]},"application/x-wais-source":{"source":"apache","extensions":["src"]},"application/x-web-app-manifest+json":{"compressible":true,"extensions":["webapp"]},"application/x-www-form-urlencoded":{"source":"iana","compressible":true},"application/x-x509-ca-cert":{"source":"iana","extensions":["der","crt","pem"]},"application/x-x509-ca-ra-cert":{"source":"iana"},"application/x-x509-next-ca-cert":{"source":"iana"},"application/x-xfig":{"source":"apache","extensions":["fig"]},"application/x-xliff+xml":{"source":"apache","compressible":true,"extensions":["xlf"]},"application/x-xpinstall":{"source":"apache","compressible":false,"extensions":["xpi"]},"application/x-xz":{"source":"apache","extensions":["xz"]},"application/x-zmachine":{"source":"apache","extensions":["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{"source":"iana"},"application/xacml+xml":{"source":"iana","compressible":true},"application/xaml+xml":{"source":"apache","compressible":true,"extensions":["xaml"]},"application/xcap-att+xml":{"source":"iana","compressible":true,"extensions":["xav"]},"application/xcap-caps+xml":{"source":"iana","compressible":true,"extensions":["xca"]},"application/xcap-diff+xml":{"source":"iana","compressible":true,"extensions":["xdf"]},"application/xcap-el+xml":{"source":"iana","compressible":true,"extensions":["xel"]},"application/xcap-error+xml":{"source":"iana","compressible":true},"application/xcap-ns+xml":{"source":"iana","compressible":true,"extensions":["xns"]},"application/xcon-conference-info+xml":{"source":"iana","compressible":true},"application/xcon-conference-info-diff+xml":{"source":"iana","compressible":true},"application/xenc+xml":{"source":"iana","compressible":true,"extensions":["xenc"]},"application/xhtml+xml":{"source":"iana","compressible":true,"extensions":["xhtml","xht"]},"application/xhtml-voice+xml":{"source":"apache","compressible":true},"application/xliff+xml":{"source":"iana","compressible":true,"extensions":["xlf"]},"application/xml":{"source":"iana","compressible":true,"extensions":["xml","xsl","xsd","rng"]},"application/xml-dtd":{"source":"iana","compressible":true,"extensions":["dtd"]},"application/xml-external-parsed-entity":{"source":"iana"},"application/xml-patch+xml":{"source":"iana","compressible":true},"application/xmpp+xml":{"source":"iana","compressible":true},"application/xop+xml":{"source":"iana","compressible":true,"extensions":["xop"]},"application/xproc+xml":{"source":"apache","compressible":true,"extensions":["xpl"]},"application/xslt+xml":{"source":"iana","compressible":true,"extensions":["xsl","xslt"]},"application/xspf+xml":{"source":"apache","compressible":true,"extensions":["xspf"]},"application/xv+xml":{"source":"iana","compressible":true,"extensions":["mxml","xhvml","xvml","xvm"]},"application/yang":{"source":"iana","extensions":["yang"]},"application/yang-data+json":{"source":"iana","compressible":true},"application/yang-data+xml":{"source":"iana","compressible":true},"application/yang-patch+json":{"source":"iana","compressible":true},"application/yang-patch+xml":{"source":"iana","compressible":true},"application/yin+xml":{"source":"iana","compressible":true,"extensions":["yin"]},"application/zip":{"source":"iana","compressible":false,"extensions":["zip"]},"application/zlib":{"source":"iana"},"application/zstd":{"source":"iana"},"audio/1d-interleaved-parityfec":{"source":"iana"},"audio/32kadpcm":{"source":"iana"},"audio/3gpp":{"source":"iana","compressible":false,"extensions":["3gpp"]},"audio/3gpp2":{"source":"iana"},"audio/aac":{"source":"iana"},"audio/ac3":{"source":"iana"},"audio/adpcm":{"source":"apache","extensions":["adp"]},"audio/amr":{"source":"iana","extensions":["amr"]},"audio/amr-wb":{"source":"iana"},"audio/amr-wb+":{"source":"iana"},"audio/aptx":{"source":"iana"},"audio/asc":{"source":"iana"},"audio/atrac-advanced-lossless":{"source":"iana"},"audio/atrac-x":{"source":"iana"},"audio/atrac3":{"source":"iana"},"audio/basic":{"source":"iana","compressible":false,"extensions":["au","snd"]},"audio/bv16":{"source":"iana"},"audio/bv32":{"source":"iana"},"audio/clearmode":{"source":"iana"},"audio/cn":{"source":"iana"},"audio/dat12":{"source":"iana"},"audio/dls":{"source":"iana"},"audio/dsr-es201108":{"source":"iana"},"audio/dsr-es202050":{"source":"iana"},"audio/dsr-es202211":{"source":"iana"},"audio/dsr-es202212":{"source":"iana"},"audio/dv":{"source":"iana"},"audio/dvi4":{"source":"iana"},"audio/eac3":{"source":"iana"},"audio/encaprtp":{"source":"iana"},"audio/evrc":{"source":"iana"},"audio/evrc-qcp":{"source":"iana"},"audio/evrc0":{"source":"iana"},"audio/evrc1":{"source":"iana"},"audio/evrcb":{"source":"iana"},"audio/evrcb0":{"source":"iana"},"audio/evrcb1":{"source":"iana"},"audio/evrcnw":{"source":"iana"},"audio/evrcnw0":{"source":"iana"},"audio/evrcnw1":{"source":"iana"},"audio/evrcwb":{"source":"iana"},"audio/evrcwb0":{"source":"iana"},"audio/evrcwb1":{"source":"iana"},"audio/evs":{"source":"iana"},"audio/flexfec":{"source":"iana"},"audio/fwdred":{"source":"iana"},"audio/g711-0":{"source":"iana"},"audio/g719":{"source":"iana"},"audio/g722":{"source":"iana"},"audio/g7221":{"source":"iana"},"audio/g723":{"source":"iana"},"audio/g726-16":{"source":"iana"},"audio/g726-24":{"source":"iana"},"audio/g726-32":{"source":"iana"},"audio/g726-40":{"source":"iana"},"audio/g728":{"source":"iana"},"audio/g729":{"source":"iana"},"audio/g7291":{"source":"iana"},"audio/g729d":{"source":"iana"},"audio/g729e":{"source":"iana"},"audio/gsm":{"source":"iana"},"audio/gsm-efr":{"source":"iana"},"audio/gsm-hr-08":{"source":"iana"},"audio/ilbc":{"source":"iana"},"audio/ip-mr_v2.5":{"source":"iana"},"audio/isac":{"source":"apache"},"audio/l16":{"source":"iana"},"audio/l20":{"source":"iana"},"audio/l24":{"source":"iana","compressible":false},"audio/l8":{"source":"iana"},"audio/lpc":{"source":"iana"},"audio/melp":{"source":"iana"},"audio/melp1200":{"source":"iana"},"audio/melp2400":{"source":"iana"},"audio/melp600":{"source":"iana"},"audio/mhas":{"source":"iana"},"audio/midi":{"source":"apache","extensions":["mid","midi","kar","rmi"]},"audio/mobile-xmf":{"source":"iana","extensions":["mxmf"]},"audio/mp3":{"compressible":false,"extensions":["mp3"]},"audio/mp4":{"source":"iana","compressible":false,"extensions":["m4a","mp4a"]},"audio/mp4a-latm":{"source":"iana"},"audio/mpa":{"source":"iana"},"audio/mpa-robust":{"source":"iana"},"audio/mpeg":{"source":"iana","compressible":false,"extensions":["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{"source":"iana"},"audio/musepack":{"source":"apache"},"audio/ogg":{"source":"iana","compressible":false,"extensions":["oga","ogg","spx","opus"]},"audio/opus":{"source":"iana"},"audio/parityfec":{"source":"iana"},"audio/pcma":{"source":"iana"},"audio/pcma-wb":{"source":"iana"},"audio/pcmu":{"source":"iana"},"audio/pcmu-wb":{"source":"iana"},"audio/prs.sid":{"source":"iana"},"audio/qcelp":{"source":"iana"},"audio/raptorfec":{"source":"iana"},"audio/red":{"source":"iana"},"audio/rtp-enc-aescm128":{"source":"iana"},"audio/rtp-midi":{"source":"iana"},"audio/rtploopback":{"source":"iana"},"audio/rtx":{"source":"iana"},"audio/s3m":{"source":"apache","extensions":["s3m"]},"audio/scip":{"source":"iana"},"audio/silk":{"source":"apache","extensions":["sil"]},"audio/smv":{"source":"iana"},"audio/smv-qcp":{"source":"iana"},"audio/smv0":{"source":"iana"},"audio/sofa":{"source":"iana"},"audio/sp-midi":{"source":"iana"},"audio/speex":{"source":"iana"},"audio/t140c":{"source":"iana"},"audio/t38":{"source":"iana"},"audio/telephone-event":{"source":"iana"},"audio/tetra_acelp":{"source":"iana"},"audio/tetra_acelp_bb":{"source":"iana"},"audio/tone":{"source":"iana"},"audio/tsvcis":{"source":"iana"},"audio/uemclip":{"source":"iana"},"audio/ulpfec":{"source":"iana"},"audio/usac":{"source":"iana"},"audio/vdvi":{"source":"iana"},"audio/vmr-wb":{"source":"iana"},"audio/vnd.3gpp.iufp":{"source":"iana"},"audio/vnd.4sb":{"source":"iana"},"audio/vnd.audiokoz":{"source":"iana"},"audio/vnd.celp":{"source":"iana"},"audio/vnd.cisco.nse":{"source":"iana"},"audio/vnd.cmles.radio-events":{"source":"iana"},"audio/vnd.cns.anp1":{"source":"iana"},"audio/vnd.cns.inf1":{"source":"iana"},"audio/vnd.dece.audio":{"source":"iana","extensions":["uva","uvva"]},"audio/vnd.digital-winds":{"source":"iana","extensions":["eol"]},"audio/vnd.dlna.adts":{"source":"iana"},"audio/vnd.dolby.heaac.1":{"source":"iana"},"audio/vnd.dolby.heaac.2":{"source":"iana"},"audio/vnd.dolby.mlp":{"source":"iana"},"audio/vnd.dolby.mps":{"source":"iana"},"audio/vnd.dolby.pl2":{"source":"iana"},"audio/vnd.dolby.pl2x":{"source":"iana"},"audio/vnd.dolby.pl2z":{"source":"iana"},"audio/vnd.dolby.pulse.1":{"source":"iana"},"audio/vnd.dra":{"source":"iana","extensions":["dra"]},"audio/vnd.dts":{"source":"iana","extensions":["dts"]},"audio/vnd.dts.hd":{"source":"iana","extensions":["dtshd"]},"audio/vnd.dts.uhd":{"source":"iana"},"audio/vnd.dvb.file":{"source":"iana"},"audio/vnd.everad.plj":{"source":"iana"},"audio/vnd.hns.audio":{"source":"iana"},"audio/vnd.lucent.voice":{"source":"iana","extensions":["lvp"]},"audio/vnd.ms-playready.media.pya":{"source":"iana","extensions":["pya"]},"audio/vnd.nokia.mobile-xmf":{"source":"iana"},"audio/vnd.nortel.vbk":{"source":"iana"},"audio/vnd.nuera.ecelp4800":{"source":"iana","extensions":["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{"source":"iana","extensions":["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{"source":"iana","extensions":["ecelp9600"]},"audio/vnd.octel.sbc":{"source":"iana"},"audio/vnd.presonus.multitrack":{"source":"iana"},"audio/vnd.qcelp":{"source":"iana"},"audio/vnd.rhetorex.32kadpcm":{"source":"iana"},"audio/vnd.rip":{"source":"iana","extensions":["rip"]},"audio/vnd.rn-realaudio":{"compressible":false},"audio/vnd.sealedmedia.softseal.mpeg":{"source":"iana"},"audio/vnd.vmx.cvsd":{"source":"iana"},"audio/vnd.wave":{"compressible":false},"audio/vorbis":{"source":"iana","compressible":false},"audio/vorbis-config":{"source":"iana"},"audio/wav":{"compressible":false,"extensions":["wav"]},"audio/wave":{"compressible":false,"extensions":["wav"]},"audio/webm":{"source":"apache","compressible":false,"extensions":["weba"]},"audio/x-aac":{"source":"apache","compressible":false,"extensions":["aac"]},"audio/x-aiff":{"source":"apache","extensions":["aif","aiff","aifc"]},"audio/x-caf":{"source":"apache","compressible":false,"extensions":["caf"]},"audio/x-flac":{"source":"apache","extensions":["flac"]},"audio/x-m4a":{"source":"nginx","extensions":["m4a"]},"audio/x-matroska":{"source":"apache","extensions":["mka"]},"audio/x-mpegurl":{"source":"apache","extensions":["m3u"]},"audio/x-ms-wax":{"source":"apache","extensions":["wax"]},"audio/x-ms-wma":{"source":"apache","extensions":["wma"]},"audio/x-pn-realaudio":{"source":"apache","extensions":["ram","ra"]},"audio/x-pn-realaudio-plugin":{"source":"apache","extensions":["rmp"]},"audio/x-realaudio":{"source":"nginx","extensions":["ra"]},"audio/x-tta":{"source":"apache"},"audio/x-wav":{"source":"apache","extensions":["wav"]},"audio/xm":{"source":"apache","extensions":["xm"]},"chemical/x-cdx":{"source":"apache","extensions":["cdx"]},"chemical/x-cif":{"source":"apache","extensions":["cif"]},"chemical/x-cmdf":{"source":"apache","extensions":["cmdf"]},"chemical/x-cml":{"source":"apache","extensions":["cml"]},"chemical/x-csml":{"source":"apache","extensions":["csml"]},"chemical/x-pdb":{"source":"apache"},"chemical/x-xyz":{"source":"apache","extensions":["xyz"]},"font/collection":{"source":"iana","extensions":["ttc"]},"font/otf":{"source":"iana","compressible":true,"extensions":["otf"]},"font/sfnt":{"source":"iana"},"font/ttf":{"source":"iana","compressible":true,"extensions":["ttf"]},"font/woff":{"source":"iana","extensions":["woff"]},"font/woff2":{"source":"iana","extensions":["woff2"]},"image/aces":{"source":"iana","extensions":["exr"]},"image/apng":{"compressible":false,"extensions":["apng"]},"image/avci":{"source":"iana"},"image/avcs":{"source":"iana"},"image/avif":{"source":"iana","compressible":false,"extensions":["avif"]},"image/bmp":{"source":"iana","compressible":true,"extensions":["bmp"]},"image/cgm":{"source":"iana","extensions":["cgm"]},"image/dicom-rle":{"source":"iana","extensions":["drle"]},"image/emf":{"source":"iana","extensions":["emf"]},"image/fits":{"source":"iana","extensions":["fits"]},"image/g3fax":{"source":"iana","extensions":["g3"]},"image/gif":{"source":"iana","compressible":false,"extensions":["gif"]},"image/heic":{"source":"iana","extensions":["heic"]},"image/heic-sequence":{"source":"iana","extensions":["heics"]},"image/heif":{"source":"iana","extensions":["heif"]},"image/heif-sequence":{"source":"iana","extensions":["heifs"]},"image/hej2k":{"source":"iana","extensions":["hej2"]},"image/hsj2":{"source":"iana","extensions":["hsj2"]},"image/ief":{"source":"iana","extensions":["ief"]},"image/jls":{"source":"iana","extensions":["jls"]},"image/jp2":{"source":"iana","compressible":false,"extensions":["jp2","jpg2"]},"image/jpeg":{"source":"iana","compressible":false,"extensions":["jpeg","jpg","jpe"]},"image/jph":{"source":"iana","extensions":["jph"]},"image/jphc":{"source":"iana","extensions":["jhc"]},"image/jpm":{"source":"iana","compressible":false,"extensions":["jpm"]},"image/jpx":{"source":"iana","compressible":false,"extensions":["jpx","jpf"]},"image/jxr":{"source":"iana","extensions":["jxr"]},"image/jxra":{"source":"iana","extensions":["jxra"]},"image/jxrs":{"source":"iana","extensions":["jxrs"]},"image/jxs":{"source":"iana","extensions":["jxs"]},"image/jxsc":{"source":"iana","extensions":["jxsc"]},"image/jxsi":{"source":"iana","extensions":["jxsi"]},"image/jxss":{"source":"iana","extensions":["jxss"]},"image/ktx":{"source":"iana","extensions":["ktx"]},"image/ktx2":{"source":"iana","extensions":["ktx2"]},"image/naplps":{"source":"iana"},"image/pjpeg":{"compressible":false},"image/png":{"source":"iana","compressible":false,"extensions":["png"]},"image/prs.btif":{"source":"iana","extensions":["btif"]},"image/prs.pti":{"source":"iana","extensions":["pti"]},"image/pwg-raster":{"source":"iana"},"image/sgi":{"source":"apache","extensions":["sgi"]},"image/svg+xml":{"source":"iana","compressible":true,"extensions":["svg","svgz"]},"image/t38":{"source":"iana","extensions":["t38"]},"image/tiff":{"source":"iana","compressible":false,"extensions":["tif","tiff"]},"image/tiff-fx":{"source":"iana","extensions":["tfx"]},"image/vnd.adobe.photoshop":{"source":"iana","compressible":true,"extensions":["psd"]},"image/vnd.airzip.accelerator.azv":{"source":"iana","extensions":["azv"]},"image/vnd.cns.inf2":{"source":"iana"},"image/vnd.dece.graphic":{"source":"iana","extensions":["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{"source":"iana","extensions":["djvu","djv"]},"image/vnd.dvb.subtitle":{"source":"iana","extensions":["sub"]},"image/vnd.dwg":{"source":"iana","extensions":["dwg"]},"image/vnd.dxf":{"source":"iana","extensions":["dxf"]},"image/vnd.fastbidsheet":{"source":"iana","extensions":["fbs"]},"image/vnd.fpx":{"source":"iana","extensions":["fpx"]},"image/vnd.fst":{"source":"iana","extensions":["fst"]},"image/vnd.fujixerox.edmics-mmr":{"source":"iana","extensions":["mmr"]},"image/vnd.fujixerox.edmics-rlc":{"source":"iana","extensions":["rlc"]},"image/vnd.globalgraphics.pgb":{"source":"iana"},"image/vnd.microsoft.icon":{"source":"iana","extensions":["ico"]},"image/vnd.mix":{"source":"iana"},"image/vnd.mozilla.apng":{"source":"iana"},"image/vnd.ms-dds":{"extensions":["dds"]},"image/vnd.ms-modi":{"source":"iana","extensions":["mdi"]},"image/vnd.ms-photo":{"source":"apache","extensions":["wdp"]},"image/vnd.net-fpx":{"source":"iana","extensions":["npx"]},"image/vnd.pco.b16":{"source":"iana","extensions":["b16"]},"image/vnd.radiance":{"source":"iana"},"image/vnd.sealed.png":{"source":"iana"},"image/vnd.sealedmedia.softseal.gif":{"source":"iana"},"image/vnd.sealedmedia.softseal.jpg":{"source":"iana"},"image/vnd.svf":{"source":"iana"},"image/vnd.tencent.tap":{"source":"iana","extensions":["tap"]},"image/vnd.valve.source.texture":{"source":"iana","extensions":["vtf"]},"image/vnd.wap.wbmp":{"source":"iana","extensions":["wbmp"]},"image/vnd.xiff":{"source":"iana","extensions":["xif"]},"image/vnd.zbrush.pcx":{"source":"iana","extensions":["pcx"]},"image/webp":{"source":"apache","extensions":["webp"]},"image/wmf":{"source":"iana","extensions":["wmf"]},"image/x-3ds":{"source":"apache","extensions":["3ds"]},"image/x-cmu-raster":{"source":"apache","extensions":["ras"]},"image/x-cmx":{"source":"apache","extensions":["cmx"]},"image/x-freehand":{"source":"apache","extensions":["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{"source":"apache","compressible":true,"extensions":["ico"]},"image/x-jng":{"source":"nginx","extensions":["jng"]},"image/x-mrsid-image":{"source":"apache","extensions":["sid"]},"image/x-ms-bmp":{"source":"nginx","compressible":true,"extensions":["bmp"]},"image/x-pcx":{"source":"apache","extensions":["pcx"]},"image/x-pict":{"source":"apache","extensions":["pic","pct"]},"image/x-portable-anymap":{"source":"apache","extensions":["pnm"]},"image/x-portable-bitmap":{"source":"apache","extensions":["pbm"]},"image/x-portable-graymap":{"source":"apache","extensions":["pgm"]},"image/x-portable-pixmap":{"source":"apache","extensions":["ppm"]},"image/x-rgb":{"source":"apache","extensions":["rgb"]},"image/x-tga":{"source":"apache","extensions":["tga"]},"image/x-xbitmap":{"source":"apache","extensions":["xbm"]},"image/x-xcf":{"compressible":false},"image/x-xpixmap":{"source":"apache","extensions":["xpm"]},"image/x-xwindowdump":{"source":"apache","extensions":["xwd"]},"message/cpim":{"source":"iana"},"message/delivery-status":{"source":"iana"},"message/disposition-notification":{"source":"iana","extensions":["disposition-notification"]},"message/external-body":{"source":"iana"},"message/feedback-report":{"source":"iana"},"message/global":{"source":"iana","extensions":["u8msg"]},"message/global-delivery-status":{"source":"iana","extensions":["u8dsn"]},"message/global-disposition-notification":{"source":"iana","extensions":["u8mdn"]},"message/global-headers":{"source":"iana","extensions":["u8hdr"]},"message/http":{"source":"iana","compressible":false},"message/imdn+xml":{"source":"iana","compressible":true},"message/news":{"source":"iana"},"message/partial":{"source":"iana","compressible":false},"message/rfc822":{"source":"iana","compressible":true,"extensions":["eml","mime"]},"message/s-http":{"source":"iana"},"message/sip":{"source":"iana"},"message/sipfrag":{"source":"iana"},"message/tracking-status":{"source":"iana"},"message/vnd.si.simp":{"source":"iana"},"message/vnd.wfa.wsc":{"source":"iana","extensions":["wsc"]},"model/3mf":{"source":"iana","extensions":["3mf"]},"model/e57":{"source":"iana"},"model/gltf+json":{"source":"iana","compressible":true,"extensions":["gltf"]},"model/gltf-binary":{"source":"iana","compressible":true,"extensions":["glb"]},"model/iges":{"source":"iana","compressible":false,"extensions":["igs","iges"]},"model/mesh":{"source":"iana","compressible":false,"extensions":["msh","mesh","silo"]},"model/mtl":{"source":"iana","extensions":["mtl"]},"model/obj":{"source":"iana","extensions":["obj"]},"model/stl":{"source":"iana","extensions":["stl"]},"model/vnd.collada+xml":{"source":"iana","compressible":true,"extensions":["dae"]},"model/vnd.dwf":{"source":"iana","extensions":["dwf"]},"model/vnd.flatland.3dml":{"source":"iana"},"model/vnd.gdl":{"source":"iana","extensions":["gdl"]},"model/vnd.gs-gdl":{"source":"apache"},"model/vnd.gs.gdl":{"source":"iana"},"model/vnd.gtw":{"source":"iana","extensions":["gtw"]},"model/vnd.moml+xml":{"source":"iana","compressible":true},"model/vnd.mts":{"source":"iana","extensions":["mts"]},"model/vnd.opengex":{"source":"iana","extensions":["ogex"]},"model/vnd.parasolid.transmit.binary":{"source":"iana","extensions":["x_b"]},"model/vnd.parasolid.transmit.text":{"source":"iana","extensions":["x_t"]},"model/vnd.rosette.annotated-data-model":{"source":"iana"},"model/vnd.sap.vds":{"source":"iana","extensions":["vds"]},"model/vnd.usdz+zip":{"source":"iana","compressible":false,"extensions":["usdz"]},"model/vnd.valve.source.compiled-map":{"source":"iana","extensions":["bsp"]},"model/vnd.vtu":{"source":"iana","extensions":["vtu"]},"model/vrml":{"source":"iana","compressible":false,"extensions":["wrl","vrml"]},"model/x3d+binary":{"source":"apache","compressible":false,"extensions":["x3db","x3dbz"]},"model/x3d+fastinfoset":{"source":"iana","extensions":["x3db"]},"model/x3d+vrml":{"source":"apache","compressible":false,"extensions":["x3dv","x3dvz"]},"model/x3d+xml":{"source":"iana","compressible":true,"extensions":["x3d","x3dz"]},"model/x3d-vrml":{"source":"iana","extensions":["x3dv"]},"multipart/alternative":{"source":"iana","compressible":false},"multipart/appledouble":{"source":"iana"},"multipart/byteranges":{"source":"iana"},"multipart/digest":{"source":"iana"},"multipart/encrypted":{"source":"iana","compressible":false},"multipart/form-data":{"source":"iana","compressible":false},"multipart/header-set":{"source":"iana"},"multipart/mixed":{"source":"iana"},"multipart/multilingual":{"source":"iana"},"multipart/parallel":{"source":"iana"},"multipart/related":{"source":"iana","compressible":false},"multipart/report":{"source":"iana"},"multipart/signed":{"source":"iana","compressible":false},"multipart/vnd.bint.med-plus":{"source":"iana"},"multipart/voice-message":{"source":"iana"},"multipart/x-mixed-replace":{"source":"iana"},"text/1d-interleaved-parityfec":{"source":"iana"},"text/cache-manifest":{"source":"iana","compressible":true,"extensions":["appcache","manifest"]},"text/calendar":{"source":"iana","extensions":["ics","ifb"]},"text/calender":{"compressible":true},"text/cmd":{"compressible":true},"text/coffeescript":{"extensions":["coffee","litcoffee"]},"text/cql":{"source":"iana"},"text/cql-expression":{"source":"iana"},"text/cql-identifier":{"source":"iana"},"text/css":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["css"]},"text/csv":{"source":"iana","compressible":true,"extensions":["csv"]},"text/csv-schema":{"source":"iana"},"text/directory":{"source":"iana"},"text/dns":{"source":"iana"},"text/ecmascript":{"source":"iana"},"text/encaprtp":{"source":"iana"},"text/enriched":{"source":"iana"},"text/fhirpath":{"source":"iana"},"text/flexfec":{"source":"iana"},"text/fwdred":{"source":"iana"},"text/gff3":{"source":"iana"},"text/grammar-ref-list":{"source":"iana"},"text/html":{"source":"iana","compressible":true,"extensions":["html","htm","shtml"]},"text/jade":{"extensions":["jade"]},"text/javascript":{"source":"iana","compressible":true},"text/jcr-cnd":{"source":"iana"},"text/jsx":{"compressible":true,"extensions":["jsx"]},"text/less":{"compressible":true,"extensions":["less"]},"text/markdown":{"source":"iana","compressible":true,"extensions":["markdown","md"]},"text/mathml":{"source":"nginx","extensions":["mml"]},"text/mdx":{"compressible":true,"extensions":["mdx"]},"text/mizar":{"source":"iana"},"text/n3":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["n3"]},"text/parameters":{"source":"iana","charset":"UTF-8"},"text/parityfec":{"source":"iana"},"text/plain":{"source":"iana","compressible":true,"extensions":["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{"source":"iana","charset":"UTF-8"},"text/prs.fallenstein.rst":{"source":"iana"},"text/prs.lines.tag":{"source":"iana","extensions":["dsc"]},"text/prs.prop.logic":{"source":"iana"},"text/raptorfec":{"source":"iana"},"text/red":{"source":"iana"},"text/rfc822-headers":{"source":"iana"},"text/richtext":{"source":"iana","compressible":true,"extensions":["rtx"]},"text/rtf":{"source":"iana","compressible":true,"extensions":["rtf"]},"text/rtp-enc-aescm128":{"source":"iana"},"text/rtploopback":{"source":"iana"},"text/rtx":{"source":"iana"},"text/sgml":{"source":"iana","extensions":["sgml","sgm"]},"text/shaclc":{"source":"iana"},"text/shex":{"extensions":["shex"]},"text/slim":{"extensions":["slim","slm"]},"text/spdx":{"source":"iana","extensions":["spdx"]},"text/strings":{"source":"iana"},"text/stylus":{"extensions":["stylus","styl"]},"text/t140":{"source":"iana"},"text/tab-separated-values":{"source":"iana","compressible":true,"extensions":["tsv"]},"text/troff":{"source":"iana","extensions":["t","tr","roff","man","me","ms"]},"text/turtle":{"source":"iana","charset":"UTF-8","extensions":["ttl"]},"text/ulpfec":{"source":"iana"},"text/uri-list":{"source":"iana","compressible":true,"extensions":["uri","uris","urls"]},"text/vcard":{"source":"iana","compressible":true,"extensions":["vcard"]},"text/vnd.a":{"source":"iana"},"text/vnd.abc":{"source":"iana"},"text/vnd.ascii-art":{"source":"iana"},"text/vnd.curl":{"source":"iana","extensions":["curl"]},"text/vnd.curl.dcurl":{"source":"apache","extensions":["dcurl"]},"text/vnd.curl.mcurl":{"source":"apache","extensions":["mcurl"]},"text/vnd.curl.scurl":{"source":"apache","extensions":["scurl"]},"text/vnd.debian.copyright":{"source":"iana","charset":"UTF-8"},"text/vnd.dmclientscript":{"source":"iana"},"text/vnd.dvb.subtitle":{"source":"iana","extensions":["sub"]},"text/vnd.esmertec.theme-descriptor":{"source":"iana","charset":"UTF-8"},"text/vnd.ficlab.flt":{"source":"iana"},"text/vnd.fly":{"source":"iana","extensions":["fly"]},"text/vnd.fmi.flexstor":{"source":"iana","extensions":["flx"]},"text/vnd.gml":{"source":"iana"},"text/vnd.graphviz":{"source":"iana","extensions":["gv"]},"text/vnd.hans":{"source":"iana"},"text/vnd.hgl":{"source":"iana"},"text/vnd.in3d.3dml":{"source":"iana","extensions":["3dml"]},"text/vnd.in3d.spot":{"source":"iana","extensions":["spot"]},"text/vnd.iptc.newsml":{"source":"iana"},"text/vnd.iptc.nitf":{"source":"iana"},"text/vnd.latex-z":{"source":"iana"},"text/vnd.motorola.reflex":{"source":"iana"},"text/vnd.ms-mediapackage":{"source":"iana"},"text/vnd.net2phone.commcenter.command":{"source":"iana"},"text/vnd.radisys.msml-basic-layout":{"source":"iana"},"text/vnd.senx.warpscript":{"source":"iana"},"text/vnd.si.uricatalogue":{"source":"iana"},"text/vnd.sosi":{"source":"iana"},"text/vnd.sun.j2me.app-descriptor":{"source":"iana","charset":"UTF-8","extensions":["jad"]},"text/vnd.trolltech.linguist":{"source":"iana","charset":"UTF-8"},"text/vnd.wap.si":{"source":"iana"},"text/vnd.wap.sl":{"source":"iana"},"text/vnd.wap.wml":{"source":"iana","extensions":["wml"]},"text/vnd.wap.wmlscript":{"source":"iana","extensions":["wmls"]},"text/vtt":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["vtt"]},"text/x-asm":{"source":"apache","extensions":["s","asm"]},"text/x-c":{"source":"apache","extensions":["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{"source":"nginx","extensions":["htc"]},"text/x-fortran":{"source":"apache","extensions":["f","for","f77","f90"]},"text/x-gwt-rpc":{"compressible":true},"text/x-handlebars-template":{"extensions":["hbs"]},"text/x-java-source":{"source":"apache","extensions":["java"]},"text/x-jquery-tmpl":{"compressible":true},"text/x-lua":{"extensions":["lua"]},"text/x-markdown":{"compressible":true,"extensions":["mkd"]},"text/x-nfo":{"source":"apache","extensions":["nfo"]},"text/x-opml":{"source":"apache","extensions":["opml"]},"text/x-org":{"compressible":true,"extensions":["org"]},"text/x-pascal":{"source":"apache","extensions":["p","pas"]},"text/x-processing":{"compressible":true,"extensions":["pde"]},"text/x-sass":{"extensions":["sass"]},"text/x-scss":{"extensions":["scss"]},"text/x-setext":{"source":"apache","extensions":["etx"]},"text/x-sfv":{"source":"apache","extensions":["sfv"]},"text/x-suse-ymp":{"compressible":true,"extensions":["ymp"]},"text/x-uuencode":{"source":"apache","extensions":["uu"]},"text/x-vcalendar":{"source":"apache","extensions":["vcs"]},"text/x-vcard":{"source":"apache","extensions":["vcf"]},"text/xml":{"source":"iana","compressible":true,"extensions":["xml"]},"text/xml-external-parsed-entity":{"source":"iana"},"text/yaml":{"extensions":["yaml","yml"]},"video/1d-interleaved-parityfec":{"source":"iana"},"video/3gpp":{"source":"iana","extensions":["3gp","3gpp"]},"video/3gpp-tt":{"source":"iana"},"video/3gpp2":{"source":"iana","extensions":["3g2"]},"video/av1":{"source":"iana"},"video/bmpeg":{"source":"iana"},"video/bt656":{"source":"iana"},"video/celb":{"source":"iana"},"video/dv":{"source":"iana"},"video/encaprtp":{"source":"iana"},"video/ffv1":{"source":"iana"},"video/flexfec":{"source":"iana"},"video/h261":{"source":"iana","extensions":["h261"]},"video/h263":{"source":"iana","extensions":["h263"]},"video/h263-1998":{"source":"iana"},"video/h263-2000":{"source":"iana"},"video/h264":{"source":"iana","extensions":["h264"]},"video/h264-rcdo":{"source":"iana"},"video/h264-svc":{"source":"iana"},"video/h265":{"source":"iana"},"video/iso.segment":{"source":"iana","extensions":["m4s"]},"video/jpeg":{"source":"iana","extensions":["jpgv"]},"video/jpeg2000":{"source":"iana"},"video/jpm":{"source":"apache","extensions":["jpm","jpgm"]},"video/mj2":{"source":"iana","extensions":["mj2","mjp2"]},"video/mp1s":{"source":"iana"},"video/mp2p":{"source":"iana"},"video/mp2t":{"source":"iana","extensions":["ts"]},"video/mp4":{"source":"iana","compressible":false,"extensions":["mp4","mp4v","mpg4"]},"video/mp4v-es":{"source":"iana"},"video/mpeg":{"source":"iana","compressible":false,"extensions":["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{"source":"iana"},"video/mpv":{"source":"iana"},"video/nv":{"source":"iana"},"video/ogg":{"source":"iana","compressible":false,"extensions":["ogv"]},"video/parityfec":{"source":"iana"},"video/pointer":{"source":"iana"},"video/quicktime":{"source":"iana","compressible":false,"extensions":["qt","mov"]},"video/raptorfec":{"source":"iana"},"video/raw":{"source":"iana"},"video/rtp-enc-aescm128":{"source":"iana"},"video/rtploopback":{"source":"iana"},"video/rtx":{"source":"iana"},"video/scip":{"source":"iana"},"video/smpte291":{"source":"iana"},"video/smpte292m":{"source":"iana"},"video/ulpfec":{"source":"iana"},"video/vc1":{"source":"iana"},"video/vc2":{"source":"iana"},"video/vnd.cctv":{"source":"iana"},"video/vnd.dece.hd":{"source":"iana","extensions":["uvh","uvvh"]},"video/vnd.dece.mobile":{"source":"iana","extensions":["uvm","uvvm"]},"video/vnd.dece.mp4":{"source":"iana"},"video/vnd.dece.pd":{"source":"iana","extensions":["uvp","uvvp"]},"video/vnd.dece.sd":{"source":"iana","extensions":["uvs","uvvs"]},"video/vnd.dece.video":{"source":"iana","extensions":["uvv","uvvv"]},"video/vnd.directv.mpeg":{"source":"iana"},"video/vnd.directv.mpeg-tts":{"source":"iana"},"video/vnd.dlna.mpeg-tts":{"source":"iana"},"video/vnd.dvb.file":{"source":"iana","extensions":["dvb"]},"video/vnd.fvt":{"source":"iana","extensions":["fvt"]},"video/vnd.hns.video":{"source":"iana"},"video/vnd.iptvforum.1dparityfec-1010":{"source":"iana"},"video/vnd.iptvforum.1dparityfec-2005":{"source":"iana"},"video/vnd.iptvforum.2dparityfec-1010":{"source":"iana"},"video/vnd.iptvforum.2dparityfec-2005":{"source":"iana"},"video/vnd.iptvforum.ttsavc":{"source":"iana"},"video/vnd.iptvforum.ttsmpeg2":{"source":"iana"},"video/vnd.motorola.video":{"source":"iana"},"video/vnd.motorola.videop":{"source":"iana"},"video/vnd.mpegurl":{"source":"iana","extensions":["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{"source":"iana","extensions":["pyv"]},"video/vnd.nokia.interleaved-multimedia":{"source":"iana"},"video/vnd.nokia.mp4vr":{"source":"iana"},"video/vnd.nokia.videovoip":{"source":"iana"},"video/vnd.objectvideo":{"source":"iana"},"video/vnd.radgamettools.bink":{"source":"iana"},"video/vnd.radgamettools.smacker":{"source":"iana"},"video/vnd.sealed.mpeg1":{"source":"iana"},"video/vnd.sealed.mpeg4":{"source":"iana"},"video/vnd.sealed.swf":{"source":"iana"},"video/vnd.sealedmedia.softseal.mov":{"source":"iana"},"video/vnd.uvvu.mp4":{"source":"iana","extensions":["uvu","uvvu"]},"video/vnd.vivo":{"source":"iana","extensions":["viv"]},"video/vnd.youtube.yt":{"source":"iana"},"video/vp8":{"source":"iana"},"video/webm":{"source":"apache","compressible":false,"extensions":["webm"]},"video/x-f4v":{"source":"apache","extensions":["f4v"]},"video/x-fli":{"source":"apache","extensions":["fli"]},"video/x-flv":{"source":"apache","compressible":false,"extensions":["flv"]},"video/x-m4v":{"source":"apache","extensions":["m4v"]},"video/x-matroska":{"source":"apache","compressible":false,"extensions":["mkv","mk3d","mks"]},"video/x-mng":{"source":"apache","extensions":["mng"]},"video/x-ms-asf":{"source":"apache","extensions":["asf","asx"]},"video/x-ms-vob":{"source":"apache","extensions":["vob"]},"video/x-ms-wm":{"source":"apache","extensions":["wm"]},"video/x-ms-wmv":{"source":"apache","compressible":false,"extensions":["wmv"]},"video/x-ms-wmx":{"source":"apache","extensions":["wmx"]},"video/x-ms-wvx":{"source":"apache","extensions":["wvx"]},"video/x-msvideo":{"source":"apache","extensions":["avi"]},"video/x-sgi-movie":{"source":"apache","extensions":["movie"]},"video/x-smv":{"source":"apache","extensions":["smv"]},"x-conference/x-cooltalk":{"source":"apache","extensions":["ice"]},"x-shader/x-fragment":{"compressible":true},"x-shader/x-vertex":{"compressible":true}}'); +module.exports = JSON.parse('{"application/1d-interleaved-parityfec":{"source":"iana"},"application/3gpdash-qoe-report+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/3gpp-ims+xml":{"source":"iana","compressible":true},"application/3gpphal+json":{"source":"iana","compressible":true},"application/3gpphalforms+json":{"source":"iana","compressible":true},"application/a2l":{"source":"iana"},"application/activemessage":{"source":"iana"},"application/activity+json":{"source":"iana","compressible":true},"application/alto-costmap+json":{"source":"iana","compressible":true},"application/alto-costmapfilter+json":{"source":"iana","compressible":true},"application/alto-directory+json":{"source":"iana","compressible":true},"application/alto-endpointcost+json":{"source":"iana","compressible":true},"application/alto-endpointcostparams+json":{"source":"iana","compressible":true},"application/alto-endpointprop+json":{"source":"iana","compressible":true},"application/alto-endpointpropparams+json":{"source":"iana","compressible":true},"application/alto-error+json":{"source":"iana","compressible":true},"application/alto-networkmap+json":{"source":"iana","compressible":true},"application/alto-networkmapfilter+json":{"source":"iana","compressible":true},"application/alto-updatestreamcontrol+json":{"source":"iana","compressible":true},"application/alto-updatestreamparams+json":{"source":"iana","compressible":true},"application/aml":{"source":"iana"},"application/andrew-inset":{"source":"iana","extensions":["ez"]},"application/applefile":{"source":"iana"},"application/applixware":{"source":"apache","extensions":["aw"]},"application/atf":{"source":"iana"},"application/atfx":{"source":"iana"},"application/atom+xml":{"source":"iana","compressible":true,"extensions":["atom"]},"application/atomcat+xml":{"source":"iana","compressible":true,"extensions":["atomcat"]},"application/atomdeleted+xml":{"source":"iana","compressible":true,"extensions":["atomdeleted"]},"application/atomicmail":{"source":"iana"},"application/atomsvc+xml":{"source":"iana","compressible":true,"extensions":["atomsvc"]},"application/atsc-dwd+xml":{"source":"iana","compressible":true,"extensions":["dwd"]},"application/atsc-dynamic-event-message":{"source":"iana"},"application/atsc-held+xml":{"source":"iana","compressible":true,"extensions":["held"]},"application/atsc-rdt+json":{"source":"iana","compressible":true},"application/atsc-rsat+xml":{"source":"iana","compressible":true,"extensions":["rsat"]},"application/atxml":{"source":"iana"},"application/auth-policy+xml":{"source":"iana","compressible":true},"application/bacnet-xdd+zip":{"source":"iana","compressible":false},"application/batch-smtp":{"source":"iana"},"application/bdoc":{"compressible":false,"extensions":["bdoc"]},"application/beep+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/calendar+json":{"source":"iana","compressible":true},"application/calendar+xml":{"source":"iana","compressible":true,"extensions":["xcs"]},"application/call-completion":{"source":"iana"},"application/cals-1840":{"source":"iana"},"application/captive+json":{"source":"iana","compressible":true},"application/cbor":{"source":"iana"},"application/cbor-seq":{"source":"iana"},"application/cccex":{"source":"iana"},"application/ccmp+xml":{"source":"iana","compressible":true},"application/ccxml+xml":{"source":"iana","compressible":true,"extensions":["ccxml"]},"application/cdfx+xml":{"source":"iana","compressible":true,"extensions":["cdfx"]},"application/cdmi-capability":{"source":"iana","extensions":["cdmia"]},"application/cdmi-container":{"source":"iana","extensions":["cdmic"]},"application/cdmi-domain":{"source":"iana","extensions":["cdmid"]},"application/cdmi-object":{"source":"iana","extensions":["cdmio"]},"application/cdmi-queue":{"source":"iana","extensions":["cdmiq"]},"application/cdni":{"source":"iana"},"application/cea":{"source":"iana"},"application/cea-2018+xml":{"source":"iana","compressible":true},"application/cellml+xml":{"source":"iana","compressible":true},"application/cfw":{"source":"iana"},"application/clr":{"source":"iana"},"application/clue+xml":{"source":"iana","compressible":true},"application/clue_info+xml":{"source":"iana","compressible":true},"application/cms":{"source":"iana"},"application/cnrp+xml":{"source":"iana","compressible":true},"application/coap-group+json":{"source":"iana","compressible":true},"application/coap-payload":{"source":"iana"},"application/commonground":{"source":"iana"},"application/conference-info+xml":{"source":"iana","compressible":true},"application/cose":{"source":"iana"},"application/cose-key":{"source":"iana"},"application/cose-key-set":{"source":"iana"},"application/cpl+xml":{"source":"iana","compressible":true},"application/csrattrs":{"source":"iana"},"application/csta+xml":{"source":"iana","compressible":true},"application/cstadata+xml":{"source":"iana","compressible":true},"application/csvm+json":{"source":"iana","compressible":true},"application/cu-seeme":{"source":"apache","extensions":["cu"]},"application/cwt":{"source":"iana"},"application/cybercash":{"source":"iana"},"application/dart":{"compressible":true},"application/dash+xml":{"source":"iana","compressible":true,"extensions":["mpd"]},"application/dashdelta":{"source":"iana"},"application/davmount+xml":{"source":"iana","compressible":true,"extensions":["davmount"]},"application/dca-rft":{"source":"iana"},"application/dcd":{"source":"iana"},"application/dec-dx":{"source":"iana"},"application/dialog-info+xml":{"source":"iana","compressible":true},"application/dicom":{"source":"iana"},"application/dicom+json":{"source":"iana","compressible":true},"application/dicom+xml":{"source":"iana","compressible":true},"application/dii":{"source":"iana"},"application/dit":{"source":"iana"},"application/dns":{"source":"iana"},"application/dns+json":{"source":"iana","compressible":true},"application/dns-message":{"source":"iana"},"application/docbook+xml":{"source":"apache","compressible":true,"extensions":["dbk"]},"application/dots+cbor":{"source":"iana"},"application/dskpp+xml":{"source":"iana","compressible":true},"application/dssc+der":{"source":"iana","extensions":["dssc"]},"application/dssc+xml":{"source":"iana","compressible":true,"extensions":["xdssc"]},"application/dvcs":{"source":"iana"},"application/ecmascript":{"source":"iana","compressible":true,"extensions":["es","ecma"]},"application/edi-consent":{"source":"iana"},"application/edi-x12":{"source":"iana","compressible":false},"application/edifact":{"source":"iana","compressible":false},"application/efi":{"source":"iana"},"application/elm+json":{"source":"iana","charset":"UTF-8","compressible":true},"application/elm+xml":{"source":"iana","compressible":true},"application/emergencycalldata.cap+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/emergencycalldata.comment+xml":{"source":"iana","compressible":true},"application/emergencycalldata.control+xml":{"source":"iana","compressible":true},"application/emergencycalldata.deviceinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.ecall.msd":{"source":"iana"},"application/emergencycalldata.providerinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.serviceinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.subscriberinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.veds+xml":{"source":"iana","compressible":true},"application/emma+xml":{"source":"iana","compressible":true,"extensions":["emma"]},"application/emotionml+xml":{"source":"iana","compressible":true,"extensions":["emotionml"]},"application/encaprtp":{"source":"iana"},"application/epp+xml":{"source":"iana","compressible":true},"application/epub+zip":{"source":"iana","compressible":false,"extensions":["epub"]},"application/eshop":{"source":"iana"},"application/exi":{"source":"iana","extensions":["exi"]},"application/expect-ct-report+json":{"source":"iana","compressible":true},"application/fastinfoset":{"source":"iana"},"application/fastsoap":{"source":"iana"},"application/fdt+xml":{"source":"iana","compressible":true,"extensions":["fdt"]},"application/fhir+json":{"source":"iana","charset":"UTF-8","compressible":true},"application/fhir+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/fido.trusted-apps+json":{"compressible":true},"application/fits":{"source":"iana"},"application/flexfec":{"source":"iana"},"application/font-sfnt":{"source":"iana"},"application/font-tdpfr":{"source":"iana","extensions":["pfr"]},"application/font-woff":{"source":"iana","compressible":false},"application/framework-attributes+xml":{"source":"iana","compressible":true},"application/geo+json":{"source":"iana","compressible":true,"extensions":["geojson"]},"application/geo+json-seq":{"source":"iana"},"application/geopackage+sqlite3":{"source":"iana"},"application/geoxacml+xml":{"source":"iana","compressible":true},"application/gltf-buffer":{"source":"iana"},"application/gml+xml":{"source":"iana","compressible":true,"extensions":["gml"]},"application/gpx+xml":{"source":"apache","compressible":true,"extensions":["gpx"]},"application/gxf":{"source":"apache","extensions":["gxf"]},"application/gzip":{"source":"iana","compressible":false,"extensions":["gz"]},"application/h224":{"source":"iana"},"application/held+xml":{"source":"iana","compressible":true},"application/hjson":{"extensions":["hjson"]},"application/http":{"source":"iana"},"application/hyperstudio":{"source":"iana","extensions":["stk"]},"application/ibe-key-request+xml":{"source":"iana","compressible":true},"application/ibe-pkg-reply+xml":{"source":"iana","compressible":true},"application/ibe-pp-data":{"source":"iana"},"application/iges":{"source":"iana"},"application/im-iscomposing+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/index":{"source":"iana"},"application/index.cmd":{"source":"iana"},"application/index.obj":{"source":"iana"},"application/index.response":{"source":"iana"},"application/index.vnd":{"source":"iana"},"application/inkml+xml":{"source":"iana","compressible":true,"extensions":["ink","inkml"]},"application/iotp":{"source":"iana"},"application/ipfix":{"source":"iana","extensions":["ipfix"]},"application/ipp":{"source":"iana"},"application/isup":{"source":"iana"},"application/its+xml":{"source":"iana","compressible":true,"extensions":["its"]},"application/java-archive":{"source":"apache","compressible":false,"extensions":["jar","war","ear"]},"application/java-serialized-object":{"source":"apache","compressible":false,"extensions":["ser"]},"application/java-vm":{"source":"apache","compressible":false,"extensions":["class"]},"application/javascript":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["js","mjs"]},"application/jf2feed+json":{"source":"iana","compressible":true},"application/jose":{"source":"iana"},"application/jose+json":{"source":"iana","compressible":true},"application/jrd+json":{"source":"iana","compressible":true},"application/jscalendar+json":{"source":"iana","compressible":true},"application/json":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["json","map"]},"application/json-patch+json":{"source":"iana","compressible":true},"application/json-seq":{"source":"iana"},"application/json5":{"extensions":["json5"]},"application/jsonml+json":{"source":"apache","compressible":true,"extensions":["jsonml"]},"application/jwk+json":{"source":"iana","compressible":true},"application/jwk-set+json":{"source":"iana","compressible":true},"application/jwt":{"source":"iana"},"application/kpml-request+xml":{"source":"iana","compressible":true},"application/kpml-response+xml":{"source":"iana","compressible":true},"application/ld+json":{"source":"iana","compressible":true,"extensions":["jsonld"]},"application/lgr+xml":{"source":"iana","compressible":true,"extensions":["lgr"]},"application/link-format":{"source":"iana"},"application/load-control+xml":{"source":"iana","compressible":true},"application/lost+xml":{"source":"iana","compressible":true,"extensions":["lostxml"]},"application/lostsync+xml":{"source":"iana","compressible":true},"application/lpf+zip":{"source":"iana","compressible":false},"application/lxf":{"source":"iana"},"application/mac-binhex40":{"source":"iana","extensions":["hqx"]},"application/mac-compactpro":{"source":"apache","extensions":["cpt"]},"application/macwriteii":{"source":"iana"},"application/mads+xml":{"source":"iana","compressible":true,"extensions":["mads"]},"application/manifest+json":{"charset":"UTF-8","compressible":true,"extensions":["webmanifest"]},"application/marc":{"source":"iana","extensions":["mrc"]},"application/marcxml+xml":{"source":"iana","compressible":true,"extensions":["mrcx"]},"application/mathematica":{"source":"iana","extensions":["ma","nb","mb"]},"application/mathml+xml":{"source":"iana","compressible":true,"extensions":["mathml"]},"application/mathml-content+xml":{"source":"iana","compressible":true},"application/mathml-presentation+xml":{"source":"iana","compressible":true},"application/mbms-associated-procedure-description+xml":{"source":"iana","compressible":true},"application/mbms-deregister+xml":{"source":"iana","compressible":true},"application/mbms-envelope+xml":{"source":"iana","compressible":true},"application/mbms-msk+xml":{"source":"iana","compressible":true},"application/mbms-msk-response+xml":{"source":"iana","compressible":true},"application/mbms-protection-description+xml":{"source":"iana","compressible":true},"application/mbms-reception-report+xml":{"source":"iana","compressible":true},"application/mbms-register+xml":{"source":"iana","compressible":true},"application/mbms-register-response+xml":{"source":"iana","compressible":true},"application/mbms-schedule+xml":{"source":"iana","compressible":true},"application/mbms-user-service-description+xml":{"source":"iana","compressible":true},"application/mbox":{"source":"iana","extensions":["mbox"]},"application/media-policy-dataset+xml":{"source":"iana","compressible":true},"application/media_control+xml":{"source":"iana","compressible":true},"application/mediaservercontrol+xml":{"source":"iana","compressible":true,"extensions":["mscml"]},"application/merge-patch+json":{"source":"iana","compressible":true},"application/metalink+xml":{"source":"apache","compressible":true,"extensions":["metalink"]},"application/metalink4+xml":{"source":"iana","compressible":true,"extensions":["meta4"]},"application/mets+xml":{"source":"iana","compressible":true,"extensions":["mets"]},"application/mf4":{"source":"iana"},"application/mikey":{"source":"iana"},"application/mipc":{"source":"iana"},"application/mmt-aei+xml":{"source":"iana","compressible":true,"extensions":["maei"]},"application/mmt-usd+xml":{"source":"iana","compressible":true,"extensions":["musd"]},"application/mods+xml":{"source":"iana","compressible":true,"extensions":["mods"]},"application/moss-keys":{"source":"iana"},"application/moss-signature":{"source":"iana"},"application/mosskey-data":{"source":"iana"},"application/mosskey-request":{"source":"iana"},"application/mp21":{"source":"iana","extensions":["m21","mp21"]},"application/mp4":{"source":"iana","extensions":["mp4s","m4p"]},"application/mpeg4-generic":{"source":"iana"},"application/mpeg4-iod":{"source":"iana"},"application/mpeg4-iod-xmt":{"source":"iana"},"application/mrb-consumer+xml":{"source":"iana","compressible":true},"application/mrb-publish+xml":{"source":"iana","compressible":true},"application/msc-ivr+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/msc-mixer+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/msword":{"source":"iana","compressible":false,"extensions":["doc","dot"]},"application/mud+json":{"source":"iana","compressible":true},"application/multipart-core":{"source":"iana"},"application/mxf":{"source":"iana","extensions":["mxf"]},"application/n-quads":{"source":"iana","extensions":["nq"]},"application/n-triples":{"source":"iana","extensions":["nt"]},"application/nasdata":{"source":"iana"},"application/news-checkgroups":{"source":"iana","charset":"US-ASCII"},"application/news-groupinfo":{"source":"iana","charset":"US-ASCII"},"application/news-transmission":{"source":"iana"},"application/nlsml+xml":{"source":"iana","compressible":true},"application/node":{"source":"iana","extensions":["cjs"]},"application/nss":{"source":"iana"},"application/oauth-authz-req+jwt":{"source":"iana"},"application/ocsp-request":{"source":"iana"},"application/ocsp-response":{"source":"iana"},"application/octet-stream":{"source":"iana","compressible":false,"extensions":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{"source":"iana","extensions":["oda"]},"application/odm+xml":{"source":"iana","compressible":true},"application/odx":{"source":"iana"},"application/oebps-package+xml":{"source":"iana","compressible":true,"extensions":["opf"]},"application/ogg":{"source":"iana","compressible":false,"extensions":["ogx"]},"application/omdoc+xml":{"source":"apache","compressible":true,"extensions":["omdoc"]},"application/onenote":{"source":"apache","extensions":["onetoc","onetoc2","onetmp","onepkg"]},"application/opc-nodeset+xml":{"source":"iana","compressible":true},"application/oscore":{"source":"iana"},"application/oxps":{"source":"iana","extensions":["oxps"]},"application/p2p-overlay+xml":{"source":"iana","compressible":true,"extensions":["relo"]},"application/parityfec":{"source":"iana"},"application/passport":{"source":"iana"},"application/patch-ops-error+xml":{"source":"iana","compressible":true,"extensions":["xer"]},"application/pdf":{"source":"iana","compressible":false,"extensions":["pdf"]},"application/pdx":{"source":"iana"},"application/pem-certificate-chain":{"source":"iana"},"application/pgp-encrypted":{"source":"iana","compressible":false,"extensions":["pgp"]},"application/pgp-keys":{"source":"iana"},"application/pgp-signature":{"source":"iana","extensions":["asc","sig"]},"application/pics-rules":{"source":"apache","extensions":["prf"]},"application/pidf+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/pidf-diff+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/pkcs10":{"source":"iana","extensions":["p10"]},"application/pkcs12":{"source":"iana"},"application/pkcs7-mime":{"source":"iana","extensions":["p7m","p7c"]},"application/pkcs7-signature":{"source":"iana","extensions":["p7s"]},"application/pkcs8":{"source":"iana","extensions":["p8"]},"application/pkcs8-encrypted":{"source":"iana"},"application/pkix-attr-cert":{"source":"iana","extensions":["ac"]},"application/pkix-cert":{"source":"iana","extensions":["cer"]},"application/pkix-crl":{"source":"iana","extensions":["crl"]},"application/pkix-pkipath":{"source":"iana","extensions":["pkipath"]},"application/pkixcmp":{"source":"iana","extensions":["pki"]},"application/pls+xml":{"source":"iana","compressible":true,"extensions":["pls"]},"application/poc-settings+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/postscript":{"source":"iana","compressible":true,"extensions":["ai","eps","ps"]},"application/ppsp-tracker+json":{"source":"iana","compressible":true},"application/problem+json":{"source":"iana","compressible":true},"application/problem+xml":{"source":"iana","compressible":true},"application/provenance+xml":{"source":"iana","compressible":true,"extensions":["provx"]},"application/prs.alvestrand.titrax-sheet":{"source":"iana"},"application/prs.cww":{"source":"iana","extensions":["cww"]},"application/prs.cyn":{"source":"iana","charset":"7-BIT"},"application/prs.hpub+zip":{"source":"iana","compressible":false},"application/prs.nprend":{"source":"iana"},"application/prs.plucker":{"source":"iana"},"application/prs.rdf-xml-crypt":{"source":"iana"},"application/prs.xsf+xml":{"source":"iana","compressible":true},"application/pskc+xml":{"source":"iana","compressible":true,"extensions":["pskcxml"]},"application/pvd+json":{"source":"iana","compressible":true},"application/qsig":{"source":"iana"},"application/raml+yaml":{"compressible":true,"extensions":["raml"]},"application/raptorfec":{"source":"iana"},"application/rdap+json":{"source":"iana","compressible":true},"application/rdf+xml":{"source":"iana","compressible":true,"extensions":["rdf","owl"]},"application/reginfo+xml":{"source":"iana","compressible":true,"extensions":["rif"]},"application/relax-ng-compact-syntax":{"source":"iana","extensions":["rnc"]},"application/remote-printing":{"source":"iana"},"application/reputon+json":{"source":"iana","compressible":true},"application/resource-lists+xml":{"source":"iana","compressible":true,"extensions":["rl"]},"application/resource-lists-diff+xml":{"source":"iana","compressible":true,"extensions":["rld"]},"application/rfc+xml":{"source":"iana","compressible":true},"application/riscos":{"source":"iana"},"application/rlmi+xml":{"source":"iana","compressible":true},"application/rls-services+xml":{"source":"iana","compressible":true,"extensions":["rs"]},"application/route-apd+xml":{"source":"iana","compressible":true,"extensions":["rapd"]},"application/route-s-tsid+xml":{"source":"iana","compressible":true,"extensions":["sls"]},"application/route-usd+xml":{"source":"iana","compressible":true,"extensions":["rusd"]},"application/rpki-ghostbusters":{"source":"iana","extensions":["gbr"]},"application/rpki-manifest":{"source":"iana","extensions":["mft"]},"application/rpki-publication":{"source":"iana"},"application/rpki-roa":{"source":"iana","extensions":["roa"]},"application/rpki-updown":{"source":"iana"},"application/rsd+xml":{"source":"apache","compressible":true,"extensions":["rsd"]},"application/rss+xml":{"source":"apache","compressible":true,"extensions":["rss"]},"application/rtf":{"source":"iana","compressible":true,"extensions":["rtf"]},"application/rtploopback":{"source":"iana"},"application/rtx":{"source":"iana"},"application/samlassertion+xml":{"source":"iana","compressible":true},"application/samlmetadata+xml":{"source":"iana","compressible":true},"application/sarif+json":{"source":"iana","compressible":true},"application/sarif-external-properties+json":{"source":"iana","compressible":true},"application/sbe":{"source":"iana"},"application/sbml+xml":{"source":"iana","compressible":true,"extensions":["sbml"]},"application/scaip+xml":{"source":"iana","compressible":true},"application/scim+json":{"source":"iana","compressible":true},"application/scvp-cv-request":{"source":"iana","extensions":["scq"]},"application/scvp-cv-response":{"source":"iana","extensions":["scs"]},"application/scvp-vp-request":{"source":"iana","extensions":["spq"]},"application/scvp-vp-response":{"source":"iana","extensions":["spp"]},"application/sdp":{"source":"iana","extensions":["sdp"]},"application/secevent+jwt":{"source":"iana"},"application/senml+cbor":{"source":"iana"},"application/senml+json":{"source":"iana","compressible":true},"application/senml+xml":{"source":"iana","compressible":true,"extensions":["senmlx"]},"application/senml-etch+cbor":{"source":"iana"},"application/senml-etch+json":{"source":"iana","compressible":true},"application/senml-exi":{"source":"iana"},"application/sensml+cbor":{"source":"iana"},"application/sensml+json":{"source":"iana","compressible":true},"application/sensml+xml":{"source":"iana","compressible":true,"extensions":["sensmlx"]},"application/sensml-exi":{"source":"iana"},"application/sep+xml":{"source":"iana","compressible":true},"application/sep-exi":{"source":"iana"},"application/session-info":{"source":"iana"},"application/set-payment":{"source":"iana"},"application/set-payment-initiation":{"source":"iana","extensions":["setpay"]},"application/set-registration":{"source":"iana"},"application/set-registration-initiation":{"source":"iana","extensions":["setreg"]},"application/sgml":{"source":"iana"},"application/sgml-open-catalog":{"source":"iana"},"application/shf+xml":{"source":"iana","compressible":true,"extensions":["shf"]},"application/sieve":{"source":"iana","extensions":["siv","sieve"]},"application/simple-filter+xml":{"source":"iana","compressible":true},"application/simple-message-summary":{"source":"iana"},"application/simplesymbolcontainer":{"source":"iana"},"application/sipc":{"source":"iana"},"application/slate":{"source":"iana"},"application/smil":{"source":"iana"},"application/smil+xml":{"source":"iana","compressible":true,"extensions":["smi","smil"]},"application/smpte336m":{"source":"iana"},"application/soap+fastinfoset":{"source":"iana"},"application/soap+xml":{"source":"iana","compressible":true},"application/sparql-query":{"source":"iana","extensions":["rq"]},"application/sparql-results+xml":{"source":"iana","compressible":true,"extensions":["srx"]},"application/spirits-event+xml":{"source":"iana","compressible":true},"application/sql":{"source":"iana"},"application/srgs":{"source":"iana","extensions":["gram"]},"application/srgs+xml":{"source":"iana","compressible":true,"extensions":["grxml"]},"application/sru+xml":{"source":"iana","compressible":true,"extensions":["sru"]},"application/ssdl+xml":{"source":"apache","compressible":true,"extensions":["ssdl"]},"application/ssml+xml":{"source":"iana","compressible":true,"extensions":["ssml"]},"application/stix+json":{"source":"iana","compressible":true},"application/swid+xml":{"source":"iana","compressible":true,"extensions":["swidtag"]},"application/tamp-apex-update":{"source":"iana"},"application/tamp-apex-update-confirm":{"source":"iana"},"application/tamp-community-update":{"source":"iana"},"application/tamp-community-update-confirm":{"source":"iana"},"application/tamp-error":{"source":"iana"},"application/tamp-sequence-adjust":{"source":"iana"},"application/tamp-sequence-adjust-confirm":{"source":"iana"},"application/tamp-status-query":{"source":"iana"},"application/tamp-status-response":{"source":"iana"},"application/tamp-update":{"source":"iana"},"application/tamp-update-confirm":{"source":"iana"},"application/tar":{"compressible":true},"application/taxii+json":{"source":"iana","compressible":true},"application/td+json":{"source":"iana","compressible":true},"application/tei+xml":{"source":"iana","compressible":true,"extensions":["tei","teicorpus"]},"application/tetra_isi":{"source":"iana"},"application/thraud+xml":{"source":"iana","compressible":true,"extensions":["tfi"]},"application/timestamp-query":{"source":"iana"},"application/timestamp-reply":{"source":"iana"},"application/timestamped-data":{"source":"iana","extensions":["tsd"]},"application/tlsrpt+gzip":{"source":"iana"},"application/tlsrpt+json":{"source":"iana","compressible":true},"application/tnauthlist":{"source":"iana"},"application/toml":{"compressible":true,"extensions":["toml"]},"application/trickle-ice-sdpfrag":{"source":"iana"},"application/trig":{"source":"iana"},"application/ttml+xml":{"source":"iana","compressible":true,"extensions":["ttml"]},"application/tve-trigger":{"source":"iana"},"application/tzif":{"source":"iana"},"application/tzif-leap":{"source":"iana"},"application/ubjson":{"compressible":false,"extensions":["ubj"]},"application/ulpfec":{"source":"iana"},"application/urc-grpsheet+xml":{"source":"iana","compressible":true},"application/urc-ressheet+xml":{"source":"iana","compressible":true,"extensions":["rsheet"]},"application/urc-targetdesc+xml":{"source":"iana","compressible":true,"extensions":["td"]},"application/urc-uisocketdesc+xml":{"source":"iana","compressible":true},"application/vcard+json":{"source":"iana","compressible":true},"application/vcard+xml":{"source":"iana","compressible":true},"application/vemmi":{"source":"iana"},"application/vividence.scriptfile":{"source":"apache"},"application/vnd.1000minds.decision-model+xml":{"source":"iana","compressible":true,"extensions":["1km"]},"application/vnd.3gpp-prose+xml":{"source":"iana","compressible":true},"application/vnd.3gpp-prose-pc3ch+xml":{"source":"iana","compressible":true},"application/vnd.3gpp-v2x-local-service-information":{"source":"iana"},"application/vnd.3gpp.5gnas":{"source":"iana"},"application/vnd.3gpp.access-transfer-events+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.bsf+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.gmop+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.gtpc":{"source":"iana"},"application/vnd.3gpp.interworking-data":{"source":"iana"},"application/vnd.3gpp.lpp":{"source":"iana"},"application/vnd.3gpp.mc-signalling-ear":{"source":"iana"},"application/vnd.3gpp.mcdata-affiliation-command+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-payload":{"source":"iana"},"application/vnd.3gpp.mcdata-service-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-signalling":{"source":"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-user-profile+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-affiliation-command+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-floor-request+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-location-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-service-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-signed+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-ue-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-ue-init-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-user-profile+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-affiliation-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-location-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-service-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-transmission-request+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-ue-config+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcvideo-user-profile+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mid-call+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.ngap":{"source":"iana"},"application/vnd.3gpp.pfcp":{"source":"iana"},"application/vnd.3gpp.pic-bw-large":{"source":"iana","extensions":["plb"]},"application/vnd.3gpp.pic-bw-small":{"source":"iana","extensions":["psb"]},"application/vnd.3gpp.pic-bw-var":{"source":"iana","extensions":["pvb"]},"application/vnd.3gpp.s1ap":{"source":"iana"},"application/vnd.3gpp.sms":{"source":"iana"},"application/vnd.3gpp.sms+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.srvcc-ext+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.srvcc-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.state-and-event-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.ussd+xml":{"source":"iana","compressible":true},"application/vnd.3gpp2.bcmcsinfo+xml":{"source":"iana","compressible":true},"application/vnd.3gpp2.sms":{"source":"iana"},"application/vnd.3gpp2.tcap":{"source":"iana","extensions":["tcap"]},"application/vnd.3lightssoftware.imagescal":{"source":"iana"},"application/vnd.3m.post-it-notes":{"source":"iana","extensions":["pwn"]},"application/vnd.accpac.simply.aso":{"source":"iana","extensions":["aso"]},"application/vnd.accpac.simply.imp":{"source":"iana","extensions":["imp"]},"application/vnd.acucobol":{"source":"iana","extensions":["acu"]},"application/vnd.acucorp":{"source":"iana","extensions":["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{"source":"apache","compressible":false,"extensions":["air"]},"application/vnd.adobe.flash.movie":{"source":"iana"},"application/vnd.adobe.formscentral.fcdt":{"source":"iana","extensions":["fcdt"]},"application/vnd.adobe.fxp":{"source":"iana","extensions":["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{"source":"iana"},"application/vnd.adobe.xdp+xml":{"source":"iana","compressible":true,"extensions":["xdp"]},"application/vnd.adobe.xfdf":{"source":"iana","extensions":["xfdf"]},"application/vnd.aether.imp":{"source":"iana"},"application/vnd.afpc.afplinedata":{"source":"iana"},"application/vnd.afpc.afplinedata-pagedef":{"source":"iana"},"application/vnd.afpc.cmoca-cmresource":{"source":"iana"},"application/vnd.afpc.foca-charset":{"source":"iana"},"application/vnd.afpc.foca-codedfont":{"source":"iana"},"application/vnd.afpc.foca-codepage":{"source":"iana"},"application/vnd.afpc.modca":{"source":"iana"},"application/vnd.afpc.modca-cmtable":{"source":"iana"},"application/vnd.afpc.modca-formdef":{"source":"iana"},"application/vnd.afpc.modca-mediummap":{"source":"iana"},"application/vnd.afpc.modca-objectcontainer":{"source":"iana"},"application/vnd.afpc.modca-overlay":{"source":"iana"},"application/vnd.afpc.modca-pagesegment":{"source":"iana"},"application/vnd.ah-barcode":{"source":"iana"},"application/vnd.ahead.space":{"source":"iana","extensions":["ahead"]},"application/vnd.airzip.filesecure.azf":{"source":"iana","extensions":["azf"]},"application/vnd.airzip.filesecure.azs":{"source":"iana","extensions":["azs"]},"application/vnd.amadeus+json":{"source":"iana","compressible":true},"application/vnd.amazon.ebook":{"source":"apache","extensions":["azw"]},"application/vnd.amazon.mobi8-ebook":{"source":"iana"},"application/vnd.americandynamics.acc":{"source":"iana","extensions":["acc"]},"application/vnd.amiga.ami":{"source":"iana","extensions":["ami"]},"application/vnd.amundsen.maze+xml":{"source":"iana","compressible":true},"application/vnd.android.ota":{"source":"iana"},"application/vnd.android.package-archive":{"source":"apache","compressible":false,"extensions":["apk"]},"application/vnd.anki":{"source":"iana"},"application/vnd.anser-web-certificate-issue-initiation":{"source":"iana","extensions":["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{"source":"apache","extensions":["fti"]},"application/vnd.antix.game-component":{"source":"iana","extensions":["atx"]},"application/vnd.apache.thrift.binary":{"source":"iana"},"application/vnd.apache.thrift.compact":{"source":"iana"},"application/vnd.apache.thrift.json":{"source":"iana"},"application/vnd.api+json":{"source":"iana","compressible":true},"application/vnd.aplextor.warrp+json":{"source":"iana","compressible":true},"application/vnd.apothekende.reservation+json":{"source":"iana","compressible":true},"application/vnd.apple.installer+xml":{"source":"iana","compressible":true,"extensions":["mpkg"]},"application/vnd.apple.keynote":{"source":"iana","extensions":["key"]},"application/vnd.apple.mpegurl":{"source":"iana","extensions":["m3u8"]},"application/vnd.apple.numbers":{"source":"iana","extensions":["numbers"]},"application/vnd.apple.pages":{"source":"iana","extensions":["pages"]},"application/vnd.apple.pkpass":{"compressible":false,"extensions":["pkpass"]},"application/vnd.arastra.swi":{"source":"iana"},"application/vnd.aristanetworks.swi":{"source":"iana","extensions":["swi"]},"application/vnd.artisan+json":{"source":"iana","compressible":true},"application/vnd.artsquare":{"source":"iana"},"application/vnd.astraea-software.iota":{"source":"iana","extensions":["iota"]},"application/vnd.audiograph":{"source":"iana","extensions":["aep"]},"application/vnd.autopackage":{"source":"iana"},"application/vnd.avalon+json":{"source":"iana","compressible":true},"application/vnd.avistar+xml":{"source":"iana","compressible":true},"application/vnd.balsamiq.bmml+xml":{"source":"iana","compressible":true,"extensions":["bmml"]},"application/vnd.balsamiq.bmpr":{"source":"iana"},"application/vnd.banana-accounting":{"source":"iana"},"application/vnd.bbf.usp.error":{"source":"iana"},"application/vnd.bbf.usp.msg":{"source":"iana"},"application/vnd.bbf.usp.msg+json":{"source":"iana","compressible":true},"application/vnd.bekitzur-stech+json":{"source":"iana","compressible":true},"application/vnd.bint.med-content":{"source":"iana"},"application/vnd.biopax.rdf+xml":{"source":"iana","compressible":true},"application/vnd.blink-idb-value-wrapper":{"source":"iana"},"application/vnd.blueice.multipass":{"source":"iana","extensions":["mpm"]},"application/vnd.bluetooth.ep.oob":{"source":"iana"},"application/vnd.bluetooth.le.oob":{"source":"iana"},"application/vnd.bmi":{"source":"iana","extensions":["bmi"]},"application/vnd.bpf":{"source":"iana"},"application/vnd.bpf3":{"source":"iana"},"application/vnd.businessobjects":{"source":"iana","extensions":["rep"]},"application/vnd.byu.uapi+json":{"source":"iana","compressible":true},"application/vnd.cab-jscript":{"source":"iana"},"application/vnd.canon-cpdl":{"source":"iana"},"application/vnd.canon-lips":{"source":"iana"},"application/vnd.capasystems-pg+json":{"source":"iana","compressible":true},"application/vnd.cendio.thinlinc.clientconf":{"source":"iana"},"application/vnd.century-systems.tcp_stream":{"source":"iana"},"application/vnd.chemdraw+xml":{"source":"iana","compressible":true,"extensions":["cdxml"]},"application/vnd.chess-pgn":{"source":"iana"},"application/vnd.chipnuts.karaoke-mmd":{"source":"iana","extensions":["mmd"]},"application/vnd.ciedi":{"source":"iana"},"application/vnd.cinderella":{"source":"iana","extensions":["cdy"]},"application/vnd.cirpack.isdn-ext":{"source":"iana"},"application/vnd.citationstyles.style+xml":{"source":"iana","compressible":true,"extensions":["csl"]},"application/vnd.claymore":{"source":"iana","extensions":["cla"]},"application/vnd.cloanto.rp9":{"source":"iana","extensions":["rp9"]},"application/vnd.clonk.c4group":{"source":"iana","extensions":["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{"source":"iana","extensions":["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{"source":"iana","extensions":["c11amz"]},"application/vnd.coffeescript":{"source":"iana"},"application/vnd.collabio.xodocuments.document":{"source":"iana"},"application/vnd.collabio.xodocuments.document-template":{"source":"iana"},"application/vnd.collabio.xodocuments.presentation":{"source":"iana"},"application/vnd.collabio.xodocuments.presentation-template":{"source":"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{"source":"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{"source":"iana"},"application/vnd.collection+json":{"source":"iana","compressible":true},"application/vnd.collection.doc+json":{"source":"iana","compressible":true},"application/vnd.collection.next+json":{"source":"iana","compressible":true},"application/vnd.comicbook+zip":{"source":"iana","compressible":false},"application/vnd.comicbook-rar":{"source":"iana"},"application/vnd.commerce-battelle":{"source":"iana"},"application/vnd.commonspace":{"source":"iana","extensions":["csp"]},"application/vnd.contact.cmsg":{"source":"iana","extensions":["cdbcmsg"]},"application/vnd.coreos.ignition+json":{"source":"iana","compressible":true},"application/vnd.cosmocaller":{"source":"iana","extensions":["cmc"]},"application/vnd.crick.clicker":{"source":"iana","extensions":["clkx"]},"application/vnd.crick.clicker.keyboard":{"source":"iana","extensions":["clkk"]},"application/vnd.crick.clicker.palette":{"source":"iana","extensions":["clkp"]},"application/vnd.crick.clicker.template":{"source":"iana","extensions":["clkt"]},"application/vnd.crick.clicker.wordbank":{"source":"iana","extensions":["clkw"]},"application/vnd.criticaltools.wbs+xml":{"source":"iana","compressible":true,"extensions":["wbs"]},"application/vnd.cryptii.pipe+json":{"source":"iana","compressible":true},"application/vnd.crypto-shade-file":{"source":"iana"},"application/vnd.cryptomator.encrypted":{"source":"iana"},"application/vnd.cryptomator.vault":{"source":"iana"},"application/vnd.ctc-posml":{"source":"iana","extensions":["pml"]},"application/vnd.ctct.ws+xml":{"source":"iana","compressible":true},"application/vnd.cups-pdf":{"source":"iana"},"application/vnd.cups-postscript":{"source":"iana"},"application/vnd.cups-ppd":{"source":"iana","extensions":["ppd"]},"application/vnd.cups-raster":{"source":"iana"},"application/vnd.cups-raw":{"source":"iana"},"application/vnd.curl":{"source":"iana"},"application/vnd.curl.car":{"source":"apache","extensions":["car"]},"application/vnd.curl.pcurl":{"source":"apache","extensions":["pcurl"]},"application/vnd.cyan.dean.root+xml":{"source":"iana","compressible":true},"application/vnd.cybank":{"source":"iana"},"application/vnd.cyclonedx+json":{"source":"iana","compressible":true},"application/vnd.cyclonedx+xml":{"source":"iana","compressible":true},"application/vnd.d2l.coursepackage1p0+zip":{"source":"iana","compressible":false},"application/vnd.d3m-dataset":{"source":"iana"},"application/vnd.d3m-problem":{"source":"iana"},"application/vnd.dart":{"source":"iana","compressible":true,"extensions":["dart"]},"application/vnd.data-vision.rdz":{"source":"iana","extensions":["rdz"]},"application/vnd.datapackage+json":{"source":"iana","compressible":true},"application/vnd.dataresource+json":{"source":"iana","compressible":true},"application/vnd.dbf":{"source":"iana","extensions":["dbf"]},"application/vnd.debian.binary-package":{"source":"iana"},"application/vnd.dece.data":{"source":"iana","extensions":["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{"source":"iana","compressible":true,"extensions":["uvt","uvvt"]},"application/vnd.dece.unspecified":{"source":"iana","extensions":["uvx","uvvx"]},"application/vnd.dece.zip":{"source":"iana","extensions":["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{"source":"iana","extensions":["fe_launch"]},"application/vnd.desmume.movie":{"source":"iana"},"application/vnd.dir-bi.plate-dl-nosuffix":{"source":"iana"},"application/vnd.dm.delegation+xml":{"source":"iana","compressible":true},"application/vnd.dna":{"source":"iana","extensions":["dna"]},"application/vnd.document+json":{"source":"iana","compressible":true},"application/vnd.dolby.mlp":{"source":"apache","extensions":["mlp"]},"application/vnd.dolby.mobile.1":{"source":"iana"},"application/vnd.dolby.mobile.2":{"source":"iana"},"application/vnd.doremir.scorecloud-binary-document":{"source":"iana"},"application/vnd.dpgraph":{"source":"iana","extensions":["dpg"]},"application/vnd.dreamfactory":{"source":"iana","extensions":["dfac"]},"application/vnd.drive+json":{"source":"iana","compressible":true},"application/vnd.ds-keypoint":{"source":"apache","extensions":["kpxx"]},"application/vnd.dtg.local":{"source":"iana"},"application/vnd.dtg.local.flash":{"source":"iana"},"application/vnd.dtg.local.html":{"source":"iana"},"application/vnd.dvb.ait":{"source":"iana","extensions":["ait"]},"application/vnd.dvb.dvbisl+xml":{"source":"iana","compressible":true},"application/vnd.dvb.dvbj":{"source":"iana"},"application/vnd.dvb.esgcontainer":{"source":"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{"source":"iana"},"application/vnd.dvb.ipdcesgaccess":{"source":"iana"},"application/vnd.dvb.ipdcesgaccess2":{"source":"iana"},"application/vnd.dvb.ipdcesgpdd":{"source":"iana"},"application/vnd.dvb.ipdcroaming":{"source":"iana"},"application/vnd.dvb.iptv.alfec-base":{"source":"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{"source":"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-container+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-generic+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-ia-msglist+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-ia-registration-request+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-ia-registration-response+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-init+xml":{"source":"iana","compressible":true},"application/vnd.dvb.pfr":{"source":"iana"},"application/vnd.dvb.service":{"source":"iana","extensions":["svc"]},"application/vnd.dxr":{"source":"iana"},"application/vnd.dynageo":{"source":"iana","extensions":["geo"]},"application/vnd.dzr":{"source":"iana"},"application/vnd.easykaraoke.cdgdownload":{"source":"iana"},"application/vnd.ecdis-update":{"source":"iana"},"application/vnd.ecip.rlp":{"source":"iana"},"application/vnd.ecowin.chart":{"source":"iana","extensions":["mag"]},"application/vnd.ecowin.filerequest":{"source":"iana"},"application/vnd.ecowin.fileupdate":{"source":"iana"},"application/vnd.ecowin.series":{"source":"iana"},"application/vnd.ecowin.seriesrequest":{"source":"iana"},"application/vnd.ecowin.seriesupdate":{"source":"iana"},"application/vnd.efi.img":{"source":"iana"},"application/vnd.efi.iso":{"source":"iana"},"application/vnd.emclient.accessrequest+xml":{"source":"iana","compressible":true},"application/vnd.enliven":{"source":"iana","extensions":["nml"]},"application/vnd.enphase.envoy":{"source":"iana"},"application/vnd.eprints.data+xml":{"source":"iana","compressible":true},"application/vnd.epson.esf":{"source":"iana","extensions":["esf"]},"application/vnd.epson.msf":{"source":"iana","extensions":["msf"]},"application/vnd.epson.quickanime":{"source":"iana","extensions":["qam"]},"application/vnd.epson.salt":{"source":"iana","extensions":["slt"]},"application/vnd.epson.ssf":{"source":"iana","extensions":["ssf"]},"application/vnd.ericsson.quickcall":{"source":"iana"},"application/vnd.espass-espass+zip":{"source":"iana","compressible":false},"application/vnd.eszigno3+xml":{"source":"iana","compressible":true,"extensions":["es3","et3"]},"application/vnd.etsi.aoc+xml":{"source":"iana","compressible":true},"application/vnd.etsi.asic-e+zip":{"source":"iana","compressible":false},"application/vnd.etsi.asic-s+zip":{"source":"iana","compressible":false},"application/vnd.etsi.cug+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvcommand+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvdiscovery+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvprofile+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsad-bc+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsad-cod+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsad-npvr+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvservice+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsync+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvueprofile+xml":{"source":"iana","compressible":true},"application/vnd.etsi.mcid+xml":{"source":"iana","compressible":true},"application/vnd.etsi.mheg5":{"source":"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{"source":"iana","compressible":true},"application/vnd.etsi.pstn+xml":{"source":"iana","compressible":true},"application/vnd.etsi.sci+xml":{"source":"iana","compressible":true},"application/vnd.etsi.simservs+xml":{"source":"iana","compressible":true},"application/vnd.etsi.timestamp-token":{"source":"iana"},"application/vnd.etsi.tsl+xml":{"source":"iana","compressible":true},"application/vnd.etsi.tsl.der":{"source":"iana"},"application/vnd.eudora.data":{"source":"iana"},"application/vnd.evolv.ecig.profile":{"source":"iana"},"application/vnd.evolv.ecig.settings":{"source":"iana"},"application/vnd.evolv.ecig.theme":{"source":"iana"},"application/vnd.exstream-empower+zip":{"source":"iana","compressible":false},"application/vnd.exstream-package":{"source":"iana"},"application/vnd.ezpix-album":{"source":"iana","extensions":["ez2"]},"application/vnd.ezpix-package":{"source":"iana","extensions":["ez3"]},"application/vnd.f-secure.mobile":{"source":"iana"},"application/vnd.fastcopy-disk-image":{"source":"iana"},"application/vnd.fdf":{"source":"iana","extensions":["fdf"]},"application/vnd.fdsn.mseed":{"source":"iana","extensions":["mseed"]},"application/vnd.fdsn.seed":{"source":"iana","extensions":["seed","dataless"]},"application/vnd.ffsns":{"source":"iana"},"application/vnd.ficlab.flb+zip":{"source":"iana","compressible":false},"application/vnd.filmit.zfc":{"source":"iana"},"application/vnd.fints":{"source":"iana"},"application/vnd.firemonkeys.cloudcell":{"source":"iana"},"application/vnd.flographit":{"source":"iana","extensions":["gph"]},"application/vnd.fluxtime.clip":{"source":"iana","extensions":["ftc"]},"application/vnd.font-fontforge-sfd":{"source":"iana"},"application/vnd.framemaker":{"source":"iana","extensions":["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{"source":"iana","extensions":["fnc"]},"application/vnd.frogans.ltf":{"source":"iana","extensions":["ltf"]},"application/vnd.fsc.weblaunch":{"source":"iana","extensions":["fsc"]},"application/vnd.fujifilm.fb.docuworks":{"source":"iana"},"application/vnd.fujifilm.fb.docuworks.binder":{"source":"iana"},"application/vnd.fujifilm.fb.docuworks.container":{"source":"iana"},"application/vnd.fujifilm.fb.jfi+xml":{"source":"iana","compressible":true},"application/vnd.fujitsu.oasys":{"source":"iana","extensions":["oas"]},"application/vnd.fujitsu.oasys2":{"source":"iana","extensions":["oa2"]},"application/vnd.fujitsu.oasys3":{"source":"iana","extensions":["oa3"]},"application/vnd.fujitsu.oasysgp":{"source":"iana","extensions":["fg5"]},"application/vnd.fujitsu.oasysprs":{"source":"iana","extensions":["bh2"]},"application/vnd.fujixerox.art-ex":{"source":"iana"},"application/vnd.fujixerox.art4":{"source":"iana"},"application/vnd.fujixerox.ddd":{"source":"iana","extensions":["ddd"]},"application/vnd.fujixerox.docuworks":{"source":"iana","extensions":["xdw"]},"application/vnd.fujixerox.docuworks.binder":{"source":"iana","extensions":["xbd"]},"application/vnd.fujixerox.docuworks.container":{"source":"iana"},"application/vnd.fujixerox.hbpl":{"source":"iana"},"application/vnd.fut-misnet":{"source":"iana"},"application/vnd.futoin+cbor":{"source":"iana"},"application/vnd.futoin+json":{"source":"iana","compressible":true},"application/vnd.fuzzysheet":{"source":"iana","extensions":["fzs"]},"application/vnd.genomatix.tuxedo":{"source":"iana","extensions":["txd"]},"application/vnd.gentics.grd+json":{"source":"iana","compressible":true},"application/vnd.geo+json":{"source":"iana","compressible":true},"application/vnd.geocube+xml":{"source":"iana","compressible":true},"application/vnd.geogebra.file":{"source":"iana","extensions":["ggb"]},"application/vnd.geogebra.slides":{"source":"iana"},"application/vnd.geogebra.tool":{"source":"iana","extensions":["ggt"]},"application/vnd.geometry-explorer":{"source":"iana","extensions":["gex","gre"]},"application/vnd.geonext":{"source":"iana","extensions":["gxt"]},"application/vnd.geoplan":{"source":"iana","extensions":["g2w"]},"application/vnd.geospace":{"source":"iana","extensions":["g3w"]},"application/vnd.gerber":{"source":"iana"},"application/vnd.globalplatform.card-content-mgt":{"source":"iana"},"application/vnd.globalplatform.card-content-mgt-response":{"source":"iana"},"application/vnd.gmx":{"source":"iana","extensions":["gmx"]},"application/vnd.google-apps.document":{"compressible":false,"extensions":["gdoc"]},"application/vnd.google-apps.presentation":{"compressible":false,"extensions":["gslides"]},"application/vnd.google-apps.spreadsheet":{"compressible":false,"extensions":["gsheet"]},"application/vnd.google-earth.kml+xml":{"source":"iana","compressible":true,"extensions":["kml"]},"application/vnd.google-earth.kmz":{"source":"iana","compressible":false,"extensions":["kmz"]},"application/vnd.gov.sk.e-form+xml":{"source":"iana","compressible":true},"application/vnd.gov.sk.e-form+zip":{"source":"iana","compressible":false},"application/vnd.gov.sk.xmldatacontainer+xml":{"source":"iana","compressible":true},"application/vnd.grafeq":{"source":"iana","extensions":["gqf","gqs"]},"application/vnd.gridmp":{"source":"iana"},"application/vnd.groove-account":{"source":"iana","extensions":["gac"]},"application/vnd.groove-help":{"source":"iana","extensions":["ghf"]},"application/vnd.groove-identity-message":{"source":"iana","extensions":["gim"]},"application/vnd.groove-injector":{"source":"iana","extensions":["grv"]},"application/vnd.groove-tool-message":{"source":"iana","extensions":["gtm"]},"application/vnd.groove-tool-template":{"source":"iana","extensions":["tpl"]},"application/vnd.groove-vcard":{"source":"iana","extensions":["vcg"]},"application/vnd.hal+json":{"source":"iana","compressible":true},"application/vnd.hal+xml":{"source":"iana","compressible":true,"extensions":["hal"]},"application/vnd.handheld-entertainment+xml":{"source":"iana","compressible":true,"extensions":["zmm"]},"application/vnd.hbci":{"source":"iana","extensions":["hbci"]},"application/vnd.hc+json":{"source":"iana","compressible":true},"application/vnd.hcl-bireports":{"source":"iana"},"application/vnd.hdt":{"source":"iana"},"application/vnd.heroku+json":{"source":"iana","compressible":true},"application/vnd.hhe.lesson-player":{"source":"iana","extensions":["les"]},"application/vnd.hp-hpgl":{"source":"iana","extensions":["hpgl"]},"application/vnd.hp-hpid":{"source":"iana","extensions":["hpid"]},"application/vnd.hp-hps":{"source":"iana","extensions":["hps"]},"application/vnd.hp-jlyt":{"source":"iana","extensions":["jlt"]},"application/vnd.hp-pcl":{"source":"iana","extensions":["pcl"]},"application/vnd.hp-pclxl":{"source":"iana","extensions":["pclxl"]},"application/vnd.httphone":{"source":"iana"},"application/vnd.hydrostatix.sof-data":{"source":"iana","extensions":["sfd-hdstx"]},"application/vnd.hyper+json":{"source":"iana","compressible":true},"application/vnd.hyper-item+json":{"source":"iana","compressible":true},"application/vnd.hyperdrive+json":{"source":"iana","compressible":true},"application/vnd.hzn-3d-crossword":{"source":"iana"},"application/vnd.ibm.afplinedata":{"source":"iana"},"application/vnd.ibm.electronic-media":{"source":"iana"},"application/vnd.ibm.minipay":{"source":"iana","extensions":["mpy"]},"application/vnd.ibm.modcap":{"source":"iana","extensions":["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{"source":"iana","extensions":["irm"]},"application/vnd.ibm.secure-container":{"source":"iana","extensions":["sc"]},"application/vnd.iccprofile":{"source":"iana","extensions":["icc","icm"]},"application/vnd.ieee.1905":{"source":"iana"},"application/vnd.igloader":{"source":"iana","extensions":["igl"]},"application/vnd.imagemeter.folder+zip":{"source":"iana","compressible":false},"application/vnd.imagemeter.image+zip":{"source":"iana","compressible":false},"application/vnd.immervision-ivp":{"source":"iana","extensions":["ivp"]},"application/vnd.immervision-ivu":{"source":"iana","extensions":["ivu"]},"application/vnd.ims.imsccv1p1":{"source":"iana"},"application/vnd.ims.imsccv1p2":{"source":"iana"},"application/vnd.ims.imsccv1p3":{"source":"iana"},"application/vnd.ims.lis.v2.result+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolproxy+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolproxy.id+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolsettings+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolsettings.simple+json":{"source":"iana","compressible":true},"application/vnd.informedcontrol.rms+xml":{"source":"iana","compressible":true},"application/vnd.informix-visionary":{"source":"iana"},"application/vnd.infotech.project":{"source":"iana"},"application/vnd.infotech.project+xml":{"source":"iana","compressible":true},"application/vnd.innopath.wamp.notification":{"source":"iana"},"application/vnd.insors.igm":{"source":"iana","extensions":["igm"]},"application/vnd.intercon.formnet":{"source":"iana","extensions":["xpw","xpx"]},"application/vnd.intergeo":{"source":"iana","extensions":["i2g"]},"application/vnd.intertrust.digibox":{"source":"iana"},"application/vnd.intertrust.nncp":{"source":"iana"},"application/vnd.intu.qbo":{"source":"iana","extensions":["qbo"]},"application/vnd.intu.qfx":{"source":"iana","extensions":["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.conceptitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.knowledgeitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.newsitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.newsmessage+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.packageitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.planningitem+xml":{"source":"iana","compressible":true},"application/vnd.ipunplugged.rcprofile":{"source":"iana","extensions":["rcprofile"]},"application/vnd.irepository.package+xml":{"source":"iana","compressible":true,"extensions":["irp"]},"application/vnd.is-xpr":{"source":"iana","extensions":["xpr"]},"application/vnd.isac.fcs":{"source":"iana","extensions":["fcs"]},"application/vnd.iso11783-10+zip":{"source":"iana","compressible":false},"application/vnd.jam":{"source":"iana","extensions":["jam"]},"application/vnd.japannet-directory-service":{"source":"iana"},"application/vnd.japannet-jpnstore-wakeup":{"source":"iana"},"application/vnd.japannet-payment-wakeup":{"source":"iana"},"application/vnd.japannet-registration":{"source":"iana"},"application/vnd.japannet-registration-wakeup":{"source":"iana"},"application/vnd.japannet-setstore-wakeup":{"source":"iana"},"application/vnd.japannet-verification":{"source":"iana"},"application/vnd.japannet-verification-wakeup":{"source":"iana"},"application/vnd.jcp.javame.midlet-rms":{"source":"iana","extensions":["rms"]},"application/vnd.jisp":{"source":"iana","extensions":["jisp"]},"application/vnd.joost.joda-archive":{"source":"iana","extensions":["joda"]},"application/vnd.jsk.isdn-ngn":{"source":"iana"},"application/vnd.kahootz":{"source":"iana","extensions":["ktz","ktr"]},"application/vnd.kde.karbon":{"source":"iana","extensions":["karbon"]},"application/vnd.kde.kchart":{"source":"iana","extensions":["chrt"]},"application/vnd.kde.kformula":{"source":"iana","extensions":["kfo"]},"application/vnd.kde.kivio":{"source":"iana","extensions":["flw"]},"application/vnd.kde.kontour":{"source":"iana","extensions":["kon"]},"application/vnd.kde.kpresenter":{"source":"iana","extensions":["kpr","kpt"]},"application/vnd.kde.kspread":{"source":"iana","extensions":["ksp"]},"application/vnd.kde.kword":{"source":"iana","extensions":["kwd","kwt"]},"application/vnd.kenameaapp":{"source":"iana","extensions":["htke"]},"application/vnd.kidspiration":{"source":"iana","extensions":["kia"]},"application/vnd.kinar":{"source":"iana","extensions":["kne","knp"]},"application/vnd.koan":{"source":"iana","extensions":["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{"source":"iana","extensions":["sse"]},"application/vnd.las":{"source":"iana"},"application/vnd.las.las+json":{"source":"iana","compressible":true},"application/vnd.las.las+xml":{"source":"iana","compressible":true,"extensions":["lasxml"]},"application/vnd.laszip":{"source":"iana"},"application/vnd.leap+json":{"source":"iana","compressible":true},"application/vnd.liberty-request+xml":{"source":"iana","compressible":true},"application/vnd.llamagraphics.life-balance.desktop":{"source":"iana","extensions":["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{"source":"iana","compressible":true,"extensions":["lbe"]},"application/vnd.logipipe.circuit+zip":{"source":"iana","compressible":false},"application/vnd.loom":{"source":"iana"},"application/vnd.lotus-1-2-3":{"source":"iana","extensions":["123"]},"application/vnd.lotus-approach":{"source":"iana","extensions":["apr"]},"application/vnd.lotus-freelance":{"source":"iana","extensions":["pre"]},"application/vnd.lotus-notes":{"source":"iana","extensions":["nsf"]},"application/vnd.lotus-organizer":{"source":"iana","extensions":["org"]},"application/vnd.lotus-screencam":{"source":"iana","extensions":["scm"]},"application/vnd.lotus-wordpro":{"source":"iana","extensions":["lwp"]},"application/vnd.macports.portpkg":{"source":"iana","extensions":["portpkg"]},"application/vnd.mapbox-vector-tile":{"source":"iana","extensions":["mvt"]},"application/vnd.marlin.drm.actiontoken+xml":{"source":"iana","compressible":true},"application/vnd.marlin.drm.conftoken+xml":{"source":"iana","compressible":true},"application/vnd.marlin.drm.license+xml":{"source":"iana","compressible":true},"application/vnd.marlin.drm.mdcf":{"source":"iana"},"application/vnd.mason+json":{"source":"iana","compressible":true},"application/vnd.maxmind.maxmind-db":{"source":"iana"},"application/vnd.mcd":{"source":"iana","extensions":["mcd"]},"application/vnd.medcalcdata":{"source":"iana","extensions":["mc1"]},"application/vnd.mediastation.cdkey":{"source":"iana","extensions":["cdkey"]},"application/vnd.meridian-slingshot":{"source":"iana"},"application/vnd.mfer":{"source":"iana","extensions":["mwf"]},"application/vnd.mfmp":{"source":"iana","extensions":["mfm"]},"application/vnd.micro+json":{"source":"iana","compressible":true},"application/vnd.micrografx.flo":{"source":"iana","extensions":["flo"]},"application/vnd.micrografx.igx":{"source":"iana","extensions":["igx"]},"application/vnd.microsoft.portable-executable":{"source":"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{"source":"iana"},"application/vnd.miele+json":{"source":"iana","compressible":true},"application/vnd.mif":{"source":"iana","extensions":["mif"]},"application/vnd.minisoft-hp3000-save":{"source":"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{"source":"iana"},"application/vnd.mobius.daf":{"source":"iana","extensions":["daf"]},"application/vnd.mobius.dis":{"source":"iana","extensions":["dis"]},"application/vnd.mobius.mbk":{"source":"iana","extensions":["mbk"]},"application/vnd.mobius.mqy":{"source":"iana","extensions":["mqy"]},"application/vnd.mobius.msl":{"source":"iana","extensions":["msl"]},"application/vnd.mobius.plc":{"source":"iana","extensions":["plc"]},"application/vnd.mobius.txf":{"source":"iana","extensions":["txf"]},"application/vnd.mophun.application":{"source":"iana","extensions":["mpn"]},"application/vnd.mophun.certificate":{"source":"iana","extensions":["mpc"]},"application/vnd.motorola.flexsuite":{"source":"iana"},"application/vnd.motorola.flexsuite.adsi":{"source":"iana"},"application/vnd.motorola.flexsuite.fis":{"source":"iana"},"application/vnd.motorola.flexsuite.gotap":{"source":"iana"},"application/vnd.motorola.flexsuite.kmr":{"source":"iana"},"application/vnd.motorola.flexsuite.ttc":{"source":"iana"},"application/vnd.motorola.flexsuite.wem":{"source":"iana"},"application/vnd.motorola.iprm":{"source":"iana"},"application/vnd.mozilla.xul+xml":{"source":"iana","compressible":true,"extensions":["xul"]},"application/vnd.ms-3mfdocument":{"source":"iana"},"application/vnd.ms-artgalry":{"source":"iana","extensions":["cil"]},"application/vnd.ms-asf":{"source":"iana"},"application/vnd.ms-cab-compressed":{"source":"iana","extensions":["cab"]},"application/vnd.ms-color.iccprofile":{"source":"apache"},"application/vnd.ms-excel":{"source":"iana","compressible":false,"extensions":["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{"source":"iana","extensions":["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{"source":"iana","extensions":["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{"source":"iana","extensions":["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{"source":"iana","extensions":["xltm"]},"application/vnd.ms-fontobject":{"source":"iana","compressible":true,"extensions":["eot"]},"application/vnd.ms-htmlhelp":{"source":"iana","extensions":["chm"]},"application/vnd.ms-ims":{"source":"iana","extensions":["ims"]},"application/vnd.ms-lrm":{"source":"iana","extensions":["lrm"]},"application/vnd.ms-office.activex+xml":{"source":"iana","compressible":true},"application/vnd.ms-officetheme":{"source":"iana","extensions":["thmx"]},"application/vnd.ms-opentype":{"source":"apache","compressible":true},"application/vnd.ms-outlook":{"compressible":false,"extensions":["msg"]},"application/vnd.ms-package.obfuscated-opentype":{"source":"apache"},"application/vnd.ms-pki.seccat":{"source":"apache","extensions":["cat"]},"application/vnd.ms-pki.stl":{"source":"apache","extensions":["stl"]},"application/vnd.ms-playready.initiator+xml":{"source":"iana","compressible":true},"application/vnd.ms-powerpoint":{"source":"iana","compressible":false,"extensions":["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{"source":"iana","extensions":["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{"source":"iana","extensions":["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{"source":"iana","extensions":["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{"source":"iana","extensions":["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{"source":"iana","extensions":["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{"source":"iana","compressible":true},"application/vnd.ms-printing.printticket+xml":{"source":"apache","compressible":true},"application/vnd.ms-printschematicket+xml":{"source":"iana","compressible":true},"application/vnd.ms-project":{"source":"iana","extensions":["mpp","mpt"]},"application/vnd.ms-tnef":{"source":"iana"},"application/vnd.ms-windows.devicepairing":{"source":"iana"},"application/vnd.ms-windows.nwprinting.oob":{"source":"iana"},"application/vnd.ms-windows.printerpairing":{"source":"iana"},"application/vnd.ms-windows.wsd.oob":{"source":"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{"source":"iana"},"application/vnd.ms-wmdrm.lic-resp":{"source":"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{"source":"iana"},"application/vnd.ms-wmdrm.meter-resp":{"source":"iana"},"application/vnd.ms-word.document.macroenabled.12":{"source":"iana","extensions":["docm"]},"application/vnd.ms-word.template.macroenabled.12":{"source":"iana","extensions":["dotm"]},"application/vnd.ms-works":{"source":"iana","extensions":["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{"source":"iana","extensions":["wpl"]},"application/vnd.ms-xpsdocument":{"source":"iana","compressible":false,"extensions":["xps"]},"application/vnd.msa-disk-image":{"source":"iana"},"application/vnd.mseq":{"source":"iana","extensions":["mseq"]},"application/vnd.msign":{"source":"iana"},"application/vnd.multiad.creator":{"source":"iana"},"application/vnd.multiad.creator.cif":{"source":"iana"},"application/vnd.music-niff":{"source":"iana"},"application/vnd.musician":{"source":"iana","extensions":["mus"]},"application/vnd.muvee.style":{"source":"iana","extensions":["msty"]},"application/vnd.mynfc":{"source":"iana","extensions":["taglet"]},"application/vnd.ncd.control":{"source":"iana"},"application/vnd.ncd.reference":{"source":"iana"},"application/vnd.nearst.inv+json":{"source":"iana","compressible":true},"application/vnd.nebumind.line":{"source":"iana"},"application/vnd.nervana":{"source":"iana"},"application/vnd.netfpx":{"source":"iana"},"application/vnd.neurolanguage.nlu":{"source":"iana","extensions":["nlu"]},"application/vnd.nimn":{"source":"iana"},"application/vnd.nintendo.nitro.rom":{"source":"iana"},"application/vnd.nintendo.snes.rom":{"source":"iana"},"application/vnd.nitf":{"source":"iana","extensions":["ntf","nitf"]},"application/vnd.noblenet-directory":{"source":"iana","extensions":["nnd"]},"application/vnd.noblenet-sealer":{"source":"iana","extensions":["nns"]},"application/vnd.noblenet-web":{"source":"iana","extensions":["nnw"]},"application/vnd.nokia.catalogs":{"source":"iana"},"application/vnd.nokia.conml+wbxml":{"source":"iana"},"application/vnd.nokia.conml+xml":{"source":"iana","compressible":true},"application/vnd.nokia.iptv.config+xml":{"source":"iana","compressible":true},"application/vnd.nokia.isds-radio-presets":{"source":"iana"},"application/vnd.nokia.landmark+wbxml":{"source":"iana"},"application/vnd.nokia.landmark+xml":{"source":"iana","compressible":true},"application/vnd.nokia.landmarkcollection+xml":{"source":"iana","compressible":true},"application/vnd.nokia.n-gage.ac+xml":{"source":"iana","compressible":true,"extensions":["ac"]},"application/vnd.nokia.n-gage.data":{"source":"iana","extensions":["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{"source":"iana","extensions":["n-gage"]},"application/vnd.nokia.ncd":{"source":"iana"},"application/vnd.nokia.pcd+wbxml":{"source":"iana"},"application/vnd.nokia.pcd+xml":{"source":"iana","compressible":true},"application/vnd.nokia.radio-preset":{"source":"iana","extensions":["rpst"]},"application/vnd.nokia.radio-presets":{"source":"iana","extensions":["rpss"]},"application/vnd.novadigm.edm":{"source":"iana","extensions":["edm"]},"application/vnd.novadigm.edx":{"source":"iana","extensions":["edx"]},"application/vnd.novadigm.ext":{"source":"iana","extensions":["ext"]},"application/vnd.ntt-local.content-share":{"source":"iana"},"application/vnd.ntt-local.file-transfer":{"source":"iana"},"application/vnd.ntt-local.ogw_remote-access":{"source":"iana"},"application/vnd.ntt-local.sip-ta_remote":{"source":"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{"source":"iana"},"application/vnd.oasis.opendocument.chart":{"source":"iana","extensions":["odc"]},"application/vnd.oasis.opendocument.chart-template":{"source":"iana","extensions":["otc"]},"application/vnd.oasis.opendocument.database":{"source":"iana","extensions":["odb"]},"application/vnd.oasis.opendocument.formula":{"source":"iana","extensions":["odf"]},"application/vnd.oasis.opendocument.formula-template":{"source":"iana","extensions":["odft"]},"application/vnd.oasis.opendocument.graphics":{"source":"iana","compressible":false,"extensions":["odg"]},"application/vnd.oasis.opendocument.graphics-template":{"source":"iana","extensions":["otg"]},"application/vnd.oasis.opendocument.image":{"source":"iana","extensions":["odi"]},"application/vnd.oasis.opendocument.image-template":{"source":"iana","extensions":["oti"]},"application/vnd.oasis.opendocument.presentation":{"source":"iana","compressible":false,"extensions":["odp"]},"application/vnd.oasis.opendocument.presentation-template":{"source":"iana","extensions":["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{"source":"iana","compressible":false,"extensions":["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{"source":"iana","extensions":["ots"]},"application/vnd.oasis.opendocument.text":{"source":"iana","compressible":false,"extensions":["odt"]},"application/vnd.oasis.opendocument.text-master":{"source":"iana","extensions":["odm"]},"application/vnd.oasis.opendocument.text-template":{"source":"iana","extensions":["ott"]},"application/vnd.oasis.opendocument.text-web":{"source":"iana","extensions":["oth"]},"application/vnd.obn":{"source":"iana"},"application/vnd.ocf+cbor":{"source":"iana"},"application/vnd.oci.image.manifest.v1+json":{"source":"iana","compressible":true},"application/vnd.oftn.l10n+json":{"source":"iana","compressible":true},"application/vnd.oipf.contentaccessdownload+xml":{"source":"iana","compressible":true},"application/vnd.oipf.contentaccessstreaming+xml":{"source":"iana","compressible":true},"application/vnd.oipf.cspg-hexbinary":{"source":"iana"},"application/vnd.oipf.dae.svg+xml":{"source":"iana","compressible":true},"application/vnd.oipf.dae.xhtml+xml":{"source":"iana","compressible":true},"application/vnd.oipf.mippvcontrolmessage+xml":{"source":"iana","compressible":true},"application/vnd.oipf.pae.gem":{"source":"iana"},"application/vnd.oipf.spdiscovery+xml":{"source":"iana","compressible":true},"application/vnd.oipf.spdlist+xml":{"source":"iana","compressible":true},"application/vnd.oipf.ueprofile+xml":{"source":"iana","compressible":true},"application/vnd.oipf.userprofile+xml":{"source":"iana","compressible":true},"application/vnd.olpc-sugar":{"source":"iana","extensions":["xo"]},"application/vnd.oma-scws-config":{"source":"iana"},"application/vnd.oma-scws-http-request":{"source":"iana"},"application/vnd.oma-scws-http-response":{"source":"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.drm-trigger+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.imd+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.ltkm":{"source":"iana"},"application/vnd.oma.bcast.notification+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.provisioningtrigger":{"source":"iana"},"application/vnd.oma.bcast.sgboot":{"source":"iana"},"application/vnd.oma.bcast.sgdd+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.sgdu":{"source":"iana"},"application/vnd.oma.bcast.simple-symbol-container":{"source":"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.sprov+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.stkm":{"source":"iana"},"application/vnd.oma.cab-address-book+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-feature-handler+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-pcc+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-subs-invite+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-user-prefs+xml":{"source":"iana","compressible":true},"application/vnd.oma.dcd":{"source":"iana"},"application/vnd.oma.dcdc":{"source":"iana"},"application/vnd.oma.dd2+xml":{"source":"iana","compressible":true,"extensions":["dd2"]},"application/vnd.oma.drm.risd+xml":{"source":"iana","compressible":true},"application/vnd.oma.group-usage-list+xml":{"source":"iana","compressible":true},"application/vnd.oma.lwm2m+cbor":{"source":"iana"},"application/vnd.oma.lwm2m+json":{"source":"iana","compressible":true},"application/vnd.oma.lwm2m+tlv":{"source":"iana"},"application/vnd.oma.pal+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.detailed-progress-report+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.final-report+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.groups+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.invocation-descriptor+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.optimized-progress-report+xml":{"source":"iana","compressible":true},"application/vnd.oma.push":{"source":"iana"},"application/vnd.oma.scidm.messages+xml":{"source":"iana","compressible":true},"application/vnd.oma.xcap-directory+xml":{"source":"iana","compressible":true},"application/vnd.omads-email+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.omads-file+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.omads-folder+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.omaloc-supl-init":{"source":"iana"},"application/vnd.onepager":{"source":"iana"},"application/vnd.onepagertamp":{"source":"iana"},"application/vnd.onepagertamx":{"source":"iana"},"application/vnd.onepagertat":{"source":"iana"},"application/vnd.onepagertatp":{"source":"iana"},"application/vnd.onepagertatx":{"source":"iana"},"application/vnd.openblox.game+xml":{"source":"iana","compressible":true,"extensions":["obgx"]},"application/vnd.openblox.game-binary":{"source":"iana"},"application/vnd.openeye.oeb":{"source":"iana"},"application/vnd.openofficeorg.extension":{"source":"apache","extensions":["oxt"]},"application/vnd.openstreetmap.data+xml":{"source":"iana","compressible":true,"extensions":["osm"]},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawing+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{"source":"iana","compressible":false,"extensions":["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slide":{"source":"iana","extensions":["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{"source":"iana","extensions":["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.template":{"source":"iana","extensions":["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"source":"iana","compressible":false,"extensions":["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{"source":"iana","extensions":["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.theme+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.vmldrawing":{"source":"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{"source":"iana","compressible":false,"extensions":["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{"source":"iana","extensions":["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-package.core-properties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-package.relationships+xml":{"source":"iana","compressible":true},"application/vnd.oracle.resource+json":{"source":"iana","compressible":true},"application/vnd.orange.indata":{"source":"iana"},"application/vnd.osa.netdeploy":{"source":"iana"},"application/vnd.osgeo.mapguide.package":{"source":"iana","extensions":["mgp"]},"application/vnd.osgi.bundle":{"source":"iana"},"application/vnd.osgi.dp":{"source":"iana","extensions":["dp"]},"application/vnd.osgi.subsystem":{"source":"iana","extensions":["esa"]},"application/vnd.otps.ct-kip+xml":{"source":"iana","compressible":true},"application/vnd.oxli.countgraph":{"source":"iana"},"application/vnd.pagerduty+json":{"source":"iana","compressible":true},"application/vnd.palm":{"source":"iana","extensions":["pdb","pqa","oprc"]},"application/vnd.panoply":{"source":"iana"},"application/vnd.paos.xml":{"source":"iana"},"application/vnd.patentdive":{"source":"iana"},"application/vnd.patientecommsdoc":{"source":"iana"},"application/vnd.pawaafile":{"source":"iana","extensions":["paw"]},"application/vnd.pcos":{"source":"iana"},"application/vnd.pg.format":{"source":"iana","extensions":["str"]},"application/vnd.pg.osasli":{"source":"iana","extensions":["ei6"]},"application/vnd.piaccess.application-licence":{"source":"iana"},"application/vnd.picsel":{"source":"iana","extensions":["efif"]},"application/vnd.pmi.widget":{"source":"iana","extensions":["wg"]},"application/vnd.poc.group-advertisement+xml":{"source":"iana","compressible":true},"application/vnd.pocketlearn":{"source":"iana","extensions":["plf"]},"application/vnd.powerbuilder6":{"source":"iana","extensions":["pbd"]},"application/vnd.powerbuilder6-s":{"source":"iana"},"application/vnd.powerbuilder7":{"source":"iana"},"application/vnd.powerbuilder7-s":{"source":"iana"},"application/vnd.powerbuilder75":{"source":"iana"},"application/vnd.powerbuilder75-s":{"source":"iana"},"application/vnd.preminet":{"source":"iana"},"application/vnd.previewsystems.box":{"source":"iana","extensions":["box"]},"application/vnd.proteus.magazine":{"source":"iana","extensions":["mgz"]},"application/vnd.psfs":{"source":"iana"},"application/vnd.publishare-delta-tree":{"source":"iana","extensions":["qps"]},"application/vnd.pvi.ptid1":{"source":"iana","extensions":["ptid"]},"application/vnd.pwg-multiplexed":{"source":"iana"},"application/vnd.pwg-xhtml-print+xml":{"source":"iana","compressible":true},"application/vnd.qualcomm.brew-app-res":{"source":"iana"},"application/vnd.quarantainenet":{"source":"iana"},"application/vnd.quark.quarkxpress":{"source":"iana","extensions":["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{"source":"iana"},"application/vnd.radisys.moml+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-conf+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-conn+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-dialog+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-stream+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-conf+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-base+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-fax-detect+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-group+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-speech+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-transform+xml":{"source":"iana","compressible":true},"application/vnd.rainstor.data":{"source":"iana"},"application/vnd.rapid":{"source":"iana"},"application/vnd.rar":{"source":"iana","extensions":["rar"]},"application/vnd.realvnc.bed":{"source":"iana","extensions":["bed"]},"application/vnd.recordare.musicxml":{"source":"iana","extensions":["mxl"]},"application/vnd.recordare.musicxml+xml":{"source":"iana","compressible":true,"extensions":["musicxml"]},"application/vnd.renlearn.rlprint":{"source":"iana"},"application/vnd.restful+json":{"source":"iana","compressible":true},"application/vnd.rig.cryptonote":{"source":"iana","extensions":["cryptonote"]},"application/vnd.rim.cod":{"source":"apache","extensions":["cod"]},"application/vnd.rn-realmedia":{"source":"apache","extensions":["rm"]},"application/vnd.rn-realmedia-vbr":{"source":"apache","extensions":["rmvb"]},"application/vnd.route66.link66+xml":{"source":"iana","compressible":true,"extensions":["link66"]},"application/vnd.rs-274x":{"source":"iana"},"application/vnd.ruckus.download":{"source":"iana"},"application/vnd.s3sms":{"source":"iana"},"application/vnd.sailingtracker.track":{"source":"iana","extensions":["st"]},"application/vnd.sar":{"source":"iana"},"application/vnd.sbm.cid":{"source":"iana"},"application/vnd.sbm.mid2":{"source":"iana"},"application/vnd.scribus":{"source":"iana"},"application/vnd.sealed.3df":{"source":"iana"},"application/vnd.sealed.csf":{"source":"iana"},"application/vnd.sealed.doc":{"source":"iana"},"application/vnd.sealed.eml":{"source":"iana"},"application/vnd.sealed.mht":{"source":"iana"},"application/vnd.sealed.net":{"source":"iana"},"application/vnd.sealed.ppt":{"source":"iana"},"application/vnd.sealed.tiff":{"source":"iana"},"application/vnd.sealed.xls":{"source":"iana"},"application/vnd.sealedmedia.softseal.html":{"source":"iana"},"application/vnd.sealedmedia.softseal.pdf":{"source":"iana"},"application/vnd.seemail":{"source":"iana","extensions":["see"]},"application/vnd.seis+json":{"source":"iana","compressible":true},"application/vnd.sema":{"source":"iana","extensions":["sema"]},"application/vnd.semd":{"source":"iana","extensions":["semd"]},"application/vnd.semf":{"source":"iana","extensions":["semf"]},"application/vnd.shade-save-file":{"source":"iana"},"application/vnd.shana.informed.formdata":{"source":"iana","extensions":["ifm"]},"application/vnd.shana.informed.formtemplate":{"source":"iana","extensions":["itp"]},"application/vnd.shana.informed.interchange":{"source":"iana","extensions":["iif"]},"application/vnd.shana.informed.package":{"source":"iana","extensions":["ipk"]},"application/vnd.shootproof+json":{"source":"iana","compressible":true},"application/vnd.shopkick+json":{"source":"iana","compressible":true},"application/vnd.shp":{"source":"iana"},"application/vnd.shx":{"source":"iana"},"application/vnd.sigrok.session":{"source":"iana"},"application/vnd.simtech-mindmapper":{"source":"iana","extensions":["twd","twds"]},"application/vnd.siren+json":{"source":"iana","compressible":true},"application/vnd.smaf":{"source":"iana","extensions":["mmf"]},"application/vnd.smart.notebook":{"source":"iana"},"application/vnd.smart.teacher":{"source":"iana","extensions":["teacher"]},"application/vnd.snesdev-page-table":{"source":"iana"},"application/vnd.software602.filler.form+xml":{"source":"iana","compressible":true,"extensions":["fo"]},"application/vnd.software602.filler.form-xml-zip":{"source":"iana"},"application/vnd.solent.sdkm+xml":{"source":"iana","compressible":true,"extensions":["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{"source":"iana","extensions":["dxp"]},"application/vnd.spotfire.sfs":{"source":"iana","extensions":["sfs"]},"application/vnd.sqlite3":{"source":"iana"},"application/vnd.sss-cod":{"source":"iana"},"application/vnd.sss-dtf":{"source":"iana"},"application/vnd.sss-ntf":{"source":"iana"},"application/vnd.stardivision.calc":{"source":"apache","extensions":["sdc"]},"application/vnd.stardivision.draw":{"source":"apache","extensions":["sda"]},"application/vnd.stardivision.impress":{"source":"apache","extensions":["sdd"]},"application/vnd.stardivision.math":{"source":"apache","extensions":["smf"]},"application/vnd.stardivision.writer":{"source":"apache","extensions":["sdw","vor"]},"application/vnd.stardivision.writer-global":{"source":"apache","extensions":["sgl"]},"application/vnd.stepmania.package":{"source":"iana","extensions":["smzip"]},"application/vnd.stepmania.stepchart":{"source":"iana","extensions":["sm"]},"application/vnd.street-stream":{"source":"iana"},"application/vnd.sun.wadl+xml":{"source":"iana","compressible":true,"extensions":["wadl"]},"application/vnd.sun.xml.calc":{"source":"apache","extensions":["sxc"]},"application/vnd.sun.xml.calc.template":{"source":"apache","extensions":["stc"]},"application/vnd.sun.xml.draw":{"source":"apache","extensions":["sxd"]},"application/vnd.sun.xml.draw.template":{"source":"apache","extensions":["std"]},"application/vnd.sun.xml.impress":{"source":"apache","extensions":["sxi"]},"application/vnd.sun.xml.impress.template":{"source":"apache","extensions":["sti"]},"application/vnd.sun.xml.math":{"source":"apache","extensions":["sxm"]},"application/vnd.sun.xml.writer":{"source":"apache","extensions":["sxw"]},"application/vnd.sun.xml.writer.global":{"source":"apache","extensions":["sxg"]},"application/vnd.sun.xml.writer.template":{"source":"apache","extensions":["stw"]},"application/vnd.sus-calendar":{"source":"iana","extensions":["sus","susp"]},"application/vnd.svd":{"source":"iana","extensions":["svd"]},"application/vnd.swiftview-ics":{"source":"iana"},"application/vnd.sycle+xml":{"source":"iana","compressible":true},"application/vnd.symbian.install":{"source":"apache","extensions":["sis","sisx"]},"application/vnd.syncml+xml":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["xsm"]},"application/vnd.syncml.dm+wbxml":{"source":"iana","charset":"UTF-8","extensions":["bdm"]},"application/vnd.syncml.dm+xml":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["xdm"]},"application/vnd.syncml.dm.notification":{"source":"iana"},"application/vnd.syncml.dmddf+wbxml":{"source":"iana"},"application/vnd.syncml.dmddf+xml":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{"source":"iana"},"application/vnd.syncml.dmtnds+xml":{"source":"iana","charset":"UTF-8","compressible":true},"application/vnd.syncml.ds.notification":{"source":"iana"},"application/vnd.tableschema+json":{"source":"iana","compressible":true},"application/vnd.tao.intent-module-archive":{"source":"iana","extensions":["tao"]},"application/vnd.tcpdump.pcap":{"source":"iana","extensions":["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{"source":"iana","compressible":true},"application/vnd.tmd.mediaflex.api+xml":{"source":"iana","compressible":true},"application/vnd.tml":{"source":"iana"},"application/vnd.tmobile-livetv":{"source":"iana","extensions":["tmo"]},"application/vnd.tri.onesource":{"source":"iana"},"application/vnd.trid.tpt":{"source":"iana","extensions":["tpt"]},"application/vnd.triscape.mxs":{"source":"iana","extensions":["mxs"]},"application/vnd.trueapp":{"source":"iana","extensions":["tra"]},"application/vnd.truedoc":{"source":"iana"},"application/vnd.ubisoft.webplayer":{"source":"iana"},"application/vnd.ufdl":{"source":"iana","extensions":["ufd","ufdl"]},"application/vnd.uiq.theme":{"source":"iana","extensions":["utz"]},"application/vnd.umajin":{"source":"iana","extensions":["umj"]},"application/vnd.unity":{"source":"iana","extensions":["unityweb"]},"application/vnd.uoml+xml":{"source":"iana","compressible":true,"extensions":["uoml"]},"application/vnd.uplanet.alert":{"source":"iana"},"application/vnd.uplanet.alert-wbxml":{"source":"iana"},"application/vnd.uplanet.bearer-choice":{"source":"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{"source":"iana"},"application/vnd.uplanet.cacheop":{"source":"iana"},"application/vnd.uplanet.cacheop-wbxml":{"source":"iana"},"application/vnd.uplanet.channel":{"source":"iana"},"application/vnd.uplanet.channel-wbxml":{"source":"iana"},"application/vnd.uplanet.list":{"source":"iana"},"application/vnd.uplanet.list-wbxml":{"source":"iana"},"application/vnd.uplanet.listcmd":{"source":"iana"},"application/vnd.uplanet.listcmd-wbxml":{"source":"iana"},"application/vnd.uplanet.signal":{"source":"iana"},"application/vnd.uri-map":{"source":"iana"},"application/vnd.valve.source.material":{"source":"iana"},"application/vnd.vcx":{"source":"iana","extensions":["vcx"]},"application/vnd.vd-study":{"source":"iana"},"application/vnd.vectorworks":{"source":"iana"},"application/vnd.vel+json":{"source":"iana","compressible":true},"application/vnd.verimatrix.vcas":{"source":"iana"},"application/vnd.veryant.thin":{"source":"iana"},"application/vnd.ves.encrypted":{"source":"iana"},"application/vnd.vidsoft.vidconference":{"source":"iana"},"application/vnd.visio":{"source":"iana","extensions":["vsd","vst","vss","vsw"]},"application/vnd.visionary":{"source":"iana","extensions":["vis"]},"application/vnd.vividence.scriptfile":{"source":"iana"},"application/vnd.vsf":{"source":"iana","extensions":["vsf"]},"application/vnd.wap.sic":{"source":"iana"},"application/vnd.wap.slc":{"source":"iana"},"application/vnd.wap.wbxml":{"source":"iana","charset":"UTF-8","extensions":["wbxml"]},"application/vnd.wap.wmlc":{"source":"iana","extensions":["wmlc"]},"application/vnd.wap.wmlscriptc":{"source":"iana","extensions":["wmlsc"]},"application/vnd.webturbo":{"source":"iana","extensions":["wtb"]},"application/vnd.wfa.dpp":{"source":"iana"},"application/vnd.wfa.p2p":{"source":"iana"},"application/vnd.wfa.wsc":{"source":"iana"},"application/vnd.windows.devicepairing":{"source":"iana"},"application/vnd.wmc":{"source":"iana"},"application/vnd.wmf.bootstrap":{"source":"iana"},"application/vnd.wolfram.mathematica":{"source":"iana"},"application/vnd.wolfram.mathematica.package":{"source":"iana"},"application/vnd.wolfram.player":{"source":"iana","extensions":["nbp"]},"application/vnd.wordperfect":{"source":"iana","extensions":["wpd"]},"application/vnd.wqd":{"source":"iana","extensions":["wqd"]},"application/vnd.wrq-hp3000-labelled":{"source":"iana"},"application/vnd.wt.stf":{"source":"iana","extensions":["stf"]},"application/vnd.wv.csp+wbxml":{"source":"iana"},"application/vnd.wv.csp+xml":{"source":"iana","compressible":true},"application/vnd.wv.ssp+xml":{"source":"iana","compressible":true},"application/vnd.xacml+json":{"source":"iana","compressible":true},"application/vnd.xara":{"source":"iana","extensions":["xar"]},"application/vnd.xfdl":{"source":"iana","extensions":["xfdl"]},"application/vnd.xfdl.webform":{"source":"iana"},"application/vnd.xmi+xml":{"source":"iana","compressible":true},"application/vnd.xmpie.cpkg":{"source":"iana"},"application/vnd.xmpie.dpkg":{"source":"iana"},"application/vnd.xmpie.plan":{"source":"iana"},"application/vnd.xmpie.ppkg":{"source":"iana"},"application/vnd.xmpie.xlim":{"source":"iana"},"application/vnd.yamaha.hv-dic":{"source":"iana","extensions":["hvd"]},"application/vnd.yamaha.hv-script":{"source":"iana","extensions":["hvs"]},"application/vnd.yamaha.hv-voice":{"source":"iana","extensions":["hvp"]},"application/vnd.yamaha.openscoreformat":{"source":"iana","extensions":["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{"source":"iana","compressible":true,"extensions":["osfpvg"]},"application/vnd.yamaha.remote-setup":{"source":"iana"},"application/vnd.yamaha.smaf-audio":{"source":"iana","extensions":["saf"]},"application/vnd.yamaha.smaf-phrase":{"source":"iana","extensions":["spf"]},"application/vnd.yamaha.through-ngn":{"source":"iana"},"application/vnd.yamaha.tunnel-udpencap":{"source":"iana"},"application/vnd.yaoweme":{"source":"iana"},"application/vnd.yellowriver-custom-menu":{"source":"iana","extensions":["cmp"]},"application/vnd.youtube.yt":{"source":"iana"},"application/vnd.zul":{"source":"iana","extensions":["zir","zirz"]},"application/vnd.zzazz.deck+xml":{"source":"iana","compressible":true,"extensions":["zaz"]},"application/voicexml+xml":{"source":"iana","compressible":true,"extensions":["vxml"]},"application/voucher-cms+json":{"source":"iana","compressible":true},"application/vq-rtcpxr":{"source":"iana"},"application/wasm":{"source":"iana","compressible":true,"extensions":["wasm"]},"application/watcherinfo+xml":{"source":"iana","compressible":true},"application/webpush-options+json":{"source":"iana","compressible":true},"application/whoispp-query":{"source":"iana"},"application/whoispp-response":{"source":"iana"},"application/widget":{"source":"iana","extensions":["wgt"]},"application/winhlp":{"source":"apache","extensions":["hlp"]},"application/wita":{"source":"iana"},"application/wordperfect5.1":{"source":"iana"},"application/wsdl+xml":{"source":"iana","compressible":true,"extensions":["wsdl"]},"application/wspolicy+xml":{"source":"iana","compressible":true,"extensions":["wspolicy"]},"application/x-7z-compressed":{"source":"apache","compressible":false,"extensions":["7z"]},"application/x-abiword":{"source":"apache","extensions":["abw"]},"application/x-ace-compressed":{"source":"apache","extensions":["ace"]},"application/x-amf":{"source":"apache"},"application/x-apple-diskimage":{"source":"apache","extensions":["dmg"]},"application/x-arj":{"compressible":false,"extensions":["arj"]},"application/x-authorware-bin":{"source":"apache","extensions":["aab","x32","u32","vox"]},"application/x-authorware-map":{"source":"apache","extensions":["aam"]},"application/x-authorware-seg":{"source":"apache","extensions":["aas"]},"application/x-bcpio":{"source":"apache","extensions":["bcpio"]},"application/x-bdoc":{"compressible":false,"extensions":["bdoc"]},"application/x-bittorrent":{"source":"apache","extensions":["torrent"]},"application/x-blorb":{"source":"apache","extensions":["blb","blorb"]},"application/x-bzip":{"source":"apache","compressible":false,"extensions":["bz"]},"application/x-bzip2":{"source":"apache","compressible":false,"extensions":["bz2","boz"]},"application/x-cbr":{"source":"apache","extensions":["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{"source":"apache","extensions":["vcd"]},"application/x-cfs-compressed":{"source":"apache","extensions":["cfs"]},"application/x-chat":{"source":"apache","extensions":["chat"]},"application/x-chess-pgn":{"source":"apache","extensions":["pgn"]},"application/x-chrome-extension":{"extensions":["crx"]},"application/x-cocoa":{"source":"nginx","extensions":["cco"]},"application/x-compress":{"source":"apache"},"application/x-conference":{"source":"apache","extensions":["nsc"]},"application/x-cpio":{"source":"apache","extensions":["cpio"]},"application/x-csh":{"source":"apache","extensions":["csh"]},"application/x-deb":{"compressible":false},"application/x-debian-package":{"source":"apache","extensions":["deb","udeb"]},"application/x-dgc-compressed":{"source":"apache","extensions":["dgc"]},"application/x-director":{"source":"apache","extensions":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{"source":"apache","extensions":["wad"]},"application/x-dtbncx+xml":{"source":"apache","compressible":true,"extensions":["ncx"]},"application/x-dtbook+xml":{"source":"apache","compressible":true,"extensions":["dtb"]},"application/x-dtbresource+xml":{"source":"apache","compressible":true,"extensions":["res"]},"application/x-dvi":{"source":"apache","compressible":false,"extensions":["dvi"]},"application/x-envoy":{"source":"apache","extensions":["evy"]},"application/x-eva":{"source":"apache","extensions":["eva"]},"application/x-font-bdf":{"source":"apache","extensions":["bdf"]},"application/x-font-dos":{"source":"apache"},"application/x-font-framemaker":{"source":"apache"},"application/x-font-ghostscript":{"source":"apache","extensions":["gsf"]},"application/x-font-libgrx":{"source":"apache"},"application/x-font-linux-psf":{"source":"apache","extensions":["psf"]},"application/x-font-pcf":{"source":"apache","extensions":["pcf"]},"application/x-font-snf":{"source":"apache","extensions":["snf"]},"application/x-font-speedo":{"source":"apache"},"application/x-font-sunos-news":{"source":"apache"},"application/x-font-type1":{"source":"apache","extensions":["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{"source":"apache"},"application/x-freearc":{"source":"apache","extensions":["arc"]},"application/x-futuresplash":{"source":"apache","extensions":["spl"]},"application/x-gca-compressed":{"source":"apache","extensions":["gca"]},"application/x-glulx":{"source":"apache","extensions":["ulx"]},"application/x-gnumeric":{"source":"apache","extensions":["gnumeric"]},"application/x-gramps-xml":{"source":"apache","extensions":["gramps"]},"application/x-gtar":{"source":"apache","extensions":["gtar"]},"application/x-gzip":{"source":"apache"},"application/x-hdf":{"source":"apache","extensions":["hdf"]},"application/x-httpd-php":{"compressible":true,"extensions":["php"]},"application/x-install-instructions":{"source":"apache","extensions":["install"]},"application/x-iso9660-image":{"source":"apache","extensions":["iso"]},"application/x-java-archive-diff":{"source":"nginx","extensions":["jardiff"]},"application/x-java-jnlp-file":{"source":"apache","compressible":false,"extensions":["jnlp"]},"application/x-javascript":{"compressible":true},"application/x-keepass2":{"extensions":["kdbx"]},"application/x-latex":{"source":"apache","compressible":false,"extensions":["latex"]},"application/x-lua-bytecode":{"extensions":["luac"]},"application/x-lzh-compressed":{"source":"apache","extensions":["lzh","lha"]},"application/x-makeself":{"source":"nginx","extensions":["run"]},"application/x-mie":{"source":"apache","extensions":["mie"]},"application/x-mobipocket-ebook":{"source":"apache","extensions":["prc","mobi"]},"application/x-mpegurl":{"compressible":false},"application/x-ms-application":{"source":"apache","extensions":["application"]},"application/x-ms-shortcut":{"source":"apache","extensions":["lnk"]},"application/x-ms-wmd":{"source":"apache","extensions":["wmd"]},"application/x-ms-wmz":{"source":"apache","extensions":["wmz"]},"application/x-ms-xbap":{"source":"apache","extensions":["xbap"]},"application/x-msaccess":{"source":"apache","extensions":["mdb"]},"application/x-msbinder":{"source":"apache","extensions":["obd"]},"application/x-mscardfile":{"source":"apache","extensions":["crd"]},"application/x-msclip":{"source":"apache","extensions":["clp"]},"application/x-msdos-program":{"extensions":["exe"]},"application/x-msdownload":{"source":"apache","extensions":["exe","dll","com","bat","msi"]},"application/x-msmediaview":{"source":"apache","extensions":["mvb","m13","m14"]},"application/x-msmetafile":{"source":"apache","extensions":["wmf","wmz","emf","emz"]},"application/x-msmoney":{"source":"apache","extensions":["mny"]},"application/x-mspublisher":{"source":"apache","extensions":["pub"]},"application/x-msschedule":{"source":"apache","extensions":["scd"]},"application/x-msterminal":{"source":"apache","extensions":["trm"]},"application/x-mswrite":{"source":"apache","extensions":["wri"]},"application/x-netcdf":{"source":"apache","extensions":["nc","cdf"]},"application/x-ns-proxy-autoconfig":{"compressible":true,"extensions":["pac"]},"application/x-nzb":{"source":"apache","extensions":["nzb"]},"application/x-perl":{"source":"nginx","extensions":["pl","pm"]},"application/x-pilot":{"source":"nginx","extensions":["prc","pdb"]},"application/x-pkcs12":{"source":"apache","compressible":false,"extensions":["p12","pfx"]},"application/x-pkcs7-certificates":{"source":"apache","extensions":["p7b","spc"]},"application/x-pkcs7-certreqresp":{"source":"apache","extensions":["p7r"]},"application/x-pki-message":{"source":"iana"},"application/x-rar-compressed":{"source":"apache","compressible":false,"extensions":["rar"]},"application/x-redhat-package-manager":{"source":"nginx","extensions":["rpm"]},"application/x-research-info-systems":{"source":"apache","extensions":["ris"]},"application/x-sea":{"source":"nginx","extensions":["sea"]},"application/x-sh":{"source":"apache","compressible":true,"extensions":["sh"]},"application/x-shar":{"source":"apache","extensions":["shar"]},"application/x-shockwave-flash":{"source":"apache","compressible":false,"extensions":["swf"]},"application/x-silverlight-app":{"source":"apache","extensions":["xap"]},"application/x-sql":{"source":"apache","extensions":["sql"]},"application/x-stuffit":{"source":"apache","compressible":false,"extensions":["sit"]},"application/x-stuffitx":{"source":"apache","extensions":["sitx"]},"application/x-subrip":{"source":"apache","extensions":["srt"]},"application/x-sv4cpio":{"source":"apache","extensions":["sv4cpio"]},"application/x-sv4crc":{"source":"apache","extensions":["sv4crc"]},"application/x-t3vm-image":{"source":"apache","extensions":["t3"]},"application/x-tads":{"source":"apache","extensions":["gam"]},"application/x-tar":{"source":"apache","compressible":true,"extensions":["tar"]},"application/x-tcl":{"source":"apache","extensions":["tcl","tk"]},"application/x-tex":{"source":"apache","extensions":["tex"]},"application/x-tex-tfm":{"source":"apache","extensions":["tfm"]},"application/x-texinfo":{"source":"apache","extensions":["texinfo","texi"]},"application/x-tgif":{"source":"apache","extensions":["obj"]},"application/x-ustar":{"source":"apache","extensions":["ustar"]},"application/x-virtualbox-hdd":{"compressible":true,"extensions":["hdd"]},"application/x-virtualbox-ova":{"compressible":true,"extensions":["ova"]},"application/x-virtualbox-ovf":{"compressible":true,"extensions":["ovf"]},"application/x-virtualbox-vbox":{"compressible":true,"extensions":["vbox"]},"application/x-virtualbox-vbox-extpack":{"compressible":false,"extensions":["vbox-extpack"]},"application/x-virtualbox-vdi":{"compressible":true,"extensions":["vdi"]},"application/x-virtualbox-vhd":{"compressible":true,"extensions":["vhd"]},"application/x-virtualbox-vmdk":{"compressible":true,"extensions":["vmdk"]},"application/x-wais-source":{"source":"apache","extensions":["src"]},"application/x-web-app-manifest+json":{"compressible":true,"extensions":["webapp"]},"application/x-www-form-urlencoded":{"source":"iana","compressible":true},"application/x-x509-ca-cert":{"source":"iana","extensions":["der","crt","pem"]},"application/x-x509-ca-ra-cert":{"source":"iana"},"application/x-x509-next-ca-cert":{"source":"iana"},"application/x-xfig":{"source":"apache","extensions":["fig"]},"application/x-xliff+xml":{"source":"apache","compressible":true,"extensions":["xlf"]},"application/x-xpinstall":{"source":"apache","compressible":false,"extensions":["xpi"]},"application/x-xz":{"source":"apache","extensions":["xz"]},"application/x-zmachine":{"source":"apache","extensions":["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{"source":"iana"},"application/xacml+xml":{"source":"iana","compressible":true},"application/xaml+xml":{"source":"apache","compressible":true,"extensions":["xaml"]},"application/xcap-att+xml":{"source":"iana","compressible":true,"extensions":["xav"]},"application/xcap-caps+xml":{"source":"iana","compressible":true,"extensions":["xca"]},"application/xcap-diff+xml":{"source":"iana","compressible":true,"extensions":["xdf"]},"application/xcap-el+xml":{"source":"iana","compressible":true,"extensions":["xel"]},"application/xcap-error+xml":{"source":"iana","compressible":true},"application/xcap-ns+xml":{"source":"iana","compressible":true,"extensions":["xns"]},"application/xcon-conference-info+xml":{"source":"iana","compressible":true},"application/xcon-conference-info-diff+xml":{"source":"iana","compressible":true},"application/xenc+xml":{"source":"iana","compressible":true,"extensions":["xenc"]},"application/xhtml+xml":{"source":"iana","compressible":true,"extensions":["xhtml","xht"]},"application/xhtml-voice+xml":{"source":"apache","compressible":true},"application/xliff+xml":{"source":"iana","compressible":true,"extensions":["xlf"]},"application/xml":{"source":"iana","compressible":true,"extensions":["xml","xsl","xsd","rng"]},"application/xml-dtd":{"source":"iana","compressible":true,"extensions":["dtd"]},"application/xml-external-parsed-entity":{"source":"iana"},"application/xml-patch+xml":{"source":"iana","compressible":true},"application/xmpp+xml":{"source":"iana","compressible":true},"application/xop+xml":{"source":"iana","compressible":true,"extensions":["xop"]},"application/xproc+xml":{"source":"apache","compressible":true,"extensions":["xpl"]},"application/xslt+xml":{"source":"iana","compressible":true,"extensions":["xsl","xslt"]},"application/xspf+xml":{"source":"apache","compressible":true,"extensions":["xspf"]},"application/xv+xml":{"source":"iana","compressible":true,"extensions":["mxml","xhvml","xvml","xvm"]},"application/yang":{"source":"iana","extensions":["yang"]},"application/yang-data+json":{"source":"iana","compressible":true},"application/yang-data+xml":{"source":"iana","compressible":true},"application/yang-patch+json":{"source":"iana","compressible":true},"application/yang-patch+xml":{"source":"iana","compressible":true},"application/yin+xml":{"source":"iana","compressible":true,"extensions":["yin"]},"application/zip":{"source":"iana","compressible":false,"extensions":["zip"]},"application/zlib":{"source":"iana"},"application/zstd":{"source":"iana"},"audio/1d-interleaved-parityfec":{"source":"iana"},"audio/32kadpcm":{"source":"iana"},"audio/3gpp":{"source":"iana","compressible":false,"extensions":["3gpp"]},"audio/3gpp2":{"source":"iana"},"audio/aac":{"source":"iana"},"audio/ac3":{"source":"iana"},"audio/adpcm":{"source":"apache","extensions":["adp"]},"audio/amr":{"source":"iana","extensions":["amr"]},"audio/amr-wb":{"source":"iana"},"audio/amr-wb+":{"source":"iana"},"audio/aptx":{"source":"iana"},"audio/asc":{"source":"iana"},"audio/atrac-advanced-lossless":{"source":"iana"},"audio/atrac-x":{"source":"iana"},"audio/atrac3":{"source":"iana"},"audio/basic":{"source":"iana","compressible":false,"extensions":["au","snd"]},"audio/bv16":{"source":"iana"},"audio/bv32":{"source":"iana"},"audio/clearmode":{"source":"iana"},"audio/cn":{"source":"iana"},"audio/dat12":{"source":"iana"},"audio/dls":{"source":"iana"},"audio/dsr-es201108":{"source":"iana"},"audio/dsr-es202050":{"source":"iana"},"audio/dsr-es202211":{"source":"iana"},"audio/dsr-es202212":{"source":"iana"},"audio/dv":{"source":"iana"},"audio/dvi4":{"source":"iana"},"audio/eac3":{"source":"iana"},"audio/encaprtp":{"source":"iana"},"audio/evrc":{"source":"iana"},"audio/evrc-qcp":{"source":"iana"},"audio/evrc0":{"source":"iana"},"audio/evrc1":{"source":"iana"},"audio/evrcb":{"source":"iana"},"audio/evrcb0":{"source":"iana"},"audio/evrcb1":{"source":"iana"},"audio/evrcnw":{"source":"iana"},"audio/evrcnw0":{"source":"iana"},"audio/evrcnw1":{"source":"iana"},"audio/evrcwb":{"source":"iana"},"audio/evrcwb0":{"source":"iana"},"audio/evrcwb1":{"source":"iana"},"audio/evs":{"source":"iana"},"audio/flexfec":{"source":"iana"},"audio/fwdred":{"source":"iana"},"audio/g711-0":{"source":"iana"},"audio/g719":{"source":"iana"},"audio/g722":{"source":"iana"},"audio/g7221":{"source":"iana"},"audio/g723":{"source":"iana"},"audio/g726-16":{"source":"iana"},"audio/g726-24":{"source":"iana"},"audio/g726-32":{"source":"iana"},"audio/g726-40":{"source":"iana"},"audio/g728":{"source":"iana"},"audio/g729":{"source":"iana"},"audio/g7291":{"source":"iana"},"audio/g729d":{"source":"iana"},"audio/g729e":{"source":"iana"},"audio/gsm":{"source":"iana"},"audio/gsm-efr":{"source":"iana"},"audio/gsm-hr-08":{"source":"iana"},"audio/ilbc":{"source":"iana"},"audio/ip-mr_v2.5":{"source":"iana"},"audio/isac":{"source":"apache"},"audio/l16":{"source":"iana"},"audio/l20":{"source":"iana"},"audio/l24":{"source":"iana","compressible":false},"audio/l8":{"source":"iana"},"audio/lpc":{"source":"iana"},"audio/melp":{"source":"iana"},"audio/melp1200":{"source":"iana"},"audio/melp2400":{"source":"iana"},"audio/melp600":{"source":"iana"},"audio/mhas":{"source":"iana"},"audio/midi":{"source":"apache","extensions":["mid","midi","kar","rmi"]},"audio/mobile-xmf":{"source":"iana","extensions":["mxmf"]},"audio/mp3":{"compressible":false,"extensions":["mp3"]},"audio/mp4":{"source":"iana","compressible":false,"extensions":["m4a","mp4a"]},"audio/mp4a-latm":{"source":"iana"},"audio/mpa":{"source":"iana"},"audio/mpa-robust":{"source":"iana"},"audio/mpeg":{"source":"iana","compressible":false,"extensions":["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{"source":"iana"},"audio/musepack":{"source":"apache"},"audio/ogg":{"source":"iana","compressible":false,"extensions":["oga","ogg","spx","opus"]},"audio/opus":{"source":"iana"},"audio/parityfec":{"source":"iana"},"audio/pcma":{"source":"iana"},"audio/pcma-wb":{"source":"iana"},"audio/pcmu":{"source":"iana"},"audio/pcmu-wb":{"source":"iana"},"audio/prs.sid":{"source":"iana"},"audio/qcelp":{"source":"iana"},"audio/raptorfec":{"source":"iana"},"audio/red":{"source":"iana"},"audio/rtp-enc-aescm128":{"source":"iana"},"audio/rtp-midi":{"source":"iana"},"audio/rtploopback":{"source":"iana"},"audio/rtx":{"source":"iana"},"audio/s3m":{"source":"apache","extensions":["s3m"]},"audio/scip":{"source":"iana"},"audio/silk":{"source":"apache","extensions":["sil"]},"audio/smv":{"source":"iana"},"audio/smv-qcp":{"source":"iana"},"audio/smv0":{"source":"iana"},"audio/sofa":{"source":"iana"},"audio/sp-midi":{"source":"iana"},"audio/speex":{"source":"iana"},"audio/t140c":{"source":"iana"},"audio/t38":{"source":"iana"},"audio/telephone-event":{"source":"iana"},"audio/tetra_acelp":{"source":"iana"},"audio/tetra_acelp_bb":{"source":"iana"},"audio/tone":{"source":"iana"},"audio/tsvcis":{"source":"iana"},"audio/uemclip":{"source":"iana"},"audio/ulpfec":{"source":"iana"},"audio/usac":{"source":"iana"},"audio/vdvi":{"source":"iana"},"audio/vmr-wb":{"source":"iana"},"audio/vnd.3gpp.iufp":{"source":"iana"},"audio/vnd.4sb":{"source":"iana"},"audio/vnd.audiokoz":{"source":"iana"},"audio/vnd.celp":{"source":"iana"},"audio/vnd.cisco.nse":{"source":"iana"},"audio/vnd.cmles.radio-events":{"source":"iana"},"audio/vnd.cns.anp1":{"source":"iana"},"audio/vnd.cns.inf1":{"source":"iana"},"audio/vnd.dece.audio":{"source":"iana","extensions":["uva","uvva"]},"audio/vnd.digital-winds":{"source":"iana","extensions":["eol"]},"audio/vnd.dlna.adts":{"source":"iana"},"audio/vnd.dolby.heaac.1":{"source":"iana"},"audio/vnd.dolby.heaac.2":{"source":"iana"},"audio/vnd.dolby.mlp":{"source":"iana"},"audio/vnd.dolby.mps":{"source":"iana"},"audio/vnd.dolby.pl2":{"source":"iana"},"audio/vnd.dolby.pl2x":{"source":"iana"},"audio/vnd.dolby.pl2z":{"source":"iana"},"audio/vnd.dolby.pulse.1":{"source":"iana"},"audio/vnd.dra":{"source":"iana","extensions":["dra"]},"audio/vnd.dts":{"source":"iana","extensions":["dts"]},"audio/vnd.dts.hd":{"source":"iana","extensions":["dtshd"]},"audio/vnd.dts.uhd":{"source":"iana"},"audio/vnd.dvb.file":{"source":"iana"},"audio/vnd.everad.plj":{"source":"iana"},"audio/vnd.hns.audio":{"source":"iana"},"audio/vnd.lucent.voice":{"source":"iana","extensions":["lvp"]},"audio/vnd.ms-playready.media.pya":{"source":"iana","extensions":["pya"]},"audio/vnd.nokia.mobile-xmf":{"source":"iana"},"audio/vnd.nortel.vbk":{"source":"iana"},"audio/vnd.nuera.ecelp4800":{"source":"iana","extensions":["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{"source":"iana","extensions":["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{"source":"iana","extensions":["ecelp9600"]},"audio/vnd.octel.sbc":{"source":"iana"},"audio/vnd.presonus.multitrack":{"source":"iana"},"audio/vnd.qcelp":{"source":"iana"},"audio/vnd.rhetorex.32kadpcm":{"source":"iana"},"audio/vnd.rip":{"source":"iana","extensions":["rip"]},"audio/vnd.rn-realaudio":{"compressible":false},"audio/vnd.sealedmedia.softseal.mpeg":{"source":"iana"},"audio/vnd.vmx.cvsd":{"source":"iana"},"audio/vnd.wave":{"compressible":false},"audio/vorbis":{"source":"iana","compressible":false},"audio/vorbis-config":{"source":"iana"},"audio/wav":{"compressible":false,"extensions":["wav"]},"audio/wave":{"compressible":false,"extensions":["wav"]},"audio/webm":{"source":"apache","compressible":false,"extensions":["weba"]},"audio/x-aac":{"source":"apache","compressible":false,"extensions":["aac"]},"audio/x-aiff":{"source":"apache","extensions":["aif","aiff","aifc"]},"audio/x-caf":{"source":"apache","compressible":false,"extensions":["caf"]},"audio/x-flac":{"source":"apache","extensions":["flac"]},"audio/x-m4a":{"source":"nginx","extensions":["m4a"]},"audio/x-matroska":{"source":"apache","extensions":["mka"]},"audio/x-mpegurl":{"source":"apache","extensions":["m3u"]},"audio/x-ms-wax":{"source":"apache","extensions":["wax"]},"audio/x-ms-wma":{"source":"apache","extensions":["wma"]},"audio/x-pn-realaudio":{"source":"apache","extensions":["ram","ra"]},"audio/x-pn-realaudio-plugin":{"source":"apache","extensions":["rmp"]},"audio/x-realaudio":{"source":"nginx","extensions":["ra"]},"audio/x-tta":{"source":"apache"},"audio/x-wav":{"source":"apache","extensions":["wav"]},"audio/xm":{"source":"apache","extensions":["xm"]},"chemical/x-cdx":{"source":"apache","extensions":["cdx"]},"chemical/x-cif":{"source":"apache","extensions":["cif"]},"chemical/x-cmdf":{"source":"apache","extensions":["cmdf"]},"chemical/x-cml":{"source":"apache","extensions":["cml"]},"chemical/x-csml":{"source":"apache","extensions":["csml"]},"chemical/x-pdb":{"source":"apache"},"chemical/x-xyz":{"source":"apache","extensions":["xyz"]},"font/collection":{"source":"iana","extensions":["ttc"]},"font/otf":{"source":"iana","compressible":true,"extensions":["otf"]},"font/sfnt":{"source":"iana"},"font/ttf":{"source":"iana","compressible":true,"extensions":["ttf"]},"font/woff":{"source":"iana","extensions":["woff"]},"font/woff2":{"source":"iana","extensions":["woff2"]},"image/aces":{"source":"iana","extensions":["exr"]},"image/apng":{"compressible":false,"extensions":["apng"]},"image/avci":{"source":"iana"},"image/avcs":{"source":"iana"},"image/avif":{"source":"iana","compressible":false,"extensions":["avif"]},"image/bmp":{"source":"iana","compressible":true,"extensions":["bmp"]},"image/cgm":{"source":"iana","extensions":["cgm"]},"image/dicom-rle":{"source":"iana","extensions":["drle"]},"image/emf":{"source":"iana","extensions":["emf"]},"image/fits":{"source":"iana","extensions":["fits"]},"image/g3fax":{"source":"iana","extensions":["g3"]},"image/gif":{"source":"iana","compressible":false,"extensions":["gif"]},"image/heic":{"source":"iana","extensions":["heic"]},"image/heic-sequence":{"source":"iana","extensions":["heics"]},"image/heif":{"source":"iana","extensions":["heif"]},"image/heif-sequence":{"source":"iana","extensions":["heifs"]},"image/hej2k":{"source":"iana","extensions":["hej2"]},"image/hsj2":{"source":"iana","extensions":["hsj2"]},"image/ief":{"source":"iana","extensions":["ief"]},"image/jls":{"source":"iana","extensions":["jls"]},"image/jp2":{"source":"iana","compressible":false,"extensions":["jp2","jpg2"]},"image/jpeg":{"source":"iana","compressible":false,"extensions":["jpeg","jpg","jpe"]},"image/jph":{"source":"iana","extensions":["jph"]},"image/jphc":{"source":"iana","extensions":["jhc"]},"image/jpm":{"source":"iana","compressible":false,"extensions":["jpm"]},"image/jpx":{"source":"iana","compressible":false,"extensions":["jpx","jpf"]},"image/jxr":{"source":"iana","extensions":["jxr"]},"image/jxra":{"source":"iana","extensions":["jxra"]},"image/jxrs":{"source":"iana","extensions":["jxrs"]},"image/jxs":{"source":"iana","extensions":["jxs"]},"image/jxsc":{"source":"iana","extensions":["jxsc"]},"image/jxsi":{"source":"iana","extensions":["jxsi"]},"image/jxss":{"source":"iana","extensions":["jxss"]},"image/ktx":{"source":"iana","extensions":["ktx"]},"image/ktx2":{"source":"iana","extensions":["ktx2"]},"image/naplps":{"source":"iana"},"image/pjpeg":{"compressible":false},"image/png":{"source":"iana","compressible":false,"extensions":["png"]},"image/prs.btif":{"source":"iana","extensions":["btif"]},"image/prs.pti":{"source":"iana","extensions":["pti"]},"image/pwg-raster":{"source":"iana"},"image/sgi":{"source":"apache","extensions":["sgi"]},"image/svg+xml":{"source":"iana","compressible":true,"extensions":["svg","svgz"]},"image/t38":{"source":"iana","extensions":["t38"]},"image/tiff":{"source":"iana","compressible":false,"extensions":["tif","tiff"]},"image/tiff-fx":{"source":"iana","extensions":["tfx"]},"image/vnd.adobe.photoshop":{"source":"iana","compressible":true,"extensions":["psd"]},"image/vnd.airzip.accelerator.azv":{"source":"iana","extensions":["azv"]},"image/vnd.cns.inf2":{"source":"iana"},"image/vnd.dece.graphic":{"source":"iana","extensions":["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{"source":"iana","extensions":["djvu","djv"]},"image/vnd.dvb.subtitle":{"source":"iana","extensions":["sub"]},"image/vnd.dwg":{"source":"iana","extensions":["dwg"]},"image/vnd.dxf":{"source":"iana","extensions":["dxf"]},"image/vnd.fastbidsheet":{"source":"iana","extensions":["fbs"]},"image/vnd.fpx":{"source":"iana","extensions":["fpx"]},"image/vnd.fst":{"source":"iana","extensions":["fst"]},"image/vnd.fujixerox.edmics-mmr":{"source":"iana","extensions":["mmr"]},"image/vnd.fujixerox.edmics-rlc":{"source":"iana","extensions":["rlc"]},"image/vnd.globalgraphics.pgb":{"source":"iana"},"image/vnd.microsoft.icon":{"source":"iana","extensions":["ico"]},"image/vnd.mix":{"source":"iana"},"image/vnd.mozilla.apng":{"source":"iana"},"image/vnd.ms-dds":{"extensions":["dds"]},"image/vnd.ms-modi":{"source":"iana","extensions":["mdi"]},"image/vnd.ms-photo":{"source":"apache","extensions":["wdp"]},"image/vnd.net-fpx":{"source":"iana","extensions":["npx"]},"image/vnd.pco.b16":{"source":"iana","extensions":["b16"]},"image/vnd.radiance":{"source":"iana"},"image/vnd.sealed.png":{"source":"iana"},"image/vnd.sealedmedia.softseal.gif":{"source":"iana"},"image/vnd.sealedmedia.softseal.jpg":{"source":"iana"},"image/vnd.svf":{"source":"iana"},"image/vnd.tencent.tap":{"source":"iana","extensions":["tap"]},"image/vnd.valve.source.texture":{"source":"iana","extensions":["vtf"]},"image/vnd.wap.wbmp":{"source":"iana","extensions":["wbmp"]},"image/vnd.xiff":{"source":"iana","extensions":["xif"]},"image/vnd.zbrush.pcx":{"source":"iana","extensions":["pcx"]},"image/webp":{"source":"apache","extensions":["webp"]},"image/wmf":{"source":"iana","extensions":["wmf"]},"image/x-3ds":{"source":"apache","extensions":["3ds"]},"image/x-cmu-raster":{"source":"apache","extensions":["ras"]},"image/x-cmx":{"source":"apache","extensions":["cmx"]},"image/x-freehand":{"source":"apache","extensions":["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{"source":"apache","compressible":true,"extensions":["ico"]},"image/x-jng":{"source":"nginx","extensions":["jng"]},"image/x-mrsid-image":{"source":"apache","extensions":["sid"]},"image/x-ms-bmp":{"source":"nginx","compressible":true,"extensions":["bmp"]},"image/x-pcx":{"source":"apache","extensions":["pcx"]},"image/x-pict":{"source":"apache","extensions":["pic","pct"]},"image/x-portable-anymap":{"source":"apache","extensions":["pnm"]},"image/x-portable-bitmap":{"source":"apache","extensions":["pbm"]},"image/x-portable-graymap":{"source":"apache","extensions":["pgm"]},"image/x-portable-pixmap":{"source":"apache","extensions":["ppm"]},"image/x-rgb":{"source":"apache","extensions":["rgb"]},"image/x-tga":{"source":"apache","extensions":["tga"]},"image/x-xbitmap":{"source":"apache","extensions":["xbm"]},"image/x-xcf":{"compressible":false},"image/x-xpixmap":{"source":"apache","extensions":["xpm"]},"image/x-xwindowdump":{"source":"apache","extensions":["xwd"]},"message/cpim":{"source":"iana"},"message/delivery-status":{"source":"iana"},"message/disposition-notification":{"source":"iana","extensions":["disposition-notification"]},"message/external-body":{"source":"iana"},"message/feedback-report":{"source":"iana"},"message/global":{"source":"iana","extensions":["u8msg"]},"message/global-delivery-status":{"source":"iana","extensions":["u8dsn"]},"message/global-disposition-notification":{"source":"iana","extensions":["u8mdn"]},"message/global-headers":{"source":"iana","extensions":["u8hdr"]},"message/http":{"source":"iana","compressible":false},"message/imdn+xml":{"source":"iana","compressible":true},"message/news":{"source":"iana"},"message/partial":{"source":"iana","compressible":false},"message/rfc822":{"source":"iana","compressible":true,"extensions":["eml","mime"]},"message/s-http":{"source":"iana"},"message/sip":{"source":"iana"},"message/sipfrag":{"source":"iana"},"message/tracking-status":{"source":"iana"},"message/vnd.si.simp":{"source":"iana"},"message/vnd.wfa.wsc":{"source":"iana","extensions":["wsc"]},"model/3mf":{"source":"iana","extensions":["3mf"]},"model/e57":{"source":"iana"},"model/gltf+json":{"source":"iana","compressible":true,"extensions":["gltf"]},"model/gltf-binary":{"source":"iana","compressible":true,"extensions":["glb"]},"model/iges":{"source":"iana","compressible":false,"extensions":["igs","iges"]},"model/mesh":{"source":"iana","compressible":false,"extensions":["msh","mesh","silo"]},"model/mtl":{"source":"iana","extensions":["mtl"]},"model/obj":{"source":"iana","extensions":["obj"]},"model/stl":{"source":"iana","extensions":["stl"]},"model/vnd.collada+xml":{"source":"iana","compressible":true,"extensions":["dae"]},"model/vnd.dwf":{"source":"iana","extensions":["dwf"]},"model/vnd.flatland.3dml":{"source":"iana"},"model/vnd.gdl":{"source":"iana","extensions":["gdl"]},"model/vnd.gs-gdl":{"source":"apache"},"model/vnd.gs.gdl":{"source":"iana"},"model/vnd.gtw":{"source":"iana","extensions":["gtw"]},"model/vnd.moml+xml":{"source":"iana","compressible":true},"model/vnd.mts":{"source":"iana","extensions":["mts"]},"model/vnd.opengex":{"source":"iana","extensions":["ogex"]},"model/vnd.parasolid.transmit.binary":{"source":"iana","extensions":["x_b"]},"model/vnd.parasolid.transmit.text":{"source":"iana","extensions":["x_t"]},"model/vnd.pytha.pyox":{"source":"iana"},"model/vnd.rosette.annotated-data-model":{"source":"iana"},"model/vnd.sap.vds":{"source":"iana","extensions":["vds"]},"model/vnd.usdz+zip":{"source":"iana","compressible":false,"extensions":["usdz"]},"model/vnd.valve.source.compiled-map":{"source":"iana","extensions":["bsp"]},"model/vnd.vtu":{"source":"iana","extensions":["vtu"]},"model/vrml":{"source":"iana","compressible":false,"extensions":["wrl","vrml"]},"model/x3d+binary":{"source":"apache","compressible":false,"extensions":["x3db","x3dbz"]},"model/x3d+fastinfoset":{"source":"iana","extensions":["x3db"]},"model/x3d+vrml":{"source":"apache","compressible":false,"extensions":["x3dv","x3dvz"]},"model/x3d+xml":{"source":"iana","compressible":true,"extensions":["x3d","x3dz"]},"model/x3d-vrml":{"source":"iana","extensions":["x3dv"]},"multipart/alternative":{"source":"iana","compressible":false},"multipart/appledouble":{"source":"iana"},"multipart/byteranges":{"source":"iana"},"multipart/digest":{"source":"iana"},"multipart/encrypted":{"source":"iana","compressible":false},"multipart/form-data":{"source":"iana","compressible":false},"multipart/header-set":{"source":"iana"},"multipart/mixed":{"source":"iana"},"multipart/multilingual":{"source":"iana"},"multipart/parallel":{"source":"iana"},"multipart/related":{"source":"iana","compressible":false},"multipart/report":{"source":"iana"},"multipart/signed":{"source":"iana","compressible":false},"multipart/vnd.bint.med-plus":{"source":"iana"},"multipart/voice-message":{"source":"iana"},"multipart/x-mixed-replace":{"source":"iana"},"text/1d-interleaved-parityfec":{"source":"iana"},"text/cache-manifest":{"source":"iana","compressible":true,"extensions":["appcache","manifest"]},"text/calendar":{"source":"iana","extensions":["ics","ifb"]},"text/calender":{"compressible":true},"text/cmd":{"compressible":true},"text/coffeescript":{"extensions":["coffee","litcoffee"]},"text/cql":{"source":"iana"},"text/cql-expression":{"source":"iana"},"text/cql-identifier":{"source":"iana"},"text/css":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["css"]},"text/csv":{"source":"iana","compressible":true,"extensions":["csv"]},"text/csv-schema":{"source":"iana"},"text/directory":{"source":"iana"},"text/dns":{"source":"iana"},"text/ecmascript":{"source":"iana"},"text/encaprtp":{"source":"iana"},"text/enriched":{"source":"iana"},"text/fhirpath":{"source":"iana"},"text/flexfec":{"source":"iana"},"text/fwdred":{"source":"iana"},"text/gff3":{"source":"iana"},"text/grammar-ref-list":{"source":"iana"},"text/html":{"source":"iana","compressible":true,"extensions":["html","htm","shtml"]},"text/jade":{"extensions":["jade"]},"text/javascript":{"source":"iana","compressible":true},"text/jcr-cnd":{"source":"iana"},"text/jsx":{"compressible":true,"extensions":["jsx"]},"text/less":{"compressible":true,"extensions":["less"]},"text/markdown":{"source":"iana","compressible":true,"extensions":["markdown","md"]},"text/mathml":{"source":"nginx","extensions":["mml"]},"text/mdx":{"compressible":true,"extensions":["mdx"]},"text/mizar":{"source":"iana"},"text/n3":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["n3"]},"text/parameters":{"source":"iana","charset":"UTF-8"},"text/parityfec":{"source":"iana"},"text/plain":{"source":"iana","compressible":true,"extensions":["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{"source":"iana","charset":"UTF-8"},"text/prs.fallenstein.rst":{"source":"iana"},"text/prs.lines.tag":{"source":"iana","extensions":["dsc"]},"text/prs.prop.logic":{"source":"iana"},"text/raptorfec":{"source":"iana"},"text/red":{"source":"iana"},"text/rfc822-headers":{"source":"iana"},"text/richtext":{"source":"iana","compressible":true,"extensions":["rtx"]},"text/rtf":{"source":"iana","compressible":true,"extensions":["rtf"]},"text/rtp-enc-aescm128":{"source":"iana"},"text/rtploopback":{"source":"iana"},"text/rtx":{"source":"iana"},"text/sgml":{"source":"iana","extensions":["sgml","sgm"]},"text/shaclc":{"source":"iana"},"text/shex":{"source":"iana","extensions":["shex"]},"text/slim":{"extensions":["slim","slm"]},"text/spdx":{"source":"iana","extensions":["spdx"]},"text/strings":{"source":"iana"},"text/stylus":{"extensions":["stylus","styl"]},"text/t140":{"source":"iana"},"text/tab-separated-values":{"source":"iana","compressible":true,"extensions":["tsv"]},"text/troff":{"source":"iana","extensions":["t","tr","roff","man","me","ms"]},"text/turtle":{"source":"iana","charset":"UTF-8","extensions":["ttl"]},"text/ulpfec":{"source":"iana"},"text/uri-list":{"source":"iana","compressible":true,"extensions":["uri","uris","urls"]},"text/vcard":{"source":"iana","compressible":true,"extensions":["vcard"]},"text/vnd.a":{"source":"iana"},"text/vnd.abc":{"source":"iana"},"text/vnd.ascii-art":{"source":"iana"},"text/vnd.curl":{"source":"iana","extensions":["curl"]},"text/vnd.curl.dcurl":{"source":"apache","extensions":["dcurl"]},"text/vnd.curl.mcurl":{"source":"apache","extensions":["mcurl"]},"text/vnd.curl.scurl":{"source":"apache","extensions":["scurl"]},"text/vnd.debian.copyright":{"source":"iana","charset":"UTF-8"},"text/vnd.dmclientscript":{"source":"iana"},"text/vnd.dvb.subtitle":{"source":"iana","extensions":["sub"]},"text/vnd.esmertec.theme-descriptor":{"source":"iana","charset":"UTF-8"},"text/vnd.ficlab.flt":{"source":"iana"},"text/vnd.fly":{"source":"iana","extensions":["fly"]},"text/vnd.fmi.flexstor":{"source":"iana","extensions":["flx"]},"text/vnd.gml":{"source":"iana"},"text/vnd.graphviz":{"source":"iana","extensions":["gv"]},"text/vnd.hans":{"source":"iana"},"text/vnd.hgl":{"source":"iana"},"text/vnd.in3d.3dml":{"source":"iana","extensions":["3dml"]},"text/vnd.in3d.spot":{"source":"iana","extensions":["spot"]},"text/vnd.iptc.newsml":{"source":"iana"},"text/vnd.iptc.nitf":{"source":"iana"},"text/vnd.latex-z":{"source":"iana"},"text/vnd.motorola.reflex":{"source":"iana"},"text/vnd.ms-mediapackage":{"source":"iana"},"text/vnd.net2phone.commcenter.command":{"source":"iana"},"text/vnd.radisys.msml-basic-layout":{"source":"iana"},"text/vnd.senx.warpscript":{"source":"iana"},"text/vnd.si.uricatalogue":{"source":"iana"},"text/vnd.sosi":{"source":"iana"},"text/vnd.sun.j2me.app-descriptor":{"source":"iana","charset":"UTF-8","extensions":["jad"]},"text/vnd.trolltech.linguist":{"source":"iana","charset":"UTF-8"},"text/vnd.wap.si":{"source":"iana"},"text/vnd.wap.sl":{"source":"iana"},"text/vnd.wap.wml":{"source":"iana","extensions":["wml"]},"text/vnd.wap.wmlscript":{"source":"iana","extensions":["wmls"]},"text/vtt":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["vtt"]},"text/x-asm":{"source":"apache","extensions":["s","asm"]},"text/x-c":{"source":"apache","extensions":["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{"source":"nginx","extensions":["htc"]},"text/x-fortran":{"source":"apache","extensions":["f","for","f77","f90"]},"text/x-gwt-rpc":{"compressible":true},"text/x-handlebars-template":{"extensions":["hbs"]},"text/x-java-source":{"source":"apache","extensions":["java"]},"text/x-jquery-tmpl":{"compressible":true},"text/x-lua":{"extensions":["lua"]},"text/x-markdown":{"compressible":true,"extensions":["mkd"]},"text/x-nfo":{"source":"apache","extensions":["nfo"]},"text/x-opml":{"source":"apache","extensions":["opml"]},"text/x-org":{"compressible":true,"extensions":["org"]},"text/x-pascal":{"source":"apache","extensions":["p","pas"]},"text/x-processing":{"compressible":true,"extensions":["pde"]},"text/x-sass":{"extensions":["sass"]},"text/x-scss":{"extensions":["scss"]},"text/x-setext":{"source":"apache","extensions":["etx"]},"text/x-sfv":{"source":"apache","extensions":["sfv"]},"text/x-suse-ymp":{"compressible":true,"extensions":["ymp"]},"text/x-uuencode":{"source":"apache","extensions":["uu"]},"text/x-vcalendar":{"source":"apache","extensions":["vcs"]},"text/x-vcard":{"source":"apache","extensions":["vcf"]},"text/xml":{"source":"iana","compressible":true,"extensions":["xml"]},"text/xml-external-parsed-entity":{"source":"iana"},"text/yaml":{"compressible":true,"extensions":["yaml","yml"]},"video/1d-interleaved-parityfec":{"source":"iana"},"video/3gpp":{"source":"iana","extensions":["3gp","3gpp"]},"video/3gpp-tt":{"source":"iana"},"video/3gpp2":{"source":"iana","extensions":["3g2"]},"video/av1":{"source":"iana"},"video/bmpeg":{"source":"iana"},"video/bt656":{"source":"iana"},"video/celb":{"source":"iana"},"video/dv":{"source":"iana"},"video/encaprtp":{"source":"iana"},"video/ffv1":{"source":"iana"},"video/flexfec":{"source":"iana"},"video/h261":{"source":"iana","extensions":["h261"]},"video/h263":{"source":"iana","extensions":["h263"]},"video/h263-1998":{"source":"iana"},"video/h263-2000":{"source":"iana"},"video/h264":{"source":"iana","extensions":["h264"]},"video/h264-rcdo":{"source":"iana"},"video/h264-svc":{"source":"iana"},"video/h265":{"source":"iana"},"video/iso.segment":{"source":"iana","extensions":["m4s"]},"video/jpeg":{"source":"iana","extensions":["jpgv"]},"video/jpeg2000":{"source":"iana"},"video/jpm":{"source":"apache","extensions":["jpm","jpgm"]},"video/mj2":{"source":"iana","extensions":["mj2","mjp2"]},"video/mp1s":{"source":"iana"},"video/mp2p":{"source":"iana"},"video/mp2t":{"source":"iana","extensions":["ts"]},"video/mp4":{"source":"iana","compressible":false,"extensions":["mp4","mp4v","mpg4"]},"video/mp4v-es":{"source":"iana"},"video/mpeg":{"source":"iana","compressible":false,"extensions":["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{"source":"iana"},"video/mpv":{"source":"iana"},"video/nv":{"source":"iana"},"video/ogg":{"source":"iana","compressible":false,"extensions":["ogv"]},"video/parityfec":{"source":"iana"},"video/pointer":{"source":"iana"},"video/quicktime":{"source":"iana","compressible":false,"extensions":["qt","mov"]},"video/raptorfec":{"source":"iana"},"video/raw":{"source":"iana"},"video/rtp-enc-aescm128":{"source":"iana"},"video/rtploopback":{"source":"iana"},"video/rtx":{"source":"iana"},"video/scip":{"source":"iana"},"video/smpte291":{"source":"iana"},"video/smpte292m":{"source":"iana"},"video/ulpfec":{"source":"iana"},"video/vc1":{"source":"iana"},"video/vc2":{"source":"iana"},"video/vnd.cctv":{"source":"iana"},"video/vnd.dece.hd":{"source":"iana","extensions":["uvh","uvvh"]},"video/vnd.dece.mobile":{"source":"iana","extensions":["uvm","uvvm"]},"video/vnd.dece.mp4":{"source":"iana"},"video/vnd.dece.pd":{"source":"iana","extensions":["uvp","uvvp"]},"video/vnd.dece.sd":{"source":"iana","extensions":["uvs","uvvs"]},"video/vnd.dece.video":{"source":"iana","extensions":["uvv","uvvv"]},"video/vnd.directv.mpeg":{"source":"iana"},"video/vnd.directv.mpeg-tts":{"source":"iana"},"video/vnd.dlna.mpeg-tts":{"source":"iana"},"video/vnd.dvb.file":{"source":"iana","extensions":["dvb"]},"video/vnd.fvt":{"source":"iana","extensions":["fvt"]},"video/vnd.hns.video":{"source":"iana"},"video/vnd.iptvforum.1dparityfec-1010":{"source":"iana"},"video/vnd.iptvforum.1dparityfec-2005":{"source":"iana"},"video/vnd.iptvforum.2dparityfec-1010":{"source":"iana"},"video/vnd.iptvforum.2dparityfec-2005":{"source":"iana"},"video/vnd.iptvforum.ttsavc":{"source":"iana"},"video/vnd.iptvforum.ttsmpeg2":{"source":"iana"},"video/vnd.motorola.video":{"source":"iana"},"video/vnd.motorola.videop":{"source":"iana"},"video/vnd.mpegurl":{"source":"iana","extensions":["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{"source":"iana","extensions":["pyv"]},"video/vnd.nokia.interleaved-multimedia":{"source":"iana"},"video/vnd.nokia.mp4vr":{"source":"iana"},"video/vnd.nokia.videovoip":{"source":"iana"},"video/vnd.objectvideo":{"source":"iana"},"video/vnd.radgamettools.bink":{"source":"iana"},"video/vnd.radgamettools.smacker":{"source":"iana"},"video/vnd.sealed.mpeg1":{"source":"iana"},"video/vnd.sealed.mpeg4":{"source":"iana"},"video/vnd.sealed.swf":{"source":"iana"},"video/vnd.sealedmedia.softseal.mov":{"source":"iana"},"video/vnd.uvvu.mp4":{"source":"iana","extensions":["uvu","uvvu"]},"video/vnd.vivo":{"source":"iana","extensions":["viv"]},"video/vnd.youtube.yt":{"source":"iana"},"video/vp8":{"source":"iana"},"video/webm":{"source":"apache","compressible":false,"extensions":["webm"]},"video/x-f4v":{"source":"apache","extensions":["f4v"]},"video/x-fli":{"source":"apache","extensions":["fli"]},"video/x-flv":{"source":"apache","compressible":false,"extensions":["flv"]},"video/x-m4v":{"source":"apache","extensions":["m4v"]},"video/x-matroska":{"source":"apache","compressible":false,"extensions":["mkv","mk3d","mks"]},"video/x-mng":{"source":"apache","extensions":["mng"]},"video/x-ms-asf":{"source":"apache","extensions":["asf","asx"]},"video/x-ms-vob":{"source":"apache","extensions":["vob"]},"video/x-ms-wm":{"source":"apache","extensions":["wm"]},"video/x-ms-wmv":{"source":"apache","compressible":false,"extensions":["wmv"]},"video/x-ms-wmx":{"source":"apache","extensions":["wmx"]},"video/x-ms-wvx":{"source":"apache","extensions":["wvx"]},"video/x-msvideo":{"source":"apache","extensions":["avi"]},"video/x-sgi-movie":{"source":"apache","extensions":["movie"]},"video/x-smv":{"source":"apache","extensions":["smv"]},"x-conference/x-cooltalk":{"source":"apache","extensions":["ice"]},"x-shader/x-fragment":{"compressible":true},"x-shader/x-vertex":{"compressible":true}}'); /***/ }), @@ -59804,6 +60464,9 @@ var external_os_default = /*#__PURE__*/__nccwpck_require__.n(external_os_); process.on("uncaughtException", (e) => { core.info(`[warning] ${e.message}`); + if (e.stack) { + core.info(e.stack); + } }); const cwd = core.getInput("working-directory"); // TODO: this could be read from .cargo config file directly diff --git a/package-lock.json b/package-lock.json index 3d2e742..4cf53be 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,14 +9,14 @@ "license": "LGPL-3.0", "dependencies": { "@actions/cache": "^1.0.7", - "@actions/core": "^1.3.0", - "@actions/exec": "^1.0.4", - "@actions/glob": "^0.1.2", - "@actions/io": "^1.1.0" + "@actions/core": "^1.4.0", + "@actions/exec": "^1.1.0", + "@actions/glob": "^0.2.0", + "@actions/io": "^1.1.1" }, "devDependencies": { "@vercel/ncc": "^0.28.6", - "typescript": "^4.3.2" + "typescript": "^4.3.4" }, "funding": { "url": "https://github.com/sponsors/Swatinem" @@ -38,23 +38,32 @@ "uuid": "^3.3.3" } }, + "node_modules/@actions/cache/node_modules/@actions/glob": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@actions/glob/-/glob-0.1.2.tgz", + "integrity": "sha512-SclLR7Ia5sEqjkJTPs7Sd86maMDw43p769YxBOxvPvEWuPEhpAnBsQfENOpXjFYMmhCqd127bmf+YdvJqVqR4A==", + "dependencies": { + "@actions/core": "^1.2.6", + "minimatch": "^3.0.4" + } + }, "node_modules/@actions/core": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.3.0.tgz", - "integrity": "sha512-xxtX0Cwdhb8LcgatfJkokqT8KzPvcIbwL9xpLU09nOwBzaStbfm0dNncsP0M4us+EpoPdWy7vbzU5vSOH7K6pg==" + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.4.0.tgz", + "integrity": "sha512-CGx2ilGq5i7zSLgiiGUtBCxhRRxibJYU6Fim0Q1Wg2aQL2LTnF27zbqZOrxfvFQ55eSBW0L8uVStgtKMpa0Qlg==" }, "node_modules/@actions/exec": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.0.4.tgz", - "integrity": "sha512-4DPChWow9yc9W3WqEbUj8Nr86xkpyE29ZzWjXucHItclLbEW6jr80Zx4nqv18QL6KK65+cifiQZXvnqgTV6oHw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.1.0.tgz", + "integrity": "sha512-LImpN9AY0J1R1mEYJjVJfSZWU4zYOlEcwSTgPve1rFQqK5AwrEs6uWW5Rv70gbDIQIAUwI86z6B+9mPK4w9Sbg==", "dependencies": { "@actions/io": "^1.0.1" } }, "node_modules/@actions/glob": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/@actions/glob/-/glob-0.1.2.tgz", - "integrity": "sha512-SclLR7Ia5sEqjkJTPs7Sd86maMDw43p769YxBOxvPvEWuPEhpAnBsQfENOpXjFYMmhCqd127bmf+YdvJqVqR4A==", + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@actions/glob/-/glob-0.2.0.tgz", + "integrity": "sha512-mqE2a7I66kxcvsdwxs/filQwZsq25IfktMaviGfDB51v6Q3bvxnV7mFsZnvYtLhqGZbPxwBnH8AD3UYaOWb//w==", "dependencies": { "@actions/core": "^1.2.6", "minimatch": "^3.0.4" @@ -69,9 +78,9 @@ } }, "node_modules/@actions/io": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@actions/io/-/io-1.1.0.tgz", - "integrity": "sha512-PspSX7Z9zh2Fyyuf3F6BsYeXcYHfc/VJ1vwy2vouas95efHVd42M6UfBFRs+jY0uiMDXhAoUtATn9g2r1MaWBQ==" + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@actions/io/-/io-1.1.1.tgz", + "integrity": "sha512-Qi4JoKXjmE0O67wAOH6y0n26QXhMKMFo7GD/4IXNVcrtLjUlGjGuVys6pQgwF3ArfGTQu0XpqaNr0YhED2RaRA==" }, "node_modules/@azure/abort-controller": { "version": "1.0.4", @@ -85,9 +94,9 @@ } }, "node_modules/@azure/abort-controller/node_modules/tslib": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.2.0.tgz", - "integrity": "sha512-gS9GVHRU+RGn5KQM2rllAlR3dU6m7AcpJKdtH8gFvQiC4Otgk98XnmMU+nZenHt/+VhnBPWwgrJsyrdcw6i23w==" + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz", + "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==" }, "node_modules/@azure/core-asynciterator-polyfill": { "version": "1.0.0", @@ -107,14 +116,14 @@ } }, "node_modules/@azure/core-auth/node_modules/tslib": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.2.0.tgz", - "integrity": "sha512-gS9GVHRU+RGn5KQM2rllAlR3dU6m7AcpJKdtH8gFvQiC4Otgk98XnmMU+nZenHt/+VhnBPWwgrJsyrdcw6i23w==" + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz", + "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==" }, "node_modules/@azure/core-http": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@azure/core-http/-/core-http-1.2.4.tgz", - "integrity": "sha512-cNumz3ckyFZY5zWOgcTHSO7AKRVwxbodG8WfcEGcdH+ZJL3KvJEI/vN58H6xk5v3ijulU2x/WPGJqrMVvcI79A==", + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@azure/core-http/-/core-http-1.2.6.tgz", + "integrity": "sha512-odtH7UMKtekc5YQ86xg9GlVHNXR6pq2JgJ5FBo7/jbOjNGdBqcrIVrZx2bevXVJz/uUTSx6vUf62gzTXTfqYSQ==", "dependencies": { "@azure/abort-controller": "^1.0.0", "@azure/core-asynciterator-polyfill": "^1.0.0", @@ -127,7 +136,7 @@ "node-fetch": "^2.6.0", "process": "^0.11.10", "tough-cookie": "^4.0.0", - "tslib": "^2.0.0", + "tslib": "^2.2.0", "tunnel": "^0.0.6", "uuid": "^8.3.0", "xml2js": "^0.4.19" @@ -136,27 +145,6 @@ "node": ">=8.0.0" } }, - "node_modules/@azure/core-http/node_modules/@azure/core-tracing": { - "version": "1.0.0-preview.11", - "resolved": "https://registry.npmjs.org/@azure/core-tracing/-/core-tracing-1.0.0-preview.11.tgz", - "integrity": "sha512-frF0pJc9HTmKncVokhBxCqipjbql02DThQ1ZJ9wLi7SDMLdPAFyDI5xZNzX5guLz+/DtPkY+SGK2li9FIXqshQ==", - "dependencies": { - "@opencensus/web-types": "0.0.7", - "@opentelemetry/api": "1.0.0-rc.0", - "tslib": "^2.0.0" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/@azure/core-http/node_modules/@opentelemetry/api": { - "version": "1.0.0-rc.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.0.0-rc.0.tgz", - "integrity": "sha512-iXKByCMfrlO5S6Oh97BuM56tM2cIBB0XsL/vWF/AtJrJEKx4MC/Xdu0xDsGXMGcNWpqF7ujMsjjnp0+UHBwnDQ==", - "engines": { - "node": ">=8.0.0" - } - }, "node_modules/@azure/core-http/node_modules/form-data": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz", @@ -184,9 +172,9 @@ } }, "node_modules/@azure/core-http/node_modules/tslib": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.2.0.tgz", - "integrity": "sha512-gS9GVHRU+RGn5KQM2rllAlR3dU6m7AcpJKdtH8gFvQiC4Otgk98XnmMU+nZenHt/+VhnBPWwgrJsyrdcw6i23w==" + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz", + "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==" }, "node_modules/@azure/core-http/node_modules/uuid": { "version": "8.3.2", @@ -211,31 +199,10 @@ "node": ">=8.0.0" } }, - "node_modules/@azure/core-lro/node_modules/@azure/core-tracing": { - "version": "1.0.0-preview.11", - "resolved": "https://registry.npmjs.org/@azure/core-tracing/-/core-tracing-1.0.0-preview.11.tgz", - "integrity": "sha512-frF0pJc9HTmKncVokhBxCqipjbql02DThQ1ZJ9wLi7SDMLdPAFyDI5xZNzX5guLz+/DtPkY+SGK2li9FIXqshQ==", - "dependencies": { - "@opencensus/web-types": "0.0.7", - "@opentelemetry/api": "1.0.0-rc.0", - "tslib": "^2.0.0" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/@azure/core-lro/node_modules/@opentelemetry/api": { - "version": "1.0.0-rc.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.0.0-rc.0.tgz", - "integrity": "sha512-iXKByCMfrlO5S6Oh97BuM56tM2cIBB0XsL/vWF/AtJrJEKx4MC/Xdu0xDsGXMGcNWpqF7ujMsjjnp0+UHBwnDQ==", - "engines": { - "node": ">=8.0.0" - } - }, "node_modules/@azure/core-lro/node_modules/tslib": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.2.0.tgz", - "integrity": "sha512-gS9GVHRU+RGn5KQM2rllAlR3dU6m7AcpJKdtH8gFvQiC4Otgk98XnmMU+nZenHt/+VhnBPWwgrJsyrdcw6i23w==" + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz", + "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==" }, "node_modules/@azure/core-paging": { "version": "1.1.3", @@ -249,12 +216,12 @@ } }, "node_modules/@azure/core-tracing": { - "version": "1.0.0-preview.10", - "resolved": "https://registry.npmjs.org/@azure/core-tracing/-/core-tracing-1.0.0-preview.10.tgz", - "integrity": "sha512-iIwjtMwQnsxB7cYkugMx+s4W1nfy3+pT/ceo+uW1fv4YDgYe84nh+QP0fEC9IH/3UATLSWbIBemdMHzk2APUrw==", + "version": "1.0.0-preview.11", + "resolved": "https://registry.npmjs.org/@azure/core-tracing/-/core-tracing-1.0.0-preview.11.tgz", + "integrity": "sha512-frF0pJc9HTmKncVokhBxCqipjbql02DThQ1ZJ9wLi7SDMLdPAFyDI5xZNzX5guLz+/DtPkY+SGK2li9FIXqshQ==", "dependencies": { "@opencensus/web-types": "0.0.7", - "@opentelemetry/api": "^0.10.2", + "@opentelemetry/api": "1.0.0-rc.0", "tslib": "^2.0.0" }, "engines": { @@ -262,9 +229,9 @@ } }, "node_modules/@azure/core-tracing/node_modules/tslib": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.2.0.tgz", - "integrity": "sha512-gS9GVHRU+RGn5KQM2rllAlR3dU6m7AcpJKdtH8gFvQiC4Otgk98XnmMU+nZenHt/+VhnBPWwgrJsyrdcw6i23w==" + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz", + "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==" }, "node_modules/@azure/logger": { "version": "1.0.2", @@ -278,14 +245,14 @@ } }, "node_modules/@azure/logger/node_modules/tslib": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.2.0.tgz", - "integrity": "sha512-gS9GVHRU+RGn5KQM2rllAlR3dU6m7AcpJKdtH8gFvQiC4Otgk98XnmMU+nZenHt/+VhnBPWwgrJsyrdcw6i23w==" + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz", + "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==" }, "node_modules/@azure/ms-rest-js": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/@azure/ms-rest-js/-/ms-rest-js-2.5.0.tgz", - "integrity": "sha512-mXezdECH1Vjr+7FkH5+LlL85/YEHOrXHYqd9qh8b6dgvvE7sVvUk3qrtRGk3WZr4TLrZvRLE7NbFU7RgHHg45Q==", + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/@azure/ms-rest-js/-/ms-rest-js-2.5.2.tgz", + "integrity": "sha512-9nCuuoYwHZEZw1t0MVtENH+c1k2R4maYAlBBDSZhZu6bEucyfYUUigNXXKjt2cFBt4sO+sTzi0uI0f/fiPFr+Q==", "dependencies": { "@azure/core-auth": "^1.1.4", "abort-controller": "^3.0.0", @@ -299,17 +266,16 @@ } }, "node_modules/@azure/storage-blob": { - "version": "12.5.0", - "resolved": "https://registry.npmjs.org/@azure/storage-blob/-/storage-blob-12.5.0.tgz", - "integrity": "sha512-DgoefgODst2IPkkQsNdhtYdyJgSsAZC1pEujO6aD5y7uFy5GnzhYliobSrp204jYRyK5XeJ9iiePmy/SPtTbLA==", + "version": "12.6.0", + "resolved": "https://registry.npmjs.org/@azure/storage-blob/-/storage-blob-12.6.0.tgz", + "integrity": "sha512-cAzsae+5ZdhugQfIT7o5SlVyF2Sc+HygZdPO41ZYdXklfGUyEt+5K4PyM5HQDc0MTVt6x7+waXcaAXT2eF9E6A==", "dependencies": { "@azure/abort-controller": "^1.0.0", "@azure/core-http": "^1.2.0", "@azure/core-lro": "^1.0.2", "@azure/core-paging": "^1.1.1", - "@azure/core-tracing": "1.0.0-preview.10", + "@azure/core-tracing": "1.0.0-preview.11", "@azure/logger": "^1.0.0", - "@opentelemetry/api": "^0.10.2", "events": "^3.0.0", "tslib": "^2.0.0" }, @@ -318,9 +284,9 @@ } }, "node_modules/@azure/storage-blob/node_modules/tslib": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.2.0.tgz", - "integrity": "sha512-gS9GVHRU+RGn5KQM2rllAlR3dU6m7AcpJKdtH8gFvQiC4Otgk98XnmMU+nZenHt/+VhnBPWwgrJsyrdcw6i23w==" + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz", + "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==" }, "node_modules/@opencensus/web-types": { "version": "0.0.7", @@ -331,28 +297,17 @@ } }, "node_modules/@opentelemetry/api": { - "version": "0.10.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-0.10.2.tgz", - "integrity": "sha512-GtpMGd6vkzDMYcpu2t9LlhEgMy/SzBwRnz48EejlRArYqZzqSzAsKmegUK7zHgl+EOIaK9mKHhnRaQu3qw20cA==", - "dependencies": { - "@opentelemetry/context-base": "^0.10.2" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/@opentelemetry/context-base": { - "version": "0.10.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/context-base/-/context-base-0.10.2.tgz", - "integrity": "sha512-hZNKjKOYsckoOEgBziGMnBcX0M7EtstnCmwz5jZUOUYwlZ+/xxX6z3jPu1XVO2Jivk0eLfuP9GP+vFD49CMetw==", + "version": "1.0.0-rc.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.0.0-rc.0.tgz", + "integrity": "sha512-iXKByCMfrlO5S6Oh97BuM56tM2cIBB0XsL/vWF/AtJrJEKx4MC/Xdu0xDsGXMGcNWpqF7ujMsjjnp0+UHBwnDQ==", "engines": { "node": ">=8.0.0" } }, "node_modules/@types/node": { - "version": "15.6.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-15.6.1.tgz", - "integrity": "sha512-7EIraBEyRHEe7CH+Fm1XvgqU6uwZN8Q7jppJGcqjROMT29qhAuuOxYB1uEY5UMYQKEmA5D+5tBnhdaPXSsLONA==" + "version": "15.12.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-15.12.5.tgz", + "integrity": "sha512-se3yX7UHv5Bscf8f1ERKvQOD6sTyycH3hdaoozvaLxgUiY5lIGEeH37AD0G0Qi9kPqihPn0HOfd2yaIEN9VwEg==" }, "node_modules/@types/node-fetch": { "version": "2.5.10", @@ -485,19 +440,19 @@ } }, "node_modules/mime-db": { - "version": "1.47.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.47.0.tgz", - "integrity": "sha512-QBmA/G2y+IfeS4oktet3qRZ+P5kPhCKRXxXnQEudYqUaEioAU1/Lq2us3D/t1Jfo4hE9REQPrbB7K5sOczJVIw==", + "version": "1.48.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.48.0.tgz", + "integrity": "sha512-FM3QwxV+TnZYQ2aRqhlKBMHxk10lTbMt3bBkMAp54ddrNeVSfcQYOOKuGuy3Ddrm38I04If834fOUSq1yzslJQ==", "engines": { "node": ">= 0.6" } }, "node_modules/mime-types": { - "version": "2.1.30", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.30.tgz", - "integrity": "sha512-crmjA4bLtR8m9qLpHvgxSChT+XoSlZi8J4n/aIdn3z92e/U47Z0V/yl+Wh9W046GgFVAmoNR/fmdbZYcSSIUeg==", + "version": "2.1.31", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.31.tgz", + "integrity": "sha512-XGZnNzm3QvgKxa8dpzyhFTHmpP3l5YNusmne07VUOXxou9CqUqYa/HBy124RqtVh/O2pECas/MOcsDgpilPOPg==", "dependencies": { - "mime-db": "1.47.0" + "mime-db": "1.48.0" }, "engines": { "node": ">= 0.6" @@ -583,9 +538,9 @@ } }, "node_modules/typescript": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.3.2.tgz", - "integrity": "sha512-zZ4hShnmnoVnAHpVHWpTcxdv7dWP60S2FsydQLV8V5PbS3FifjWFFRiHSWpDJahly88PRyV5teTSLoq4eG7mKw==", + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.3.4.tgz", + "integrity": "sha512-uauPG7XZn9F/mo+7MrsRjyvbxFpzemRjKEZXS4AK83oP2KKOJPvb+9cO/gmnv8arWZvhnjVOXz7B49m1l0e9Ew==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -648,25 +603,36 @@ "@azure/storage-blob": "^12.1.2", "semver": "^6.1.0", "uuid": "^3.3.3" + }, + "dependencies": { + "@actions/glob": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@actions/glob/-/glob-0.1.2.tgz", + "integrity": "sha512-SclLR7Ia5sEqjkJTPs7Sd86maMDw43p769YxBOxvPvEWuPEhpAnBsQfENOpXjFYMmhCqd127bmf+YdvJqVqR4A==", + "requires": { + "@actions/core": "^1.2.6", + "minimatch": "^3.0.4" + } + } } }, "@actions/core": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.3.0.tgz", - "integrity": "sha512-xxtX0Cwdhb8LcgatfJkokqT8KzPvcIbwL9xpLU09nOwBzaStbfm0dNncsP0M4us+EpoPdWy7vbzU5vSOH7K6pg==" + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.4.0.tgz", + "integrity": "sha512-CGx2ilGq5i7zSLgiiGUtBCxhRRxibJYU6Fim0Q1Wg2aQL2LTnF27zbqZOrxfvFQ55eSBW0L8uVStgtKMpa0Qlg==" }, "@actions/exec": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.0.4.tgz", - "integrity": "sha512-4DPChWow9yc9W3WqEbUj8Nr86xkpyE29ZzWjXucHItclLbEW6jr80Zx4nqv18QL6KK65+cifiQZXvnqgTV6oHw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.1.0.tgz", + "integrity": "sha512-LImpN9AY0J1R1mEYJjVJfSZWU4zYOlEcwSTgPve1rFQqK5AwrEs6uWW5Rv70gbDIQIAUwI86z6B+9mPK4w9Sbg==", "requires": { "@actions/io": "^1.0.1" } }, "@actions/glob": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/@actions/glob/-/glob-0.1.2.tgz", - "integrity": "sha512-SclLR7Ia5sEqjkJTPs7Sd86maMDw43p769YxBOxvPvEWuPEhpAnBsQfENOpXjFYMmhCqd127bmf+YdvJqVqR4A==", + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@actions/glob/-/glob-0.2.0.tgz", + "integrity": "sha512-mqE2a7I66kxcvsdwxs/filQwZsq25IfktMaviGfDB51v6Q3bvxnV7mFsZnvYtLhqGZbPxwBnH8AD3UYaOWb//w==", "requires": { "@actions/core": "^1.2.6", "minimatch": "^3.0.4" @@ -681,9 +647,9 @@ } }, "@actions/io": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@actions/io/-/io-1.1.0.tgz", - "integrity": "sha512-PspSX7Z9zh2Fyyuf3F6BsYeXcYHfc/VJ1vwy2vouas95efHVd42M6UfBFRs+jY0uiMDXhAoUtATn9g2r1MaWBQ==" + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@actions/io/-/io-1.1.1.tgz", + "integrity": "sha512-Qi4JoKXjmE0O67wAOH6y0n26QXhMKMFo7GD/4IXNVcrtLjUlGjGuVys6pQgwF3ArfGTQu0XpqaNr0YhED2RaRA==" }, "@azure/abort-controller": { "version": "1.0.4", @@ -694,9 +660,9 @@ }, "dependencies": { "tslib": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.2.0.tgz", - "integrity": "sha512-gS9GVHRU+RGn5KQM2rllAlR3dU6m7AcpJKdtH8gFvQiC4Otgk98XnmMU+nZenHt/+VhnBPWwgrJsyrdcw6i23w==" + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz", + "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==" } } }, @@ -715,16 +681,16 @@ }, "dependencies": { "tslib": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.2.0.tgz", - "integrity": "sha512-gS9GVHRU+RGn5KQM2rllAlR3dU6m7AcpJKdtH8gFvQiC4Otgk98XnmMU+nZenHt/+VhnBPWwgrJsyrdcw6i23w==" + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz", + "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==" } } }, "@azure/core-http": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@azure/core-http/-/core-http-1.2.4.tgz", - "integrity": "sha512-cNumz3ckyFZY5zWOgcTHSO7AKRVwxbodG8WfcEGcdH+ZJL3KvJEI/vN58H6xk5v3ijulU2x/WPGJqrMVvcI79A==", + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@azure/core-http/-/core-http-1.2.6.tgz", + "integrity": "sha512-odtH7UMKtekc5YQ86xg9GlVHNXR6pq2JgJ5FBo7/jbOjNGdBqcrIVrZx2bevXVJz/uUTSx6vUf62gzTXTfqYSQ==", "requires": { "@azure/abort-controller": "^1.0.0", "@azure/core-asynciterator-polyfill": "^1.0.0", @@ -737,27 +703,12 @@ "node-fetch": "^2.6.0", "process": "^0.11.10", "tough-cookie": "^4.0.0", - "tslib": "^2.0.0", + "tslib": "^2.2.0", "tunnel": "^0.0.6", "uuid": "^8.3.0", "xml2js": "^0.4.19" }, "dependencies": { - "@azure/core-tracing": { - "version": "1.0.0-preview.11", - "resolved": "https://registry.npmjs.org/@azure/core-tracing/-/core-tracing-1.0.0-preview.11.tgz", - "integrity": "sha512-frF0pJc9HTmKncVokhBxCqipjbql02DThQ1ZJ9wLi7SDMLdPAFyDI5xZNzX5guLz+/DtPkY+SGK2li9FIXqshQ==", - "requires": { - "@opencensus/web-types": "0.0.7", - "@opentelemetry/api": "1.0.0-rc.0", - "tslib": "^2.0.0" - } - }, - "@opentelemetry/api": { - "version": "1.0.0-rc.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.0.0-rc.0.tgz", - "integrity": "sha512-iXKByCMfrlO5S6Oh97BuM56tM2cIBB0XsL/vWF/AtJrJEKx4MC/Xdu0xDsGXMGcNWpqF7ujMsjjnp0+UHBwnDQ==" - }, "form-data": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz", @@ -779,9 +730,9 @@ } }, "tslib": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.2.0.tgz", - "integrity": "sha512-gS9GVHRU+RGn5KQM2rllAlR3dU6m7AcpJKdtH8gFvQiC4Otgk98XnmMU+nZenHt/+VhnBPWwgrJsyrdcw6i23w==" + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz", + "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==" }, "uuid": { "version": "8.3.2", @@ -802,25 +753,10 @@ "tslib": "^2.0.0" }, "dependencies": { - "@azure/core-tracing": { - "version": "1.0.0-preview.11", - "resolved": "https://registry.npmjs.org/@azure/core-tracing/-/core-tracing-1.0.0-preview.11.tgz", - "integrity": "sha512-frF0pJc9HTmKncVokhBxCqipjbql02DThQ1ZJ9wLi7SDMLdPAFyDI5xZNzX5guLz+/DtPkY+SGK2li9FIXqshQ==", - "requires": { - "@opencensus/web-types": "0.0.7", - "@opentelemetry/api": "1.0.0-rc.0", - "tslib": "^2.0.0" - } - }, - "@opentelemetry/api": { - "version": "1.0.0-rc.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.0.0-rc.0.tgz", - "integrity": "sha512-iXKByCMfrlO5S6Oh97BuM56tM2cIBB0XsL/vWF/AtJrJEKx4MC/Xdu0xDsGXMGcNWpqF7ujMsjjnp0+UHBwnDQ==" - }, "tslib": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.2.0.tgz", - "integrity": "sha512-gS9GVHRU+RGn5KQM2rllAlR3dU6m7AcpJKdtH8gFvQiC4Otgk98XnmMU+nZenHt/+VhnBPWwgrJsyrdcw6i23w==" + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz", + "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==" } } }, @@ -833,19 +769,19 @@ } }, "@azure/core-tracing": { - "version": "1.0.0-preview.10", - "resolved": "https://registry.npmjs.org/@azure/core-tracing/-/core-tracing-1.0.0-preview.10.tgz", - "integrity": "sha512-iIwjtMwQnsxB7cYkugMx+s4W1nfy3+pT/ceo+uW1fv4YDgYe84nh+QP0fEC9IH/3UATLSWbIBemdMHzk2APUrw==", + "version": "1.0.0-preview.11", + "resolved": "https://registry.npmjs.org/@azure/core-tracing/-/core-tracing-1.0.0-preview.11.tgz", + "integrity": "sha512-frF0pJc9HTmKncVokhBxCqipjbql02DThQ1ZJ9wLi7SDMLdPAFyDI5xZNzX5guLz+/DtPkY+SGK2li9FIXqshQ==", "requires": { "@opencensus/web-types": "0.0.7", - "@opentelemetry/api": "^0.10.2", + "@opentelemetry/api": "1.0.0-rc.0", "tslib": "^2.0.0" }, "dependencies": { "tslib": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.2.0.tgz", - "integrity": "sha512-gS9GVHRU+RGn5KQM2rllAlR3dU6m7AcpJKdtH8gFvQiC4Otgk98XnmMU+nZenHt/+VhnBPWwgrJsyrdcw6i23w==" + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz", + "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==" } } }, @@ -858,16 +794,16 @@ }, "dependencies": { "tslib": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.2.0.tgz", - "integrity": "sha512-gS9GVHRU+RGn5KQM2rllAlR3dU6m7AcpJKdtH8gFvQiC4Otgk98XnmMU+nZenHt/+VhnBPWwgrJsyrdcw6i23w==" + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz", + "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==" } } }, "@azure/ms-rest-js": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/@azure/ms-rest-js/-/ms-rest-js-2.5.0.tgz", - "integrity": "sha512-mXezdECH1Vjr+7FkH5+LlL85/YEHOrXHYqd9qh8b6dgvvE7sVvUk3qrtRGk3WZr4TLrZvRLE7NbFU7RgHHg45Q==", + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/@azure/ms-rest-js/-/ms-rest-js-2.5.2.tgz", + "integrity": "sha512-9nCuuoYwHZEZw1t0MVtENH+c1k2R4maYAlBBDSZhZu6bEucyfYUUigNXXKjt2cFBt4sO+sTzi0uI0f/fiPFr+Q==", "requires": { "@azure/core-auth": "^1.1.4", "abort-controller": "^3.0.0", @@ -881,25 +817,24 @@ } }, "@azure/storage-blob": { - "version": "12.5.0", - "resolved": "https://registry.npmjs.org/@azure/storage-blob/-/storage-blob-12.5.0.tgz", - "integrity": "sha512-DgoefgODst2IPkkQsNdhtYdyJgSsAZC1pEujO6aD5y7uFy5GnzhYliobSrp204jYRyK5XeJ9iiePmy/SPtTbLA==", + "version": "12.6.0", + "resolved": "https://registry.npmjs.org/@azure/storage-blob/-/storage-blob-12.6.0.tgz", + "integrity": "sha512-cAzsae+5ZdhugQfIT7o5SlVyF2Sc+HygZdPO41ZYdXklfGUyEt+5K4PyM5HQDc0MTVt6x7+waXcaAXT2eF9E6A==", "requires": { "@azure/abort-controller": "^1.0.0", "@azure/core-http": "^1.2.0", "@azure/core-lro": "^1.0.2", "@azure/core-paging": "^1.1.1", - "@azure/core-tracing": "1.0.0-preview.10", + "@azure/core-tracing": "1.0.0-preview.11", "@azure/logger": "^1.0.0", - "@opentelemetry/api": "^0.10.2", "events": "^3.0.0", "tslib": "^2.0.0" }, "dependencies": { "tslib": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.2.0.tgz", - "integrity": "sha512-gS9GVHRU+RGn5KQM2rllAlR3dU6m7AcpJKdtH8gFvQiC4Otgk98XnmMU+nZenHt/+VhnBPWwgrJsyrdcw6i23w==" + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz", + "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==" } } }, @@ -909,22 +844,14 @@ "integrity": "sha512-xB+w7ZDAu3YBzqH44rCmG9/RlrOmFuDPt/bpf17eJr8eZSrLt7nc7LnWdxM9Mmoj/YKMHpxRg28txu3TcpiL+g==" }, "@opentelemetry/api": { - "version": "0.10.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-0.10.2.tgz", - "integrity": "sha512-GtpMGd6vkzDMYcpu2t9LlhEgMy/SzBwRnz48EejlRArYqZzqSzAsKmegUK7zHgl+EOIaK9mKHhnRaQu3qw20cA==", - "requires": { - "@opentelemetry/context-base": "^0.10.2" - } - }, - "@opentelemetry/context-base": { - "version": "0.10.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/context-base/-/context-base-0.10.2.tgz", - "integrity": "sha512-hZNKjKOYsckoOEgBziGMnBcX0M7EtstnCmwz5jZUOUYwlZ+/xxX6z3jPu1XVO2Jivk0eLfuP9GP+vFD49CMetw==" + "version": "1.0.0-rc.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.0.0-rc.0.tgz", + "integrity": "sha512-iXKByCMfrlO5S6Oh97BuM56tM2cIBB0XsL/vWF/AtJrJEKx4MC/Xdu0xDsGXMGcNWpqF7ujMsjjnp0+UHBwnDQ==" }, "@types/node": { - "version": "15.6.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-15.6.1.tgz", - "integrity": "sha512-7EIraBEyRHEe7CH+Fm1XvgqU6uwZN8Q7jppJGcqjROMT29qhAuuOxYB1uEY5UMYQKEmA5D+5tBnhdaPXSsLONA==" + "version": "15.12.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-15.12.5.tgz", + "integrity": "sha512-se3yX7UHv5Bscf8f1ERKvQOD6sTyycH3hdaoozvaLxgUiY5lIGEeH37AD0G0Qi9kPqihPn0HOfd2yaIEN9VwEg==" }, "@types/node-fetch": { "version": "2.5.10", @@ -1032,16 +959,16 @@ "integrity": "sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk=" }, "mime-db": { - "version": "1.47.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.47.0.tgz", - "integrity": "sha512-QBmA/G2y+IfeS4oktet3qRZ+P5kPhCKRXxXnQEudYqUaEioAU1/Lq2us3D/t1Jfo4hE9REQPrbB7K5sOczJVIw==" + "version": "1.48.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.48.0.tgz", + "integrity": "sha512-FM3QwxV+TnZYQ2aRqhlKBMHxk10lTbMt3bBkMAp54ddrNeVSfcQYOOKuGuy3Ddrm38I04If834fOUSq1yzslJQ==" }, "mime-types": { - "version": "2.1.30", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.30.tgz", - "integrity": "sha512-crmjA4bLtR8m9qLpHvgxSChT+XoSlZi8J4n/aIdn3z92e/U47Z0V/yl+Wh9W046GgFVAmoNR/fmdbZYcSSIUeg==", + "version": "2.1.31", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.31.tgz", + "integrity": "sha512-XGZnNzm3QvgKxa8dpzyhFTHmpP3l5YNusmne07VUOXxou9CqUqYa/HBy124RqtVh/O2pECas/MOcsDgpilPOPg==", "requires": { - "mime-db": "1.47.0" + "mime-db": "1.48.0" } }, "minimatch": { @@ -1103,9 +1030,9 @@ "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==" }, "typescript": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.3.2.tgz", - "integrity": "sha512-zZ4hShnmnoVnAHpVHWpTcxdv7dWP60S2FsydQLV8V5PbS3FifjWFFRiHSWpDJahly88PRyV5teTSLoq4eG7mKw==", + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.3.4.tgz", + "integrity": "sha512-uauPG7XZn9F/mo+7MrsRjyvbxFpzemRjKEZXS4AK83oP2KKOJPvb+9cO/gmnv8arWZvhnjVOXz7B49m1l0e9Ew==", "dev": true }, "universalify": { diff --git a/package.json b/package.json index 7145364..042e837 100644 --- a/package.json +++ b/package.json @@ -23,14 +23,14 @@ "homepage": "https://github.com/Swatinem/rust-cache#readme", "dependencies": { "@actions/cache": "^1.0.7", - "@actions/core": "^1.3.0", - "@actions/exec": "^1.0.4", - "@actions/glob": "^0.1.2", - "@actions/io": "^1.1.0" + "@actions/core": "^1.4.0", + "@actions/exec": "^1.1.0", + "@actions/glob": "^0.2.0", + "@actions/io": "^1.1.1" }, "devDependencies": { "@vercel/ncc": "^0.28.6", - "typescript": "^4.3.2" + "typescript": "^4.3.4" }, "scripts": { "prepare": "ncc build --target es2020 -o dist/restore src/restore.ts && ncc build --target es2020 -o dist/save src/save.ts"