Socket
Socket
Sign inDemoInstall

@pnp/odata

Package Overview
Dependencies
Maintainers
6
Versions
154
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pnp/odata - npm Package Compare versions

Comparing version 1.0.0-beta.7 to 1.0.0-beta.10

25

dist/odata.es5.js

@@ -0,1 +1,10 @@

/**
@license
* @pnp/odata v1.0.0-beta.10 - pnp - provides shared odata functionality and base classes
* MIT (https://github.com/pnp/pnp/blob/master/LICENSE)
* Copyright (c) 2018 Microsoft
* docs: http://officedev.github.io/PnP-JS-Core
* source: https://github.com/pnp/pnp
* bugs: https://github.com/pnp/pnp/issues
*/
import { Dictionary, PnPClientStorage, RuntimeConfig, Util, mergeOptions } from '@pnp/common';

@@ -206,5 +215,4 @@ import { __decorate, __extends } from 'tslib';

function next(c) {
var _next = c.pipeline.shift();
if (typeof _next !== "undefined") {
return _next(c);
if (c.pipeline.length > 0) {
return c.pipeline.shift()(c);
}

@@ -221,10 +229,9 @@ else {

function pipe(context) {
if (context.pipeline.length < 1) {
Logger.write("[" + context.requestId + "] (" + (new Date()).getTime() + ") Request pipeline contains no methods!", 2 /* Warning */);
}
return next(context)
.then(function (ctx) { return returnResult(ctx); })
.catch(function (e) {
Logger.log({
data: e,
level: 3 /* Error */,
message: "Error in request pipeline: " + e.message,
});
Logger.error(e);
throw e;

@@ -394,3 +401,3 @@ });

_this.name = "AlreadyInBatchException";
Logger.log({ data: {}, level: 3 /* Error */, message: "[" + _this.name + "]::" + _this.message });
Logger.error(_this);
return _this;

@@ -397,0 +404,0 @@ }

@@ -0,1 +1,10 @@

/**
@license
* @pnp/odata v1.0.0-beta.10 - pnp - provides shared odata functionality and base classes
* MIT (https://github.com/pnp/pnp/blob/master/LICENSE)
* Copyright (c) 2018 Microsoft
* docs: http://officedev.github.io/PnP-JS-Core
* source: https://github.com/pnp/pnp
* bugs: https://github.com/pnp/pnp/issues
*/
!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()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.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=7)}([function(e,t,n){"use strict";(function(e){function r(e,t){if(void 0!==t&&null!==t){new Request("",{headers:t}).headers.forEach(function(t,n){e.append(n,t)})}}function o(e,t){if(f.objectDefinedNotNull(t)){var n=f.extend(e.headers||{},t.headers);e=f.extend(e,t),e.headers=n}}n.d(t,"d",function(){return f}),n.d(t,"a",function(){return a}),n.d(t,"c",function(){return l}),n.d(t,"e",function(){return o}),n.d(t,"b",function(){return g});var i=n(2),u=n(1),a=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 o in r)r.hasOwnProperty(o)&&this.add(o,r[o])}},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}(),c=(function(e){function t(t){var n=e.call(this,t)||this;return n.name="UrlException",i.a.log({data:{},level:3,message:"["+n.name+"]::"+n.message}),n}Object(u.b)(t,e)}(Error),function(){function e(){this._v=new a,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}()),s=new c,l=s,f=function(){function e(){}return e.getCtxCallback=function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return function(){t.apply(e,n)}},e.dateAdd=function(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},e.combinePaths=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return t.filter(function(t){return!e.stringIsNullOrEmpty(t)}).map(function(e){return e.replace(/^[\\|\/]/,"").replace(/[\\|\/]$/,"")}).join("/").replace(/\\/g,"/")},e.getRandomString=function(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("")},e.getGUID=function(){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)})},e.isFunc=function(e){return"function"==typeof e},e.objectDefinedNotNull=function(e){return void 0!==e&&null!==e},e.isArray=function(e){return Array.isArray?Array.isArray(e):e&&"number"==typeof e.length&&e.constructor===Array},e.extend=function(t,n,r){if(void 0===r&&(r=!1),!e.objectDefinedNotNull(n))return t;var o=r?function(e,t){return!(t in e)}:function(){return!0};return Object.getOwnPropertyNames(n).filter(function(e){return o(t,e)}).reduce(function(e,t){return e[t]=n[t],e},t)},e.isUrlAbsolute=function(e){return/^https?:\/\/|^\/\//i.test(e)},e.stringIsNullOrEmpty=function(e){return void 0===e||null===e||e.length<1},e}(),p=function(){function t(){}return t.prototype.fetch=function(t,n){return e.fetch(t,n)},t}(),d=(function(e){function t(t){var n=e.call(this)||this;return n._token=t,n}Object(u.b)(t,e),t.prototype.fetch=function(t,n){void 0===n&&(n={});var o=new Headers;return r(o,n.headers),o.set("Authorization","Bearer "+this._token),n.headers=o,e.prototype.fetch.call(this,t,n)}}(p),function(){function e(e,t){void 0===t&&(t=-1),this.store=e,this.defaultTimeoutMinutes=t,this.enabled=this.test(),l.enableCacheExpiration&&(i.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?(i.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(o){var i=r.get(e);null==i?t().then(function(t){r.put(e,t,n),o(t)}):o(i)}):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 o=e.store.key(r);null!==o&&/["|']?pnp["|']? ?: ?1/i.test(e.store.getItem(o))&&e.get(o)}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=l.defaultCachingTimeoutSeconds;this.defaultTimeoutMinutes>0&&(n=60*this.defaultTimeoutMinutes),t=f.dateAdd(new Date,"second",n)}return JSON.stringify({pnp:1,expiration:t,value:e})},e.prototype.cacheExpirationHandler=function(){var e=this;i.a.write("Called cache expiration handler.",0),this.deleteExpired().then(function(t){setTimeout(f.getCtxCallback(e,e.cacheExpirationHandler),l.cacheExpirationIntervalMilliseconds)}).catch(function(e){i.a.log({data:e,level:3,message:"Error deleting expired cache entries, see data for details. Timeout not reset."})})},e}()),h=function(){function e(e){void 0===e&&(e=new a),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}(),g=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 d("undefined"!=typeof localStorage?localStorage:new h)),this._local},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"session",{get:function(){return null===this._session&&(this._session=new d("undefined"!=typeof sessionStorage?sessionStorage:new h)),this._session},enumerable:!0,configurable:!0}),e}()}).call(t,n(9))},function(e,t,n){"use strict";function r(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function o(e,t,n,r){var o,i=arguments.length,u=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)u=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(u=(i<3?o(u):i>3?o(t,n,u):o(t,n))||u);return i>3&&u&&Object.defineProperty(t,n,u),u}t.b=r,t.a=o;/*! *****************************************************************************

@@ -15,3 +24,12 @@ Copyright (c) Microsoft Corporation. All rights reserved.

***************************************************************************** */
var i=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});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 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=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}(),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=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 o}),n.d(t,"b",function(){return i});var r=n(0),o=function(){function e(e){this.key=e,this.expiration=r.d.dateAdd(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}(),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}()},function(e,t,n){"use strict";n.d(t,"b",function(){return i}),n.d(t,"a",function(){return u});var r=n(1),o=n(2),i=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),u=function(){function e(){}return e.prototype.parse=function(e){var t=this;return new Promise(function(n,r){t.handleError(e,r)&&e.text().then(function(e){return e.replace(/\s/gi,"").length>0?JSON.parse(e):{}}).then(function(e){return n(t.parseODataJSON(e))}).catch(function(e){return r(e)})})},e.prototype.handleError=function(e,t){return e.ok||e.json().then(function(n){var r={responseBody:n,responseHeaders:e.headers};t(new i(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 i(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}()},function(e,t,n){"use strict";n.d(t,"d",function(){return u}),n.d(t,"e",function(){return a}),n.d(t,"a",function(){return c}),n.d(t,"c",function(){return s}),n.d(t,"b",function(){return l});var r=n(1),o=n(4),i=n(0),u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.b(t,e),t}(o.a),a=function(){function e(){}return e.prototype.parse=function(e){return e.text()},e}(),c=function(){function e(){}return e.prototype.parse=function(e){return e.blob()},e}(),s=function(){function e(){}return e.prototype.parse=function(e){return e.json()},e}(),l=function(){function e(){}return e.prototype.parse=function(e){return i.d.isFunc(e.arrayBuffer)?e.arrayBuffer():e.buffer()},e}()},function(e,t,n){"use strict";function r(e){return f.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 o(e,t){return new Promise(function(n){e.result=t,e.hasResult=!0,n(e)})}function i(e){var t=e.pipeline.shift();return void 0!==t?t(e):Promise.resolve(e)}function u(e){return i(e).then(function(e){return r(e)}).catch(function(e){throw f.a.log({data:e,level:3,message:"Error in request pipeline: "+e.message}),e})}function a(e){return void 0===e&&(e=!1),function(t,n,r){var o=r.value;r.value=function(){for(var r=[],u=0;u<arguments.length;u++)r[u]=arguments[u];return!e&&r.length>0&&r[0].hasOwnProperty("hasResult")&&r[0].hasResult?(f.a.write("["+r[0].requestId+"] ("+(new Date).getTime()+") Skipping request pipeline method "+n+", existing result in pipeline.",0),Promise.resolve(r[0])):(f.a.write("["+r[0].requestId+"] ("+(new Date).getTime()+") Calling request pipeline method "+n+".",0),o.apply(t,r).then(function(e){return i(e)}))}}}function c(){return[d.logStart,d.caching,d.send,d.logEnd].slice(0)}t.e=o,t.c=u,t.d=a,n.d(t,"a",function(){return d}),t.b=c;var s=n(1),l=n(3),f=n(2),p=n(0),d=function(){function e(){}return e.logStart=function(e){return new Promise(function(t){f.a.log({data:1===f.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){f.a.write("["+e.requestId+"] ("+(new Date).getTime()+") Caching is enabled for request, checking cache...",1);var n=new l.a(e.requestAbsoluteUrl.toLowerCase());if(void 0!==e.cachingOptions&&(n=p.d.extend(n,e.cachingOptions)),null!==n.store){var r=n.store.get(n.key);if(null!==r)return f.a.log({data:1===f.a.activeLogLevel?{}:r,level:1,message:"["+e.requestId+"] ("+(new Date).getTime()+") Value returned from cache."}),e.batchDependency(),e.parser.hasOwnProperty("hydrate")&&(r=e.parser.hydrate(r)),o(e,r).then(function(e){return t(e)})}f.a.write("["+e.requestId+"] ("+(new Date).getTime()+") Value not found in cache.",1),e.parser=new l.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.batchDependency(),f.a.write("["+e.requestId+"] ("+(new Date).getTime()+") Batching request in batch "+e.batch.batchId+".",1),t(o(e,r))}else{f.a.write("["+e.requestId+"] ("+(new Date).getTime()+") Sending request.",1);var i=e.clientFactory(),u=p.d.extend(e.options||{},{method:e.verb});i.fetch(e.requestAbsoluteUrl,u).then(function(t){return e.parser.parse(t)}).then(function(t){return o(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?f.a.log({data:1===f.a.activeLogLevel?{}:e,level:1,message:"["+e.requestId+"] ("+(new Date).getTime()+") "+e.verb+" request will complete in batch "+e.batch.batchId+"."}):f.a.log({data:1===f.a.activeLogLevel?{}:e,level:1,message:"["+e.requestId+"] ("+(new Date).getTime()+") Completing "+e.verb+" request."}),t(e)})},s.a([a(!0)],e,"logStart",null),s.a([a()],e,"caching",null),s.a([a()],e,"send",null),s.a([a(!0)],e,"logEnd",null),e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(8);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.m}),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.q}),n.d(t,"pipe",function(){return r.o}),n.d(t,"requestPipelineMethod",function(){return r.p}),n.d(t,"PipelineMethods",function(){return r.k}),n.d(t,"getDefaultPipeline",function(){return r.n}),n.d(t,"AlreadyInBatchException",function(){return r.a}),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 o=n(4);n.d(t,"i",function(){return o.a}),n.d(t,"l",function(){return o.b});var i=n(5);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,"m",function(){return i.e});var u=n(6);n.d(t,"k",function(){return u.a}),n.d(t,"n",function(){return u.b}),n.d(t,"o",function(){return u.c}),n.d(t,"p",function(){return u.d}),n.d(t,"q",function(){return u.e});var a=n(10);n.d(t,"a",function(){return a.a}),n.d(t,"j",function(){return a.b});var c=n(11);n.d(t,"g",function(){return c.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,n){"use strict";n.d(t,"a",function(){return c}),n.d(t,"b",function(){return s});var r=n(1),o=n(0),i=n(2),u=n(5),a=n(6),c=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",i.a.log({data:{},level:3,message:"["+n.name+"]::"+n.message}),n}return r.b(t,e),t}(Error),s=function(){function e(){this._batch=null,this._query=new o.a,this._options={},this._url="",this._parentUrl="",this._useCaching=!1,this._cachingOptions=null}return 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(o.e)(this._options,e),this},e.prototype.usingCaching=function(e){return o.c.globalCacheDisable||(this._useCaching=!0,void 0!==e&&(this._cachingOptions=e)),this},e.prototype.inBatch=function(e){if(null!==this.batch)throw new c;return this._batch=e,this},e.prototype.toUrl=function(){return this._url},e.prototype.get=function(e,t){return void 0===e&&(e=new u.d),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 u.d),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 u.d),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 u.d),this.toRequestContext("DELETE",e,t,Object(a.b)()).then(function(e){return Object(a.c)(e)})},e.prototype.addBatchDependency=function(){return null!==this._batch?this._batch.addDependency():function(){return null}},Object.defineProperty(e.prototype,"hasBatch",{get:function(){return o.d.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.prototype.append=function(e){this._url=o.d.combinePaths(this._url,e)},Object.defineProperty(e.prototype,"parentUrl",{get:function(){return this._parentUrl},enumerable:!0,configurable:!0}),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return o});var r=n(0),o=function(){function e(e){void 0===e&&(e=r.d.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 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 i=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.0-beta.10 - pnp - light-weight, subscribable logging framework
* MIT (https://github.com/pnp/pnp/blob/master/LICENSE)
* Copyright (c) 2018 Microsoft
* docs: http://officedev.github.io/PnP-JS-Core
* source: https://github.com/pnp/pnp
* bugs: https://github.com/pnp/pnp/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 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=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.name+"]::"+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=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 o}),n.d(t,"b",function(){return i});var r=n(0),o=function(){function e(e){this.key=e,this.expiration=r.d.dateAdd(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}(),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}()},function(e,t,n){"use strict";n.d(t,"b",function(){return i}),n.d(t,"a",function(){return u});var r=n(1),o=n(2),i=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),u=function(){function e(){}return e.prototype.parse=function(e){var t=this;return new Promise(function(n,r){t.handleError(e,r)&&e.text().then(function(e){return e.replace(/\s/gi,"").length>0?JSON.parse(e):{}}).then(function(e){return n(t.parseODataJSON(e))}).catch(function(e){return r(e)})})},e.prototype.handleError=function(e,t){return e.ok||e.json().then(function(n){var r={responseBody:n,responseHeaders:e.headers};t(new i(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 i(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}()},function(e,t,n){"use strict";n.d(t,"d",function(){return u}),n.d(t,"e",function(){return a}),n.d(t,"a",function(){return c}),n.d(t,"c",function(){return s}),n.d(t,"b",function(){return l});var r=n(1),o=n(4),i=n(0),u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r.b(t,e),t}(o.a),a=function(){function e(){}return e.prototype.parse=function(e){return e.text()},e}(),c=function(){function e(){}return e.prototype.parse=function(e){return e.blob()},e}(),s=function(){function e(){}return e.prototype.parse=function(e){return e.json()},e}(),l=function(){function e(){}return e.prototype.parse=function(e){return i.d.isFunc(e.arrayBuffer)?e.arrayBuffer():e.buffer()},e}()},function(e,t,n){"use strict";function r(e){return f.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 o(e,t){return new Promise(function(n){e.result=t,e.hasResult=!0,n(e)})}function i(e){return e.pipeline.length>0?e.pipeline.shift()(e):Promise.resolve(e)}function u(e){return e.pipeline.length<1&&f.a.write("["+e.requestId+"] ("+(new Date).getTime()+") Request pipeline contains no methods!",2),i(e).then(function(e){return r(e)}).catch(function(e){throw f.a.error(e),e})}function a(e){return void 0===e&&(e=!1),function(t,n,r){var o=r.value;r.value=function(){for(var r=[],u=0;u<arguments.length;u++)r[u]=arguments[u];return!e&&r.length>0&&r[0].hasOwnProperty("hasResult")&&r[0].hasResult?(f.a.write("["+r[0].requestId+"] ("+(new Date).getTime()+") Skipping request pipeline method "+n+", existing result in pipeline.",0),Promise.resolve(r[0])):(f.a.write("["+r[0].requestId+"] ("+(new Date).getTime()+") Calling request pipeline method "+n+".",0),o.apply(t,r).then(function(e){return i(e)}))}}}function c(){return[d.logStart,d.caching,d.send,d.logEnd].slice(0)}t.e=o,t.c=u,t.d=a,n.d(t,"a",function(){return d}),t.b=c;var s=n(1),l=n(3),f=n(2),p=n(0),d=function(){function e(){}return e.logStart=function(e){return new Promise(function(t){f.a.log({data:1===f.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){f.a.write("["+e.requestId+"] ("+(new Date).getTime()+") Caching is enabled for request, checking cache...",1);var n=new l.a(e.requestAbsoluteUrl.toLowerCase());if(void 0!==e.cachingOptions&&(n=p.d.extend(n,e.cachingOptions)),null!==n.store){var r=n.store.get(n.key);if(null!==r)return f.a.log({data:1===f.a.activeLogLevel?{}:r,level:1,message:"["+e.requestId+"] ("+(new Date).getTime()+") Value returned from cache."}),e.batchDependency(),e.parser.hasOwnProperty("hydrate")&&(r=e.parser.hydrate(r)),o(e,r).then(function(e){return t(e)})}f.a.write("["+e.requestId+"] ("+(new Date).getTime()+") Value not found in cache.",1),e.parser=new l.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.batchDependency(),f.a.write("["+e.requestId+"] ("+(new Date).getTime()+") Batching request in batch "+e.batch.batchId+".",1),t(o(e,r))}else{f.a.write("["+e.requestId+"] ("+(new Date).getTime()+") Sending request.",1);var i=e.clientFactory(),u=p.d.extend(e.options||{},{method:e.verb});i.fetch(e.requestAbsoluteUrl,u).then(function(t){return e.parser.parse(t)}).then(function(t){return o(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?f.a.log({data:1===f.a.activeLogLevel?{}:e,level:1,message:"["+e.requestId+"] ("+(new Date).getTime()+") "+e.verb+" request will complete in batch "+e.batch.batchId+"."}):f.a.log({data:1===f.a.activeLogLevel?{}:e,level:1,message:"["+e.requestId+"] ("+(new Date).getTime()+") Completing "+e.verb+" request."}),t(e)})},s.a([a(!0)],e,"logStart",null),s.a([a()],e,"caching",null),s.a([a()],e,"send",null),s.a([a(!0)],e,"logEnd",null),e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(8);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.m}),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.q}),n.d(t,"pipe",function(){return r.o}),n.d(t,"requestPipelineMethod",function(){return r.p}),n.d(t,"PipelineMethods",function(){return r.k}),n.d(t,"getDefaultPipeline",function(){return r.n}),n.d(t,"AlreadyInBatchException",function(){return r.a}),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 o=n(4);n.d(t,"i",function(){return o.a}),n.d(t,"l",function(){return o.b});var i=n(5);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,"m",function(){return i.e});var u=n(6);n.d(t,"k",function(){return u.a}),n.d(t,"n",function(){return u.b}),n.d(t,"o",function(){return u.c}),n.d(t,"p",function(){return u.d}),n.d(t,"q",function(){return u.e});var a=n(10);n.d(t,"a",function(){return a.a}),n.d(t,"j",function(){return a.b});var c=n(11);n.d(t,"g",function(){return c.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,n){"use strict";n.d(t,"a",function(){return c}),n.d(t,"b",function(){return s});var r=n(1),o=n(0),i=n(2),u=n(5),a=n(6),c=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",i.a.error(n),n}return r.b(t,e),t}(Error),s=function(){function e(){this._batch=null,this._query=new o.a,this._options={},this._url="",this._parentUrl="",this._useCaching=!1,this._cachingOptions=null}return 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(o.e)(this._options,e),this},e.prototype.usingCaching=function(e){return o.c.globalCacheDisable||(this._useCaching=!0,void 0!==e&&(this._cachingOptions=e)),this},e.prototype.inBatch=function(e){if(null!==this.batch)throw new c;return this._batch=e,this},e.prototype.toUrl=function(){return this._url},e.prototype.get=function(e,t){return void 0===e&&(e=new u.d),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 u.d),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 u.d),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 u.d),this.toRequestContext("DELETE",e,t,Object(a.b)()).then(function(e){return Object(a.c)(e)})},e.prototype.addBatchDependency=function(){return null!==this._batch?this._batch.addDependency():function(){return null}},Object.defineProperty(e.prototype,"hasBatch",{get:function(){return o.d.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.prototype.append=function(e){this._url=o.d.combinePaths(this._url,e)},Object.defineProperty(e.prototype,"parentUrl",{get:function(){return this._parentUrl},enumerable:!0,configurable:!0}),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return o});var r=n(0),o=function(){function e(e){void 0===e&&(e=r.d.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 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}()}])});
//# sourceMappingURL=odata.es5.umd.bundle.min.js.map

@@ -0,1 +1,10 @@

/**
@license
* @pnp/odata v1.0.0-beta.10 - pnp - provides shared odata functionality and base classes
* MIT (https://github.com/pnp/pnp/blob/master/LICENSE)
* Copyright (c) 2018 Microsoft
* docs: http://officedev.github.io/PnP-JS-Core
* source: https://github.com/pnp/pnp
* bugs: https://github.com/pnp/pnp/issues
*/
(function (global, factory) {

@@ -208,5 +217,4 @@ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@pnp/common'), require('tslib'), require('@pnp/logging')) :

function next(c) {
var _next = c.pipeline.shift();
if (typeof _next !== "undefined") {
return _next(c);
if (c.pipeline.length > 0) {
return c.pipeline.shift()(c);
}

@@ -223,10 +231,9 @@ else {

function pipe(context) {
if (context.pipeline.length < 1) {
logging.Logger.write("[" + context.requestId + "] (" + (new Date()).getTime() + ") Request pipeline contains no methods!", 2 /* Warning */);
}
return next(context)
.then(function (ctx) { return returnResult(ctx); })
.catch(function (e) {
logging.Logger.log({
data: e,
level: 3 /* Error */,
message: "Error in request pipeline: " + e.message,
});
logging.Logger.error(e);
throw e;

@@ -396,3 +403,3 @@ });

_this.name = "AlreadyInBatchException";
logging.Logger.log({ data: {}, level: 3 /* Error */, message: "[" + _this.name + "]::" + _this.message });
logging.Logger.error(_this);
return _this;

@@ -399,0 +406,0 @@ }

@@ -1,1 +0,10 @@

!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.common,e.tslib_1,e.logging)}(this,function(e,t,n,r){"use strict";function o(e){return r.Logger.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 u(e){var t=e.pipeline.shift();return void 0!==t?t(e):Promise.resolve(e)}function s(e){return u(e).then(function(e){return o(e)}).catch(function(e){throw r.Logger.log({data:e,level:3,message:"Error in request pipeline: "+e.message}),e})}function a(e){return void 0===e&&(e=!1),function(t,n,o){var i=o.value;o.value=function(){for(var o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];return!e&&o.length>0&&o[0].hasOwnProperty("hasResult")&&o[0].hasResult?(r.Logger.write("["+o[0].requestId+"] ("+(new Date).getTime()+") Skipping request pipeline method "+n+", existing result in pipeline.",0),Promise.resolve(o[0])):(r.Logger.write("["+o[0].requestId+"] ("+(new Date).getTime()+") Calling request pipeline method "+n+".",0),i.apply(t,o).then(function(e){return u(e)}))}}}function c(){return[v.logStart,v.caching,v.send,v.logEnd].slice(0)}var l=function(){function e(e){this.key=e,this.expiration=t.Util.dateAdd(new Date,"second",t.RuntimeConfig.defaultCachingTimeoutSeconds),this.storeName=t.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 t.PnPClientStorage,e}(),p=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}(),h=function(e){function t(t,n,o){var i=e.call(this,"Error making HttpClient request in queryable: ["+t+"] "+n)||this;return i.status=t,i.statusText=n,i.data=o,i.name="ProcessHttpClientResponseException",r.Logger.log({data:i.data,level:3,message:i.message}),i}return n.__extends(t,e),t}(Error),f=function(){function e(){}return e.prototype.parse=function(e){var t=this;return new Promise(function(n,r){t.handleError(e,r)&&e.text().then(function(e){return e.replace(/\s/gi,"").length>0?JSON.parse(e):{}}).then(function(e){return n(t.parseODataJSON(e))}).catch(function(e){return r(e)})})},e.prototype.handleError=function(e,t){return e.ok||e.json().then(function(n){var r={responseBody:n,responseHeaders:e.headers};t(new h(e.status,e.statusText,r))}).catch(function(n){r.Logger.log({data:n,level:2,message:"There was an error parsing the error response body. See data for details."});var o={responseBody:"[[body not available]]",responseHeaders:e.headers};t(new h(e.status,e.statusText,o))}),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}(),g=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t}(f),d=function(){function e(){}return e.prototype.parse=function(e){return e.text()},e}(),y=function(){function e(){}return e.prototype.parse=function(e){return e.blob()},e}(),b=function(){function e(){}return e.prototype.parse=function(e){return e.json()},e}(),m=function(){function e(){}return e.prototype.parse=function(e){return t.Util.isFunc(e.arrayBuffer)?e.arrayBuffer():e.buffer()},e}(),v=function(){function e(){}return e.logStart=function(e){return new Promise(function(t){r.Logger.log({data:1===r.Logger.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(n){if("GET"===e.verb&&e.isCached){r.Logger.write("["+e.requestId+"] ("+(new Date).getTime()+") Caching is enabled for request, checking cache...",1);var o=new l(e.requestAbsoluteUrl.toLowerCase());if(void 0!==e.cachingOptions&&(o=t.Util.extend(o,e.cachingOptions)),null!==o.store){var u=o.store.get(o.key);if(null!==u)return r.Logger.log({data:1===r.Logger.activeLogLevel?{}:u,level:1,message:"["+e.requestId+"] ("+(new Date).getTime()+") Value returned from cache."}),e.batchDependency(),e.parser.hasOwnProperty("hydrate")&&(u=e.parser.hydrate(u)),i(e,u).then(function(e){return n(e)})}r.Logger.write("["+e.requestId+"] ("+(new Date).getTime()+") Value not found in cache.",1),e.parser=new p(e.parser,o)}return n(e)})},e.send=function(e){return new Promise(function(n,o){if(e.isBatched){var u=e.batch.add(e.requestAbsoluteUrl,e.verb,e.options,e.parser);e.batchDependency(),r.Logger.write("["+e.requestId+"] ("+(new Date).getTime()+") Batching request in batch "+e.batch.batchId+".",1),n(i(e,u))}else{r.Logger.write("["+e.requestId+"] ("+(new Date).getTime()+") Sending request.",1);var s=e.clientFactory(),a=t.Util.extend(e.options||{},{method:e.verb});s.fetch(e.requestAbsoluteUrl,a).then(function(t){return e.parser.parse(t)}).then(function(t){return i(e,t)}).then(function(e){return n(e)}).catch(function(e){return o(e)})}})},e.logEnd=function(e){return new Promise(function(t){e.isBatched?r.Logger.log({data:1===r.Logger.activeLogLevel?{}:e,level:1,message:"["+e.requestId+"] ("+(new Date).getTime()+") "+e.verb+" request will complete in batch "+e.batch.batchId+"."}):r.Logger.log({data:1===r.Logger.activeLogLevel?{}:e,level:1,message:"["+e.requestId+"] ("+(new Date).getTime()+") Completing "+e.verb+" request."}),t(e)})},n.__decorate([a(!0)],e,"logStart",null),n.__decorate([a()],e,"caching",null),n.__decorate([a()],e,"send",null),n.__decorate([a(!0)],e,"logEnd",null),e}(),_=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",r.Logger.log({data:{},level:3,message:"["+n.name+"]::"+n.message}),n}return n.__extends(t,e),t}(Error),w=function(){function e(){this._batch=null,this._query=new t.Dictionary,this._options={},this._url="",this._parentUrl="",this._useCaching=!1,this._cachingOptions=null}return 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 t.mergeOptions(this._options,e),this},e.prototype.usingCaching=function(e){return t.RuntimeConfig.globalCacheDisable||(this._useCaching=!0,void 0!==e&&(this._cachingOptions=e)),this},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 g),void 0===t&&(t={}),this.toRequestContext("GET",t,e,c()).then(function(e){return s(e)})},e.prototype.postCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new g),this.toRequestContext("POST",e,t,c()).then(function(e){return s(e)})},e.prototype.patchCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new g),this.toRequestContext("PATCH",e,t,c()).then(function(e){return s(e)})},e.prototype.deleteCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new g),this.toRequestContext("DELETE",e,t,c()).then(function(e){return s(e)})},e.prototype.addBatchDependency=function(){return null!==this._batch?this._batch.addDependency():function(){return null}},Object.defineProperty(e.prototype,"hasBatch",{get:function(){return t.Util.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.prototype.append=function(e){this._url=t.Util.combinePaths(this._url,e)},Object.defineProperty(e.prototype,"parentUrl",{get:function(){return this._parentUrl},enumerable:!0,configurable:!0}),e}(),P=function(){function e(e){void 0===e&&(e=t.Util.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 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}();e.CachingOptions=l,e.CachingParserWrapper=p,e.ProcessHttpClientResponseException=h,e.ODataParserBase=f,e.ODataDefaultParser=g,e.TextParser=d,e.BlobParser=y,e.JSONParser=b,e.BufferParser=m,e.setResult=i,e.pipe=s,e.requestPipelineMethod=a,e.PipelineMethods=v,e.getDefaultPipeline=c,e.AlreadyInBatchException=_,e.ODataQueryable=w,e.ODataBatch=P,Object.defineProperty(e,"__esModule",{value:!0})});
/**
@license
* @pnp/odata v1.0.0-beta.10 - pnp - provides shared odata functionality and base classes
* MIT (https://github.com/pnp/pnp/blob/master/LICENSE)
* Copyright (c) 2018 Microsoft
* docs: http://officedev.github.io/PnP-JS-Core
* source: https://github.com/pnp/pnp
* bugs: https://github.com/pnp/pnp/issues
*/
!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.common,e.tslib_1,e.logging)}(this,function(e,t,n,r){"use strict";function o(e){return r.Logger.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 u(e){return e.pipeline.length>0?e.pipeline.shift()(e):Promise.resolve(e)}function s(e){return e.pipeline.length<1&&r.Logger.write("["+e.requestId+"] ("+(new Date).getTime()+") Request pipeline contains no methods!",2),u(e).then(function(e){return o(e)}).catch(function(e){throw r.Logger.error(e),e})}function a(e){return void 0===e&&(e=!1),function(t,n,o){var i=o.value;o.value=function(){for(var o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];return!e&&o.length>0&&o[0].hasOwnProperty("hasResult")&&o[0].hasResult?(r.Logger.write("["+o[0].requestId+"] ("+(new Date).getTime()+") Skipping request pipeline method "+n+", existing result in pipeline.",0),Promise.resolve(o[0])):(r.Logger.write("["+o[0].requestId+"] ("+(new Date).getTime()+") Calling request pipeline method "+n+".",0),i.apply(t,o).then(function(e){return u(e)}))}}}function c(){return[v.logStart,v.caching,v.send,v.logEnd].slice(0)}var l=function(){function e(e){this.key=e,this.expiration=t.Util.dateAdd(new Date,"second",t.RuntimeConfig.defaultCachingTimeoutSeconds),this.storeName=t.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 t.PnPClientStorage,e}(),p=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}(),h=function(e){function t(t,n,o){var i=e.call(this,"Error making HttpClient request in queryable: ["+t+"] "+n)||this;return i.status=t,i.statusText=n,i.data=o,i.name="ProcessHttpClientResponseException",r.Logger.log({data:i.data,level:3,message:i.message}),i}return n.__extends(t,e),t}(Error),f=function(){function e(){}return e.prototype.parse=function(e){var t=this;return new Promise(function(n,r){t.handleError(e,r)&&e.text().then(function(e){return e.replace(/\s/gi,"").length>0?JSON.parse(e):{}}).then(function(e){return n(t.parseODataJSON(e))}).catch(function(e){return r(e)})})},e.prototype.handleError=function(e,t){return e.ok||e.json().then(function(n){var r={responseBody:n,responseHeaders:e.headers};t(new h(e.status,e.statusText,r))}).catch(function(n){r.Logger.log({data:n,level:2,message:"There was an error parsing the error response body. See data for details."});var o={responseBody:"[[body not available]]",responseHeaders:e.headers};t(new h(e.status,e.statusText,o))}),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}(),g=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n.__extends(t,e),t}(f),d=function(){function e(){}return e.prototype.parse=function(e){return e.text()},e}(),y=function(){function e(){}return e.prototype.parse=function(e){return e.blob()},e}(),b=function(){function e(){}return e.prototype.parse=function(e){return e.json()},e}(),m=function(){function e(){}return e.prototype.parse=function(e){return t.Util.isFunc(e.arrayBuffer)?e.arrayBuffer():e.buffer()},e}(),v=function(){function e(){}return e.logStart=function(e){return new Promise(function(t){r.Logger.log({data:1===r.Logger.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(n){if("GET"===e.verb&&e.isCached){r.Logger.write("["+e.requestId+"] ("+(new Date).getTime()+") Caching is enabled for request, checking cache...",1);var o=new l(e.requestAbsoluteUrl.toLowerCase());if(void 0!==e.cachingOptions&&(o=t.Util.extend(o,e.cachingOptions)),null!==o.store){var u=o.store.get(o.key);if(null!==u)return r.Logger.log({data:1===r.Logger.activeLogLevel?{}:u,level:1,message:"["+e.requestId+"] ("+(new Date).getTime()+") Value returned from cache."}),e.batchDependency(),e.parser.hasOwnProperty("hydrate")&&(u=e.parser.hydrate(u)),i(e,u).then(function(e){return n(e)})}r.Logger.write("["+e.requestId+"] ("+(new Date).getTime()+") Value not found in cache.",1),e.parser=new p(e.parser,o)}return n(e)})},e.send=function(e){return new Promise(function(n,o){if(e.isBatched){var u=e.batch.add(e.requestAbsoluteUrl,e.verb,e.options,e.parser);e.batchDependency(),r.Logger.write("["+e.requestId+"] ("+(new Date).getTime()+") Batching request in batch "+e.batch.batchId+".",1),n(i(e,u))}else{r.Logger.write("["+e.requestId+"] ("+(new Date).getTime()+") Sending request.",1);var s=e.clientFactory(),a=t.Util.extend(e.options||{},{method:e.verb});s.fetch(e.requestAbsoluteUrl,a).then(function(t){return e.parser.parse(t)}).then(function(t){return i(e,t)}).then(function(e){return n(e)}).catch(function(e){return o(e)})}})},e.logEnd=function(e){return new Promise(function(t){e.isBatched?r.Logger.log({data:1===r.Logger.activeLogLevel?{}:e,level:1,message:"["+e.requestId+"] ("+(new Date).getTime()+") "+e.verb+" request will complete in batch "+e.batch.batchId+"."}):r.Logger.log({data:1===r.Logger.activeLogLevel?{}:e,level:1,message:"["+e.requestId+"] ("+(new Date).getTime()+") Completing "+e.verb+" request."}),t(e)})},n.__decorate([a(!0)],e,"logStart",null),n.__decorate([a()],e,"caching",null),n.__decorate([a()],e,"send",null),n.__decorate([a(!0)],e,"logEnd",null),e}(),_=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",r.Logger.error(n),n}return n.__extends(t,e),t}(Error),w=function(){function e(){this._batch=null,this._query=new t.Dictionary,this._options={},this._url="",this._parentUrl="",this._useCaching=!1,this._cachingOptions=null}return 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 t.mergeOptions(this._options,e),this},e.prototype.usingCaching=function(e){return t.RuntimeConfig.globalCacheDisable||(this._useCaching=!0,void 0!==e&&(this._cachingOptions=e)),this},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 g),void 0===t&&(t={}),this.toRequestContext("GET",t,e,c()).then(function(e){return s(e)})},e.prototype.postCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new g),this.toRequestContext("POST",e,t,c()).then(function(e){return s(e)})},e.prototype.patchCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new g),this.toRequestContext("PATCH",e,t,c()).then(function(e){return s(e)})},e.prototype.deleteCore=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new g),this.toRequestContext("DELETE",e,t,c()).then(function(e){return s(e)})},e.prototype.addBatchDependency=function(){return null!==this._batch?this._batch.addDependency():function(){return null}},Object.defineProperty(e.prototype,"hasBatch",{get:function(){return t.Util.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.prototype.append=function(e){this._url=t.Util.combinePaths(this._url,e)},Object.defineProperty(e.prototype,"parentUrl",{get:function(){return this._parentUrl},enumerable:!0,configurable:!0}),e}(),q=function(){function e(e){void 0===e&&(e=t.Util.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 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}();e.CachingOptions=l,e.CachingParserWrapper=p,e.ProcessHttpClientResponseException=h,e.ODataParserBase=f,e.ODataDefaultParser=g,e.TextParser=d,e.BlobParser=y,e.JSONParser=b,e.BufferParser=m,e.setResult=i,e.pipe=s,e.requestPipelineMethod=a,e.PipelineMethods=v,e.getDefaultPipeline=c,e.AlreadyInBatchException=_,e.ODataQueryable=w,e.ODataBatch=q,Object.defineProperty(e,"__esModule",{value:!0})});

@@ -0,1 +1,10 @@

/**
@license
* @pnp/odata v1.0.0-beta.10 - pnp - provides shared odata functionality and base classes
* MIT (https://github.com/pnp/pnp/blob/master/LICENSE)
* Copyright (c) 2018 Microsoft
* docs: http://officedev.github.io/PnP-JS-Core
* source: https://github.com/pnp/pnp
* bugs: https://github.com/pnp/pnp/issues
*/
import { Dictionary, PnPClientStorage, RuntimeConfig, Util, mergeOptions } from '@pnp/common';

@@ -175,5 +184,4 @@ import { Logger } from '@pnp/logging';

function next(c) {
const _next = c.pipeline.shift();
if (typeof _next !== "undefined") {
return _next(c);
if (c.pipeline.length > 0) {
return c.pipeline.shift()(c);
}

@@ -190,10 +198,9 @@ else {

function pipe(context) {
if (context.pipeline.length < 1) {
Logger.write(`[${context.requestId}] (${(new Date()).getTime()}) Request pipeline contains no methods!`, 2 /* Warning */);
}
return next(context)
.then(ctx => returnResult(ctx))
.catch((e) => {
Logger.log({
data: e,
level: 3 /* Error */,
message: `Error in request pipeline: ${e.message}`,
});
Logger.error(e);
throw e;

@@ -353,3 +360,3 @@ });

this.name = "AlreadyInBatchException";
Logger.log({ data: {}, level: 3 /* Error */, message: `[${this.name}]::${this.message}` });
Logger.error(this);
}

@@ -356,0 +363,0 @@ }

@@ -1,2 +0,2 @@

# @pnp\odata\caching
# @pnp/odata/caching

@@ -3,0 +3,0 @@ Often times data doesn't change that quickly, especially in the case of rolling up corporate news or upcoming events. These types of things can be cached for minutes if not hours. To help make caching easy you just need to insert the usingCaching method in your chain. This only applies to get requests. The usingCaching method can be used with the inBatch method as well to cache the results of batched requests.

@@ -1,2 +0,2 @@

# @pnp\odata\core
# @pnp/odata/core

@@ -3,0 +3,0 @@ This modules contains shared interfaces and abstract classes used within, and by inheritors of, the @pnp/odata package.

@@ -1,2 +0,2 @@

@pnp\odata
# @pnp/odata

@@ -3,0 +3,0 @@ This modules contains the abstract core classes used to process odata requests. They can also be used to build your own odata

@@ -1,2 +0,2 @@

# @pnp\odata\odatabatch
# @pnp/odata/odatabatch

@@ -3,0 +3,0 @@ This module contains an abstract class used as a base when inheriting libraries support batching.

@@ -1,2 +0,2 @@

# @pnp\odata\parsers
# @pnp/odata/parsers

@@ -3,0 +3,0 @@ This modules contains a set of generic parsers. These can be used or extended as needed, though it is likely in most cases the

@@ -1,2 +0,2 @@

# @pnp\odata\pipeline
# @pnp/odata/pipeline

@@ -3,0 +3,0 @@ All of the odata requests processed by @pnp/odata pass through an extensible request pipeline. Each request is executed in a specific request context defined by

@@ -1,2 +0,2 @@

# @pnp\odata\queryable
# @pnp/odata/queryable

@@ -3,0 +3,0 @@ The Queryable class is the base class for all of the libraries building fluent request apis.

{
"name": "@pnp/odata",
"version": "1.0.0-beta.7",
"version": "1.0.0-beta.10",
"description": "pnp - provides shared odata functionality and base classes",

@@ -11,3 +11,3 @@ "main": "./dist/odata.es5.umd.js",

"peerDependencies": {
"@pnp/logging": "1.0.0-beta.7"
"@pnp/logging": "1.0.0-beta.10"
},

@@ -14,0 +14,0 @@ "author": {

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc