diff --git a/browser/sharepointplus.js b/browser/sharepointplus.js index 47d2ef7..403c293 100644 --- a/browser/sharepointplus.js +++ b/browser/sharepointplus.js @@ -1,8 +1,8 @@ -window.$SP=function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=230)}([function(e,t,r){"use strict";(function(e,n){r.d(t,"a",(function(){return s}));r(39),r(16),r(2),r(3),r(6),r(30),r(5);var i=r(67),o=r(158);function a(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function s(e){return u.apply(this,arguments)}function u(){var t;return t=regeneratorRuntime.mark((function t(a){var u,c,l,f,h,p,d,g,v,y,m,b,w;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a.headers=a.headers||{},t.prev=1,u=!1,a.url.toLowerCase().indexOf("/_api/")>-1&&-1===a.url.toLowerCase().indexOf("_api/web/url")&&(void 0===a.headers.Accept&&(a.headers.Accept="application/json;odata="+e._SP_JSON_ACCEPT),void 0===a.headers["Content-Type"]&&(a.headers["Content-Type"]="application/json;odata="+e._SP_JSON_ACCEPT),void 0===a.headers["X-RequestDigest"]&&-1===a.url.indexOf("contextinfo")&&(u=!0)),a.url.toLowerCase().indexOf("_vti_bin/client.svc/processquery")>-1&&void 0===a.headers["X-RequestDigest"]&&(u=!0),!u){t.next=11;break}return t.next=8,i.a.call(this,{url:a.url.toLowerCase().split("_api")[0]});case 8:return c=t.sent,a.headers["X-RequestDigest"]=c,t.abrupt("return",s.call(this,a));case 11:if(void 0===a.headers["Content-Type"]&&(a.headers["Content-Type"]="text/xml; charset=utf-8"),!e._SP_ISBROWSER){t.next=36;break}return"POST"!==a.method||a.body||(a.body=""),t.next=16,new Promise((function(e){Object(o.a)(a,(function(t,r,n){e({code:t,responseText:r,request:n})}))}));case 16:if(l=t.sent,f=l.code,h=l.responseText,p=l.request,!(f>=200&&f<300&&"Error"!==h&&"Abort"!==h&&"Timeout"!==h)){t.next=24;break}return d=p.responseType&&"document"!==p.responseType?h:p.responseXML||p.responseText,(p.getResponseHeader("Content-Type")||"").indexOf("/json")>-1&&"string"==typeof d&&(d=JSON.parse(d)),t.abrupt("return",Promise.resolve(d));case 24:if(!(403==f&&h.indexOf("The security validation for this page is invalid and might be corrupted. Please use your web browser's Back button to try your operation again.")>-1)){t.next=33;break}return delete a.headers["X-RequestDigest"],t.next=28,Object(i.a)({cache:!1});case 28:return g=t.sent,a.headers["X-RequestDigest"]=g,t.abrupt("return",s.call(this,a));case 33:return t.abrupt("return",Promise.reject({statusCode:f,responseText:h,request:p}));case 34:t.next=64;break;case 36:if(null!==this.module_sprequest){t.next=40;break}if(null!==this.credentialOptions){t.next=39;break}throw"[SharepointPlus 'ajax'] please use `$SP().auth()` to provide your credentials first";case 39:this.module_sprequest=r(185).create(this.credentialOptions);case 40:for(y in a.headers["Content-Type"]&&a.headers["Content-Type"].indexOf("xml")>-1&&(a.headers.Accept="application/xml, text/xml, */*; q=0.01"),a.method||(a.method=void 0!==a.body?"POST":"GET"),"POST"===a.method.toUpperCase()&&void 0!==a.body&&(a.headers["Content-Length"]=n.byteLength(a.body)),a.headers["User-Agent"]="Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:52.0) Gecko/20100101 Firefox/52.0",v={json:!1,method:a.method,strictSSL:!1,headers:a.headers,jar:!0},a.body&&(v.body=a.body),this.proxyweb&&(v.proxy=this.proxyweb),v.headers&&delete v.headers["Content-Length"],a)Object.prototype.hasOwnProperty.call(a,y)&&!v[y]&&(v[y]=a[y]);return t.next=51,this.module_sprequest(a.url,v);case 51:if(200!==(m=t.sent).statusCode||"Error"===m.statusMessage||"Abort"===m.statusMessage||"Timeout"===m.statusMessage){t.next=63;break}if(!((m.headers["content-type"]||"").indexOf("xml")>-1&&"-1&&"string"==typeof m.body&&(m.body=JSON.parse(m.body)),t.abrupt("return",Promise.resolve(m.body));case 61:t.next=64;break;case 63:return t.abrupt("return",Promise.reject({response:m,statusCode:m.statusCode,responseText:m.body}));case 64:t.next=69;break;case 66:return t.prev=66,t.t0=t.catch(1),t.abrupt("return",Promise.reject({error:t.t0,statusCode:t.t0.statusCode,response:t.t0.response,responseText:t.t0.response?t.t0.response.body:""}));case 69:case"end":return t.stop()}}),t,this,[[1,66]])})),(u=function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function s(e){a(o,n,i,s,u,"next",e)}function u(e){a(o,n,i,s,u,"throw",e)}s(void 0)}))}).apply(this,arguments)}}).call(this,r(10),r(180).Buffer)},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));r(6),r(14);function n(e,t,r){return'<'+e+' xmlns="'+(r=r||"http://schemas.microsoft.com/sharepoint/soap/").replace(/webpartpages\/$/,"webpartpages")+'">'+t+""}},function(e,t,r){var n=r(108),i=r(33),o=r(172);n||i(Object.prototype,"toString",o,{unsafe:!0})},function(e,t,r){"use strict";var n,i,o,a,s=r(12),u=r(53),c=r(7),l=r(54),f=r(173),h=r(33),p=r(135),d=r(62),g=r(136),v=r(22),y=r(63),m=r(109),b=r(43),w=r(101),S=r(174),x=r(139),A=r(49),P=r(140).set,E=r(176),_=r(177),T=r(178),k=r(142),I=r(179),D=r(47),R=r(127),O=r(11),C=r(111),N=O("species"),L="Promise",j=D.get,U=D.set,M=D.getterFor(L),F=f,V=c.TypeError,B=c.document,W=c.process,G=l("fetch"),q=k.f,Y=q,H="process"==b(W),$=!!(B&&B.createEvent&&c.dispatchEvent),z=R(L,(function(){if(!(w(F)!==String(F))){if(66===C)return!0;if(!H&&"function"!=typeof PromiseRejectionEvent)return!0}if(u&&!F.prototype.finally)return!0;if(C>=51&&/native code/.test(F))return!1;var e=F.resolve(1),t=function(e){e((function(){}),(function(){}))};return(e.constructor={})[N]=t,!(e.then((function(){}))instanceof t)})),X=z||!x((function(e){F.all(e).catch((function(){}))})),Z=function(e){var t;return!(!v(e)||"function"!=typeof(t=e.then))&&t},Q=function(e,t,r){if(!t.notified){t.notified=!0;var n=t.reactions;E((function(){for(var i=t.value,o=1==t.state,a=0;n.length>a;){var s,u,c,l=n[a++],f=o?l.ok:l.fail,h=l.resolve,p=l.reject,d=l.domain;try{f?(o||(2===t.rejection&&te(e,t),t.rejection=1),!0===f?s=i:(d&&d.enter(),s=f(i),d&&(d.exit(),c=!0)),s===l.promise?p(V("Promise-chain cycle")):(u=Z(s))?u.call(s,h,p):h(s)):p(i)}catch(e){d&&!c&&d.exit(),p(e)}}t.reactions=[],t.notified=!1,r&&!t.rejection&&K(e,t)}))}},J=function(e,t,r){var n,i;$?((n=B.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),c.dispatchEvent(n)):n={promise:t,reason:r},(i=c["on"+e])?i(n):"unhandledrejection"===e&&T("Unhandled promise rejection",r)},K=function(e,t){P.call(c,(function(){var r,n=t.value;if(ee(t)&&(r=I((function(){H?W.emit("unhandledRejection",n,e):J("unhandledrejection",e,n)})),t.rejection=H||ee(t)?2:1,r.error))throw r.value}))},ee=function(e){return 1!==e.rejection&&!e.parent},te=function(e,t){P.call(c,(function(){H?W.emit("rejectionHandled",e):J("rejectionhandled",e,t.value)}))},re=function(e,t,r,n){return function(i){e(t,r,i,n)}},ne=function(e,t,r,n){t.done||(t.done=!0,n&&(t=n),t.value=r,t.state=2,Q(e,t,!0))},ie=function(e,t,r,n){if(!t.done){t.done=!0,n&&(t=n);try{if(e===r)throw V("Promise can't be resolved itself");var i=Z(r);i?E((function(){var n={done:!1};try{i.call(r,re(ie,e,n,t),re(ne,e,n,t))}catch(r){ne(e,n,r,t)}})):(t.value=r,t.state=1,Q(e,t,!1))}catch(r){ne(e,{done:!1},r,t)}}};z&&(F=function(e){m(this,F,L),y(e),n.call(this);var t=j(this);try{e(re(ie,this,t),re(ne,this,t))}catch(e){ne(this,t,e)}},(n=function(e){U(this,{type:L,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=p(F.prototype,{then:function(e,t){var r=M(this),n=q(A(this,F));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=H?W.domain:void 0,r.parent=!0,r.reactions.push(n),0!=r.state&&Q(this,r,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),i=function(){var e=new n,t=j(e);this.promise=e,this.resolve=re(ie,e,t),this.reject=re(ne,e,t)},k.f=q=function(e){return e===F||e===o?new i(e):Y(e)},u||"function"!=typeof f||(a=f.prototype.then,h(f.prototype,"then",(function(e,t){var r=this;return new F((function(e,t){a.call(r,e,t)})).then(e,t)}),{unsafe:!0}),"function"==typeof G&&s({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return _(F,G.apply(c,arguments))}}))),s({global:!0,wrap:!0,forced:z},{Promise:F}),d(F,L,!1,!0),g(L),o=l(L),s({target:L,stat:!0,forced:z},{reject:function(e){var t=q(this);return t.reject.call(void 0,e),t.promise}}),s({target:L,stat:!0,forced:u||z},{resolve:function(e){return _(u&&this===o?F:this,e)}}),s({target:L,stat:!0,forced:X},{all:function(e){var t=this,r=q(t),n=r.resolve,i=r.reject,o=I((function(){var r=y(t.resolve),o=[],a=0,s=1;S(e,(function(e){var u=a++,c=!1;o.push(void 0),s++,r.call(t,e).then((function(e){c||(c=!0,o[u]=e,--s||n(o))}),i)})),--s||n(o)}));return o.error&&i(o.value),r.promise},race:function(e){var t=this,r=q(t),n=r.reject,i=I((function(){var i=y(t.resolve);S(e,(function(e){i.call(t,e).then(r.resolve,n)}))}));return i.error&&n(i.value),r.promise}})},function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));r(2),r(3),r(6),r(14),r(5);var n=r(0),i=r(1);function o(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function a(){return s.apply(this,arguments)}function s(){var e;return e=regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0!==this.url){e.next=26;break}if(void 0===window.L_Menu_BaseUrl){e.next=5;break}return e.abrupt("return",Promise.resolve(u(window.L_Menu_BaseUrl)));case 5:if(void 0===window._spPageContextInfo||void 0===window._spPageContextInfo.webServerRelativeUrl){e.next=9;break}return e.abrupt("return",Promise.resolve(u(window._spPageContextInfo.webServerRelativeUrl)));case 9:return e.prev=9,e.next=12,n.a.call(this,{url:"/_vti_bin/Webs.asmx",body:Object(i.a)("WebUrlFromPageUrl",""+window.location.href.replace(/&/g,"&")+"")});case 12:if(t=e.sent,!(r=t.getElementsByTagName("WebUrlFromPageUrlResult")).length){e.next=18;break}return e.abrupt("return",Promise.resolve(u(r[0].firstChild.nodeValue.toLowerCase())));case 18:return e.abrupt("return",Promise.reject("[SharepointPlus 'getURL'] Unable to retrieve the URL"));case 19:e.next=24;break;case 21:return e.prev=21,e.t0=e.catch(9),e.abrupt("return",Promise.reject(e.t0));case 24:e.next=27;break;case 26:return e.abrupt("return",Promise.resolve(u(this.url)));case 27:case"end":return e.stop()}}),e,this,[[9,21]])})),(s=function(){var t=this,r=arguments;return new Promise((function(n,i){var a=e.apply(t,r);function s(e){o(a,n,i,s,u,"next",e)}function u(e){o(a,n,i,s,u,"throw",e)}s(void 0)}))}).apply(this,arguments)}function u(e){return""===e||"/"===e?window.location.protocol+"//"+window.location.host+"/":e}},function(e,t,r){var n=function(e){"use strict";var t,r=Object.prototype,n=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(e,t,r,n){var i=t&&t.prototype instanceof g?t:g,o=Object.create(i.prototype),a=new T(n||[]);return o._invoke=function(e,t,r){var n=l;return function(i,o){if(n===h)throw new Error("Generator is already running");if(n===p){if("throw"===i)throw o;return I()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=P(a,r);if(s){if(s===d)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===l)throw n=p,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=h;var u=c(e,t,r);if("normal"===u.type){if(n=r.done?p:f,u.arg===d)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n=p,r.method="throw",r.arg=u.arg)}}}(e,r,a),o}function c(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var l="suspendedStart",f="suspendedYield",h="executing",p="completed",d={};function g(){}function v(){}function y(){}var m={};m[o]=function(){return this};var b=Object.getPrototypeOf,w=b&&b(b(k([])));w&&w!==r&&n.call(w,o)&&(m=w);var S=y.prototype=g.prototype=Object.create(m);function x(e){["next","throw","return"].forEach((function(t){e[t]=function(e){return this._invoke(t,e)}}))}function A(e){var t;this._invoke=function(r,i){function o(){return new Promise((function(t,o){!function t(r,i,o,a){var s=c(e[r],e,i);if("throw"!==s.type){var u=s.arg,l=u.value;return l&&"object"==typeof l&&n.call(l,"__await")?Promise.resolve(l.__await).then((function(e){t("next",e,o,a)}),(function(e){t("throw",e,o,a)})):Promise.resolve(l).then((function(e){u.value=e,o(u)}),(function(e){return t("throw",e,o,a)}))}a(s.arg)}(r,i,t,o)}))}return t=t?t.then(o,o):o()}}function P(e,r){var n=e.iterator[r.method];if(n===t){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=t,P(e,r),"throw"===r.method))return d;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var i=c(n,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,d;var o=i.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,d):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function _(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function k(e){if(e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function r(){for(;++i=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(u&&c){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),_(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;_(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:k(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),d}},e}(e.exports);try{regeneratorRuntime=n}catch(e){Function("r","regeneratorRuntime = r")(n)}},function(e,t,r){"use strict";var n=r(12),i=r(80);n({target:"RegExp",proto:!0,forced:/./.exec!==i},{exec:i})},function(e,t,r){(function(t){var r=function(e){return e&&e.Math==Math&&e};e.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof t&&t)||Function("return this")()}).call(this,r(10))},function(e,t,r){"use strict";var n,i=r(27),o=r(7),a=r(22),s=r(25),u=r(78),c=r(28),l=r(33),f=r(24).f,h=r(106),p=r(77),d=r(11),g=r(72),v=o.DataView,y=v&&v.prototype,m=o.Int8Array,b=m&&m.prototype,w=o.Uint8ClampedArray,S=w&&w.prototype,x=m&&h(m),A=b&&h(b),P=Object.prototype,E=P.isPrototypeOf,_=d("toStringTag"),T=g("TYPED_ARRAY_TAG"),k=!(!o.ArrayBuffer||!v),I=k&&!!p&&"Opera"!==u(o.opera),D=!1,R={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},O=function(e){return a(e)&&s(R,u(e))};for(n in R)o[n]||(I=!1);if((!I||"function"!=typeof x||x===Function.prototype)&&(x=function(){throw TypeError("Incorrect invocation")},I))for(n in R)o[n]&&p(o[n],x);if((!I||!A||A===P)&&(A=x.prototype,I))for(n in R)o[n]&&p(o[n].prototype,A);if(I&&h(S)!==A&&p(S,A),i&&!s(A,_))for(n in D=!0,f(A,_,{get:function(){return a(this)?this[T]:void 0}}),R)o[n]&&c(o[n],T,n);k&&p&&h(y)!==P&&p(y,P),e.exports={NATIVE_ARRAY_BUFFER:k,NATIVE_ARRAY_BUFFER_VIEWS:I,TYPED_ARRAY_TAG:D&&T,aTypedArray:function(e){if(O(e))return e;throw TypeError("Target is not a typed array")},aTypedArrayConstructor:function(e){if(p){if(E.call(x,e))return e}else for(var t in R)if(s(R,n)){var r=o[t];if(r&&(e===r||E.call(r,e)))return e}throw TypeError("Target is not a typed array constructor")},exportTypedArrayMethod:function(e,t,r){if(i){if(r)for(var n in R){var a=o[n];a&&s(a.prototype,e)&&delete a.prototype[e]}A[e]&&!r||l(A,e,r?t:I&&b[e]||t)}},exportTypedArrayStaticMethod:function(e,t,r){var n,a;if(i){if(p){if(r)for(n in R)(a=o[n])&&s(a,e)&&delete a[e];if(x[e]&&!r)return;try{return l(x,e,r?t:I&&m[e]||t)}catch(e){}}for(n in R)!(a=o[n])||a[e]&&!r||l(a,e,t)}},isView:function(e){var t=u(e);return"DataView"===t||s(R,t)},isTypedArray:O,TypedArray:x,TypedArrayPrototype:A}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t,r){var n=r(7),i=r(102),o=r(25),a=r(72),s=r(104),u=r(128),c=i("wks"),l=n.Symbol,f=u?l:l&&l.withoutSetter||a;e.exports=function(e){return o(c,e)||(s&&o(l,e)?c[e]=l[e]:c[e]=f("Symbol."+e)),c[e]}},function(e,t,r){var n=r(7),i=r(51).f,o=r(28),a=r(33),s=r(100),u=r(123),c=r(127);e.exports=function(e,t){var r,l,f,h,p,d=e.target,g=e.global,v=e.stat;if(r=g?n:v?n[d]||s(d,{}):(n[d]||{}).prototype)for(l in t){if(h=t[l],f=e.noTargetGet?(p=i(r,l))&&p.value:r[l],!c(g?l:d+(v?".":"#")+l,e.forced)&&void 0!==f){if(typeof h==typeof f)continue;u(h,f)}(e.sham||f&&f.sham)&&o(h,"sham",!0),a(r,l,h,e)}}},function(e,t,r){"use strict";var n=r(38),i=r(168),o=r(64),a=r(47),s=r(133),u=a.set,c=a.getterFor("Array Iterator");e.exports=s(Array,"Array",(function(e,t){u(this,{type:"Array Iterator",target:n(e),index:0,kind:t})}),(function(){var e=c(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==r?{value:n,done:!1}:"values"==r?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}}),"values"),o.Arguments=o.Array,i("keys"),i("values"),i("entries")},function(e,t,r){"use strict";var n=r(113),i=r(23),o=r(31),a=r(15),s=r(34),u=r(32),c=r(114),l=r(115),f=Math.max,h=Math.min,p=Math.floor,d=/\$([$&'`]|\d\d?|<[^>]*>)/g,g=/\$([$&'`]|\d\d?)/g;n("replace",2,(function(e,t,r,n){return[function(r,n){var i=u(this),o=null==r?void 0:r[e];return void 0!==o?o.call(r,i,n):t.call(String(i),r,n)},function(e,o){if(n.REPLACE_KEEPS_$0||"string"==typeof o&&-1===o.indexOf("$0")){var u=r(t,e,this,o);if(u.done)return u.value}var p=i(e),d=String(this),g="function"==typeof o;g||(o=String(o));var y=p.global;if(y){var m=p.unicode;p.lastIndex=0}for(var b=[];;){var w=l(p,d);if(null===w)break;if(b.push(w),!y)break;""===String(w[0])&&(p.lastIndex=c(d,a(p.lastIndex),m))}for(var S,x="",A=0,P=0;P=A&&(x+=d.slice(A,_)+R,A=_+E.length)}return x+d.slice(A)}];function v(e,r,n,i,a,s){var u=n+e.length,c=i.length,l=g;return void 0!==a&&(a=o(a),l=d),t.call(s,l,(function(t,o){var s;switch(o.charAt(0)){case"$":return"$";case"&":return e;case"`":return r.slice(0,n);case"'":return r.slice(u);case"<":s=a[o.slice(1,-1)];break;default:var l=+o;if(0===l)return t;if(l>c){var f=p(l/10);return 0===f?t:f<=c?void 0===i[f-1]?o.charAt(1):i[f-1]+o.charAt(1):t}s=i[l-1]}return void 0===s?"":s}))}}))},function(e,t,r){var n=r(34),i=Math.min;e.exports=function(e){return e>0?i(n(e),9007199254740991):0}},function(e,t,r){"use strict";var n=r(12),i=r(22),o=r(61),a=r(48),s=r(15),u=r(38),c=r(112),l=r(65),f=r(11)("species"),h=[].slice,p=Math.max;n({target:"Array",proto:!0,forced:!l("slice")},{slice:function(e,t){var r,n,l,d=u(this),g=s(d.length),v=a(e,g),y=a(void 0===t?g:t,g);if(o(d)&&("function"!=typeof(r=d.constructor)||r!==Array&&!o(r.prototype)?i(r)&&null===(r=r[f])&&(r=void 0):r=void 0,r===Array||void 0===r))return h.call(d,v,y);for(n=new(void 0===r?Array:r)(p(y-v,0)),l=0;v=r.length?{value:void 0,done:!0}:(e=n(r,i),t.index+=e.length,{value:e,done:!1})}))},function(e,t,r){"use strict";var n=r(12),i=r(7),o=r(54),a=r(53),s=r(27),u=r(104),c=r(128),l=r(9),f=r(25),h=r(61),p=r(22),d=r(23),g=r(31),v=r(38),y=r(59),m=r(52),b=r(75),w=r(129),S=r(60),x=r(167),A=r(126),P=r(51),E=r(24),_=r(120),T=r(28),k=r(33),I=r(102),D=r(71),R=r(73),O=r(72),C=r(11),N=r(131),L=r(132),j=r(62),U=r(47),M=r(29).forEach,F=D("hidden"),V=C("toPrimitive"),B=U.set,W=U.getterFor("Symbol"),G=Object.prototype,q=i.Symbol,Y=o("JSON","stringify"),H=P.f,$=E.f,z=x.f,X=_.f,Z=I("symbols"),Q=I("op-symbols"),J=I("string-to-symbol-registry"),K=I("symbol-to-string-registry"),ee=I("wks"),te=i.QObject,re=!te||!te.prototype||!te.prototype.findChild,ne=s&&l((function(){return 7!=b($({},"a",{get:function(){return $(this,"a",{value:7}).a}})).a}))?function(e,t,r){var n=H(G,t);n&&delete G[t],$(e,t,r),n&&e!==G&&$(G,t,n)}:$,ie=function(e,t){var r=Z[e]=b(q.prototype);return B(r,{type:"Symbol",tag:e,description:t}),s||(r.description=t),r},oe=c?function(e){return"symbol"==typeof e}:function(e){return Object(e)instanceof q},ae=function(e,t,r){e===G&&ae(Q,t,r),d(e);var n=y(t,!0);return d(r),f(Z,n)?(r.enumerable?(f(e,F)&&e[F][n]&&(e[F][n]=!1),r=b(r,{enumerable:m(0,!1)})):(f(e,F)||$(e,F,m(1,{})),e[F][n]=!0),ne(e,n,r)):$(e,n,r)},se=function(e,t){d(e);var r=v(t),n=w(r).concat(fe(r));return M(n,(function(t){s&&!ue.call(r,t)||ae(e,t,r[t])})),e},ue=function(e){var t=y(e,!0),r=X.call(this,t);return!(this===G&&f(Z,t)&&!f(Q,t))&&(!(r||!f(this,t)||!f(Z,t)||f(this,F)&&this[F][t])||r)},ce=function(e,t){var r=v(e),n=y(t,!0);if(r!==G||!f(Z,n)||f(Q,n)){var i=H(r,n);return!i||!f(Z,n)||f(r,F)&&r[F][n]||(i.enumerable=!0),i}},le=function(e){var t=z(v(e)),r=[];return M(t,(function(e){f(Z,e)||f(R,e)||r.push(e)})),r},fe=function(e){var t=e===G,r=z(t?Q:v(e)),n=[];return M(r,(function(e){!f(Z,e)||t&&!f(G,e)||n.push(Z[e])})),n};(u||(k((q=function(){if(this instanceof q)throw TypeError("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?String(arguments[0]):void 0,t=O(e),r=function(e){this===G&&r.call(Q,e),f(this,F)&&f(this[F],t)&&(this[F][t]=!1),ne(this,t,m(1,e))};return s&&re&&ne(G,t,{configurable:!0,set:r}),ie(t,e)}).prototype,"toString",(function(){return W(this).tag})),k(q,"withoutSetter",(function(e){return ie(O(e),e)})),_.f=ue,E.f=ae,P.f=ce,S.f=x.f=le,A.f=fe,N.f=function(e){return ie(C(e),e)},s&&($(q.prototype,"description",{configurable:!0,get:function(){return W(this).description}}),a||k(G,"propertyIsEnumerable",ue,{unsafe:!0}))),n({global:!0,wrap:!0,forced:!u,sham:!u},{Symbol:q}),M(w(ee),(function(e){L(e)})),n({target:"Symbol",stat:!0,forced:!u},{for:function(e){var t=String(e);if(f(J,t))return J[t];var r=q(t);return J[t]=r,K[r]=t,r},keyFor:function(e){if(!oe(e))throw TypeError(e+" is not a symbol");if(f(K,e))return K[e]},useSetter:function(){re=!0},useSimple:function(){re=!1}}),n({target:"Object",stat:!0,forced:!u,sham:!s},{create:function(e,t){return void 0===t?b(e):se(b(e),t)},defineProperty:ae,defineProperties:se,getOwnPropertyDescriptor:ce}),n({target:"Object",stat:!0,forced:!u},{getOwnPropertyNames:le,getOwnPropertySymbols:fe}),n({target:"Object",stat:!0,forced:l((function(){A.f(1)}))},{getOwnPropertySymbols:function(e){return A.f(g(e))}}),Y)&&n({target:"JSON",stat:!0,forced:!u||l((function(){var e=q();return"[null]"!=Y([e])||"{}"!=Y({a:e})||"{}"!=Y(Object(e))}))},{stringify:function(e,t,r){for(var n,i=[e],o=1;arguments.length>o;)i.push(arguments[o++]);if(n=t,(p(t)||void 0!==e)&&!oe(e))return h(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!oe(t))return t}),i[1]=t,Y.apply(null,i)}});q.prototype[V]||T(q.prototype,V,q.prototype.valueOf),j(q,"Symbol"),R[F]=!0},function(e,t,r){"use strict";var n=r(12),i=r(27),o=r(7),a=r(25),s=r(22),u=r(24).f,c=r(123),l=o.Symbol;if(i&&"function"==typeof l&&(!("description"in l.prototype)||void 0!==l().description)){var f={},h=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),t=this instanceof h?new l(e):void 0===e?l():l(e);return""===e&&(f[t]=!0),t};c(h,l);var p=h.prototype=l.prototype;p.constructor=h;var d=p.toString,g="Symbol(test)"==String(l("test")),v=/^Symbol\((.*)\)[^)]+$/;u(p,"description",{configurable:!0,get:function(){var e=s(this)?this.valueOf():this,t=d.call(e);if(a(f,e))return"";var r=g?t.slice(7,-1):t.replace(v,"$1");return""===r?void 0:r}}),n({global:!0,forced:!0},{Symbol:h})}},function(e,t,r){r(132)("iterator")},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,r){var n=r(22);e.exports=function(e){if(!n(e))throw TypeError(String(e)+" is not an object");return e}},function(e,t,r){var n=r(27),i=r(121),o=r(23),a=r(59),s=Object.defineProperty;t.f=n?s:function(e,t,r){if(o(e),t=a(t,!0),o(r),i)try{return s(e,t,r)}catch(e){}if("get"in r||"set"in r)throw TypeError("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},function(e,t){var r={}.hasOwnProperty;e.exports=function(e,t){return r.call(e,t)}},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));r(19),r(20),r(21),r(44),r(13),r(2),r(18),r(17);function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(){var e,t,r,a,s=arguments[0]||{},u=1,c=arguments.length,l=!1;for("boolean"==typeof s&&(l=s,s=arguments[u]||{},u++),"object"!==n(s)&&"function"!=typeof s&&(s={});uA;A++)if((h||A in w)&&(m=S(y=w[A],A,b),e))if(t)E[A]=m;else if(m)switch(e){case 3:return!0;case 5:return y;case 6:return A;case 2:u.call(E,y)}else if(l)return!1;return f?-1:c||l?l:E}};e.exports={forEach:c(0),map:c(1),filter:c(2),some:c(3),every:c(4),find:c(5),findIndex:c(6)}},function(e,t,r){"use strict";var n=r(113),i=r(146),o=r(23),a=r(32),s=r(49),u=r(114),c=r(15),l=r(115),f=r(80),h=r(9),p=[].push,d=Math.min,g=!h((function(){return!RegExp(4294967295,"y")}));n("split",2,(function(e,t,r){var n;return n="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,r){var n=String(a(this)),o=void 0===r?4294967295:r>>>0;if(0===o)return[];if(void 0===e)return[n];if(!i(e))return t.call(n,e,o);for(var s,u,c,l=[],h=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),d=0,g=new RegExp(e.source,h+"g");(s=f.call(g,n))&&!((u=g.lastIndex)>d&&(l.push(n.slice(d,s.index)),s.length>1&&s.index=o));)g.lastIndex===s.index&&g.lastIndex++;return d===n.length?!c&&g.test("")||l.push(""):l.push(n.slice(d)),l.length>o?l.slice(0,o):l}:"0".split(void 0,0).length?function(e,r){return void 0===e&&0===r?[]:t.call(this,e,r)}:t,[function(t,r){var i=a(this),o=null==t?void 0:t[e];return void 0!==o?o.call(t,i,r):n.call(String(i),t,r)},function(e,i){var a=r(n,e,this,i,n!==t);if(a.done)return a.value;var f=o(e),h=String(this),p=s(f,RegExp),v=f.unicode,y=(f.ignoreCase?"i":"")+(f.multiline?"m":"")+(f.unicode?"u":"")+(g?"y":"g"),m=new p(g?f:"^(?:"+f.source+")",y),b=void 0===i?4294967295:i>>>0;if(0===b)return[];if(0===h.length)return null===l(m,h)?[h]:[];for(var w=0,S=0,x=[];S0?n:r)(e)}},function(e,t,r){"use strict";var n=r(12),i=r(70),o=r(38),a=r(79),s=[].join,u=i!=Object,c=a("join",",");n({target:"Array",proto:!0,forced:u||c},{join:function(e){return s.call(o(this),void 0===e?",":e)}})},function(e,t,r){var n=r(33),i=Date.prototype,o=i.toString,a=i.getTime;new Date(NaN)+""!="Invalid Date"&&n(i,"toString",(function(){var e=a.call(this);return e==e?o.call(this):"Invalid Date"}))},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));r(6),r(14);function n(e){return e.replace(/&(?!amp;|lt;|gt;)/g,"&").replace(//g,">")}},function(e,t,r){var n=r(70),i=r(32);e.exports=function(e){return n(i(e))}},function(e,t,r){"use strict";var n=r(12),i=r(74).indexOf,o=r(79),a=[].indexOf,s=!!a&&1/[1].indexOf(1,-0)<0,u=o("indexOf");n({target:"Array",proto:!0,forced:s||u},{indexOf:function(e){return s?a.apply(this,arguments)||0:i(this,e,arguments.length>1?arguments[1]:void 0)}})},function(e,t,r){"use strict";var n=r(12),i=r(148);n({target:"Array",proto:!0,forced:[].forEach!=i},{forEach:i})},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0),i=r(1);function o(){if(!this.listID)throw"[SharepointPlus 'info'] the list ID/Name is required.";if(!this.url)throw"[SharepointPlus 'info'] not able to find the URL!";return n.a.call(this,{url:this.url+"/_vti_bin/lists.asmx",body:Object(i.a)("GetList",""+this.listID+""),headers:{SOAPAction:"http://schemas.microsoft.com/sharepoint/soap/GetList"}}).then((function(e){var t,r,n,i,o,a,s,u,c,l,f,h,p,d=[],g=e.getElementsByTagName("Field"),v=0,y=e.getElementsByTagName("List");for(r=(y=y.length>0?y[0]:null).attributes,d._List={},s=0;s0&&(t.Property[h[0].firstChild.nodeValue]=p.length>0?p[0].firstChild.nodeValue:null);break;default:t.Choices=[]}t[n]=i}if((o=g[s].getElementsByTagName("Default").length)>0){a=g[s].getElementsByTagName("Default"),d[v].DefaultValue=[];for(var m=0;m(.*<\/DateRangesOverlap>)(.*)<\/And>$/))&&3===w.length&&(g.WhereCAML=""+w[2]+w[1]+""),b=b.map((function(e){return""+e+g.WhereCAML+""})),d.where=b,d.whereCAML=!0),d.fields+=(""===d.fields?"":",")+g.Fields.join(","),d.orderby+=(""===d.orderby?"":",")+g.OrderBy,d.calendarViaView=d.calendar,d.calendar=!1;case 39:if(!Array.isArray(d.where)){t.next=45;break}return S=d.where.length,x=0,t.abrupt("return",Promise.all(d.where.map((function(e){var t={};for(var r in d)t[r]=d[r];return t.where=e,m.call(Re,t).then((function(e){return"function"==typeof t.progress&&t.progress(++x,S),e}))}))).then((function(e){var t=[];return e.forEach((function(e){return t=t.concat(e)})),t})));case 45:d.originalWhere=d.where,d.nextWhere=[];case 47:if(d.progress=d.progress||function(){},A="",E="",I="",O="",N="",d.fields.length>0)for("string"==typeof d.fields&&(d.fields=d.fields.replace(/^\s+/,"").replace(/\s+$/,"").replace(/( )?,( )?/g,",").split(",")),P=0;P';if(""!==d.orderby)for(_=d.orderby.split(","),P=0;P<_.length;P++)T="ASC",(k=_[P].trim().split(" ")).length>0&&(2==k.length&&(T=k[1].toUpperCase()),E+='');if(!0!==d.calendar&&!0!==d.calendarViaView||""!==E||(E=''),""!==d.groupby)for(D=d.groupby.split(","),P=0;P';if(Array.isArray(d.merge)&&(d.mergeData=d.mergeData||[]),!0===d.calendar||!0===d.calendarViaView)for(R=["Title","EventDate","EndDate","Duration","fAllDayEvent","fRecurrence","RecurrenceData","ID","MasterSeriesItemID","UID","RecurrenceID"],P=0;P';if(!d.folderOptions||d.folderOptions.rootFolder){t.next=60;break}return t.next=58,a.a.call(this);case 58:j=t.sent,d.folderOptions.rootFolder=j._List.RootFolder;case 60:if(void 0!==d.queryOptions){t.next=80;break}if(d._queryOptions=""+d.dateInUTC+'True'+(""===A?"":"False")+""+d.expandUserField+"",!d.folderOptions){t.next=77;break}t.t0=d.folderOptions.show,t.next="FilesAndFolders_Recursive"===t.t0?66:"FilesOnly_InFolder"===t.t0?68:"FilesAndFolders_InFolder"===t.t0?70:(t.t0,72);break;case 66:return C="RecursiveAll",t.abrupt("break",73);case 68:return C="FilesOnly",t.abrupt("break",73);case 70:return C="",t.abrupt("break",73);case 72:C="Recursive";case 73:d._queryOptions+='',d.folderOptions.path&&(d._queryOptions+=""+d.folderOptions.rootFolder+"/"+d.folderOptions.path+""),t.next=78;break;case 77:d._queryOptions+='';case 78:t.next=81;break;case 80:d._queryOptions=d.queryOptions;case 81:return d.calendarOptions&&(d._queryOptions+=""+d.calendarOptions.referenceDate+"v3"+d.calendarOptions.splitRecurrence+""),""!==d.where&&(N=d.whereCAML?d.where:Object(o.a)(d.where)),!0===d.calendar&&(L="<"+d.calendarOptions.range+" />",N=""!==N?""+N+L+"":L),N=d.whereFct(N),O=""+this.listID+""+(d.viewID||"")+""+(""!=N?""+N+"":"")+(""!=I?""+I+"":"")+(""!=E?""+E+"":"")+""+A+""+d.rowlimit+""+d._queryOptions+"",O=Object(c.a)("GetListItems",O),t.next=89,l.a.call(this,{url:this.url+"/_vti_bin/Lists.asmx",body:O});case 89:if(U=t.sent,oe=[],0===(M=U.getElementsByTagName("z:row")).length&&(M=U.getElementsByTagName("row")),ue=d.json&&!d.join&&!d.innerjoin&&!d.outerjoin&&!d.joinIndex,d.showListInAttribute)for(ce=0,le=M.length;ce0)for(P=0,V=oe.length;P0)){t.next=109;break}if(0===d.results.length&&(d.results=oe),d.progress(d.results.length),!$){t.next=106;break}return d.listItemCollectionPositionNext=Object(s.a)($),t.abrupt("return",m.call(this,d));case 106:oe=d.results;case 107:t.next=117;break;case 109:if(!(d.nextWhere.length>0)){t.next=115;break}return 0===d.results.length&&(d.results=oe),d.where=d.nextWhere.slice(0),t.abrupt("return",m.call(this,d));case 115:d.where=d.originalWhere,oe=d.results.length>0?d.results:oe;case 117:if(!d.joinData){t.next=139;break}for(W=d.joinData.noindex,G=[],q="",H={length:0},W.length||alert("$SP.get() -- Error 'get': you must define the ON clause when JOIN is used."),P=0,V=oe.length;P0){for(ie=Object(p.a)(ne,60),F=0;F0)){t.next=167;break}return(ae=d.merge.shift()).merge=d.merge.slice(0),this.listID=ae.list,this.url=ae.url||this.url,ae.mergeData=d.mergeData.concat(oe.map((function(e){return e.Source=se,e}))),t.abrupt("return",m.call(this,ae));case 167:oe=d.mergeData.concat(oe.map((function(e){return e.Source=se,e})));case 168:if(oe.NextPage=$,!d.json||ue){t.next=173;break}for(ke=[],Ie=0,De=oe.length;Iep.packetsize)){t.next=22;break}g=r.slice(0),v=g.splice(0,p.packetsize),e._SP_ADD_PROGRESSVAR[p.progressVar.eventID]=function(e){return h.call(I,g,e)},d=(r=v).length,t.next=25;break;case 22:if(0!==d){t.next=25;break}return p.progress(1,1),t.abrupt("return",Promise.resolve({passed:[],failed:[]}));case 25:p.progressVar.current+=d,S='",w=0;case 28:if(!(w',S+="New",t.t0=regeneratorRuntime.keys(r[w]);case 32:if((t.t1=t.t0()).done){t.next=63;break}if(b=t.t1.value,!Object.prototype.hasOwnProperty.call(r[w],b)){t.next=61;break}y=b,m=r[w][b],Array.isArray(m)&&(m=0===m.length?"":";#"+m.join(";#")+";#"),t.t2=y,t.next="RecurrenceData"===t.t2?41:58;break;case 41:if("object"===l(m)&&(m=Object(a.a)(m)),void 0===r[w].fRecurrence&&(S+="1"),void 0===r[w].EventType&&(S+="1"),void 0===r[w].UID&&(S+="{"+Object(s.a)()+"}"),void 0===r[w].fAllDayEvent&&(S+="0"),void 0!==r[w].TimeZone){t.next=56;break}if(!e._SP_CACHE_TIMEZONEINFO[this.url]){t.next=51;break}S+=""+e._SP_CACHE_TIMEZONEINFO[this.url].ID+"",t.next=56;break;case 51:return t.next=53,c.a.call(this,{url:this.url});case 53:return x=t.sent,e._SP_CACHE_TIMEZONEINFO[this.url]=x,t.abrupt("return",h.call(this,r,f));case 56:return S+="",t.abrupt("break",61);case 58:"boolean"==typeof m&&(m=m?"1":"0"),p.escapeChar&&"string"==typeof m&&(m=Object(u.a)(m)),S+=""+m+"";case 61:t.next=32;break;case 63:S+="";case 64:w++,t.next=28;break;case 67:return S+="",t.next=70,n.a.call(this,{url:this.url+"/_vti_bin/lists.asmx",body:Object(i.a)("UpdateListItems",""+this.listID+""+S+""),headers:{SOAPAction:"http://schemas.microsoft.com/sharepoint/soap/UpdateListItems"}});case 70:for(A=t.sent,P=A.getElementsByTagName("Result"),E=P.length,_=p.progressVar.passed,T=p.progressVar.failed,w=0;w0)){t.next=79;break}return e._SP_ADD_PROGRESSVAR[p.progressVar.eventID]=void 0,t.abrupt("return",Promise.resolve({passed:_,failed:T}));case 79:return t.abrupt("return",e._SP_ADD_PROGRESSVAR[p.progressVar.eventID](p));case 80:t.next=84;break;case 82:return e._SP_ADD_PROGRESSVAR[p.progressVar.eventID]&&(e._SP_ADD_PROGRESSVAR[p.progressVar.eventID]=void 0),t.abrupt("return",Promise.resolve({passed:_,failed:T}));case 84:t.next=89;break;case 86:return t.prev=86,t.t3=t.catch(0),t.abrupt("return",Promise.reject(t.t3));case 89:case"end":return t.stop()}}),t,this,[[0,86]])})),(p=function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function a(e){f(o,n,i,a,s,"next",e)}function s(e){f(o,n,i,a,s,"throw",e)}a(void 0)}))}).apply(this,arguments)}}).call(this,r(10))},function(e,t,r){var n,i,o,a=r(164),s=r(7),u=r(22),c=r(28),l=r(25),f=r(71),h=r(73),p=s.WeakMap;if(a){var d=new p,g=d.get,v=d.has,y=d.set;n=function(e,t){return y.call(d,e,t),t},i=function(e){return g.call(d,e)||{}},o=function(e){return v.call(d,e)}}else{var m=f("state");h[m]=!0,n=function(e,t){return c(e,m,t),t},i=function(e){return l(e,m)?e[m]:{}},o=function(e){return l(e,m)}}e.exports={set:n,get:i,has:o,enforce:function(e){return o(e)?i(e):n(e,{})},getterFor:function(e){return function(t){var r;if(!u(t)||(r=i(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return r}}}},function(e,t,r){var n=r(34),i=Math.max,o=Math.min;e.exports=function(e,t){var r=n(e);return r<0?i(r+t,0):o(r,t)}},function(e,t,r){var n=r(23),i=r(63),o=r(11)("species");e.exports=function(e,t){var r,a=n(e).constructor;return void 0===a||null==(r=n(a)[o])?t:i(r)}},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));r(19),r(20),r(21),r(40),r(13),r(35),r(16),r(2),r(6),r(18),r(14),r(45),r(17);var n=r(37);function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){var r=e.replace(/(\s+)?(=|~=|<=|>=|~<>|<>|<|>| LIKE | IN )(\s+)?/g,"$2").replace(/""|''/g,"Null").replace(/==/g,"=");/\w+ IN \[([^[]+,)?Null,?/.test(r)&&(r=r.replace(/(\w+) IN \[([^\[]+,)?Null(,[^\]]+)?\]/g,"($1 = Null OR $&)").replace(/\[([^\[]+,)?Null(,[^\]]+)?\]/g,"[$1$2]").replace(/(\[),|(,),|,(\])/g,"$1$2$3"));var a=[];t=!1!==t;for(var s=r.length,u="",c="",l=!1,f="",h={open:0},p=!1,d=0;d0&&d=0?(""!=u&&(a[0]="<"+u+">"+a[0]),a[0]+=o(r.substring(v+1,d)),""!=u&&(a[0]+=""),u=""):a[0]=o(r.substring(v+1,d));break;case"[":for(v=d,y=!1;d'+w.join('')+""+c,f="",c="",b>0&&(""!=u&&(a[0]="<"+u+">"+a[0]),a[0]+=a[b],""!=u&&(a[0]+=""),delete a[b],u="");break;case">":case"<":d++,"="==r.charAt(d)?(a.push("<"+(">"==g?"G":"L")+"eq>"),c=""==g?"G":"L")+"eq>"):"<"==g&&">"==r.charAt(d)?(a.push(""),c=""):(d--,a.push("<"+(">"==g?"G":"L")+"t>"),c=""==g?"G":"L")+"t>");break;case"~":("="==r.charAt(d+1)||"<"===r.charAt(d+1)&&">"===r.charAt(d+2))&&(p=!0);break;case"=":a.push(""),c="";break;case" ":" AND "==r.substring(d,d+5).toUpperCase()?(u="And",d+=4):" OR "==r.substring(d,d+4).toUpperCase()?(u="Or",d+=3):" LIKE "==r.slice(d,d+6).toUpperCase()?(d+=5,a.push(""),c=""):" IN "==r.slice(d,d+4).toUpperCase()?(d+=3,a.push(""),c=""):f+=g;break;case'"':case"'":for(var x=g,A="",P="";(g=r.charAt(++d))!=x&&d",f="";var E="Text";/\d{4}-\d\d?-\d\d?((T| )\d{2}:\d{2}:\d{2})?/.test(A)&&(E="DateTime",/\d{4}-\d\d?-\d\d?((T| )\d{2}:\d{2}:\d{2})/.test(A)&&(P=' IncludeTimeValue="TRUE"')),t&&(A=Object(n.a)(A)),"[Me]"===A?(A='',E="Integer"):"[Today"==A.slice(0,6)&&(E="DateTime",A=''),a[b]+='"+A+"",a[b]+=c,c="",b>0&&(""!=u&&(a[0]="<"+u+">"+a[0]),a[0]+=a[b],""!=u&&(a[0]+=""),delete a[b],u="");break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":if(""!=c){for(var _=g;!isNaN(g=r.charAt(++d))&&d",f="",a[b]+=''+_.replace(/ $/,"")+"",a[b]+=c,c="",b>0&&(""!=u&&(a[0]="<"+u+">"+a[0]),a[0]+=a[b],""!=u&&(a[0]+=""),delete a[b],u=""),d-=2;break}default:""==c?f+=g:"n"==g.toLowerCase()&&"null"==r.substring(d,d+4).toLowerCase()?(b=a.length-1,""==c?(a[b]="",c=""):""==c&&(a[b]="",c=""),d+=3,a[b]+='',f="",a[b]+=c,c="",b>0&&(""!=u&&(a[0]="<"+u+">"+a[0]),a[0]+=a[b],""!=u&&(a[0]+=""),delete a[b],u="")):("t"===g.toLowerCase()&&"true"===r.substring(d,d+4).toLowerCase()||"f"===g.toLowerCase()&&"false"===r.substring(d,d+5).toLowerCase())&&(b=a.length-1,d+=3,"f"===g.toLowerCase()&&d++,a[b]+=''+("t"===g.toLowerCase()?1:0)+"",f="",a[b]+=c,c="",b>0&&(""!=u&&(a[0]="<"+u+">"+a[0]),a[0]+=a[b],""!=u&&(a[0]+=""),delete a[b],u=""))}}return a.join("")}},function(e,t,r){var n=r(27),i=r(120),o=r(52),a=r(38),s=r(59),u=r(25),c=r(121),l=Object.getOwnPropertyDescriptor;t.f=n?l:function(e,t){if(e=a(e),t=s(t,!0),c)try{return l(e,t)}catch(e){}if(u(e,t))return o(!i.f.call(e,t),e[t])}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t){e.exports=!1},function(e,t,r){var n=r(124),i=r(7),o=function(e){return"function"==typeof e?e:void 0};e.exports=function(e,t){return arguments.length<2?o(n[e])||o(i[e]):n[e]&&n[e][t]||i[e]&&i[e][t]}},function(e,t,r){"use strict";var n=r(12),i=r(48),o=r(34),a=r(15),s=r(31),u=r(105),c=r(112),l=r(65),f=Math.max,h=Math.min;n({target:"Array",proto:!0,forced:!l("splice")},{splice:function(e,t){var r,n,l,p,d,g,v=s(this),y=a(v.length),m=i(e,y),b=arguments.length;if(0===b?r=n=0:1===b?(r=0,n=y-m):(r=b-2,n=h(f(o(t),0),y-m)),y+r-n>9007199254740991)throw TypeError("Maximum allowed length exceeded");for(l=u(v,n),p=0;py-n+r;p--)delete v[p-1]}else if(r>n)for(p=y-n;p>m;p--)g=p+r-1,(d=p+n-1)in v?v[g]=v[d]:delete v[g];for(p=0;p]+>([^<]+)<\/[^>]+>$/m,"$1")};return["firstDayOfWeek","daily","weekly","monthly","monthlyByDay","yearly","yearlyByDay","windowEnd","repeatInstances"].forEach((function(e){var n=i.getElementsByTagName(e);if(1===n.length){var o=n[0];switch(/y$/.test(e)&&(r.type=e),e){case"firstDayOfWeek":for(var s=a(o),u=0;u"+(e.firstDayOfWeek.toLowerCase().slice(0,2)||"mo")+"<"+e.type+" ",e.type){case"daily":r+=(e.frequency?'dayFrequency="'+e.frequency+'"':'weekday="TRUE"')+" />";break;case"weekly":t.forEach((function(t){e.on[t]&&(r+=t.slice(0,2)+'="TRUE" ')})),r+='weekFrequency="'+e.frequency+'" />';break;case"monthly":r+='monthFrequency="'+e.frequency+'" day="'+e.on.day+'" />';break;case"yearlyByDay":case"monthlyByDay":["day","weekday","weekend"].concat(t).forEach((function(t,n){e.on[t]&&(r+=n<3?t+("weekend"===t?"_day":""):t.slice(0,2),-1===(r+='="TRUE" ').indexOf("ayOfMonth")&&(r+="week"+("monthlyByDay"===e.type?"d":"D")+'ayOfMonth="'+e.on[t]+'" '),t=e.on[t])})),e.on.month&&(r+=' month="'+e.on.month+'"'),r+=("monthlyByDay"===e.type?"month":"year")+'Frequency="'+e.frequency+'" />';break;case"yearly":r+='yearFrequency="'+e.frequency+'" month="'+e.on.month+'" day="'+e.on.day+'" />'}return r+="",e.endDate?r+=""+new Date(e.endDate).toISOString().replace(/.000Z/,"Z")+"":e.endAfter?r+=""+e.endAfter+"":r+="FALSE",r+=""}return null}},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));r(36),r(2),r(116);function n(){for(var e="",t=0;t<32;t++){var r=Math.floor(16*Math.random());switch(t){case 8:e+="-";break;case 12:r=4,e+="-";break;case 16:r=3&r|8,e+="-";break;case 20:e+="-"}e+=r.toString(16)}return e}},function(e,t,r){"use strict";(function(e){r.d(t,"a",(function(){return i}));r(19),r(20),r(21),r(13),r(16),r(55),r(66),r(2),r(18),r(17),r(82);function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(t,r){var o,a=this;switch(arguments.length){case 0:throw"Error 'removeNotify': you must provide 'name' or 'options'.";case 2:if("object"!==n(r))throw"Error 'removeNotify': you must provide an object for 'options'."}if(1===arguments.length&&"object"===n(t)&&(r=t,t=void 0),(r=r||{all:!1}).timeout=!0===r.timeout,!1===e._SP_NOTIFY_READY&&e._SP_NOTIFY_QUEUE.length>0)return setTimeout((function(){return i.call(a,t,r)}),150),this;if(!0===r.all){for(var s=[];e._SP_NOTIFY.length>0;)o=e._SP_NOTIFY.shift(),!1===r.includeSticky&&!0===o.options.sticky?s.push(o):(SP.UI.Notify.removeNotification(o.id),setTimeout((function(){return o.options.after.call(a,o.name,!1)}),150));e._SP_NOTIFY=s.slice(0)}else if(void 0!==t)for(var u=0,c=e._SP_NOTIFY.length;u=51||!n((function(){var t=[];return(t.constructor={})[a]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}},function(e,t,r){var n=r(27),i=r(24).f,o=Function.prototype,a=o.toString,s=/^\s*function ([^ (]*)/;!n||"name"in o||i(o,"name",{configurable:!0,get:function(){try{return a.call(this).match(s)[1]}catch(e){return""}}})},function(e,t,r){"use strict";(function(e){r.d(t,"a",(function(){return o}));r(39),r(35),r(16),r(36),r(2),r(3),r(6),r(30),r(5);var n=r(0);function i(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)}function o(e){return a.apply(this,arguments)}function a(){var t;return t=regeneratorRuntime.mark((function t(r){var i,o,a,s;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,(r=r||{}).cache=!1!==r.cache,(a=r.url||this.url)||(a=window.location.href.split("/").slice(0,3).join("/")),-1!==(a=a.toLowerCase()).indexOf("_api")?a=a.split("_api")[0]:-1!==a.indexOf("_vti_bin/client.svc/processquery")&&(a=a.split("_vti_bin/client.svc/processquery")[0]),r.cache&&(o=e._SP_CACHE_REQUESTDIGEST[a]),!o){t.next=11;break}if(!((new Date).getTime()-new Date(o.split(",")[1]).getTime()<864e5)){t.next=11;break}return t.abrupt("return",Promise.resolve(o));case 11:if(!(e._SP_ISBROWSER&&document&&r.cache)){t.next=17;break}if(!(i=document.querySelector("#__REQUESTDIGEST"))){t.next=17;break}return o=i.value,e._SP_CACHE_REQUESTDIGEST[a]=o,t.abrupt("return",Promise.resolve(o));case 17:return t.next=19,n.a.call(this,{url:a+"/_api/contextinfo",method:"POST"});case 19:return s=t.sent,o=s.d.GetContextWebInformation.FormDigestValue,e._SP_CACHE_REQUESTDIGEST[a]=o,e._SP_ISBROWSER&&document&&(i=document.querySelector("#__REQUESTDIGEST"))&&(i.value=o),t.abrupt("return",Promise.resolve(o));case 26:return t.prev=26,t.t0=t.catch(0),t.abrupt("return",Promise.reject(t.t0));case 29:case"end":return t.stop()}}),t,this,[[0,26]])})),(a=function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function s(e){i(a,n,o,s,u,"next",e)}function u(e){i(a,n,o,s,u,"throw",e)}s(void 0)}))}).apply(this,arguments)}}).call(this,r(10))},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));r(16),r(6),r(14),r(30);function n(e){if(!e)return{id:"",value:""};var t=e.split(";#");return t.length<=2?{id:t[0],value:void 0===t[1]?t[0]:t[1]}:{id:e.replace(/([0-9]+;#)([^;]+)/g,"$1").replace(/;#;#/g,",").slice(0,-2).split(","),value:e.replace(/([0-9]+;#)([^;]+)/g,"$2").split(";#")}}},function(e,t,r){"use strict";function n(e){var t={width:0,height:0},r={width:0,height:0},n=e||window,i=n.document,o=i.documentElement,a=i.querySelector("body");return t.width=n.innerWidth||o.clientWidth||a.clientWidth,t.height=n.innerHeight||o.clientHeight||a.clientHeight,r.width=Math.max(a.scrollWidth,o.scrollWidth,a.offsetWidth,o.offsetWidth,a.clientWidth,o.clientWidth),r.height=Math.max(a.scrollHeight,o.scrollHeight,a.offsetHeight,o.offsetHeight,a.clientHeight,o.clientHeight),document.all&&document.querySelector&&!document.addEventListener&&t.width+4==r.width&&t.height+4==r.height&&(t.width=r.width,t.height=r.height),{vw:t,doc:r}}r.d(t,"a",(function(){return n}))},function(e,t,r){var n=r(9),i=r(43),o="".split;e.exports=n((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==i(e)?o.call(e,""):Object(e)}:Object},function(e,t,r){var n=r(102),i=r(72),o=n("keys");e.exports=function(e){return o[e]||(o[e]=i(e))}},function(e,t){var r=0,n=Math.random();e.exports=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++r+n).toString(36)}},function(e,t){e.exports={}},function(e,t,r){var n=r(38),i=r(15),o=r(48),a=function(e){return function(t,r,a){var s,u=n(t),c=i(u.length),l=o(a,c);if(e&&r!=r){for(;c>l;)if((s=u[l++])!=s)return!0}else for(;c>l;l++)if((e||l in u)&&u[l]===r)return e||l||0;return!e&&-1}};e.exports={includes:a(!0),indexOf:a(!1)}},function(e,t,r){var n,i=r(23),o=r(166),a=r(103),s=r(73),u=r(130),c=r(99),l=r(71),f=l("IE_PROTO"),h=function(){},p=function(e){return" diff --git a/docs/files.html b/docs/files.html index f5c41be..c06adfd 100644 --- a/docs/files.html +++ b/docs/files.html @@ -298,7 +298,7 @@

Example:

Documentation built by @aymkdn (http://kodono.info) with JSDoc.
This work is licensed under LGPL-3.
Designed with Bootstrap from Twitter.
-
Automatically generated with JSDoc on Wed, 08 Jan 2020 09:13:47 GMT
+
Automatically generated with JSDoc on Mon, 13 Jan 2020 11:19:17 GMT
diff --git a/docs/index.html b/docs/index.html index 229db66..8417c8b 100644 --- a/docs/index.html +++ b/docs/index.html @@ -370,7 +370,7 @@

Older Versions

Documentation built by @aymkdn (http://kodono.info) with JSDoc.
This work is licensed under LGPL-3.
Designed with Bootstrap from Twitter.
-
Automatically generated with JSDoc on Wed, 08 Jan 2020 09:13:47 GMT
+
Automatically generated with JSDoc on Mon, 13 Jan 2020 11:19:17 GMT
diff --git a/docs/lists.html b/docs/lists.html index dae7967..e8e33d2 100644 --- a/docs/lists.html +++ b/docs/lists.html @@ -1584,7 +1584,7 @@

Example:

Documentation built by @aymkdn (http://kodono.info) with JSDoc.
This work is licensed under LGPL-3.
Designed with Bootstrap from Twitter.
-
Automatically generated with JSDoc on Wed, 08 Jan 2020 09:13:47 GMT
+
Automatically generated with JSDoc on Mon, 13 Jan 2020 11:19:17 GMT
diff --git a/docs/modals.html b/docs/modals.html index 64a8599..182109e 100644 --- a/docs/modals.html +++ b/docs/modals.html @@ -380,7 +380,7 @@

Parameters:

Documentation built by @aymkdn (http://kodono.info) with JSDoc.
This work is licensed under LGPL-3.
Designed with Bootstrap from Twitter.
-
Automatically generated with JSDoc on Wed, 08 Jan 2020 09:13:47 GMT
+
Automatically generated with JSDoc on Mon, 13 Jan 2020 11:19:17 GMT
diff --git a/docs/node.html b/docs/node.html index 66f47e7..094ea36 100644 --- a/docs/node.html +++ b/docs/node.html @@ -161,7 +161,7 @@

Example:

Documentation built by @aymkdn (http://kodono.info) with JSDoc.
This work is licensed under LGPL-3.
Designed with Bootstrap from Twitter.
-
Automatically generated with JSDoc on Wed, 08 Jan 2020 09:13:47 GMT
+
Automatically generated with JSDoc on Mon, 13 Jan 2020 11:19:17 GMT
diff --git a/docs/people.html b/docs/people.html index eb45533..6cb5a83 100644 --- a/docs/people.html +++ b/docs/people.html @@ -470,7 +470,7 @@

Example:

Documentation built by @aymkdn (http://kodono.info) with JSDoc.
This work is licensed under LGPL-3.
Designed with Bootstrap from Twitter.
-
Automatically generated with JSDoc on Wed, 08 Jan 2020 09:13:47 GMT
+
Automatically generated with JSDoc on Mon, 13 Jan 2020 11:19:17 GMT
diff --git a/docs/utils.html b/docs/utils.html index dc941c5..0a4de07 100644 --- a/docs/utils.html +++ b/docs/utils.html @@ -840,7 +840,7 @@

Example:

Documentation built by @aymkdn (http://kodono.info) with JSDoc.
This work is licensed under LGPL-3.
Designed with Bootstrap from Twitter.
-
Automatically generated with JSDoc on Wed, 08 Jan 2020 09:13:47 GMT
+
Automatically generated with JSDoc on Mon, 13 Jan 2020 11:19:17 GMT
diff --git a/es5/lists/get.js b/es5/lists/get.js index e6c0781..edc5b58 100644 --- a/es5/lists/get.js +++ b/es5/lists/get.js @@ -1,3 +1,4 @@ +import _typeof from "@babel/runtime-corejs3/helpers/esm/typeof"; import _regeneratorRuntime from "@babel/runtime-corejs3/regenerator"; import _startsWithInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/starts-with"; import _trimInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/trim"; @@ -468,695 +469,751 @@ export default function get(_x) { function _get() { _get = _asyncToGenerator( /*#__PURE__*/ - _regeneratorRuntime.mark(function _callee(options) { + _regeneratorRuntime.mark(function _callee2(options) { var _this = this; - var setup, _view, _context, _where, mtchDateRanges, _context2, totalWhere, cntWhere, fields, i, orderby, fieldsDir, direction, splt, groupby, gFields, tmpFields, body, viewAttr, where, whereDateRanges, _context3, infos, data, rows, j, stop, collection, on, aResult, prevIndex, index, listIndexFound, nextPage, joinDataLen, tmp, attributes, attributesReturn, attr, attributesJoinData, joinIndexLen, idx, joinData, joinIndex, joinWhereLookup, wh, aReturn, mergeSetup, mergeSource, doJSON, _i, len, _attributes, _tmp, _j, _context4, _len, lenFields, _i2, ret, attrs, attrsLen, _i3, _context5, fieldName, _i4, _fieldName, _i5, _len2, _context6, _context7, _context8, _context9, whereParsed, onLookupWhereParsed, _context10, _context11, _context12, _context13, _context14, _ret, _i6, _len3; + var mtchDateRanges, _ret; - return _regeneratorRuntime.wrap(function _callee$(_context15) { + return _regeneratorRuntime.wrap(function _callee2$(_context17) { while (1) { - switch (_context15.prev = _context15.next) { + switch (_context17.prev = _context17.next) { case 0: - _context15.prev = 0; - - if (this.listID) { - _context15.next = 3; - break; - } - - return _context15.abrupt("return", _Promise.reject("[SharepointPlus 'get']: the list ID/Name is required")); - - case 3: - // default values - setup = {}; - cloneObject(true, setup, options); - - if (this.url) { - _context15.next = 7; - break; - } - - return _context15.abrupt("return", _Promise.reject("[SharepointPlus 'get']: not able to find the URL!")); - - case 7: - // we cannot determine the url - setup.fields = setup.fields || ""; - setup.where = setup.where || ""; - - setup.whereFct = setup.whereFct || function (w) { - return w; - }; - - setup.orderby = setup.orderby || ""; - setup.useIndexForOrderBy = setup.useIndexForOrderBy === true ? true : false; - setup.groupby = setup.groupby || ""; - setup.rowlimit = setup.rowlimit || 0; - setup.whereEscapeChar = setup.whereEscapeChar === false ? false : true; - setup.paging = setup.paging === true ? true : false; - setup.page = setup.paging === false || isNaN(setup.page) ? 5000 : setup.page; - if (setup.paging && setup.rowlimit === 0) setup.rowlimit = 5000; // if rowlimit is not defined, we set it to 5000 by default - - setup.expandUserField = setup.expandUserField === true || setup.expandUserField === "True" ? "True" : "False"; - setup.dateInUTC = setup.dateInUTC === true ? "True" : "False"; - setup.folderOptions = setup.folderOptions || null; - setup.view = setup.view || ""; - setup.alias = setup.alias || this.listID; - setup.calendar = setup.calendar === true ? true : false; - - if (setup.calendar === true) { - setup.calendarOptions = setup.calendarOptions || {}; - setup.calendarOptions.referenceDate = setup.calendarOptions.referenceDate || new Date(); - if (typeof setup.calendarOptions.referenceDate !== "string") setup.calendarOptions.referenceDate = toSPDate(setup.calendarOptions.referenceDate); - setup.calendarOptions.splitRecurrence = setup.calendarOptions.splitRecurrence === false ? "FALSE" : "TRUE"; - setup.calendarOptions.range = setup.calendarOptions.range || "Month"; - } // if we want to force the ListName in the attribute name, but don't do it when there is a join - - - if (setup.showListInAttribute && (setup.join || setup.innerjoin || setup.outerjoin)) { - setup.showListInAttribute = false; - } // if (setup.whereCAML!==true) setup.whereCAML = (setup.view!=""); - - - setup.results = setup.results || []; // internal use when there is a paging - - setup.listItemCollectionPositionNext = setup.listItemCollectionPositionNext || ""; // for paging - // protect & into ListItemCollectionPositionNext - - if (setup.listItemCollectionPositionNext) setup.listItemCollectionPositionNext = setup.listItemCollectionPositionNext.replace(/&/g, "&").replace(/&amp;/g, "&"); // if view is defined, then we need to find the view ID - - if (!(setup.view !== "")) { - _context15.next = 39; - break; - } + _context17.prev = 0; + return _context17.delegateYield( + /*#__PURE__*/ + _regeneratorRuntime.mark(function _callee() { + var setup, _view, _context, _where, _context2, totalWhere, cntWhere, fields, i, orderby, fieldsDir, direction, splt, groupby, gFields, tmpFields, body, viewAttr, where, whereDateRanges, _context3, infos, data, rows, j, stop, collection, on, aResult, prevIndex, index, listIndexFound, nextPage, joinDataLen, tmp, attributes, attributesReturn, attr, attributesJoinData, joinIndexLen, idx, joinData, joinIndex, joinWhereLookup, wh, aReturn, mergeSetup, mergeSource, doJSON, _i, len, _attributes, _tmp, _j, _context4, _len, lenFields, _loop, _i2, _i4, _len2, _context7, _context8, _context9, _context10, whereParsed, onLookupWhereParsed, _context11, _context12, _context13, _context14, _context15, ret, _i5, _len3; + + return _regeneratorRuntime.wrap(function _callee$(_context16) { + while (1) { + switch (_context16.prev = _context16.next) { + case 0: + if (_this.listID) { + _context16.next = 2; + break; + } + + return _context16.abrupt("return", { + v: _Promise.reject("[SharepointPlus 'get']: the list ID/Name is required") + }); - _context15.next = 32; - return view.call(this, setup.view); - - case 32: - _view = _context15.sent; - setup.view = _view.ID; // the view will return a WHERE clause in CAML format - - if (_view.WhereCAML) { - if (!_Array$isArray(setup.where)) _where = [setup.where];else _where = _sliceInstanceProperty(_context = setup.where).call(_context, 0); - _where = _mapInstanceProperty(_where).call(_where, function (w) { - // is our original Where in the setup is already converted in CAML ? - // If not, we convert it in order to merge with the one from the View - return setup.whereCAML ? w : parse(w); - }); // if we have a 'DateRangesOverlap' then we want to move this part at the end -- since v3.0.9 - - mtchDateRanges = _view.WhereCAML.match(/^(.*<\/DateRangesOverlap>)(.*)<\/And>$/); - if (mtchDateRanges && mtchDateRanges.length === 3) _view.WhereCAML = '' + mtchDateRanges[2] + mtchDateRanges[1] + ''; - _where = _mapInstanceProperty(_where).call(_where, function (w) { - return "" + w + _view.WhereCAML + ""; - }); - setup.where = _where; - setup.whereCAML = true; - } + case 2: + // default values + setup = {}; + cloneObject(true, setup, options); - setup.fields += (setup.fields === "" ? "" : ",") + _view.Fields.join(","); - setup.orderby += (setup.orderby === "" ? "" : ",") + _view.OrderBy; // disable the calendar option + if (_this.url) { + _context16.next = 6; + break; + } - setup.calendarViaView = setup.calendar; - setup.calendar = false; + return _context16.abrupt("return", { + v: _Promise.reject("[SharepointPlus 'get']: not able to find the URL!") + }); - case 39: - if (!_Array$isArray(setup.where)) { - _context15.next = 45; - break; - } + case 6: + // we cannot determine the url + setup.fields = setup.fields || ""; + setup.where = setup.where || ""; + + setup.whereFct = setup.whereFct || function (w) { + return w; + }; + + setup.orderby = setup.orderby || ""; + setup.useIndexForOrderBy = setup.useIndexForOrderBy === true ? true : false; + setup.groupby = setup.groupby || ""; + setup.rowlimit = setup.rowlimit || 0; + setup.whereEscapeChar = setup.whereEscapeChar === false ? false : true; + setup.paging = setup.paging === true ? true : false; + setup.page = setup.paging === false || isNaN(setup.page) ? 5000 : setup.page; + if (setup.paging && setup.rowlimit === 0) setup.rowlimit = 5000; // if rowlimit is not defined, we set it to 5000 by default + + setup.expandUserField = setup.expandUserField === true || setup.expandUserField === "True" ? "True" : "False"; + setup.dateInUTC = setup.dateInUTC === true ? "True" : "False"; + setup.folderOptions = setup.folderOptions || null; + setup.view = setup.view || ""; + setup.alias = setup.alias || _this.listID; + setup.calendar = setup.calendar === true ? true : false; + + if (setup.calendar === true) { + setup.calendarOptions = setup.calendarOptions || {}; + setup.calendarOptions.referenceDate = setup.calendarOptions.referenceDate || new Date(); + if (typeof setup.calendarOptions.referenceDate !== "string") setup.calendarOptions.referenceDate = toSPDate(setup.calendarOptions.referenceDate); + setup.calendarOptions.splitRecurrence = setup.calendarOptions.splitRecurrence === false ? "FALSE" : "TRUE"; + setup.calendarOptions.range = setup.calendarOptions.range || "Month"; + } // if we want to force the ListName in the attribute name, but don't do it when there is a join + + + if (setup.showListInAttribute && (setup.join || setup.innerjoin || setup.outerjoin)) { + setup.showListInAttribute = false; + } // if (setup.whereCAML!==true) setup.whereCAML = (setup.view!=""); + + + setup.results = setup.results || []; // internal use when there is a paging + + setup.listItemCollectionPositionNext = setup.listItemCollectionPositionNext || ""; // for paging + // protect & into ListItemCollectionPositionNext + + if (setup.listItemCollectionPositionNext) setup.listItemCollectionPositionNext = setup.listItemCollectionPositionNext.replace(/&/g, "&").replace(/&amp;/g, "&"); // if view is defined, then we need to find the view ID + + if (!(setup.view !== "")) { + _context16.next = 38; + break; + } + + _context16.next = 31; + return view.call(_this, setup.view); + + case 31: + _view = _context16.sent; + setup.view = _view.ID; // the view will return a WHERE clause in CAML format + + if (_view.WhereCAML) { + if (!_Array$isArray(setup.where)) _where = [setup.where];else _where = _sliceInstanceProperty(_context = setup.where).call(_context, 0); + _where = _mapInstanceProperty(_where).call(_where, function (w) { + // is our original Where in the setup is already converted in CAML ? + // If not, we convert it in order to merge with the one from the View + return setup.whereCAML ? w : parse(w); + }); // if we have a 'DateRangesOverlap' then we want to move this part at the end -- since v3.0.9 + + mtchDateRanges = _view.WhereCAML.match(/^(.*<\/DateRangesOverlap>)(.*)<\/And>$/); + if (mtchDateRanges && mtchDateRanges.length === 3) _view.WhereCAML = '' + mtchDateRanges[2] + mtchDateRanges[1] + ''; + _where = _mapInstanceProperty(_where).call(_where, function (w) { + return "" + w + _view.WhereCAML + ""; + }); + setup.where = _where; + setup.whereCAML = true; + } + + setup.fields += (setup.fields === "" ? "" : ",") + _view.Fields.join(","); + setup.orderby += (setup.orderby === "" ? "" : ",") + _view.OrderBy; // disable the calendar option + + setup.calendarViaView = setup.calendar; + setup.calendar = false; + + case 38: + if (!_Array$isArray(setup.where)) { + _context16.next = 44; + break; + } + + /*setup.where = setup.where.slice(0); // clone the original array + if (!setup.originalWhere) setup.originalWhere = setup.where.slice(0); + setup.nextWhere = setup.where.slice(1); + setup.where = setup.where.shift();*/ + totalWhere = setup.where.length; + cntWhere = 0; + return _context16.abrupt("return", { + v: _Promise.all(_mapInstanceProperty(_context2 = setup.where).call(_context2, function (w) { + var params = {}; + + for (var k in setup) { + params[k] = setup[k]; + } + + params.where = w; + return get.call(_this, params).then(function (data) { + if (typeof params.progress === "function") params.progress(++cntWhere, totalWhere); + return data; + }); + })).then(function (allData) { + var data = []; + + _forEachInstanceProperty(allData).call(allData, function (d) { + return data = _concatInstanceProperty(data).call(data, d); + }); + + return data; + }) + }); - /*setup.where = setup.where.slice(0); // clone the original array - if (!setup.originalWhere) setup.originalWhere = setup.where.slice(0); - setup.nextWhere = setup.where.slice(1); - setup.where = setup.where.shift();*/ - totalWhere = setup.where.length; - cntWhere = 0; - return _context15.abrupt("return", _Promise.all(_mapInstanceProperty(_context2 = setup.where).call(_context2, function (w) { - var params = {}; + case 44: + setup.originalWhere = setup.where; + setup.nextWhere = []; - for (var k in setup) { - params[k] = setup[k]; - } + case 46: + // we use the progress only when WHERE is an array + setup.progress = setup.progress || function () {}; // what about the fields ? - params.where = w; - return get.call(_this, params).then(function (data) { - if (typeof params.progress === "function") params.progress(++cntWhere, totalWhere); - return data; - }); - })).then(function (allData) { - var data = []; - _forEachInstanceProperty(allData).call(allData, function (d) { - return data = _concatInstanceProperty(data).call(data, d); - }); + fields = "", orderby = "", groupby = "", body = "", where = ""; - return data; - })); + if (setup.fields.length > 0) { + if (typeof setup.fields === "string") setup.fields = setup.fields.replace(/^\s+/, "").replace(/\s+$/, "").replace(/( )?,( )?/g, ",").split(","); - case 45: - setup.originalWhere = setup.where; - setup.nextWhere = []; + for (i = 0; i < setup.fields.length; i++) { + fields += ''; + } + } // what about sorting ? - case 47: - // we use the progress only when WHERE is an array - setup.progress = setup.progress || function () {}; // what about the fields ? + if (setup.orderby !== "") { + fieldsDir = setup.orderby.split(","); - fields = "", orderby = "", groupby = "", body = "", where = ""; + for (i = 0; i < fieldsDir.length; i++) { + direction = "ASC"; + splt = _trimInstanceProperty(_context3 = fieldsDir[i]).call(_context3).split(" "); - if (setup.fields.length > 0) { - if (typeof setup.fields === "string") setup.fields = setup.fields.replace(/^\s+/, "").replace(/\s+$/, "").replace(/( )?,( )?/g, ",").split(","); + if (splt.length > 0) { + if (splt.length == 2) direction = splt[1].toUpperCase(); + orderby += ''; + } + } + } // if calendar:true and no orderby, then we order by the EventDate - for (i = 0; i < setup.fields.length; i++) { - fields += ''; - } - } // what about sorting ? + if ((setup.calendar === true || setup.calendarViaView === true) && orderby === "") orderby = ''; // what about groupby ? - if (setup.orderby !== "") { - fieldsDir = setup.orderby.split(","); + if (setup.groupby !== "") { + gFields = setup.groupby.split(","); - for (i = 0; i < fieldsDir.length; i++) { - direction = "ASC"; - splt = _trimInstanceProperty(_context3 = fieldsDir[i]).call(_context3).split(" "); + for (i = 0; i < gFields.length; i++) { + groupby += ''; + } + } // if we merge several similar lists - if (splt.length > 0) { - if (splt.length == 2) direction = splt[1].toUpperCase(); - orderby += ''; - } - } - } // if calendar:true and no orderby, then we order by the EventDate + if (_Array$isArray(setup.merge)) { + setup.mergeData = setup.mergeData || []; + } // when it's a calendar we want to retrieve some fields by default - if ((setup.calendar === true || setup.calendarViaView === true) && orderby === "") orderby = ''; // what about groupby ? - if (setup.groupby !== "") { - gFields = setup.groupby.split(","); + if (setup.calendar === true || setup.calendarViaView === true) { + tmpFields = ["Title", "EventDate", "EndDate", "Duration", "fAllDayEvent", "fRecurrence", "RecurrenceData", "ID", "MasterSeriesItemID", "UID", "RecurrenceID"]; - for (i = 0; i < gFields.length; i++) { - groupby += ''; - } - } // if we merge several similar lists + for (i = 0; i < tmpFields.length; i++) { + fields += ''; + } + } // forge the parameters - if (_Array$isArray(setup.merge)) { - setup.mergeData = setup.mergeData || []; - } // when it's a calendar we want to retrieve some fields by default + if (!(setup.folderOptions && !setup.folderOptions.rootFolder)) { + _context16.next = 59; + break; + } + _context16.next = 57; + return info.call(_this); - if (setup.calendar === true || setup.calendarViaView === true) { - tmpFields = ["Title", "EventDate", "EndDate", "Duration", "fAllDayEvent", "fRecurrence", "RecurrenceData", "ID", "MasterSeriesItemID", "UID", "RecurrenceID"]; + case 57: + infos = _context16.sent; + setup.folderOptions.rootFolder = infos._List.RootFolder; - for (i = 0; i < tmpFields.length; i++) { - fields += ''; - } - } // forge the parameters + case 59: + if (!(setup.queryOptions === undefined)) { + _context16.next = 79; + break; + } + setup._queryOptions = "" + setup.dateInUTC + "" + "" + "True" + (fields === "" ? "" : "False") + "" + setup.expandUserField + ""; // check if we want something related to the folders - if (!(setup.folderOptions && !setup.folderOptions.rootFolder)) { - _context15.next = 60; - break; - } + if (!setup.folderOptions) { + _context16.next = 76; + break; + } - _context15.next = 58; - return info.call(this); + _context16.t0 = setup.folderOptions.show; + _context16.next = _context16.t0 === "FilesAndFolders_Recursive" ? 65 : _context16.t0 === "FilesOnly_InFolder" ? 67 : _context16.t0 === "FilesAndFolders_InFolder" ? 69 : _context16.t0 === "FilesOnly_Recursive" ? 71 : 71; + break; - case 58: - infos = _context15.sent; - setup.folderOptions.rootFolder = infos._List.RootFolder; + case 65: + viewAttr = "RecursiveAll"; + return _context16.abrupt("break", 72); - case 60: - if (!(setup.queryOptions === undefined)) { - _context15.next = 80; - break; - } + case 67: + viewAttr = "FilesOnly"; + return _context16.abrupt("break", 72); - setup._queryOptions = "" + setup.dateInUTC + "" + "" + "True" + (fields === "" ? "" : "False") + "" + setup.expandUserField + ""; // check if we want something related to the folders + case 69: + viewAttr = ""; + return _context16.abrupt("break", 72); - if (!setup.folderOptions) { - _context15.next = 77; - break; - } + case 71: + viewAttr = "Recursive"; - _context15.t0 = setup.folderOptions.show; - _context15.next = _context15.t0 === "FilesAndFolders_Recursive" ? 66 : _context15.t0 === "FilesOnly_InFolder" ? 68 : _context15.t0 === "FilesAndFolders_InFolder" ? 70 : _context15.t0 === "FilesOnly_Recursive" ? 72 : 72; - break; + case 72: + setup._queryOptions += ""; + if (setup.folderOptions.path) setup._queryOptions += "" + setup.folderOptions.rootFolder + '/' + setup.folderOptions.path + ""; + _context16.next = 77; + break; - case 66: - viewAttr = "RecursiveAll"; - return _context15.abrupt("break", 73); + case 76: + setup._queryOptions += ""; - case 68: - viewAttr = "FilesOnly"; - return _context15.abrupt("break", 73); + case 77: + _context16.next = 80; + break; - case 70: - viewAttr = ""; - return _context15.abrupt("break", 73); + case 79: + setup._queryOptions = setup.queryOptions; - case 72: - viewAttr = "Recursive"; + case 80: + if (setup.calendarOptions) { + setup._queryOptions += "" + setup.calendarOptions.referenceDate + "" + "v3" + "" + setup.calendarOptions.splitRecurrence + ""; + } // what about the Where ? - case 73: - setup._queryOptions += ""; - if (setup.folderOptions.path) setup._queryOptions += "" + setup.folderOptions.rootFolder + '/' + setup.folderOptions.path + ""; - _context15.next = 78; - break; - case 77: - setup._queryOptions += ""; + if (setup.where !== "") { + if (setup.whereCAML) where = setup.where;else where = parse(setup.where); + } - case 78: - _context15.next = 81; - break; + if (setup.calendar === true) { + whereDateRanges = "" + "" + "" + "" + "<" + setup.calendarOptions.range + " />" + /* there is a property called IncludeTimeValue="TRUE" */ + + ""; + if (where !== "") where = "" + where + whereDateRanges + "";else where = whereDateRanges; + } - case 80: - setup._queryOptions = setup.queryOptions; + where = setup.whereFct(where); + body = "" + _this.listID + "" + "" + (setup.viewID || "") + "" + "" + "" + (where != "" ? "" + where + "" : "") + (groupby != "" ? "" + groupby + "" : "") + (orderby != "" ? "" + orderby + "" : "") + "" + "" + "" + "" + fields + "" + "" + "" + setup.rowlimit + "" + "" + "" + setup._queryOptions + "" + ""; + body = _buildBodyForSOAP("GetListItems", body); // do the request - case 81: - if (setup.calendarOptions) { - setup._queryOptions += "" + setup.calendarOptions.referenceDate + "" + "v3" + "" + setup.calendarOptions.splitRecurrence + ""; - } // what about the Where ? + _context16.next = 88; + return ajax.call(_this, { + url: _this.url + "/_vti_bin/Lists.asmx", + body: body + }); + case 88: + data = _context16.sent; + aReturn = []; // we want to use myElem to change the getAttribute function - if (setup.where !== "") { - if (setup.whereCAML) where = setup.where;else where = parse(setup.where); - } + rows = data.getElementsByTagName('z:row'); + if (rows.length === 0) rows = data.getElementsByTagName('row'); // for Chrome 'bug' + // convert immediatly to JSON if there is no JOIN - if (setup.calendar === true) { - whereDateRanges = "" + "" + "" + "" + "<" + setup.calendarOptions.range + " />" - /* there is a property called IncludeTimeValue="TRUE" */ - + ""; - if (where !== "") where = "" + where + whereDateRanges + "";else where = whereDateRanges; - } + doJSON = setup.json && !setup.join && !setup.innerjoin && !setup.outerjoin && !setup.joinIndex; // do we want to force the ListName in the attribute name ? - where = setup.whereFct(where); - body = "" + this.listID + "" + "" + (setup.viewID || "") + "" + "" + "" + (where != "" ? "" + where + "" : "") + (groupby != "" ? "" + groupby + "" : "") + (orderby != "" ? "" + orderby + "" : "") + "" + "" + "" + "" + fields + "" + "" + "" + setup.rowlimit + "" + "" + "" + setup._queryOptions + "" + ""; - body = _buildBodyForSOAP("GetListItems", body); // do the request + if (setup.showListInAttribute) { + for (_i = 0, len = rows.length; _i < len; _i++) { + _attributes = rows[_i].attributes; + _tmp = {}; - _context15.next = 89; - return ajax.call(this, { - url: this.url + "/_vti_bin/Lists.asmx", - body: body - }); + for (_j = _attributes.length; _j--;) { + _tmp[setup.alias + "." + _sliceInstanceProperty(_context4 = _attributes[_j].nodeName).call(_context4, 4)] = _attributes[_j].nodeValue; + } - case 89: - data = _context15.sent; - aReturn = []; // we want to use myElem to change the getAttribute function + if (doJSON) aReturn.push(_tmp);else aReturn.push(new extendMyObject(_tmp)); + } + } else { + // if we want the result as an array of JSON + if (doJSON) { + _len = rows.length; + lenFields = setup.fields.length; - rows = data.getElementsByTagName('z:row'); - if (rows.length === 0) rows = data.getElementsByTagName('row'); // for Chrome 'bug' - // convert immediatly to JSON if there is no JOIN + _loop = function _loop(_i2) { + var ret = {}; // if we don't have any fields defined + // then we need to search for them - doJSON = setup.json && !setup.join && !setup.innerjoin && !setup.outerjoin && !setup.joinIndex; // do we want to force the ListName in the attribute name ? + if (lenFields === 0) { + var attrs = rows[_i2].attributes; - if (setup.showListInAttribute) { - for (_i = 0, len = rows.length; _i < len; _i++) { - _attributes = rows[_i].attributes; - _tmp = {}; + for (var attrsLen = attrs.length, _i3 = 0; _i3 < attrsLen; _i3++) { + var _context5; - for (_j = _attributes.length; _j--;) { - _tmp[setup.alias + "." + _sliceInstanceProperty(_context4 = _attributes[_j].nodeName).call(_context4, 4)] = _attributes[_j].nodeValue; - } + var fieldName = _sliceInstanceProperty(_context5 = attrs[_i3].nodeName).call(_context5, 4); - if (doJSON) aReturn.push(_tmp);else aReturn.push(new extendMyObject(_tmp)); - } - } else { - // if we want the result as an array of JSON - if (doJSON) { - _len = rows.length; - lenFields = setup.fields.length; - - for (_i2 = 0; _i2 < _len; _i2++) { - ret = {}; // if we don't have any fields defined - // then we need to search for them - - if (lenFields === 0) { - attrs = rows[_i2].attributes; - - for (attrsLen = attrs.length, _i3 = 0; _i3 < attrsLen; _i3++) { - fieldName = _sliceInstanceProperty(_context5 = attrs[_i3].nodeName).call(_context5, 4); - ret[fieldName] = attrs[_i3].nodeValue; - } - } else { - for (_i4 = 0; _i4 < lenFields; _i4++) { - _fieldName = setup.fields[_i4]; - ret[_fieldName] = rows[_i4].getAttribute('ows_' + _fieldName); - } - } + ret[fieldName] = attrs[_i3].nodeValue; + } + } else { + var _context6; - aReturn.push(ret); - } - } else { - for (_i5 = 0, _len2 = rows.length; _i5 < _len2; _i5++) { - aReturn.push(new myElem(rows[_i5])); - } - } - } // if setup.results length is bigger than 0 then it means we need to add the current data + _forEachInstanceProperty(_context6 = setup.fields).call(_context6, function (fieldName) { + ret[fieldName] = rows[_i2].getAttribute('ows_' + fieldName); + }); + } + aReturn.push(ret); + }; - if (setup.results.length > 0) for (i = 0, stop = aReturn.length; i < stop; i++) { - setup.results.push(aReturn[i]); - } // depending of the setup.nextWhere length we update the progress + for (_i2 = 0; _i2 < _len; _i2++) { + _loop(_i2); + } + } else { + for (_i4 = 0, _len2 = rows.length; _i4 < _len2; _i4++) { + aReturn.push(new myElem(rows[_i4])); + } + } + } // if setup.results length is bigger than 0 then it means we need to add the current data - if (typeof setup.originalWhere !== "string") setup.progress(setup.originalWhere.length - setup.nextWhere.length, setup.originalWhere.length); // if paging we want to return ListItemCollectionPositionNext - if (setup.paging) { - collection = data.getElementsByTagName("rs:data")[0]; + if (setup.results.length > 0) for (i = 0, stop = aReturn.length; i < stop; i++) { + setup.results.push(aReturn[i]); + } // depending of the setup.nextWhere length we update the progress - if (typeof collection === "undefined" || collection.length == 0) { - collection = data.getElementsByTagName("data")[0]; // for Chrome - } + if (typeof setup.originalWhere !== "string") setup.progress(setup.originalWhere.length - setup.nextWhere.length, setup.originalWhere.length); // if paging we want to return ListItemCollectionPositionNext - if (collection) nextPage = collection.getAttribute("ListItemCollectionPositionNext"); - } // if we have a paging then we need to do the request again + if (setup.paging) { + collection = data.getElementsByTagName("rs:data")[0]; + if (typeof collection === "undefined" || collection.length == 0) { + collection = data.getElementsByTagName("data")[0]; // for Chrome + } - if (!(setup.paging && --setup.page > 0)) { - _context15.next = 109; - break; - } + if (collection) nextPage = collection.getAttribute("ListItemCollectionPositionNext"); + } // if we have a paging then we need to do the request again - // check if we need to go to another request - if (setup.results.length === 0) setup.results = aReturn; // notify that we keep loading - setup.progress(setup.results.length); + if (!(setup.paging && --setup.page > 0)) { + _context16.next = 108; + break; + } - if (!nextPage) { - _context15.next = 106; - break; - } + // check if we need to go to another request + if (setup.results.length === 0) setup.results = aReturn; // notify that we keep loading - // we need more calls - setup.listItemCollectionPositionNext = _cleanString(nextPage); - return _context15.abrupt("return", get.call(this, setup)); + setup.progress(setup.results.length); - case 106: - aReturn = setup.results; // it means we're done, no more call + if (!nextPage) { + _context16.next = 105; + break; + } - case 107: - _context15.next = 117; - break; - - case 109: - if (!(setup.nextWhere.length > 0)) { - _context15.next = 115; - break; - } - - // if we need to so some more request - if (setup.results.length === 0) setup.results = aReturn; - setup.where = _sliceInstanceProperty(_context6 = setup.nextWhere).call(_context6, 0); - return _context15.abrupt("return", get.call(this, setup)); - - case 115: - // rechange setup.where with the original one just in case it was an array to make sure we didn't override the original array - setup.where = setup.originalWhere; - aReturn = setup.results.length > 0 ? setup.results : aReturn; - - case 117: - if (!setup.joinData) { - _context15.next = 139; - break; - } - - on = setup.joinData["noindex"]; - aResult = []; - prevIndex = ""; - listIndexFound = { - length: 0 - }; - if (!on.length) alert("$SP.get() -- Error 'get': you must define the ON clause when JOIN is used."); // we have a linked list so do some stuff here to tie the two lists together - - for (i = 0, stop = aReturn.length; i < stop; i++) { - index = ""; - - for (j = 0; j < on.length; j++) { - index += "_" + getLookup(aReturn[i].getAttribute(on[j][setup.alias])).id; - } // check if the index exists in the previous set of data + // we need more calls + setup.listItemCollectionPositionNext = _cleanString(nextPage); + return _context16.abrupt("return", { + v: get.call(_this, setup) + }); + case 105: + aReturn = setup.results; // it means we're done, no more call - if (setup.joinData[index]) { - if (prevIndex !== index) { - if (!listIndexFound[setup.joinIndex[index]]) listIndexFound.length++; - listIndexFound[setup.joinIndex[index]] = true; - prevIndex = index; - } // we merge the joinData and the aReturn + case 106: + _context16.next = 116; + break; + case 108: + if (!(setup.nextWhere.length > 0)) { + _context16.next = 114; + break; + } - for (j = 0, joinDataLen = setup.joinData[index].length; j < joinDataLen; j++) { - tmp = []; // find the attributes for the current list + // if we need to so some more request + if (setup.results.length === 0) setup.results = aReturn; + setup.where = _sliceInstanceProperty(_context7 = setup.nextWhere).call(_context7, 0); + return _context16.abrupt("return", { + v: get.call(_this, setup) + }); - attributesReturn = aReturn[i].getAttributes(); + case 114: + // rechange setup.where with the original one just in case it was an array to make sure we didn't override the original array + setup.where = setup.originalWhere; + aReturn = setup.results.length > 0 ? setup.results : aReturn; - for (attr = attributesReturn.length; attr--;) { - tmp[setup.alias + "." + _sliceInstanceProperty(_context7 = attributesReturn[attr].nodeName).call(_context7, 4)] = attributesReturn[attr].nodeValue; - } // now find the attributes for the joinData + case 116: + if (!setup.joinData) { + _context16.next = 138; + break; + } + on = setup.joinData["noindex"]; + aResult = []; + prevIndex = ""; + listIndexFound = { + length: 0 + }; + if (!on.length) alert("$SP.get() -- Error 'get': you must define the ON clause when JOIN is used."); // we have a linked list so do some stuff here to tie the two lists together - attributesJoinData = setup.joinData[index][j].getAttributes(); + for (i = 0, stop = aReturn.length; i < stop; i++) { + index = ""; - for (attr in attributesJoinData) { - tmp[attr] = setup.joinData[index][j].getAttribute(attr); - } + for (j = 0; j < on.length; j++) { + index += "_" + getLookup(aReturn[i].getAttribute(on[j][setup.alias])).id; + } // check if the index exists in the previous set of data - aResult.push(new extendMyObject(tmp)); - } - } // for the default options + if (setup.joinData[index]) { + if (prevIndex !== index) { + if (!listIndexFound[setup.joinIndex[index]]) listIndexFound.length++; + listIndexFound[setup.joinIndex[index]] = true; + prevIndex = index; + } // we merge the joinData and the aReturn - if (setup.innerjoin) setup.join = setup.innerjoin; - if (setup.outerjoin) { - setup.join = setup.outerjoin; - setup.join.outer = true; - } - } + for (j = 0, joinDataLen = setup.joinData[index].length; j < joinDataLen; j++) { + tmp = []; // find the attributes for the current list - aReturn = aResult; // if there is a WHERE clause then we want to force to an innerjoin - // except where setup.where equals to setup.onLookupWhere + attributesReturn = aReturn[i].getAttributes(); - if (setup.where && setup.onLookupWhere && setup.outer) { - whereParsed = _startsWithInstanceProperty(_context8 = setup.where).call(_context8, '<') ? setup.where : parse(setup.where); - onLookupWhereParsed = _startsWithInstanceProperty(_context9 = setup.onLookupWhere).call(_context9, '<') ? setup.onLookupWhere : parse(setup.onLookupWhere); - if (whereParsed !== onLookupWhereParsed) setup.outer = false; - } // if we want to do an outerjoin we link the missing data + for (attr = attributesReturn.length; attr--;) { + tmp[setup.alias + "." + _sliceInstanceProperty(_context8 = attributesReturn[attr].nodeName).call(_context8, 4)] = attributesReturn[attr].nodeValue; + } // now find the attributes for the joinData - if (!setup.outer) { - _context15.next = 139; - break; - } + attributesJoinData = setup.joinData[index][j].getAttributes(); - joinIndexLen = setup.joinIndex.length; + for (attr in attributesJoinData) { + tmp[attr] = setup.joinData[index][j].getAttribute(attr); + } - if (!(listIndexFound.length < joinIndexLen)) { - _context15.next = 139; - break; - } + aResult.push(new extendMyObject(tmp)); + } + } // for the default options - i = 0; - case 130: - if (!(i < joinIndexLen)) { - _context15.next = 139; - break; - } + if (setup.innerjoin) setup.join = setup.innerjoin; - if (!(listIndexFound[i] !== true)) { - _context15.next = 136; - break; - } + if (setup.outerjoin) { + setup.join = setup.outerjoin; + setup.join.outer = true; + } + } - idx = setup.joinIndex[i]; + aReturn = aResult; // if there is a WHERE clause then we want to force to an innerjoin + // except where setup.where equals to setup.onLookupWhere - if (!(idx === undefined || setup.joinData[idx] === undefined)) { - _context15.next = 135; - break; - } + if (setup.where && setup.onLookupWhere && setup.outer) { + whereParsed = _startsWithInstanceProperty(_context9 = setup.where).call(_context9, '<') ? setup.where : parse(setup.where); + onLookupWhereParsed = _startsWithInstanceProperty(_context10 = setup.onLookupWhere).call(_context10, '<') ? setup.onLookupWhere : parse(setup.onLookupWhere); + if (whereParsed !== onLookupWhereParsed) setup.outer = false; + } // if we want to do an outerjoin we link the missing data - return _context15.abrupt("continue", 136); - case 135: - for (j = 0, joinDataLen = setup.joinData[idx].length; j < joinDataLen; j++) { - tmp = []; - attributesJoinData = setup.joinData[idx][j].getAttributes(); + if (!setup.outer) { + _context16.next = 138; + break; + } - for (attr in attributesJoinData) { - tmp[attr] = setup.joinData[idx][j].getAttribute(attr); - } + joinIndexLen = setup.joinIndex.length; - aResult.push(new extendMyObject(tmp)); - } + if (!(listIndexFound.length < joinIndexLen)) { + _context16.next = 138; + break; + } - case 136: - i++; - _context15.next = 130; - break; + i = 0; - case 139: - if (setup.outerjoin) { - setup.join = setup.outerjoin; - setup.join.outer = true; - } else if (setup.innerjoin) setup.join = setup.innerjoin; // if we join it with another list + case 129: + if (!(i < joinIndexLen)) { + _context16.next = 138; + break; + } + if (!(listIndexFound[i] !== true)) { + _context16.next = 135; + break; + } - if (!setup.join) { - _context15.next = 156; - break; - } + idx = setup.joinIndex[i]; - joinData = []; - joinIndex = []; - joinWhereLookup = []; // retrieve the ON clauses + if (!(idx === undefined || setup.joinData[idx] === undefined)) { + _context16.next = 134; + break; + } - if (setup.join.onLookup) setup.join.on = "'" + (setup.join.alias || setup.join.list) + "'." + setup.join.onLookup + " = '" + setup.alias + "'.ID"; - on = _parseOn(setup.join.on); - joinData["noindex"] = on; // keep a copy of it for the next treatment in the tied list + return _context16.abrupt("continue", 135); - for (i = 0, stop = aReturn.length; i < stop; i++) { - // create an index that will be used in the next list to filter it - index = "", tmp = []; + case 134: + for (j = 0, joinDataLen = setup.joinData[idx].length; j < joinDataLen; j++) { + tmp = []; + attributesJoinData = setup.joinData[idx][j].getAttributes(); - for (j = 0; j < on.length; j++) { - index += "_" + getLookup(aReturn[i].getAttribute(on[j][setup.alias]) || aReturn[i].getAttribute(setup.alias + "." + on[j][setup.alias])).id; - } + for (attr in attributesJoinData) { + tmp[attr] = setup.joinData[idx][j].getAttribute(attr); + } - if (!joinData[index]) { - joinIndex[index] = joinIndex.length; - joinIndex.push(index); - joinData[index] = []; // if onLookup then we will store the current ID with the ~ to use it in a where clause with IN operator + aResult.push(new extendMyObject(tmp)); + } - if (setup.join.onLookup && index !== "_") joinWhereLookup.push("~" + _sliceInstanceProperty(index).call(index, 1)); - } // if we are coming from some other join + case 135: + i++; + _context16.next = 129; + break; + case 138: + if (setup.outerjoin) { + setup.join = setup.outerjoin; + setup.join.outer = true; + } else if (setup.innerjoin) setup.join = setup.innerjoin; // if we join it with another list - if (setup.joinData) { - joinData[index].push(aReturn[i]); - } else { - attributes = aReturn[i].getAttributes(); - for (j = attributes.length; j--;) { - tmp[setup.alias + "." + _sliceInstanceProperty(_context10 = attributes[j].nodeName).call(_context10, 4)] = attributes[j].nodeValue; - } + if (!setup.join) { + _context16.next = 155; + break; + } - joinData[index].push(new extendMyObject(tmp)); - } - } + joinData = []; + joinIndex = []; + joinWhereLookup = []; // retrieve the ON clauses - setup.joinData = undefined; // call the joined list to grab data and process them - // if onLookup then we create a WHERE clause with IN operator + if (setup.join.onLookup) setup.join.on = "'" + (setup.join.alias || setup.join.list) + "'." + setup.join.onLookup + " = '" + setup.alias + "'.ID"; + on = _parseOn(setup.join.on); + joinData["noindex"] = on; // keep a copy of it for the next treatment in the tied list - if (setup.join.onLookup) { - if (joinWhereLookup.length > 0) { - // SP2013 limits to 60 items per IN - wh = arrayChunk(joinWhereLookup, 60); + for (i = 0, stop = aReturn.length; i < stop; i++) { + // create an index that will be used in the next list to filter it + index = "", tmp = []; - for (j = 0; j < wh.length; j++) { - wh[j] = setup.join.onLookup + ' IN ["' + wh[j].join('","') + '"]'; - } // if the WHERE is too big then the server could run out of memory + for (j = 0; j < on.length; j++) { + index += "_" + getLookup(aReturn[i].getAttribute(on[j][setup.alias]) || aReturn[i].getAttribute(setup.alias + "." + on[j][setup.alias])).id; + } + if (!joinData[index]) { + joinIndex[index] = joinIndex.length; + joinIndex.push(index); + joinData[index] = []; // if onLookup then we will store the current ID with the ~ to use it in a where clause with IN operator + + if (setup.join.onLookup && index !== "_") joinWhereLookup.push("~" + _sliceInstanceProperty(index).call(index, 1)); + } // if we are coming from some other join + + + if (setup.joinData) { + joinData[index].push(aReturn[i]); + } else { + attributes = aReturn[i].getAttributes(); - if (wh.length <= global._SP_MAXWHERE_ONLOOKUP) { - wh = "(" + wh.join(" OR ") + ")"; // now we add this WHERE into the existing where + for (j = attributes.length; j--;) { + tmp[setup.alias + "." + _sliceInstanceProperty(_context11 = attributes[j].nodeName).call(_context11, 4)] = attributes[j].nodeValue; + } - if (setup.join.where) { - if (_Array$isArray(setup.join.where)) { - _forEachInstanceProperty(_context11 = setup.join.where).call(_context11, function (e, i) { - setup.join.where[i] = wh + " AND (" + e + ")"; + joinData[index].push(new extendMyObject(tmp)); + } + } + + setup.joinData = undefined; // call the joined list to grab data and process them + // if onLookup then we create a WHERE clause with IN operator + + if (setup.join.onLookup) { + if (joinWhereLookup.length > 0) { + // SP2013 limits to 60 items per IN + wh = arrayChunk(joinWhereLookup, 60); + + for (j = 0; j < wh.length; j++) { + wh[j] = setup.join.onLookup + ' IN ["' + wh[j].join('","') + '"]'; + } // if the WHERE is too big then the server could run out of memory + + + if (wh.length <= global._SP_MAXWHERE_ONLOOKUP) { + wh = "(" + wh.join(" OR ") + ")"; // now we add this WHERE into the existing where + + if (setup.join.where) { + if (_Array$isArray(setup.join.where)) { + _forEachInstanceProperty(_context12 = setup.join.where).call(_context12, function (e, i) { + setup.join.where[i] = wh + " AND (" + e + ")"; + }); + } else { + setup.join.where = wh + " AND (" + setup.join.where + ")"; + } + } else setup.join.where = wh; + + setup.join.onLookupWhere = wh; + } else { + // in that case we'll use paging + setup.join.paging = true; + } + } // make sure the lookup fields is in the fields list + + + if (!setup.join.fields) setup.join.fields = []; + + if (!_Array$isArray(setup.join.fields)) { + tmp = setup.join.fields.split(","); + tmp.push(setup.join.onLookup); + setup.join.fields = tmp.join(","); + } else setup.join.fields.push(setup.join.onLookup); + } + + _this.listID = setup.join.list; + _this.url = setup.join.url || _this.url; + setup.join.json = setup.json; + setup.join.joinData = joinData; + setup.join.joinIndex = joinIndex; + return _context16.abrupt("return", { + v: get.call(_this, setup.join) }); - } else { - setup.join.where = wh + " AND (" + setup.join.where + ")"; - } - } else setup.join.where = wh; - - setup.join.onLookupWhere = wh; - } else { - // in that case we'll use paging - setup.join.paging = true; - } - } // make sure the lookup fields is in the fields list + case 155: + if (!setup.merge) { + _context16.next = 167; + break; + } + + mergeSource = { + list: setup.list || _this.listID, + url: setup.url || _this.url + }; + + if (!(setup.merge.length > 0)) { + _context16.next = 166; + break; + } + + mergeSetup = setup.merge.shift(); + mergeSetup.merge = _sliceInstanceProperty(_context13 = setup.merge).call(_context13, 0); + _this.listID = mergeSetup.list; + _this.url = mergeSetup.url || _this.url; // we need to identify the Source of each set + + mergeSetup.mergeData = _concatInstanceProperty(_context14 = setup.mergeData).call(_context14, _mapInstanceProperty(aReturn).call(aReturn, function (ret) { + ret.Source = mergeSource; + return ret; + })); + return _context16.abrupt("return", { + v: get.call(_this, mergeSetup) + }); - if (!setup.join.fields) setup.join.fields = []; + case 166: + aReturn = _concatInstanceProperty(_context15 = setup.mergeData).call(_context15, _mapInstanceProperty(aReturn).call(aReturn, function (ret) { + ret.Source = mergeSource; + return ret; + })); - if (!_Array$isArray(setup.join.fields)) { - tmp = setup.join.fields.split(","); - tmp.push(setup.join.onLookup); - setup.join.fields = tmp.join(","); - } else setup.join.fields.push(setup.join.onLookup); - } + case 167: + aReturn["NextPage"] = nextPage; // convert to JSON if required - this.listID = setup.join.list; - this.url = setup.join.url || this.url; - setup.join.json = setup.json; - setup.join.joinData = joinData; - setup.join.joinIndex = joinIndex; - return _context15.abrupt("return", get.call(this, setup.join)); + if (!(setup.json && !doJSON)) { + _context16.next = 172; + break; + } - case 156: - if (!setup.merge) { - _context15.next = 168; - break; - } + ret = []; - mergeSource = { - list: setup.list || this.listID, - url: setup.url || this.url - }; + for (_i5 = 0, _len3 = aReturn.length; _i5 < _len3; _i5++) { + ret.push(aReturn[_i5].getAttributes()); + } - if (!(setup.merge.length > 0)) { - _context15.next = 167; - break; - } - - mergeSetup = setup.merge.shift(); - mergeSetup.merge = _sliceInstanceProperty(_context12 = setup.merge).call(_context12, 0); - this.listID = mergeSetup.list; - this.url = mergeSetup.url || this.url; // we need to identify the Source of each set + return _context16.abrupt("return", { + v: _Promise.resolve(ret) + }); - mergeSetup.mergeData = _concatInstanceProperty(_context13 = setup.mergeData).call(_context13, _mapInstanceProperty(aReturn).call(aReturn, function (ret) { - ret.Source = mergeSource; - return ret; - })); - return _context15.abrupt("return", get.call(this, mergeSetup)); + case 172: + return _context16.abrupt("return", { + v: _Promise.resolve(aReturn) + }); - case 167: - aReturn = _concatInstanceProperty(_context14 = setup.mergeData).call(_context14, _mapInstanceProperty(aReturn).call(aReturn, function (ret) { - ret.Source = mergeSource; - return ret; - })); + case 173: + case "end": + return _context16.stop(); + } + } + }, _callee); + })(), "t0", 2); - case 168: - aReturn["NextPage"] = nextPage; // convert to JSON if required + case 2: + _ret = _context17.t0; - if (!(setup.json && !doJSON)) { - _context15.next = 173; + if (!(_typeof(_ret) === "object")) { + _context17.next = 5; break; } - _ret = []; - - for (_i6 = 0, _len3 = aReturn.length; _i6 < _len3; _i6++) { - _ret.push(aReturn[_i6].getAttributes()); - } - - return _context15.abrupt("return", _Promise.resolve(_ret)); + return _context17.abrupt("return", _ret.v); - case 173: - return _context15.abrupt("return", _Promise.resolve(aReturn)); + case 5: + _context17.next = 10; + break; - case 176: - _context15.prev = 176; - _context15.t1 = _context15["catch"](0); - return _context15.abrupt("return", _Promise.reject(_context15.t1)); + case 7: + _context17.prev = 7; + _context17.t1 = _context17["catch"](0); + return _context17.abrupt("return", _Promise.reject(_context17.t1)); - case 179: + case 10: case "end": - return _context15.stop(); + return _context17.stop(); } } - }, _callee, this, [[0, 176]]); + }, _callee2, null, [[0, 7]]); })); return _get.apply(this, arguments); } \ No newline at end of file diff --git a/es5/main.js b/es5/main.js index c92587f..eb758a1 100644 --- a/es5/main.js +++ b/es5/main.js @@ -57,7 +57,7 @@ function () { _createClass(SharepointPlus, [{ key: "getVersion", value: function getVersion() { - return "6.0.3"; + return "6.0.4"; } /** @name $SP().auth diff --git a/package.json b/package.json index 8e87322..5d56de8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sharepointplus", - "version": "6.0.3", + "version": "6.0.4", "description": "A library that offers an easy interface to deal with Sharepoint", "module": "./es5/index.js", "main": "./es5/index.js", diff --git a/src/lists/get.js b/src/lists/get.js index 8d4789e..76e6b1b 100644 --- a/src/lists/get.js +++ b/src/lists/get.js @@ -696,10 +696,9 @@ export default async function get (options) { ret[fieldName]=attrs[i].nodeValue; } } else { - for (let i=0; i