diff --git a/dist/azure/gitreleasemanager/close/bundle.js b/dist/azure/gitreleasemanager/close/bundle.js index 42ade1d83..d4a6b6f1d 100644 --- a/dist/azure/gitreleasemanager/close/bundle.js +++ b/dist/azure/gitreleasemanager/close/bundle.js @@ -1,8567 +1,228 @@ -module.exports = -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); -/******/ } -/******/ }; -/******/ -/******/ // define __esModule on exports -/******/ __webpack_require__.r = function(exports) { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ -/******/ // create a fake namespace object -/******/ // mode & 1: value is a module id, require it -/******/ // mode & 2: merge all properties of value into the ns -/******/ // mode & 4: return value when already ns object -/******/ // mode & 8|1: behave like require -/******/ __webpack_require__.t = function(value, mode) { -/******/ if(mode & 1) value = __webpack_require__(value); -/******/ if(mode & 8) return value; -/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; -/******/ var ns = Object.create(null); -/******/ __webpack_require__.r(ns); -/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); -/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); -/******/ return ns; -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = "./src/tasks/gitreleasemanager/close.ts"); -/******/ }) -/************************************************************************/ -/******/ ({ - -/***/ "./node_modules/azure-pipelines-task-lib sync recursive": +module.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=20)}([function(e,t){e.exports=require("assert")},function(e,t){e.exports=require("child_process")},function(e,t){e.exports=require("crypto")},function(e,t){e.exports=require("events")},function(e,t){e.exports=require("fs")},function(e,t){e.exports=require("http")},function(e,t){e.exports=require("https")},function(e,t){e.exports=require("net")},function(e,t){e.exports=require("os")},function(e,t){e.exports=require("path")},function(e,t){e.exports=require("process")},function(e,t){e.exports=require("tls")},function(e,t){e.exports=require("url")},function(e,t){e.exports=require("util")},function(e,t){e.exports=require("zlib")},,,,,,function(e,t,n){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="./src/tasks/gitreleasemanager/close.ts")}({"./node_modules/azure-pipelines-task-lib sync recursive": /*!****************************************************!*\ !*** ./node_modules/azure-pipelines-task-lib sync ***! \****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -function webpackEmptyContext(req) { - var e = new Error("Cannot find module '" + req + "'"); - e.code = 'MODULE_NOT_FOUND'; - throw e; -} -webpackEmptyContext.keys = function() { return []; }; -webpackEmptyContext.resolve = webpackEmptyContext; -module.exports = webpackEmptyContext; -webpackEmptyContext.id = "./node_modules/azure-pipelines-task-lib sync recursive"; - -/***/ }), - -/***/ "./node_modules/azure-pipelines-task-lib/internal.js": +/*! no static exports found */function(e,t){function n(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}n.keys=function(){return[]},n.resolve=n,e.exports=n,n.id="./node_modules/azure-pipelines-task-lib sync recursive"},"./node_modules/azure-pipelines-task-lib/internal.js": /*!***********************************************************!*\ !*** ./node_modules/azure-pipelines-task-lib/internal.js ***! \***********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -var fs = __webpack_require__(/*! fs */ "fs"); -var path = __webpack_require__(/*! path */ "path"); -var os = __webpack_require__(/*! os */ "os"); -var minimatch = __webpack_require__(/*! minimatch */ "./node_modules/minimatch/minimatch.js"); -var util = __webpack_require__(/*! util */ "util"); -var tcm = __webpack_require__(/*! ./taskcommand */ "./node_modules/azure-pipelines-task-lib/taskcommand.js"); -var vm = __webpack_require__(/*! ./vault */ "./node_modules/azure-pipelines-task-lib/vault.js"); -var semver = __webpack_require__(/*! semver */ "./node_modules/semver/semver.js"); -var crypto = __webpack_require__(/*! crypto */ "crypto"); -/** - * Hash table of known variable info. The formatted env var name is the lookup key. - * - * The purpose of this hash table is to keep track of known variables. The hash table - * needs to be maintained for multiple reasons: - * 1) to distinguish between env vars and job vars - * 2) to distinguish between secret vars and public - * 3) to know the real variable name and not just the formatted env var name. - */ -exports._knownVariableMap = {}; -//----------------------------------------------------- -// Validation Checks -//----------------------------------------------------- -// async await needs generators in node 4.x+ -if (semver.lt(process.versions.node, '4.2.0')) { - this.warning('Tasks require a new agent. Upgrade your agent or node to 4.2.0 or later'); -} -//----------------------------------------------------- -// String convenience -//----------------------------------------------------- -function _startsWith(str, start) { - return str.slice(0, start.length) == start; -} -exports._startsWith = _startsWith; - -function _endsWith(str, end) { - return str.slice(-end.length) == end; -} -exports._endsWith = _endsWith; -//----------------------------------------------------- -// General Helpers -//----------------------------------------------------- -var _outStream = process.stdout; -var _errStream = process.stderr; - -function _writeLine(str) { - _outStream.write(str + os.EOL); -} -exports._writeLine = _writeLine; - -function _setStdStream(stdStream) { - _outStream = stdStream; -} -exports._setStdStream = _setStdStream; - -function _setErrStream(errStream) { - _errStream = errStream; -} -exports._setErrStream = _setErrStream; -//----------------------------------------------------- -// Loc Helpers -//----------------------------------------------------- -var _locStringCache = {}; -var _resourceFiles = {}; -var _libResourceFileLoaded = false; -var _resourceCulture = 'en-US'; - -function _loadResJson(resjsonFile) { - var resJson; - if (_exist(resjsonFile)) { - var resjsonContent = fs.readFileSync(resjsonFile, 'utf8').toString(); - // remove BOM - if (resjsonContent.indexOf('\uFEFF') == 0) { - resjsonContent = resjsonContent.slice(1); - } - try { - resJson = JSON.parse(resjsonContent); - } catch (err) { - _debug('unable to parse resjson with err: ' + err.message); - } - } else { - _debug('.resjson file not found: ' + resjsonFile); - } - return resJson; -} - -function _loadLocStrings(resourceFile, culture) { - var locStrings = {}; - if (_exist(resourceFile)) { - var resourceJson = _loadResJson(resourceFile); - if (resourceJson && resourceJson.hasOwnProperty('messages')) { - var locResourceJson; - // load up resource resjson for different culture - var localizedResourceFile = path.join(path.dirname(resourceFile), 'Strings', 'resources.resjson'); - var upperCulture = culture.toUpperCase(); - var cultures = []; - try { - cultures = fs.readdirSync(localizedResourceFile); - } catch (ex) {} - for (var i = 0; i < cultures.length; i++) { - if (cultures[i].toUpperCase() == upperCulture) { - localizedResourceFile = path.join(localizedResourceFile, cultures[i], 'resources.resjson'); - if (_exist(localizedResourceFile)) { - locResourceJson = _loadResJson(localizedResourceFile); - } - break; - } - } - for (var key in resourceJson.messages) { - if (locResourceJson && locResourceJson.hasOwnProperty('loc.messages.' + key)) { - locStrings[key] = locResourceJson['loc.messages.' + key]; - } else { - locStrings[key] = resourceJson.messages[key]; - } - } - } - } else { - _warning('LIB_ResourceFile does not exist'); - } - return locStrings; -} -/** - * Sets the location of the resources json. This is typically the task.json file. - * Call once at the beginning of the script before any calls to loc. - * - * @param path Full path to the json. - * @returns void - */ -function _setResourcePath(path) { - if (process.env['TASKLIB_INPROC_UNITS']) { - _resourceFiles = {}; - _libResourceFileLoaded = false; - _locStringCache = {}; - _resourceCulture = 'en-US'; - } - if (!_resourceFiles[path]) { - _checkPath(path, 'resource file path'); - _resourceFiles[path] = path; - _debug('adding resource file: ' + path); - _resourceCulture = _getVariable('system.culture') || _resourceCulture; - var locStrs = _loadLocStrings(path, _resourceCulture); - for (var key in locStrs) { - //cache loc string - _locStringCache[key] = locStrs[key]; - } - } else { - _warning(_loc('LIB_ResourceFileAlreadySet', path)); - } -} -exports._setResourcePath = _setResourcePath; -/** - * Gets the localized string from the json resource file. Optionally formats with additional params. - * - * @param key key of the resources string in the resource file - * @param param additional params for formatting the string - * @returns string - */ -function _loc(key) { - var param = []; - for (var _i = 1; _i < arguments.length; _i++) { - param[_i - 1] = arguments[_i]; - } - if (!_libResourceFileLoaded) { - // merge loc strings from azure-pipelines-task-lib. - var libResourceFile = path.join(__dirname, 'lib.json'); - var libLocStrs = _loadLocStrings(libResourceFile, _resourceCulture); - for (var libKey in libLocStrs) { - //cache azure-pipelines-task-lib loc string - _locStringCache[libKey] = libLocStrs[libKey]; - } - _libResourceFileLoaded = true; - } - var locString;; - if (_locStringCache.hasOwnProperty(key)) { - locString = _locStringCache[key]; - } else { - if (Object.keys(_resourceFiles).length <= 0) { - _warning(_loc('LIB_ResourceFileNotSet', key)); - } else { - _warning(_loc('LIB_LocStringNotFound', key)); - } - locString = key; - } - if (param.length > 0) { - return util.format.apply(this, [locString].concat(param)); - } else { - return locString; - } -} -exports._loc = _loc; -//----------------------------------------------------- -// Input Helpers -//----------------------------------------------------- -/** - * Gets a variable value that is defined on the build/release definition or set at runtime. - * - * @param name name of the variable to get - * @returns string - */ -function _getVariable(name) { - var varval; - // get the metadata - var info; - var key = _getVariableKey(name); - if (exports._knownVariableMap.hasOwnProperty(key)) { - info = exports._knownVariableMap[key]; - } - if (info && info.secret) { - // get the secret value - varval = exports._vault.retrieveSecret('SECRET_' + key); - } else { - // get the public value - varval = process.env[key]; - // fallback for pre 2.104.1 agent - if (!varval && name.toUpperCase() == 'AGENT.JOBSTATUS') { - varval = process.env['agent.jobstatus']; - } - } - _debug(name + '=' + varval); - return varval; -} -exports._getVariable = _getVariable; - -function _getVariableKey(name) { - if (!name) { - throw new Error(_loc('LIB_ParameterIsRequired', 'name')); - } - return name.replace(/\./g, '_').replace(/ /g, '_').toUpperCase(); -} -exports._getVariableKey = _getVariableKey; -//----------------------------------------------------- -// Cmd Helpers -//----------------------------------------------------- -function _command(command, properties, message) { - var taskCmd = new tcm.TaskCommand(command, properties, message); - _writeLine(taskCmd.toString()); -} -exports._command = _command; - -function _warning(message) { - _command('task.issue', { 'type': 'warning' }, message); -} -exports._warning = _warning; - -function _error(message) { - _command('task.issue', { 'type': 'error' }, message); -} -exports._error = _error; - -function _debug(message) { - _command('task.debug', null, message); -} -exports._debug = _debug; -// //----------------------------------------------------- -// // Disk Functions -// //----------------------------------------------------- -/** - * Returns whether a path exists. - * - * @param path path to check - * @returns boolean - */ -function _exist(path) { - var exist = false; - try { - exist = !!(path && fs.statSync(path) != null); - } catch (err) { - if (err && err.code === 'ENOENT') { - exist = false; - } else { - throw err; - } - } - return exist; -} -exports._exist = _exist; -/** - * Checks whether a path exists. - * If the path does not exist, it will throw. - * - * @param p path to check - * @param name name only used in error message to identify the path - * @returns void - */ -function _checkPath(p, name) { - _debug('check path : ' + p); - if (!_exist(p)) { - throw new Error(_loc('LIB_PathNotFound', name, p)); - } -} -exports._checkPath = _checkPath; -/** - * 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 string - */ -function _which(tool, check) { - if (!tool) { - throw new Error('parameter \'tool\' is required'); - } - // recursive when check=true - if (check) { - var result = _which(tool, false); - if (result) { - return result; - } else { - if (process.platform == 'win32') { - throw new Error(_loc('LIB_WhichNotFound_Win', tool)); - } else { - throw new Error(_loc('LIB_WhichNotFound_Linux', tool)); - } - } - } - _debug("which '" + tool + "'"); - try { - // build the list of extensions to try - var extensions = []; - if (process.platform == 'win32' && process.env['PATHEXT']) { - for (var _i = 0, _a = process.env['PATHEXT'].split(path.delimiter); _i < _a.length; _i++) { - var extension = _a[_i]; - if (extension) { - extensions.push(extension); - } - } - } - // if it's rooted, return it if exists. otherwise return empty. - if (_isRooted(tool)) { - var filePath = _tryGetExecutablePath(tool, extensions); - if (filePath) { - _debug("found: '" + filePath + "'"); - return filePath; - } - _debug('not found'); - return ''; - } - // if any path separators, return empty - if (tool.indexOf('/') >= 0 || (process.platform == 'win32' && tool.indexOf('\\') >= 0)) { - _debug('not found'); - return ''; - } - // build the list of directories - // - // Note, technically "where" checks the current directory on Windows. From a task lib 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 task lib should strive for consistency - // across platforms. - var directories = []; - if (process.env['PATH']) { - for (var _b = 0, _c = process.env['PATH'].split(path.delimiter); _b < _c.length; _b++) { - var p = _c[_b]; - if (p) { - directories.push(p); - } - } - } - // return the first match - for (var _d = 0, directories_1 = directories; _d < directories_1.length; _d++) { - var directory = directories_1[_d]; - var filePath = _tryGetExecutablePath(directory + path.sep + tool, extensions); - if (filePath) { - _debug("found: '" + filePath + "'"); - return filePath; - } - } - _debug('not found'); - return ''; - } catch (err) { - throw new Error(_loc('LIB_OperationFailed', 'which', err.message)); - } -} -exports._which = _which; -/** - * 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 _tryGetExecutablePath(filePath, extensions) { - try { - // test file exists - var stats = fs.statSync(filePath); - if (stats.isFile()) { - if (process.platform == 'win32') { - // on Windows, test for valid extension - var isExecutable = false; - var fileName = path.basename(filePath); - var dotIndex = fileName.lastIndexOf('.'); - if (dotIndex >= 0) { - var upperExt_1 = fileName.substr(dotIndex).toUpperCase(); - if (extensions.some(function(validExt) { return validExt.toUpperCase() == upperExt_1; })) { - return filePath; - } - } - } else { - if (isUnixExecutable(stats)) { - return filePath; - } - } - } - } catch (err) { - if (err.code != 'ENOENT') { - _debug("Unexpected error attempting to determine if executable file exists '" + filePath + "': " + err); - } - } - // try each extension - var originalFilePath = filePath; - for (var _i = 0, extensions_1 = extensions; _i < extensions_1.length; _i++) { - var extension = extensions_1[_i]; - var found = false; - var filePath_1 = originalFilePath + extension; - try { - var stats = fs.statSync(filePath_1); - if (stats.isFile()) { - if (process.platform == 'win32') { - // preserve the case of the actual file (since an extension was appended) - try { - var directory = path.dirname(filePath_1); - var upperName = path.basename(filePath_1).toUpperCase(); - for (var _a = 0, _b = fs.readdirSync(directory); _a < _b.length; _a++) { - var actualName = _b[_a]; - if (upperName == actualName.toUpperCase()) { - filePath_1 = path.join(directory, actualName); - break; - } - } - } catch (err) { - _debug("Unexpected error attempting to determine the actual case of the file '" + filePath_1 + "': " + err); - } - return filePath_1; - } else { - if (isUnixExecutable(stats)) { - return filePath_1; - } - } - } - } catch (err) { - if (err.code != 'ENOENT') { - _debug("Unexpected error attempting to determine if executable file exists '" + filePath_1 + "': " + err); - } - } - } - return ''; -} -// 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 _legacyFindFiles_convertPatternToRegExp(pattern) { - pattern = (process.platform == 'win32' ? pattern.replace(/\\/g, '/') : pattern) // normalize separator on Windows - .replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&') // regex escape - from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript - .replace(/\\\/\\\*\\\*\\\//g, '((\/.+/)|(\/))') // replace directory globstar, e.g. /hello/**/world - .replace(/\\\*\\\*/g, '.*') // replace remaining globstars with a wildcard that can span directory separators, e.g. /hello/**dll - .replace(/\\\*/g, '[^\/]*') // replace asterisks with a wildcard that cannot span directory separators, e.g. /hello/*.dll - .replace(/\\\?/g, '[^\/]'); // replace single character wildcards, e.g. /hello/log?.dll - pattern = "^" + pattern + "$"; - var flags = process.platform == 'win32' ? 'i' : ''; - return new RegExp(pattern, flags); -} -exports._legacyFindFiles_convertPatternToRegExp = _legacyFindFiles_convertPatternToRegExp; - -function _cloneMatchOptions(matchOptions) { - return { - debug: matchOptions.debug, - nobrace: matchOptions.nobrace, - noglobstar: matchOptions.noglobstar, - dot: matchOptions.dot, - noext: matchOptions.noext, - nocase: matchOptions.nocase, - nonull: matchOptions.nonull, - matchBase: matchOptions.matchBase, - nocomment: matchOptions.nocomment, - nonegate: matchOptions.nonegate, - flipNegate: matchOptions.flipNegate - }; -} -exports._cloneMatchOptions = _cloneMatchOptions; - -function _getFindInfoFromPattern(defaultRoot, pattern, matchOptions) { - // parameter validation - if (!defaultRoot) { - throw new Error('getFindRootFromPattern() parameter defaultRoot cannot be empty'); - } - if (!pattern) { - throw new Error('getFindRootFromPattern() parameter pattern cannot be empty'); - } - if (!matchOptions.nobrace) { - throw new Error('getFindRootFromPattern() expected matchOptions.nobrace to be true'); - } - // for the sake of determining the findPath, pretend nocase=false - matchOptions = _cloneMatchOptions(matchOptions); - matchOptions.nocase = false; - // check if basename only and matchBase=true - if (matchOptions.matchBase && - !_isRooted(pattern) && - (process.platform == 'win32' ? pattern.replace(/\\/g, '/') : pattern).indexOf('/') < 0) { - return { - adjustedPattern: pattern, - findPath: defaultRoot, - statOnly: false, - }; - } - // the technique applied by this function is to use the information on the Minimatch object determine - // the findPath. Minimatch breaks the pattern into path segments, and exposes information about which - // segments are literal vs patterns. - // - // note, the technique currently imposes a limitation for drive-relative paths with a glob in the - // first segment, e.g. C:hello*/world. it's feasible to overcome this limitation, but is left unsolved - // for now. - var minimatchObj = new minimatch.Minimatch(pattern, matchOptions); - // the "set" property is an array of arrays of parsed path segment info. the outer array should only - // contain one item, otherwise something went wrong. brace expansion can result in multiple arrays, - // but that should be turned off by the time this function is reached. - if (minimatchObj.set.length != 1) { - throw new Error('getFindRootFromPattern() expected Minimatch(...).set.length to be 1. Actual: ' + minimatchObj.set.length); - } - var literalSegments = []; - for (var _i = 0, _a = minimatchObj.set[0]; _i < _a.length; _i++) { - var parsedSegment = _a[_i]; - if (typeof parsedSegment == 'string') { - // the item is a string when the original input for the path segment does not contain any - // unescaped glob characters. - // - // note, the string here is already unescaped (i.e. glob escaping removed), so it is ready - // to pass to find() as-is. for example, an input string 'hello\\*world' => 'hello*world'. - literalSegments.push(parsedSegment); - continue; - } - break; - } - // join the literal segments back together. Minimatch converts '\' to '/' on Windows, then squashes - // consequetive slashes, and finally splits on slash. this means that UNC format is lost, but can - // be detected from the original pattern. - var joinedSegments = literalSegments.join('/'); - if (joinedSegments && process.platform == 'win32' && _startsWith(pattern.replace(/\\/g, '/'), '//')) { - joinedSegments = '/' + joinedSegments; // restore UNC format - } - // determine the find path - var findPath; - if (_isRooted(pattern)) { // the pattern was rooted - findPath = joinedSegments; - } else if (joinedSegments) { // the pattern was not rooted, and literal segments were found - findPath = _ensureRooted(defaultRoot, joinedSegments); - } else { // the pattern was not rooted, and no literal segments were found - findPath = defaultRoot; - } - // clean up the path - if (findPath) { - findPath = _getDirectoryName(_ensureRooted(findPath, '_')); // hack to remove unnecessary trailing slash - findPath = _normalizeSeparators(findPath); // normalize slashes - } - return { - adjustedPattern: _ensurePatternRooted(defaultRoot, pattern), - findPath: findPath, - statOnly: literalSegments.length == minimatchObj.set[0].length, - }; -} -exports._getFindInfoFromPattern = _getFindInfoFromPattern; - -function _ensurePatternRooted(root, p) { - if (!root) { - throw new Error('ensurePatternRooted() parameter "root" cannot be empty'); - } - if (!p) { - throw new Error('ensurePatternRooted() parameter "p" cannot be empty'); - } - if (_isRooted(p)) { - return p; - } - // normalize root - root = _normalizeSeparators(root); - // escape special glob characters - root = (process.platform == 'win32' ? root : root.replace(/\\/g, '\\\\')) // escape '\' on OSX/Linux - .replace(/(\[)(?=[^\/]+\])/g, '[[]') // escape '[' when ']' follows within the path segment - .replace(/\?/g, '[?]') // escape '?' - .replace(/\*/g, '[*]') // escape '*' - .replace(/\+\(/g, '[+](') // escape '+(' - .replace(/@\(/g, '[@](') // escape '@(' - .replace(/!\(/g, '[!]('); // escape '!(' - return _ensureRooted(root, p); -} -exports._ensurePatternRooted = _ensurePatternRooted; -//------------------------------------------------------------------- -// Populate the vault with sensitive data. Inputs and Endpoints -//------------------------------------------------------------------- -function _loadData() { - // in agent, prefer TempDirectory then workFolder. - // In interactive dev mode, it won't be - var keyPath = _getVariable("agent.TempDirectory") || _getVariable("agent.workFolder") || process.cwd(); - exports._vault = new vm.Vault(keyPath); - exports._knownVariableMap = {}; - _debug('loading inputs and endpoints'); - var loaded = 0; - for (var envvar in process.env) { - if (_startsWith(envvar, 'INPUT_') || - _startsWith(envvar, 'ENDPOINT_AUTH_') || - _startsWith(envvar, 'SECUREFILE_TICKET_') || - _startsWith(envvar, 'SECRET_') || - _startsWith(envvar, 'VSTS_TASKVARIABLE_')) { - // Record the secret variable metadata. This is required by getVariable to know whether - // to retrieve the value from the vault. In a 2.104.1 agent or higher, this metadata will - // be overwritten when the VSTS_SECRET_VARIABLES env var is processed below. - if (_startsWith(envvar, 'SECRET_')) { - var variableName = envvar.substring('SECRET_'.length); - if (variableName) { - // This is technically not the variable name (has underscores instead of dots), - // but it's good enough to make getVariable work in a pre-2.104.1 agent where - // the VSTS_SECRET_VARIABLES env var is not defined. - exports._knownVariableMap[_getVariableKey(variableName)] = { name: variableName, secret: true }; - } - } - // store the secret - if (process.env[envvar]) { - ++loaded; - _debug('loading ' + envvar); - exports._vault.storeSecret(envvar, process.env[envvar]); - delete process.env[envvar]; - } - } - } - _debug('loaded ' + loaded); - // store public variable metadata - var names; - try { - names = JSON.parse(process.env['VSTS_PUBLIC_VARIABLES'] || '[]'); - } catch (err) { - throw new Error('Failed to parse VSTS_PUBLIC_VARIABLES as JSON. ' + err); // may occur during interactive testing - } - names.forEach(function(name) { - exports._knownVariableMap[_getVariableKey(name)] = { name: name, secret: false }; - }); - delete process.env['VSTS_PUBLIC_VARIABLES']; - // store secret variable metadata - try { - names = JSON.parse(process.env['VSTS_SECRET_VARIABLES'] || '[]'); - } catch (err) { - throw new Error('Failed to parse VSTS_SECRET_VARIABLES as JSON. ' + err); // may occur during interactive testing - } - names.forEach(function(name) { - exports._knownVariableMap[_getVariableKey(name)] = { name: name, secret: true }; - }); - delete process.env['VSTS_SECRET_VARIABLES']; - // avoid loading twice (overwrites .taskkey) - global['_vsts_task_lib_loaded'] = true; -} -exports._loadData = _loadData; -//-------------------------------------------------------------------------------- -// Internal path helpers. -//-------------------------------------------------------------------------------- -function _ensureRooted(root, p) { - if (!root) { - throw new Error('ensureRooted() parameter "root" cannot be empty'); - } - if (!p) { - throw new Error('ensureRooted() parameter "p" cannot be empty'); - } - if (_isRooted(p)) { - return p; - } - if (process.platform == 'win32' && root.match(/^[A-Z]:$/i)) { // e.g. C: - return root + p; - } - // ensure root ends with a separator - if (_endsWith(root, '/') || (process.platform == 'win32' && _endsWith(root, '\\'))) { - // root already ends with a separator - } else { - root += path.sep; // append separator - } - return root + p; -} -exports._ensureRooted = _ensureRooted; -/** - * Determines the parent path and trims trailing slashes (when safe). Path separators are normalized - * in the result. This function works similar to the .NET System.IO.Path.GetDirectoryName() method. - * For example, C:\hello\world\ returns C:\hello\world (trailing slash removed). Returns empty when - * no higher directory can be determined. - */ -function _getDirectoryName(p) { - // short-circuit if empty - if (!p) { - return ''; - } - // normalize separators - p = _normalizeSeparators(p); - // on Windows, the goal of this function is to match the behavior of - // [System.IO.Path]::GetDirectoryName(), e.g. - // C:/ => - // C:/hello => C:\ - // C:/hello/ => C:\hello - // C:/hello/world => C:\hello - // C:/hello/world/ => C:\hello\world - // C: => - // C:hello => C: - // C:hello/ => C:hello - // / => - // /hello => \ - // /hello/ => \hello - // //hello => - // //hello/ => - // //hello/world => - // //hello/world/ => \\hello\world - // - // unfortunately, path.dirname() can't simply be used. for example, on Windows - // it yields different results from Path.GetDirectoryName: - // C:/ => C:/ - // C:/hello => C:/ - // C:/hello/ => C:/ - // C:/hello/world => C:/hello - // C:/hello/world/ => C:/hello - // C: => C: - // C:hello => C: - // C:hello/ => C: - // / => / - // /hello => / - // /hello/ => / - // //hello => / - // //hello/ => / - // //hello/world => //hello/world - // //hello/world/ => //hello/world/ - // //hello/world/again => //hello/world/ - // //hello/world/again/ => //hello/world/ - // //hello/world/again/again => //hello/world/again - // //hello/world/again/again/ => //hello/world/again - if (process.platform == 'win32') { - if (/^[A-Z]:\\?[^\\]+$/i.test(p)) { // e.g. C:\hello or C:hello - return p.charAt(2) == '\\' ? p.substring(0, 3) : p.substring(0, 2); - } else if (/^[A-Z]:\\?$/i.test(p)) { // e.g. C:\ or C: - return ''; - } - var lastSlashIndex = p.lastIndexOf('\\'); - if (lastSlashIndex < 0) { // file name only - return ''; - } else if (p == '\\') { // relative root - return ''; - } else if (lastSlashIndex == 0) { // e.g. \\hello - return '\\'; - } else if (/^\\\\[^\\]+(\\[^\\]*)?$/.test(p)) { // UNC root, e.g. \\hello or \\hello\ or \\hello\world - return ''; - } - return p.substring(0, lastSlashIndex); // e.g. hello\world => hello or hello\world\ => hello\world - // note, this means trailing slashes for non-root directories - // (i.e. not C:\, \, or \\unc\) will simply be removed. - } - // OSX/Linux - if (p.indexOf('/') < 0) { // file name only - return ''; - } else if (p == '/') { - return ''; - } else if (_endsWith(p, '/')) { - return p.substring(0, p.length - 1); - } - return path.dirname(p); -} -exports._getDirectoryName = _getDirectoryName; -/** - * 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 _isRooted(p) { - p = _normalizeSeparators(p); - if (!p) { - throw new Error('isRooted() parameter "p" cannot be empty'); - } - if (process.platform == 'win32') { - return _startsWith(p, '\\') || // e.g. \ or \hello or \\hello - /^[A-Z]:/i.test(p); // e.g. C: or C:\hello - } - return _startsWith(p, '/'); // e.g. /hello -} -exports._isRooted = _isRooted; - -function _normalizeSeparators(p) { - p = p || ''; - if (process.platform == 'win32') { - // convert slashes on Windows - p = p.replace(/\//g, '\\'); - // remove redundant slashes - var isUnc = /^\\\\+[^\\]/.test(p); // e.g. \\hello - return (isUnc ? '\\' : '') + p.replace(/\\\\+/g, '\\'); // preserve leading // for UNC - } - // remove redundant slashes - return p.replace(/\/\/+/g, '/'); -} -exports._normalizeSeparators = _normalizeSeparators; -//----------------------------------------------------- -// Expose proxy information to vsts-node-api -//----------------------------------------------------- -function _exposeProxySettings() { - var proxyUrl = _getVariable('Agent.ProxyUrl'); - if (proxyUrl && proxyUrl.length > 0) { - var proxyUsername = _getVariable('Agent.ProxyUsername'); - var proxyPassword = _getVariable('Agent.ProxyPassword'); - var proxyBypassHostsJson = _getVariable('Agent.ProxyBypassList'); - global['_vsts_task_lib_proxy_url'] = proxyUrl; - global['_vsts_task_lib_proxy_username'] = proxyUsername; - global['_vsts_task_lib_proxy_bypass'] = proxyBypassHostsJson; - global['_vsts_task_lib_proxy_password'] = _exposeTaskLibSecret('proxy', proxyPassword || ''); - _debug('expose agent proxy configuration.'); - global['_vsts_task_lib_proxy'] = true; - } -} -exports._exposeProxySettings = _exposeProxySettings; -//----------------------------------------------------- -// Expose certificate information to vsts-node-api -//----------------------------------------------------- -function _exposeCertSettings() { - var ca = _getVariable('Agent.CAInfo'); - if (ca) { - global['_vsts_task_lib_cert_ca'] = ca; - } - var clientCert = _getVariable('Agent.ClientCert'); - if (clientCert) { - var clientCertKey = _getVariable('Agent.ClientCertKey'); - var clientCertArchive = _getVariable('Agent.ClientCertArchive'); - var clientCertPassword = _getVariable('Agent.ClientCertPassword'); - global['_vsts_task_lib_cert_clientcert'] = clientCert; - global['_vsts_task_lib_cert_key'] = clientCertKey; - global['_vsts_task_lib_cert_archive'] = clientCertArchive; - global['_vsts_task_lib_cert_passphrase'] = _exposeTaskLibSecret('cert', clientCertPassword || ''); - } - if (ca || clientCert) { - _debug('expose agent certificate configuration.'); - global['_vsts_task_lib_cert'] = true; - } - var skipCertValidation = _getVariable('Agent.SkipCertValidation') || 'false'; - if (skipCertValidation) { - global['_vsts_task_lib_skip_cert_validation'] = skipCertValidation.toUpperCase() === 'TRUE'; - } -} -exports._exposeCertSettings = _exposeCertSettings; -// We store the encryption key on disk and hold the encrypted content and key file in memory -// return base64encoded:base64encoded -// downstream vsts-node-api will retrieve the secret later -function _exposeTaskLibSecret(keyFile, secret) { - if (secret) { - var encryptKey = crypto.randomBytes(256); - var cipher = crypto.createCipher("aes-256-ctr", encryptKey); - var encryptedContent = cipher.update(secret, "utf8", "hex"); - encryptedContent += cipher.final("hex"); - var storageFile = path.join(_getVariable('Agent.TempDirectory') || _getVariable("agent.workFolder") || process.cwd(), keyFile); - fs.writeFileSync(storageFile, encryptKey.toString('base64'), { encoding: 'utf8' }); - return new Buffer(storageFile).toString('base64') + ':' + new Buffer(encryptedContent).toString('base64'); - } -} - -/***/ }), - -/***/ "./node_modules/azure-pipelines-task-lib/task.js": +/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(/*! fs */"fs"),i=n(/*! path */"path"),o=n(/*! os */"os"),s=n(/*! minimatch */"./node_modules/minimatch/minimatch.js"),a=n(/*! util */"util"),c=n(/*! ./taskcommand */"./node_modules/azure-pipelines-task-lib/taskcommand.js"),u=n(/*! ./vault */"./node_modules/azure-pipelines-task-lib/vault.js"),l=n(/*! semver */"./node_modules/semver/semver.js"),d=n(/*! crypto */"crypto");function p(e,t){return e.slice(0,t.length)==t}function f(e,t){return e.slice(-t.length)==t}t._knownVariableMap={},l.lt(process.versions.node,"4.2.0")&&this.warning("Tasks require a new agent. Upgrade your agent or node to 4.2.0 or later"),t._startsWith=p,t._endsWith=f;var h=process.stdout;process.stderr;function g(e){h.write(e+o.EOL)}t._writeLine=g,t._setStdStream=function(e){h=e},t._setErrStream=function(e){e};var y={},m={},v=!1,_="en-US";function b(e){var t;if(A(e)){var n=r.readFileSync(e,"utf8").toString();0==n.indexOf("\ufeff")&&(n=n.slice(1));try{t=JSON.parse(n)}catch(e){O("unable to parse resjson with err: "+e.message)}}else O(".resjson file not found: "+e);return t}function w(e,t){var n={};if(A(e)){var o=b(e);if(o&&o.hasOwnProperty("messages")){var s,a=i.join(i.dirname(e),"Strings","resources.resjson"),c=t.toUpperCase(),u=[];try{u=r.readdirSync(a)}catch(e){}for(var l=0;l0?a.format.apply(this,[t].concat(n)):t}function E(e){var n,r,i=j(e);return t._knownVariableMap.hasOwnProperty(i)&&(r=t._knownVariableMap[i]),r&&r.secret?n=t._vault.retrieveSecret("SECRET_"+i):(n=process.env[i])||"AGENT.JOBSTATUS"!=e.toUpperCase()||(n=process.env["agent.jobstatus"]),O(e+"="+n),n}function j(e){if(!e)throw new Error(S("LIB_ParameterIsRequired","name"));return e.replace(/\./g,"_").replace(/ /g,"_").toUpperCase()}function x(e,t,n){g(new c.TaskCommand(e,t,n).toString())}function T(e){x("task.issue",{type:"warning"},e)}function O(e){x("task.debug",null,e)}function A(e){var t=!1;try{t=!(!e||null==r.statSync(e))}catch(e){if(!e||"ENOENT"!==e.code)throw e;t=!1}return t}function P(e,t){if(O("check path : "+e),!A(e))throw new Error(S("LIB_PathNotFound",t,e))}function k(e,t){try{if((d=r.statSync(e)).isFile())if("win32"==process.platform){var n=i.basename(e),o=n.lastIndexOf(".");if(o>=0){var s=n.substr(o).toUpperCase();if(t.some((function(e){return e.toUpperCase()==s})))return e}}else if(C(d))return e}catch(t){"ENOENT"!=t.code&&O("Unexpected error attempting to determine if executable file exists '"+e+"': "+t)}for(var a=e,c=0,u=t;c0||(8&e.mode)>0&&e.gid===process.getgid()||(64&e.mode)>0&&e.uid===process.getuid()}function R(e){return{debug:e.debug,nobrace:e.nobrace,noglobstar:e.noglobstar,dot:e.dot,noext:e.noext,nocase:e.nocase,nonull:e.nonull,matchBase:e.matchBase,nocomment:e.nocomment,nonegate:e.nonegate,flipNegate:e.flipNegate}}function N(e,t){if(!e)throw new Error('ensurePatternRooted() parameter "root" cannot be empty');if(!t)throw new Error('ensurePatternRooted() parameter "p" cannot be empty');return D(t)?t:(e=B(e),I(e=("win32"==process.platform?e:e.replace(/\\/g,"\\\\")).replace(/(\[)(?=[^\/]+\])/g,"[[]").replace(/\?/g,"[?]").replace(/\*/g,"[*]").replace(/\+\(/g,"[+](").replace(/@\(/g,"[@](").replace(/!\(/g,"[!]("),t))}function I(e,t){if(!e)throw new Error('ensureRooted() parameter "root" cannot be empty');if(!t)throw new Error('ensureRooted() parameter "p" cannot be empty');return D(t)?t:"win32"==process.platform&&e.match(/^[A-Z]:$/i)?e+t:(f(e,"/")||"win32"==process.platform&&f(e,"\\")||(e+=i.sep),e+t)}function M(e){if(!e)return"";if(e=B(e),"win32"==process.platform){if(/^[A-Z]:\\?[^\\]+$/i.test(e))return"\\"==e.charAt(2)?e.substring(0,3):e.substring(0,2);if(/^[A-Z]:\\?$/i.test(e))return"";var t=e.lastIndexOf("\\");return t<0?"":"\\"==e?"":0==t?"\\":/^\\\\[^\\]+(\\[^\\]*)?$/.test(e)?"":e.substring(0,t)}return e.indexOf("/")<0?"":"/"==e?"":f(e,"/")?e.substring(0,e.length-1):i.dirname(e)}function D(e){if(!(e=B(e)))throw new Error('isRooted() parameter "p" cannot be empty');return"win32"==process.platform?p(e,"\\")||/^[A-Z]:/i.test(e):p(e,"/")}function B(e){return e=e||"","win32"==process.platform?(e=e.replace(/\//g,"\\"),(/^\\\\+[^\\]/.test(e)?"\\":"")+e.replace(/\\\\+/g,"\\")):e.replace(/\/\/+/g,"/")}function F(e,t){if(t){var n=d.randomBytes(256),o=d.createCipher("aes-256-ctr",n),s=o.update(t,"utf8","hex");s+=o.final("hex");var a=i.join(E("Agent.TempDirectory")||E("agent.workFolder")||process.cwd(),e);return r.writeFileSync(a,n.toString("base64"),{encoding:"utf8"}),new Buffer(a).toString("base64")+":"+new Buffer(s).toString("base64")}}t._setResourcePath=function(e){if(process.env.TASKLIB_INPROC_UNITS&&(m={},v=!1,y={},_="en-US"),m[e])T(S("LIB_ResourceFileAlreadySet",e));else{P(e,"resource file path"),m[e]=e,O("adding resource file: "+e);var t=w(e,_=E("system.culture")||_);for(var n in t)y[n]=t[n]}},t._loc=S,t._getVariable=E,t._getVariableKey=j,t._command=x,t._warning=T,t._error=function(e){x("task.issue",{type:"error"},e)},t._debug=O,t._exist=A,t._checkPath=P,t._which=function e(t,n){if(!t)throw new Error("parameter 'tool' is required");if(n){var r=e(t,!1);if(r)return r;throw"win32"==process.platform?new Error(S("LIB_WhichNotFound_Win",t)):new Error(S("LIB_WhichNotFound_Linux",t))}O("which '"+t+"'");try{var o=[];if("win32"==process.platform&&process.env.PATHEXT)for(var s=0,a=process.env.PATHEXT.split(i.delimiter);s=0||"win32"==process.platform&&t.indexOf("\\")>=0)return O("not found"),"";var u=[];if(process.env.PATH)for(var l=0,d=process.env.PATH.split(i.delimiter);l0){var t=E("Agent.ProxyUsername"),n=E("Agent.ProxyPassword"),r=E("Agent.ProxyBypassList");global._vsts_task_lib_proxy_url=e,global._vsts_task_lib_proxy_username=t,global._vsts_task_lib_proxy_bypass=r,global._vsts_task_lib_proxy_password=F("proxy",n||""),O("expose agent proxy configuration."),global._vsts_task_lib_proxy=!0}},t._exposeCertSettings=function(){var e=E("Agent.CAInfo");e&&(global._vsts_task_lib_cert_ca=e);var t=E("Agent.ClientCert");if(t){var n=E("Agent.ClientCertKey"),r=E("Agent.ClientCertArchive"),i=E("Agent.ClientCertPassword");global._vsts_task_lib_cert_clientcert=t,global._vsts_task_lib_cert_key=n,global._vsts_task_lib_cert_archive=r,global._vsts_task_lib_cert_passphrase=F("cert",i||"")}(e||t)&&(O("expose agent certificate configuration."),global._vsts_task_lib_cert=!0);var o=E("Agent.SkipCertValidation")||"false";o&&(global._vsts_task_lib_skip_cert_validation="TRUE"===o.toUpperCase())}},"./node_modules/azure-pipelines-task-lib/task.js": /*!*******************************************************!*\ !*** ./node_modules/azure-pipelines-task-lib/task.js ***! \*******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -var shell = __webpack_require__(/*! shelljs */ "./node_modules/shelljs/shell.js"); -var childProcess = __webpack_require__(/*! child_process */ "child_process"); -var fs = __webpack_require__(/*! fs */ "fs"); -var path = __webpack_require__(/*! path */ "path"); -var os = __webpack_require__(/*! os */ "os"); -var minimatch = __webpack_require__(/*! minimatch */ "./node_modules/minimatch/minimatch.js"); -var im = __webpack_require__(/*! ./internal */ "./node_modules/azure-pipelines-task-lib/internal.js"); -var tcm = __webpack_require__(/*! ./taskcommand */ "./node_modules/azure-pipelines-task-lib/taskcommand.js"); -var trm = __webpack_require__(/*! ./toolrunner */ "./node_modules/azure-pipelines-task-lib/toolrunner.js"); -var semver = __webpack_require__(/*! semver */ "./node_modules/semver/semver.js"); -var TaskResult; -(function (TaskResult) { - TaskResult[TaskResult["Succeeded"] = 0] = "Succeeded"; - TaskResult[TaskResult["SucceededWithIssues"] = 1] = "SucceededWithIssues"; - TaskResult[TaskResult["Failed"] = 2] = "Failed"; - TaskResult[TaskResult["Cancelled"] = 3] = "Cancelled"; - TaskResult[TaskResult["Skipped"] = 4] = "Skipped"; -})(TaskResult = exports.TaskResult || (exports.TaskResult = {})); -var TaskState; -(function (TaskState) { - TaskState[TaskState["Unknown"] = 0] = "Unknown"; - TaskState[TaskState["Initialized"] = 1] = "Initialized"; - TaskState[TaskState["InProgress"] = 2] = "InProgress"; - TaskState[TaskState["Completed"] = 3] = "Completed"; -})(TaskState = exports.TaskState || (exports.TaskState = {})); -var IssueType; -(function (IssueType) { - IssueType[IssueType["Error"] = 0] = "Error"; - IssueType[IssueType["Warning"] = 1] = "Warning"; -})(IssueType = exports.IssueType || (exports.IssueType = {})); -var ArtifactType; -(function (ArtifactType) { - ArtifactType[ArtifactType["Container"] = 0] = "Container"; - ArtifactType[ArtifactType["FilePath"] = 1] = "FilePath"; - ArtifactType[ArtifactType["VersionControl"] = 2] = "VersionControl"; - ArtifactType[ArtifactType["GitRef"] = 3] = "GitRef"; - ArtifactType[ArtifactType["TfvcLabel"] = 4] = "TfvcLabel"; -})(ArtifactType = exports.ArtifactType || (exports.ArtifactType = {})); -var FieldType; -(function (FieldType) { - FieldType[FieldType["AuthParameter"] = 0] = "AuthParameter"; - FieldType[FieldType["DataParameter"] = 1] = "DataParameter"; - FieldType[FieldType["Url"] = 2] = "Url"; -})(FieldType = exports.FieldType || (exports.FieldType = {})); -/** Platforms supported by our build agent */ -var Platform; -(function (Platform) { - Platform[Platform["Windows"] = 0] = "Windows"; - Platform[Platform["MacOS"] = 1] = "MacOS"; - Platform[Platform["Linux"] = 2] = "Linux"; -})(Platform = exports.Platform || (exports.Platform = {})); -//----------------------------------------------------- -// General Helpers -//----------------------------------------------------- -exports.setStdStream = im._setStdStream; -exports.setErrStream = im._setErrStream; -//----------------------------------------------------- -// Results -//----------------------------------------------------- -/** - * Sets the result of the task. - * Execution will continue. - * If not set, task will be Succeeded. - * If multiple calls are made to setResult the most pessimistic call wins (Failed) regardless of the order of calls. - * - * @param result TaskResult enum of Succeeded, SucceededWithIssues, Failed, Cancelled or Skipped. - * @param message A message which will be logged as an error issue if the result is Failed. - * @param done Optional. Instructs the agent the task is done. This is helpful when child processes - * may still be running and prevent node from fully exiting. This argument is supported - * from agent version 2.142.0 or higher (otherwise will no-op). - * @returns void - */ -function setResult(result, message, done) { - exports.debug('task result: ' + TaskResult[result]); - // add an error issue - if (result == TaskResult.Failed && message) { - exports.error(message); - } - else if (result == TaskResult.SucceededWithIssues && message) { - exports.warning(message); - } - // task.complete - var properties = { 'result': TaskResult[result] }; - if (done) { - properties['done'] = 'true'; - } - exports.command('task.complete', properties, message); -} -exports.setResult = setResult; -// -// Catching all exceptions -// -process.on('uncaughtException', function (err) { - setResult(TaskResult.Failed, exports.loc('LIB_UnhandledEx', err.message)); -}); -//----------------------------------------------------- -// Loc Helpers -//----------------------------------------------------- -exports.setResourcePath = im._setResourcePath; -exports.loc = im._loc; -//----------------------------------------------------- -// Input Helpers -//----------------------------------------------------- -exports.getVariable = im._getVariable; -/** - * Asserts the agent version is at least the specified minimum. - * - * @param minimum minimum version version - must be 2.104.1 or higher - */ -function assertAgent(minimum) { - if (semver.lt(minimum, '2.104.1')) { - throw new Error('assertAgent() requires the parameter to be 2.104.1 or higher'); - } - var agent = exports.getVariable('Agent.Version'); - if (agent && semver.lt(agent, minimum)) { - throw new Error("Agent version " + minimum + " or higher is required"); - } -} -exports.assertAgent = assertAgent; -/** - * Gets a snapshot of the current state of all job variables available to the task. - * Requires a 2.104.1 agent or higher for full functionality. - * - * Limitations on an agent prior to 2.104.1: - * 1) The return value does not include all public variables. Only public variables - * that have been added using setVariable are returned. - * 2) The name returned for each secret variable is the formatted environment variable - * name, not the actual variable name (unless it was set explicitly at runtime using - * setVariable). - * - * @returns VariableInfo[] - */ -function getVariables() { - return Object.keys(im._knownVariableMap) - .map(function (key) { - var info = im._knownVariableMap[key]; - return { name: info.name, value: exports.getVariable(info.name), secret: info.secret }; - }); -} -exports.getVariables = getVariables; -/** - * Sets a variable which will be available to subsequent tasks as well. - * - * @param name name of the variable to set - * @param val value to set - * @param secret whether variable is secret. Multi-line secrets are not allowed. Optional, defaults to false - * @returns void - */ -function setVariable(name, val, secret) { - if (secret === void 0) { secret = false; } - // once a secret always a secret - var key = im._getVariableKey(name); - if (im._knownVariableMap.hasOwnProperty(key)) { - secret = secret || im._knownVariableMap[key].secret; - } - // store the value - var varValue = val || ''; - exports.debug('set ' + name + '=' + (secret && varValue ? '********' : varValue)); - if (secret) { - if (varValue && varValue.match(/\r|\n/) && ("" + process.env['SYSTEM_UNSAFEALLOWMULTILINESECRET']).toUpperCase() != 'TRUE') { - throw new Error(exports.loc('LIB_MultilineSecret')); - } - im._vault.storeSecret('SECRET_' + key, varValue); - delete process.env[key]; - } - else { - process.env[key] = varValue; - } - // store the metadata - im._knownVariableMap[key] = { name: name, secret: secret }; - // write the command - exports.command('task.setvariable', { 'variable': name || '', 'issecret': (secret || false).toString() }, varValue); -} -exports.setVariable = setVariable; -/** - * Registers a value with the logger, so the value will be masked from the logs. Multi-line secrets are not allowed. - * - * @param val value to register - */ -function setSecret(val) { - if (val) { - if (val.match(/\r|\n/) && ("" + process.env['SYSTEM_UNSAFEALLOWMULTILINESECRET']).toUpperCase() !== 'TRUE') { - throw new Error(exports.loc('LIB_MultilineSecret')); - } - exports.command('task.setsecret', {}, val); - } -} -exports.setSecret = setSecret; -/** - * Gets the value of an input. The value is also trimmed. - * If required is true and the value is not set, it will throw. - * - * @param name name of the input to get - * @param required whether input is required. optional, defaults to false - * @returns string - */ -function getInput(name, required) { - var inval = im._vault.retrieveSecret('INPUT_' + im._getVariableKey(name)); - if (inval) { - inval = inval.trim(); - } - if (required && !inval) { - throw new Error(exports.loc('LIB_InputRequired', name)); - } - exports.debug(name + '=' + inval); - return inval; -} -exports.getInput = getInput; -/** - * Gets the value of an input and converts to a bool. Convenience. - * If required is true and the value is not set, it will throw. - * If required is false and the value is not set, returns false. - * - * @param name name of the bool input to get - * @param required whether input is required. optional, defaults to false - * @returns boolean - */ -function getBoolInput(name, required) { - return (getInput(name, required) || '').toUpperCase() == "TRUE"; -} -exports.getBoolInput = getBoolInput; -/** - * Gets the value of an input and splits the value using a delimiter (space, comma, etc). - * Empty values are removed. This function is useful for splitting an input containing a simple - * list of items - such as build targets. - * IMPORTANT: Do not use this function for splitting additional args! Instead use argString(), which - * follows normal argument splitting rules and handles values encapsulated by quotes. - * If required is true and the value is not set, it will throw. - * - * @param name name of the input to get - * @param delim delimiter to split on - * @param required whether input is required. optional, defaults to false - * @returns string[] - */ -function getDelimitedInput(name, delim, required) { - var inputVal = getInput(name, required); - if (!inputVal) { - return []; - } - var result = []; - inputVal.split(delim).forEach(function (x) { - if (x) { - result.push(x); - } - }); - return result; -} -exports.getDelimitedInput = getDelimitedInput; -/** - * Checks whether a path inputs value was supplied by the user - * File paths are relative with a picker, so an empty path is the root of the repo. - * Useful if you need to condition work (like append an arg) if a value was supplied - * - * @param name name of the path input to check - * @returns boolean - */ -function filePathSupplied(name) { - // normalize paths - var pathValue = this.resolve(this.getPathInput(name) || ''); - var repoRoot = this.resolve(exports.getVariable('build.sourcesDirectory') || exports.getVariable('system.defaultWorkingDirectory') || ''); - var supplied = pathValue !== repoRoot; - exports.debug(name + 'path supplied :' + supplied); - return supplied; -} -exports.filePathSupplied = filePathSupplied; -/** - * Gets the value of a path input - * It will be quoted for you if it isn't already and contains spaces - * If required is true and the value is not set, it will throw. - * If check is true and the path does not exist, it will throw. - * - * @param name name of the input to get - * @param required whether input is required. optional, defaults to false - * @param check whether path is checked. optional, defaults to false - * @returns string - */ -function getPathInput(name, required, check) { - var inval = getInput(name, required); - if (inval) { - if (check) { - exports.checkPath(inval, name); - } - } - return inval; -} -exports.getPathInput = getPathInput; -//----------------------------------------------------- -// Endpoint Helpers -//----------------------------------------------------- -/** - * Gets the url for a service endpoint - * If the url was not set and is not optional, it will throw. - * - * @param id name of the service endpoint - * @param optional whether the url is optional - * @returns string - */ -function getEndpointUrl(id, optional) { - var urlval = process.env['ENDPOINT_URL_' + id]; - if (!optional && !urlval) { - throw new Error(exports.loc('LIB_EndpointNotExist', id)); - } - exports.debug(id + '=' + urlval); - return urlval; -} -exports.getEndpointUrl = getEndpointUrl; -/* - * Gets the endpoint data parameter value with specified key for a service endpoint - * If the endpoint data parameter was not set and is not optional, it will throw. - * - * @param id name of the service endpoint - * @param key of the parameter - * @param optional whether the endpoint data is optional - * @returns {string} value of the endpoint data parameter - */ -function getEndpointDataParameter(id, key, optional) { - var dataParamVal = process.env['ENDPOINT_DATA_' + id + '_' + key.toUpperCase()]; - if (!optional && !dataParamVal) { - throw new Error(exports.loc('LIB_EndpointDataNotExist', id, key)); - } - exports.debug(id + ' data ' + key + ' = ' + dataParamVal); - return dataParamVal; -} -exports.getEndpointDataParameter = getEndpointDataParameter; -/** - * Gets the endpoint authorization scheme for a service endpoint - * If the endpoint authorization scheme is not set and is not optional, it will throw. - * - * @param id name of the service endpoint - * @param optional whether the endpoint authorization scheme is optional - * @returns {string} value of the endpoint authorization scheme - */ -function getEndpointAuthorizationScheme(id, optional) { - var authScheme = im._vault.retrieveSecret('ENDPOINT_AUTH_SCHEME_' + id); - if (!optional && !authScheme) { - throw new Error(exports.loc('LIB_EndpointAuthNotExist', id)); - } - exports.debug(id + ' auth scheme = ' + authScheme); - return authScheme; -} -exports.getEndpointAuthorizationScheme = getEndpointAuthorizationScheme; -/** - * Gets the endpoint authorization parameter value for a service endpoint with specified key - * If the endpoint authorization parameter is not set and is not optional, it will throw. - * - * @param id name of the service endpoint - * @param key key to find the endpoint authorization parameter - * @param optional optional whether the endpoint authorization scheme is optional - * @returns {string} value of the endpoint authorization parameter value - */ -function getEndpointAuthorizationParameter(id, key, optional) { - var authParam = im._vault.retrieveSecret('ENDPOINT_AUTH_PARAMETER_' + id + '_' + key.toUpperCase()); - if (!optional && !authParam) { - throw new Error(exports.loc('LIB_EndpointAuthNotExist', id)); - } - exports.debug(id + ' auth param ' + key + ' = ' + authParam); - return authParam; -} -exports.getEndpointAuthorizationParameter = getEndpointAuthorizationParameter; -/** - * Gets the authorization details for a service endpoint - * If the authorization was not set and is not optional, it will throw. - * - * @param id name of the service endpoint - * @param optional whether the url is optional - * @returns string - */ -function getEndpointAuthorization(id, optional) { - var aval = im._vault.retrieveSecret('ENDPOINT_AUTH_' + id); - if (!optional && !aval) { - setResult(TaskResult.Failed, exports.loc('LIB_EndpointAuthNotExist', id)); - } - exports.debug(id + ' exists ' + (aval !== null)); - var auth; - try { - if (aval) { - auth = JSON.parse(aval); - } - } - catch (err) { - throw new Error(exports.loc('LIB_InvalidEndpointAuth', aval)); - } - return auth; -} -exports.getEndpointAuthorization = getEndpointAuthorization; -//----------------------------------------------------- -// SecureFile Helpers -//----------------------------------------------------- -/** - * Gets the name for a secure file - * - * @param id secure file id - * @returns string - */ -function getSecureFileName(id) { - var name = process.env['SECUREFILE_NAME_' + id]; - exports.debug('secure file name for id ' + id + ' = ' + name); - return name; -} -exports.getSecureFileName = getSecureFileName; -/** - * Gets the secure file ticket that can be used to download the secure file contents - * - * @param id name of the secure file - * @returns {string} secure file ticket - */ -function getSecureFileTicket(id) { - var ticket = im._vault.retrieveSecret('SECUREFILE_TICKET_' + id); - exports.debug('secure file ticket for id ' + id + ' = ' + ticket); - return ticket; -} -exports.getSecureFileTicket = getSecureFileTicket; -//----------------------------------------------------- -// Task Variable Helpers -//----------------------------------------------------- -/** - * Gets a variable value that is set by previous step from the same wrapper task. - * Requires a 2.115.0 agent or higher. - * - * @param name name of the variable to get - * @returns string - */ -function getTaskVariable(name) { - assertAgent('2.115.0'); - var inval = im._vault.retrieveSecret('VSTS_TASKVARIABLE_' + im._getVariableKey(name)); - if (inval) { - inval = inval.trim(); - } - exports.debug('task variable: ' + name + '=' + inval); - return inval; -} -exports.getTaskVariable = getTaskVariable; -/** - * Sets a task variable which will only be available to subsequent steps belong to the same wrapper task. - * Requires a 2.115.0 agent or higher. - * - * @param name name of the variable to set - * @param val value to set - * @param secret whether variable is secret. optional, defaults to false - * @returns void - */ -function setTaskVariable(name, val, secret) { - if (secret === void 0) { secret = false; } - assertAgent('2.115.0'); - var key = im._getVariableKey(name); - // store the value - var varValue = val || ''; - exports.debug('set task variable: ' + name + '=' + (secret && varValue ? '********' : varValue)); - im._vault.storeSecret('VSTS_TASKVARIABLE_' + key, varValue); - delete process.env[key]; - // write the command - exports.command('task.settaskvariable', { 'variable': name || '', 'issecret': (secret || false).toString() }, varValue); -} -exports.setTaskVariable = setTaskVariable; -//----------------------------------------------------- -// Cmd Helpers -//----------------------------------------------------- -exports.command = im._command; -exports.warning = im._warning; -exports.error = im._error; -exports.debug = im._debug; -//----------------------------------------------------- -// Disk Functions -//----------------------------------------------------- -function _checkShell(cmd, continueOnError) { - var se = shell.error(); - if (se) { - exports.debug(cmd + ' failed'); - var errMsg = exports.loc('LIB_OperationFailed', cmd, se); - exports.debug(errMsg); - if (!continueOnError) { - throw new Error(errMsg); - } - } -} -/** - * Get's stat on a path. - * Useful for checking whether a file or directory. Also getting created, modified and accessed time. - * see [fs.stat](https://nodejs.org/api/fs.html#fs_class_fs_stats) - * - * @param path path to check - * @returns fsStat - */ -function stats(path) { - return fs.statSync(path); -} -exports.stats = stats; -exports.exist = im._exist; -function writeFile(file, data, options) { - if (typeof (options) === 'string') { - fs.writeFileSync(file, data, { encoding: options }); - } - else { - fs.writeFileSync(file, data, options); - } -} -exports.writeFile = writeFile; -/** - * @deprecated Use `getPlatform` - * Useful for determining the host operating system. - * see [os.type](https://nodejs.org/api/os.html#os_os_type) - * - * @return the name of the operating system - */ -function osType() { - return os.type(); -} -exports.osType = osType; -/** - * Determine the operating system the build agent is running on. - * @returns {Platform} - * @throws {Error} Platform is not supported by our agent - */ -function getPlatform() { - switch (process.platform) { - case 'win32': return Platform.Windows; - case 'darwin': return Platform.MacOS; - case 'linux': return Platform.Linux; - default: throw Error(exports.loc('LIB_PlatformNotSupported', process.platform)); - } -} -exports.getPlatform = getPlatform; -/** - * Returns the process's current working directory. - * see [process.cwd](https://nodejs.org/api/process.html#process_process_cwd) - * - * @return the path to the current working directory of the process - */ -function cwd() { - return process.cwd(); -} -exports.cwd = cwd; -exports.checkPath = im._checkPath; -/** - * Change working directory. - * - * @param path new working directory path - * @returns void - */ -function cd(path) { - if (path) { - shell.cd(path); - _checkShell('cd'); - } -} -exports.cd = cd; -/** - * Change working directory and push it on the stack - * - * @param path new working directory path - * @returns void - */ -function pushd(path) { - shell.pushd(path); - _checkShell('pushd'); -} -exports.pushd = pushd; -/** - * Change working directory back to previously pushed directory - * - * @returns void - */ -function popd() { - shell.popd(); - _checkShell('popd'); -} -exports.popd = popd; -/** - * Make a directory. Creates the full path with folders in between - * Will throw if it fails - * - * @param p path to create - * @returns void - */ -function mkdirP(p) { - if (!p) { - throw new Error(exports.loc('LIB_ParameterIsRequired', 'p')); - } - // build a stack of directories to create - var stack = []; - var testDir = p; - while (true) { - // validate the loop is not out of control - if (stack.length >= (process.env['TASKLIB_TEST_MKDIRP_FAILSAFE'] || 1000)) { - // let the framework throw - exports.debug('loop is out of control'); - fs.mkdirSync(p); - return; - } - exports.debug("testing directory '" + testDir + "'"); - var stats_1 = void 0; - try { - stats_1 = fs.statSync(testDir); - } - catch (err) { - if (err.code == 'ENOENT') { - // validate the directory is not the drive root - var parentDir = path.dirname(testDir); - if (testDir == parentDir) { - throw new Error(exports.loc('LIB_MkdirFailedInvalidDriveRoot', p, testDir)); // Unable to create directory '{p}'. Root directory does not exist: '{testDir}' - } - // push the dir and test the parent - stack.push(testDir); - testDir = parentDir; - continue; - } - else if (err.code == 'UNKNOWN') { - throw new Error(exports.loc('LIB_MkdirFailedInvalidShare', p, testDir)); // Unable to create directory '{p}'. Unable to verify the directory exists: '{testDir}'. If directory is a file share, please verify the share name is correct, the share is online, and the current process has permission to access the share. - } - else { - throw err; - } - } - if (!stats_1.isDirectory()) { - throw new Error(exports.loc('LIB_MkdirFailedFileExists', p, testDir)); // Unable to create directory '{p}'. Conflicting file exists: '{testDir}' - } - // testDir exists - break; - } - // create each directory - while (stack.length) { - var dir = stack.pop(); // non-null because `stack.length` was truthy - exports.debug("mkdir '" + dir + "'"); - try { - fs.mkdirSync(dir); - } - catch (err) { - throw new Error(exports.loc('LIB_MkdirFailed', p, err.message)); // Unable to create directory '{p}'. {err.message} - } - } -} -exports.mkdirP = mkdirP; -/** - * Resolves a sequence of paths or path segments into an absolute path. - * Calls node.js path.resolve() - * Allows L0 testing with consistent path formats on Mac/Linux and Windows in the mock implementation - * @param pathSegments - * @returns {string} - */ -function resolve() { - var pathSegments = []; - for (var _i = 0; _i < arguments.length; _i++) { - pathSegments[_i] = arguments[_i]; - } - var absolutePath = path.resolve.apply(this, pathSegments); - exports.debug('Absolute path for pathSegments: ' + pathSegments + ' = ' + absolutePath); - return absolutePath; -} -exports.resolve = resolve; -exports.which = im._which; -/** - * Returns array of files in the given path, or in current directory if no path provided. See shelljs.ls - * @param {string} options Available options: -R (recursive), -A (all files, include files beginning with ., except for . and ..) - * @param {string[]} paths Paths to search. - * @return {string[]} An array of files in the given path(s). - */ -function ls(options, paths) { - if (options) { - return shell.ls(options, paths); - } - else { - return shell.ls(paths); - } -} -exports.ls = ls; -/** - * Copies a file or folder. - * - * @param source source path - * @param dest destination path - * @param options string -r, -f or -rf for recursive and force - * @param continueOnError optional. whether to continue on error - */ -function cp(source, dest, options, continueOnError) { - if (options) { - shell.cp(options, source, dest); - } - else { - shell.cp(source, dest); - } - _checkShell('cp', continueOnError); -} -exports.cp = cp; -/** - * Moves a path. - * - * @param source source path - * @param dest destination path - * @param options string -f or -n for force and no clobber - * @param continueOnError optional. whether to continue on error - */ -function mv(source, dest, options, continueOnError) { - if (options) { - shell.mv(options, source, dest); - } - else { - shell.mv(source, dest); - } - _checkShell('mv', continueOnError); -} -exports.mv = mv; -/** - * Recursively finds all paths a given path. Returns an array of paths. - * - * @param findPath path to search - * @param options optional. defaults to { followSymbolicLinks: true }. following soft links is generally appropriate unless deleting files. - * @returns string[] - */ -function find(findPath, options) { - if (!findPath) { - exports.debug('no path specified'); - return []; - } - // normalize the path, otherwise the first result is inconsistently formatted from the rest of the results - // because path.join() performs normalization. - findPath = path.normalize(findPath); - // debug trace the parameters - exports.debug("findPath: '" + findPath + "'"); - options = options || _getDefaultFindOptions(); - _debugFindOptions(options); - // return empty if not exists - try { - fs.lstatSync(findPath); - } - catch (err) { - if (err.code == 'ENOENT') { - exports.debug('0 results'); - return []; - } - throw err; - } - try { - var result = []; - // push the first item - var stack = [new _FindItem(findPath, 1)]; - var traversalChain = []; // used to detect cycles - var _loop_1 = function () { - // pop the next item and push to the result array - var item = stack.pop(); // non-null because `stack.length` was truthy - result.push(item.path); - // stat the item. the stat info is used further below to determine whether to traverse deeper - // - // stat returns info about the target of a symlink (or symlink chain), - // lstat returns info about a symlink itself - var stats_2 = void 0; - if (options.followSymbolicLinks) { - try { - // use stat (following all symlinks) - stats_2 = fs.statSync(item.path); - } - catch (err) { - if (err.code == 'ENOENT' && options.allowBrokenSymbolicLinks) { - // fallback to lstat (broken symlinks allowed) - stats_2 = fs.lstatSync(item.path); - exports.debug(" " + item.path + " (broken symlink)"); - } - else { - throw err; - } - } - } - else if (options.followSpecifiedSymbolicLink && result.length == 1) { - try { - // use stat (following symlinks for the specified path and this is the specified path) - stats_2 = fs.statSync(item.path); - } - catch (err) { - if (err.code == 'ENOENT' && options.allowBrokenSymbolicLinks) { - // fallback to lstat (broken symlinks allowed) - stats_2 = fs.lstatSync(item.path); - exports.debug(" " + item.path + " (broken symlink)"); - } - else { - throw err; - } - } - } - else { - // use lstat (not following symlinks) - stats_2 = fs.lstatSync(item.path); - } - // note, isDirectory() returns false for the lstat of a symlink - if (stats_2.isDirectory()) { - exports.debug(" " + item.path + " (directory)"); - if (options.followSymbolicLinks) { - // get the realpath - var realPath_1 = fs.realpathSync(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(function (x) { return x == realPath_1; })) { - exports.debug(' cycle detected'); - return "continue"; - } - // update the traversal chain - traversalChain.push(realPath_1); - } - // push the child items in reverse onto the stack - var childLevel_1 = item.level + 1; - var childItems = fs.readdirSync(item.path) - .map(function (childName) { return new _FindItem(path.join(item.path, childName), childLevel_1); }); - for (var i = childItems.length - 1; i >= 0; i--) { - stack.push(childItems[i]); - } - } - else { - exports.debug(" " + item.path + " (file)"); - } - }; - while (stack.length) { - _loop_1(); - } - exports.debug(result.length + " results"); - return result; - } - catch (err) { - throw new Error(exports.loc('LIB_OperationFailed', 'find', err.message)); - } -} -exports.find = find; -var _FindItem = /** @class */ (function () { - function _FindItem(path, level) { - this.path = path; - this.level = level; - } - return _FindItem; -}()); -function _debugFindOptions(options) { - exports.debug("findOptions.allowBrokenSymbolicLinks: '" + options.allowBrokenSymbolicLinks + "'"); - exports.debug("findOptions.followSpecifiedSymbolicLink: '" + options.followSpecifiedSymbolicLink + "'"); - exports.debug("findOptions.followSymbolicLinks: '" + options.followSymbolicLinks + "'"); -} -function _getDefaultFindOptions() { - return { - allowBrokenSymbolicLinks: false, - followSpecifiedSymbolicLink: true, - followSymbolicLinks: true - }; -} -/** - * Prefer tl.find() and tl.match() instead. This function is for backward compatibility - * when porting tasks to Node from the PowerShell or PowerShell3 execution handler. - * - * @param rootDirectory path to root unrooted patterns with - * @param pattern include and exclude patterns - * @param includeFiles whether to include files in the result. defaults to true when includeFiles and includeDirectories are both false - * @param includeDirectories whether to include directories in the result - * @returns string[] - */ -function legacyFindFiles(rootDirectory, pattern, includeFiles, includeDirectories) { - if (!pattern) { - throw new Error('pattern parameter cannot be empty'); - } - exports.debug("legacyFindFiles rootDirectory: '" + rootDirectory + "'"); - exports.debug("pattern: '" + pattern + "'"); - exports.debug("includeFiles: '" + includeFiles + "'"); - exports.debug("includeDirectories: '" + includeDirectories + "'"); - if (!includeFiles && !includeDirectories) { - includeFiles = true; - } - // organize the patterns into include patterns and exclude patterns - var includePatterns = []; - var excludePatterns = []; - pattern = pattern.replace(/;;/g, '\0'); - for (var _i = 0, _a = pattern.split(';'); _i < _a.length; _i++) { - var pat = _a[_i]; - if (!pat) { - continue; - } - pat = pat.replace(/\0/g, ';'); - // determine whether include pattern and remove any include/exclude prefix. - // include patterns start with +: or anything other than -: - // exclude patterns start with -: - var isIncludePattern = void 0; - if (im._startsWith(pat, '+:')) { - pat = pat.substring(2); - isIncludePattern = true; - } - else if (im._startsWith(pat, '-:')) { - pat = pat.substring(2); - isIncludePattern = false; - } - else { - isIncludePattern = true; - } - // validate pattern does not end with a slash - if (im._endsWith(pat, '/') || (process.platform == 'win32' && im._endsWith(pat, '\\'))) { - throw new Error(exports.loc('LIB_InvalidPattern', pat)); - } - // root the pattern - if (rootDirectory && !path.isAbsolute(pat)) { - pat = path.join(rootDirectory, pat); - // remove trailing slash sometimes added by path.join() on Windows, e.g. - // path.join('\\\\hello', 'world') => '\\\\hello\\world\\' - // path.join('//hello', 'world') => '\\\\hello\\world\\' - if (im._endsWith(pat, '\\')) { - pat = pat.substring(0, pat.length - 1); - } - } - if (isIncludePattern) { - includePatterns.push(pat); - } - else { - excludePatterns.push(im._legacyFindFiles_convertPatternToRegExp(pat)); - } - } - // find and apply patterns - var count = 0; - var result = _legacyFindFiles_getMatchingItems(includePatterns, excludePatterns, !!includeFiles, !!includeDirectories); - exports.debug('all matches:'); - for (var _b = 0, result_1 = result; _b < result_1.length; _b++) { - var resultItem = result_1[_b]; - exports.debug(' ' + resultItem); - } - exports.debug('total matched: ' + result.length); - return result; -} -exports.legacyFindFiles = legacyFindFiles; -function _legacyFindFiles_getMatchingItems(includePatterns, excludePatterns, includeFiles, includeDirectories) { - exports.debug('getMatchingItems()'); - for (var _i = 0, includePatterns_1 = includePatterns; _i < includePatterns_1.length; _i++) { - var pattern = includePatterns_1[_i]; - exports.debug("includePattern: '" + pattern + "'"); - } - for (var _a = 0, excludePatterns_1 = excludePatterns; _a < excludePatterns_1.length; _a++) { - var pattern = excludePatterns_1[_a]; - exports.debug("excludePattern: " + pattern); - } - exports.debug('includeFiles: ' + includeFiles); - exports.debug('includeDirectories: ' + includeDirectories); - var allFiles = {}; - var _loop_2 = function (pattern) { - // determine the directory to search - // - // note, getDirectoryName removes redundant path separators - var findPath = void 0; - var starIndex = pattern.indexOf('*'); - var questionIndex = pattern.indexOf('?'); - if (starIndex < 0 && questionIndex < 0) { - // if no wildcards are found, use the directory name portion of the path. - // if there is no directory name (file name only in pattern or drive root), - // this will return empty string. - findPath = im._getDirectoryName(pattern); - } - else { - // extract the directory prior to the first wildcard - var index = Math.min(starIndex >= 0 ? starIndex : questionIndex, questionIndex >= 0 ? questionIndex : starIndex); - findPath = im._getDirectoryName(pattern.substring(0, index)); - } - // note, due to this short-circuit and the above usage of getDirectoryName, this - // function has the same limitations regarding drive roots as the powershell - // implementation. - // - // also note, since getDirectoryName eliminates slash redundancies, some additional - // work may be required if removal of this limitation is attempted. - if (!findPath) { - return "continue"; - } - var patternRegex = im._legacyFindFiles_convertPatternToRegExp(pattern); - // find files/directories - var items = find(findPath, { followSymbolicLinks: true }) - .filter(function (item) { - if (includeFiles && includeDirectories) { - return true; - } - var isDir = fs.statSync(item).isDirectory(); - return (includeFiles && !isDir) || (includeDirectories && isDir); - }) - .forEach(function (item) { - var normalizedPath = process.platform == 'win32' ? item.replace(/\\/g, '/') : item; // normalize separators - // **/times/** will not match C:/fun/times because there isn't a trailing slash - // so try both if including directories - var alternatePath = normalizedPath + "/"; // potential bug: it looks like this will result in a false - // positive if the item is a regular file and not a directory - var isMatch = false; - if (patternRegex.test(normalizedPath) || (includeDirectories && patternRegex.test(alternatePath))) { - isMatch = true; - // test whether the path should be excluded - for (var _i = 0, excludePatterns_2 = excludePatterns; _i < excludePatterns_2.length; _i++) { - var regex = excludePatterns_2[_i]; - if (regex.test(normalizedPath) || (includeDirectories && regex.test(alternatePath))) { - isMatch = false; - break; - } - } - } - if (isMatch) { - allFiles[item] = item; - } - }); - }; - for (var _b = 0, includePatterns_2 = includePatterns; _b < includePatterns_2.length; _b++) { - var pattern = includePatterns_2[_b]; - _loop_2(pattern); - } - return Object.keys(allFiles).sort(); -} -/** - * Remove a path recursively with force - * Returns whether it succeeds - * - * @param path path to remove - * @returns void - */ -function rmRF(inputPath) { - exports.debug('rm -rf ' + inputPath); - if (getPlatform() == Platform.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 (fs.statSync(inputPath).isDirectory()) { - exports.debug('removing directory ' + inputPath); - childProcess.execSync("rd /s /q \"" + inputPath + "\""); - } - else { - exports.debug('removing file ' + inputPath); - childProcess.execSync("del /f /a \"" + 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 new Error(exports.loc('LIB_OperationFailed', 'rmRF', err.message)); - } - } - // Shelling out fails to remove a symlink folder with missing source, this unlink catches that - try { - fs.unlinkSync(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 new Error(exports.loc('LIB_OperationFailed', 'rmRF', err.message)); - } - } - } - else { - // get the lstats in order to workaround a bug in shelljs@0.3.0 where symlinks - // with missing targets are not handled correctly by "rm('-rf', path)" - var lstats = void 0; - try { - lstats = fs.lstatSync(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') { - return; - } - throw new Error(exports.loc('LIB_OperationFailed', 'rmRF', err.message)); - } - if (lstats.isDirectory()) { - exports.debug('removing directory'); - shell.rm('-rf', inputPath); - var errMsg = shell.error(); - if (errMsg) { - throw new Error(exports.loc('LIB_OperationFailed', 'rmRF', errMsg)); - } - return; - } - exports.debug('removing file'); - try { - fs.unlinkSync(inputPath); - } - catch (err) { - throw new Error(exports.loc('LIB_OperationFailed', 'rmRF', err.message)); - } - } -} -exports.rmRF = rmRF; -/** - * Exec a tool. Convenience wrapper over ToolRunner to exec with args in one call. - * Output will be streamed to the live console. - * Returns promise with return code - * - * @param tool path to tool to exec - * @param args an arg string or array of args - * @param options optional exec options. See IExecOptions - * @returns number - */ -function exec(tool, args, options) { - var tr = this.tool(tool); - tr.on('debug', function (data) { - exports.debug(data); - }); - if (args) { - if (args instanceof Array) { - tr.arg(args); - } - else if (typeof (args) === 'string') { - tr.line(args); - } - } - return tr.exec(options); -} -exports.exec = exec; -/** - * Exec a tool synchronously. Convenience wrapper over ToolRunner to execSync with args in one call. - * Output will be *not* be streamed to the live console. It will be returned after execution is complete. - * Appropriate for short running tools - * Returns IExecResult with output and return code - * - * @param tool path to tool to exec - * @param args an arg string or array of args - * @param options optional exec options. See IExecSyncOptions - * @returns IExecSyncResult - */ -function execSync(tool, args, options) { - var tr = this.tool(tool); - tr.on('debug', function (data) { - exports.debug(data); - }); - if (args) { - if (args instanceof Array) { - tr.arg(args); - } - else if (typeof (args) === 'string') { - tr.line(args); - } - } - return tr.execSync(options); -} -exports.execSync = execSync; -/** - * Convenience factory to create a ToolRunner. - * - * @param tool path to tool to exec - * @returns ToolRunner - */ -function tool(tool) { - var tr = new trm.ToolRunner(tool); - tr.on('debug', function (message) { - exports.debug(message); - }); - return tr; -} -exports.tool = tool; -/** - * Applies glob patterns to a list of paths. Supports interleaved exclude patterns. - * - * @param list array of paths - * @param patterns patterns to apply. supports interleaved exclude patterns. - * @param patternRoot optional. default root to apply to unrooted patterns. not applied to basename-only patterns when matchBase:true. - * @param options optional. defaults to { dot: true, nobrace: true, nocase: process.platform == 'win32' }. - */ -function match(list, patterns, patternRoot, options) { - // trace parameters - exports.debug("patternRoot: '" + patternRoot + "'"); - options = options || _getDefaultMatchOptions(); // default match options - _debugMatchOptions(options); - // convert pattern to an array - if (typeof patterns == 'string') { - patterns = [patterns]; - } - // hashtable to keep track of matches - var map = {}; - var originalOptions = options; - for (var _i = 0, patterns_1 = patterns; _i < patterns_1.length; _i++) { - var pattern = patterns_1[_i]; - exports.debug("pattern: '" + pattern + "'"); - // trim and skip empty - pattern = (pattern || '').trim(); - if (!pattern) { - exports.debug('skipping empty pattern'); - continue; - } - // clone match options - var options_1 = im._cloneMatchOptions(originalOptions); - // skip comments - if (!options_1.nocomment && im._startsWith(pattern, '#')) { - exports.debug('skipping comment'); - continue; - } - // set nocomment - brace expansion could result in a leading '#' - options_1.nocomment = true; - // determine whether pattern is include or exclude - var negateCount = 0; - if (!options_1.nonegate) { - while (pattern.charAt(negateCount) == '!') { - negateCount++; - } - pattern = pattern.substring(negateCount); // trim leading '!' - if (negateCount) { - exports.debug("trimmed leading '!'. pattern: '" + pattern + "'"); - } - } - var isIncludePattern = negateCount == 0 || - (negateCount % 2 == 0 && !options_1.flipNegate) || - (negateCount % 2 == 1 && options_1.flipNegate); - // set nonegate - brace expansion could result in a leading '!' - options_1.nonegate = true; - options_1.flipNegate = false; - // expand braces - required to accurately root patterns - var expanded = void 0; - var preExpanded = pattern; - if (options_1.nobrace) { - expanded = [pattern]; - } - else { - // convert slashes on Windows before calling braceExpand(). unfortunately this means braces cannot - // be escaped on Windows, this limitation is consistent with current limitations of minimatch (3.0.3). - exports.debug('expanding braces'); - var convertedPattern = process.platform == 'win32' ? pattern.replace(/\\/g, '/') : pattern; - expanded = minimatch.braceExpand(convertedPattern); - } - // set nobrace - options_1.nobrace = true; - for (var _a = 0, expanded_1 = expanded; _a < expanded_1.length; _a++) { - var pattern_1 = expanded_1[_a]; - if (expanded.length != 1 || pattern_1 != preExpanded) { - exports.debug("pattern: '" + pattern_1 + "'"); - } - // trim and skip empty - pattern_1 = (pattern_1 || '').trim(); - if (!pattern_1) { - exports.debug('skipping empty pattern'); - continue; - } - // root the pattern when all of the following conditions are true: - if (patternRoot && // patternRoot supplied - !im._isRooted(pattern_1) && // AND pattern not rooted - // AND matchBase:false or not basename only - (!options_1.matchBase || (process.platform == 'win32' ? pattern_1.replace(/\\/g, '/') : pattern_1).indexOf('/') >= 0)) { - pattern_1 = im._ensureRooted(patternRoot, pattern_1); - exports.debug("rooted pattern: '" + pattern_1 + "'"); - } - if (isIncludePattern) { - // apply the pattern - exports.debug('applying include pattern against original list'); - var matchResults = minimatch.match(list, pattern_1, options_1); - exports.debug(matchResults.length + ' matches'); - // union the results - for (var _b = 0, matchResults_1 = matchResults; _b < matchResults_1.length; _b++) { - var matchResult = matchResults_1[_b]; - map[matchResult] = true; - } - } - else { - // apply the pattern - exports.debug('applying exclude pattern against original list'); - var matchResults = minimatch.match(list, pattern_1, options_1); - exports.debug(matchResults.length + ' matches'); - // substract the results - for (var _c = 0, matchResults_2 = matchResults; _c < matchResults_2.length; _c++) { - var matchResult = matchResults_2[_c]; - delete map[matchResult]; - } - } - } - } - // return a filtered version of the original list (preserves order and prevents duplication) - var result = list.filter(function (item) { return map.hasOwnProperty(item); }); - exports.debug(result.length + ' final results'); - return result; -} -exports.match = match; -/** - * Filter to apply glob patterns - * - * @param pattern pattern to apply - * @param options optional. defaults to { dot: true, nobrace: true, nocase: process.platform == 'win32' }. - */ -function filter(pattern, options) { - options = options || _getDefaultMatchOptions(); - return minimatch.filter(pattern, options); -} -exports.filter = filter; -function _debugMatchOptions(options) { - exports.debug("matchOptions.debug: '" + options.debug + "'"); - exports.debug("matchOptions.nobrace: '" + options.nobrace + "'"); - exports.debug("matchOptions.noglobstar: '" + options.noglobstar + "'"); - exports.debug("matchOptions.dot: '" + options.dot + "'"); - exports.debug("matchOptions.noext: '" + options.noext + "'"); - exports.debug("matchOptions.nocase: '" + options.nocase + "'"); - exports.debug("matchOptions.nonull: '" + options.nonull + "'"); - exports.debug("matchOptions.matchBase: '" + options.matchBase + "'"); - exports.debug("matchOptions.nocomment: '" + options.nocomment + "'"); - exports.debug("matchOptions.nonegate: '" + options.nonegate + "'"); - exports.debug("matchOptions.flipNegate: '" + options.flipNegate + "'"); -} -function _getDefaultMatchOptions() { - return { - debug: false, - nobrace: true, - noglobstar: false, - dot: true, - noext: false, - nocase: process.platform == 'win32', - nonull: false, - matchBase: false, - nocomment: false, - nonegate: false, - flipNegate: false - }; -} -/** - * Determines the find root from a list of patterns. Performs the find and then applies the glob patterns. - * Supports interleaved exclude patterns. Unrooted patterns are rooted using defaultRoot, unless - * matchOptions.matchBase is specified and the pattern is a basename only. For matchBase cases, the - * defaultRoot is used as the find root. - * - * @param defaultRoot default path to root unrooted patterns. falls back to System.DefaultWorkingDirectory or process.cwd(). - * @param patterns pattern or array of patterns to apply - * @param findOptions defaults to { followSymbolicLinks: true }. following soft links is generally appropriate unless deleting files. - * @param matchOptions defaults to { dot: true, nobrace: true, nocase: process.platform == 'win32' } - */ -function findMatch(defaultRoot, patterns, findOptions, matchOptions) { - // apply defaults for parameters and trace - defaultRoot = defaultRoot || this.getVariable('system.defaultWorkingDirectory') || process.cwd(); - exports.debug("defaultRoot: '" + defaultRoot + "'"); - patterns = patterns || []; - patterns = typeof patterns == 'string' ? [patterns] : patterns; - findOptions = findOptions || _getDefaultFindOptions(); - _debugFindOptions(findOptions); - matchOptions = matchOptions || _getDefaultMatchOptions(); - _debugMatchOptions(matchOptions); - // normalize slashes for root dir - defaultRoot = im._normalizeSeparators(defaultRoot); - var results = {}; - var originalMatchOptions = matchOptions; - for (var _i = 0, _a = (patterns || []); _i < _a.length; _i++) { - var pattern = _a[_i]; - exports.debug("pattern: '" + pattern + "'"); - // trim and skip empty - pattern = (pattern || '').trim(); - if (!pattern) { - exports.debug('skipping empty pattern'); - continue; - } - // clone match options - var matchOptions_1 = im._cloneMatchOptions(originalMatchOptions); - // skip comments - if (!matchOptions_1.nocomment && im._startsWith(pattern, '#')) { - exports.debug('skipping comment'); - continue; - } - // set nocomment - brace expansion could result in a leading '#' - matchOptions_1.nocomment = true; - // determine whether pattern is include or exclude - var negateCount = 0; - if (!matchOptions_1.nonegate) { - while (pattern.charAt(negateCount) == '!') { - negateCount++; - } - pattern = pattern.substring(negateCount); // trim leading '!' - if (negateCount) { - exports.debug("trimmed leading '!'. pattern: '" + pattern + "'"); - } - } - var isIncludePattern = negateCount == 0 || - (negateCount % 2 == 0 && !matchOptions_1.flipNegate) || - (negateCount % 2 == 1 && matchOptions_1.flipNegate); - // set nonegate - brace expansion could result in a leading '!' - matchOptions_1.nonegate = true; - matchOptions_1.flipNegate = false; - // expand braces - required to accurately interpret findPath - var expanded = void 0; - var preExpanded = pattern; - if (matchOptions_1.nobrace) { - expanded = [pattern]; - } - else { - // convert slashes on Windows before calling braceExpand(). unfortunately this means braces cannot - // be escaped on Windows, this limitation is consistent with current limitations of minimatch (3.0.3). - exports.debug('expanding braces'); - var convertedPattern = process.platform == 'win32' ? pattern.replace(/\\/g, '/') : pattern; - expanded = minimatch.braceExpand(convertedPattern); - } - // set nobrace - matchOptions_1.nobrace = true; - for (var _b = 0, expanded_2 = expanded; _b < expanded_2.length; _b++) { - var pattern_2 = expanded_2[_b]; - if (expanded.length != 1 || pattern_2 != preExpanded) { - exports.debug("pattern: '" + pattern_2 + "'"); - } - // trim and skip empty - pattern_2 = (pattern_2 || '').trim(); - if (!pattern_2) { - exports.debug('skipping empty pattern'); - continue; - } - if (isIncludePattern) { - // determine the findPath - var findInfo = im._getFindInfoFromPattern(defaultRoot, pattern_2, matchOptions_1); - var findPath = findInfo.findPath; - exports.debug("findPath: '" + findPath + "'"); - if (!findPath) { - exports.debug('skipping empty path'); - continue; - } - // perform the find - exports.debug("statOnly: '" + findInfo.statOnly + "'"); - var findResults = []; - if (findInfo.statOnly) { - // simply stat the path - all path segments were used to build the path - try { - fs.statSync(findPath); - findResults.push(findPath); - } - catch (err) { - if (err.code != 'ENOENT') { - throw err; - } - exports.debug('ENOENT'); - } - } - else { - findResults = find(findPath, findOptions); - } - exports.debug("found " + findResults.length + " paths"); - // apply the pattern - exports.debug('applying include pattern'); - if (findInfo.adjustedPattern != pattern_2) { - exports.debug("adjustedPattern: '" + findInfo.adjustedPattern + "'"); - pattern_2 = findInfo.adjustedPattern; - } - var matchResults = minimatch.match(findResults, pattern_2, matchOptions_1); - exports.debug(matchResults.length + ' matches'); - // union the results - for (var _c = 0, matchResults_3 = matchResults; _c < matchResults_3.length; _c++) { - var matchResult = matchResults_3[_c]; - var key = process.platform == 'win32' ? matchResult.toUpperCase() : matchResult; - results[key] = matchResult; - } - } - else { - // check if basename only and matchBase=true - if (matchOptions_1.matchBase && - !im._isRooted(pattern_2) && - (process.platform == 'win32' ? pattern_2.replace(/\\/g, '/') : pattern_2).indexOf('/') < 0) { - // do not root the pattern - exports.debug('matchBase and basename only'); - } - else { - // root the exclude pattern - pattern_2 = im._ensurePatternRooted(defaultRoot, pattern_2); - exports.debug("after ensurePatternRooted, pattern: '" + pattern_2 + "'"); - } - // apply the pattern - exports.debug('applying exclude pattern'); - var matchResults = minimatch.match(Object.keys(results).map(function (key) { return results[key]; }), pattern_2, matchOptions_1); - exports.debug(matchResults.length + ' matches'); - // substract the results - for (var _d = 0, matchResults_4 = matchResults; _d < matchResults_4.length; _d++) { - var matchResult = matchResults_4[_d]; - var key = process.platform == 'win32' ? matchResult.toUpperCase() : matchResult; - delete results[key]; - } - } - } - } - var finalResult = Object.keys(results) - .map(function (key) { return results[key]; }) - .sort(); - exports.debug(finalResult.length + ' final results'); - return finalResult; -} -exports.findMatch = findMatch; -/** - * Gets http proxy configuration used by Build/Release agent - * - * @return ProxyConfiguration - */ -function getHttpProxyConfiguration(requestUrl) { - var proxyUrl = exports.getVariable('Agent.ProxyUrl'); - if (proxyUrl && proxyUrl.length > 0) { - var proxyUsername = exports.getVariable('Agent.ProxyUsername'); - var proxyPassword = exports.getVariable('Agent.ProxyPassword'); - var proxyBypassHosts = JSON.parse(exports.getVariable('Agent.ProxyBypassList') || '[]'); - var bypass_1 = false; - if (requestUrl) { - proxyBypassHosts.forEach(function (bypassHost) { - if (new RegExp(bypassHost, 'i').test(requestUrl)) { - bypass_1 = true; - } - }); - } - if (bypass_1) { - return null; - } - else { - return { - proxyUrl: proxyUrl, - proxyUsername: proxyUsername, - proxyPassword: proxyPassword, - proxyBypassHosts: proxyBypassHosts - }; - } - } - else { - return null; - } -} -exports.getHttpProxyConfiguration = getHttpProxyConfiguration; -/** - * Gets http certificate configuration used by Build/Release agent - * - * @return CertConfiguration - */ -function getHttpCertConfiguration() { - var ca = exports.getVariable('Agent.CAInfo'); - var clientCert = exports.getVariable('Agent.ClientCert'); - if (ca || clientCert) { - var certConfig = {}; - certConfig.caFile = ca; - certConfig.certFile = clientCert; - if (clientCert) { - var clientCertKey = exports.getVariable('Agent.ClientCertKey'); - var clientCertArchive = exports.getVariable('Agent.ClientCertArchive'); - var clientCertPassword = exports.getVariable('Agent.ClientCertPassword'); - certConfig.keyFile = clientCertKey; - certConfig.certArchiveFile = clientCertArchive; - certConfig.passphrase = clientCertPassword; - } - return certConfig; - } - else { - return null; - } -} -exports.getHttpCertConfiguration = getHttpCertConfiguration; -//----------------------------------------------------- -// Test Publisher -//----------------------------------------------------- -var TestPublisher = /** @class */ (function () { - function TestPublisher(testRunner) { - this.testRunner = testRunner; - } - TestPublisher.prototype.publish = function (resultFiles, mergeResults, platform, config, runTitle, publishRunAttachments, testRunSystem) { - // Could have used an initializer, but wanted to avoid reordering parameters when converting to strict null checks - // (A parameter cannot both be optional and have an initializer) - testRunSystem = testRunSystem || "VSTSTask"; - var properties = {}; - properties['type'] = this.testRunner; - if (mergeResults) { - properties['mergeResults'] = mergeResults; - } - if (platform) { - properties['platform'] = platform; - } - if (config) { - properties['config'] = config; - } - if (runTitle) { - properties['runTitle'] = runTitle; - } - if (publishRunAttachments) { - properties['publishRunAttachments'] = publishRunAttachments; - } - if (resultFiles) { - properties['resultFiles'] = resultFiles; - } - properties['testRunSystem'] = testRunSystem; - exports.command('results.publish', properties, ''); - }; - return TestPublisher; -}()); -exports.TestPublisher = TestPublisher; -//----------------------------------------------------- -// Code coverage Publisher -//----------------------------------------------------- -var CodeCoveragePublisher = /** @class */ (function () { - function CodeCoveragePublisher() { - } - CodeCoveragePublisher.prototype.publish = function (codeCoverageTool, summaryFileLocation, reportDirectory, additionalCodeCoverageFiles) { - var properties = {}; - if (codeCoverageTool) { - properties['codecoveragetool'] = codeCoverageTool; - } - if (summaryFileLocation) { - properties['summaryfile'] = summaryFileLocation; - } - if (reportDirectory) { - properties['reportdirectory'] = reportDirectory; - } - if (additionalCodeCoverageFiles) { - properties['additionalcodecoveragefiles'] = additionalCodeCoverageFiles; - } - exports.command('codecoverage.publish', properties, ""); - }; - return CodeCoveragePublisher; -}()); -exports.CodeCoveragePublisher = CodeCoveragePublisher; -//----------------------------------------------------- -// Code coverage Publisher -//----------------------------------------------------- -var CodeCoverageEnabler = /** @class */ (function () { - function CodeCoverageEnabler(buildTool, ccTool) { - this.buildTool = buildTool; - this.ccTool = ccTool; - } - CodeCoverageEnabler.prototype.enableCodeCoverage = function (buildProps) { - buildProps['buildtool'] = this.buildTool; - buildProps['codecoveragetool'] = this.ccTool; - exports.command('codecoverage.enable', buildProps, ""); - }; - return CodeCoverageEnabler; -}()); -exports.CodeCoverageEnabler = CodeCoverageEnabler; -//----------------------------------------------------- -// Task Logging Commands -//----------------------------------------------------- -/** - * Upload user interested file as additional log information - * to the current timeline record. - * - * The file shall be available for download along with task logs. - * - * @param path Path to the file that should be uploaded. - * @returns void - */ -function uploadFile(path) { - exports.command("task.uploadfile", null, path); -} -exports.uploadFile = uploadFile; -/** - * Instruction for the agent to update the PATH environment variable. - * The specified directory is prepended to the PATH. - * The updated environment variable will be reflected in subsequent tasks. - * - * @param path Local directory path. - * @returns void - */ -function prependPath(path) { - assertAgent("2.115.0"); - exports.command("task.prependpath", null, path); -} -exports.prependPath = prependPath; -/** - * Upload and attach summary markdown to current timeline record. - * This summary shall be added to the build/release summary and - * not available for download with logs. - * - * @param path Local directory path. - * @returns void - */ -function uploadSummary(path) { - exports.command("task.uploadsummary", null, path); -} -exports.uploadSummary = uploadSummary; -/** - * Upload and attach attachment to current timeline record. - * These files are not available for download with logs. - * These can only be referred to by extensions using the type or name values. - * - * @param type Attachment type. - * @param name Attachment name. - * @param path Attachment path. - * @returns void - */ -function addAttachment(type, name, path) { - exports.command("task.addattachment", { "type": type, "name": name }, path); -} -exports.addAttachment = addAttachment; -/** - * Set an endpoint field with given value. - * Value updated will be retained in the endpoint for - * the subsequent tasks that execute within the same job. - * - * @param id Endpoint id. - * @param field FieldType enum of AuthParameter, DataParameter or Url. - * @param key Key. - * @param value Value for key or url. - * @returns void - */ -function setEndpoint(id, field, key, value) { - exports.command("task.setendpoint", { "id": id, "field": FieldType[field].toLowerCase(), "key": key }, value); -} -exports.setEndpoint = setEndpoint; -/** - * Set progress and current operation for current task. - * - * @param percent Percentage of completion. - * @param currentOperation Current pperation. - * @returns void - */ -function setProgress(percent, currentOperation) { - exports.command("task.setprogress", { "value": "" + percent }, currentOperation); -} -exports.setProgress = setProgress; -/** - * Indicates whether to write the logging command directly to the host or to the output pipeline. - * - * @param id Timeline record Guid. - * @param parentId Parent timeline record Guid. - * @param recordType Record type. - * @param recordName Record name. - * @param order Order of timeline record. - * @param startTime Start time. - * @param finishTime End time. - * @param progress Percentage of completion. - * @param state TaskState enum of Unknown, Initialized, InProgress or Completed. - * @param result TaskResult enum of Succeeded, SucceededWithIssues, Failed, Cancelled or Skipped. - * @param message current operation - * @returns void - */ -function logDetail(id, message, parentId, recordType, recordName, order, startTime, finishTime, progress, state, result) { - var properties = { - "id": id, - "parentid": parentId, - "type": recordType, - "name": recordName, - "order": order ? order.toString() : undefined, - "starttime": startTime, - "finishtime": finishTime, - "progress": progress ? progress.toString() : undefined, - "state": state ? TaskState[state] : undefined, - "result": result ? TaskResult[result] : undefined - }; - exports.command("task.logdetail", properties, message); -} -exports.logDetail = logDetail; -/** - * Log error or warning issue to timeline record of current task. - * - * @param type IssueType enum of Error or Warning. - * @param sourcePath Source file location. - * @param lineNumber Line number. - * @param columnNumber Column number. - * @param code Error or warning code. - * @param message Error or warning message. - * @returns void - */ -function logIssue(type, message, sourcePath, lineNumber, columnNumber, errorCode) { - var properties = { - "type": IssueType[type].toLowerCase(), - "code": errorCode, - "sourcepath": sourcePath, - "linenumber": lineNumber ? lineNumber.toString() : undefined, - "columnnumber": columnNumber ? columnNumber.toString() : undefined, - }; - exports.command("task.logissue", properties, message); -} -exports.logIssue = logIssue; -//----------------------------------------------------- -// Artifact Logging Commands -//----------------------------------------------------- -/** - * Upload user interested file as additional log information - * to the current timeline record. - * - * The file shall be available for download along with task logs. - * - * @param containerFolder Folder that the file will upload to, folder will be created if needed. - * @param path Path to the file that should be uploaded. - * @param name Artifact name. - * @returns void - */ -function uploadArtifact(containerFolder, path, name) { - exports.command("artifact.upload", { "containerfolder": containerFolder, "artifactname": name }, path); -} -exports.uploadArtifact = uploadArtifact; -/** - * Create an artifact link, artifact location is required to be - * a file container path, VC path or UNC share path. - * - * The file shall be available for download along with task logs. - * - * @param name Artifact name. - * @param path Path to the file that should be associated. - * @param artifactType ArtifactType enum of Container, FilePath, VersionControl, GitRef or TfvcLabel. - * @returns void - */ -function associateArtifact(name, path, artifactType) { - exports.command("artifact.associate", { "type": ArtifactType[artifactType].toLowerCase(), "artifactname": name }, path); -} -exports.associateArtifact = associateArtifact; -//----------------------------------------------------- -// Build Logging Commands -//----------------------------------------------------- -/** - * Upload user interested log to build’s container “logs\tool” folder. - * - * @param path Path to the file that should be uploaded. - * @returns void - */ -function uploadBuildLog(path) { - exports.command("build.uploadlog", null, path); -} -exports.uploadBuildLog = uploadBuildLog; -/** - * Update build number for current build. - * - * @param value Value to be assigned as the build number. - * @returns void - */ -function updateBuildNumber(value) { - exports.command("build.updatebuildnumber", null, value); -} -exports.updateBuildNumber = updateBuildNumber; -/** - * Add a tag for current build. - * - * @param value Tag value. - * @returns void - */ -function addBuildTag(value) { - exports.command("build.addbuildtag", null, value); -} -exports.addBuildTag = addBuildTag; -//----------------------------------------------------- -// Release Logging Commands -//----------------------------------------------------- -/** - * Update release name for current release. - * - * @param value Value to be assigned as the release name. - * @returns void - */ -function updateReleaseName(name) { - assertAgent("2.132"); - exports.command("release.updatereleasename", null, name); -} -exports.updateReleaseName = updateReleaseName; -//----------------------------------------------------- -// Tools -//----------------------------------------------------- -exports.TaskCommand = tcm.TaskCommand; -exports.commandFromString = tcm.commandFromString; -exports.ToolRunner = trm.ToolRunner; -//----------------------------------------------------- -// Validation Checks -//----------------------------------------------------- -// async await needs generators in node 4.x+ -if (semver.lt(process.versions.node, '4.2.0')) { - this.warning('Tasks require a new agent. Upgrade your agent or node to 4.2.0 or later'); -} -//------------------------------------------------------------------- -// Populate the vault with sensitive data. Inputs and Endpoints -//------------------------------------------------------------------- -// avoid loading twice (overwrites .taskkey) -if (!global['_vsts_task_lib_loaded']) { - im._loadData(); - im._exposeProxySettings(); - im._exposeCertSettings(); -} - - -/***/ }), - -/***/ "./node_modules/azure-pipelines-task-lib/taskcommand.js": +/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i,o,s,a,c,u=n(/*! shelljs */"./node_modules/shelljs/shell.js"),l=n(/*! child_process */"child_process"),d=n(/*! fs */"fs"),p=n(/*! path */"path"),f=n(/*! os */"os"),h=n(/*! minimatch */"./node_modules/minimatch/minimatch.js"),g=n(/*! ./internal */"./node_modules/azure-pipelines-task-lib/internal.js"),y=n(/*! ./taskcommand */"./node_modules/azure-pipelines-task-lib/taskcommand.js"),m=n(/*! ./toolrunner */"./node_modules/azure-pipelines-task-lib/toolrunner.js"),v=n(/*! semver */"./node_modules/semver/semver.js");function _(e,n,i){t.debug("task result: "+r[e]),e==r.Failed&&n?t.error(n):e==r.SucceededWithIssues&&n&&t.warning(n);var o={result:r[e]};i&&(o.done="true"),t.command("task.complete",o,n)}function b(e){if(v.lt(e,"2.104.1"))throw new Error("assertAgent() requires the parameter to be 2.104.1 or higher");var n=t.getVariable("Agent.Version");if(n&&v.lt(n,e))throw new Error("Agent version "+e+" or higher is required")}function w(e,n){var r=g._vault.retrieveSecret("INPUT_"+g._getVariableKey(e));if(r&&(r=r.trim()),n&&!r)throw new Error(t.loc("LIB_InputRequired",e));return t.debug(e+"="+r),r}function S(e,n){var r=u.error();if(r){t.debug(e+" failed");var i=t.loc("LIB_OperationFailed",e,r);if(t.debug(i),!n)throw new Error(i)}}function E(){switch(process.platform){case"win32":return c.Windows;case"darwin":return c.MacOS;case"linux":return c.Linux;default:throw Error(t.loc("LIB_PlatformNotSupported",process.platform))}}function j(e,n){if(!e)return t.debug("no path specified"),[];e=p.normalize(e),t.debug("findPath: '"+e+"'"),T(n=n||{allowBrokenSymbolicLinks:!1,followSpecifiedSymbolicLink:!0,followSymbolicLinks:!0});try{d.lstatSync(e)}catch(e){if("ENOENT"==e.code)return t.debug("0 results"),[];throw e}try{for(var r=[],i=[new x(e,1)],o=[],s=function(){var e=i.pop();r.push(e.path);var s=void 0;if(n.followSymbolicLinks)try{s=d.statSync(e.path)}catch(r){if("ENOENT"!=r.code||!n.allowBrokenSymbolicLinks)throw r;s=d.lstatSync(e.path),t.debug(" "+e.path+" (broken symlink)")}else if(n.followSpecifiedSymbolicLink&&1==r.length)try{s=d.statSync(e.path)}catch(r){if("ENOENT"!=r.code||!n.allowBrokenSymbolicLinks)throw r;s=d.lstatSync(e.path),t.debug(" "+e.path+" (broken symlink)")}else s=d.lstatSync(e.path);if(s.isDirectory()){if(t.debug(" "+e.path+" (directory)"),n.followSymbolicLinks){for(var a=d.realpathSync(e.path);o.length>=e.level;)o.pop();if(o.some((function(e){return e==a})))return t.debug(" cycle detected"),"continue";o.push(a)}for(var c=e.level+1,u=d.readdirSync(e.path).map((function(t){return new x(p.join(e.path,t),c)})),l=u.length-1;l>=0;l--)i.push(u[l])}else t.debug(" "+e.path+" (file)")};i.length;)s();return t.debug(r.length+" results"),r}catch(e){throw new Error(t.loc("LIB_OperationFailed","find",e.message))}}!function(e){e[e.Succeeded=0]="Succeeded",e[e.SucceededWithIssues=1]="SucceededWithIssues",e[e.Failed=2]="Failed",e[e.Cancelled=3]="Cancelled",e[e.Skipped=4]="Skipped"}(r=t.TaskResult||(t.TaskResult={})),function(e){e[e.Unknown=0]="Unknown",e[e.Initialized=1]="Initialized",e[e.InProgress=2]="InProgress",e[e.Completed=3]="Completed"}(i=t.TaskState||(t.TaskState={})),function(e){e[e.Error=0]="Error",e[e.Warning=1]="Warning"}(o=t.IssueType||(t.IssueType={})),function(e){e[e.Container=0]="Container",e[e.FilePath=1]="FilePath",e[e.VersionControl=2]="VersionControl",e[e.GitRef=3]="GitRef",e[e.TfvcLabel=4]="TfvcLabel"}(s=t.ArtifactType||(t.ArtifactType={})),function(e){e[e.AuthParameter=0]="AuthParameter",e[e.DataParameter=1]="DataParameter",e[e.Url=2]="Url"}(a=t.FieldType||(t.FieldType={})),function(e){e[e.Windows=0]="Windows",e[e.MacOS=1]="MacOS",e[e.Linux=2]="Linux"}(c=t.Platform||(t.Platform={})),t.setStdStream=g._setStdStream,t.setErrStream=g._setErrStream,t.setResult=_,process.on("uncaughtException",(function(e){_(r.Failed,t.loc("LIB_UnhandledEx",e.message))})),t.setResourcePath=g._setResourcePath,t.loc=g._loc,t.getVariable=g._getVariable,t.assertAgent=b,t.getVariables=function(){return Object.keys(g._knownVariableMap).map((function(e){var n=g._knownVariableMap[e];return{name:n.name,value:t.getVariable(n.name),secret:n.secret}}))},t.setVariable=function(e,n,r){void 0===r&&(r=!1);var i=g._getVariableKey(e);g._knownVariableMap.hasOwnProperty(i)&&(r=r||g._knownVariableMap[i].secret);var o=n||"";if(t.debug("set "+e+"="+(r&&o?"********":o)),r){if(o&&o.match(/\r|\n/)&&"TRUE"!=(""+process.env.SYSTEM_UNSAFEALLOWMULTILINESECRET).toUpperCase())throw new Error(t.loc("LIB_MultilineSecret"));g._vault.storeSecret("SECRET_"+i,o),delete process.env[i]}else process.env[i]=o;g._knownVariableMap[i]={name:e,secret:r},t.command("task.setvariable",{variable:e||"",issecret:(r||!1).toString()},o)},t.setSecret=function(e){if(e){if(e.match(/\r|\n/)&&"TRUE"!==(""+process.env.SYSTEM_UNSAFEALLOWMULTILINESECRET).toUpperCase())throw new Error(t.loc("LIB_MultilineSecret"));t.command("task.setsecret",{},e)}},t.getInput=w,t.getBoolInput=function(e,t){return"TRUE"==(w(e,t)||"").toUpperCase()},t.getDelimitedInput=function(e,t,n){var r=w(e,n);if(!r)return[];var i=[];return r.split(t).forEach((function(e){e&&i.push(e)})),i},t.filePathSupplied=function(e){var n=this.resolve(this.getPathInput(e)||"")!==this.resolve(t.getVariable("build.sourcesDirectory")||t.getVariable("system.defaultWorkingDirectory")||"");return t.debug(e+"path supplied :"+n),n},t.getPathInput=function(e,n,r){var i=w(e,n);return i&&r&&t.checkPath(i,e),i},t.getEndpointUrl=function(e,n){var r=process.env["ENDPOINT_URL_"+e];if(!n&&!r)throw new Error(t.loc("LIB_EndpointNotExist",e));return t.debug(e+"="+r),r},t.getEndpointDataParameter=function(e,n,r){var i=process.env["ENDPOINT_DATA_"+e+"_"+n.toUpperCase()];if(!r&&!i)throw new Error(t.loc("LIB_EndpointDataNotExist",e,n));return t.debug(e+" data "+n+" = "+i),i},t.getEndpointAuthorizationScheme=function(e,n){var r=g._vault.retrieveSecret("ENDPOINT_AUTH_SCHEME_"+e);if(!n&&!r)throw new Error(t.loc("LIB_EndpointAuthNotExist",e));return t.debug(e+" auth scheme = "+r),r},t.getEndpointAuthorizationParameter=function(e,n,r){var i=g._vault.retrieveSecret("ENDPOINT_AUTH_PARAMETER_"+e+"_"+n.toUpperCase());if(!r&&!i)throw new Error(t.loc("LIB_EndpointAuthNotExist",e));return t.debug(e+" auth param "+n+" = "+i),i},t.getEndpointAuthorization=function(e,n){var i,o=g._vault.retrieveSecret("ENDPOINT_AUTH_"+e);n||o||_(r.Failed,t.loc("LIB_EndpointAuthNotExist",e)),t.debug(e+" exists "+(null!==o));try{o&&(i=JSON.parse(o))}catch(e){throw new Error(t.loc("LIB_InvalidEndpointAuth",o))}return i},t.getSecureFileName=function(e){var n=process.env["SECUREFILE_NAME_"+e];return t.debug("secure file name for id "+e+" = "+n),n},t.getSecureFileTicket=function(e){var n=g._vault.retrieveSecret("SECUREFILE_TICKET_"+e);return t.debug("secure file ticket for id "+e+" = "+n),n},t.getTaskVariable=function(e){b("2.115.0");var n=g._vault.retrieveSecret("VSTS_TASKVARIABLE_"+g._getVariableKey(e));return n&&(n=n.trim()),t.debug("task variable: "+e+"="+n),n},t.setTaskVariable=function(e,n,r){void 0===r&&(r=!1),b("2.115.0");var i=g._getVariableKey(e),o=n||"";t.debug("set task variable: "+e+"="+(r&&o?"********":o)),g._vault.storeSecret("VSTS_TASKVARIABLE_"+i,o),delete process.env[i],t.command("task.settaskvariable",{variable:e||"",issecret:(r||!1).toString()},o)},t.command=g._command,t.warning=g._warning,t.error=g._error,t.debug=g._debug,t.stats=function(e){return d.statSync(e)},t.exist=g._exist,t.writeFile=function(e,t,n){"string"==typeof n?d.writeFileSync(e,t,{encoding:n}):d.writeFileSync(e,t,n)},t.osType=function(){return f.type()},t.getPlatform=E,t.cwd=function(){return process.cwd()},t.checkPath=g._checkPath,t.cd=function(e){e&&(u.cd(e),S("cd"))},t.pushd=function(e){u.pushd(e),S("pushd")},t.popd=function(){u.popd(),S("popd")},t.mkdirP=function(e){if(!e)throw new Error(t.loc("LIB_ParameterIsRequired","p"));for(var n=[],r=e;;){if(n.length>=(process.env.TASKLIB_TEST_MKDIRP_FAILSAFE||1e3))return t.debug("loop is out of control"),void d.mkdirSync(e);t.debug("testing directory '"+r+"'");var i=void 0;try{i=d.statSync(r)}catch(i){if("ENOENT"==i.code){var o=p.dirname(r);if(r==o)throw new Error(t.loc("LIB_MkdirFailedInvalidDriveRoot",e,r));n.push(r),r=o;continue}throw"UNKNOWN"==i.code?new Error(t.loc("LIB_MkdirFailedInvalidShare",e,r)):i}if(!i.isDirectory())throw new Error(t.loc("LIB_MkdirFailedFileExists",e,r));break}for(;n.length;){var s=n.pop();t.debug("mkdir '"+s+"'");try{d.mkdirSync(s)}catch(n){throw new Error(t.loc("LIB_MkdirFailed",e,n.message))}}},t.resolve=function(){for(var e=[],n=0;n=0?o:s,s>=0?s:o);t=g._getDirectoryName(e.substring(0,a))}if(!t)return"continue";var c=g._legacyFindFiles_convertPatternToRegExp(e);j(t,{followSymbolicLinks:!0}).filter((function(e){if(r&&i)return!0;var t=d.statSync(e).isDirectory();return r&&!t||i&&t})).forEach((function(e){var t="win32"==process.platform?e.replace(/\\/g,"/"):e,r=t+"/",o=!1;if(c.test(t)||i&&c.test(r)){o=!0;for(var s=0,a=n;s=0)&&(b=g._ensureRooted(r,b),t.debug("rooted pattern: '"+b+"'")),p){t.debug("applying include pattern against original list");var w=h.match(e,b,l);t.debug(w.length+" matches");for(var S=0,E=w;S0){var r=t.getVariable("Agent.ProxyUsername"),i=t.getVariable("Agent.ProxyPassword"),o=JSON.parse(t.getVariable("Agent.ProxyBypassList")||"[]"),s=!1;return e&&o.forEach((function(t){new RegExp(t,"i").test(e)&&(s=!0)})),s?null:{proxyUrl:n,proxyUsername:r,proxyPassword:i,proxyBypassHosts:o}}return null},t.getHttpCertConfiguration=function(){var e=t.getVariable("Agent.CAInfo"),n=t.getVariable("Agent.ClientCert");if(e||n){var r={};if(r.caFile=e,r.certFile=n,n){var i=t.getVariable("Agent.ClientCertKey"),o=t.getVariable("Agent.ClientCertArchive"),s=t.getVariable("Agent.ClientCertPassword");r.keyFile=i,r.certArchiveFile=o,r.passphrase=s}return r}return null};var P=function(){function e(e){this.testRunner=e}return e.prototype.publish=function(e,n,r,i,o,s,a){a=a||"VSTSTask";var c={};c.type=this.testRunner,n&&(c.mergeResults=n),r&&(c.platform=r),i&&(c.config=i),o&&(c.runTitle=o),s&&(c.publishRunAttachments=s),e&&(c.resultFiles=e),c.testRunSystem=a,t.command("results.publish",c,"")},e}();t.TestPublisher=P;var k=function(){function e(){}return e.prototype.publish=function(e,n,r,i){var o={};e&&(o.codecoveragetool=e),n&&(o.summaryfile=n),r&&(o.reportdirectory=r),i&&(o.additionalcodecoveragefiles=i),t.command("codecoverage.publish",o,"")},e}();t.CodeCoveragePublisher=k;var C=function(){function e(e,t){this.buildTool=e,this.ccTool=t}return e.prototype.enableCodeCoverage=function(e){e.buildtool=this.buildTool,e.codecoveragetool=this.ccTool,t.command("codecoverage.enable",e,"")},e}();t.CodeCoverageEnabler=C,t.uploadFile=function(e){t.command("task.uploadfile",null,e)},t.prependPath=function(e){b("2.115.0"),t.command("task.prependpath",null,e)},t.uploadSummary=function(e){t.command("task.uploadsummary",null,e)},t.addAttachment=function(e,n,r){t.command("task.addattachment",{type:e,name:n},r)},t.setEndpoint=function(e,n,r,i){t.command("task.setendpoint",{id:e,field:a[n].toLowerCase(),key:r},i)},t.setProgress=function(e,n){t.command("task.setprogress",{value:""+e},n)},t.logDetail=function(e,n,o,s,a,c,u,l,d,p,f){var h={id:e,parentid:o,type:s,name:a,order:c?c.toString():void 0,starttime:u,finishtime:l,progress:d?d.toString():void 0,state:p?i[p]:void 0,result:f?r[f]:void 0};t.command("task.logdetail",h,n)},t.logIssue=function(e,n,r,i,s,a){var c={type:o[e].toLowerCase(),code:a,sourcepath:r,linenumber:i?i.toString():void 0,columnnumber:s?s.toString():void 0};t.command("task.logissue",c,n)},t.uploadArtifact=function(e,n,r){t.command("artifact.upload",{containerfolder:e,artifactname:r},n)},t.associateArtifact=function(e,n,r){t.command("artifact.associate",{type:s[r].toLowerCase(),artifactname:e},n)},t.uploadBuildLog=function(e){t.command("build.uploadlog",null,e)},t.updateBuildNumber=function(e){t.command("build.updatebuildnumber",null,e)},t.addBuildTag=function(e){t.command("build.addbuildtag",null,e)},t.updateReleaseName=function(e){b("2.132"),t.command("release.updatereleasename",null,e)},t.TaskCommand=y.TaskCommand,t.commandFromString=y.commandFromString,t.ToolRunner=m.ToolRunner,v.lt(process.versions.node,"4.2.0")&&this.warning("Tasks require a new agent. Upgrade your agent or node to 4.2.0 or later"),global._vsts_task_lib_loaded||(g._loadData(),g._exposeProxySettings(),g._exposeCertSettings())},"./node_modules/azure-pipelines-task-lib/taskcommand.js": /*!**************************************************************!*\ !*** ./node_modules/azure-pipelines-task-lib/taskcommand.js ***! \**************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -// -// Command Format: -// ##vso[artifact.command key=value;key=value]user message -// -// Examples: -// ##vso[task.progress value=58] -// ##vso[task.issue type=warning;]This is the user warning message -// -var CMD_PREFIX = '##vso['; -var TaskCommand = /** @class */ (function () { - function TaskCommand(command, properties, message) { - if (!command) { - command = 'missing.command'; - } - this.command = command; - this.properties = properties; - this.message = message; - } - TaskCommand.prototype.toString = function () { - var cmdStr = CMD_PREFIX + this.command; - if (this.properties && Object.keys(this.properties).length > 0) { - cmdStr += ' '; - for (var key in this.properties) { - if (this.properties.hasOwnProperty(key)) { - var val = this.properties[key]; - if (val) { - // safely append the val - avoid blowing up when attempting to - // call .replace() if message is not a string for some reason - cmdStr += key + '=' + escape('' + (val || '')) + ';'; - } - } - } - } - cmdStr += ']'; - // safely append the message - avoid blowing up when attempting to - // call .replace() if message is not a string for some reason - var message = '' + (this.message || ''); - cmdStr += escapedata(message); - return cmdStr; - }; - return TaskCommand; -}()); -exports.TaskCommand = TaskCommand; -function commandFromString(commandLine) { - var preLen = CMD_PREFIX.length; - var lbPos = commandLine.indexOf('['); - var rbPos = commandLine.indexOf(']'); - if (lbPos == -1 || rbPos == -1 || rbPos - lbPos < 3) { - throw new Error('Invalid command brackets'); - } - var cmdInfo = commandLine.substring(lbPos + 1, rbPos); - var spaceIdx = cmdInfo.indexOf(' '); - var command = cmdInfo; - var properties = {}; - if (spaceIdx > 0) { - command = cmdInfo.trim().substring(0, spaceIdx); - var propSection = cmdInfo.trim().substring(spaceIdx + 1); - var propLines = propSection.split(';'); - propLines.forEach(function (propLine) { - propLine = propLine.trim(); - if (propLine.length > 0) { - var eqIndex = propLine.indexOf('='); - if (eqIndex == -1) { - throw new Error('Invalid property: ' + propLine); - } - var key = propLine.substring(0, eqIndex); - var val = propLine.substring(eqIndex + 1); - properties[key] = unescape(val); - } - }); - } - var msg = unescapedata(commandLine.substring(rbPos + 1)); - var cmd = new TaskCommand(command, properties, msg); - return cmd; -} -exports.commandFromString = commandFromString; -function escapedata(s) { - return s.replace(/%/g, '%25') - .replace(/\r/g, '%0D') - .replace(/\n/g, '%0A'); -} -function unescapedata(s) { - return s.replace(/%0D/g, '\r') - .replace(/%0A/g, '\n') - .replace(/%25/g, '%'); -} -function escape(s) { - return s.replace(/%/g, '%25') - .replace(/\r/g, '%0D') - .replace(/\n/g, '%0A') - .replace(/]/g, '%5D') - .replace(/;/g, '%3B'); -} -function unescape(s) { - return s.replace(/%0D/g, '\r') - .replace(/%0A/g, '\n') - .replace(/%5D/g, ']') - .replace(/%3B/g, ';') - .replace(/%25/g, '%'); -} - - -/***/ }), - -/***/ "./node_modules/azure-pipelines-task-lib/toolrunner.js": +/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t,n){e||(e="missing.command"),this.command=e,this.properties=t,this.message=n}return e.prototype.toString=function(){var e="##vso["+this.command;if(this.properties&&Object.keys(this.properties).length>0)for(var t in e+=" ",this.properties)if(this.properties.hasOwnProperty(t)){var n=this.properties[t];n&&(e+=t+"="+(""+(n||"")).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/]/g,"%5D").replace(/;/g,"%3B")+";")}return e+="]",e+=function(e){return e.replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A")}(""+(this.message||""))},e}();t.TaskCommand=r,t.commandFromString=function(e){var t=e.indexOf("["),n=e.indexOf("]");if(-1==t||-1==n||n-t<3)throw new Error("Invalid command brackets");var i=e.substring(t+1,n),o=i.indexOf(" "),s=i,a={};o>0&&(s=i.trim().substring(0,o),i.trim().substring(o+1).split(";").forEach((function(e){if((e=e.trim()).length>0){var t=e.indexOf("=");if(-1==t)throw new Error("Invalid property: "+e);var n=e.substring(0,t),r=e.substring(t+1);a[n]=r.replace(/%0D/g,"\r").replace(/%0A/g,"\n").replace(/%5D/g,"]").replace(/%3B/g,";").replace(/%25/g,"%")}})));var c=e.substring(n+1).replace(/%0D/g,"\r").replace(/%0A/g,"\n").replace(/%25/g,"%");return new r(s,a,c)}},"./node_modules/azure-pipelines-task-lib/toolrunner.js": /*!*************************************************************!*\ !*** ./node_modules/azure-pipelines-task-lib/toolrunner.js ***! \*************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -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 }); -var Q = __webpack_require__(/*! q */ "./node_modules/q/q.js"); -var os = __webpack_require__(/*! os */ "os"); -var events = __webpack_require__(/*! events */ "events"); -var child = __webpack_require__(/*! child_process */ "child_process"); -var im = __webpack_require__(/*! ./internal */ "./node_modules/azure-pipelines-task-lib/internal.js"); -var fs = __webpack_require__(/*! fs */ "fs"); -var ToolRunner = /** @class */ (function (_super) { - __extends(ToolRunner, _super); - function ToolRunner(toolPath) { - var _this = _super.call(this) || this; - if (!toolPath) { - throw new Error('Parameter \'toolPath\' cannot be null or empty.'); - } - _this.toolPath = im._which(toolPath, true); - _this.args = []; - _this._debug('toolRunner toolPath: ' + toolPath); - return _this; - } - ToolRunner.prototype._debug = function (message) { - this.emit('debug', message); - }; - ToolRunner.prototype._argStringToArray = function (argString) { - var args = []; - var inQuotes = false; - var escaped = false; - var lastCharWasSpace = true; - var arg = ''; - var append = function (c) { - // we only escape double quotes. - if (escaped && c !== '"') { - arg += '\\'; - } - arg += c; - escaped = false; - }; - for (var i = 0; i < argString.length; i++) { - var c = argString.charAt(i); - if (c === ' ' && !inQuotes) { - if (!lastCharWasSpace) { - args.push(arg); - arg = ''; - } - lastCharWasSpace = true; - continue; - } - else { - lastCharWasSpace = false; - } - if (c === '"') { - if (!escaped) { - inQuotes = !inQuotes; - } - else { - append(c); - } - continue; - } - if (c === "\\" && escaped) { - append(c); - continue; - } - if (c === "\\" && inQuotes) { - escaped = true; - continue; - } - append(c); - lastCharWasSpace = false; - } - if (!lastCharWasSpace) { - args.push(arg.trim()); - } - return args; - }; - ToolRunner.prototype._getCommandString = function (options, noPrefix) { - var _this = this; - var toolPath = this._getSpawnFileName(); - var args = this._getSpawnArgs(options); - var cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool - if (process.platform == 'win32') { - // Windows + cmd file - if (this._isCmdFile()) { - cmd += toolPath; - args.forEach(function (a) { - cmd += " " + a; - }); - } - // Windows + verbatim - else if (options.windowsVerbatimArguments) { - cmd += "\"" + toolPath + "\""; - args.forEach(function (a) { - cmd += " " + a; - }); - } - // Windows (regular) - else { - cmd += this._windowsQuoteCmdArg(toolPath); - args.forEach(function (a) { - cmd += " " + _this._windowsQuoteCmdArg(a); - }); - } - } - 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; - args.forEach(function (a) { - cmd += " " + a; - }); - } - // append second tool - if (this.pipeOutputToTool) { - cmd += ' | ' + this.pipeOutputToTool._getCommandString(options, /*noPrefix:*/ true); - } - return cmd; - }; - ToolRunner.prototype._processLineBuffer = function (data, strBuffer, onLine) { - try { - var s = strBuffer + data.toString(); - var n = s.indexOf(os.EOL); - while (n > -1) { - var line = s.substring(0, n); - onLine(line); - // the rest of the string ... - s = s.substring(n + os.EOL.length); - n = s.indexOf(os.EOL); - } - strBuffer = s; - } - catch (err) { - // streaming lines to console is best effort. Don't fail a build. - this._debug('error processing line'); - } - }; - ToolRunner.prototype._getSpawnFileName = function () { - if (process.platform == 'win32') { - if (this._isCmdFile()) { - return process.env['COMSPEC'] || 'cmd.exe'; - } - } - return this.toolPath; - }; - ToolRunner.prototype._getSpawnArgs = function (options) { - if (process.platform == 'win32') { - if (this._isCmdFile()) { - var argline = "/D /S /C \"" + this._windowsQuoteCmdArg(this.toolPath); - for (var i = 0; i < this.args.length; i++) { - argline += ' '; - argline += options.windowsVerbatimArguments ? this.args[i] : this._windowsQuoteCmdArg(this.args[i]); - } - argline += '"'; - return [argline]; - } - if (options.windowsVerbatimArguments) { - // note, in Node 6.x options.argv0 can be used instead of overriding args.slice and args.unshift. - // for more details, refer to https://github.com/nodejs/node/blob/v6.x/lib/child_process.js - var args_1 = this.args.slice(0); // copy the array - // override slice to prevent Node from creating a copy of the arg array. - // we need Node to use the "unshift" override below. - args_1.slice = function () { - if (arguments.length != 1 || arguments[0] != 0) { - throw new Error('Unexpected arguments passed to args.slice when windowsVerbatimArguments flag is set.'); - } - return args_1; - }; - // override unshift - // - // when using the windowsVerbatimArguments option, Node does not quote the tool path when building - // the cmdline parameter for the win32 function CreateProcess(). an unquoted space in the tool path - // causes problems for tools when attempting to parse their own command line args. tools typically - // assume their arguments begin after arg 0. - // - // by hijacking unshift, we can quote the tool path when it pushed onto the args array. Node builds - // the cmdline parameter from the args array. - // - // note, we can't simply pass a quoted tool path to Node for multiple reasons: - // 1) Node verifies the file exists (calls win32 function GetFileAttributesW) and the check returns - // false if the path is quoted. - // 2) Node passes the tool path as the application parameter to CreateProcess, which expects the - // path to be unquoted. - // - // also note, in addition to the tool path being embedded within the cmdline parameter, Node also - // passes the tool path to CreateProcess via the application parameter (optional parameter). when - // present, Windows uses the application parameter to determine which file to run, instead of - // interpreting the file from the cmdline parameter. - args_1.unshift = function () { - if (arguments.length != 1) { - throw new Error('Unexpected arguments passed to args.unshift when windowsVerbatimArguments flag is set.'); - } - return Array.prototype.unshift.call(args_1, "\"" + arguments[0] + "\""); // quote the file name - }; - return args_1; - } - } - return this.args; - }; - ToolRunner.prototype._isCmdFile = function () { - var upperToolPath = this.toolPath.toUpperCase(); - return im._endsWith(upperToolPath, '.CMD') || im._endsWith(upperToolPath, '.BAT'); - }; - ToolRunner.prototype._windowsQuoteCmdArg = function (arg) { - // for .exe, apply the normal quoting rules that libuv applies - if (!this._isCmdFile()) { - return this._uv_quote_cmd_arg(arg); - } - // 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 '""'; - } - // determine whether the arg needs to be quoted - var cmdSpecialChars = [' ', '\t', '&', '(', ')', '[', ']', '{', '}', '^', '=', ';', '!', '\'', '+', ',', '`', '~', '|', '<', '>', '"']; - var needsQuotes = false; - var _loop_1 = function (char) { - if (cmdSpecialChars.some(function (x) { return x == char; })) { - needsQuotes = true; - return "break"; - } - }; - for (var _i = 0, arg_1 = arg; _i < arg_1.length; _i++) { - var char = arg_1[_i]; - var state_1 = _loop_1(char); - if (state_1 === "break") - break; - } - // 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 preceed 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. - var reverse = '"'; - var quote_hit = true; - for (var i = arg.length; i > 0; i--) { // walk the string in reverse - reverse += arg[i - 1]; - if (quote_hit && arg[i - 1] == '\\') { - reverse += '\\'; // double the slash - } - else if (arg[i - 1] == '"') { - quote_hit = true; - reverse += '"'; // double the quote - } - else { - quote_hit = false; - } - } - reverse += '"'; - return reverse.split('').reverse().join(''); - }; - ToolRunner.prototype._uv_quote_cmd_arg = function (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.indexOf(' ') < 0 && arg.indexOf('\t') < 0 && arg.indexOf('"') < 0) { - // No quotation needed - return arg; - } - if (arg.indexOf('"') < 0 && arg.indexOf('\\') < 0) { - // 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\\" - var reverse = '"'; - var quote_hit = true; - for (var i = arg.length; i > 0; i--) { // walk the string in reverse - reverse += arg[i - 1]; - if (quote_hit && arg[i - 1] == '\\') { - reverse += '\\'; - } - else if (arg[i - 1] == '"') { - quote_hit = true; - reverse += '\\'; - } - else { - quote_hit = false; - } - } - reverse += '"'; - return reverse.split('').reverse().join(''); - }; - ToolRunner.prototype._cloneExecOptions = function (options) { - options = options || {}; - var result = { - cwd: options.cwd || process.cwd(), - env: options.env || process.env, - silent: options.silent || false, - failOnStdErr: options.failOnStdErr || false, - ignoreReturnCode: options.ignoreReturnCode || false, - windowsVerbatimArguments: options.windowsVerbatimArguments || false - }; - result.outStream = options.outStream || process.stdout; - result.errStream = options.errStream || process.stderr; - return result; - }; - ToolRunner.prototype._getSpawnOptions = function (options) { - options = options || {}; - var result = {}; - result.cwd = options.cwd; - result.env = options.env; - result['windowsVerbatimArguments'] = options.windowsVerbatimArguments || this._isCmdFile(); - return result; - }; - ToolRunner.prototype._getSpawnSyncOptions = function (options) { - var result = {}; - result.cwd = options.cwd; - result.env = options.env; - result['windowsVerbatimArguments'] = options.windowsVerbatimArguments || this._isCmdFile(); - return result; - }; - ToolRunner.prototype.execWithPiping = function (pipeOutputToTool, options) { - var _this = this; - var defer = Q.defer(); - this._debug('exec tool: ' + this.toolPath); - this._debug('arguments:'); - this.args.forEach(function (arg) { - _this._debug(' ' + arg); - }); - var success = true; - var optionsNonNull = this._cloneExecOptions(options); - if (!optionsNonNull.silent) { - optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL); - } - var cp; - var toolPath = pipeOutputToTool.toolPath; - var toolPathFirst; - var successFirst = true; - var returnCodeFirst; - var fileStream; - var waitingEvents = 0; // number of process or stream events we are waiting on to complete - var returnCode = 0; - var error; - toolPathFirst = this.toolPath; - // Following node documentation example from this link on how to pipe output of one process to another - // https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options - //start the child process for both tools - waitingEvents++; - var cpFirst = child.spawn(this._getSpawnFileName(), this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(optionsNonNull)); - waitingEvents++; - cp = child.spawn(pipeOutputToTool._getSpawnFileName(), pipeOutputToTool._getSpawnArgs(optionsNonNull), pipeOutputToTool._getSpawnOptions(optionsNonNull)); - fileStream = this.pipeOutputToFile ? fs.createWriteStream(this.pipeOutputToFile) : null; - if (fileStream) { - waitingEvents++; - fileStream.on('finish', function () { - waitingEvents--; //file write is complete - fileStream = null; - if (waitingEvents == 0) { - if (error) { - defer.reject(error); - } - else { - defer.resolve(returnCode); - } - } - }); - fileStream.on('error', function (err) { - waitingEvents--; //there were errors writing to the file, write is done - _this._debug("Failed to pipe output of " + toolPathFirst + " to file " + _this.pipeOutputToFile + ". Error = " + err); - fileStream = null; - if (waitingEvents == 0) { - if (error) { - defer.reject(error); - } - else { - defer.resolve(returnCode); - } - } - }); - } - //pipe stdout of first tool to stdin of second tool - cpFirst.stdout.on('data', function (data) { - try { - if (fileStream) { - fileStream.write(data); - } - cp.stdin.write(data); - } - catch (err) { - _this._debug('Failed to pipe output of ' + toolPathFirst + ' to ' + toolPath); - _this._debug(toolPath + ' might have exited due to errors prematurely. Verify the arguments passed are valid.'); - } - }); - cpFirst.stderr.on('data', function (data) { - if (fileStream) { - fileStream.write(data); - } - successFirst = !optionsNonNull.failOnStdErr; - if (!optionsNonNull.silent) { - var s = optionsNonNull.failOnStdErr ? optionsNonNull.errStream : optionsNonNull.outStream; - s.write(data); - } - }); - cpFirst.on('error', function (err) { - waitingEvents--; //first process is complete with errors - if (fileStream) { - fileStream.end(); - } - cp.stdin.end(); - error = new Error(toolPathFirst + ' failed. ' + err.message); - if (waitingEvents == 0) { - defer.reject(error); - } - }); - cpFirst.on('close', function (code, signal) { - waitingEvents--; //first process is complete - if (code != 0 && !optionsNonNull.ignoreReturnCode) { - successFirst = false; - returnCodeFirst = code; - returnCode = returnCodeFirst; - } - _this._debug('success of first tool:' + successFirst); - if (fileStream) { - fileStream.end(); - } - cp.stdin.end(); - if (waitingEvents == 0) { - if (error) { - defer.reject(error); - } - else { - defer.resolve(returnCode); - } - } - }); - var stdbuffer = ''; - cp.stdout.on('data', function (data) { - _this.emit('stdout', data); - if (!optionsNonNull.silent) { - optionsNonNull.outStream.write(data); - } - _this._processLineBuffer(data, stdbuffer, function (line) { - _this.emit('stdline', line); - }); - }); - var errbuffer = ''; - cp.stderr.on('data', function (data) { - _this.emit('stderr', data); - success = !optionsNonNull.failOnStdErr; - if (!optionsNonNull.silent) { - var s = optionsNonNull.failOnStdErr ? optionsNonNull.errStream : optionsNonNull.outStream; - s.write(data); - } - _this._processLineBuffer(data, errbuffer, function (line) { - _this.emit('errline', line); - }); - }); - cp.on('error', function (err) { - waitingEvents--; //process is done with errors - error = new Error(toolPath + ' failed. ' + err.message); - if (waitingEvents == 0) { - defer.reject(error); - } - }); - cp.on('close', function (code, signal) { - waitingEvents--; //process is complete - _this._debug('rc:' + code); - returnCode = code; - if (stdbuffer.length > 0) { - _this.emit('stdline', stdbuffer); - } - if (errbuffer.length > 0) { - _this.emit('errline', errbuffer); - } - if (code != 0 && !optionsNonNull.ignoreReturnCode) { - success = false; - } - _this._debug('success:' + success); - if (!successFirst) { //in the case output is piped to another tool, check exit code of both tools - error = new Error(toolPathFirst + ' failed with return code: ' + returnCodeFirst); - } - else if (!success) { - error = new Error(toolPath + ' failed with return code: ' + code); - } - if (waitingEvents == 0) { - if (error) { - defer.reject(error); - } - else { - defer.resolve(returnCode); - } - } - }); - return defer.promise; - }; - /** - * Add argument - * Append an argument or an array of arguments - * returns ToolRunner for chaining - * - * @param val string cmdline or array of strings - * @returns ToolRunner - */ - ToolRunner.prototype.arg = function (val) { - if (!val) { - return this; - } - if (val instanceof Array) { - this._debug(this.toolPath + ' arg: ' + JSON.stringify(val)); - this.args = this.args.concat(val); - } - else if (typeof (val) === 'string') { - this._debug(this.toolPath + ' arg: ' + val); - this.args = this.args.concat(val.trim()); - } - return this; - }; - /** - * Parses an argument line into one or more arguments - * e.g. .line('"arg one" two -z') is equivalent to .arg(['arg one', 'two', '-z']) - * returns ToolRunner for chaining - * - * @param val string argument line - * @returns ToolRunner - */ - ToolRunner.prototype.line = function (val) { - if (!val) { - return this; - } - this._debug(this.toolPath + ' arg: ' + val); - this.args = this.args.concat(this._argStringToArray(val)); - return this; - }; - /** - * Add argument(s) if a condition is met - * Wraps arg(). See arg for details - * returns ToolRunner for chaining - * - * @param condition boolean condition - * @param val string cmdline or array of strings - * @returns ToolRunner - */ - ToolRunner.prototype.argIf = function (condition, val) { - if (condition) { - this.arg(val); - } - return this; - }; - /** - * Pipe output of exec() to another tool - * @param tool - * @param file optional filename to additionally stream the output to. - * @returns {ToolRunner} - */ - ToolRunner.prototype.pipeExecOutputToTool = function (tool, file) { - this.pipeOutputToTool = tool; - this.pipeOutputToFile = file; - return this; - }; - /** - * 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 IExecOptions - * @returns number - */ - ToolRunner.prototype.exec = function (options) { - var _this = this; - if (this.pipeOutputToTool) { - return this.execWithPiping(this.pipeOutputToTool, options); - } - var defer = Q.defer(); - this._debug('exec tool: ' + this.toolPath); - this._debug('arguments:'); - this.args.forEach(function (arg) { - _this._debug(' ' + arg); - }); - var optionsNonNull = this._cloneExecOptions(options); - if (!optionsNonNull.silent) { - optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL); - } - var state = new ExecState(optionsNonNull, this.toolPath); - state.on('debug', function (message) { - _this._debug(message); - }); - var cp = child.spawn(this._getSpawnFileName(), this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(options)); - // it is possible for the child process to end its last line without a new line. - // because stdout is buffered, this causes the last line to not get sent to the parent - // stream. Adding this event forces a flush before the child streams are closed. - cp.stdout.on('finish', function () { - if (!optionsNonNull.silent) { - optionsNonNull.outStream.write(os.EOL); - } - }); - var stdbuffer = ''; - cp.stdout.on('data', function (data) { - _this.emit('stdout', data); - if (!optionsNonNull.silent) { - optionsNonNull.outStream.write(data); - } - _this._processLineBuffer(data, stdbuffer, function (line) { - _this.emit('stdline', line); - }); - }); - var errbuffer = ''; - cp.stderr.on('data', function (data) { - state.processStderr = true; - _this.emit('stderr', data); - if (!optionsNonNull.silent) { - var s = optionsNonNull.failOnStdErr ? optionsNonNull.errStream : optionsNonNull.outStream; - s.write(data); - } - _this._processLineBuffer(data, errbuffer, function (line) { - _this.emit('errline', line); - }); - }); - cp.on('error', function (err) { - state.processError = err.message; - state.processExited = true; - state.processClosed = true; - state.CheckComplete(); - }); - cp.on('exit', function (code, signal) { - state.processExitCode = code; - state.processExited = true; - _this._debug("Exit code " + code + " received from tool '" + _this.toolPath + "'"); - state.CheckComplete(); - }); - cp.on('close', function (code, signal) { - state.processExitCode = code; - state.processExited = true; - state.processClosed = true; - _this._debug("STDIO streams have closed for tool '" + _this.toolPath + "'"); - state.CheckComplete(); - }); - state.on('done', function (error, exitCode) { - if (stdbuffer.length > 0) { - _this.emit('stdline', stdbuffer); - } - if (errbuffer.length > 0) { - _this.emit('errline', errbuffer); - } - cp.removeAllListeners(); - if (error) { - defer.reject(error); - } - else { - defer.resolve(exitCode); - } - }); - return defer.promise; - }; - /** - * Exec a tool synchronously. - * Output will be *not* be streamed to the live console. It will be returned after execution is complete. - * Appropriate for short running tools - * Returns IExecSyncResult with output and return code - * - * @param tool path to tool to exec - * @param options optional exec options. See IExecSyncOptions - * @returns IExecSyncResult - */ - ToolRunner.prototype.execSync = function (options) { - var _this = this; - this._debug('exec tool: ' + this.toolPath); - this._debug('arguments:'); - this.args.forEach(function (arg) { - _this._debug(' ' + arg); - }); - var success = true; - options = this._cloneExecOptions(options); - if (!options.silent) { - options.outStream.write(this._getCommandString(options) + os.EOL); - } - var r = child.spawnSync(this._getSpawnFileName(), this._getSpawnArgs(options), this._getSpawnSyncOptions(options)); - if (!options.silent && r.stdout && r.stdout.length > 0) { - options.outStream.write(r.stdout); - } - if (!options.silent && r.stderr && r.stderr.length > 0) { - options.errStream.write(r.stderr); - } - var res = { code: r.status, error: r.error }; - res.stdout = (r.stdout) ? r.stdout.toString() : ''; - res.stderr = (r.stderr) ? r.stderr.toString() : ''; - return res; - }; - return ToolRunner; -}(events.EventEmitter)); -exports.ToolRunner = ToolRunner; -var ExecState = /** @class */ (function (_super) { - __extends(ExecState, _super); - function ExecState(options, toolPath) { - var _this = _super.call(this) || this; - _this.delay = 10000; // 10 seconds - _this.timeout = null; - if (!toolPath) { - throw new Error('toolPath must not be empty'); - } - _this.options = options; - _this.toolPath = toolPath; - var delay = process.env['TASKLIB_TEST_TOOLRUNNER_EXITDELAY']; - if (delay) { - _this.delay = parseInt(delay); - } - return _this; - } - ExecState.prototype.CheckComplete = function () { - if (this.done) { - return; - } - if (this.processClosed) { - this._setResult(); - } - else if (this.processExited) { - this.timeout = setTimeout(ExecState.HandleTimeout, this.delay, this); - } - }; - ExecState.prototype._debug = function (message) { - this.emit('debug', message); - }; - ExecState.prototype._setResult = function () { - // determine whether there is an error - var error; - if (this.processExited) { - if (this.processError) { - error = new Error(im._loc('LIB_ProcessError', this.toolPath, this.processError)); - } - else if (this.processExitCode != 0 && !this.options.ignoreReturnCode) { - error = new Error(im._loc('LIB_ProcessExitCode', this.toolPath, this.processExitCode)); - } - else if (this.processStderr && this.options.failOnStdErr) { - error = new Error(im._loc('LIB_ProcessStderr', this.toolPath)); - } - } - // clear the timeout - if (this.timeout) { - clearTimeout(this.timeout); - this.timeout = null; - } - this.done = true; - this.emit('done', error, this.processExitCode); - }; - ExecState.HandleTimeout = function (state) { - if (state.done) { - return; - } - if (!state.processClosed && state.processExited) { - console.log(im._loc('LIB_StdioNotClosed', state.delay / 1000, state.toolPath)); - state._debug(im._loc('LIB_StdioNotClosed', state.delay / 1000, state.toolPath)); - } - state._setResult(); - }; - return ExecState; -}(events.EventEmitter)); - - -/***/ }), - -/***/ "./node_modules/azure-pipelines-task-lib/vault.js": +/*! no static exports found */function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var o=n(/*! q */"./node_modules/q/q.js"),s=n(/*! os */"os"),a=n(/*! events */"events"),c=n(/*! child_process */"child_process"),u=n(/*! ./internal */"./node_modules/azure-pipelines-task-lib/internal.js"),l=n(/*! fs */"fs"),d=function(e){function t(t){var n=e.call(this)||this;if(!t)throw new Error("Parameter 'toolPath' cannot be null or empty.");return n.toolPath=u._which(t,!0),n.args=[],n._debug("toolRunner toolPath: "+t),n}return i(t,e),t.prototype._debug=function(e){this.emit("debug",e)},t.prototype._argStringToArray=function(e){for(var t=[],n=!1,r=!1,i=!0,o="",s=function(e){r&&'"'!==e&&(o+="\\"),o+=e,r=!1},a=0;a-1;){n(r.substring(0,i)),i=(r=r.substring(i+s.EOL.length)).indexOf(s.EOL)}t=r}catch(e){this._debug("error processing line")}},t.prototype._getSpawnFileName=function(){return"win32"==process.platform&&this._isCmdFile()?process.env.COMSPEC||"cmd.exe":this.toolPath},t.prototype._getSpawnArgs=function(e){if("win32"==process.platform){if(this._isCmdFile()){for(var t='/D /S /C "'+this._windowsQuoteCmdArg(this.toolPath),n=0;n",'"'],n=!1,r=function(e){if(t.some((function(t){return t==e})))return n=!0,"break"},i=0,o=e;i0;c--)s+=e[c-1],a&&"\\"==e[c-1]?s+="\\":'"'==e[c-1]?(a=!0,s+='"'):a=!1;return(s+='"').split("").reverse().join("")},t.prototype._uv_quote_cmd_arg=function(e){if(!e)return'""';if(e.indexOf(" ")<0&&e.indexOf("\t")<0&&e.indexOf('"')<0)return e;if(e.indexOf('"')<0&&e.indexOf("\\")<0)return'"'+e+'"';for(var t='"',n=!0,r=e.length;r>0;r--)t+=e[r-1],n&&"\\"==e[r-1]?t+="\\":'"'==e[r-1]?(n=!0,t+="\\"):n=!1;return(t+='"').split("").reverse().join("")},t.prototype._cloneExecOptions=function(e){var t={cwd:(e=e||{}).cwd||process.cwd(),env:e.env||process.env,silent:e.silent||!1,failOnStdErr:e.failOnStdErr||!1,ignoreReturnCode:e.ignoreReturnCode||!1,windowsVerbatimArguments:e.windowsVerbatimArguments||!1};return t.outStream=e.outStream||process.stdout,t.errStream=e.errStream||process.stderr,t},t.prototype._getSpawnOptions=function(e){e=e||{};var t={};return t.cwd=e.cwd,t.env=e.env,t.windowsVerbatimArguments=e.windowsVerbatimArguments||this._isCmdFile(),t},t.prototype._getSpawnSyncOptions=function(e){var t={};return t.cwd=e.cwd,t.env=e.env,t.windowsVerbatimArguments=e.windowsVerbatimArguments||this._isCmdFile(),t},t.prototype.execWithPiping=function(e,t){var n=this,r=o.defer();this._debug("exec tool: "+this.toolPath),this._debug("arguments:"),this.args.forEach((function(e){n._debug(" "+e)}));var i,a=!0,u=this._cloneExecOptions(t);u.silent||u.outStream.write(this._getCommandString(u)+s.EOL);var d,p,f,h,g=e.toolPath,y=!0,m=0,v=0;d=this.toolPath,m++;var _=c.spawn(this._getSpawnFileName(),this._getSpawnArgs(u),this._getSpawnOptions(u));m++,i=c.spawn(e._getSpawnFileName(),e._getSpawnArgs(u),e._getSpawnOptions(u)),(f=this.pipeOutputToFile?l.createWriteStream(this.pipeOutputToFile):null)&&(m++,f.on("finish",(function(){m--,f=null,0==m&&(h?r.reject(h):r.resolve(v))})),f.on("error",(function(e){m--,n._debug("Failed to pipe output of "+d+" to file "+n.pipeOutputToFile+". Error = "+e),f=null,0==m&&(h?r.reject(h):r.resolve(v))}))),_.stdout.on("data",(function(e){try{f&&f.write(e),i.stdin.write(e)}catch(e){n._debug("Failed to pipe output of "+d+" to "+g),n._debug(g+" might have exited due to errors prematurely. Verify the arguments passed are valid.")}})),_.stderr.on("data",(function(e){(f&&f.write(e),y=!u.failOnStdErr,u.silent)||(u.failOnStdErr?u.errStream:u.outStream).write(e)})),_.on("error",(function(e){m--,f&&f.end(),i.stdin.end(),h=new Error(d+" failed. "+e.message),0==m&&r.reject(h)})),_.on("close",(function(e,t){m--,0==e||u.ignoreReturnCode||(y=!1,v=p=e),n._debug("success of first tool:"+y),f&&f.end(),i.stdin.end(),0==m&&(h?r.reject(h):r.resolve(v))}));i.stdout.on("data",(function(e){n.emit("stdout",e),u.silent||u.outStream.write(e),n._processLineBuffer(e,"",(function(e){n.emit("stdline",e)}))}));return i.stderr.on("data",(function(e){(n.emit("stderr",e),a=!u.failOnStdErr,u.silent)||(u.failOnStdErr?u.errStream:u.outStream).write(e);n._processLineBuffer(e,"",(function(e){n.emit("errline",e)}))})),i.on("error",(function(e){m--,h=new Error(g+" failed. "+e.message),0==m&&r.reject(h)})),i.on("close",(function(e,t){m--,n._debug("rc:"+e),v=e,"".length>0&&n.emit("stdline",""),"".length>0&&n.emit("errline",""),0==e||u.ignoreReturnCode||(a=!1),n._debug("success:"+a),y?a||(h=new Error(g+" failed with return code: "+e)):h=new Error(d+" failed with return code: "+p),0==m&&(h?r.reject(h):r.resolve(v))})),r.promise},t.prototype.arg=function(e){return e?(e instanceof Array?(this._debug(this.toolPath+" arg: "+JSON.stringify(e)),this.args=this.args.concat(e)):"string"==typeof e&&(this._debug(this.toolPath+" arg: "+e),this.args=this.args.concat(e.trim())),this):this},t.prototype.line=function(e){return e?(this._debug(this.toolPath+" arg: "+e),this.args=this.args.concat(this._argStringToArray(e)),this):this},t.prototype.argIf=function(e,t){return e&&this.arg(t),this},t.prototype.pipeExecOutputToTool=function(e,t){return this.pipeOutputToTool=e,this.pipeOutputToFile=t,this},t.prototype.exec=function(e){var t=this;if(this.pipeOutputToTool)return this.execWithPiping(this.pipeOutputToTool,e);var n=o.defer();this._debug("exec tool: "+this.toolPath),this._debug("arguments:"),this.args.forEach((function(e){t._debug(" "+e)}));var r=this._cloneExecOptions(e);r.silent||r.outStream.write(this._getCommandString(r)+s.EOL);var i=new p(r,this.toolPath);i.on("debug",(function(e){t._debug(e)}));var a=c.spawn(this._getSpawnFileName(),this._getSpawnArgs(r),this._getSpawnOptions(e));a.stdout.on("finish",(function(){r.silent||r.outStream.write(s.EOL)}));a.stdout.on("data",(function(e){t.emit("stdout",e),r.silent||r.outStream.write(e),t._processLineBuffer(e,"",(function(e){t.emit("stdline",e)}))}));return a.stderr.on("data",(function(e){(i.processStderr=!0,t.emit("stderr",e),r.silent)||(r.failOnStdErr?r.errStream:r.outStream).write(e);t._processLineBuffer(e,"",(function(e){t.emit("errline",e)}))})),a.on("error",(function(e){i.processError=e.message,i.processExited=!0,i.processClosed=!0,i.CheckComplete()})),a.on("exit",(function(e,n){i.processExitCode=e,i.processExited=!0,t._debug("Exit code "+e+" received from tool '"+t.toolPath+"'"),i.CheckComplete()})),a.on("close",(function(e,n){i.processExitCode=e,i.processExited=!0,i.processClosed=!0,t._debug("STDIO streams have closed for tool '"+t.toolPath+"'"),i.CheckComplete()})),i.on("done",(function(e,r){"".length>0&&t.emit("stdline",""),"".length>0&&t.emit("errline",""),a.removeAllListeners(),e?n.reject(e):n.resolve(r)})),n.promise},t.prototype.execSync=function(e){var t=this;this._debug("exec tool: "+this.toolPath),this._debug("arguments:"),this.args.forEach((function(e){t._debug(" "+e)}));(e=this._cloneExecOptions(e)).silent||e.outStream.write(this._getCommandString(e)+s.EOL);var n=c.spawnSync(this._getSpawnFileName(),this._getSpawnArgs(e),this._getSpawnSyncOptions(e));!e.silent&&n.stdout&&n.stdout.length>0&&e.outStream.write(n.stdout),!e.silent&&n.stderr&&n.stderr.length>0&&e.errStream.write(n.stderr);var r={code:n.status,error:n.error};return r.stdout=n.stdout?n.stdout.toString():"",r.stderr=n.stderr?n.stderr.toString():"",r},t}(a.EventEmitter);t.ToolRunner=d;var p=function(e){function t(t,n){var r=e.call(this)||this;if(r.delay=1e4,r.timeout=null,!n)throw new Error("toolPath must not be empty");r.options=t,r.toolPath=n;var i=process.env.TASKLIB_TEST_TOOLRUNNER_EXITDELAY;return i&&(r.delay=parseInt(i)),r}return i(t,e),t.prototype.CheckComplete=function(){this.done||(this.processClosed?this._setResult():this.processExited&&(this.timeout=setTimeout(t.HandleTimeout,this.delay,this)))},t.prototype._debug=function(e){this.emit("debug",e)},t.prototype._setResult=function(){var e;this.processExited&&(this.processError?e=new Error(u._loc("LIB_ProcessError",this.toolPath,this.processError)):0==this.processExitCode||this.options.ignoreReturnCode?this.processStderr&&this.options.failOnStdErr&&(e=new Error(u._loc("LIB_ProcessStderr",this.toolPath))):e=new Error(u._loc("LIB_ProcessExitCode",this.toolPath,this.processExitCode))),this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.done=!0,this.emit("done",e,this.processExitCode)},t.HandleTimeout=function(e){e.done||(!e.processClosed&&e.processExited&&(console.log(u._loc("LIB_StdioNotClosed",e.delay/1e3,e.toolPath)),e._debug(u._loc("LIB_StdioNotClosed",e.delay/1e3,e.toolPath))),e._setResult())},t}(a.EventEmitter)},"./node_modules/azure-pipelines-task-lib/vault.js": /*!********************************************************!*\ !*** ./node_modules/azure-pipelines-task-lib/vault.js ***! \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -var fs = __webpack_require__(/*! fs */ "fs"); -var path = __webpack_require__(/*! path */ "path"); -var crypto = __webpack_require__(/*! crypto */ "crypto"); -var uuidV4 = __webpack_require__(/*! uuid/v4 */ "./node_modules/uuid/v4.js"); -var algorithm = "aes-256-ctr"; -var encryptEncoding = 'hex'; -var unencryptedEncoding = 'utf8'; -// -// Store sensitive data in proc. -// Main goal: Protects tasks which would dump envvars from leaking secrets inadvertently -// the task lib clears after storing. -// Also protects against a dump of a process getting the secrets -// The secret is generated and stored externally for the lifetime of the task. -// -var Vault = /** @class */ (function () { - function Vault(keyPath) { - this._keyFile = path.join(keyPath, '.taskkey'); - this._store = {}; - this.genKey(); - } - Vault.prototype.initialize = function () { - }; - Vault.prototype.storeSecret = function (name, data) { - if (!name || name.length == 0) { - return false; - } - name = name.toLowerCase(); - if (!data || data.length == 0) { - if (this._store.hasOwnProperty(name)) { - delete this._store[name]; - } - return false; - } - var key = this.getKey(); - var iv = crypto.randomBytes(16); - var cipher = crypto.createCipheriv(algorithm, key, iv); - var crypted = cipher.update(data, unencryptedEncoding, encryptEncoding); - var cryptedFinal = cipher.final(encryptEncoding); - this._store[name] = iv.toString(encryptEncoding) + crypted + cryptedFinal; - return true; - }; - Vault.prototype.retrieveSecret = function (name) { - var secret; - name = (name || '').toLowerCase(); - if (this._store.hasOwnProperty(name)) { - var key = this.getKey(); - var data = this._store[name]; - var ivDataBuffer = Buffer.from(data, encryptEncoding); - var iv = ivDataBuffer.slice(0, 16); - var encryptedText = ivDataBuffer.slice(16); - var decipher = crypto.createDecipheriv(algorithm, key, iv); - var dec = decipher.update(encryptedText, encryptEncoding, unencryptedEncoding); - var decFinal = decipher.final(unencryptedEncoding); - secret = dec + decFinal; - } - return secret; - }; - Vault.prototype.getKey = function () { - var key = fs.readFileSync(this._keyFile).toString('utf8'); - // Key needs to be hashed to correct length to match algorithm (aes-256-ctr) - return crypto.createHash('sha256').update(key).digest(); - }; - Vault.prototype.genKey = function () { - fs.writeFileSync(this._keyFile, uuidV4(), { encoding: 'utf8' }); - }; - return Vault; -}()); -exports.Vault = Vault; - - -/***/ }), - -/***/ "./node_modules/azure-pipelines-tool-lib sync recursive": +/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(/*! fs */"fs"),i=n(/*! path */"path"),o=n(/*! crypto */"crypto"),s=n(/*! uuid/v4 */"./node_modules/uuid/v4.js"),a=function(){function e(e){this._keyFile=i.join(e,".taskkey"),this._store={},this.genKey()}return e.prototype.initialize=function(){},e.prototype.storeSecret=function(e,t){if(!e||0==e.length)return!1;if(e=e.toLowerCase(),!t||0==t.length)return this._store.hasOwnProperty(e)&&delete this._store[e],!1;var n=this.getKey(),r=o.randomBytes(16),i=o.createCipheriv("aes-256-ctr",n,r),s=i.update(t,"utf8","hex"),a=i.final("hex");return this._store[e]=r.toString("hex")+s+a,!0},e.prototype.retrieveSecret=function(e){var t;if(e=(e||"").toLowerCase(),this._store.hasOwnProperty(e)){var n=this.getKey(),r=this._store[e],i=Buffer.from(r,"hex"),s=i.slice(0,16),a=i.slice(16),c=o.createDecipheriv("aes-256-ctr",n,s);t=c.update(a,"hex","utf8")+c.final("utf8")}return t},e.prototype.getKey=function(){var e=r.readFileSync(this._keyFile).toString("utf8");return o.createHash("sha256").update(e).digest()},e.prototype.genKey=function(){r.writeFileSync(this._keyFile,s(),{encoding:"utf8"})},e}();t.Vault=a},"./node_modules/azure-pipelines-tool-lib sync recursive": /*!****************************************************!*\ !*** ./node_modules/azure-pipelines-tool-lib sync ***! \****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -function webpackEmptyContext(req) { - var e = new Error("Cannot find module '" + req + "'"); - e.code = 'MODULE_NOT_FOUND'; - throw e; -} -webpackEmptyContext.keys = function() { return []; }; -webpackEmptyContext.resolve = webpackEmptyContext; -module.exports = webpackEmptyContext; -webpackEmptyContext.id = "./node_modules/azure-pipelines-tool-lib sync recursive"; - -/***/ }), - -/***/ "./node_modules/azure-pipelines-tool-lib/node_modules/typed-rest-client/HttpClient.js": +/*! no static exports found */function(e,t){function n(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}n.keys=function(){return[]},n.resolve=n,e.exports=n,n.id="./node_modules/azure-pipelines-tool-lib sync recursive"},"./node_modules/azure-pipelines-tool-lib/node_modules/typed-rest-client/HttpClient.js": /*!********************************************************************************************!*\ !*** ./node_modules/azure-pipelines-tool-lib/node_modules/typed-rest-client/HttpClient.js ***! \********************************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - 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) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const url = __webpack_require__(/*! url */ "url"); -const http = __webpack_require__(/*! http */ "http"); -const https = __webpack_require__(/*! https */ "https"); -const tunnel = __webpack_require__(/*! tunnel */ "./node_modules/tunnel/index.js"); -const fs = __webpack_require__(/*! fs */ "fs"); -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["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 = {})); -const HttpRedirectCodes = [HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, HttpCodes.SeeOther, HttpCodes.TemporaryRedirect, HttpCodes.PermanentRedirect]; -class HttpClientResponse { - constructor(message) { - this.message = message; - } - readBody() { - return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - let output = ''; - this.message.on('data', (chunk) => { - output += chunk; - }); - this.message.on('end', () => { - resolve(output); - }); - })); - } -} -exports.HttpClientResponse = HttpClientResponse; -function isHttps(requestUrl) { - let parsedUrl = url.parse(requestUrl); - return parsedUrl.protocol === 'https:'; -} -exports.isHttps = isHttps; -var EnvironmentVariables; -(function (EnvironmentVariables) { - EnvironmentVariables["HTTP_PROXY"] = "HTTP_PROXY"; - EnvironmentVariables["HTTPS_PROXY"] = "HTTPS_PROXY"; -})(EnvironmentVariables || (EnvironmentVariables = {})); -class HttpClient { - constructor(userAgent, handlers, requestOptions) { - this._ignoreSslError = false; - this._allowRedirects = true; - this._maxRedirects = 50; - 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; - this._httpProxy = requestOptions.proxy; - if (requestOptions.proxy && requestOptions.proxy.proxyBypassHosts) { - this._httpProxyBypassHosts = []; - requestOptions.proxy.proxyBypassHosts.forEach(bypass => { - this._httpProxyBypassHosts.push(new RegExp(bypass, 'i')); - }); - } - this._certConfig = requestOptions.cert; - // cache the cert content into memory, so we don't have to read it from disk every time - if (this._certConfig && this._certConfig.caFile && fs.existsSync(this._certConfig.caFile)) { - this._ca = fs.readFileSync(this._certConfig.caFile, 'utf8'); - } - if (this._certConfig && this._certConfig.certFile && fs.existsSync(this._certConfig.certFile)) { - this._cert = fs.readFileSync(this._certConfig.certFile, 'utf8'); - } - if (this._certConfig && this._certConfig.keyFile && fs.existsSync(this._certConfig.keyFile)) { - this._key = fs.readFileSync(this._certConfig.keyFile, 'utf8'); - } - if (requestOptions.allowRedirects != null) { - this._allowRedirects = requestOptions.allowRedirects; - } - if (requestOptions.maxRedirects != null) { - this._maxRedirects = Math.max(requestOptions.maxRedirects, 0); - } - if (requestOptions.keepAlive != null) { - this._keepAlive = requestOptions.keepAlive; - } - } - } - 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); - } - /** - * Makes a raw http request. - * All other methods such as get, post, patch, and request ultimately call this. - * Prefer get, del, post and patch - */ - request(verb, requestUrl, data, headers) { - return __awaiter(this, void 0, void 0, function* () { - if (this._disposed) { - throw new Error("Client has already been disposed."); - } - let info = this._prepareRequest(verb, requestUrl, headers); - let response = yield 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; - } - // we need to finish reading the response before reassigning response - // which will leak the open socket. - yield response.readBody(); - // let's make the request with the new redirectUrl - info = this._prepareRequest(verb, redirectUrl, headers); - response = yield this.requestRaw(info, data); - redirectsRemaining--; - } - 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 - */ - 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; - let isDataString = typeof (data) === 'string'; - 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); - } - }; - 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(); - } - 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(); - } - } - _prepareRequest(method, requestUrl, headers) { - const info = {}; - info.parsedUrl = url.parse(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 = headers || {}; - info.options.headers["User-Agent"] = this.userAgent; - info.options.agent = this._getAgent(requestUrl); - // gives handlers an opportunity to participate - if (this.handlers) { - this.handlers.forEach((handler) => { - handler.prepareRequest(info.options); - }); - } - return info; - } - _getAgent(requestUrl) { - let agent; - let proxy = this._getProxy(requestUrl); - let useProxy = proxy.proxyUrl && proxy.proxyUrl.hostname && !this._isBypassProxy(requestUrl); - 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; - } - let parsedUrl = url.parse(requestUrl); - const usingSsl = parsedUrl.protocol === 'https:'; - let maxSockets = 100; - if (!!this.requestOptions) { - maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets; - } - if (useProxy) { - const agentOptions = { - maxSockets: maxSockets, - keepAlive: this._keepAlive, - proxy: { - proxyAuth: proxy.proxyAuth, - host: proxy.proxyUrl.hostname, - port: proxy.proxyUrl.port - }, - }; - let tunnelAgent; - const overHttps = proxy.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 }); - } - if (usingSsl && this._certConfig) { - agent.options = Object.assign(agent.options || {}, { ca: this._ca, cert: this._cert, key: this._key, passphrase: this._certConfig.passphrase }); - } - return agent; - } - _getProxy(requestUrl) { - const parsedUrl = url.parse(requestUrl); - let usingSsl = parsedUrl.protocol === 'https:'; - let proxyConfig = this._httpProxy; - // fallback to http_proxy and https_proxy env - let https_proxy = process.env[EnvironmentVariables.HTTPS_PROXY]; - let http_proxy = process.env[EnvironmentVariables.HTTP_PROXY]; - if (!proxyConfig) { - if (https_proxy && usingSsl) { - proxyConfig = { - proxyUrl: https_proxy - }; - } - else if (http_proxy) { - proxyConfig = { - proxyUrl: http_proxy - }; - } - } - let proxyUrl; - let proxyAuth; - if (proxyConfig) { - if (proxyConfig.proxyUrl.length > 0) { - proxyUrl = url.parse(proxyConfig.proxyUrl); - } - if (proxyConfig.proxyUsername || proxyConfig.proxyPassword) { - proxyAuth = proxyConfig.proxyUsername + ":" + proxyConfig.proxyPassword; - } - } - return { proxyUrl: proxyUrl, proxyAuth: proxyAuth }; - } - _isBypassProxy(requestUrl) { - if (!this._httpProxyBypassHosts) { - return false; - } - let bypass = false; - this._httpProxyBypassHosts.forEach(bypassHost => { - if (bypassHost.test(requestUrl)) { - bypass = true; - } - }); - return bypass; - } -} -exports.HttpClient = HttpClient; - - -/***/ }), - -/***/ "./node_modules/azure-pipelines-tool-lib/tool.js": +/*! no static exports found */function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){e.done?i(e.value):new n((function(t){t(e.value)})).then(s,a)}c((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=n(/*! url */"url"),o=n(/*! http */"http"),s=n(/*! https */"https"),a=n(/*! tunnel */"./node_modules/tunnel/index.js"),c=n(/*! fs */"fs");var u;!function(e){e[e.OK=200]="OK",e[e.MultipleChoices=300]="MultipleChoices",e[e.MovedPermanently=301]="MovedPermanently",e[e.ResourceMoved=302]="ResourceMoved",e[e.SeeOther=303]="SeeOther",e[e.NotModified=304]="NotModified",e[e.UseProxy=305]="UseProxy",e[e.SwitchProxy=306]="SwitchProxy",e[e.TemporaryRedirect=307]="TemporaryRedirect",e[e.PermanentRedirect=308]="PermanentRedirect",e[e.BadRequest=400]="BadRequest",e[e.Unauthorized=401]="Unauthorized",e[e.PaymentRequired=402]="PaymentRequired",e[e.Forbidden=403]="Forbidden",e[e.NotFound=404]="NotFound",e[e.MethodNotAllowed=405]="MethodNotAllowed",e[e.NotAcceptable=406]="NotAcceptable",e[e.ProxyAuthenticationRequired=407]="ProxyAuthenticationRequired",e[e.RequestTimeout=408]="RequestTimeout",e[e.Conflict=409]="Conflict",e[e.Gone=410]="Gone",e[e.InternalServerError=500]="InternalServerError",e[e.NotImplemented=501]="NotImplemented",e[e.BadGateway=502]="BadGateway",e[e.ServiceUnavailable=503]="ServiceUnavailable",e[e.GatewayTimeout=504]="GatewayTimeout"}(u=t.HttpCodes||(t.HttpCodes={}));const l=[u.MovedPermanently,u.ResourceMoved,u.SeeOther,u.TemporaryRedirect,u.PermanentRedirect];class d{constructor(e){this.message=e}readBody(){return new Promise((e,t)=>r(this,void 0,void 0,(function*(){let t="";this.message.on("data",e=>{t+=e}),this.message.on("end",()=>{e(t)})})))}}var p;t.HttpClientResponse=d,t.isHttps=function(e){return"https:"===i.parse(e).protocol},function(e){e.HTTP_PROXY="HTTP_PROXY",e.HTTPS_PROXY="HTTPS_PROXY"}(p||(p={}));t.HttpClient=class{constructor(e,t,n){this._ignoreSslError=!1,this._allowRedirects=!0,this._maxRedirects=50,this._keepAlive=!1,this._disposed=!1,this.userAgent=e,this.handlers=t||[],this.requestOptions=n,n&&(null!=n.ignoreSslError&&(this._ignoreSslError=n.ignoreSslError),this._socketTimeout=n.socketTimeout,this._httpProxy=n.proxy,n.proxy&&n.proxy.proxyBypassHosts&&(this._httpProxyBypassHosts=[],n.proxy.proxyBypassHosts.forEach(e=>{this._httpProxyBypassHosts.push(new RegExp(e,"i"))})),this._certConfig=n.cert,this._certConfig&&this._certConfig.caFile&&c.existsSync(this._certConfig.caFile)&&(this._ca=c.readFileSync(this._certConfig.caFile,"utf8")),this._certConfig&&this._certConfig.certFile&&c.existsSync(this._certConfig.certFile)&&(this._cert=c.readFileSync(this._certConfig.certFile,"utf8")),this._certConfig&&this._certConfig.keyFile&&c.existsSync(this._certConfig.keyFile)&&(this._key=c.readFileSync(this._certConfig.keyFile,"utf8")),null!=n.allowRedirects&&(this._allowRedirects=n.allowRedirects),null!=n.maxRedirects&&(this._maxRedirects=Math.max(n.maxRedirects,0)),null!=n.keepAlive&&(this._keepAlive=n.keepAlive))}options(e,t){return this.request("OPTIONS",e,null,t||{})}get(e,t){return this.request("GET",e,null,t||{})}del(e,t){return this.request("DELETE",e,null,t||{})}post(e,t,n){return this.request("POST",e,t,n||{})}patch(e,t,n){return this.request("PATCH",e,t,n||{})}put(e,t,n){return this.request("PUT",e,t,n||{})}head(e,t){return this.request("HEAD",e,null,t||{})}sendStream(e,t,n,r){return this.request(e,t,n,r)}request(e,t,n,i){return r(this,void 0,void 0,(function*(){if(this._disposed)throw new Error("Client has already been disposed.");let r=this._prepareRequest(e,t,i),o=yield this.requestRaw(r,n);if(o&&o.message&&o.message.statusCode===u.Unauthorized){let e;for(let t=0;t0;){const t=o.message.headers.location;if(!t)break;yield o.readBody(),r=this._prepareRequest(e,t,i),o=yield this.requestRaw(r,n),s--}return o}))}dispose(){this._agent&&this._agent.destroy(),this._disposed=!0}requestRaw(e,t){return new Promise((n,r)=>{this.requestRawWithCallback(e,t,(function(e,t){e&&r(e),n(t)}))})}requestRawWithCallback(e,t,n){let r;"string"==typeof t&&(e.options.headers["Content-Length"]=Buffer.byteLength(t,"utf8"));let i=!1,o=(e,t)=>{i||(i=!0,n(e,t))},s=e.httpModule.request(e.options,e=>{let t=new d(e);o(null,t)});s.on("socket",e=>{r=e}),s.setTimeout(this._socketTimeout||18e4,()=>{r&&r.end(),o(new Error("Request timeout: "+e.options.path),null)}),s.on("error",(function(e){o(e,null)})),t&&"string"==typeof t&&s.write(t,"utf8"),t&&"string"!=typeof t?(t.on("close",(function(){s.end()})),t.pipe(s)):s.end()}_prepareRequest(e,t,n){const r={};r.parsedUrl=i.parse(t);const a="https:"===r.parsedUrl.protocol;r.httpModule=a?s:o;const c=a?443:80;return r.options={},r.options.host=r.parsedUrl.hostname,r.options.port=r.parsedUrl.port?parseInt(r.parsedUrl.port):c,r.options.path=(r.parsedUrl.pathname||"")+(r.parsedUrl.search||""),r.options.method=e,r.options.headers=n||{},r.options.headers["User-Agent"]=this.userAgent,r.options.agent=this._getAgent(t),this.handlers&&this.handlers.forEach(e=>{e.prepareRequest(r.options)}),r}_getAgent(e){let t,n=this._getProxy(e),r=n.proxyUrl&&n.proxyUrl.hostname&&!this._isBypassProxy(e);if(this._keepAlive&&r&&(t=this._proxyAgent),this._keepAlive&&!r&&(t=this._agent),t)return t;const c="https:"===i.parse(e).protocol;let u=100;if(this.requestOptions&&(u=this.requestOptions.maxSockets||o.globalAgent.maxSockets),r){const e={maxSockets:u,keepAlive:this._keepAlive,proxy:{proxyAuth:n.proxyAuth,host:n.proxyUrl.hostname,port:n.proxyUrl.port}};let r;const i="https:"===n.proxyUrl.protocol;r=c?i?a.httpsOverHttps:a.httpsOverHttp:i?a.httpOverHttps:a.httpOverHttp,t=r(e),this._proxyAgent=t}if(this._keepAlive&&!t){const e={keepAlive:this._keepAlive,maxSockets:u};t=c?new s.Agent(e):new o.Agent(e),this._agent=t}return t||(t=c?s.globalAgent:o.globalAgent),c&&this._ignoreSslError&&(t.options=Object.assign(t.options||{},{rejectUnauthorized:!1})),c&&this._certConfig&&(t.options=Object.assign(t.options||{},{ca:this._ca,cert:this._cert,key:this._key,passphrase:this._certConfig.passphrase})),t}_getProxy(e){let t,n,r="https:"===i.parse(e).protocol,o=this._httpProxy,s=process.env[p.HTTPS_PROXY],a=process.env[p.HTTP_PROXY];return o||(s&&r?o={proxyUrl:s}:a&&(o={proxyUrl:a})),o&&(o.proxyUrl.length>0&&(t=i.parse(o.proxyUrl)),(o.proxyUsername||o.proxyPassword)&&(n=o.proxyUsername+":"+o.proxyPassword)),{proxyUrl:t,proxyAuth:n}}_isBypassProxy(e){if(!this._httpProxyBypassHosts)return!1;let t=!1;return this._httpProxyBypassHosts.forEach(n=>{n.test(e)&&(t=!0)}),t}}},"./node_modules/azure-pipelines-tool-lib/tool.js": /*!*******************************************************!*\ !*** ./node_modules/azure-pipelines-tool-lib/tool.js ***! \*******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - 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) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const httpm = __webpack_require__(/*! typed-rest-client/HttpClient */ "./node_modules/azure-pipelines-tool-lib/node_modules/typed-rest-client/HttpClient.js"); -const path = __webpack_require__(/*! path */ "path"); -const os = __webpack_require__(/*! os */ "os"); -const process = __webpack_require__(/*! process */ "process"); -const fs = __webpack_require__(/*! fs */ "fs"); -const semver = __webpack_require__(/*! semver */ "./node_modules/semver/semver.js"); -const tl = __webpack_require__(/*! azure-pipelines-task-lib/task */ "./node_modules/azure-pipelines-task-lib/task.js"); -const cmp = __webpack_require__(/*! semver-compare */ "./node_modules/semver-compare/index.js"); -const uuidV4 = __webpack_require__(/*! uuid/v4 */ "./node_modules/uuid/v4.js"); -let pkg = { version: "1.2.3" }; -let userAgent = 'vsts-task-installer/' + pkg.version; -let requestOptions = { - // ignoreSslError: true, - proxy: tl.getHttpProxyConfiguration(), - cert: tl.getHttpCertConfiguration() -}; -let http = new httpm.HttpClient(userAgent, null, requestOptions); -tl.setResourcePath(path.join(__dirname, 'lib.json')); -function debug(message) { - tl.debug(message); -} -exports.debug = debug; -function prependPath(toolPath) { - tl.assertAgent('2.115.0'); - if (!toolPath) { - throw new Error('Parameter toolPath must not be null or empty'); - } - else if (!tl.exist(toolPath) || !tl.stats(toolPath).isDirectory()) { - throw new Error('Directory does not exist: ' + toolPath); - } - // todo: add a test for path - console.log(tl.loc('TOOL_LIB_PrependPath', toolPath)); - let newPath = toolPath + path.delimiter + process.env['PATH']; - tl.debug('new Path: ' + newPath); - process.env['PATH'] = newPath; - // instruct the agent to set this path on future tasks - console.log('##vso[task.prependpath]' + toolPath); -} -exports.prependPath = prependPath; -function delay(ms) { - return new Promise(resolve => setTimeout(resolve, ms)); -} -//----------------------------- -// Version Functions -//----------------------------- -/** - * Checks if a version spec is an explicit version (e.g. 1.0.1 or v1.0.1) - * As opposed to a version spec like 1.x - * - * @param versionSpec - */ -function isExplicitVersion(versionSpec) { - let c = semver.clean(versionSpec); - tl.debug('isExplicit: ' + c); - let valid = semver.valid(c) != null; - tl.debug('explicit? ' + valid); - return valid; -} -exports.isExplicitVersion = isExplicitVersion; -/** - * Returns cleaned (removed leading/trailing whitespace, remove '=v' prefix) - * and parsed version, or null if version is invalid. - */ -function cleanVersion(version) { - tl.debug('cleaning: ' + version); - return semver.clean(version); -} -exports.cleanVersion = cleanVersion; -/** - * evaluates a list of versions and returns the latest version matching the version spec - * - * @param versions an array of versions to evaluate - * @param versionSpec a version spec (e.g. 1.x) - */ -function evaluateVersions(versions, versionSpec) { - let version; - tl.debug('evaluating ' + versions.length + ' versions'); - versions = versions.sort(cmp); - for (let i = versions.length - 1; i >= 0; i--) { - let potential = versions[i]; - let satisfied = semver.satisfies(potential, versionSpec); - if (satisfied) { - version = potential; - break; - } - } - if (version) { - tl.debug('matched: ' + version); - } - else { - tl.debug('match not found'); - } - return version; -} -exports.evaluateVersions = evaluateVersions; -//----------------------------- -// Local Tool Cache Functions -//----------------------------- -/** - * finds the path to a tool in the local installed tool cache - * - * @param toolName name of the tool - * @param versionSpec version of the tool - * @param arch optional arch. defaults to arch of computer - */ -function findLocalTool(toolName, versionSpec, arch) { - if (!toolName) { - throw new Error('toolName parameter is required'); - } - if (!versionSpec) { - throw new Error('versionSpec parameter is required'); - } - arch = arch || os.arch(); - // attempt to resolve an explicit version - if (!isExplicitVersion(versionSpec)) { - let localVersions = findLocalToolVersions(toolName, arch); - let match = evaluateVersions(localVersions, versionSpec); - versionSpec = match; - } - // check for the explicit version in the cache - let toolPath; - if (versionSpec) { - versionSpec = semver.clean(versionSpec); - let cacheRoot = _getCacheRoot(); - let cachePath = path.join(cacheRoot, toolName, versionSpec, arch); - tl.debug('checking cache: ' + cachePath); - if (tl.exist(cachePath) && tl.exist(`${cachePath}.complete`)) { - console.log(tl.loc('TOOL_LIB_FoundInCache', toolName, versionSpec, arch)); - toolPath = cachePath; - } - else { - tl.debug('not found'); - } - } - return toolPath; -} -exports.findLocalTool = findLocalTool; -/** - * Retrieves the versions of a tool that is intalled in the local tool cache - * - * @param toolName name of the tool - * @param arch optional arch. defaults to arch of computer - */ -function findLocalToolVersions(toolName, arch) { - let versions = []; - arch = arch || os.arch(); - let toolPath = path.join(_getCacheRoot(), toolName); - if (tl.exist(toolPath)) { - let children = tl.ls('', [toolPath]); - children.forEach((child) => { - if (isExplicitVersion(child)) { - let fullPath = path.join(toolPath, child, arch); - if (tl.exist(fullPath) && tl.exist(`${fullPath}.complete`)) { - versions.push(child); - } - } - }); - } - return versions; -} -exports.findLocalToolVersions = findLocalToolVersions; -//--------------------- -// Download Functions -//--------------------- -// -// TODO: keep extension intact -// -/** - * Download a tool from an url and stream it into a file - * - * @param url url of tool to download - * @param fileName optional fileName. Should typically not use (will be a guid for reliability). Can pass fileName with an absolute path. - */ -function downloadTool(url, fileName) { - return __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - try { - tl.debug(fileName); - fileName = fileName || uuidV4(); - // check if it's an absolute path already - var destPath; - if (path.isAbsolute(fileName)) { - destPath = fileName; - } - else { - destPath = path.join(_getAgentTemp(), fileName); - } - // make sure that the folder exists - tl.mkdirP(path.dirname(destPath)); - console.log(tl.loc('TOOL_LIB_Downloading', url)); - tl.debug('destination ' + destPath); - if (fs.existsSync(destPath)) { - throw new Error("Destination file path already exists"); - } - tl.debug('downloading'); - const statusCodesToRetry = [httpm.HttpCodes.BadGateway, httpm.HttpCodes.ServiceUnavailable, httpm.HttpCodes.GatewayTimeout]; - let retryCount = 1; - const maxRetries = 3; - let response = yield http.get(url); - while (retryCount < maxRetries && statusCodesToRetry.indexOf(response.message.statusCode) > -1) { - tl.debug(`Download attempt "${retryCount}" of "${maxRetries}" failed with status code "${response.message.statusCode}".`); - retryCount += 1; - yield delay(1000); - tl.debug(`Downloading attempt "${retryCount}" of "${maxRetries}"`); - response = yield http.get(url); - } - if (response.message.statusCode != 200) { - let err = new Error('Unexpected HTTP response: ' + response.message.statusCode); - err['httpStatusCode'] = response.message.statusCode; - tl.debug(`Failed to download "${fileName}" from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`); - throw err; - } - tl.debug('creating stream'); - let file = fs.createWriteStream(destPath); - file.on('open', (fd) => __awaiter(this, void 0, void 0, function* () { - try { - let stream = response.message.pipe(file); - stream.on('close', () => { - tl.debug('download complete'); - resolve(destPath); - }); - } - catch (err) { - reject(err); - } - })); - file.on('error', (err) => { - file.end(); - reject(err); - }); - } - catch (error) { - reject(error); - } - })); - }); -} -exports.downloadTool = downloadTool; -//--------------------- -// Install Functions -//--------------------- -function _createToolPath(tool, version, arch) { - // todo: add test for clean - let folderPath = path.join(_getCacheRoot(), tool, semver.clean(version), arch); - tl.debug('destination ' + folderPath); - let markerPath = `${folderPath}.complete`; - tl.rmRF(folderPath); - tl.rmRF(markerPath); - tl.mkdirP(folderPath); - return folderPath; -} -function _completeToolPath(tool, version, arch) { - let folderPath = path.join(_getCacheRoot(), tool, semver.clean(version), arch); - let markerPath = `${folderPath}.complete`; - tl.writeFile(markerPath, ''); - tl.debug('finished caching tool'); -} -/** - * Caches a directory and installs it into the tool cacheDir - * - * @param sourceDir the directory to cache into tools - * @param tool tool name - * @param version version of the tool. semver format - * @param arch architecture of the tool. Optional. Defaults to machine architecture - */ -function cacheDir(sourceDir, tool, version, arch) { - return __awaiter(this, void 0, void 0, function* () { - version = semver.clean(version); - arch = arch || os.arch(); - console.log(tl.loc('TOOL_LIB_CachingTool', tool, version, arch)); - tl.debug('source dir: ' + sourceDir); - if (!tl.stats(sourceDir).isDirectory()) { - throw new Error('sourceDir is not a directory'); - } - // create the tool dir - let destPath = _createToolPath(tool, version, arch); - // copy each child item. do not move. move can fail on Windows - // due to anti-virus software having an open handle on a file. - for (let itemName of fs.readdirSync(sourceDir)) { - let s = path.join(sourceDir, itemName); - tl.cp(s, destPath + '/', '-r'); - } - // write .complete - _completeToolPath(tool, version, arch); - return destPath; - }); -} -exports.cacheDir = cacheDir; -/** - * Caches a downloaded file (GUID) and installs it - * into the tool cache with a given targetName - * - * @param sourceFile the file to cache into tools. Typically a result of downloadTool which is a guid. - * @param targetFile the name of the file name in the tools directory - * @param tool tool name - * @param version version of the tool. semver format - * @param arch architecture of the tool. Optional. Defaults to machine architecture - */ -function cacheFile(sourceFile, targetFile, tool, version, arch) { - return __awaiter(this, void 0, void 0, function* () { - version = semver.clean(version); - arch = arch || os.arch(); - console.log(tl.loc('TOOL_LIB_CachingTool', tool, version, arch)); - tl.debug('source file:' + sourceFile); - if (!tl.stats(sourceFile).isFile()) { - throw new Error('sourceFile is not a file'); - } - // create the tool dir - let destFolder = _createToolPath(tool, version, arch); - // copy instead of move. move can fail on Windows due to - // anti-virus software having an open handle on a file. - let destPath = path.join(destFolder, targetFile); - tl.debug('destination file' + destPath); - tl.cp(sourceFile, destPath); - // write .complete - _completeToolPath(tool, version, arch); - return destFolder; - }); -} -exports.cacheFile = cacheFile; -//--------------------- -// Extract Functions -//--------------------- -/** - * Extract a .7z file - * - * @param file path to the .7z file - * @param dest destination directory. Optional. - * @param _7zPath path to 7zr.exe. Optional, for long path support. Most .7z archives do not have this - * problem. If your .7z archive contains very long paths, you can pass the path to 7zr.exe which will - * gracefully handle long paths. By default 7zdec.exe is used because it is a very small program and is - * bundled with the tool lib. However it does not support long paths. 7zr.exe is the reduced command line - * interface, it is smaller than the full command line interface, and it does support long paths. At the - * time of this writing, it is freely available from the LZMA SDK that is available on the 7zip website. - * Be sure to check the current license agreement. If 7zr.exe is bundled with your task, then the path - * to 7zr.exe can be pass to this function. - * @returns path to the destination directory - */ -function extract7z(file, dest, _7zPath) { - return __awaiter(this, void 0, void 0, function* () { - if (process.platform != 'win32') { - throw new Error('extract7z() not supported on current OS'); - } - if (!file) { - throw new Error("parameter 'file' is required"); - } - console.log(tl.loc('TOOL_LIB_ExtractingArchive')); - dest = _createExtractFolder(dest); - let originalCwd = process.cwd(); - try { - process.chdir(dest); - if (_7zPath) { - // extract - let _7z = tl.tool(_7zPath) - .arg('x') // eXtract files with full paths - .arg('-bb1') // -bb[0-3] : set output log level - .arg('-bd') // disable progress indicator - .arg('-sccUTF-8') // set charset for for console input/output - .arg(file); - yield _7z.exec(); - } - else { - // extract - let escapedScript = path.join(__dirname, 'Invoke-7zdec.ps1').replace(/'/g, "''").replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines - let escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, ''); - let escapedTarget = dest.replace(/'/g, "''").replace(/"|\n|\r/g, ''); - let command = `& '${escapedScript}' -Source '${escapedFile}' -Target '${escapedTarget}'`; - let powershellPath = tl.which('powershell', true); - let powershell = tl.tool(powershellPath) - .line('-NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command') - .arg(command); - powershell.on('stdout', (buffer) => { - process.stdout.write(buffer); - }); - powershell.on('stderr', (buffer) => { - process.stderr.write(buffer); - }); - yield powershell.exec({ silent: true }); - } - } - finally { - process.chdir(originalCwd); - } - return dest; - }); -} -exports.extract7z = extract7z; -/** - * installs a tool from a tar by extracting the tar and installing it into the tool cache - * - * @param file file path of the tar - * @param tool name of tool in the tool cache - * @param version version of the tool - * @param arch arch of the tool. optional. defaults to the arch of the machine - * @param options IExtractOptions - * @param destination destination directory. optional. - */ -function extractTar(file, destination) { - return __awaiter(this, void 0, void 0, function* () { - // mkdir -p node/4.7.0/x64 - // tar xzC ./node/4.7.0/x64 -f node-v4.7.0-darwin-x64.tar.gz --strip-components 1 - console.log(tl.loc('TOOL_LIB_ExtractingArchive')); - let dest = _createExtractFolder(destination); - let tr = tl.tool('tar'); - tr.arg(['xzC', dest, '-f', file]); - yield tr.exec(); - return dest; - }); -} -exports.extractTar = extractTar; -function extractZip(file, destination) { - return __awaiter(this, void 0, void 0, function* () { - if (!file) { - throw new Error("parameter 'file' is required"); - } - console.log(tl.loc('TOOL_LIB_ExtractingArchive')); - let dest = _createExtractFolder(destination); - if (process.platform == 'win32') { - // build the powershell command - let escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines - let escapedDest = dest.replace(/'/g, "''").replace(/"|\n|\r/g, ''); - let command = `$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ; [System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}')`; - // change the console output code page to UTF-8. - // TODO: FIX WHICH: let chcpPath = tl.which('chcp.com', true); - let chcpPath = path.join(process.env.windir, "system32", "chcp.com"); - yield tl.exec(chcpPath, '65001'); - // run powershell - let powershell = tl.tool('powershell') - .line('-NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command') - .arg(command); - yield powershell.exec(); - } - else { - let unzip = tl.tool('unzip') - .arg(file); - yield unzip.exec({ cwd: dest }); - } - return dest; - }); -} -exports.extractZip = extractZip; -function _createExtractFolder(dest) { - if (!dest) { - // create a temp dir - dest = path.join(_getAgentTemp(), uuidV4()); - } - tl.mkdirP(dest); - return dest; -} -//--------------------- -// Query Functions -//--------------------- -// default input will be >= LTS version. drop label different than value. -// v4 (LTS) would have a value of 4.x -// option to always download? (not cache), TTL? -/** - * Scrape a web page for versions by regex - * - * @param url url to scrape - * @param regex regex to use for version matches - */ -function scrape(url, regex) { - return __awaiter(this, void 0, void 0, function* () { - let output = yield (yield http.get(url)).readBody(); - let matches = output.match(regex); - let seen = {}; - let versions = []; - for (let i = 0; i < matches.length; i++) { - let ver = semver.clean(matches[i]); - if (!seen.hasOwnProperty(ver)) { - seen[ver] = true; - versions.push(ver); - } - } - return versions; - }); -} -exports.scrape = scrape; -function _getCacheRoot() { - tl.assertAgent('2.115.0'); - let cacheRoot = tl.getVariable('Agent.ToolsDirectory'); - if (!cacheRoot) { - throw new Error('Agent.ToolsDirectory is not set'); - } - return cacheRoot; -} -function _getAgentTemp() { - tl.assertAgent('2.115.0'); - let tempDirectory = tl.getVariable('Agent.TempDirectory'); - if (!tempDirectory) { - throw new Error('Agent.TempDirectory is not set'); - } - return tempDirectory; -} - - -/***/ }), - -/***/ "./node_modules/balanced-match/index.js": +/*! no static exports found */function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){e.done?i(e.value):new n((function(t){t(e.value)})).then(s,a)}c((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=n(/*! typed-rest-client/HttpClient */"./node_modules/azure-pipelines-tool-lib/node_modules/typed-rest-client/HttpClient.js"),o=n(/*! path */"path"),s=n(/*! os */"os"),a=n(/*! process */"process"),c=n(/*! fs */"fs"),u=n(/*! semver */"./node_modules/semver/semver.js"),l=n(/*! azure-pipelines-task-lib/task */"./node_modules/azure-pipelines-task-lib/task.js"),d=n(/*! semver-compare */"./node_modules/semver-compare/index.js"),p=n(/*! uuid/v4 */"./node_modules/uuid/v4.js");let f={proxy:l.getHttpProxyConfiguration(),cert:l.getHttpCertConfiguration()},h=new i.HttpClient("vsts-task-installer/1.2.3",null,f);function g(e){return new Promise(t=>setTimeout(t,e))}function y(e){let t=u.clean(e);l.debug("isExplicit: "+t);let n=null!=u.valid(t);return l.debug("explicit? "+n),n}function m(e,t){let n;l.debug("evaluating "+e.length+" versions");for(let r=(e=e.sort(d)).length-1;r>=0;r--){let i=e[r];if(u.satisfies(i,t)){n=i;break}}return n?l.debug("matched: "+n):l.debug("match not found"),n}function v(e,t){let n=[];t=t||s.arch();let r=o.join(S(),e);if(l.exist(r)){l.ls("",[r]).forEach(e=>{if(y(e)){let i=o.join(r,e,t);l.exist(i)&&l.exist(`${i}.complete`)&&n.push(e)}})}return n}function _(e,t,n){let r=o.join(S(),e,u.clean(t),n);l.debug("destination "+r);let i=`${r}.complete`;return l.rmRF(r),l.rmRF(i),l.mkdirP(r),r}function b(e,t,n){let r=`${o.join(S(),e,u.clean(t),n)}.complete`;l.writeFile(r,""),l.debug("finished caching tool")}function w(e){return e||(e=o.join(E(),p())),l.mkdirP(e),e}function S(){l.assertAgent("2.115.0");let e=l.getVariable("Agent.ToolsDirectory");if(!e)throw new Error("Agent.ToolsDirectory is not set");return e}function E(){l.assertAgent("2.115.0");let e=l.getVariable("Agent.TempDirectory");if(!e)throw new Error("Agent.TempDirectory is not set");return e}l.setResourcePath(o.join(__dirname,"lib.json")),t.debug=function(e){l.debug(e)},t.prependPath=function(e){if(l.assertAgent("2.115.0"),!e)throw new Error("Parameter toolPath must not be null or empty");if(!l.exist(e)||!l.stats(e).isDirectory())throw new Error("Directory does not exist: "+e);console.log(l.loc("TOOL_LIB_PrependPath",e));let t=e+o.delimiter+a.env.PATH;l.debug("new Path: "+t),a.env.PATH=t,console.log("##vso[task.prependpath]"+e)},t.isExplicitVersion=y,t.cleanVersion=function(e){return l.debug("cleaning: "+e),u.clean(e)},t.evaluateVersions=m,t.findLocalTool=function(e,t,n){if(!e)throw new Error("toolName parameter is required");if(!t)throw new Error("versionSpec parameter is required");if(n=n||s.arch(),!y(t)){t=m(v(e,n),t)}let r;if(t){t=u.clean(t);let i=S(),s=o.join(i,e,t,n);l.debug("checking cache: "+s),l.exist(s)&&l.exist(`${s}.complete`)?(console.log(l.loc("TOOL_LIB_FoundInCache",e,t,n)),r=s):l.debug("not found")}return r},t.findLocalToolVersions=v,t.downloadTool=function(e,t){return r(this,void 0,void 0,(function*(){return new Promise((n,s)=>r(this,void 0,void 0,(function*(){try{var a;if(l.debug(t),t=t||p(),a=o.isAbsolute(t)?t:o.join(E(),t),l.mkdirP(o.dirname(a)),console.log(l.loc("TOOL_LIB_Downloading",e)),l.debug("destination "+a),c.existsSync(a))throw new Error("Destination file path already exists");l.debug("downloading");const u=[i.HttpCodes.BadGateway,i.HttpCodes.ServiceUnavailable,i.HttpCodes.GatewayTimeout];let d=1;const f=3;let y=yield h.get(e);for(;d-1;)l.debug(`Download attempt "${d}" of "${f}" failed with status code "${y.message.statusCode}".`),d+=1,yield g(1e3),l.debug(`Downloading attempt "${d}" of "${f}"`),y=yield h.get(e);if(200!=y.message.statusCode){let n=new Error("Unexpected HTTP response: "+y.message.statusCode);throw n.httpStatusCode=y.message.statusCode,l.debug(`Failed to download "${t}" from "${e}". Code(${y.message.statusCode}) Message(${y.message.statusMessage})`),n}l.debug("creating stream");let m=c.createWriteStream(a);m.on("open",e=>r(this,void 0,void 0,(function*(){try{y.message.pipe(m).on("close",()=>{l.debug("download complete"),n(a)})}catch(e){s(e)}}))),m.on("error",e=>{m.end(),s(e)})}catch(e){s(e)}})))}))},t.cacheDir=function(e,t,n,i){return r(this,void 0,void 0,(function*(){if(n=u.clean(n),i=i||s.arch(),console.log(l.loc("TOOL_LIB_CachingTool",t,n,i)),l.debug("source dir: "+e),!l.stats(e).isDirectory())throw new Error("sourceDir is not a directory");let r=_(t,n,i);for(let t of c.readdirSync(e)){let n=o.join(e,t);l.cp(n,r+"/","-r")}return b(t,n,i),r}))},t.cacheFile=function(e,t,n,i,a){return r(this,void 0,void 0,(function*(){if(i=u.clean(i),a=a||s.arch(),console.log(l.loc("TOOL_LIB_CachingTool",n,i,a)),l.debug("source file:"+e),!l.stats(e).isFile())throw new Error("sourceFile is not a file");let r=_(n,i,a),c=o.join(r,t);return l.debug("destination file"+c),l.cp(e,c),b(n,i,a),r}))},t.extract7z=function(e,t,n){return r(this,void 0,void 0,(function*(){if("win32"!=a.platform)throw new Error("extract7z() not supported on current OS");if(!e)throw new Error("parameter 'file' is required");console.log(l.loc("TOOL_LIB_ExtractingArchive")),t=w(t);let r=a.cwd();try{if(a.chdir(t),n){let t=l.tool(n).arg("x").arg("-bb1").arg("-bd").arg("-sccUTF-8").arg(e);yield t.exec()}else{let n=`& '${o.join(__dirname,"Invoke-7zdec.ps1").replace(/'/g,"''").replace(/"|\n|\r/g,"")}' -Source '${e.replace(/'/g,"''").replace(/"|\n|\r/g,"")}' -Target '${t.replace(/'/g,"''").replace(/"|\n|\r/g,"")}'`,r=l.which("powershell",!0),i=l.tool(r).line("-NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command").arg(n);i.on("stdout",e=>{a.stdout.write(e)}),i.on("stderr",e=>{a.stderr.write(e)}),yield i.exec({silent:!0})}}finally{a.chdir(r)}return t}))},t.extractTar=function(e,t){return r(this,void 0,void 0,(function*(){console.log(l.loc("TOOL_LIB_ExtractingArchive"));let n=w(t),r=l.tool("tar");return r.arg(["xzC",n,"-f",e]),yield r.exec(),n}))},t.extractZip=function(e,t){return r(this,void 0,void 0,(function*(){if(!e)throw new Error("parameter 'file' is required");console.log(l.loc("TOOL_LIB_ExtractingArchive"));let n=w(t);if("win32"==a.platform){let t=`$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ; [System.IO.Compression.ZipFile]::ExtractToDirectory('${e.replace(/'/g,"''").replace(/"|\n|\r/g,"")}', '${n.replace(/'/g,"''").replace(/"|\n|\r/g,"")}')`,r=o.join(a.env.windir,"system32","chcp.com");yield l.exec(r,"65001");let i=l.tool("powershell").line("-NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command").arg(t);yield i.exec()}else{let t=l.tool("unzip").arg(e);yield t.exec({cwd:n})}return n}))},t.scrape=function(e,t){return r(this,void 0,void 0,(function*(){let n=(yield(yield h.get(e)).readBody()).match(t),r={},i=[];for(let e=0;e= 0 && bi > 0) { - begs = []; - left = str.length; - - while (i >= 0 && !result) { - if (i == ai) { - begs.push(i); - ai = str.indexOf(a, i + 1); - } else if (begs.length == 1) { - result = [ begs.pop(), bi ]; - } else { - beg = begs.pop(); - if (beg < left) { - left = beg; - right = bi; - } - - bi = str.indexOf(b, i + 1); - } - - i = ai < bi && ai >= 0 ? ai : bi; - } - - if (begs.length) { - result = [ left, right ]; - } - } - - return result; -} - - -/***/ }), - -/***/ "./node_modules/brace-expansion/index.js": +/*! no static exports found */function(e,t,n){"use strict";function r(e,t,n){e instanceof RegExp&&(e=i(e,n)),t instanceof RegExp&&(t=i(t,n));var r=o(e,t,n);return r&&{start:r[0],end:r[1],pre:n.slice(0,r[0]),body:n.slice(r[0]+e.length,r[1]),post:n.slice(r[1]+t.length)}}function i(e,t){var n=t.match(e);return n?n[0]:null}function o(e,t,n){var r,i,o,s,a,c=n.indexOf(e),u=n.indexOf(t,c+1),l=c;if(c>=0&&u>0){for(r=[],o=n.length;l>=0&&!a;)l==c?(r.push(l),c=n.indexOf(e,l+1)):1==r.length?a=[r.pop(),u]:((i=r.pop())=0?c:u;r.length&&(a=[o,s])}return a}e.exports=r,r.range=o},"./node_modules/brace-expansion/index.js": /*!***********************************************!*\ !*** ./node_modules/brace-expansion/index.js ***! \***********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -var concatMap = __webpack_require__(/*! concat-map */ "./node_modules/concat-map/index.js"); -var balanced = __webpack_require__(/*! balanced-match */ "./node_modules/balanced-match/index.js"); - -module.exports = expandTop; - -var escSlash = '\0SLASH'+Math.random()+'\0'; -var escOpen = '\0OPEN'+Math.random()+'\0'; -var escClose = '\0CLOSE'+Math.random()+'\0'; -var escComma = '\0COMMA'+Math.random()+'\0'; -var escPeriod = '\0PERIOD'+Math.random()+'\0'; - -function numeric(str) { - return parseInt(str, 10) == str - ? parseInt(str, 10) - : str.charCodeAt(0); -} - -function escapeBraces(str) { - return str.split('\\\\').join(escSlash) - .split('\\{').join(escOpen) - .split('\\}').join(escClose) - .split('\\,').join(escComma) - .split('\\.').join(escPeriod); -} - -function unescapeBraces(str) { - return str.split(escSlash).join('\\') - .split(escOpen).join('{') - .split(escClose).join('}') - .split(escComma).join(',') - .split(escPeriod).join('.'); -} - - -// Basically just str.split(","), but handling cases -// where we have nested braced sections, which should be -// treated as individual members, like {a,{b,c},d} -function parseCommaParts(str) { - if (!str) - return ['']; - - var parts = []; - var m = balanced('{', '}', str); - - if (!m) - return str.split(','); - - var pre = m.pre; - var body = m.body; - var post = m.post; - var p = pre.split(','); - - p[p.length-1] += '{' + body + '}'; - var postParts = parseCommaParts(post); - if (post.length) { - p[p.length-1] += postParts.shift(); - p.push.apply(p, postParts); - } - - parts.push.apply(parts, p); - - return parts; -} - -function expandTop(str) { - if (!str) - return []; - - // I don't know why Bash 4.3 does this, but it does. - // Anything starting with {} will have the first two bytes preserved - // but *only* at the top level, so {},a}b will not expand to anything, - // but a{},b}c will be expanded to [a}c,abc]. - // One could argue that this is a bug in Bash, but since the goal of - // this module is to match Bash's rules, we escape a leading {} - if (str.substr(0, 2) === '{}') { - str = '\\{\\}' + str.substr(2); - } - - return expand(escapeBraces(str), true).map(unescapeBraces); -} - -function identity(e) { - return e; -} - -function embrace(str) { - return '{' + str + '}'; -} -function isPadded(el) { - return /^-?0\d/.test(el); -} - -function lte(i, y) { - return i <= y; -} -function gte(i, y) { - return i >= y; -} - -function expand(str, isTop) { - var expansions = []; - - var m = balanced('{', '}', str); - if (!m || /\$$/.test(m.pre)) return [str]; - - var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); - var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); - var isSequence = isNumericSequence || isAlphaSequence; - var isOptions = m.body.indexOf(',') >= 0; - if (!isSequence && !isOptions) { - // {a},b} - if (m.post.match(/,.*\}/)) { - str = m.pre + '{' + m.body + escClose + m.post; - return expand(str); - } - return [str]; - } - - var n; - if (isSequence) { - n = m.body.split(/\.\./); - } else { - n = parseCommaParts(m.body); - if (n.length === 1) { - // x{{a,b}}y ==> x{a}y x{b}y - n = expand(n[0], false).map(embrace); - if (n.length === 1) { - var post = m.post.length - ? expand(m.post, false) - : ['']; - return post.map(function(p) { - return m.pre + n[0] + p; - }); - } - } - } - - // at this point, n is the parts, and we know it's not a comma set - // with a single entry. - - // no need to expand pre, since it is guaranteed to be free of brace-sets - var pre = m.pre; - var post = m.post.length - ? expand(m.post, false) - : ['']; - - var N; - - if (isSequence) { - var x = numeric(n[0]); - var y = numeric(n[1]); - var width = Math.max(n[0].length, n[1].length) - var incr = n.length == 3 - ? Math.abs(numeric(n[2])) - : 1; - var test = lte; - var reverse = y < x; - if (reverse) { - incr *= -1; - test = gte; - } - var pad = n.some(isPadded); - - N = []; - - for (var i = x; test(i, y); i += incr) { - var c; - if (isAlphaSequence) { - c = String.fromCharCode(i); - if (c === '\\') - c = ''; - } else { - c = String(i); - if (pad) { - var need = width - c.length; - if (need > 0) { - var z = new Array(need + 1).join('0'); - if (i < 0) - c = '-' + z + c.slice(1); - else - c = z + c; - } - } - } - N.push(c); - } - } else { - N = concatMap(n, function(el) { return expand(el, false) }); - } - - for (var j = 0; j < N.length; j++) { - for (var k = 0; k < post.length; k++) { - var expansion = pre + N[j] + post[k]; - if (!isTop || isSequence || expansion) - expansions.push(expansion); - } - } - - return expansions; -} - - - -/***/ }), - -/***/ "./node_modules/concat-map/index.js": +/*! no static exports found */function(e,t,n){var r=n(/*! concat-map */"./node_modules/concat-map/index.js"),i=n(/*! balanced-match */"./node_modules/balanced-match/index.js");e.exports=function(e){if(!e)return[];"{}"===e.substr(0,2)&&(e="\\{\\}"+e.substr(2));return function e(t,n){var o=[],s=i("{","}",t);if(!s||/\$$/.test(s.pre))return[t];var c,u=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(s.body),d=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(s.body),y=u||d,m=s.body.indexOf(",")>=0;if(!y&&!m)return s.post.match(/,.*\}/)?(t=s.pre+"{"+s.body+a+s.post,e(t)):[t];if(y)c=s.body.split(/\.\./);else{if(1===(c=function e(t){if(!t)return[""];var n=[],r=i("{","}",t);if(!r)return t.split(",");var o=r.pre,s=r.body,a=r.post,c=o.split(",");c[c.length-1]+="{"+s+"}";var u=e(a);a.length&&(c[c.length-1]+=u.shift(),c.push.apply(c,u));return n.push.apply(n,c),n}(s.body)).length)if(1===(c=e(c[0],!1).map(p)).length)return(b=s.post.length?e(s.post,!1):[""]).map((function(e){return s.pre+c[0]+e}))}var v,_=s.pre,b=s.post.length?e(s.post,!1):[""];if(y){var w=l(c[0]),S=l(c[1]),E=Math.max(c[0].length,c[1].length),j=3==c.length?Math.abs(l(c[2])):1,x=h;S0){var k=new Array(P+1).join("0");A=O<0?"-"+k+A.slice(1):k+A}}v.push(A)}}else v=r(c,(function(t){return e(t,!1)}));for(var C=0;C=t}},"./node_modules/concat-map/index.js": /*!******************************************!*\ !*** ./node_modules/concat-map/index.js ***! \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -module.exports = function (xs, fn) { - var res = []; - for (var i = 0; i < xs.length; i++) { - var x = fn(xs[i], i); - if (isArray(x)) res.push.apply(res, x); - else res.push(x); - } - return res; -}; - -var isArray = Array.isArray || function (xs) { - return Object.prototype.toString.call(xs) === '[object Array]'; -}; - - -/***/ }), - -/***/ "./node_modules/inversify/lib/annotation/decorator_utils.js": +/*! no static exports found */function(e,t){e.exports=function(e,t){for(var r=[],i=0;i= than the number of constructor arguments of its base class."); -}; -exports.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT = "Invalid Container constructor argument. Container options " + - "must be an object."; -exports.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE = "Invalid Container option. Default scope must " + - "be a string ('singleton' or 'transient')."; -exports.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE = "Invalid Container option. Auto bind injectable must " + - "be a boolean"; -exports.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK = "Invalid Container option. Skip base check must " + - "be a boolean"; -exports.MULTIPLE_POST_CONSTRUCT_METHODS = "Cannot apply @postConstruct decorator multiple times in the same class"; -exports.POST_CONSTRUCT_ERROR = function () { - var values = []; - for (var _i = 0; _i < arguments.length; _i++) { - values[_i] = arguments[_i]; - } - return "@postConstruct error in class " + values[0] + ": " + values[1]; -}; -exports.CIRCULAR_DEPENDENCY_IN_FACTORY = function () { - var values = []; - for (var _i = 0; _i < arguments.length; _i++) { - values[_i] = arguments[_i]; - } - return "It looks like there is a circular dependency " + - ("in one of the '" + values[0] + "' bindings. Please investigate bindings with") + - ("service identifier '" + values[1] + "'."); -}; -exports.STACK_OVERFLOW = "Maximum call stack size exceeded"; - - -/***/ }), - -/***/ "./node_modules/inversify/lib/constants/literal_types.js": +/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DUPLICATED_INJECTABLE_DECORATOR="Cannot apply @injectable decorator multiple times.",t.DUPLICATED_METADATA="Metadata key was used more than once in a parameter:",t.NULL_ARGUMENT="NULL argument",t.KEY_NOT_FOUND="Key Not Found",t.AMBIGUOUS_MATCH="Ambiguous match found for serviceIdentifier:",t.CANNOT_UNBIND="Could not unbind serviceIdentifier:",t.NOT_REGISTERED="No matching bindings found for serviceIdentifier:",t.MISSING_INJECTABLE_ANNOTATION="Missing required @injectable annotation in:",t.MISSING_INJECT_ANNOTATION="Missing required @inject or @multiInject annotation in:",t.UNDEFINED_INJECT_ANNOTATION=function(e){return"@inject called with undefined this could mean that the class "+e+" has a circular dependency problem. You can use a LazyServiceIdentifer to overcome this limitation."},t.CIRCULAR_DEPENDENCY="Circular dependency found:",t.NOT_IMPLEMENTED="Sorry, this feature is not fully implemented yet.",t.INVALID_BINDING_TYPE="Invalid binding type:",t.NO_MORE_SNAPSHOTS_AVAILABLE="No snapshot available to restore.",t.INVALID_MIDDLEWARE_RETURN="Invalid return type in middleware. Middleware must return!",t.INVALID_FUNCTION_BINDING="Value provided to function binding must be a function!",t.INVALID_TO_SELF_VALUE="The toSelf function can only be applied when a constructor is used as service identifier",t.INVALID_DECORATOR_OPERATION="The @inject @multiInject @tagged and @named decorators must be applied to the parameters of a class constructor or a class property.",t.ARGUMENTS_LENGTH_MISMATCH=function(){for(var e=[],t=0;t= than the number of constructor arguments of its base class."},t.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT="Invalid Container constructor argument. Container options must be an object.",t.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE="Invalid Container option. Default scope must be a string ('singleton' or 'transient').",t.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE="Invalid Container option. Auto bind injectable must be a boolean",t.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK="Invalid Container option. Skip base check must be a boolean",t.MULTIPLE_POST_CONSTRUCT_METHODS="Cannot apply @postConstruct decorator multiple times in the same class",t.POST_CONSTRUCT_ERROR=function(){for(var e=[],t=0;t 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 }; - } -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var binding_1 = __webpack_require__(/*! ../bindings/binding */ "./node_modules/inversify/lib/bindings/binding.js"); -var ERROR_MSGS = __webpack_require__(/*! ../constants/error_msgs */ "./node_modules/inversify/lib/constants/error_msgs.js"); -var literal_types_1 = __webpack_require__(/*! ../constants/literal_types */ "./node_modules/inversify/lib/constants/literal_types.js"); -var METADATA_KEY = __webpack_require__(/*! ../constants/metadata_keys */ "./node_modules/inversify/lib/constants/metadata_keys.js"); -var metadata_reader_1 = __webpack_require__(/*! ../planning/metadata_reader */ "./node_modules/inversify/lib/planning/metadata_reader.js"); -var planner_1 = __webpack_require__(/*! ../planning/planner */ "./node_modules/inversify/lib/planning/planner.js"); -var resolver_1 = __webpack_require__(/*! ../resolution/resolver */ "./node_modules/inversify/lib/resolution/resolver.js"); -var binding_to_syntax_1 = __webpack_require__(/*! ../syntax/binding_to_syntax */ "./node_modules/inversify/lib/syntax/binding_to_syntax.js"); -var id_1 = __webpack_require__(/*! ../utils/id */ "./node_modules/inversify/lib/utils/id.js"); -var serialization_1 = __webpack_require__(/*! ../utils/serialization */ "./node_modules/inversify/lib/utils/serialization.js"); -var container_snapshot_1 = __webpack_require__(/*! ./container_snapshot */ "./node_modules/inversify/lib/container/container_snapshot.js"); -var lookup_1 = __webpack_require__(/*! ./lookup */ "./node_modules/inversify/lib/container/lookup.js"); -var Container = (function () { - function Container(containerOptions) { - var options = containerOptions || {}; - if (typeof options !== "object") { - throw new Error("" + ERROR_MSGS.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT); - } - if (options.defaultScope === undefined) { - options.defaultScope = literal_types_1.BindingScopeEnum.Transient; - } - else if (options.defaultScope !== literal_types_1.BindingScopeEnum.Singleton && - options.defaultScope !== literal_types_1.BindingScopeEnum.Transient && - options.defaultScope !== literal_types_1.BindingScopeEnum.Request) { - throw new Error("" + ERROR_MSGS.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE); - } - if (options.autoBindInjectable === undefined) { - options.autoBindInjectable = false; - } - else if (typeof options.autoBindInjectable !== "boolean") { - throw new Error("" + ERROR_MSGS.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE); - } - if (options.skipBaseClassChecks === undefined) { - options.skipBaseClassChecks = false; - } - else if (typeof options.skipBaseClassChecks !== "boolean") { - throw new Error("" + ERROR_MSGS.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK); - } - this.options = { - autoBindInjectable: options.autoBindInjectable, - defaultScope: options.defaultScope, - skipBaseClassChecks: options.skipBaseClassChecks - }; - this.id = id_1.id(); - this._bindingDictionary = new lookup_1.Lookup(); - this._snapshots = []; - this._middleware = null; - this.parent = null; - this._metadataReader = new metadata_reader_1.MetadataReader(); - } - Container.merge = function (container1, container2) { - var container = new Container(); - var bindingDictionary = planner_1.getBindingDictionary(container); - var bindingDictionary1 = planner_1.getBindingDictionary(container1); - var bindingDictionary2 = planner_1.getBindingDictionary(container2); - function copyDictionary(origin, destination) { - origin.traverse(function (key, value) { - value.forEach(function (binding) { - destination.add(binding.serviceIdentifier, binding.clone()); - }); - }); - } - copyDictionary(bindingDictionary1, bindingDictionary); - copyDictionary(bindingDictionary2, bindingDictionary); - return container; - }; - Container.prototype.load = function () { - var modules = []; - for (var _i = 0; _i < arguments.length; _i++) { - modules[_i] = arguments[_i]; - } - var getHelpers = this._getContainerModuleHelpersFactory(); - for (var _a = 0, modules_1 = modules; _a < modules_1.length; _a++) { - var currentModule = modules_1[_a]; - var containerModuleHelpers = getHelpers(currentModule.id); - currentModule.registry(containerModuleHelpers.bindFunction, containerModuleHelpers.unbindFunction, containerModuleHelpers.isboundFunction, containerModuleHelpers.rebindFunction); - } - }; - Container.prototype.loadAsync = function () { - var modules = []; - for (var _i = 0; _i < arguments.length; _i++) { - modules[_i] = arguments[_i]; - } - return __awaiter(this, void 0, void 0, function () { - var getHelpers, _a, modules_2, currentModule, containerModuleHelpers; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - getHelpers = this._getContainerModuleHelpersFactory(); - _a = 0, modules_2 = modules; - _b.label = 1; - case 1: - if (!(_a < modules_2.length)) return [3, 4]; - currentModule = modules_2[_a]; - containerModuleHelpers = getHelpers(currentModule.id); - return [4, currentModule.registry(containerModuleHelpers.bindFunction, containerModuleHelpers.unbindFunction, containerModuleHelpers.isboundFunction, containerModuleHelpers.rebindFunction)]; - case 2: - _b.sent(); - _b.label = 3; - case 3: - _a++; - return [3, 1]; - case 4: return [2]; - } - }); - }); - }; - Container.prototype.unload = function () { - var _this = this; - var modules = []; - for (var _i = 0; _i < arguments.length; _i++) { - modules[_i] = arguments[_i]; - } - var conditionFactory = function (expected) { return function (item) { - return item.moduleId === expected; - }; }; - modules.forEach(function (module) { - var condition = conditionFactory(module.id); - _this._bindingDictionary.removeByCondition(condition); - }); - }; - Container.prototype.bind = function (serviceIdentifier) { - var scope = this.options.defaultScope || literal_types_1.BindingScopeEnum.Transient; - var binding = new binding_1.Binding(serviceIdentifier, scope); - this._bindingDictionary.add(serviceIdentifier, binding); - return new binding_to_syntax_1.BindingToSyntax(binding); - }; - Container.prototype.rebind = function (serviceIdentifier) { - this.unbind(serviceIdentifier); - return this.bind(serviceIdentifier); - }; - Container.prototype.unbind = function (serviceIdentifier) { - try { - this._bindingDictionary.remove(serviceIdentifier); - } - catch (e) { - throw new Error(ERROR_MSGS.CANNOT_UNBIND + " " + serialization_1.getServiceIdentifierAsString(serviceIdentifier)); - } - }; - Container.prototype.unbindAll = function () { - this._bindingDictionary = new lookup_1.Lookup(); - }; - Container.prototype.isBound = function (serviceIdentifier) { - var bound = this._bindingDictionary.hasKey(serviceIdentifier); - if (!bound && this.parent) { - bound = this.parent.isBound(serviceIdentifier); - } - return bound; - }; - Container.prototype.isBoundNamed = function (serviceIdentifier, named) { - return this.isBoundTagged(serviceIdentifier, METADATA_KEY.NAMED_TAG, named); - }; - Container.prototype.isBoundTagged = function (serviceIdentifier, key, value) { - var bound = false; - if (this._bindingDictionary.hasKey(serviceIdentifier)) { - var bindings = this._bindingDictionary.get(serviceIdentifier); - var request_1 = planner_1.createMockRequest(this, serviceIdentifier, key, value); - bound = bindings.some(function (b) { return b.constraint(request_1); }); - } - if (!bound && this.parent) { - bound = this.parent.isBoundTagged(serviceIdentifier, key, value); - } - return bound; - }; - Container.prototype.snapshot = function () { - this._snapshots.push(container_snapshot_1.ContainerSnapshot.of(this._bindingDictionary.clone(), this._middleware)); - }; - Container.prototype.restore = function () { - var snapshot = this._snapshots.pop(); - if (snapshot === undefined) { - throw new Error(ERROR_MSGS.NO_MORE_SNAPSHOTS_AVAILABLE); - } - this._bindingDictionary = snapshot.bindings; - this._middleware = snapshot.middleware; - }; - Container.prototype.createChild = function (containerOptions) { - var child = new Container(containerOptions || this.options); - child.parent = this; - return child; - }; - Container.prototype.applyMiddleware = function () { - var middlewares = []; - for (var _i = 0; _i < arguments.length; _i++) { - middlewares[_i] = arguments[_i]; - } - var initial = (this._middleware) ? this._middleware : this._planAndResolve(); - this._middleware = middlewares.reduce(function (prev, curr) { return curr(prev); }, initial); - }; - Container.prototype.applyCustomMetadataReader = function (metadataReader) { - this._metadataReader = metadataReader; - }; - Container.prototype.get = function (serviceIdentifier) { - return this._get(false, false, literal_types_1.TargetTypeEnum.Variable, serviceIdentifier); - }; - Container.prototype.getTagged = function (serviceIdentifier, key, value) { - return this._get(false, false, literal_types_1.TargetTypeEnum.Variable, serviceIdentifier, key, value); - }; - Container.prototype.getNamed = function (serviceIdentifier, named) { - return this.getTagged(serviceIdentifier, METADATA_KEY.NAMED_TAG, named); - }; - Container.prototype.getAll = function (serviceIdentifier) { - return this._get(true, true, literal_types_1.TargetTypeEnum.Variable, serviceIdentifier); - }; - Container.prototype.getAllTagged = function (serviceIdentifier, key, value) { - return this._get(false, true, literal_types_1.TargetTypeEnum.Variable, serviceIdentifier, key, value); - }; - Container.prototype.getAllNamed = function (serviceIdentifier, named) { - return this.getAllTagged(serviceIdentifier, METADATA_KEY.NAMED_TAG, named); - }; - Container.prototype.resolve = function (constructorFunction) { - var tempContainer = this.createChild(); - tempContainer.bind(constructorFunction).toSelf(); - return tempContainer.get(constructorFunction); - }; - Container.prototype._getContainerModuleHelpersFactory = function () { - var _this = this; - var setModuleId = function (bindingToSyntax, moduleId) { - bindingToSyntax._binding.moduleId = moduleId; - }; - var getBindFunction = function (moduleId) { - return function (serviceIdentifier) { - var _bind = _this.bind.bind(_this); - var bindingToSyntax = _bind(serviceIdentifier); - setModuleId(bindingToSyntax, moduleId); - return bindingToSyntax; - }; - }; - var getUnbindFunction = function (moduleId) { - return function (serviceIdentifier) { - var _unbind = _this.unbind.bind(_this); - _unbind(serviceIdentifier); - }; - }; - var getIsboundFunction = function (moduleId) { - return function (serviceIdentifier) { - var _isBound = _this.isBound.bind(_this); - return _isBound(serviceIdentifier); - }; - }; - var getRebindFunction = function (moduleId) { - return function (serviceIdentifier) { - var _rebind = _this.rebind.bind(_this); - var bindingToSyntax = _rebind(serviceIdentifier); - setModuleId(bindingToSyntax, moduleId); - return bindingToSyntax; - }; - }; - return function (mId) { return ({ - bindFunction: getBindFunction(mId), - isboundFunction: getIsboundFunction(mId), - rebindFunction: getRebindFunction(mId), - unbindFunction: getUnbindFunction(mId) - }); }; - }; - Container.prototype._get = function (avoidConstraints, isMultiInject, targetType, serviceIdentifier, key, value) { - var result = null; - var defaultArgs = { - avoidConstraints: avoidConstraints, - contextInterceptor: function (context) { return context; }, - isMultiInject: isMultiInject, - key: key, - serviceIdentifier: serviceIdentifier, - targetType: targetType, - value: value - }; - if (this._middleware) { - result = this._middleware(defaultArgs); - if (result === undefined || result === null) { - throw new Error(ERROR_MSGS.INVALID_MIDDLEWARE_RETURN); - } - } - else { - result = this._planAndResolve()(defaultArgs); - } - return result; - }; - Container.prototype._planAndResolve = function () { - var _this = this; - return function (args) { - var context = planner_1.plan(_this._metadataReader, _this, args.isMultiInject, args.targetType, args.serviceIdentifier, args.key, args.value, args.avoidConstraints); - context = args.contextInterceptor(context); - var result = resolver_1.resolve(context); - return result; - }; - }; - return Container; -}()); -exports.Container = Container; - - -/***/ }), - -/***/ "./node_modules/inversify/lib/container/container_module.js": +/*! no static exports found */function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){e.done?i(e.value):new n((function(t){t(e.value)})).then(s,a)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=r[2&o[0]?"return":o[0]?"throw":"next"])&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[0,i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1] 0) { - _this._map.set(key, updatedEntries); - } - else { - _this._map.delete(key); - } - }); - }; - Lookup.prototype.hasKey = function (serviceIdentifier) { - if (serviceIdentifier === null || serviceIdentifier === undefined) { - throw new Error(ERROR_MSGS.NULL_ARGUMENT); - } - return this._map.has(serviceIdentifier); - }; - Lookup.prototype.clone = function () { - var copy = new Lookup(); - this._map.forEach(function (value, key) { - value.forEach(function (b) { return copy.add(key, b.clone()); }); - }); - return copy; - }; - Lookup.prototype.traverse = function (func) { - this._map.forEach(function (value, key) { - func(key, value); - }); - }; - return Lookup; -}()); -exports.Lookup = Lookup; - - -/***/ }), - -/***/ "./node_modules/inversify/lib/inversify.js": +/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(/*! ../constants/error_msgs */"./node_modules/inversify/lib/constants/error_msgs.js"),i=function(){function e(){this._map=new Map}return e.prototype.getMap=function(){return this._map},e.prototype.add=function(e,t){if(null==e)throw new Error(r.NULL_ARGUMENT);if(null==t)throw new Error(r.NULL_ARGUMENT);var n=this._map.get(e);void 0!==n?(n.push(t),this._map.set(e,n)):this._map.set(e,[t])},e.prototype.get=function(e){if(null==e)throw new Error(r.NULL_ARGUMENT);var t=this._map.get(e);if(void 0!==t)return t;throw new Error(r.KEY_NOT_FOUND)},e.prototype.remove=function(e){if(null==e)throw new Error(r.NULL_ARGUMENT);if(!this._map.delete(e))throw new Error(r.KEY_NOT_FOUND)},e.prototype.removeByCondition=function(e){var t=this;this._map.forEach((function(n,r){var i=n.filter((function(t){return!e(t)}));i.length>0?t._map.set(r,i):t._map.delete(r)}))},e.prototype.hasKey=function(e){if(null==e)throw new Error(r.NULL_ARGUMENT);return this._map.has(e)},e.prototype.clone=function(){var t=new e;return this._map.forEach((function(e,n){e.forEach((function(e){return t.add(n,e.clone())}))})),t},e.prototype.traverse=function(e){this._map.forEach((function(t,n){e(n,t)}))},e}();t.Lookup=i},"./node_modules/inversify/lib/inversify.js": /*!*************************************************!*\ !*** ./node_modules/inversify/lib/inversify.js ***! \*************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -var keys = __webpack_require__(/*! ./constants/metadata_keys */ "./node_modules/inversify/lib/constants/metadata_keys.js"); -exports.METADATA_KEY = keys; -var container_1 = __webpack_require__(/*! ./container/container */ "./node_modules/inversify/lib/container/container.js"); -exports.Container = container_1.Container; -var literal_types_1 = __webpack_require__(/*! ./constants/literal_types */ "./node_modules/inversify/lib/constants/literal_types.js"); -exports.BindingScopeEnum = literal_types_1.BindingScopeEnum; -exports.BindingTypeEnum = literal_types_1.BindingTypeEnum; -exports.TargetTypeEnum = literal_types_1.TargetTypeEnum; -var container_module_1 = __webpack_require__(/*! ./container/container_module */ "./node_modules/inversify/lib/container/container_module.js"); -exports.AsyncContainerModule = container_module_1.AsyncContainerModule; -exports.ContainerModule = container_module_1.ContainerModule; -var injectable_1 = __webpack_require__(/*! ./annotation/injectable */ "./node_modules/inversify/lib/annotation/injectable.js"); -exports.injectable = injectable_1.injectable; -var tagged_1 = __webpack_require__(/*! ./annotation/tagged */ "./node_modules/inversify/lib/annotation/tagged.js"); -exports.tagged = tagged_1.tagged; -var named_1 = __webpack_require__(/*! ./annotation/named */ "./node_modules/inversify/lib/annotation/named.js"); -exports.named = named_1.named; -var inject_1 = __webpack_require__(/*! ./annotation/inject */ "./node_modules/inversify/lib/annotation/inject.js"); -exports.inject = inject_1.inject; -exports.LazyServiceIdentifer = inject_1.LazyServiceIdentifer; -var optional_1 = __webpack_require__(/*! ./annotation/optional */ "./node_modules/inversify/lib/annotation/optional.js"); -exports.optional = optional_1.optional; -var unmanaged_1 = __webpack_require__(/*! ./annotation/unmanaged */ "./node_modules/inversify/lib/annotation/unmanaged.js"); -exports.unmanaged = unmanaged_1.unmanaged; -var multi_inject_1 = __webpack_require__(/*! ./annotation/multi_inject */ "./node_modules/inversify/lib/annotation/multi_inject.js"); -exports.multiInject = multi_inject_1.multiInject; -var target_name_1 = __webpack_require__(/*! ./annotation/target_name */ "./node_modules/inversify/lib/annotation/target_name.js"); -exports.targetName = target_name_1.targetName; -var post_construct_1 = __webpack_require__(/*! ./annotation/post_construct */ "./node_modules/inversify/lib/annotation/post_construct.js"); -exports.postConstruct = post_construct_1.postConstruct; -var metadata_reader_1 = __webpack_require__(/*! ./planning/metadata_reader */ "./node_modules/inversify/lib/planning/metadata_reader.js"); -exports.MetadataReader = metadata_reader_1.MetadataReader; -var id_1 = __webpack_require__(/*! ./utils/id */ "./node_modules/inversify/lib/utils/id.js"); -exports.id = id_1.id; -var decorator_utils_1 = __webpack_require__(/*! ./annotation/decorator_utils */ "./node_modules/inversify/lib/annotation/decorator_utils.js"); -exports.decorate = decorator_utils_1.decorate; -var constraint_helpers_1 = __webpack_require__(/*! ./syntax/constraint_helpers */ "./node_modules/inversify/lib/syntax/constraint_helpers.js"); -exports.traverseAncerstors = constraint_helpers_1.traverseAncerstors; -exports.taggedConstraint = constraint_helpers_1.taggedConstraint; -exports.namedConstraint = constraint_helpers_1.namedConstraint; -exports.typeConstraint = constraint_helpers_1.typeConstraint; -var serialization_1 = __webpack_require__(/*! ./utils/serialization */ "./node_modules/inversify/lib/utils/serialization.js"); -exports.getServiceIdentifierAsString = serialization_1.getServiceIdentifierAsString; -var binding_utils_1 = __webpack_require__(/*! ./utils/binding_utils */ "./node_modules/inversify/lib/utils/binding_utils.js"); -exports.multiBindToService = binding_utils_1.multiBindToService; - - -/***/ }), - -/***/ "./node_modules/inversify/lib/planning/context.js": +/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(/*! ./constants/metadata_keys */"./node_modules/inversify/lib/constants/metadata_keys.js");t.METADATA_KEY=r;var i=n(/*! ./container/container */"./node_modules/inversify/lib/container/container.js");t.Container=i.Container;var o=n(/*! ./constants/literal_types */"./node_modules/inversify/lib/constants/literal_types.js");t.BindingScopeEnum=o.BindingScopeEnum,t.BindingTypeEnum=o.BindingTypeEnum,t.TargetTypeEnum=o.TargetTypeEnum;var s=n(/*! ./container/container_module */"./node_modules/inversify/lib/container/container_module.js");t.AsyncContainerModule=s.AsyncContainerModule,t.ContainerModule=s.ContainerModule;var a=n(/*! ./annotation/injectable */"./node_modules/inversify/lib/annotation/injectable.js");t.injectable=a.injectable;var c=n(/*! ./annotation/tagged */"./node_modules/inversify/lib/annotation/tagged.js");t.tagged=c.tagged;var u=n(/*! ./annotation/named */"./node_modules/inversify/lib/annotation/named.js");t.named=u.named;var l=n(/*! ./annotation/inject */"./node_modules/inversify/lib/annotation/inject.js");t.inject=l.inject,t.LazyServiceIdentifer=l.LazyServiceIdentifer;var d=n(/*! ./annotation/optional */"./node_modules/inversify/lib/annotation/optional.js");t.optional=d.optional;var p=n(/*! ./annotation/unmanaged */"./node_modules/inversify/lib/annotation/unmanaged.js");t.unmanaged=p.unmanaged;var f=n(/*! ./annotation/multi_inject */"./node_modules/inversify/lib/annotation/multi_inject.js");t.multiInject=f.multiInject;var h=n(/*! ./annotation/target_name */"./node_modules/inversify/lib/annotation/target_name.js");t.targetName=h.targetName;var g=n(/*! ./annotation/post_construct */"./node_modules/inversify/lib/annotation/post_construct.js");t.postConstruct=g.postConstruct;var y=n(/*! ./planning/metadata_reader */"./node_modules/inversify/lib/planning/metadata_reader.js");t.MetadataReader=y.MetadataReader;var m=n(/*! ./utils/id */"./node_modules/inversify/lib/utils/id.js");t.id=m.id;var v=n(/*! ./annotation/decorator_utils */"./node_modules/inversify/lib/annotation/decorator_utils.js");t.decorate=v.decorate;var _=n(/*! ./syntax/constraint_helpers */"./node_modules/inversify/lib/syntax/constraint_helpers.js");t.traverseAncerstors=_.traverseAncerstors,t.taggedConstraint=_.taggedConstraint,t.namedConstraint=_.namedConstraint,t.typeConstraint=_.typeConstraint;var b=n(/*! ./utils/serialization */"./node_modules/inversify/lib/utils/serialization.js");t.getServiceIdentifierAsString=b.getServiceIdentifierAsString;var w=n(/*! ./utils/binding_utils */"./node_modules/inversify/lib/utils/binding_utils.js");t.multiBindToService=w.multiBindToService},"./node_modules/inversify/lib/planning/context.js": /*!********************************************************!*\ !*** ./node_modules/inversify/lib/planning/context.js ***! \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -var id_1 = __webpack_require__(/*! ../utils/id */ "./node_modules/inversify/lib/utils/id.js"); -var Context = (function () { - function Context(container) { - this.id = id_1.id(); - this.container = container; - } - Context.prototype.addPlan = function (plan) { - this.plan = plan; - }; - Context.prototype.setCurrentRequest = function (currentRequest) { - this.currentRequest = currentRequest; - }; - return Context; -}()); -exports.Context = Context; - - -/***/ }), - -/***/ "./node_modules/inversify/lib/planning/metadata.js": +/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(/*! ../utils/id */"./node_modules/inversify/lib/utils/id.js"),i=function(){function e(e){this.id=r.id(),this.container=e}return e.prototype.addPlan=function(e){this.plan=e},e.prototype.setCurrentRequest=function(e){this.currentRequest=e},e}();t.Context=i},"./node_modules/inversify/lib/planning/metadata.js": /*!*********************************************************!*\ !*** ./node_modules/inversify/lib/planning/metadata.js ***! \*********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -var METADATA_KEY = __webpack_require__(/*! ../constants/metadata_keys */ "./node_modules/inversify/lib/constants/metadata_keys.js"); -var Metadata = (function () { - function Metadata(key, value) { - this.key = key; - this.value = value; - } - Metadata.prototype.toString = function () { - if (this.key === METADATA_KEY.NAMED_TAG) { - return "named: " + this.value.toString() + " "; - } - else { - return "tagged: { key:" + this.key.toString() + ", value: " + this.value + " }"; - } - }; - return Metadata; -}()); -exports.Metadata = Metadata; - - -/***/ }), - -/***/ "./node_modules/inversify/lib/planning/metadata_reader.js": +/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(/*! ../constants/metadata_keys */"./node_modules/inversify/lib/constants/metadata_keys.js"),i=function(){function e(e,t){this.key=e,this.value=t}return e.prototype.toString=function(){return this.key===r.NAMED_TAG?"named: "+this.value.toString()+" ":"tagged: { key:"+this.key.toString()+", value: "+this.value+" }"},e}();t.Metadata=i},"./node_modules/inversify/lib/planning/metadata_reader.js": /*!****************************************************************!*\ !*** ./node_modules/inversify/lib/planning/metadata_reader.js ***! \****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -var METADATA_KEY = __webpack_require__(/*! ../constants/metadata_keys */ "./node_modules/inversify/lib/constants/metadata_keys.js"); -var MetadataReader = (function () { - function MetadataReader() { - } - MetadataReader.prototype.getConstructorMetadata = function (constructorFunc) { - var compilerGeneratedMetadata = Reflect.getMetadata(METADATA_KEY.PARAM_TYPES, constructorFunc); - var userGeneratedMetadata = Reflect.getMetadata(METADATA_KEY.TAGGED, constructorFunc); - return { - compilerGeneratedMetadata: compilerGeneratedMetadata, - userGeneratedMetadata: userGeneratedMetadata || {} - }; - }; - MetadataReader.prototype.getPropertiesMetadata = function (constructorFunc) { - var userGeneratedMetadata = Reflect.getMetadata(METADATA_KEY.TAGGED_PROP, constructorFunc) || []; - return userGeneratedMetadata; - }; - return MetadataReader; -}()); -exports.MetadataReader = MetadataReader; - - -/***/ }), - -/***/ "./node_modules/inversify/lib/planning/plan.js": +/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(/*! ../constants/metadata_keys */"./node_modules/inversify/lib/constants/metadata_keys.js"),i=function(){function e(){}return e.prototype.getConstructorMetadata=function(e){return{compilerGeneratedMetadata:Reflect.getMetadata(r.PARAM_TYPES,e),userGeneratedMetadata:Reflect.getMetadata(r.TAGGED,e)||{}}},e.prototype.getPropertiesMetadata=function(e){return Reflect.getMetadata(r.TAGGED_PROP,e)||[]},e}();t.MetadataReader=i},"./node_modules/inversify/lib/planning/plan.js": /*!*****************************************************!*\ !*** ./node_modules/inversify/lib/planning/plan.js ***! \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -var Plan = (function () { - function Plan(parentContext, rootRequest) { - this.parentContext = parentContext; - this.rootRequest = rootRequest; - } - return Plan; -}()); -exports.Plan = Plan; - - -/***/ }), - -/***/ "./node_modules/inversify/lib/planning/planner.js": +/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e,t){this.parentContext=e,this.rootRequest=t};t.Plan=r},"./node_modules/inversify/lib/planning/planner.js": /*!********************************************************!*\ !*** ./node_modules/inversify/lib/planning/planner.js ***! \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -var binding_count_1 = __webpack_require__(/*! ../bindings/binding_count */ "./node_modules/inversify/lib/bindings/binding_count.js"); -var ERROR_MSGS = __webpack_require__(/*! ../constants/error_msgs */ "./node_modules/inversify/lib/constants/error_msgs.js"); -var literal_types_1 = __webpack_require__(/*! ../constants/literal_types */ "./node_modules/inversify/lib/constants/literal_types.js"); -var METADATA_KEY = __webpack_require__(/*! ../constants/metadata_keys */ "./node_modules/inversify/lib/constants/metadata_keys.js"); -var exceptions_1 = __webpack_require__(/*! ../utils/exceptions */ "./node_modules/inversify/lib/utils/exceptions.js"); -var serialization_1 = __webpack_require__(/*! ../utils/serialization */ "./node_modules/inversify/lib/utils/serialization.js"); -var context_1 = __webpack_require__(/*! ./context */ "./node_modules/inversify/lib/planning/context.js"); -var metadata_1 = __webpack_require__(/*! ./metadata */ "./node_modules/inversify/lib/planning/metadata.js"); -var plan_1 = __webpack_require__(/*! ./plan */ "./node_modules/inversify/lib/planning/plan.js"); -var reflection_utils_1 = __webpack_require__(/*! ./reflection_utils */ "./node_modules/inversify/lib/planning/reflection_utils.js"); -var request_1 = __webpack_require__(/*! ./request */ "./node_modules/inversify/lib/planning/request.js"); -var target_1 = __webpack_require__(/*! ./target */ "./node_modules/inversify/lib/planning/target.js"); -function getBindingDictionary(cntnr) { - return cntnr._bindingDictionary; -} -exports.getBindingDictionary = getBindingDictionary; -function _createTarget(isMultiInject, targetType, serviceIdentifier, name, key, value) { - var metadataKey = isMultiInject ? METADATA_KEY.MULTI_INJECT_TAG : METADATA_KEY.INJECT_TAG; - var injectMetadata = new metadata_1.Metadata(metadataKey, serviceIdentifier); - var target = new target_1.Target(targetType, name, serviceIdentifier, injectMetadata); - if (key !== undefined) { - var tagMetadata = new metadata_1.Metadata(key, value); - target.metadata.push(tagMetadata); - } - return target; -} -function _getActiveBindings(metadataReader, avoidConstraints, context, parentRequest, target) { - var bindings = getBindings(context.container, target.serviceIdentifier); - var activeBindings = []; - if (bindings.length === binding_count_1.BindingCount.NoBindingsAvailable && - context.container.options.autoBindInjectable && - typeof target.serviceIdentifier === "function" && - metadataReader.getConstructorMetadata(target.serviceIdentifier).compilerGeneratedMetadata) { - context.container.bind(target.serviceIdentifier).toSelf(); - bindings = getBindings(context.container, target.serviceIdentifier); - } - if (!avoidConstraints) { - activeBindings = bindings.filter(function (binding) { - var request = new request_1.Request(binding.serviceIdentifier, context, parentRequest, binding, target); - return binding.constraint(request); - }); - } - else { - activeBindings = bindings; - } - _validateActiveBindingCount(target.serviceIdentifier, activeBindings, target, context.container); - return activeBindings; -} -function _validateActiveBindingCount(serviceIdentifier, bindings, target, container) { - switch (bindings.length) { - case binding_count_1.BindingCount.NoBindingsAvailable: - if (target.isOptional()) { - return bindings; - } - else { - var serviceIdentifierString = serialization_1.getServiceIdentifierAsString(serviceIdentifier); - var msg = ERROR_MSGS.NOT_REGISTERED; - msg += serialization_1.listMetadataForTarget(serviceIdentifierString, target); - msg += serialization_1.listRegisteredBindingsForServiceIdentifier(container, serviceIdentifierString, getBindings); - throw new Error(msg); - } - case binding_count_1.BindingCount.OnlyOneBindingAvailable: - if (!target.isArray()) { - return bindings; - } - case binding_count_1.BindingCount.MultipleBindingsAvailable: - default: - if (!target.isArray()) { - var serviceIdentifierString = serialization_1.getServiceIdentifierAsString(serviceIdentifier); - var msg = ERROR_MSGS.AMBIGUOUS_MATCH + " " + serviceIdentifierString; - msg += serialization_1.listRegisteredBindingsForServiceIdentifier(container, serviceIdentifierString, getBindings); - throw new Error(msg); - } - else { - return bindings; - } - } -} -function _createSubRequests(metadataReader, avoidConstraints, serviceIdentifier, context, parentRequest, target) { - var activeBindings; - var childRequest; - if (parentRequest === null) { - activeBindings = _getActiveBindings(metadataReader, avoidConstraints, context, null, target); - childRequest = new request_1.Request(serviceIdentifier, context, null, activeBindings, target); - var thePlan = new plan_1.Plan(context, childRequest); - context.addPlan(thePlan); - } - else { - activeBindings = _getActiveBindings(metadataReader, avoidConstraints, context, parentRequest, target); - childRequest = parentRequest.addChildRequest(target.serviceIdentifier, activeBindings, target); - } - activeBindings.forEach(function (binding) { - var subChildRequest = null; - if (target.isArray()) { - subChildRequest = childRequest.addChildRequest(binding.serviceIdentifier, binding, target); - } - else { - if (binding.cache) { - return; - } - subChildRequest = childRequest; - } - if (binding.type === literal_types_1.BindingTypeEnum.Instance && binding.implementationType !== null) { - var dependencies = reflection_utils_1.getDependencies(metadataReader, binding.implementationType); - if (!context.container.options.skipBaseClassChecks) { - var baseClassDependencyCount = reflection_utils_1.getBaseClassDependencyCount(metadataReader, binding.implementationType); - if (dependencies.length < baseClassDependencyCount) { - var error = ERROR_MSGS.ARGUMENTS_LENGTH_MISMATCH(reflection_utils_1.getFunctionName(binding.implementationType)); - throw new Error(error); - } - } - dependencies.forEach(function (dependency) { - _createSubRequests(metadataReader, false, dependency.serviceIdentifier, context, subChildRequest, dependency); - }); - } - }); -} -function getBindings(container, serviceIdentifier) { - var bindings = []; - var bindingDictionary = getBindingDictionary(container); - if (bindingDictionary.hasKey(serviceIdentifier)) { - bindings = bindingDictionary.get(serviceIdentifier); - } - else if (container.parent !== null) { - bindings = getBindings(container.parent, serviceIdentifier); - } - return bindings; -} -function plan(metadataReader, container, isMultiInject, targetType, serviceIdentifier, key, value, avoidConstraints) { - if (avoidConstraints === void 0) { avoidConstraints = false; } - var context = new context_1.Context(container); - var target = _createTarget(isMultiInject, targetType, serviceIdentifier, "", key, value); - try { - _createSubRequests(metadataReader, avoidConstraints, serviceIdentifier, context, null, target); - return context; - } - catch (error) { - if (exceptions_1.isStackOverflowExeption(error)) { - if (context.plan) { - serialization_1.circularDependencyToException(context.plan.rootRequest); - } - } - throw error; - } -} -exports.plan = plan; -function createMockRequest(container, serviceIdentifier, key, value) { - var target = new target_1.Target(literal_types_1.TargetTypeEnum.Variable, "", serviceIdentifier, new metadata_1.Metadata(key, value)); - var context = new context_1.Context(container); - var request = new request_1.Request(serviceIdentifier, context, null, [], target); - return request; -} -exports.createMockRequest = createMockRequest; - - -/***/ }), - -/***/ "./node_modules/inversify/lib/planning/queryable_string.js": +/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(/*! ../bindings/binding_count */"./node_modules/inversify/lib/bindings/binding_count.js"),i=n(/*! ../constants/error_msgs */"./node_modules/inversify/lib/constants/error_msgs.js"),o=n(/*! ../constants/literal_types */"./node_modules/inversify/lib/constants/literal_types.js"),s=n(/*! ../constants/metadata_keys */"./node_modules/inversify/lib/constants/metadata_keys.js"),a=n(/*! ../utils/exceptions */"./node_modules/inversify/lib/utils/exceptions.js"),c=n(/*! ../utils/serialization */"./node_modules/inversify/lib/utils/serialization.js"),u=n(/*! ./context */"./node_modules/inversify/lib/planning/context.js"),l=n(/*! ./metadata */"./node_modules/inversify/lib/planning/metadata.js"),d=n(/*! ./plan */"./node_modules/inversify/lib/planning/plan.js"),p=n(/*! ./reflection_utils */"./node_modules/inversify/lib/planning/reflection_utils.js"),f=n(/*! ./request */"./node_modules/inversify/lib/planning/request.js"),h=n(/*! ./target */"./node_modules/inversify/lib/planning/target.js");function g(e){return e._bindingDictionary}function y(e,t,n,o,s){var a=m(n.container,s.serviceIdentifier),u=[];return a.length===r.BindingCount.NoBindingsAvailable&&n.container.options.autoBindInjectable&&"function"==typeof s.serviceIdentifier&&e.getConstructorMetadata(s.serviceIdentifier).compilerGeneratedMetadata&&(n.container.bind(s.serviceIdentifier).toSelf(),a=m(n.container,s.serviceIdentifier)),u=t?a:a.filter((function(e){var t=new f.Request(e.serviceIdentifier,n,o,e,s);return e.constraint(t)})),function(e,t,n,o){switch(t.length){case r.BindingCount.NoBindingsAvailable:if(n.isOptional())return t;var s=c.getServiceIdentifierAsString(e),a=i.NOT_REGISTERED;throw a+=c.listMetadataForTarget(s,n),a+=c.listRegisteredBindingsForServiceIdentifier(o,s,m),new Error(a);case r.BindingCount.OnlyOneBindingAvailable:if(!n.isArray())return t;case r.BindingCount.MultipleBindingsAvailable:default:if(n.isArray())return t;s=c.getServiceIdentifierAsString(e),a=i.AMBIGUOUS_MATCH+" "+s;throw a+=c.listRegisteredBindingsForServiceIdentifier(o,s,m),new Error(a)}}(s.serviceIdentifier,u,s,n.container),u}function m(e,t){var n=[],r=g(e);return r.hasKey(t)?n=r.get(t):null!==e.parent&&(n=m(e.parent,t)),n}t.getBindingDictionary=g,t.plan=function(e,t,n,r,g,m,v,_){void 0===_&&(_=!1);var b=new u.Context(t),w=function(e,t,n,r,i,o){var a=e?s.MULTI_INJECT_TAG:s.INJECT_TAG,c=new l.Metadata(a,n),u=new h.Target(t,r,n,c);if(void 0!==i){var d=new l.Metadata(i,o);u.metadata.push(d)}return u}(n,r,g,"",m,v);try{return function e(t,n,r,s,a,c){var u,l;if(null===a){u=y(t,n,s,null,c),l=new f.Request(r,s,null,u,c);var h=new d.Plan(s,l);s.addPlan(h)}else u=y(t,n,s,a,c),l=a.addChildRequest(c.serviceIdentifier,u,c);u.forEach((function(n){var r=null;if(c.isArray())r=l.addChildRequest(n.serviceIdentifier,n,c);else{if(n.cache)return;r=l}if(n.type===o.BindingTypeEnum.Instance&&null!==n.implementationType){var a=p.getDependencies(t,n.implementationType);if(!s.container.options.skipBaseClassChecks){var u=p.getBaseClassDependencyCount(t,n.implementationType);if(a.length 0); - var iterations = (hasUserDeclaredUnknownInjections) ? keys.length : func.length; - var constructorTargets = getConstructorArgsAsTargets(isBaseClass, constructorName, serviceIdentifiers, constructorArgsMetadata, iterations); - var propertyTargets = getClassPropsAsTargets(metadataReader, func); - var targets = constructorTargets.concat(propertyTargets); - return targets; -} -function getConstructorArgsAsTarget(index, isBaseClass, constructorName, serviceIdentifiers, constructorArgsMetadata) { - var targetMetadata = constructorArgsMetadata[index.toString()] || []; - var metadata = formatTargetMetadata(targetMetadata); - var isManaged = metadata.unmanaged !== true; - var serviceIdentifier = serviceIdentifiers[index]; - var injectIdentifier = (metadata.inject || metadata.multiInject); - serviceIdentifier = (injectIdentifier) ? (injectIdentifier) : serviceIdentifier; - if (serviceIdentifier instanceof inject_1.LazyServiceIdentifer) { - serviceIdentifier = serviceIdentifier.unwrap(); - } - if (isManaged) { - var isObject = serviceIdentifier === Object; - var isFunction = serviceIdentifier === Function; - var isUndefined = serviceIdentifier === undefined; - var isUnknownType = (isObject || isFunction || isUndefined); - if (!isBaseClass && isUnknownType) { - var msg = ERROR_MSGS.MISSING_INJECT_ANNOTATION + " argument " + index + " in class " + constructorName + "."; - throw new Error(msg); - } - var target = new target_1.Target(literal_types_1.TargetTypeEnum.ConstructorArgument, metadata.targetName, serviceIdentifier); - target.metadata = targetMetadata; - return target; - } - return null; -} -function getConstructorArgsAsTargets(isBaseClass, constructorName, serviceIdentifiers, constructorArgsMetadata, iterations) { - var targets = []; - for (var i = 0; i < iterations; i++) { - var index = i; - var target = getConstructorArgsAsTarget(index, isBaseClass, constructorName, serviceIdentifiers, constructorArgsMetadata); - if (target !== null) { - targets.push(target); - } - } - return targets; -} -function getClassPropsAsTargets(metadataReader, constructorFunc) { - var classPropsMetadata = metadataReader.getPropertiesMetadata(constructorFunc); - var targets = []; - var keys = Object.keys(classPropsMetadata); - for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) { - var key = keys_1[_i]; - var targetMetadata = classPropsMetadata[key]; - var metadata = formatTargetMetadata(classPropsMetadata[key]); - var targetName = metadata.targetName || key; - var serviceIdentifier = (metadata.inject || metadata.multiInject); - var target = new target_1.Target(literal_types_1.TargetTypeEnum.ClassProperty, targetName, serviceIdentifier); - target.metadata = targetMetadata; - targets.push(target); - } - var baseConstructor = Object.getPrototypeOf(constructorFunc.prototype).constructor; - if (baseConstructor !== Object) { - var baseTargets = getClassPropsAsTargets(metadataReader, baseConstructor); - targets = targets.concat(baseTargets); - } - return targets; -} -function getBaseClassDependencyCount(metadataReader, func) { - var baseConstructor = Object.getPrototypeOf(func.prototype).constructor; - if (baseConstructor !== Object) { - var baseConstructorName = serialization_1.getFunctionName(baseConstructor); - var targets = getTargets(metadataReader, baseConstructorName, baseConstructor, true); - var metadata = targets.map(function (t) { - return t.metadata.filter(function (m) { - return m.key === METADATA_KEY.UNMANAGED_TAG; - }); - }); - var unmanagedCount = [].concat.apply([], metadata).length; - var dependencyCount = targets.length - unmanagedCount; - if (dependencyCount > 0) { - return dependencyCount; - } - else { - return getBaseClassDependencyCount(metadataReader, baseConstructor); - } - } - else { - return 0; - } -} -exports.getBaseClassDependencyCount = getBaseClassDependencyCount; -function formatTargetMetadata(targetMetadata) { - var targetMetadataMap = {}; - targetMetadata.forEach(function (m) { - targetMetadataMap[m.key.toString()] = m.value; - }); - return { - inject: targetMetadataMap[METADATA_KEY.INJECT_TAG], - multiInject: targetMetadataMap[METADATA_KEY.MULTI_INJECT_TAG], - targetName: targetMetadataMap[METADATA_KEY.NAME_TAG], - unmanaged: targetMetadataMap[METADATA_KEY.UNMANAGED_TAG] - }; -} - - -/***/ }), - -/***/ "./node_modules/inversify/lib/planning/request.js": +/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(/*! ../annotation/inject */"./node_modules/inversify/lib/annotation/inject.js"),i=n(/*! ../constants/error_msgs */"./node_modules/inversify/lib/constants/error_msgs.js"),o=n(/*! ../constants/literal_types */"./node_modules/inversify/lib/constants/literal_types.js"),s=n(/*! ../constants/metadata_keys */"./node_modules/inversify/lib/constants/metadata_keys.js"),a=n(/*! ../utils/serialization */"./node_modules/inversify/lib/utils/serialization.js");t.getFunctionName=a.getFunctionName;var c=n(/*! ./target */"./node_modules/inversify/lib/planning/target.js");function u(e,t,n,r){var s=e.getConstructorMetadata(n),a=s.compilerGeneratedMetadata;if(void 0===a){var u=i.MISSING_INJECTABLE_ANNOTATION+" "+t+".";throw new Error(u)}var p=s.userGeneratedMetadata,f=Object.keys(p),h=function(e,t,n,r,i){for(var o=[],s=0;s0?f.length:n.length),g=function e(t,n){for(var r=t.getPropertiesMetadata(n),i=[],s=Object.keys(r),a=0,u=s;a0?l:e(t,r)}return 0}},"./node_modules/inversify/lib/planning/request.js": /*!********************************************************!*\ !*** ./node_modules/inversify/lib/planning/request.js ***! \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -var id_1 = __webpack_require__(/*! ../utils/id */ "./node_modules/inversify/lib/utils/id.js"); -var Request = (function () { - function Request(serviceIdentifier, parentContext, parentRequest, bindings, target) { - this.id = id_1.id(); - this.serviceIdentifier = serviceIdentifier; - this.parentContext = parentContext; - this.parentRequest = parentRequest; - this.target = target; - this.childRequests = []; - this.bindings = (Array.isArray(bindings) ? bindings : [bindings]); - this.requestScope = parentRequest === null - ? new Map() - : null; - } - Request.prototype.addChildRequest = function (serviceIdentifier, bindings, target) { - var child = new Request(serviceIdentifier, this.parentContext, this, bindings, target); - this.childRequests.push(child); - return child; - }; - return Request; -}()); -exports.Request = Request; - - -/***/ }), - -/***/ "./node_modules/inversify/lib/planning/target.js": +/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(/*! ../utils/id */"./node_modules/inversify/lib/utils/id.js"),i=function(){function e(e,t,n,i,o){this.id=r.id(),this.serviceIdentifier=e,this.parentContext=t,this.parentRequest=n,this.target=o,this.childRequests=[],this.bindings=Array.isArray(i)?i:[i],this.requestScope=null===n?new Map:null}return e.prototype.addChildRequest=function(t,n,r){var i=new e(t,this.parentContext,this,n,r);return this.childRequests.push(i),i},e}();t.Request=i},"./node_modules/inversify/lib/planning/target.js": /*!*******************************************************!*\ !*** ./node_modules/inversify/lib/planning/target.js ***! \*******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -var METADATA_KEY = __webpack_require__(/*! ../constants/metadata_keys */ "./node_modules/inversify/lib/constants/metadata_keys.js"); -var id_1 = __webpack_require__(/*! ../utils/id */ "./node_modules/inversify/lib/utils/id.js"); -var metadata_1 = __webpack_require__(/*! ./metadata */ "./node_modules/inversify/lib/planning/metadata.js"); -var queryable_string_1 = __webpack_require__(/*! ./queryable_string */ "./node_modules/inversify/lib/planning/queryable_string.js"); -var Target = (function () { - function Target(type, name, serviceIdentifier, namedOrTagged) { - this.id = id_1.id(); - this.type = type; - this.serviceIdentifier = serviceIdentifier; - this.name = new queryable_string_1.QueryableString(name || ""); - this.metadata = new Array(); - var metadataItem = null; - if (typeof namedOrTagged === "string") { - metadataItem = new metadata_1.Metadata(METADATA_KEY.NAMED_TAG, namedOrTagged); - } - else if (namedOrTagged instanceof metadata_1.Metadata) { - metadataItem = namedOrTagged; - } - if (metadataItem !== null) { - this.metadata.push(metadataItem); - } - } - Target.prototype.hasTag = function (key) { - for (var _i = 0, _a = this.metadata; _i < _a.length; _i++) { - var m = _a[_i]; - if (m.key === key) { - return true; - } - } - return false; - }; - Target.prototype.isArray = function () { - return this.hasTag(METADATA_KEY.MULTI_INJECT_TAG); - }; - Target.prototype.matchesArray = function (name) { - return this.matchesTag(METADATA_KEY.MULTI_INJECT_TAG)(name); - }; - Target.prototype.isNamed = function () { - return this.hasTag(METADATA_KEY.NAMED_TAG); - }; - Target.prototype.isTagged = function () { - return this.metadata.some(function (m) { - return (m.key !== METADATA_KEY.INJECT_TAG) && - (m.key !== METADATA_KEY.MULTI_INJECT_TAG) && - (m.key !== METADATA_KEY.NAME_TAG) && - (m.key !== METADATA_KEY.UNMANAGED_TAG) && - (m.key !== METADATA_KEY.NAMED_TAG); - }); - }; - Target.prototype.isOptional = function () { - return this.matchesTag(METADATA_KEY.OPTIONAL_TAG)(true); - }; - Target.prototype.getNamedTag = function () { - if (this.isNamed()) { - return this.metadata.filter(function (m) { return m.key === METADATA_KEY.NAMED_TAG; })[0]; - } - return null; - }; - Target.prototype.getCustomTags = function () { - if (this.isTagged()) { - return this.metadata.filter(function (m) { - return (m.key !== METADATA_KEY.INJECT_TAG) && - (m.key !== METADATA_KEY.MULTI_INJECT_TAG) && - (m.key !== METADATA_KEY.NAME_TAG) && - (m.key !== METADATA_KEY.UNMANAGED_TAG) && - (m.key !== METADATA_KEY.NAMED_TAG); - }); - } - return null; - }; - Target.prototype.matchesNamedTag = function (name) { - return this.matchesTag(METADATA_KEY.NAMED_TAG)(name); - }; - Target.prototype.matchesTag = function (key) { - var _this = this; - return function (value) { - for (var _i = 0, _a = _this.metadata; _i < _a.length; _i++) { - var m = _a[_i]; - if (m.key === key && m.value === value) { - return true; - } - } - return false; - }; - }; - return Target; -}()); -exports.Target = Target; - - -/***/ }), - -/***/ "./node_modules/inversify/lib/resolution/instantiation.js": +/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(/*! ../constants/metadata_keys */"./node_modules/inversify/lib/constants/metadata_keys.js"),i=n(/*! ../utils/id */"./node_modules/inversify/lib/utils/id.js"),o=n(/*! ./metadata */"./node_modules/inversify/lib/planning/metadata.js"),s=n(/*! ./queryable_string */"./node_modules/inversify/lib/planning/queryable_string.js"),a=function(){function e(e,t,n,a){this.id=i.id(),this.type=e,this.serviceIdentifier=n,this.name=new s.QueryableString(t||""),this.metadata=new Array;var c=null;"string"==typeof a?c=new o.Metadata(r.NAMED_TAG,a):a instanceof o.Metadata&&(c=a),null!==c&&this.metadata.push(c)}return e.prototype.hasTag=function(e){for(var t=0,n=this.metadata;t 0) { - var constructorInjectionsRequests = childRequests.filter(function (childRequest) { - return (childRequest.target !== null && childRequest.target.type === literal_types_1.TargetTypeEnum.ConstructorArgument); - }); - var constructorInjections = constructorInjectionsRequests.map(resolveRequest); - result = _createInstance(constr, constructorInjections); - result = _injectProperties(result, childRequests, resolveRequest); - } - else { - result = new constr(); - } - _postConstruct(constr, result); - return result; -} -exports.resolveInstance = resolveInstance; - - -/***/ }), - -/***/ "./node_modules/inversify/lib/resolution/resolver.js": +/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(/*! ../constants/error_msgs */"./node_modules/inversify/lib/constants/error_msgs.js"),i=n(/*! ../constants/literal_types */"./node_modules/inversify/lib/constants/literal_types.js"),o=n(/*! ../constants/metadata_keys */"./node_modules/inversify/lib/constants/metadata_keys.js");t.resolveInstance=function(e,t,n){var s,a,c=null;if(t.length>0){var u=t.filter((function(e){return null!==e.target&&e.target.type===i.TargetTypeEnum.ConstructorArgument})).map(n);a=u,c=function(e,t,n){var r=t.filter((function(e){return null!==e.target&&e.target.type===i.TargetTypeEnum.ClassProperty})),o=r.map(n);return r.forEach((function(t,n){var r;r=t.target.name.value();var i=o[n];e[r]=i})),e}(c=new((s=e).bind.apply(s,[void 0].concat(a))),t,n)}else c=new e;return function(e,t){if(Reflect.hasMetadata(o.POST_CONSTRUCT,e)){var n=Reflect.getMetadata(o.POST_CONSTRUCT,e);try{t[n.value]()}catch(t){throw new Error(r.POST_CONSTRUCT_ERROR(e.name,t.message))}}}(e,c),c}},"./node_modules/inversify/lib/resolution/resolver.js": /*!***********************************************************!*\ !*** ./node_modules/inversify/lib/resolution/resolver.js ***! \***********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -var ERROR_MSGS = __webpack_require__(/*! ../constants/error_msgs */ "./node_modules/inversify/lib/constants/error_msgs.js"); -var literal_types_1 = __webpack_require__(/*! ../constants/literal_types */ "./node_modules/inversify/lib/constants/literal_types.js"); -var exceptions_1 = __webpack_require__(/*! ../utils/exceptions */ "./node_modules/inversify/lib/utils/exceptions.js"); -var serialization_1 = __webpack_require__(/*! ../utils/serialization */ "./node_modules/inversify/lib/utils/serialization.js"); -var instantiation_1 = __webpack_require__(/*! ./instantiation */ "./node_modules/inversify/lib/resolution/instantiation.js"); -var invokeFactory = function (factoryType, serviceIdentifier, fn) { - try { - return fn(); - } - catch (error) { - if (exceptions_1.isStackOverflowExeption(error)) { - throw new Error(ERROR_MSGS.CIRCULAR_DEPENDENCY_IN_FACTORY(factoryType, serviceIdentifier.toString())); - } - else { - throw error; - } - } -}; -var _resolveRequest = function (requestScope) { - return function (request) { - request.parentContext.setCurrentRequest(request); - var bindings = request.bindings; - var childRequests = request.childRequests; - var targetIsAnArray = request.target && request.target.isArray(); - var targetParentIsNotAnArray = !request.parentRequest || - !request.parentRequest.target || - !request.target || - !request.parentRequest.target.matchesArray(request.target.serviceIdentifier); - if (targetIsAnArray && targetParentIsNotAnArray) { - return childRequests.map(function (childRequest) { - var _f = _resolveRequest(requestScope); - return _f(childRequest); - }); - } - else { - var result = null; - if (request.target.isOptional() && bindings.length === 0) { - return undefined; - } - var binding_1 = bindings[0]; - var isSingleton = binding_1.scope === literal_types_1.BindingScopeEnum.Singleton; - var isRequestSingleton = binding_1.scope === literal_types_1.BindingScopeEnum.Request; - if (isSingleton && binding_1.activated) { - return binding_1.cache; - } - if (isRequestSingleton && - requestScope !== null && - requestScope.has(binding_1.id)) { - return requestScope.get(binding_1.id); - } - if (binding_1.type === literal_types_1.BindingTypeEnum.ConstantValue) { - result = binding_1.cache; - } - else if (binding_1.type === literal_types_1.BindingTypeEnum.Function) { - result = binding_1.cache; - } - else if (binding_1.type === literal_types_1.BindingTypeEnum.Constructor) { - result = binding_1.implementationType; - } - else if (binding_1.type === literal_types_1.BindingTypeEnum.DynamicValue && binding_1.dynamicValue !== null) { - result = invokeFactory("toDynamicValue", binding_1.serviceIdentifier, function () { return binding_1.dynamicValue(request.parentContext); }); - } - else if (binding_1.type === literal_types_1.BindingTypeEnum.Factory && binding_1.factory !== null) { - result = invokeFactory("toFactory", binding_1.serviceIdentifier, function () { return binding_1.factory(request.parentContext); }); - } - else if (binding_1.type === literal_types_1.BindingTypeEnum.Provider && binding_1.provider !== null) { - result = invokeFactory("toProvider", binding_1.serviceIdentifier, function () { return binding_1.provider(request.parentContext); }); - } - else if (binding_1.type === literal_types_1.BindingTypeEnum.Instance && binding_1.implementationType !== null) { - result = instantiation_1.resolveInstance(binding_1.implementationType, childRequests, _resolveRequest(requestScope)); - } - else { - var serviceIdentifier = serialization_1.getServiceIdentifierAsString(request.serviceIdentifier); - throw new Error(ERROR_MSGS.INVALID_BINDING_TYPE + " " + serviceIdentifier); - } - if (typeof binding_1.onActivation === "function") { - result = binding_1.onActivation(request.parentContext, result); - } - if (isSingleton) { - binding_1.cache = result; - binding_1.activated = true; - } - if (isRequestSingleton && - requestScope !== null && - !requestScope.has(binding_1.id)) { - requestScope.set(binding_1.id, result); - } - return result; - } - }; -}; -function resolve(context) { - var _f = _resolveRequest(context.plan.rootRequest.requestScope); - return _f(context.plan.rootRequest); -} -exports.resolve = resolve; - - -/***/ }), - -/***/ "./node_modules/inversify/lib/syntax/binding_in_syntax.js": +/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(/*! ../constants/error_msgs */"./node_modules/inversify/lib/constants/error_msgs.js"),i=n(/*! ../constants/literal_types */"./node_modules/inversify/lib/constants/literal_types.js"),o=n(/*! ../utils/exceptions */"./node_modules/inversify/lib/utils/exceptions.js"),s=n(/*! ../utils/serialization */"./node_modules/inversify/lib/utils/serialization.js"),a=n(/*! ./instantiation */"./node_modules/inversify/lib/resolution/instantiation.js"),c=function(e,t,n){try{return n()}catch(n){throw o.isStackOverflowExeption(n)?new Error(r.CIRCULAR_DEPENDENCY_IN_FACTORY(e,t.toString())):n}},u=function(e){return function(t){t.parentContext.setCurrentRequest(t);var n=t.bindings,o=t.childRequests,l=t.target&&t.target.isArray(),d=!(t.parentRequest&&t.parentRequest.target&&t.target&&t.parentRequest.target.matchesArray(t.target.serviceIdentifier));if(l&&d)return o.map((function(t){return u(e)(t)}));var p=null;if(!t.target.isOptional()||0!==n.length){var f=n[0],h=f.scope===i.BindingScopeEnum.Singleton,g=f.scope===i.BindingScopeEnum.Request;if(h&&f.activated)return f.cache;if(g&&null!==e&&e.has(f.id))return e.get(f.id);if(f.type===i.BindingTypeEnum.ConstantValue)p=f.cache;else if(f.type===i.BindingTypeEnum.Function)p=f.cache;else if(f.type===i.BindingTypeEnum.Constructor)p=f.implementationType;else if(f.type===i.BindingTypeEnum.DynamicValue&&null!==f.dynamicValue)p=c("toDynamicValue",f.serviceIdentifier,(function(){return f.dynamicValue(t.parentContext)}));else if(f.type===i.BindingTypeEnum.Factory&&null!==f.factory)p=c("toFactory",f.serviceIdentifier,(function(){return f.factory(t.parentContext)}));else if(f.type===i.BindingTypeEnum.Provider&&null!==f.provider)p=c("toProvider",f.serviceIdentifier,(function(){return f.provider(t.parentContext)}));else{if(f.type!==i.BindingTypeEnum.Instance||null===f.implementationType){var y=s.getServiceIdentifierAsString(t.serviceIdentifier);throw new Error(r.INVALID_BINDING_TYPE+" "+y)}p=a.resolveInstance(f.implementationType,o,u(e))}return"function"==typeof f.onActivation&&(p=f.onActivation(t.parentContext,p)),h&&(f.cache=p,f.activated=!0),g&&null!==e&&!e.has(f.id)&&e.set(f.id,p),p}}};t.resolve=function(e){return u(e.plan.rootRequest.requestScope)(e.plan.rootRequest)}},"./node_modules/inversify/lib/syntax/binding_in_syntax.js": /*!****************************************************************!*\ !*** ./node_modules/inversify/lib/syntax/binding_in_syntax.js ***! \****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -var literal_types_1 = __webpack_require__(/*! ../constants/literal_types */ "./node_modules/inversify/lib/constants/literal_types.js"); -var binding_when_on_syntax_1 = __webpack_require__(/*! ./binding_when_on_syntax */ "./node_modules/inversify/lib/syntax/binding_when_on_syntax.js"); -var BindingInSyntax = (function () { - function BindingInSyntax(binding) { - this._binding = binding; - } - BindingInSyntax.prototype.inRequestScope = function () { - this._binding.scope = literal_types_1.BindingScopeEnum.Request; - return new binding_when_on_syntax_1.BindingWhenOnSyntax(this._binding); - }; - BindingInSyntax.prototype.inSingletonScope = function () { - this._binding.scope = literal_types_1.BindingScopeEnum.Singleton; - return new binding_when_on_syntax_1.BindingWhenOnSyntax(this._binding); - }; - BindingInSyntax.prototype.inTransientScope = function () { - this._binding.scope = literal_types_1.BindingScopeEnum.Transient; - return new binding_when_on_syntax_1.BindingWhenOnSyntax(this._binding); - }; - return BindingInSyntax; -}()); -exports.BindingInSyntax = BindingInSyntax; - - -/***/ }), - -/***/ "./node_modules/inversify/lib/syntax/binding_in_when_on_syntax.js": +/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(/*! ../constants/literal_types */"./node_modules/inversify/lib/constants/literal_types.js"),i=n(/*! ./binding_when_on_syntax */"./node_modules/inversify/lib/syntax/binding_when_on_syntax.js"),o=function(){function e(e){this._binding=e}return e.prototype.inRequestScope=function(){return this._binding.scope=r.BindingScopeEnum.Request,new i.BindingWhenOnSyntax(this._binding)},e.prototype.inSingletonScope=function(){return this._binding.scope=r.BindingScopeEnum.Singleton,new i.BindingWhenOnSyntax(this._binding)},e.prototype.inTransientScope=function(){return this._binding.scope=r.BindingScopeEnum.Transient,new i.BindingWhenOnSyntax(this._binding)},e}();t.BindingInSyntax=o},"./node_modules/inversify/lib/syntax/binding_in_when_on_syntax.js": /*!************************************************************************!*\ !*** ./node_modules/inversify/lib/syntax/binding_in_when_on_syntax.js ***! \************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -var binding_in_syntax_1 = __webpack_require__(/*! ./binding_in_syntax */ "./node_modules/inversify/lib/syntax/binding_in_syntax.js"); -var binding_on_syntax_1 = __webpack_require__(/*! ./binding_on_syntax */ "./node_modules/inversify/lib/syntax/binding_on_syntax.js"); -var binding_when_syntax_1 = __webpack_require__(/*! ./binding_when_syntax */ "./node_modules/inversify/lib/syntax/binding_when_syntax.js"); -var BindingInWhenOnSyntax = (function () { - function BindingInWhenOnSyntax(binding) { - this._binding = binding; - this._bindingWhenSyntax = new binding_when_syntax_1.BindingWhenSyntax(this._binding); - this._bindingOnSyntax = new binding_on_syntax_1.BindingOnSyntax(this._binding); - this._bindingInSyntax = new binding_in_syntax_1.BindingInSyntax(binding); - } - BindingInWhenOnSyntax.prototype.inRequestScope = function () { - return this._bindingInSyntax.inRequestScope(); - }; - BindingInWhenOnSyntax.prototype.inSingletonScope = function () { - return this._bindingInSyntax.inSingletonScope(); - }; - BindingInWhenOnSyntax.prototype.inTransientScope = function () { - return this._bindingInSyntax.inTransientScope(); - }; - BindingInWhenOnSyntax.prototype.when = function (constraint) { - return this._bindingWhenSyntax.when(constraint); - }; - BindingInWhenOnSyntax.prototype.whenTargetNamed = function (name) { - return this._bindingWhenSyntax.whenTargetNamed(name); - }; - BindingInWhenOnSyntax.prototype.whenTargetIsDefault = function () { - return this._bindingWhenSyntax.whenTargetIsDefault(); - }; - BindingInWhenOnSyntax.prototype.whenTargetTagged = function (tag, value) { - return this._bindingWhenSyntax.whenTargetTagged(tag, value); - }; - BindingInWhenOnSyntax.prototype.whenInjectedInto = function (parent) { - return this._bindingWhenSyntax.whenInjectedInto(parent); - }; - BindingInWhenOnSyntax.prototype.whenParentNamed = function (name) { - return this._bindingWhenSyntax.whenParentNamed(name); - }; - BindingInWhenOnSyntax.prototype.whenParentTagged = function (tag, value) { - return this._bindingWhenSyntax.whenParentTagged(tag, value); - }; - BindingInWhenOnSyntax.prototype.whenAnyAncestorIs = function (ancestor) { - return this._bindingWhenSyntax.whenAnyAncestorIs(ancestor); - }; - BindingInWhenOnSyntax.prototype.whenNoAncestorIs = function (ancestor) { - return this._bindingWhenSyntax.whenNoAncestorIs(ancestor); - }; - BindingInWhenOnSyntax.prototype.whenAnyAncestorNamed = function (name) { - return this._bindingWhenSyntax.whenAnyAncestorNamed(name); - }; - BindingInWhenOnSyntax.prototype.whenAnyAncestorTagged = function (tag, value) { - return this._bindingWhenSyntax.whenAnyAncestorTagged(tag, value); - }; - BindingInWhenOnSyntax.prototype.whenNoAncestorNamed = function (name) { - return this._bindingWhenSyntax.whenNoAncestorNamed(name); - }; - BindingInWhenOnSyntax.prototype.whenNoAncestorTagged = function (tag, value) { - return this._bindingWhenSyntax.whenNoAncestorTagged(tag, value); - }; - BindingInWhenOnSyntax.prototype.whenAnyAncestorMatches = function (constraint) { - return this._bindingWhenSyntax.whenAnyAncestorMatches(constraint); - }; - BindingInWhenOnSyntax.prototype.whenNoAncestorMatches = function (constraint) { - return this._bindingWhenSyntax.whenNoAncestorMatches(constraint); - }; - BindingInWhenOnSyntax.prototype.onActivation = function (handler) { - return this._bindingOnSyntax.onActivation(handler); - }; - return BindingInWhenOnSyntax; -}()); -exports.BindingInWhenOnSyntax = BindingInWhenOnSyntax; - - -/***/ }), - -/***/ "./node_modules/inversify/lib/syntax/binding_on_syntax.js": +/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(/*! ./binding_in_syntax */"./node_modules/inversify/lib/syntax/binding_in_syntax.js"),i=n(/*! ./binding_on_syntax */"./node_modules/inversify/lib/syntax/binding_on_syntax.js"),o=n(/*! ./binding_when_syntax */"./node_modules/inversify/lib/syntax/binding_when_syntax.js"),s=function(){function e(e){this._binding=e,this._bindingWhenSyntax=new o.BindingWhenSyntax(this._binding),this._bindingOnSyntax=new i.BindingOnSyntax(this._binding),this._bindingInSyntax=new r.BindingInSyntax(e)}return e.prototype.inRequestScope=function(){return this._bindingInSyntax.inRequestScope()},e.prototype.inSingletonScope=function(){return this._bindingInSyntax.inSingletonScope()},e.prototype.inTransientScope=function(){return this._bindingInSyntax.inTransientScope()},e.prototype.when=function(e){return this._bindingWhenSyntax.when(e)},e.prototype.whenTargetNamed=function(e){return this._bindingWhenSyntax.whenTargetNamed(e)},e.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},e.prototype.whenTargetTagged=function(e,t){return this._bindingWhenSyntax.whenTargetTagged(e,t)},e.prototype.whenInjectedInto=function(e){return this._bindingWhenSyntax.whenInjectedInto(e)},e.prototype.whenParentNamed=function(e){return this._bindingWhenSyntax.whenParentNamed(e)},e.prototype.whenParentTagged=function(e,t){return this._bindingWhenSyntax.whenParentTagged(e,t)},e.prototype.whenAnyAncestorIs=function(e){return this._bindingWhenSyntax.whenAnyAncestorIs(e)},e.prototype.whenNoAncestorIs=function(e){return this._bindingWhenSyntax.whenNoAncestorIs(e)},e.prototype.whenAnyAncestorNamed=function(e){return this._bindingWhenSyntax.whenAnyAncestorNamed(e)},e.prototype.whenAnyAncestorTagged=function(e,t){return this._bindingWhenSyntax.whenAnyAncestorTagged(e,t)},e.prototype.whenNoAncestorNamed=function(e){return this._bindingWhenSyntax.whenNoAncestorNamed(e)},e.prototype.whenNoAncestorTagged=function(e,t){return this._bindingWhenSyntax.whenNoAncestorTagged(e,t)},e.prototype.whenAnyAncestorMatches=function(e){return this._bindingWhenSyntax.whenAnyAncestorMatches(e)},e.prototype.whenNoAncestorMatches=function(e){return this._bindingWhenSyntax.whenNoAncestorMatches(e)},e.prototype.onActivation=function(e){return this._bindingOnSyntax.onActivation(e)},e}();t.BindingInWhenOnSyntax=s},"./node_modules/inversify/lib/syntax/binding_on_syntax.js": /*!****************************************************************!*\ !*** ./node_modules/inversify/lib/syntax/binding_on_syntax.js ***! \****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -var binding_when_syntax_1 = __webpack_require__(/*! ./binding_when_syntax */ "./node_modules/inversify/lib/syntax/binding_when_syntax.js"); -var BindingOnSyntax = (function () { - function BindingOnSyntax(binding) { - this._binding = binding; - } - BindingOnSyntax.prototype.onActivation = function (handler) { - this._binding.onActivation = handler; - return new binding_when_syntax_1.BindingWhenSyntax(this._binding); - }; - return BindingOnSyntax; -}()); -exports.BindingOnSyntax = BindingOnSyntax; - - -/***/ }), - -/***/ "./node_modules/inversify/lib/syntax/binding_to_syntax.js": +/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(/*! ./binding_when_syntax */"./node_modules/inversify/lib/syntax/binding_when_syntax.js"),i=function(){function e(e){this._binding=e}return e.prototype.onActivation=function(e){return this._binding.onActivation=e,new r.BindingWhenSyntax(this._binding)},e}();t.BindingOnSyntax=i},"./node_modules/inversify/lib/syntax/binding_to_syntax.js": /*!****************************************************************!*\ !*** ./node_modules/inversify/lib/syntax/binding_to_syntax.js ***! \****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -var ERROR_MSGS = __webpack_require__(/*! ../constants/error_msgs */ "./node_modules/inversify/lib/constants/error_msgs.js"); -var literal_types_1 = __webpack_require__(/*! ../constants/literal_types */ "./node_modules/inversify/lib/constants/literal_types.js"); -var binding_in_when_on_syntax_1 = __webpack_require__(/*! ./binding_in_when_on_syntax */ "./node_modules/inversify/lib/syntax/binding_in_when_on_syntax.js"); -var binding_when_on_syntax_1 = __webpack_require__(/*! ./binding_when_on_syntax */ "./node_modules/inversify/lib/syntax/binding_when_on_syntax.js"); -var BindingToSyntax = (function () { - function BindingToSyntax(binding) { - this._binding = binding; - } - BindingToSyntax.prototype.to = function (constructor) { - this._binding.type = literal_types_1.BindingTypeEnum.Instance; - this._binding.implementationType = constructor; - return new binding_in_when_on_syntax_1.BindingInWhenOnSyntax(this._binding); - }; - BindingToSyntax.prototype.toSelf = function () { - if (typeof this._binding.serviceIdentifier !== "function") { - throw new Error("" + ERROR_MSGS.INVALID_TO_SELF_VALUE); - } - var self = this._binding.serviceIdentifier; - return this.to(self); - }; - BindingToSyntax.prototype.toConstantValue = function (value) { - this._binding.type = literal_types_1.BindingTypeEnum.ConstantValue; - this._binding.cache = value; - this._binding.dynamicValue = null; - this._binding.implementationType = null; - return new binding_when_on_syntax_1.BindingWhenOnSyntax(this._binding); - }; - BindingToSyntax.prototype.toDynamicValue = function (func) { - this._binding.type = literal_types_1.BindingTypeEnum.DynamicValue; - this._binding.cache = null; - this._binding.dynamicValue = func; - this._binding.implementationType = null; - return new binding_in_when_on_syntax_1.BindingInWhenOnSyntax(this._binding); - }; - BindingToSyntax.prototype.toConstructor = function (constructor) { - this._binding.type = literal_types_1.BindingTypeEnum.Constructor; - this._binding.implementationType = constructor; - return new binding_when_on_syntax_1.BindingWhenOnSyntax(this._binding); - }; - BindingToSyntax.prototype.toFactory = function (factory) { - this._binding.type = literal_types_1.BindingTypeEnum.Factory; - this._binding.factory = factory; - return new binding_when_on_syntax_1.BindingWhenOnSyntax(this._binding); - }; - BindingToSyntax.prototype.toFunction = function (func) { - if (typeof func !== "function") { - throw new Error(ERROR_MSGS.INVALID_FUNCTION_BINDING); - } - var bindingWhenOnSyntax = this.toConstantValue(func); - this._binding.type = literal_types_1.BindingTypeEnum.Function; - return bindingWhenOnSyntax; - }; - BindingToSyntax.prototype.toAutoFactory = function (serviceIdentifier) { - this._binding.type = literal_types_1.BindingTypeEnum.Factory; - this._binding.factory = function (context) { - var autofactory = function () { return context.container.get(serviceIdentifier); }; - return autofactory; - }; - return new binding_when_on_syntax_1.BindingWhenOnSyntax(this._binding); - }; - BindingToSyntax.prototype.toProvider = function (provider) { - this._binding.type = literal_types_1.BindingTypeEnum.Provider; - this._binding.provider = provider; - return new binding_when_on_syntax_1.BindingWhenOnSyntax(this._binding); - }; - BindingToSyntax.prototype.toService = function (service) { - this.toDynamicValue(function (context) { return context.container.get(service); }); - }; - return BindingToSyntax; -}()); -exports.BindingToSyntax = BindingToSyntax; - - -/***/ }), - -/***/ "./node_modules/inversify/lib/syntax/binding_when_on_syntax.js": +/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(/*! ../constants/error_msgs */"./node_modules/inversify/lib/constants/error_msgs.js"),i=n(/*! ../constants/literal_types */"./node_modules/inversify/lib/constants/literal_types.js"),o=n(/*! ./binding_in_when_on_syntax */"./node_modules/inversify/lib/syntax/binding_in_when_on_syntax.js"),s=n(/*! ./binding_when_on_syntax */"./node_modules/inversify/lib/syntax/binding_when_on_syntax.js"),a=function(){function e(e){this._binding=e}return e.prototype.to=function(e){return this._binding.type=i.BindingTypeEnum.Instance,this._binding.implementationType=e,new o.BindingInWhenOnSyntax(this._binding)},e.prototype.toSelf=function(){if("function"!=typeof this._binding.serviceIdentifier)throw new Error(""+r.INVALID_TO_SELF_VALUE);var e=this._binding.serviceIdentifier;return this.to(e)},e.prototype.toConstantValue=function(e){return this._binding.type=i.BindingTypeEnum.ConstantValue,this._binding.cache=e,this._binding.dynamicValue=null,this._binding.implementationType=null,new s.BindingWhenOnSyntax(this._binding)},e.prototype.toDynamicValue=function(e){return this._binding.type=i.BindingTypeEnum.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=e,this._binding.implementationType=null,new o.BindingInWhenOnSyntax(this._binding)},e.prototype.toConstructor=function(e){return this._binding.type=i.BindingTypeEnum.Constructor,this._binding.implementationType=e,new s.BindingWhenOnSyntax(this._binding)},e.prototype.toFactory=function(e){return this._binding.type=i.BindingTypeEnum.Factory,this._binding.factory=e,new s.BindingWhenOnSyntax(this._binding)},e.prototype.toFunction=function(e){if("function"!=typeof e)throw new Error(r.INVALID_FUNCTION_BINDING);var t=this.toConstantValue(e);return this._binding.type=i.BindingTypeEnum.Function,t},e.prototype.toAutoFactory=function(e){return this._binding.type=i.BindingTypeEnum.Factory,this._binding.factory=function(t){return function(){return t.container.get(e)}},new s.BindingWhenOnSyntax(this._binding)},e.prototype.toProvider=function(e){return this._binding.type=i.BindingTypeEnum.Provider,this._binding.provider=e,new s.BindingWhenOnSyntax(this._binding)},e.prototype.toService=function(e){this.toDynamicValue((function(t){return t.container.get(e)}))},e}();t.BindingToSyntax=a},"./node_modules/inversify/lib/syntax/binding_when_on_syntax.js": /*!*********************************************************************!*\ !*** ./node_modules/inversify/lib/syntax/binding_when_on_syntax.js ***! \*********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -var binding_on_syntax_1 = __webpack_require__(/*! ./binding_on_syntax */ "./node_modules/inversify/lib/syntax/binding_on_syntax.js"); -var binding_when_syntax_1 = __webpack_require__(/*! ./binding_when_syntax */ "./node_modules/inversify/lib/syntax/binding_when_syntax.js"); -var BindingWhenOnSyntax = (function () { - function BindingWhenOnSyntax(binding) { - this._binding = binding; - this._bindingWhenSyntax = new binding_when_syntax_1.BindingWhenSyntax(this._binding); - this._bindingOnSyntax = new binding_on_syntax_1.BindingOnSyntax(this._binding); - } - BindingWhenOnSyntax.prototype.when = function (constraint) { - return this._bindingWhenSyntax.when(constraint); - }; - BindingWhenOnSyntax.prototype.whenTargetNamed = function (name) { - return this._bindingWhenSyntax.whenTargetNamed(name); - }; - BindingWhenOnSyntax.prototype.whenTargetIsDefault = function () { - return this._bindingWhenSyntax.whenTargetIsDefault(); - }; - BindingWhenOnSyntax.prototype.whenTargetTagged = function (tag, value) { - return this._bindingWhenSyntax.whenTargetTagged(tag, value); - }; - BindingWhenOnSyntax.prototype.whenInjectedInto = function (parent) { - return this._bindingWhenSyntax.whenInjectedInto(parent); - }; - BindingWhenOnSyntax.prototype.whenParentNamed = function (name) { - return this._bindingWhenSyntax.whenParentNamed(name); - }; - BindingWhenOnSyntax.prototype.whenParentTagged = function (tag, value) { - return this._bindingWhenSyntax.whenParentTagged(tag, value); - }; - BindingWhenOnSyntax.prototype.whenAnyAncestorIs = function (ancestor) { - return this._bindingWhenSyntax.whenAnyAncestorIs(ancestor); - }; - BindingWhenOnSyntax.prototype.whenNoAncestorIs = function (ancestor) { - return this._bindingWhenSyntax.whenNoAncestorIs(ancestor); - }; - BindingWhenOnSyntax.prototype.whenAnyAncestorNamed = function (name) { - return this._bindingWhenSyntax.whenAnyAncestorNamed(name); - }; - BindingWhenOnSyntax.prototype.whenAnyAncestorTagged = function (tag, value) { - return this._bindingWhenSyntax.whenAnyAncestorTagged(tag, value); - }; - BindingWhenOnSyntax.prototype.whenNoAncestorNamed = function (name) { - return this._bindingWhenSyntax.whenNoAncestorNamed(name); - }; - BindingWhenOnSyntax.prototype.whenNoAncestorTagged = function (tag, value) { - return this._bindingWhenSyntax.whenNoAncestorTagged(tag, value); - }; - BindingWhenOnSyntax.prototype.whenAnyAncestorMatches = function (constraint) { - return this._bindingWhenSyntax.whenAnyAncestorMatches(constraint); - }; - BindingWhenOnSyntax.prototype.whenNoAncestorMatches = function (constraint) { - return this._bindingWhenSyntax.whenNoAncestorMatches(constraint); - }; - BindingWhenOnSyntax.prototype.onActivation = function (handler) { - return this._bindingOnSyntax.onActivation(handler); - }; - return BindingWhenOnSyntax; -}()); -exports.BindingWhenOnSyntax = BindingWhenOnSyntax; - - -/***/ }), - -/***/ "./node_modules/inversify/lib/syntax/binding_when_syntax.js": +/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(/*! ./binding_on_syntax */"./node_modules/inversify/lib/syntax/binding_on_syntax.js"),i=n(/*! ./binding_when_syntax */"./node_modules/inversify/lib/syntax/binding_when_syntax.js"),o=function(){function e(e){this._binding=e,this._bindingWhenSyntax=new i.BindingWhenSyntax(this._binding),this._bindingOnSyntax=new r.BindingOnSyntax(this._binding)}return e.prototype.when=function(e){return this._bindingWhenSyntax.when(e)},e.prototype.whenTargetNamed=function(e){return this._bindingWhenSyntax.whenTargetNamed(e)},e.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},e.prototype.whenTargetTagged=function(e,t){return this._bindingWhenSyntax.whenTargetTagged(e,t)},e.prototype.whenInjectedInto=function(e){return this._bindingWhenSyntax.whenInjectedInto(e)},e.prototype.whenParentNamed=function(e){return this._bindingWhenSyntax.whenParentNamed(e)},e.prototype.whenParentTagged=function(e,t){return this._bindingWhenSyntax.whenParentTagged(e,t)},e.prototype.whenAnyAncestorIs=function(e){return this._bindingWhenSyntax.whenAnyAncestorIs(e)},e.prototype.whenNoAncestorIs=function(e){return this._bindingWhenSyntax.whenNoAncestorIs(e)},e.prototype.whenAnyAncestorNamed=function(e){return this._bindingWhenSyntax.whenAnyAncestorNamed(e)},e.prototype.whenAnyAncestorTagged=function(e,t){return this._bindingWhenSyntax.whenAnyAncestorTagged(e,t)},e.prototype.whenNoAncestorNamed=function(e){return this._bindingWhenSyntax.whenNoAncestorNamed(e)},e.prototype.whenNoAncestorTagged=function(e,t){return this._bindingWhenSyntax.whenNoAncestorTagged(e,t)},e.prototype.whenAnyAncestorMatches=function(e){return this._bindingWhenSyntax.whenAnyAncestorMatches(e)},e.prototype.whenNoAncestorMatches=function(e){return this._bindingWhenSyntax.whenNoAncestorMatches(e)},e.prototype.onActivation=function(e){return this._bindingOnSyntax.onActivation(e)},e}();t.BindingWhenOnSyntax=o},"./node_modules/inversify/lib/syntax/binding_when_syntax.js": /*!******************************************************************!*\ !*** ./node_modules/inversify/lib/syntax/binding_when_syntax.js ***! \******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -var binding_on_syntax_1 = __webpack_require__(/*! ./binding_on_syntax */ "./node_modules/inversify/lib/syntax/binding_on_syntax.js"); -var constraint_helpers_1 = __webpack_require__(/*! ./constraint_helpers */ "./node_modules/inversify/lib/syntax/constraint_helpers.js"); -var BindingWhenSyntax = (function () { - function BindingWhenSyntax(binding) { - this._binding = binding; - } - BindingWhenSyntax.prototype.when = function (constraint) { - this._binding.constraint = constraint; - return new binding_on_syntax_1.BindingOnSyntax(this._binding); - }; - BindingWhenSyntax.prototype.whenTargetNamed = function (name) { - this._binding.constraint = constraint_helpers_1.namedConstraint(name); - return new binding_on_syntax_1.BindingOnSyntax(this._binding); - }; - BindingWhenSyntax.prototype.whenTargetIsDefault = function () { - this._binding.constraint = function (request) { - var targetIsDefault = (request.target !== null) && - (!request.target.isNamed()) && - (!request.target.isTagged()); - return targetIsDefault; - }; - return new binding_on_syntax_1.BindingOnSyntax(this._binding); - }; - BindingWhenSyntax.prototype.whenTargetTagged = function (tag, value) { - this._binding.constraint = constraint_helpers_1.taggedConstraint(tag)(value); - return new binding_on_syntax_1.BindingOnSyntax(this._binding); - }; - BindingWhenSyntax.prototype.whenInjectedInto = function (parent) { - this._binding.constraint = function (request) { - return constraint_helpers_1.typeConstraint(parent)(request.parentRequest); - }; - return new binding_on_syntax_1.BindingOnSyntax(this._binding); - }; - BindingWhenSyntax.prototype.whenParentNamed = function (name) { - this._binding.constraint = function (request) { - return constraint_helpers_1.namedConstraint(name)(request.parentRequest); - }; - return new binding_on_syntax_1.BindingOnSyntax(this._binding); - }; - BindingWhenSyntax.prototype.whenParentTagged = function (tag, value) { - this._binding.constraint = function (request) { - return constraint_helpers_1.taggedConstraint(tag)(value)(request.parentRequest); - }; - return new binding_on_syntax_1.BindingOnSyntax(this._binding); - }; - BindingWhenSyntax.prototype.whenAnyAncestorIs = function (ancestor) { - this._binding.constraint = function (request) { - return constraint_helpers_1.traverseAncerstors(request, constraint_helpers_1.typeConstraint(ancestor)); - }; - return new binding_on_syntax_1.BindingOnSyntax(this._binding); - }; - BindingWhenSyntax.prototype.whenNoAncestorIs = function (ancestor) { - this._binding.constraint = function (request) { - return !constraint_helpers_1.traverseAncerstors(request, constraint_helpers_1.typeConstraint(ancestor)); - }; - return new binding_on_syntax_1.BindingOnSyntax(this._binding); - }; - BindingWhenSyntax.prototype.whenAnyAncestorNamed = function (name) { - this._binding.constraint = function (request) { - return constraint_helpers_1.traverseAncerstors(request, constraint_helpers_1.namedConstraint(name)); - }; - return new binding_on_syntax_1.BindingOnSyntax(this._binding); - }; - BindingWhenSyntax.prototype.whenNoAncestorNamed = function (name) { - this._binding.constraint = function (request) { - return !constraint_helpers_1.traverseAncerstors(request, constraint_helpers_1.namedConstraint(name)); - }; - return new binding_on_syntax_1.BindingOnSyntax(this._binding); - }; - BindingWhenSyntax.prototype.whenAnyAncestorTagged = function (tag, value) { - this._binding.constraint = function (request) { - return constraint_helpers_1.traverseAncerstors(request, constraint_helpers_1.taggedConstraint(tag)(value)); - }; - return new binding_on_syntax_1.BindingOnSyntax(this._binding); - }; - BindingWhenSyntax.prototype.whenNoAncestorTagged = function (tag, value) { - this._binding.constraint = function (request) { - return !constraint_helpers_1.traverseAncerstors(request, constraint_helpers_1.taggedConstraint(tag)(value)); - }; - return new binding_on_syntax_1.BindingOnSyntax(this._binding); - }; - BindingWhenSyntax.prototype.whenAnyAncestorMatches = function (constraint) { - this._binding.constraint = function (request) { - return constraint_helpers_1.traverseAncerstors(request, constraint); - }; - return new binding_on_syntax_1.BindingOnSyntax(this._binding); - }; - BindingWhenSyntax.prototype.whenNoAncestorMatches = function (constraint) { - this._binding.constraint = function (request) { - return !constraint_helpers_1.traverseAncerstors(request, constraint); - }; - return new binding_on_syntax_1.BindingOnSyntax(this._binding); - }; - return BindingWhenSyntax; -}()); -exports.BindingWhenSyntax = BindingWhenSyntax; - - -/***/ }), - -/***/ "./node_modules/inversify/lib/syntax/constraint_helpers.js": +/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(/*! ./binding_on_syntax */"./node_modules/inversify/lib/syntax/binding_on_syntax.js"),i=n(/*! ./constraint_helpers */"./node_modules/inversify/lib/syntax/constraint_helpers.js"),o=function(){function e(e){this._binding=e}return e.prototype.when=function(e){return this._binding.constraint=e,new r.BindingOnSyntax(this._binding)},e.prototype.whenTargetNamed=function(e){return this._binding.constraint=i.namedConstraint(e),new r.BindingOnSyntax(this._binding)},e.prototype.whenTargetIsDefault=function(){return this._binding.constraint=function(e){return null!==e.target&&!e.target.isNamed()&&!e.target.isTagged()},new r.BindingOnSyntax(this._binding)},e.prototype.whenTargetTagged=function(e,t){return this._binding.constraint=i.taggedConstraint(e)(t),new r.BindingOnSyntax(this._binding)},e.prototype.whenInjectedInto=function(e){return this._binding.constraint=function(t){return i.typeConstraint(e)(t.parentRequest)},new r.BindingOnSyntax(this._binding)},e.prototype.whenParentNamed=function(e){return this._binding.constraint=function(t){return i.namedConstraint(e)(t.parentRequest)},new r.BindingOnSyntax(this._binding)},e.prototype.whenParentTagged=function(e,t){return this._binding.constraint=function(n){return i.taggedConstraint(e)(t)(n.parentRequest)},new r.BindingOnSyntax(this._binding)},e.prototype.whenAnyAncestorIs=function(e){return this._binding.constraint=function(t){return i.traverseAncerstors(t,i.typeConstraint(e))},new r.BindingOnSyntax(this._binding)},e.prototype.whenNoAncestorIs=function(e){return this._binding.constraint=function(t){return!i.traverseAncerstors(t,i.typeConstraint(e))},new r.BindingOnSyntax(this._binding)},e.prototype.whenAnyAncestorNamed=function(e){return this._binding.constraint=function(t){return i.traverseAncerstors(t,i.namedConstraint(e))},new r.BindingOnSyntax(this._binding)},e.prototype.whenNoAncestorNamed=function(e){return this._binding.constraint=function(t){return!i.traverseAncerstors(t,i.namedConstraint(e))},new r.BindingOnSyntax(this._binding)},e.prototype.whenAnyAncestorTagged=function(e,t){return this._binding.constraint=function(n){return i.traverseAncerstors(n,i.taggedConstraint(e)(t))},new r.BindingOnSyntax(this._binding)},e.prototype.whenNoAncestorTagged=function(e,t){return this._binding.constraint=function(n){return!i.traverseAncerstors(n,i.taggedConstraint(e)(t))},new r.BindingOnSyntax(this._binding)},e.prototype.whenAnyAncestorMatches=function(e){return this._binding.constraint=function(t){return i.traverseAncerstors(t,e)},new r.BindingOnSyntax(this._binding)},e.prototype.whenNoAncestorMatches=function(e){return this._binding.constraint=function(t){return!i.traverseAncerstors(t,e)},new r.BindingOnSyntax(this._binding)},e}();t.BindingWhenSyntax=o},"./node_modules/inversify/lib/syntax/constraint_helpers.js": /*!*****************************************************************!*\ !*** ./node_modules/inversify/lib/syntax/constraint_helpers.js ***! \*****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -var METADATA_KEY = __webpack_require__(/*! ../constants/metadata_keys */ "./node_modules/inversify/lib/constants/metadata_keys.js"); -var metadata_1 = __webpack_require__(/*! ../planning/metadata */ "./node_modules/inversify/lib/planning/metadata.js"); -var traverseAncerstors = function (request, constraint) { - var parent = request.parentRequest; - if (parent !== null) { - return constraint(parent) ? true : traverseAncerstors(parent, constraint); - } - else { - return false; - } -}; -exports.traverseAncerstors = traverseAncerstors; -var taggedConstraint = function (key) { return function (value) { - var constraint = function (request) { - return request !== null && request.target !== null && request.target.matchesTag(key)(value); - }; - constraint.metaData = new metadata_1.Metadata(key, value); - return constraint; -}; }; -exports.taggedConstraint = taggedConstraint; -var namedConstraint = taggedConstraint(METADATA_KEY.NAMED_TAG); -exports.namedConstraint = namedConstraint; -var typeConstraint = function (type) { return function (request) { - var binding = null; - if (request !== null) { - binding = request.bindings[0]; - if (typeof type === "string") { - var serviceIdentifier = binding.serviceIdentifier; - return serviceIdentifier === type; - } - else { - var constructor = request.bindings[0].implementationType; - return type === constructor; - } - } - return false; -}; }; -exports.typeConstraint = typeConstraint; - - -/***/ }), - -/***/ "./node_modules/inversify/lib/utils/binding_utils.js": +/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(/*! ../constants/metadata_keys */"./node_modules/inversify/lib/constants/metadata_keys.js"),i=n(/*! ../planning/metadata */"./node_modules/inversify/lib/planning/metadata.js"),o=function(e,t){var n=e.parentRequest;return null!==n&&(!!t(n)||o(n,t))};t.traverseAncerstors=o;var s=function(e){return function(t){var n=function(n){return null!==n&&null!==n.target&&n.target.matchesTag(e)(t)};return n.metaData=new i.Metadata(e,t),n}};t.taggedConstraint=s;var a=s(r.NAMED_TAG);t.namedConstraint=a;t.typeConstraint=function(e){return function(t){var n=null;if(null!==t){if(n=t.bindings[0],"string"==typeof e)return n.serviceIdentifier===e;var r=t.bindings[0].implementationType;return e===r}return!1}}},"./node_modules/inversify/lib/utils/binding_utils.js": /*!***********************************************************!*\ !*** ./node_modules/inversify/lib/utils/binding_utils.js ***! \***********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -exports.multiBindToService = function (container) { - return function (service) { - return function () { - var types = []; - for (var _i = 0; _i < arguments.length; _i++) { - types[_i] = arguments[_i]; - } - return types.forEach(function (t) { return container.bind(t).toService(service); }); - }; - }; -}; - - -/***/ }), - -/***/ "./node_modules/inversify/lib/utils/exceptions.js": +/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.multiBindToService=function(e){return function(t){return function(){for(var n=[],r=0;r "); -} -function circularDependencyToException(request) { - request.childRequests.forEach(function (childRequest) { - if (alreadyDependencyChain(childRequest, childRequest.serviceIdentifier)) { - var services = dependencyChainToString(childRequest); - throw new Error(ERROR_MSGS.CIRCULAR_DEPENDENCY + " " + services); - } - else { - circularDependencyToException(childRequest); - } - }); -} -exports.circularDependencyToException = circularDependencyToException; -function listMetadataForTarget(serviceIdentifierString, target) { - if (target.isTagged() || target.isNamed()) { - var m_1 = ""; - var namedTag = target.getNamedTag(); - var otherTags = target.getCustomTags(); - if (namedTag !== null) { - m_1 += namedTag.toString() + "\n"; - } - if (otherTags !== null) { - otherTags.forEach(function (tag) { - m_1 += tag.toString() + "\n"; - }); - } - return " " + serviceIdentifierString + "\n " + serviceIdentifierString + " - " + m_1; - } - else { - return " " + serviceIdentifierString; - } -} -exports.listMetadataForTarget = listMetadataForTarget; -function getFunctionName(v) { - if (v.name) { - return v.name; - } - else { - var name_1 = v.toString(); - var match = name_1.match(/^function\s*([^\s(]+)/); - return match ? match[1] : "Anonymous function: " + name_1; - } -} -exports.getFunctionName = getFunctionName; - - -/***/ }), - -/***/ "./node_modules/minimatch/minimatch.js": +/*! no static exports found */function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(/*! ../constants/error_msgs */"./node_modules/inversify/lib/constants/error_msgs.js");function i(e){return"function"==typeof e?e.name:"symbol"==typeof e?e.toString():e}function o(e){if(e.name)return e.name;var t=e.toString(),n=t.match(/^function\s*([^\s(]+)/);return n?n[1]:"Anonymous function: "+t}t.getServiceIdentifierAsString=i,t.listRegisteredBindingsForServiceIdentifier=function(e,t,n){var r="",i=n(e,t);return 0!==i.length&&(r="\nRegistered bindings:",i.forEach((function(e){var t="Object";null!==e.implementationType&&(t=o(e.implementationType)),r=r+"\n "+t,e.constraint.metaData&&(r=r+" - "+e.constraint.metaData)}))),r},t.circularDependencyToException=function e(t){t.childRequests.forEach((function(t){if(function e(t,n){return null!==t.parentRequest&&(t.parentRequest.serviceIdentifier===n||e(t.parentRequest,n))}(t,t.serviceIdentifier)){var n=function(e){return function e(t,n){void 0===n&&(n=[]);var r=i(t.serviceIdentifier);return n.push(r),null!==t.parentRequest?e(t.parentRequest,n):n}(e).reverse().join(" --\x3e ")}(t);throw new Error(r.CIRCULAR_DEPENDENCY+" "+n)}e(t)}))},t.listMetadataForTarget=function(e,t){if(t.isTagged()||t.isNamed()){var n="",r=t.getNamedTag(),i=t.getCustomTags();return null!==r&&(n+=r.toString()+"\n"),null!==i&&i.forEach((function(e){n+=e.toString()+"\n"}))," "+e+"\n "+e+" - "+n}return" "+e},t.getFunctionName=o},"./node_modules/minimatch/minimatch.js": /*!*********************************************!*\ !*** ./node_modules/minimatch/minimatch.js ***! \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = minimatch -minimatch.Minimatch = Minimatch - -var path = { sep: '/' } -try { - path = __webpack_require__(/*! path */ "path") -} catch (er) {} - -var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} -var expand = __webpack_require__(/*! brace-expansion */ "./node_modules/brace-expansion/index.js") - -var plTypes = { - '!': { open: '(?:(?!(?:', close: '))[^/]*?)'}, - '?': { open: '(?:', close: ')?' }, - '+': { open: '(?:', close: ')+' }, - '*': { open: '(?:', close: ')*' }, - '@': { open: '(?:', close: ')' } -} - -// any single thing other than / -// don't need to escape / when using new RegExp() -var qmark = '[^/]' - -// * => any number of characters -var star = qmark + '*?' - -// ** when dots are allowed. Anything goes, except .. and . -// not (^ or / followed by one or two dots followed by $ or /), -// followed by anything, any number of times. -var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?' - -// not a ^ or / followed by a dot, -// followed by anything, any number of times. -var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?' - -// characters that need to be escaped in RegExp. -var reSpecials = charSet('().*{}+?[]^$\\!') - -// "abc" -> { a:true, b:true, c:true } -function charSet (s) { - return s.split('').reduce(function (set, c) { - set[c] = true - return set - }, {}) -} - -// normalizes slashes. -var slashSplit = /\/+/ - -minimatch.filter = filter -function filter (pattern, options) { - options = options || {} - return function (p, i, list) { - return minimatch(p, pattern, options) - } -} - -function ext (a, b) { - a = a || {} - b = b || {} - var t = {} - Object.keys(b).forEach(function (k) { - t[k] = b[k] - }) - Object.keys(a).forEach(function (k) { - t[k] = a[k] - }) - return t -} - -minimatch.defaults = function (def) { - if (!def || !Object.keys(def).length) return minimatch - - var orig = minimatch - - var m = function minimatch (p, pattern, options) { - return orig.minimatch(p, pattern, ext(def, options)) - } - - m.Minimatch = function Minimatch (pattern, options) { - return new orig.Minimatch(pattern, ext(def, options)) - } - - return m -} - -Minimatch.defaults = function (def) { - if (!def || !Object.keys(def).length) return Minimatch - return minimatch.defaults(def).Minimatch -} - -function minimatch (p, pattern, options) { - if (typeof pattern !== 'string') { - throw new TypeError('glob pattern string required') - } - - if (!options) options = {} - - // shortcut: comments match nothing. - if (!options.nocomment && pattern.charAt(0) === '#') { - return false - } - - // "" only matches "" - if (pattern.trim() === '') return p === '' - - return new Minimatch(pattern, options).match(p) -} - -function Minimatch (pattern, options) { - if (!(this instanceof Minimatch)) { - return new Minimatch(pattern, options) - } - - if (typeof pattern !== 'string') { - throw new TypeError('glob pattern string required') - } - - if (!options) options = {} - pattern = pattern.trim() - - // windows support: need to use /, not \ - if (path.sep !== '/') { - pattern = pattern.split(path.sep).join('/') - } - - this.options = options - this.set = [] - this.pattern = pattern - this.regexp = null - this.negate = false - this.comment = false - this.empty = false - - // make the set of regexps etc. - this.make() -} - -Minimatch.prototype.debug = function () {} - -Minimatch.prototype.make = make -function make () { - // don't do it more than once. - if (this._made) return - - var pattern = this.pattern - var options = this.options - - // empty patterns and comments match nothing. - if (!options.nocomment && pattern.charAt(0) === '#') { - this.comment = true - return - } - if (!pattern) { - this.empty = true - return - } - - // step 1: figure out negation, etc. - this.parseNegate() - - // step 2: expand braces - var set = this.globSet = this.braceExpand() - - if (options.debug) this.debug = console.error - - this.debug(this.pattern, set) - - // step 3: now we have a set, so turn each one into a series of path-portion - // matching patterns. - // These will be regexps, except in the case of "**", which is - // set to the GLOBSTAR object for globstar behavior, - // and will not contain any / characters - set = this.globParts = set.map(function (s) { - return s.split(slashSplit) - }) - - this.debug(this.pattern, set) - - // glob --> regexps - set = set.map(function (s, si, set) { - return s.map(this.parse, this) - }, this) - - this.debug(this.pattern, set) - - // filter out everything that didn't compile properly. - set = set.filter(function (s) { - return s.indexOf(false) === -1 - }) - - this.debug(this.pattern, set) - - this.set = set -} - -Minimatch.prototype.parseNegate = parseNegate -function parseNegate () { - var pattern = this.pattern - var negate = false - var options = this.options - var negateOffset = 0 - - if (options.nonegate) return - - for (var i = 0, l = pattern.length - ; i < l && pattern.charAt(i) === '!' - ; i++) { - negate = !negate - negateOffset++ - } - - if (negateOffset) this.pattern = pattern.substr(negateOffset) - this.negate = negate -} - -// Brace expansion: -// a{b,c}d -> abd acd -// a{b,}c -> abc ac -// a{0..3}d -> a0d a1d a2d a3d -// a{b,c{d,e}f}g -> abg acdfg acefg -// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg -// -// Invalid sets are not expanded. -// a{2..}b -> a{2..}b -// a{b}c -> a{b}c -minimatch.braceExpand = function (pattern, options) { - return braceExpand(pattern, options) -} - -Minimatch.prototype.braceExpand = braceExpand - -function braceExpand (pattern, options) { - if (!options) { - if (this instanceof Minimatch) { - options = this.options - } else { - options = {} - } - } - - pattern = typeof pattern === 'undefined' - ? this.pattern : pattern - - if (typeof pattern === 'undefined') { - throw new TypeError('undefined pattern') - } - - if (options.nobrace || - !pattern.match(/\{.*\}/)) { - // shortcut. no need to expand. - return [pattern] - } - - return expand(pattern) -} - -// parse a component of the expanded set. -// At this point, no pattern may contain "/" in it -// so we're going to return a 2d array, where each entry is the full -// pattern, split on '/', and then turned into a regular expression. -// A regexp is made at the end which joins each array with an -// escaped /, and another full one which joins each regexp with |. -// -// Following the lead of Bash 4.1, note that "**" only has special meaning -// when it is the *only* thing in a path portion. Otherwise, any series -// of * is equivalent to a single *. Globstar behavior is enabled by -// default, and can be disabled by setting options.noglobstar. -Minimatch.prototype.parse = parse -var SUBPARSE = {} -function parse (pattern, isSub) { - if (pattern.length > 1024 * 64) { - throw new TypeError('pattern is too long') - } - - var options = this.options - - // shortcuts - if (!options.noglobstar && pattern === '**') return GLOBSTAR - if (pattern === '') return '' - - var re = '' - var hasMagic = !!options.nocase - var escaping = false - // ? => one single character - var patternListStack = [] - var negativeLists = [] - var stateChar - var inClass = false - var reClassStart = -1 - var classStart = -1 - // . and .. never match anything that doesn't start with ., - // even when options.dot is set. - var patternStart = pattern.charAt(0) === '.' ? '' // anything - // not (start or / followed by . or .. followed by / or end) - : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' - : '(?!\\.)' - var self = this - - function clearStateChar () { - if (stateChar) { - // we had some state-tracking character - // that wasn't consumed by this pass. - switch (stateChar) { - case '*': - re += star - hasMagic = true - break - case '?': - re += qmark - hasMagic = true - break - default: - re += '\\' + stateChar - break - } - self.debug('clearStateChar %j %j', stateChar, re) - stateChar = false - } - } - - for (var i = 0, len = pattern.length, c - ; (i < len) && (c = pattern.charAt(i)) - ; i++) { - this.debug('%s\t%s %s %j', pattern, i, re, c) - - // skip over any that are escaped. - if (escaping && reSpecials[c]) { - re += '\\' + c - escaping = false - continue - } - - switch (c) { - case '/': - // completely not allowed, even escaped. - // Should already be path-split by now. - return false - - case '\\': - clearStateChar() - escaping = true - continue - - // the various stateChar values - // for the "extglob" stuff. - case '?': - case '*': - case '+': - case '@': - case '!': - this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c) - - // all of those are literals inside a class, except that - // the glob [!a] means [^a] in regexp - if (inClass) { - this.debug(' in class') - if (c === '!' && i === classStart + 1) c = '^' - re += c - continue - } - - // if we already have a stateChar, then it means - // that there was something like ** or +? in there. - // Handle the stateChar, then proceed with this one. - self.debug('call clearStateChar %j', stateChar) - clearStateChar() - stateChar = c - // if extglob is disabled, then +(asdf|foo) isn't a thing. - // just clear the statechar *now*, rather than even diving into - // the patternList stuff. - if (options.noext) clearStateChar() - continue - - case '(': - if (inClass) { - re += '(' - continue - } - - if (!stateChar) { - re += '\\(' - continue - } - - patternListStack.push({ - type: stateChar, - start: i - 1, - reStart: re.length, - open: plTypes[stateChar].open, - close: plTypes[stateChar].close - }) - // negation is (?:(?!js)[^/]*) - re += stateChar === '!' ? '(?:(?!(?:' : '(?:' - this.debug('plType %j %j', stateChar, re) - stateChar = false - continue - - case ')': - if (inClass || !patternListStack.length) { - re += '\\)' - continue - } - - clearStateChar() - hasMagic = true - var pl = patternListStack.pop() - // negation is (?:(?!js)[^/]*) - // The others are (?:) - re += pl.close - if (pl.type === '!') { - negativeLists.push(pl) - } - pl.reEnd = re.length - continue - - case '|': - if (inClass || !patternListStack.length || escaping) { - re += '\\|' - escaping = false - continue - } - - clearStateChar() - re += '|' - continue - - // these are mostly the same in regexp and glob - case '[': - // swallow any state-tracking char before the [ - clearStateChar() - - if (inClass) { - re += '\\' + c - continue - } - - inClass = true - classStart = i - reClassStart = re.length - re += c - continue - - case ']': - // a right bracket shall lose its special - // meaning and represent itself in - // a bracket expression if it occurs - // first in the list. -- POSIX.2 2.8.3.2 - if (i === classStart + 1 || !inClass) { - re += '\\' + c - escaping = false - continue - } - - // handle the case where we left a class open. - // "[z-a]" is valid, equivalent to "\[z-a\]" - if (inClass) { - // split where the last [ was, make sure we don't have - // an invalid re. if so, re-walk the contents of the - // would-be class to re-translate any characters that - // were passed through as-is - // TODO: It would probably be faster to determine this - // without a try/catch and a new RegExp, but it's tricky - // to do safely. For now, this is safe and works. - var cs = pattern.substring(classStart + 1, i) - try { - RegExp('[' + cs + ']') - } catch (er) { - // not a valid class! - var sp = this.parse(cs, SUBPARSE) - re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]' - hasMagic = hasMagic || sp[1] - inClass = false - continue - } - } - - // finish up the class. - hasMagic = true - inClass = false - re += c - continue - - default: - // swallow any state char that wasn't consumed - clearStateChar() - - if (escaping) { - // no need - escaping = false - } else if (reSpecials[c] - && !(c === '^' && inClass)) { - re += '\\' - } - - re += c - - } // switch - } // for - - // handle the case where we left a class open. - // "[abc" is valid, equivalent to "\[abc" - if (inClass) { - // split where the last [ was, and escape it - // this is a huge pita. We now have to re-walk - // the contents of the would-be class to re-translate - // any characters that were passed through as-is - cs = pattern.substr(classStart + 1) - sp = this.parse(cs, SUBPARSE) - re = re.substr(0, reClassStart) + '\\[' + sp[0] - hasMagic = hasMagic || sp[1] - } - - // handle the case where we had a +( thing at the *end* - // of the pattern. - // each pattern list stack adds 3 chars, and we need to go through - // and escape any | chars that were passed through as-is for the regexp. - // Go through and escape them, taking care not to double-escape any - // | chars that were already escaped. - for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { - var tail = re.slice(pl.reStart + pl.open.length) - this.debug('setting tail', re, pl) - // maybe some even number of \, then maybe 1 \, followed by a | - tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) { - if (!$2) { - // the | isn't already escaped, so escape it. - $2 = '\\' - } - - // need to escape all those slashes *again*, without escaping the - // one that we need for escaping the | character. As it works out, - // escaping an even number of slashes can be done by simply repeating - // it exactly after itself. That's why this trick works. - // - // I am sorry that you have to see this. - return $1 + $1 + $2 + '|' - }) - - this.debug('tail=%j\n %s', tail, tail, pl, re) - var t = pl.type === '*' ? star - : pl.type === '?' ? qmark - : '\\' + pl.type - - hasMagic = true - re = re.slice(0, pl.reStart) + t + '\\(' + tail - } - - // handle trailing things that only matter at the very end. - clearStateChar() - if (escaping) { - // trailing \\ - re += '\\\\' - } - - // only need to apply the nodot start if the re starts with - // something that could conceivably capture a dot - var addPatternStart = false - switch (re.charAt(0)) { - case '.': - case '[': - case '(': addPatternStart = true - } - - // Hack to work around lack of negative lookbehind in JS - // A pattern like: *.!(x).!(y|z) needs to ensure that a name - // like 'a.xyz.yz' doesn't match. So, the first negative - // lookahead, has to look ALL the way ahead, to the end of - // the pattern. - for (var n = negativeLists.length - 1; n > -1; n--) { - var nl = negativeLists[n] - - var nlBefore = re.slice(0, nl.reStart) - var nlFirst = re.slice(nl.reStart, nl.reEnd - 8) - var nlLast = re.slice(nl.reEnd - 8, nl.reEnd) - var nlAfter = re.slice(nl.reEnd) - - nlLast += nlAfter - - // Handle nested stuff like *(*.js|!(*.json)), where open parens - // mean that we should *not* include the ) in the bit that is considered - // "after" the negated section. - var openParensBefore = nlBefore.split('(').length - 1 - var cleanAfter = nlAfter - for (i = 0; i < openParensBefore; i++) { - cleanAfter = cleanAfter.replace(/\)[+*?]?/, '') - } - nlAfter = cleanAfter - - var dollar = '' - if (nlAfter === '' && isSub !== SUBPARSE) { - dollar = '$' - } - var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast - re = newRe - } - - // if the re is not "" at this point, then we need to make sure - // it doesn't match against an empty path part. - // Otherwise a/* will match a/, which it should not. - if (re !== '' && hasMagic) { - re = '(?=.)' + re - } - - if (addPatternStart) { - re = patternStart + re - } - - // parsing just a piece of a larger pattern. - if (isSub === SUBPARSE) { - return [re, hasMagic] - } - - // skip the regexp for non-magical patterns - // unescape anything in it, though, so that it'll be - // an exact match against a file etc. - if (!hasMagic) { - return globUnescape(pattern) - } - - var flags = options.nocase ? 'i' : '' - try { - var regExp = new RegExp('^' + re + '$', flags) - } catch (er) { - // If it was an invalid regular expression, then it can't match - // anything. This trick looks for a character after the end of - // the string, which is of course impossible, except in multi-line - // mode, but it's not a /m regex. - return new RegExp('$.') - } - - regExp._glob = pattern - regExp._src = re - - return regExp -} - -minimatch.makeRe = function (pattern, options) { - return new Minimatch(pattern, options || {}).makeRe() -} - -Minimatch.prototype.makeRe = makeRe -function makeRe () { - if (this.regexp || this.regexp === false) return this.regexp - - // at this point, this.set is a 2d array of partial - // pattern strings, or "**". - // - // It's better to use .match(). This function shouldn't - // be used, really, but it's pretty convenient sometimes, - // when you just want to work with a regex. - var set = this.set - - if (!set.length) { - this.regexp = false - return this.regexp - } - var options = this.options - - var twoStar = options.noglobstar ? star - : options.dot ? twoStarDot - : twoStarNoDot - var flags = options.nocase ? 'i' : '' - - var re = set.map(function (pattern) { - return pattern.map(function (p) { - return (p === GLOBSTAR) ? twoStar - : (typeof p === 'string') ? regExpEscape(p) - : p._src - }).join('\\\/') - }).join('|') - - // must match entire pattern - // ending in a * or ** will make it less strict. - re = '^(?:' + re + ')$' - - // can match anything, as long as it's not this. - if (this.negate) re = '^(?!' + re + ').*$' - - try { - this.regexp = new RegExp(re, flags) - } catch (ex) { - this.regexp = false - } - return this.regexp -} - -minimatch.match = function (list, pattern, options) { - options = options || {} - var mm = new Minimatch(pattern, options) - list = list.filter(function (f) { - return mm.match(f) - }) - if (mm.options.nonull && !list.length) { - list.push(pattern) - } - return list -} - -Minimatch.prototype.match = match -function match (f, partial) { - this.debug('match', f, this.pattern) - // short-circuit in the case of busted things. - // comments, etc. - if (this.comment) return false - if (this.empty) return f === '' - - if (f === '/' && partial) return true - - var options = this.options - - // windows: need to use /, not \ - if (path.sep !== '/') { - f = f.split(path.sep).join('/') - } - - // treat the test path as a set of pathparts. - f = f.split(slashSplit) - this.debug(this.pattern, 'split', f) - - // just ONE of the pattern sets in this.set needs to match - // in order for it to be valid. If negating, then just one - // match means that we have failed. - // Either way, return on the first hit. - - var set = this.set - this.debug(this.pattern, 'set', set) - - // Find the basename of the path by looking for the last non-empty segment - var filename - var i - for (i = f.length - 1; i >= 0; i--) { - filename = f[i] - if (filename) break - } - - for (i = 0; i < set.length; i++) { - var pattern = set[i] - var file = f - if (options.matchBase && pattern.length === 1) { - file = [filename] - } - var hit = this.matchOne(file, pattern, partial) - if (hit) { - if (options.flipNegate) return true - return !this.negate - } - } - - // didn't get any hits. this is success if it's a negative - // pattern, failure otherwise. - if (options.flipNegate) return false - return this.negate -} - -// set partial to true to test if, for example, -// "/a/b" matches the start of "/*/b/*/d" -// Partial means, if you run out of file before you run -// out of pattern, then that's fine, as long as all -// the parts match. -Minimatch.prototype.matchOne = function (file, pattern, partial) { - var options = this.options - - this.debug('matchOne', - { 'this': this, file: file, pattern: pattern }) - - this.debug('matchOne', file.length, pattern.length) - - for (var fi = 0, - pi = 0, - fl = file.length, - pl = pattern.length - ; (fi < fl) && (pi < pl) - ; fi++, pi++) { - this.debug('matchOne loop') - var p = pattern[pi] - var f = file[fi] - - this.debug(pattern, p, f) - - // should be impossible. - // some invalid regexp stuff in the set. - if (p === false) return false - - if (p === GLOBSTAR) { - this.debug('GLOBSTAR', [pattern, p, f]) - - // "**" - // a/**/b/**/c would match the following: - // a/b/x/y/z/c - // a/x/y/z/b/c - // a/b/x/b/x/c - // a/b/c - // To do this, take the rest of the pattern after - // the **, and see if it would match the file remainder. - // If so, return success. - // If not, the ** "swallows" a segment, and try again. - // This is recursively awful. - // - // a/**/b/**/c matching a/b/x/y/z/c - // - a matches a - // - doublestar - // - matchOne(b/x/y/z/c, b/**/c) - // - b matches b - // - doublestar - // - matchOne(x/y/z/c, c) -> no - // - matchOne(y/z/c, c) -> no - // - matchOne(z/c, c) -> no - // - matchOne(c, c) yes, hit - var fr = fi - var pr = pi + 1 - if (pr === pl) { - this.debug('** at the end') - // a ** at the end will just swallow the rest. - // We have found a match. - // however, it will not swallow /.x, unless - // options.dot is set. - // . and .. are *never* matched by **, for explosively - // exponential reasons. - for (; fi < fl; fi++) { - if (file[fi] === '.' || file[fi] === '..' || - (!options.dot && file[fi].charAt(0) === '.')) return false - } - return true - } - - // ok, let's see if we can swallow whatever we can. - while (fr < fl) { - var swallowee = file[fr] - - this.debug('\nglobstar while', file, fr, pattern, pr, swallowee) - - // XXX remove this slice. Just pass the start index. - if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { - this.debug('globstar found match!', fr, fl, swallowee) - // found a match. - return true - } else { - // can't swallow "." or ".." ever. - // can only swallow ".foo" when explicitly asked. - if (swallowee === '.' || swallowee === '..' || - (!options.dot && swallowee.charAt(0) === '.')) { - this.debug('dot detected!', file, fr, pattern, pr) - break - } - - // ** swallows a segment, and continue. - this.debug('globstar swallow a segment, and continue') - fr++ - } - } - - // no match was found. - // However, in partial mode, we can't say this is necessarily over. - // If there's more *pattern* left, then - if (partial) { - // ran out of file - this.debug('\n>>> no match, partial?', file, fr, pattern, pr) - if (fr === fl) return true - } - return false - } - - // something other than ** - // non-magic patterns just have to match exactly - // patterns with magic have been turned into regexps. - var hit - if (typeof p === 'string') { - if (options.nocase) { - hit = f.toLowerCase() === p.toLowerCase() - } else { - hit = f === p - } - this.debug('string match', p, f, hit) - } else { - hit = f.match(p) - this.debug('pattern match', p, f, hit) - } - - if (!hit) return false - } - - // Note: ending in / means that we'll get a final "" - // at the end of the pattern. This can only match a - // corresponding "" at the end of the file. - // If the file ends in /, then it can only match a - // a pattern that ends in /, unless the pattern just - // doesn't have any more for it. But, a/b/ should *not* - // match "a/b/*", even though "" matches against the - // [^/]*? pattern, except in partial mode, where it might - // simply not be reached yet. - // However, a/b/ should still satisfy a/* - - // now either we fell off the end of the pattern, or we're done. - if (fi === fl && pi === pl) { - // ran out of pattern and filename at the same time. - // an exact hit! - return true - } else if (fi === fl) { - // ran out of file, but still had pattern left. - // this is ok if we're doing the match as part of - // a glob fs traversal. - return partial - } else if (pi === pl) { - // ran out of pattern, still have file left. - // this is only acceptable if we're on the very last - // empty segment of a file with a trailing slash. - // a/* should match a/b/ - var emptyFileEnd = (fi === fl - 1) && (file[fi] === '') - return emptyFileEnd - } - - // should be unreachable. - throw new Error('wtf?') -} - -// replace stuff like \* with * -function globUnescape (s) { - return s.replace(/\\(.)/g, '$1') -} - -function regExpEscape (s) { - return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') -} - - -/***/ }), - -/***/ "./node_modules/q/q.js": +/*! no static exports found */function(e,t,n){e.exports=l,l.Minimatch=d;var r={sep:"/"};try{r=n(/*! path */"path")}catch(e){}var i=l.GLOBSTAR=d.GLOBSTAR={},o=n(/*! brace-expansion */"./node_modules/brace-expansion/index.js"),s={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},a="().*{}+?[]^$\\!".split("").reduce((function(e,t){return e[t]=!0,e}),{});var c=/\/+/;function u(e,t){e=e||{},t=t||{};var n={};return Object.keys(t).forEach((function(e){n[e]=t[e]})),Object.keys(e).forEach((function(t){n[t]=e[t]})),n}function l(e,t,n){if("string"!=typeof t)throw new TypeError("glob pattern string required");return n||(n={}),!(!n.nocomment&&"#"===t.charAt(0))&&(""===t.trim()?""===e:new d(t,n).match(e))}function d(e,t){if(!(this instanceof d))return new d(e,t);if("string"!=typeof e)throw new TypeError("glob pattern string required");t||(t={}),e=e.trim(),"/"!==r.sep&&(e=e.split(r.sep).join("/")),this.options=t,this.set=[],this.pattern=e,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.make()}function p(e,t){if(t||(t=this instanceof d?this.options:{}),void 0===(e=void 0===e?this.pattern:e))throw new TypeError("undefined pattern");return t.nobrace||!e.match(/\{.*\}/)?[e]:o(e)}l.filter=function(e,t){return t=t||{},function(n,r,i){return l(n,e,t)}},l.defaults=function(e){if(!e||!Object.keys(e).length)return l;var t=l,n=function(n,r,i){return t.minimatch(n,r,u(e,i))};return n.Minimatch=function(n,r){return new t.Minimatch(n,u(e,r))},n},d.defaults=function(e){return e&&Object.keys(e).length?l.defaults(e).Minimatch:d},d.prototype.debug=function(){},d.prototype.make=function(){if(this._made)return;var e=this.pattern,t=this.options;if(!t.nocomment&&"#"===e.charAt(0))return void(this.comment=!0);if(!e)return void(this.empty=!0);this.parseNegate();var n=this.globSet=this.braceExpand();t.debug&&(this.debug=console.error);this.debug(this.pattern,n),n=this.globParts=n.map((function(e){return e.split(c)})),this.debug(this.pattern,n),n=n.map((function(e,t,n){return e.map(this.parse,this)}),this),this.debug(this.pattern,n),n=n.filter((function(e){return-1===e.indexOf(!1)})),this.debug(this.pattern,n),this.set=n},d.prototype.parseNegate=function(){var e=this.pattern,t=!1,n=this.options,r=0;if(n.nonegate)return;for(var i=0,o=e.length;i65536)throw new TypeError("pattern is too long");var n=this.options;if(!n.noglobstar&&"**"===e)return i;if(""===e)return"";var r,o="",c=!!n.nocase,u=!1,l=[],d=[],p=!1,h=-1,g=-1,y="."===e.charAt(0)?"":n.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",m=this;function v(){if(r){switch(r){case"*":o+="[^/]*?",c=!0;break;case"?":o+="[^/]",c=!0;break;default:o+="\\"+r}m.debug("clearStateChar %j %j",r,o),r=!1}}for(var _,b=0,w=e.length;b-1;A--){var P=d[A],k=o.slice(0,P.reStart),C=o.slice(P.reStart,P.reEnd-8),R=o.slice(P.reEnd-8,P.reEnd),N=o.slice(P.reEnd);R+=N;var I=k.split("(").length-1,M=N;for(b=0;b=0&&!(i=e[o]);o--);for(o=0;o>> no match, partial?",e,p,t,f),p!==a))}if("string"==typeof l?(u=r.nocase?d.toLowerCase()===l.toLowerCase():d===l,this.debug("string match",l,d,u)):(u=d.match(l),this.debug("pattern match",l,d,u)),!u)return!1}if(o===a&&s===c)return!0;if(o===a)return n;if(s===c)return o===a-1&&""===e[o];throw new Error("wtf?")}},"./node_modules/q/q.js": /*!*****************************!*\ !*** ./node_modules/q/q.js ***! \*****************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -// vim:ts=4:sts=4:sw=4: +/*! no static exports found */function(e,t,n){ /*! * * Copyright 2009-2017 Kris Kowal under the terms of the MIT @@ -8588,9916 +249,279 @@ function regExpEscape (s) { * limitations under the License. * */ +!function(t){"use strict";"function"==typeof bootstrap?bootstrap("promise",t):e.exports=t()}((function(){"use strict";var e=!1;try{throw new Error}catch(t){e=!!t.stack}var t,n=w(),r=function(){},i=function(){var e={task:void 0,next:null},t=e,n=!1,r=void 0,o=!1,s=[];function a(){for(var t,r;e.next;)t=(e=e.next).task,e.task=void 0,(r=e.domain)&&(e.domain=void 0,r.enter()),c(t,r);for(;s.length;)c(t=s.pop());n=!1}function c(e,t){try{e()}catch(e){if(o)throw t&&t.exit(),setTimeout(a,0),t&&t.enter(),e;setTimeout((function(){throw e}),0)}t&&t.exit()}if(i=function(e){t=t.next={task:e,domain:o&&process.domain,next:null},n||(n=!0,r())},"object"==typeof process&&"[object process]"===process.toString()&&process.nextTick)o=!0,r=function(){process.nextTick(a)};else if("function"==typeof setImmediate)r="undefined"!=typeof window?setImmediate.bind(window,a):function(){setImmediate(a)};else if("undefined"!=typeof MessageChannel){var u=new MessageChannel;u.port1.onmessage=function(){r=l,u.port1.onmessage=a,a()};var l=function(){u.port2.postMessage(0)};r=function(){setTimeout(a,0),l()}}else r=function(){setTimeout(a,0)};return i.runAfter=function(e){s.push(e),n||(n=!0,r())},i}(),o=Function.call;function s(e){return function(){return o.apply(e,arguments)}}var a,c=s(Array.prototype.slice),u=s(Array.prototype.reduce||function(e,t){var n=0,r=this.length;if(1===arguments.length)for(;;){if(n in this){t=this[n++];break}if(++n>=r)throw new TypeError}for(;ni.stackCounter)&&(f(t,"__minimumStackCounter__",{value:i.stackCounter,configurable:!0}),r.unshift(i.stack));r.unshift(t.stack);var o=function(e){for(var t=e.split("\n"),n=[],r=0;r=n&&o<=z}function w(){if(e)try{throw new Error}catch(e){var n=e.stack.split("\n"),r=_(n[0].indexOf("@")>0?n[1]:n[2]);if(!r)return;return t=r[0],r[1]}}function S(e){return e instanceof O?e:C(e)?function(e){var t=j();return S.nextTick((function(){try{e.then(t.resolve,t.reject,t.notify)}catch(e){t.reject(e)}})),t.promise}(e):q(e)}S.resolve=S,S.nextTick=i,S.longStackSupport=!1;var E=1;function j(){var t,n=[],r=[],i=p(j.prototype),o=p(O.prototype);if(o.promiseDispatch=function(e,i,o){var s=c(arguments);n?(n.push(s),"when"===i&&o[1]&&r.push(o[1])):S.nextTick((function(){t.promiseDispatch.apply(t,s)}))},o.valueOf=function(){if(n)return o;var e=P(t);return k(e)&&(t=e),e},o.inspect=function(){return t?t.inspect():{state:"pending"}},S.longStackSupport&&e)try{throw new Error}catch(e){o.stack=e.stack.substring(e.stack.indexOf("\n")+1),o.stackCounter=E++}function s(i){t=i,S.longStackSupport&&e&&(o.source=i),u(n,(function(e,t){S.nextTick((function(){i.promiseDispatch.apply(i,t)}))}),void 0),n=void 0,r=void 0}return i.promise=o,i.resolve=function(e){t||s(S(e))},i.fulfill=function(e){t||s(q(e))},i.reject=function(e){t||s(U(e))},i.notify=function(e){t||u(r,(function(t,n){S.nextTick((function(){n(e)}))}),void 0)},i}function x(e){if("function"!=typeof e)throw new TypeError("resolver must be a function.");var t=j();try{e(t.resolve,t.reject,t.notify)}catch(e){t.reject(e)}return t.promise}function T(e){return x((function(t,n){for(var r=0,i=e.length;r2?e.resolve(c(arguments,1)):e.resolve(n)}},S.Promise=x,S.promise=x,x.race=T,x.all=H,x.reject=U,x.resolve=S,S.passByCopy=function(e){return e},O.prototype.passByCopy=function(){return this},S.join=function(e,t){return S(e).join(t)},O.prototype.join=function(e){return S([this,e]).spread((function(e,t){if(e===t)return e;throw new Error("Q can't join: not the same: "+e+" "+t)}))},S.race=T,O.prototype.race=function(){return this.then(S.race)},S.makePromise=O,O.prototype.toString=function(){return"[object Promise]"},O.prototype.then=function(e,t,n){var r=this,i=j(),o=!1;return S.nextTick((function(){r.promiseDispatch((function(t){o||(o=!0,i.resolve(function(t){try{return"function"==typeof e?e(t):t}catch(e){return U(e)}}(t)))}),"when",[function(e){o||(o=!0,i.resolve(function(e){if("function"==typeof t){v(e,r);try{return t(e)}catch(e){return U(e)}}return U(e)}(e)))}])})),r.promiseDispatch(void 0,"when",[void 0,function(e){var t,r=!1;try{t=function(e){return"function"==typeof n?n(e):e}(e)}catch(e){if(r=!0,!S.onerror)throw e;S.onerror(e)}r||i.notify(t)}]),i.promise},S.tap=function(e,t){return S(e).tap(t)},O.prototype.tap=function(e){return e=S(e),this.then((function(t){return e.fcall(t).thenResolve(t)}))},S.when=A,O.prototype.thenResolve=function(e){return this.then((function(){return e}))},S.thenResolve=function(e,t){return S(e).thenResolve(t)},O.prototype.thenReject=function(e){return this.then((function(){throw e}))},S.thenReject=function(e,t){return S(e).thenReject(t)},S.nearer=P,S.isPromise=k,S.isPromiseAlike=C,S.isPending=function(e){return k(e)&&"pending"===e.inspect().state},O.prototype.isPending=function(){return"pending"===this.inspect().state},S.isFulfilled=function(e){return!k(e)||"fulfilled"===e.inspect().state},O.prototype.isFulfilled=function(){return"fulfilled"===this.inspect().state},S.isRejected=function(e){return k(e)&&"rejected"===e.inspect().state},O.prototype.isRejected=function(){return"rejected"===this.inspect().state};var R,N,I,M=[],D=[],B=[],F=!0;function L(){M.length=0,D.length=0,F||(F=!0)}function U(e){var t=O({when:function(t){return t&&function(e){if(F){var t=l(D,e);-1!==t&&("object"==typeof process&&"function"==typeof process.emit&&S.nextTick.runAfter((function(){var n=l(B,e);-1!==n&&(process.emit("rejectionHandled",M[t],e),B.splice(n,1))})),D.splice(t,1),M.splice(t,1))}}(this),t?t(e):this}},(function(){return this}),(function(){return{state:"rejected",reason:e}}));return function(e,t){F&&("object"==typeof process&&"function"==typeof process.emit&&S.nextTick.runAfter((function(){-1!==l(D,e)&&(process.emit("unhandledRejection",t,e),B.push(e))})),D.push(e),t&&void 0!==t.stack?M.push(t.stack):M.push("(no stack) "+t))}(t,e),t}function q(e){return O({when:function(){return e},get:function(t){return e[t]},set:function(t,n){e[t]=n},delete:function(t){delete e[t]},post:function(t,n){return null==t?e.apply(void 0,n):e[t].apply(e,n)},apply:function(t,n){return e.apply(t,n)},keys:function(){return g(e)}},void 0,(function(){return{state:"fulfilled",value:e}}))}function V(e,t,n){return S(e).spread(t,n)}function G(e,t,n){return S(e).dispatch(t,n)}function H(e){return A(e,(function(e){var t=0,n=j();return u(e,(function(r,i,o){var s;k(i)&&"fulfilled"===(s=i.inspect()).state?e[o]=s.value:(++t,A(i,(function(r){e[o]=r,0==--t&&n.resolve(e)}),n.reject,(function(e){n.notify({index:o,value:e})})))}),void 0),0===t&&n.resolve(e),n.promise}))}function W(e){if(0===e.length)return S.resolve();var t=S.defer(),n=0;return u(e,(function(r,i,o){var s=e[o];n++,A(s,(function(e){t.resolve(e)}),(function(e){if(0===--n){var r=e||new Error(""+e);r.message="Q can't get fulfillment value from any promise, all promises were rejected. Last error message: "+r.message,t.reject(r)}}),(function(e){t.notify({index:o,value:e})}))}),void 0),t.promise}function $(e){return A(e,(function(e){return e=d(e,S),A(H(d(e,(function(e){return A(e,r,r)}))),(function(){return e}))}))}S.resetUnhandledRejections=L,S.getUnhandledReasons=function(){return M.slice()},S.stopUnhandledRejectionTracking=function(){L(),F=!1},L(),S.reject=U,S.fulfill=q,S.master=function(e){return O({isDef:function(){}},(function(t,n){return G(e,t,n)}),(function(){return S(e).inspect()}))},S.spread=V,O.prototype.spread=function(e,t){return this.all().then((function(t){return e.apply(void 0,t)}),t)},S.async=function(e){return function(){function t(e,t){var o;if("undefined"==typeof StopIteration){try{o=n[e](t)}catch(e){return U(e)}return o.done?S(o.value):A(o.value,r,i)}try{o=n[e](t)}catch(e){return m(e)?S(e.value):U(e)}return A(o,r,i)}var n=e.apply(this,arguments),r=t.bind(t,"next"),i=t.bind(t,"throw");return r()}},S.spawn=function(e){S.done(S.async(e)())},S.return=function(e){throw new a(e)},S.promised=function(e){return function(){return V([this,H(arguments)],(function(t,n){return e.apply(t,n)}))}},S.dispatch=G,O.prototype.dispatch=function(e,t){var n=this,r=j();return S.nextTick((function(){n.promiseDispatch(r.resolve,e,t)})),r.promise},S.get=function(e,t){return S(e).dispatch("get",[t])},O.prototype.get=function(e){return this.dispatch("get",[e])},S.set=function(e,t,n){return S(e).dispatch("set",[t,n])},O.prototype.set=function(e,t){return this.dispatch("set",[e,t])},S.del=S.delete=function(e,t){return S(e).dispatch("delete",[t])},O.prototype.del=O.prototype.delete=function(e){return this.dispatch("delete",[e])},S.mapply=S.post=function(e,t,n){return S(e).dispatch("post",[t,n])},O.prototype.mapply=O.prototype.post=function(e,t){return this.dispatch("post",[e,t])},S.send=S.mcall=S.invoke=function(e,t){return S(e).dispatch("post",[t,c(arguments,2)])},O.prototype.send=O.prototype.mcall=O.prototype.invoke=function(e){return this.dispatch("post",[e,c(arguments,1)])},S.fapply=function(e,t){return S(e).dispatch("apply",[void 0,t])},O.prototype.fapply=function(e){return this.dispatch("apply",[void 0,e])},S.try=S.fcall=function(e){return S(e).dispatch("apply",[void 0,c(arguments,1)])},O.prototype.fcall=function(){return this.dispatch("apply",[void 0,c(arguments)])},S.fbind=function(e){var t=S(e),n=c(arguments,1);return function(){return t.dispatch("apply",[this,n.concat(c(arguments))])}},O.prototype.fbind=function(){var e=this,t=c(arguments);return function(){return e.dispatch("apply",[this,t.concat(c(arguments))])}},S.keys=function(e){return S(e).dispatch("keys",[])},O.prototype.keys=function(){return this.dispatch("keys",[])},S.all=H,O.prototype.all=function(){return H(this)},S.any=W,O.prototype.any=function(){return W(this)},S.allResolved=(R=$,N="allResolved",I="allSettled",function(){return"undefined"!=typeof console&&"function"==typeof console.warn&&console.warn(N+" is deprecated, use "+I+" instead.",new Error("").stack),R.apply(R,arguments)}),O.prototype.allResolved=function(){return $(this)},S.allSettled=function(e){return S(e).allSettled()},O.prototype.allSettled=function(){return this.then((function(e){return H(d(e,(function(e){function t(){return e.inspect()}return(e=S(e)).then(t,t)})))}))},S.fail=S.catch=function(e,t){return S(e).then(void 0,t)},O.prototype.fail=O.prototype.catch=function(e){return this.then(void 0,e)},S.progress=function(e,t){return S(e).then(void 0,void 0,t)},O.prototype.progress=function(e){return this.then(void 0,void 0,e)},S.fin=S.finally=function(e,t){return S(e).finally(t)},O.prototype.fin=O.prototype.finally=function(e){if(!e||"function"!=typeof e.apply)throw new Error("Q can't apply finally callback");return e=S(e),this.then((function(t){return e.fcall().then((function(){return t}))}),(function(t){return e.fcall().then((function(){throw t}))}))},S.done=function(e,t,n,r){return S(e).done(t,n,r)},O.prototype.done=function(e,t,n){var r=function(e){S.nextTick((function(){if(v(e,i),!S.onerror)throw e;S.onerror(e)}))},i=e||t||n?this.then(e,t,n):this;"object"==typeof process&&process&&process.domain&&(r=process.domain.bind(r)),i.then(void 0,r)},S.timeout=function(e,t,n){return S(e).timeout(t,n)},O.prototype.timeout=function(e,t){var n=j(),r=setTimeout((function(){t&&"string"!=typeof t||((t=new Error(t||"Timed out after "+e+" ms")).code="ETIMEDOUT"),n.reject(t)}),e);return this.then((function(e){clearTimeout(r),n.resolve(e)}),(function(e){clearTimeout(r),n.reject(e)}),n.notify),n.promise},S.delay=function(e,t){return void 0===t&&(t=e,e=void 0),S(e).delay(t)},O.prototype.delay=function(e){return this.then((function(t){var n=j();return setTimeout((function(){n.resolve(t)}),e),n.promise}))},S.nfapply=function(e,t){return S(e).nfapply(t)},O.prototype.nfapply=function(e){var t=j(),n=c(e);return n.push(t.makeNodeResolver()),this.fapply(n).fail(t.reject),t.promise},S.nfcall=function(e){var t=c(arguments,1);return S(e).nfapply(t)},O.prototype.nfcall=function(){var e=c(arguments),t=j();return e.push(t.makeNodeResolver()),this.fapply(e).fail(t.reject),t.promise},S.nfbind=S.denodeify=function(e){if(void 0===e)throw new Error("Q can't wrap an undefined function");var t=c(arguments,1);return function(){var n=t.concat(c(arguments)),r=j();return n.push(r.makeNodeResolver()),S(e).fapply(n).fail(r.reject),r.promise}},O.prototype.nfbind=O.prototype.denodeify=function(){var e=c(arguments);return e.unshift(this),S.denodeify.apply(void 0,e)},S.nbind=function(e,t){var n=c(arguments,2);return function(){var r=n.concat(c(arguments)),i=j();function o(){return e.apply(t,arguments)}return r.push(i.makeNodeResolver()),S(o).fapply(r).fail(i.reject),i.promise}},O.prototype.nbind=function(){var e=c(arguments,0);return e.unshift(this),S.nbind.apply(void 0,e)},S.nmapply=S.npost=function(e,t,n){return S(e).npost(t,n)},O.prototype.nmapply=O.prototype.npost=function(e,t){var n=c(t||[]),r=j();return n.push(r.makeNodeResolver()),this.dispatch("post",[e,n]).fail(r.reject),r.promise},S.nsend=S.nmcall=S.ninvoke=function(e,t){var n=c(arguments,2),r=j();return n.push(r.makeNodeResolver()),S(e).dispatch("post",[t,n]).fail(r.reject),r.promise},O.prototype.nsend=O.prototype.nmcall=O.prototype.ninvoke=function(e){var t=c(arguments,1),n=j();return t.push(n.makeNodeResolver()),this.dispatch("post",[e,t]).fail(n.reject),n.promise},S.nodeify=function(e,t){return S(e).nodeify(t)},O.prototype.nodeify=function(e){if(!e)return this;this.then((function(t){S.nextTick((function(){e(null,t)}))}),(function(t){S.nextTick((function(){e(t)}))}))},S.noConflict=function(){throw new Error("Q.noConflict only works when Q is used as a global")};var z=w();return S}))},"./node_modules/qs/lib/formats.js": +/*!****************************************!*\ + !*** ./node_modules/qs/lib/formats.js ***! + \****************************************/ +/*! no static exports found */function(e,t,n){"use strict";var r=String.prototype.replace,i=/%20/g,o=n(/*! ./utils */"./node_modules/qs/lib/utils.js"),s={RFC1738:"RFC1738",RFC3986:"RFC3986"};e.exports=o.assign({default:s.RFC3986,formatters:{RFC1738:function(e){return r.call(e,i,"+")},RFC3986:function(e){return String(e)}}},s)},"./node_modules/qs/lib/index.js": +/*!**************************************!*\ + !*** ./node_modules/qs/lib/index.js ***! + \**************************************/ +/*! no static exports found */function(e,t,n){"use strict";var r=n(/*! ./stringify */"./node_modules/qs/lib/stringify.js"),i=n(/*! ./parse */"./node_modules/qs/lib/parse.js"),o=n(/*! ./formats */"./node_modules/qs/lib/formats.js");e.exports={formats:o,parse:i,stringify:r}},"./node_modules/qs/lib/parse.js": +/*!**************************************!*\ + !*** ./node_modules/qs/lib/parse.js ***! + \**************************************/ +/*! no static exports found */function(e,t,n){"use strict";var r=n(/*! ./utils */"./node_modules/qs/lib/utils.js"),i=Object.prototype.hasOwnProperty,o=Array.isArray,s={allowDots:!1,allowPrototypes:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:r.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},a=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},c=function(e,t,n){if(e){var r=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,o=/(\[[^[\]]*])/g,s=n.depth>0&&/(\[[^[\]]*])/.exec(r),a=s?r.slice(0,s.index):r,c=[];if(a){if(!n.plainObjects&&i.call(Object.prototype,a)&&!n.allowPrototypes)return;c.push(a)}for(var u=0;n.depth>0&&null!==(s=o.exec(r))&&u=0;--i){var o,s=e[i];if("[]"===s&&n.parseArrays)o=[].concat(r);else{o=n.plainObjects?Object.create(null):{};var a="["===s.charAt(0)&&"]"===s.charAt(s.length-1)?s.slice(1,-1):s,c=parseInt(a,10);n.parseArrays||""!==a?!isNaN(c)&&s!==a&&String(c)===a&&c>=0&&n.parseArrays&&c<=n.arrayLimit?(o=[])[c]=r:o[a]=r:o={0:r}}r=o}return r}(c,t,n)}};e.exports=function(e,t){var n=function(e){if(!e)return s;if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new Error("The charset option must be either utf-8, iso-8859-1, or undefined");var t=void 0===e.charset?s.charset:e.charset;return{allowDots:void 0===e.allowDots?s.allowDots:!!e.allowDots,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:s.allowPrototypes,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:s.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:s.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:s.comma,decoder:"function"==typeof e.decoder?e.decoder:s.decoder,delimiter:"string"==typeof e.delimiter||r.isRegExp(e.delimiter)?e.delimiter:s.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:s.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:s.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:s.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:s.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:s.strictNullHandling}}(t);if(""===e||null==e)return n.plainObjects?Object.create(null):{};for(var u="string"==typeof e?function(e,t){var n,c={},u=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,l=t.parameterLimit===1/0?void 0:t.parameterLimit,d=u.split(t.delimiter,l),p=-1,f=t.charset;if(t.charsetSentinel)for(n=0;n-1&&(g=g.split(",")),y.indexOf("[]=")>-1&&(g=o(g)?[g]:g),i.call(c,h)?c[h]=r.combine(c[h],g):c[h]=g}return c}(e,n):e,l=n.plainObjects?Object.create(null):{},d=Object.keys(u),p=0;p0?v+m:""}},"./node_modules/qs/lib/utils.js": +/*!**************************************!*\ + !*** ./node_modules/qs/lib/utils.js ***! + \**************************************/ +/*! no static exports found */function(e,t,n){"use strict";var r=Object.prototype.hasOwnProperty,i=Array.isArray,o=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),s=function(e,t){for(var n=t&&t.plainObjects?Object.create(null):{},r=0;r1;){var t=e.pop(),n=t.obj[t.prop];if(i(n)){for(var r=[],o=0;o=48&&a<=57||a>=65&&a<=90||a>=97&&a<=122?i+=r.charAt(s):a<128?i+=o[a]:a<2048?i+=o[192|a>>6]+o[128|63&a]:a<55296||a>=57344?i+=o[224|a>>12]+o[128|a>>6&63]+o[128|63&a]:(s+=1,a=65536+((1023&a)<<10|1023&r.charCodeAt(s)),i+=o[240|a>>18]+o[128|a>>12&63]+o[128|a>>6&63]+o[128|63&a])}return i},isBuffer:function(e){return!(!e||"object"!=typeof e)&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},merge:function e(t,n,o){if(!n)return t;if("object"!=typeof n){if(i(t))t.push(n);else{if(!t||"object"!=typeof t)return[t,n];(o&&(o.plainObjects||o.allowPrototypes)||!r.call(Object.prototype,n))&&(t[n]=!0)}return t}if(!t||"object"!=typeof t)return[t].concat(n);var a=t;return i(t)&&!i(n)&&(a=s(t,o)),i(t)&&i(n)?(n.forEach((function(n,i){if(r.call(t,i)){var s=t[i];s&&"object"==typeof s&&n&&"object"==typeof n?t[i]=e(s,n,o):t.push(n)}else t[i]=n})),t):Object.keys(n).reduce((function(t,i){var s=n[i];return r.call(t,i)?t[i]=e(t[i],s,o):t[i]=s,t}),a)}}},"./node_modules/reflect-metadata/Reflect.js": +/*!**************************************************!*\ + !*** ./node_modules/reflect-metadata/Reflect.js ***! + \**************************************************/ +/*! no static exports found */function(e,t){ +/*! ***************************************************************************** +Copyright (C) Microsoft. All rights reserved. +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 http://www.apache.org/licenses/LICENSE-2.0 -(function (definition) { - "use strict"; - - // This file will function properly as a