type2docfx
Version:
A tool to convert json format output from TypeDoc to universal reference model for DocFx to consume.
1 lines • 120 kB
JavaScript
var msRest=function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=17)}([function(e,t,r){"use strict";(function(e){function n(){return"undefined"!=typeof window&&window.fetch&&window.navigator&&window.navigator.userAgent&&-1===window.navigator.userAgent.indexOf("Edge/")?window.fetch.bind(window):r(22)({useCookie:!0}).fetch}var i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new r(function(t){t(e.value)}).then(s,a)}u((n=n.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){function r(e){return function(t){return n([e,t])}}function n(r){if(i)throw new TypeError("Generator is already executing.");for(;u;)try{if(i=1,o&&(s=o[2&r[0]?"return":r[0]?"throw":"next"])&&!(s=s.call(o,r[1])).done)return s;switch(o=0,s&&(r=[0,s.value]),r[0]){case 0:case 1:s=r;break;case 4:return u.label++,{value:r[1],done:!1};case 5:u.label++,o=r[1],r=[0];continue;case 7:r=u.ops.pop(),u.trys.pop();continue;default:if(s=u.trys,!(s=s.length>0&&s[s.length-1])&&(6===r[0]||2===r[0])){u=0;continue}if(3===r[0]&&(!s||r[1]>s[0]&&r[1]<s[3])){u.label=r[1];break}if(6===r[0]&&u.label<s[1]){u.label=s[1],s=r;break}if(s&&u.label<s[2]){u.label=s[2],u.ops.push(r);break}s[2]&&u.ops.pop(),u.trys.pop();continue}r=t.call(e,u)}catch(e){r=[6,e],o=0}finally{i=s=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}var i,o,s,a,u={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return a={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a};Object.defineProperty(t,"__esModule",{value:!0});var s=r(18),a=r(21),u=r(3),l=r(2),c=r(7),h=r(8);t.getFetch=n,t.myFetch=n(),t.isNode="undefined"==typeof navigator&&void 0!==e,t.urlIsHTTPS=function(e){return e.protocol.toLowerCase()===l.Constants.HTTPS},t.objectIsNull=function(e){return null===e||void 0===e},t.encodeUri=function(e){return encodeURIComponent(e).replace(/!/g,"%21").replace(/"/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A")},t.stripResponse=function(e){var t={};return t.body=e.body,t.headers=e.headers,t.status=e.status,t},t.stripRequest=function(e){var t=new u.WebResource;try{(t=JSON.parse(JSON.stringify(e))).headers&&t.headers.Authorization?delete t.headers.Authorization:t.headers&&t.headers.authorization&&delete t.headers.authorization}catch(t){var r=t.message;return t.message='Error - "'+r+'" occured while creating a stripped version of the request object - "'+e+'".',t}return t},t.isValidUuid=function(e){return new RegExp("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$","ig").test(e)},t.objectValues=function(e){var t=[];if(!(e&&e instanceof Object))throw new Error("The provided object "+JSON.stringify(e,void 0,2)+" is not a valid object that can be enumerated to provide its values as an array.");for(var r in e)e.hasOwnProperty(r)&&t.push(e[r]);return t},t.generateUuid=function(){return s.v4()},t.executePromisesSequentially=function(e,t){var r=Promise.resolve(t);return e.forEach(function(e){r=r.then(e)}),r},t.mergeObjects=function(e,t){return Object.keys(e).forEach(function(r){t[r]=e[r]}),t},t.delay=function(e,t){return new Promise(function(r){return setTimeout(function(){return r(t)},e)})},t.strEnum=function(e){return e.reduce(function(e,t){return e[t]=t,e},Object.create(null))},t.promiseToCallback=function(t){if("function"!=typeof t.then)throw new Error("The provided input is not a Promise.");return function(r){t.then(function(t){e.nextTick(r,void 0,t)},function(t){e.nextTick(r,t)})}},t.promiseToServiceCallback=function(t){if("function"!=typeof t.then)throw new Error("The provided input is not a Promise.");return function(r){t.then(function(t){e.nextTick(r,void 0,t.bodyAsJson,t.request,t.response)},function(t){e.nextTick(r,t)})}},t.dispatchRequest=function(e){return i(this,void 0,void 0,function(){var r,n,i,s,u,l,f,d,p,m,y,v,_,g;return o(this,function(o){switch(o.label){case 0:if(!e)return[2,Promise.reject(new Error("options (WebResource) cannot be null or undefined and must be of type object."))];if(e.formData){r=e.formData,n=new a,i=function(e,t){t&&t.hasOwnProperty("value")&&t.hasOwnProperty("options")?n.append(e,t.value,t.options):n.append(e,t)};for(s in r)if(r.hasOwnProperty(s))if((u=r[s])instanceof Array)for(l=0;l<u.length;l++)i(s,u[l]);else i(s,u);e.body=n,e.formData=void 0,e.headers&&e.headers["Content-Type"]&&e.headers["Content-Type"].indexOf("multipart/form-data")>-1&&"function"==typeof n.getBoundary&&(e.headers["Content-Type"]="multipart/form-data; boundary="+n.getBoundary())}o.label=1;case 1:return o.trys.push([1,3,,4]),[4,t.myFetch(e.url,e)];case 2:return f=o.sent(),[3,4];case 3:return d=o.sent(),[2,Promise.reject(d)];case 4:if(p=new h.HttpOperationResponse(e,f),e.rawResponse)return[3,9];o.label=5;case 5:return o.trys.push([5,7,,8]),m=p,[4,f.text()];case 6:return m.bodyAsText=o.sent(),[3,8];case 7:return y=o.sent(),v='Error "'+y+'" occured while converting the raw response body into string.',_=y.code||"RAWTEXT_CONVERSION_ERROR",g=new c.RestError(v,_,f.status,e,f,f.body),[2,Promise.reject(g)];case 8:try{p.bodyAsText&&(p.bodyAsJson=JSON.parse(p.bodyAsText))}catch(t){return v='Error "'+t+'" occured while executing JSON.parse on the response body - '+p.bodyAsText+".",_=t.code||"JSON_PARSE_ERROR",g=new c.RestError(v,_,f.status,e,f,p.bodyAsText),[2,Promise.reject(g)]}o.label=9;case 9:return[2,Promise.resolve(p)]}})})},t.applyMixins=function(e,t){t.forEach(function(t){Object.getOwnPropertyNames(t.prototype).forEach(function(r){e.prototype[r]=t.prototype[r]})})}}).call(t,r(4))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){}return e.prototype.before=function(e){return Promise.resolve(e)},e.prototype.after=function(e){return Promise.resolve(e)},e}();t.BaseFilter=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Constants={msRestVersion:"0.1.0",HTTP:"http:",HTTPS:"https:",HTTP_PROXY:"HTTP_PROXY",HTTPS_PROXY:"HTTPS_PROXY",HttpConstants:{HttpVerbs:{PUT:"PUT",GET:"GET",DELETE:"DELETE",POST:"POST",MERGE:"MERGE",HEAD:"HEAD",PATCH:"PATCH"}},HeaderConstants:{AUTHORIZATION:"authorization",AUTHORIZATION_SCHEME:"Bearer",USER_AGENT:"User-Agent"}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(0),i=r(9),o=function(){function e(e,t,r,n,i,o){void 0===i&&(i={}),void 0===o&&(o=!1),this.headers={},this.rawResponse=o,this.url=e||"",this.method=t||"GET",this.headers=i||{},this.body=r,this.query=n,this.formData=void 0}return e.prototype.validateRequestProperties=function(){if(!(this.method&&this.url&&this.headers["Content-Type"]&&this.headers["accept-language"]))throw new Error('method, url, headers["Content-Type"], headers["accept-language"] are required properties before making a request. Either provide them or use WebResource.prepare() method.')},e.prototype.prepare=function(e){if(null===e||void 0===e||"object"!=typeof e)throw new Error("options cannot be null or undefined and must be of type object");if(null===e.method||void 0===e.method||"string"!=typeof e.method.valueOf())throw new Error("options.method cannot be null or undefined and it must be of type string.");if(e.url&&e.pathTemplate)throw new Error("options.url and options.pathTemplate are mutually exclusive. Please provide either of them.");if(!(null!==e.pathTemplate&&void 0!==e.pathTemplate&&"string"==typeof e.pathTemplate.valueOf()||null!==e.url&&void 0!==e.url&&"string"==typeof e.url.valueOf()))throw new Error("Please provide either options.pathTemplate or options.url. Currently none of them were provided.");if(e.url){if("string"!=typeof e.url)throw new Error('options.url must be of type "string".');this.url=e.url}if(e.method){var t=["GET","PUT","HEAD","DELETE","OPTIONS","POST","PATCH","TRACE"];if(-1===t.indexOf(e.method.toUpperCase()))throw new Error('The provided method "'+e.method+'" is invalid. Supported HTTP methods are: '+JSON.stringify(t))}if(this.method=e.method.toUpperCase(),e.pathTemplate){if("string"!=typeof e.pathTemplate)throw new Error('options.pathTemplate must be of type "string".');e.baseUrl||(e.baseUrl="https://management.azure.com");var r=e.baseUrl,o=r+(r.endsWith("/")?"":"/")+(e.pathTemplate.startsWith("/")?e.pathTemplate.slice(1):e.pathTemplate),s=o.match(/({\w*\s*\w*})/gi);if(s&&s.length){if(null===e.pathParameters||void 0===e.pathParameters||"object"!=typeof e.pathParameters)throw new Error("pathTemplate: "+e.pathTemplate+' has been provided. Hence, options.pathParameters cannot be null or undefined and must be of type "object".');s.forEach(function(t){var r=t.slice(1,-1),n=e.pathParameters[r];if(null===n||void 0===n||"string"!=typeof n&&"object"!=typeof n)throw new Error("pathTemplate: "+e.pathTemplate+" contains the path parameter "+r+" however, it is not present in "+e.pathParameters+" - "+JSON.stringify(e.pathParameters,void 0,2)+'.The value of the path parameter can either be a "string" of the form { '+r+': "some sample value" } or it can be an "object" of the form { "'+r+'": { value: "some sample value", skipUrlEncoding: true } }.');if("string"==typeof n.valueOf()&&(o=o.replace(t,encodeURIComponent(n))),"object"==typeof n.valueOf()){if(!n.value)throw new Error("options.pathParameters["+r+'] is of type "object" but it does not contain a "value" property.');o=n.skipUrlEncoding?o.replace(t,n.value):o.replace(t,encodeURIComponent(n.value))}})}this.url=o}if(e.queryParameters){if("object"!=typeof e.queryParameters)throw new Error('options.queryParameters must be of type object. It should be a JSON object of "query-parameter-name" as the key and the "query-parameter-value" as the value. The "query-parameter-value" may be fo type "string" or an "object" of the form { value: "query-parameter-value", skipUrlEncoding: true }.');this.url&&-1===this.url.indexOf("?")&&(this.url+="?");var a=[],u=e.queryParameters;this.query={};for(var l in u){var c=u[l];if(c)if("string"==typeof c)a.push(l+"="+encodeURIComponent(c)),this.query[l]=encodeURIComponent(c);else if("object"==typeof c){if(!c.value)throw new Error("options.queryParameters["+l+'] is of type "object" but it does not contain a "value" property.');c.skipUrlEncoding?(a.push(l+"="+c.value),this.query[l]=c.value):(a.push(l+"="+encodeURIComponent(c.value)),this.query[l]=encodeURIComponent(c.value))}}this.url+=a.join("&")}if(e.headers){var h=e.headers;for(var f in h)h.hasOwnProperty(f)&&(this.headers[f]=h[f])}if(this.headers["accept-language"]||(this.headers["accept-language"]="en-US"),this.headers["x-ms-client-request-id"]||e.disableClientRequestId||(this.headers["x-ms-client-request-id"]=n.generateUuid()),this.headers["Content-Type"]||(this.headers["Content-Type"]="application/json; charset=utf-8"),this.body=void 0,null!==e.body&&void 0!==e.body)if(e.bodyIsStream)this.body=e.body,this.headers["Transfer-Encoding"]||(this.headers["Transfer-Encoding"]="chunked"),"application/octet-stream"!==this.headers["Content-Type"]&&(this.headers["Content-Type"]="application/octet-stream");else{var d=void 0;e.serializationMapper&&(d=new i.Serializer(e.mappers).serialize(e.serializationMapper,e.body,"requestBody")),e.disableJsonStringifyOnBody?this.body=d||e.body:this.body=d?JSON.stringify(d):JSON.stringify(e.body)}return this},e}();t.WebResource=o},function(e,t){function r(){throw new Error("setTimeout has not been defined")}function n(){throw new Error("clearTimeout has not been defined")}function i(e){if(c===setTimeout)return setTimeout(e,0);if((c===r||!c)&&setTimeout)return c=setTimeout,setTimeout(e,0);try{return c(e,0)}catch(t){try{return c.call(null,e,0)}catch(t){return c.call(this,e,0)}}}function o(e){if(h===clearTimeout)return clearTimeout(e);if((h===n||!h)&&clearTimeout)return h=clearTimeout,clearTimeout(e);try{return h(e)}catch(t){try{return h.call(null,e)}catch(t){return h.call(this,e)}}}function s(){m&&d&&(m=!1,d.length?p=d.concat(p):y=-1,p.length&&a())}function a(){if(!m){var e=i(s);m=!0;for(var t=p.length;t;){for(d=p,p=[];++y<t;)d&&d[y].run();y=-1,t=p.length}d=null,m=!1,o(e)}}function u(e,t){this.fun=e,this.array=t}function l(){}var c,h,f=e.exports={};!function(){try{c="function"==typeof setTimeout?setTimeout:r}catch(e){c=r}try{h="function"==typeof clearTimeout?clearTimeout:n}catch(e){h=n}}();var d,p=[],m=!1,y=-1;f.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];p.push(new u(e,t)),1!==p.length||m||i(a)},u.prototype.run=function(){this.fun.apply(null,this.array)},f.title="browser",f.browser=!0,f.env={},f.argv=[],f.version="",f.versions={},f.on=l,f.addListener=l,f.once=l,f.off=l,f.removeListener=l,f.removeAllListeners=l,f.emit=l,f.prependListener=l,f.prependOnceListener=l,f.listeners=function(e){return[]},f.binding=function(e){throw new Error("process.binding is not supported")},f.cwd=function(){return"/"},f.chdir=function(e){throw new Error("process.chdir is not supported")},f.umask=function(){return 0}},function(e,t){var r="undefined"!=typeof crypto&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&msCrypto.getRandomValues.bind(msCrypto);if(r){var n=new Uint8Array(16);e.exports=function(){return r(n),n}}else{var i=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),i[t]=e>>>((3&t)<<3)&255;return i}}},function(e,t){for(var r=[],n=0;n<256;++n)r[n]=(n+256).toString(16).substr(1);e.exports=function(e,t){var n=t||0,i=r;return i[e[n++]]+i[e[n++]]+i[e[n++]]+i[e[n++]]+"-"+i[e[n++]]+i[e[n++]]+"-"+i[e[n++]]+i[e[n++]]+"-"+i[e[n++]]+i[e[n++]]+"-"+i[e[n++]]+i[e[n++]]+i[e[n++]]+i[e[n++]]+i[e[n++]]+i[e[n++]]}},function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){function t(t,r,n,i,o,s){var a=e.call(this,t)||this;return a.code=r,a.statusCode=n,a.request=i,a.response=o,a.body=s,a}return n(t,e),t}(Error);t.RestError=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){return function(e,t){this.request=e,this.response=t,this.bodyAsText=null,this.bodyAsJson=null}}();t.HttpOperationResponse=n},function(e,t,r){"use strict";function n(e){if(null!==e&&void 0!==e){if(s(e))return e=e.toString("base64");if(e instanceof Date)return e.toISOString();if(Array.isArray(e)){for(var t=[],r=0;r<e.length;r++)t.push(n(e[r]));return t}if("object"==typeof e){var i={};for(var o in e)i[o]=n(e[o]);return i}return e}}Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),o=r(23),s=r(25),a=r(10),u=function(){function e(e){this.modelMappers=e}return e.prototype.validateConstraints=function(e,t,r){if(e.constraints&&(null!==t||void 0!==t))for(var n=0,i=Object.keys(e.constraints);n<i.length;n++){var o=i[n];if(null!==o.match(/^ExclusiveMaximum$/gi)){if(t>=e.constraints.ExclusiveMaximum)throw new Error('"'+r+'" with value "'+t+'" should satify the constraint "ExclusiveMaximum": '+e.constraints.ExclusiveMaximum+".")}else if(null!==o.match(/^ExclusiveMinimum$/gi)){if(t<=e.constraints.ExclusiveMinimum)throw new Error(r+' " with value "'+t+' " should satify the constraint "ExclusiveMinimum": '+e.constraints.ExclusiveMinimum+".")}else if(null!==o.match(/^InclusiveMaximum$/gi)){if(t>e.constraints.InclusiveMaximum)throw new Error(r+'" with value "'+t+'" should satify the constraint "InclusiveMaximum": '+e.constraints.InclusiveMaximum+".")}else if(null!==o.match(/^InclusiveMinimum$/gi)){if(t<e.constraints.InclusiveMinimum)throw new Error(r+'" with value "'+t+'" should satify the constraint "InclusiveMinimum": '+e.constraints.InclusiveMinimum+".")}else if(null!==o.match(/^MaxItems$/gi)){if(t.length>e.constraints.MaxItems)throw new Error(r+'" with value "'+t+'" should satify the constraint "MaxItems": '+e.constraints.MaxItems+".")}else if(null!==o.match(/^MaxLength$/gi)){if(t.length>e.constraints.MaxLength)throw new Error(r+'" with value "'+t+'" should satify the constraint "MaxLength": '+e.constraints.MaxLength+".")}else if(null!==o.match(/^MinItems$/gi)){if(t.length<e.constraints.MinItems)throw new Error(r+'" with value "'+t+'" should satify the constraint "MinItems": '+e.constraints.MinItems+".")}else if(null!==o.match(/^MinLength$/gi)){if(t.length<e.constraints.MinLength)throw new Error(r+'" with value "'+t+'" should satify the constraint "MinLength": '+e.constraints.MinLength+".")}else if(null!==o.match(/^MultipleOf$/gi)){if(t.length%e.constraints.MultipleOf!=0)throw new Error(r+'" with value "'+t+'" should satify the constraint "MultipleOf": '+e.constraints.MultipleOf+".")}else if(null!==o.match(/^Pattern$/gi)){if(null===t.match(e.constraints.Pattern.split("/").join("/")))throw new Error(r+'" with value "'+t+'" should satify the constraint "Pattern": '+e.constraints.Pattern+".")}else if(null!==o.match(/^UniqueItems/gi)&&e.constraints.UniqueItems&&t.length!==t.filter(function(e,t,r){return r.indexOf(e)===t}).length)throw new Error(r+'" with value "'+t+'" should satify the constraint "UniqueItems": '+e.constraints.UniqueItems)}},e.prototype.trimEnd=function(e,t){for(var r=e.length;r-1>=0&&e[r-1]===t;)--r;return e.substr(0,r)},e.prototype.bufferToBase64Url=function(e){if(e){if(!s(e))throw new Error("Please provide an input of type Buffer for converting to Base64Url.");var t=e.toString("base64");return this.trimEnd(t,"=").replace(/\+/g,"-").replace(/\//g,"_")}},e.prototype.base64UrlToBuffer=function(e){if(e){if(e&&"string"!=typeof e.valueOf())throw new Error("Please provide an input of type string for converting to Buffer");return e=e.replace(/\-/g,"+").replace(/\_/g,"/"),Buffer.from(e,"base64")}},e.prototype.splitSerializeName=function(e){for(var t=[],r="",n=0,i=e.split(".");n<i.length;n++){var o=i[n];"\\"===o.charAt(o.length-1)?r+=o.substr(0,o.length-1)+".":(r+=o,t.push(r),r="")}return t},e.prototype.dateToUnixTime=function(e){if(e)return"string"==typeof e.valueOf()&&(e=new Date(e)),Math.floor(e.getTime()/1e3)},e.prototype.unixTimeToDate=function(e){if(e)return new Date(1e3*e)},e.prototype.serializeBasicTypes=function(e,t,r){if(null!==r&&void 0!==r)if(null!==e.match(/^Number$/gi)){if("number"!=typeof r)throw new Error(t+" with value "+r+" must be of type number.")}else if(null!==e.match(/^String$/gi)){if("string"!=typeof r.valueOf())throw new Error(t+' with value "'+r+'" must be of type string.')}else if(null!==e.match(/^Uuid$/gi)){if("string"!=typeof r.valueOf()||!i.isValidUuid(r))throw new Error(t+' with value "'+r+'" must be of type string and a valid uuid.')}else if(null!==e.match(/^Boolean$/gi)){if("boolean"!=typeof r)throw new Error(t+" with value "+r+" must be of type boolean.")}else if(null!==e.match(/^Stream$/gi)&&!a(r))throw new Error(t+" must be of type stream.");return r},e.prototype.serializeEnumType=function(e,t,r){if(!t)throw new Error("Please provide a set of allowedValues to validate "+e+" as an Enum Type.");if(!t.some(function(e){return"string"==typeof e.valueOf()?e.toLowerCase()===r.toLowerCase():e===r}))throw new Error(r+" is not a valid value for "+e+". The valid values are: "+JSON.stringify(t)+".");return r},e.prototype.serializeBufferType=function(e,t){if(null!==t&&void 0!==t){if(!s(t))throw new Error(e+" must be of type Buffer.");t=t.toString("base64")}return t},e.prototype.serializeBase64UrlType=function(e,t){if(null!==t&&void 0!==t){if(!s(t))throw new Error(e+" must be of type Buffer.");t=this.bufferToBase64Url(t)}return t},e.prototype.serializeDateTypes=function(e,t,r){if(null!==t&&void 0!==t)if(null!==e.match(/^Date$/gi)){if(!(t instanceof Date||"string"==typeof t.valueOf()&&!isNaN(Date.parse(t))))throw new Error(r+" must be an instanceof Date or a string in ISO8601 format.");t=t instanceof Date?t.toISOString().substring(0,10):new Date(t).toISOString().substring(0,10)}else if(null!==e.match(/^DateTime$/gi)){if(!(t instanceof Date||"string"==typeof t.valueOf()&&!isNaN(Date.parse(t))))throw new Error(r+" must be an instanceof Date or a string in ISO8601 format.");t=t instanceof Date?t.toISOString():new Date(t).toISOString()}else if(null!==e.match(/^DateTimeRfc1123$/gi)){if(!(t instanceof Date||"string"==typeof t.valueOf()&&!isNaN(Date.parse(t))))throw new Error(r+" must be an instanceof Date or a string in RFC-1123 format.");t=t instanceof Date?t.toUTCString():new Date(t).toUTCString()}else if(null!==e.match(/^UnixTime$/gi)){if(!(t instanceof Date||"string"==typeof t.valueOf()&&!isNaN(Date.parse(t))))throw new Error(r+" must be an instanceof Date or a string in RFC-1123/ISO8601 format for it to be serialized in UnixTime/Epoch format.");t=this.dateToUnixTime(t)}else if(null!==e.match(/^TimeSpan$/gi)){if(!(o.isDuration(t)||t.constructor&&"Duration"===t.constructor.name&&"function"==typeof t.isValid&&t.isValid()))throw new Error(r+" must be a TimeSpan/Duration.");t=t.toISOString()}return t},e.prototype.serializeSequenceType=function(e,t,r){if(!Array.isArray(t))throw new Error(r+" must be of type Array.");if(!e.type.element||"object"!=typeof e.type.element)throw new Error('element" metadata for an Array must be defined in the mapper and it must of type "object" in '+r+".");for(var n=[],i=0;i<t.length;i++)n[i]=this.serialize(e.type.element,t[i],r);return n},e.prototype.serializeDictionaryType=function(e,t,r){if("object"!=typeof t)throw new Error(r+" must be of type object.");if(!e.type.value||"object"!=typeof e.type.value)throw new Error('"value" metadata for a Dictionary must be defined in the mapper and it must of type "object" in '+r+".");var n={};for(var i in t)t.hasOwnProperty(i)&&(n[i]=this.serialize(e.type.value,t[i],r));return n},e.prototype.serializeCompositeType=function(e,t,r){e.type.polymorphicDiscriminator&&(e=this.getPolymorphicMapper(e,t,r,"serialize"));var n={},i={required:!1,serializedName:"serializedName",type:{name:"Composite",className:"className",modelProperties:{}}};if(null!==t&&void 0!==t){var o=e.type.modelProperties;if(!o){if(!e.type.className)throw new Error('Class name for model "'+r+'" is not provided in the mapper "'+JSON.stringify(e,void 0,2)+'".');if(!(i=this.modelMappers[e.type.className]))throw new Error('mapper() cannot be null or undefined for model "'+e.type.className+'".');if(!(o=i.type.modelProperties))throw new Error('modelProperties cannot be null or undefined in the mapper "'+JSON.stringify(i)+'" of type "'+e.type.className+'" for object "'+r+'".')}for(var s in o)if(o.hasOwnProperty(s)){for(var a=this.splitSerializeName(o[s].serializedName),u=a.pop(),l=n,c=0,h=a;c<h.length;c++){var f=h[c],d=l[f];null!==d&&void 0!==d||null===t[s]||void 0===t[s]||(l[f]={}),l=l[f]}if(o[s].required&&!o[s].isConstant&&(null===t[s]||void 0===t[s]))throw new Error(s+'" cannot be null or undefined in "'+r+'".');if(o[s].readOnly)continue;if(null!==l&&void 0!==l&&null!==o[s].defaultValue&&void 0!==o[s].defaultValue||null!==t[s]&&void 0!==t[s]){var p=r;""!==o[s].serializedName&&(p=r+"."+o[s].serializedName);var m=o[s],y=this.serialize(m,t[s],p);null!==u&&void 0!==u&&(l[u]=y)}}return n}return t},e.prototype.serialize=function(e,t,r){var n={},i=e.type.name;if(r||(r=e.serializedName),null!==i.match(/^Sequence$/gi)&&(n=[]),e.required&&(null===t||void 0===t)&&!e.isConstant)throw new Error(r+" cannot be null or undefined.");if(null===e.defaultValue||void 0===e.defaultValue||null!==t&&void 0!==t||(t=e.defaultValue),e.isConstant&&(t=e.defaultValue),this.validateConstraints(e,t,r),null!==i.match(/^any$/gi))n=t;else if(null!==i.match(/^(Number|String|Boolean|Object|Stream|Uuid)$/gi))n=this.serializeBasicTypes(i,r,t);else if(null!==i.match(/^Enum$/gi)){var o=e;n=this.serializeEnumType(r,o.type.allowedValues,t)}else null!==i.match(/^(Date|DateTime|TimeSpan|DateTimeRfc1123|UnixTime)$/gi)?n=this.serializeDateTypes(i,t,r):null!==i.match(/^ByteArray$/gi)?n=this.serializeBufferType(r,t):null!==i.match(/^Base64Url$/gi)?n=this.serializeBase64UrlType(r,t):null!==i.match(/^Sequence$/gi)?n=this.serializeSequenceType(e,t,r):null!==i.match(/^Dictionary$/gi)?n=this.serializeDictionaryType(e,t,r):null!==i.match(/^Composite$/gi)&&(n=this.serializeCompositeType(e,t,r));return n},e.prototype.deserializeCompositeType=function(e,t,r){e.type.polymorphicDiscriminator&&(e=this.getPolymorphicMapper(e,t,r,"deserialize"));var n={},i={required:!1,serializedName:"serializedName",type:{name:"Composite"}};if(null!==t&&void 0!==t){var o=e.type.modelProperties;if(!o){if(!e.type.className)throw new Error('Class name for model "'+r+'" is not provided in the mapper "'+JSON.stringify(e)+'"');if(!(i=this.modelMappers[e.type.className]))throw new Error('mapper() cannot be null or undefined for model "'+e.type.className+'"');if(!(o=i.type.modelProperties))throw new Error('modelProperties cannot be null or undefined in the mapper "'+JSON.stringify(i)+'" of type "'+e.type.className+'" for responseBody "'+r+'".')}for(var s in o)if(o.hasOwnProperty(s)){for(var a=void 0,u=t,l=0,c=this.splitSerializeName(o[s].serializedName);l<c.length;l++){var h=c[l];if(!u)break;u=u[h]}a=u;var f=r;""!==o[s].serializedName&&(f=r+"."+o[s].serializedName);var d=o[s],p=void 0;Array.isArray(t[s])&&""===o[s].serializedName?(a=t[s],n=this.deserialize(d,a,f)):null!==a&&void 0!==a&&(p=this.deserialize(d,a,f),n[s]=p)}return n}return t},e.prototype.deserializeDictionaryType=function(e,t,r){if(!e.type.value||"object"!=typeof e.type.value)throw new Error('"value" metadata for a Dictionary must be defined in the mapper and it must of type "object" in '+r);if(t){var n={};for(var i in t)t.hasOwnProperty(i)&&(n[i]=this.deserialize(e.type.value,t[i],r));return n}return t},e.prototype.deserializeSequenceType=function(e,t,r){if(!e.type.element||"object"!=typeof e.type.element)throw new Error('element" metadata for an Array must be defined in the mapper and it must of type "object" in '+r);if(t){for(var n=[],i=0;i<t.length;i++)n[i]=this.deserialize(e.type.element,t[i],r);return n}return t},e.prototype.deserialize=function(e,t,r){if(null===t||void 0===t)return t;var n,i=e.type.name;return r||(r=e.serializedName),null!==i.match(/^Sequence$/gi)&&(n=[]),null!==i.match(/^(Number|String|Boolean|Enum|Object|Stream|Uuid|any)$/gi)?n=t:null!==i.match(/^(Date|DateTime|DateTimeRfc1123)$/gi)?n=new Date(t):null!==i.match(/^TimeSpan$/gi)?n=o.duration(t):null!==i.match(/^UnixTime$/gi)?n=this.unixTimeToDate(t):null!==i.match(/^ByteArray$/gi)?n=Buffer.from(t,"base64"):null!==i.match(/^Base64Url$/gi)?n=this.base64UrlToBuffer(t):null!==i.match(/^Sequence$/gi)?n=this.deserializeSequenceType(e,t,r):null!==i.match(/^Dictionary$/gi)?n=this.deserializeDictionaryType(e,t,r):null!==i.match(/^Composite$/gi)&&(n=this.deserializeCompositeType(e,t,r)),e.isConstant&&(n=e.defaultValue),n},e.prototype.getPolymorphicMapper=function(e,t,r,n){if(e.type.polymorphicDiscriminator){if("string"==typeof e.type.polymorphicDiscriminator.valueOf())return this.getPolymorphicMapperStringVersion(e,t,r);if(e.type.polymorphicDiscriminator instanceof Object)return this.getPolymorphicMapperObjectVersion(e,t,r,n);throw new Error('The polymorphicDiscriminator for "'+r+'" is neither a string nor an object.')}return e},e.prototype.getPolymorphicMapperObjectVersion=function(e,t,r,n){var i="";if("serialize"===n)i="clientName";else{if("deserialize"!==n)throw new Error('The given mode "'+n+'" for getting the polymorphic mapper for "'+r+'" is inavlid.');i="serializedName"}var o=e.type.polymorphicDiscriminator;if(o&&null!==o[i]&&void 0!==o[i]){if(null===t||void 0===t)throw new Error(r+'" cannot be null or undefined. "'+o[i]+'" is the polmorphicDiscriminator and is a required property.');if(null===t[o[i]]||void 0===t[o[i]])throw new Error('No discriminator field "'+o[i]+'" was found in "'+r+'".');var s=void 0;s=t[o[i]]===e.type.uberParent?t[o[i]]:e.type.uberParent+"."+t[o[i]],this.modelMappers&&this.modelMappers.discriminators[s]&&(e=this.modelMappers.discriminators[s])}return e},e.prototype.getPolymorphicMapperStringVersion=function(e,t,r){var n=e.type.polymorphicDiscriminator;if(null!==n&&void 0!==n){if(null===t||void 0===t)throw new Error(r+'" cannot be null or undefined. "'+n+'" is the polmorphicDiscriminator and is a required property.');if(null===t[n]||void 0===t[n])throw new Error('No discriminator field "'+n+'" was found in "'+r+'".');var i=void 0;i=t[n]===e.type.uberParent?t[n]:e.type.uberParent+"."+t[n],this.modelMappers&&this.modelMappers.discriminators[i]&&(e=this.modelMappers.discriminators[i])}return e},e}();t.Serializer=u,t.serializeObject=n,t.MapperType=i.strEnum(["Base64Url","Boolean","ByteArray","Composite","Date","DateTime","DateTimeRfc1123","Dictionary","Enum","Number","Object","Sequence","String","Stream","TimeSpan","UnixTime"])},function(e,t,r){"use strict";var n=e.exports=function(e){return null!==e&&"object"==typeof e&&"function"==typeof e.pipe};n.writable=function(e){return n(e)&&!1!==e.writable&&"function"==typeof e._write&&"object"==typeof e._writableState},n.readable=function(e){return n(e)&&!1!==e.readable&&"function"==typeof e._read&&"object"==typeof e._readableState},n.duplex=function(e){return n.writable(e)&&n.readable(e)},n.transform=function(e){return n.duplex(e)&&"function"==typeof e._transform&&"object"==typeof e._transformState}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(0),i=function(){function e(e,t){this.filters=e||[],this.requestOptions=t||{}}return e.prototype.addFilter=function(e){this.filters.push(e)},e.prototype.create=function(){var e=this,t=[];if(e.filters&&e.filters.length){for(var r=[],i=[],o=0;o<e.filters.length;o++){var s=e.filters[o];s.before&&"function"==typeof s.before&&r.push(s.before.bind(s)),s.after&&"function"==typeof s.after&&i.push(s.after.bind(s))}r.push(e.requestSink.bind(e)),t=r.concat(i)}else t.push(e.requestSink.bind(e));return function(e){return e.headers||(e.headers={}),n.executePromisesSequentially(t,e)}},e.prototype.requestSink=function(e){return this.requestOptions.method&&delete this.requestOptions.method,n.dispatchRequest(e)},e}();t.RequestPipeline=i},function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new r(function(t){t(e.value)}).then(s,a)}u((n=n.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){function r(e){return function(t){return n([e,t])}}function n(r){if(i)throw new TypeError("Generator is already executing.");for(;u;)try{if(i=1,o&&(s=o[2&r[0]?"return":r[0]?"throw":"next"])&&!(s=s.call(o,r[1])).done)return s;switch(o=0,s&&(r=[0,s.value]),r[0]){case 0:case 1:s=r;break;case 4:return u.label++,{value:r[1],done:!1};case 5:u.label++,o=r[1],r=[0];continue;case 7:r=u.ops.pop(),u.trys.pop();continue;default:if(s=u.trys,!(s=s.length>0&&s[s.length-1])&&(6===r[0]||2===r[0])){u=0;continue}if(3===r[0]&&(!s||r[1]>s[0]&&r[1]<s[3])){u.label=r[1];break}if(6===r[0]&&u.label<s[1]){u.label=s[1],s=r;break}if(s&&u.label<s[2]){u.label=s[2],u.ops.push(r);break}s[2]&&u.ops.pop(),u.trys.pop();continue}r=t.call(e,u)}catch(e){r=[6,e],o=0}finally{i=s=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}var i,o,s,a,u={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return a={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a};Object.defineProperty(t,"__esModule",{value:!0});var s=r(1),a=r(0),u=function(e){function t(t,r,n,i){var o=e.call(this)||this;return o.DEFAULT_CLIENT_RETRY_INTERVAL=3e4,o.DEFAULT_CLIENT_RETRY_COUNT=3,o.DEFAULT_CLIENT_MAX_RETRY_INTERVAL=9e4,o.DEFAULT_CLIENT_MIN_RETRY_INTERVAL=3e3,o.retryCount="number"==typeof t?t:o.DEFAULT_CLIENT_RETRY_COUNT,o.retryInterval="number"==typeof r?r:o.DEFAULT_CLIENT_RETRY_INTERVAL,o.minRetryInterval="number"==typeof n?n:o.DEFAULT_CLIENT_MIN_RETRY_INTERVAL,o.maxRetryInterval="number"==typeof i?i:o.DEFAULT_CLIENT_MAX_RETRY_INTERVAL,o}return n(t,e),t.prototype.shouldRetry=function(e,t){if(e<500&&408!==e||501===e||505===e)return!1;if(!t)throw new Error("retryData for the ExponentialRetryPolicyFilter cannot be null.");return(t&&t.retryCount)<this.retryCount},t.prototype.updateRetryData=function(e,t){e||(e={retryCount:0,retryInterval:0}),t&&(e.error&&(t.innerError=e.error),e.error=t),e.retryCount++;var r=Math.pow(2,e.retryCount)-1;return r*=.8*this.retryInterval+Math.floor(Math.random()*(1.2*this.retryInterval-.8*this.retryInterval)),e.retryInterval=Math.min(this.minRetryInterval+r,this.maxRetryInterval),e},t.prototype.retry=function(e,t,r){return i(this,void 0,void 0,function(){var n,i,s,u;return o(this,function(o){switch(o.label){case 0:if(n=this,i=e.response,t=n.updateRetryData(t,r),a.objectIsNull(i)||!n.shouldRetry(i.status,t))return[3,6];o.label=1;case 1:return o.trys.push([1,4,,5]),[4,a.delay(t.retryInterval)];case 2:return o.sent(),[4,a.dispatchRequest(e.request)];case 3:return s=o.sent(),[2,n.retry(s,t,r)];case 4:return u=o.sent(),[2,n.retry(e,t,u)];case 5:return[3,7];case 6:return a.objectIsNull(r)?[2,Promise.resolve(e)]:(r=t.error,[2,Promise.reject(r)]);case 7:return[2]}})})},t.prototype.after=function(e){return this.retry(e)},t}(s.BaseFilter);t.ExponentialRetryPolicyFilter=u},function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new r(function(t){t(e.value)}).then(s,a)}u((n=n.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){function r(e){return function(t){return n([e,t])}}function n(r){if(i)throw new TypeError("Generator is already executing.");for(;u;)try{if(i=1,o&&(s=o[2&r[0]?"return":r[0]?"throw":"next"])&&!(s=s.call(o,r[1])).done)return s;switch(o=0,s&&(r=[0,s.value]),r[0]){case 0:case 1:s=r;break;case 4:return u.label++,{value:r[1],done:!1};case 5:u.label++,o=r[1],r=[0];continue;case 7:r=u.ops.pop(),u.trys.pop();continue;default:if(s=u.trys,!(s=s.length>0&&s[s.length-1])&&(6===r[0]||2===r[0])){u=0;continue}if(3===r[0]&&(!s||r[1]>s[0]&&r[1]<s[3])){u.label=r[1];break}if(6===r[0]&&u.label<s[1]){u.label=s[1],s=r;break}if(s&&u.label<s[2]){u.label=s[2],u.ops.push(r);break}s[2]&&u.ops.pop(),u.trys.pop();continue}r=t.call(e,u)}catch(e){r=[6,e],o=0}finally{i=s=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}var i,o,s,a,u={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return a={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a};Object.defineProperty(t,"__esModule",{value:!0});var s=r(1),a=r(0),u=function(e){function t(t,r,n,i){var o=e.call(this)||this;return o.DEFAULT_CLIENT_RETRY_INTERVAL=3e4,o.DEFAULT_CLIENT_RETRY_COUNT=3,o.DEFAULT_CLIENT_MAX_RETRY_INTERVAL=9e4,o.DEFAULT_CLIENT_MIN_RETRY_INTERVAL=3e3,o.retryCount="number"==typeof t?t:o.DEFAULT_CLIENT_RETRY_COUNT,o.retryInterval="number"==typeof r?r:o.DEFAULT_CLIENT_RETRY_INTERVAL,o.minRetryInterval="number"==typeof n?n:o.DEFAULT_CLIENT_MIN_RETRY_INTERVAL,o.maxRetryInterval="number"==typeof i?i:o.DEFAULT_CLIENT_MAX_RETRY_INTERVAL,o}return n(t,e),t.prototype.shouldRetry=function(e){if(!e)throw new Error("retryData for the SystemErrorRetryPolicyFilter cannot be null.");return(e&&e.retryCount)<this.retryCount},t.prototype.updateRetryData=function(e,t){e||(e={retryCount:0,retryInterval:0}),t&&(e.error&&(t.innerError=e.error),e.error=t),e.retryCount++;var r=Math.pow(2,e.retryCount)-1;return r*=.8*this.retryInterval+Math.floor(Math.random()*(1.2*this.retryInterval-.8*this.retryInterval)),e.retryInterval=Math.min(this.minRetryInterval+r,this.maxRetryInterval),e},t.prototype.retry=function(e,t,r){return i(this,void 0,void 0,function(){var n,i,s;return o(this,function(o){switch(o.label){case 0:if(n=this,t=n.updateRetryData(t,r),!(r&&r.code&&n.shouldRetry(t))||"ETIMEDOUT"!==r.code&&"ESOCKETTIMEDOUT"!==r.code&&"ECONNREFUSED"!==r.code&&"ECONNRESET"!==r.code&&"ENOENT"!==r.code)return[3,6];o.label=1;case 1:return o.trys.push([1,4,,5]),[4,a.delay(t.retryInterval)];case 2:return o.sent(),[4,a.dispatchRequest(e.request)];case 3:return i=o.sent(),[2,n.retry(i,t,r)];case 4:return s=o.sent(),[2,n.retry(e,t,s)];case 5:return[3,7];case 6:return a.objectIsNull(r)?[2,Promise.resolve(e)]:(r=t.error,[2,Promise.reject(r)]);case 7:return[2]}})})},t.prototype.after=function(e){return this.retry(e)},t}(s.BaseFilter);t.SystemErrorRetryPolicyFilter=u},function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new r(function(t){t(e.value)}).then(s,a)}u((n=n.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){function r(e){return function(t){return n([e,t])}}function n(r){if(i)throw new TypeError("Generator is already executing.");for(;u;)try{if(i=1,o&&(s=o[2&r[0]?"return":r[0]?"throw":"next"])&&!(s=s.call(o,r[1])).done)return s;switch(o=0,s&&(r=[0,s.value]),r[0]){case 0:case 1:s=r;break;case 4:return u.label++,{value:r[1],done:!1};case 5:u.label++,o=r[1],r=[0];continue;case 7:r=u.ops.pop(),u.trys.pop();continue;default:if(s=u.trys,!(s=s.length>0&&s[s.length-1])&&(6===r[0]||2===r[0])){u=0;continue}if(3===r[0]&&(!s||r[1]>s[0]&&r[1]<s[3])){u.label=r[1];break}if(6===r[0]&&u.label<s[1]){u.label=s[1],s=r;break}if(s&&u.label<s[2]){u.label=s[2],u.ops.push(r);break}s[2]&&u.ops.pop(),u.trys.pop();continue}r=t.call(e,u)}catch(e){r=[6,e],o=0}finally{i=s=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}var i,o,s,a,u={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return a={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a};Object.defineProperty(t,"__esModule",{value:!0});var s=r(1),a=r(0),u=r(27),l=function(e){function t(t){void 0===t&&(t=20);var r=e.call(this)||this;return r.maximumRetries=t,r}return n(t,e),t.prototype.handleRedirect=function(e,t){return i(this,void 0,void 0,function(){var r,n,i,s,l;return o(this,function(o){switch(o.label){case 0:if(r=e.request,!((n=e.response)&&n.headers&&n.headers.get("location")&&(300===n.status||307===n.status||303===n.status&&"POST"===r.method)&&(!this.maximumRetries||t<this.maximumRetries)))return[3,5];u(n.headers.get("location")).hostname?r.url=n.headers.get("location"):((i=u(r.url)).set("pathname",n.headers.get("location")),r.url=i.href),303===n.status&&(r.method="GET"),s=void 0,o.label=1;case 1:return o.trys.push([1,3,,4]),[4,a.dispatchRequest(r)];case 2:return s=o.sent(),t++,[3,4];case 3:return l=o.sent(),[2,Promise.reject(l)];case 4:return[2,this.handleRedirect(s,t)];case 5:return[2,Promise.resolve(e)]}})})},t.prototype.after=function(e){return this.handleRedirect(e,0)},t}(s.BaseFilter);t.RedirectFilter=l},function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){function t(t){var r=e.call(this)||this;return r.authenticationProvider=t,r}return n(t,e),t.prototype.before=function(e){return this.authenticationProvider.signRequest(e)},t}(r(1).BaseFilter);t.SigningFilter=i},function(e,t,r){"use strict";(function(e){var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=r(1),o=r(2),s=r(0),a=r(32),u=o.Constants.HeaderConstants,l=function(t){function r(e){var r=t.call(this)||this;return r.userAgentInfo=e,r}return n(r,t),r.prototype.tagRequest=function(t){if(s.isNode){var r="("+a.arch()+"-"+a.type()+"-"+a.release()+")";-1===this.userAgentInfo.indexOf(r)&&this.userAgentInfo.unshift(r);var n="Node/"+e.version;-1===this.userAgentInfo.indexOf(n)&&this.userAgentInfo.unshift(n);if(-1===this.userAgentInfo.indexOf("Azure-SDK-For-Node")){var i=this.userAgentInfo.indexOf("ms-rest-azure");i=i<0?this.userAgentInfo.length:i+1,this.userAgentInfo.splice(i,0,"Azure-SDK-For-Node")}t.headers||(t.headers={}),t.headers[u.USER_AGENT]=this.userAgentInfo.join(" ")}return Promise.resolve(t)},r.prototype.before=function(e){var t=this;return e.headers||(e.headers={}),e.headers[u.USER_AGENT]?Promise.resolve(e):t.tagRequest(e)},r}(i.BaseFilter);t.MsRestUserAgentFilter=l}).call(t,r(4))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(3);t.WebResource=n.WebResource;var i=r(8);t.HttpOperationResponse=i.HttpOperationResponse;var o=r(7);t.RestError=o.RestError;var s=r(26);t.ServiceClient=s.ServiceClient;var a=r(2);t.Constants=a.Constants;var u=r(11);t.RequestPipeline=u.RequestPipeline;var l=r(33);t.LogFilter=l.LogFilter;var c=r(1);t.BaseFilter=c.BaseFilter;var h=r(12);t.ExponentialRetryPolicyFilter=h.ExponentialRetryPolicyFilter;var f=r(13);t.SystemErrorRetryPolicyFilter=f.SystemErrorRetryPolicyFilter;var d=r(14);t.RedirectFilter=d.RedirectFilter;var p=r(15);t.SigningFilter=p.SigningFilter;var m=r(16);t.MsRestUserAgentFilter=m.MsRestUserAgentFilter;var y=r(9);t.MapperType=y.MapperType,t.Serializer=y.Serializer,t.serializeObject=y.serializeObject;var v=r(0);t.stripRequest=v.stripRequest,t.stripResponse=v.stripResponse,t.delay=v.delay,t.executePromisesSequentially=v.executePromisesSequentially,t.generateUuid=v.generateUuid,t.encodeUri=v.encodeUri,t.promiseToCallback=v.promiseToCallback,t.promiseToServiceCallback=v.promiseToServiceCallback,t.isValidUuid=v.isValidUuid,t.dispatchRequest=v.dispatchRequest,t.applyMixins=v.applyMixins,t.isNode=v.isNode;var _=r(34);t.TokenCredentials=_.TokenCredentials;var g=r(35);t.BasicAuthenticationCredentials=g.BasicAuthenticationCredentials;var w=r(36);t.ApiKeyCredentials=w.ApiKeyCredentials;var b=r(10);t.isStream=b},function(e,t,r){var n=r(19),i=r(20),o=i;o.v1=n,o.v4=i,e.exports=o},function(e,t,r){var n,i,o=r(5),s=r(6),a=0,u=0;e.exports=function(e,t,r){var l=t&&r||0,c=t||[],h=(e=e||{}).node||n,f=void 0!==e.clockseq?e.clockseq:i;if(null==h||null==f){var d=o();null==h&&(h=n=[1|d[0],d[1],d[2],d[3],d[4],d[5]]),null==f&&(f=i=16383&(d[6]<<8|d[7]))}var p=void 0!==e.msecs?e.msecs:(new Date).getTime(),m=void 0!==e.nsecs?e.nsecs:u+1,y=p-a+(m-u)/1e4;if(y<0&&void 0===e.clockseq&&(f=f+1&16383),(y<0||p>a)&&void 0===e.nsecs&&(m=0),m>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");a=p,u=m,i=f;var v=(1e4*(268435455&(p+=122192928e5))+m)%4294967296;c[l++]=v>>>24&255,c[l++]=v>>>16&255,c[l++]=v>>>8&255,c[l++]=255&v;var _=p/4294967296*1e4&268435455;c[l++]=_>>>8&255,c[l++]=255&_,c[l++]=_>>>24&15|16,c[l++]=_>>>16&255,c[l++]=f>>>8|128,c[l++]=255&f;for(var g=0;g<6;++g)c[l+g]=h[g];return t||s(c)}},function(e,t,r){var n=r(5),i=r(6);e.exports=function(e,t,r){var o=t&&r||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var s=(e=e||{}).random||(e.rng||n)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,t)for(var a=0;a<16;++a)t[o+a]=s[a];return t||i(s)}},function(e,t){e.exports="object"==typeof self?self.FormData:window.FormData},function(e,t,r){var n;!function(i){"use strict";function o(e){var t=e&&e.Promise||i.Promise,r=e&&e.XMLHttpRequest||i.XMLHttpRequest,n=i;return function(){var e=Object.create(n,{fetch:{value:void 0,writable:!0}});return function(e){function n(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function i(e){return"string"!=typeof e&&(e=String(e)),e}function o(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return g.iterable&&(t[Symbol.iterator]=function(){return t}),t}function s(e){this.map={},e instanceof s?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function a(e){if(e.bodyUsed)return t.reject(new TypeError("Already read"));e.bodyUsed=!0}function u(e){return new t(function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}})}function l(e){var t=new FileReader,r=u(t);return t.readAsArrayBuffer(e),r}function c(e){var t=new FileReader,r=u(t);return t.readAsText(e),r}function h(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}function f(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function d(){return this.bodyUsed=!1,this._initBody=function(e){if(this._bodyInit=e,e)if("string"==typeof e)this._bodyText=e;else if(g.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(g.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(g.searchParams&&URLSearchParams.prototype.isPrototypeOf(e))this._bodyText=e.toString();else if(g.arrayBuffer&&g.blob&&b(e))this._bodyArrayBuffer=f(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer]);else{if(!g.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(e)&&!T(e))throw new Error("unsupported BodyInit type");this._bodyArrayBuffer=f(e)}else this._bodyText="";this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):g.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},g.blob&&(this.blob=function(){var e=a(this);if(e)return e;if(this._bodyBlob)return t.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return t.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return t.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?a(this)||t.resolve(this._bodyArrayBuffer):this.blob().then(l)}),this.text=function(){var e=a(this);if(e)return e;if(this._bodyBlob)return c(this._bodyBlob);if(this._bodyArrayBuffer)return t.resolve(h(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return t.resolve(this._bodyText)},g.formData&&(this.formData=function(){return this.text().then(y)}),this.json=function(){return this.text().then(JSON.parse)},this}function p(e){var t=e.toUpperCase();return S.indexOf(t)>-1?t:e}function m(e,t){var r=(t=t||{}).body;if(e instanceof m){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new s(e.headers)),this.method=e.method,this.mode=e.mode,r||null==e._bodyInit||(r=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new s(t.headers)),this.method=p(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&r)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(r)}function y(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(i))}}),t}function v(e){var t=new s;return e.split(/\r?\n/).forEach(function(e){var r=e.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();t.append(n,i)}}),t}function _(e,t){t||(t={}),this.type="default",this.status="status"in t?t.status:200,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new s(t.headers),this.url=t.url||"",this._initBody(e)}if(!e.fetch){var g={searchParams:"URLSearchParams"in e,iterable:"Symbol"in e&&"iterator"in Symbol,blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in e,array