Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*! jQuery v3.2.1 | (c) JS Foundation and other contributors | jquery.org/license */
- !function(a,b){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){"use strict";var c=[],d=a.document,e=Object.getPrototypeOf,f=c.slice,g=c.concat,h=c.push,i=c.indexOf,j={},k=j.toString,l=j.hasOwnProperty,m=l.toString,n=m.call(Object),o={};function p(a,b){b=b||d;var c=b.createElement("script");c.text=a,b.head.appendChild(c).parentNode.removeChild(c)}var q="3.2.1",r=function(a,b){return new r.fn.init(a,b)},s=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,t=/^-ms-/,u=/-([a-z])/g,v=function(a,b){return b.toUpperCase()};r.fn=r.prototype={jquery:q,constructor:r,length:0,toArray:function(){return f.call(this)},get:function(a){return null==a?f.call(this):a<0?this[a+this.length]:this[a]},pushStack:function(a){var b=r.merge(this.constructor(),a);return b.prevObject=this,b},each:function(a){return r.each(this,a)},map:function(a){return this.pushStack(r.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(f.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(a<0?b:0);return this.pushStack(c>=0&&c<b?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:h,sort:c.sort,splice:c.splice},r.extend=r.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||r.isFunction(g)||(g={}),h===i&&(g=this,h--);h<i;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(r.isPlainObject(d)||(e=Array.isArray(d)))?(e?(e=!1,f=c&&Array.isArray(c)?c:[]):f=c&&r.isPlainObject(c)?c:{},g[b]=r.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},r.extend({expando:"jQuery"+(q+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===r.type(a)},isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){var b=r.type(a);return("number"===b||"string"===b)&&!isNaN(a-parseFloat(a))},isPlainObject:function(a){var b,c;return!(!a||"[object Object]"!==k.call(a))&&(!(b=e(a))||(c=l.call(b,"constructor")&&b.constructor,"function"==typeof c&&m.call(c)===n))},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?j[k.call(a)]||"object":typeof a},globalEval:function(a){p(a)},camelCase:function(a){return a.replace(t,"ms-").replace(u,v)},each:function(a,b){var c,d=0;if(w(a)){for(c=a.length;d<c;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(s,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(w(Object(a))?r.merge(c,"string"==typeof a?[a]:a):h.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:i.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;d<c;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;f<g;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,e,f=0,h=[];if(w(a))for(d=a.length;f<d;f++)e=b(a[f],f,c),null!=e&&h.push(e);else for(f in a)e=b(a[f],f,c),null!=e&&h.push(e);return g.apply([],h)},guid:1,proxy:function(a,b){var c,d,e;if("string"==typeof b&&(c=a[b],b=a,a=c),r.isFunction(a))return d=f.call(arguments,2),e=function(){return a.apply(b||this,d.concat(f.call(arguments)))},e.guid=a.guid=a.guid||r.guid++,e},now:Date.now,support:o}),"function"==typeof Symbol&&(r.fn[Symbol.iterator]=c[Symbol.iterator]),r.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){j["[object "+b+"]"]=b.toLowerCase()});function w(a){var b=!!a&&"length"in a&&a.length,c=r.type(a);return"function"!==c&&!r.isWindow(a)&&("array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a)}var x=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=function(a,b){for(var c=0,d=a.length;c<d;c++)if(a[c]===b)return c;return-1},J="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",K="[\\x20\\t\\r\\n\\f]",L="(?:\\\\.|[\\w-]|[^\0-\\xa0])+",M="\\["+K+"*("+L+")(?:"+K+"*([*^$|!~]?=)"+K+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+L+"))|)"+K+"*\\]",N=":("+L+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+M+")*)|.*)\\)|)",O=new RegExp(K+"+","g"),P=new RegExp("^"+K+"+|((?:^|[^\\\\])(?:\\\\.)*)"+K+"+$","g"),Q=new RegExp("^"+K+"*,"+K+"*"),R=new RegExp("^"+K+"*([>+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(N),U=new RegExp("^"+L+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L+"|[*])"),ATTR:new RegExp("^"+M),PSEUDO:new RegExp("^"+N),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),aa=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:d<0?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ba=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ca=function(a,b){return b?"\0"===a?"\ufffd":a.slice(0,-1)+"\\"+a.charCodeAt(a.length-1).toString(16)+" ":"\\"+a},da=function(){m()},ea=ta(function(a){return a.disabled===!0&&("form"in a||"label"in a)},{dir:"parentNode",next:"legend"});try{G.apply(D=H.call(v.childNodes),v.childNodes),D[v.childNodes.length].nodeType}catch(fa){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s=b&&b.ownerDocument,w=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==w&&9!==w&&11!==w)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==w&&(l=Z.exec(a)))if(f=l[1]){if(9===w){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(s&&(j=s.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(l[2])return G.apply(d,b.getElementsByTagName(a)),d;if((f=l[3])&&c.getElementsByClassName&&b.getElementsByClassName)return G.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==w)s=b,r=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(ba,ca):b.setAttribute("id",k=u),o=g(a),h=o.length;while(h--)o[h]="#"+k+" "+sa(o[h]);r=o.join(","),s=$.test(a)&&qa(b.parentNode)||b}if(r)try{return G.apply(d,s.querySelectorAll(r)),d}catch(x){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(P,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("fieldset");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&a.sourceIndex-b.sourceIndex;if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return function(b){return"form"in b?b.parentNode&&b.disabled===!1?"label"in b?"label"in b.parentNode?b.parentNode.disabled===a:b.disabled===a:b.isDisabled===a||b.isDisabled!==!a&&ea(b)===a:b.disabled===a:"label"in b&&b.disabled===a}}function pa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function qa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return!!b&&"HTML"!==b.nodeName},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),v!==n&&(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Y.test(n.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){return a.getAttribute("id")===b}},d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}}):(d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}},d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c,d,e,f=b.getElementById(a);if(f){if(c=f.getAttributeNode("id"),c&&c.value===a)return[f];e=b.getElementsByName(a),d=0;while(f=e[d++])if(c=f.getAttributeNode("id"),c&&c.value===a)return[f]}return[]}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){if("undefined"!=typeof b.getElementsByClassName&&p)return b.getElementsByClassName(a)},r=[],q=[],(c.qsa=Y.test(n.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\r\\' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){a.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+K+"*[*^$|!~]?="),2!==a.querySelectorAll(":enabled").length&&q.push(":enabled",":disabled"),o.appendChild(a).disabled=!0,2!==a.querySelectorAll(":disabled").length&&q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Y.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"*"),s.call(a,"[s!='']:x"),r.push("!=",N)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Y.test(o.compareDocumentPosition),t=b||Y.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?I(k,a)-I(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?I(k,a)-I(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?la(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(S,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&C.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.escape=function(a){return(a+"").replace(ba,ca)},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(_,aa),a[3]=(a[3]||a[4]||a[5]||"").replace(_,aa),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return V.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&T.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(_,aa).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+K+")"+a+"("+K+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:!b||(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(O," ")+" ").indexOf(c)>-1:"|="===b&&(e===c||e.slice(0,c.length+1)===c+"-"))}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=I(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(P,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(_,aa),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return U.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(_,aa).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:oa(!1),disabled:oa(!0),checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return X.test(a.nodeName)},input:function(a){return W.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:pa(function(){return[0]}),last:pa(function(a,b){return[b-1]}),eq:pa(function(a,b,c){return[c<0?c+b:c]}),even:pa(function(a,b){for(var c=0;c<b;c+=2)a.push(c);return a}),odd:pa(function(a,b){for(var c=1;c<b;c+=2)a.push(c);return a}),lt:pa(function(a,b,c){for(var d=c<0?c+b:c;--d>=0;)a.push(d);return a}),gt:pa(function(a,b,c){for(var d=c<0?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=ma(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=na(b);function ra(){}ra.prototype=d.filters=d.pseudos,d.setFilters=new ra,g=ga.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){c&&!(e=Q.exec(h))||(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=R.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(P," ")}),h=h.slice(c.length));for(g in d.filter)!(e=V[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?ga.error(a):z(a,i).slice(0)};function sa(a){for(var b=0,c=a.length,d="";b<c;b++)d+=a[b].value;return d}function ta(a,b,c){var d=b.dir,e=b.next,f=e||d,g=c&&"parentNode"===f,h=x++;return b.first?function(b,c,e){while(b=b[d])if(1===b.nodeType||g)return a(b,c,e);return!1}:function(b,c,i){var j,k,l,m=[w,h];if(i){while(b=b[d])if((1===b.nodeType||g)&&a(b,c,i))return!0}else while(b=b[d])if(1===b.nodeType||g)if(l=b[u]||(b[u]={}),k=l[b.uniqueID]||(l[b.uniqueID]={}),e&&e===b.nodeName.toLowerCase())b=b[d]||b;else{if((j=k[f])&&j[0]===w&&j[1]===h)return m[2]=j[2];if(k[f]=m,m[2]=a(b,c,i))return!0}return!1}}function ua(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function va(a,b,c){for(var d=0,e=b.length;d<e;d++)ga(a,b[d],c);return c}function wa(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;h<i;h++)(f=a[h])&&(c&&!c(f,d,e)||(g.push(f),j&&b.push(h)));return g}function xa(a,b,c,d,e,f){return d&&!d[u]&&(d=xa(d)),e&&!e[u]&&(e=xa(e,f)),ia(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||va(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:wa(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=wa(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?I(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=wa(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)})}function ya(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ta(function(a){return a===b},h,!0),l=ta(function(a){return I(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];i<f;i++)if(c=d.relative[a[i].type])m=[ta(ua(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;e<f;e++)if(d.relative[a[e].type])break;return xa(i>1&&ua(m),i>1&&sa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(P,"$1"),c,i<e&&ya(a.slice(i,e)),e<f&&ya(a=a.slice(e)),e<f&&sa(a))}m.push(c)}return ua(m)}function za(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=E.call(i));u=wa(u)}G.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&ga.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=ya(b[c]),f[u]?d.push(f):e.push(f);f=A(a,za(e,d)),f.selector=a}return f},i=ga.select=function(a,b,c,e){var f,i,j,k,l,m="function"==typeof a&&a,n=!e&&g(a=m.selector||a);if(c=c||[],1===n.length){if(i=n[0]=n[0].slice(0),i.length>2&&"ID"===(j=i[0]).type&&9===b.nodeType&&p&&d.relative[i[1].type]){if(b=(d.find.ID(j.matches[0].replace(_,aa),b)||[])[0],!b)return c;m&&(b=b.parentNode),a=a.slice(i.shift().value.length)}f=V.needsContext.test(a)?0:i.length;while(f--){if(j=i[f],d.relative[k=j.type])break;if((l=d.find[k])&&(e=l(j.matches[0].replace(_,aa),$.test(i[0].type)&&qa(b.parentNode)||b))){if(i.splice(f,1),a=e.length&&sa(i),!a)return G.apply(c,e),c;break}}}return(m||h(a,n))(e,b,!p,c,!b||$.test(a)&&qa(b.parentNode)||b),c},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("fieldset"))}),ja(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){if(!c)return a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){if(!c&&"input"===a.nodeName.toLowerCase())return a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(J,function(a,b,c){var d;if(!c)return a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);r.find=x,r.expr=x.selectors,r.expr[":"]=r.expr.pseudos,r.uniqueSort=r.unique=x.uniqueSort,r.text=x.getText,r.isXMLDoc=x.isXML,r.contains=x.contains,r.escapeSelector=x.escape;var y=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&r(a).is(c))break;d.push(a)}return d},z=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},A=r.expr.match.needsContext;function B(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()}var C=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,D=/^.[^:#\[\.,]*$/;function E(a,b,c){return r.isFunction(b)?r.grep(a,function(a,d){return!!b.call(a,d,a)!==c}):b.nodeType?r.grep(a,function(a){return a===b!==c}):"string"!=typeof b?r.grep(a,function(a){return i.call(b,a)>-1!==c}):D.test(b)?r.filter(b,a,c):(b=r.filter(b,a),r.grep(a,function(a){return i.call(b,a)>-1!==c&&1===a.nodeType}))}r.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?r.find.matchesSelector(d,a)?[d]:[]:r.find.matches(a,r.grep(b,function(a){return 1===a.nodeType}))},r.fn.extend({find:function(a){var b,c,d=this.length,e=this;if("string"!=typeof a)return this.pushStack(r(a).filter(function(){for(b=0;b<d;b++)if(r.contains(e[b],this))return!0}));for(c=this.pushStack([]),b=0;b<d;b++)r.find(a,e[b],c);return d>1?r.uniqueSort(c):c},filter:function(a){return this.pushStack(E(this,a||[],!1))},not:function(a){return this.pushStack(E(this,a||[],!0))},is:function(a){return!!E(this,"string"==typeof a&&A.test(a)?r(a):a||[],!1).length}});var F,G=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,H=r.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||F,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:G.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof r?b[0]:b,r.merge(this,r.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),C.test(e[1])&&r.isPlainObject(b))for(e in b)r.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&(this[0]=f,this.length=1),this}return a.nodeType?(this[0]=a,this.length=1,this):r.isFunction(a)?void 0!==c.ready?c.ready(a):a(r):r.makeArray(a,this)};H.prototype=r.fn,F=r(d);var I=/^(?:parents|prev(?:Until|All))/,J={children:!0,contents:!0,next:!0,prev:!0};r.fn.extend({has:function(a){var b=r(a,this),c=b.length;return this.filter(function(){for(var a=0;a<c;a++)if(r.contains(this,b[a]))return!0})},closest:function(a,b){var c,d=0,e=this.length,f=[],g="string"!=typeof a&&r(a);if(!A.test(a))for(;d<e;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&r.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?r.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?i.call(r(a),this[0]):i.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(r.uniqueSort(r.merge(this.get(),r(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function K(a,b){while((a=a[b])&&1!==a.nodeType);return a}r.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return y(a,"parentNode")},parentsUntil:function(a,b,c){return y(a,"parentNode",c)},next:function(a){return K(a,"nextSibling")},prev:function(a){return K(a,"previousSibling")},nextAll:function(a){return y(a,"nextSibling")},prevAll:function(a){return y(a,"previousSibling")},nextUntil:function(a,b,c){return y(a,"nextSibling",c)},prevUntil:function(a,b,c){return y(a,"previousSibling",c)},siblings:function(a){return z((a.parentNode||{}).firstChild,a)},children:function(a){return z(a.firstChild)},contents:function(a){return B(a,"iframe")?a.contentDocument:(B(a,"template")&&(a=a.content||a),r.merge([],a.childNodes))}},function(a,b){r.fn[a]=function(c,d){var e=r.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=r.filter(d,e)),this.length>1&&(J[a]||r.uniqueSort(e),I.test(a)&&e.reverse()),this.pushStack(e)}});var L=/[^\x20\t\r\n\f]+/g;function M(a){var b={};return r.each(a.match(L)||[],function(a,c){b[c]=!0}),b}r.Callbacks=function(a){a="string"==typeof a?M(a):r.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=e||a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h<f.length)f[h].apply(c[0],c[1])===!1&&a.stopOnFalse&&(h=f.length,c=!1)}a.memory||(c=!1),b=!1,e&&(f=c?[]:"")},j={add:function(){return f&&(c&&!b&&(h=f.length-1,g.push(c)),function d(b){r.each(b,function(b,c){r.isFunction(c)?a.unique&&j.has(c)||f.push(c):c&&c.length&&"string"!==r.type(c)&&d(c)})}(arguments),c&&!b&&i()),this},remove:function(){return r.each(arguments,function(a,b){var c;while((c=r.inArray(b,f,c))>-1)f.splice(c,1),c<=h&&h--}),this},has:function(a){return a?r.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||b||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j};function N(a){return a}function O(a){throw a}function P(a,b,c,d){var e;try{a&&r.isFunction(e=a.promise)?e.call(a).done(b).fail(c):a&&r.isFunction(e=a.then)?e.call(a,b,c):b.apply(void 0,[a].slice(d))}catch(a){c.apply(void 0,[a])}}r.extend({Deferred:function(b){var c=[["notify","progress",r.Callbacks("memory"),r.Callbacks("memory"),2],["resolve","done",r.Callbacks("once memory"),r.Callbacks("once memory"),0,"resolved"],["reject","fail",r.Callbacks("once memory"),r.Callbacks("once memory"),1,"rejected"]],d="pending",e={state:function(){return d},always:function(){return f.done(arguments).fail(arguments),this},"catch":function(a){return e.then(null,a)},pipe:function(){var a=arguments;return r.Deferred(function(b){r.each(c,function(c,d){var e=r.isFunction(a[d[4]])&&a[d[4]];f[d[1]](function(){var a=e&&e.apply(this,arguments);a&&r.isFunction(a.promise)?a.promise().progress(b.notify).done(b.resolve).fail(b.reject):b[d[0]+"With"](this,e?[a]:arguments)})}),a=null}).promise()},then:function(b,d,e){var f=0;function g(b,c,d,e){return function(){var h=this,i=arguments,j=function(){var a,j;if(!(b<f)){if(a=d.apply(h,i),a===c.promise())throw new TypeError("Thenable self-resolution");j=a&&("object"==typeof a||"function"==typeof a)&&a.then,r.isFunction(j)?e?j.call(a,g(f,c,N,e),g(f,c,O,e)):(f++,j.call(a,g(f,c,N,e),g(f,c,O,e),g(f,c,N,c.notifyWith))):(d!==N&&(h=void 0,i=[a]),(e||c.resolveWith)(h,i))}},k=e?j:function(){try{j()}catch(a){r.Deferred.exceptionHook&&r.Deferred.exceptionHook(a,k.stackTrace),b+1>=f&&(d!==O&&(h=void 0,i=[a]),c.rejectWith(h,i))}};b?k():(r.Deferred.getStackHook&&(k.stackTrace=r.Deferred.getStackHook()),a.setTimeout(k))}}return r.Deferred(function(a){c[0][3].add(g(0,a,r.isFunction(e)?e:N,a.notifyWith)),c[1][3].add(g(0,a,r.isFunction(b)?b:N)),c[2][3].add(g(0,a,r.isFunction(d)?d:O))}).promise()},promise:function(a){return null!=a?r.extend(a,e):e}},f={};return r.each(c,function(a,b){var g=b[2],h=b[5];e[b[1]]=g.add,h&&g.add(function(){d=h},c[3-a][2].disable,c[0][2].lock),g.add(b[3].fire),f[b[0]]=function(){return f[b[0]+"With"](this===f?void 0:this,arguments),this},f[b[0]+"With"]=g.fireWith}),e.promise(f),b&&b.call(f,f),f},when:function(a){var b=arguments.length,c=b,d=Array(c),e=f.call(arguments),g=r.Deferred(),h=function(a){return function(c){d[a]=this,e[a]=arguments.length>1?f.call(arguments):c,--b||g.resolveWith(d,e)}};if(b<=1&&(P(a,g.done(h(c)).resolve,g.reject,!b),"pending"===g.state()||r.isFunction(e[c]&&e[c].then)))return g.then();while(c--)P(e[c],h(c),g.reject);return g.promise()}});var Q=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;r.Deferred.exceptionHook=function(b,c){a.console&&a.console.warn&&b&&Q.test(b.name)&&a.console.warn("jQuery.Deferred exception: "+b.message,b.stack,c)},r.readyException=function(b){a.setTimeout(function(){throw b})};var R=r.Deferred();r.fn.ready=function(a){return R.then(a)["catch"](function(a){r.readyException(a)}),this},r.extend({isReady:!1,readyWait:1,ready:function(a){(a===!0?--r.readyWait:r.isReady)||(r.isReady=!0,a!==!0&&--r.readyWait>0||R.resolveWith(d,[r]))}}),r.ready.then=R.then;function S(){d.removeEventListener("DOMContentLoaded",S),
- a.removeEventListener("load",S),r.ready()}"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(r.ready):(d.addEventListener("DOMContentLoaded",S),a.addEventListener("load",S));var T=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===r.type(c)){e=!0;for(h in c)T(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,r.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(r(a),c)})),b))for(;h<i;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},U=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function V(){this.expando=r.expando+V.uid++}V.uid=1,V.prototype={cache:function(a){var b=a[this.expando];return b||(b={},U(a)&&(a.nodeType?a[this.expando]=b:Object.defineProperty(a,this.expando,{value:b,configurable:!0}))),b},set:function(a,b,c){var d,e=this.cache(a);if("string"==typeof b)e[r.camelCase(b)]=c;else for(d in b)e[r.camelCase(d)]=b[d];return e},get:function(a,b){return void 0===b?this.cache(a):a[this.expando]&&a[this.expando][r.camelCase(b)]},access:function(a,b,c){return void 0===b||b&&"string"==typeof b&&void 0===c?this.get(a,b):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d=a[this.expando];if(void 0!==d){if(void 0!==b){Array.isArray(b)?b=b.map(r.camelCase):(b=r.camelCase(b),b=b in d?[b]:b.match(L)||[]),c=b.length;while(c--)delete d[b[c]]}(void 0===b||r.isEmptyObject(d))&&(a.nodeType?a[this.expando]=void 0:delete a[this.expando])}},hasData:function(a){var b=a[this.expando];return void 0!==b&&!r.isEmptyObject(b)}};var W=new V,X=new V,Y=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Z=/[A-Z]/g;function $(a){return"true"===a||"false"!==a&&("null"===a?null:a===+a+""?+a:Y.test(a)?JSON.parse(a):a)}function _(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(Z,"-$&").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c=$(c)}catch(e){}X.set(a,b,c)}else c=void 0;return c}r.extend({hasData:function(a){return X.hasData(a)||W.hasData(a)},data:function(a,b,c){return X.access(a,b,c)},removeData:function(a,b){X.remove(a,b)},_data:function(a,b,c){return W.access(a,b,c)},_removeData:function(a,b){W.remove(a,b)}}),r.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=X.get(f),1===f.nodeType&&!W.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=r.camelCase(d.slice(5)),_(f,d,e[d])));W.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){X.set(this,a)}):T(this,function(b){var c;if(f&&void 0===b){if(c=X.get(f,a),void 0!==c)return c;if(c=_(f,a),void 0!==c)return c}else this.each(function(){X.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){X.remove(this,a)})}}),r.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=W.get(a,b),c&&(!d||Array.isArray(c)?d=W.access(a,b,r.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=r.queue(a,b),d=c.length,e=c.shift(),f=r._queueHooks(a,b),g=function(){r.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return W.get(a,c)||W.access(a,c,{empty:r.Callbacks("once memory").add(function(){W.remove(a,[b+"queue",c])})})}}),r.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?r.queue(this[0],a):void 0===b?this:this.each(function(){var c=r.queue(this,a,b);r._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&r.dequeue(this,a)})},dequeue:function(a){return this.each(function(){r.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=r.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=W.get(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var aa=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,ba=new RegExp("^(?:([+-])=|)("+aa+")([a-z%]*)$","i"),ca=["Top","Right","Bottom","Left"],da=function(a,b){return a=b||a,"none"===a.style.display||""===a.style.display&&r.contains(a.ownerDocument,a)&&"none"===r.css(a,"display")},ea=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};function fa(a,b,c,d){var e,f=1,g=20,h=d?function(){return d.cur()}:function(){return r.css(a,b,"")},i=h(),j=c&&c[3]||(r.cssNumber[b]?"":"px"),k=(r.cssNumber[b]||"px"!==j&&+i)&&ba.exec(r.css(a,b));if(k&&k[3]!==j){j=j||k[3],c=c||[],k=+i||1;do f=f||".5",k/=f,r.style(a,b,k+j);while(f!==(f=h()/i)&&1!==f&&--g)}return c&&(k=+k||+i||0,e=c[1]?k+(c[1]+1)*c[2]:+c[2],d&&(d.unit=j,d.start=k,d.end=e)),e}var ga={};function ha(a){var b,c=a.ownerDocument,d=a.nodeName,e=ga[d];return e?e:(b=c.body.appendChild(c.createElement(d)),e=r.css(b,"display"),b.parentNode.removeChild(b),"none"===e&&(e="block"),ga[d]=e,e)}function ia(a,b){for(var c,d,e=[],f=0,g=a.length;f<g;f++)d=a[f],d.style&&(c=d.style.display,b?("none"===c&&(e[f]=W.get(d,"display")||null,e[f]||(d.style.display="")),""===d.style.display&&da(d)&&(e[f]=ha(d))):"none"!==c&&(e[f]="none",W.set(d,"display",c)));for(f=0;f<g;f++)null!=e[f]&&(a[f].style.display=e[f]);return a}r.fn.extend({show:function(){return ia(this,!0)},hide:function(){return ia(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){da(this)?r(this).show():r(this).hide()})}});var ja=/^(?:checkbox|radio)$/i,ka=/<([a-z][^\/\0>\x20\t\r\n\f]+)/i,la=/^$|\/(?:java|ecma)script/i,ma={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};ma.optgroup=ma.option,ma.tbody=ma.tfoot=ma.colgroup=ma.caption=ma.thead,ma.th=ma.td;function na(a,b){var c;return c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[],void 0===b||b&&B(a,b)?r.merge([a],c):c}function oa(a,b){for(var c=0,d=a.length;c<d;c++)W.set(a[c],"globalEval",!b||W.get(b[c],"globalEval"))}var pa=/<|&#?\w+;/;function qa(a,b,c,d,e){for(var f,g,h,i,j,k,l=b.createDocumentFragment(),m=[],n=0,o=a.length;n<o;n++)if(f=a[n],f||0===f)if("object"===r.type(f))r.merge(m,f.nodeType?[f]:f);else if(pa.test(f)){g=g||l.appendChild(b.createElement("div")),h=(ka.exec(f)||["",""])[1].toLowerCase(),i=ma[h]||ma._default,g.innerHTML=i[1]+r.htmlPrefilter(f)+i[2],k=i[0];while(k--)g=g.lastChild;r.merge(m,g.childNodes),g=l.firstChild,g.textContent=""}else m.push(b.createTextNode(f));l.textContent="",n=0;while(f=m[n++])if(d&&r.inArray(f,d)>-1)e&&e.push(f);else if(j=r.contains(f.ownerDocument,f),g=na(l.appendChild(f),"script"),j&&oa(g),c){k=0;while(f=g[k++])la.test(f.type||"")&&c.push(f)}return l}!function(){var a=d.createDocumentFragment(),b=a.appendChild(d.createElement("div")),c=d.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),o.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="<textarea>x</textarea>",o.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var ra=d.documentElement,sa=/^key/,ta=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,ua=/^([^.]*)(?:\.(.+)|)/;function va(){return!0}function wa(){return!1}function xa(){try{return d.activeElement}catch(a){}}function ya(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)ya(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=wa;else if(!e)return a;return 1===f&&(g=e,e=function(a){return r().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=r.guid++)),a.each(function(){r.event.add(this,b,e,d,c)})}r.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=W.get(a);if(q){c.handler&&(f=c,c=f.handler,e=f.selector),e&&r.find.matchesSelector(ra,e),c.guid||(c.guid=r.guid++),(i=q.events)||(i=q.events={}),(g=q.handle)||(g=q.handle=function(b){return"undefined"!=typeof r&&r.event.triggered!==b.type?r.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(L)||[""],j=b.length;while(j--)h=ua.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n&&(l=r.event.special[n]||{},n=(e?l.delegateType:l.bindType)||n,l=r.event.special[n]||{},k=r.extend({type:n,origType:p,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&r.expr.match.needsContext.test(e),namespace:o.join(".")},f),(m=i[n])||(m=i[n]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,o,g)!==!1||a.addEventListener&&a.addEventListener(n,g)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),r.event.global[n]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=W.hasData(a)&&W.get(a);if(q&&(i=q.events)){b=(b||"").match(L)||[""],j=b.length;while(j--)if(h=ua.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n){l=r.event.special[n]||{},n=(d?l.delegateType:l.bindType)||n,m=i[n]||[],h=h[2]&&new RegExp("(^|\\.)"+o.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&p!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,o,q.handle)!==!1||r.removeEvent(a,n,q.handle),delete i[n])}else for(n in i)r.event.remove(a,n+b[j],c,d,!0);r.isEmptyObject(i)&&W.remove(a,"handle events")}},dispatch:function(a){var b=r.event.fix(a),c,d,e,f,g,h,i=new Array(arguments.length),j=(W.get(this,"events")||{})[b.type]||[],k=r.event.special[b.type]||{};for(i[0]=b,c=1;c<arguments.length;c++)i[c]=arguments[c];if(b.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,b)!==!1){h=r.event.handlers.call(this,b,j),c=0;while((f=h[c++])&&!b.isPropagationStopped()){b.currentTarget=f.elem,d=0;while((g=f.handlers[d++])&&!b.isImmediatePropagationStopped())b.rnamespace&&!b.rnamespace.test(g.namespace)||(b.handleObj=g,b.data=g.data,e=((r.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(b.result=e)===!1&&(b.preventDefault(),b.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,b),b.result}},handlers:function(a,b){var c,d,e,f,g,h=[],i=b.delegateCount,j=a.target;if(i&&j.nodeType&&!("click"===a.type&&a.button>=1))for(;j!==this;j=j.parentNode||this)if(1===j.nodeType&&("click"!==a.type||j.disabled!==!0)){for(f=[],g={},c=0;c<i;c++)d=b[c],e=d.selector+" ",void 0===g[e]&&(g[e]=d.needsContext?r(e,this).index(j)>-1:r.find(e,this,null,[j]).length),g[e]&&f.push(d);f.length&&h.push({elem:j,handlers:f})}return j=this,i<b.length&&h.push({elem:j,handlers:b.slice(i)}),h},addProp:function(a,b){Object.defineProperty(r.Event.prototype,a,{enumerable:!0,configurable:!0,get:r.isFunction(b)?function(){if(this.originalEvent)return b(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[a]},set:function(b){Object.defineProperty(this,a,{enumerable:!0,configurable:!0,writable:!0,value:b})}})},fix:function(a){return a[r.expando]?a:new r.Event(a)},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==xa()&&this.focus)return this.focus(),!1},delegateType:"focusin"},blur:{trigger:function(){if(this===xa()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if("checkbox"===this.type&&this.click&&B(this,"input"))return this.click(),!1},_default:function(a){return B(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}}},r.removeEvent=function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c)},r.Event=function(a,b){return this instanceof r.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?va:wa,this.target=a.target&&3===a.target.nodeType?a.target.parentNode:a.target,this.currentTarget=a.currentTarget,this.relatedTarget=a.relatedTarget):this.type=a,b&&r.extend(this,b),this.timeStamp=a&&a.timeStamp||r.now(),void(this[r.expando]=!0)):new r.Event(a,b)},r.Event.prototype={constructor:r.Event,isDefaultPrevented:wa,isPropagationStopped:wa,isImmediatePropagationStopped:wa,isSimulated:!1,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=va,a&&!this.isSimulated&&a.preventDefault()},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=va,a&&!this.isSimulated&&a.stopPropagation()},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=va,a&&!this.isSimulated&&a.stopImmediatePropagation(),this.stopPropagation()}},r.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,"char":!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(a){var b=a.button;return null==a.which&&sa.test(a.type)?null!=a.charCode?a.charCode:a.keyCode:!a.which&&void 0!==b&&ta.test(a.type)?1&b?1:2&b?3:4&b?2:0:a.which}},r.event.addProp),r.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){r.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return e&&(e===d||r.contains(d,e))||(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),r.fn.extend({on:function(a,b,c,d){return ya(this,a,b,c,d)},one:function(a,b,c,d){return ya(this,a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,r(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return b!==!1&&"function"!=typeof b||(c=b,b=void 0),c===!1&&(c=wa),this.each(function(){r.event.remove(this,a,c,b)})}});var za=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,Aa=/<script|<style|<link/i,Ba=/checked\s*(?:[^=]|=\s*.checked.)/i,Ca=/^true\/(.*)/,Da=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function Ea(a,b){return B(a,"table")&&B(11!==b.nodeType?b:b.firstChild,"tr")?r(">tbody",a)[0]||a:a}function Fa(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function Ga(a){var b=Ca.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Ha(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(W.hasData(a)&&(f=W.access(a),g=W.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;c<d;c++)r.event.add(b,e,j[e][c])}X.hasData(a)&&(h=X.access(a),i=r.extend({},h),X.set(b,i))}}function Ia(a,b){var c=b.nodeName.toLowerCase();"input"===c&&ja.test(a.type)?b.checked=a.checked:"input"!==c&&"textarea"!==c||(b.defaultValue=a.defaultValue)}function Ja(a,b,c,d){b=g.apply([],b);var e,f,h,i,j,k,l=0,m=a.length,n=m-1,q=b[0],s=r.isFunction(q);if(s||m>1&&"string"==typeof q&&!o.checkClone&&Ba.test(q))return a.each(function(e){var f=a.eq(e);s&&(b[0]=q.call(this,e,f.html())),Ja(f,b,c,d)});if(m&&(e=qa(b,a[0].ownerDocument,!1,a,d),f=e.firstChild,1===e.childNodes.length&&(e=f),f||d)){for(h=r.map(na(e,"script"),Fa),i=h.length;l<m;l++)j=e,l!==n&&(j=r.clone(j,!0,!0),i&&r.merge(h,na(j,"script"))),c.call(a[l],j,l);if(i)for(k=h[h.length-1].ownerDocument,r.map(h,Ga),l=0;l<i;l++)j=h[l],la.test(j.type||"")&&!W.access(j,"globalEval")&&r.contains(k,j)&&(j.src?r._evalUrl&&r._evalUrl(j.src):p(j.textContent.replace(Da,""),k))}return a}function Ka(a,b,c){for(var d,e=b?r.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||r.cleanData(na(d)),d.parentNode&&(c&&r.contains(d.ownerDocument,d)&&oa(na(d,"script")),d.parentNode.removeChild(d));return a}r.extend({htmlPrefilter:function(a){return a.replace(za,"<$1></$2>")},clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=r.contains(a.ownerDocument,a);if(!(o.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||r.isXMLDoc(a)))for(g=na(h),f=na(a),d=0,e=f.length;d<e;d++)Ia(f[d],g[d]);if(b)if(c)for(f=f||na(a),g=g||na(h),d=0,e=f.length;d<e;d++)Ha(f[d],g[d]);else Ha(a,h);return g=na(h,"script"),g.length>0&&oa(g,!i&&na(a,"script")),h},cleanData:function(a){for(var b,c,d,e=r.event.special,f=0;void 0!==(c=a[f]);f++)if(U(c)){if(b=c[W.expando]){if(b.events)for(d in b.events)e[d]?r.event.remove(c,d):r.removeEvent(c,d,b.handle);c[W.expando]=void 0}c[X.expando]&&(c[X.expando]=void 0)}}}),r.fn.extend({detach:function(a){return Ka(this,a,!0)},remove:function(a){return Ka(this,a)},text:function(a){return T(this,function(a){return void 0===a?r.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=a)})},null,a,arguments.length)},append:function(){return Ja(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ea(this,a);b.appendChild(a)}})},prepend:function(){return Ja(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ea(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return Ja(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return Ja(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(r.cleanData(na(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null!=a&&a,b=null==b?a:b,this.map(function(){return r.clone(this,a,b)})},html:function(a){return T(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!Aa.test(a)&&!ma[(ka.exec(a)||["",""])[1].toLowerCase()]){a=r.htmlPrefilter(a);try{for(;c<d;c++)b=this[c]||{},1===b.nodeType&&(r.cleanData(na(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=[];return Ja(this,arguments,function(b){var c=this.parentNode;r.inArray(this,a)<0&&(r.cleanData(na(this)),c&&c.replaceChild(b,this))},a)}}),r.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){r.fn[a]=function(a){for(var c,d=[],e=r(a),f=e.length-1,g=0;g<=f;g++)c=g===f?this:this.clone(!0),r(e[g])[b](c),h.apply(d,c.get());return this.pushStack(d)}});var La=/^margin/,Ma=new RegExp("^("+aa+")(?!px)[a-z%]+$","i"),Na=function(b){var c=b.ownerDocument.defaultView;return c&&c.opener||(c=a),c.getComputedStyle(b)};!function(){function b(){if(i){i.style.cssText="box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",i.innerHTML="",ra.appendChild(h);var b=a.getComputedStyle(i);c="1%"!==b.top,g="2px"===b.marginLeft,e="4px"===b.width,i.style.marginRight="50%",f="4px"===b.marginRight,ra.removeChild(h),i=null}}var c,e,f,g,h=d.createElement("div"),i=d.createElement("div");i.style&&(i.style.backgroundClip="content-box",i.cloneNode(!0).style.backgroundClip="",o.clearCloneStyle="content-box"===i.style.backgroundClip,h.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",h.appendChild(i),r.extend(o,{pixelPosition:function(){return b(),c},boxSizingReliable:function(){return b(),e},pixelMarginRight:function(){return b(),f},reliableMarginLeft:function(){return b(),g}}))}();function Oa(a,b,c){var d,e,f,g,h=a.style;return c=c||Na(a),c&&(g=c.getPropertyValue(b)||c[b],""!==g||r.contains(a.ownerDocument,a)||(g=r.style(a,b)),!o.pixelMarginRight()&&Ma.test(g)&&La.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0!==g?g+"":g}function Pa(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}var Qa=/^(none|table(?!-c[ea]).+)/,Ra=/^--/,Sa={position:"absolute",visibility:"hidden",display:"block"},Ta={letterSpacing:"0",fontWeight:"400"},Ua=["Webkit","Moz","ms"],Va=d.createElement("div").style;function Wa(a){if(a in Va)return a;var b=a[0].toUpperCase()+a.slice(1),c=Ua.length;while(c--)if(a=Ua[c]+b,a in Va)return a}function Xa(a){var b=r.cssProps[a];return b||(b=r.cssProps[a]=Wa(a)||a),b}function Ya(a,b,c){var d=ba.exec(b);return d?Math.max(0,d[2]-(c||0))+(d[3]||"px"):b}function Za(a,b,c,d,e){var f,g=0;for(f=c===(d?"border":"content")?4:"width"===b?1:0;f<4;f+=2)"margin"===c&&(g+=r.css(a,c+ca[f],!0,e)),d?("content"===c&&(g-=r.css(a,"padding"+ca[f],!0,e)),"margin"!==c&&(g-=r.css(a,"border"+ca[f]+"Width",!0,e))):(g+=r.css(a,"padding"+ca[f],!0,e),"padding"!==c&&(g+=r.css(a,"border"+ca[f]+"Width",!0,e)));return g}function $a(a,b,c){var d,e=Na(a),f=Oa(a,b,e),g="border-box"===r.css(a,"boxSizing",!1,e);return Ma.test(f)?f:(d=g&&(o.boxSizingReliable()||f===a.style[b]),"auto"===f&&(f=a["offset"+b[0].toUpperCase()+b.slice(1)]),f=parseFloat(f)||0,f+Za(a,b,c||(g?"border":"content"),d,e)+"px")}r.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Oa(a,"opacity");return""===c?"1":c}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=r.camelCase(b),i=Ra.test(b),j=a.style;return i||(b=Xa(h)),g=r.cssHooks[b]||r.cssHooks[h],void 0===c?g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:j[b]:(f=typeof c,"string"===f&&(e=ba.exec(c))&&e[1]&&(c=fa(a,b,e),f="number"),null!=c&&c===c&&("number"===f&&(c+=e&&e[3]||(r.cssNumber[h]?"":"px")),o.clearCloneStyle||""!==c||0!==b.indexOf("background")||(j[b]="inherit"),g&&"set"in g&&void 0===(c=g.set(a,c,d))||(i?j.setProperty(b,c):j[b]=c)),void 0)}},css:function(a,b,c,d){var e,f,g,h=r.camelCase(b),i=Ra.test(b);return i||(b=Xa(h)),g=r.cssHooks[b]||r.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=Oa(a,b,d)),"normal"===e&&b in Ta&&(e=Ta[b]),""===c||c?(f=parseFloat(e),c===!0||isFinite(f)?f||0:e):e}}),r.each(["height","width"],function(a,b){r.cssHooks[b]={get:function(a,c,d){if(c)return!Qa.test(r.css(a,"display"))||a.getClientRects().length&&a.getBoundingClientRect().width?$a(a,b,d):ea(a,Sa,function(){return $a(a,b,d)})},set:function(a,c,d){var e,f=d&&Na(a),g=d&&Za(a,b,d,"border-box"===r.css(a,"boxSizing",!1,f),f);return g&&(e=ba.exec(c))&&"px"!==(e[3]||"px")&&(a.style[b]=c,c=r.css(a,b)),Ya(a,c,g)}}}),r.cssHooks.marginLeft=Pa(o.reliableMarginLeft,function(a,b){if(b)return(parseFloat(Oa(a,"marginLeft"))||a.getBoundingClientRect().left-ea(a,{marginLeft:0},function(){return a.getBoundingClientRect().left}))+"px"}),r.each({margin:"",padding:"",border:"Width"},function(a,b){r.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];d<4;d++)e[a+ca[d]+b]=f[d]||f[d-2]||f[0];return e}},La.test(a)||(r.cssHooks[a+b].set=Ya)}),r.fn.extend({css:function(a,b){return T(this,function(a,b,c){var d,e,f={},g=0;if(Array.isArray(b)){for(d=Na(a),e=b.length;g<e;g++)f[b[g]]=r.css(a,b[g],!1,d);return f}return void 0!==c?r.style(a,b,c):r.css(a,b)},a,b,arguments.length>1)}});function _a(a,b,c,d,e){return new _a.prototype.init(a,b,c,d,e)}r.Tween=_a,_a.prototype={constructor:_a,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||r.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(r.cssNumber[c]?"":"px")},cur:function(){var a=_a.propHooks[this.prop];return a&&a.get?a.get(this):_a.propHooks._default.get(this)},run:function(a){var b,c=_a.propHooks[this.prop];return this.options.duration?this.pos=b=r.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):_a.propHooks._default.set(this),this}},_a.prototype.init.prototype=_a.prototype,_a.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=r.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){r.fx.step[a.prop]?r.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[r.cssProps[a.prop]]&&!r.cssHooks[a.prop]?a.elem[a.prop]=a.now:r.style(a.elem,a.prop,a.now+a.unit)}}},_a.propHooks.scrollTop=_a.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},r.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},r.fx=_a.prototype.init,r.fx.step={};var ab,bb,cb=/^(?:toggle|show|hide)$/,db=/queueHooks$/;function eb(){bb&&(d.hidden===!1&&a.requestAnimationFrame?a.requestAnimationFrame(eb):a.setTimeout(eb,r.fx.interval),r.fx.tick())}function fb(){return a.setTimeout(function(){ab=void 0}),ab=r.now()}function gb(a,b){var c,d=0,e={height:a};for(b=b?1:0;d<4;d+=2-b)c=ca[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function hb(a,b,c){for(var d,e=(kb.tweeners[b]||[]).concat(kb.tweeners["*"]),f=0,g=e.length;f<g;f++)if(d=e[f].call(c,b,a))return d}function ib(a,b,c){var d,e,f,g,h,i,j,k,l="width"in b||"height"in b,m=this,n={},o=a.style,p=a.nodeType&&da(a),q=W.get(a,"fxshow");c.queue||(g=r._queueHooks(a,"fx"),null==g.unqueued&&(g.unqueued=0,h=g.empty.fire,g.empty.fire=function(){g.unqueued||h()}),g.unqueued++,m.always(function(){m.always(function(){g.unqueued--,r.queue(a,"fx").length||g.empty.fire()})}));for(d in b)if(e=b[d],cb.test(e)){if(delete b[d],f=f||"toggle"===e,e===(p?"hide":"show")){if("show"!==e||!q||void 0===q[d])continue;p=!0}n[d]=q&&q[d]||r.style(a,d)}if(i=!r.isEmptyObject(b),i||!r.isEmptyObject(n)){l&&1===a.nodeType&&(c.overflow=[o.overflow,o.overflowX,o.overflowY],j=q&&q.display,null==j&&(j=W.get(a,"display")),k=r.css(a,"display"),"none"===k&&(j?k=j:(ia([a],!0),j=a.style.display||j,k=r.css(a,"display"),ia([a]))),("inline"===k||"inline-block"===k&&null!=j)&&"none"===r.css(a,"float")&&(i||(m.done(function(){o.display=j}),null==j&&(k=o.display,j="none"===k?"":k)),o.display="inline-block")),c.overflow&&(o.overflow="hidden",m.always(function(){o.overflow=c.overflow[0],o.overflowX=c.overflow[1],o.overflowY=c.overflow[2]})),i=!1;for(d in n)i||(q?"hidden"in q&&(p=q.hidden):q=W.access(a,"fxshow",{display:j}),f&&(q.hidden=!p),p&&ia([a],!0),m.done(function(){p||ia([a]),W.remove(a,"fxshow");for(d in n)r.style(a,d,n[d])})),i=hb(p?q[d]:0,d,m),d in q||(q[d]=i.start,p&&(i.end=i.start,i.start=0))}}function jb(a,b){var c,d,e,f,g;for(c in a)if(d=r.camelCase(c),e=b[d],f=a[c],Array.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=r.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function kb(a,b,c){var d,e,f=0,g=kb.prefilters.length,h=r.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=ab||fb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;g<i;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),f<1&&i?c:(i||h.notifyWith(a,[j,1,0]),h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:r.extend({},b),opts:r.extend(!0,{specialEasing:{},easing:r.easing._default},c),originalProperties:b,originalOptions:c,startTime:ab||fb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=r.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;c<d;c++)j.tweens[c].run(1);return b?(h.notifyWith(a,[j,1,0]),h.resolveWith(a,[j,b])):h.rejectWith(a,[j,b]),this}}),k=j.props;for(jb(k,j.opts.specialEasing);f<g;f++)if(d=kb.prefilters[f].call(j,a,k,j.opts))return r.isFunction(d.stop)&&(r._queueHooks(j.elem,j.opts.queue).stop=r.proxy(d.stop,d)),d;return r.map(k,hb,j),r.isFunction(j.opts.start)&&j.opts.start.call(a,j),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always),r.fx.timer(r.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j}r.Animation=r.extend(kb,{tweeners:{"*":[function(a,b){var c=this.createTween(a,b);return fa(c.elem,a,ba.exec(b),c),c}]},tweener:function(a,b){r.isFunction(a)?(b=a,a=["*"]):a=a.match(L);for(var c,d=0,e=a.length;d<e;d++)c=a[d],kb.tweeners[c]=kb.tweeners[c]||[],kb.tweeners[c].unshift(b)},prefilters:[ib],prefilter:function(a,b){b?kb.prefilters.unshift(a):kb.prefilters.push(a)}}),r.speed=function(a,b,c){var d=a&&"object"==typeof a?r.extend({},a):{complete:c||!c&&b||r.isFunction(a)&&a,duration:a,easing:c&&b||b&&!r.isFunction(b)&&b};return r.fx.off?d.duration=0:"number"!=typeof d.duration&&(d.duration in r.fx.speeds?d.duration=r.fx.speeds[d.duration]:d.duration=r.fx.speeds._default),null!=d.queue&&d.queue!==!0||(d.queue="fx"),d.old=d.complete,d.complete=function(){r.isFunction(d.old)&&d.old.call(this),d.queue&&r.dequeue(this,d.queue)},d},r.fn.extend({fadeTo:function(a,b,c,d){return this.filter(da).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=r.isEmptyObject(a),f=r.speed(b,c,d),g=function(){var b=kb(this,r.extend({},a),f);(e||W.get(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=r.timers,g=W.get(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&db.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));!b&&c||r.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=W.get(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=r.timers,g=d?d.length:0;for(c.finish=!0,r.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;b<g;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),r.each(["toggle","show","hide"],function(a,b){var c=r.fn[b];r.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(gb(b,!0),a,d,e)}}),r.each({slideDown:gb("show"),slideUp:gb("hide"),slideToggle:gb("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){r.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),r.timers=[],r.fx.tick=function(){var a,b=0,c=r.timers;for(ab=r.now();b<c.length;b++)a=c[b],a()||c[b]!==a||c.splice(b--,1);c.length||r.fx.stop(),ab=void 0},r.fx.timer=function(a){r.timers.push(a),r.fx.start()},r.fx.interval=13,r.fx.start=function(){bb||(bb=!0,eb())},r.fx.stop=function(){bb=null},r.fx.speeds={slow:600,fast:200,_default:400},r.fn.delay=function(b,c){return b=r.fx?r.fx.speeds[b]||b:b,c=c||"fx",this.queue(c,function(c,d){var e=a.setTimeout(c,b);d.stop=function(){a.clearTimeout(e)}})},function(){var a=d.createElement("input"),b=d.createElement("select"),c=b.appendChild(d.createElement("option"));a.type="checkbox",o.checkOn=""!==a.value,o.optSelected=c.selected,a=d.createElement("input"),a.value="t",a.type="radio",o.radioValue="t"===a.value}();var lb,mb=r.expr.attrHandle;r.fn.extend({attr:function(a,b){return T(this,r.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){r.removeAttr(this,a)})}}),r.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?r.prop(a,b,c):(1===f&&r.isXMLDoc(a)||(e=r.attrHooks[b.toLowerCase()]||(r.expr.match.bool.test(b)?lb:void 0)),void 0!==c?null===c?void r.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=r.find.attr(a,b),
- null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!o.radioValue&&"radio"===b&&B(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d=0,e=b&&b.match(L);if(e&&1===a.nodeType)while(c=e[d++])a.removeAttribute(c)}}),lb={set:function(a,b,c){return b===!1?r.removeAttr(a,c):a.setAttribute(c,c),c}},r.each(r.expr.match.bool.source.match(/\w+/g),function(a,b){var c=mb[b]||r.find.attr;mb[b]=function(a,b,d){var e,f,g=b.toLowerCase();return d||(f=mb[g],mb[g]=e,e=null!=c(a,b,d)?g:null,mb[g]=f),e}});var nb=/^(?:input|select|textarea|button)$/i,ob=/^(?:a|area)$/i;r.fn.extend({prop:function(a,b){return T(this,r.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[r.propFix[a]||a]})}}),r.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&r.isXMLDoc(a)||(b=r.propFix[b]||b,e=r.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=r.find.attr(a,"tabindex");return b?parseInt(b,10):nb.test(a.nodeName)||ob.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),o.optSelected||(r.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null},set:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}}),r.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){r.propFix[this.toLowerCase()]=this});function pb(a){var b=a.match(L)||[];return b.join(" ")}function qb(a){return a.getAttribute&&a.getAttribute("class")||""}r.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).addClass(a.call(this,b,qb(this)))});if("string"==typeof a&&a){b=a.match(L)||[];while(c=this[i++])if(e=qb(c),d=1===c.nodeType&&" "+pb(e)+" "){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=pb(d),e!==h&&c.setAttribute("class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).removeClass(a.call(this,b,qb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(L)||[];while(c=this[i++])if(e=qb(c),d=1===c.nodeType&&" "+pb(e)+" "){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=pb(d),e!==h&&c.setAttribute("class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):r.isFunction(a)?this.each(function(c){r(this).toggleClass(a.call(this,c,qb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=r(this),f=a.match(L)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else void 0!==a&&"boolean"!==c||(b=qb(this),b&&W.set(this,"__className__",b),this.setAttribute&&this.setAttribute("class",b||a===!1?"":W.get(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+pb(qb(c))+" ").indexOf(b)>-1)return!0;return!1}});var rb=/\r/g;r.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=r.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,r(this).val()):a,null==e?e="":"number"==typeof e?e+="":Array.isArray(e)&&(e=r.map(e,function(a){return null==a?"":a+""})),b=r.valHooks[this.type]||r.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=r.valHooks[e.type]||r.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(rb,""):null==c?"":c)}}}),r.extend({valHooks:{option:{get:function(a){var b=r.find.attr(a,"value");return null!=b?b:pb(r.text(a))}},select:{get:function(a){var b,c,d,e=a.options,f=a.selectedIndex,g="select-one"===a.type,h=g?null:[],i=g?f+1:e.length;for(d=f<0?i:g?f:0;d<i;d++)if(c=e[d],(c.selected||d===f)&&!c.disabled&&(!c.parentNode.disabled||!B(c.parentNode,"optgroup"))){if(b=r(c).val(),g)return b;h.push(b)}return h},set:function(a,b){var c,d,e=a.options,f=r.makeArray(b),g=e.length;while(g--)d=e[g],(d.selected=r.inArray(r.valHooks.option.get(d),f)>-1)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),r.each(["radio","checkbox"],function(){r.valHooks[this]={set:function(a,b){if(Array.isArray(b))return a.checked=r.inArray(r(a).val(),b)>-1}},o.checkOn||(r.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var sb=/^(?:focusinfocus|focusoutblur)$/;r.extend(r.event,{trigger:function(b,c,e,f){var g,h,i,j,k,m,n,o=[e||d],p=l.call(b,"type")?b.type:b,q=l.call(b,"namespace")?b.namespace.split("."):[];if(h=i=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!sb.test(p+r.event.triggered)&&(p.indexOf(".")>-1&&(q=p.split("."),p=q.shift(),q.sort()),k=p.indexOf(":")<0&&"on"+p,b=b[r.expando]?b:new r.Event(p,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=q.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:r.makeArray(c,[b]),n=r.event.special[p]||{},f||!n.trigger||n.trigger.apply(e,c)!==!1)){if(!f&&!n.noBubble&&!r.isWindow(e)){for(j=n.delegateType||p,sb.test(j+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),i=h;i===(e.ownerDocument||d)&&o.push(i.defaultView||i.parentWindow||a)}g=0;while((h=o[g++])&&!b.isPropagationStopped())b.type=g>1?j:n.bindType||p,m=(W.get(h,"events")||{})[b.type]&&W.get(h,"handle"),m&&m.apply(h,c),m=k&&h[k],m&&m.apply&&U(h)&&(b.result=m.apply(h,c),b.result===!1&&b.preventDefault());return b.type=p,f||b.isDefaultPrevented()||n._default&&n._default.apply(o.pop(),c)!==!1||!U(e)||k&&r.isFunction(e[p])&&!r.isWindow(e)&&(i=e[k],i&&(e[k]=null),r.event.triggered=p,e[p](),r.event.triggered=void 0,i&&(e[k]=i)),b.result}},simulate:function(a,b,c){var d=r.extend(new r.Event,c,{type:a,isSimulated:!0});r.event.trigger(d,null,b)}}),r.fn.extend({trigger:function(a,b){return this.each(function(){r.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];if(c)return r.event.trigger(a,b,c,!0)}}),r.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(a,b){r.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),r.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),o.focusin="onfocusin"in a,o.focusin||r.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){r.event.simulate(b,a.target,r.event.fix(a))};r.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=W.access(d,b);e||d.addEventListener(a,c,!0),W.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=W.access(d,b)-1;e?W.access(d,b,e):(d.removeEventListener(a,c,!0),W.remove(d,b))}}});var tb=a.location,ub=r.now(),vb=/\?/;r.parseXML=function(b){var c;if(!b||"string"!=typeof b)return null;try{c=(new a.DOMParser).parseFromString(b,"text/xml")}catch(d){c=void 0}return c&&!c.getElementsByTagName("parsererror").length||r.error("Invalid XML: "+b),c};var wb=/\[\]$/,xb=/\r?\n/g,yb=/^(?:submit|button|image|reset|file)$/i,zb=/^(?:input|select|textarea|keygen)/i;function Ab(a,b,c,d){var e;if(Array.isArray(b))r.each(b,function(b,e){c||wb.test(a)?d(a,e):Ab(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)});else if(c||"object"!==r.type(b))d(a,b);else for(e in b)Ab(a+"["+e+"]",b[e],c,d)}r.param=function(a,b){var c,d=[],e=function(a,b){var c=r.isFunction(b)?b():b;d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(null==c?"":c)};if(Array.isArray(a)||a.jquery&&!r.isPlainObject(a))r.each(a,function(){e(this.name,this.value)});else for(c in a)Ab(c,a[c],b,e);return d.join("&")},r.fn.extend({serialize:function(){return r.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=r.prop(this,"elements");return a?r.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!r(this).is(":disabled")&&zb.test(this.nodeName)&&!yb.test(a)&&(this.checked||!ja.test(a))}).map(function(a,b){var c=r(this).val();return null==c?null:Array.isArray(c)?r.map(c,function(a){return{name:b.name,value:a.replace(xb,"\r\n")}}):{name:b.name,value:c.replace(xb,"\r\n")}}).get()}});var Bb=/%20/g,Cb=/#.*$/,Db=/([?&])_=[^&]*/,Eb=/^(.*?):[ \t]*([^\r\n]*)$/gm,Fb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Gb=/^(?:GET|HEAD)$/,Hb=/^\/\//,Ib={},Jb={},Kb="*/".concat("*"),Lb=d.createElement("a");Lb.href=tb.href;function Mb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(L)||[];if(r.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Nb(a,b,c,d){var e={},f=a===Jb;function g(h){var i;return e[h]=!0,r.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Ob(a,b){var c,d,e=r.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&r.extend(!0,a,d),a}function Pb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}if(f)return f!==i[0]&&i.unshift(f),c[f]}function Qb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}r.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:tb.href,type:"GET",isLocal:Fb.test(tb.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Kb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":r.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Ob(Ob(a,r.ajaxSettings),b):Ob(r.ajaxSettings,a)},ajaxPrefilter:Mb(Ib),ajaxTransport:Mb(Jb),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var e,f,g,h,i,j,k,l,m,n,o=r.ajaxSetup({},c),p=o.context||o,q=o.context&&(p.nodeType||p.jquery)?r(p):r.event,s=r.Deferred(),t=r.Callbacks("once memory"),u=o.statusCode||{},v={},w={},x="canceled",y={readyState:0,getResponseHeader:function(a){var b;if(k){if(!h){h={};while(b=Eb.exec(g))h[b[1].toLowerCase()]=b[2]}b=h[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return k?g:null},setRequestHeader:function(a,b){return null==k&&(a=w[a.toLowerCase()]=w[a.toLowerCase()]||a,v[a]=b),this},overrideMimeType:function(a){return null==k&&(o.mimeType=a),this},statusCode:function(a){var b;if(a)if(k)y.always(a[y.status]);else for(b in a)u[b]=[u[b],a[b]];return this},abort:function(a){var b=a||x;return e&&e.abort(b),A(0,b),this}};if(s.promise(y),o.url=((b||o.url||tb.href)+"").replace(Hb,tb.protocol+"//"),o.type=c.method||c.type||o.method||o.type,o.dataTypes=(o.dataType||"*").toLowerCase().match(L)||[""],null==o.crossDomain){j=d.createElement("a");try{j.href=o.url,j.href=j.href,o.crossDomain=Lb.protocol+"//"+Lb.host!=j.protocol+"//"+j.host}catch(z){o.crossDomain=!0}}if(o.data&&o.processData&&"string"!=typeof o.data&&(o.data=r.param(o.data,o.traditional)),Nb(Ib,o,c,y),k)return y;l=r.event&&o.global,l&&0===r.active++&&r.event.trigger("ajaxStart"),o.type=o.type.toUpperCase(),o.hasContent=!Gb.test(o.type),f=o.url.replace(Cb,""),o.hasContent?o.data&&o.processData&&0===(o.contentType||"").indexOf("application/x-www-form-urlencoded")&&(o.data=o.data.replace(Bb,"+")):(n=o.url.slice(f.length),o.data&&(f+=(vb.test(f)?"&":"?")+o.data,delete o.data),o.cache===!1&&(f=f.replace(Db,"$1"),n=(vb.test(f)?"&":"?")+"_="+ub++ +n),o.url=f+n),o.ifModified&&(r.lastModified[f]&&y.setRequestHeader("If-Modified-Since",r.lastModified[f]),r.etag[f]&&y.setRequestHeader("If-None-Match",r.etag[f])),(o.data&&o.hasContent&&o.contentType!==!1||c.contentType)&&y.setRequestHeader("Content-Type",o.contentType),y.setRequestHeader("Accept",o.dataTypes[0]&&o.accepts[o.dataTypes[0]]?o.accepts[o.dataTypes[0]]+("*"!==o.dataTypes[0]?", "+Kb+"; q=0.01":""):o.accepts["*"]);for(m in o.headers)y.setRequestHeader(m,o.headers[m]);if(o.beforeSend&&(o.beforeSend.call(p,y,o)===!1||k))return y.abort();if(x="abort",t.add(o.complete),y.done(o.success),y.fail(o.error),e=Nb(Jb,o,c,y)){if(y.readyState=1,l&&q.trigger("ajaxSend",[y,o]),k)return y;o.async&&o.timeout>0&&(i=a.setTimeout(function(){y.abort("timeout")},o.timeout));try{k=!1,e.send(v,A)}catch(z){if(k)throw z;A(-1,z)}}else A(-1,"No Transport");function A(b,c,d,h){var j,m,n,v,w,x=c;k||(k=!0,i&&a.clearTimeout(i),e=void 0,g=h||"",y.readyState=b>0?4:0,j=b>=200&&b<300||304===b,d&&(v=Pb(o,y,d)),v=Qb(o,v,y,j),j?(o.ifModified&&(w=y.getResponseHeader("Last-Modified"),w&&(r.lastModified[f]=w),w=y.getResponseHeader("etag"),w&&(r.etag[f]=w)),204===b||"HEAD"===o.type?x="nocontent":304===b?x="notmodified":(x=v.state,m=v.data,n=v.error,j=!n)):(n=x,!b&&x||(x="error",b<0&&(b=0))),y.status=b,y.statusText=(c||x)+"",j?s.resolveWith(p,[m,x,y]):s.rejectWith(p,[y,x,n]),y.statusCode(u),u=void 0,l&&q.trigger(j?"ajaxSuccess":"ajaxError",[y,o,j?m:n]),t.fireWith(p,[y,x]),l&&(q.trigger("ajaxComplete",[y,o]),--r.active||r.event.trigger("ajaxStop")))}return y},getJSON:function(a,b,c){return r.get(a,b,c,"json")},getScript:function(a,b){return r.get(a,void 0,b,"script")}}),r.each(["get","post"],function(a,b){r[b]=function(a,c,d,e){return r.isFunction(c)&&(e=e||d,d=c,c=void 0),r.ajax(r.extend({url:a,type:b,dataType:e,data:c,success:d},r.isPlainObject(a)&&a))}}),r._evalUrl=function(a){return r.ajax({url:a,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},r.fn.extend({wrapAll:function(a){var b;return this[0]&&(r.isFunction(a)&&(a=a.call(this[0])),b=r(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this},wrapInner:function(a){return r.isFunction(a)?this.each(function(b){r(this).wrapInner(a.call(this,b))}):this.each(function(){var b=r(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=r.isFunction(a);return this.each(function(c){r(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(a){return this.parent(a).not("body").each(function(){r(this).replaceWith(this.childNodes)}),this}}),r.expr.pseudos.hidden=function(a){return!r.expr.pseudos.visible(a)},r.expr.pseudos.visible=function(a){return!!(a.offsetWidth||a.offsetHeight||a.getClientRects().length)},r.ajaxSettings.xhr=function(){try{return new a.XMLHttpRequest}catch(b){}};var Rb={0:200,1223:204},Sb=r.ajaxSettings.xhr();o.cors=!!Sb&&"withCredentials"in Sb,o.ajax=Sb=!!Sb,r.ajaxTransport(function(b){var c,d;if(o.cors||Sb&&!b.crossDomain)return{send:function(e,f){var g,h=b.xhr();if(h.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(g in b.xhrFields)h[g]=b.xhrFields[g];b.mimeType&&h.overrideMimeType&&h.overrideMimeType(b.mimeType),b.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest");for(g in e)h.setRequestHeader(g,e[g]);c=function(a){return function(){c&&(c=d=h.onload=h.onerror=h.onabort=h.onreadystatechange=null,"abort"===a?h.abort():"error"===a?"number"!=typeof h.status?f(0,"error"):f(h.status,h.statusText):f(Rb[h.status]||h.status,h.statusText,"text"!==(h.responseType||"text")||"string"!=typeof h.responseText?{binary:h.response}:{text:h.responseText},h.getAllResponseHeaders()))}},h.onload=c(),d=h.onerror=c("error"),void 0!==h.onabort?h.onabort=d:h.onreadystatechange=function(){4===h.readyState&&a.setTimeout(function(){c&&d()})},c=c("abort");try{h.send(b.hasContent&&b.data||null)}catch(i){if(c)throw i}},abort:function(){c&&c()}}}),r.ajaxPrefilter(function(a){a.crossDomain&&(a.contents.script=!1)}),r.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return r.globalEval(a),a}}}),r.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),r.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(e,f){b=r("<script>").prop({charset:a.scriptCharset,src:a.url}).on("load error",c=function(a){b.remove(),c=null,a&&f("error"===a.type?404:200,a.type)}),d.head.appendChild(b[0])},abort:function(){c&&c()}}}});var Tb=[],Ub=/(=)\?(?=&|$)|\?\?/;r.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=Tb.pop()||r.expando+"_"+ub++;return this[a]=!0,a}}),r.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(Ub.test(b.url)?"url":"string"==typeof b.data&&0===(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ub.test(b.data)&&"data");if(h||"jsonp"===b.dataTypes[0])return e=b.jsonpCallback=r.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(Ub,"$1"+e):b.jsonp!==!1&&(b.url+=(vb.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||r.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){void 0===f?r(a).removeProp(e):a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,Tb.push(e)),g&&r.isFunction(f)&&f(g[0]),g=f=void 0}),"script"}),o.createHTMLDocument=function(){var a=d.implementation.createHTMLDocument("").body;return a.innerHTML="<form></form><form></form>",2===a.childNodes.length}(),r.parseHTML=function(a,b,c){if("string"!=typeof a)return[];"boolean"==typeof b&&(c=b,b=!1);var e,f,g;return b||(o.createHTMLDocument?(b=d.implementation.createHTMLDocument(""),e=b.createElement("base"),e.href=d.location.href,b.head.appendChild(e)):b=d),f=C.exec(a),g=!c&&[],f?[b.createElement(f[1])]:(f=qa([a],b,g),g&&g.length&&r(g).remove(),r.merge([],f.childNodes))},r.fn.load=function(a,b,c){var d,e,f,g=this,h=a.indexOf(" ");return h>-1&&(d=pb(a.slice(h)),a=a.slice(0,h)),r.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&r.ajax({url:a,type:e||"GET",dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?r("<div>").append(r.parseHTML(a)).find(d):a)}).always(c&&function(a,b){g.each(function(){c.apply(this,f||[a.responseText,b,a])})}),this},r.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){r.fn[b]=function(a){return this.on(b,a)}}),r.expr.pseudos.animated=function(a){return r.grep(r.timers,function(b){return a===b.elem}).length},r.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=r.css(a,"position"),l=r(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=r.css(a,"top"),i=r.css(a,"left"),j=("absolute"===k||"fixed"===k)&&(f+i).indexOf("auto")>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),r.isFunction(b)&&(b=b.call(a,c,r.extend({},h))),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},r.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){r.offset.setOffset(this,a,b)});var b,c,d,e,f=this[0];if(f)return f.getClientRects().length?(d=f.getBoundingClientRect(),b=f.ownerDocument,c=b.documentElement,e=b.defaultView,{top:d.top+e.pageYOffset-c.clientTop,left:d.left+e.pageXOffset-c.clientLeft}):{top:0,left:0}},position:function(){if(this[0]){var a,b,c=this[0],d={top:0,left:0};return"fixed"===r.css(c,"position")?b=c.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),B(a[0],"html")||(d=a.offset()),d={top:d.top+r.css(a[0],"borderTopWidth",!0),left:d.left+r.css(a[0],"borderLeftWidth",!0)}),{top:b.top-d.top-r.css(c,"marginTop",!0),left:b.left-d.left-r.css(c,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent;while(a&&"static"===r.css(a,"position"))a=a.offsetParent;return a||ra})}}),r.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c="pageYOffset"===b;r.fn[a]=function(d){return T(this,function(a,d,e){var f;return r.isWindow(a)?f=a:9===a.nodeType&&(f=a.defaultView),void 0===e?f?f[b]:a[d]:void(f?f.scrollTo(c?f.pageXOffset:e,c?e:f.pageYOffset):a[d]=e)},a,d,arguments.length)}}),r.each(["top","left"],function(a,b){r.cssHooks[b]=Pa(o.pixelPosition,function(a,c){if(c)return c=Oa(a,b),Ma.test(c)?r(a).position()[b]+"px":c})}),r.each({Height:"height",Width:"width"},function(a,b){r.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){r.fn[d]=function(e,f){var g=arguments.length&&(c||"boolean"!=typeof e),h=c||(e===!0||f===!0?"margin":"border");return T(this,function(b,c,e){var f;return r.isWindow(b)?0===d.indexOf("outer")?b["inner"+a]:b.document.documentElement["client"+a]:9===b.nodeType?(f=b.documentElement,Math.max(b.body["scroll"+a],f["scroll"+a],b.body["offset"+a],f["offset"+a],f["client"+a])):void 0===e?r.css(b,c,h):r.style(b,c,e,h)},b,g?e:void 0,g)}})}),r.fn.extend({bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}}),r.holdReady=function(a){a?r.readyWait++:r.ready(!0)},r.isArray=Array.isArray,r.parseJSON=JSON.parse,r.nodeName=B,"function"==typeof define&&define.amd&&define("jquery",[],function(){return r});var Vb=a.jQuery,Wb=a.$;return r.noConflict=function(b){return a.$===r&&(a.$=Wb),b&&a.jQuery===r&&(a.jQuery=Vb),r},b||(a.jQuery=a.$=r),r});
- /* es6-promise.min.js */
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.ES6Promise=e()}(this,function(){"use strict";function t(t){return"function"==typeof t||"object"==typeof t&&null!==t}function e(t){return"function"==typeof t}function n(t){I=t}function r(t){J=t}function o(){return function(){return process.nextTick(a)}}function i(){return"undefined"!=typeof H?function(){H(a)}:c()}function s(){var t=0,e=new V(a),n=document.createTextNode("");return e.observe(n,{characterData:!0}),function(){n.data=t=++t%2}}function u(){var t=new MessageChannel;return t.port1.onmessage=a,function(){return t.port2.postMessage(0)}}function c(){var t=setTimeout;return function(){return t(a,1)}}function a(){for(var t=0;t<G;t+=2){var e=$[t],n=$[t+1];e(n),$[t]=void 0,$[t+1]=void 0}G=0}function f(){try{var t=require,e=t("vertx");return H=e.runOnLoop||e.runOnContext,i()}catch(n){return c()}}function l(t,e){var n=arguments,r=this,o=new this.constructor(p);void 0===o[et]&&k(o);var i=r._state;return i?!function(){var t=n[i-1];J(function(){return x(i,o,t,r._result)})}():E(r,o,t,e),o}function h(t){var e=this;if(t&&"object"==typeof t&&t.constructor===e)return t;var n=new e(p);return g(n,t),n}function p(){}function v(){return new TypeError("You cannot resolve a promise with itself")}function d(){return new TypeError("A promises callback cannot return that same promise.")}function _(t){try{return t.then}catch(e){return it.error=e,it}}function y(t,e,n,r){try{t.call(e,n,r)}catch(o){return o}}function m(t,e,n){J(function(t){var r=!1,o=y(n,e,function(n){r||(r=!0,e!==n?g(t,n):S(t,n))},function(e){r||(r=!0,j(t,e))},"Settle: "+(t._label||" unknown promise"));!r&&o&&(r=!0,j(t,o))},t)}function b(t,e){e._state===rt?S(t,e._result):e._state===ot?j(t,e._result):E(e,void 0,function(e){return g(t,e)},function(e){return j(t,e)})}function w(t,n,r){n.constructor===t.constructor&&r===l&&n.constructor.resolve===h?b(t,n):r===it?(j(t,it.error),it.error=null):void 0===r?S(t,n):e(r)?m(t,n,r):S(t,n)}function g(e,n){e===n?j(e,v()):t(n)?w(e,n,_(n)):S(e,n)}function A(t){t._onerror&&t._onerror(t._result),T(t)}function S(t,e){t._state===nt&&(t._result=e,t._state=rt,0!==t._subscribers.length&&J(T,t))}function j(t,e){t._state===nt&&(t._state=ot,t._result=e,J(A,t))}function E(t,e,n,r){var o=t._subscribers,i=o.length;t._onerror=null,o[i]=e,o[i+rt]=n,o[i+ot]=r,0===i&&t._state&&J(T,t)}function T(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var r=void 0,o=void 0,i=t._result,s=0;s<e.length;s+=3)r=e[s],o=e[s+n],r?x(n,r,o,i):o(i);t._subscribers.length=0}}function M(){this.error=null}function P(t,e){try{return t(e)}catch(n){return st.error=n,st}}function x(t,n,r,o){var i=e(r),s=void 0,u=void 0,c=void 0,a=void 0;if(i){if(s=P(r,o),s===st?(a=!0,u=s.error,s.error=null):c=!0,n===s)return void j(n,d())}else s=o,c=!0;n._state!==nt||(i&&c?g(n,s):a?j(n,u):t===rt?S(n,s):t===ot&&j(n,s))}function C(t,e){try{e(function(e){g(t,e)},function(e){j(t,e)})}catch(n){j(t,n)}}function O(){return ut++}function k(t){t[et]=ut++,t._state=void 0,t._result=void 0,t._subscribers=[]}function Y(t,e){this._instanceConstructor=t,this.promise=new t(p),this.promise[et]||k(this.promise),B(e)?(this._input=e,this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?S(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&S(this.promise,this._result))):j(this.promise,q())}function q(){return new Error("Array Methods must be provided an Array")}function F(t){return new Y(this,t).promise}function D(t){var e=this;return new e(B(t)?function(n,r){for(var o=t.length,i=0;i<o;i++)e.resolve(t[i]).then(n,r)}:function(t,e){return e(new TypeError("You must pass an array to race."))})}function K(t){var e=this,n=new e(p);return j(n,t),n}function L(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function N(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function U(t){this[et]=O(),this._result=this._state=void 0,this._subscribers=[],p!==t&&("function"!=typeof t&&L(),this instanceof U?C(this,t):N())}function W(){var t=void 0;if("undefined"!=typeof global)t=global;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var n=t.Promise;if(n){var r=null;try{r=Object.prototype.toString.call(n.resolve())}catch(e){}if("[object Promise]"===r&&!n.cast)return}t.Promise=U}var z=void 0;z=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};var B=z,G=0,H=void 0,I=void 0,J=function(t,e){$[G]=t,$[G+1]=e,G+=2,2===G&&(I?I(a):tt())},Q="undefined"!=typeof window?window:void 0,R=Q||{},V=R.MutationObserver||R.WebKitMutationObserver,X="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),Z="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,$=new Array(1e3),tt=void 0;tt=X?o():V?s():Z?u():void 0===Q&&"function"==typeof require?f():c();var et=Math.random().toString(36).substring(16),nt=void 0,rt=1,ot=2,it=new M,st=new M,ut=0;return Y.prototype._enumerate=function(){for(var t=this.length,e=this._input,n=0;this._state===nt&&n<t;n++)this._eachEntry(e[n],n)},Y.prototype._eachEntry=function(t,e){var n=this._instanceConstructor,r=n.resolve;if(r===h){var o=_(t);if(o===l&&t._state!==nt)this._settledAt(t._state,e,t._result);else if("function"!=typeof o)this._remaining--,this._result[e]=t;else if(n===U){var i=new n(p);w(i,t,o),this._willSettleAt(i,e)}else this._willSettleAt(new n(function(e){return e(t)}),e)}else this._willSettleAt(r(t),e)},Y.prototype._settledAt=function(t,e,n){var r=this.promise;r._state===nt&&(this._remaining--,t===ot?j(r,n):this._result[e]=n),0===this._remaining&&S(r,this._result)},Y.prototype._willSettleAt=function(t,e){var n=this;E(t,void 0,function(t){return n._settledAt(rt,e,t)},function(t){return n._settledAt(ot,e,t)})},U.all=F,U.race=D,U.resolve=h,U.reject=K,U._setScheduler=n,U._setAsap=r,U._asap=J,U.prototype={constructor:U,then:l,"catch":function(t){return this.then(null,t)}},U.polyfill=W,U.Promise=U,U});
- /* fetch */
- (function(self) {
- 'use strict';
- if (self.fetch) {
- return
- }
- var support = {
- searchParams: 'URLSearchParams' in self,
- iterable: 'Symbol' in self && 'iterator' in Symbol,
- blob: 'FileReader' in self && 'Blob' in self && (function() {
- try {
- new Blob()
- return true
- } catch(e) {
- return false
- }
- })(),
- formData: 'FormData' in self,
- arrayBuffer: 'ArrayBuffer' in self
- }
- if (support.arrayBuffer) {
- var viewClasses = [
- '[object Int8Array]',
- '[object Uint8Array]',
- '[object Uint8ClampedArray]',
- '[object Int16Array]',
- '[object Uint16Array]',
- '[object Int32Array]',
- '[object Uint32Array]',
- '[object Float32Array]',
- '[object Float64Array]'
- ]
- var isDataView = function(obj) {
- return obj && DataView.prototype.isPrototypeOf(obj)
- }
- var isArrayBufferView = ArrayBuffer.isView || function(obj) {
- return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1
- }
- }
- function normalizeName(name) {
- if (typeof name !== 'string') {
- name = String(name)
- }
- if (/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(name)) {
- throw new TypeError('Invalid character in header field name')
- }
- return name.toLowerCase()
- }
- function normalizeValue(value) {
- if (typeof value !== 'string') {
- value = String(value)
- }
- return value
- }
- // Build a destructive iterator for the value list
- function iteratorFor(items) {
- var iterator = {
- next: function() {
- var value = items.shift()
- return {done: value === undefined, value: value}
- }
- }
- if (support.iterable) {
- iterator[Symbol.iterator] = function() {
- return iterator
- }
- }
- return iterator
- }
- function Headers(headers) {
- this.map = {}
- if (headers instanceof Headers) {
- headers.forEach(function(value, name) {
- this.append(name, value)
- }, this)
- } else if (Array.isArray(headers)) {
- headers.forEach(function(header) {
- this.append(header[0], header[1])
- }, this)
- } else if (headers) {
- Object.getOwnPropertyNames(headers).forEach(function(name) {
- this.append(name, headers[name])
- }, this)
- }
- }
- Headers.prototype.append = function(name, value) {
- name = normalizeName(name)
- value = normalizeValue(value)
- var oldValue = this.map[name]
- this.map[name] = oldValue ? oldValue+','+value : value
- }
- Headers.prototype['delete'] = function(name) {
- delete this.map[normalizeName(name)]
- }
- Headers.prototype.get = function(name) {
- name = normalizeName(name)
- return this.has(name) ? this.map[name] : null
- }
- Headers.prototype.has = function(name) {
- return this.map.hasOwnProperty(normalizeName(name))
- }
- Headers.prototype.set = function(name, value) {
- this.map[normalizeName(name)] = normalizeValue(value)
- }
- Headers.prototype.forEach = function(callback, thisArg) {
- for (var name in this.map) {
- if (this.map.hasOwnProperty(name)) {
- callback.call(thisArg, this.map[name], name, this)
- }
- }
- }
- Headers.prototype.keys = function() {
- var items = []
- this.forEach(function(value, name) { items.push(name) })
- return iteratorFor(items)
- }
- Headers.prototype.values = function() {
- var items = []
- this.forEach(function(value) { items.push(value) })
- return iteratorFor(items)
- }
- Headers.prototype.entries = function() {
- var items = []
- this.forEach(function(value, name) { items.push([name, value]) })
- return iteratorFor(items)
- }
- if (support.iterable) {
- Headers.prototype[Symbol.iterator] = Headers.prototype.entries
- }
- function consumed(body) {
- if (body.bodyUsed) {
- return Promise.reject(new TypeError('Already read'))
- }
- body.bodyUsed = true
- }
- function fileReaderReady(reader) {
- return new Promise(function(resolve, reject) {
- reader.onload = function() {
- resolve(reader.result)
- }
- reader.onerror = function() {
- reject(reader.error)
- }
- })
- }
- function readBlobAsArrayBuffer(blob) {
- var reader = new FileReader()
- var promise = fileReaderReady(reader)
- reader.readAsArrayBuffer(blob)
- return promise
- }
- function readBlobAsText(blob) {
- var reader = new FileReader()
- var promise = fileReaderReady(reader)
- reader.readAsText(blob)
- return promise
- }
- function readArrayBufferAsText(buf) {
- var view = new Uint8Array(buf)
- var chars = new Array(view.length)
- for (var i = 0; i < view.length; i++) {
- chars[i] = String.fromCharCode(view[i])
- }
- return chars.join('')
- }
- function bufferClone(buf) {
- if (buf.slice) {
- return buf.slice(0)
- } else {
- var view = new Uint8Array(buf.byteLength)
- view.set(new Uint8Array(buf))
- return view.buffer
- }
- }
- function Body() {
- this.bodyUsed = false
- this._initBody = function(body) {
- this._bodyInit = body
- if (!body) {
- this._bodyText = ''
- } else if (typeof body === 'string') {
- this._bodyText = body
- } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {
- this._bodyBlob = body
- } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {
- this._bodyFormData = body
- } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
- this._bodyText = body.toString()
- } else if (support.arrayBuffer && support.blob && isDataView(body)) {
- this._bodyArrayBuffer = bufferClone(body.buffer)
- // IE 10-11 can't handle a DataView body.
- this._bodyInit = new Blob([this._bodyArrayBuffer])
- } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {
- this._bodyArrayBuffer = bufferClone(body)
- } else {
- throw new Error('unsupported BodyInit type')
- }
- if (!this.headers.get('content-type')) {
- if (typeof body === 'string') {
- this.headers.set('content-type', 'text/plain;charset=UTF-8')
- } else if (this._bodyBlob && this._bodyBlob.type) {
- this.headers.set('content-type', this._bodyBlob.type)
- } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
- this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8')
- }
- }
- }
- if (support.blob) {
- this.blob = function() {
- var rejected = consumed(this)
- if (rejected) {
- return rejected
- }
- if (this._bodyBlob) {
- return Promise.resolve(this._bodyBlob)
- } else if (this._bodyArrayBuffer) {
- return Promise.resolve(new Blob([this._bodyArrayBuffer]))
- } else if (this._bodyFormData) {
- throw new Error('could not read FormData body as blob')
- } else {
- return Promise.resolve(new Blob([this._bodyText]))
- }
- }
- this.arrayBuffer = function() {
- if (this._bodyArrayBuffer) {
- return consumed(this) || Promise.resolve(this._bodyArrayBuffer)
- } else {
- return this.blob().then(readBlobAsArrayBuffer)
- }
- }
- }
- this.text = function() {
- var rejected = consumed(this)
- if (rejected) {
- return rejected
- }
- if (this._bodyBlob) {
- return readBlobAsText(this._bodyBlob)
- } else if (this._bodyArrayBuffer) {
- return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))
- } else if (this._bodyFormData) {
- throw new Error('could not read FormData body as text')
- } else {
- return Promise.resolve(this._bodyText)
- }
- }
- if (support.formData) {
- this.formData = function() {
- return this.text().then(decode)
- }
- }
- this.json = function() {
- return this.text().then(JSON.parse)
- }
- return this
- }
- // HTTP methods whose capitalization should be normalized
- var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']
- function normalizeMethod(method) {
- var upcased = method.toUpperCase()
- return (methods.indexOf(upcased) > -1) ? upcased : method
- }
- function Request(input, options) {
- options = options || {}
- var body = options.body
- if (input instanceof Request) {
- if (input.bodyUsed) {
- throw new TypeError('Already read')
- }
- this.url = input.url
- this.credentials = input.credentials
- if (!options.headers) {
- this.headers = new Headers(input.headers)
- }
- this.method = input.method
- this.mode = input.mode
- if (!body && input._bodyInit != null) {
- body = input._bodyInit
- input.bodyUsed = true
- }
- } else {
- this.url = String(input)
- }
- this.credentials = options.credentials || this.credentials || 'omit'
- if (options.headers || !this.headers) {
- this.headers = new Headers(options.headers)
- }
- this.method = normalizeMethod(options.method || this.method || 'GET')
- this.mode = options.mode || this.mode || null
- this.referrer = null
- if ((this.method === 'GET' || this.method === 'HEAD') && body) {
- throw new TypeError('Body not allowed for GET or HEAD requests')
- }
- this._initBody(body)
- }
- Request.prototype.clone = function() {
- return new Request(this, { body: this._bodyInit })
- }
- function decode(body) {
- var form = new FormData()
- body.trim().split('&').forEach(function(bytes) {
- if (bytes) {
- var split = bytes.split('=')
- var name = split.shift().replace(/\+/g, ' ')
- var value = split.join('=').replace(/\+/g, ' ')
- form.append(decodeURIComponent(name), decodeURIComponent(value))
- }
- })
- return form
- }
- function parseHeaders(rawHeaders) {
- var headers = new Headers()
- // Replace instances of \r\n and \n followed by at least one space or horizontal tab with a space
- // https://tools.ietf.org/html/rfc7230#section-3.2
- var preProcessedHeaders = rawHeaders.replace(/\r?\n[\t ]+/g, ' ')
- preProcessedHeaders.split(/\r?\n/).forEach(function(line) {
- var parts = line.split(':')
- var key = parts.shift().trim()
- if (key) {
- var value = parts.join(':').trim()
- headers.append(key, value)
- }
- })
- return headers
- }
- Body.call(Request.prototype)
- function Response(bodyInit, options) {
- if (!options) {
- options = {}
- }
- this.type = 'default'
- this.status = 'status' in options ? options.status : 200
- this.ok = this.status >= 200 && this.status < 300
- this.statusText = 'statusText' in options ? options.statusText : 'OK'
- this.headers = new Headers(options.headers)
- this.url = options.url || ''
- this._initBody(bodyInit)
- }
- Body.call(Response.prototype)
- Response.prototype.clone = function() {
- return new Response(this._bodyInit, {
- status: this.status,
- statusText: this.statusText,
- headers: new Headers(this.headers),
- url: this.url
- })
- }
- Response.error = function() {
- var response = new Response(null, {status: 0, statusText: ''})
- response.type = 'error'
- return response
- }
- var redirectStatuses = [301, 302, 303, 307, 308]
- Response.redirect = function(url, status) {
- if (redirectStatuses.indexOf(status) === -1) {
- throw new RangeError('Invalid status code')
- }
- return new Response(null, {status: status, headers: {location: url}})
- }
- self.Headers = Headers
- self.Request = Request
- self.Response = Response
- self.fetch = function(input, init) {
- return new Promise(function(resolve, reject) {
- var request = new Request(input, init)
- var xhr = new XMLHttpRequest()
- xhr.onload = function() {
- var options = {
- status: xhr.status,
- statusText: xhr.statusText,
- headers: parseHeaders(xhr.getAllResponseHeaders() || '')
- }
- options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL')
- var body = 'response' in xhr ? xhr.response : xhr.responseText
- resolve(new Response(body, options))
- }
- xhr.onerror = function() {
- reject(new TypeError('Network request failed'))
- }
- xhr.ontimeout = function() {
- reject(new TypeError('Network request failed'))
- }
- xhr.open(request.method, request.url, true)
- if (request.credentials === 'include') {
- xhr.withCredentials = true
- }
- if ('responseType' in xhr && support.blob) {
- xhr.responseType = 'blob'
- }
- request.headers.forEach(function(value, name) {
- xhr.setRequestHeader(name, value)
- })
- xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)
- })
- }
- self.fetch.polyfill = true
- })(typeof self !== 'undefined' ? self : this);
- /* PNP */
- /**
- * sp-pnp-js v2.0.3 - A JavaScript library for SharePoint development.
- * MIT (https://github.com/SharePoint/PnP-JS-Core/blob/master/LICENSE)
- * Copyright (c) 2017 Microsoft
- * docs: http://officedev.github.io/PnP-JS-Core
- * source: https://github.com/SharePoint/PnP-JS-Core
- * bugs: https://github.com/SharePoint/PnP-JS-Core/issues
- */
- (function webpackUniversalModuleDefinition(root, factory) {
- if(typeof exports === 'object' && typeof module === 'object')
- module.exports = factory();
- else if(typeof define === 'function' && define.amd)
- define([], factory);
- else if(typeof exports === 'object')
- exports["$pnp"] = factory();
- else
- root["$pnp"] = factory();
- })(this, function() {
- return /******/ (function(modules) { // webpackBootstrap
- /******/ // The module cache
- /******/ var installedModules = {};
- /******/
- /******/ // The require function
- /******/ function __webpack_require__(moduleId) {
- /******/
- /******/ // Check if module is in cache
- /******/ if(installedModules[moduleId])
- /******/ return installedModules[moduleId].exports;
- /******/
- /******/ // Create a new module (and put it into the cache)
- /******/ var module = installedModules[moduleId] = {
- /******/ i: moduleId,
- /******/ l: false,
- /******/ exports: {}
- /******/ };
- /******/
- /******/ // Execute the module function
- /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
- /******/
- /******/ // Flag the module as loaded
- /******/ module.l = true;
- /******/
- /******/ // Return the exports of the module
- /******/ return module.exports;
- /******/ }
- /******/
- /******/
- /******/ // expose the modules object (__webpack_modules__)
- /******/ __webpack_require__.m = modules;
- /******/
- /******/ // expose the module cache
- /******/ __webpack_require__.c = installedModules;
- /******/
- /******/ // identity function for calling harmony imports with the correct context
- /******/ __webpack_require__.i = function(value) { return value; };
- /******/
- /******/ // define getter function for harmony exports
- /******/ __webpack_require__.d = function(exports, name, getter) {
- /******/ if(!__webpack_require__.o(exports, name)) {
- /******/ Object.defineProperty(exports, name, {
- /******/ configurable: false,
- /******/ enumerable: true,
- /******/ get: getter
- /******/ });
- /******/ }
- /******/ };
- /******/
- /******/ // getDefaultExport function for compatibility with non-harmony modules
- /******/ __webpack_require__.n = function(module) {
- /******/ var getter = module && module.__esModule ?
- /******/ function getDefault() { return module['default']; } :
- /******/ function getModuleExports() { return module; };
- /******/ __webpack_require__.d(getter, 'a', getter);
- /******/ return getter;
- /******/ };
- /******/
- /******/ // Object.prototype.hasOwnProperty.call
- /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
- /******/
- /******/ // __webpack_public_path__
- /******/ __webpack_require__.p = "/assets/";
- /******/
- /******/ // Load entry module and return exports
- /******/ return __webpack_require__(__webpack_require__.s = 41);
- /******/ })
- /************************************************************************/
- /******/ ([
- /* 0 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /* WEBPACK VAR INJECTION */(function(global) {
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
- return c > 3 && r && Object.defineProperty(target, key, r), r;
- };
- Object.defineProperty(exports, "__esModule", { value: true });
- var decorators_1 = __webpack_require__(31);
- var pnplibconfig_1 = __webpack_require__(4);
- var Util = (function () {
- function Util() {
- }
- /**
- * Gets a callback function which will maintain context across async calls.
- * Allows for the calling pattern getCtxCallback(thisobj, method, methodarg1, methodarg2, ...)
- *
- * @param context The object that will be the 'this' value in the callback
- * @param method The method to which we will apply the context and parameters
- * @param params Optional, additional arguments to supply to the wrapped method when it is invoked
- */
- Util.getCtxCallback = function (context, method) {
- var params = [];
- for (var _i = 2; _i < arguments.length; _i++) {
- params[_i - 2] = arguments[_i];
- }
- return function () {
- method.apply(context, params);
- };
- };
- /**
- * Tests if a url param exists
- *
- * @param name The name of the url paramter to check
- */
- Util.urlParamExists = function (name) {
- name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
- var regex = new RegExp("[\\?&]" + name + "=([^&#]*)");
- return regex.test(location.search);
- };
- /**
- * Gets a url param value by name
- *
- * @param name The name of the paramter for which we want the value
- */
- Util.getUrlParamByName = function (name) {
- name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
- var regex = new RegExp("[\\?&]" + name + "=([^&#]*)");
- var results = regex.exec(location.search);
- return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
- };
- /**
- * Gets a url param by name and attempts to parse a bool value
- *
- * @param name The name of the paramter for which we want the boolean value
- */
- Util.getUrlParamBoolByName = function (name) {
- var p = this.getUrlParamByName(name);
- var isFalse = (p === "" || /false|0/i.test(p));
- return !isFalse;
- };
- /**
- * Inserts the string s into the string target as the index specified by index
- *
- * @param target The string into which we will insert s
- * @param index The location in target to insert s (zero based)
- * @param s The string to insert into target at position index
- */
- Util.stringInsert = function (target, index, s) {
- if (index > 0) {
- return target.substring(0, index) + s + target.substring(index, target.length);
- }
- return s + target;
- };
- /**
- * Adds a value to a date
- *
- * @param date The date to which we will add units, done in local time
- * @param interval The name of the interval to add, one of: ['year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second']
- * @param units The amount to add to date of the given interval
- *
- * http://stackoverflow.com/questions/1197928/how-to-add-30-minutes-to-a-javascript-date-object
- */
- Util.dateAdd = function (date, interval, units) {
- var ret = new Date(date.toLocaleString()); // don't change original date
- switch (interval.toLowerCase()) {
- case "year":
- ret.setFullYear(ret.getFullYear() + units);
- break;
- case "quarter":
- ret.setMonth(ret.getMonth() + 3 * units);
- break;
- case "month":
- ret.setMonth(ret.getMonth() + units);
- break;
- case "week":
- ret.setDate(ret.getDate() + 7 * units);
- break;
- case "day":
- ret.setDate(ret.getDate() + units);
- break;
- case "hour":
- ret.setTime(ret.getTime() + units * 3600000);
- break;
- case "minute":
- ret.setTime(ret.getTime() + units * 60000);
- break;
- case "second":
- ret.setTime(ret.getTime() + units * 1000);
- break;
- default:
- ret = undefined;
- break;
- }
- return ret;
- };
- /**
- * Loads a stylesheet into the current page
- *
- * @param path The url to the stylesheet
- * @param avoidCache If true a value will be appended as a query string to avoid browser caching issues
- */
- Util.loadStylesheet = function (path, avoidCache) {
- if (avoidCache) {
- path += "?" + encodeURIComponent((new Date()).getTime().toString());
- }
- var head = document.getElementsByTagName("head");
- if (head.length > 0) {
- var e = document.createElement("link");
- head[0].appendChild(e);
- e.setAttribute("type", "text/css");
- e.setAttribute("rel", "stylesheet");
- e.setAttribute("href", path);
- }
- };
- /**
- * Combines an arbitrary set of paths ensuring that the slashes are normalized
- *
- * @param paths 0 to n path parts to combine
- */
- Util.combinePaths = function () {
- var paths = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- paths[_i] = arguments[_i];
- }
- return paths
- .filter(function (path) { return typeof path !== "undefined" && path !== null; })
- .map(function (path) { return path.replace(/^[\\|\/]/, "").replace(/[\\|\/]$/, ""); })
- .join("/")
- .replace(/\\/g, "/");
- };
- /**
- * Gets a random string of chars length
- *
- * @param chars The length of the random string to generate
- */
- Util.getRandomString = function (chars) {
- var text = new Array(chars);
- var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
- for (var i = 0; i < chars; i++) {
- text[i] = possible.charAt(Math.floor(Math.random() * possible.length));
- }
- return text.join("");
- };
- /**
- * Gets a random GUID value
- *
- * http://stackoverflow.com/questions/105034/create-guid-uuid-in-javascript
- */
- /* tslint:disable no-bitwise */
- Util.getGUID = function () {
- var d = new Date().getTime();
- var guid = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (c) {
- var r = (d + Math.random() * 16) % 16 | 0;
- d = Math.floor(d / 16);
- return (c === "x" ? r : (r & 0x3 | 0x8)).toString(16);
- });
- return guid;
- };
- /* tslint:enable */
- /**
- * Determines if a given value is a function
- *
- * @param candidateFunction The thing to test for being a function
- */
- Util.isFunction = function (candidateFunction) {
- return typeof candidateFunction === "function";
- };
- /**
- * @returns whether the provided parameter is a JavaScript Array or not.
- */
- Util.isArray = function (array) {
- if (Array.isArray) {
- return Array.isArray(array);
- }
- return array && typeof array.length === "number" && array.constructor === Array;
- };
- /**
- * Determines if a string is null or empty or undefined
- *
- * @param s The string to test
- */
- Util.stringIsNullOrEmpty = function (s) {
- return typeof s === "undefined" || s === null || s === "";
- };
- /**
- * Provides functionality to extend the given object by doing a shallow copy
- *
- * @param target The object to which properties will be copied
- * @param source The source object from which properties will be copied
- * @param noOverwrite If true existing properties on the target are not overwritten from the source
- *
- */
- Util.extend = function (target, source, noOverwrite) {
- if (noOverwrite === void 0) { noOverwrite = false; }
- if (source === null || typeof source === "undefined") {
- return target;
- }
- // ensure we don't overwrite things we don't want overwritten
- var check = noOverwrite ? function (o, i) { return !(i in o); } : function () { return true; };
- return Object.getOwnPropertyNames(source)
- .filter(function (v) { return check(target, v); })
- .reduce(function (t, v) {
- t[v] = source[v];
- return t;
- }, target);
- };
- /**
- * Determines if a given url is absolute
- *
- * @param url The url to check to see if it is absolute
- */
- Util.isUrlAbsolute = function (url) {
- return /^https?:\/\/|^\/\//i.test(url);
- };
- /**
- * Attempts to make the supplied relative url absolute based on the _spPageContextInfo object, if available
- *
- * @param url The relative url to make absolute
- */
- Util.makeUrlAbsolute = function (url) {
- if (Util.isUrlAbsolute(url)) {
- return url;
- }
- if (typeof global._spPageContextInfo !== "undefined") {
- if (global._spPageContextInfo.hasOwnProperty("webAbsoluteUrl")) {
- return Util.combinePaths(global._spPageContextInfo.webAbsoluteUrl, url);
- }
- else if (global._spPageContextInfo.hasOwnProperty("webServerRelativeUrl")) {
- return Util.combinePaths(global._spPageContextInfo.webServerRelativeUrl, url);
- }
- }
- else {
- return url;
- }
- };
- /**
- * Ensures that a given url is absolute for the current web based on context
- *
- * @param candidateUrl The url to make absolute
- *
- */
- Util.toAbsoluteUrl = function (candidateUrl) {
- return new Promise(function (resolve) {
- if (Util.isUrlAbsolute(candidateUrl)) {
- // if we are already absolute, then just return the url
- return resolve(candidateUrl);
- }
- if (pnplibconfig_1.RuntimeConfig.baseUrl !== null) {
- // base url specified either with baseUrl of spfxContext config property
- return resolve(Util.combinePaths(pnplibconfig_1.RuntimeConfig.baseUrl, candidateUrl));
- }
- if (typeof global._spPageContextInfo !== "undefined") {
- // operating in classic pages
- if (global._spPageContextInfo.hasOwnProperty("webAbsoluteUrl")) {
- return resolve(Util.combinePaths(global._spPageContextInfo.webAbsoluteUrl, candidateUrl));
- }
- else if (global._spPageContextInfo.hasOwnProperty("webServerRelativeUrl")) {
- return resolve(Util.combinePaths(global._spPageContextInfo.webServerRelativeUrl, candidateUrl));
- }
- }
- // does window.location exist and have _layouts in it?
- if (typeof global.location !== "undefined") {
- var index = global.location.toString().toLowerCase().indexOf("/_layouts/");
- if (index > 0) {
- // we are likely in the workbench in /_layouts/
- return resolve(Util.combinePaths(global.location.toString().substr(0, index), candidateUrl));
- }
- }
- return resolve(candidateUrl);
- });
- };
- return Util;
- }());
- __decorate([
- decorators_1.deprecated("The Util.makeUrlAbsolute method is deprecated and will be removed from future releases. Use Util.toAbsoluteUrl instead")
- ], Util, "makeUrlAbsolute", null);
- exports.Util = Util;
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(32)))
- /***/ }),
- /* 1 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var __extends = (this && this.__extends) || (function () {
- var extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- Object.defineProperty(exports, "__esModule", { value: true });
- var util_1 = __webpack_require__(0);
- var collections_1 = __webpack_require__(6);
- var odata_1 = __webpack_require__(2);
- var pnplibconfig_1 = __webpack_require__(4);
- var exceptions_1 = __webpack_require__(3);
- var queryablerequest_1 = __webpack_require__(45);
- var logging_1 = __webpack_require__(5);
- /**
- * Queryable Base Class
- *
- */
- var Queryable = (function () {
- /**
- * Creates a new instance of the Queryable class
- *
- * @constructor
- * @param baseUrl A string or Queryable that should form the base part of the url
- *
- */
- function Queryable(baseUrl, path) {
- this._query = new collections_1.Dictionary();
- this._batch = null;
- if (typeof baseUrl === "string") {
- // we need to do some extra parsing to get the parent url correct if we are
- // being created from just a string.
- var urlStr = baseUrl;
- if (util_1.Util.isUrlAbsolute(urlStr) || urlStr.lastIndexOf("/") < 0) {
- this._parentUrl = urlStr;
- this._url = util_1.Util.combinePaths(urlStr, path);
- }
- else if (urlStr.lastIndexOf("/") > urlStr.lastIndexOf("(")) {
- // .../items(19)/fields
- var index = urlStr.lastIndexOf("/");
- this._parentUrl = urlStr.slice(0, index);
- path = util_1.Util.combinePaths(urlStr.slice(index), path);
- this._url = util_1.Util.combinePaths(this._parentUrl, path);
- }
- else {
- // .../items(19)
- var index = urlStr.lastIndexOf("(");
- this._parentUrl = urlStr.slice(0, index);
- this._url = util_1.Util.combinePaths(urlStr, path);
- }
- }
- else {
- var q = baseUrl;
- this._parentUrl = q._url;
- var target = q._query.get("@target");
- if (target !== null) {
- this._query.add("@target", target);
- }
- this._url = util_1.Util.combinePaths(this._parentUrl, path);
- }
- }
- /**
- * Directly concatonates the supplied string to the current url, not normalizing "/" chars
- *
- * @param pathPart The string to concatonate to the url
- */
- Queryable.prototype.concat = function (pathPart) {
- this._url += pathPart;
- };
- /**
- * Appends the given string and normalizes "/" chars
- *
- * @param pathPart The string to append
- */
- Queryable.prototype.append = function (pathPart) {
- this._url = util_1.Util.combinePaths(this._url, pathPart);
- };
- /**
- * Blocks a batch call from occuring, MUST be cleared by calling the returned function
- */
- Queryable.prototype.addBatchDependency = function () {
- if (this.hasBatch) {
- return this._batch.addDependency();
- }
- return function () { return null; };
- };
- Object.defineProperty(Queryable.prototype, "hasBatch", {
- /**
- * Indicates if the current query has a batch associated
- *
- */
- get: function () {
- return this._batch !== null;
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(Queryable.prototype, "batch", {
- /**
- * The batch currently associated with this query or null
- *
- */
- get: function () {
- return this.hasBatch ? this._batch : null;
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(Queryable.prototype, "parentUrl", {
- /**
- * Gets the parent url used when creating this instance
- *
- */
- get: function () {
- return this._parentUrl;
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(Queryable.prototype, "query", {
- /**
- * Provides access to the query builder for this url
- *
- */
- get: function () {
- return this._query;
- },
- enumerable: true,
- configurable: true
- });
- /**
- * Creates a new instance of the supplied factory and extends this into that new instance
- *
- * @param factory constructor for the new queryable
- */
- Queryable.prototype.as = function (factory) {
- var o = new factory(this._url, null);
- return util_1.Util.extend(o, this, true);
- };
- /**
- * Adds this query to the supplied batch
- *
- * @example
- * ```
- *
- * let b = pnp.sp.createBatch();
- * pnp.sp.web.inBatch(b).get().then(...);
- * b.execute().then(...)
- * ```
- */
- Queryable.prototype.inBatch = function (batch) {
- if (this._batch !== null) {
- throw new exceptions_1.AlreadyInBatchException();
- }
- this._batch = batch;
- return this;
- };
- /**
- * Enables caching for this request
- *
- * @param options Defines the options used when caching this request
- */
- Queryable.prototype.usingCaching = function (options) {
- if (!pnplibconfig_1.RuntimeConfig.globalCacheDisable) {
- this._useCaching = true;
- this._cachingOptions = options;
- }
- return this;
- };
- /**
- * Gets the currentl url, made absolute based on the availability of the _spPageContextInfo object
- *
- */
- Queryable.prototype.toUrl = function () {
- return this._url;
- };
- /**
- * Gets the full url with query information
- *
- */
- Queryable.prototype.toUrlAndQuery = function () {
- var aliasedParams = new collections_1.Dictionary();
- var url = this.toUrl().replace(/'!(@.*?)::(.*?)'/ig, function (match, labelName, value) {
- logging_1.Logger.write("Rewriting aliased parameter from match " + match + " to label: " + labelName + " value: " + value, logging_1.LogLevel.Verbose);
- aliasedParams.add(labelName, "'" + value + "'");
- return labelName;
- });
- // inlude our explicitly set query string params
- aliasedParams.merge(this._query);
- if (aliasedParams.count() > 0) {
- url += "?" + aliasedParams.getKeys().map(function (key) { return key + "=" + aliasedParams.get(key); }).join("&");
- }
- return url;
- };
- /**
- * Gets a parent for this instance as specified
- *
- * @param factory The contructor for the class to create
- */
- Queryable.prototype.getParent = function (factory, baseUrl, path, batch) {
- if (baseUrl === void 0) { baseUrl = this.parentUrl; }
- var parent = new factory(baseUrl, path);
- var target = this.query.get("@target");
- if (target !== null) {
- parent.query.add("@target", target);
- }
- if (typeof batch !== "undefined") {
- parent = parent.inBatch(batch);
- }
- return parent;
- };
- /**
- * Clones this queryable into a new queryable instance of T
- * @param factory Constructor used to create the new instance
- * @param additionalPath Any additional path to include in the clone
- * @param includeBatch If true this instance's batch will be added to the cloned instance
- */
- Queryable.prototype.clone = function (factory, additionalPath, includeBatch) {
- if (includeBatch === void 0) { includeBatch = false; }
- var clone = new factory(this, additionalPath);
- var target = this.query.get("@target");
- if (target !== null) {
- clone.query.add("@target", target);
- }
- if (includeBatch && this.hasBatch) {
- clone = clone.inBatch(this.batch);
- }
- return clone;
- };
- /**
- * Executes the currently built request
- *
- * @param parser Allows you to specify a parser to handle the result
- * @param getOptions The options used for this request
- */
- Queryable.prototype.get = function (parser, getOptions) {
- if (parser === void 0) { parser = new odata_1.ODataDefaultParser(); }
- if (getOptions === void 0) { getOptions = {}; }
- return this.toRequestContext("GET", getOptions, parser).then(function (context) { return queryablerequest_1.pipe(context); });
- };
- Queryable.prototype.getAs = function (parser, getOptions) {
- if (parser === void 0) { parser = new odata_1.ODataDefaultParser(); }
- if (getOptions === void 0) { getOptions = {}; }
- return this.toRequestContext("GET", getOptions, parser).then(function (context) { return queryablerequest_1.pipe(context); });
- };
- Queryable.prototype.post = function (postOptions, parser) {
- if (postOptions === void 0) { postOptions = {}; }
- if (parser === void 0) { parser = new odata_1.ODataDefaultParser(); }
- return this.toRequestContext("POST", postOptions, parser).then(function (context) { return queryablerequest_1.pipe(context); });
- };
- Queryable.prototype.postAs = function (postOptions, parser) {
- if (postOptions === void 0) { postOptions = {}; }
- if (parser === void 0) { parser = new odata_1.ODataDefaultParser(); }
- return this.toRequestContext("POST", postOptions, parser).then(function (context) { return queryablerequest_1.pipe(context); });
- };
- Queryable.prototype.patch = function (patchOptions, parser) {
- if (patchOptions === void 0) { patchOptions = {}; }
- if (parser === void 0) { parser = new odata_1.ODataDefaultParser(); }
- return this.toRequestContext("PATCH", patchOptions, parser).then(function (context) { return queryablerequest_1.pipe(context); });
- };
- Queryable.prototype.delete = function (deleteOptions, parser) {
- if (deleteOptions === void 0) { deleteOptions = {}; }
- if (parser === void 0) { parser = new odata_1.ODataDefaultParser(); }
- return this.toRequestContext("DELETE", deleteOptions, parser).then(function (context) { return queryablerequest_1.pipe(context); });
- };
- Queryable.prototype.toRequestContext = function (verb, options, parser) {
- var _this = this;
- if (options === void 0) { options = {}; }
- var dependencyDispose = this.hasBatch ? this.addBatchDependency() : function () { return; };
- return util_1.Util.toAbsoluteUrl(this.toUrlAndQuery()).then(function (url) {
- // build our request context
- var context = {
- batch: _this._batch,
- batchDependency: dependencyDispose,
- cachingOptions: _this._cachingOptions,
- isBatched: _this.hasBatch,
- isCached: _this._useCaching,
- options: options,
- parser: parser,
- requestAbsoluteUrl: url,
- requestId: util_1.Util.getGUID(),
- verb: verb,
- };
- return context;
- });
- };
- return Queryable;
- }());
- exports.Queryable = Queryable;
- /**
- * Represents a REST collection which can be filtered, paged, and selected
- *
- */
- var QueryableCollection = (function (_super) {
- __extends(QueryableCollection, _super);
- function QueryableCollection() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- /**
- * Filters the returned collection (https://msdn.microsoft.com/en-us/library/office/fp142385.aspx#bk_supported)
- *
- * @param filter The string representing the filter query
- */
- QueryableCollection.prototype.filter = function (filter) {
- this._query.add("$filter", filter);
- return this;
- };
- /**
- * Choose which fields to return
- *
- * @param selects One or more fields to return
- */
- QueryableCollection.prototype.select = function () {
- var selects = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- selects[_i] = arguments[_i];
- }
- if (selects.length > 0) {
- this._query.add("$select", selects.join(","));
- }
- return this;
- };
- /**
- * Expands fields such as lookups to get additional data
- *
- * @param expands The Fields for which to expand the values
- */
- QueryableCollection.prototype.expand = function () {
- var expands = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- expands[_i] = arguments[_i];
- }
- if (expands.length > 0) {
- this._query.add("$expand", expands.join(","));
- }
- return this;
- };
- /**
- * Orders based on the supplied fields ascending
- *
- * @param orderby The name of the field to sort on
- * @param ascending If false DESC is appended, otherwise ASC (default)
- */
- QueryableCollection.prototype.orderBy = function (orderBy, ascending) {
- if (ascending === void 0) { ascending = true; }
- var keys = this._query.getKeys();
- var query = [];
- var asc = ascending ? " asc" : " desc";
- for (var i = 0; i < keys.length; i++) {
- if (keys[i] === "$orderby") {
- query.push(this._query.get("$orderby"));
- break;
- }
- }
- query.push("" + orderBy + asc);
- this._query.add("$orderby", query.join(","));
- return this;
- };
- /**
- * Skips the specified number of items
- *
- * @param skip The number of items to skip
- */
- QueryableCollection.prototype.skip = function (skip) {
- this._query.add("$skip", skip.toString());
- return this;
- };
- /**
- * Limits the query to only return the specified number of items
- *
- * @param top The query row limit
- */
- QueryableCollection.prototype.top = function (top) {
- this._query.add("$top", top.toString());
- return this;
- };
- return QueryableCollection;
- }(Queryable));
- exports.QueryableCollection = QueryableCollection;
- /**
- * Represents an instance that can be selected
- *
- */
- var QueryableInstance = (function (_super) {
- __extends(QueryableInstance, _super);
- function QueryableInstance() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- /**
- * Choose which fields to return
- *
- * @param selects One or more fields to return
- */
- QueryableInstance.prototype.select = function () {
- var selects = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- selects[_i] = arguments[_i];
- }
- if (selects.length > 0) {
- this._query.add("$select", selects.join(","));
- }
- return this;
- };
- /**
- * Expands fields such as lookups to get additional data
- *
- * @param expands The Fields for which to expand the values
- */
- QueryableInstance.prototype.expand = function () {
- var expands = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- expands[_i] = arguments[_i];
- }
- if (expands.length > 0) {
- this._query.add("$expand", expands.join(","));
- }
- return this;
- };
- return QueryableInstance;
- }(Queryable));
- exports.QueryableInstance = QueryableInstance;
- /***/ }),
- /* 2 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var __extends = (this && this.__extends) || (function () {
- var extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- Object.defineProperty(exports, "__esModule", { value: true });
- var util_1 = __webpack_require__(0);
- var logging_1 = __webpack_require__(5);
- var httpclient_1 = __webpack_require__(15);
- var pnplibconfig_1 = __webpack_require__(4);
- var exceptions_1 = __webpack_require__(3);
- var exceptions_2 = __webpack_require__(3);
- function extractOdataId(candidate) {
- if (candidate.hasOwnProperty("odata.id")) {
- return candidate["odata.id"];
- }
- else if (candidate.hasOwnProperty("__metadata") && candidate.__metadata.hasOwnProperty("id")) {
- return candidate.__metadata.id;
- }
- else {
- throw new exceptions_1.ODataIdException(candidate);
- }
- }
- exports.extractOdataId = extractOdataId;
- var ODataParserBase = (function () {
- function ODataParserBase() {
- }
- ODataParserBase.prototype.parse = function (r) {
- var _this = this;
- return new Promise(function (resolve, reject) {
- if (_this.handleError(r, reject)) {
- if ((r.headers.has("Content-Length") && parseFloat(r.headers.get("Content-Length")) === 0) || r.status === 204) {
- resolve({});
- }
- else {
- r.json().then(function (json) { return resolve(_this.parseODataJSON(json)); }).catch(function (e) { return reject(e); });
- }
- }
- });
- };
- ODataParserBase.prototype.handleError = function (r, reject) {
- if (!r.ok) {
- r.json().then(function (json) {
- // include the headers as they contain diagnostic information
- var data = {
- responseBody: json,
- responseHeaders: r.headers,
- };
- reject(new exceptions_2.ProcessHttpClientResponseException(r.status, r.statusText, data));
- }).catch(function (e) {
- // we failed to read the body - possibly it is empty. Let's report the original status that caused
- // the request to fail and log the error with parsing the body if anyone needs it for debugging
- logging_1.Logger.log({
- data: e,
- level: logging_1.LogLevel.Warning,
- message: "There was an error parsing the error response body. See data for details.",
- });
- // include the headers as they contain diagnostic information
- var data = {
- responseBody: "[[body not available]]",
- responseHeaders: r.headers,
- };
- reject(new exceptions_2.ProcessHttpClientResponseException(r.status, r.statusText, data));
- });
- }
- return r.ok;
- };
- ODataParserBase.prototype.parseODataJSON = function (json) {
- var result = json;
- if (json.hasOwnProperty("d")) {
- if (json.d.hasOwnProperty("results")) {
- result = json.d.results;
- }
- else {
- result = json.d;
- }
- }
- else if (json.hasOwnProperty("value")) {
- result = json.value;
- }
- return result;
- };
- return ODataParserBase;
- }());
- exports.ODataParserBase = ODataParserBase;
- var ODataDefaultParser = (function (_super) {
- __extends(ODataDefaultParser, _super);
- function ODataDefaultParser() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- return ODataDefaultParser;
- }(ODataParserBase));
- exports.ODataDefaultParser = ODataDefaultParser;
- var ODataRawParserImpl = (function () {
- function ODataRawParserImpl() {
- }
- ODataRawParserImpl.prototype.parse = function (r) {
- return r.json();
- };
- return ODataRawParserImpl;
- }());
- exports.ODataRawParserImpl = ODataRawParserImpl;
- var ODataValueParserImpl = (function (_super) {
- __extends(ODataValueParserImpl, _super);
- function ODataValueParserImpl() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- ODataValueParserImpl.prototype.parse = function (r) {
- return _super.prototype.parse.call(this, r).then(function (d) { return d; });
- };
- return ODataValueParserImpl;
- }(ODataParserBase));
- var ODataEntityParserImpl = (function (_super) {
- __extends(ODataEntityParserImpl, _super);
- function ODataEntityParserImpl(factory) {
- var _this = _super.call(this) || this;
- _this.factory = factory;
- return _this;
- }
- ODataEntityParserImpl.prototype.parse = function (r) {
- var _this = this;
- return _super.prototype.parse.call(this, r).then(function (d) {
- var o = new _this.factory(getEntityUrl(d), null);
- return util_1.Util.extend(o, d);
- });
- };
- return ODataEntityParserImpl;
- }(ODataParserBase));
- var ODataEntityArrayParserImpl = (function (_super) {
- __extends(ODataEntityArrayParserImpl, _super);
- function ODataEntityArrayParserImpl(factory) {
- var _this = _super.call(this) || this;
- _this.factory = factory;
- return _this;
- }
- ODataEntityArrayParserImpl.prototype.parse = function (r) {
- var _this = this;
- return _super.prototype.parse.call(this, r).then(function (d) {
- return d.map(function (v) {
- var o = new _this.factory(getEntityUrl(v), null);
- return util_1.Util.extend(o, v);
- });
- });
- };
- return ODataEntityArrayParserImpl;
- }(ODataParserBase));
- function getEntityUrl(entity) {
- if (entity.hasOwnProperty("odata.editLink")) {
- // we are dealign with minimal metadata (default)
- return util_1.Util.combinePaths("_api", entity["odata.editLink"]);
- }
- else if (entity.hasOwnProperty("__metadata")) {
- // we are dealing with verbose, which has an absolute uri
- return entity.__metadata.uri;
- }
- else {
- // we are likely dealing with nometadata, so don't error but we won't be able to
- // chain off these objects
- logging_1.Logger.write("No uri information found in ODataEntity parsing, chaining will fail for this object.", logging_1.LogLevel.Warning);
- return "";
- }
- }
- exports.getEntityUrl = getEntityUrl;
- exports.ODataRaw = new ODataRawParserImpl();
- function ODataValue() {
- return new ODataValueParserImpl();
- }
- exports.ODataValue = ODataValue;
- function ODataEntity(factory) {
- return new ODataEntityParserImpl(factory);
- }
- exports.ODataEntity = ODataEntity;
- function ODataEntityArray(factory) {
- return new ODataEntityArrayParserImpl(factory);
- }
- exports.ODataEntityArray = ODataEntityArray;
- /**
- * Manages a batch of OData operations
- */
- var ODataBatch = (function () {
- function ODataBatch(baseUrl, _batchId) {
- if (_batchId === void 0) { _batchId = util_1.Util.getGUID(); }
- this.baseUrl = baseUrl;
- this._batchId = _batchId;
- this._requests = [];
- this._dependencies = [];
- }
- /**
- * Adds a request to a batch (not designed for public use)
- *
- * @param url The full url of the request
- * @param method The http method GET, POST, etc
- * @param options Any options to include in the request
- * @param parser The parser that will hadle the results of the request
- */
- ODataBatch.prototype.add = function (url, method, options, parser) {
- var info = {
- method: method.toUpperCase(),
- options: options,
- parser: parser,
- reject: null,
- resolve: null,
- url: url,
- };
- var p = new Promise(function (resolve, reject) {
- info.resolve = resolve;
- info.reject = reject;
- });
- this._requests.push(info);
- return p;
- };
- /**
- * Adds a dependency insuring that some set of actions will occur before a batch is processed.
- * MUST be cleared using the returned resolve delegate to allow batches to run
- */
- ODataBatch.prototype.addDependency = function () {
- var resolver;
- var promise = new Promise(function (resolve) {
- resolver = resolve;
- });
- this._dependencies.push(promise);
- return resolver;
- };
- /**
- * Execute the current batch and resolve the associated promises
- *
- * @returns A promise which will be resolved once all of the batch's child promises have resolved
- */
- ODataBatch.prototype.execute = function () {
- var _this = this;
- // we need to check the dependencies twice due to how different engines handle things.
- // We can get a second set of promises added after the first set resolve
- return Promise.all(this._dependencies).then(function () { return Promise.all(_this._dependencies); }).then(function () { return _this.executeImpl(); });
- };
- ODataBatch.prototype.executeImpl = function () {
- var _this = this;
- logging_1.Logger.write("Executing batch with " + this._requests.length + " requests.", logging_1.LogLevel.Info);
- // if we don't have any requests, don't bother sending anything
- // this could be due to caching further upstream, or just an empty batch
- if (this._requests.length < 1) {
- logging_1.Logger.write("Resolving empty batch.", logging_1.LogLevel.Info);
- return Promise.resolve();
- }
- // creating the client here allows the url to be populated for nodejs client as well as potentially
- // any other hacks needed for other types of clients. Essentially allows the absoluteRequestUrl
- // below to be correct
- var client = new httpclient_1.HttpClient();
- // due to timing we need to get the absolute url here so we can use it for all the individual requests
- // and for sending the entire batch
- return util_1.Util.toAbsoluteUrl(this.baseUrl).then(function (absoluteRequestUrl) {
- // build all the requests, send them, pipe results in order to parsers
- var batchBody = [];
- var currentChangeSetId = "";
- _this._requests.map(function (reqInfo) {
- if (reqInfo.method === "GET") {
- if (currentChangeSetId.length > 0) {
- // end an existing change set
- batchBody.push("--changeset_" + currentChangeSetId + "--\n\n");
- currentChangeSetId = "";
- }
- batchBody.push("--batch_" + _this._batchId + "\n");
- }
- else {
- if (currentChangeSetId.length < 1) {
- // start new change set
- currentChangeSetId = util_1.Util.getGUID();
- batchBody.push("--batch_" + _this._batchId + "\n");
- batchBody.push("Content-Type: multipart/mixed; boundary=\"changeset_" + currentChangeSetId + "\"\n\n");
- }
- batchBody.push("--changeset_" + currentChangeSetId + "\n");
- }
- // common batch part prefix
- batchBody.push("Content-Type: application/http\n");
- batchBody.push("Content-Transfer-Encoding: binary\n\n");
- var headers = {
- "Accept": "application/json;",
- };
- // this is the url of the individual request within the batch
- var url = util_1.Util.isUrlAbsolute(reqInfo.url) ? reqInfo.url : util_1.Util.combinePaths(absoluteRequestUrl, reqInfo.url);
- logging_1.Logger.write("Adding request " + reqInfo.method + " " + url + " to batch.", logging_1.LogLevel.Verbose);
- if (reqInfo.method !== "GET") {
- var method = reqInfo.method;
- if (reqInfo.hasOwnProperty("options") && reqInfo.options.hasOwnProperty("headers") && typeof reqInfo.options.headers["X-HTTP-Method"] !== "undefined") {
- method = reqInfo.options.headers["X-HTTP-Method"];
- delete reqInfo.options.headers["X-HTTP-Method"];
- }
- batchBody.push(method + " " + url + " HTTP/1.1\n");
- headers = util_1.Util.extend(headers, { "Content-Type": "application/json;odata=verbose;charset=utf-8" });
- }
- else {
- batchBody.push(reqInfo.method + " " + url + " HTTP/1.1\n");
- }
- if (typeof pnplibconfig_1.RuntimeConfig.headers !== "undefined") {
- headers = util_1.Util.extend(headers, pnplibconfig_1.RuntimeConfig.headers);
- }
- if (reqInfo.options && reqInfo.options.headers) {
- headers = util_1.Util.extend(headers, reqInfo.options.headers);
- }
- for (var name_1 in headers) {
- if (headers.hasOwnProperty(name_1)) {
- batchBody.push(name_1 + ": " + headers[name_1] + "\n");
- }
- }
- batchBody.push("\n");
- if (reqInfo.options.body) {
- batchBody.push(reqInfo.options.body + "\n\n");
- }
- });
- if (currentChangeSetId.length > 0) {
- // Close the changeset
- batchBody.push("--changeset_" + currentChangeSetId + "--\n\n");
- currentChangeSetId = "";
- }
- batchBody.push("--batch_" + _this._batchId + "--\n");
- var batchHeaders = {
- "Content-Type": "multipart/mixed; boundary=batch_" + _this._batchId,
- };
- var batchOptions = {
- "body": batchBody.join(""),
- "headers": batchHeaders,
- };
- logging_1.Logger.write("Sending batch request.", logging_1.LogLevel.Info);
- return client.post(util_1.Util.combinePaths(absoluteRequestUrl, "/_api/$batch"), batchOptions)
- .then(function (r) { return r.text(); })
- .then(_this._parseResponse)
- .then(function (responses) {
- if (responses.length !== _this._requests.length) {
- throw new exceptions_1.BatchParseException("Could not properly parse responses to match requests in batch.");
- }
- logging_1.Logger.write("Resolving batched requests.", logging_1.LogLevel.Info);
- return responses.reduce(function (chain, response, index) {
- var request = _this._requests[index];
- logging_1.Logger.write("Resolving request " + request.method + " " + request.url + ".", logging_1.LogLevel.Verbose);
- return chain.then(function (_) { return request.parser.parse(response).then(request.resolve).catch(request.reject); });
- }, Promise.resolve());
- });
- });
- };
- /**
- * Parses the response from a batch request into an array of Response instances
- *
- * @param body Text body of the response from the batch request
- */
- ODataBatch.prototype._parseResponse = function (body) {
- return new Promise(function (resolve, reject) {
- var responses = [];
- var header = "--batchresponse_";
- // Ex. "HTTP/1.1 500 Internal Server Error"
- var statusRegExp = new RegExp("^HTTP/[0-9.]+ +([0-9]+) +(.*)", "i");
- var lines = body.split("\n");
- var state = "batch";
- var status;
- var statusText;
- for (var i = 0; i < lines.length; ++i) {
- var line = lines[i];
- switch (state) {
- case "batch":
- if (line.substr(0, header.length) === header) {
- state = "batchHeaders";
- }
- else {
- if (line.trim() !== "") {
- throw new exceptions_1.BatchParseException("Invalid response, line " + i);
- }
- }
- break;
- case "batchHeaders":
- if (line.trim() === "") {
- state = "status";
- }
- break;
- case "status":
- var parts = statusRegExp.exec(line);
- if (parts.length !== 3) {
- throw new exceptions_1.BatchParseException("Invalid status, line " + i);
- }
- status = parseInt(parts[1], 10);
- statusText = parts[2];
- state = "statusHeaders";
- break;
- case "statusHeaders":
- if (line.trim() === "") {
- state = "body";
- }
- break;
- case "body":
- responses.push((status === 204) ? new Response() : new Response(line, { status: status, statusText: statusText }));
- state = "batch";
- break;
- }
- }
- if (state !== "status") {
- reject(new exceptions_1.BatchParseException("Unexpected end of input"));
- }
- resolve(responses);
- });
- };
- return ODataBatch;
- }());
- exports.ODataBatch = ODataBatch;
- var TextFileParser = (function () {
- function TextFileParser() {
- }
- TextFileParser.prototype.parse = function (r) {
- return r.text();
- };
- return TextFileParser;
- }());
- exports.TextFileParser = TextFileParser;
- var BlobFileParser = (function () {
- function BlobFileParser() {
- }
- BlobFileParser.prototype.parse = function (r) {
- return r.blob();
- };
- return BlobFileParser;
- }());
- exports.BlobFileParser = BlobFileParser;
- var JSONFileParser = (function () {
- function JSONFileParser() {
- }
- JSONFileParser.prototype.parse = function (r) {
- return r.json();
- };
- return JSONFileParser;
- }());
- exports.JSONFileParser = JSONFileParser;
- var BufferFileParser = (function () {
- function BufferFileParser() {
- }
- BufferFileParser.prototype.parse = function (r) {
- if (util_1.Util.isFunction(r.arrayBuffer)) {
- return r.arrayBuffer();
- }
- return r.buffer();
- };
- return BufferFileParser;
- }());
- exports.BufferFileParser = BufferFileParser;
- /***/ }),
- /* 3 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var __extends = (this && this.__extends) || (function () {
- var extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- Object.defineProperty(exports, "__esModule", { value: true });
- var logging_1 = __webpack_require__(5);
- function defaultLog(error) {
- logging_1.Logger.log({ data: {}, level: logging_1.LogLevel.Error, message: "[" + error.name + "]::" + error.message });
- }
- /**
- * Represents an exception with an HttpClient request
- *
- */
- var ProcessHttpClientResponseException = (function (_super) {
- __extends(ProcessHttpClientResponseException, _super);
- function ProcessHttpClientResponseException(status, statusText, data) {
- var _this = _super.call(this, "Error making HttpClient request in queryable: [" + status + "] " + statusText) || this;
- _this.status = status;
- _this.statusText = statusText;
- _this.data = data;
- _this.name = "ProcessHttpClientResponseException";
- logging_1.Logger.log({ data: _this.data, level: logging_1.LogLevel.Error, message: _this.message });
- return _this;
- }
- return ProcessHttpClientResponseException;
- }(Error));
- exports.ProcessHttpClientResponseException = ProcessHttpClientResponseException;
- var NoCacheAvailableException = (function (_super) {
- __extends(NoCacheAvailableException, _super);
- function NoCacheAvailableException(msg) {
- if (msg === void 0) { msg = "Cannot create a caching configuration provider since cache is not available."; }
- var _this = _super.call(this, msg) || this;
- _this.name = "NoCacheAvailableException";
- defaultLog(_this);
- return _this;
- }
- return NoCacheAvailableException;
- }(Error));
- exports.NoCacheAvailableException = NoCacheAvailableException;
- var APIUrlException = (function (_super) {
- __extends(APIUrlException, _super);
- function APIUrlException(msg) {
- if (msg === void 0) { msg = "Unable to determine API url."; }
- var _this = _super.call(this, msg) || this;
- _this.name = "APIUrlException";
- defaultLog(_this);
- return _this;
- }
- return APIUrlException;
- }(Error));
- exports.APIUrlException = APIUrlException;
- var AuthUrlException = (function (_super) {
- __extends(AuthUrlException, _super);
- function AuthUrlException(data, msg) {
- if (msg === void 0) { msg = "Auth URL Endpoint could not be determined from data. Data logged."; }
- var _this = _super.call(this, msg) || this;
- _this.name = "APIUrlException";
- logging_1.Logger.log({ data: data, level: logging_1.LogLevel.Error, message: _this.message });
- return _this;
- }
- return AuthUrlException;
- }(Error));
- exports.AuthUrlException = AuthUrlException;
- var NodeFetchClientUnsupportedException = (function (_super) {
- __extends(NodeFetchClientUnsupportedException, _super);
- function NodeFetchClientUnsupportedException(msg) {
- if (msg === void 0) { msg = "Using NodeFetchClient in the browser is not supported."; }
- var _this = _super.call(this, msg) || this;
- _this.name = "NodeFetchClientUnsupportedException";
- defaultLog(_this);
- return _this;
- }
- return NodeFetchClientUnsupportedException;
- }(Error));
- exports.NodeFetchClientUnsupportedException = NodeFetchClientUnsupportedException;
- var SPRequestExecutorUndefinedException = (function (_super) {
- __extends(SPRequestExecutorUndefinedException, _super);
- function SPRequestExecutorUndefinedException() {
- var _this = this;
- var msg = [
- "SP.RequestExecutor is undefined. ",
- "Load the SP.RequestExecutor.js library (/_layouts/15/SP.RequestExecutor.js) before loading the PnP JS Core library.",
- ].join(" ");
- _this = _super.call(this, msg) || this;
- _this.name = "SPRequestExecutorUndefinedException";
- defaultLog(_this);
- return _this;
- }
- return SPRequestExecutorUndefinedException;
- }(Error));
- exports.SPRequestExecutorUndefinedException = SPRequestExecutorUndefinedException;
- var MaxCommentLengthException = (function (_super) {
- __extends(MaxCommentLengthException, _super);
- function MaxCommentLengthException(msg) {
- if (msg === void 0) { msg = "The maximum comment length is 1023 characters."; }
- var _this = _super.call(this, msg) || this;
- _this.name = "MaxCommentLengthException";
- defaultLog(_this);
- return _this;
- }
- return MaxCommentLengthException;
- }(Error));
- exports.MaxCommentLengthException = MaxCommentLengthException;
- var NotSupportedInBatchException = (function (_super) {
- __extends(NotSupportedInBatchException, _super);
- function NotSupportedInBatchException(operation) {
- if (operation === void 0) { operation = "This operation"; }
- var _this = _super.call(this, operation + " is not supported as part of a batch.") || this;
- _this.name = "NotSupportedInBatchException";
- defaultLog(_this);
- return _this;
- }
- return NotSupportedInBatchException;
- }(Error));
- exports.NotSupportedInBatchException = NotSupportedInBatchException;
- var ODataIdException = (function (_super) {
- __extends(ODataIdException, _super);
- function ODataIdException(data, msg) {
- if (msg === void 0) { msg = "Could not extract odata id in object, you may be using nometadata. Object data logged to logger."; }
- var _this = _super.call(this, msg) || this;
- _this.name = "ODataIdException";
- logging_1.Logger.log({ data: data, level: logging_1.LogLevel.Error, message: _this.message });
- return _this;
- }
- return ODataIdException;
- }(Error));
- exports.ODataIdException = ODataIdException;
- var BatchParseException = (function (_super) {
- __extends(BatchParseException, _super);
- function BatchParseException(msg) {
- var _this = _super.call(this, msg) || this;
- _this.name = "BatchParseException";
- defaultLog(_this);
- return _this;
- }
- return BatchParseException;
- }(Error));
- exports.BatchParseException = BatchParseException;
- var AlreadyInBatchException = (function (_super) {
- __extends(AlreadyInBatchException, _super);
- function AlreadyInBatchException(msg) {
- if (msg === void 0) { msg = "This query is already part of a batch."; }
- var _this = _super.call(this, msg) || this;
- _this.name = "AlreadyInBatchException";
- defaultLog(_this);
- return _this;
- }
- return AlreadyInBatchException;
- }(Error));
- exports.AlreadyInBatchException = AlreadyInBatchException;
- var FunctionExpectedException = (function (_super) {
- __extends(FunctionExpectedException, _super);
- function FunctionExpectedException(msg) {
- if (msg === void 0) { msg = "This query is already part of a batch."; }
- var _this = _super.call(this, msg) || this;
- _this.name = "FunctionExpectedException";
- defaultLog(_this);
- return _this;
- }
- return FunctionExpectedException;
- }(Error));
- exports.FunctionExpectedException = FunctionExpectedException;
- var UrlException = (function (_super) {
- __extends(UrlException, _super);
- function UrlException(msg) {
- var _this = _super.call(this, msg) || this;
- _this.name = "UrlException";
- defaultLog(_this);
- return _this;
- }
- return UrlException;
- }(Error));
- exports.UrlException = UrlException;
- /***/ }),
- /* 4 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var fetchclient_1 = __webpack_require__(21);
- var RuntimeConfigImpl = (function () {
- function RuntimeConfigImpl() {
- // these are our default values for the library
- this._headers = null;
- this._defaultCachingStore = "session";
- this._defaultCachingTimeoutSeconds = 60;
- this._globalCacheDisable = false;
- this._fetchClientFactory = function () { return new fetchclient_1.FetchClient(); };
- this._baseUrl = null;
- this._spfxContext = null;
- }
- RuntimeConfigImpl.prototype.set = function (config) {
- if (config.hasOwnProperty("headers")) {
- this._headers = config.headers;
- }
- if (config.hasOwnProperty("globalCacheDisable")) {
- this._globalCacheDisable = config.globalCacheDisable;
- }
- if (config.hasOwnProperty("defaultCachingStore")) {
- this._defaultCachingStore = config.defaultCachingStore;
- }
- if (config.hasOwnProperty("defaultCachingTimeoutSeconds")) {
- this._defaultCachingTimeoutSeconds = config.defaultCachingTimeoutSeconds;
- }
- if (config.hasOwnProperty("fetchClientFactory")) {
- this._fetchClientFactory = config.fetchClientFactory;
- }
- if (config.hasOwnProperty("baseUrl")) {
- this._baseUrl = config.baseUrl;
- }
- if (config.hasOwnProperty("spFXContext")) {
- this._spfxContext = config.spfxContext;
- }
- };
- Object.defineProperty(RuntimeConfigImpl.prototype, "headers", {
- get: function () {
- return this._headers;
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(RuntimeConfigImpl.prototype, "defaultCachingStore", {
- get: function () {
- return this._defaultCachingStore;
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(RuntimeConfigImpl.prototype, "defaultCachingTimeoutSeconds", {
- get: function () {
- return this._defaultCachingTimeoutSeconds;
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(RuntimeConfigImpl.prototype, "globalCacheDisable", {
- get: function () {
- return this._globalCacheDisable;
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(RuntimeConfigImpl.prototype, "fetchClientFactory", {
- get: function () {
- return this._fetchClientFactory;
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(RuntimeConfigImpl.prototype, "baseUrl", {
- get: function () {
- if (this._baseUrl !== null) {
- return this._baseUrl;
- }
- else if (this._spfxContext !== null) {
- return this._spfxContext.pageContext.web.absoluteUrl;
- }
- return null;
- },
- enumerable: true,
- configurable: true
- });
- return RuntimeConfigImpl;
- }());
- exports.RuntimeConfigImpl = RuntimeConfigImpl;
- var _runtimeConfig = new RuntimeConfigImpl();
- exports.RuntimeConfig = _runtimeConfig;
- function setRuntimeConfig(config) {
- _runtimeConfig.set(config);
- }
- exports.setRuntimeConfig = setRuntimeConfig;
- /***/ }),
- /* 5 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- /**
- * A set of logging levels
- *
- */
- var LogLevel;
- (function (LogLevel) {
- LogLevel[LogLevel["Verbose"] = 0] = "Verbose";
- LogLevel[LogLevel["Info"] = 1] = "Info";
- LogLevel[LogLevel["Warning"] = 2] = "Warning";
- LogLevel[LogLevel["Error"] = 3] = "Error";
- LogLevel[LogLevel["Off"] = 99] = "Off";
- })(LogLevel = exports.LogLevel || (exports.LogLevel = {}));
- /**
- * Class used to subscribe ILogListener and log messages throughout an application
- *
- */
- var Logger = (function () {
- function Logger() {
- }
- Object.defineProperty(Logger, "activeLogLevel", {
- get: function () {
- return Logger.instance.activeLogLevel;
- },
- set: function (value) {
- Logger.instance.activeLogLevel = value;
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(Logger, "instance", {
- get: function () {
- if (typeof Logger._instance === "undefined" || Logger._instance === null) {
- Logger._instance = new LoggerImpl();
- }
- return Logger._instance;
- },
- enumerable: true,
- configurable: true
- });
- /**
- * Adds ILogListener instances to the set of subscribed listeners
- *
- * @param listeners One or more listeners to subscribe to this log
- */
- Logger.subscribe = function () {
- var listeners = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- listeners[_i] = arguments[_i];
- }
- listeners.map(function (listener) { return Logger.instance.subscribe(listener); });
- };
- /**
- * Clears the subscribers collection, returning the collection before modifiction
- */
- Logger.clearSubscribers = function () {
- return Logger.instance.clearSubscribers();
- };
- Object.defineProperty(Logger, "count", {
- /**
- * Gets the current subscriber count
- */
- get: function () {
- return Logger.instance.count;
- },
- enumerable: true,
- configurable: true
- });
- /**
- * Writes the supplied string to the subscribed listeners
- *
- * @param message The message to write
- * @param level [Optional] if supplied will be used as the level of the entry (Default: LogLevel.Verbose)
- */
- Logger.write = function (message, level) {
- if (level === void 0) { level = LogLevel.Verbose; }
- Logger.instance.log({ level: level, message: message });
- };
- /**
- * Writes the supplied string to the subscribed listeners
- *
- * @param json The json object to stringify and write
- * @param level [Optional] if supplied will be used as the level of the entry (Default: LogLevel.Verbose)
- */
- Logger.writeJSON = function (json, level) {
- if (level === void 0) { level = LogLevel.Verbose; }
- Logger.instance.log({ level: level, message: JSON.stringify(json) });
- };
- /**
- * Logs the supplied entry to the subscribed listeners
- *
- * @param entry The message to log
- */
- Logger.log = function (entry) {
- Logger.instance.log(entry);
- };
- /**
- * Logs performance tracking data for the the execution duration of the supplied function using console.profile
- *
- * @param name The name of this profile boundary
- * @param f The function to execute and track within this performance boundary
- */
- Logger.measure = function (name, f) {
- return Logger.instance.measure(name, f);
- };
- return Logger;
- }());
- exports.Logger = Logger;
- var LoggerImpl = (function () {
- function LoggerImpl(activeLogLevel, subscribers) {
- if (activeLogLevel === void 0) { activeLogLevel = LogLevel.Warning; }
- if (subscribers === void 0) { subscribers = []; }
- this.activeLogLevel = activeLogLevel;
- this.subscribers = subscribers;
- }
- LoggerImpl.prototype.subscribe = function (listener) {
- this.subscribers.push(listener);
- };
- LoggerImpl.prototype.clearSubscribers = function () {
- var s = this.subscribers.slice(0);
- this.subscribers.length = 0;
- return s;
- };
- Object.defineProperty(LoggerImpl.prototype, "count", {
- get: function () {
- return this.subscribers.length;
- },
- enumerable: true,
- configurable: true
- });
- LoggerImpl.prototype.write = function (message, level) {
- if (level === void 0) { level = LogLevel.Verbose; }
- this.log({ level: level, message: message });
- };
- LoggerImpl.prototype.log = function (entry) {
- if (typeof entry === "undefined" || entry.level < this.activeLogLevel) {
- return;
- }
- this.subscribers.map(function (subscriber) { return subscriber.log(entry); });
- };
- LoggerImpl.prototype.measure = function (name, f) {
- console.profile(name);
- try {
- return f();
- }
- finally {
- console.profileEnd();
- }
- };
- return LoggerImpl;
- }());
- /**
- * Implementation of ILogListener which logs to the browser console
- *
- */
- var ConsoleListener = (function () {
- function ConsoleListener() {
- }
- /**
- * Any associated data that a given logging listener may choose to log or ignore
- *
- * @param entry The information to be logged
- */
- ConsoleListener.prototype.log = function (entry) {
- var msg = this.format(entry);
- switch (entry.level) {
- case LogLevel.Verbose:
- case LogLevel.Info:
- console.log(msg);
- break;
- case LogLevel.Warning:
- console.warn(msg);
- break;
- case LogLevel.Error:
- console.error(msg);
- break;
- }
- };
- /**
- * Formats the message
- *
- * @param entry The information to format into a string
- */
- ConsoleListener.prototype.format = function (entry) {
- return "Message: " + entry.message + " Data: " + JSON.stringify(entry.data);
- };
- return ConsoleListener;
- }());
- exports.ConsoleListener = ConsoleListener;
- /**
- * Implementation of ILogListener which logs to the supplied function
- *
- */
- var FunctionListener = (function () {
- /**
- * Creates a new instance of the FunctionListener class
- *
- * @constructor
- * @param method The method to which any logging data will be passed
- */
- function FunctionListener(method) {
- this.method = method;
- }
- /**
- * Any associated data that a given logging listener may choose to log or ignore
- *
- * @param entry The information to be logged
- */
- FunctionListener.prototype.log = function (entry) {
- this.method(entry);
- };
- return FunctionListener;
- }());
- exports.FunctionListener = FunctionListener;
- /***/ }),
- /* 6 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- /**
- * Generic dictionary
- */
- var Dictionary = (function () {
- /**
- * Creates a new instance of the Dictionary<T> class
- *
- * @constructor
- */
- function Dictionary(keys, values) {
- if (keys === void 0) { keys = []; }
- if (values === void 0) { values = []; }
- this.keys = keys;
- this.values = values;
- }
- /**
- * Gets a value from the collection using the specified key
- *
- * @param key The key whose value we want to return, returns null if the key does not exist
- */
- Dictionary.prototype.get = function (key) {
- var index = this.keys.indexOf(key);
- if (index < 0) {
- return null;
- }
- return this.values[index];
- };
- /**
- * Adds the supplied key and value to the dictionary
- *
- * @param key The key to add
- * @param o The value to add
- */
- Dictionary.prototype.add = function (key, o) {
- var index = this.keys.indexOf(key);
- if (index > -1) {
- this.values[index] = o;
- }
- else {
- this.keys.push(key);
- this.values.push(o);
- }
- };
- /**
- * Merges the supplied typed hash into this dictionary instance. Existing values are updated and new ones are created as appropriate.
- */
- Dictionary.prototype.merge = function (source) {
- var _this = this;
- if ("getKeys" in source) {
- var sourceAsDictionary_1 = source;
- sourceAsDictionary_1.getKeys().map(function (key) {
- _this.add(key, sourceAsDictionary_1.get(key));
- });
- }
- else {
- var sourceAsHash = source;
- for (var key in sourceAsHash) {
- if (sourceAsHash.hasOwnProperty(key)) {
- this.add(key, sourceAsHash[key]);
- }
- }
- }
- };
- /**
- * Removes a value from the dictionary
- *
- * @param key The key of the key/value pair to remove. Returns null if the key was not found.
- */
- Dictionary.prototype.remove = function (key) {
- var index = this.keys.indexOf(key);
- if (index < 0) {
- return null;
- }
- var val = this.values[index];
- this.keys.splice(index, 1);
- this.values.splice(index, 1);
- return val;
- };
- /**
- * Returns all the keys currently in the dictionary as an array
- */
- Dictionary.prototype.getKeys = function () {
- return this.keys;
- };
- /**
- * Returns all the values currently in the dictionary as an array
- */
- Dictionary.prototype.getValues = function () {
- return this.values;
- };
- /**
- * Clears the current dictionary
- */
- Dictionary.prototype.clear = function () {
- this.keys = [];
- this.values = [];
- };
- /**
- * Gets a count of the items currently in the dictionary
- */
- Dictionary.prototype.count = function () {
- return this.keys.length;
- };
- return Dictionary;
- }());
- exports.Dictionary = Dictionary;
- /***/ }),
- /* 7 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var __extends = (this && this.__extends) || (function () {
- var extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
- return c > 3 && r && Object.defineProperty(target, key, r), r;
- };
- Object.defineProperty(exports, "__esModule", { value: true });
- var queryable_1 = __webpack_require__(1);
- var lists_1 = __webpack_require__(11);
- var fields_1 = __webpack_require__(24);
- var navigation_1 = __webpack_require__(25);
- var sitegroups_1 = __webpack_require__(18);
- var contenttypes_1 = __webpack_require__(16);
- var folders_1 = __webpack_require__(9);
- var roles_1 = __webpack_require__(17);
- var files_1 = __webpack_require__(8);
- var util_1 = __webpack_require__(0);
- var lists_2 = __webpack_require__(11);
- var siteusers_1 = __webpack_require__(30);
- var usercustomactions_1 = __webpack_require__(19);
- var odata_1 = __webpack_require__(2);
- var features_1 = __webpack_require__(23);
- var decorators_1 = __webpack_require__(31);
- var queryableshareable_1 = __webpack_require__(12);
- var relateditems_1 = __webpack_require__(46);
- var Webs = (function (_super) {
- __extends(Webs, _super);
- function Webs(baseUrl, webPath) {
- if (webPath === void 0) { webPath = "webs"; }
- return _super.call(this, baseUrl, webPath) || this;
- }
- /**
- * Adds a new web to the collection
- *
- * @param title The new web's title
- * @param url The new web's relative url
- * @param description The web web's description
- * @param template The web's template
- * @param language The language code to use for this web
- * @param inheritPermissions If true permissions will be inherited from the partent web
- * @param additionalSettings Will be passed as part of the web creation body
- */
- Webs.prototype.add = function (title, url, description, template, language, inheritPermissions, additionalSettings) {
- if (description === void 0) { description = ""; }
- if (template === void 0) { template = "STS"; }
- if (language === void 0) { language = 1033; }
- if (inheritPermissions === void 0) { inheritPermissions = true; }
- if (additionalSettings === void 0) { additionalSettings = {}; }
- var props = util_1.Util.extend({
- Description: description,
- Language: language,
- Title: title,
- Url: url,
- UseSamePermissionsAsParentSite: inheritPermissions,
- WebTemplate: template,
- }, additionalSettings);
- var postBody = JSON.stringify({
- "parameters": util_1.Util.extend({
- "__metadata": { "type": "SP.WebCreationInformation" },
- }, props),
- });
- return this.clone(Webs, "add", true).post({ body: postBody }).then(function (data) {
- return {
- data: data,
- web: new Web(odata_1.extractOdataId(data).replace(/_api\/web\/?/i, "")),
- };
- });
- };
- return Webs;
- }(queryable_1.QueryableCollection));
- exports.Webs = Webs;
- /**
- * Describes a web
- *
- */
- var Web = (function (_super) {
- __extends(Web, _super);
- function Web(baseUrl, path) {
- if (path === void 0) { path = "_api/web"; }
- return _super.call(this, baseUrl, path) || this;
- }
- /**
- * Creates a new web instance from the given url by indexing the location of the /_api/
- * segment. If this is not found the method creates a new web with the entire string as
- * supplied.
- *
- * @param url
- */
- Web.fromUrl = function (url, path) {
- if (url === null) {
- return new Web("");
- }
- var index = url.indexOf("_api/");
- if (index > -1) {
- return new Web(url.substr(0, index), path);
- }
- return new Web(url, path);
- };
- Object.defineProperty(Web.prototype, "webs", {
- get: function () {
- return new Webs(this);
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(Web.prototype, "contentTypes", {
- /**
- * Get the content types available in this web
- *
- */
- get: function () {
- return new contenttypes_1.ContentTypes(this);
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(Web.prototype, "lists", {
- /**
- * Get the lists in this web
- *
- */
- get: function () {
- return new lists_1.Lists(this);
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(Web.prototype, "fields", {
- /**
- * Gets the fields in this web
- *
- */
- get: function () {
- return new fields_1.Fields(this);
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(Web.prototype, "features", {
- /**
- * Gets the active features for this web
- *
- */
- get: function () {
- return new features_1.Features(this);
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(Web.prototype, "availablefields", {
- /**
- * Gets the available fields in this web
- *
- */
- get: function () {
- return new fields_1.Fields(this, "availablefields");
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(Web.prototype, "navigation", {
- /**
- * Get the navigation options in this web
- *
- */
- get: function () {
- return new navigation_1.Navigation(this);
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(Web.prototype, "siteUsers", {
- /**
- * Gets the site users
- *
- */
- get: function () {
- return new siteusers_1.SiteUsers(this);
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(Web.prototype, "siteGroups", {
- /**
- * Gets the site groups
- *
- */
- get: function () {
- return new sitegroups_1.SiteGroups(this);
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(Web.prototype, "currentUser", {
- /**
- * Gets the current user
- */
- get: function () {
- return new siteusers_1.CurrentUser(this);
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(Web.prototype, "folders", {
- /**
- * Get the folders in this web
- *
- */
- get: function () {
- return new folders_1.Folders(this);
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(Web.prototype, "userCustomActions", {
- /**
- * Get all custom actions on a site
- *
- */
- get: function () {
- return new usercustomactions_1.UserCustomActions(this);
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(Web.prototype, "roleDefinitions", {
- /**
- * Gets the collection of RoleDefinition resources.
- *
- */
- get: function () {
- return new roles_1.RoleDefinitions(this);
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(Web.prototype, "relatedItems", {
- /**
- * Provides an interface to manage related items
- *
- */
- get: function () {
- return relateditems_1.RelatedItemManagerImpl.FromUrl(this.toUrl());
- },
- enumerable: true,
- configurable: true
- });
- /**
- * Creates a new batch for requests within the context of context this web
- *
- */
- Web.prototype.createBatch = function () {
- return new odata_1.ODataBatch(this.parentUrl);
- };
- Object.defineProperty(Web.prototype, "rootFolder", {
- /**
- * The root folder of the web
- */
- get: function () {
- return new folders_1.Folder(this, "rootFolder");
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(Web.prototype, "associatedOwnerGroup", {
- get: function () {
- return new sitegroups_1.SiteGroup(this, "associatedownergroup");
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(Web.prototype, "associatedMemberGroup", {
- get: function () {
- return new sitegroups_1.SiteGroup(this, "associatedmembergroup");
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(Web.prototype, "associatedVisitorGroup", {
- get: function () {
- return new sitegroups_1.SiteGroup(this, "associatedvisitorgroup");
- },
- enumerable: true,
- configurable: true
- });
- /**
- * Get a folder by server relative url
- *
- * @param folderRelativeUrl the server relative path to the folder (including /sites/ if applicable)
- */
- Web.prototype.getFolderByServerRelativeUrl = function (folderRelativeUrl) {
- return new folders_1.Folder(this, "getFolderByServerRelativeUrl('" + folderRelativeUrl + "')");
- };
- /**
- * Get a file by server relative url
- *
- * @param fileRelativeUrl the server relative path to the file (including /sites/ if applicable)
- */
- Web.prototype.getFileByServerRelativeUrl = function (fileRelativeUrl) {
- return new files_1.File(this, "getFileByServerRelativeUrl('" + fileRelativeUrl + "')");
- };
- /**
- * Get a list by server relative url (list's root folder)
- *
- * @param listRelativeUrl the server relative path to the list's root folder (including /sites/ if applicable)
- */
- Web.prototype.getList = function (listRelativeUrl) {
- return new lists_2.List(this, "getList('" + listRelativeUrl + "')");
- };
- /**
- * Updates this web intance with the supplied properties
- *
- * @param properties A plain object hash of values to update for the web
- */
- Web.prototype.update = function (properties) {
- var _this = this;
- var postBody = JSON.stringify(util_1.Util.extend({
- "__metadata": { "type": "SP.Web" },
- }, properties));
- return this.post({
- body: postBody,
- headers: {
- "X-HTTP-Method": "MERGE",
- },
- }).then(function (data) {
- return {
- data: data,
- web: _this,
- };
- });
- };
- /**
- * Delete this web
- *
- */
- Web.prototype.delete = function () {
- return _super.prototype.delete.call(this);
- };
- /**
- * Applies the theme specified by the contents of each of the files specified in the arguments to the site.
- *
- * @param colorPaletteUrl Server-relative URL of the color palette file.
- * @param fontSchemeUrl Server-relative URL of the font scheme.
- * @param backgroundImageUrl Server-relative URL of the background image.
- * @param shareGenerated true to store the generated theme files in the root site, or false to store them in this site.
- */
- Web.prototype.applyTheme = function (colorPaletteUrl, fontSchemeUrl, backgroundImageUrl, shareGenerated) {
- var postBody = JSON.stringify({
- backgroundImageUrl: backgroundImageUrl,
- colorPaletteUrl: colorPaletteUrl,
- fontSchemeUrl: fontSchemeUrl,
- shareGenerated: shareGenerated,
- });
- return this.clone(Web, "applytheme", true).post({ body: postBody });
- };
- /**
- * Applies the specified site definition or site template to the Web site that has no template applied to it.
- *
- * @param template Name of the site definition or the name of the site template
- */
- Web.prototype.applyWebTemplate = function (template) {
- var q = this.clone(Web, "applywebtemplate", true);
- q.concat("(@t)");
- q.query.add("@t", template);
- return q.post();
- };
- /**
- * Returns whether the current user has the given set of permissions.
- *
- * @param perms The high and low permission range.
- */
- Web.prototype.doesUserHavePermissions = function (perms) {
- var q = this.clone(Web, "doesuserhavepermissions", true);
- q.concat("(@p)");
- q.query.add("@p", JSON.stringify(perms));
- return q.get();
- };
- /**
- * Checks whether the specified login name belongs to a valid user in the site. If the user doesn't exist, adds the user to the site.
- *
- * @param loginName The login name of the user (ex: i:0#.f|membership|user@domain.onmicrosoft.com)
- */
- Web.prototype.ensureUser = function (loginName) {
- var postBody = JSON.stringify({
- logonName: loginName,
- });
- return this.clone(Web, "ensureuser", true).post({ body: postBody }).then(function (data) {
- return {
- data: data,
- user: new siteusers_1.SiteUser(odata_1.extractOdataId(data)),
- };
- });
- };
- /**
- * Returns a collection of site templates available for the site.
- *
- * @param language The LCID of the site templates to get.
- * @param true to include language-neutral site templates; otherwise false
- */
- Web.prototype.availableWebTemplates = function (language, includeCrossLanugage) {
- if (language === void 0) { language = 1033; }
- if (includeCrossLanugage === void 0) { includeCrossLanugage = true; }
- return new queryable_1.QueryableCollection(this, "getavailablewebtemplates(lcid=" + language + ", doincludecrosslanguage=" + includeCrossLanugage + ")");
- };
- /**
- * Returns the list gallery on the site.
- *
- * @param type The gallery type - WebTemplateCatalog = 111, WebPartCatalog = 113 ListTemplateCatalog = 114,
- * MasterPageCatalog = 116, SolutionCatalog = 121, ThemeCatalog = 123, DesignCatalog = 124, AppDataCatalog = 125
- */
- Web.prototype.getCatalog = function (type) {
- return this.clone(Web, "getcatalog(" + type + ")", true).select("Id").get().then(function (data) {
- return new lists_2.List(odata_1.extractOdataId(data));
- });
- };
- /**
- * Returns the collection of changes from the change log that have occurred within the list, based on the specified query.
- */
- Web.prototype.getChanges = function (query) {
- var postBody = JSON.stringify({ "query": util_1.Util.extend({ "__metadata": { "type": "SP.ChangeQuery" } }, query) });
- return this.clone(Web, "getchanges", true).post({ body: postBody });
- };
- Object.defineProperty(Web.prototype, "customListTemplate", {
- /**
- * Gets the custom list templates for the site.
- *
- */
- get: function () {
- return new queryable_1.QueryableCollection(this, "getcustomlisttemplates");
- },
- enumerable: true,
- configurable: true
- });
- /**
- * Returns the user corresponding to the specified member identifier for the current site.
- *
- * @param id The ID of the user.
- */
- Web.prototype.getUserById = function (id) {
- return new siteusers_1.SiteUser(this, "getUserById(" + id + ")");
- };
- /**
- * Returns the name of the image file for the icon that is used to represent the specified file.
- *
- * @param filename The file name. If this parameter is empty, the server returns an empty string.
- * @param size The size of the icon: 16x16 pixels = 0, 32x32 pixels = 1.
- * @param progId The ProgID of the application that was used to create the file, in the form OLEServerName.ObjectName
- */
- Web.prototype.mapToIcon = function (filename, size, progId) {
- if (size === void 0) { size = 0; }
- if (progId === void 0) { progId = ""; }
- return this.clone(Web, "maptoicon(filename='" + filename + "', progid='" + progId + "', size=" + size + ")", true).get();
- };
- return Web;
- }(queryableshareable_1.QueryableShareableWeb));
- __decorate([
- decorators_1.deprecated("This method will be removed in future releases. Please use the methods found in queryable securable.")
- ], Web.prototype, "doesUserHavePermissions", null);
- exports.Web = Web;
- /***/ }),
- /* 8 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var __extends = (this && this.__extends) || (function () {
- var extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- Object.defineProperty(exports, "__esModule", { value: true });
- var queryable_1 = __webpack_require__(1);
- var odata_1 = __webpack_require__(2);
- var util_1 = __webpack_require__(0);
- var exceptions_1 = __webpack_require__(3);
- var webparts_1 = __webpack_require__(50);
- var items_1 = __webpack_require__(10);
- var queryableshareable_1 = __webpack_require__(12);
- var odata_2 = __webpack_require__(2);
- /**
- * Describes a collection of File objects
- *
- */
- var Files = (function (_super) {
- __extends(Files, _super);
- /**
- * Creates a new instance of the Files class
- *
- * @param baseUrl The url or Queryable which forms the parent of this fields collection
- */
- function Files(baseUrl, path) {
- if (path === void 0) { path = "files"; }
- return _super.call(this, baseUrl, path) || this;
- }
- /**
- * Gets a File by filename
- *
- * @param name The name of the file, including extension.
- */
- Files.prototype.getByName = function (name) {
- var f = new File(this);
- f.concat("('" + name + "')");
- return f;
- };
- /**
- * Uploads a file. Not supported for batching
- *
- * @param url The folder-relative url of the file.
- * @param content The file contents blob.
- * @param shouldOverWrite Should a file with the same name in the same location be overwritten? (default: true)
- * @returns The new File and the raw response.
- */
- Files.prototype.add = function (url, content, shouldOverWrite) {
- var _this = this;
- if (shouldOverWrite === void 0) { shouldOverWrite = true; }
- return new Files(this, "add(overwrite=" + shouldOverWrite + ",url='" + url + "')")
- .post({
- body: content,
- }).then(function (response) {
- return {
- data: response,
- file: _this.getByName(url),
- };
- });
- };
- /**
- * Uploads a file. Not supported for batching
- *
- * @param url The folder-relative url of the file.
- * @param content The Blob file content to add
- * @param progress A callback function which can be used to track the progress of the upload
- * @param shouldOverWrite Should a file with the same name in the same location be overwritten? (default: true)
- * @param chunkSize The size of each file slice, in bytes (default: 10485760)
- * @returns The new File and the raw response.
- */
- Files.prototype.addChunked = function (url, content, progress, shouldOverWrite, chunkSize) {
- var _this = this;
- if (shouldOverWrite === void 0) { shouldOverWrite = true; }
- if (chunkSize === void 0) { chunkSize = 10485760; }
- var adder = this.clone(Files, "add(overwrite=" + shouldOverWrite + ",url='" + url + "')");
- return adder.post().then(function () { return _this.getByName(url); }).then(function (file) { return file.setContentChunked(content, progress, chunkSize); }).then(function (response) {
- return {
- data: response,
- file: _this.getByName(url),
- };
- });
- };
- /**
- * Adds a ghosted file to an existing list or document library. Not supported for batching.
- *
- * @param fileUrl The server-relative url where you want to save the file.
- * @param templateFileType The type of use to create the file.
- * @returns The template file that was added and the raw response.
- */
- Files.prototype.addTemplateFile = function (fileUrl, templateFileType) {
- var _this = this;
- return this.clone(Files, "addTemplateFile(urloffile='" + fileUrl + "',templatefiletype=" + templateFileType + ")")
- .post().then(function (response) {
- return {
- data: response,
- file: _this.getByName(fileUrl),
- };
- });
- };
- return Files;
- }(queryable_1.QueryableCollection));
- exports.Files = Files;
- /**
- * Describes a single File instance
- *
- */
- var File = (function (_super) {
- __extends(File, _super);
- function File() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- Object.defineProperty(File.prototype, "listItemAllFields", {
- /**
- * Gets a value that specifies the list item field values for the list item corresponding to the file.
- *
- */
- get: function () {
- return new queryable_1.QueryableCollection(this, "listItemAllFields");
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(File.prototype, "versions", {
- /**
- * Gets a collection of versions
- *
- */
- get: function () {
- return new Versions(this);
- },
- enumerable: true,
- configurable: true
- });
- /**
- * Approves the file submitted for content approval with the specified comment.
- * Only documents in lists that are enabled for content approval can be approved.
- *
- * @param comment The comment for the approval.
- */
- File.prototype.approve = function (comment) {
- return this.clone(File, "approve(comment='" + comment + "')", true).post();
- };
- /**
- * Stops the chunk upload session without saving the uploaded data. Does not support batching.
- * If the file doesn’t already exist in the library, the partially uploaded file will be deleted.
- * Use this in response to user action (as in a request to cancel an upload) or an error or exception.
- * Use the uploadId value that was passed to the StartUpload method that started the upload session.
- * This method is currently available only on Office 365.
- *
- * @param uploadId The unique identifier of the upload session.
- */
- File.prototype.cancelUpload = function (uploadId) {
- return this.clone(File, "cancelUpload(uploadId=guid'" + uploadId + "')", false).post();
- };
- /**
- * Checks the file in to a document library based on the check-in type.
- *
- * @param comment A comment for the check-in. Its length must be <= 1023.
- * @param checkinType The check-in type for the file.
- */
- File.prototype.checkin = function (comment, checkinType) {
- if (comment === void 0) { comment = ""; }
- if (checkinType === void 0) { checkinType = CheckinType.Major; }
- if (comment.length > 1023) {
- throw new exceptions_1.MaxCommentLengthException();
- }
- return this.clone(File, "checkin(comment='" + comment + "',checkintype=" + checkinType + ")", true).post();
- };
- /**
- * Checks out the file from a document library.
- */
- File.prototype.checkout = function () {
- return this.clone(File, "checkout", true).post();
- };
- /**
- * Copies the file to the destination url.
- *
- * @param url The absolute url or server relative url of the destination file path to copy to.
- * @param shouldOverWrite Should a file with the same name in the same location be overwritten?
- */
- File.prototype.copyTo = function (url, shouldOverWrite) {
- if (shouldOverWrite === void 0) { shouldOverWrite = true; }
- return this.clone(File, "copyTo(strnewurl='" + url + "',boverwrite=" + shouldOverWrite + ")", true).post();
- };
- /**
- * Delete this file.
- *
- * @param eTag Value used in the IF-Match header, by default "*"
- */
- File.prototype.delete = function (eTag) {
- if (eTag === void 0) { eTag = "*"; }
- return this.clone(File, null, true).post({
- headers: {
- "IF-Match": eTag,
- "X-HTTP-Method": "DELETE",
- },
- });
- };
- /**
- * Denies approval for a file that was submitted for content approval.
- * Only documents in lists that are enabled for content approval can be denied.
- *
- * @param comment The comment for the denial.
- */
- File.prototype.deny = function (comment) {
- if (comment === void 0) { comment = ""; }
- if (comment.length > 1023) {
- throw new exceptions_1.MaxCommentLengthException();
- }
- return this.clone(File, "deny(comment='" + comment + "')", true).post();
- };
- /**
- * Specifies the control set used to access, modify, or add Web Parts associated with this Web Part Page and view.
- * An exception is thrown if the file is not an ASPX page.
- *
- * @param scope The WebPartsPersonalizationScope view on the Web Parts page.
- */
- File.prototype.getLimitedWebPartManager = function (scope) {
- if (scope === void 0) { scope = WebPartsPersonalizationScope.Shared; }
- return new webparts_1.LimitedWebPartManager(this, "getLimitedWebPartManager(scope=" + scope + ")");
- };
- /**
- * Moves the file to the specified destination url.
- *
- * @param url The absolute url or server relative url of the destination file path to move to.
- * @param moveOperations The bitwise MoveOperations value for how to move the file.
- */
- File.prototype.moveTo = function (url, moveOperations) {
- if (moveOperations === void 0) { moveOperations = MoveOperations.Overwrite; }
- return this.clone(File, "moveTo(newurl='" + url + "',flags=" + moveOperations + ")", true).post();
- };
- /**
- * Submits the file for content approval with the specified comment.
- *
- * @param comment The comment for the published file. Its length must be <= 1023.
- */
- File.prototype.publish = function (comment) {
- if (comment === void 0) { comment = ""; }
- if (comment.length > 1023) {
- throw new exceptions_1.MaxCommentLengthException();
- }
- return this.clone(File, "publish(comment='" + comment + "')", true).post();
- };
- /**
- * Moves the file to the Recycle Bin and returns the identifier of the new Recycle Bin item.
- *
- * @returns The GUID of the recycled file.
- */
- File.prototype.recycle = function () {
- return this.clone(File, "recycle", true).post();
- };
- /**
- * Reverts an existing checkout for the file.
- *
- */
- File.prototype.undoCheckout = function () {
- return this.clone(File, "undoCheckout", true).post();
- };
- /**
- * Removes the file from content approval or unpublish a major version.
- *
- * @param comment The comment for the unpublish operation. Its length must be <= 1023.
- */
- File.prototype.unpublish = function (comment) {
- if (comment === void 0) { comment = ""; }
- if (comment.length > 1023) {
- throw new exceptions_1.MaxCommentLengthException();
- }
- return this.clone(File, "unpublish(comment='" + comment + "')", true).post();
- };
- /**
- * Gets the contents of the file as text. Not supported in batching.
- *
- */
- File.prototype.getText = function () {
- return this.clone(File, "$value").get(new odata_1.TextFileParser(), { headers: { "binaryStringResponseBody": "true" } });
- };
- /**
- * Gets the contents of the file as a blob, does not work in Node.js. Not supported in batching.
- *
- */
- File.prototype.getBlob = function () {
- return this.clone(File, "$value").get(new odata_1.BlobFileParser(), { headers: { "binaryStringResponseBody": "true" } });
- };
- /**
- * Gets the contents of a file as an ArrayBuffer, works in Node.js. Not supported in batching.
- */
- File.prototype.getBuffer = function () {
- return this.clone(File, "$value").get(new odata_1.BufferFileParser(), { headers: { "binaryStringResponseBody": "true" } });
- };
- /**
- * Gets the contents of a file as an ArrayBuffer, works in Node.js. Not supported in batching.
- */
- File.prototype.getJSON = function () {
- return this.clone(File, "$value").get(new odata_1.JSONFileParser(), { headers: { "binaryStringResponseBody": "true" } });
- };
- /**
- * Sets the content of a file, for large files use setContentChunked. Not supported in batching.
- *
- * @param content The file content
- *
- */
- File.prototype.setContent = function (content) {
- var _this = this;
- return this.clone(File, "$value").post({
- body: content,
- headers: {
- "X-HTTP-Method": "PUT",
- },
- }).then(function (_) { return new File(_this); });
- };
- /**
- * Gets the associated list item for this folder, loading the default properties
- */
- File.prototype.getItem = function () {
- var selects = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- selects[_i] = arguments[_i];
- }
- var q = this.listItemAllFields;
- return q.select.apply(q, selects).get().then(function (d) {
- return util_1.Util.extend(new items_1.Item(odata_2.getEntityUrl(d)), d);
- });
- };
- /**
- * Sets the contents of a file using a chunked upload approach. Not supported in batching.
- *
- * @param file The file to upload
- * @param progress A callback function which can be used to track the progress of the upload
- * @param chunkSize The size of each file slice, in bytes (default: 10485760)
- */
- File.prototype.setContentChunked = function (file, progress, chunkSize) {
- if (chunkSize === void 0) { chunkSize = 10485760; }
- if (typeof progress === "undefined") {
- progress = function () { return null; };
- }
- var self = this;
- var fileSize = file.size;
- var blockCount = parseInt((file.size / chunkSize).toString(), 10) + ((file.size % chunkSize === 0) ? 1 : 0);
- var uploadId = util_1.Util.getGUID();
- // start the chain with the first fragment
- progress({ blockNumber: 1, chunkSize: chunkSize, currentPointer: 0, fileSize: fileSize, stage: "starting", totalBlocks: blockCount });
- var chain = self.startUpload(uploadId, file.slice(0, chunkSize));
- var _loop_1 = function (i) {
- chain = chain.then(function (pointer) {
- progress({ blockNumber: i, chunkSize: chunkSize, currentPointer: pointer, fileSize: fileSize, stage: "continue", totalBlocks: blockCount });
- return self.continueUpload(uploadId, pointer, file.slice(pointer, pointer + chunkSize));
- });
- };
- // skip the first and last blocks
- for (var i = 2; i < blockCount; i++) {
- _loop_1(i);
- }
- return chain.then(function (pointer) {
- progress({ blockNumber: blockCount, chunkSize: chunkSize, currentPointer: pointer, fileSize: fileSize, stage: "finishing", totalBlocks: blockCount });
- return self.finishUpload(uploadId, pointer, file.slice(pointer));
- }).then(function (_) {
- return self;
- });
- };
- /**
- * Starts a new chunk upload session and uploads the first fragment.
- * The current file content is not changed when this method completes.
- * The method is idempotent (and therefore does not change the result) as long as you use the same values for uploadId and stream.
- * The upload session ends either when you use the CancelUpload method or when you successfully
- * complete the upload session by passing the rest of the file contents through the ContinueUpload and FinishUpload methods.
- * The StartUpload and ContinueUpload methods return the size of the running total of uploaded data in bytes,
- * so you can pass those return values to subsequent uses of ContinueUpload and FinishUpload.
- * This method is currently available only on Office 365.
- *
- * @param uploadId The unique identifier of the upload session.
- * @param fragment The file contents.
- * @returns The size of the total uploaded data in bytes.
- */
- File.prototype.startUpload = function (uploadId, fragment) {
- return this.clone(File, "startUpload(uploadId=guid'" + uploadId + "')").postAs({ body: fragment }).then(function (n) { return parseFloat(n); });
- };
- /**
- * Continues the chunk upload session with an additional fragment.
- * The current file content is not changed.
- * Use the uploadId value that was passed to the StartUpload method that started the upload session.
- * This method is currently available only on Office 365.
- *
- * @param uploadId The unique identifier of the upload session.
- * @param fileOffset The size of the offset into the file where the fragment starts.
- * @param fragment The file contents.
- * @returns The size of the total uploaded data in bytes.
- */
- File.prototype.continueUpload = function (uploadId, fileOffset, fragment) {
- return this.clone(File, "continueUpload(uploadId=guid'" + uploadId + "',fileOffset=" + fileOffset + ")").postAs({ body: fragment }).then(function (n) { return parseFloat(n); });
- };
- /**
- * Uploads the last file fragment and commits the file. The current file content is changed when this method completes.
- * Use the uploadId value that was passed to the StartUpload method that started the upload session.
- * This method is currently available only on Office 365.
- *
- * @param uploadId The unique identifier of the upload session.
- * @param fileOffset The size of the offset into the file where the fragment starts.
- * @param fragment The file contents.
- * @returns The newly uploaded file.
- */
- File.prototype.finishUpload = function (uploadId, fileOffset, fragment) {
- return this.clone(File, "finishUpload(uploadId=guid'" + uploadId + "',fileOffset=" + fileOffset + ")")
- .postAs({ body: fragment }).then(function (response) {
- return {
- data: response,
- file: new File(response.ServerRelativeUrl),
- };
- });
- };
- return File;
- }(queryableshareable_1.QueryableShareableFile));
- exports.File = File;
- /**
- * Describes a collection of Version objects
- *
- */
- var Versions = (function (_super) {
- __extends(Versions, _super);
- /**
- * Creates a new instance of the File class
- *
- * @param baseUrl The url or Queryable which forms the parent of this fields collection
- */
- function Versions(baseUrl, path) {
- if (path === void 0) { path = "versions"; }
- return _super.call(this, baseUrl, path) || this;
- }
- /**
- * Gets a version by id
- *
- * @param versionId The id of the version to retrieve
- */
- Versions.prototype.getById = function (versionId) {
- var v = new Version(this);
- v.concat("(" + versionId + ")");
- return v;
- };
- /**
- * Deletes all the file version objects in the collection.
- *
- */
- Versions.prototype.deleteAll = function () {
- return new Versions(this, "deleteAll").post();
- };
- /**
- * Deletes the specified version of the file.
- *
- * @param versionId The ID of the file version to delete.
- */
- Versions.prototype.deleteById = function (versionId) {
- return this.clone(Versions, "deleteById(vid=" + versionId + ")", true).post();
- };
- /**
- * Deletes the file version object with the specified version label.
- *
- * @param label The version label of the file version to delete, for example: 1.2
- */
- Versions.prototype.deleteByLabel = function (label) {
- return this.clone(Versions, "deleteByLabel(versionlabel='" + label + "')", true).post();
- };
- /**
- * Creates a new file version from the file specified by the version label.
- *
- * @param label The version label of the file version to restore, for example: 1.2
- */
- Versions.prototype.restoreByLabel = function (label) {
- return this.clone(Versions, "restoreByLabel(versionlabel='" + label + "')", true).post();
- };
- return Versions;
- }(queryable_1.QueryableCollection));
- exports.Versions = Versions;
- /**
- * Describes a single Version instance
- *
- */
- var Version = (function (_super) {
- __extends(Version, _super);
- function Version() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- /**
- * Delete a specific version of a file.
- *
- * @param eTag Value used in the IF-Match header, by default "*"
- */
- Version.prototype.delete = function (eTag) {
- if (eTag === void 0) { eTag = "*"; }
- return this.post({
- headers: {
- "IF-Match": eTag,
- "X-HTTP-Method": "DELETE",
- },
- });
- };
- return Version;
- }(queryable_1.QueryableInstance));
- exports.Version = Version;
- var CheckinType;
- (function (CheckinType) {
- CheckinType[CheckinType["Minor"] = 0] = "Minor";
- CheckinType[CheckinType["Major"] = 1] = "Major";
- CheckinType[CheckinType["Overwrite"] = 2] = "Overwrite";
- })(CheckinType = exports.CheckinType || (exports.CheckinType = {}));
- var WebPartsPersonalizationScope;
- (function (WebPartsPersonalizationScope) {
- WebPartsPersonalizationScope[WebPartsPersonalizationScope["User"] = 0] = "User";
- WebPartsPersonalizationScope[WebPartsPersonalizationScope["Shared"] = 1] = "Shared";
- })(WebPartsPersonalizationScope = exports.WebPartsPersonalizationScope || (exports.WebPartsPersonalizationScope = {}));
- var MoveOperations;
- (function (MoveOperations) {
- MoveOperations[MoveOperations["Overwrite"] = 1] = "Overwrite";
- MoveOperations[MoveOperations["AllowBrokenThickets"] = 8] = "AllowBrokenThickets";
- })(MoveOperations = exports.MoveOperations || (exports.MoveOperations = {}));
- var TemplateFileType;
- (function (TemplateFileType) {
- TemplateFileType[TemplateFileType["StandardPage"] = 0] = "StandardPage";
- TemplateFileType[TemplateFileType["WikiPage"] = 1] = "WikiPage";
- TemplateFileType[TemplateFileType["FormPage"] = 2] = "FormPage";
- })(TemplateFileType = exports.TemplateFileType || (exports.TemplateFileType = {}));
- /***/ }),
- /* 9 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var __extends = (this && this.__extends) || (function () {
- var extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- Object.defineProperty(exports, "__esModule", { value: true });
- var queryable_1 = __webpack_require__(1);
- var queryableshareable_1 = __webpack_require__(12);
- var files_1 = __webpack_require__(8);
- var util_1 = __webpack_require__(0);
- var odata_1 = __webpack_require__(2);
- var items_1 = __webpack_require__(10);
- /**
- * Describes a collection of Folder objects
- *
- */
- var Folders = (function (_super) {
- __extends(Folders, _super);
- /**
- * Creates a new instance of the Folders class
- *
- * @param baseUrl The url or Queryable which forms the parent of this fields collection
- */
- function Folders(baseUrl, path) {
- if (path === void 0) { path = "folders"; }
- return _super.call(this, baseUrl, path) || this;
- }
- /**
- * Gets a folder by folder name
- *
- */
- Folders.prototype.getByName = function (name) {
- var f = new Folder(this);
- f.concat("('" + name + "')");
- return f;
- };
- /**
- * Adds a new folder to the current folder (relative) or any folder (absolute)
- *
- * @param url The relative or absolute url where the new folder will be created. Urls starting with a forward slash are absolute.
- * @returns The new Folder and the raw response.
- */
- Folders.prototype.add = function (url) {
- var _this = this;
- return this.clone(Folders, "add('" + url + "')", true).post().then(function (response) {
- return {
- data: response,
- folder: _this.getByName(url),
- };
- });
- };
- return Folders;
- }(queryable_1.QueryableCollection));
- exports.Folders = Folders;
- /**
- * Describes a single Folder instance
- *
- */
- var Folder = (function (_super) {
- __extends(Folder, _super);
- function Folder() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- Object.defineProperty(Folder.prototype, "contentTypeOrder", {
- /**
- * Specifies the sequence in which content types are displayed.
- *
- */
- get: function () {
- return new queryable_1.QueryableCollection(this, "contentTypeOrder");
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(Folder.prototype, "files", {
- /**
- * Gets this folder's files
- *
- */
- get: function () {
- return new files_1.Files(this);
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(Folder.prototype, "folders", {
- /**
- * Gets this folder's sub folders
- *
- */
- get: function () {
- return new Folders(this);
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(Folder.prototype, "listItemAllFields", {
- /**
- * Gets this folder's list item field values
- *
- */
- get: function () {
- return new queryable_1.QueryableCollection(this, "listItemAllFields");
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(Folder.prototype, "parentFolder", {
- /**
- * Gets the parent folder, if available
- *
- */
- get: function () {
- return new Folder(this, "parentFolder");
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(Folder.prototype, "properties", {
- /**
- * Gets this folder's properties
- *
- */
- get: function () {
- return new queryable_1.QueryableInstance(this, "properties");
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(Folder.prototype, "serverRelativeUrl", {
- /**
- * Gets this folder's server relative url
- *
- */
- get: function () {
- return new queryable_1.Queryable(this, "serverRelativeUrl");
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(Folder.prototype, "uniqueContentTypeOrder", {
- /**
- * Gets a value that specifies the content type order.
- *
- */
- get: function () {
- return new queryable_1.QueryableCollection(this, "uniqueContentTypeOrder");
- },
- enumerable: true,
- configurable: true
- });
- Folder.prototype.update = function (properties) {
- var _this = this;
- var postBody = JSON.stringify(util_1.Util.extend({
- "__metadata": { "type": "SP.Folder" },
- }, properties));
- return this.post({
- body: postBody,
- headers: {
- "X-HTTP-Method": "MERGE",
- },
- }).then(function (data) {
- return {
- data: data,
- folder: _this,
- };
- });
- };
- /**
- * Delete this folder
- *
- * @param eTag Value used in the IF-Match header, by default "*"
- */
- Folder.prototype.delete = function (eTag) {
- if (eTag === void 0) { eTag = "*"; }
- return this.clone(Folder, null, true).post({
- headers: {
- "IF-Match": eTag,
- "X-HTTP-Method": "DELETE",
- },
- });
- };
- /**
- * Moves the folder to the Recycle Bin and returns the identifier of the new Recycle Bin item.
- */
- Folder.prototype.recycle = function () {
- return this.clone(Folder, "recycle", true).post();
- };
- /**
- * Gets the associated list item for this folder, loading the default properties
- */
- Folder.prototype.getItem = function () {
- var selects = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- selects[_i] = arguments[_i];
- }
- var q = this.listItemAllFields;
- return q.select.apply(q, selects).get().then(function (d) {
- return util_1.Util.extend(new items_1.Item(odata_1.getEntityUrl(d)), d);
- });
- };
- return Folder;
- }(queryableshareable_1.QueryableShareableFolder));
- exports.Folder = Folder;
- /***/ }),
- /* 10 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var __extends = (this && this.__extends) || (function () {
- var extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- Object.defineProperty(exports, "__esModule", { value: true });
- var queryable_1 = __webpack_require__(1);
- var queryableshareable_1 = __webpack_require__(12);
- var folders_1 = __webpack_require__(9);
- var files_1 = __webpack_require__(8);
- var contenttypes_1 = __webpack_require__(16);
- var util_1 = __webpack_require__(0);
- var odata_1 = __webpack_require__(2);
- var attachmentfiles_1 = __webpack_require__(42);
- var lists_1 = __webpack_require__(11);
- /**
- * Describes a collection of Item objects
- *
- */
- var Items = (function (_super) {
- __extends(Items, _super);
- /**
- * Creates a new instance of the Items class
- *
- * @param baseUrl The url or Queryable which forms the parent of this fields collection
- */
- function Items(baseUrl, path) {
- if (path === void 0) { path = "items"; }
- return _super.call(this, baseUrl, path) || this;
- }
- /**
- * Gets an Item by id
- *
- * @param id The integer id of the item to retrieve
- */
- Items.prototype.getById = function (id) {
- var i = new Item(this);
- i.concat("(" + id + ")");
- return i;
- };
- /**
- * Skips the specified number of items (https://msdn.microsoft.com/en-us/library/office/fp142385.aspx#sectionSection6)
- *
- * @param skip The starting id where the page should start, use with top to specify pages
- */
- Items.prototype.skip = function (skip) {
- this._query.add("$skiptoken", encodeURIComponent("Paged=TRUE&p_ID=" + skip));
- return this;
- };
- /**
- * Gets a collection designed to aid in paging through data
- *
- */
- Items.prototype.getPaged = function () {
- return this.getAs(new PagedItemCollectionParser());
- };
- //
- /**
- * Adds a new item to the collection
- *
- * @param properties The new items's properties
- */
- Items.prototype.add = function (properties, listItemEntityTypeFullName) {
- var _this = this;
- if (properties === void 0) { properties = {}; }
- if (listItemEntityTypeFullName === void 0) { listItemEntityTypeFullName = null; }
- var removeDependency = this.addBatchDependency();
- return this.ensureListItemEntityTypeName(listItemEntityTypeFullName).then(function (listItemEntityType) {
- var postBody = JSON.stringify(util_1.Util.extend({
- "__metadata": { "type": listItemEntityType },
- }, properties));
- var promise = _this.clone(Items, null, true).postAs({ body: postBody }).then(function (data) {
- return {
- data: data,
- item: _this.getById(data.Id),
- };
- });
- removeDependency();
- return promise;
- });
- };
- /**
- * Ensures we have the proper list item entity type name, either from the value provided or from the list
- *
- * @param candidatelistItemEntityTypeFullName The potential type name
- */
- Items.prototype.ensureListItemEntityTypeName = function (candidatelistItemEntityTypeFullName) {
- return candidatelistItemEntityTypeFullName ?
- Promise.resolve(candidatelistItemEntityTypeFullName) :
- this.getParent(lists_1.List).getListItemEntityTypeFullName();
- };
- return Items;
- }(queryable_1.QueryableCollection));
- exports.Items = Items;
- /**
- * Descrines a single Item instance
- *
- */
- var Item = (function (_super) {
- __extends(Item, _super);
- function Item() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- Object.defineProperty(Item.prototype, "attachmentFiles", {
- /**
- * Gets the set of attachments for this item
- *
- */
- get: function () {
- return new attachmentfiles_1.AttachmentFiles(this);
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(Item.prototype, "contentType", {
- /**
- * Gets the content type for this item
- *
- */
- get: function () {
- return new contenttypes_1.ContentType(this, "ContentType");
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(Item.prototype, "effectiveBasePermissions", {
- /**
- * Gets the effective base permissions for the item
- *
- */
- get: function () {
- return new queryable_1.Queryable(this, "EffectiveBasePermissions");
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(Item.prototype, "effectiveBasePermissionsForUI", {
- /**
- * Gets the effective base permissions for the item in a UI context
- *
- */
- get: function () {
- return new queryable_1.Queryable(this, "EffectiveBasePermissionsForUI");
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(Item.prototype, "fieldValuesAsHTML", {
- /**
- * Gets the field values for this list item in their HTML representation
- *
- */
- get: function () {
- return new queryable_1.QueryableInstance(this, "FieldValuesAsHTML");
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(Item.prototype, "fieldValuesAsText", {
- /**
- * Gets the field values for this list item in their text representation
- *
- */
- get: function () {
- return new queryable_1.QueryableInstance(this, "FieldValuesAsText");
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(Item.prototype, "fieldValuesForEdit", {
- /**
- * Gets the field values for this list item for use in editing controls
- *
- */
- get: function () {
- return new queryable_1.QueryableInstance(this, "FieldValuesForEdit");
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(Item.prototype, "folder", {
- /**
- * Gets the folder associated with this list item (if this item represents a folder)
- *
- */
- get: function () {
- return new folders_1.Folder(this, "folder");
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(Item.prototype, "file", {
- /**
- * Gets the folder associated with this list item (if this item represents a folder)
- *
- */
- get: function () {
- return new files_1.File(this, "file");
- },
- enumerable: true,
- configurable: true
- });
- /**
- * Updates this list intance with the supplied properties
- *
- * @param properties A plain object hash of values to update for the list
- * @param eTag Value used in the IF-Match header, by default "*"
- */
- Item.prototype.update = function (properties, eTag) {
- var _this = this;
- if (eTag === void 0) { eTag = "*"; }
- return new Promise(function (resolve, reject) {
- var removeDependency = _this.addBatchDependency();
- var parentList = _this.getParent(queryable_1.QueryableInstance, _this.parentUrl.substr(0, _this.parentUrl.lastIndexOf("/")));
- parentList.select("ListItemEntityTypeFullName").getAs().then(function (d) {
- var postBody = JSON.stringify(util_1.Util.extend({
- "__metadata": { "type": d.ListItemEntityTypeFullName },
- }, properties));
- removeDependency();
- return _this.post({
- body: postBody,
- headers: {
- "IF-Match": eTag,
- "X-HTTP-Method": "MERGE",
- },
- }, new ItemUpdatedParser()).then(function (data) {
- resolve({
- data: data,
- item: _this,
- });
- });
- }).catch(function (e) { return reject(e); });
- });
- };
- /**
- * Delete this item
- *
- * @param eTag Value used in the IF-Match header, by default "*"
- */
- Item.prototype.delete = function (eTag) {
- if (eTag === void 0) { eTag = "*"; }
- return this.post({
- headers: {
- "IF-Match": eTag,
- "X-HTTP-Method": "DELETE",
- },
- });
- };
- /**
- * Moves the list item to the Recycle Bin and returns the identifier of the new Recycle Bin item.
- */
- Item.prototype.recycle = function () {
- return this.clone(Item, "recycle", true).post();
- };
- /**
- * Gets a string representation of the full URL to the WOPI frame.
- * If there is no associated WOPI application, or no associated action, an empty string is returned.
- *
- * @param action Display mode: 0: view, 1: edit, 2: mobileView, 3: interactivePreview
- */
- Item.prototype.getWopiFrameUrl = function (action) {
- if (action === void 0) { action = 0; }
- var i = this.clone(Item, "getWOPIFrameUrl(@action)", true);
- i._query.add("@action", action);
- return i.post().then(function (data) {
- return data.GetWOPIFrameUrl;
- });
- };
- /**
- * Validates and sets the values of the specified collection of fields for the list item.
- *
- * @param formValues The fields to change and their new values.
- * @param newDocumentUpdate true if the list item is a document being updated after upload; otherwise false.
- */
- Item.prototype.validateUpdateListItem = function (formValues, newDocumentUpdate) {
- if (newDocumentUpdate === void 0) { newDocumentUpdate = false; }
- return this.clone(Item, "validateupdatelistitem", true).post({
- body: JSON.stringify({ "formValues": formValues, bNewDocumentUpdate: newDocumentUpdate }),
- });
- };
- return Item;
- }(queryableshareable_1.QueryableShareableItem));
- exports.Item = Item;
- /**
- * Provides paging functionality for list items
- */
- var PagedItemCollection = (function () {
- function PagedItemCollection(nextUrl, results) {
- this.nextUrl = nextUrl;
- this.results = results;
- }
- Object.defineProperty(PagedItemCollection.prototype, "hasNext", {
- /**
- * If true there are more results available in the set, otherwise there are not
- */
- get: function () {
- return typeof this.nextUrl === "string" && this.nextUrl.length > 0;
- },
- enumerable: true,
- configurable: true
- });
- /**
- * Gets the next set of results, or resolves to null if no results are available
- */
- PagedItemCollection.prototype.getNext = function () {
- if (this.hasNext) {
- var items = new Items(this.nextUrl, null);
- return items.getPaged();
- }
- return new Promise(function (r) { return r(null); });
- };
- return PagedItemCollection;
- }());
- exports.PagedItemCollection = PagedItemCollection;
- var PagedItemCollectionParser = (function (_super) {
- __extends(PagedItemCollectionParser, _super);
- function PagedItemCollectionParser() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- PagedItemCollectionParser.prototype.parse = function (r) {
- var _this = this;
- return new Promise(function (resolve, reject) {
- if (_this.handleError(r, reject)) {
- r.json().then(function (json) {
- var nextUrl = json.hasOwnProperty("d") && json.d.hasOwnProperty("__next") ? json.d.__next : json["odata.nextLink"];
- resolve(new PagedItemCollection(nextUrl, _this.parseODataJSON(json)));
- });
- }
- });
- };
- return PagedItemCollectionParser;
- }(odata_1.ODataParserBase));
- var ItemUpdatedParser = (function (_super) {
- __extends(ItemUpdatedParser, _super);
- function ItemUpdatedParser() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- ItemUpdatedParser.prototype.parse = function (r) {
- var _this = this;
- return new Promise(function (resolve, reject) {
- if (_this.handleError(r, reject)) {
- resolve({
- "odata.etag": r.headers.get("etag"),
- });
- }
- });
- };
- return ItemUpdatedParser;
- }(odata_1.ODataParserBase));
- /***/ }),
- /* 11 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var __extends = (this && this.__extends) || (function () {
- var extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- Object.defineProperty(exports, "__esModule", { value: true });
- var items_1 = __webpack_require__(10);
- var views_1 = __webpack_require__(49);
- var contenttypes_1 = __webpack_require__(16);
- var fields_1 = __webpack_require__(24);
- var forms_1 = __webpack_require__(43);
- var subscriptions_1 = __webpack_require__(47);
- var queryable_1 = __webpack_require__(1);
- var queryablesecurable_1 = __webpack_require__(26);
- var util_1 = __webpack_require__(0);
- var usercustomactions_1 = __webpack_require__(19);
- var odata_1 = __webpack_require__(2);
- var exceptions_1 = __webpack_require__(3);
- var folders_1 = __webpack_require__(9);
- /**
- * Describes a collection of List objects
- *
- */
- var Lists = (function (_super) {
- __extends(Lists, _super);
- /**
- * Creates a new instance of the Lists class
- *
- * @param baseUrl The url or Queryable which forms the parent of this fields collection
- */
- function Lists(baseUrl, path) {
- if (path === void 0) { path = "lists"; }
- return _super.call(this, baseUrl, path) || this;
- }
- /**
- * Gets a list from the collection by title
- *
- * @param title The title of the list
- */
- Lists.prototype.getByTitle = function (title) {
- return new List(this, "getByTitle('" + title + "')");
- };
- /**
- * Gets a list from the collection by guid id
- *
- * @param id The Id of the list (GUID)
- */
- Lists.prototype.getById = function (id) {
- var list = new List(this);
- list.concat("('" + id + "')");
- return list;
- };
- /**
- * Adds a new list to the collection
- *
- * @param title The new list's title
- * @param description The new list's description
- * @param template The list template value
- * @param enableContentTypes If true content types will be allowed and enabled, otherwise they will be disallowed and not enabled
- * @param additionalSettings Will be passed as part of the list creation body
- */
- Lists.prototype.add = function (title, description, template, enableContentTypes, additionalSettings) {
- var _this = this;
- if (description === void 0) { description = ""; }
- if (template === void 0) { template = 100; }
- if (enableContentTypes === void 0) { enableContentTypes = false; }
- if (additionalSettings === void 0) { additionalSettings = {}; }
- var addSettings = util_1.Util.extend({
- "AllowContentTypes": enableContentTypes,
- "BaseTemplate": template,
- "ContentTypesEnabled": enableContentTypes,
- "Description": description,
- "Title": title,
- "__metadata": { "type": "SP.List" },
- }, additionalSettings);
- return this.post({ body: JSON.stringify(addSettings) }).then(function (data) {
- return { data: data, list: _this.getByTitle(addSettings.Title) };
- });
- };
- /**
- * Ensures that the specified list exists in the collection (note: this method not supported for batching)
- *
- * @param title The new list's title
- * @param description The new list's description
- * @param template The list template value
- * @param enableContentTypes If true content types will be allowed and enabled, otherwise they will be disallowed and not enabled
- * @param additionalSettings Will be passed as part of the list creation body or used to update an existing list
- */
- Lists.prototype.ensure = function (title, description, template, enableContentTypes, additionalSettings) {
- var _this = this;
- if (description === void 0) { description = ""; }
- if (template === void 0) { template = 100; }
- if (enableContentTypes === void 0) { enableContentTypes = false; }
- if (additionalSettings === void 0) { additionalSettings = {}; }
- if (this.hasBatch) {
- throw new exceptions_1.NotSupportedInBatchException("The ensure list method");
- }
- return new Promise(function (resolve, reject) {
- var addOrUpdateSettings = util_1.Util.extend(additionalSettings, { Title: title, Description: description, ContentTypesEnabled: enableContentTypes }, true);
- var list = _this.getByTitle(addOrUpdateSettings.Title);
- list.get().then(function (_) {
- list.update(addOrUpdateSettings).then(function (d) {
- resolve({ created: false, data: d, list: _this.getByTitle(addOrUpdateSettings.Title) });
- }).catch(function (e) { return reject(e); });
- }).catch(function (_) {
- _this.add(title, description, template, enableContentTypes, addOrUpdateSettings).then(function (r) {
- resolve({ created: true, data: r.data, list: _this.getByTitle(addOrUpdateSettings.Title) });
- }).catch(function (e) { return reject(e); });
- });
- });
- };
- /**
- * Gets a list that is the default asset location for images or other files, which the users upload to their wiki pages.
- */
- Lists.prototype.ensureSiteAssetsLibrary = function () {
- return this.clone(Lists, "ensuresiteassetslibrary", true).post().then(function (json) {
- return new List(odata_1.extractOdataId(json));
- });
- };
- /**
- * Gets a list that is the default location for wiki pages.
- */
- Lists.prototype.ensureSitePagesLibrary = function () {
- return this.clone(Lists, "ensuresitepageslibrary", true).post().then(function (json) {
- return new List(odata_1.extractOdataId(json));
- });
- };
- return Lists;
- }(queryable_1.QueryableCollection));
- exports.Lists = Lists;
- /**
- * Describes a single List instance
- *
- */
- var List = (function (_super) {
- __extends(List, _super);
- function List() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- Object.defineProperty(List.prototype, "contentTypes", {
- /**
- * Gets the content types in this list
- *
- */
- get: function () {
- return new contenttypes_1.ContentTypes(this);
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(List.prototype, "items", {
- /**
- * Gets the items in this list
- *
- */
- get: function () {
- return new items_1.Items(this);
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(List.prototype, "views", {
- /**
- * Gets the views in this list
- *
- */
- get: function () {
- return new views_1.Views(this);
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(List.prototype, "fields", {
- /**
- * Gets the fields in this list
- *
- */
- get: function () {
- return new fields_1.Fields(this);
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(List.prototype, "forms", {
- /**
- * Gets the forms in this list
- *
- */
- get: function () {
- return new forms_1.Forms(this);
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(List.prototype, "defaultView", {
- /**
- * Gets the default view of this list
- *
- */
- get: function () {
- return new queryable_1.QueryableInstance(this, "DefaultView");
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(List.prototype, "userCustomActions", {
- /**
- * Get all custom actions on a site collection
- *
- */
- get: function () {
- return new usercustomactions_1.UserCustomActions(this);
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(List.prototype, "effectiveBasePermissions", {
- /**
- * Gets the effective base permissions of this list
- *
- */
- get: function () {
- return new queryable_1.Queryable(this, "EffectiveBasePermissions");
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(List.prototype, "eventReceivers", {
- /**
- * Gets the event receivers attached to this list
- *
- */
- get: function () {
- return new queryable_1.QueryableCollection(this, "EventReceivers");
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(List.prototype, "relatedFields", {
- /**
- * Gets the related fields of this list
- *
- */
- get: function () {
- return new queryable_1.Queryable(this, "getRelatedFields");
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(List.prototype, "informationRightsManagementSettings", {
- /**
- * Gets the IRM settings for this list
- *
- */
- get: function () {
- return new queryable_1.Queryable(this, "InformationRightsManagementSettings");
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(List.prototype, "subscriptions", {
- /**
- * Gets the webhook subscriptions of this list
- *
- */
- get: function () {
- return new subscriptions_1.Subscriptions(this);
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(List.prototype, "rootFolder", {
- /**
- * The root folder of the list
- */
- get: function () {
- return new folders_1.Folder(this, "rootFolder");
- },
- enumerable: true,
- configurable: true
- });
- /**
- * Gets a view by view guid id
- *
- */
- List.prototype.getView = function (viewId) {
- return new views_1.View(this, "getView('" + viewId + "')");
- };
- /**
- * Updates this list intance with the supplied properties
- *
- * @param properties A plain object hash of values to update for the list
- * @param eTag Value used in the IF-Match header, by default "*"
- */
- /* tslint:disable no-string-literal */
- List.prototype.update = function (properties, eTag) {
- var _this = this;
- if (eTag === void 0) { eTag = "*"; }
- var postBody = JSON.stringify(util_1.Util.extend({
- "__metadata": { "type": "SP.List" },
- }, properties));
- return this.post({
- body: postBody,
- headers: {
- "IF-Match": eTag,
- "X-HTTP-Method": "MERGE",
- },
- }).then(function (data) {
- var retList = _this;
- if (properties.hasOwnProperty("Title")) {
- retList = _this.getParent(List, _this.parentUrl, "getByTitle('" + properties["Title"] + "')");
- }
- return {
- data: data,
- list: retList,
- };
- });
- };
- /* tslint:enable */
- /**
- * Delete this list
- *
- * @param eTag Value used in the IF-Match header, by default "*"
- */
- List.prototype.delete = function (eTag) {
- if (eTag === void 0) { eTag = "*"; }
- return this.post({
- headers: {
- "IF-Match": eTag,
- "X-HTTP-Method": "DELETE",
- },
- });
- };
- /**
- * Returns the collection of changes from the change log that have occurred within the list, based on the specified query.
- */
- List.prototype.getChanges = function (query) {
- return this.clone(List, "getchanges", true).post({
- body: JSON.stringify({ "query": util_1.Util.extend({ "__metadata": { "type": "SP.ChangeQuery" } }, query) }),
- });
- };
- /**
- * Returns a collection of items from the list based on the specified query.
- *
- * @param CamlQuery The Query schema of Collaborative Application Markup
- * Language (CAML) is used in various ways within the context of Microsoft SharePoint Foundation
- * to define queries against list data.
- * see:
- *
- * https://msdn.microsoft.com/en-us/library/office/ms467521.aspx
- *
- * @param expands A URI with a $expand System Query Option indicates that Entries associated with
- * the Entry or Collection of Entries identified by the Resource Path
- * section of the URI must be represented inline (i.e. eagerly loaded).
- * see:
- *
- * https://msdn.microsoft.com/en-us/library/office/fp142385.aspx
- *
- * http://www.odata.org/documentation/odata-version-2-0/uri-conventions/#ExpandSystemQueryOption
- */
- List.prototype.getItemsByCAMLQuery = function (query) {
- var expands = [];
- for (var _i = 1; _i < arguments.length; _i++) {
- expands[_i - 1] = arguments[_i];
- }
- var q = this.clone(List, "getitems", true);
- return q.expand.apply(q, expands).post({
- body: JSON.stringify({ "query": util_1.Util.extend({ "__metadata": { "type": "SP.CamlQuery" } }, query) }),
- });
- };
- /**
- * See: https://msdn.microsoft.com/en-us/library/office/dn292554.aspx
- */
- List.prototype.getListItemChangesSinceToken = function (query) {
- return this.clone(List, "getlistitemchangessincetoken", true).post({
- body: JSON.stringify({ "query": util_1.Util.extend({ "__metadata": { "type": "SP.ChangeLogItemQuery" } }, query) }),
- }, { parse: function (r) { return r.text(); } });
- };
- /**
- * Moves the list to the Recycle Bin and returns the identifier of the new Recycle Bin item.
- */
- List.prototype.recycle = function () {
- return this.clone(List, "recycle", true).post().then(function (data) {
- if (data.hasOwnProperty("Recycle")) {
- return data.Recycle;
- }
- else {
- return data;
- }
- });
- };
- /**
- * Renders list data based on the view xml provided
- */
- List.prototype.renderListData = function (viewXml) {
- var q = this.clone(List, "renderlistdata(@viewXml)");
- q.query.add("@viewXml", "'" + viewXml + "'");
- return q.post().then(function (data) {
- // data will be a string, so we parse it again
- data = JSON.parse(data);
- if (data.hasOwnProperty("RenderListData")) {
- return data.RenderListData;
- }
- else {
- return data;
- }
- });
- };
- /**
- * Gets the field values and field schema attributes for a list item.
- */
- List.prototype.renderListFormData = function (itemId, formId, mode) {
- return this.clone(List, "renderlistformdata(itemid=" + itemId + ", formid='" + formId + "', mode='" + mode + "')", true).post().then(function (data) {
- // data will be a string, so we parse it again
- data = JSON.parse(data);
- if (data.hasOwnProperty("ListData")) {
- return data.ListData;
- }
- else {
- return data;
- }
- });
- };
- /**
- * Reserves a list item ID for idempotent list item creation.
- */
- List.prototype.reserveListItemId = function () {
- return this.clone(List, "reservelistitemid", true).post().then(function (data) {
- if (data.hasOwnProperty("ReserveListItemId")) {
- return data.ReserveListItemId;
- }
- else {
- return data;
- }
- });
- };
- /**
- * Returns the ListItemEntityTypeFullName for this list, used when adding/updating list items. Does not support batching.
- *
- */
- List.prototype.getListItemEntityTypeFullName = function () {
- return this.clone(List, null).select("ListItemEntityTypeFullName").getAs().then(function (o) { return o.ListItemEntityTypeFullName; });
- };
- return List;
- }(queryablesecurable_1.QueryableSecurable));
- exports.List = List;
- /***/ }),
- /* 12 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var __extends = (this && this.__extends) || (function () {
- var extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- Object.defineProperty(exports, "__esModule", { value: true });
- var util_1 = __webpack_require__(0);
- var webs_1 = __webpack_require__(7);
- var odata_1 = __webpack_require__(2);
- var queryable_1 = __webpack_require__(1);
- var queryablesecurable_1 = __webpack_require__(26);
- var types_1 = __webpack_require__(13);
- /**
- * Internal helper class used to augment classes to include sharing functionality
- */
- var QueryableShareable = (function (_super) {
- __extends(QueryableShareable, _super);
- function QueryableShareable() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- /**
- * Gets a sharing link for the supplied
- *
- * @param kind The kind of link to share
- * @param expiration The optional expiration for this link
- */
- QueryableShareable.prototype.getShareLink = function (kind, expiration) {
- if (expiration === void 0) { expiration = null; }
- // date needs to be an ISO string or null
- var expString = expiration !== null ? expiration.toISOString() : null;
- // clone using the factory and send the request
- return this.clone(QueryableShareable, "shareLink", true).postAs({
- body: JSON.stringify({
- request: {
- createLink: true,
- emailData: null,
- settings: {
- expiration: expString,
- linkKind: kind,
- },
- },
- }),
- });
- };
- /**
- * Shares this instance with the supplied users
- *
- * @param loginNames Resolved login names to share
- * @param role The role
- * @param requireSignin True to require the user is authenticated, otherwise false
- * @param propagateAcl True to apply this share to all children
- * @param emailData If supplied an email will be sent with the indicated properties
- */
- QueryableShareable.prototype.shareWith = function (loginNames, role, requireSignin, propagateAcl, emailData) {
- var _this = this;
- if (requireSignin === void 0) { requireSignin = true; }
- if (propagateAcl === void 0) { propagateAcl = false; }
- // handle the multiple input types
- if (!Array.isArray(loginNames)) {
- loginNames = [loginNames];
- }
- var userStr = JSON.stringify(loginNames.map(function (login) { return { Key: login }; }));
- var roleFilter = role === types_1.SharingRole.Edit ? types_1.RoleType.Contributor : types_1.RoleType.Reader;
- // start by looking up the role definition id we need to set the roleValue
- return webs_1.Web.fromUrl(this.toUrl()).roleDefinitions.select("Id").filter("RoleTypeKind eq " + roleFilter).get().then(function (def) {
- if (!Array.isArray(def) || def.length < 1) {
- throw new Error("Could not locate a role defintion with RoleTypeKind " + roleFilter);
- }
- var postBody = {
- includeAnonymousLinkInEmail: requireSignin,
- peoplePickerInput: userStr,
- propagateAcl: propagateAcl,
- roleValue: "role:" + def[0].Id,
- useSimplifiedRoles: true,
- };
- if (typeof emailData !== "undefined") {
- postBody = util_1.Util.extend(postBody, {
- emailBody: emailData.body,
- emailSubject: typeof emailData.subject !== "undefined" ? "" : emailData.subject,
- sendEmail: true,
- });
- }
- return _this.clone(QueryableShareable, "shareObject", true).postAs({
- body: JSON.stringify(postBody),
- });
- });
- };
- /**
- * Shares an object based on the supplied options
- *
- * @param options The set of options to send to the ShareObject method
- * @param bypass If true any processing is skipped and the options are sent directly to the ShareObject method
- */
- QueryableShareable.prototype.shareObject = function (options, bypass) {
- var _this = this;
- if (bypass === void 0) { bypass = false; }
- if (bypass) {
- // if the bypass flag is set send the supplied parameters directly to the service
- return this.sendShareObjectRequest(options);
- }
- // extend our options with some defaults
- options = util_1.Util.extend(options, {
- group: null,
- includeAnonymousLinkInEmail: false,
- propagateAcl: false,
- useSimplifiedRoles: true,
- }, true);
- return this.getRoleValue(options.role, options.group).then(function (roleValue) {
- // handle the multiple input types
- if (!Array.isArray(options.loginNames)) {
- options.loginNames = [options.loginNames];
- }
- var userStr = JSON.stringify(options.loginNames.map(function (login) { return { Key: login }; }));
- var postBody = {
- peoplePickerInput: userStr,
- roleValue: roleValue,
- url: options.url,
- };
- if (typeof options.emailData !== "undefined" && options.emailData !== null) {
- postBody = util_1.Util.extend(postBody, {
- emailBody: options.emailData.body,
- emailSubject: typeof options.emailData.subject !== "undefined" ? "Shared for you." : options.emailData.subject,
- sendEmail: true,
- });
- }
- return _this.sendShareObjectRequest(postBody);
- });
- };
- /**
- * Calls the web's UnshareObject method
- *
- * @param url The url of the object to unshare
- */
- QueryableShareable.prototype.unshareObjectWeb = function (url) {
- return this.clone(QueryableShareable, "unshareObject", true).postAs({
- body: JSON.stringify({
- url: url,
- }),
- });
- };
- /**
- * Checks Permissions on the list of Users and returns back role the users have on the Item.
- *
- * @param recipients The array of Entities for which Permissions need to be checked.
- */
- QueryableShareable.prototype.checkPermissions = function (recipients) {
- return this.clone(QueryableShareable, "checkPermissions", true).postAs({
- body: JSON.stringify({
- recipients: recipients,
- }),
- });
- };
- /**
- * Get Sharing Information.
- *
- * @param request The SharingInformationRequest Object.
- */
- QueryableShareable.prototype.getSharingInformation = function (request) {
- if (request === void 0) { request = null; }
- return this.clone(QueryableShareable, "getSharingInformation", true).postAs({
- body: JSON.stringify({
- request: request,
- }),
- });
- };
- /**
- * Gets the sharing settings of an item.
- *
- * @param useSimplifiedRoles Determines whether to use simplified roles.
- */
- QueryableShareable.prototype.getObjectSharingSettings = function (useSimplifiedRoles) {
- if (useSimplifiedRoles === void 0) { useSimplifiedRoles = true; }
- return this.clone(QueryableShareable, "getObjectSharingSettings", true).postAs({
- body: JSON.stringify({
- useSimplifiedRoles: useSimplifiedRoles,
- }),
- });
- };
- /**
- * Unshares this object
- */
- QueryableShareable.prototype.unshareObject = function () {
- return this.clone(QueryableShareable, "unshareObject", true).postAs();
- };
- /**
- * Deletes a link by type
- *
- * @param kind Deletes a sharing link by the kind of link
- */
- QueryableShareable.prototype.deleteLinkByKind = function (kind) {
- return this.clone(QueryableShareable, "deleteLinkByKind", true).post({
- body: JSON.stringify({ linkKind: kind }),
- });
- };
- /**
- * Removes the specified link to the item.
- *
- * @param kind The kind of link to be deleted.
- * @param shareId
- */
- QueryableShareable.prototype.unshareLink = function (kind, shareId) {
- if (shareId === void 0) { shareId = "00000000-0000-0000-0000-000000000000"; }
- return this.clone(QueryableShareable, "unshareLink", true).post({
- body: JSON.stringify({ linkKind: kind, shareId: shareId }),
- });
- };
- /**
- * Calculates the roleValue string used in the sharing query
- *
- * @param role The Sharing Role
- * @param group The Group type
- */
- QueryableShareable.prototype.getRoleValue = function (role, group) {
- // we will give group precedence, because we had to make a choice
- if (typeof group !== "undefined" && group !== null) {
- switch (group) {
- case types_1.RoleType.Contributor:
- return webs_1.Web.fromUrl(this.toUrl()).associatedMemberGroup.select("Id").getAs().then(function (g) { return "group: " + g.Id; });
- case types_1.RoleType.Reader:
- case types_1.RoleType.Guest:
- return webs_1.Web.fromUrl(this.toUrl()).associatedVisitorGroup.select("Id").getAs().then(function (g) { return "group: " + g.Id; });
- default:
- throw new Error("Could not determine role value for supplied value. Contributor, Reader, and Guest are supported");
- }
- }
- else {
- var roleFilter = role === types_1.SharingRole.Edit ? types_1.RoleType.Contributor : types_1.RoleType.Reader;
- return webs_1.Web.fromUrl(this.toUrl()).roleDefinitions.select("Id").top(1).filter("RoleTypeKind eq " + roleFilter).getAs().then(function (def) {
- if (def.length < 1) {
- throw new Error("Could not locate associated role definition for supplied role. Edit and View are supported");
- }
- return "role: " + def[0].Id;
- });
- }
- };
- QueryableShareable.prototype.getShareObjectWeb = function (candidate) {
- return Promise.resolve(webs_1.Web.fromUrl(candidate, "/_api/SP.Web.ShareObject"));
- };
- QueryableShareable.prototype.sendShareObjectRequest = function (options) {
- return this.getShareObjectWeb(this.toUrl()).then(function (web) {
- return web.expand("UsersWithAccessRequests", "GroupsSharedWith").as(QueryableShareable).post({
- body: JSON.stringify(options),
- });
- });
- };
- return QueryableShareable;
- }(queryable_1.Queryable));
- exports.QueryableShareable = QueryableShareable;
- var QueryableShareableWeb = (function (_super) {
- __extends(QueryableShareableWeb, _super);
- function QueryableShareableWeb() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- /**
- * Shares this web with the supplied users
- * @param loginNames The resolved login names to share
- * @param role The role to share this web
- * @param emailData Optional email data
- */
- QueryableShareableWeb.prototype.shareWith = function (loginNames, role, emailData) {
- var _this = this;
- if (role === void 0) { role = types_1.SharingRole.View; }
- var dependency = this.addBatchDependency();
- return webs_1.Web.fromUrl(this.toUrl(), "/_api/web/url").get().then(function (url) {
- dependency();
- return _this.shareObject(util_1.Util.combinePaths(url, "/_layouts/15/aclinv.aspx?forSharing=1&mbypass=1"), loginNames, role, emailData);
- });
- };
- /**
- * Provides direct access to the static web.ShareObject method
- *
- * @param url The url to share
- * @param loginNames Resolved loginnames string[] of a single login name string
- * @param roleValue Role value
- * @param emailData Optional email data
- * @param groupId Optional group id
- * @param propagateAcl
- * @param includeAnonymousLinkInEmail
- * @param useSimplifiedRoles
- */
- QueryableShareableWeb.prototype.shareObject = function (url, loginNames, role, emailData, group, propagateAcl, includeAnonymousLinkInEmail, useSimplifiedRoles) {
- if (propagateAcl === void 0) { propagateAcl = false; }
- if (includeAnonymousLinkInEmail === void 0) { includeAnonymousLinkInEmail = false; }
- if (useSimplifiedRoles === void 0) { useSimplifiedRoles = true; }
- return this.clone(QueryableShareable, null, true).shareObject({
- emailData: emailData,
- group: group,
- includeAnonymousLinkInEmail: includeAnonymousLinkInEmail,
- loginNames: loginNames,
- propagateAcl: propagateAcl,
- role: role,
- url: url,
- useSimplifiedRoles: useSimplifiedRoles,
- });
- };
- /**
- * Supplies a method to pass any set of arguments to ShareObject
- *
- * @param options The set of options to send to ShareObject
- */
- QueryableShareableWeb.prototype.shareObjectRaw = function (options) {
- return this.clone(QueryableShareable, null, true).shareObject(options, true);
- };
- /**
- * Unshares the object
- *
- * @param url The url of the object to stop sharing
- */
- QueryableShareableWeb.prototype.unshareObject = function (url) {
- return this.clone(QueryableShareable, null, true).unshareObjectWeb(url);
- };
- return QueryableShareableWeb;
- }(queryablesecurable_1.QueryableSecurable));
- exports.QueryableShareableWeb = QueryableShareableWeb;
- var QueryableShareableItem = (function (_super) {
- __extends(QueryableShareableItem, _super);
- function QueryableShareableItem() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- /**
- * Gets a link suitable for sharing for this item
- *
- * @param kind The type of link to share
- * @param expiration The optional expiration date
- */
- QueryableShareableItem.prototype.getShareLink = function (kind, expiration) {
- if (kind === void 0) { kind = types_1.SharingLinkKind.OrganizationView; }
- if (expiration === void 0) { expiration = null; }
- return this.clone(QueryableShareable, null, true).getShareLink(kind, expiration);
- };
- /**
- * Shares this item with one or more users
- *
- * @param loginNames string or string[] of resolved login names to which this item will be shared
- * @param role The role (View | Edit) applied to the share
- * @param emailData Optional, if inlucded an email will be sent. Note subject currently has no effect.
- */
- QueryableShareableItem.prototype.shareWith = function (loginNames, role, requireSignin, emailData) {
- if (role === void 0) { role = types_1.SharingRole.View; }
- if (requireSignin === void 0) { requireSignin = true; }
- return this.clone(QueryableShareable, null, true).shareWith(loginNames, role, requireSignin, false, emailData);
- };
- /**
- * Checks Permissions on the list of Users and returns back role the users have on the Item.
- *
- * @param recipients The array of Entities for which Permissions need to be checked.
- */
- QueryableShareableItem.prototype.checkSharingPermissions = function (recipients) {
- return this.clone(QueryableShareable, null, true).checkPermissions(recipients);
- };
- /**
- * Get Sharing Information.
- *
- * @param request The SharingInformationRequest Object.
- */
- QueryableShareableItem.prototype.getSharingInformation = function (request) {
- if (request === void 0) { request = null; }
- return this.clone(QueryableShareable, null, true).getSharingInformation(request);
- };
- /**
- * Gets the sharing settings of an item.
- *
- * @param useSimplifiedRoles Determines whether to use simplified roles.
- */
- QueryableShareableItem.prototype.getObjectSharingSettings = function (useSimplifiedRoles) {
- if (useSimplifiedRoles === void 0) { useSimplifiedRoles = true; }
- return this.clone(QueryableShareable, null, true).getObjectSharingSettings(useSimplifiedRoles);
- };
- /**
- * Unshare this item
- */
- QueryableShareableItem.prototype.unshare = function () {
- return this.clone(QueryableShareable, null, true).unshareObject();
- };
- /**
- * Deletes a sharing link by kind
- *
- * @param kind Deletes a sharing link by the kind of link
- */
- QueryableShareableItem.prototype.deleteSharingLinkByKind = function (kind) {
- return this.clone(QueryableShareable, null, true).deleteLinkByKind(kind);
- };
- /**
- * Removes the specified link to the item.
- *
- * @param kind The kind of link to be deleted.
- * @param shareId
- */
- QueryableShareableItem.prototype.unshareLink = function (kind, shareId) {
- return this.clone(QueryableShareable, null, true).unshareLink(kind, shareId);
- };
- return QueryableShareableItem;
- }(queryablesecurable_1.QueryableSecurable));
- exports.QueryableShareableItem = QueryableShareableItem;
- var FileFolderShared = (function (_super) {
- __extends(FileFolderShared, _super);
- function FileFolderShared() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- /**
- * Gets a link suitable for sharing
- *
- * @param kind The kind of link to get
- * @param expiration Optional, an expiration for this link
- */
- FileFolderShared.prototype.getShareLink = function (kind, expiration) {
- if (kind === void 0) { kind = types_1.SharingLinkKind.OrganizationView; }
- if (expiration === void 0) { expiration = null; }
- var dependency = this.addBatchDependency();
- return this.getShareable().then(function (shareable) {
- dependency();
- return shareable.getShareLink(kind, expiration);
- });
- };
- /**
- * Checks Permissions on the list of Users and returns back role the users have on the Item.
- *
- * @param recipients The array of Entities for which Permissions need to be checked.
- */
- FileFolderShared.prototype.checkSharingPermissions = function (recipients) {
- var dependency = this.addBatchDependency();
- return this.getShareable().then(function (shareable) {
- dependency();
- return shareable.checkPermissions(recipients);
- });
- };
- /**
- * Get Sharing Information.
- *
- * @param request The SharingInformationRequest Object.
- */
- FileFolderShared.prototype.getSharingInformation = function (request) {
- if (request === void 0) { request = null; }
- var dependency = this.addBatchDependency();
- return this.getShareable().then(function (shareable) {
- dependency();
- return shareable.getSharingInformation(request);
- });
- };
- /**
- * Gets the sharing settings of an item.
- *
- * @param useSimplifiedRoles Determines whether to use simplified roles.
- */
- FileFolderShared.prototype.getObjectSharingSettings = function (useSimplifiedRoles) {
- if (useSimplifiedRoles === void 0) { useSimplifiedRoles = true; }
- var dependency = this.addBatchDependency();
- return this.getShareable().then(function (shareable) {
- dependency();
- return shareable.getObjectSharingSettings(useSimplifiedRoles);
- });
- };
- /**
- * Unshare this item
- */
- FileFolderShared.prototype.unshare = function () {
- var dependency = this.addBatchDependency();
- return this.getShareable().then(function (shareable) {
- dependency();
- return shareable.unshareObject();
- });
- };
- /**
- * Deletes a sharing link by the kind of link
- *
- * @param kind The kind of link to be deleted.
- */
- FileFolderShared.prototype.deleteSharingLinkByKind = function (kind) {
- var dependency = this.addBatchDependency();
- return this.getShareable().then(function (shareable) {
- dependency();
- return shareable.deleteLinkByKind(kind);
- });
- };
- /**
- * Removes the specified link to the item.
- *
- * @param kind The kind of link to be deleted.
- * @param shareId The share id to delete
- */
- FileFolderShared.prototype.unshareLink = function (kind, shareId) {
- var dependency = this.addBatchDependency();
- return this.getShareable().then(function (shareable) {
- dependency();
- return shareable.unshareLink(kind, shareId);
- });
- };
- /**
- * For files and folders we need to use the associated item end point
- */
- FileFolderShared.prototype.getShareable = function () {
- var _this = this;
- // sharing only works on the item end point, not the file one - so we create a folder instance with the item url internally
- return this.clone(QueryableShareableFile, "listItemAllFields", false).select("odata.editlink").get().then(function (d) {
- var shareable = new QueryableShareable(odata_1.getEntityUrl(d));
- // we need to handle batching
- if (_this.hasBatch) {
- shareable = shareable.inBatch(_this.batch);
- }
- return shareable;
- });
- };
- return FileFolderShared;
- }(queryable_1.QueryableInstance));
- exports.FileFolderShared = FileFolderShared;
- var QueryableShareableFile = (function (_super) {
- __extends(QueryableShareableFile, _super);
- function QueryableShareableFile() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- /**
- * Shares this item with one or more users
- *
- * @param loginNames string or string[] of resolved login names to which this item will be shared
- * @param role The role (View | Edit) applied to the share
- * @param shareEverything Share everything in this folder, even items with unique permissions.
- * @param requireSignin If true the user must signin to view link, otherwise anyone with the link can access the resource
- * @param emailData Optional, if inlucded an email will be sent. Note subject currently has no effect.
- */
- QueryableShareableFile.prototype.shareWith = function (loginNames, role, requireSignin, emailData) {
- if (role === void 0) { role = types_1.SharingRole.View; }
- if (requireSignin === void 0) { requireSignin = true; }
- var dependency = this.addBatchDependency();
- return this.getShareable().then(function (shareable) {
- dependency();
- return shareable.shareWith(loginNames, role, requireSignin, false, emailData);
- });
- };
- return QueryableShareableFile;
- }(FileFolderShared));
- exports.QueryableShareableFile = QueryableShareableFile;
- var QueryableShareableFolder = (function (_super) {
- __extends(QueryableShareableFolder, _super);
- function QueryableShareableFolder() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- /**
- * Shares this item with one or more users
- *
- * @param loginNames string or string[] of resolved login names to which this item will be shared
- * @param role The role (View | Edit) applied to the share
- * @param shareEverything Share everything in this folder, even items with unique permissions.
- * @param requireSignin If true the user must signin to view link, otherwise anyone with the link can access the resource
- * @param emailData Optional, if inlucded an email will be sent. Note subject currently has no effect.
- */
- QueryableShareableFolder.prototype.shareWith = function (loginNames, role, requireSignin, shareEverything, emailData) {
- if (role === void 0) { role = types_1.SharingRole.View; }
- if (requireSignin === void 0) { requireSignin = true; }
- if (shareEverything === void 0) { shareEverything = false; }
- var dependency = this.addBatchDependency();
- return this.getShareable().then(function (shareable) {
- dependency();
- return shareable.shareWith(loginNames, role, requireSignin, shareEverything, emailData);
- });
- };
- return QueryableShareableFolder;
- }(FileFolderShared));
- exports.QueryableShareableFolder = QueryableShareableFolder;
- /***/ }),
- /* 13 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- // reference: https://msdn.microsoft.com/en-us/library/office/dn600183.aspx
- Object.defineProperty(exports, "__esModule", { value: true });
- /**
- * Determines the display mode of the given control or view
- */
- var ControlMode;
- (function (ControlMode) {
- ControlMode[ControlMode["Display"] = 1] = "Display";
- ControlMode[ControlMode["Edit"] = 2] = "Edit";
- ControlMode[ControlMode["New"] = 3] = "New";
- })(ControlMode = exports.ControlMode || (exports.ControlMode = {}));
- /**
- * Specifies the type of the field.
- */
- var FieldTypes;
- (function (FieldTypes) {
- FieldTypes[FieldTypes["Invalid"] = 0] = "Invalid";
- FieldTypes[FieldTypes["Integer"] = 1] = "Integer";
- FieldTypes[FieldTypes["Text"] = 2] = "Text";
- FieldTypes[FieldTypes["Note"] = 3] = "Note";
- FieldTypes[FieldTypes["DateTime"] = 4] = "DateTime";
- FieldTypes[FieldTypes["Counter"] = 5] = "Counter";
- FieldTypes[FieldTypes["Choice"] = 6] = "Choice";
- FieldTypes[FieldTypes["Lookup"] = 7] = "Lookup";
- FieldTypes[FieldTypes["Boolean"] = 8] = "Boolean";
- FieldTypes[FieldTypes["Number"] = 9] = "Number";
- FieldTypes[FieldTypes["Currency"] = 10] = "Currency";
- FieldTypes[FieldTypes["URL"] = 11] = "URL";
- FieldTypes[FieldTypes["Computed"] = 12] = "Computed";
- FieldTypes[FieldTypes["Threading"] = 13] = "Threading";
- FieldTypes[FieldTypes["Guid"] = 14] = "Guid";
- FieldTypes[FieldTypes["MultiChoice"] = 15] = "MultiChoice";
- FieldTypes[FieldTypes["GridChoice"] = 16] = "GridChoice";
- FieldTypes[FieldTypes["Calculated"] = 17] = "Calculated";
- FieldTypes[FieldTypes["File"] = 18] = "File";
- FieldTypes[FieldTypes["Attachments"] = 19] = "Attachments";
- FieldTypes[FieldTypes["User"] = 20] = "User";
- FieldTypes[FieldTypes["Recurrence"] = 21] = "Recurrence";
- FieldTypes[FieldTypes["CrossProjectLink"] = 22] = "CrossProjectLink";
- FieldTypes[FieldTypes["ModStat"] = 23] = "ModStat";
- FieldTypes[FieldTypes["Error"] = 24] = "Error";
- FieldTypes[FieldTypes["ContentTypeId"] = 25] = "ContentTypeId";
- FieldTypes[FieldTypes["PageSeparator"] = 26] = "PageSeparator";
- FieldTypes[FieldTypes["ThreadIndex"] = 27] = "ThreadIndex";
- FieldTypes[FieldTypes["WorkflowStatus"] = 28] = "WorkflowStatus";
- FieldTypes[FieldTypes["AllDayEvent"] = 29] = "AllDayEvent";
- FieldTypes[FieldTypes["WorkflowEventType"] = 30] = "WorkflowEventType";
- })(FieldTypes = exports.FieldTypes || (exports.FieldTypes = {}));
- var DateTimeFieldFormatType;
- (function (DateTimeFieldFormatType) {
- DateTimeFieldFormatType[DateTimeFieldFormatType["DateOnly"] = 0] = "DateOnly";
- DateTimeFieldFormatType[DateTimeFieldFormatType["DateTime"] = 1] = "DateTime";
- })(DateTimeFieldFormatType = exports.DateTimeFieldFormatType || (exports.DateTimeFieldFormatType = {}));
- /**
- * Specifies the control settings while adding a field.
- */
- var AddFieldOptions;
- (function (AddFieldOptions) {
- /**
- * Specify that a new field added to the list must also be added to the default content type in the site collection
- */
- AddFieldOptions[AddFieldOptions["DefaultValue"] = 0] = "DefaultValue";
- /**
- * Specify that a new field added to the list must also be added to the default content type in the site collection.
- */
- AddFieldOptions[AddFieldOptions["AddToDefaultContentType"] = 1] = "AddToDefaultContentType";
- /**
- * Specify that a new field must not be added to any other content type
- */
- AddFieldOptions[AddFieldOptions["AddToNoContentType"] = 2] = "AddToNoContentType";
- /**
- * Specify that a new field that is added to the specified list must also be added to all content types in the site collection
- */
- AddFieldOptions[AddFieldOptions["AddToAllContentTypes"] = 4] = "AddToAllContentTypes";
- /**
- * Specify adding an internal field name hint for the purpose of avoiding possible database locking or field renaming operations
- */
- AddFieldOptions[AddFieldOptions["AddFieldInternalNameHint"] = 8] = "AddFieldInternalNameHint";
- /**
- * Specify that a new field that is added to the specified list must also be added to the default list view
- */
- AddFieldOptions[AddFieldOptions["AddFieldToDefaultView"] = 16] = "AddFieldToDefaultView";
- /**
- * Specify to confirm that no other field has the same display name
- */
- AddFieldOptions[AddFieldOptions["AddFieldCheckDisplayName"] = 32] = "AddFieldCheckDisplayName";
- })(AddFieldOptions = exports.AddFieldOptions || (exports.AddFieldOptions = {}));
- var CalendarType;
- (function (CalendarType) {
- CalendarType[CalendarType["Gregorian"] = 1] = "Gregorian";
- CalendarType[CalendarType["Japan"] = 3] = "Japan";
- CalendarType[CalendarType["Taiwan"] = 4] = "Taiwan";
- CalendarType[CalendarType["Korea"] = 5] = "Korea";
- CalendarType[CalendarType["Hijri"] = 6] = "Hijri";
- CalendarType[CalendarType["Thai"] = 7] = "Thai";
- CalendarType[CalendarType["Hebrew"] = 8] = "Hebrew";
- CalendarType[CalendarType["GregorianMEFrench"] = 9] = "GregorianMEFrench";
- CalendarType[CalendarType["GregorianArabic"] = 10] = "GregorianArabic";
- CalendarType[CalendarType["GregorianXLITEnglish"] = 11] = "GregorianXLITEnglish";
- CalendarType[CalendarType["GregorianXLITFrench"] = 12] = "GregorianXLITFrench";
- CalendarType[CalendarType["KoreaJapanLunar"] = 14] = "KoreaJapanLunar";
- CalendarType[CalendarType["ChineseLunar"] = 15] = "ChineseLunar";
- CalendarType[CalendarType["SakaEra"] = 16] = "SakaEra";
- CalendarType[CalendarType["UmAlQura"] = 23] = "UmAlQura";
- })(CalendarType = exports.CalendarType || (exports.CalendarType = {}));
- var UrlFieldFormatType;
- (function (UrlFieldFormatType) {
- UrlFieldFormatType[UrlFieldFormatType["Hyperlink"] = 0] = "Hyperlink";
- UrlFieldFormatType[UrlFieldFormatType["Image"] = 1] = "Image";
- })(UrlFieldFormatType = exports.UrlFieldFormatType || (exports.UrlFieldFormatType = {}));
- var PermissionKind;
- (function (PermissionKind) {
- /**
- * Has no permissions on the Site. Not available through the user interface.
- */
- PermissionKind[PermissionKind["EmptyMask"] = 0] = "EmptyMask";
- /**
- * View items in lists, documents in document libraries, and Web discussion comments.
- */
- PermissionKind[PermissionKind["ViewListItems"] = 1] = "ViewListItems";
- /**
- * Add items to lists, documents to document libraries, and Web discussion comments.
- */
- PermissionKind[PermissionKind["AddListItems"] = 2] = "AddListItems";
- /**
- * Edit items in lists, edit documents in document libraries, edit Web discussion comments
- * in documents, and customize Web Part Pages in document libraries.
- */
- PermissionKind[PermissionKind["EditListItems"] = 3] = "EditListItems";
- /**
- * Delete items from a list, documents from a document library, and Web discussion
- * comments in documents.
- */
- PermissionKind[PermissionKind["DeleteListItems"] = 4] = "DeleteListItems";
- /**
- * Approve a minor version of a list item or document.
- */
- PermissionKind[PermissionKind["ApproveItems"] = 5] = "ApproveItems";
- /**
- * View the source of documents with server-side file handlers.
- */
- PermissionKind[PermissionKind["OpenItems"] = 6] = "OpenItems";
- /**
- * View past versions of a list item or document.
- */
- PermissionKind[PermissionKind["ViewVersions"] = 7] = "ViewVersions";
- /**
- * Delete past versions of a list item or document.
- */
- PermissionKind[PermissionKind["DeleteVersions"] = 8] = "DeleteVersions";
- /**
- * Discard or check in a document which is checked out to another user.
- */
- PermissionKind[PermissionKind["CancelCheckout"] = 9] = "CancelCheckout";
- /**
- * Create, change, and delete personal views of lists.
- */
- PermissionKind[PermissionKind["ManagePersonalViews"] = 10] = "ManagePersonalViews";
- /**
- * Create and delete lists, add or remove columns in a list, and add or remove public views of a list.
- */
- PermissionKind[PermissionKind["ManageLists"] = 12] = "ManageLists";
- /**
- * View forms, views, and application pages, and enumerate lists.
- */
- PermissionKind[PermissionKind["ViewFormPages"] = 13] = "ViewFormPages";
- /**
- * Make content of a list or document library retrieveable for anonymous users through SharePoint search.
- * The list permissions in the site do not change.
- */
- PermissionKind[PermissionKind["AnonymousSearchAccessList"] = 14] = "AnonymousSearchAccessList";
- /**
- * Allow users to open a Site, list, or folder to access items inside that container.
- */
- PermissionKind[PermissionKind["Open"] = 17] = "Open";
- /**
- * View pages in a Site.
- */
- PermissionKind[PermissionKind["ViewPages"] = 18] = "ViewPages";
- /**
- * Add, change, or delete HTML pages or Web Part Pages, and edit the Site using
- * a Windows SharePoint Services compatible editor.
- */
- PermissionKind[PermissionKind["AddAndCustomizePages"] = 19] = "AddAndCustomizePages";
- /**
- * Apply a theme or borders to the entire Site.
- */
- PermissionKind[PermissionKind["ApplyThemeAndBorder"] = 20] = "ApplyThemeAndBorder";
- /**
- * Apply a style sheet (.css file) to the Site.
- */
- PermissionKind[PermissionKind["ApplyStyleSheets"] = 21] = "ApplyStyleSheets";
- /**
- * View reports on Site usage.
- */
- PermissionKind[PermissionKind["ViewUsageData"] = 22] = "ViewUsageData";
- /**
- * Create a Site using Self-Service Site Creation.
- */
- PermissionKind[PermissionKind["CreateSSCSite"] = 23] = "CreateSSCSite";
- /**
- * Create subsites such as team sites, Meeting Workspace sites, and Document Workspace sites.
- */
- PermissionKind[PermissionKind["ManageSubwebs"] = 24] = "ManageSubwebs";
- /**
- * Create a group of users that can be used anywhere within the site collection.
- */
- PermissionKind[PermissionKind["CreateGroups"] = 25] = "CreateGroups";
- /**
- * Create and change permission levels on the Site and assign permissions to users
- * and groups.
- */
- PermissionKind[PermissionKind["ManagePermissions"] = 26] = "ManagePermissions";
- /**
- * Enumerate files and folders in a Site using Microsoft Office SharePoint Designer
- * and WebDAV interfaces.
- */
- PermissionKind[PermissionKind["BrowseDirectories"] = 27] = "BrowseDirectories";
- /**
- * View information about users of the Site.
- */
- PermissionKind[PermissionKind["BrowseUserInfo"] = 28] = "BrowseUserInfo";
- /**
- * Add or remove personal Web Parts on a Web Part Page.
- */
- PermissionKind[PermissionKind["AddDelPrivateWebParts"] = 29] = "AddDelPrivateWebParts";
- /**
- * Update Web Parts to display personalized information.
- */
- PermissionKind[PermissionKind["UpdatePersonalWebParts"] = 30] = "UpdatePersonalWebParts";
- /**
- * Grant the ability to perform all administration tasks for the Site as well as
- * manage content, activate, deactivate, or edit properties of Site scoped Features
- * through the object model or through the user interface (UI). When granted on the
- * root Site of a Site Collection, activate, deactivate, or edit properties of
- * site collection scoped Features through the object model. To browse to the Site
- * Collection Features page and activate or deactivate Site Collection scoped Features
- * through the UI, you must be a Site Collection administrator.
- */
- PermissionKind[PermissionKind["ManageWeb"] = 31] = "ManageWeb";
- /**
- * Content of lists and document libraries in the Web site will be retrieveable for anonymous users through
- * SharePoint search if the list or document library has AnonymousSearchAccessList set.
- */
- PermissionKind[PermissionKind["AnonymousSearchAccessWebLists"] = 32] = "AnonymousSearchAccessWebLists";
- /**
- * Use features that launch client applications. Otherwise, users must work on documents
- * locally and upload changes.
- */
- PermissionKind[PermissionKind["UseClientIntegration"] = 37] = "UseClientIntegration";
- /**
- * Use SOAP, WebDAV, or Microsoft Office SharePoint Designer interfaces to access the Site.
- */
- PermissionKind[PermissionKind["UseRemoteAPIs"] = 38] = "UseRemoteAPIs";
- /**
- * Manage alerts for all users of the Site.
- */
- PermissionKind[PermissionKind["ManageAlerts"] = 39] = "ManageAlerts";
- /**
- * Create e-mail alerts.
- */
- PermissionKind[PermissionKind["CreateAlerts"] = 40] = "CreateAlerts";
- /**
- * Allows a user to change his or her user information, such as adding a picture.
- */
- PermissionKind[PermissionKind["EditMyUserInfo"] = 41] = "EditMyUserInfo";
- /**
- * Enumerate permissions on Site, list, folder, document, or list item.
- */
- PermissionKind[PermissionKind["EnumeratePermissions"] = 63] = "EnumeratePermissions";
- /**
- * Has all permissions on the Site. Not available through the user interface.
- */
- PermissionKind[PermissionKind["FullMask"] = 65] = "FullMask";
- })(PermissionKind = exports.PermissionKind || (exports.PermissionKind = {}));
- var PrincipalType;
- (function (PrincipalType) {
- PrincipalType[PrincipalType["None"] = 0] = "None";
- PrincipalType[PrincipalType["User"] = 1] = "User";
- PrincipalType[PrincipalType["DistributionList"] = 2] = "DistributionList";
- PrincipalType[PrincipalType["SecurityGroup"] = 4] = "SecurityGroup";
- PrincipalType[PrincipalType["SharePointGroup"] = 8] = "SharePointGroup";
- PrincipalType[PrincipalType["All"] = 15] = "All";
- })(PrincipalType = exports.PrincipalType || (exports.PrincipalType = {}));
- var RoleType;
- (function (RoleType) {
- RoleType[RoleType["None"] = 0] = "None";
- RoleType[RoleType["Guest"] = 1] = "Guest";
- RoleType[RoleType["Reader"] = 2] = "Reader";
- RoleType[RoleType["Contributor"] = 3] = "Contributor";
- RoleType[RoleType["WebDesigner"] = 4] = "WebDesigner";
- RoleType[RoleType["Administrator"] = 5] = "Administrator";
- })(RoleType = exports.RoleType || (exports.RoleType = {}));
- var PageType;
- (function (PageType) {
- PageType[PageType["Invalid"] = -1] = "Invalid";
- PageType[PageType["DefaultView"] = 0] = "DefaultView";
- PageType[PageType["NormalView"] = 1] = "NormalView";
- PageType[PageType["DialogView"] = 2] = "DialogView";
- PageType[PageType["View"] = 3] = "View";
- PageType[PageType["DisplayForm"] = 4] = "DisplayForm";
- PageType[PageType["DisplayFormDialog"] = 5] = "DisplayFormDialog";
- PageType[PageType["EditForm"] = 6] = "EditForm";
- PageType[PageType["EditFormDialog"] = 7] = "EditFormDialog";
- PageType[PageType["NewForm"] = 8] = "NewForm";
- PageType[PageType["NewFormDialog"] = 9] = "NewFormDialog";
- PageType[PageType["SolutionForm"] = 10] = "SolutionForm";
- PageType[PageType["PAGE_MAXITEMS"] = 11] = "PAGE_MAXITEMS";
- })(PageType = exports.PageType || (exports.PageType = {}));
- var SharingLinkKind;
- (function (SharingLinkKind) {
- /**
- * Uninitialized link
- */
- SharingLinkKind[SharingLinkKind["Uninitialized"] = 0] = "Uninitialized";
- /**
- * Direct link to the object being shared
- */
- SharingLinkKind[SharingLinkKind["Direct"] = 1] = "Direct";
- /**
- * Organization-shareable link to the object being shared with view permissions
- */
- SharingLinkKind[SharingLinkKind["OrganizationView"] = 2] = "OrganizationView";
- /**
- * Organization-shareable link to the object being shared with edit permissions
- */
- SharingLinkKind[SharingLinkKind["OrganizationEdit"] = 3] = "OrganizationEdit";
- /**
- * View only anonymous link
- */
- SharingLinkKind[SharingLinkKind["AnonymousView"] = 4] = "AnonymousView";
- /**
- * Read/Write anonymous link
- */
- SharingLinkKind[SharingLinkKind["AnonymousEdit"] = 5] = "AnonymousEdit";
- /**
- * Flexible sharing Link where properties can change without affecting link URL
- */
- SharingLinkKind[SharingLinkKind["Flexible"] = 6] = "Flexible";
- })(SharingLinkKind = exports.SharingLinkKind || (exports.SharingLinkKind = {}));
- ;
- /**
- * Indicates the role of the sharing link
- */
- var SharingRole;
- (function (SharingRole) {
- SharingRole[SharingRole["None"] = 0] = "None";
- SharingRole[SharingRole["View"] = 1] = "View";
- SharingRole[SharingRole["Edit"] = 2] = "Edit";
- SharingRole[SharingRole["Owner"] = 3] = "Owner";
- })(SharingRole = exports.SharingRole || (exports.SharingRole = {}));
- var SharingOperationStatusCode;
- (function (SharingOperationStatusCode) {
- /**
- * The share operation completed without errors.
- */
- SharingOperationStatusCode[SharingOperationStatusCode["CompletedSuccessfully"] = 0] = "CompletedSuccessfully";
- /**
- * The share operation completed and generated requests for access.
- */
- SharingOperationStatusCode[SharingOperationStatusCode["AccessRequestsQueued"] = 1] = "AccessRequestsQueued";
- /**
- * The share operation failed as there were no resolved users.
- */
- SharingOperationStatusCode[SharingOperationStatusCode["NoResolvedUsers"] = -1] = "NoResolvedUsers";
- /**
- * The share operation failed due to insufficient permissions.
- */
- SharingOperationStatusCode[SharingOperationStatusCode["AccessDenied"] = -2] = "AccessDenied";
- /**
- * The share operation failed when attempting a cross site share, which is not supported.
- */
- SharingOperationStatusCode[SharingOperationStatusCode["CrossSiteRequestNotSupported"] = -3] = "CrossSiteRequestNotSupported";
- /**
- * The sharing operation failed due to an unknown error.
- */
- SharingOperationStatusCode[SharingOperationStatusCode["UnknowError"] = -4] = "UnknowError";
- /**
- * The text you typed is too long. Please shorten it.
- */
- SharingOperationStatusCode[SharingOperationStatusCode["EmailBodyTooLong"] = -5] = "EmailBodyTooLong";
- /**
- * The maximum number of unique scopes in the list has been exceeded.
- */
- SharingOperationStatusCode[SharingOperationStatusCode["ListUniqueScopesExceeded"] = -6] = "ListUniqueScopesExceeded";
- /**
- * The share operation failed because a sharing capability is disabled in the site.
- */
- SharingOperationStatusCode[SharingOperationStatusCode["CapabilityDisabled"] = -7] = "CapabilityDisabled";
- /**
- * The specified object for the share operation is not supported.
- */
- SharingOperationStatusCode[SharingOperationStatusCode["ObjectNotSupported"] = -8] = "ObjectNotSupported";
- /**
- * A SharePoint group cannot contain another SharePoint group.
- */
- SharingOperationStatusCode[SharingOperationStatusCode["NestedGroupsNotSupported"] = -9] = "NestedGroupsNotSupported";
- })(SharingOperationStatusCode = exports.SharingOperationStatusCode || (exports.SharingOperationStatusCode = {}));
- var SPSharedObjectType;
- (function (SPSharedObjectType) {
- SPSharedObjectType[SPSharedObjectType["Unknown"] = 0] = "Unknown";
- SPSharedObjectType[SPSharedObjectType["File"] = 1] = "File";
- SPSharedObjectType[SPSharedObjectType["Folder"] = 2] = "Folder";
- SPSharedObjectType[SPSharedObjectType["Item"] = 3] = "Item";
- SPSharedObjectType[SPSharedObjectType["List"] = 4] = "List";
- SPSharedObjectType[SPSharedObjectType["Web"] = 5] = "Web";
- SPSharedObjectType[SPSharedObjectType["Max"] = 6] = "Max";
- })(SPSharedObjectType = exports.SPSharedObjectType || (exports.SPSharedObjectType = {}));
- var SharingDomainRestrictionMode;
- (function (SharingDomainRestrictionMode) {
- SharingDomainRestrictionMode[SharingDomainRestrictionMode["None"] = 0] = "None";
- SharingDomainRestrictionMode[SharingDomainRestrictionMode["AllowList"] = 1] = "AllowList";
- SharingDomainRestrictionMode[SharingDomainRestrictionMode["BlockList"] = 2] = "BlockList";
- })(SharingDomainRestrictionMode = exports.SharingDomainRestrictionMode || (exports.SharingDomainRestrictionMode = {}));
- ;
- /***/ }),
- /* 14 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var util_1 = __webpack_require__(0);
- var collections_1 = __webpack_require__(6);
- var pnplibconfig_1 = __webpack_require__(4);
- /**
- * A wrapper class to provide a consistent interface to browser based storage
- *
- */
- var PnPClientStorageWrapper = (function () {
- /**
- * Creates a new instance of the PnPClientStorageWrapper class
- *
- * @constructor
- */
- function PnPClientStorageWrapper(store, defaultTimeoutMinutes) {
- this.store = store;
- this.defaultTimeoutMinutes = defaultTimeoutMinutes;
- this.defaultTimeoutMinutes = (defaultTimeoutMinutes === void 0) ? -1 : defaultTimeoutMinutes;
- this.enabled = this.test();
- }
- /**
- * Get a value from storage, or null if that value does not exist
- *
- * @param key The key whose value we want to retrieve
- */
- PnPClientStorageWrapper.prototype.get = function (key) {
- if (!this.enabled) {
- return null;
- }
- var o = this.store.getItem(key);
- if (o == null) {
- return null;
- }
- var persistable = JSON.parse(o);
- if (new Date(persistable.expiration) <= new Date()) {
- this.delete(key);
- return null;
- }
- else {
- return persistable.value;
- }
- };
- /**
- * Adds a value to the underlying storage
- *
- * @param key The key to use when storing the provided value
- * @param o The value to store
- * @param expire Optional, if provided the expiration of the item, otherwise the default is used
- */
- PnPClientStorageWrapper.prototype.put = function (key, o, expire) {
- if (this.enabled) {
- this.store.setItem(key, this.createPersistable(o, expire));
- }
- };
- /**
- * Deletes a value from the underlying storage
- *
- * @param key The key of the pair we want to remove from storage
- */
- PnPClientStorageWrapper.prototype.delete = function (key) {
- if (this.enabled) {
- this.store.removeItem(key);
- }
- };
- /**
- * Gets an item from the underlying storage, or adds it if it does not exist using the supplied getter function
- *
- * @param key The key to use when storing the provided value
- * @param getter A function which will upon execution provide the desired value
- * @param expire Optional, if provided the expiration of the item, otherwise the default is used
- */
- PnPClientStorageWrapper.prototype.getOrPut = function (key, getter, expire) {
- var _this = this;
- if (!this.enabled) {
- return getter();
- }
- return new Promise(function (resolve) {
- var o = _this.get(key);
- if (o == null) {
- getter().then(function (d) {
- _this.put(key, d, expire);
- resolve(d);
- });
- }
- else {
- resolve(o);
- }
- });
- };
- /**
- * Used to determine if the wrapped storage is available currently
- */
- PnPClientStorageWrapper.prototype.test = function () {
- var str = "test";
- try {
- this.store.setItem(str, str);
- this.store.removeItem(str);
- return true;
- }
- catch (e) {
- return false;
- }
- };
- /**
- * Creates the persistable to store
- */
- PnPClientStorageWrapper.prototype.createPersistable = function (o, expire) {
- if (typeof expire === "undefined") {
- // ensure we are by default inline with the global library setting
- var defaultTimeout = pnplibconfig_1.RuntimeConfig.defaultCachingTimeoutSeconds;
- if (this.defaultTimeoutMinutes > 0) {
- defaultTimeout = this.defaultTimeoutMinutes * 60;
- }
- expire = util_1.Util.dateAdd(new Date(), "second", defaultTimeout);
- }
- return JSON.stringify({ expiration: expire, value: o });
- };
- return PnPClientStorageWrapper;
- }());
- exports.PnPClientStorageWrapper = PnPClientStorageWrapper;
- /**
- * A thin implementation of in-memory storage for use in nodejs
- */
- var MemoryStorage = (function () {
- function MemoryStorage(_store) {
- if (_store === void 0) { _store = new collections_1.Dictionary(); }
- this._store = _store;
- }
- Object.defineProperty(MemoryStorage.prototype, "length", {
- get: function () {
- return this._store.count();
- },
- enumerable: true,
- configurable: true
- });
- MemoryStorage.prototype.clear = function () {
- this._store.clear();
- };
- MemoryStorage.prototype.getItem = function (key) {
- return this._store.get(key);
- };
- MemoryStorage.prototype.key = function (index) {
- return this._store.getKeys()[index];
- };
- MemoryStorage.prototype.removeItem = function (key) {
- this._store.remove(key);
- };
- MemoryStorage.prototype.setItem = function (key, data) {
- this._store.add(key, data);
- };
- return MemoryStorage;
- }());
- /**
- * A class that will establish wrappers for both local and session storage
- */
- var PnPClientStorage = (function () {
- /**
- * Creates a new instance of the PnPClientStorage class
- *
- * @constructor
- */
- function PnPClientStorage() {
- this.local = typeof localStorage !== "undefined" ? new PnPClientStorageWrapper(localStorage) : new PnPClientStorageWrapper(new MemoryStorage());
- this.session = typeof sessionStorage !== "undefined" ? new PnPClientStorageWrapper(sessionStorage) : new PnPClientStorageWrapper(new MemoryStorage());
- }
- return PnPClientStorage;
- }());
- exports.PnPClientStorage = PnPClientStorage;
- /***/ }),
- /* 15 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var digestcache_1 = __webpack_require__(38);
- var util_1 = __webpack_require__(0);
- var pnplibconfig_1 = __webpack_require__(4);
- var exceptions_1 = __webpack_require__(3);
- var HttpClient = (function () {
- function HttpClient() {
- this._impl = pnplibconfig_1.RuntimeConfig.fetchClientFactory();
- this._digestCache = new digestcache_1.DigestCache(this);
- }
- HttpClient.prototype.fetch = function (url, options) {
- var _this = this;
- if (options === void 0) { options = {}; }
- var opts = util_1.Util.extend(options, { cache: "no-cache", credentials: "same-origin" }, true);
- var headers = new Headers();
- // first we add the global headers so they can be overwritten by any passed in locally to this call
- this.mergeHeaders(headers, pnplibconfig_1.RuntimeConfig.headers);
- // second we add the local options so we can overwrite the globals
- this.mergeHeaders(headers, options.headers);
- // lastly we apply any default headers we need that may not exist
- if (!headers.has("Accept")) {
- headers.append("Accept", "application/json");
- }
- if (!headers.has("Content-Type")) {
- headers.append("Content-Type", "application/json;odata=verbose;charset=utf-8");
- }
- if (!headers.has("X-ClientService-ClientTag")) {
- headers.append("X-ClientService-ClientTag", "PnPCoreJS:2.0.3");
- }
- opts = util_1.Util.extend(opts, { headers: headers });
- if (opts.method && opts.method.toUpperCase() !== "GET") {
- if (!headers.has("X-RequestDigest")) {
- var index = url.indexOf("_api/");
- if (index < 0) {
- throw new exceptions_1.APIUrlException();
- }
- var webUrl = url.substr(0, index);
- return this._digestCache.getDigest(webUrl)
- .then(function (digest) {
- headers.append("X-RequestDigest", digest);
- return _this.fetchRaw(url, opts);
- });
- }
- }
- return this.fetchRaw(url, opts);
- };
- HttpClient.prototype.fetchRaw = function (url, options) {
- var _this = this;
- if (options === void 0) { options = {}; }
- // here we need to normalize the headers
- var rawHeaders = new Headers();
- this.mergeHeaders(rawHeaders, options.headers);
- options = util_1.Util.extend(options, { headers: rawHeaders });
- var retry = function (ctx) {
- _this._impl.fetch(url, options).then(function (response) { return ctx.resolve(response); }).catch(function (response) {
- // grab our current delay
- var delay = ctx.delay;
- // Check if request was throttled - http status code 429
- // Check is request failed due to server unavailable - http status code 503
- if (response.status !== 429 && response.status !== 503) {
- ctx.reject(response);
- }
- // Increment our counters.
- ctx.delay *= 2;
- ctx.attempts++;
- // If we have exceeded the retry count, reject.
- if (ctx.retryCount <= ctx.attempts) {
- ctx.reject(response);
- }
- // Set our retry timeout for {delay} milliseconds.
- setTimeout(util_1.Util.getCtxCallback(_this, retry, ctx), delay);
- });
- };
- return new Promise(function (resolve, reject) {
- var retryContext = {
- attempts: 0,
- delay: 100,
- reject: reject,
- resolve: resolve,
- retryCount: 7,
- };
- retry.call(_this, retryContext);
- });
- };
- HttpClient.prototype.get = function (url, options) {
- if (options === void 0) { options = {}; }
- var opts = util_1.Util.extend(options, { method: "GET" });
- return this.fetch(url, opts);
- };
- HttpClient.prototype.post = function (url, options) {
- if (options === void 0) { options = {}; }
- var opts = util_1.Util.extend(options, { method: "POST" });
- return this.fetch(url, opts);
- };
- HttpClient.prototype.patch = function (url, options) {
- if (options === void 0) { options = {}; }
- var opts = util_1.Util.extend(options, { method: "PATCH" });
- return this.fetch(url, opts);
- };
- HttpClient.prototype.delete = function (url, options) {
- if (options === void 0) { options = {}; }
- var opts = util_1.Util.extend(options, { method: "DELETE" });
- return this.fetch(url, opts);
- };
- HttpClient.prototype.mergeHeaders = function (target, source) {
- if (typeof source !== "undefined" && source !== null) {
- var temp = new Request("", { headers: source });
- temp.headers.forEach(function (value, name) {
- target.append(name, value);
- });
- }
- };
- return HttpClient;
- }());
- exports.HttpClient = HttpClient;
- ;
- /***/ }),
- /* 16 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var __extends = (this && this.__extends) || (function () {
- var extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- Object.defineProperty(exports, "__esModule", { value: true });
- var util_1 = __webpack_require__(0);
- var queryable_1 = __webpack_require__(1);
- /**
- * Describes a collection of content types
- *
- */
- var ContentTypes = (function (_super) {
- __extends(ContentTypes, _super);
- /**
- * Creates a new instance of the ContentTypes class
- *
- * @param baseUrl The url or Queryable which forms the parent of this content types collection
- */
- function ContentTypes(baseUrl, path) {
- if (path === void 0) { path = "contenttypes"; }
- return _super.call(this, baseUrl, path) || this;
- }
- /**
- * Gets a ContentType by content type id
- */
- ContentTypes.prototype.getById = function (id) {
- var ct = new ContentType(this);
- ct.concat("('" + id + "')");
- return ct;
- };
- /**
- * Adds an existing contenttype to a content type collection
- *
- * @param contentTypeId in the following format, for example: 0x010102
- */
- ContentTypes.prototype.addAvailableContentType = function (contentTypeId) {
- var _this = this;
- var postBody = JSON.stringify({
- "contentTypeId": contentTypeId,
- });
- return this.clone(ContentTypes, "addAvailableContentType", true).postAs({ body: postBody }).then(function (data) {
- return {
- contentType: _this.getById(data.id),
- data: data,
- };
- });
- };
- /**
- * Adds a new content type to the collection
- *
- * @param id The desired content type id for the new content type (also determines the parent content type)
- * @param name The name of the content type
- * @param description The description of the content type
- * @param group The group in which to add the content type
- * @param additionalSettings Any additional settings to provide when creating the content type
- *
- */
- ContentTypes.prototype.add = function (id, name, description, group, additionalSettings) {
- var _this = this;
- if (description === void 0) { description = ""; }
- if (group === void 0) { group = "Custom Content Types"; }
- if (additionalSettings === void 0) { additionalSettings = {}; }
- var postBody = JSON.stringify(util_1.Util.extend({
- "Description": description,
- "Group": group,
- "Id": { "StringValue": id },
- "Name": name,
- "__metadata": { "type": "SP.ContentType" },
- }, additionalSettings));
- return this.post({ body: postBody }).then(function (data) {
- return { contentType: _this.getById(data.id), data: data };
- });
- };
- return ContentTypes;
- }(queryable_1.QueryableCollection));
- exports.ContentTypes = ContentTypes;
- /**
- * Describes a single ContentType instance
- *
- */
- var ContentType = (function (_super) {
- __extends(ContentType, _super);
- function ContentType() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- Object.defineProperty(ContentType.prototype, "fieldLinks", {
- /**
- * Gets the column (also known as field) references in the content type.
- */
- get: function () {
- return new FieldLinks(this);
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(ContentType.prototype, "fields", {
- /**
- * Gets a value that specifies the collection of fields for the content type.
- */
- get: function () {
- return new queryable_1.QueryableCollection(this, "fields");
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(ContentType.prototype, "parent", {
- /**
- * Gets the parent content type of the content type.
- */
- get: function () {
- return new ContentType(this, "parent");
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(ContentType.prototype, "workflowAssociations", {
- /**
- * Gets a value that specifies the collection of workflow associations for the content type.
- */
- get: function () {
- return new queryable_1.QueryableCollection(this, "workflowAssociations");
- },
- enumerable: true,
- configurable: true
- });
- /**
- * Delete this content type
- */
- ContentType.prototype.delete = function () {
- return this.post({
- headers: {
- "X-HTTP-Method": "DELETE",
- },
- });
- };
- return ContentType;
- }(queryable_1.QueryableInstance));
- exports.ContentType = ContentType;
- /**
- * Represents a collection of field link instances
- */
- var FieldLinks = (function (_super) {
- __extends(FieldLinks, _super);
- /**
- * Creates a new instance of the ContentType class
- *
- * @param baseUrl The url or Queryable which forms the parent of this content type instance
- */
- function FieldLinks(baseUrl, path) {
- if (path === void 0) { path = "fieldlinks"; }
- return _super.call(this, baseUrl, path) || this;
- }
- /**
- * Gets a FieldLink by GUID id
- *
- * @param id The GUID id of the field link
- */
- FieldLinks.prototype.getById = function (id) {
- var fl = new FieldLink(this);
- fl.concat("(guid'" + id + "')");
- return fl;
- };
- return FieldLinks;
- }(queryable_1.QueryableCollection));
- exports.FieldLinks = FieldLinks;
- /**
- * Represents a field link instance
- */
- var FieldLink = (function (_super) {
- __extends(FieldLink, _super);
- function FieldLink() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- return FieldLink;
- }(queryable_1.QueryableInstance));
- exports.FieldLink = FieldLink;
- /***/ }),
- /* 17 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var __extends = (this && this.__extends) || (function () {
- var extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- Object.defineProperty(exports, "__esModule", { value: true });
- var queryable_1 = __webpack_require__(1);
- var sitegroups_1 = __webpack_require__(18);
- var util_1 = __webpack_require__(0);
- /**
- * Describes a set of role assignments for the current scope
- *
- */
- var RoleAssignments = (function (_super) {
- __extends(RoleAssignments, _super);
- /**
- * Creates a new instance of the RoleAssignments class
- *
- * @param baseUrl The url or Queryable which forms the parent of this fields collection
- */
- function RoleAssignments(baseUrl, path) {
- if (path === void 0) { path = "roleassignments"; }
- return _super.call(this, baseUrl, path) || this;
- }
- /**
- * Adds a new role assignment with the specified principal and role definitions to the collection.
- *
- * @param principalId The ID of the user or group to assign permissions to
- * @param roleDefId The ID of the role definition that defines the permissions to assign
- *
- */
- RoleAssignments.prototype.add = function (principalId, roleDefId) {
- return this.clone(RoleAssignments, "addroleassignment(principalid=" + principalId + ", roledefid=" + roleDefId + ")", true).post();
- };
- /**
- * Removes the role assignment with the specified principal and role definition from the collection
- *
- * @param principalId The ID of the user or group in the role assignment.
- * @param roleDefId The ID of the role definition in the role assignment
- *
- */
- RoleAssignments.prototype.remove = function (principalId, roleDefId) {
- return this.clone(RoleAssignments, "removeroleassignment(principalid=" + principalId + ", roledefid=" + roleDefId + ")", true).post();
- };
- /**
- * Gets the role assignment associated with the specified principal ID from the collection.
- *
- * @param id The id of the role assignment
- */
- RoleAssignments.prototype.getById = function (id) {
- var ra = new RoleAssignment(this);
- ra.concat("(" + id + ")");
- return ra;
- };
- return RoleAssignments;
- }(queryable_1.QueryableCollection));
- exports.RoleAssignments = RoleAssignments;
- var RoleAssignment = (function (_super) {
- __extends(RoleAssignment, _super);
- function RoleAssignment() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- Object.defineProperty(RoleAssignment.prototype, "groups", {
- get: function () {
- return new sitegroups_1.SiteGroups(this, "groups");
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(RoleAssignment.prototype, "bindings", {
- /**
- * Get the role definition bindings for this role assignment
- *
- */
- get: function () {
- return new RoleDefinitionBindings(this);
- },
- enumerable: true,
- configurable: true
- });
- /**
- * Delete this role assignment
- *
- */
- RoleAssignment.prototype.delete = function () {
- return this.post({
- headers: {
- "X-HTTP-Method": "DELETE",
- },
- });
- };
- return RoleAssignment;
- }(queryable_1.QueryableInstance));
- exports.RoleAssignment = RoleAssignment;
- var RoleDefinitions = (function (_super) {
- __extends(RoleDefinitions, _super);
- /**
- * Creates a new instance of the RoleDefinitions class
- *
- * @param baseUrl The url or Queryable which forms the parent of this fields collection
- * @param path
- *
- */
- function RoleDefinitions(baseUrl, path) {
- if (path === void 0) { path = "roledefinitions"; }
- return _super.call(this, baseUrl, path) || this;
- }
- /**
- * Gets the role definition with the specified ID from the collection.
- *
- * @param id The ID of the role definition.
- *
- */
- RoleDefinitions.prototype.getById = function (id) {
- return new RoleDefinition(this, "getById(" + id + ")");
- };
- /**
- * Gets the role definition with the specified name.
- *
- * @param name The name of the role definition.
- *
- */
- RoleDefinitions.prototype.getByName = function (name) {
- return new RoleDefinition(this, "getbyname('" + name + "')");
- };
- /**
- * Gets the role definition with the specified type.
- *
- * @param name The name of the role definition.
- *
- */
- RoleDefinitions.prototype.getByType = function (roleTypeKind) {
- return new RoleDefinition(this, "getbytype(" + roleTypeKind + ")");
- };
- /**
- * Create a role definition
- *
- * @param name The new role definition's name
- * @param description The new role definition's description
- * @param order The order in which the role definition appears
- * @param basePermissions The permissions mask for this role definition
- *
- */
- RoleDefinitions.prototype.add = function (name, description, order, basePermissions) {
- var _this = this;
- var postBody = JSON.stringify({
- BasePermissions: util_1.Util.extend({ __metadata: { type: "SP.BasePermissions" } }, basePermissions),
- Description: description,
- Name: name,
- Order: order,
- __metadata: { "type": "SP.RoleDefinition" },
- });
- return this.post({ body: postBody }).then(function (data) {
- return {
- data: data,
- definition: _this.getById(data.Id),
- };
- });
- };
- return RoleDefinitions;
- }(queryable_1.QueryableCollection));
- exports.RoleDefinitions = RoleDefinitions;
- var RoleDefinition = (function (_super) {
- __extends(RoleDefinition, _super);
- function RoleDefinition() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- /**
- * Updates this web intance with the supplied properties
- *
- * @param properties A plain object hash of values to update for the web
- */
- /* tslint:disable no-string-literal */
- RoleDefinition.prototype.update = function (properties) {
- var _this = this;
- if (typeof properties.hasOwnProperty("BasePermissions") !== "undefined") {
- properties["BasePermissions"] = util_1.Util.extend({ __metadata: { type: "SP.BasePermissions" } }, properties["BasePermissions"]);
- }
- var postBody = JSON.stringify(util_1.Util.extend({
- "__metadata": { "type": "SP.RoleDefinition" },
- }, properties));
- return this.post({
- body: postBody,
- headers: {
- "X-HTTP-Method": "MERGE",
- },
- }).then(function (data) {
- var retDef = _this;
- if (properties.hasOwnProperty("Name")) {
- var parent_1 = _this.getParent(RoleDefinitions, _this.parentUrl, "");
- retDef = parent_1.getByName(properties["Name"]);
- }
- return {
- data: data,
- definition: retDef,
- };
- });
- };
- /* tslint:enable */
- /**
- * Delete this role definition
- *
- */
- RoleDefinition.prototype.delete = function () {
- return this.post({
- headers: {
- "X-HTTP-Method": "DELETE",
- },
- });
- };
- return RoleDefinition;
- }(queryable_1.QueryableInstance));
- exports.RoleDefinition = RoleDefinition;
- var RoleDefinitionBindings = (function (_super) {
- __extends(RoleDefinitionBindings, _super);
- function RoleDefinitionBindings(baseUrl, path) {
- if (path === void 0) { path = "roledefinitionbindings"; }
- return _super.call(this, baseUrl, path) || this;
- }
- return RoleDefinitionBindings;
- }(queryable_1.QueryableCollection));
- exports.RoleDefinitionBindings = RoleDefinitionBindings;
- /***/ }),
- /* 18 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var __extends = (this && this.__extends) || (function () {
- var extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- Object.defineProperty(exports, "__esModule", { value: true });
- var queryable_1 = __webpack_require__(1);
- var siteusers_1 = __webpack_require__(30);
- var util_1 = __webpack_require__(0);
- /**
- * Principal Type enum
- *
- */
- var PrincipalType;
- (function (PrincipalType) {
- PrincipalType[PrincipalType["None"] = 0] = "None";
- PrincipalType[PrincipalType["User"] = 1] = "User";
- PrincipalType[PrincipalType["DistributionList"] = 2] = "DistributionList";
- PrincipalType[PrincipalType["SecurityGroup"] = 4] = "SecurityGroup";
- PrincipalType[PrincipalType["SharePointGroup"] = 8] = "SharePointGroup";
- PrincipalType[PrincipalType["All"] = 15] = "All";
- })(PrincipalType = exports.PrincipalType || (exports.PrincipalType = {}));
- /**
- * Describes a collection of site users
- *
- */
- var SiteGroups = (function (_super) {
- __extends(SiteGroups, _super);
- /**
- * Creates a new instance of the SiteUsers class
- *
- * @param baseUrl The url or Queryable which forms the parent of this user collection
- */
- function SiteGroups(baseUrl, path) {
- if (path === void 0) { path = "sitegroups"; }
- return _super.call(this, baseUrl, path) || this;
- }
- /**
- * Adds a new group to the site collection
- *
- * @param props The properties to be updated
- */
- SiteGroups.prototype.add = function (properties) {
- var _this = this;
- var postBody = JSON.stringify(util_1.Util.extend({ "__metadata": { "type": "SP.Group" } }, properties));
- return this.post({ body: postBody }).then(function (data) {
- return {
- data: data,
- group: _this.getById(data.Id),
- };
- });
- };
- /**
- * Gets a group from the collection by name
- *
- * @param email The name of the group
- */
- SiteGroups.prototype.getByName = function (groupName) {
- return new SiteGroup(this, "getByName('" + groupName + "')");
- };
- /**
- * Gets a group from the collection by id
- *
- * @param id The id of the group
- */
- SiteGroups.prototype.getById = function (id) {
- var sg = new SiteGroup(this);
- sg.concat("(" + id + ")");
- return sg;
- };
- /**
- * Removes the group with the specified member ID from the collection.
- *
- * @param id The id of the group to remove
- */
- SiteGroups.prototype.removeById = function (id) {
- return this.clone(SiteGroups, "removeById('" + id + "')", true).post();
- };
- /**
- * Removes a user from the collection by login name
- *
- * @param loginName The login name of the user
- */
- SiteGroups.prototype.removeByLoginName = function (loginName) {
- return this.clone(SiteGroups, "removeByLoginName('" + loginName + "')", true).post();
- };
- return SiteGroups;
- }(queryable_1.QueryableCollection));
- exports.SiteGroups = SiteGroups;
- /**
- * Describes a single group
- *
- */
- var SiteGroup = (function (_super) {
- __extends(SiteGroup, _super);
- function SiteGroup() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- Object.defineProperty(SiteGroup.prototype, "users", {
- /**
- * Get's the users for this group
- *
- */
- get: function () {
- return new siteusers_1.SiteUsers(this, "users");
- },
- enumerable: true,
- configurable: true
- });
- /**
- * Updates this group instance with the supplied properties
- *
- * @param properties A GroupWriteableProperties object of property names and values to update for the user
- */
- /* tslint:disable no-string-literal */
- SiteGroup.prototype.update = function (properties) {
- var _this = this;
- var postBody = util_1.Util.extend({ "__metadata": { "type": "SP.Group" } }, properties);
- return this.post({
- body: JSON.stringify(postBody),
- headers: {
- "X-HTTP-Method": "MERGE",
- },
- }).then(function (data) {
- var retGroup = _this;
- if (properties.hasOwnProperty("Title")) {
- retGroup = _this.getParent(SiteGroup, _this.parentUrl, "getByName('" + properties["Title"] + "')");
- }
- return {
- data: data,
- group: retGroup,
- };
- });
- };
- return SiteGroup;
- }(queryable_1.QueryableInstance));
- exports.SiteGroup = SiteGroup;
- /***/ }),
- /* 19 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var __extends = (this && this.__extends) || (function () {
- var extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- Object.defineProperty(exports, "__esModule", { value: true });
- var queryable_1 = __webpack_require__(1);
- var util_1 = __webpack_require__(0);
- var UserCustomActions = (function (_super) {
- __extends(UserCustomActions, _super);
- function UserCustomActions(baseUrl, path) {
- if (path === void 0) { path = "usercustomactions"; }
- return _super.call(this, baseUrl, path) || this;
- }
- /**
- * Returns the custom action with the specified identifier.
- *
- * @param id The GUID ID of the user custom action to get.
- */
- UserCustomActions.prototype.getById = function (id) {
- var uca = new UserCustomAction(this);
- uca.concat("('" + id + "')");
- return uca;
- };
- /**
- * Create a custom action
- *
- * @param creationInfo The information which defines the new custom action
- *
- */
- UserCustomActions.prototype.add = function (properties) {
- var _this = this;
- var postBody = JSON.stringify(util_1.Util.extend({ __metadata: { "type": "SP.UserCustomAction" } }, properties));
- return this.post({ body: postBody }).then(function (data) {
- return {
- action: _this.getById(data.Id),
- data: data,
- };
- });
- };
- /**
- * Deletes all custom actions in the collection.
- *
- */
- UserCustomActions.prototype.clear = function () {
- return this.clone(UserCustomActions, "clear", true).post();
- };
- return UserCustomActions;
- }(queryable_1.QueryableCollection));
- exports.UserCustomActions = UserCustomActions;
- var UserCustomAction = (function (_super) {
- __extends(UserCustomAction, _super);
- function UserCustomAction() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- UserCustomAction.prototype.update = function (properties) {
- var _this = this;
- var postBody = JSON.stringify(util_1.Util.extend({
- "__metadata": { "type": "SP.UserCustomAction" },
- }, properties));
- return this.post({
- body: postBody,
- headers: {
- "X-HTTP-Method": "MERGE",
- },
- }).then(function (data) {
- return {
- action: _this,
- data: data,
- };
- });
- };
- /**
- * Remove a custom action
- *
- */
- UserCustomAction.prototype.delete = function () {
- return _super.prototype.delete.call(this);
- };
- return UserCustomAction;
- }(queryable_1.QueryableInstance));
- exports.UserCustomAction = UserCustomAction;
- /***/ }),
- /* 20 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var storage = __webpack_require__(14);
- var exceptions_1 = __webpack_require__(3);
- /**
- * A caching provider which can wrap other non-caching providers
- *
- */
- var CachingConfigurationProvider = (function () {
- /**
- * Creates a new caching configuration provider
- * @constructor
- * @param {IConfigurationProvider} wrappedProvider Provider which will be used to fetch the configuration
- * @param {string} cacheKey Key that will be used to store cached items to the cache
- * @param {IPnPClientStore} cacheStore OPTIONAL storage, which will be used to store cached settings.
- */
- function CachingConfigurationProvider(wrappedProvider, cacheKey, cacheStore) {
- this.wrappedProvider = wrappedProvider;
- this.store = (cacheStore) ? cacheStore : this.selectPnPCache();
- this.cacheKey = "_configcache_" + cacheKey;
- }
- /**
- * Gets the wrapped configuration providers
- *
- * @return {IConfigurationProvider} Wrapped configuration provider
- */
- CachingConfigurationProvider.prototype.getWrappedProvider = function () {
- return this.wrappedProvider;
- };
- /**
- * Loads the configuration values either from the cache or from the wrapped provider
- *
- * @return {Promise<TypedHash<string>>} Promise of loaded configuration values
- */
- CachingConfigurationProvider.prototype.getConfiguration = function () {
- var _this = this;
- // Cache not available, pass control to the wrapped provider
- if ((!this.store) || (!this.store.enabled)) {
- return this.wrappedProvider.getConfiguration();
- }
- // Value is found in cache, return it directly
- var cachedConfig = this.store.get(this.cacheKey);
- if (cachedConfig) {
- return new Promise(function (resolve) {
- resolve(cachedConfig);
- });
- }
- // Get and cache value from the wrapped provider
- var providerPromise = this.wrappedProvider.getConfiguration();
- providerPromise.then(function (providedConfig) {
- _this.store.put(_this.cacheKey, providedConfig);
- });
- return providerPromise;
- };
- CachingConfigurationProvider.prototype.selectPnPCache = function () {
- var pnpCache = new storage.PnPClientStorage();
- if ((pnpCache.local) && (pnpCache.local.enabled)) {
- return pnpCache.local;
- }
- if ((pnpCache.session) && (pnpCache.session.enabled)) {
- return pnpCache.session;
- }
- throw new exceptions_1.NoCacheAvailableException();
- };
- return CachingConfigurationProvider;
- }());
- exports.default = CachingConfigurationProvider;
- /***/ }),
- /* 21 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- /* WEBPACK VAR INJECTION */(function(global) {
- Object.defineProperty(exports, "__esModule", { value: true });
- /**
- * Makes requests using the fetch API
- */
- var FetchClient = (function () {
- function FetchClient() {
- }
- FetchClient.prototype.fetch = function (url, options) {
- return global.fetch(url, options);
- };
- return FetchClient;
- }());
- exports.FetchClient = FetchClient;
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(32)))
- /***/ }),
- /* 22 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var storage_1 = __webpack_require__(14);
- var util_1 = __webpack_require__(0);
- var pnplibconfig_1 = __webpack_require__(4);
- var CachingOptions = (function () {
- function CachingOptions(key) {
- this.key = key;
- this.expiration = util_1.Util.dateAdd(new Date(), "second", pnplibconfig_1.RuntimeConfig.defaultCachingTimeoutSeconds);
- this.storeName = pnplibconfig_1.RuntimeConfig.defaultCachingStore;
- }
- Object.defineProperty(CachingOptions.prototype, "store", {
- get: function () {
- if (this.storeName === "local") {
- return CachingOptions.storage.local;
- }
- else {
- return CachingOptions.storage.session;
- }
- },
- enumerable: true,
- configurable: true
- });
- return CachingOptions;
- }());
- CachingOptions.storage = new storage_1.PnPClientStorage();
- exports.CachingOptions = CachingOptions;
- var CachingParserWrapper = (function () {
- function CachingParserWrapper(_parser, _cacheOptions) {
- this._parser = _parser;
- this._cacheOptions = _cacheOptions;
- }
- CachingParserWrapper.prototype.parse = function (response) {
- var _this = this;
- // add this to the cache based on the options
- return this._parser.parse(response).then(function (data) {
- if (_this._cacheOptions.store !== null) {
- _this._cacheOptions.store.put(_this._cacheOptions.key, data, _this._cacheOptions.expiration);
- }
- return data;
- });
- };
- return CachingParserWrapper;
- }());
- exports.CachingParserWrapper = CachingParserWrapper;
- /***/ }),
- /* 23 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var __extends = (this && this.__extends) || (function () {
- var extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- Object.defineProperty(exports, "__esModule", { value: true });
- var queryable_1 = __webpack_require__(1);
- /**
- * Describes a collection of List objects
- *
- */
- var Features = (function (_super) {
- __extends(Features, _super);
- /**
- * Creates a new instance of the Lists class
- *
- * @param baseUrl The url or Queryable which forms the parent of this fields collection
- */
- function Features(baseUrl, path) {
- if (path === void 0) { path = "features"; }
- return _super.call(this, baseUrl, path) || this;
- }
- /**
- * Gets a list from the collection by guid id
- *
- * @param id The Id of the feature (GUID)
- */
- Features.prototype.getById = function (id) {
- var feature = new Feature(this);
- feature.concat("('" + id + "')");
- return feature;
- };
- /**
- * Adds a new list to the collection
- *
- * @param id The Id of the feature (GUID)
- * @param force If true the feature activation will be forced
- */
- Features.prototype.add = function (id, force) {
- var _this = this;
- if (force === void 0) { force = false; }
- return this.clone(Features, "add", true).post({
- body: JSON.stringify({
- featdefScope: 0,
- featureId: id,
- force: force,
- }),
- }).then(function (data) {
- return {
- data: data,
- feature: _this.getById(id),
- };
- });
- };
- /**
- * Removes (deactivates) a feature from the collection
- *
- * @param id The Id of the feature (GUID)
- * @param force If true the feature deactivation will be forced
- */
- Features.prototype.remove = function (id, force) {
- if (force === void 0) { force = false; }
- return this.clone(Features, "remove", true).post({
- body: JSON.stringify({
- featureId: id,
- force: force,
- }),
- });
- };
- return Features;
- }(queryable_1.QueryableCollection));
- exports.Features = Features;
- var Feature = (function (_super) {
- __extends(Feature, _super);
- function Feature() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- /**
- * Removes (deactivates) a feature from the collection
- *
- * @param force If true the feature deactivation will be forced
- */
- Feature.prototype.deactivate = function (force) {
- var _this = this;
- if (force === void 0) { force = false; }
- var removeDependency = this.addBatchDependency();
- var idGet = new Feature(this).select("DefinitionId");
- return idGet.getAs().then(function (feature) {
- var promise = _this.getParent(Features, _this.parentUrl, "", _this.batch).remove(feature.DefinitionId, force);
- removeDependency();
- return promise;
- });
- };
- return Feature;
- }(queryable_1.QueryableInstance));
- exports.Feature = Feature;
- /***/ }),
- /* 24 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var __extends = (this && this.__extends) || (function () {
- var extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- Object.defineProperty(exports, "__esModule", { value: true });
- var queryable_1 = __webpack_require__(1);
- var util_1 = __webpack_require__(0);
- var types_1 = __webpack_require__(13);
- /**
- * Describes a collection of Field objects
- *
- */
- var Fields = (function (_super) {
- __extends(Fields, _super);
- /**
- * Creates a new instance of the Fields class
- *
- * @param baseUrl The url or Queryable which forms the parent of this fields collection
- */
- function Fields(baseUrl, path) {
- if (path === void 0) { path = "fields"; }
- return _super.call(this, baseUrl, path) || this;
- }
- /**
- * Gets a field from the collection by title
- *
- * @param title The case-sensitive title of the field
- */
- Fields.prototype.getByTitle = function (title) {
- return new Field(this, "getByTitle('" + title + "')");
- };
- /**
- * Gets a field from the collection by using internal name or title
- *
- * @param name The case-sensitive internal name or title of the field
- */
- Fields.prototype.getByInternalNameOrTitle = function (name) {
- return new Field(this, "getByInternalNameOrTitle('" + name + "')");
- };
- /**
- * Gets a list from the collection by guid id
- *
- * @param title The Id of the list
- */
- Fields.prototype.getById = function (id) {
- var f = new Field(this);
- f.concat("('" + id + "')");
- return f;
- };
- /**
- * Creates a field based on the specified schema
- */
- Fields.prototype.createFieldAsXml = function (xml) {
- var _this = this;
- var info;
- if (typeof xml === "string") {
- info = { SchemaXml: xml };
- }
- else {
- info = xml;
- }
- var postBody = JSON.stringify({
- "parameters": util_1.Util.extend({
- "__metadata": {
- "type": "SP.XmlSchemaFieldCreationInformation",
- },
- }, info),
- });
- return this.clone(Fields, "createfieldasxml", true).postAs({ body: postBody }).then(function (data) {
- return {
- data: data,
- field: _this.getById(data.Id),
- };
- });
- };
- /**
- * Adds a new list to the collection
- *
- * @param title The new field's title
- * @param fieldType The new field's type (ex: SP.FieldText)
- * @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx)
- */
- Fields.prototype.add = function (title, fieldType, properties) {
- var _this = this;
- if (properties === void 0) { properties = {}; }
- var postBody = JSON.stringify(util_1.Util.extend({
- "Title": title,
- "__metadata": { "type": fieldType },
- }, properties));
- return this.clone(Fields, null, true).postAs({ body: postBody }).then(function (data) {
- return {
- data: data,
- field: _this.getById(data.Id),
- };
- });
- };
- /**
- * Adds a new SP.FieldText to the collection
- *
- * @param title The field title
- * @param maxLength The maximum number of characters allowed in the value of the field.
- * @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx)
- */
- Fields.prototype.addText = function (title, maxLength, properties) {
- if (maxLength === void 0) { maxLength = 255; }
- var props = {
- FieldTypeKind: 2,
- MaxLength: maxLength,
- };
- return this.add(title, "SP.FieldText", util_1.Util.extend(props, properties));
- };
- /**
- * Adds a new SP.FieldCalculated to the collection
- *
- * @param title The field title.
- * @param formula The formula for the field.
- * @param dateFormat The date and time format that is displayed in the field.
- * @param outputType Specifies the output format for the field. Represents a FieldType value.
- * @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx)
- */
- Fields.prototype.addCalculated = function (title, formula, dateFormat, outputType, properties) {
- if (outputType === void 0) { outputType = types_1.FieldTypes.Text; }
- var props = {
- DateFormat: dateFormat,
- FieldTypeKind: 17,
- Formula: formula,
- OutputType: outputType,
- };
- return this.add(title, "SP.FieldCalculated", util_1.Util.extend(props, properties));
- };
- /**
- * Adds a new SP.FieldDateTime to the collection
- *
- * @param title The field title
- * @param displayFormat The format of the date and time that is displayed in the field.
- * @param calendarType Specifies the calendar type of the field.
- * @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx)
- */
- Fields.prototype.addDateTime = function (title, displayFormat, calendarType, friendlyDisplayFormat, properties) {
- if (displayFormat === void 0) { displayFormat = types_1.DateTimeFieldFormatType.DateOnly; }
- if (calendarType === void 0) { calendarType = types_1.CalendarType.Gregorian; }
- if (friendlyDisplayFormat === void 0) { friendlyDisplayFormat = 0; }
- var props = {
- DateTimeCalendarType: calendarType,
- DisplayFormat: displayFormat,
- FieldTypeKind: 4,
- FriendlyDisplayFormat: friendlyDisplayFormat,
- };
- return this.add(title, "SP.FieldDateTime", util_1.Util.extend(props, properties));
- };
- /**
- * Adds a new SP.FieldNumber to the collection
- *
- * @param title The field title
- * @param minValue The field's minimum value
- * @param maxValue The field's maximum value
- * @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx)
- */
- Fields.prototype.addNumber = function (title, minValue, maxValue, properties) {
- var props = { FieldTypeKind: 9 };
- if (typeof minValue !== "undefined") {
- props = util_1.Util.extend({ MinimumValue: minValue }, props);
- }
- if (typeof maxValue !== "undefined") {
- props = util_1.Util.extend({ MaximumValue: maxValue }, props);
- }
- return this.add(title, "SP.FieldNumber", util_1.Util.extend(props, properties));
- };
- /**
- * Adds a new SP.FieldCurrency to the collection
- *
- * @param title The field title
- * @param minValue The field's minimum value
- * @param maxValue The field's maximum value
- * @param currencyLocalId Specifies the language code identifier (LCID) used to format the value of the field
- * @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx)
- */
- Fields.prototype.addCurrency = function (title, minValue, maxValue, currencyLocalId, properties) {
- if (currencyLocalId === void 0) { currencyLocalId = 1033; }
- var props = {
- CurrencyLocaleId: currencyLocalId,
- FieldTypeKind: 10,
- };
- if (typeof minValue !== "undefined") {
- props = util_1.Util.extend({ MinimumValue: minValue }, props);
- }
- if (typeof maxValue !== "undefined") {
- props = util_1.Util.extend({ MaximumValue: maxValue }, props);
- }
- return this.add(title, "SP.FieldCurrency", util_1.Util.extend(props, properties));
- };
- /**
- * Adds a new SP.FieldMultiLineText to the collection
- *
- * @param title The field title
- * @param numberOfLines Specifies the number of lines of text to display for the field.
- * @param richText Specifies whether the field supports rich formatting.
- * @param restrictedMode Specifies whether the field supports a subset of rich formatting.
- * @param appendOnly Specifies whether all changes to the value of the field are displayed in list forms.
- * @param allowHyperlink Specifies whether a hyperlink is allowed as a value of the field.
- * @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx)
- *
- */
- Fields.prototype.addMultilineText = function (title, numberOfLines, richText, restrictedMode, appendOnly, allowHyperlink, properties) {
- if (numberOfLines === void 0) { numberOfLines = 6; }
- if (richText === void 0) { richText = true; }
- if (restrictedMode === void 0) { restrictedMode = false; }
- if (appendOnly === void 0) { appendOnly = false; }
- if (allowHyperlink === void 0) { allowHyperlink = true; }
- var props = {
- AllowHyperlink: allowHyperlink,
- AppendOnly: appendOnly,
- FieldTypeKind: 3,
- NumberOfLines: numberOfLines,
- RestrictedMode: restrictedMode,
- RichText: richText,
- };
- return this.add(title, "SP.FieldMultiLineText", util_1.Util.extend(props, properties));
- };
- /**
- * Adds a new SP.FieldUrl to the collection
- *
- * @param title The field title
- */
- Fields.prototype.addUrl = function (title, displayFormat, properties) {
- if (displayFormat === void 0) { displayFormat = types_1.UrlFieldFormatType.Hyperlink; }
- var props = {
- DisplayFormat: displayFormat,
- FieldTypeKind: 11,
- };
- return this.add(title, "SP.FieldUrl", util_1.Util.extend(props, properties));
- };
- return Fields;
- }(queryable_1.QueryableCollection));
- exports.Fields = Fields;
- /**
- * Describes a single of Field instance
- *
- */
- var Field = (function (_super) {
- __extends(Field, _super);
- function Field() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- /**
- * Updates this field intance with the supplied properties
- *
- * @param properties A plain object hash of values to update for the list
- * @param fieldType The type value, required to update child field type properties
- */
- Field.prototype.update = function (properties, fieldType) {
- var _this = this;
- if (fieldType === void 0) { fieldType = "SP.Field"; }
- var postBody = JSON.stringify(util_1.Util.extend({
- "__metadata": { "type": fieldType },
- }, properties));
- return this.post({
- body: postBody,
- headers: {
- "X-HTTP-Method": "MERGE",
- },
- }).then(function (data) {
- return {
- data: data,
- field: _this,
- };
- });
- };
- /**
- * Delete this fields
- *
- */
- Field.prototype.delete = function () {
- return this.post({
- headers: {
- "X-HTTP-Method": "DELETE",
- },
- });
- };
- /**
- * Sets the value of the ShowInDisplayForm property for this field.
- */
- Field.prototype.setShowInDisplayForm = function (show) {
- return this.clone(Field, "setshowindisplayform(" + show + ")", true).post();
- };
- /**
- * Sets the value of the ShowInEditForm property for this field.
- */
- Field.prototype.setShowInEditForm = function (show) {
- return this.clone(Field, "setshowineditform(" + show + ")", true).post();
- };
- /**
- * Sets the value of the ShowInNewForm property for this field.
- */
- Field.prototype.setShowInNewForm = function (show) {
- return this.clone(Field, "setshowinnewform(" + show + ")", true).post();
- };
- return Field;
- }(queryable_1.QueryableInstance));
- exports.Field = Field;
- /***/ }),
- /* 25 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var __extends = (this && this.__extends) || (function () {
- var extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- Object.defineProperty(exports, "__esModule", { value: true });
- var util_1 = __webpack_require__(0);
- var queryable_1 = __webpack_require__(1);
- /**
- * Represents a collection of navigation nodes
- *
- */
- var NavigationNodes = (function (_super) {
- __extends(NavigationNodes, _super);
- function NavigationNodes() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- /**
- * Gets a navigation node by id
- *
- * @param id The id of the node
- */
- NavigationNodes.prototype.getById = function (id) {
- var node = new NavigationNode(this);
- node.concat("(" + id + ")");
- return node;
- };
- /**
- * Adds a new node to the collection
- *
- * @param title Display name of the node
- * @param url The url of the node
- * @param visible If true the node is visible, otherwise it is hidden (default: true)
- */
- NavigationNodes.prototype.add = function (title, url, visible) {
- var _this = this;
- if (visible === void 0) { visible = true; }
- var postBody = JSON.stringify({
- IsVisible: visible,
- Title: title,
- Url: url,
- "__metadata": { "type": "SP.NavigationNode" },
- });
- return this.clone(NavigationNodes, null, true).post({ body: postBody }).then(function (data) {
- return {
- data: data,
- node: _this.getById(data.Id),
- };
- });
- };
- /**
- * Moves a node to be after another node in the navigation
- *
- * @param nodeId Id of the node to move
- * @param previousNodeId Id of the node after which we move the node specified by nodeId
- */
- NavigationNodes.prototype.moveAfter = function (nodeId, previousNodeId) {
- var postBody = JSON.stringify({
- nodeId: nodeId,
- previousNodeId: previousNodeId,
- });
- return this.clone(NavigationNodes, "MoveAfter", true).post({ body: postBody });
- };
- return NavigationNodes;
- }(queryable_1.QueryableCollection));
- exports.NavigationNodes = NavigationNodes;
- var NavigationNode = (function (_super) {
- __extends(NavigationNode, _super);
- function NavigationNode() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- Object.defineProperty(NavigationNode.prototype, "children", {
- /**
- * Represents the child nodes of this node
- */
- get: function () {
- return new NavigationNodes(this, "Children");
- },
- enumerable: true,
- configurable: true
- });
- /**
- * Updates this node based on the supplied properties
- *
- * @param properties The hash of key/value pairs to update
- */
- NavigationNode.prototype.update = function (properties) {
- var _this = this;
- var postBody = JSON.stringify(util_1.Util.extend({
- "__metadata": { "type": "SP.NavigationNode" },
- }, properties));
- return this.post({
- body: postBody,
- headers: {
- "X-HTTP-Method": "MERGE",
- },
- }).then(function (data) {
- return {
- data: data,
- node: _this,
- };
- });
- };
- /**
- * Deletes this node and any child nodes
- */
- NavigationNode.prototype.delete = function () {
- return _super.prototype.delete.call(this);
- };
- return NavigationNode;
- }(queryable_1.QueryableInstance));
- exports.NavigationNode = NavigationNode;
- /**
- * Exposes the navigation components
- *
- */
- var Navigation = (function (_super) {
- __extends(Navigation, _super);
- /**
- * Creates a new instance of the Lists class
- *
- * @param baseUrl The url or Queryable which forms the parent of this fields collection
- */
- function Navigation(baseUrl, path) {
- if (path === void 0) { path = "navigation"; }
- return _super.call(this, baseUrl, path) || this;
- }
- Object.defineProperty(Navigation.prototype, "quicklaunch", {
- /**
- * Gets the quicklaunch navigation for the current context
- *
- */
- get: function () {
- return new NavigationNodes(this, "quicklaunch");
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(Navigation.prototype, "topNavigationBar", {
- /**
- * Gets the top bar navigation navigation for the current context
- *
- */
- get: function () {
- return new NavigationNodes(this, "topnavigationbar");
- },
- enumerable: true,
- configurable: true
- });
- return Navigation;
- }(queryable_1.Queryable));
- exports.Navigation = Navigation;
- /***/ }),
- /* 26 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var __extends = (this && this.__extends) || (function () {
- var extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- Object.defineProperty(exports, "__esModule", { value: true });
- var webs_1 = __webpack_require__(7);
- var roles_1 = __webpack_require__(17);
- var types_1 = __webpack_require__(13);
- var queryable_1 = __webpack_require__(1);
- var QueryableSecurable = (function (_super) {
- __extends(QueryableSecurable, _super);
- function QueryableSecurable() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- Object.defineProperty(QueryableSecurable.prototype, "roleAssignments", {
- /**
- * Gets the set of role assignments for this item
- *
- */
- get: function () {
- return new roles_1.RoleAssignments(this);
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(QueryableSecurable.prototype, "firstUniqueAncestorSecurableObject", {
- /**
- * Gets the closest securable up the security hierarchy whose permissions are applied to this list item
- *
- */
- get: function () {
- return new queryable_1.QueryableInstance(this, "FirstUniqueAncestorSecurableObject");
- },
- enumerable: true,
- configurable: true
- });
- /**
- * Gets the effective permissions for the user supplied
- *
- * @param loginName The claims username for the user (ex: i:0#.f|membership|user@domain.com)
- */
- QueryableSecurable.prototype.getUserEffectivePermissions = function (loginName) {
- var q = this.clone(queryable_1.Queryable, "getUserEffectivePermissions(@user)", true);
- q.query.add("@user", "'" + encodeURIComponent(loginName) + "'");
- return q.getAs();
- };
- /**
- * Gets the effective permissions for the current user
- */
- QueryableSecurable.prototype.getCurrentUserEffectivePermissions = function () {
- var _this = this;
- var w = webs_1.Web.fromUrl(this.toUrl());
- return w.currentUser.select("LoginName").getAs().then(function (user) {
- return _this.getUserEffectivePermissions(user.LoginName);
- });
- };
- /**
- * Breaks the security inheritance at this level optinally copying permissions and clearing subscopes
- *
- * @param copyRoleAssignments If true the permissions are copied from the current parent scope
- * @param clearSubscopes Optional. true to make all child securable objects inherit role assignments from the current object
- */
- QueryableSecurable.prototype.breakRoleInheritance = function (copyRoleAssignments, clearSubscopes) {
- if (copyRoleAssignments === void 0) { copyRoleAssignments = false; }
- if (clearSubscopes === void 0) { clearSubscopes = false; }
- return this.clone(QueryableSecurable, "breakroleinheritance(copyroleassignments=" + copyRoleAssignments + ", clearsubscopes=" + clearSubscopes + ")", true).post();
- };
- /**
- * Removes the local role assignments so that it re-inherit role assignments from the parent object.
- *
- */
- QueryableSecurable.prototype.resetRoleInheritance = function () {
- return this.clone(QueryableSecurable, "resetroleinheritance", true).post();
- };
- /**
- * Determines if a given user has the appropriate permissions
- *
- * @param loginName The user to check
- * @param permission The permission being checked
- */
- QueryableSecurable.prototype.userHasPermissions = function (loginName, permission) {
- var _this = this;
- return this.getUserEffectivePermissions(loginName).then(function (perms) {
- return _this.hasPermissions(perms, permission);
- });
- };
- /**
- * Determines if the current user has the requested permissions
- *
- * @param permission The permission we wish to check
- */
- QueryableSecurable.prototype.currentUserHasPermissions = function (permission) {
- var _this = this;
- return this.getCurrentUserEffectivePermissions().then(function (perms) {
- return _this.hasPermissions(perms, permission);
- });
- };
- /**
- * Taken from sp.js, checks the supplied permissions against the mask
- *
- * @param value The security principal's permissions on the given object
- * @param perm The permission checked against the value
- */
- /* tslint:disable:no-bitwise */
- QueryableSecurable.prototype.hasPermissions = function (value, perm) {
- if (!perm) {
- return true;
- }
- if (perm === types_1.PermissionKind.FullMask) {
- return (value.High & 32767) === 32767 && value.Low === 65535;
- }
- perm = perm - 1;
- var num = 1;
- if (perm >= 0 && perm < 32) {
- num = num << perm;
- return 0 !== (value.Low & num);
- }
- else if (perm >= 32 && perm < 64) {
- num = num << perm - 32;
- return 0 !== (value.High & num);
- }
- return false;
- };
- return QueryableSecurable;
- }(queryable_1.QueryableInstance));
- exports.QueryableSecurable = QueryableSecurable;
- /***/ }),
- /* 27 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var __extends = (this && this.__extends) || (function () {
- var extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- Object.defineProperty(exports, "__esModule", { value: true });
- var queryable_1 = __webpack_require__(1);
- var util_1 = __webpack_require__(0);
- /**
- * Describes the search API
- *
- */
- var Search = (function (_super) {
- __extends(Search, _super);
- /**
- * Creates a new instance of the Search class
- *
- * @param baseUrl The url for the search context
- * @param query The SearchQuery object to execute
- */
- function Search(baseUrl, path) {
- if (path === void 0) { path = "_api/search/postquery"; }
- return _super.call(this, baseUrl, path) || this;
- }
- /**
- * .......
- * @returns Promise
- */
- Search.prototype.execute = function (query) {
- var formattedBody;
- formattedBody = query;
- if (formattedBody.SelectProperties) {
- formattedBody.SelectProperties = { results: query.SelectProperties };
- }
- if (formattedBody.RefinementFilters) {
- formattedBody.RefinementFilters = { results: query.RefinementFilters };
- }
- if (formattedBody.SortList) {
- formattedBody.SortList = { results: query.SortList };
- }
- if (formattedBody.HithighlightedProperties) {
- formattedBody.HithighlightedProperties = { results: query.HithighlightedProperties };
- }
- if (formattedBody.ReorderingRules) {
- formattedBody.ReorderingRules = { results: query.ReorderingRules };
- }
- if (formattedBody.Properties) {
- formattedBody.Properties = { results: query.Properties };
- }
- var postBody = JSON.stringify({
- request: util_1.Util.extend({
- "__metadata": { "type": "Microsoft.Office.Server.Search.REST.SearchRequest" },
- }, formattedBody),
- });
- return this.post({ body: postBody }).then(function (data) { return new SearchResults(data); });
- };
- return Search;
- }(queryable_1.QueryableInstance));
- exports.Search = Search;
- /**
- * Describes the SearchResults class, which returns the formatted and raw version of the query response
- */
- var SearchResults = (function () {
- /**
- * Creates a new instance of the SearchResult class
- *
- */
- function SearchResults(rawResponse) {
- var response = rawResponse.postquery ? rawResponse.postquery : rawResponse;
- this.PrimarySearchResults = this.formatSearchResults(response.PrimaryQueryResult.RelevantResults.Table.Rows);
- this.RawSearchResults = response;
- this.ElapsedTime = response.ElapsedTime;
- this.RowCount = response.PrimaryQueryResult.RelevantResults.RowCount;
- this.TotalRows = response.PrimaryQueryResult.RelevantResults.TotalRows;
- this.TotalRowsIncludingDuplicates = response.PrimaryQueryResult.RelevantResults.TotalRowsIncludingDuplicates;
- }
- /**
- * Formats a search results array
- *
- * @param rawResults The array to process
- */
- SearchResults.prototype.formatSearchResults = function (rawResults) {
- var results = new Array(), tempResults = rawResults.results ? rawResults.results : rawResults;
- for (var _i = 0, tempResults_1 = tempResults; _i < tempResults_1.length; _i++) {
- var i = tempResults_1[_i];
- results.push(new SearchResult(i.Cells));
- }
- return results;
- };
- return SearchResults;
- }());
- exports.SearchResults = SearchResults;
- /**
- * Describes the SearchResult class
- */
- var SearchResult = (function () {
- /**
- * Creates a new instance of the SearchResult class
- *
- */
- function SearchResult(rawItem) {
- var item = rawItem.results ? rawItem.results : rawItem;
- for (var _i = 0, item_1 = item; _i < item_1.length; _i++) {
- var i = item_1[_i];
- Object.defineProperty(this, i.Key, {
- configurable: false,
- enumerable: false,
- value: i.Value,
- writable: false,
- });
- }
- }
- return SearchResult;
- }());
- exports.SearchResult = SearchResult;
- /**
- * defines the SortDirection enum
- */
- var SortDirection;
- (function (SortDirection) {
- SortDirection[SortDirection["Ascending"] = 0] = "Ascending";
- SortDirection[SortDirection["Descending"] = 1] = "Descending";
- SortDirection[SortDirection["FQLFormula"] = 2] = "FQLFormula";
- })(SortDirection = exports.SortDirection || (exports.SortDirection = {}));
- /**
- * defines the ReorderingRuleMatchType enum
- */
- var ReorderingRuleMatchType;
- (function (ReorderingRuleMatchType) {
- ReorderingRuleMatchType[ReorderingRuleMatchType["ResultContainsKeyword"] = 0] = "ResultContainsKeyword";
- ReorderingRuleMatchType[ReorderingRuleMatchType["TitleContainsKeyword"] = 1] = "TitleContainsKeyword";
- ReorderingRuleMatchType[ReorderingRuleMatchType["TitleMatchesKeyword"] = 2] = "TitleMatchesKeyword";
- ReorderingRuleMatchType[ReorderingRuleMatchType["UrlStartsWith"] = 3] = "UrlStartsWith";
- ReorderingRuleMatchType[ReorderingRuleMatchType["UrlExactlyMatches"] = 4] = "UrlExactlyMatches";
- ReorderingRuleMatchType[ReorderingRuleMatchType["ContentTypeIs"] = 5] = "ContentTypeIs";
- ReorderingRuleMatchType[ReorderingRuleMatchType["FileExtensionMatches"] = 6] = "FileExtensionMatches";
- ReorderingRuleMatchType[ReorderingRuleMatchType["ResultHasTag"] = 7] = "ResultHasTag";
- ReorderingRuleMatchType[ReorderingRuleMatchType["ManualCondition"] = 8] = "ManualCondition";
- })(ReorderingRuleMatchType = exports.ReorderingRuleMatchType || (exports.ReorderingRuleMatchType = {}));
- /**
- * Specifies the type value for the property
- */
- var QueryPropertyValueType;
- (function (QueryPropertyValueType) {
- QueryPropertyValueType[QueryPropertyValueType["None"] = 0] = "None";
- QueryPropertyValueType[QueryPropertyValueType["StringType"] = 1] = "StringType";
- QueryPropertyValueType[QueryPropertyValueType["Int32TYpe"] = 2] = "Int32TYpe";
- QueryPropertyValueType[QueryPropertyValueType["BooleanType"] = 3] = "BooleanType";
- QueryPropertyValueType[QueryPropertyValueType["StringArrayType"] = 4] = "StringArrayType";
- QueryPropertyValueType[QueryPropertyValueType["UnSupportedType"] = 5] = "UnSupportedType";
- })(QueryPropertyValueType = exports.QueryPropertyValueType || (exports.QueryPropertyValueType = {}));
- /***/ }),
- /* 28 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var __extends = (this && this.__extends) || (function () {
- var extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- Object.defineProperty(exports, "__esModule", { value: true });
- var queryable_1 = __webpack_require__(1);
- var SearchSuggest = (function (_super) {
- __extends(SearchSuggest, _super);
- function SearchSuggest(baseUrl, path) {
- if (path === void 0) { path = "_api/search/suggest"; }
- return _super.call(this, baseUrl, path) || this;
- }
- SearchSuggest.prototype.execute = function (query) {
- this.mapQueryToQueryString(query);
- return this.get().then(function (response) { return new SearchSuggestResult(response); });
- };
- SearchSuggest.prototype.mapQueryToQueryString = function (query) {
- this.query.add("querytext", "'" + query.querytext + "'");
- if (query.hasOwnProperty("count")) {
- this.query.add("inumberofquerysuggestions", query.count.toString());
- }
- if (query.hasOwnProperty("personalCount")) {
- this.query.add("inumberofresultsuggestions", query.personalCount.toString());
- }
- if (query.hasOwnProperty("preQuery")) {
- this.query.add("fprequerysuggestions", query.preQuery.toString());
- }
- if (query.hasOwnProperty("hitHighlighting")) {
- this.query.add("fhithighlighting", query.hitHighlighting.toString());
- }
- if (query.hasOwnProperty("capitalize")) {
- this.query.add("fcapitalizefirstletters", query.capitalize.toString());
- }
- if (query.hasOwnProperty("culture")) {
- this.query.add("culture", query.culture.toString());
- }
- if (query.hasOwnProperty("stemming")) {
- this.query.add("enablestemming", query.stemming.toString());
- }
- if (query.hasOwnProperty("includePeople")) {
- this.query.add("showpeoplenamesuggestions", query.includePeople.toString());
- }
- if (query.hasOwnProperty("queryRules")) {
- this.query.add("enablequeryrules", query.queryRules.toString());
- }
- if (query.hasOwnProperty("prefixMatch")) {
- this.query.add("fprefixmatchallterms", query.prefixMatch.toString());
- }
- };
- return SearchSuggest;
- }(queryable_1.QueryableInstance));
- exports.SearchSuggest = SearchSuggest;
- var SearchSuggestResult = (function () {
- function SearchSuggestResult(json) {
- if (json.hasOwnProperty("suggest")) {
- // verbose
- this.PeopleNames = json.suggest.PeopleNames.results;
- this.PersonalResults = json.suggest.PersonalResults.results;
- this.Queries = json.suggest.Queries.results;
- }
- else {
- this.PeopleNames = json.PeopleNames;
- this.PersonalResults = json.PersonalResults;
- this.Queries = json.Queries;
- }
- }
- return SearchSuggestResult;
- }());
- exports.SearchSuggestResult = SearchSuggestResult;
- /***/ }),
- /* 29 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var __extends = (this && this.__extends) || (function () {
- var extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- Object.defineProperty(exports, "__esModule", { value: true });
- var queryable_1 = __webpack_require__(1);
- var webs_1 = __webpack_require__(7);
- var usercustomactions_1 = __webpack_require__(19);
- var odata_1 = __webpack_require__(2);
- var features_1 = __webpack_require__(23);
- /**
- * Describes a site collection
- *
- */
- var Site = (function (_super) {
- __extends(Site, _super);
- /**
- * Creates a new instance of the RoleAssignments class
- *
- * @param baseUrl The url or Queryable which forms the parent of this fields collection
- */
- function Site(baseUrl, path) {
- if (path === void 0) { path = "_api/site"; }
- return _super.call(this, baseUrl, path) || this;
- }
- Object.defineProperty(Site.prototype, "rootWeb", {
- /**
- * Gets the root web of the site collection
- *
- */
- get: function () {
- return new webs_1.Web(this, "rootweb");
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(Site.prototype, "features", {
- /**
- * Gets the active features for this site
- *
- */
- get: function () {
- return new features_1.Features(this);
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(Site.prototype, "userCustomActions", {
- /**
- * Get all custom actions on a site collection
- *
- */
- get: function () {
- return new usercustomactions_1.UserCustomActions(this);
- },
- enumerable: true,
- configurable: true
- });
- /**
- * Gets the context information for the site.
- */
- Site.prototype.getContextInfo = function () {
- var q = new Site(this.parentUrl, "_api/contextinfo");
- return q.post().then(function (data) {
- if (data.hasOwnProperty("GetContextWebInformation")) {
- var info = data.GetContextWebInformation;
- info.SupportedSchemaVersions = info.SupportedSchemaVersions.results;
- return info;
- }
- else {
- return data;
- }
- });
- };
- /**
- * Gets the document libraries on a site. Static method. (SharePoint Online only)
- *
- * @param absoluteWebUrl The absolute url of the web whose document libraries should be returned
- */
- Site.prototype.getDocumentLibraries = function (absoluteWebUrl) {
- var q = new queryable_1.Queryable("", "_api/sp.web.getdocumentlibraries(@v)");
- q.query.add("@v", "'" + absoluteWebUrl + "'");
- return q.get().then(function (data) {
- if (data.hasOwnProperty("GetDocumentLibraries")) {
- return data.GetDocumentLibraries;
- }
- else {
- return data;
- }
- });
- };
- /**
- * Gets the site URL from a page URL.
- *
- * @param absolutePageUrl The absolute url of the page
- */
- Site.prototype.getWebUrlFromPageUrl = function (absolutePageUrl) {
- var q = new queryable_1.Queryable("", "_api/sp.web.getweburlfrompageurl(@v)");
- q.query.add("@v", "'" + absolutePageUrl + "'");
- return q.get().then(function (data) {
- if (data.hasOwnProperty("GetWebUrlFromPageUrl")) {
- return data.GetWebUrlFromPageUrl;
- }
- else {
- return data;
- }
- });
- };
- /**
- * Creates a new batch for requests within the context of context this site
- *
- */
- Site.prototype.createBatch = function () {
- return new odata_1.ODataBatch(this.parentUrl);
- };
- return Site;
- }(queryable_1.QueryableInstance));
- exports.Site = Site;
- /***/ }),
- /* 30 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var __extends = (this && this.__extends) || (function () {
- var extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- Object.defineProperty(exports, "__esModule", { value: true });
- var queryable_1 = __webpack_require__(1);
- var sitegroups_1 = __webpack_require__(18);
- var util_1 = __webpack_require__(0);
- /**
- * Describes a collection of all site collection users
- *
- */
- var SiteUsers = (function (_super) {
- __extends(SiteUsers, _super);
- /**
- * Creates a new instance of the Users class
- *
- * @param baseUrl The url or Queryable which forms the parent of this user collection
- */
- function SiteUsers(baseUrl, path) {
- if (path === void 0) { path = "siteusers"; }
- return _super.call(this, baseUrl, path) || this;
- }
- /**
- * Gets a user from the collection by email
- *
- * @param email The email of the user
- */
- SiteUsers.prototype.getByEmail = function (email) {
- return new SiteUser(this, "getByEmail('" + email + "')");
- };
- /**
- * Gets a user from the collection by id
- *
- * @param id The id of the user
- */
- SiteUsers.prototype.getById = function (id) {
- return new SiteUser(this, "getById(" + id + ")");
- };
- /**
- * Gets a user from the collection by login name
- *
- * @param loginName The email address of the user
- */
- SiteUsers.prototype.getByLoginName = function (loginName) {
- var su = new SiteUser(this);
- su.concat("(@v)");
- su.query.add("@v", "'" + encodeURIComponent(loginName) + "'");
- return su;
- };
- /**
- * Removes a user from the collection by id
- *
- * @param id The id of the user
- */
- SiteUsers.prototype.removeById = function (id) {
- return this.clone(SiteUsers, "removeById(" + id + ")", true).post();
- };
- /**
- * Removes a user from the collection by login name
- *
- * @param loginName The login name of the user
- */
- SiteUsers.prototype.removeByLoginName = function (loginName) {
- var o = this.clone(SiteUsers, "removeByLoginName(@v)", true);
- o.query.add("@v", "'" + encodeURIComponent(loginName) + "'");
- return o.post();
- };
- /**
- * Add a user to a group
- *
- * @param loginName The login name of the user to add to the group
- *
- */
- SiteUsers.prototype.add = function (loginName) {
- var _this = this;
- return this.clone(SiteUsers, null, true).post({
- body: JSON.stringify({ "__metadata": { "type": "SP.User" }, LoginName: loginName }),
- }).then(function () { return _this.getByLoginName(loginName); });
- };
- return SiteUsers;
- }(queryable_1.QueryableCollection));
- exports.SiteUsers = SiteUsers;
- /**
- * Describes a single user
- *
- */
- var SiteUser = (function (_super) {
- __extends(SiteUser, _super);
- function SiteUser() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- Object.defineProperty(SiteUser.prototype, "groups", {
- /**
- * Get's the groups for this user.
- *
- */
- get: function () {
- return new sitegroups_1.SiteGroups(this, "groups");
- },
- enumerable: true,
- configurable: true
- });
- /**
- * Updates this user instance with the supplied properties
- *
- * @param properties A plain object of property names and values to update for the user
- */
- SiteUser.prototype.update = function (properties) {
- var _this = this;
- var postBody = util_1.Util.extend({ "__metadata": { "type": "SP.User" } }, properties);
- return this.post({
- body: JSON.stringify(postBody),
- headers: {
- "X-HTTP-Method": "MERGE",
- },
- }).then(function (data) {
- return {
- data: data,
- user: _this,
- };
- });
- };
- /**
- * Delete this user
- *
- */
- SiteUser.prototype.delete = function () {
- return this.post({
- headers: {
- "X-HTTP-Method": "DELETE",
- },
- });
- };
- return SiteUser;
- }(queryable_1.QueryableInstance));
- exports.SiteUser = SiteUser;
- /**
- * Represents the current user
- */
- var CurrentUser = (function (_super) {
- __extends(CurrentUser, _super);
- function CurrentUser(baseUrl, path) {
- if (path === void 0) { path = "currentuser"; }
- return _super.call(this, baseUrl, path) || this;
- }
- return CurrentUser;
- }(queryable_1.QueryableInstance));
- exports.CurrentUser = CurrentUser;
- /***/ }),
- /* 31 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var logging_1 = __webpack_require__(5);
- function deprecated(message) {
- return function (target, propertyKey, descriptor) {
- var method = descriptor.value;
- descriptor.value = function () {
- var args = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- args[_i] = arguments[_i];
- }
- logging_1.Logger.log({
- data: {
- descriptor: descriptor,
- propertyKey: propertyKey,
- target: target,
- },
- level: logging_1.LogLevel.Warning,
- message: message,
- });
- return method.apply(this, args);
- };
- };
- }
- exports.deprecated = deprecated;
- /***/ }),
- /* 32 */
- /***/ (function(module, exports) {
- var g;
- // This works in non-strict mode
- g = (function() {
- return this;
- })();
- try {
- // This works if eval is allowed (see CSP)
- g = g || Function("return this")() || (1,eval)("this");
- } catch(e) {
- // This works if the window reference is available
- if(typeof window === "object")
- g = window;
- }
- // g can still be undefined, but nothing to do about it...
- // We return undefined, instead of nothing here, so it's
- // easier to handle this case. if(!global) { ...}
- module.exports = g;
- /***/ }),
- /* 33 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var collections_1 = __webpack_require__(6);
- /**
- * Class used to manage the current application settings
- *
- */
- var Settings = (function () {
- /**
- * Creates a new instance of the settings class
- *
- * @constructor
- */
- function Settings() {
- this._settings = new collections_1.Dictionary();
- }
- /**
- * Adds a new single setting, or overwrites a previous setting with the same key
- *
- * @param {string} key The key used to store this setting
- * @param {string} value The setting value to store
- */
- Settings.prototype.add = function (key, value) {
- this._settings.add(key, value);
- };
- /**
- * Adds a JSON value to the collection as a string, you must use getJSON to rehydrate the object when read
- *
- * @param {string} key The key used to store this setting
- * @param {any} value The setting value to store
- */
- Settings.prototype.addJSON = function (key, value) {
- this._settings.add(key, JSON.stringify(value));
- };
- /**
- * Applies the supplied hash to the setting collection overwriting any existing value, or created new values
- *
- * @param {TypedHash<any>} hash The set of values to add
- */
- Settings.prototype.apply = function (hash) {
- var _this = this;
- return new Promise(function (resolve, reject) {
- try {
- _this._settings.merge(hash);
- resolve();
- }
- catch (e) {
- reject(e);
- }
- });
- };
- /**
- * Loads configuration settings into the collection from the supplied provider and returns a Promise
- *
- * @param {IConfigurationProvider} provider The provider from which we will load the settings
- */
- Settings.prototype.load = function (provider) {
- var _this = this;
- return new Promise(function (resolve, reject) {
- provider.getConfiguration().then(function (value) {
- _this._settings.merge(value);
- resolve();
- }).catch(function (reason) {
- reject(reason);
- });
- });
- };
- /**
- * Gets a value from the configuration
- *
- * @param {string} key The key whose value we want to return. Returns null if the key does not exist
- * @return {string} string value from the configuration
- */
- Settings.prototype.get = function (key) {
- return this._settings.get(key);
- };
- /**
- * Gets a JSON value, rehydrating the stored string to the original object
- *
- * @param {string} key The key whose value we want to return. Returns null if the key does not exist
- * @return {any} object from the configuration
- */
- Settings.prototype.getJSON = function (key) {
- var o = this.get(key);
- if (typeof o === "undefined" || o === null) {
- return o;
- }
- return JSON.parse(o);
- };
- return Settings;
- }());
- exports.Settings = Settings;
- /***/ }),
- /* 34 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var search_1 = __webpack_require__(27);
- var searchsuggest_1 = __webpack_require__(28);
- var site_1 = __webpack_require__(29);
- var webs_1 = __webpack_require__(7);
- var util_1 = __webpack_require__(0);
- var userprofiles_1 = __webpack_require__(48);
- var exceptions_1 = __webpack_require__(3);
- /**
- * Root of the SharePoint REST module
- */
- var Rest = (function () {
- function Rest() {
- }
- /**
- * Executes a search against this web context
- *
- * @param query The SearchQuery definition
- */
- Rest.prototype.searchSuggest = function (query) {
- var finalQuery;
- if (typeof query === "string") {
- finalQuery = { querytext: query };
- }
- else {
- finalQuery = query;
- }
- return new searchsuggest_1.SearchSuggest("").execute(finalQuery);
- };
- /**
- * Executes a search against this web context
- *
- * @param query The SearchQuery definition
- */
- Rest.prototype.search = function (query) {
- var finalQuery;
- if (typeof query === "string") {
- finalQuery = { Querytext: query };
- }
- else {
- finalQuery = query;
- }
- return new search_1.Search("").execute(finalQuery);
- };
- Object.defineProperty(Rest.prototype, "site", {
- /**
- * Begins a site collection scoped REST request
- *
- */
- get: function () {
- return new site_1.Site("");
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(Rest.prototype, "web", {
- /**
- * Begins a web scoped REST request
- *
- */
- get: function () {
- return new webs_1.Web("");
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(Rest.prototype, "profiles", {
- /**
- * Access to user profile methods
- *
- */
- get: function () {
- return new userprofiles_1.UserProfileQuery("");
- },
- enumerable: true,
- configurable: true
- });
- /**
- * Creates a new batch object for use with the Queryable.addToBatch method
- *
- */
- Rest.prototype.createBatch = function () {
- return this.web.createBatch();
- };
- /**
- * Begins a cross-domain, host site scoped REST request, for use in add-in webs
- *
- * @param addInWebUrl The absolute url of the add-in web
- * @param hostWebUrl The absolute url of the host web
- */
- Rest.prototype.crossDomainSite = function (addInWebUrl, hostWebUrl) {
- return this._cdImpl(site_1.Site, addInWebUrl, hostWebUrl, "site");
- };
- /**
- * Begins a cross-domain, host web scoped REST request, for use in add-in webs
- *
- * @param addInWebUrl The absolute url of the add-in web
- * @param hostWebUrl The absolute url of the host web
- */
- Rest.prototype.crossDomainWeb = function (addInWebUrl, hostWebUrl) {
- return this._cdImpl(webs_1.Web, addInWebUrl, hostWebUrl, "web");
- };
- /**
- * Implements the creation of cross domain REST urls
- *
- * @param factory The constructor of the object to create Site | Web
- * @param addInWebUrl The absolute url of the add-in web
- * @param hostWebUrl The absolute url of the host web
- * @param urlPart String part to append to the url "site" | "web"
- */
- Rest.prototype._cdImpl = function (factory, addInWebUrl, hostWebUrl, urlPart) {
- if (!util_1.Util.isUrlAbsolute(addInWebUrl)) {
- throw new exceptions_1.UrlException("The addInWebUrl parameter must be an absolute url.");
- }
- if (!util_1.Util.isUrlAbsolute(hostWebUrl)) {
- throw new exceptions_1.UrlException("The hostWebUrl parameter must be an absolute url.");
- }
- var url = util_1.Util.combinePaths(addInWebUrl, "_api/SP.AppContextSite(@target)");
- var instance = new factory(url, urlPart);
- instance.query.add("@target", "'" + encodeURIComponent(hostWebUrl) + "'");
- return instance;
- };
- return Rest;
- }());
- exports.Rest = Rest;
- /***/ }),
- /* 35 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- function __export(m) {
- for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
- }
- Object.defineProperty(exports, "__esModule", { value: true });
- __export(__webpack_require__(44));
- var httpclient_1 = __webpack_require__(15);
- exports.HttpClient = httpclient_1.HttpClient;
- var sprequestexecutorclient_1 = __webpack_require__(40);
- exports.SPRequestExecutorClient = sprequestexecutorclient_1.SPRequestExecutorClient;
- var nodefetchclient_1 = __webpack_require__(39);
- exports.NodeFetchClient = nodefetchclient_1.NodeFetchClient;
- var fetchclient_1 = __webpack_require__(21);
- exports.FetchClient = fetchclient_1.FetchClient;
- __export(__webpack_require__(36));
- var collections_1 = __webpack_require__(6);
- exports.Dictionary = collections_1.Dictionary;
- var util_1 = __webpack_require__(0);
- exports.Util = util_1.Util;
- __export(__webpack_require__(5));
- __export(__webpack_require__(3));
- /***/ }),
- /* 36 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var cachingConfigurationProvider_1 = __webpack_require__(20);
- exports.CachingConfigurationProvider = cachingConfigurationProvider_1.default;
- var spListConfigurationProvider_1 = __webpack_require__(37);
- exports.SPListConfigurationProvider = spListConfigurationProvider_1.default;
- /***/ }),
- /* 37 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var cachingConfigurationProvider_1 = __webpack_require__(20);
- /**
- * A configuration provider which loads configuration values from a SharePoint list
- *
- */
- var SPListConfigurationProvider = (function () {
- /**
- * Creates a new SharePoint list based configuration provider
- * @constructor
- * @param {string} webUrl Url of the SharePoint site, where the configuration list is located
- * @param {string} listTitle Title of the SharePoint list, which contains the configuration settings (optional, default = "config")
- */
- function SPListConfigurationProvider(sourceWeb, sourceListTitle) {
- if (sourceListTitle === void 0) { sourceListTitle = "config"; }
- this.sourceWeb = sourceWeb;
- this.sourceListTitle = sourceListTitle;
- }
- Object.defineProperty(SPListConfigurationProvider.prototype, "web", {
- /**
- * Gets the url of the SharePoint site, where the configuration list is located
- *
- * @return {string} Url address of the site
- */
- get: function () {
- return this.sourceWeb;
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(SPListConfigurationProvider.prototype, "listTitle", {
- /**
- * Gets the title of the SharePoint list, which contains the configuration settings
- *
- * @return {string} List title
- */
- get: function () {
- return this.sourceListTitle;
- },
- enumerable: true,
- configurable: true
- });
- /**
- * Loads the configuration values from the SharePoint list
- *
- * @return {Promise<TypedHash<string>>} Promise of loaded configuration values
- */
- SPListConfigurationProvider.prototype.getConfiguration = function () {
- return this.web.lists.getByTitle(this.listTitle).items.select("Title", "Value")
- .getAs().then(function (data) {
- return data.reduce(function (configuration, item) {
- return Object.defineProperty(configuration, item.Title, {
- configurable: false,
- enumerable: false,
- value: item.Value,
- writable: false,
- });
- }, {});
- });
- };
- /**
- * Wraps the current provider in a cache enabled provider
- *
- * @return {CachingConfigurationProvider} Caching providers which wraps the current provider
- */
- SPListConfigurationProvider.prototype.asCaching = function () {
- var cacheKey = "splist_" + this.web.toUrl() + "+" + this.listTitle;
- return new cachingConfigurationProvider_1.default(this, cacheKey);
- };
- return SPListConfigurationProvider;
- }());
- exports.default = SPListConfigurationProvider;
- /***/ }),
- /* 38 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var collections_1 = __webpack_require__(6);
- var util_1 = __webpack_require__(0);
- var odata_1 = __webpack_require__(2);
- var CachedDigest = (function () {
- function CachedDigest() {
- }
- return CachedDigest;
- }());
- exports.CachedDigest = CachedDigest;
- // allows for the caching of digests across all HttpClient's which each have their own DigestCache wrapper.
- var digests = new collections_1.Dictionary();
- var DigestCache = (function () {
- function DigestCache(_httpClient, _digests) {
- if (_digests === void 0) { _digests = digests; }
- this._httpClient = _httpClient;
- this._digests = _digests;
- }
- DigestCache.prototype.getDigest = function (webUrl) {
- var _this = this;
- var cachedDigest = this._digests.get(webUrl);
- if (cachedDigest !== null) {
- var now = new Date();
- if (now < cachedDigest.expiration) {
- return Promise.resolve(cachedDigest.value);
- }
- }
- var url = util_1.Util.combinePaths(webUrl, "/_api/contextinfo");
- return this._httpClient.fetchRaw(url, {
- cache: "no-cache",
- credentials: "same-origin",
- headers: {
- "Accept": "application/json;odata=verbose",
- "Content-type": "application/json;odata=verbose;charset=utf-8",
- },
- method: "POST",
- }).then(function (response) {
- var parser = new odata_1.ODataDefaultParser();
- return parser.parse(response).then(function (d) { return d.GetContextWebInformation; });
- }).then(function (data) {
- var newCachedDigest = new CachedDigest();
- newCachedDigest.value = data.FormDigestValue;
- var seconds = data.FormDigestTimeoutSeconds;
- var expiration = new Date();
- expiration.setTime(expiration.getTime() + 1000 * seconds);
- newCachedDigest.expiration = expiration;
- _this._digests.add(webUrl, newCachedDigest);
- return newCachedDigest.value;
- });
- };
- DigestCache.prototype.clear = function () {
- this._digests.clear();
- };
- return DigestCache;
- }());
- exports.DigestCache = DigestCache;
- /***/ }),
- /* 39 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var exceptions_1 = __webpack_require__(3);
- /**
- * This module is substituted for the NodeFetchClient.ts during the packaging process. This helps to reduce the pnp.js file size by
- * not including all of the node dependencies
- */
- var NodeFetchClient = (function () {
- function NodeFetchClient() {
- }
- /**
- * Always throws an error that NodeFetchClient is not supported for use in the browser
- */
- NodeFetchClient.prototype.fetch = function () {
- throw new exceptions_1.NodeFetchClientUnsupportedException();
- };
- return NodeFetchClient;
- }());
- exports.NodeFetchClient = NodeFetchClient;
- /***/ }),
- /* 40 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- var util_1 = __webpack_require__(0);
- var exceptions_1 = __webpack_require__(3);
- /**
- * Makes requests using the SP.RequestExecutor library.
- */
- var SPRequestExecutorClient = (function () {
- function SPRequestExecutorClient() {
- /**
- * Converts a SharePoint REST API response to a fetch API response.
- */
- this.convertToResponse = function (spResponse) {
- var responseHeaders = new Headers();
- for (var h in spResponse.headers) {
- if (spResponse.headers[h]) {
- responseHeaders.append(h, spResponse.headers[h]);
- }
- }
- // issue #256, Cannot have an empty string body when creating a Response with status 204
- var body = spResponse.statusCode === 204 ? null : spResponse.body;
- return new Response(body, {
- headers: responseHeaders,
- status: spResponse.statusCode,
- statusText: spResponse.statusText,
- });
- };
- }
- /**
- * Fetches a URL using the SP.RequestExecutor library.
- */
- SPRequestExecutorClient.prototype.fetch = function (url, options) {
- var _this = this;
- if (typeof SP === "undefined" || typeof SP.RequestExecutor === "undefined") {
- throw new exceptions_1.SPRequestExecutorUndefinedException();
- }
- var addinWebUrl = url.substring(0, url.indexOf("/_api")), executor = new SP.RequestExecutor(addinWebUrl);
- var headers = {}, iterator, temp;
- if (options.headers && options.headers instanceof Headers) {
- iterator = options.headers.entries();
- temp = iterator.next();
- while (!temp.done) {
- headers[temp.value[0]] = temp.value[1];
- temp = iterator.next();
- }
- }
- else {
- headers = options.headers;
- }
- return new Promise(function (resolve, reject) {
- var requestOptions = {
- error: function (error) {
- reject(_this.convertToResponse(error));
- },
- headers: headers,
- method: options.method,
- success: function (response) {
- resolve(_this.convertToResponse(response));
- },
- url: url,
- };
- if (options.body) {
- requestOptions = util_1.Util.extend(requestOptions, { body: options.body });
- }
- else {
- requestOptions = util_1.Util.extend(requestOptions, { binaryStringRequestBody: true });
- }
- executor.executeAsync(requestOptions);
- });
- };
- return SPRequestExecutorClient;
- }());
- exports.SPRequestExecutorClient = SPRequestExecutorClient;
- /***/ }),
- /* 41 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- function __export(m) {
- for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
- }
- Object.defineProperty(exports, "__esModule", { value: true });
- var util_1 = __webpack_require__(0);
- var storage_1 = __webpack_require__(14);
- var configuration_1 = __webpack_require__(33);
- var logging_1 = __webpack_require__(5);
- var rest_1 = __webpack_require__(34);
- var pnplibconfig_1 = __webpack_require__(4);
- /**
- * Root class of the Patterns and Practices namespace, provides an entry point to the library
- */
- /**
- * Utility methods
- */
- exports.util = util_1.Util;
- /**
- * Provides access to the REST interface
- */
- exports.sp = new rest_1.Rest();
- /**
- * Provides access to local and session storage
- */
- exports.storage = new storage_1.PnPClientStorage();
- /**
- * Global configuration instance to which providers can be added
- */
- exports.config = new configuration_1.Settings();
- /**
- * Global logging instance to which subscribers can be registered and messages written
- */
- exports.log = logging_1.Logger;
- /**
- * Allows for the configuration of the library
- */
- exports.setup = pnplibconfig_1.setRuntimeConfig;
- /**
- * Expose a subset of classes from the library for public consumption
- */
- __export(__webpack_require__(35));
- // creating this class instead of directly assigning to default fixes issue #116
- var Def = {
- /**
- * Global configuration instance to which providers can be added
- */
- config: exports.config,
- /**
- * Global logging instance to which subscribers can be registered and messages written
- */
- log: exports.log,
- /**
- * Provides access to local and session storage
- */
- setup: exports.setup,
- /**
- * Provides access to the REST interface
- */
- sp: exports.sp,
- /**
- * Provides access to local and session storage
- */
- storage: exports.storage,
- /**
- * Utility methods
- */
- util: exports.util,
- };
- /**
- * Enables use of the import pnp from syntax
- */
- exports.default = Def;
- /***/ }),
- /* 42 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var __extends = (this && this.__extends) || (function () {
- var extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- Object.defineProperty(exports, "__esModule", { value: true });
- var queryable_1 = __webpack_require__(1);
- var odata_1 = __webpack_require__(2);
- /**
- * Describes a collection of Item objects
- *
- */
- var AttachmentFiles = (function (_super) {
- __extends(AttachmentFiles, _super);
- /**
- * Creates a new instance of the AttachmentFiles class
- *
- * @param baseUrl The url or Queryable which forms the parent of this attachments collection
- */
- function AttachmentFiles(baseUrl, path) {
- if (path === void 0) { path = "AttachmentFiles"; }
- return _super.call(this, baseUrl, path) || this;
- }
- /**
- * Gets a Attachment File by filename
- *
- * @param name The name of the file, including extension.
- */
- AttachmentFiles.prototype.getByName = function (name) {
- var f = new AttachmentFile(this);
- f.concat("('" + name + "')");
- return f;
- };
- /**
- * Adds a new attachment to the collection. Not supported for batching.
- *
- * @param name The name of the file, including extension.
- * @param content The Base64 file content.
- */
- AttachmentFiles.prototype.add = function (name, content) {
- var _this = this;
- return this.clone(AttachmentFiles, "add(FileName='" + name + "')").post({
- body: content,
- }).then(function (response) {
- return {
- data: response,
- file: _this.getByName(name),
- };
- });
- };
- /**
- * Adds mjultiple new attachment to the collection. Not supported for batching.
- *
- * @files name The collection of files to add
- */
- AttachmentFiles.prototype.addMultiple = function (files) {
- var _this = this;
- // add the files in series so we don't get update conflicts
- return files.reduce(function (chain, file) { return chain.then(function () { return _this.clone(AttachmentFiles, "add(FileName='" + file.name + "')").post({
- body: file.content,
- }); }); }, Promise.resolve());
- };
- return AttachmentFiles;
- }(queryable_1.QueryableCollection));
- exports.AttachmentFiles = AttachmentFiles;
- /**
- * Describes a single attachment file instance
- *
- */
- var AttachmentFile = (function (_super) {
- __extends(AttachmentFile, _super);
- function AttachmentFile() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- /**
- * Gets the contents of the file as text
- *
- */
- AttachmentFile.prototype.getText = function () {
- return this.clone(AttachmentFile, "$value").get(new odata_1.TextFileParser());
- };
- /**
- * Gets the contents of the file as a blob, does not work in Node.js
- *
- */
- AttachmentFile.prototype.getBlob = function () {
- return this.clone(AttachmentFile, "$value").get(new odata_1.BlobFileParser());
- };
- /**
- * Gets the contents of a file as an ArrayBuffer, works in Node.js
- */
- AttachmentFile.prototype.getBuffer = function () {
- return this.clone(AttachmentFile, "$value").get(new odata_1.BufferFileParser());
- };
- /**
- * Gets the contents of a file as an ArrayBuffer, works in Node.js
- */
- AttachmentFile.prototype.getJSON = function () {
- return this.clone(AttachmentFile, "$value").get(new odata_1.JSONFileParser());
- };
- /**
- * Sets the content of a file. Not supported for batching
- *
- * @param content The value to set for the file contents
- */
- AttachmentFile.prototype.setContent = function (content) {
- var _this = this;
- return this.clone(AttachmentFile, "$value").post({
- body: content,
- headers: {
- "X-HTTP-Method": "PUT",
- },
- }).then(function (_) { return new AttachmentFile(_this); });
- };
- /**
- * Delete this attachment file
- *
- * @param eTag Value used in the IF-Match header, by default "*"
- */
- AttachmentFile.prototype.delete = function (eTag) {
- if (eTag === void 0) { eTag = "*"; }
- return this.post({
- headers: {
- "IF-Match": eTag,
- "X-HTTP-Method": "DELETE",
- },
- });
- };
- return AttachmentFile;
- }(queryable_1.QueryableInstance));
- exports.AttachmentFile = AttachmentFile;
- /***/ }),
- /* 43 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var __extends = (this && this.__extends) || (function () {
- var extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- Object.defineProperty(exports, "__esModule", { value: true });
- var queryable_1 = __webpack_require__(1);
- /**
- * Describes a collection of Field objects
- *
- */
- var Forms = (function (_super) {
- __extends(Forms, _super);
- /**
- * Creates a new instance of the Fields class
- *
- * @param baseUrl The url or Queryable which forms the parent of this fields collection
- */
- function Forms(baseUrl, path) {
- if (path === void 0) { path = "forms"; }
- return _super.call(this, baseUrl, path) || this;
- }
- /**
- * Gets a form by id
- *
- * @param id The guid id of the item to retrieve
- */
- Forms.prototype.getById = function (id) {
- var i = new Form(this);
- i.concat("('" + id + "')");
- return i;
- };
- return Forms;
- }(queryable_1.QueryableCollection));
- exports.Forms = Forms;
- /**
- * Describes a single of Form instance
- *
- */
- var Form = (function (_super) {
- __extends(Form, _super);
- function Form() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- return Form;
- }(queryable_1.QueryableInstance));
- exports.Form = Form;
- /***/ }),
- /* 44 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- function __export(m) {
- for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
- }
- Object.defineProperty(exports, "__esModule", { value: true });
- __export(__webpack_require__(22));
- var files_1 = __webpack_require__(8);
- exports.CheckinType = files_1.CheckinType;
- exports.WebPartsPersonalizationScope = files_1.WebPartsPersonalizationScope;
- exports.MoveOperations = files_1.MoveOperations;
- exports.TemplateFileType = files_1.TemplateFileType;
- var folders_1 = __webpack_require__(9);
- exports.Folder = folders_1.Folder;
- exports.Folders = folders_1.Folders;
- var items_1 = __webpack_require__(10);
- exports.Item = items_1.Item;
- exports.Items = items_1.Items;
- exports.PagedItemCollection = items_1.PagedItemCollection;
- var navigation_1 = __webpack_require__(25);
- exports.NavigationNodes = navigation_1.NavigationNodes;
- exports.NavigationNode = navigation_1.NavigationNode;
- var lists_1 = __webpack_require__(11);
- exports.List = lists_1.List;
- exports.Lists = lists_1.Lists;
- var odata_1 = __webpack_require__(2);
- exports.extractOdataId = odata_1.extractOdataId;
- exports.ODataParserBase = odata_1.ODataParserBase;
- exports.ODataDefaultParser = odata_1.ODataDefaultParser;
- exports.ODataRaw = odata_1.ODataRaw;
- exports.ODataValue = odata_1.ODataValue;
- exports.ODataEntity = odata_1.ODataEntity;
- exports.ODataEntityArray = odata_1.ODataEntityArray;
- exports.TextFileParser = odata_1.TextFileParser;
- exports.BlobFileParser = odata_1.BlobFileParser;
- exports.BufferFileParser = odata_1.BufferFileParser;
- exports.JSONFileParser = odata_1.JSONFileParser;
- var queryable_1 = __webpack_require__(1);
- exports.Queryable = queryable_1.Queryable;
- exports.QueryableInstance = queryable_1.QueryableInstance;
- exports.QueryableCollection = queryable_1.QueryableCollection;
- var roles_1 = __webpack_require__(17);
- exports.RoleDefinitionBindings = roles_1.RoleDefinitionBindings;
- var search_1 = __webpack_require__(27);
- exports.Search = search_1.Search;
- exports.SearchResult = search_1.SearchResult;
- exports.SearchResults = search_1.SearchResults;
- exports.SortDirection = search_1.SortDirection;
- exports.ReorderingRuleMatchType = search_1.ReorderingRuleMatchType;
- exports.QueryPropertyValueType = search_1.QueryPropertyValueType;
- var searchsuggest_1 = __webpack_require__(28);
- exports.SearchSuggest = searchsuggest_1.SearchSuggest;
- exports.SearchSuggestResult = searchsuggest_1.SearchSuggestResult;
- var site_1 = __webpack_require__(29);
- exports.Site = site_1.Site;
- __export(__webpack_require__(13));
- var webs_1 = __webpack_require__(7);
- exports.Web = webs_1.Web;
- /***/ }),
- /* 45 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
- return c > 3 && r && Object.defineProperty(target, key, r), r;
- };
- Object.defineProperty(exports, "__esModule", { value: true });
- var caching_1 = __webpack_require__(22);
- var httpclient_1 = __webpack_require__(15);
- var logging_1 = __webpack_require__(5);
- var util_1 = __webpack_require__(0);
- /**
- * Processes a given context through the request pipeline
- *
- * @param context The request context we are processing
- */
- function pipe(context) {
- // this is the beginning of the extensible pipeline in future versions
- var pipeline = [
- PipelineMethods.logStart,
- PipelineMethods.caching,
- PipelineMethods.send,
- PipelineMethods.logEnd,
- ];
- return pipeline.reduce(function (chain, next) { return chain.then(function (c) { return next(c); }); }, Promise.resolve(context))
- .then(function (ctx) { return PipelineMethods.returnResult(ctx); })
- .catch(function (e) {
- logging_1.Logger.log({
- data: e,
- level: logging_1.LogLevel.Error,
- message: "Error in request pipeline: " + e.message,
- });
- throw e;
- });
- }
- exports.pipe = pipe;
- /**
- * decorator factory applied to methods in the pipeline to control behavior
- */
- function requestPipelineMethod(alwaysRun) {
- if (alwaysRun === void 0) { alwaysRun = false; }
- return function (target, propertyKey, descriptor) {
- var method = descriptor.value;
- descriptor.value = function () {
- var args = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- args[_i] = arguments[_i];
- }
- // if we have a result already in the pipeline, pass it along and don't call the tagged method
- if (!alwaysRun && args.length > 0 && args[0].hasOwnProperty("hasResult") && args[0].hasResult) {
- logging_1.Logger.write("[" + args[0].requestId + "] (" + (new Date()).getTime() + ") Skipping request pipeline method " + propertyKey + ", existing result in pipeline.", logging_1.LogLevel.Verbose);
- return Promise.resolve(args[0]);
- }
- // apply the tagged method
- logging_1.Logger.write("[" + args[0].requestId + "] (" + (new Date()).getTime() + ") Calling request pipeline method " + propertyKey + ".", logging_1.LogLevel.Verbose);
- return method.apply(target, args);
- };
- };
- }
- /**
- * Contains the methods used within the request pipeline
- */
- var PipelineMethods = (function () {
- function PipelineMethods() {
- }
- /**
- * Logs the start of the request
- */
- PipelineMethods.logStart = function (context) {
- return new Promise(function (resolve) {
- logging_1.Logger.log({
- data: logging_1.Logger.activeLogLevel === logging_1.LogLevel.Info ? {} : context,
- level: logging_1.LogLevel.Info,
- message: "[" + context.requestId + "] (" + (new Date()).getTime() + ") Beginning " + context.verb + " request to " + context.requestAbsoluteUrl,
- });
- resolve(context);
- });
- };
- /**
- * Handles caching of the request
- */
- PipelineMethods.caching = function (context) {
- return new Promise(function (resolve) {
- // handle caching, if applicable
- if (context.verb === "GET" && context.isCached) {
- logging_1.Logger.write("[" + context.requestId + "] (" + (new Date()).getTime() + ") Caching is enabled for request, checking cache...", logging_1.LogLevel.Info);
- var cacheOptions = new caching_1.CachingOptions(context.requestAbsoluteUrl.toLowerCase());
- if (typeof context.cachingOptions !== "undefined") {
- cacheOptions = util_1.Util.extend(cacheOptions, context.cachingOptions);
- }
- // we may not have a valid store, i.e. on node
- if (cacheOptions.store !== null) {
- // check if we have the data in cache and if so resolve the promise and return
- var data = cacheOptions.store.get(cacheOptions.key);
- if (data !== null) {
- // ensure we clear any help batch dependency we are resolving from the cache
- logging_1.Logger.log({
- data: logging_1.Logger.activeLogLevel === logging_1.LogLevel.Info ? {} : data,
- level: logging_1.LogLevel.Info,
- message: "[" + context.requestId + "] (" + (new Date()).getTime() + ") Value returned from cache.",
- });
- context.batchDependency();
- return PipelineMethods.setResult(context, data).then(function (ctx) { return resolve(ctx); });
- }
- }
- logging_1.Logger.write("[" + context.requestId + "] (" + (new Date()).getTime() + ") Value not found in cache.", logging_1.LogLevel.Info);
- // if we don't then wrap the supplied parser in the caching parser wrapper
- // and send things on their way
- context.parser = new caching_1.CachingParserWrapper(context.parser, cacheOptions);
- }
- return resolve(context);
- });
- };
- /**
- * Sends the request
- */
- PipelineMethods.send = function (context) {
- return new Promise(function (resolve, reject) {
- // send or batch the request
- if (context.isBatched) {
- // we are in a batch, so add to batch, remove dependency, and resolve with the batch's promise
- var p = context.batch.add(context.requestAbsoluteUrl, context.verb, context.options, context.parser);
- // we release the dependency here to ensure the batch does not execute until the request is added to the batch
- context.batchDependency();
- logging_1.Logger.write("[" + context.requestId + "] (" + (new Date()).getTime() + ") Batching request.", logging_1.LogLevel.Info);
- resolve(p.then(function (result) { return PipelineMethods.setResult(context, result); }));
- }
- else {
- logging_1.Logger.write("[" + context.requestId + "] (" + (new Date()).getTime() + ") Sending request.", logging_1.LogLevel.Info);
- // we are not part of a batch, so proceed as normal
- var client = new httpclient_1.HttpClient();
- var opts = util_1.Util.extend(context.options || {}, { method: context.verb });
- client.fetch(context.requestAbsoluteUrl, opts)
- .then(function (response) { return context.parser.parse(response); })
- .then(function (result) { return PipelineMethods.setResult(context, result); })
- .then(function (ctx) { return resolve(ctx); })
- .catch(function (e) { return reject(e); });
- }
- });
- };
- /**
- * Logs the end of the request
- */
- PipelineMethods.logEnd = function (context) {
- return new Promise(function (resolve) {
- logging_1.Logger.log({
- data: logging_1.Logger.activeLogLevel === logging_1.LogLevel.Info ? {} : context,
- level: logging_1.LogLevel.Info,
- message: "[" + context.requestId + "] (" + (new Date()).getTime() + ") Completing " + context.verb + " request to " + context.requestAbsoluteUrl,
- });
- resolve(context);
- });
- };
- /**
- * At the end of the pipeline resolves the request's result
- */
- PipelineMethods.returnResult = function (context) {
- logging_1.Logger.log({
- data: context.result,
- level: logging_1.LogLevel.Verbose,
- message: "[" + context.requestId + "] (" + (new Date()).getTime() + ") Returning, see data property for value.",
- });
- return Promise.resolve(context.result);
- };
- /**
- * Sets the result on the context
- */
- PipelineMethods.setResult = function (context, value) {
- return new Promise(function (resolve) {
- context.result = value;
- context.hasResult = true;
- resolve(context);
- });
- };
- return PipelineMethods;
- }());
- __decorate([
- requestPipelineMethod(true)
- ], PipelineMethods, "logStart", null);
- __decorate([
- requestPipelineMethod()
- ], PipelineMethods, "caching", null);
- __decorate([
- requestPipelineMethod()
- ], PipelineMethods, "send", null);
- __decorate([
- requestPipelineMethod(true)
- ], PipelineMethods, "logEnd", null);
- __decorate([
- requestPipelineMethod(true)
- ], PipelineMethods, "returnResult", null);
- /***/ }),
- /* 46 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var __extends = (this && this.__extends) || (function () {
- var extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- Object.defineProperty(exports, "__esModule", { value: true });
- var queryable_1 = __webpack_require__(1);
- var RelatedItemManagerImpl = (function (_super) {
- __extends(RelatedItemManagerImpl, _super);
- function RelatedItemManagerImpl(baseUrl, path) {
- if (path === void 0) { path = "_api/SP.RelatedItemManager"; }
- return _super.call(this, baseUrl, path) || this;
- }
- RelatedItemManagerImpl.FromUrl = function (url) {
- if (url === null) {
- return new RelatedItemManagerImpl("");
- }
- var index = url.indexOf("_api/");
- if (index > -1) {
- return new RelatedItemManagerImpl(url.substr(0, index));
- }
- return new RelatedItemManagerImpl(url);
- };
- RelatedItemManagerImpl.prototype.getRelatedItems = function (sourceListName, sourceItemId) {
- var query = this.clone(RelatedItemManagerImpl, null, true);
- query.concat(".GetRelatedItems");
- return query.post({
- body: JSON.stringify({
- SourceItemID: sourceItemId,
- SourceListName: sourceListName,
- }),
- });
- };
- RelatedItemManagerImpl.prototype.getPageOneRelatedItems = function (sourceListName, sourceItemId) {
- var query = this.clone(RelatedItemManagerImpl, null, true);
- query.concat(".GetPageOneRelatedItems");
- return query.post({
- body: JSON.stringify({
- SourceItemID: sourceItemId,
- SourceListName: sourceListName,
- }),
- });
- };
- RelatedItemManagerImpl.prototype.addSingleLink = function (sourceListName, sourceItemId, sourceWebUrl, targetListName, targetItemID, targetWebUrl, tryAddReverseLink) {
- if (tryAddReverseLink === void 0) { tryAddReverseLink = false; }
- var query = this.clone(RelatedItemManagerImpl, null, true);
- query.concat(".AddSingleLink");
- return query.post({
- body: JSON.stringify({
- SourceItemID: sourceItemId,
- SourceListName: sourceListName,
- SourceWebUrl: sourceWebUrl,
- TargetItemID: targetItemID,
- TargetListName: targetListName,
- TargetWebUrl: targetWebUrl,
- TryAddReverseLink: tryAddReverseLink,
- }),
- });
- };
- /**
- * Adds a related item link from an item specified by list name and item id, to an item specified by url
- *
- * @param sourceListName The source list name or list id
- * @param sourceItemId The source item id
- * @param targetItemUrl The target item url
- * @param tryAddReverseLink If set to true try to add the reverse link (will not return error if it fails)
- */
- RelatedItemManagerImpl.prototype.addSingleLinkToUrl = function (sourceListName, sourceItemId, targetItemUrl, tryAddReverseLink) {
- if (tryAddReverseLink === void 0) { tryAddReverseLink = false; }
- var query = this.clone(RelatedItemManagerImpl, null, true);
- query.concat(".AddSingleLinkToUrl");
- return query.post({
- body: JSON.stringify({
- SourceItemID: sourceItemId,
- SourceListName: sourceListName,
- TargetItemUrl: targetItemUrl,
- TryAddReverseLink: tryAddReverseLink,
- }),
- });
- };
- /**
- * Adds a related item link from an item specified by url, to an item specified by list name and item id
- *
- * @param sourceItemUrl The source item url
- * @param targetListName The target list name or list id
- * @param targetItemId The target item id
- * @param tryAddReverseLink If set to true try to add the reverse link (will not return error if it fails)
- */
- RelatedItemManagerImpl.prototype.addSingleLinkFromUrl = function (sourceItemUrl, targetListName, targetItemId, tryAddReverseLink) {
- if (tryAddReverseLink === void 0) { tryAddReverseLink = false; }
- var query = this.clone(RelatedItemManagerImpl, null, true);
- query.concat(".AddSingleLinkFromUrl");
- return query.post({
- body: JSON.stringify({
- SourceItemUrl: sourceItemUrl,
- TargetItemID: targetItemId,
- TargetListName: targetListName,
- TryAddReverseLink: tryAddReverseLink,
- }),
- });
- };
- RelatedItemManagerImpl.prototype.deleteSingleLink = function (sourceListName, sourceItemId, sourceWebUrl, targetListName, targetItemId, targetWebUrl, tryDeleteReverseLink) {
- if (tryDeleteReverseLink === void 0) { tryDeleteReverseLink = false; }
- var query = this.clone(RelatedItemManagerImpl, null, true);
- query.concat(".DeleteSingleLink");
- return query.post({
- body: JSON.stringify({
- SourceItemID: sourceItemId,
- SourceListName: sourceListName,
- SourceWebUrl: sourceWebUrl,
- TargetItemID: targetItemId,
- TargetListName: targetListName,
- TargetWebUrl: targetWebUrl,
- TryDeleteReverseLink: tryDeleteReverseLink,
- }),
- });
- };
- return RelatedItemManagerImpl;
- }(queryable_1.Queryable));
- exports.RelatedItemManagerImpl = RelatedItemManagerImpl;
- /***/ }),
- /* 47 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var __extends = (this && this.__extends) || (function () {
- var extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- Object.defineProperty(exports, "__esModule", { value: true });
- var queryable_1 = __webpack_require__(1);
- /**
- * Describes a collection of webhook subscriptions
- *
- */
- var Subscriptions = (function (_super) {
- __extends(Subscriptions, _super);
- /**
- * Creates a new instance of the Subscriptions class
- *
- * @param baseUrl - The url or Queryable which forms the parent of this webhook subscriptions collection
- */
- function Subscriptions(baseUrl, path) {
- if (path === void 0) { path = "subscriptions"; }
- return _super.call(this, baseUrl, path) || this;
- }
- /**
- * Returns all the webhook subscriptions or the specified webhook subscription
- *
- */
- Subscriptions.prototype.getById = function (subscriptionId) {
- var subscription = new Subscription(this);
- subscription.concat("('" + subscriptionId + "')");
- return subscription;
- };
- /**
- * Create a new webhook subscription
- *
- */
- Subscriptions.prototype.add = function (notificationUrl, expirationDate, clientState) {
- var _this = this;
- var postBody = JSON.stringify({
- "clientState": clientState || "pnp-js-core-subscription",
- "expirationDateTime": expirationDate,
- "notificationUrl": notificationUrl,
- "resource": this.toUrl(),
- });
- return this.post({ body: postBody, headers: { "Content-Type": "application/json" } }).then(function (result) {
- return { data: result, subscription: _this.getById(result.id) };
- });
- };
- return Subscriptions;
- }(queryable_1.QueryableCollection));
- exports.Subscriptions = Subscriptions;
- /**
- * Describes a single webhook subscription instance
- *
- */
- var Subscription = (function (_super) {
- __extends(Subscription, _super);
- function Subscription() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- /**
- * Update a webhook subscription
- *
- */
- Subscription.prototype.update = function (expirationDate) {
- var _this = this;
- var postBody = JSON.stringify({
- "expirationDateTime": expirationDate,
- });
- return this.patch({ body: postBody, headers: { "Content-Type": "application/json" } }).then(function (data) {
- return { data: data, subscription: _this };
- });
- };
- /**
- * Remove a webhook subscription
- *
- */
- Subscription.prototype.delete = function () {
- return _super.prototype.delete.call(this);
- };
- return Subscription;
- }(queryable_1.QueryableInstance));
- exports.Subscription = Subscription;
- /***/ }),
- /* 48 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var __extends = (this && this.__extends) || (function () {
- var extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- Object.defineProperty(exports, "__esModule", { value: true });
- var queryable_1 = __webpack_require__(1);
- var files_1 = __webpack_require__(51);
- var odata_1 = __webpack_require__(2);
- var UserProfileQuery = (function (_super) {
- __extends(UserProfileQuery, _super);
- function UserProfileQuery(baseUrl, path) {
- if (path === void 0) { path = "_api/sp.userprofiles.peoplemanager"; }
- var _this = _super.call(this, baseUrl, path) || this;
- _this.profileLoader = new ProfileLoader(baseUrl);
- return _this;
- }
- Object.defineProperty(UserProfileQuery.prototype, "editProfileLink", {
- /**
- * The URL of the edit profile page for the current user.
- */
- get: function () {
- return this.clone(UserProfileQuery, "EditProfileLink").getAs(odata_1.ODataValue());
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(UserProfileQuery.prototype, "isMyPeopleListPublic", {
- /**
- * A Boolean value that indicates whether the current user's People I'm Following list is public.
- */
- get: function () {
- return this.clone(UserProfileQuery, "IsMyPeopleListPublic").getAs(odata_1.ODataValue());
- },
- enumerable: true,
- configurable: true
- });
- /**
- * A Boolean value that indicates whether the current user's People I'm Following list is public.
- *
- * @param loginName The account name of the user
- */
- UserProfileQuery.prototype.amIFollowedBy = function (loginName) {
- var q = this.clone(UserProfileQuery, "amifollowedby(@v)", true);
- q.query.add("@v", "'" + encodeURIComponent(loginName) + "'");
- return q.get();
- };
- /**
- * Checks whether the current user is following the specified user.
- *
- * @param loginName The account name of the user
- */
- UserProfileQuery.prototype.amIFollowing = function (loginName) {
- var q = this.clone(UserProfileQuery, "amifollowing(@v)", true);
- q.query.add("@v", "'" + encodeURIComponent(loginName) + "'");
- return q.get();
- };
- /**
- * Gets tags that the user is following.
- *
- * @param maxCount The maximum number of tags to get.
- */
- UserProfileQuery.prototype.getFollowedTags = function (maxCount) {
- if (maxCount === void 0) { maxCount = 20; }
- return this.clone(UserProfileQuery, "getfollowedtags(" + maxCount + ")", true).get();
- };
- /**
- * Gets the people who are following the specified user.
- *
- * @param loginName The account name of the user.
- */
- UserProfileQuery.prototype.getFollowersFor = function (loginName) {
- var q = this.clone(UserProfileQuery, "getfollowersfor(@v)", true);
- q.query.add("@v", "'" + encodeURIComponent(loginName) + "'");
- return q.get();
- };
- Object.defineProperty(UserProfileQuery.prototype, "myFollowers", {
- /**
- * Gets the people who are following the current user.
- *
- */
- get: function () {
- return new queryable_1.QueryableCollection(this, "getmyfollowers");
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(UserProfileQuery.prototype, "myProperties", {
- /**
- * Gets user properties for the current user.
- *
- */
- get: function () {
- return new UserProfileQuery(this, "getmyproperties");
- },
- enumerable: true,
- configurable: true
- });
- /**
- * Gets the people who the specified user is following.
- *
- * @param loginName The account name of the user.
- */
- UserProfileQuery.prototype.getPeopleFollowedBy = function (loginName) {
- var q = this.clone(UserProfileQuery, "getpeoplefollowedby(@v)", true);
- q.query.add("@v", "'" + encodeURIComponent(loginName) + "'");
- return q.get();
- };
- /**
- * Gets user properties for the specified user.
- *
- * @param loginName The account name of the user.
- */
- UserProfileQuery.prototype.getPropertiesFor = function (loginName) {
- var q = this.clone(UserProfileQuery, "getpropertiesfor(@v)", true);
- q.query.add("@v", "'" + encodeURIComponent(loginName) + "'");
- return q.get();
- };
- Object.defineProperty(UserProfileQuery.prototype, "trendingTags", {
- /**
- * Gets the most popular tags.
- *
- */
- get: function () {
- var q = this.clone(UserProfileQuery, null, true);
- q.concat(".gettrendingtags");
- return q.get();
- },
- enumerable: true,
- configurable: true
- });
- /**
- * Gets the specified user profile property for the specified user.
- *
- * @param loginName The account name of the user.
- * @param propertyName The case-sensitive name of the property to get.
- */
- UserProfileQuery.prototype.getUserProfilePropertyFor = function (loginName, propertyName) {
- var q = this.clone(UserProfileQuery, "getuserprofilepropertyfor(accountname=@v, propertyname='" + propertyName + "')", true);
- q.query.add("@v", "'" + encodeURIComponent(loginName) + "'");
- return q.get();
- };
- /**
- * Removes the specified user from the user's list of suggested people to follow.
- *
- * @param loginName The account name of the user.
- */
- UserProfileQuery.prototype.hideSuggestion = function (loginName) {
- var q = this.clone(UserProfileQuery, "hidesuggestion(@v)", true);
- q.query.add("@v", "'" + encodeURIComponent(loginName) + "'");
- return q.post();
- };
- /**
- * Checks whether the first user is following the second user.
- *
- * @param follower The account name of the user who might be following followee.
- * @param followee The account name of the user who might be followed.
- */
- UserProfileQuery.prototype.isFollowing = function (follower, followee) {
- var q = this.clone(UserProfileQuery, null, true);
- q.concat(".isfollowing(possiblefolloweraccountname=@v, possiblefolloweeaccountname=@y)");
- q.query.add("@v", "'" + encodeURIComponent(follower) + "'");
- q.query.add("@y", "'" + encodeURIComponent(followee) + "'");
- return q.get();
- };
- /**
- * Uploads and sets the user profile picture. Not supported for batching.
- *
- * @param profilePicSource Blob data representing the user's picture
- */
- UserProfileQuery.prototype.setMyProfilePic = function (profilePicSource) {
- var _this = this;
- return new Promise(function (resolve, reject) {
- files_1.readBlobAsArrayBuffer(profilePicSource).then(function (buffer) {
- var request = new UserProfileQuery(_this, "setmyprofilepicture");
- request.post({
- body: String.fromCharCode.apply(null, new Uint16Array(buffer)),
- }).then(function (_) { return resolve(); });
- }).catch(function (e) { return reject(e); });
- });
- };
- /**
- * Provisions one or more users' personal sites. (My Site administrator on SharePoint Online only)
- *
- * @param emails The email addresses of the users to provision sites for
- */
- UserProfileQuery.prototype.createPersonalSiteEnqueueBulk = function () {
- var emails = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- emails[_i] = arguments[_i];
- }
- return this.profileLoader.createPersonalSiteEnqueueBulk(emails);
- };
- Object.defineProperty(UserProfileQuery.prototype, "ownerUserProfile", {
- /**
- * Gets the user profile of the site owner.
- *
- */
- get: function () {
- return this.profileLoader.ownerUserProfile;
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(UserProfileQuery.prototype, "userProfile", {
- /**
- * Gets the user profile that corresponds to the current user.
- */
- get: function () {
- return this.profileLoader.userProfile;
- },
- enumerable: true,
- configurable: true
- });
- /**
- * Enqueues creating a personal site for this user, which can be used to share documents, web pages, and other files.
- *
- * @param interactiveRequest true if interactively (web) initiated request, or false if non-interactively (client) initiated request
- */
- UserProfileQuery.prototype.createPersonalSite = function (interactiveRequest) {
- if (interactiveRequest === void 0) { interactiveRequest = false; }
- return this.profileLoader.createPersonalSite(interactiveRequest);
- };
- /**
- * Sets the privacy settings for this profile.
- *
- * @param share true to make all social data public; false to make all social data private.
- */
- UserProfileQuery.prototype.shareAllSocialData = function (share) {
- return this.profileLoader.shareAllSocialData(share);
- };
- return UserProfileQuery;
- }(queryable_1.QueryableInstance));
- exports.UserProfileQuery = UserProfileQuery;
- var ProfileLoader = (function (_super) {
- __extends(ProfileLoader, _super);
- function ProfileLoader(baseUrl, path) {
- if (path === void 0) { path = "_api/sp.userprofiles.profileloader.getprofileloader"; }
- return _super.call(this, baseUrl, path) || this;
- }
- /**
- * Provisions one or more users' personal sites. (My Site administrator on SharePoint Online only)
- *
- * @param emails The email addresses of the users to provision sites for
- */
- ProfileLoader.prototype.createPersonalSiteEnqueueBulk = function (emails) {
- return this.clone(ProfileLoader, "createpersonalsiteenqueuebulk").post({
- body: JSON.stringify({ "emailIDs": emails }),
- });
- };
- Object.defineProperty(ProfileLoader.prototype, "ownerUserProfile", {
- /**
- * Gets the user profile of the site owner.
- *
- */
- get: function () {
- var q = this.getParent(ProfileLoader, this.parentUrl, "_api/sp.userprofiles.profileloader.getowneruserprofile");
- if (this.hasBatch) {
- q = q.inBatch(this.batch);
- }
- return q.postAs();
- },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(ProfileLoader.prototype, "userProfile", {
- /**
- * Gets the user profile that corresponds to the current user.
- *
- */
- get: function () {
- return this.clone(ProfileLoader, "getuserprofile", true).postAs();
- },
- enumerable: true,
- configurable: true
- });
- /**
- * Enqueues creating a personal site for this user, which can be used to share documents, web pages, and other files.
- *
- * @param interactiveRequest true if interactively (web) initiated request, or false if non-interactively (client) initiated request
- */
- ProfileLoader.prototype.createPersonalSite = function (interactiveRequest) {
- if (interactiveRequest === void 0) { interactiveRequest = false; }
- return this.clone(ProfileLoader, "getuserprofile/createpersonalsiteenque(" + interactiveRequest + ")", true).post();
- };
- /**
- * Sets the privacy settings for this profile.
- *
- * @param share true to make all social data public; false to make all social data private.
- */
- ProfileLoader.prototype.shareAllSocialData = function (share) {
- return this.clone(ProfileLoader, "getuserprofile/shareallsocialdata(" + share + ")", true).post();
- };
- return ProfileLoader;
- }(queryable_1.Queryable));
- /***/ }),
- /* 49 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var __extends = (this && this.__extends) || (function () {
- var extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- Object.defineProperty(exports, "__esModule", { value: true });
- var queryable_1 = __webpack_require__(1);
- var util_1 = __webpack_require__(0);
- /**
- * Describes the views available in the current context
- *
- */
- var Views = (function (_super) {
- __extends(Views, _super);
- /**
- * Creates a new instance of the Views class
- *
- * @param baseUrl The url or Queryable which forms the parent of this fields collection
- */
- function Views(baseUrl, path) {
- if (path === void 0) { path = "views"; }
- return _super.call(this, baseUrl, path) || this;
- }
- /**
- * Gets a view by guid id
- *
- * @param id The GUID id of the view
- */
- Views.prototype.getById = function (id) {
- var v = new View(this);
- v.concat("('" + id + "')");
- return v;
- };
- /**
- * Gets a view by title (case-sensitive)
- *
- * @param title The case-sensitive title of the view
- */
- Views.prototype.getByTitle = function (title) {
- return new View(this, "getByTitle('" + title + "')");
- };
- /**
- * Adds a new view to the collection
- *
- * @param title The new views's title
- * @param personalView True if this is a personal view, otherwise false, default = false
- * @param additionalSettings Will be passed as part of the view creation body
- */
- /*tslint:disable max-line-length */
- Views.prototype.add = function (title, personalView, additionalSettings) {
- var _this = this;
- if (personalView === void 0) { personalView = false; }
- if (additionalSettings === void 0) { additionalSettings = {}; }
- var postBody = JSON.stringify(util_1.Util.extend({
- "PersonalView": personalView,
- "Title": title,
- "__metadata": { "type": "SP.View" },
- }, additionalSettings));
- return this.clone(Views, null, true).postAs({ body: postBody }).then(function (data) {
- return {
- data: data,
- view: _this.getById(data.Id),
- };
- });
- };
- return Views;
- }(queryable_1.QueryableCollection));
- exports.Views = Views;
- /**
- * Describes a single View instance
- *
- */
- var View = (function (_super) {
- __extends(View, _super);
- function View() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- Object.defineProperty(View.prototype, "fields", {
- get: function () {
- return new ViewFields(this);
- },
- enumerable: true,
- configurable: true
- });
- /**
- * Updates this view intance with the supplied properties
- *
- * @param properties A plain object hash of values to update for the view
- */
- View.prototype.update = function (properties) {
- var _this = this;
- var postBody = JSON.stringify(util_1.Util.extend({
- "__metadata": { "type": "SP.View" },
- }, properties));
- return this.post({
- body: postBody,
- headers: {
- "X-HTTP-Method": "MERGE",
- },
- }).then(function (data) {
- return {
- data: data,
- view: _this,
- };
- });
- };
- /**
- * Delete this view
- *
- */
- View.prototype.delete = function () {
- return this.post({
- headers: {
- "X-HTTP-Method": "DELETE",
- },
- });
- };
- /**
- * Returns the list view as HTML.
- *
- */
- View.prototype.renderAsHtml = function () {
- return this.clone(queryable_1.Queryable, "renderashtml", true).get();
- };
- return View;
- }(queryable_1.QueryableInstance));
- exports.View = View;
- var ViewFields = (function (_super) {
- __extends(ViewFields, _super);
- function ViewFields(baseUrl, path) {
- if (path === void 0) { path = "viewfields"; }
- return _super.call(this, baseUrl, path) || this;
- }
- /**
- * Gets a value that specifies the XML schema that represents the collection.
- */
- ViewFields.prototype.getSchemaXml = function () {
- return this.clone(queryable_1.Queryable, "schemaxml", true).get();
- };
- /**
- * Adds the field with the specified field internal name or display name to the collection.
- *
- * @param fieldTitleOrInternalName The case-sensitive internal name or display name of the field to add.
- */
- ViewFields.prototype.add = function (fieldTitleOrInternalName) {
- return this.clone(ViewFields, "addviewfield('" + fieldTitleOrInternalName + "')", true).post();
- };
- /**
- * Moves the field with the specified field internal name to the specified position in the collection.
- *
- * @param fieldInternalName The case-sensitive internal name of the field to move.
- * @param index The zero-based index of the new position for the field.
- */
- ViewFields.prototype.move = function (fieldInternalName, index) {
- return this.clone(ViewFields, "moveviewfieldto", true).post({
- body: JSON.stringify({ "field": fieldInternalName, "index": index }),
- });
- };
- /**
- * Removes all the fields from the collection.
- */
- ViewFields.prototype.removeAll = function () {
- return this.clone(ViewFields, "removeallviewfields", true).post();
- };
- /**
- * Removes the field with the specified field internal name from the collection.
- *
- * @param fieldInternalName The case-sensitive internal name of the field to remove from the view.
- */
- ViewFields.prototype.remove = function (fieldInternalName) {
- return this.clone(ViewFields, "removeviewfield('" + fieldInternalName + "')", true).post();
- };
- return ViewFields;
- }(queryable_1.QueryableCollection));
- exports.ViewFields = ViewFields;
- /***/ }),
- /* 50 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- var __extends = (this && this.__extends) || (function () {
- var extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- Object.defineProperty(exports, "__esModule", { value: true });
- var queryable_1 = __webpack_require__(1);
- var LimitedWebPartManager = (function (_super) {
- __extends(LimitedWebPartManager, _super);
- function LimitedWebPartManager() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- Object.defineProperty(LimitedWebPartManager.prototype, "webparts", {
- /**
- * Gets the set of web part definitions contained by this web part manager
- *
- */
- get: function () {
- return new WebPartDefinitions(this, "webparts");
- },
- enumerable: true,
- configurable: true
- });
- /**
- * Exports a webpart definition
- *
- * @param id the GUID id of the definition to export
- */
- LimitedWebPartManager.prototype.export = function (id) {
- return this.clone(LimitedWebPartManager, "ExportWebPart", true).post({
- body: JSON.stringify({ webPartId: id }),
- });
- };
- /**
- * Imports a webpart
- *
- * @param xml webpart definition which must be valid XML in the .dwp or .webpart format
- */
- LimitedWebPartManager.prototype.import = function (xml) {
- return this.clone(LimitedWebPartManager, "ImportWebPart", true).post({
- body: JSON.stringify({ webPartXml: xml }),
- });
- };
- return LimitedWebPartManager;
- }(queryable_1.Queryable));
- exports.LimitedWebPartManager = LimitedWebPartManager;
- var WebPartDefinitions = (function (_super) {
- __extends(WebPartDefinitions, _super);
- function WebPartDefinitions() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- /**
- * Gets a web part definition from the collection by id
- *
- * @param id GUID id of the web part definition to get
- */
- WebPartDefinitions.prototype.getById = function (id) {
- return new WebPartDefinition(this, "getbyid('" + id + "')");
- };
- return WebPartDefinitions;
- }(queryable_1.QueryableCollection));
- exports.WebPartDefinitions = WebPartDefinitions;
- var WebPartDefinition = (function (_super) {
- __extends(WebPartDefinition, _super);
- function WebPartDefinition() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- Object.defineProperty(WebPartDefinition.prototype, "webpart", {
- /**
- * Gets the webpart information associated with this definition
- */
- get: function () {
- return new WebPart(this);
- },
- enumerable: true,
- configurable: true
- });
- /**
- * Removes a webpart from a page, all settings will be lost
- */
- WebPartDefinition.prototype.delete = function () {
- return this.clone(WebPartDefinition, "DeleteWebPart", true).post();
- };
- return WebPartDefinition;
- }(queryable_1.QueryableInstance));
- exports.WebPartDefinition = WebPartDefinition;
- var WebPart = (function (_super) {
- __extends(WebPart, _super);
- /**
- * Creates a new instance of the WebPart class
- *
- * @param baseUrl The url or Queryable which forms the parent of this fields collection
- * @param path Optional, if supplied will be appended to the supplied baseUrl
- */
- function WebPart(baseUrl, path) {
- if (path === void 0) { path = "webpart"; }
- return _super.call(this, baseUrl, path) || this;
- }
- return WebPart;
- }(queryable_1.QueryableInstance));
- exports.WebPart = WebPart;
- /***/ }),
- /* 51 */
- /***/ (function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- /**
- * Reads a blob as text
- *
- * @param blob The data to read
- */
- function readBlobAsText(blob) {
- return readBlobAs(blob, "string");
- }
- exports.readBlobAsText = readBlobAsText;
- /**
- * Reads a blob into an array buffer
- *
- * @param blob The data to read
- */
- function readBlobAsArrayBuffer(blob) {
- return readBlobAs(blob, "buffer");
- }
- exports.readBlobAsArrayBuffer = readBlobAsArrayBuffer;
- /**
- * Generic method to read blob's content
- *
- * @param blob The data to read
- * @param mode The read mode
- */
- function readBlobAs(blob, mode) {
- return new Promise(function (resolve, reject) {
- try {
- var reader = new FileReader();
- reader.onload = function (e) {
- resolve(e.target.result);
- };
- switch (mode) {
- case "string":
- reader.readAsText(blob);
- break;
- case "buffer":
- reader.readAsArrayBuffer(blob);
- break;
- }
- }
- catch (e) {
- reject(e);
- }
- });
- }
- /***/ })
- /******/ ]);
- });
- //# sourceMappingURL=pnp.js.map
- var pnp = $pnp;
Add Comment
Please, Sign In to add comment