@pnp/odata
Advanced tools
Comparing version 1.0.5 to 1.1.0
/** | ||
@license | ||
* @pnp/odata v1.0.5 - pnp - provides shared odata functionality and base classes | ||
* @pnp/odata v1.1.0 - pnp - provides shared odata functionality and base classes | ||
* MIT (https://github.com/pnp/pnpjs/blob/master/LICENSE) | ||
@@ -11,3 +11,3 @@ * Copyright (c) 2018 Microsoft | ||
import { RuntimeConfig, dateAdd, PnPClientStorage, isFunc, extend, combinePaths, Dictionary, mergeOptions, objectDefinedNotNull, getGUID } from '@pnp/common'; | ||
import { __extends, __decorate } from 'tslib'; | ||
import { __decorate, __extends } from 'tslib'; | ||
import { Logger } from '@pnp/logging'; | ||
@@ -37,16 +37,16 @@ | ||
var CachingParserWrapper = /** @class */ (function () { | ||
function CachingParserWrapper(_parser, _cacheOptions) { | ||
this._parser = _parser; | ||
this._cacheOptions = _cacheOptions; | ||
function CachingParserWrapper(parser, cacheOptions) { | ||
this.parser = parser; | ||
this.cacheOptions = cacheOptions; | ||
} | ||
CachingParserWrapper.prototype.parse = function (response) { | ||
var _this = this; | ||
// add this to the cache based on the options | ||
return this._parser.parse(response).then(function (data) { | ||
if (_this._cacheOptions.store !== null) { | ||
_this._cacheOptions.store.put(_this._cacheOptions.key, data, _this._cacheOptions.expiration); | ||
} | ||
return data; | ||
}); | ||
return this.parser.parse(response).then(function (r) { return _this.cacheData(r); }); | ||
}; | ||
CachingParserWrapper.prototype.cacheData = function (data) { | ||
if (this.cacheOptions.store !== null) { | ||
this.cacheOptions.store.put(this.cacheOptions.key, data, this.cacheOptions.expiration); | ||
} | ||
return data; | ||
}; | ||
return CachingParserWrapper; | ||
@@ -199,6 +199,17 @@ }()); | ||
} | ||
r.buffer().then(resolve); | ||
else { | ||
r.buffer().then(resolve); | ||
} | ||
}; | ||
return BufferParser; | ||
}(ODataParserBase)); | ||
var LambdaParser = /** @class */ (function () { | ||
function LambdaParser(parser) { | ||
this.parser = parser; | ||
} | ||
LambdaParser.prototype.parse = function (r) { | ||
return this.parser(r); | ||
}; | ||
return LambdaParser; | ||
}()); | ||
@@ -212,5 +223,5 @@ /** | ||
Logger.log({ | ||
data: context.result, | ||
level: 0 /* Verbose */, | ||
message: "[" + context.requestId + "] (" + (new Date()).getTime() + ") Returning result, see data property for value.", | ||
data: Logger.activeLogLevel === 0 /* Verbose */ ? context.result : {}, | ||
level: 1 /* Info */, | ||
message: "[" + context.requestId + "] (" + (new Date()).getTime() + ") Returning result from pipeline. Set logging to verbose to see data.", | ||
}); | ||
@@ -251,8 +262,11 @@ return Promise.resolve(context.result || null); | ||
} | ||
return next(context) | ||
.then(function (ctx) { return returnResult(ctx); }) | ||
.catch(function (e) { | ||
var promise = next(context).then(function (ctx) { return returnResult(ctx); }).catch(function (e) { | ||
Logger.error(e); | ||
throw e; | ||
}); | ||
if (context.isBatched) { | ||
// this will block the batch's execute method from returning until the child requets have been resolved | ||
context.batch.addResolveBatchDependency(promise); | ||
} | ||
return promise; | ||
} | ||
@@ -308,3 +322,3 @@ /** | ||
// handle caching, if applicable | ||
if (context.verb === "GET" && context.isCached) { | ||
if (context.isCached) { | ||
Logger.write("[" + context.requestId + "] (" + (new Date()).getTime() + ") Caching is enabled for request, checking cache...", 1 /* Info */); | ||
@@ -320,3 +334,3 @@ var cacheOptions = new CachingOptions(context.requestAbsoluteUrl.toLowerCase()); | ||
if (data !== null) { | ||
// ensure we clear any help batch dependency we are resolving from the cache | ||
// ensure we clear any held batch dependency we are resolving from the cache | ||
Logger.log({ | ||
@@ -353,3 +367,3 @@ data: Logger.activeLogLevel === 1 /* Info */ ? {} : data, | ||
// we are in a batch, so add to batch, remove dependency, and resolve with the batch's promise | ||
var p = context.batch.add(context.requestAbsoluteUrl, context.verb, context.options, context.parser); | ||
var p = context.batch.add(context.requestAbsoluteUrl, context.verb, context.options, context.parser, context.requestId); | ||
// we release the dependency here to ensure the batch does not execute until the request is added to the batch | ||
@@ -500,13 +514,2 @@ if (isFunc(context.batchDependency)) { | ||
}; | ||
/** | ||
* Executes the currently built request | ||
* | ||
* @param parser Allows you to specify a parser to handle the result | ||
* @param getOptions The options used for this request | ||
*/ | ||
Queryable.prototype.get = function (parser, options) { | ||
if (parser === void 0) { parser = new JSONParser(); } | ||
if (options === void 0) { options = {}; } | ||
return this.getCore(parser, options); | ||
}; | ||
Queryable.prototype.getCore = function (parser, options) { | ||
@@ -557,3 +560,3 @@ if (parser === void 0) { parser = new JSONParser(); } | ||
/** | ||
* Extends this queryable from | ||
* Extends this queryable from the provided parent | ||
* | ||
@@ -678,2 +681,3 @@ * @param parent Parent queryable from which we will derive a base url | ||
this._dependencies = []; | ||
this._resolveBatchDependencies = []; | ||
} | ||
@@ -704,4 +708,5 @@ Object.defineProperty(ODataBatch.prototype, "batchId", { | ||
*/ | ||
ODataBatch.prototype.add = function (url, method, options, parser) { | ||
ODataBatch.prototype.add = function (url, method, options, parser, requestId) { | ||
var info = { | ||
id: requestId, | ||
method: method.toUpperCase(), | ||
@@ -734,2 +739,10 @@ options: options, | ||
/** | ||
* The batch's execute method will not resolve util any promises added here resolve | ||
* | ||
* @param p The dependent promise | ||
*/ | ||
ODataBatch.prototype.addResolveBatchDependency = function (p) { | ||
this._resolveBatchDependencies.push(p); | ||
}; | ||
/** | ||
* Execute the current batch and resolve the associated promises | ||
@@ -743,3 +756,7 @@ * | ||
// We can get a second set of promises added during the first set resolving | ||
return Promise.all(this._dependencies).then(function () { return Promise.all(_this._dependencies); }).then(function () { return _this.executeImpl(); }); | ||
return Promise.all(this._dependencies) | ||
.then(function () { return Promise.all(_this._dependencies); }) | ||
.then(function () { return _this.executeImpl(); }) | ||
.then(function () { return Promise.all(_this._resolveBatchDependencies); }) | ||
.then(function () { return void (0); }); | ||
}; | ||
@@ -749,3 +766,3 @@ return ODataBatch; | ||
export { CachingOptions, CachingParserWrapper, ProcessHttpClientResponseException, ODataParserBase, ODataDefaultParser, TextParser, BlobParser, JSONParser, BufferParser, setResult, pipe, requestPipelineMethod, PipelineMethods, getDefaultPipeline, AlreadyInBatchException, Queryable, ODataQueryable, ODataBatch }; | ||
export { CachingOptions, CachingParserWrapper, ProcessHttpClientResponseException, ODataParserBase, ODataDefaultParser, TextParser, BlobParser, JSONParser, BufferParser, LambdaParser, setResult, pipe, requestPipelineMethod, PipelineMethods, getDefaultPipeline, AlreadyInBatchException, Queryable, ODataQueryable, ODataBatch }; | ||
//# sourceMappingURL=odata.es5.js.map |
/** | ||
@license | ||
* @pnp/odata v1.0.5 - pnp - provides shared odata functionality and base classes | ||
* @pnp/odata v1.1.0 - pnp - provides shared odata functionality and base classes | ||
* MIT (https://github.com/pnp/pnpjs/blob/master/LICENSE) | ||
@@ -10,5 +10,5 @@ * Copyright (c) 2018 Microsoft | ||
*/ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.pnp=t():e.pnp=t()}("undefined"!=typeof self?self:this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=6)}([function(e,t,n){"use strict";(function(e){/** | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.pnp=t():e.pnp=t()}("undefined"!=typeof self?self:this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=6)}([function(e,t,n){"use strict";(function(e){function r(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return function(){t.apply(e,n)}}function i(e,t,n){var r=new Date(e);switch(t.toLowerCase()){case"year":r.setFullYear(r.getFullYear()+n);break;case"quarter":r.setMonth(r.getMonth()+3*n);break;case"month":r.setMonth(r.getMonth()+n);break;case"week":r.setDate(r.getDate()+7*n);break;case"day":r.setDate(r.getDate()+n);break;case"hour":r.setTime(r.getTime()+36e5*n);break;case"minute":r.setTime(r.getTime()+6e4*n);break;case"second":r.setTime(r.getTime()+1e3*n);break;default:r=void 0}return r}function o(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.filter(function(e){return!d(e)}).map(function(e){return e.replace(/^[\\|\/]/,"").replace(/[\\|\/]$/,"")}).join("/").replace(/\\/g,"/")}function s(e){for(var t=new Array(e),n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=0;r<e;r++)t[r]=n.charAt(Math.floor(Math.random()*n.length));return t.join("")}function a(){var e=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===t?n:3&n|8).toString(16)})}function u(e){return"function"==typeof e}function c(e){return void 0!==e&&null!==e}function h(e){return Array.isArray?Array.isArray(e):e&&"number"==typeof e.length&&e.constructor===Array}function l(e,t,n,r){if(void 0===n&&(n=!1),!c(t))return e;var i=n?function(e,t){return!(t in e)}:function(){return!0},o=u(r)?r:function(){return!0},s=function(t){return i(e,t)&&o(t)};return Object.getOwnPropertyNames(t).filter(s).reduce(function(e,n){return e[n]=t[n],e},e)}function p(e){return/^https?:\/\/|^\/\//i.test(e)}function d(e){return void 0===e||null===e||e.length<1}function f(e,t){e=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");var n=new RegExp(t+"\\s*?=\\s*?(\"|')([^\\1]*?)\\1","i"),r=n.exec(e);return null!==r&&r.length>0?r[2]:null}function T(e){if(d(e))return e;var t=/([0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12})/i.exec(e);return null===t?e:t[1]}function g(e,t){if(void 0!==t&&null!==t){new Request("",{headers:t}).headers.forEach(function(t,n){e.append(n,t)})}}function _(e,t){if(c(t)){var n=l(e.headers||{},t.headers);e=l(e,t),e.headers=n}}n.d(t,"a",function(){return v}),n.d(t,"c",function(){return I}),n.d(t,"i",function(){return _}),n.d(t,"b",function(){return C}),n.d(t,"e",function(){return i}),n.d(t,"d",function(){return o}),n.d(t,"g",function(){return a}),n.d(t,"h",function(){return u}),n.d(t,"j",function(){return c}),n.d(t,"f",function(){return l});var S=n(1),E=n(2),O=n(9),N=(n.n(O),function(){function e(){}e.getCtxCallback=r,e.dateAdd=i,e.combinePaths=o,e.getRandomString=s,e.getGUID=a,e.isFunc=u,e.objectDefinedNotNull=c,e.isArray=h,e.extend=l,e.isUrlAbsolute=p,e.stringIsNullOrEmpty=d,e.getAttrValueFromString=f,e.sanitizeGuid=T}(),function(){function t(){}return t.prototype.fetch=function(t,n){return e.fetch(t,n)},t}()),m=function(e){function t(t){var n=e.call(this)||this;return n._token=t,n}return Object(E.b)(t,e),Object.defineProperty(t.prototype,"token",{get:function(){return this._token},set:function(e){this._token=e},enumerable:!0,configurable:!0}),t.prototype.fetch=function(t,n){void 0===n&&(n={});var r=new Headers;return g(r,n.headers),r.set("Authorization","Bearer "+this._token),n.headers=r,e.prototype.fetch.call(this,t,n)},t}(N),v=(function(e){function t(t,n,r){var i=e.call(this,null)||this;return i.clientId=t,i.tenant=n,i.redirectUri=r,i}Object(E.b)(t,e),t.fromSPFxContext=function(e,n){return void 0===n&&(n="c58637bb-e2e1-4312-8a00-04b5ffcd3403"),new t(n,e.pageContext.aadInfo.tenantId.toString(),o(window.location.origin,"/_forms/spfxsinglesignon.aspx"))},t.prototype.fetch=function(t,n){var r=this;if(!p(t))throw new Error("You must supply absolute urls to AdalClient.fetch.");return this.getToken(this.getResource(t)).then(function(i){return r.token=i,e.prototype.fetch.call(r,t,n)})},t.prototype.getToken=function(e){var n=this;return new Promise(function(r,i){n.ensureAuthContext().then(function(e){return n.login()}).then(function(n){t._authContext.acquireToken(e,function(e,t){if(e)return i(new Error(e));r(t)})}).catch(i)})},t.prototype.ensureAuthContext=function(){var e=this;return new Promise(function(n){null===t._authContext&&(t._authContext=Object(O.inject)({clientId:e.clientId,displayCall:function(t){e._displayCallback&&e._displayCallback(t)},navigateToLoginRequestUrl:!1,redirectUri:e.redirectUri,tenant:e.tenant})),n()})},t.prototype.login=function(){var e=this;return this._loginPromise?this._loginPromise:(this._loginPromise=new Promise(function(n,r){if(t._authContext.getCachedUser())return n();e._displayCallback=function(i){var o=window.open(i,"login","width=483, height=600");if(!o)return r(new Error("Could not open pop-up window for auth. Likely pop-ups are blocked by the browser."));o&&o.focus&&o.focus();var s=window.setInterval(function(){o&&!o.closed&&void 0!==o.closed||window.clearInterval(s);try{-1!==o.document.URL.indexOf(e.redirectUri)&&(window.clearInterval(s),t._authContext.handleWindowCallback(o.location.hash),o.close(),n())}catch(e){r(e)}},30)},e.ensureAuthContext().then(function(n){t._authContext._loginInProgress=!1,t._authContext.login(),e._displayCallback=null})}),this._loginPromise)},t.prototype.getResource=function(e){var t=document.createElement("a");return t.href=e,t.protocol+"//"+t.hostname},t._authContext=null}(m),function(){function e(e,t){void 0===e&&(e=[]),void 0===t&&(t=[]),this.keys=e,this.values=t}return e.prototype.get=function(e){var t=this.keys.indexOf(e);return t<0?null:this.values[t]},e.prototype.add=function(e,t){var n=this.keys.indexOf(e);n>-1?null===t?this.remove(e):this.values[n]=t:null!==t&&(this.keys.push(e),this.values.push(t))},e.prototype.merge=function(e){var t=this;if("getKeys"in e){var n=e;n.getKeys().map(function(e){t.add(e,n.get(e))})}else{var r=e;for(var i in r)r.hasOwnProperty(i)&&this.add(i,r[i])}},e.prototype.remove=function(e){var t=this.keys.indexOf(e);if(t<0)return null;var n=this.values[t];return this.keys.splice(t,1),this.values.splice(t,1),n},e.prototype.getKeys=function(){return this.keys},e.prototype.getValues=function(){return this.values},e.prototype.clear=function(){this.keys=[],this.values=[]},Object.defineProperty(e.prototype,"count",{get:function(){return this.keys.length},enumerable:!0,configurable:!0}),e}()),R=(function(e){function t(t){var n=e.call(this,t)||this;return n.name="UrlException",S.a.log({data:{},level:3,message:"["+n.name+"]::"+n.message}),n}Object(E.b)(t,e)}(Error),function(){function e(){this._v=new v,this._v.add("defaultCachingStore","session"),this._v.add("defaultCachingTimeoutSeconds",60),this._v.add("globalCacheDisable",!1),this._v.add("enableCacheExpiration",!1),this._v.add("cacheExpirationIntervalMilliseconds",750),this._v.add("spfxContext",null)}return e.prototype.extend=function(e){var t=this;Object.keys(e).forEach(function(n){t._v.add(n,e[n])})},e.prototype.get=function(e){return this._v.get(e)},Object.defineProperty(e.prototype,"defaultCachingStore",{get:function(){return this.get("defaultCachingStore")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"defaultCachingTimeoutSeconds",{get:function(){return this.get("defaultCachingTimeoutSeconds")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"globalCacheDisable",{get:function(){return this.get("globalCacheDisable")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"enableCacheExpiration",{get:function(){return this.get("enableCacheExpiration")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"cacheExpirationIntervalMilliseconds",{get:function(){return this.get("cacheExpirationIntervalMilliseconds")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"spfxContext",{get:function(){return this.get("spfxContext")},enumerable:!0,configurable:!0}),e}()),y=new R,I=y,b=function(){function e(e,t){void 0===t&&(t=-1),this.store=e,this.defaultTimeoutMinutes=t,this.enabled=this.test(),I.enableCacheExpiration&&(S.a.write("Enabling cache expiration.",1),this.cacheExpirationHandler())}return e.prototype.get=function(e){if(!this.enabled)return null;var t=this.store.getItem(e);if(null==t)return null;var n=JSON.parse(t);return new Date(n.expiration)<=new Date?(S.a.write("Removing item with key '"+e+"' from cache due to expiration.",1),this.delete(e),null):n.value},e.prototype.put=function(e,t,n){this.enabled&&this.store.setItem(e,this.createPersistable(t,n))},e.prototype.delete=function(e){this.enabled&&this.store.removeItem(e)},e.prototype.getOrPut=function(e,t,n){var r=this;return this.enabled?new Promise(function(i){var o=r.get(e);null==o?t().then(function(t){r.put(e,t,n),i(t)}):i(o)}):t()},e.prototype.deleteExpired=function(){var e=this;return new Promise(function(t,n){e.enabled||t();try{for(var r=0;r<e.store.length;r++){var i=e.store.key(r);null!==i&&/["|']?pnp["|']? ?: ?1/i.test(e.store.getItem(i))&&e.get(i)}t()}catch(e){n(e)}})},e.prototype.test=function(){try{return this.store.setItem("test","test"),this.store.removeItem("test"),!0}catch(e){return!1}},e.prototype.createPersistable=function(e,t){if(void 0===t){var n=I.defaultCachingTimeoutSeconds;this.defaultTimeoutMinutes>0&&(n=60*this.defaultTimeoutMinutes),t=i(new Date,"second",n)}return JSON.stringify({pnp:1,expiration:t,value:e})},e.prototype.cacheExpirationHandler=function(){var e=this;S.a.write("Called cache expiration handler.",0),this.deleteExpired().then(function(t){setTimeout(r(e,e.cacheExpirationHandler),I.cacheExpirationIntervalMilliseconds)}).catch(function(e){S.a.log({data:e,level:3,message:"Error deleting expired cache entries, see data for details. Timeout not reset."})})},e}(),w=function(){function e(e){void 0===e&&(e=new v),this._store=e}return Object.defineProperty(e.prototype,"length",{get:function(){return this._store.count},enumerable:!0,configurable:!0}),e.prototype.clear=function(){this._store.clear()},e.prototype.getItem=function(e){return this._store.get(e)},e.prototype.key=function(e){return this._store.getKeys()[e]},e.prototype.removeItem=function(e){this._store.remove(e)},e.prototype.setItem=function(e,t){this._store.add(e,t)},e}(),C=function(){function e(e,t){void 0===e&&(e=null),void 0===t&&(t=null),this._local=e,this._session=t}return Object.defineProperty(e.prototype,"local",{get:function(){return null===this._local&&(this._local=new b("undefined"!=typeof localStorage?localStorage:new w)),this._local},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"session",{get:function(){return null===this._session&&(this._session=new b("undefined"!=typeof sessionStorage?sessionStorage:new w)),this._session},enumerable:!0,configurable:!0}),e}()}).call(t,n(8))},function(e,t,n){"use strict";n.d(t,"a",function(){return i});/** | ||
@license | ||
* @pnp/common v1.0.5 - pnp - provides shared functionality across all pnp libraries | ||
* @pnp/logging v1.1.0 - pnp - light-weight, subscribable logging framework | ||
* MIT (https://github.com/pnp/pnpjs/blob/master/LICENSE) | ||
@@ -20,3 +20,3 @@ * Copyright (c) 2018 Microsoft | ||
*/ | ||
function r(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return function(){t.apply(e,n)}}function i(e,t,n){var r=new Date(e);switch(t.toLowerCase()){case"year":r.setFullYear(r.getFullYear()+n);break;case"quarter":r.setMonth(r.getMonth()+3*n);break;case"month":r.setMonth(r.getMonth()+n);break;case"week":r.setDate(r.getDate()+7*n);break;case"day":r.setDate(r.getDate()+n);break;case"hour":r.setTime(r.getTime()+36e5*n);break;case"minute":r.setTime(r.getTime()+6e4*n);break;case"second":r.setTime(r.getTime()+1e3*n);break;default:r=void 0}return r}function o(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.filter(function(e){return!d(e)}).map(function(e){return e.replace(/^[\\|\/]/,"").replace(/[\\|\/]$/,"")}).join("/").replace(/\\/g,"/")}function s(e){for(var t=new Array(e),n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=0;r<e;r++)t[r]=n.charAt(Math.floor(Math.random()*n.length));return t.join("")}function a(){var e=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===t?n:3&n|8).toString(16)})}function u(e){return"function"==typeof e}function c(e){return void 0!==e&&null!==e}function h(e){return Array.isArray?Array.isArray(e):e&&"number"==typeof e.length&&e.constructor===Array}function l(e,t,n){if(void 0===n&&(n=!1),!c(t))return e;var r=n?function(e,t){return!(t in e)}:function(){return!0};return Object.getOwnPropertyNames(t).filter(function(t){return r(e,t)}).reduce(function(e,n){return e[n]=t[n],e},e)}function p(e){return/^https?:\/\/|^\/\//i.test(e)}function d(e){return void 0===e||null===e||e.length<1}function f(e,t){if(void 0!==t&&null!==t){new Request("",{headers:t}).headers.forEach(function(t,n){e.append(n,t)})}}function T(e,t){if(c(t)){var n=l(e.headers||{},t.headers);e=l(e,t),e.headers=n}}n.d(t,"a",function(){return N}),n.d(t,"c",function(){return R}),n.d(t,"i",function(){return T}),n.d(t,"b",function(){return b}),n.d(t,"e",function(){return i}),n.d(t,"d",function(){return o}),n.d(t,"g",function(){return a}),n.d(t,"h",function(){return u}),n.d(t,"j",function(){return c}),n.d(t,"f",function(){return l});var _=n(1),g=n(9),S=(n.n(g),n(2)),E=(function(){function e(){}e.getCtxCallback=r,e.dateAdd=i,e.combinePaths=o,e.getRandomString=s,e.getGUID=a,e.isFunc=u,e.objectDefinedNotNull=c,e.isArray=h,e.extend=l,e.isUrlAbsolute=p,e.stringIsNullOrEmpty=d}(),function(){function t(){}return t.prototype.fetch=function(t,n){return e.fetch(t,n)},t}()),O=function(e){function t(t){var n=e.call(this)||this;return n._token=t,n}return Object(_.b)(t,e),Object.defineProperty(t.prototype,"token",{get:function(){return this._token},set:function(e){this._token=e},enumerable:!0,configurable:!0}),t.prototype.fetch=function(t,n){void 0===n&&(n={});var r=new Headers;return f(r,n.headers),r.set("Authorization","Bearer "+this._token),n.headers=r,e.prototype.fetch.call(this,t,n)},t}(E),N=(function(e){function t(t,n,r){var i=e.call(this,null)||this;return i.clientId=t,i.tenant=n,i.redirectUri=r,i}Object(_.b)(t,e),t.fromSPFxContext=function(e,n){return void 0===n&&(n="c58637bb-e2e1-4312-8a00-04b5ffcd3403"),new t(n,e.pageContext.aadInfo.tenantId.toString(),o(window.location.origin,"/_forms/spfxsinglesignon.aspx"))},t.prototype.fetch=function(t,n){var r=this;if(!p(t))throw new Error("You must supply absolute urls to AdalClient.fetch.");return this.getToken(this.getResource(t)).then(function(i){return r.token=i,e.prototype.fetch.call(r,t,n)})},t.prototype.getToken=function(e){var n=this;return new Promise(function(r,i){n.ensureAuthContext().then(function(e){return n.login()}).then(function(n){t._authContext.acquireToken(e,function(e,t){if(e)return i(new Error(e));r(t)})}).catch(i)})},t.prototype.ensureAuthContext=function(){var e=this;return new Promise(function(n){null===t._authContext&&(t._authContext=Object(g.inject)({clientId:e.clientId,displayCall:function(t){e._displayCallback&&e._displayCallback(t)},navigateToLoginRequestUrl:!1,redirectUri:e.redirectUri,tenant:e.tenant})),n()})},t.prototype.login=function(){var e=this;return this._loginPromise?this._loginPromise:(this._loginPromise=new Promise(function(n,r){if(t._authContext.getCachedUser())return n();e._displayCallback=function(i){var o=window.open(i,"login","width=483, height=600");if(!o)return r(new Error("Could not open pop-up window for auth. Likely pop-ups are blocked by the browser."));o&&o.focus&&o.focus();var s=window.setInterval(function(){o&&!o.closed&&void 0!==o.closed||window.clearInterval(s);try{-1!==o.document.URL.indexOf(e.redirectUri)&&(window.clearInterval(s),t._authContext.handleWindowCallback(o.location.hash),o.close(),n())}catch(e){r(e)}},30)},e.ensureAuthContext().then(function(n){t._authContext._loginInProgress=!1,t._authContext.login(),e._displayCallback=null})}),this._loginPromise)},t.prototype.getResource=function(e){var t=document.createElement("a");return t.href=e,t.protocol+"//"+t.hostname},t._authContext=null}(O),function(){function e(e,t){void 0===e&&(e=[]),void 0===t&&(t=[]),this.keys=e,this.values=t}return e.prototype.get=function(e){var t=this.keys.indexOf(e);return t<0?null:this.values[t]},e.prototype.add=function(e,t){var n=this.keys.indexOf(e);n>-1?null===t?this.remove(e):this.values[n]=t:null!==t&&(this.keys.push(e),this.values.push(t))},e.prototype.merge=function(e){var t=this;if("getKeys"in e){var n=e;n.getKeys().map(function(e){t.add(e,n.get(e))})}else{var r=e;for(var i in r)r.hasOwnProperty(i)&&this.add(i,r[i])}},e.prototype.remove=function(e){var t=this.keys.indexOf(e);if(t<0)return null;var n=this.values[t];return this.keys.splice(t,1),this.values.splice(t,1),n},e.prototype.getKeys=function(){return this.keys},e.prototype.getValues=function(){return this.values},e.prototype.clear=function(){this.keys=[],this.values=[]},Object.defineProperty(e.prototype,"count",{get:function(){return this.keys.length},enumerable:!0,configurable:!0}),e}()),m=(function(e){function t(t){var n=e.call(this,t)||this;return n.name="UrlException",S.a.log({data:{},level:3,message:"["+n.name+"]::"+n.message}),n}Object(_.b)(t,e)}(Error),function(){function e(){this._v=new N,this._v.add("defaultCachingStore","session"),this._v.add("defaultCachingTimeoutSeconds",60),this._v.add("globalCacheDisable",!1),this._v.add("enableCacheExpiration",!1),this._v.add("cacheExpirationIntervalMilliseconds",750),this._v.add("spfxContext",null)}return e.prototype.extend=function(e){var t=this;Object.keys(e).forEach(function(n){t._v.add(n,e[n])})},e.prototype.get=function(e){return this._v.get(e)},Object.defineProperty(e.prototype,"defaultCachingStore",{get:function(){return this.get("defaultCachingStore")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"defaultCachingTimeoutSeconds",{get:function(){return this.get("defaultCachingTimeoutSeconds")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"globalCacheDisable",{get:function(){return this.get("globalCacheDisable")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"enableCacheExpiration",{get:function(){return this.get("enableCacheExpiration")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"cacheExpirationIntervalMilliseconds",{get:function(){return this.get("cacheExpirationIntervalMilliseconds")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"spfxContext",{get:function(){return this.get("spfxContext")},enumerable:!0,configurable:!0}),e}()),v=new m,R=v,y=function(){function e(e,t){void 0===t&&(t=-1),this.store=e,this.defaultTimeoutMinutes=t,this.enabled=this.test(),R.enableCacheExpiration&&(S.a.write("Enabling cache expiration.",1),this.cacheExpirationHandler())}return e.prototype.get=function(e){if(!this.enabled)return null;var t=this.store.getItem(e);if(null==t)return null;var n=JSON.parse(t);return new Date(n.expiration)<=new Date?(S.a.write("Removing item with key '"+e+"' from cache due to expiration.",1),this.delete(e),null):n.value},e.prototype.put=function(e,t,n){this.enabled&&this.store.setItem(e,this.createPersistable(t,n))},e.prototype.delete=function(e){this.enabled&&this.store.removeItem(e)},e.prototype.getOrPut=function(e,t,n){var r=this;return this.enabled?new Promise(function(i){var o=r.get(e);null==o?t().then(function(t){r.put(e,t,n),i(t)}):i(o)}):t()},e.prototype.deleteExpired=function(){var e=this;return new Promise(function(t,n){e.enabled||t();try{for(var r=0;r<e.store.length;r++){var i=e.store.key(r);null!==i&&/["|']?pnp["|']? ?: ?1/i.test(e.store.getItem(i))&&e.get(i)}t()}catch(e){n(e)}})},e.prototype.test=function(){try{return this.store.setItem("test","test"),this.store.removeItem("test"),!0}catch(e){return!1}},e.prototype.createPersistable=function(e,t){if(void 0===t){var n=R.defaultCachingTimeoutSeconds;this.defaultTimeoutMinutes>0&&(n=60*this.defaultTimeoutMinutes),t=i(new Date,"second",n)}return JSON.stringify({pnp:1,expiration:t,value:e})},e.prototype.cacheExpirationHandler=function(){var e=this;S.a.write("Called cache expiration handler.",0),this.deleteExpired().then(function(t){setTimeout(r(e,e.cacheExpirationHandler),R.cacheExpirationIntervalMilliseconds)}).catch(function(e){S.a.log({data:e,level:3,message:"Error deleting expired cache entries, see data for details. Timeout not reset."})})},e}(),I=function(){function e(e){void 0===e&&(e=new N),this._store=e}return Object.defineProperty(e.prototype,"length",{get:function(){return this._store.count},enumerable:!0,configurable:!0}),e.prototype.clear=function(){this._store.clear()},e.prototype.getItem=function(e){return this._store.get(e)},e.prototype.key=function(e){return this._store.getKeys()[e]},e.prototype.removeItem=function(e){this._store.remove(e)},e.prototype.setItem=function(e,t){this._store.add(e,t)},e}(),b=function(){function e(e,t){void 0===e&&(e=null),void 0===t&&(t=null),this._local=e,this._session=t}return Object.defineProperty(e.prototype,"local",{get:function(){return null===this._local&&(this._local=new y("undefined"!=typeof localStorage?localStorage:new I)),this._local},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"session",{get:function(){return null===this._session&&(this._session=new y("undefined"!=typeof sessionStorage?sessionStorage:new I)),this._session},enumerable:!0,configurable:!0}),e}()}).call(t,n(8))},function(e,t,n){"use strict";function r(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function i(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s}t.b=r,t.a=i;/*! ***************************************************************************** | ||
var r,i=function(){function e(){}return Object.defineProperty(e,"activeLogLevel",{get:function(){return e.instance.activeLogLevel},set:function(t){e.instance.activeLogLevel=t},enumerable:!0,configurable:!0}),Object.defineProperty(e,"instance",{get:function(){return void 0!==e._instance&&null!==e._instance||(e._instance=new o),e._instance},enumerable:!0,configurable:!0}),e.subscribe=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];t.map(function(t){return e.instance.subscribe(t)})},e.clearSubscribers=function(){return e.instance.clearSubscribers()},Object.defineProperty(e,"count",{get:function(){return e.instance.count},enumerable:!0,configurable:!0}),e.write=function(t,n){void 0===n&&(n=1),e.instance.log({level:n,message:t})},e.writeJSON=function(t,n){void 0===n&&(n=1),e.instance.log({level:n,message:JSON.stringify(t)})},e.log=function(t){e.instance.log(t)},e.error=function(t){e.instance.log({data:t,level:3,message:t.message})},e}(),o=function(){function e(e,t){void 0===e&&(e=2),void 0===t&&(t=[]),this.activeLogLevel=e,this.subscribers=t}return e.prototype.subscribe=function(e){this.subscribers.push(e)},e.prototype.clearSubscribers=function(){var e=this.subscribers.slice(0);return this.subscribers.length=0,e},Object.defineProperty(e.prototype,"count",{get:function(){return this.subscribers.length},enumerable:!0,configurable:!0}),e.prototype.write=function(e,t){void 0===t&&(t=1),this.log({level:t,message:e})},e.prototype.log=function(e){void 0!==e&&this.activeLogLevel<=e.level&&this.subscribers.map(function(t){return t.log(e)})},e}();!function(e){e[e.Verbose=0]="Verbose",e[e.Info=1]="Info",e[e.Warning=2]="Warning",e[e.Error=3]="Error",e[e.Off=99]="Off"}(r||(r={}));(function(){function e(){}e.prototype.log=function(e){var t=this.format(e);switch(e.level){case 0:case 1:console.log(t);break;case 2:console.warn(t);break;case 3:console.error(t)}},e.prototype.format=function(e){var t=[];return t.push("Message: "+e.message),void 0!==e.data&&t.push(" Data: "+JSON.stringify(e.data)),t.join("")}})(),function(){function e(e){this.method=e}e.prototype.log=function(e){this.method(e)}}()},function(e,t,n){"use strict";function r(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function i(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s}t.b=r,t.a=i;/*! ***************************************************************************** | ||
Copyright (c) Microsoft Corporation. All rights reserved. | ||
@@ -35,14 +35,5 @@ Licensed under the Apache License, Version 2.0 (the "License"); you may not use | ||
***************************************************************************** */ | ||
var o=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])};Object.assign},function(e,t,n){"use strict";n.d(t,"a",function(){return r});/** | ||
@license | ||
* @pnp/logging v1.0.5 - pnp - light-weight, subscribable logging framework | ||
* MIT (https://github.com/pnp/pnpjs/blob/master/LICENSE) | ||
* Copyright (c) 2018 Microsoft | ||
* docs: https://pnp.github.io/pnpjs/ | ||
* source: https:github.com/pnp/pnpjs | ||
* bugs: https://github.com/pnp/pnpjs/issues | ||
*/ | ||
var r=function(){function e(){}return Object.defineProperty(e,"activeLogLevel",{get:function(){return e.instance.activeLogLevel},set:function(t){e.instance.activeLogLevel=t},enumerable:!0,configurable:!0}),Object.defineProperty(e,"instance",{get:function(){return void 0!==e._instance&&null!==e._instance||(e._instance=new i),e._instance},enumerable:!0,configurable:!0}),e.subscribe=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];t.map(function(t){return e.instance.subscribe(t)})},e.clearSubscribers=function(){return e.instance.clearSubscribers()},Object.defineProperty(e,"count",{get:function(){return e.instance.count},enumerable:!0,configurable:!0}),e.write=function(t,n){void 0===n&&(n=0),e.instance.log({level:n,message:t})},e.writeJSON=function(t,n){void 0===n&&(n=0),e.instance.log({level:n,message:JSON.stringify(t)})},e.log=function(t){e.instance.log(t)},e.error=function(t){e.instance.log({data:t,level:3,message:t.message})},e}(),i=function(){function e(e,t){void 0===e&&(e=2),void 0===t&&(t=[]),this.activeLogLevel=e,this.subscribers=t}return e.prototype.subscribe=function(e){this.subscribers.push(e)},e.prototype.clearSubscribers=function(){var e=this.subscribers.slice(0);return this.subscribers.length=0,e},Object.defineProperty(e.prototype,"count",{get:function(){return this.subscribers.length},enumerable:!0,configurable:!0}),e.prototype.write=function(e,t){void 0===t&&(t=0),this.log({level:t,message:e})},e.prototype.log=function(e){void 0!==e&&this.activeLogLevel<=e.level&&this.subscribers.map(function(t){return t.log(e)})},e}();(function(){function e(){}e.prototype.log=function(e){var t=this.format(e);switch(e.level){case 0:case 1:console.log(t);break;case 2:console.warn(t);break;case 3:console.error(t)}},e.prototype.format=function(e){var t=[];return t.push("Message: "+e.message),void 0!==e.data&&t.push(" Data: "+JSON.stringify(e.data)),t.join("")}})(),function(){function e(e){this.method=e}e.prototype.log=function(e){this.method(e)}}()},function(e,t,n){"use strict";n.d(t,"a",function(){return i}),n.d(t,"b",function(){return o});var r=n(0),i=function(){function e(e){this.key=e,this.expiration=Object(r.e)(new Date,"second",r.c.defaultCachingTimeoutSeconds),this.storeName=r.c.defaultCachingStore}return Object.defineProperty(e.prototype,"store",{get:function(){return"local"===this.storeName?e.storage.local:e.storage.session},enumerable:!0,configurable:!0}),e.storage=new r.b,e}(),o=function(){function e(e,t){this._parser=e,this._cacheOptions=t}return e.prototype.parse=function(e){var t=this;return this._parser.parse(e).then(function(e){return null!==t._cacheOptions.store&&t._cacheOptions.store.put(t._cacheOptions.key,e,t._cacheOptions.expiration),e})},e}()},function(e,t,n){"use strict";n.d(t,"f",function(){return s}),n.d(t,"e",function(){return a}),n.d(t,"d",function(){return u}),n.d(t,"g",function(){return c}),n.d(t,"a",function(){return h}),n.d(t,"c",function(){return l}),n.d(t,"b",function(){return p});var r=n(1),i=n(0),o=n(2),s=function(e){function t(t,n,r){var i=e.call(this,"Error making HttpClient request in queryable: ["+t+"] "+n)||this;return i.status=t,i.statusText=n,i.data=r,i.name="ProcessHttpClientResponseException",o.a.log({data:i.data,level:3,message:i.message}),i}return r.b(t,e),t}(Error),a=function(){function e(){}return e.prototype.parse=function(e){var t=this;return new Promise(function(n,r){t.handleError(e,r)&&t.parseImpl(e,n,r)})},e.prototype.parseImpl=function(e,t,n){var r=this;e.headers.has("Content-Length")&&0===parseFloat(e.headers.get("Content-Length"))||204===e.status?t({}):e.text().then(function(e){return e.replace(/\s/gi,"").length>0?JSON.parse(e):{}}).then(function(e){return t(r.parseODataJSON(e))}).catch(function(e){return n(e)})},e.prototype.handleError=function(e,t){return e.ok||e.json().then(function(n){var r={responseBody:n,responseHeaders:e.headers};t(new s(e.status,e.statusText,r))}).catch(function(n){o.a.log({data:n,level:2,message:"There was an error parsing the error response body. See data for details."});var r={responseBody:"[[body not available]]",responseHeaders:e.headers};t(new s(e.status,e.statusText,r))}),e.ok},e.prototype.parseODataJSON=function(e){var t=e;return e.hasOwnProperty("d")?t=e.d.hasOwnProperty("results")?e.d.results:e.d:e.hasOwnProperty("value")&&(t=e.value),t},e}(),u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.b(t,e),t}(a),c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.b(t,e),t.prototype.parseImpl=function(e,t){e.text().then(t)},t}(a),h=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.b(t,e),t.prototype.parseImpl=function(e,t){e.blob().then(t)},t}(a),l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.b(t,e),t.prototype.parseImpl=function(e,t){e.json().then(t)},t}(a),p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.b(t,e),t.prototype.parseImpl=function(e,t){Object(i.h)(e.arrayBuffer)&&e.arrayBuffer().then(t),e.buffer().then(t)},t}(a)},function(e,t,n){"use strict";function r(e){return l.a.log({data:e.result,level:0,message:"["+e.requestId+"] ("+(new Date).getTime()+") Returning result, see data property for value."}),Promise.resolve(e.result||null)}function i(e,t){return new Promise(function(n){e.result=t,e.hasResult=!0,n(e)})}function o(e){return e.pipeline.length>0?e.pipeline.shift()(e):Promise.resolve(e)}function s(e){return e.pipeline.length<1&&l.a.write("["+e.requestId+"] ("+(new Date).getTime()+") Request pipeline contains no methods!",2),o(e).then(function(e){return r(e)}).catch(function(e){throw l.a.error(e),e})}function a(e){return void 0===e&&(e=!1),function(t,n,r){var i=r.value;r.value=function(){for(var r=[],s=0;s<arguments.length;s++)r[s]=arguments[s];return!e&&r.length>0&&r[0].hasOwnProperty("hasResult")&&r[0].hasResult?(l.a.write("["+r[0].requestId+"] ("+(new Date).getTime()+") Skipping request pipeline method "+n+", existing result in pipeline.",0),Promise.resolve(r[0])):(l.a.write("["+r[0].requestId+"] ("+(new Date).getTime()+") Calling request pipeline method "+n+".",0),i.apply(t,r).then(function(e){return o(e)}))}}}function u(){return[d.logStart,d.caching,d.send,d.logEnd].slice(0)}t.e=i,t.c=s,t.d=a,n.d(t,"a",function(){return d}),t.b=u;var c=n(1),h=n(3),l=n(2),p=n(0),d=function(){function e(){}return e.logStart=function(e){return new Promise(function(t){l.a.log({data:1===l.a.activeLogLevel?{}:e,level:1,message:"["+e.requestId+"] ("+(new Date).getTime()+") Beginning "+e.verb+" request ("+e.requestAbsoluteUrl+")"}),t(e)})},e.caching=function(e){return new Promise(function(t){if("GET"===e.verb&&e.isCached){l.a.write("["+e.requestId+"] ("+(new Date).getTime()+") Caching is enabled for request, checking cache...",1);var n=new h.a(e.requestAbsoluteUrl.toLowerCase());if(void 0!==e.cachingOptions&&(n=Object(p.f)(n,e.cachingOptions)),null!==n.store){var r=n.store.get(n.key);if(null!==r)return l.a.log({data:1===l.a.activeLogLevel?{}:r,level:1,message:"["+e.requestId+"] ("+(new Date).getTime()+") Value returned from cache."}),Object(p.h)(e.batchDependency)&&e.batchDependency(),e.parser.hasOwnProperty("hydrate")&&(r=e.parser.hydrate(r)),i(e,r).then(function(e){return t(e)})}l.a.write("["+e.requestId+"] ("+(new Date).getTime()+") Value not found in cache.",1),e.parser=new h.b(e.parser,n)}return t(e)})},e.send=function(e){return new Promise(function(t,n){if(e.isBatched){var r=e.batch.add(e.requestAbsoluteUrl,e.verb,e.options,e.parser);Object(p.h)(e.batchDependency)&&e.batchDependency(),l.a.write("["+e.requestId+"] ("+(new Date).getTime()+") Batching request in batch "+e.batch.batchId+".",1),t(i(e,r))}else{l.a.write("["+e.requestId+"] ("+(new Date).getTime()+") Sending request.",1);var o=e.clientFactory(),s=Object(p.f)(e.options||{},{method:e.verb});o.fetch(e.requestAbsoluteUrl,s).then(function(t){return e.parser.parse(t)}).then(function(t){return i(e,t)}).then(function(e){return t(e)}).catch(function(e){return n(e)})}})},e.logEnd=function(e){return new Promise(function(t){e.isBatched?l.a.log({data:1===l.a.activeLogLevel?{}:e,level:1,message:"["+e.requestId+"] ("+(new Date).getTime()+") "+e.verb+" request will complete in batch "+e.batch.batchId+"."}):l.a.log({data:1===l.a.activeLogLevel?{}:e,level:1,message:"["+e.requestId+"] ("+(new Date).getTime()+") Completing "+e.verb+" request."}),t(e)})},c.a([a(!0)],e,"logStart",null),c.a([a()],e,"caching",null),c.a([a()],e,"send",null),c.a([a(!0)],e,"logEnd",null),e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7);n.d(t,"CachingOptions",function(){return r.d}),n.d(t,"CachingParserWrapper",function(){return r.e}),n.d(t,"ProcessHttpClientResponseException",function(){return r.l}),n.d(t,"ODataParserBase",function(){return r.i}),n.d(t,"ODataDefaultParser",function(){return r.h}),n.d(t,"TextParser",function(){return r.n}),n.d(t,"BlobParser",function(){return r.b}),n.d(t,"JSONParser",function(){return r.f}),n.d(t,"BufferParser",function(){return r.c}),n.d(t,"setResult",function(){return r.r}),n.d(t,"pipe",function(){return r.p}),n.d(t,"requestPipelineMethod",function(){return r.q}),n.d(t,"PipelineMethods",function(){return r.k}),n.d(t,"getDefaultPipeline",function(){return r.o}),n.d(t,"AlreadyInBatchException",function(){return r.a}),n.d(t,"Queryable",function(){return r.m}),n.d(t,"ODataQueryable",function(){return r.j}),n.d(t,"ODataBatch",function(){return r.g})},function(e,t,n){"use strict";var r=n(3);n.d(t,"d",function(){return r.a}),n.d(t,"e",function(){return r.b});var i=n(4);n.d(t,"b",function(){return i.a}),n.d(t,"c",function(){return i.b}),n.d(t,"f",function(){return i.c}),n.d(t,"h",function(){return i.d}),n.d(t,"i",function(){return i.e}),n.d(t,"l",function(){return i.f}),n.d(t,"n",function(){return i.g});var o=n(5);n.d(t,"k",function(){return o.a}),n.d(t,"o",function(){return o.b}),n.d(t,"p",function(){return o.c}),n.d(t,"q",function(){return o.d}),n.d(t,"r",function(){return o.e});var s=n(10);n.d(t,"a",function(){return s.a}),n.d(t,"j",function(){return s.b}),n.d(t,"m",function(){return s.c});var a=n(11);n.d(t,"g",function(){return a.a})},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){ | ||
var o=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])};Object.assign},function(e,t,n){"use strict";n.d(t,"a",function(){return i}),n.d(t,"b",function(){return o});var r=n(0),i=function(){function e(e){this.key=e,this.expiration=Object(r.e)(new Date,"second",r.c.defaultCachingTimeoutSeconds),this.storeName=r.c.defaultCachingStore}return Object.defineProperty(e.prototype,"store",{get:function(){return"local"===this.storeName?e.storage.local:e.storage.session},enumerable:!0,configurable:!0}),e.storage=new r.b,e}(),o=function(){function e(e,t){this.parser=e,this.cacheOptions=t}return e.prototype.parse=function(e){var t=this;return this.parser.parse(e).then(function(e){return t.cacheData(e)})},e.prototype.cacheData=function(e){return null!==this.cacheOptions.store&&this.cacheOptions.store.put(this.cacheOptions.key,e,this.cacheOptions.expiration),e},e}()},function(e,t,n){"use strict";n.d(t,"g",function(){return s}),n.d(t,"f",function(){return a}),n.d(t,"e",function(){return u}),n.d(t,"h",function(){return c}),n.d(t,"a",function(){return h}),n.d(t,"c",function(){return l}),n.d(t,"b",function(){return p}),n.d(t,"d",function(){return d});var r=n(2),i=n(0),o=n(1),s=function(e){function t(t,n,r){var i=e.call(this,"Error making HttpClient request in queryable: ["+t+"] "+n)||this;return i.status=t,i.statusText=n,i.data=r,i.name="ProcessHttpClientResponseException",o.a.log({data:i.data,level:3,message:i.message}),i}return r.b(t,e),t}(Error),a=function(){function e(){}return e.prototype.parse=function(e){var t=this;return new Promise(function(n,r){t.handleError(e,r)&&t.parseImpl(e,n,r)})},e.prototype.parseImpl=function(e,t,n){var r=this;e.headers.has("Content-Length")&&0===parseFloat(e.headers.get("Content-Length"))||204===e.status?t({}):e.text().then(function(e){return e.replace(/\s/gi,"").length>0?JSON.parse(e):{}}).then(function(e){return t(r.parseODataJSON(e))}).catch(function(e){return n(e)})},e.prototype.handleError=function(e,t){return e.ok||e.json().then(function(n){var r={responseBody:n,responseHeaders:e.headers};t(new s(e.status,e.statusText,r))}).catch(function(n){o.a.log({data:n,level:2,message:"There was an error parsing the error response body. See data for details."});var r={responseBody:"[[body not available]]",responseHeaders:e.headers};t(new s(e.status,e.statusText,r))}),e.ok},e.prototype.parseODataJSON=function(e){var t=e;return e.hasOwnProperty("d")?t=e.d.hasOwnProperty("results")?e.d.results:e.d:e.hasOwnProperty("value")&&(t=e.value),t},e}(),u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.b(t,e),t}(a),c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.b(t,e),t.prototype.parseImpl=function(e,t){e.text().then(t)},t}(a),h=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.b(t,e),t.prototype.parseImpl=function(e,t){e.blob().then(t)},t}(a),l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.b(t,e),t.prototype.parseImpl=function(e,t){e.json().then(t)},t}(a),p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.b(t,e),t.prototype.parseImpl=function(e,t){Object(i.h)(e.arrayBuffer)?e.arrayBuffer().then(t):e.buffer().then(t)},t}(a),d=function(){function e(e){this.parser=e}return e.prototype.parse=function(e){return this.parser(e)},e}()},function(e,t,n){"use strict";function r(e){return l.a.log({data:0===l.a.activeLogLevel?e.result:{},level:1,message:"["+e.requestId+"] ("+(new Date).getTime()+") Returning result from pipeline. Set logging to verbose to see data."}),Promise.resolve(e.result||null)}function i(e,t){return new Promise(function(n){e.result=t,e.hasResult=!0,n(e)})}function o(e){return e.pipeline.length>0?e.pipeline.shift()(e):Promise.resolve(e)}function s(e){e.pipeline.length<1&&l.a.write("["+e.requestId+"] ("+(new Date).getTime()+") Request pipeline contains no methods!",2);var t=o(e).then(function(e){return r(e)}).catch(function(e){throw l.a.error(e),e});return e.isBatched&&e.batch.addResolveBatchDependency(t),t}function a(e){return void 0===e&&(e=!1),function(t,n,r){var i=r.value;r.value=function(){for(var r=[],s=0;s<arguments.length;s++)r[s]=arguments[s];return!e&&r.length>0&&r[0].hasOwnProperty("hasResult")&&r[0].hasResult?(l.a.write("["+r[0].requestId+"] ("+(new Date).getTime()+") Skipping request pipeline method "+n+", existing result in pipeline.",0),Promise.resolve(r[0])):(l.a.write("["+r[0].requestId+"] ("+(new Date).getTime()+") Calling request pipeline method "+n+".",0),i.apply(t,r).then(function(e){return o(e)}))}}}function u(){return[d.logStart,d.caching,d.send,d.logEnd].slice(0)}t.e=i,t.c=s,t.d=a,n.d(t,"a",function(){return d}),t.b=u;var c=n(2),h=n(0),l=n(1),p=n(3),d=function(){function e(){}return e.logStart=function(e){return new Promise(function(t){l.a.log({data:1===l.a.activeLogLevel?{}:e,level:1,message:"["+e.requestId+"] ("+(new Date).getTime()+") Beginning "+e.verb+" request ("+e.requestAbsoluteUrl+")"}),t(e)})},e.caching=function(e){return new Promise(function(t){if(e.isCached){l.a.write("["+e.requestId+"] ("+(new Date).getTime()+") Caching is enabled for request, checking cache...",1);var n=new p.a(e.requestAbsoluteUrl.toLowerCase());if(void 0!==e.cachingOptions&&(n=Object(h.f)(n,e.cachingOptions)),null!==n.store){var r=n.store.get(n.key);if(null!==r)return l.a.log({data:1===l.a.activeLogLevel?{}:r,level:1,message:"["+e.requestId+"] ("+(new Date).getTime()+") Value returned from cache."}),Object(h.h)(e.batchDependency)&&e.batchDependency(),e.parser.hasOwnProperty("hydrate")&&(r=e.parser.hydrate(r)),i(e,r).then(function(e){return t(e)})}l.a.write("["+e.requestId+"] ("+(new Date).getTime()+") Value not found in cache.",1),e.parser=new p.b(e.parser,n)}return t(e)})},e.send=function(e){return new Promise(function(t,n){if(e.isBatched){var r=e.batch.add(e.requestAbsoluteUrl,e.verb,e.options,e.parser,e.requestId);Object(h.h)(e.batchDependency)&&e.batchDependency(),l.a.write("["+e.requestId+"] ("+(new Date).getTime()+") Batching request in batch "+e.batch.batchId+".",1),t(i(e,r))}else{l.a.write("["+e.requestId+"] ("+(new Date).getTime()+") Sending request.",1);var o=e.clientFactory(),s=Object(h.f)(e.options||{},{method:e.verb});o.fetch(e.requestAbsoluteUrl,s).then(function(t){return e.parser.parse(t)}).then(function(t){return i(e,t)}).then(function(e){return t(e)}).catch(function(e){return n(e)})}})},e.logEnd=function(e){return new Promise(function(t){e.isBatched?l.a.log({data:1===l.a.activeLogLevel?{}:e,level:1,message:"["+e.requestId+"] ("+(new Date).getTime()+") "+e.verb+" request will complete in batch "+e.batch.batchId+"."}):l.a.log({data:1===l.a.activeLogLevel?{}:e,level:1,message:"["+e.requestId+"] ("+(new Date).getTime()+") Completing "+e.verb+" request."}),t(e)})},c.a([a(!0)],e,"logStart",null),c.a([a()],e,"caching",null),c.a([a()],e,"send",null),c.a([a(!0)],e,"logEnd",null),e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7);n.d(t,"CachingOptions",function(){return r.d}),n.d(t,"CachingParserWrapper",function(){return r.e}),n.d(t,"ProcessHttpClientResponseException",function(){return r.m}),n.d(t,"ODataParserBase",function(){return r.j}),n.d(t,"ODataDefaultParser",function(){return r.i}),n.d(t,"TextParser",function(){return r.o}),n.d(t,"BlobParser",function(){return r.b}),n.d(t,"JSONParser",function(){return r.f}),n.d(t,"BufferParser",function(){return r.c}),n.d(t,"LambdaParser",function(){return r.g}),n.d(t,"setResult",function(){return r.s}),n.d(t,"pipe",function(){return r.q}),n.d(t,"requestPipelineMethod",function(){return r.r}),n.d(t,"PipelineMethods",function(){return r.l}),n.d(t,"getDefaultPipeline",function(){return r.p}),n.d(t,"AlreadyInBatchException",function(){return r.a}),n.d(t,"Queryable",function(){return r.n}),n.d(t,"ODataQueryable",function(){return r.k}),n.d(t,"ODataBatch",function(){return r.h})},function(e,t,n){"use strict";var r=n(3);n.d(t,"d",function(){return r.a}),n.d(t,"e",function(){return r.b});var i=n(4);n.d(t,"b",function(){return i.a}),n.d(t,"c",function(){return i.b}),n.d(t,"f",function(){return i.c}),n.d(t,"g",function(){return i.d}),n.d(t,"i",function(){return i.e}),n.d(t,"j",function(){return i.f}),n.d(t,"m",function(){return i.g}),n.d(t,"o",function(){return i.h});var o=n(5);n.d(t,"l",function(){return o.a}),n.d(t,"p",function(){return o.b}),n.d(t,"q",function(){return o.c}),n.d(t,"r",function(){return o.d}),n.d(t,"s",function(){return o.e});var s=n(10);n.d(t,"a",function(){return s.a}),n.d(t,"k",function(){return s.b}),n.d(t,"n",function(){return s.c});var a=n(11);n.d(t,"h",function(){return a.a})},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){ | ||
// @preserve Copyright (c) Microsoft Open Technologies, Inc. | ||
var n=function(){"use strict";return n=function(e){if(this.REQUEST_TYPE={LOGIN:"LOGIN",RENEW_TOKEN:"RENEW_TOKEN",UNKNOWN:"UNKNOWN"},this.RESPONSE_TYPE={ID_TOKEN_TOKEN:"id_token token",TOKEN:"token"},this.CONSTANTS={ACCESS_TOKEN:"access_token",EXPIRES_IN:"expires_in",ID_TOKEN:"id_token",ERROR_DESCRIPTION:"error_description",SESSION_STATE:"session_state",ERROR:"error",STORAGE:{TOKEN_KEYS:"adal.token.keys",ACCESS_TOKEN_KEY:"adal.access.token.key",EXPIRATION_KEY:"adal.expiration.key",STATE_LOGIN:"adal.state.login",STATE_RENEW:"adal.state.renew",NONCE_IDTOKEN:"adal.nonce.idtoken",SESSION_STATE:"adal.session.state",USERNAME:"adal.username",IDTOKEN:"adal.idtoken",ERROR:"adal.error",ERROR_DESCRIPTION:"adal.error.description",LOGIN_REQUEST:"adal.login.request",LOGIN_ERROR:"adal.login.error",RENEW_STATUS:"adal.token.renew.status",ANGULAR_LOGIN_REQUEST:"adal.angular.login.request"},RESOURCE_DELIMETER:"|",CACHE_DELIMETER:"||",LOADFRAME_TIMEOUT:6e3,TOKEN_RENEW_STATUS_CANCELED:"Canceled",TOKEN_RENEW_STATUS_COMPLETED:"Completed",TOKEN_RENEW_STATUS_IN_PROGRESS:"In Progress",LOGGING_LEVEL:{ERROR:0,WARN:1,INFO:2,VERBOSE:3},LEVEL_STRING_MAP:{0:"ERROR:",1:"WARNING:",2:"INFO:",3:"VERBOSE:"},POPUP_WIDTH:483,POPUP_HEIGHT:600},n.prototype._singletonInstance)return n.prototype._singletonInstance;if(n.prototype._singletonInstance=this,this.instance="https://login.microsoftonline.com/",this.config={},this.callback=null,this.popUp=!1,this.isAngular=!1,this._user=null,this._activeRenewals={},this._loginInProgress=!1,this._acquireTokenInProgress=!1,this._renewStates=[],this._callBackMappedToRenewStates={},this._callBacksMappedToRenewStates={},this._openedWindows=[],this._requestType=this.REQUEST_TYPE.LOGIN,window._adalInstance=this,e.displayCall&&"function"!=typeof e.displayCall)throw new Error("displayCall is not a function");if(!e.clientId)throw new Error("clientId is required");this.config=this._cloneConfig(e),void 0===this.config.navigateToLoginRequestUrl&&(this.config.navigateToLoginRequestUrl=!0),this.config.popUp&&(this.popUp=!0),this.config.callback&&"function"==typeof this.config.callback&&(this.callback=this.config.callback),this.config.instance&&(this.instance=this.config.instance),this.config.loginResource||(this.config.loginResource=this.config.clientId),this.config.redirectUri||(this.config.redirectUri=window.location.href.split("?")[0].split("#")[0]),this.config.postLogoutRedirectUri||(this.config.postLogoutRedirectUri=window.location.href.split("?")[0].split("#")[0]),this.config.anonymousEndpoints||(this.config.anonymousEndpoints=[]),this.config.isAngular&&(this.isAngular=this.config.isAngular),this.config.loadFrameTimeout&&(this.CONSTANTS.LOADFRAME_TIMEOUT=this.config.loadFrameTimeout)},"undefined"!=typeof window&&(window.Logging={piiLoggingEnabled:!1,level:0,log:function(e){}}),n.prototype.login=function(){if(this._loginInProgress)return void this.info("Login in progress");this._loginInProgress=!0;var e=this._guid();this.config.state=e,this._idTokenNonce=this._guid();var t=this._getItem(this.CONSTANTS.STORAGE.ANGULAR_LOGIN_REQUEST);t&&""!==t?this._saveItem(this.CONSTANTS.STORAGE.ANGULAR_LOGIN_REQUEST,""):t=window.location.href,this.verbose("Expected state: "+e+" startPage:"+t),this._saveItem(this.CONSTANTS.STORAGE.LOGIN_REQUEST,t),this._saveItem(this.CONSTANTS.STORAGE.LOGIN_ERROR,""),this._saveItem(this.CONSTANTS.STORAGE.STATE_LOGIN,e,!0),this._saveItem(this.CONSTANTS.STORAGE.NONCE_IDTOKEN,this._idTokenNonce,!0),this._saveItem(this.CONSTANTS.STORAGE.ERROR,""),this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION,"");var n=this._getNavigateUrl("id_token",null)+"&nonce="+encodeURIComponent(this._idTokenNonce);this.config.displayCall?this.config.displayCall(n):this.popUp?(this._saveItem(this.CONSTANTS.STORAGE.STATE_LOGIN,""),this._renewStates.push(e),this.registerCallback(e,this.config.clientId,this.callback),this._loginPopup(n)):this.promptUser(n)},n.prototype._openPopup=function(e,t,n,r){try{var i=window.screenLeft?window.screenLeft:window.screenX,o=window.screenTop?window.screenTop:window.screenY,s=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,a=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,u=s/2-n/2+i,c=a/2-r/2+o,h=window.open(e,t,"width="+n+", height="+r+", top="+c+", left="+u);return h.focus&&h.focus(),h}catch(e){return this.warn("Error opening popup, "+e.message),this._loginInProgress=!1,this._acquireTokenInProgress=!1,null}},n.prototype._handlePopupError=function(e,t,n,r,i){this.warn(r),this._saveItem(this.CONSTANTS.STORAGE.ERROR,n),this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION,r),this._saveItem(this.CONSTANTS.STORAGE.LOGIN_ERROR,i),t&&this._activeRenewals[t]&&(this._activeRenewals[t]=null),this._loginInProgress=!1,this._acquireTokenInProgress=!1,e&&e(r,null,n)},n.prototype._loginPopup=function(e,t,n){var r=this._openPopup(e,"login",this.CONSTANTS.POPUP_WIDTH,this.CONSTANTS.POPUP_HEIGHT),i=n||this.callback;if(null==r){var o="Popup Window is null. This can happen if you are using IE";return void this._handlePopupError(i,t,"Error opening popup",o,o)}if(this._openedWindows.push(r),-1!=this.config.redirectUri.indexOf("#"))var s=this.config.redirectUri.split("#")[0];else var s=this.config.redirectUri;var a=this,u=window.setInterval(function(){if(!r||r.closed||void 0===r.closed){var e="Popup Window closed",n="Popup Window closed by UI action/ Popup Window handle destroyed due to cross zone navigation in IE/Edge";return a.isAngular&&a._broadcast("adal:popUpClosed",n+a.CONSTANTS.RESOURCE_DELIMETER+e),a._handlePopupError(i,t,e,n,n),void window.clearInterval(u)}try{var o=r.location;if(-1!=encodeURI(o.href).indexOf(encodeURI(s)))return a.isAngular?a._broadcast("adal:popUpHashChanged",o.hash):a.handleWindowCallback(o.hash),window.clearInterval(u),a._loginInProgress=!1,a._acquireTokenInProgress=!1,a.info("Closing popup window"),a._openedWindows=[],void r.close()}catch(e){}},1)},n.prototype._broadcast=function(e,t){!function(){function e(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n}if("function"==typeof window.CustomEvent)return!1;e.prototype=window.Event.prototype,window.CustomEvent=e}();var n=new CustomEvent(e,{detail:t});window.dispatchEvent(n)},n.prototype.loginInProgress=function(){return this._loginInProgress},n.prototype._hasResource=function(e){var t=this._getItem(this.CONSTANTS.STORAGE.TOKEN_KEYS);return t&&!this._isEmpty(t)&&t.indexOf(e+this.CONSTANTS.RESOURCE_DELIMETER)>-1},n.prototype.getCachedToken=function(e){if(!this._hasResource(e))return null;var t=this._getItem(this.CONSTANTS.STORAGE.ACCESS_TOKEN_KEY+e),n=this._getItem(this.CONSTANTS.STORAGE.EXPIRATION_KEY+e),r=this.config.expireOffsetSeconds||300;return n&&n>this._now()+r?t:(this._saveItem(this.CONSTANTS.STORAGE.ACCESS_TOKEN_KEY+e,""),this._saveItem(this.CONSTANTS.STORAGE.EXPIRATION_KEY+e,0),null)},n.prototype.getCachedUser=function(){if(this._user)return this._user;var e=this._getItem(this.CONSTANTS.STORAGE.IDTOKEN);return this._user=this._createUser(e),this._user},n.prototype.registerCallback=function(e,t,n){this._activeRenewals[t]=e,this._callBacksMappedToRenewStates[e]||(this._callBacksMappedToRenewStates[e]=[]);var r=this;this._callBacksMappedToRenewStates[e].push(n),this._callBackMappedToRenewStates[e]||(this._callBackMappedToRenewStates[e]=function(n,i,o,s){r._activeRenewals[t]=null;for(var a=0;a<r._callBacksMappedToRenewStates[e].length;++a)try{r._callBacksMappedToRenewStates[e][a](n,i,o,s)}catch(o){r.warn(o)}r._callBacksMappedToRenewStates[e]=null,r._callBackMappedToRenewStates[e]=null})},n.prototype._renewToken=function(e,t,n){this.info("renewToken is called for resource:"+e);var r=this._addAdalFrame("adalRenewFrame"+e),i=this._guid()+"|"+e;this.config.state=i,this._renewStates.push(i),this.verbose("Renew token Expected state: "+i),n=n||"token";var o=this._urlRemoveQueryStringParameter(this._getNavigateUrl(n,e),"prompt");n===this.RESPONSE_TYPE.ID_TOKEN_TOKEN&&(this._idTokenNonce=this._guid(),this._saveItem(this.CONSTANTS.STORAGE.NONCE_IDTOKEN,this._idTokenNonce,!0),o+="&nonce="+encodeURIComponent(this._idTokenNonce)),o+="&prompt=none",o=this._addHintParameters(o),this.registerCallback(i,e,t),this.verbosePii("Navigate to:"+o),r.src="about:blank",this._loadFrameTimeout(o,"adalRenewFrame"+e,e)},n.prototype._renewIdToken=function(e,t){this.info("renewIdToken is called");var n=this._addAdalFrame("adalIdTokenFrame"),r=this._guid()+"|"+this.config.clientId;this._idTokenNonce=this._guid(),this._saveItem(this.CONSTANTS.STORAGE.NONCE_IDTOKEN,this._idTokenNonce,!0),this.config.state=r,this._renewStates.push(r),this.verbose("Renew Idtoken Expected state: "+r);var i=null===t||void 0===t?null:this.config.clientId,t=t||"id_token",o=this._urlRemoveQueryStringParameter(this._getNavigateUrl(t,i),"prompt");o+="&prompt=none",o=this._addHintParameters(o),o+="&nonce="+encodeURIComponent(this._idTokenNonce),this.registerCallback(r,this.config.clientId,e),this.verbosePii("Navigate to:"+o),n.src="about:blank",this._loadFrameTimeout(o,"adalIdTokenFrame",this.config.clientId)},n.prototype._urlContainsQueryStringParameter=function(e,t){return new RegExp("[\\?&]"+e+"=").test(t)},n.prototype._urlRemoveQueryStringParameter=function(e,t){var n=new RegExp("(\\&"+t+"=)[^&]+");return e=e.replace(n,""),n=new RegExp("("+t+"=)[^&]+&"),e=e.replace(n,""),n=new RegExp("("+t+"=)[^&]+"),e=e.replace(n,"")},n.prototype._loadFrameTimeout=function(e,t,n){this.verbose("Set loading state to pending for: "+n),this._saveItem(this.CONSTANTS.STORAGE.RENEW_STATUS+n,this.CONSTANTS.TOKEN_RENEW_STATUS_IN_PROGRESS),this._loadFrame(e,t);var r=this;setTimeout(function(){if(r._getItem(r.CONSTANTS.STORAGE.RENEW_STATUS+n)===r.CONSTANTS.TOKEN_RENEW_STATUS_IN_PROGRESS){r.verbose("Loading frame has timed out after: "+r.CONSTANTS.LOADFRAME_TIMEOUT/1e3+" seconds for resource "+n);var e=r._activeRenewals[n];e&&r._callBackMappedToRenewStates[e]&&r._callBackMappedToRenewStates[e]("Token renewal operation failed due to timeout",null,"Token Renewal Failed"),r._saveItem(r.CONSTANTS.STORAGE.RENEW_STATUS+n,r.CONSTANTS.TOKEN_RENEW_STATUS_CANCELED)}},r.CONSTANTS.LOADFRAME_TIMEOUT)},n.prototype._loadFrame=function(e,t){var n=this;n.info("LoadFrame: "+t);var r=t;setTimeout(function(){var t=n._addAdalFrame(r);""!==t.src&&"about:blank"!==t.src||(t.src=e,n._loadFrame(e,r))},500)},n.prototype.acquireToken=function(e,t){if(this._isEmpty(e))return this.warn("resource is required"),void t("resource is required",null,"resource is required");var n=this.getCachedToken(e);return n?(this.info("Token is already in cache for resource:"+e),void t(null,n,null)):this._user||this.config.extraQueryParameter&&-1!==this.config.extraQueryParameter.indexOf("login_hint")?void(this._activeRenewals[e]?this.registerCallback(this._activeRenewals[e],e,t):(this._requestType=this.REQUEST_TYPE.RENEW_TOKEN,e===this.config.clientId?this._user?(this.verbose("renewing idtoken"),this._renewIdToken(t)):(this.verbose("renewing idtoken and access_token"),this._renewIdToken(t,this.RESPONSE_TYPE.ID_TOKEN_TOKEN)):this._user?(this.verbose("renewing access_token"),this._renewToken(e,t)):(this.verbose("renewing idtoken and access_token"),this._renewToken(e,t,this.RESPONSE_TYPE.ID_TOKEN_TOKEN)))):(this.warn("User login is required"),void t("User login is required",null,"login required"))},n.prototype.acquireTokenPopup=function(e,t,n,r){if(this._isEmpty(e))return this.warn("resource is required"),void r("resource is required",null,"resource is required");if(!this._user)return this.warn("User login is required"),void r("User login is required",null,"login required");if(this._acquireTokenInProgress)return this.warn("Acquire token interactive is already in progress"),void r("Acquire token interactive is already in progress",null,"Acquire token interactive is already in progress");var i=this._guid()+"|"+e;this.config.state=i,this._renewStates.push(i),this._requestType=this.REQUEST_TYPE.RENEW_TOKEN,this.verbose("Renew token Expected state: "+i);var o=this._urlRemoveQueryStringParameter(this._getNavigateUrl("token",e),"prompt");if(o+="&prompt=select_account",t&&(o+=t),n&&-1===o.indexOf("&claims"))o+="&claims="+encodeURIComponent(n);else if(n&&-1!==o.indexOf("&claims"))throw new Error("Claims cannot be passed as an extraQueryParameter");o=this._addHintParameters(o),this._acquireTokenInProgress=!0,this.info("acquireToken interactive is called for the resource "+e),this.registerCallback(i,e,r),this._loginPopup(o,e,r)},n.prototype.acquireTokenRedirect=function(e,t,n){if(this._isEmpty(e))return this.warn("resource is required"),void r("resource is required",null,"resource is required");var r=this.callback;if(!this._user)return this.warn("User login is required"),void r("User login is required",null,"login required");if(this._acquireTokenInProgress)return this.warn("Acquire token interactive is already in progress"),void r("Acquire token interactive is already in progress",null,"Acquire token interactive is already in progress");var i=this._guid()+"|"+e;this.config.state=i,this.verbose("Renew token Expected state: "+i);var o=this._urlRemoveQueryStringParameter(this._getNavigateUrl("token",e),"prompt");if(o+="&prompt=select_account",t&&(o+=t),n&&-1===o.indexOf("&claims"))o+="&claims="+encodeURIComponent(n);else if(n&&-1!==o.indexOf("&claims"))throw new Error("Claims cannot be passed as an extraQueryParameter");o=this._addHintParameters(o),this._acquireTokenInProgress=!0,this.info("acquireToken interactive is called for the resource "+e),this._saveItem(this.CONSTANTS.STORAGE.LOGIN_REQUEST,window.location.href),this._saveItem(this.CONSTANTS.STORAGE.STATE_RENEW,i,!0),this.promptUser(o)},n.prototype.promptUser=function(e){e?(this.infoPii("Navigate to:"+e),window.location.replace(e)):this.info("Navigate url is empty")},n.prototype.clearCache=function(){this._saveItem(this.CONSTANTS.STORAGE.LOGIN_REQUEST,""),this._saveItem(this.CONSTANTS.STORAGE.ANGULAR_LOGIN_REQUEST,""),this._saveItem(this.CONSTANTS.STORAGE.SESSION_STATE,""),this._saveItem(this.CONSTANTS.STORAGE.STATE_LOGIN,""),this._saveItem(this.CONSTANTS.STORAGE.STATE_RENEW,""),this._renewStates=[],this._saveItem(this.CONSTANTS.STORAGE.NONCE_IDTOKEN,""),this._saveItem(this.CONSTANTS.STORAGE.IDTOKEN,""),this._saveItem(this.CONSTANTS.STORAGE.ERROR,""),this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION,""),this._saveItem(this.CONSTANTS.STORAGE.LOGIN_ERROR,""),this._saveItem(this.CONSTANTS.STORAGE.LOGIN_ERROR,"");var e=this._getItem(this.CONSTANTS.STORAGE.TOKEN_KEYS);if(!this._isEmpty(e)){e=e.split(this.CONSTANTS.RESOURCE_DELIMETER);for(var t=0;t<e.length&&""!==e[t];t++)this._saveItem(this.CONSTANTS.STORAGE.ACCESS_TOKEN_KEY+e[t],""),this._saveItem(this.CONSTANTS.STORAGE.EXPIRATION_KEY+e[t],0)}this._saveItem(this.CONSTANTS.STORAGE.TOKEN_KEYS,"")},n.prototype.clearCacheForResource=function(e){this._saveItem(this.CONSTANTS.STORAGE.STATE_RENEW,""),this._saveItem(this.CONSTANTS.STORAGE.ERROR,""),this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION,""),this._hasResource(e)&&(this._saveItem(this.CONSTANTS.STORAGE.ACCESS_TOKEN_KEY+e,""),this._saveItem(this.CONSTANTS.STORAGE.EXPIRATION_KEY+e,0))},n.prototype.logOut=function(){this.clearCache(),this._user=null;var e;if(this.config.logOutUri)e=this.config.logOutUri;else{var t="common",n="";this.config.tenant&&(t=this.config.tenant),this.config.postLogoutRedirectUri&&(n="post_logout_redirect_uri="+encodeURIComponent(this.config.postLogoutRedirectUri)),e=this.instance+t+"/oauth2/logout?"+n}this.infoPii("Logout navigate to: "+e),this.promptUser(e)},n.prototype._isEmpty=function(e){return void 0===e||!e||0===e.length},n.prototype.getUser=function(e){if("function"!=typeof e)throw new Error("callback is not a function");if(this._user)return void e(null,this._user);var t=this._getItem(this.CONSTANTS.STORAGE.IDTOKEN);this._isEmpty(t)?(this.warn("User information is not available"),e("User information is not available",null)):(this.info("User exists in cache: "),this._user=this._createUser(t),e(null,this._user))},n.prototype._addHintParameters=function(e){if(this._user&&this._user.profile)if(this._user.profile.sid&&-1!==e.indexOf("&prompt=none"))this._urlContainsQueryStringParameter("sid",e)||(e+="&sid="+encodeURIComponent(this._user.profile.sid));else if(this._user.profile.upn&&(this._urlContainsQueryStringParameter("login_hint",e)||(e+="&login_hint="+encodeURIComponent(this._user.profile.upn)),!this._urlContainsQueryStringParameter("domain_hint",e)&&this._user.profile.upn.indexOf("@")>-1)){var t=this._user.profile.upn.split("@");e+="&domain_hint="+encodeURIComponent(t[t.length-1])}return e},n.prototype._createUser=function(e){var t=null,n=this._extractIdToken(e);return n&&n.hasOwnProperty("aud")&&(n.aud.toLowerCase()===this.config.clientId.toLowerCase()?(t={userName:"",profile:n},n.hasOwnProperty("upn")?t.userName=n.upn:n.hasOwnProperty("email")&&(t.userName=n.email)):this.warn("IdToken has invalid aud field")),t},n.prototype._getHash=function(e){return e.indexOf("#/")>-1?e=e.substring(e.indexOf("#/")+2):e.indexOf("#")>-1&&(e=e.substring(1)),e},n.prototype.isCallback=function(e){e=this._getHash(e);var t=this._deserialize(e);return t.hasOwnProperty(this.CONSTANTS.ERROR_DESCRIPTION)||t.hasOwnProperty(this.CONSTANTS.ACCESS_TOKEN)||t.hasOwnProperty(this.CONSTANTS.ID_TOKEN)},n.prototype.getLoginError=function(){return this._getItem(this.CONSTANTS.STORAGE.LOGIN_ERROR)},n.prototype.getRequestInfo=function(e){e=this._getHash(e);var t=this._deserialize(e),n={valid:!1,parameters:{},stateMatch:!1,stateResponse:"",requestType:this.REQUEST_TYPE.UNKNOWN};if(t&&(n.parameters=t,t.hasOwnProperty(this.CONSTANTS.ERROR_DESCRIPTION)||t.hasOwnProperty(this.CONSTANTS.ACCESS_TOKEN)||t.hasOwnProperty(this.CONSTANTS.ID_TOKEN))){n.valid=!0;var r="";if(!t.hasOwnProperty("state"))return this.warn("No state returned"),n;if(this.verbose("State: "+t.state),r=t.state,n.stateResponse=r,this._matchState(n))return n;if(!n.stateMatch&&window.parent){n.requestType=this._requestType;for(var i=this._renewStates,o=0;o<i.length;o++)if(i[o]===n.stateResponse){n.stateMatch=!0;break}}}return n},n.prototype._matchNonce=function(e){var t=this._getItem(this.CONSTANTS.STORAGE.NONCE_IDTOKEN);if(t){t=t.split(this.CONSTANTS.CACHE_DELIMETER);for(var n=0;n<t.length;n++)if(t[n]===e.profile.nonce)return!0}return!1},n.prototype._matchState=function(e){var t=this._getItem(this.CONSTANTS.STORAGE.STATE_LOGIN);if(t){t=t.split(this.CONSTANTS.CACHE_DELIMETER);for(var n=0;n<t.length;n++)if(t[n]===e.stateResponse)return e.requestType=this.REQUEST_TYPE.LOGIN,e.stateMatch=!0,!0}var r=this._getItem(this.CONSTANTS.STORAGE.STATE_RENEW);if(r){r=r.split(this.CONSTANTS.CACHE_DELIMETER);for(var n=0;n<r.length;n++)if(r[n]===e.stateResponse)return e.requestType=this.REQUEST_TYPE.RENEW_TOKEN,e.stateMatch=!0,!0}return!1},n.prototype._getResourceFromState=function(e){if(e){var t=e.indexOf("|");if(t>-1&&t+1<e.length)return e.substring(t+1)}return""},n.prototype.saveTokenFromHash=function(e){this.info("State status:"+e.stateMatch+"; Request type:"+e.requestType),this._saveItem(this.CONSTANTS.STORAGE.ERROR,""),this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION,"");var t=this._getResourceFromState(e.stateResponse);if(e.parameters.hasOwnProperty(this.CONSTANTS.ERROR_DESCRIPTION))this.infoPii("Error :"+e.parameters.error+"; Error description:"+e.parameters[this.CONSTANTS.ERROR_DESCRIPTION]),this._saveItem(this.CONSTANTS.STORAGE.ERROR,e.parameters.error),this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION,e.parameters[this.CONSTANTS.ERROR_DESCRIPTION]),e.requestType===this.REQUEST_TYPE.LOGIN&&(this._loginInProgress=!1,this._saveItem(this.CONSTANTS.STORAGE.LOGIN_ERROR,e.parameters.error_description));else if(e.stateMatch){this.info("State is right"),e.parameters.hasOwnProperty(this.CONSTANTS.SESSION_STATE)&&this._saveItem(this.CONSTANTS.STORAGE.SESSION_STATE,e.parameters[this.CONSTANTS.SESSION_STATE]);var n;e.parameters.hasOwnProperty(this.CONSTANTS.ACCESS_TOKEN)&&(this.info("Fragment has access token"),this._hasResource(t)||(n=this._getItem(this.CONSTANTS.STORAGE.TOKEN_KEYS)||"",this._saveItem(this.CONSTANTS.STORAGE.TOKEN_KEYS,n+t+this.CONSTANTS.RESOURCE_DELIMETER)),this._saveItem(this.CONSTANTS.STORAGE.ACCESS_TOKEN_KEY+t,e.parameters[this.CONSTANTS.ACCESS_TOKEN]),this._saveItem(this.CONSTANTS.STORAGE.EXPIRATION_KEY+t,this._expiresIn(e.parameters[this.CONSTANTS.EXPIRES_IN]))),e.parameters.hasOwnProperty(this.CONSTANTS.ID_TOKEN)&&(this.info("Fragment has id token"),this._loginInProgress=!1,this._user=this._createUser(e.parameters[this.CONSTANTS.ID_TOKEN]),this._user&&this._user.profile?this._matchNonce(this._user)?(this._saveItem(this.CONSTANTS.STORAGE.IDTOKEN,e.parameters[this.CONSTANTS.ID_TOKEN]),t=this.config.loginResource?this.config.loginResource:this.config.clientId,this._hasResource(t)||(n=this._getItem(this.CONSTANTS.STORAGE.TOKEN_KEYS)||"",this._saveItem(this.CONSTANTS.STORAGE.TOKEN_KEYS,n+t+this.CONSTANTS.RESOURCE_DELIMETER)),this._saveItem(this.CONSTANTS.STORAGE.ACCESS_TOKEN_KEY+t,e.parameters[this.CONSTANTS.ID_TOKEN]),this._saveItem(this.CONSTANTS.STORAGE.EXPIRATION_KEY+t,this._user.profile.exp)):(this._saveItem(this.CONSTANTS.STORAGE.LOGIN_ERROR,"Nonce received: "+this._user.profile.nonce+" is not same as requested: "+this._getItem(this.CONSTANTS.STORAGE.NONCE_IDTOKEN)),this._user=null):(e.parameters.error="invalid id_token",e.parameters.error_description="Invalid id_token. id_token: "+e.parameters[this.CONSTANTS.ID_TOKEN],this._saveItem(this.CONSTANTS.STORAGE.ERROR,"invalid id_token"),this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION,"Invalid id_token. id_token: "+e.parameters[this.CONSTANTS.ID_TOKEN])))}else e.parameters.error="Invalid_state",e.parameters.error_description="Invalid_state. state: "+e.stateResponse,this._saveItem(this.CONSTANTS.STORAGE.ERROR,"Invalid_state"),this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION,"Invalid_state. state: "+e.stateResponse);this._saveItem(this.CONSTANTS.STORAGE.RENEW_STATUS+t,this.CONSTANTS.TOKEN_RENEW_STATUS_COMPLETED)},n.prototype.getResourceForEndpoint=function(e){if(this.config&&this.config.anonymousEndpoints)for(var t=0;t<this.config.anonymousEndpoints.length;t++)if(e.indexOf(this.config.anonymousEndpoints[t])>-1)return null;if(this.config&&this.config.endpoints)for(var n in this.config.endpoints)if(e.indexOf(n)>-1)return this.config.endpoints[n];return e.indexOf("http://")>-1||e.indexOf("https://")>-1?this._getHostFromUri(e)===this._getHostFromUri(this.config.redirectUri)?this.config.loginResource:null:this.config.loginResource},n.prototype._getHostFromUri=function(e){var t=String(e).replace(/^(https?:)\/\//,"");return t=t.split("/")[0]},n.prototype.handleWindowCallback=function(e){if(null==e&&(e=window.location.hash),this.isCallback(e)){var t=null,n=!1;this._openedWindows.length>0&&this._openedWindows[this._openedWindows.length-1].opener&&this._openedWindows[this._openedWindows.length-1].opener._adalInstance?(t=this._openedWindows[this._openedWindows.length-1].opener._adalInstance,n=!0):window.parent&&window.parent._adalInstance&&(t=window.parent._adalInstance);var r,i,o=t.getRequestInfo(e),s=null;i=n||window.parent!==window?t._callBackMappedToRenewStates[o.stateResponse]:t.callback,t.info("Returned from redirect url"),t.saveTokenFromHash(o),o.requestType===this.REQUEST_TYPE.RENEW_TOKEN&&window.parent?(window.parent!==window?t.verbose("Window is in iframe, acquiring token silently"):t.verbose("acquiring token interactive in progress"),r=o.parameters[t.CONSTANTS.ACCESS_TOKEN]||o.parameters[t.CONSTANTS.ID_TOKEN],s=t.CONSTANTS.ACCESS_TOKEN):o.requestType===this.REQUEST_TYPE.LOGIN&&(r=o.parameters[t.CONSTANTS.ID_TOKEN],s=t.CONSTANTS.ID_TOKEN);var a=o.parameters[t.CONSTANTS.ERROR_DESCRIPTION],u=o.parameters[t.CONSTANTS.ERROR];try{i&&i(a,r,u,s)}catch(e){t.error("Error occurred in user defined callback function: "+e)}window.parent!==window||n||(t.config.navigateToLoginRequestUrl?window.location.href=t._getItem(t.CONSTANTS.STORAGE.LOGIN_REQUEST):window.location.hash="")}},n.prototype._getNavigateUrl=function(e,t){var n="common";this.config.tenant&&(n=this.config.tenant);var r=this.instance+n+"/oauth2/authorize"+this._serialize(e,this.config,t)+this._addLibMetadata();return this.info("Navigate url:"+r),r},n.prototype._extractIdToken=function(e){var t=this._decodeJwt(e);if(!t)return null;try{var n=t.JWSPayload,r=this._base64DecodeStringUrlSafe(n);return r?JSON.parse(r):(this.info("The returned id_token could not be base64 url safe decoded."),null)}catch(e){this.error("The returned id_token could not be decoded",e)}return null},n.prototype._base64DecodeStringUrlSafe=function(e){return e=e.replace(/-/g,"+").replace(/_/g,"/"),window.atob?decodeURIComponent(escape(window.atob(e))):decodeURIComponent(escape(this._decode(e)))},n.prototype._decode=function(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";e=String(e).replace(/=+$/,"");var n=e.length;if(n%4==1)throw new Error("The token to be decoded is not correctly encoded.");for(var r,i,o,s,a,u,c,h,l="",p=0;p<n;p+=4){if(r=t.indexOf(e.charAt(p)),i=t.indexOf(e.charAt(p+1)),o=t.indexOf(e.charAt(p+2)),s=t.indexOf(e.charAt(p+3)),p+2===n-1){a=r<<18|i<<12|o<<6,u=a>>16&255,c=a>>8&255,l+=String.fromCharCode(u,c);break}if(p+1===n-1){a=r<<18|i<<12,u=a>>16&255,l+=String.fromCharCode(u);break}a=r<<18|i<<12|o<<6|s,u=a>>16&255,c=a>>8&255,h=255&a,l+=String.fromCharCode(u,c,h)}return l},n.prototype._decodeJwt=function(e){if(this._isEmpty(e))return null;var t=/^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/,n=t.exec(e);return!n||n.length<4?(this.warn("The returned id_token is not parseable."),null):{header:n[1],JWSPayload:n[2],JWSSig:n[3]}},n.prototype._convertUrlSafeToRegularBase64EncodedString=function(e){return e.replace("-","+").replace("_","/")},n.prototype._serialize=function(e,t,n){var r=[];if(null!==t){r.push("?response_type="+e),r.push("client_id="+encodeURIComponent(t.clientId)),n&&r.push("resource="+encodeURIComponent(n)),r.push("redirect_uri="+encodeURIComponent(t.redirectUri)),r.push("state="+encodeURIComponent(t.state)),t.hasOwnProperty("slice")&&r.push("slice="+encodeURIComponent(t.slice)),t.hasOwnProperty("extraQueryParameter")&&r.push(t.extraQueryParameter);var i=t.correlationId?t.correlationId:this._guid();r.push("client-request-id="+encodeURIComponent(i))}return r.join("&")},n.prototype._deserialize=function(e){var t,n=/\+/g,r=/([^&=]+)=([^&]*)/g,i=function(e){return decodeURIComponent(e.replace(n," "))},o={};for(t=r.exec(e);t;)o[i(t[1])]=i(t[2]),t=r.exec(e);return o},n.prototype._decimalToHex=function(e){for(var t=e.toString(16);t.length<2;)t="0"+t;return t},n.prototype._guid=function(){var e=window.crypto||window.msCrypto;if(e&&e.getRandomValues){var t=new Uint8Array(16);return e.getRandomValues(t),t[6]|=64,t[6]&=79,t[8]|=128,t[8]&=191,this._decimalToHex(t[0])+this._decimalToHex(t[1])+this._decimalToHex(t[2])+this._decimalToHex(t[3])+"-"+this._decimalToHex(t[4])+this._decimalToHex(t[5])+"-"+this._decimalToHex(t[6])+this._decimalToHex(t[7])+"-"+this._decimalToHex(t[8])+this._decimalToHex(t[9])+"-"+this._decimalToHex(t[10])+this._decimalToHex(t[11])+this._decimalToHex(t[12])+this._decimalToHex(t[13])+this._decimalToHex(t[14])+this._decimalToHex(t[15])}for(var n="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx",r="0123456789abcdef",i=0,o="",s=0;s<36;s++)"-"!==n[s]&&"4"!==n[s]&&(i=16*Math.random()|0),"x"===n[s]?o+=r[i]:"y"===n[s]?(i&=3,i|=8,o+=r[i]):o+=n[s];return o},n.prototype._expiresIn=function(e){return e||(e=3599),this._now()+parseInt(e,10)},n.prototype._now=function(){return Math.round((new Date).getTime()/1e3)},n.prototype._addAdalFrame=function(e){if(void 0!==e){this.info("Add adal frame to document:"+e);var t=document.getElementById(e);if(!t){if(document.createElement&&document.documentElement&&(window.opera||-1===window.navigator.userAgent.indexOf("MSIE 5.0"))){var n=document.createElement("iframe");n.setAttribute("id",e),n.setAttribute("aria-hidden","true"),n.style.visibility="hidden",n.style.position="absolute",n.style.width=n.style.height=n.borderWidth="0px",t=document.getElementsByTagName("body")[0].appendChild(n)}else document.body&&document.body.insertAdjacentHTML&&document.body.insertAdjacentHTML("beforeEnd",'<iframe name="'+e+'" id="'+e+'" style="display:none"></iframe>');window.frames&&window.frames[e]&&(t=window.frames[e])}return t}},n.prototype._saveItem=function(e,t,n){if(this.config&&this.config.cacheLocation&&"localStorage"===this.config.cacheLocation){if(!this._supportsLocalStorage())return this.info("Local storage is not supported"),!1;if(n){var r=this._getItem(e)||"";localStorage.setItem(e,r+t+this.CONSTANTS.CACHE_DELIMETER)}else localStorage.setItem(e,t);return!0}return this._supportsSessionStorage()?(sessionStorage.setItem(e,t),!0):(this.info("Session storage is not supported"),!1)},n.prototype._getItem=function(e){return this.config&&this.config.cacheLocation&&"localStorage"===this.config.cacheLocation?this._supportsLocalStorage()?localStorage.getItem(e):(this.info("Local storage is not supported"),null):this._supportsSessionStorage()?sessionStorage.getItem(e):(this.info("Session storage is not supported"),null)},n.prototype._supportsLocalStorage=function(){try{return!!window.localStorage&&(window.localStorage.setItem("storageTest","A"),"A"==window.localStorage.getItem("storageTest")&&(window.localStorage.removeItem("storageTest"),!window.localStorage.getItem("storageTest")))}catch(e){return!1}},n.prototype._supportsSessionStorage=function(){try{return!!window.sessionStorage&&(window.sessionStorage.setItem("storageTest","A"),"A"==window.sessionStorage.getItem("storageTest")&&(window.sessionStorage.removeItem("storageTest"),!window.sessionStorage.getItem("storageTest")))}catch(e){return!1}},n.prototype._cloneConfig=function(e){if(null===e||"object"!=typeof e)return e;var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t},n.prototype._addLibMetadata=function(){return"&x-client-SKU=Js&x-client-Ver="+this._libVersion()},n.prototype.log=function(e,t,n,r){if(e<=Logging.level){if(!Logging.piiLoggingEnabled&&r)return;var i=(new Date).toUTCString(),o="";o=this.config.correlationId?i+":"+this.config.correlationId+"-"+this._libVersion()+"-"+this.CONSTANTS.LEVEL_STRING_MAP[e]+" "+t:i+":"+this._libVersion()+"-"+this.CONSTANTS.LEVEL_STRING_MAP[e]+" "+t,n&&(o+="\nstack:\n"+n.stack),Logging.log(o)}},n.prototype.error=function(e,t){this.log(this.CONSTANTS.LOGGING_LEVEL.ERROR,e,t)},n.prototype.warn=function(e){this.log(this.CONSTANTS.LOGGING_LEVEL.WARN,e,null)},n.prototype.info=function(e){this.log(this.CONSTANTS.LOGGING_LEVEL.INFO,e,null)},n.prototype.verbose=function(e){this.log(this.CONSTANTS.LOGGING_LEVEL.VERBOSE,e,null)},n.prototype.errorPii=function(e,t){this.log(this.CONSTANTS.LOGGING_LEVEL.ERROR,e,t,!0)},n.prototype.warnPii=function(e){this.log(this.CONSTANTS.LOGGING_LEVEL.WARN,e,null,!0)},n.prototype.infoPii=function(e){this.log(this.CONSTANTS.LOGGING_LEVEL.INFO,e,null,!0)},n.prototype.verbosePii=function(e){this.log(this.CONSTANTS.LOGGING_LEVEL.VERBOSE,e,null,!0)},n.prototype._libVersion=function(){return"1.0.17"},void 0!==e&&e.exports&&(e.exports=n,e.exports.inject=function(e){return new n(e)}),n}()},function(e,t,n){"use strict";n.d(t,"a",function(){return u}),n.d(t,"c",function(){return c}),n.d(t,"b",function(){return h});var r=n(1),i=n(0),o=n(2),s=n(4),a=n(5),u=function(e){function t(t){void 0===t&&(t="This query is already part of a batch.");var n=e.call(this,t)||this;return n.name="AlreadyInBatchException",o.a.error(n),n}return r.b(t,e),t}(Error),c=function(){function e(){this._query=new i.a,this._options={},this._url="",this._parentUrl="",this._useCaching=!1,this._cachingOptions=null}return e.prototype.toUrl=function(){return this._url},e.prototype.concat=function(e){return this._url+=e,this},Object.defineProperty(e.prototype,"query",{get:function(){return this._query},enumerable:!0,configurable:!0}),e.prototype.configure=function(e){return Object(i.i)(this._options,e),this},e.prototype.configureFrom=function(e){return Object(i.i)(this._options,e._options),this},e.prototype.usingCaching=function(e){return i.c.globalCacheDisable||(this._useCaching=!0,void 0!==e&&(this._cachingOptions=e)),this},e.prototype.get=function(e,t){return void 0===e&&(e=new s.c),void 0===t&&(t={}),this.getCore(e,t)},e.prototype.getCore=function(e,t){return void 0===e&&(e=new s.c),void 0===t&&(t={}),this.toRequestContext("GET",t,e,Object(a.b)()).then(function(e){return Object(a.c)(e)})},e.prototype.postCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new s.c),this.toRequestContext("POST",e,t,Object(a.b)()).then(function(e){return Object(a.c)(e)})},e.prototype.patchCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new s.c),this.toRequestContext("PATCH",e,t,Object(a.b)()).then(function(e){return Object(a.c)(e)})},e.prototype.deleteCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new s.c),this.toRequestContext("DELETE",e,t,Object(a.b)()).then(function(e){return Object(a.c)(e)})},e.prototype.putCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new s.c),this.toRequestContext("PUT",e,t,Object(a.b)()).then(function(e){return Object(a.c)(e)})},e.prototype.append=function(e){this._url=Object(i.d)(this._url,e)},Object.defineProperty(e.prototype,"parentUrl",{get:function(){return this._parentUrl},enumerable:!0,configurable:!0}),e.prototype.extend=function(e,t){this._parentUrl=e._url,this._url=Object(i.d)(this._parentUrl,t),this.configureFrom(e)},e}(),h=function(e){function t(){var t=e.call(this)||this;return t._batch=null,t}return r.b(t,e),t.prototype.inBatch=function(e){if(null!==this.batch)throw new u;return this._batch=e,this},t.prototype.toUrl=function(){return this._url},t.prototype.get=function(e,t){return void 0===e&&(e=new s.d),void 0===t&&(t={}),this.getCore(e,t)},t.prototype.getCore=function(e,t){return void 0===e&&(e=new s.d),void 0===t&&(t={}),this.toRequestContext("GET",t,e,Object(a.b)()).then(function(e){return Object(a.c)(e)})},t.prototype.postCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new s.d),this.toRequestContext("POST",e,t,Object(a.b)()).then(function(e){return Object(a.c)(e)})},t.prototype.patchCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new s.d),this.toRequestContext("PATCH",e,t,Object(a.b)()).then(function(e){return Object(a.c)(e)})},t.prototype.deleteCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new s.d),this.toRequestContext("DELETE",e,t,Object(a.b)()).then(function(e){return Object(a.c)(e)})},t.prototype.putCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new s.d),this.toRequestContext("PUT",e,t,Object(a.b)()).then(function(e){return Object(a.c)(e)})},t.prototype.addBatchDependency=function(){return null!==this._batch?this._batch.addDependency():function(){return null}},Object.defineProperty(t.prototype,"hasBatch",{get:function(){return Object(i.j)(this._batch)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"batch",{get:function(){return this.hasBatch?this._batch:null},enumerable:!0,configurable:!0}),t}(c)},function(e,t,n){"use strict";n.d(t,"a",function(){return i});var r=n(0),i=function(){function e(e){void 0===e&&(e=Object(r.g)()),this._batchId=e,this._requests=[],this._dependencies=[]}return Object.defineProperty(e.prototype,"batchId",{get:function(){return this._batchId},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"requests",{get:function(){return this._requests},enumerable:!0,configurable:!0}),e.prototype.add=function(e,t,n,r){var i={method:t.toUpperCase(),options:n,parser:r,reject:null,resolve:null,url:e},o=new Promise(function(e,t){i.resolve=e,i.reject=t});return this._requests.push(i),o},e.prototype.addDependency=function(){var e=function(){},t=new Promise(function(t){e=t});return this._dependencies.push(t),e},e.prototype.execute=function(){var e=this;return Promise.all(this._dependencies).then(function(){return Promise.all(e._dependencies)}).then(function(){return e.executeImpl()})},e}()}])}); | ||
var n=function(){"use strict";return n=function(e){if(this.REQUEST_TYPE={LOGIN:"LOGIN",RENEW_TOKEN:"RENEW_TOKEN",UNKNOWN:"UNKNOWN"},this.RESPONSE_TYPE={ID_TOKEN_TOKEN:"id_token token",TOKEN:"token"},this.CONSTANTS={ACCESS_TOKEN:"access_token",EXPIRES_IN:"expires_in",ID_TOKEN:"id_token",ERROR_DESCRIPTION:"error_description",SESSION_STATE:"session_state",ERROR:"error",STORAGE:{TOKEN_KEYS:"adal.token.keys",ACCESS_TOKEN_KEY:"adal.access.token.key",EXPIRATION_KEY:"adal.expiration.key",STATE_LOGIN:"adal.state.login",STATE_RENEW:"adal.state.renew",NONCE_IDTOKEN:"adal.nonce.idtoken",SESSION_STATE:"adal.session.state",USERNAME:"adal.username",IDTOKEN:"adal.idtoken",ERROR:"adal.error",ERROR_DESCRIPTION:"adal.error.description",LOGIN_REQUEST:"adal.login.request",LOGIN_ERROR:"adal.login.error",RENEW_STATUS:"adal.token.renew.status",ANGULAR_LOGIN_REQUEST:"adal.angular.login.request"},RESOURCE_DELIMETER:"|",CACHE_DELIMETER:"||",LOADFRAME_TIMEOUT:6e3,TOKEN_RENEW_STATUS_CANCELED:"Canceled",TOKEN_RENEW_STATUS_COMPLETED:"Completed",TOKEN_RENEW_STATUS_IN_PROGRESS:"In Progress",LOGGING_LEVEL:{ERROR:0,WARN:1,INFO:2,VERBOSE:3},LEVEL_STRING_MAP:{0:"ERROR:",1:"WARNING:",2:"INFO:",3:"VERBOSE:"},POPUP_WIDTH:483,POPUP_HEIGHT:600},n.prototype._singletonInstance)return n.prototype._singletonInstance;if(n.prototype._singletonInstance=this,this.instance="https://login.microsoftonline.com/",this.config={},this.callback=null,this.popUp=!1,this.isAngular=!1,this._user=null,this._activeRenewals={},this._loginInProgress=!1,this._acquireTokenInProgress=!1,this._renewStates=[],this._callBackMappedToRenewStates={},this._callBacksMappedToRenewStates={},this._openedWindows=[],this._requestType=this.REQUEST_TYPE.LOGIN,window._adalInstance=this,e.displayCall&&"function"!=typeof e.displayCall)throw new Error("displayCall is not a function");if(!e.clientId)throw new Error("clientId is required");this.config=this._cloneConfig(e),void 0===this.config.navigateToLoginRequestUrl&&(this.config.navigateToLoginRequestUrl=!0),this.config.popUp&&(this.popUp=!0),this.config.callback&&"function"==typeof this.config.callback&&(this.callback=this.config.callback),this.config.instance&&(this.instance=this.config.instance),this.config.loginResource||(this.config.loginResource=this.config.clientId),this.config.redirectUri||(this.config.redirectUri=window.location.href.split("?")[0].split("#")[0]),this.config.postLogoutRedirectUri||(this.config.postLogoutRedirectUri=window.location.href.split("?")[0].split("#")[0]),this.config.anonymousEndpoints||(this.config.anonymousEndpoints=[]),this.config.isAngular&&(this.isAngular=this.config.isAngular),this.config.loadFrameTimeout&&(this.CONSTANTS.LOADFRAME_TIMEOUT=this.config.loadFrameTimeout)},"undefined"!=typeof window&&(window.Logging={piiLoggingEnabled:!1,level:0,log:function(e){}}),n.prototype.login=function(){if(this._loginInProgress)return void this.info("Login in progress");this._loginInProgress=!0;var e=this._guid();this.config.state=e,this._idTokenNonce=this._guid();var t=this._getItem(this.CONSTANTS.STORAGE.ANGULAR_LOGIN_REQUEST);t&&""!==t?this._saveItem(this.CONSTANTS.STORAGE.ANGULAR_LOGIN_REQUEST,""):t=window.location.href,this.verbose("Expected state: "+e+" startPage:"+t),this._saveItem(this.CONSTANTS.STORAGE.LOGIN_REQUEST,t),this._saveItem(this.CONSTANTS.STORAGE.LOGIN_ERROR,""),this._saveItem(this.CONSTANTS.STORAGE.STATE_LOGIN,e,!0),this._saveItem(this.CONSTANTS.STORAGE.NONCE_IDTOKEN,this._idTokenNonce,!0),this._saveItem(this.CONSTANTS.STORAGE.ERROR,""),this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION,"");var n=this._getNavigateUrl("id_token",null)+"&nonce="+encodeURIComponent(this._idTokenNonce);this.config.displayCall?this.config.displayCall(n):this.popUp?(this._saveItem(this.CONSTANTS.STORAGE.STATE_LOGIN,""),this._renewStates.push(e),this.registerCallback(e,this.config.clientId,this.callback),this._loginPopup(n)):this.promptUser(n)},n.prototype._openPopup=function(e,t,n,r){try{var i=window.screenLeft?window.screenLeft:window.screenX,o=window.screenTop?window.screenTop:window.screenY,s=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,a=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,u=s/2-n/2+i,c=a/2-r/2+o,h=window.open(e,t,"width="+n+", height="+r+", top="+c+", left="+u);return h.focus&&h.focus(),h}catch(e){return this.warn("Error opening popup, "+e.message),this._loginInProgress=!1,this._acquireTokenInProgress=!1,null}},n.prototype._handlePopupError=function(e,t,n,r,i){this.warn(r),this._saveItem(this.CONSTANTS.STORAGE.ERROR,n),this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION,r),this._saveItem(this.CONSTANTS.STORAGE.LOGIN_ERROR,i),t&&this._activeRenewals[t]&&(this._activeRenewals[t]=null),this._loginInProgress=!1,this._acquireTokenInProgress=!1,e&&e(r,null,n)},n.prototype._loginPopup=function(e,t,n){var r=this._openPopup(e,"login",this.CONSTANTS.POPUP_WIDTH,this.CONSTANTS.POPUP_HEIGHT),i=n||this.callback;if(null==r){var o="Popup Window is null. This can happen if you are using IE";return void this._handlePopupError(i,t,"Error opening popup",o,o)}if(this._openedWindows.push(r),-1!=this.config.redirectUri.indexOf("#"))var s=this.config.redirectUri.split("#")[0];else var s=this.config.redirectUri;var a=this,u=window.setInterval(function(){if(!r||r.closed||void 0===r.closed){var e="Popup Window closed",n="Popup Window closed by UI action/ Popup Window handle destroyed due to cross zone navigation in IE/Edge";return a.isAngular&&a._broadcast("adal:popUpClosed",n+a.CONSTANTS.RESOURCE_DELIMETER+e),a._handlePopupError(i,t,e,n,n),void window.clearInterval(u)}try{var o=r.location;if(-1!=encodeURI(o.href).indexOf(encodeURI(s)))return a.isAngular?a._broadcast("adal:popUpHashChanged",o.hash):a.handleWindowCallback(o.hash),window.clearInterval(u),a._loginInProgress=!1,a._acquireTokenInProgress=!1,a.info("Closing popup window"),a._openedWindows=[],void r.close()}catch(e){}},1)},n.prototype._broadcast=function(e,t){!function(){function e(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n}if("function"==typeof window.CustomEvent)return!1;e.prototype=window.Event.prototype,window.CustomEvent=e}();var n=new CustomEvent(e,{detail:t});window.dispatchEvent(n)},n.prototype.loginInProgress=function(){return this._loginInProgress},n.prototype._hasResource=function(e){var t=this._getItem(this.CONSTANTS.STORAGE.TOKEN_KEYS);return t&&!this._isEmpty(t)&&t.indexOf(e+this.CONSTANTS.RESOURCE_DELIMETER)>-1},n.prototype.getCachedToken=function(e){if(!this._hasResource(e))return null;var t=this._getItem(this.CONSTANTS.STORAGE.ACCESS_TOKEN_KEY+e),n=this._getItem(this.CONSTANTS.STORAGE.EXPIRATION_KEY+e),r=this.config.expireOffsetSeconds||300;return n&&n>this._now()+r?t:(this._saveItem(this.CONSTANTS.STORAGE.ACCESS_TOKEN_KEY+e,""),this._saveItem(this.CONSTANTS.STORAGE.EXPIRATION_KEY+e,0),null)},n.prototype.getCachedUser=function(){if(this._user)return this._user;var e=this._getItem(this.CONSTANTS.STORAGE.IDTOKEN);return this._user=this._createUser(e),this._user},n.prototype.registerCallback=function(e,t,n){this._activeRenewals[t]=e,this._callBacksMappedToRenewStates[e]||(this._callBacksMappedToRenewStates[e]=[]);var r=this;this._callBacksMappedToRenewStates[e].push(n),this._callBackMappedToRenewStates[e]||(this._callBackMappedToRenewStates[e]=function(n,i,o,s){r._activeRenewals[t]=null;for(var a=0;a<r._callBacksMappedToRenewStates[e].length;++a)try{r._callBacksMappedToRenewStates[e][a](n,i,o,s)}catch(o){r.warn(o)}r._callBacksMappedToRenewStates[e]=null,r._callBackMappedToRenewStates[e]=null})},n.prototype._renewToken=function(e,t,n){this.info("renewToken is called for resource:"+e);var r=this._addAdalFrame("adalRenewFrame"+e),i=this._guid()+"|"+e;this.config.state=i,this._renewStates.push(i),this.verbose("Renew token Expected state: "+i),n=n||"token";var o=this._urlRemoveQueryStringParameter(this._getNavigateUrl(n,e),"prompt");n===this.RESPONSE_TYPE.ID_TOKEN_TOKEN&&(this._idTokenNonce=this._guid(),this._saveItem(this.CONSTANTS.STORAGE.NONCE_IDTOKEN,this._idTokenNonce,!0),o+="&nonce="+encodeURIComponent(this._idTokenNonce)),o+="&prompt=none",o=this._addHintParameters(o),this.registerCallback(i,e,t),this.verbosePii("Navigate to:"+o),r.src="about:blank",this._loadFrameTimeout(o,"adalRenewFrame"+e,e)},n.prototype._renewIdToken=function(e,t){this.info("renewIdToken is called");var n=this._addAdalFrame("adalIdTokenFrame"),r=this._guid()+"|"+this.config.clientId;this._idTokenNonce=this._guid(),this._saveItem(this.CONSTANTS.STORAGE.NONCE_IDTOKEN,this._idTokenNonce,!0),this.config.state=r,this._renewStates.push(r),this.verbose("Renew Idtoken Expected state: "+r);var i=null===t||void 0===t?null:this.config.clientId,t=t||"id_token",o=this._urlRemoveQueryStringParameter(this._getNavigateUrl(t,i),"prompt");o+="&prompt=none",o=this._addHintParameters(o),o+="&nonce="+encodeURIComponent(this._idTokenNonce),this.registerCallback(r,this.config.clientId,e),this.verbosePii("Navigate to:"+o),n.src="about:blank",this._loadFrameTimeout(o,"adalIdTokenFrame",this.config.clientId)},n.prototype._urlContainsQueryStringParameter=function(e,t){return new RegExp("[\\?&]"+e+"=").test(t)},n.prototype._urlRemoveQueryStringParameter=function(e,t){var n=new RegExp("(\\&"+t+"=)[^&]+");return e=e.replace(n,""),n=new RegExp("("+t+"=)[^&]+&"),e=e.replace(n,""),n=new RegExp("("+t+"=)[^&]+"),e=e.replace(n,"")},n.prototype._loadFrameTimeout=function(e,t,n){this.verbose("Set loading state to pending for: "+n),this._saveItem(this.CONSTANTS.STORAGE.RENEW_STATUS+n,this.CONSTANTS.TOKEN_RENEW_STATUS_IN_PROGRESS),this._loadFrame(e,t);var r=this;setTimeout(function(){if(r._getItem(r.CONSTANTS.STORAGE.RENEW_STATUS+n)===r.CONSTANTS.TOKEN_RENEW_STATUS_IN_PROGRESS){r.verbose("Loading frame has timed out after: "+r.CONSTANTS.LOADFRAME_TIMEOUT/1e3+" seconds for resource "+n);var e=r._activeRenewals[n];e&&r._callBackMappedToRenewStates[e]&&r._callBackMappedToRenewStates[e]("Token renewal operation failed due to timeout",null,"Token Renewal Failed"),r._saveItem(r.CONSTANTS.STORAGE.RENEW_STATUS+n,r.CONSTANTS.TOKEN_RENEW_STATUS_CANCELED)}},r.CONSTANTS.LOADFRAME_TIMEOUT)},n.prototype._loadFrame=function(e,t){var n=this;n.info("LoadFrame: "+t);var r=t;setTimeout(function(){var t=n._addAdalFrame(r);""!==t.src&&"about:blank"!==t.src||(t.src=e,n._loadFrame(e,r))},500)},n.prototype.acquireToken=function(e,t){if(this._isEmpty(e))return this.warn("resource is required"),void t("resource is required",null,"resource is required");var n=this.getCachedToken(e);return n?(this.info("Token is already in cache for resource:"+e),void t(null,n,null)):this._user||this.config.extraQueryParameter&&-1!==this.config.extraQueryParameter.indexOf("login_hint")?void(this._activeRenewals[e]?this.registerCallback(this._activeRenewals[e],e,t):(this._requestType=this.REQUEST_TYPE.RENEW_TOKEN,e===this.config.clientId?this._user?(this.verbose("renewing idtoken"),this._renewIdToken(t)):(this.verbose("renewing idtoken and access_token"),this._renewIdToken(t,this.RESPONSE_TYPE.ID_TOKEN_TOKEN)):this._user?(this.verbose("renewing access_token"),this._renewToken(e,t)):(this.verbose("renewing idtoken and access_token"),this._renewToken(e,t,this.RESPONSE_TYPE.ID_TOKEN_TOKEN)))):(this.warn("User login is required"),void t("User login is required",null,"login required"))},n.prototype.acquireTokenPopup=function(e,t,n,r){if(this._isEmpty(e))return this.warn("resource is required"),void r("resource is required",null,"resource is required");if(!this._user)return this.warn("User login is required"),void r("User login is required",null,"login required");if(this._acquireTokenInProgress)return this.warn("Acquire token interactive is already in progress"),void r("Acquire token interactive is already in progress",null,"Acquire token interactive is already in progress");var i=this._guid()+"|"+e;this.config.state=i,this._renewStates.push(i),this._requestType=this.REQUEST_TYPE.RENEW_TOKEN,this.verbose("Renew token Expected state: "+i);var o=this._urlRemoveQueryStringParameter(this._getNavigateUrl("token",e),"prompt");if(o+="&prompt=select_account",t&&(o+=t),n&&-1===o.indexOf("&claims"))o+="&claims="+encodeURIComponent(n);else if(n&&-1!==o.indexOf("&claims"))throw new Error("Claims cannot be passed as an extraQueryParameter");o=this._addHintParameters(o),this._acquireTokenInProgress=!0,this.info("acquireToken interactive is called for the resource "+e),this.registerCallback(i,e,r),this._loginPopup(o,e,r)},n.prototype.acquireTokenRedirect=function(e,t,n){if(this._isEmpty(e))return this.warn("resource is required"),void r("resource is required",null,"resource is required");var r=this.callback;if(!this._user)return this.warn("User login is required"),void r("User login is required",null,"login required");if(this._acquireTokenInProgress)return this.warn("Acquire token interactive is already in progress"),void r("Acquire token interactive is already in progress",null,"Acquire token interactive is already in progress");var i=this._guid()+"|"+e;this.config.state=i,this.verbose("Renew token Expected state: "+i);var o=this._urlRemoveQueryStringParameter(this._getNavigateUrl("token",e),"prompt");if(o+="&prompt=select_account",t&&(o+=t),n&&-1===o.indexOf("&claims"))o+="&claims="+encodeURIComponent(n);else if(n&&-1!==o.indexOf("&claims"))throw new Error("Claims cannot be passed as an extraQueryParameter");o=this._addHintParameters(o),this._acquireTokenInProgress=!0,this.info("acquireToken interactive is called for the resource "+e),this._saveItem(this.CONSTANTS.STORAGE.LOGIN_REQUEST,window.location.href),this._saveItem(this.CONSTANTS.STORAGE.STATE_RENEW,i,!0),this.promptUser(o)},n.prototype.promptUser=function(e){e?(this.infoPii("Navigate to:"+e),window.location.replace(e)):this.info("Navigate url is empty")},n.prototype.clearCache=function(){this._saveItem(this.CONSTANTS.STORAGE.LOGIN_REQUEST,""),this._saveItem(this.CONSTANTS.STORAGE.ANGULAR_LOGIN_REQUEST,""),this._saveItem(this.CONSTANTS.STORAGE.SESSION_STATE,""),this._saveItem(this.CONSTANTS.STORAGE.STATE_LOGIN,""),this._saveItem(this.CONSTANTS.STORAGE.STATE_RENEW,""),this._renewStates=[],this._saveItem(this.CONSTANTS.STORAGE.NONCE_IDTOKEN,""),this._saveItem(this.CONSTANTS.STORAGE.IDTOKEN,""),this._saveItem(this.CONSTANTS.STORAGE.ERROR,""),this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION,""),this._saveItem(this.CONSTANTS.STORAGE.LOGIN_ERROR,""),this._saveItem(this.CONSTANTS.STORAGE.LOGIN_ERROR,"");var e=this._getItem(this.CONSTANTS.STORAGE.TOKEN_KEYS);if(!this._isEmpty(e)){e=e.split(this.CONSTANTS.RESOURCE_DELIMETER);for(var t=0;t<e.length&&""!==e[t];t++)this._saveItem(this.CONSTANTS.STORAGE.ACCESS_TOKEN_KEY+e[t],""),this._saveItem(this.CONSTANTS.STORAGE.EXPIRATION_KEY+e[t],0)}this._saveItem(this.CONSTANTS.STORAGE.TOKEN_KEYS,"")},n.prototype.clearCacheForResource=function(e){this._saveItem(this.CONSTANTS.STORAGE.STATE_RENEW,""),this._saveItem(this.CONSTANTS.STORAGE.ERROR,""),this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION,""),this._hasResource(e)&&(this._saveItem(this.CONSTANTS.STORAGE.ACCESS_TOKEN_KEY+e,""),this._saveItem(this.CONSTANTS.STORAGE.EXPIRATION_KEY+e,0))},n.prototype.logOut=function(){this.clearCache(),this._user=null;var e;if(this.config.logOutUri)e=this.config.logOutUri;else{var t="common",n="";this.config.tenant&&(t=this.config.tenant),this.config.postLogoutRedirectUri&&(n="post_logout_redirect_uri="+encodeURIComponent(this.config.postLogoutRedirectUri)),e=this.instance+t+"/oauth2/logout?"+n}this.infoPii("Logout navigate to: "+e),this.promptUser(e)},n.prototype._isEmpty=function(e){return void 0===e||!e||0===e.length},n.prototype.getUser=function(e){if("function"!=typeof e)throw new Error("callback is not a function");if(this._user)return void e(null,this._user);var t=this._getItem(this.CONSTANTS.STORAGE.IDTOKEN);this._isEmpty(t)?(this.warn("User information is not available"),e("User information is not available",null)):(this.info("User exists in cache: "),this._user=this._createUser(t),e(null,this._user))},n.prototype._addHintParameters=function(e){if(this._user&&this._user.profile)if(this._user.profile.sid&&-1!==e.indexOf("&prompt=none"))this._urlContainsQueryStringParameter("sid",e)||(e+="&sid="+encodeURIComponent(this._user.profile.sid));else if(this._user.profile.upn&&(this._urlContainsQueryStringParameter("login_hint",e)||(e+="&login_hint="+encodeURIComponent(this._user.profile.upn)),!this._urlContainsQueryStringParameter("domain_hint",e)&&this._user.profile.upn.indexOf("@")>-1)){var t=this._user.profile.upn.split("@");e+="&domain_hint="+encodeURIComponent(t[t.length-1])}return e},n.prototype._createUser=function(e){var t=null,n=this._extractIdToken(e);return n&&n.hasOwnProperty("aud")&&(n.aud.toLowerCase()===this.config.clientId.toLowerCase()?(t={userName:"",profile:n},n.hasOwnProperty("upn")?t.userName=n.upn:n.hasOwnProperty("email")&&(t.userName=n.email)):this.warn("IdToken has invalid aud field")),t},n.prototype._getHash=function(e){return e.indexOf("#/")>-1?e=e.substring(e.indexOf("#/")+2):e.indexOf("#")>-1&&(e=e.substring(1)),e},n.prototype.isCallback=function(e){e=this._getHash(e);var t=this._deserialize(e);return t.hasOwnProperty(this.CONSTANTS.ERROR_DESCRIPTION)||t.hasOwnProperty(this.CONSTANTS.ACCESS_TOKEN)||t.hasOwnProperty(this.CONSTANTS.ID_TOKEN)},n.prototype.getLoginError=function(){return this._getItem(this.CONSTANTS.STORAGE.LOGIN_ERROR)},n.prototype.getRequestInfo=function(e){e=this._getHash(e);var t=this._deserialize(e),n={valid:!1,parameters:{},stateMatch:!1,stateResponse:"",requestType:this.REQUEST_TYPE.UNKNOWN};if(t&&(n.parameters=t,t.hasOwnProperty(this.CONSTANTS.ERROR_DESCRIPTION)||t.hasOwnProperty(this.CONSTANTS.ACCESS_TOKEN)||t.hasOwnProperty(this.CONSTANTS.ID_TOKEN))){n.valid=!0;var r="";if(!t.hasOwnProperty("state"))return this.warn("No state returned"),n;if(this.verbose("State: "+t.state),r=t.state,n.stateResponse=r,this._matchState(n))return n;if(!n.stateMatch&&window.parent){n.requestType=this._requestType;for(var i=this._renewStates,o=0;o<i.length;o++)if(i[o]===n.stateResponse){n.stateMatch=!0;break}}}return n},n.prototype._matchNonce=function(e){var t=this._getItem(this.CONSTANTS.STORAGE.NONCE_IDTOKEN);if(t){t=t.split(this.CONSTANTS.CACHE_DELIMETER);for(var n=0;n<t.length;n++)if(t[n]===e.profile.nonce)return!0}return!1},n.prototype._matchState=function(e){var t=this._getItem(this.CONSTANTS.STORAGE.STATE_LOGIN);if(t){t=t.split(this.CONSTANTS.CACHE_DELIMETER);for(var n=0;n<t.length;n++)if(t[n]===e.stateResponse)return e.requestType=this.REQUEST_TYPE.LOGIN,e.stateMatch=!0,!0}var r=this._getItem(this.CONSTANTS.STORAGE.STATE_RENEW);if(r){r=r.split(this.CONSTANTS.CACHE_DELIMETER);for(var n=0;n<r.length;n++)if(r[n]===e.stateResponse)return e.requestType=this.REQUEST_TYPE.RENEW_TOKEN,e.stateMatch=!0,!0}return!1},n.prototype._getResourceFromState=function(e){if(e){var t=e.indexOf("|");if(t>-1&&t+1<e.length)return e.substring(t+1)}return""},n.prototype.saveTokenFromHash=function(e){this.info("State status:"+e.stateMatch+"; Request type:"+e.requestType),this._saveItem(this.CONSTANTS.STORAGE.ERROR,""),this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION,"");var t=this._getResourceFromState(e.stateResponse);if(e.parameters.hasOwnProperty(this.CONSTANTS.ERROR_DESCRIPTION))this.infoPii("Error :"+e.parameters.error+"; Error description:"+e.parameters[this.CONSTANTS.ERROR_DESCRIPTION]),this._saveItem(this.CONSTANTS.STORAGE.ERROR,e.parameters.error),this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION,e.parameters[this.CONSTANTS.ERROR_DESCRIPTION]),e.requestType===this.REQUEST_TYPE.LOGIN&&(this._loginInProgress=!1,this._saveItem(this.CONSTANTS.STORAGE.LOGIN_ERROR,e.parameters.error_description));else if(e.stateMatch){this.info("State is right"),e.parameters.hasOwnProperty(this.CONSTANTS.SESSION_STATE)&&this._saveItem(this.CONSTANTS.STORAGE.SESSION_STATE,e.parameters[this.CONSTANTS.SESSION_STATE]);var n;e.parameters.hasOwnProperty(this.CONSTANTS.ACCESS_TOKEN)&&(this.info("Fragment has access token"),this._hasResource(t)||(n=this._getItem(this.CONSTANTS.STORAGE.TOKEN_KEYS)||"",this._saveItem(this.CONSTANTS.STORAGE.TOKEN_KEYS,n+t+this.CONSTANTS.RESOURCE_DELIMETER)),this._saveItem(this.CONSTANTS.STORAGE.ACCESS_TOKEN_KEY+t,e.parameters[this.CONSTANTS.ACCESS_TOKEN]),this._saveItem(this.CONSTANTS.STORAGE.EXPIRATION_KEY+t,this._expiresIn(e.parameters[this.CONSTANTS.EXPIRES_IN]))),e.parameters.hasOwnProperty(this.CONSTANTS.ID_TOKEN)&&(this.info("Fragment has id token"),this._loginInProgress=!1,this._user=this._createUser(e.parameters[this.CONSTANTS.ID_TOKEN]),this._user&&this._user.profile?this._matchNonce(this._user)?(this._saveItem(this.CONSTANTS.STORAGE.IDTOKEN,e.parameters[this.CONSTANTS.ID_TOKEN]),t=this.config.loginResource?this.config.loginResource:this.config.clientId,this._hasResource(t)||(n=this._getItem(this.CONSTANTS.STORAGE.TOKEN_KEYS)||"",this._saveItem(this.CONSTANTS.STORAGE.TOKEN_KEYS,n+t+this.CONSTANTS.RESOURCE_DELIMETER)),this._saveItem(this.CONSTANTS.STORAGE.ACCESS_TOKEN_KEY+t,e.parameters[this.CONSTANTS.ID_TOKEN]),this._saveItem(this.CONSTANTS.STORAGE.EXPIRATION_KEY+t,this._user.profile.exp)):(this._saveItem(this.CONSTANTS.STORAGE.LOGIN_ERROR,"Nonce received: "+this._user.profile.nonce+" is not same as requested: "+this._getItem(this.CONSTANTS.STORAGE.NONCE_IDTOKEN)),this._user=null):(e.parameters.error="invalid id_token",e.parameters.error_description="Invalid id_token. id_token: "+e.parameters[this.CONSTANTS.ID_TOKEN],this._saveItem(this.CONSTANTS.STORAGE.ERROR,"invalid id_token"),this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION,"Invalid id_token. id_token: "+e.parameters[this.CONSTANTS.ID_TOKEN])))}else e.parameters.error="Invalid_state",e.parameters.error_description="Invalid_state. state: "+e.stateResponse,this._saveItem(this.CONSTANTS.STORAGE.ERROR,"Invalid_state"),this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION,"Invalid_state. state: "+e.stateResponse);this._saveItem(this.CONSTANTS.STORAGE.RENEW_STATUS+t,this.CONSTANTS.TOKEN_RENEW_STATUS_COMPLETED)},n.prototype.getResourceForEndpoint=function(e){if(this.config&&this.config.anonymousEndpoints)for(var t=0;t<this.config.anonymousEndpoints.length;t++)if(e.indexOf(this.config.anonymousEndpoints[t])>-1)return null;if(this.config&&this.config.endpoints)for(var n in this.config.endpoints)if(e.indexOf(n)>-1)return this.config.endpoints[n];return e.indexOf("http://")>-1||e.indexOf("https://")>-1?this._getHostFromUri(e)===this._getHostFromUri(this.config.redirectUri)?this.config.loginResource:null:this.config.loginResource},n.prototype._getHostFromUri=function(e){var t=String(e).replace(/^(https?:)\/\//,"");return t=t.split("/")[0]},n.prototype.handleWindowCallback=function(e){if(null==e&&(e=window.location.hash),this.isCallback(e)){var t=null,n=!1;this._openedWindows.length>0&&this._openedWindows[this._openedWindows.length-1].opener&&this._openedWindows[this._openedWindows.length-1].opener._adalInstance?(t=this._openedWindows[this._openedWindows.length-1].opener._adalInstance,n=!0):window.parent&&window.parent._adalInstance&&(t=window.parent._adalInstance);var r,i,o=t.getRequestInfo(e),s=null;i=n||window.parent!==window?t._callBackMappedToRenewStates[o.stateResponse]:t.callback,t.info("Returned from redirect url"),t.saveTokenFromHash(o),o.requestType===this.REQUEST_TYPE.RENEW_TOKEN&&window.parent?(window.parent!==window?t.verbose("Window is in iframe, acquiring token silently"):t.verbose("acquiring token interactive in progress"),r=o.parameters[t.CONSTANTS.ACCESS_TOKEN]||o.parameters[t.CONSTANTS.ID_TOKEN],s=t.CONSTANTS.ACCESS_TOKEN):o.requestType===this.REQUEST_TYPE.LOGIN&&(r=o.parameters[t.CONSTANTS.ID_TOKEN],s=t.CONSTANTS.ID_TOKEN);var a=o.parameters[t.CONSTANTS.ERROR_DESCRIPTION],u=o.parameters[t.CONSTANTS.ERROR];try{i&&i(a,r,u,s)}catch(e){t.error("Error occurred in user defined callback function: "+e)}window.parent!==window||n||(t.config.navigateToLoginRequestUrl?window.location.href=t._getItem(t.CONSTANTS.STORAGE.LOGIN_REQUEST):window.location.hash="")}},n.prototype._getNavigateUrl=function(e,t){var n="common";this.config.tenant&&(n=this.config.tenant);var r=this.instance+n+"/oauth2/authorize"+this._serialize(e,this.config,t)+this._addLibMetadata();return this.info("Navigate url:"+r),r},n.prototype._extractIdToken=function(e){var t=this._decodeJwt(e);if(!t)return null;try{var n=t.JWSPayload,r=this._base64DecodeStringUrlSafe(n);return r?JSON.parse(r):(this.info("The returned id_token could not be base64 url safe decoded."),null)}catch(e){this.error("The returned id_token could not be decoded",e)}return null},n.prototype._base64DecodeStringUrlSafe=function(e){return e=e.replace(/-/g,"+").replace(/_/g,"/"),window.atob?decodeURIComponent(escape(window.atob(e))):decodeURIComponent(escape(this._decode(e)))},n.prototype._decode=function(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";e=String(e).replace(/=+$/,"");var n=e.length;if(n%4==1)throw new Error("The token to be decoded is not correctly encoded.");for(var r,i,o,s,a,u,c,h,l="",p=0;p<n;p+=4){if(r=t.indexOf(e.charAt(p)),i=t.indexOf(e.charAt(p+1)),o=t.indexOf(e.charAt(p+2)),s=t.indexOf(e.charAt(p+3)),p+2===n-1){a=r<<18|i<<12|o<<6,u=a>>16&255,c=a>>8&255,l+=String.fromCharCode(u,c);break}if(p+1===n-1){a=r<<18|i<<12,u=a>>16&255,l+=String.fromCharCode(u);break}a=r<<18|i<<12|o<<6|s,u=a>>16&255,c=a>>8&255,h=255&a,l+=String.fromCharCode(u,c,h)}return l},n.prototype._decodeJwt=function(e){if(this._isEmpty(e))return null;var t=/^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/,n=t.exec(e);return!n||n.length<4?(this.warn("The returned id_token is not parseable."),null):{header:n[1],JWSPayload:n[2],JWSSig:n[3]}},n.prototype._convertUrlSafeToRegularBase64EncodedString=function(e){return e.replace("-","+").replace("_","/")},n.prototype._serialize=function(e,t,n){var r=[];if(null!==t){r.push("?response_type="+e),r.push("client_id="+encodeURIComponent(t.clientId)),n&&r.push("resource="+encodeURIComponent(n)),r.push("redirect_uri="+encodeURIComponent(t.redirectUri)),r.push("state="+encodeURIComponent(t.state)),t.hasOwnProperty("slice")&&r.push("slice="+encodeURIComponent(t.slice)),t.hasOwnProperty("extraQueryParameter")&&r.push(t.extraQueryParameter);var i=t.correlationId?t.correlationId:this._guid();r.push("client-request-id="+encodeURIComponent(i))}return r.join("&")},n.prototype._deserialize=function(e){var t,n=/\+/g,r=/([^&=]+)=([^&]*)/g,i=function(e){return decodeURIComponent(e.replace(n," "))},o={};for(t=r.exec(e);t;)o[i(t[1])]=i(t[2]),t=r.exec(e);return o},n.prototype._decimalToHex=function(e){for(var t=e.toString(16);t.length<2;)t="0"+t;return t},n.prototype._guid=function(){var e=window.crypto||window.msCrypto;if(e&&e.getRandomValues){var t=new Uint8Array(16);return e.getRandomValues(t),t[6]|=64,t[6]&=79,t[8]|=128,t[8]&=191,this._decimalToHex(t[0])+this._decimalToHex(t[1])+this._decimalToHex(t[2])+this._decimalToHex(t[3])+"-"+this._decimalToHex(t[4])+this._decimalToHex(t[5])+"-"+this._decimalToHex(t[6])+this._decimalToHex(t[7])+"-"+this._decimalToHex(t[8])+this._decimalToHex(t[9])+"-"+this._decimalToHex(t[10])+this._decimalToHex(t[11])+this._decimalToHex(t[12])+this._decimalToHex(t[13])+this._decimalToHex(t[14])+this._decimalToHex(t[15])}for(var n="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx",r="0123456789abcdef",i=0,o="",s=0;s<36;s++)"-"!==n[s]&&"4"!==n[s]&&(i=16*Math.random()|0),"x"===n[s]?o+=r[i]:"y"===n[s]?(i&=3,i|=8,o+=r[i]):o+=n[s];return o},n.prototype._expiresIn=function(e){return e||(e=3599),this._now()+parseInt(e,10)},n.prototype._now=function(){return Math.round((new Date).getTime()/1e3)},n.prototype._addAdalFrame=function(e){if(void 0!==e){this.info("Add adal frame to document:"+e);var t=document.getElementById(e);if(!t){if(document.createElement&&document.documentElement&&(window.opera||-1===window.navigator.userAgent.indexOf("MSIE 5.0"))){var n=document.createElement("iframe");n.setAttribute("id",e),n.setAttribute("aria-hidden","true"),n.style.visibility="hidden",n.style.position="absolute",n.style.width=n.style.height=n.borderWidth="0px",t=document.getElementsByTagName("body")[0].appendChild(n)}else document.body&&document.body.insertAdjacentHTML&&document.body.insertAdjacentHTML("beforeEnd",'<iframe name="'+e+'" id="'+e+'" style="display:none"></iframe>');window.frames&&window.frames[e]&&(t=window.frames[e])}return t}},n.prototype._saveItem=function(e,t,n){if(this.config&&this.config.cacheLocation&&"localStorage"===this.config.cacheLocation){if(!this._supportsLocalStorage())return this.info("Local storage is not supported"),!1;if(n){var r=this._getItem(e)||"";localStorage.setItem(e,r+t+this.CONSTANTS.CACHE_DELIMETER)}else localStorage.setItem(e,t);return!0}return this._supportsSessionStorage()?(sessionStorage.setItem(e,t),!0):(this.info("Session storage is not supported"),!1)},n.prototype._getItem=function(e){return this.config&&this.config.cacheLocation&&"localStorage"===this.config.cacheLocation?this._supportsLocalStorage()?localStorage.getItem(e):(this.info("Local storage is not supported"),null):this._supportsSessionStorage()?sessionStorage.getItem(e):(this.info("Session storage is not supported"),null)},n.prototype._supportsLocalStorage=function(){try{return!!window.localStorage&&(window.localStorage.setItem("storageTest","A"),"A"==window.localStorage.getItem("storageTest")&&(window.localStorage.removeItem("storageTest"),!window.localStorage.getItem("storageTest")))}catch(e){return!1}},n.prototype._supportsSessionStorage=function(){try{return!!window.sessionStorage&&(window.sessionStorage.setItem("storageTest","A"),"A"==window.sessionStorage.getItem("storageTest")&&(window.sessionStorage.removeItem("storageTest"),!window.sessionStorage.getItem("storageTest")))}catch(e){return!1}},n.prototype._cloneConfig=function(e){if(null===e||"object"!=typeof e)return e;var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t},n.prototype._addLibMetadata=function(){return"&x-client-SKU=Js&x-client-Ver="+this._libVersion()},n.prototype.log=function(e,t,n,r){if(e<=Logging.level){if(!Logging.piiLoggingEnabled&&r)return;var i=(new Date).toUTCString(),o="";o=this.config.correlationId?i+":"+this.config.correlationId+"-"+this._libVersion()+"-"+this.CONSTANTS.LEVEL_STRING_MAP[e]+" "+t:i+":"+this._libVersion()+"-"+this.CONSTANTS.LEVEL_STRING_MAP[e]+" "+t,n&&(o+="\nstack:\n"+n.stack),Logging.log(o)}},n.prototype.error=function(e,t){this.log(this.CONSTANTS.LOGGING_LEVEL.ERROR,e,t)},n.prototype.warn=function(e){this.log(this.CONSTANTS.LOGGING_LEVEL.WARN,e,null)},n.prototype.info=function(e){this.log(this.CONSTANTS.LOGGING_LEVEL.INFO,e,null)},n.prototype.verbose=function(e){this.log(this.CONSTANTS.LOGGING_LEVEL.VERBOSE,e,null)},n.prototype.errorPii=function(e,t){this.log(this.CONSTANTS.LOGGING_LEVEL.ERROR,e,t,!0)},n.prototype.warnPii=function(e){this.log(this.CONSTANTS.LOGGING_LEVEL.WARN,e,null,!0)},n.prototype.infoPii=function(e){this.log(this.CONSTANTS.LOGGING_LEVEL.INFO,e,null,!0)},n.prototype.verbosePii=function(e){this.log(this.CONSTANTS.LOGGING_LEVEL.VERBOSE,e,null,!0)},n.prototype._libVersion=function(){return"1.0.17"},void 0!==e&&e.exports&&(e.exports=n,e.exports.inject=function(e){return new n(e)}),n}()},function(e,t,n){"use strict";n.d(t,"a",function(){return u}),n.d(t,"c",function(){return c}),n.d(t,"b",function(){return h});var r=n(2),i=n(0),o=n(1),s=n(4),a=n(5),u=function(e){function t(t){void 0===t&&(t="This query is already part of a batch.");var n=e.call(this,t)||this;return n.name="AlreadyInBatchException",o.a.error(n),n}return r.b(t,e),t}(Error),c=function(){function e(){this._query=new i.a,this._options={},this._url="",this._parentUrl="",this._useCaching=!1,this._cachingOptions=null}return e.prototype.toUrl=function(){return this._url},e.prototype.concat=function(e){return this._url+=e,this},Object.defineProperty(e.prototype,"query",{get:function(){return this._query},enumerable:!0,configurable:!0}),e.prototype.configure=function(e){return Object(i.i)(this._options,e),this},e.prototype.configureFrom=function(e){return Object(i.i)(this._options,e._options),this},e.prototype.usingCaching=function(e){return i.c.globalCacheDisable||(this._useCaching=!0,void 0!==e&&(this._cachingOptions=e)),this},e.prototype.getCore=function(e,t){return void 0===e&&(e=new s.c),void 0===t&&(t={}),this.toRequestContext("GET",t,e,Object(a.b)()).then(function(e){return Object(a.c)(e)})},e.prototype.postCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new s.c),this.toRequestContext("POST",e,t,Object(a.b)()).then(function(e){return Object(a.c)(e)})},e.prototype.patchCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new s.c),this.toRequestContext("PATCH",e,t,Object(a.b)()).then(function(e){return Object(a.c)(e)})},e.prototype.deleteCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new s.c),this.toRequestContext("DELETE",e,t,Object(a.b)()).then(function(e){return Object(a.c)(e)})},e.prototype.putCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new s.c),this.toRequestContext("PUT",e,t,Object(a.b)()).then(function(e){return Object(a.c)(e)})},e.prototype.append=function(e){this._url=Object(i.d)(this._url,e)},Object.defineProperty(e.prototype,"parentUrl",{get:function(){return this._parentUrl},enumerable:!0,configurable:!0}),e.prototype.extend=function(e,t){this._parentUrl=e._url,this._url=Object(i.d)(this._parentUrl,t),this.configureFrom(e)},e}(),h=function(e){function t(){var t=e.call(this)||this;return t._batch=null,t}return r.b(t,e),t.prototype.inBatch=function(e){if(null!==this.batch)throw new u;return this._batch=e,this},t.prototype.toUrl=function(){return this._url},t.prototype.get=function(e,t){return void 0===e&&(e=new s.e),void 0===t&&(t={}),this.getCore(e,t)},t.prototype.getCore=function(e,t){return void 0===e&&(e=new s.e),void 0===t&&(t={}),this.toRequestContext("GET",t,e,Object(a.b)()).then(function(e){return Object(a.c)(e)})},t.prototype.postCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new s.e),this.toRequestContext("POST",e,t,Object(a.b)()).then(function(e){return Object(a.c)(e)})},t.prototype.patchCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new s.e),this.toRequestContext("PATCH",e,t,Object(a.b)()).then(function(e){return Object(a.c)(e)})},t.prototype.deleteCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new s.e),this.toRequestContext("DELETE",e,t,Object(a.b)()).then(function(e){return Object(a.c)(e)})},t.prototype.putCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new s.e),this.toRequestContext("PUT",e,t,Object(a.b)()).then(function(e){return Object(a.c)(e)})},t.prototype.addBatchDependency=function(){return null!==this._batch?this._batch.addDependency():function(){return null}},Object.defineProperty(t.prototype,"hasBatch",{get:function(){return Object(i.j)(this._batch)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"batch",{get:function(){return this.hasBatch?this._batch:null},enumerable:!0,configurable:!0}),t}(c)},function(e,t,n){"use strict";n.d(t,"a",function(){return i});var r=n(0),i=function(){function e(e){void 0===e&&(e=Object(r.g)()),this._batchId=e,this._requests=[],this._dependencies=[],this._resolveBatchDependencies=[]}return Object.defineProperty(e.prototype,"batchId",{get:function(){return this._batchId},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"requests",{get:function(){return this._requests},enumerable:!0,configurable:!0}),e.prototype.add=function(e,t,n,r,i){var o={id:i,method:t.toUpperCase(),options:n,parser:r,reject:null,resolve:null,url:e},s=new Promise(function(e,t){o.resolve=e,o.reject=t});return this._requests.push(o),s},e.prototype.addDependency=function(){var e=function(){},t=new Promise(function(t){e=t});return this._dependencies.push(t),e},e.prototype.addResolveBatchDependency=function(e){this._resolveBatchDependencies.push(e)},e.prototype.execute=function(){var e=this;return Promise.all(this._dependencies).then(function(){return Promise.all(e._dependencies)}).then(function(){return e.executeImpl()}).then(function(){return Promise.all(e._resolveBatchDependencies)}).then(function(){})},e}()}])}); | ||
//# sourceMappingURL=odata.es5.umd.bundle.min.js.map |
/** | ||
@license | ||
* @pnp/odata v1.0.5 - pnp - provides shared odata functionality and base classes | ||
* @pnp/odata v1.1.0 - pnp - provides shared odata functionality and base classes | ||
* MIT (https://github.com/pnp/pnpjs/blob/master/LICENSE) | ||
@@ -13,3 +13,3 @@ * Copyright (c) 2018 Microsoft | ||
typeof define === 'function' && define.amd ? define(['exports', '@pnp/common', 'tslib', '@pnp/logging'], factory) : | ||
(factory((global.pnp = global.pnp || {}, global.pnp.odata = {}),global.pnp.common,global.tslib_1,global.pnp.logging)); | ||
(factory((global.pnp = global.pnp || {}, global.pnp.odata = {}),global.pnp.common,null,global.pnp.logging)); | ||
}(this, (function (exports,common,tslib_1,logging) { 'use strict'; | ||
@@ -39,16 +39,16 @@ | ||
var CachingParserWrapper = /** @class */ (function () { | ||
function CachingParserWrapper(_parser, _cacheOptions) { | ||
this._parser = _parser; | ||
this._cacheOptions = _cacheOptions; | ||
function CachingParserWrapper(parser, cacheOptions) { | ||
this.parser = parser; | ||
this.cacheOptions = cacheOptions; | ||
} | ||
CachingParserWrapper.prototype.parse = function (response) { | ||
var _this = this; | ||
// add this to the cache based on the options | ||
return this._parser.parse(response).then(function (data) { | ||
if (_this._cacheOptions.store !== null) { | ||
_this._cacheOptions.store.put(_this._cacheOptions.key, data, _this._cacheOptions.expiration); | ||
} | ||
return data; | ||
}); | ||
return this.parser.parse(response).then(function (r) { return _this.cacheData(r); }); | ||
}; | ||
CachingParserWrapper.prototype.cacheData = function (data) { | ||
if (this.cacheOptions.store !== null) { | ||
this.cacheOptions.store.put(this.cacheOptions.key, data, this.cacheOptions.expiration); | ||
} | ||
return data; | ||
}; | ||
return CachingParserWrapper; | ||
@@ -201,6 +201,17 @@ }()); | ||
} | ||
r.buffer().then(resolve); | ||
else { | ||
r.buffer().then(resolve); | ||
} | ||
}; | ||
return BufferParser; | ||
}(ODataParserBase)); | ||
var LambdaParser = /** @class */ (function () { | ||
function LambdaParser(parser) { | ||
this.parser = parser; | ||
} | ||
LambdaParser.prototype.parse = function (r) { | ||
return this.parser(r); | ||
}; | ||
return LambdaParser; | ||
}()); | ||
@@ -214,5 +225,5 @@ /** | ||
logging.Logger.log({ | ||
data: context.result, | ||
level: 0 /* Verbose */, | ||
message: "[" + context.requestId + "] (" + (new Date()).getTime() + ") Returning result, see data property for value.", | ||
data: logging.Logger.activeLogLevel === 0 /* Verbose */ ? context.result : {}, | ||
level: 1 /* Info */, | ||
message: "[" + context.requestId + "] (" + (new Date()).getTime() + ") Returning result from pipeline. Set logging to verbose to see data.", | ||
}); | ||
@@ -253,8 +264,11 @@ return Promise.resolve(context.result || null); | ||
} | ||
return next(context) | ||
.then(function (ctx) { return returnResult(ctx); }) | ||
.catch(function (e) { | ||
var promise = next(context).then(function (ctx) { return returnResult(ctx); }).catch(function (e) { | ||
logging.Logger.error(e); | ||
throw e; | ||
}); | ||
if (context.isBatched) { | ||
// this will block the batch's execute method from returning until the child requets have been resolved | ||
context.batch.addResolveBatchDependency(promise); | ||
} | ||
return promise; | ||
} | ||
@@ -310,3 +324,3 @@ /** | ||
// handle caching, if applicable | ||
if (context.verb === "GET" && context.isCached) { | ||
if (context.isCached) { | ||
logging.Logger.write("[" + context.requestId + "] (" + (new Date()).getTime() + ") Caching is enabled for request, checking cache...", 1 /* Info */); | ||
@@ -322,3 +336,3 @@ var cacheOptions = new CachingOptions(context.requestAbsoluteUrl.toLowerCase()); | ||
if (data !== null) { | ||
// ensure we clear any help batch dependency we are resolving from the cache | ||
// ensure we clear any held batch dependency we are resolving from the cache | ||
logging.Logger.log({ | ||
@@ -355,3 +369,3 @@ data: logging.Logger.activeLogLevel === 1 /* Info */ ? {} : data, | ||
// we are in a batch, so add to batch, remove dependency, and resolve with the batch's promise | ||
var p = context.batch.add(context.requestAbsoluteUrl, context.verb, context.options, context.parser); | ||
var p = context.batch.add(context.requestAbsoluteUrl, context.verb, context.options, context.parser, context.requestId); | ||
// we release the dependency here to ensure the batch does not execute until the request is added to the batch | ||
@@ -502,13 +516,2 @@ if (common.isFunc(context.batchDependency)) { | ||
}; | ||
/** | ||
* Executes the currently built request | ||
* | ||
* @param parser Allows you to specify a parser to handle the result | ||
* @param getOptions The options used for this request | ||
*/ | ||
Queryable.prototype.get = function (parser, options) { | ||
if (parser === void 0) { parser = new JSONParser(); } | ||
if (options === void 0) { options = {}; } | ||
return this.getCore(parser, options); | ||
}; | ||
Queryable.prototype.getCore = function (parser, options) { | ||
@@ -559,3 +562,3 @@ if (parser === void 0) { parser = new JSONParser(); } | ||
/** | ||
* Extends this queryable from | ||
* Extends this queryable from the provided parent | ||
* | ||
@@ -680,2 +683,3 @@ * @param parent Parent queryable from which we will derive a base url | ||
this._dependencies = []; | ||
this._resolveBatchDependencies = []; | ||
} | ||
@@ -706,4 +710,5 @@ Object.defineProperty(ODataBatch.prototype, "batchId", { | ||
*/ | ||
ODataBatch.prototype.add = function (url, method, options, parser) { | ||
ODataBatch.prototype.add = function (url, method, options, parser, requestId) { | ||
var info = { | ||
id: requestId, | ||
method: method.toUpperCase(), | ||
@@ -736,2 +741,10 @@ options: options, | ||
/** | ||
* The batch's execute method will not resolve util any promises added here resolve | ||
* | ||
* @param p The dependent promise | ||
*/ | ||
ODataBatch.prototype.addResolveBatchDependency = function (p) { | ||
this._resolveBatchDependencies.push(p); | ||
}; | ||
/** | ||
* Execute the current batch and resolve the associated promises | ||
@@ -745,3 +758,7 @@ * | ||
// We can get a second set of promises added during the first set resolving | ||
return Promise.all(this._dependencies).then(function () { return Promise.all(_this._dependencies); }).then(function () { return _this.executeImpl(); }); | ||
return Promise.all(this._dependencies) | ||
.then(function () { return Promise.all(_this._dependencies); }) | ||
.then(function () { return _this.executeImpl(); }) | ||
.then(function () { return Promise.all(_this._resolveBatchDependencies); }) | ||
.then(function () { return void (0); }); | ||
}; | ||
@@ -760,2 +777,3 @@ return ODataBatch; | ||
exports.BufferParser = BufferParser; | ||
exports.LambdaParser = LambdaParser; | ||
exports.setResult = setResult; | ||
@@ -762,0 +780,0 @@ exports.pipe = pipe; |
/** | ||
@license | ||
* @pnp/odata v1.0.5 - pnp - provides shared odata functionality and base classes | ||
* @pnp/odata v1.1.0 - pnp - provides shared odata functionality and base classes | ||
* MIT (https://github.com/pnp/pnpjs/blob/master/LICENSE) | ||
@@ -10,2 +10,2 @@ * Copyright (c) 2018 Microsoft | ||
*/ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@pnp/common"),require("tslib"),require("@pnp/logging")):"function"==typeof define&&define.amd?define(["exports","@pnp/common","tslib","@pnp/logging"],t):t((e.pnp=e.pnp||{},e.pnp.odata={}),e.pnp.common,e.tslib_1,e.pnp.logging)}(this,function(e,u,r,s){"use strict";var o=function(){function e(e){this.key=e,this.expiration=u.dateAdd(new Date,"second",u.RuntimeConfig.defaultCachingTimeoutSeconds),this.storeName=u.RuntimeConfig.defaultCachingStore}return Object.defineProperty(e.prototype,"store",{get:function(){return"local"===this.storeName?e.storage.local:e.storage.session},enumerable:!0,configurable:!0}),e.storage=new u.PnPClientStorage,e}(),i=function(){function e(e,t){this._parser=e,this._cacheOptions=t}return e.prototype.parse=function(e){var t=this;return this._parser.parse(e).then(function(e){return null!==t._cacheOptions.store&&t._cacheOptions.store.put(t._cacheOptions.key,e,t._cacheOptions.expiration),e})},e}(),a=function(o){function e(e,t,n){var r=o.call(this,"Error making HttpClient request in queryable: ["+e+"] "+t)||this;return r.status=e,r.statusText=t,r.data=n,r.name="ProcessHttpClientResponseException",s.Logger.log({data:r.data,level:3,message:r.message}),r}return r.__extends(e,o),e}(Error),t=function(){function e(){}return e.prototype.parse=function(n){var r=this;return new Promise(function(e,t){r.handleError(n,t)&&r.parseImpl(n,e,t)})},e.prototype.parseImpl=function(e,t,n){var r=this;e.headers.has("Content-Length")&&0===parseFloat(e.headers.get("Content-Length"))||204===e.status?t({}):e.text().then(function(e){return 0<e.replace(/\s/gi,"").length?JSON.parse(e):{}}).then(function(e){return t(r.parseODataJSON(e))}).catch(function(e){return n(e)})},e.prototype.handleError=function(n,r){return n.ok||n.json().then(function(e){var t={responseBody:e,responseHeaders:n.headers};r(new a(n.status,n.statusText,t))}).catch(function(e){s.Logger.log({data:e,level:2,message:"There was an error parsing the error response body. See data for details."});var t={responseBody:"[[body not available]]",responseHeaders:n.headers};r(new a(n.status,n.statusText,t))}),n.ok},e.prototype.parseODataJSON=function(e){var t=e;return e.hasOwnProperty("d")?t=e.d.hasOwnProperty("results")?e.d.results:e.d:e.hasOwnProperty("value")&&(t=e.value),t},e}(),n=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t}(t),c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.parseImpl=function(e,t){e.text().then(t)},t}(t),p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.parseImpl=function(e,t){e.blob().then(t)},t}(t),l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.parseImpl=function(e,t){e.json().then(t)},t}(t),h=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.parseImpl=function(e,t){u.isFunc(e.arrayBuffer)&&e.arrayBuffer().then(t),e.buffer().then(t)},t}(t);function f(t,n){return new Promise(function(e){t.result=n,t.hasResult=!0,e(t)})}function d(e){return 0<e.pipeline.length?e.pipeline.shift()(e):Promise.resolve(e)}function g(e){return e.pipeline.length<1&&s.Logger.write("["+e.requestId+"] ("+(new Date).getTime()+") Request pipeline contains no methods!",2),d(e).then(function(e){return t=e,s.Logger.log({data:t.result,level:0,message:"["+t.requestId+"] ("+(new Date).getTime()+") Returning result, see data property for value."}),Promise.resolve(t.result||null);var t}).catch(function(e){throw s.Logger.error(e),e})}function y(i){return void 0===i&&(i=!1),function(n,r,e){var o=e.value;e.value=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return!i&&0<e.length&&e[0].hasOwnProperty("hasResult")&&e[0].hasResult?(s.Logger.write("["+e[0].requestId+"] ("+(new Date).getTime()+") Skipping request pipeline method "+r+", existing result in pipeline.",0),Promise.resolve(e[0])):(s.Logger.write("["+e[0].requestId+"] ("+(new Date).getTime()+") Calling request pipeline method "+r+".",0),o.apply(n,e).then(function(e){return d(e)}))}}}var v=function(){function e(){}return e.logStart=function(t){return new Promise(function(e){s.Logger.log({data:1===s.Logger.activeLogLevel?{}:t,level:1,message:"["+t.requestId+"] ("+(new Date).getTime()+") Beginning "+t.verb+" request ("+t.requestAbsoluteUrl+")"}),e(t)})},e.caching=function(r){return new Promise(function(t){if("GET"===r.verb&&r.isCached){s.Logger.write("["+r.requestId+"] ("+(new Date).getTime()+") Caching is enabled for request, checking cache...",1);var e=new o(r.requestAbsoluteUrl.toLowerCase());if(void 0!==r.cachingOptions&&(e=u.extend(e,r.cachingOptions)),null!==e.store){var n=e.store.get(e.key);if(null!==n)return s.Logger.log({data:1===s.Logger.activeLogLevel?{}:n,level:1,message:"["+r.requestId+"] ("+(new Date).getTime()+") Value returned from cache."}),u.isFunc(r.batchDependency)&&r.batchDependency(),r.parser.hasOwnProperty("hydrate")&&(n=r.parser.hydrate(n)),f(r,n).then(function(e){return t(e)})}s.Logger.write("["+r.requestId+"] ("+(new Date).getTime()+") Value not found in cache.",1),r.parser=new i(r.parser,e)}return t(r)})},e.send=function(i){return new Promise(function(t,n){if(i.isBatched){var e=i.batch.add(i.requestAbsoluteUrl,i.verb,i.options,i.parser);u.isFunc(i.batchDependency)&&i.batchDependency(),s.Logger.write("["+i.requestId+"] ("+(new Date).getTime()+") Batching request in batch "+i.batch.batchId+".",1),t(f(i,e))}else{s.Logger.write("["+i.requestId+"] ("+(new Date).getTime()+") Sending request.",1);var r=i.clientFactory(),o=u.extend(i.options||{},{method:i.verb});r.fetch(i.requestAbsoluteUrl,o).then(function(e){return i.parser.parse(e)}).then(function(e){return f(i,e)}).then(function(e){return t(e)}).catch(function(e){return n(e)})}})},e.logEnd=function(t){return new Promise(function(e){t.isBatched?s.Logger.log({data:1===s.Logger.activeLogLevel?{}:t,level:1,message:"["+t.requestId+"] ("+(new Date).getTime()+") "+t.verb+" request will complete in batch "+t.batch.batchId+"."}):s.Logger.log({data:1===s.Logger.activeLogLevel?{}:t,level:1,message:"["+t.requestId+"] ("+(new Date).getTime()+") Completing "+t.verb+" request."}),e(t)})},r.__decorate([y(!0)],e,"logStart",null),r.__decorate([y()],e,"caching",null),r.__decorate([y()],e,"send",null),r.__decorate([y(!0)],e,"logEnd",null),e}();function m(){return[v.logStart,v.caching,v.send,v.logEnd].slice(0)}var b=function(n){function e(e){void 0===e&&(e="This query is already part of a batch.");var t=n.call(this,e)||this;return t.name="AlreadyInBatchException",s.Logger.error(t),t}return r.__extends(e,n),e}(Error),_=function(){function e(){this._query=new u.Dictionary,this._options={},this._url="",this._parentUrl="",this._useCaching=!1,this._cachingOptions=null}return e.prototype.toUrl=function(){return this._url},e.prototype.concat=function(e){return this._url+=e,this},Object.defineProperty(e.prototype,"query",{get:function(){return this._query},enumerable:!0,configurable:!0}),e.prototype.configure=function(e){return u.mergeOptions(this._options,e),this},e.prototype.configureFrom=function(e){return u.mergeOptions(this._options,e._options),this},e.prototype.usingCaching=function(e){return u.RuntimeConfig.globalCacheDisable||(this._useCaching=!0,void 0!==e&&(this._cachingOptions=e)),this},e.prototype.get=function(e,t){return void 0===e&&(e=new l),void 0===t&&(t={}),this.getCore(e,t)},e.prototype.getCore=function(e,t){return void 0===e&&(e=new l),void 0===t&&(t={}),this.toRequestContext("GET",t,e,m()).then(function(e){return g(e)})},e.prototype.postCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new l),this.toRequestContext("POST",e,t,m()).then(function(e){return g(e)})},e.prototype.patchCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new l),this.toRequestContext("PATCH",e,t,m()).then(function(e){return g(e)})},e.prototype.deleteCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new l),this.toRequestContext("DELETE",e,t,m()).then(function(e){return g(e)})},e.prototype.putCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new l),this.toRequestContext("PUT",e,t,m()).then(function(e){return g(e)})},e.prototype.append=function(e){this._url=u.combinePaths(this._url,e)},Object.defineProperty(e.prototype,"parentUrl",{get:function(){return this._parentUrl},enumerable:!0,configurable:!0}),e.prototype.extend=function(e,t){this._parentUrl=e._url,this._url=u.combinePaths(this._parentUrl,t),this.configureFrom(e)},e}(),w=function(t){function e(){var e=t.call(this)||this;return e._batch=null,e}return r.__extends(e,t),e.prototype.inBatch=function(e){if(null!==this.batch)throw new b;return this._batch=e,this},e.prototype.toUrl=function(){return this._url},e.prototype.get=function(e,t){return void 0===e&&(e=new n),void 0===t&&(t={}),this.getCore(e,t)},e.prototype.getCore=function(e,t){return void 0===e&&(e=new n),void 0===t&&(t={}),this.toRequestContext("GET",t,e,m()).then(function(e){return g(e)})},e.prototype.postCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new n),this.toRequestContext("POST",e,t,m()).then(function(e){return g(e)})},e.prototype.patchCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new n),this.toRequestContext("PATCH",e,t,m()).then(function(e){return g(e)})},e.prototype.deleteCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new n),this.toRequestContext("DELETE",e,t,m()).then(function(e){return g(e)})},e.prototype.putCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new n),this.toRequestContext("PUT",e,t,m()).then(function(e){return g(e)})},e.prototype.addBatchDependency=function(){return null!==this._batch?this._batch.addDependency():function(){return null}},Object.defineProperty(e.prototype,"hasBatch",{get:function(){return u.objectDefinedNotNull(this._batch)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"batch",{get:function(){return this.hasBatch?this._batch:null},enumerable:!0,configurable:!0}),e}(_),q=function(){function e(e){void 0===e&&(e=u.getGUID()),this._batchId=e,this._requests=[],this._dependencies=[]}return Object.defineProperty(e.prototype,"batchId",{get:function(){return this._batchId},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"requests",{get:function(){return this._requests},enumerable:!0,configurable:!0}),e.prototype.add=function(e,t,n,r){var o={method:t.toUpperCase(),options:n,parser:r,reject:null,resolve:null,url:e},i=new Promise(function(e,t){o.resolve=e,o.reject=t});return this._requests.push(o),i},e.prototype.addDependency=function(){var t=function(){},e=new Promise(function(e){t=e});return this._dependencies.push(e),t},e.prototype.execute=function(){var e=this;return Promise.all(this._dependencies).then(function(){return Promise.all(e._dependencies)}).then(function(){return e.executeImpl()})},e}();e.CachingOptions=o,e.CachingParserWrapper=i,e.ProcessHttpClientResponseException=a,e.ODataParserBase=t,e.ODataDefaultParser=n,e.TextParser=c,e.BlobParser=p,e.JSONParser=l,e.BufferParser=h,e.setResult=f,e.pipe=g,e.requestPipelineMethod=y,e.PipelineMethods=v,e.getDefaultPipeline=m,e.AlreadyInBatchException=b,e.Queryable=_,e.ODataQueryable=w,e.ODataBatch=q,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@pnp/common"),require("tslib"),require("@pnp/logging")):"function"==typeof define&&define.amd?define(["exports","@pnp/common","tslib","@pnp/logging"],t):t((e.pnp=e.pnp||{},e.pnp.odata={}),e.pnp.common,null,e.pnp.logging)}(this,function(e,u,r,s){"use strict";var o=function(){function e(e){this.key=e,this.expiration=u.dateAdd(new Date,"second",u.RuntimeConfig.defaultCachingTimeoutSeconds),this.storeName=u.RuntimeConfig.defaultCachingStore}return Object.defineProperty(e.prototype,"store",{get:function(){return"local"===this.storeName?e.storage.local:e.storage.session},enumerable:!0,configurable:!0}),e.storage=new u.PnPClientStorage,e}(),i=function(){function e(e,t){this.parser=e,this.cacheOptions=t}return e.prototype.parse=function(e){var t=this;return this.parser.parse(e).then(function(e){return t.cacheData(e)})},e.prototype.cacheData=function(e){return null!==this.cacheOptions.store&&this.cacheOptions.store.put(this.cacheOptions.key,e,this.cacheOptions.expiration),e},e}(),a=function(o){function e(e,t,n){var r=o.call(this,"Error making HttpClient request in queryable: ["+e+"] "+t)||this;return r.status=e,r.statusText=t,r.data=n,r.name="ProcessHttpClientResponseException",s.Logger.log({data:r.data,level:3,message:r.message}),r}return r.__extends(e,o),e}(Error),t=function(){function e(){}return e.prototype.parse=function(n){var r=this;return new Promise(function(e,t){r.handleError(n,t)&&r.parseImpl(n,e,t)})},e.prototype.parseImpl=function(e,t,n){var r=this;e.headers.has("Content-Length")&&0===parseFloat(e.headers.get("Content-Length"))||204===e.status?t({}):e.text().then(function(e){return 0<e.replace(/\s/gi,"").length?JSON.parse(e):{}}).then(function(e){return t(r.parseODataJSON(e))}).catch(function(e){return n(e)})},e.prototype.handleError=function(n,r){return n.ok||n.json().then(function(e){var t={responseBody:e,responseHeaders:n.headers};r(new a(n.status,n.statusText,t))}).catch(function(e){s.Logger.log({data:e,level:2,message:"There was an error parsing the error response body. See data for details."});var t={responseBody:"[[body not available]]",responseHeaders:n.headers};r(new a(n.status,n.statusText,t))}),n.ok},e.prototype.parseODataJSON=function(e){var t=e;return e.hasOwnProperty("d")?t=e.d.hasOwnProperty("results")?e.d.results:e.d:e.hasOwnProperty("value")&&(t=e.value),t},e}(),n=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t}(t),c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.parseImpl=function(e,t){e.text().then(t)},t}(t),p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.parseImpl=function(e,t){e.blob().then(t)},t}(t),h=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.parseImpl=function(e,t){e.json().then(t)},t}(t),l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.__extends(t,e),t.prototype.parseImpl=function(e,t){u.isFunc(e.arrayBuffer)?e.arrayBuffer().then(t):e.buffer().then(t)},t}(t),f=function(){function e(e){this.parser=e}return e.prototype.parse=function(e){return this.parser(e)},e}();function d(t,n){return new Promise(function(e){t.result=n,t.hasResult=!0,e(t)})}function g(e){return 0<e.pipeline.length?e.pipeline.shift()(e):Promise.resolve(e)}function y(e){e.pipeline.length<1&&s.Logger.write("["+e.requestId+"] ("+(new Date).getTime()+") Request pipeline contains no methods!",2);var t=g(e).then(function(e){return t=e,s.Logger.log({data:0===s.Logger.activeLogLevel?t.result:{},level:1,message:"["+t.requestId+"] ("+(new Date).getTime()+") Returning result from pipeline. Set logging to verbose to see data."}),Promise.resolve(t.result||null);var t}).catch(function(e){throw s.Logger.error(e),e});return e.isBatched&&e.batch.addResolveBatchDependency(t),t}function v(i){return void 0===i&&(i=!1),function(n,r,e){var o=e.value;e.value=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return!i&&0<e.length&&e[0].hasOwnProperty("hasResult")&&e[0].hasResult?(s.Logger.write("["+e[0].requestId+"] ("+(new Date).getTime()+") Skipping request pipeline method "+r+", existing result in pipeline.",0),Promise.resolve(e[0])):(s.Logger.write("["+e[0].requestId+"] ("+(new Date).getTime()+") Calling request pipeline method "+r+".",0),o.apply(n,e).then(function(e){return g(e)}))}}}var m=function(){function e(){}return e.logStart=function(t){return new Promise(function(e){s.Logger.log({data:1===s.Logger.activeLogLevel?{}:t,level:1,message:"["+t.requestId+"] ("+(new Date).getTime()+") Beginning "+t.verb+" request ("+t.requestAbsoluteUrl+")"}),e(t)})},e.caching=function(r){return new Promise(function(t){if(r.isCached){s.Logger.write("["+r.requestId+"] ("+(new Date).getTime()+") Caching is enabled for request, checking cache...",1);var e=new o(r.requestAbsoluteUrl.toLowerCase());if(void 0!==r.cachingOptions&&(e=u.extend(e,r.cachingOptions)),null!==e.store){var n=e.store.get(e.key);if(null!==n)return s.Logger.log({data:1===s.Logger.activeLogLevel?{}:n,level:1,message:"["+r.requestId+"] ("+(new Date).getTime()+") Value returned from cache."}),u.isFunc(r.batchDependency)&&r.batchDependency(),r.parser.hasOwnProperty("hydrate")&&(n=r.parser.hydrate(n)),d(r,n).then(function(e){return t(e)})}s.Logger.write("["+r.requestId+"] ("+(new Date).getTime()+") Value not found in cache.",1),r.parser=new i(r.parser,e)}return t(r)})},e.send=function(i){return new Promise(function(t,n){if(i.isBatched){var e=i.batch.add(i.requestAbsoluteUrl,i.verb,i.options,i.parser,i.requestId);u.isFunc(i.batchDependency)&&i.batchDependency(),s.Logger.write("["+i.requestId+"] ("+(new Date).getTime()+") Batching request in batch "+i.batch.batchId+".",1),t(d(i,e))}else{s.Logger.write("["+i.requestId+"] ("+(new Date).getTime()+") Sending request.",1);var r=i.clientFactory(),o=u.extend(i.options||{},{method:i.verb});r.fetch(i.requestAbsoluteUrl,o).then(function(e){return i.parser.parse(e)}).then(function(e){return d(i,e)}).then(function(e){return t(e)}).catch(function(e){return n(e)})}})},e.logEnd=function(t){return new Promise(function(e){t.isBatched?s.Logger.log({data:1===s.Logger.activeLogLevel?{}:t,level:1,message:"["+t.requestId+"] ("+(new Date).getTime()+") "+t.verb+" request will complete in batch "+t.batch.batchId+"."}):s.Logger.log({data:1===s.Logger.activeLogLevel?{}:t,level:1,message:"["+t.requestId+"] ("+(new Date).getTime()+") Completing "+t.verb+" request."}),e(t)})},r.__decorate([v(!0)],e,"logStart",null),r.__decorate([v()],e,"caching",null),r.__decorate([v()],e,"send",null),r.__decorate([v(!0)],e,"logEnd",null),e}();function b(){return[m.logStart,m.caching,m.send,m.logEnd].slice(0)}var _=function(n){function e(e){void 0===e&&(e="This query is already part of a batch.");var t=n.call(this,e)||this;return t.name="AlreadyInBatchException",s.Logger.error(t),t}return r.__extends(e,n),e}(Error),w=function(){function e(){this._query=new u.Dictionary,this._options={},this._url="",this._parentUrl="",this._useCaching=!1,this._cachingOptions=null}return e.prototype.toUrl=function(){return this._url},e.prototype.concat=function(e){return this._url+=e,this},Object.defineProperty(e.prototype,"query",{get:function(){return this._query},enumerable:!0,configurable:!0}),e.prototype.configure=function(e){return u.mergeOptions(this._options,e),this},e.prototype.configureFrom=function(e){return u.mergeOptions(this._options,e._options),this},e.prototype.usingCaching=function(e){return u.RuntimeConfig.globalCacheDisable||(this._useCaching=!0,void 0!==e&&(this._cachingOptions=e)),this},e.prototype.getCore=function(e,t){return void 0===e&&(e=new h),void 0===t&&(t={}),this.toRequestContext("GET",t,e,b()).then(function(e){return y(e)})},e.prototype.postCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new h),this.toRequestContext("POST",e,t,b()).then(function(e){return y(e)})},e.prototype.patchCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new h),this.toRequestContext("PATCH",e,t,b()).then(function(e){return y(e)})},e.prototype.deleteCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new h),this.toRequestContext("DELETE",e,t,b()).then(function(e){return y(e)})},e.prototype.putCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new h),this.toRequestContext("PUT",e,t,b()).then(function(e){return y(e)})},e.prototype.append=function(e){this._url=u.combinePaths(this._url,e)},Object.defineProperty(e.prototype,"parentUrl",{get:function(){return this._parentUrl},enumerable:!0,configurable:!0}),e.prototype.extend=function(e,t){this._parentUrl=e._url,this._url=u.combinePaths(this._parentUrl,t),this.configureFrom(e)},e}(),q=function(t){function e(){var e=t.call(this)||this;return e._batch=null,e}return r.__extends(e,t),e.prototype.inBatch=function(e){if(null!==this.batch)throw new _;return this._batch=e,this},e.prototype.toUrl=function(){return this._url},e.prototype.get=function(e,t){return void 0===e&&(e=new n),void 0===t&&(t={}),this.getCore(e,t)},e.prototype.getCore=function(e,t){return void 0===e&&(e=new n),void 0===t&&(t={}),this.toRequestContext("GET",t,e,b()).then(function(e){return y(e)})},e.prototype.postCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new n),this.toRequestContext("POST",e,t,b()).then(function(e){return y(e)})},e.prototype.patchCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new n),this.toRequestContext("PATCH",e,t,b()).then(function(e){return y(e)})},e.prototype.deleteCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new n),this.toRequestContext("DELETE",e,t,b()).then(function(e){return y(e)})},e.prototype.putCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new n),this.toRequestContext("PUT",e,t,b()).then(function(e){return y(e)})},e.prototype.addBatchDependency=function(){return null!==this._batch?this._batch.addDependency():function(){return null}},Object.defineProperty(e.prototype,"hasBatch",{get:function(){return u.objectDefinedNotNull(this._batch)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"batch",{get:function(){return this.hasBatch?this._batch:null},enumerable:!0,configurable:!0}),e}(w),P=function(){function e(e){void 0===e&&(e=u.getGUID()),this._batchId=e,this._requests=[],this._dependencies=[],this._resolveBatchDependencies=[]}return Object.defineProperty(e.prototype,"batchId",{get:function(){return this._batchId},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"requests",{get:function(){return this._requests},enumerable:!0,configurable:!0}),e.prototype.add=function(e,t,n,r,o){var i={id:o,method:t.toUpperCase(),options:n,parser:r,reject:null,resolve:null,url:e},u=new Promise(function(e,t){i.resolve=e,i.reject=t});return this._requests.push(i),u},e.prototype.addDependency=function(){var t=function(){},e=new Promise(function(e){t=e});return this._dependencies.push(e),t},e.prototype.addResolveBatchDependency=function(e){this._resolveBatchDependencies.push(e)},e.prototype.execute=function(){var e=this;return Promise.all(this._dependencies).then(function(){return Promise.all(e._dependencies)}).then(function(){return e.executeImpl()}).then(function(){return Promise.all(e._resolveBatchDependencies)}).then(function(){})},e}();e.CachingOptions=o,e.CachingParserWrapper=i,e.ProcessHttpClientResponseException=a,e.ODataParserBase=t,e.ODataDefaultParser=n,e.TextParser=c,e.BlobParser=p,e.JSONParser=h,e.BufferParser=l,e.LambdaParser=f,e.setResult=d,e.pipe=y,e.requestPipelineMethod=v,e.PipelineMethods=m,e.getDefaultPipeline=b,e.AlreadyInBatchException=_,e.Queryable=w,e.ODataQueryable=q,e.ODataBatch=P,Object.defineProperty(e,"__esModule",{value:!0})}); |
/** | ||
@license | ||
* @pnp/odata v1.0.5 - pnp - provides shared odata functionality and base classes | ||
* @pnp/odata v1.1.0 - pnp - provides shared odata functionality and base classes | ||
* MIT (https://github.com/pnp/pnpjs/blob/master/LICENSE) | ||
@@ -31,15 +31,15 @@ * Copyright (c) 2018 Microsoft | ||
class CachingParserWrapper { | ||
constructor(_parser, _cacheOptions) { | ||
this._parser = _parser; | ||
this._cacheOptions = _cacheOptions; | ||
constructor(parser, cacheOptions) { | ||
this.parser = parser; | ||
this.cacheOptions = cacheOptions; | ||
} | ||
parse(response) { | ||
// add this to the cache based on the options | ||
return this._parser.parse(response).then(data => { | ||
if (this._cacheOptions.store !== null) { | ||
this._cacheOptions.store.put(this._cacheOptions.key, data, this._cacheOptions.expiration); | ||
} | ||
return data; | ||
}); | ||
return this.parser.parse(response).then(r => this.cacheData(r)); | ||
} | ||
cacheData(data) { | ||
if (this.cacheOptions.store !== null) { | ||
this.cacheOptions.store.put(this.cacheOptions.key, data, this.cacheOptions.expiration); | ||
} | ||
return data; | ||
} | ||
} | ||
@@ -159,5 +159,15 @@ | ||
} | ||
r.buffer().then(resolve); | ||
else { | ||
r.buffer().then(resolve); | ||
} | ||
} | ||
} | ||
class LambdaParser { | ||
constructor(parser) { | ||
this.parser = parser; | ||
} | ||
parse(r) { | ||
return this.parser(r); | ||
} | ||
} | ||
@@ -171,5 +181,5 @@ /** | ||
Logger.log({ | ||
data: context.result, | ||
level: 0 /* Verbose */, | ||
message: `[${context.requestId}] (${(new Date()).getTime()}) Returning result, see data property for value.`, | ||
data: Logger.activeLogLevel === 0 /* Verbose */ ? context.result : {}, | ||
level: 1 /* Info */, | ||
message: `[${context.requestId}] (${(new Date()).getTime()}) Returning result from pipeline. Set logging to verbose to see data.`, | ||
}); | ||
@@ -210,8 +220,11 @@ return Promise.resolve(context.result || null); | ||
} | ||
return next(context) | ||
.then(ctx => returnResult(ctx)) | ||
.catch((e) => { | ||
const promise = next(context).then(ctx => returnResult(ctx)).catch((e) => { | ||
Logger.error(e); | ||
throw e; | ||
}); | ||
if (context.isBatched) { | ||
// this will block the batch's execute method from returning until the child requets have been resolved | ||
context.batch.addResolveBatchDependency(promise); | ||
} | ||
return promise; | ||
} | ||
@@ -260,3 +273,3 @@ /** | ||
// handle caching, if applicable | ||
if (context.verb === "GET" && context.isCached) { | ||
if (context.isCached) { | ||
Logger.write(`[${context.requestId}] (${(new Date()).getTime()}) Caching is enabled for request, checking cache...`, 1 /* Info */); | ||
@@ -272,3 +285,3 @@ let cacheOptions = new CachingOptions(context.requestAbsoluteUrl.toLowerCase()); | ||
if (data !== null) { | ||
// ensure we clear any help batch dependency we are resolving from the cache | ||
// ensure we clear any held batch dependency we are resolving from the cache | ||
Logger.log({ | ||
@@ -305,3 +318,3 @@ data: Logger.activeLogLevel === 1 /* Info */ ? {} : data, | ||
// we are in a batch, so add to batch, remove dependency, and resolve with the batch's promise | ||
const p = context.batch.add(context.requestAbsoluteUrl, context.verb, context.options, context.parser); | ||
const p = context.batch.add(context.requestAbsoluteUrl, context.verb, context.options, context.parser, context.requestId); | ||
// we release the dependency here to ensure the batch does not execute until the request is added to the batch | ||
@@ -443,11 +456,2 @@ if (isFunc(context.batchDependency)) { | ||
} | ||
/** | ||
* Executes the currently built request | ||
* | ||
* @param parser Allows you to specify a parser to handle the result | ||
* @param getOptions The options used for this request | ||
*/ | ||
get(parser = new JSONParser(), options = {}) { | ||
return this.getCore(parser, options); | ||
} | ||
getCore(parser = new JSONParser(), options = {}) { | ||
@@ -484,3 +488,3 @@ return this.toRequestContext("GET", options, parser, getDefaultPipeline()).then(context => pipe(context)); | ||
/** | ||
* Extends this queryable from | ||
* Extends this queryable from the provided parent | ||
* | ||
@@ -580,2 +584,3 @@ * @param parent Parent queryable from which we will derive a base url | ||
this._dependencies = []; | ||
this._resolveBatchDependencies = []; | ||
} | ||
@@ -598,10 +603,11 @@ get batchId() { | ||
*/ | ||
add(url, method, options, parser) { | ||
add(url, method, options, parser, requestId) { | ||
const info = { | ||
id: requestId, | ||
method: method.toUpperCase(), | ||
options: options, | ||
parser: parser, | ||
options, | ||
parser, | ||
reject: null, | ||
resolve: null, | ||
url: url, | ||
url, | ||
}; | ||
@@ -628,2 +634,10 @@ const p = new Promise((resolve, reject) => { | ||
/** | ||
* The batch's execute method will not resolve util any promises added here resolve | ||
* | ||
* @param p The dependent promise | ||
*/ | ||
addResolveBatchDependency(p) { | ||
this._resolveBatchDependencies.push(p); | ||
} | ||
/** | ||
* Execute the current batch and resolve the associated promises | ||
@@ -636,7 +650,11 @@ * | ||
// We can get a second set of promises added during the first set resolving | ||
return Promise.all(this._dependencies).then(() => Promise.all(this._dependencies)).then(() => this.executeImpl()); | ||
return Promise.all(this._dependencies) | ||
.then(() => Promise.all(this._dependencies)) | ||
.then(() => this.executeImpl()) | ||
.then(() => Promise.all(this._resolveBatchDependencies)) | ||
.then(() => void (0)); | ||
} | ||
} | ||
export { CachingOptions, CachingParserWrapper, ProcessHttpClientResponseException, ODataParserBase, ODataDefaultParser, TextParser, BlobParser, JSONParser, BufferParser, setResult, pipe, requestPipelineMethod, PipelineMethods, getDefaultPipeline, AlreadyInBatchException, Queryable, ODataQueryable, ODataBatch }; | ||
export { CachingOptions, CachingParserWrapper, ProcessHttpClientResponseException, ODataParserBase, ODataDefaultParser, TextParser, BlobParser, JSONParser, BufferParser, LambdaParser, setResult, pipe, requestPipelineMethod, PipelineMethods, getDefaultPipeline, AlreadyInBatchException, Queryable, ODataQueryable, ODataBatch }; | ||
//# sourceMappingURL=odata.js.map |
{ | ||
"name": "@pnp/odata", | ||
"version": "1.0.5", | ||
"version": "1.1.0", | ||
"description": "pnp - provides shared odata functionality and base classes", | ||
@@ -8,7 +8,7 @@ "main": "./dist/odata.es5.umd.js", | ||
"dependencies": { | ||
"tslib": "1.9.0" | ||
"tslib": "1.9.1" | ||
}, | ||
"peerDependencies": { | ||
"@pnp/logging": "1.0.5", | ||
"@pnp/common": "1.0.5" | ||
"@pnp/logging": "1.1.0", | ||
"@pnp/common": "1.1.0" | ||
}, | ||
@@ -15,0 +15,0 @@ "author": { |
@@ -17,6 +17,7 @@ import { ODataParser } from "./parsers"; | ||
export declare class CachingParserWrapper<T> implements ODataParser<T> { | ||
private _parser; | ||
private _cacheOptions; | ||
constructor(_parser: ODataParser<T>, _cacheOptions: CachingOptions); | ||
parser: ODataParser<T>; | ||
cacheOptions: CachingOptions; | ||
constructor(parser: ODataParser<T>, cacheOptions: CachingOptions); | ||
parse(response: Response): Promise<T>; | ||
protected cacheData(data: any): any; | ||
} |
@@ -0,3 +1,3 @@ | ||
import { FetchOptions } from "@pnp/common"; | ||
import { ODataParser } from "./parsers"; | ||
import { FetchOptions } from "@pnp/common"; | ||
export interface ODataBatchRequestInfo { | ||
@@ -10,2 +10,3 @@ url: string; | ||
reject: ((error: any) => void) | null; | ||
id: string; | ||
} | ||
@@ -16,2 +17,3 @@ export declare abstract class ODataBatch { | ||
protected _requests: ODataBatchRequestInfo[]; | ||
protected _resolveBatchDependencies: Promise<void>[]; | ||
constructor(_batchId?: string); | ||
@@ -30,3 +32,3 @@ readonly batchId: string; | ||
*/ | ||
add<T>(url: string, method: string, options: FetchOptions, parser: ODataParser<T>): Promise<T>; | ||
add<T>(url: string, method: string, options: FetchOptions, parser: ODataParser<T>, requestId: string): Promise<T>; | ||
/** | ||
@@ -38,2 +40,8 @@ * Adds a dependency insuring that some set of actions will occur before a batch is processed. | ||
/** | ||
* The batch's execute method will not resolve util any promises added here resolve | ||
* | ||
* @param p The dependent promise | ||
*/ | ||
addResolveBatchDependency(p: Promise<any>): void; | ||
/** | ||
* Execute the current batch and resolve the associated promises | ||
@@ -40,0 +48,0 @@ * |
@@ -47,1 +47,6 @@ /** | ||
} | ||
export declare class LambdaParser<T = any> implements ODataParser<T> { | ||
private parser; | ||
constructor(parser: (r: Response) => Promise<T>); | ||
parse(r: Response): Promise<T>; | ||
} |
@@ -0,5 +1,5 @@ | ||
import { FetchOptions, RequestClient } from "@pnp/common"; | ||
import { ICachingOptions } from "./caching"; | ||
import { ODataBatch } from "./odatabatch"; | ||
import { ODataParser } from "./parsers"; | ||
import { ODataBatch } from "./odatabatch"; | ||
import { ICachingOptions } from "./caching"; | ||
import { FetchOptions, RequestClient } from "@pnp/common"; | ||
/** | ||
@@ -6,0 +6,0 @@ * Defines the context for a given request to be processed in the pipeline |
@@ -74,9 +74,2 @@ import { Dictionary, FetchOptions, ConfigOptions } from "@pnp/common"; | ||
usingCaching(options?: ICachingOptions): this; | ||
/** | ||
* Executes the currently built request | ||
* | ||
* @param parser Allows you to specify a parser to handle the result | ||
* @param getOptions The options used for this request | ||
*/ | ||
get<T = GetType>(parser?: ODataParser<T>, options?: FetchOptions): Promise<T>; | ||
protected getCore<T = GetType>(parser?: ODataParser<T>, options?: FetchOptions): Promise<T>; | ||
@@ -99,3 +92,3 @@ protected postCore<T = any>(options?: FetchOptions, parser?: ODataParser<T>): Promise<T>; | ||
/** | ||
* Extends this queryable from | ||
* Extends this queryable from the provided parent | ||
* | ||
@@ -102,0 +95,0 @@ * @param parent Parent queryable from which we will derive a base url |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6890
1180795
+ Added@pnp/common@1.1.0(transitive)
+ Added@pnp/logging@1.1.0(transitive)
+ Added@types/adal-angular@1.0.1(transitive)
+ Addedtslib@1.9.1(transitive)
- Removed@pnp/common@1.0.5(transitive)
- Removed@pnp/logging@1.0.5(transitive)
- Removed@types/adal-angular@1.0.0(transitive)
- Removedtslib@1.9.0(transitive)
Updatedtslib@1.9.1