diff --git a/dist/pnp-provisioning.js b/dist/pnp-provisioning.js index 4115269b..0ea0c1ce 100644 --- a/dist/pnp-provisioning.js +++ b/dist/pnp-provisioning.js @@ -1,10 +1,10 @@ /** - * sp-pnp-js v1.0.5 - A reusable JavaScript library targeting SharePoint client-side development. + * sp-pnp-js v1.0.6 - A reusable JavaScript library targeting SharePoint client-side development. * MIT (https://github.com/OfficeDev/PnP-JS-Core/blob/master/LICENSE) * Copyright (c) 2016 Microsoft * docs: http://officedev.github.io/PnP-JS-Core - * source: https://github.com/OfficeDev/PnP-JS-Core - * bugs: https://github.com/OfficeDev/PnP-JS-Core/issues + * source: https://github.com/SharePoint/PnP-JS-Core + * bugs: https://github.com/SharePoint/PnP-JS-Core/issues */ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}(g.$pnp || (g.$pnp = {})).Provisioning = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o 0) { - setTimeout(function () { return _this.execute(); }, 100); - } - else { - _this.executeImpl().then(function () { return resolve(); }).catch(reject); - } - }); + return this._batchDependencies.then(function () { return _this.executeImpl(); }); }; ODataBatch.prototype.executeImpl = function () { var _this = this; if (this._requests.length < 1) { - return new Promise(function (r) { return r(); }); + return Promise.resolve(); } var batchBody = []; var currentChangeSetId = ""; @@ -2006,23 +2014,27 @@ var ODataBatch = (function () { "headers": batchHeaders, }; var client = new httpclient_1.HttpClient(); - return client.post(util_1.Util.makeUrlAbsolute("/_api/$batch"), batchOptions) + var requestUrl = util_1.Util.makeUrlAbsolute(util_1.Util.combinePaths(this.baseUrl, "/_api/$batch")); + return client.post(requestUrl, batchOptions) .then(function (r) { return r.text(); }) .then(this._parseResponse) .then(function (responses) { if (responses.length !== _this._requests.length) { throw new Error("Could not properly parse responses to match requests in batch."); } - var resolutions = []; - for (var i = 0; i < responses.length; i++) { + var chain = Promise.resolve(); + var _loop_1 = function(i) { var request = _this._requests[i]; var response = responses[i]; if (!response.ok) { request.reject(new Error(response.statusText)); } - resolutions.push(request.parser.parse(response).then(request.resolve).catch(request.reject)); + chain = chain.then(function (_) { return request.parser.parse(response).then(request.resolve).catch(request.reject); }); + }; + for (var i = 0; i < responses.length; i++) { + _loop_1(i); } - return Promise.all(resolutions); + return chain; }); }; ODataBatch.prototype._parseResponse = function (body) { diff --git a/dist/pnp-provisioning.min.js b/dist/pnp-provisioning.min.js index cd2c3ce1..8da1f43d 100644 --- a/dist/pnp-provisioning.min.js +++ b/dist/pnp-provisioning.min.js @@ -1,11 +1,11 @@ /** - * sp-pnp-js v1.0.5 - A reusable JavaScript library targeting SharePoint client-side development. + * sp-pnp-js v1.0.6 - A reusable JavaScript library targeting SharePoint client-side development. * MIT (https://github.com/OfficeDev/PnP-JS-Core/blob/master/LICENSE) * Copyright (c) 2016 Microsoft * docs: http://officedev.github.io/PnP-JS-Core - * source: https://github.com/OfficeDev/PnP-JS-Core - * bugs: https://github.com/OfficeDev/PnP-JS-Core/issues + * source: https://github.com/SharePoint/PnP-JS-Core + * bugs: https://github.com/SharePoint/PnP-JS-Core/issues */ -!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,(t.$pnp||(t.$pnp={})).Provisioning=e()}}(function(){return function e(t,n,o){function r(s,a){if(!n[s]){if(!t[s]){var c="function"==typeof require&&require;if(!a&&c)return c(s,!0);if(i)return i(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var l=n[s]={exports:{}};t[s][0].call(l.exports,function(e){var n=t[s][1][e];return r(n?n:e)},l,l.exports,e,t,n,o)}return n[s].exports}for(var i="function"==typeof require&&require,s=0;s-1?this.values[n]=t:(this.keys.push(e),this.values.push(t))},e.prototype.merge=function(e){if(o.Util.isFunction(e.getKeys))for(var t=e,n=t.getKeys(),r=n.length,i=0;i0;if(!t){var n=s.add();e.Description&&n.set_description(e.Description),e.CommandUIExtension&&n.set_commandUIExtension(e.CommandUIExtension),e.Group&&n.set_group(e.Group),e.Title&&n.set_title(e.Title),e.Url&&n.set_url(e.Url),e.ScriptBlock&&n.set_scriptBlock(e.ScriptBlock),e.ScriptSrc&&n.set_scriptSrc(e.ScriptSrc),e.Location&&n.set_location(e.Location),e.ImageUrl&&n.set_imageUrl(e.ImageUrl),e.Name&&n.set_name(e.Name),e.RegistrationId&&n.set_registrationId(e.RegistrationId),e.RegistrationType&&n.set_registrationType(e.RegistrationType),e.Rights&&n.set_rights(e.Rights),e.Sequence&&n.set_sequence(e.Sequence),n.update()}}),i.executeQueryAsync(function(){e.prototype.scope_ended.call(n),o()},function(){e.prototype.scope_ended.call(n),o()})},function(){e.prototype.scope_ended.call(n),o()})})},t}(r.ObjectHandlerBase);n.ObjectCustomActions=i},{"./objecthandlerbase":12}],10:[function(e,t,n){"use strict";var o=this&&this.__extends||function(e,t){function n(){this.constructor=e}for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o]);e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},r=e("./objecthandlerbase"),i=function(e){function t(){e.call(this,"Features")}return o(t,e),t.prototype.ProvisionObjects=function(t){var n=this;return e.prototype.scope_started.call(this),new Promise(function(o,r){var i=SP.ClientContext.get_current(),s=i.get_web(),a=s.get_features();t.forEach(function(e){e.Deactivate===!0?a.remove(new SP.Guid(e.ID),!0):a.add(new SP.Guid(e.ID),!0,SP.FeatureDefinitionScope.none)}),s.update(),i.load(a),i.executeQueryAsync(function(){e.prototype.scope_ended.call(n),o()},function(){e.prototype.scope_ended.call(n),o()})})},t}(r.ObjectHandlerBase);n.ObjectFeatures=i},{"./objecthandlerbase":12}],11:[function(e,t,n){"use strict";var o=this&&this.__extends||function(e,t){function n(){this.constructor=e}for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o]);e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},r=e("../../../utils/util"),i=e("../util"),s=e("./objecthandlerbase"),a=function(e){function t(){e.call(this,"Files")}return o(t,e),t.prototype.ProvisionObjects=function(t){var n=this;return e.prototype.scope_started.call(this),new Promise(function(o,s){var a=SP.ClientContext.get_current(),c=a.get_web(),u=[],l=[];t.forEach(function(e,t){l.push(n.httpClient.fetchRaw(i.Util.replaceUrlTokens(e.Src)).then(function(e){return e.text()}))}),Promise.all(l).then(function(e){e.forEach(function(e,o){var i=t[o],s=n.GetFilenameFromFilePath(i.Dest),l=_spPageContextInfo.webServerRelativeUrl,p=c.getFolderByServerRelativeUrl(l+"/"+n.GetFolderFromFilePath(i.Dest)),f={Contents:e,Dest:i.Dest,Filename:s,Folder:p,Instance:null,Overwrite:!1,Properties:[],RemoveExistingWebParts:!0,ServerRelativeUrl:i.Dest,Src:i.Src,Views:[],WebParts:[]};if(r.Util.extend(f,i),f.Filename.indexOf("Form.aspx")===-1){var d=new SP.FileCreationInformation;d.set_overwrite(f.Overwrite),d.set_url(f.Filename),d.set_content(new SP.Base64EncodedByteArray);for(var h=0;h0&&l.push(n.ApplyFileProperties(e.Dest,e.Properties)),e.WebParts&&e.WebParts.length>0&&l.push(n.AddWebPartsToWebPartPage(e.Dest,e.Src,e.WebParts,e.RemoveExistingWebParts))}),Promise.all(l).then(function(){n.ModifyHiddenViews(t).then(function(t){e.prototype.scope_ended.call(n),o(t)},function(t){e.prototype.scope_ended.call(n),s(t)})})},function(t){e.prototype.scope_ended.call(n),s(t)})})},t.prototype.RemoveWebPartsFromFileIfSpecified=function(e,t,n){return new Promise(function(o,r){n||o();var i=t.get_webParts();e.load(i),e.executeQueryAsync(function(){i.get_data().forEach(function(e){e.deleteWebPart()}),e.load(i),e.executeQueryAsync(o,r)},r)})},t.prototype.GetWebPartXml=function(e){var t=this;return new Promise(function(n,o){var r=[];e.forEach(function(e,n){if(e.Contents.FileUrl){var o=i.Util.replaceUrlTokens(e.Contents.FileUrl);r.push(t.httpClient.fetchRaw(o).then(function(e){return e.text()}))}else r.push(function(){return new Promise(function(e,t){e()})}())}),Promise.all(r).then(function(t){t.forEach(function(t,n){var o=e[n];null!==o&&t&&t.length>0&&(o.Contents.Xml=t)}),n(e)})})},t.prototype.AddWebPartsToWebPartPage=function(e,t,n,o){var r=this;return new Promise(function(t,s){var a=SP.ClientContext.get_current(),c=a.get_web(),u=_spPageContextInfo.webServerRelativeUrl+"/"+e,l=c.getFileByServerRelativeUrl(u);a.load(l),a.executeQueryAsync(function(){var e=l.getLimitedWebPartManager(SP.WebParts.PersonalizationScope.shared);r.RemoveWebPartsFromFileIfSpecified(a,e,o).then(function(){r.GetWebPartXml(n).then(function(n){n.forEach(function(t){if(t.Contents.Xml){var n=e.importWebPart(i.Util.replaceUrlTokens(t.Contents.Xml)),o=n.get_webPart();e.addWebPart(o,t.Zone,t.Order)}}),a.executeQueryAsync(t,t)})})},t)})},t.prototype.ApplyFileProperties=function(e,t){return new Promise(function(n,o){var r=SP.ClientContext.get_current(),i=r.get_web(),s=_spPageContextInfo.webServerRelativeUrl+"/"+e,a=i.getFileByServerRelativeUrl(s),c=a.get_listItemAllFields();Object.keys(t).forEach(function(e){c.set_item(e,t[e])}),c.update(),r.executeQueryAsync(n,n)})},t.prototype.GetViewFromCollectionByUrl=function(e,t){for(var n=_spPageContextInfo.webServerRelativeUrl+"/"+t,o=e.getEnumerator();o.moveNext();){var r=o.get_current();if(r.get_serverRelativeUrl().toString().toLowerCase()===n.toLowerCase())return r}return null},t.prototype.ModifyHiddenViews=function(e){var t=this;return new Promise(function(n,o){var i=SP.ClientContext.get_current(),s=i.get_web(),a={},c=[],u=[];e.forEach(function(e){e.Views&&e.Views.forEach(function(t){a[t.List]=a[t.List]||[],a[t.List].push(r.Util.extend(t,{Url:e.Dest}))})}),Object.keys(a).forEach(function(e,t){c.push(s.get_lists().getByTitle(e)),u.push(s.get_lists().getByTitle(e).get_views()),i.load(c[t]),i.load(u[t])}),i.executeQueryAsync(function(){Object.keys(a).forEach(function(e,n){var o=a[e],r=c[n],s=u[n];o.forEach(function(e){var n=t.GetViewFromCollectionByUrl(s,e.Url);if(null!=n){if(e.Paged&&n.set_paged(e.Paged),e.Query&&n.set_viewQuery(e.Query),e.RowLimit&&n.set_rowLimit(e.RowLimit),e.ViewFields&&e.ViewFields.length>0){var o=n.get_viewFields();o.removeAll(),e.ViewFields.forEach(function(e){o.add(e)})}n.update()}}),i.load(s),r.update()}),i.executeQueryAsync(n,n)},n)})},t.prototype.GetFolderFromFilePath=function(e){var t=e.split("/");return t.splice(0,t.length-1).join("/")},t.prototype.GetFilenameFromFilePath=function(e){var t=e.split("/");return t[t.length-1]},t}(s.ObjectHandlerBase);n.ObjectFiles=a},{"../../../utils/util":23,"../util":20,"./objecthandlerbase":12}],12:[function(e,t,n){"use strict";var o=e("../../../net/httpclient"),r=e("../../../utils/logging"),i=function(){function e(e){this.name=e,this.httpClient=new o.HttpClient}return e.prototype.ProvisionObjects=function(e,t){return new Promise(function(e,t){e("Not implemented.")})},e.prototype.scope_started=function(){r.Logger.write(this.name+": Code execution scope started")},e.prototype.scope_ended=function(){r.Logger.write(this.name+": Code execution scope stopped")},e}();n.ObjectHandlerBase=i},{"../../../net/httpclient":5,"../../../utils/logging":22}],13:[function(e,t,n){"use strict";var o=this&&this.__extends||function(e,t){function n(){this.constructor=e}for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o]);e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},r=e("../sequencer/sequencer"),i=e("./objecthandlerbase"),s=function(e){function t(){e.call(this,"Lists")}return o(t,e),t.prototype.ProvisionObjects=function(t){var n=this;return e.prototype.scope_started.call(this),new Promise(function(o,i){var s=SP.ClientContext.get_current(),a=s.get_web().get_lists(),c=[];s.load(a),s.executeQueryAsync(function(){t.forEach(function(e,t){var n=a.get_data().filter(function(t){return t.get_title()===e.Title})[0];if(n)e.Description&&n.set_description(e.Description),void 0!==e.EnableVersioning&&n.set_enableVersioning(e.EnableVersioning),void 0!==e.EnableMinorVersions&&n.set_enableMinorVersions(e.EnableMinorVersions),void 0!==e.EnableModeration&&n.set_enableModeration(e.EnableModeration),void 0!==e.EnableFolderCreation&&n.set_enableFolderCreation(e.EnableFolderCreation),void 0!==e.EnableAttachments&&n.set_enableAttachments(e.EnableAttachments),void 0!==e.NoCrawl&&n.set_noCrawl(e.NoCrawl),e.DefaultDisplayFormUrl&&n.set_defaultDisplayFormUrl(e.DefaultDisplayFormUrl),e.DefaultEditFormUrl&&n.set_defaultEditFormUrl(e.DefaultEditFormUrl),e.DefaultNewFormUrl&&n.set_defaultNewFormUrl(e.DefaultNewFormUrl),e.DraftVersionVisibility&&n.set_draftVersionVisibility(SP.DraftVisibilityType[e.DraftVersionVisibility]),e.ImageUrl&&n.set_imageUrl(e.ImageUrl),void 0!==e.Hidden&&n.set_hidden(e.Hidden),void 0!==e.ForceCheckout&&n.set_forceCheckout(e.ForceCheckout),n.update(),c.push(n),s.load(c[t]);else{var o=new SP.ListCreationInformation;if(e.Description&&o.set_description(e.Description),void 0!==e.OnQuickLaunch){var r=e.OnQuickLaunch?SP.QuickLaunchOptions.on:SP.QuickLaunchOptions.off;o.set_quickLaunchOption(r)}e.TemplateType&&o.set_templateType(e.TemplateType),e.Title&&o.set_title(e.Title),e.Url&&o.set_url(e.Url);var i=a.add(o);if(void 0!==e.EnableVersioning&&i.set_enableVersioning(e.EnableVersioning),void 0!==e.EnableMinorVersions&&i.set_enableMinorVersions(e.EnableMinorVersions),void 0!==e.EnableModeration&&i.set_enableModeration(e.EnableModeration),void 0!==e.EnableFolderCreation&&i.set_enableFolderCreation(e.EnableFolderCreation),void 0!==e.EnableAttachments&&i.set_enableAttachments(e.EnableAttachments),void 0!==e.NoCrawl&&i.set_noCrawl(e.NoCrawl),e.DefaultDisplayFormUrl&&i.set_defaultDisplayFormUrl(e.DefaultDisplayFormUrl),e.DefaultEditFormUrl&&i.set_defaultEditFormUrl(e.DefaultEditFormUrl),e.DefaultNewFormUrl&&i.set_defaultNewFormUrl(e.DefaultNewFormUrl),e.DraftVersionVisibility){var r=SP.DraftVisibilityType[e.DraftVersionVisibility.toLocaleLowerCase()];i.set_draftVersionVisibility(r)}e.ImageUrl&&i.set_imageUrl(e.ImageUrl),void 0!==e.Hidden&&i.set_hidden(e.Hidden),void 0!==e.ForceCheckout&&i.set_forceCheckout(e.ForceCheckout),c.push(i),s.load(c[t])}}),s.executeQueryAsync(function(){var i=new r.Sequencer([n.ApplyContentTypeBindings,n.ApplyListInstanceFieldRefs,n.ApplyFields,n.ApplyLookupFields,n.ApplyListSecurity,n.CreateViews,n.InsertDataRows,n.CreateFolders],{ClientContext:s,ListInstances:c,Objects:t},n);i.execute().then(function(){e.prototype.scope_ended.call(n),o()})},function(){e.prototype.scope_ended.call(n),o()})},function(){e.prototype.scope_ended.call(n),o()})})},t.prototype.EnsureLocationBasedMetadataDefaultsReceiver=function(e,t){var n=t.get_eventReceivers(),o=new SP.EventReceiverDefinitionCreationInformation;o.set_receiverName("LocationBasedMetadataDefaultsReceiver ItemAdded"),o.set_synchronization(1),o.set_sequenceNumber(1e3),o.set_receiverAssembly("Microsoft.Office.DocumentManagement, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"),o.set_receiverClass("Microsoft.Office.DocumentManagement.LocationBasedMetadataDefaultsReceiver"),o.set_eventType(SP.EventReceiverType.itemAdded),n.add(o),t.update()},t.prototype.CreateFolders=function(e){var t=this;return new Promise(function(n,o){e.ListInstances.forEach(function(n,o){var r=e.Objects[o];if(r.Folders){var i=_spPageContextInfo.webServerRelativeUrl+"/"+r.Url,s=n.get_rootFolder(),a="",c=!1;if(r.Folders.forEach(function(e){var t=i+"/"+e.Name;if(s.get_folders().add(t),e.DefaultValues){var n=Object.keys(e.DefaultValues).length;n>0&&(a+="",Object.keys(e.DefaultValues).forEach(function(t){a+=''+e.DefaultValues[t]+""}),a+=""),c=!0}}),a+="",c){var u=new SP.FileCreationInformation;u.set_url(i+"/Forms/client_LocationBasedDefaults.html"),u.set_content(new SP.Base64EncodedByteArray),u.set_overwrite(!0);for(var l=0;l0&&s.get_data().forEach(function(e){a.push(e)}),i.ContentTypeBindings.forEach(function(e){s.addExistingContentType(o.getById(e.ContentTypeId))}),i.RemoveExistingContentTypes&&i.ContentTypeBindings.length>0)for(var c=0;c0))return null;o="{"+i[0].get_id().toString()+"}"}}),o="","Calculated"===e.Type&&(o+=""+e.Formula+""),o+=""}return o},t.prototype.ApplyListSecurity=function(e){return new Promise(function(t,n){e.ListInstances.forEach(function(t,n){var o=e.Objects[n];o.Security&&o.Security.BreakRoleInheritance&&(t.breakRoleInheritance(o.Security.CopyRoleAssignments,o.Security.ClearSubscopes),t.update(),e.ClientContext.load(t.get_roleAssignments()))});var o=e.ClientContext.get_web(),r=o.get_allProperties(),i=o.get_siteGroups(),s=o.get_roleDefinitions();e.ClientContext.load(r),e.ClientContext.load(s),e.ClientContext.executeQueryAsync(function(){e.ListInstances.forEach(function(t,n){var o=e.Objects[n];o.Security&&(o.Security.RoleAssignments.forEach(function(n){var o=null;o="number"==typeof n.RoleDefinition?s.getById(n.RoleDefinition):s.getByName(n.RoleDefinition);var a=SP.RoleDefinitionBindingCollection.newObject(e.ClientContext);a.add(o);var c=null;if(n.Principal.match(/\{[A-Za-z]*\}+/g)){var u=n.Principal.substring(1,n.Principal.length-1),l=r.get_fieldValues()["vti_"+u];c=i.getById(l)}else c=i.getByName(c);t.get_roleAssignments().add(c,a)}),t.update())}),e.ClientContext.executeQueryAsync(t,t)},t)})},t.prototype.CreateViews=function(e){return new Promise(function(t,n){var o=[];e.ListInstances.forEach(function(t,n){o.push(t.get_views()),e.ClientContext.load(o[n])}),e.ClientContext.executeQueryAsync(function(){e.ListInstances.forEach(function(t,n){var r=e.Objects[n];r.Views&&(o.push(t.get_views()),e.ClientContext.load(o[n]),r.Views.forEach(function(i){var s=o[n].get_data().filter(function(e){return r.RemoveExistingViews&&r.Views.length>0?(e.deleteObject(),!1):e.get_title()===i.Title}).length>0;if(s){var a=o[n].getByTitle(i.Title);if(i.Paged&&a.set_paged(i.Paged),i.Query&&a.set_viewQuery(i.Query),i.RowLimit&&a.set_rowLimit(i.RowLimit),i.ViewFields&&i.ViewFields.length>0){var c=a.get_viewFields();c.removeAll(),i.ViewFields.forEach(function(e){c.add(e)})}i.Scope&&a.set_scope(i.Scope),a.update()}else{var u=new SP.ViewCreationInformation;i.Title&&u.set_title(i.Title),i.PersonalView&&u.set_personalView(i.PersonalView),i.Paged&&u.set_paged(i.Paged),i.Query&&u.set_query(i.Query),i.RowLimit&&u.set_rowLimit(i.RowLimit),i.SetAsDefaultView&&u.set_setAsDefaultView(i.SetAsDefaultView),i.ViewFields&&u.set_viewFields(i.ViewFields),i.ViewTypeKind&&u.set_viewTypeKind(SP.ViewType.html);var a=t.get_views().add(u);i.Scope&&(a.set_scope(i.Scope),a.update()),t.update()}e.ClientContext.load(t.get_views())}))}),e.ClientContext.executeQueryAsync(t,t)},t)})},t.prototype.InsertDataRows=function(e){return new Promise(function(t,n){e.ListInstances.forEach(function(t,n){var o=e.Objects[n];o.DataRows&&o.DataRows.forEach(function(n){var o=t.addItem(new SP.ListItemCreationInformation);Object.keys(n).forEach(function(e){o.set_item(e,n[e])}),o.update(),e.ClientContext.load(o)})}),e.ClientContext.executeQueryAsync(t,t)})},t}(i.ObjectHandlerBase);n.ObjectLists=s},{"../sequencer/sequencer":19,"./objecthandlerbase":12}],14:[function(e,t,n){"use strict";var o=this&&this.__extends||function(e,t){function n(){this.constructor=e}for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o]);e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},r=e("../util"),i=e("./objecthandlerbase"),s=function(e){function t(){e.call(this,"Navigation")}return o(t,e),t.prototype.ProvisionObjects=function(t){var n=this;e.prototype.scope_started.call(this);var o=SP.ClientContext.get_current(),r=o.get_web().get_navigation();return new Promise(function(i,s){n.ConfigureQuickLaunch(t.QuickLaunch,o,n.httpClient,r).then(function(){e.prototype.scope_ended.call(n),i()},function(){e.prototype.scope_ended.call(n),s()})})},t.prototype.getNodeFromCollectionByTitle=function(e,t){var n=e.filter(function(e){return e.get_title()===t});return n[0]||null},t.prototype.ConfigureQuickLaunch=function(e,t,n,o){var i=this;return new Promise(function(s,a){if(0===e.length)s();else{var c=o.get_quickLaunch();t.load(c),t.executeQueryAsync(function(){for(var a=[],u=c.get_count()-1;u>=0;){var l=c.itemAt(u);a.push(l),l.deleteObject(),u--}t.executeQueryAsync(function(){e.forEach(function(e){var t=i.getNodeFromCollectionByTitle(a,e.Title),n=new SP.NavigationNodeCreationInformation;n.set_title(e.Title),n.set_url(t?t.get_url():r.Util.replaceUrlTokens(e.Url)),n.set_asLastNode(!0),c.add(n)}),t.executeQueryAsync(function(){n.get(_spPageContextInfo.webAbsoluteUrl+"/_api/web/Navigation/QuickLaunch").then(function(n){n.json().then(function(n){n.value.forEach(function(t){var n=o.getNodeById(t.Id),s=n.get_children(),c=e.filter(function(e){return e.Title===t.Title})[0];c&&c.Children&&c.Children.forEach(function(e){var t=i.getNodeFromCollectionByTitle(a,e.Title),n=new SP.NavigationNodeCreationInformation;n.set_title(e.Title),n.set_url(t?t.get_url():r.Util.replaceUrlTokens(e.Url)),n.set_asLastNode(!0),s.add(n)})}),t.executeQueryAsync(s,s)})})},s)})})}})},t}(i.ObjectHandlerBase);n.ObjectNavigation=s},{"../util":20,"./objecthandlerbase":12}],15:[function(e,t,n){"use strict";var o=this&&this.__extends||function(e,t){function n(){this.constructor=e}for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o]);e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},r=e("../util"),i=e("./objecthandlerbase"),s=function(e){function t(){e.call(this,"PropertyBagEntries")}return o(t,e),t.prototype.ProvisionObjects=function(t){var n=this;return e.prototype.scope_started.call(this),new Promise(function(o,i){if(t&&0!==t.length){for(var s=SP.ClientContext.get_current(),a=s.get_web(),c=a.get_allProperties(),u=[],l=0;l0?(c.set_item("vti_indexedpropertykeys",u.join("|")),a.update(),s.executeQueryAsync(function(){e.prototype.scope_ended.call(n),o()},function(){e.prototype.scope_ended.call(n),o()})):(e.prototype.scope_ended.call(n),o())},function(){e.prototype.scope_ended.call(n),o()})}else o()})},t}(i.ObjectHandlerBase);n.ObjectPropertyBagEntries=s},{"../util":20,"./objecthandlerbase":12}],16:[function(e,t,n){"use strict";var o=this&&this.__extends||function(e,t){function n(){this.constructor=e}for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o]);e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},r=e("./objecthandlerbase"),i=function(e){function t(){e.call(this,"WebSettings")}return o(t,e),t.prototype.ProvisionObjects=function(t){var n=this;return e.prototype.scope_started.call(this),new Promise(function(o,r){var i=SP.ClientContext.get_current(),s=i.get_web(); -t.WelcomePage&&(s.get_rootFolder().set_welcomePage(t.WelcomePage),s.get_rootFolder().update()),t.MasterUrl&&s.set_masterUrl(t.MasterUrl),t.CustomMasterUrl&&s.set_customMasterUrl(t.CustomMasterUrl),void 0!==t.SaveSiteAsTemplateEnabled&&s.set_saveSiteAsTemplateEnabled(t.SaveSiteAsTemplateEnabled),void 0!==t.QuickLaunchEnabled&&s.set_saveSiteAsTemplateEnabled(t.QuickLaunchEnabled),void 0!==t.TreeViewEnabled&&s.set_treeViewEnabled(t.TreeViewEnabled),s.update(),i.load(s),i.executeQueryAsync(function(){e.prototype.scope_ended.call(n),o()},function(){e.prototype.scope_ended.call(n),o()})})},t}(r.ObjectHandlerBase);n.ObjectWebSettings=i},{"./objecthandlerbase":12}],17:[function(e,t,n){"use strict";var o=e("./provisioningstep"),r=e("./objecthandlers/objectnavigation"),i=e("./objecthandlers/objectpropertybagentries"),s=e("./objecthandlers/objectfeatures"),a=e("./objecthandlers/objectwebsettings"),c=e("./objecthandlers/objectcomposedlook"),u=e("./objecthandlers/objectcustomactions"),l=e("./objecthandlers/objectfiles"),p=e("./objecthandlers/objectlists"),f=e("./util"),d=e("../../utils/logging"),h=e("../../net/httpclient"),g=function(){function e(){this.handlers={Navigation:r.ObjectNavigation,PropertyBagEntries:i.ObjectPropertyBagEntries,Features:s.ObjectFeatures,WebSettings:a.ObjectWebSettings,ComposedLook:c.ObjectComposedLook,CustomActions:u.ObjectCustomActions,Files:l.ObjectFiles,Lists:p.ObjectLists},this.httpClient=new h.HttpClient}return e.prototype.applyTemplate=function(e){var t=this,n=f.Util.replaceUrlTokens(e);return new Promise(function(e,o){t.httpClient.get(n).then(function(n){n.ok?n.json().then(function(n){t.start(n,Object.keys(n)).then(e,o)}):o(n.statusText)},function(e){d.Logger.write("Provisioning: The provided template is invalid",d.LogLevel.Error)})})},e.prototype.start=function(e,t){var n=this;return new Promise(function(r,i){n.startTime=(new Date).getTime(),n.queueItems=[],t.forEach(function(t,r){n.handlers[t]&&n.queueItems.push(new o.ProvisioningStep(t,r,e[t],e.Parameters,n.handlers[t]))});var s=[];s.push(new Promise(function(e){d.Logger.write("Provisioning: Code execution scope started",d.LogLevel.Info),e()}));for(var a=1;void 0!==n.queueItems[a-1];){var c=s.length-1;s.push(n.queueItems[a-1].execute(s[c])),a++}Promise.all(s).then(function(e){d.Logger.write("Provisioning: Code execution scope ended",d.LogLevel.Info),r(e)},function(e){d.Logger.write("Provisioning: Code execution scope ended"+JSON.stringify(e),d.LogLevel.Error),i(e)})})},e}();n.Provisioning=g},{"../../net/httpclient":5,"../../utils/logging":22,"./objecthandlers/objectcomposedlook":8,"./objecthandlers/objectcustomactions":9,"./objecthandlers/objectfeatures":10,"./objecthandlers/objectfiles":11,"./objecthandlers/objectlists":13,"./objecthandlers/objectnavigation":14,"./objecthandlers/objectpropertybagentries":15,"./objecthandlers/objectwebsettings":16,"./provisioningstep":18,"./util":20}],18:[function(e,t,n){"use strict";var o=function(){function e(e,t,n,o,r){this.name=e,this.index=t,this.objects=n,this.parameters=o,this.handler=r}return e.prototype.execute=function(e){var t=this,n=new this.handler;return e?new Promise(function(o,r){e.then(function(){return n.ProvisionObjects(t.objects,t.parameters).then(o,o)})}):n.ProvisionObjects(this.objects,this.parameters)},e}();n.ProvisioningStep=o},{}],19:[function(e,t,n){"use strict";var o=function(){function e(e,t,n){this.functions=e,this.parameter=t,this.scope=n}return e.prototype.execute=function(e){var t=this,n=Promise.resolve();return this.functions.forEach(function(o,r){n=n.then(function(){return o.call(t.scope,t.parameter)}).then(function(n){e&&e.call(t,r,t.functions)})},this),n},e}();n.Sequencer=o},{}],20:[function(e,t,n){"use strict";var o=function(){function e(){}return e.getRelativeUrl=function(e){return e.replace(document.location.protocol+"//"+document.location.hostname,"")},e.replaceUrlTokens=function(e){return e.replace(/{site}/g,_spPageContextInfo.webAbsoluteUrl).replace(/{sitecollection}/g,_spPageContextInfo.siteAbsoluteUrl).replace(/{themegallery}/g,_spPageContextInfo.siteAbsoluteUrl+"/_catalogs/theme/15")},e.encodePropertyKey=function(e){for(var t=[],n=0;n0?setTimeout(function(){return e.execute()},100):e.executeImpl().then(function(){return t()}).catch(n)})},e.prototype.executeImpl=function(){var e=this;if(this._requests.length<1)return new Promise(function(e){return e()});var t=[],n="";this._requests.forEach(function(o,r){"GET"===o.method?(n.length>0&&(t.push("--changeset_"+n+"--\n\n"),n=""),t.push("--batch_"+e._batchId+"\n")):(n.length<1&&(n=u.Util.getGUID(),t.push("--batch_"+e._batchId+"\n"),t.push('Content-Type: multipart/mixed; boundary="changeset_'+n+'"\n\n')),t.push("--changeset_"+n+"\n")),t.push("Content-Type: application/http\n"),t.push("Content-Transfer-Encoding: binary\n\n");var i={Accept:"application/json;"};if("GET"!==o.method){var s=o.method;o.options&&o.options.headers&&"undefined"!==o.options.headers["X-HTTP-Method"]&&(s=o.options.headers["X-HTTP-Method"],delete o.options.headers["X-HTTP-Method"]),t.push(s+" "+o.url+" HTTP/1.1\n"),i=u.Util.extend(i,{"Content-Type":"application/json;odata=verbose;charset=utf-8"})}else t.push(o.method+" "+o.url+" HTTP/1.1\n");"undefined"!=typeof f.RuntimeConfig.headers&&(i=u.Util.extend(i,f.RuntimeConfig.headers)),o.options&&o.options.headers&&(i=u.Util.extend(i,o.options.headers));for(var a in i)i.hasOwnProperty(a)&&t.push(a+": "+i[a]+"\n");t.push("\n"),o.options.body&&t.push(o.options.body+"\n\n")}),n.length>0&&(t.push("--changeset_"+n+"--\n\n"),n=""),t.push("--batch_"+this._batchId+"--\n");var o={"Content-Type":"multipart/mixed; boundary=batch_"+this._batchId},r={body:t.join(""),headers:o},i=new p.HttpClient;return i.post(u.Util.makeUrlAbsolute("/_api/$batch"),r).then(function(e){return e.text()}).then(this._parseResponse).then(function(t){if(t.length!==e._requests.length)throw new Error("Could not properly parse responses to match requests in batch.");for(var n=[],o=0;o0?e.substring(0,t)+n+e.substring(t,e.length):n+e},t.dateAdd=function(e,t,n){var o=new Date(e.toLocaleString());switch(t.toLowerCase()){case"year":o.setFullYear(o.getFullYear()+n);break;case"quarter":o.setMonth(o.getMonth()+3*n);break;case"month":o.setMonth(o.getMonth()+n);break;case"week":o.setDate(o.getDate()+7*n);break;case"day":o.setDate(o.getDate()+n);break;case"hour":o.setTime(o.getTime()+36e5*n);break;case"minute":o.setTime(o.getTime()+6e4*n);break;case"second":o.setTime(o.getTime()+1e3*n);break;default:o=void 0}return o},t.loadStylesheet=function(e,t){t&&(e+="?"+encodeURIComponent((new Date).getTime().toString()));var n=document.getElementsByTagName("head");if(n.length>0){var o=document.createElement("link");n[0].appendChild(o),o.setAttribute("type","text/css"),o.setAttribute("rel","stylesheet"),o.setAttribute("href",e)}},t.combinePaths=function(){for(var e=[],t=0;t-1?this.values[n]=t:(this.keys.push(e),this.values.push(t))},e.prototype.merge=function(e){if(o.Util.isFunction(e.getKeys))for(var t=e,n=t.getKeys(),r=n.length,i=0;i0;if(!t){var n=s.add();e.Description&&n.set_description(e.Description),e.CommandUIExtension&&n.set_commandUIExtension(e.CommandUIExtension),e.Group&&n.set_group(e.Group),e.Title&&n.set_title(e.Title),e.Url&&n.set_url(e.Url),e.ScriptBlock&&n.set_scriptBlock(e.ScriptBlock),e.ScriptSrc&&n.set_scriptSrc(e.ScriptSrc),e.Location&&n.set_location(e.Location),e.ImageUrl&&n.set_imageUrl(e.ImageUrl),e.Name&&n.set_name(e.Name),e.RegistrationId&&n.set_registrationId(e.RegistrationId),e.RegistrationType&&n.set_registrationType(e.RegistrationType),e.Rights&&n.set_rights(e.Rights),e.Sequence&&n.set_sequence(e.Sequence),n.update()}}),i.executeQueryAsync(function(){e.prototype.scope_ended.call(n),o()},function(){e.prototype.scope_ended.call(n),o()})},function(){e.prototype.scope_ended.call(n),o()})})},t}(r.ObjectHandlerBase);n.ObjectCustomActions=i},{"./objecthandlerbase":12}],10:[function(e,t,n){"use strict";var o=this&&this.__extends||function(e,t){function n(){this.constructor=e}for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o]);e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},r=e("./objecthandlerbase"),i=function(e){function t(){e.call(this,"Features")}return o(t,e),t.prototype.ProvisionObjects=function(t){var n=this;return e.prototype.scope_started.call(this),new Promise(function(o,r){var i=SP.ClientContext.get_current(),s=i.get_web(),a=s.get_features();t.forEach(function(e){e.Deactivate===!0?a.remove(new SP.Guid(e.ID),!0):a.add(new SP.Guid(e.ID),!0,SP.FeatureDefinitionScope.none)}),s.update(),i.load(a),i.executeQueryAsync(function(){e.prototype.scope_ended.call(n),o()},function(){e.prototype.scope_ended.call(n),o()})})},t}(r.ObjectHandlerBase);n.ObjectFeatures=i},{"./objecthandlerbase":12}],11:[function(e,t,n){"use strict";var o=this&&this.__extends||function(e,t){function n(){this.constructor=e}for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o]);e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},r=e("../../../utils/util"),i=e("../util"),s=e("./objecthandlerbase"),a=function(e){function t(){e.call(this,"Files")}return o(t,e),t.prototype.ProvisionObjects=function(t){var n=this;return e.prototype.scope_started.call(this),new Promise(function(o,s){var a=SP.ClientContext.get_current(),c=a.get_web(),u=[],l=[];t.forEach(function(e,t){l.push(n.httpClient.fetchRaw(i.Util.replaceUrlTokens(e.Src)).then(function(e){return e.text()}))}),Promise.all(l).then(function(e){e.forEach(function(e,o){var i=t[o],s=n.GetFilenameFromFilePath(i.Dest),l=_spPageContextInfo.webServerRelativeUrl,p=c.getFolderByServerRelativeUrl(l+"/"+n.GetFolderFromFilePath(i.Dest)),f={Contents:e,Dest:i.Dest,Filename:s,Folder:p,Instance:null,Overwrite:!1,Properties:[],RemoveExistingWebParts:!0,ServerRelativeUrl:i.Dest,Src:i.Src,Views:[],WebParts:[]};if(r.Util.extend(f,i),f.Filename.indexOf("Form.aspx")===-1){var d=new SP.FileCreationInformation;d.set_overwrite(f.Overwrite),d.set_url(f.Filename),d.set_content(new SP.Base64EncodedByteArray);for(var h=0;h0&&l.push(n.ApplyFileProperties(e.Dest,e.Properties)),e.WebParts&&e.WebParts.length>0&&l.push(n.AddWebPartsToWebPartPage(e.Dest,e.Src,e.WebParts,e.RemoveExistingWebParts))}),Promise.all(l).then(function(){n.ModifyHiddenViews(t).then(function(t){e.prototype.scope_ended.call(n),o(t)},function(t){e.prototype.scope_ended.call(n),s(t)})})},function(t){e.prototype.scope_ended.call(n),s(t)})})},t.prototype.RemoveWebPartsFromFileIfSpecified=function(e,t,n){return new Promise(function(o,r){n||o();var i=t.get_webParts();e.load(i),e.executeQueryAsync(function(){i.get_data().forEach(function(e){e.deleteWebPart()}),e.load(i),e.executeQueryAsync(o,r)},r)})},t.prototype.GetWebPartXml=function(e){var t=this;return new Promise(function(n,o){var r=[];e.forEach(function(e,n){if(e.Contents.FileUrl){var o=i.Util.replaceUrlTokens(e.Contents.FileUrl);r.push(t.httpClient.fetchRaw(o).then(function(e){return e.text()}))}else r.push(function(){return new Promise(function(e,t){e()})}())}),Promise.all(r).then(function(t){t.forEach(function(t,n){var o=e[n];null!==o&&t&&t.length>0&&(o.Contents.Xml=t)}),n(e)})})},t.prototype.AddWebPartsToWebPartPage=function(e,t,n,o){var r=this;return new Promise(function(t,s){var a=SP.ClientContext.get_current(),c=a.get_web(),u=_spPageContextInfo.webServerRelativeUrl+"/"+e,l=c.getFileByServerRelativeUrl(u);a.load(l),a.executeQueryAsync(function(){var e=l.getLimitedWebPartManager(SP.WebParts.PersonalizationScope.shared);r.RemoveWebPartsFromFileIfSpecified(a,e,o).then(function(){r.GetWebPartXml(n).then(function(n){n.forEach(function(t){if(t.Contents.Xml){var n=e.importWebPart(i.Util.replaceUrlTokens(t.Contents.Xml)),o=n.get_webPart();e.addWebPart(o,t.Zone,t.Order)}}),a.executeQueryAsync(t,t)})})},t)})},t.prototype.ApplyFileProperties=function(e,t){return new Promise(function(n,o){var r=SP.ClientContext.get_current(),i=r.get_web(),s=_spPageContextInfo.webServerRelativeUrl+"/"+e,a=i.getFileByServerRelativeUrl(s),c=a.get_listItemAllFields();Object.keys(t).forEach(function(e){c.set_item(e,t[e])}),c.update(),r.executeQueryAsync(n,n)})},t.prototype.GetViewFromCollectionByUrl=function(e,t){for(var n=_spPageContextInfo.webServerRelativeUrl+"/"+t,o=e.getEnumerator();o.moveNext();){var r=o.get_current();if(r.get_serverRelativeUrl().toString().toLowerCase()===n.toLowerCase())return r}return null},t.prototype.ModifyHiddenViews=function(e){var t=this;return new Promise(function(n,o){var i=SP.ClientContext.get_current(),s=i.get_web(),a={},c=[],u=[];e.forEach(function(e){e.Views&&e.Views.forEach(function(t){a[t.List]=a[t.List]||[],a[t.List].push(r.Util.extend(t,{Url:e.Dest}))})}),Object.keys(a).forEach(function(e,t){c.push(s.get_lists().getByTitle(e)),u.push(s.get_lists().getByTitle(e).get_views()),i.load(c[t]),i.load(u[t])}),i.executeQueryAsync(function(){Object.keys(a).forEach(function(e,n){var o=a[e],r=c[n],s=u[n];o.forEach(function(e){var n=t.GetViewFromCollectionByUrl(s,e.Url);if(null!=n){if(e.Paged&&n.set_paged(e.Paged),e.Query&&n.set_viewQuery(e.Query),e.RowLimit&&n.set_rowLimit(e.RowLimit),e.ViewFields&&e.ViewFields.length>0){var o=n.get_viewFields();o.removeAll(),e.ViewFields.forEach(function(e){o.add(e)})}n.update()}}),i.load(s),r.update()}),i.executeQueryAsync(n,n)},n)})},t.prototype.GetFolderFromFilePath=function(e){var t=e.split("/");return t.splice(0,t.length-1).join("/")},t.prototype.GetFilenameFromFilePath=function(e){var t=e.split("/");return t[t.length-1]},t}(s.ObjectHandlerBase);n.ObjectFiles=a},{"../../../utils/util":23,"../util":20,"./objecthandlerbase":12}],12:[function(e,t,n){"use strict";var o=e("../../../net/httpclient"),r=e("../../../utils/logging"),i=function(){function e(e){this.name=e,this.httpClient=new o.HttpClient}return e.prototype.ProvisionObjects=function(e,t){return new Promise(function(e,t){e("Not implemented.")})},e.prototype.scope_started=function(){r.Logger.write(this.name+": Code execution scope started")},e.prototype.scope_ended=function(){r.Logger.write(this.name+": Code execution scope stopped")},e}();n.ObjectHandlerBase=i},{"../../../net/httpclient":5,"../../../utils/logging":22}],13:[function(e,t,n){"use strict";var o=this&&this.__extends||function(e,t){function n(){this.constructor=e}for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o]);e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},r=e("../sequencer/sequencer"),i=e("./objecthandlerbase"),s=function(e){function t(){e.call(this,"Lists")}return o(t,e),t.prototype.ProvisionObjects=function(t){var n=this;return e.prototype.scope_started.call(this),new Promise(function(o,i){var s=SP.ClientContext.get_current(),a=s.get_web().get_lists(),c=[];s.load(a),s.executeQueryAsync(function(){t.forEach(function(e,t){var n=a.get_data().filter(function(t){return t.get_title()===e.Title})[0];if(n)e.Description&&n.set_description(e.Description),void 0!==e.EnableVersioning&&n.set_enableVersioning(e.EnableVersioning),void 0!==e.EnableMinorVersions&&n.set_enableMinorVersions(e.EnableMinorVersions),void 0!==e.EnableModeration&&n.set_enableModeration(e.EnableModeration),void 0!==e.EnableFolderCreation&&n.set_enableFolderCreation(e.EnableFolderCreation),void 0!==e.EnableAttachments&&n.set_enableAttachments(e.EnableAttachments),void 0!==e.NoCrawl&&n.set_noCrawl(e.NoCrawl),e.DefaultDisplayFormUrl&&n.set_defaultDisplayFormUrl(e.DefaultDisplayFormUrl),e.DefaultEditFormUrl&&n.set_defaultEditFormUrl(e.DefaultEditFormUrl),e.DefaultNewFormUrl&&n.set_defaultNewFormUrl(e.DefaultNewFormUrl),e.DraftVersionVisibility&&n.set_draftVersionVisibility(SP.DraftVisibilityType[e.DraftVersionVisibility]),e.ImageUrl&&n.set_imageUrl(e.ImageUrl),void 0!==e.Hidden&&n.set_hidden(e.Hidden),void 0!==e.ForceCheckout&&n.set_forceCheckout(e.ForceCheckout),n.update(),c.push(n),s.load(c[t]);else{var o=new SP.ListCreationInformation;if(e.Description&&o.set_description(e.Description),void 0!==e.OnQuickLaunch){var r=e.OnQuickLaunch?SP.QuickLaunchOptions.on:SP.QuickLaunchOptions.off;o.set_quickLaunchOption(r)}e.TemplateType&&o.set_templateType(e.TemplateType),e.Title&&o.set_title(e.Title),e.Url&&o.set_url(e.Url);var i=a.add(o);if(void 0!==e.EnableVersioning&&i.set_enableVersioning(e.EnableVersioning),void 0!==e.EnableMinorVersions&&i.set_enableMinorVersions(e.EnableMinorVersions),void 0!==e.EnableModeration&&i.set_enableModeration(e.EnableModeration),void 0!==e.EnableFolderCreation&&i.set_enableFolderCreation(e.EnableFolderCreation),void 0!==e.EnableAttachments&&i.set_enableAttachments(e.EnableAttachments),void 0!==e.NoCrawl&&i.set_noCrawl(e.NoCrawl),e.DefaultDisplayFormUrl&&i.set_defaultDisplayFormUrl(e.DefaultDisplayFormUrl),e.DefaultEditFormUrl&&i.set_defaultEditFormUrl(e.DefaultEditFormUrl),e.DefaultNewFormUrl&&i.set_defaultNewFormUrl(e.DefaultNewFormUrl),e.DraftVersionVisibility){var r=SP.DraftVisibilityType[e.DraftVersionVisibility.toLocaleLowerCase()];i.set_draftVersionVisibility(r)}e.ImageUrl&&i.set_imageUrl(e.ImageUrl),void 0!==e.Hidden&&i.set_hidden(e.Hidden),void 0!==e.ForceCheckout&&i.set_forceCheckout(e.ForceCheckout),c.push(i),s.load(c[t])}}),s.executeQueryAsync(function(){var i=new r.Sequencer([n.ApplyContentTypeBindings,n.ApplyListInstanceFieldRefs,n.ApplyFields,n.ApplyLookupFields,n.ApplyListSecurity,n.CreateViews,n.InsertDataRows,n.CreateFolders],{ClientContext:s,ListInstances:c,Objects:t},n);i.execute().then(function(){e.prototype.scope_ended.call(n),o()})},function(){e.prototype.scope_ended.call(n),o()})},function(){e.prototype.scope_ended.call(n),o()})})},t.prototype.EnsureLocationBasedMetadataDefaultsReceiver=function(e,t){var n=t.get_eventReceivers(),o=new SP.EventReceiverDefinitionCreationInformation;o.set_receiverName("LocationBasedMetadataDefaultsReceiver ItemAdded"),o.set_synchronization(1),o.set_sequenceNumber(1e3),o.set_receiverAssembly("Microsoft.Office.DocumentManagement, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"),o.set_receiverClass("Microsoft.Office.DocumentManagement.LocationBasedMetadataDefaultsReceiver"),o.set_eventType(SP.EventReceiverType.itemAdded),n.add(o),t.update()},t.prototype.CreateFolders=function(e){var t=this;return new Promise(function(n,o){e.ListInstances.forEach(function(n,o){var r=e.Objects[o];if(r.Folders){var i=_spPageContextInfo.webServerRelativeUrl+"/"+r.Url,s=n.get_rootFolder(),a="",c=!1;if(r.Folders.forEach(function(e){var t=i+"/"+e.Name;if(s.get_folders().add(t),e.DefaultValues){var n=Object.keys(e.DefaultValues).length;n>0&&(a+="",Object.keys(e.DefaultValues).forEach(function(t){a+=''+e.DefaultValues[t]+""}),a+=""),c=!0}}),a+="",c){var u=new SP.FileCreationInformation;u.set_url(i+"/Forms/client_LocationBasedDefaults.html"),u.set_content(new SP.Base64EncodedByteArray),u.set_overwrite(!0);for(var l=0;l0&&s.get_data().forEach(function(e){a.push(e)}),i.ContentTypeBindings.forEach(function(e){s.addExistingContentType(o.getById(e.ContentTypeId))}),i.RemoveExistingContentTypes&&i.ContentTypeBindings.length>0)for(var c=0;c0))return null;o="{"+i[0].get_id().toString()+"}"}}),o="","Calculated"===e.Type&&(o+=""+e.Formula+""),o+=""}return o},t.prototype.ApplyListSecurity=function(e){return new Promise(function(t,n){e.ListInstances.forEach(function(t,n){var o=e.Objects[n];o.Security&&o.Security.BreakRoleInheritance&&(t.breakRoleInheritance(o.Security.CopyRoleAssignments,o.Security.ClearSubscopes),t.update(),e.ClientContext.load(t.get_roleAssignments()))});var o=e.ClientContext.get_web(),r=o.get_allProperties(),i=o.get_siteGroups(),s=o.get_roleDefinitions();e.ClientContext.load(r),e.ClientContext.load(s),e.ClientContext.executeQueryAsync(function(){e.ListInstances.forEach(function(t,n){var o=e.Objects[n];o.Security&&(o.Security.RoleAssignments.forEach(function(n){var o=null;o="number"==typeof n.RoleDefinition?s.getById(n.RoleDefinition):s.getByName(n.RoleDefinition);var a=SP.RoleDefinitionBindingCollection.newObject(e.ClientContext);a.add(o);var c=null;if(n.Principal.match(/\{[A-Za-z]*\}+/g)){var u=n.Principal.substring(1,n.Principal.length-1),l=r.get_fieldValues()["vti_"+u];c=i.getById(l)}else c=i.getByName(c);t.get_roleAssignments().add(c,a)}),t.update())}),e.ClientContext.executeQueryAsync(t,t)},t)})},t.prototype.CreateViews=function(e){return new Promise(function(t,n){var o=[];e.ListInstances.forEach(function(t,n){o.push(t.get_views()),e.ClientContext.load(o[n])}),e.ClientContext.executeQueryAsync(function(){e.ListInstances.forEach(function(t,n){var r=e.Objects[n];r.Views&&(o.push(t.get_views()),e.ClientContext.load(o[n]),r.Views.forEach(function(i){var s=o[n].get_data().filter(function(e){return r.RemoveExistingViews&&r.Views.length>0?(e.deleteObject(),!1):e.get_title()===i.Title}).length>0;if(s){var a=o[n].getByTitle(i.Title);if(i.Paged&&a.set_paged(i.Paged),i.Query&&a.set_viewQuery(i.Query),i.RowLimit&&a.set_rowLimit(i.RowLimit),i.ViewFields&&i.ViewFields.length>0){var c=a.get_viewFields();c.removeAll(),i.ViewFields.forEach(function(e){c.add(e)})}i.Scope&&a.set_scope(i.Scope),a.update()}else{var u=new SP.ViewCreationInformation;i.Title&&u.set_title(i.Title),i.PersonalView&&u.set_personalView(i.PersonalView),i.Paged&&u.set_paged(i.Paged),i.Query&&u.set_query(i.Query),i.RowLimit&&u.set_rowLimit(i.RowLimit),i.SetAsDefaultView&&u.set_setAsDefaultView(i.SetAsDefaultView),i.ViewFields&&u.set_viewFields(i.ViewFields),i.ViewTypeKind&&u.set_viewTypeKind(SP.ViewType.html);var a=t.get_views().add(u);i.Scope&&(a.set_scope(i.Scope),a.update()),t.update()}e.ClientContext.load(t.get_views())}))}),e.ClientContext.executeQueryAsync(t,t)},t)})},t.prototype.InsertDataRows=function(e){return new Promise(function(t,n){e.ListInstances.forEach(function(t,n){var o=e.Objects[n];o.DataRows&&o.DataRows.forEach(function(n){var o=t.addItem(new SP.ListItemCreationInformation);Object.keys(n).forEach(function(e){o.set_item(e,n[e])}),o.update(),e.ClientContext.load(o)})}),e.ClientContext.executeQueryAsync(t,t)})},t}(i.ObjectHandlerBase);n.ObjectLists=s},{"../sequencer/sequencer":19,"./objecthandlerbase":12}],14:[function(e,t,n){"use strict";var o=this&&this.__extends||function(e,t){function n(){this.constructor=e}for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o]);e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},r=e("../util"),i=e("./objecthandlerbase"),s=function(e){function t(){e.call(this,"Navigation")}return o(t,e),t.prototype.ProvisionObjects=function(t){var n=this;e.prototype.scope_started.call(this);var o=SP.ClientContext.get_current(),r=o.get_web().get_navigation();return new Promise(function(i,s){n.ConfigureQuickLaunch(t.QuickLaunch,o,n.httpClient,r).then(function(){e.prototype.scope_ended.call(n),i()},function(){e.prototype.scope_ended.call(n),s()})})},t.prototype.getNodeFromCollectionByTitle=function(e,t){var n=e.filter(function(e){return e.get_title()===t});return n[0]||null},t.prototype.ConfigureQuickLaunch=function(e,t,n,o){var i=this;return new Promise(function(s,a){if(0===e.length)s();else{var c=o.get_quickLaunch();t.load(c),t.executeQueryAsync(function(){for(var a=[],u=c.get_count()-1;u>=0;){var l=c.itemAt(u);a.push(l),l.deleteObject(),u--}t.executeQueryAsync(function(){e.forEach(function(e){var t=i.getNodeFromCollectionByTitle(a,e.Title),n=new SP.NavigationNodeCreationInformation;n.set_title(e.Title),n.set_url(t?t.get_url():r.Util.replaceUrlTokens(e.Url)),n.set_asLastNode(!0),c.add(n)}),t.executeQueryAsync(function(){n.get(_spPageContextInfo.webAbsoluteUrl+"/_api/web/Navigation/QuickLaunch").then(function(n){n.json().then(function(n){n.value.forEach(function(t){var n=o.getNodeById(t.Id),s=n.get_children(),c=e.filter(function(e){return e.Title===t.Title})[0];c&&c.Children&&c.Children.forEach(function(e){var t=i.getNodeFromCollectionByTitle(a,e.Title),n=new SP.NavigationNodeCreationInformation;n.set_title(e.Title),n.set_url(t?t.get_url():r.Util.replaceUrlTokens(e.Url)),n.set_asLastNode(!0),s.add(n)})}),t.executeQueryAsync(s,s)})})},s)})})}})},t}(i.ObjectHandlerBase);n.ObjectNavigation=s},{"../util":20,"./objecthandlerbase":12}],15:[function(e,t,n){"use strict";var o=this&&this.__extends||function(e,t){function n(){this.constructor=e}for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o]);e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},r=e("../util"),i=e("./objecthandlerbase"),s=function(e){function t(){e.call(this,"PropertyBagEntries")}return o(t,e),t.prototype.ProvisionObjects=function(t){var n=this;return e.prototype.scope_started.call(this),new Promise(function(o,i){if(t&&0!==t.length){for(var s=SP.ClientContext.get_current(),a=s.get_web(),c=a.get_allProperties(),u=[],l=0;l0?(c.set_item("vti_indexedpropertykeys",u.join("|")),a.update(),s.executeQueryAsync(function(){e.prototype.scope_ended.call(n),o()},function(){e.prototype.scope_ended.call(n),o()})):(e.prototype.scope_ended.call(n),o())},function(){e.prototype.scope_ended.call(n),o()})}else o()})},t}(i.ObjectHandlerBase);n.ObjectPropertyBagEntries=s},{"../util":20,"./objecthandlerbase":12}],16:[function(e,t,n){"use strict";var o=this&&this.__extends||function(e,t){function n(){this.constructor=e}for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o]);e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},r=e("./objecthandlerbase"),i=function(e){ +function t(){e.call(this,"WebSettings")}return o(t,e),t.prototype.ProvisionObjects=function(t){var n=this;return e.prototype.scope_started.call(this),new Promise(function(o,r){var i=SP.ClientContext.get_current(),s=i.get_web();t.WelcomePage&&(s.get_rootFolder().set_welcomePage(t.WelcomePage),s.get_rootFolder().update()),t.MasterUrl&&s.set_masterUrl(t.MasterUrl),t.CustomMasterUrl&&s.set_customMasterUrl(t.CustomMasterUrl),void 0!==t.SaveSiteAsTemplateEnabled&&s.set_saveSiteAsTemplateEnabled(t.SaveSiteAsTemplateEnabled),void 0!==t.QuickLaunchEnabled&&s.set_saveSiteAsTemplateEnabled(t.QuickLaunchEnabled),void 0!==t.TreeViewEnabled&&s.set_treeViewEnabled(t.TreeViewEnabled),s.update(),i.load(s),i.executeQueryAsync(function(){e.prototype.scope_ended.call(n),o()},function(){e.prototype.scope_ended.call(n),o()})})},t}(r.ObjectHandlerBase);n.ObjectWebSettings=i},{"./objecthandlerbase":12}],17:[function(e,t,n){"use strict";var o=e("./provisioningstep"),r=e("./objecthandlers/objectnavigation"),i=e("./objecthandlers/objectpropertybagentries"),s=e("./objecthandlers/objectfeatures"),a=e("./objecthandlers/objectwebsettings"),c=e("./objecthandlers/objectcomposedlook"),u=e("./objecthandlers/objectcustomactions"),l=e("./objecthandlers/objectfiles"),p=e("./objecthandlers/objectlists"),f=e("./util"),d=e("../../utils/logging"),h=e("../../net/httpclient"),g=function(){function e(){this.handlers={Navigation:r.ObjectNavigation,PropertyBagEntries:i.ObjectPropertyBagEntries,Features:s.ObjectFeatures,WebSettings:a.ObjectWebSettings,ComposedLook:c.ObjectComposedLook,CustomActions:u.ObjectCustomActions,Files:l.ObjectFiles,Lists:p.ObjectLists},this.httpClient=new h.HttpClient}return e.prototype.applyTemplate=function(e){var t=this,n=f.Util.replaceUrlTokens(e);return new Promise(function(e,o){t.httpClient.get(n).then(function(n){n.ok?n.json().then(function(n){t.start(n,Object.keys(n)).then(e,o)}):o(n.statusText)},function(e){d.Logger.write("Provisioning: The provided template is invalid",d.LogLevel.Error)})})},e.prototype.start=function(e,t){var n=this;return new Promise(function(r,i){n.startTime=(new Date).getTime(),n.queueItems=[],t.forEach(function(t,r){n.handlers[t]&&n.queueItems.push(new o.ProvisioningStep(t,r,e[t],e.Parameters,n.handlers[t]))});var s=[];s.push(new Promise(function(e){d.Logger.write("Provisioning: Code execution scope started",d.LogLevel.Info),e()}));for(var a=1;void 0!==n.queueItems[a-1];){var c=s.length-1;s.push(n.queueItems[a-1].execute(s[c])),a++}Promise.all(s).then(function(e){d.Logger.write("Provisioning: Code execution scope ended",d.LogLevel.Info),r(e)},function(e){d.Logger.write("Provisioning: Code execution scope ended"+JSON.stringify(e),d.LogLevel.Error),i(e)})})},e}();n.Provisioning=g},{"../../net/httpclient":5,"../../utils/logging":22,"./objecthandlers/objectcomposedlook":8,"./objecthandlers/objectcustomactions":9,"./objecthandlers/objectfeatures":10,"./objecthandlers/objectfiles":11,"./objecthandlers/objectlists":13,"./objecthandlers/objectnavigation":14,"./objecthandlers/objectpropertybagentries":15,"./objecthandlers/objectwebsettings":16,"./provisioningstep":18,"./util":20}],18:[function(e,t,n){"use strict";var o=function(){function e(e,t,n,o,r){this.name=e,this.index=t,this.objects=n,this.parameters=o,this.handler=r}return e.prototype.execute=function(e){var t=this,n=new this.handler;return e?new Promise(function(o,r){e.then(function(){return n.ProvisionObjects(t.objects,t.parameters).then(o,o)})}):n.ProvisionObjects(this.objects,this.parameters)},e}();n.ProvisioningStep=o},{}],19:[function(e,t,n){"use strict";var o=function(){function e(e,t,n){this.functions=e,this.parameter=t,this.scope=n}return e.prototype.execute=function(e){var t=this,n=Promise.resolve();return this.functions.forEach(function(o,r){n=n.then(function(){return o.call(t.scope,t.parameter)}).then(function(n){e&&e.call(t,r,t.functions)})},this),n},e}();n.Sequencer=o},{}],20:[function(e,t,n){"use strict";var o=function(){function e(){}return e.getRelativeUrl=function(e){return e.replace(document.location.protocol+"//"+document.location.hostname,"")},e.replaceUrlTokens=function(e){return e.replace(/{site}/g,_spPageContextInfo.webAbsoluteUrl).replace(/{sitecollection}/g,_spPageContextInfo.siteAbsoluteUrl).replace(/{themegallery}/g,_spPageContextInfo.siteAbsoluteUrl+"/_catalogs/theme/15")},e.encodePropertyKey=function(e){for(var t=[],n=0;n0&&(t.push("--changeset_"+n+"--\n\n"),n=""),t.push("--batch_"+e._batchId+"\n")):(n.length<1&&(n=u.Util.getGUID(),t.push("--batch_"+e._batchId+"\n"),t.push('Content-Type: multipart/mixed; boundary="changeset_'+n+'"\n\n')),t.push("--changeset_"+n+"\n")),t.push("Content-Type: application/http\n"),t.push("Content-Transfer-Encoding: binary\n\n");var i={Accept:"application/json;"};if("GET"!==o.method){var s=o.method;o.options&&o.options.headers&&"undefined"!==o.options.headers["X-HTTP-Method"]&&(s=o.options.headers["X-HTTP-Method"],delete o.options.headers["X-HTTP-Method"]),t.push(s+" "+o.url+" HTTP/1.1\n"),i=u.Util.extend(i,{"Content-Type":"application/json;odata=verbose;charset=utf-8"})}else t.push(o.method+" "+o.url+" HTTP/1.1\n");"undefined"!=typeof f.RuntimeConfig.headers&&(i=u.Util.extend(i,f.RuntimeConfig.headers)),o.options&&o.options.headers&&(i=u.Util.extend(i,o.options.headers));for(var a in i)i.hasOwnProperty(a)&&t.push(a+": "+i[a]+"\n");t.push("\n"),o.options.body&&t.push(o.options.body+"\n\n")}),n.length>0&&(t.push("--changeset_"+n+"--\n\n"),n=""),t.push("--batch_"+this._batchId+"--\n");var o={"Content-Type":"multipart/mixed; boundary=batch_"+this._batchId},r={body:t.join(""),headers:o},i=new p.HttpClient,s=u.Util.makeUrlAbsolute(u.Util.combinePaths(this.baseUrl,"/_api/$batch"));return i.post(s,r).then(function(e){return e.text()}).then(this._parseResponse).then(function(t){if(t.length!==e._requests.length)throw new Error("Could not properly parse responses to match requests in batch.");for(var n=Promise.resolve(),o=function(o){var r=e._requests[o],i=t[o];i.ok||r.reject(new Error(i.statusText)),n=n.then(function(e){return r.parser.parse(i).then(r.resolve).catch(r.reject)})},r=0;r0?e.substring(0,t)+n+e.substring(t,e.length):n+e},t.dateAdd=function(e,t,n){var o=new Date(e.toLocaleString());switch(t.toLowerCase()){case"year":o.setFullYear(o.getFullYear()+n);break;case"quarter":o.setMonth(o.getMonth()+3*n);break;case"month":o.setMonth(o.getMonth()+n);break;case"week":o.setDate(o.getDate()+7*n);break;case"day":o.setDate(o.getDate()+n);break;case"hour":o.setTime(o.getTime()+36e5*n);break;case"minute":o.setTime(o.getTime()+6e4*n);break;case"second":o.setTime(o.getTime()+1e3*n);break;default:o=void 0}return o},t.loadStylesheet=function(e,t){t&&(e+="?"+encodeURIComponent((new Date).getTime().toString()));var n=document.getElementsByTagName("head");if(n.length>0){var o=document.createElement("link");n[0].appendChild(o),o.setAttribute("type","text/css"),o.setAttribute("rel","stylesheet"),o.setAttribute("href",e)}},t.combinePaths=function(){for(var e=[],t=0;t -1) {\n this.values[index] = o;\n }\n else {\n this.keys.push(key);\n this.values.push(o);\n }\n };\n Dictionary.prototype.merge = function (source) {\n if (util_1.Util.isFunction(source[\"getKeys\"])) {\n var sourceAsDictionary = source;\n var keys = sourceAsDictionary.getKeys();\n var l = keys.length;\n for (var i = 0; i < l; i++) {\n this.add(keys[i], sourceAsDictionary.get(keys[i]));\n }\n }\n else {\n var sourceAsHash = source;\n for (var key in sourceAsHash) {\n if (sourceAsHash.hasOwnProperty(key)) {\n this.add(key, source[key]);\n }\n }\n }\n };\n Dictionary.prototype.remove = function (key) {\n var index = this.keys.indexOf(key);\n if (index < 0) {\n return null;\n }\n var val = this.values[index];\n this.keys.splice(index, 1);\n this.values.splice(index, 1);\n return val;\n };\n Dictionary.prototype.getKeys = function () {\n return this.keys;\n };\n Dictionary.prototype.getValues = function () {\n return this.values;\n };\n Dictionary.prototype.clear = function () {\n this.keys = [];\n this.values = [];\n };\n Dictionary.prototype.count = function () {\n return this.keys.length;\n };\n return Dictionary;\n}());\nexports.Dictionary = Dictionary;\n\n},{\"../utils/util\":23}],2:[function(require,module,exports){\n(function (global){\n\"use strict\";\nvar RuntimeConfigImpl = (function () {\n function RuntimeConfigImpl() {\n this._headers = null;\n this._defaultCachingStore = \"session\";\n this._defaultCachingTimeoutSeconds = 30;\n this._globalCacheDisable = false;\n this._useSPRequestExecutor = false;\n }\n RuntimeConfigImpl.prototype.set = function (config) {\n if (config.hasOwnProperty(\"headers\")) {\n this._headers = config.headers;\n }\n if (config.hasOwnProperty(\"globalCacheDisable\")) {\n this._globalCacheDisable = config.globalCacheDisable;\n }\n if (config.hasOwnProperty(\"defaultCachingStore\")) {\n this._defaultCachingStore = config.defaultCachingStore;\n }\n if (config.hasOwnProperty(\"defaultCachingTimeoutSeconds\")) {\n this._defaultCachingTimeoutSeconds = config.defaultCachingTimeoutSeconds;\n }\n if (config.hasOwnProperty(\"useSPRequestExecutor\")) {\n this._useSPRequestExecutor = config.useSPRequestExecutor;\n }\n if (config.hasOwnProperty(\"nodeClientOptions\")) {\n this._useNodeClient = true;\n this._useSPRequestExecutor = false;\n this._nodeClientData = config.nodeClientOptions;\n global._spPageContextInfo = {\n webAbsoluteUrl: config.nodeClientOptions.siteUrl,\n };\n }\n };\n Object.defineProperty(RuntimeConfigImpl.prototype, \"headers\", {\n get: function () {\n return this._headers;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RuntimeConfigImpl.prototype, \"defaultCachingStore\", {\n get: function () {\n return this._defaultCachingStore;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RuntimeConfigImpl.prototype, \"defaultCachingTimeoutSeconds\", {\n get: function () {\n return this._defaultCachingTimeoutSeconds;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RuntimeConfigImpl.prototype, \"globalCacheDisable\", {\n get: function () {\n return this._globalCacheDisable;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RuntimeConfigImpl.prototype, \"useSPRequestExecutor\", {\n get: function () {\n return this._useSPRequestExecutor;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RuntimeConfigImpl.prototype, \"useNodeFetchClient\", {\n get: function () {\n return this._useNodeClient;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RuntimeConfigImpl.prototype, \"nodeRequestOptions\", {\n get: function () {\n return this._nodeClientData;\n },\n enumerable: true,\n configurable: true\n });\n return RuntimeConfigImpl;\n}());\nexports.RuntimeConfigImpl = RuntimeConfigImpl;\nvar _runtimeConfig = new RuntimeConfigImpl();\nexports.RuntimeConfig = _runtimeConfig;\nfunction setRuntimeConfig(config) {\n _runtimeConfig.set(config);\n}\nexports.setRuntimeConfig = setRuntimeConfig;\n\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n},{}],3:[function(require,module,exports){\n\"use strict\";\nvar collections_1 = require(\"../collections/collections\");\nvar util_1 = require(\"../utils/util\");\nvar odata_1 = require(\"../sharepoint/rest/odata\");\nvar CachedDigest = (function () {\n function CachedDigest() {\n }\n return CachedDigest;\n}());\nexports.CachedDigest = CachedDigest;\nvar DigestCache = (function () {\n function DigestCache(_httpClient, _digests) {\n if (_digests === void 0) { _digests = new collections_1.Dictionary(); }\n this._httpClient = _httpClient;\n this._digests = _digests;\n }\n DigestCache.prototype.getDigest = function (webUrl) {\n var self = this;\n var cachedDigest = this._digests.get(webUrl);\n if (cachedDigest !== null) {\n var now = new Date();\n if (now < cachedDigest.expiration) {\n return Promise.resolve(cachedDigest.value);\n }\n }\n var url = util_1.Util.combinePaths(webUrl, \"/_api/contextinfo\");\n return self._httpClient.fetchRaw(url, {\n cache: \"no-cache\",\n credentials: \"same-origin\",\n headers: {\n \"Accept\": \"application/json;odata=verbose\",\n \"Content-type\": \"application/json;odata=verbose;charset=utf-8\",\n },\n method: \"POST\",\n }).then(function (response) {\n var parser = new odata_1.ODataDefaultParser();\n return parser.parse(response).then(function (d) { return d.GetContextWebInformation; });\n }).then(function (data) {\n var newCachedDigest = new CachedDigest();\n newCachedDigest.value = data.FormDigestValue;\n var seconds = data.FormDigestTimeoutSeconds;\n var expiration = new Date();\n expiration.setTime(expiration.getTime() + 1000 * seconds);\n newCachedDigest.expiration = expiration;\n self._digests.add(webUrl, newCachedDigest);\n return newCachedDigest.value;\n });\n };\n DigestCache.prototype.clear = function () {\n this._digests.clear();\n };\n return DigestCache;\n}());\nexports.DigestCache = DigestCache;\n\n},{\"../collections/collections\":1,\"../sharepoint/rest/odata\":21,\"../utils/util\":23}],4:[function(require,module,exports){\n(function (global){\n\"use strict\";\nvar FetchClient = (function () {\n function FetchClient() {\n }\n FetchClient.prototype.fetch = function (url, options) {\n return global.fetch(url, options);\n };\n return FetchClient;\n}());\nexports.FetchClient = FetchClient;\n\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n},{}],5:[function(require,module,exports){\n\"use strict\";\nvar fetchclient_1 = require(\"./fetchclient\");\nvar digestcache_1 = require(\"./digestcache\");\nvar util_1 = require(\"../utils/util\");\nvar pnplibconfig_1 = require(\"../configuration/pnplibconfig\");\nvar sprequestexecutorclient_1 = require(\"./sprequestexecutorclient\");\nvar nodefetchclient_1 = require(\"./nodefetchclient\");\nvar HttpClient = (function () {\n function HttpClient() {\n this._impl = this.getFetchImpl();\n this._digestCache = new digestcache_1.DigestCache(this);\n }\n HttpClient.prototype.fetch = function (url, options) {\n if (options === void 0) { options = {}; }\n var self = this;\n var opts = util_1.Util.extend(options, { cache: \"no-cache\", credentials: \"same-origin\" }, true);\n var headers = new Headers();\n this.mergeHeaders(headers, pnplibconfig_1.RuntimeConfig.headers);\n this.mergeHeaders(headers, options.headers);\n if (!headers.has(\"Accept\")) {\n headers.append(\"Accept\", \"application/json\");\n }\n if (!headers.has(\"Content-Type\")) {\n headers.append(\"Content-Type\", \"application/json;odata=verbose;charset=utf-8\");\n }\n if (!headers.has(\"X-ClientService-ClientTag\")) {\n headers.append(\"X-ClientService-ClientTag\", \"PnPCoreJS:1.0.5\");\n }\n opts = util_1.Util.extend(opts, { headers: headers });\n if (opts.method && opts.method.toUpperCase() !== \"GET\") {\n if (!headers.has(\"X-RequestDigest\")) {\n var index = url.indexOf(\"_api/\");\n if (index < 0) {\n throw new Error(\"Unable to determine API url\");\n }\n var webUrl = url.substr(0, index);\n return this._digestCache.getDigest(webUrl)\n .then(function (digest) {\n headers.append(\"X-RequestDigest\", digest);\n return self.fetchRaw(url, opts);\n });\n }\n }\n return self.fetchRaw(url, opts);\n };\n HttpClient.prototype.fetchRaw = function (url, options) {\n var _this = this;\n if (options === void 0) { options = {}; }\n var rawHeaders = new Headers();\n this.mergeHeaders(rawHeaders, options.headers);\n options = util_1.Util.extend(options, { headers: rawHeaders });\n var retry = function (ctx) {\n _this._impl.fetch(url, options).then(function (response) { return ctx.resolve(response); }).catch(function (response) {\n var delay = ctx.delay;\n if (response.status !== 429 && response.status !== 503) {\n ctx.reject(response);\n }\n ctx.delay *= 2;\n ctx.attempts++;\n if (ctx.retryCount <= ctx.attempts) {\n ctx.reject(response);\n }\n setTimeout(util_1.Util.getCtxCallback(_this, retry, ctx), delay);\n });\n };\n return new Promise(function (resolve, reject) {\n var retryContext = {\n attempts: 0,\n delay: 100,\n reject: reject,\n resolve: resolve,\n retryCount: 7,\n };\n retry.call(_this, retryContext);\n });\n };\n HttpClient.prototype.get = function (url, options) {\n if (options === void 0) { options = {}; }\n var opts = util_1.Util.extend(options, { method: \"GET\" });\n return this.fetch(url, opts);\n };\n HttpClient.prototype.post = function (url, options) {\n if (options === void 0) { options = {}; }\n var opts = util_1.Util.extend(options, { method: \"POST\" });\n return this.fetch(url, opts);\n };\n HttpClient.prototype.getFetchImpl = function () {\n if (pnplibconfig_1.RuntimeConfig.useSPRequestExecutor) {\n return new sprequestexecutorclient_1.SPRequestExecutorClient();\n }\n else if (pnplibconfig_1.RuntimeConfig.useNodeFetchClient) {\n var opts = pnplibconfig_1.RuntimeConfig.nodeRequestOptions;\n return new nodefetchclient_1.NodeFetchClient(opts.siteUrl, opts.clientId, opts.clientSecret);\n }\n else {\n return new fetchclient_1.FetchClient();\n }\n };\n HttpClient.prototype.mergeHeaders = function (target, source) {\n if (typeof source !== \"undefined\" && source !== null) {\n var temp = new Request(\"\", { headers: source });\n temp.headers.forEach(function (value, name) {\n target.append(name, value);\n });\n }\n };\n return HttpClient;\n}());\nexports.HttpClient = HttpClient;\n\n},{\"../configuration/pnplibconfig\":2,\"../utils/util\":23,\"./digestcache\":3,\"./fetchclient\":4,\"./nodefetchclient\":6,\"./sprequestexecutorclient\":7}],6:[function(require,module,exports){\n\"use strict\";\nvar NodeFetchClient = (function () {\n function NodeFetchClient(siteUrl, _clientId, _clientSecret, _realm) {\n if (_realm === void 0) { _realm = \"\"; }\n this.siteUrl = siteUrl;\n this._clientId = _clientId;\n this._clientSecret = _clientSecret;\n this._realm = _realm;\n }\n NodeFetchClient.prototype.fetch = function (url, options) {\n throw new Error(\"Using NodeFetchClient in the browser is not supported.\");\n };\n return NodeFetchClient;\n}());\nexports.NodeFetchClient = NodeFetchClient;\n\n},{}],7:[function(require,module,exports){\n\"use strict\";\nvar util_1 = require(\"../utils/util\");\nvar SPRequestExecutorClient = (function () {\n function SPRequestExecutorClient() {\n this.convertToResponse = function (spResponse) {\n var responseHeaders = new Headers();\n for (var h in spResponse.headers) {\n if (spResponse.headers[h]) {\n responseHeaders.append(h, spResponse.headers[h]);\n }\n }\n return new Response(spResponse.body, {\n headers: responseHeaders,\n status: spResponse.statusCode,\n statusText: spResponse.statusText,\n });\n };\n }\n SPRequestExecutorClient.prototype.fetch = function (url, options) {\n var _this = this;\n if (typeof SP === \"undefined\" || typeof SP.RequestExecutor === \"undefined\") {\n throw new Error(\"SP.RequestExecutor is undefined. \" +\n \"Load the SP.RequestExecutor.js library (/_layouts/15/SP.RequestExecutor.js) before loading the PnP JS Core library.\");\n }\n var addinWebUrl = url.substring(0, url.indexOf(\"/_api\")), executor = new SP.RequestExecutor(addinWebUrl), headers = {}, iterator, temp;\n if (options.headers && options.headers instanceof Headers) {\n iterator = options.headers.entries();\n temp = iterator.next();\n while (!temp.done) {\n headers[temp.value[0]] = temp.value[1];\n temp = iterator.next();\n }\n }\n else {\n headers = options.headers;\n }\n return new Promise(function (resolve, reject) {\n var requestOptions = {\n error: function (error) {\n reject(_this.convertToResponse(error));\n },\n headers: headers,\n method: options.method,\n success: function (response) {\n resolve(_this.convertToResponse(response));\n },\n url: url,\n };\n if (options.body) {\n util_1.Util.extend(requestOptions, { body: options.body });\n }\n else {\n util_1.Util.extend(requestOptions, { binaryStringRequestBody: true });\n }\n executor.executeAsync(requestOptions);\n });\n };\n return SPRequestExecutorClient;\n}());\nexports.SPRequestExecutorClient = SPRequestExecutorClient;\n\n},{\"../utils/util\":23}],8:[function(require,module,exports){\n\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar util_1 = require(\"../util\");\nvar objecthandlerbase_1 = require(\"./objecthandlerbase\");\nvar ObjectComposedLook = (function (_super) {\n __extends(ObjectComposedLook, _super);\n function ObjectComposedLook() {\n _super.call(this, \"ComposedLook\");\n }\n ObjectComposedLook.prototype.ProvisionObjects = function (object) {\n var _this = this;\n _super.prototype.scope_started.call(this);\n return new Promise(function (resolve, reject) {\n var clientContext = SP.ClientContext.get_current();\n var web = clientContext.get_web();\n var colorPaletteUrl = object.ColorPaletteUrl ? util_1.Util.replaceUrlTokens(object.ColorPaletteUrl) : \"\";\n var fontSchemeUrl = object.FontSchemeUrl ? util_1.Util.replaceUrlTokens(object.FontSchemeUrl) : \"\";\n var backgroundImageUrl = object.BackgroundImageUrl ? util_1.Util.replaceUrlTokens(object.BackgroundImageUrl) : null;\n web.applyTheme(util_1.Util.getRelativeUrl(colorPaletteUrl), util_1.Util.getRelativeUrl(fontSchemeUrl), backgroundImageUrl, true);\n web.update();\n clientContext.executeQueryAsync(function () {\n _super.prototype.scope_ended.call(_this);\n resolve();\n }, function () {\n _super.prototype.scope_ended.call(_this);\n resolve();\n });\n });\n };\n return ObjectComposedLook;\n}(objecthandlerbase_1.ObjectHandlerBase));\nexports.ObjectComposedLook = ObjectComposedLook;\n\n},{\"../util\":20,\"./objecthandlerbase\":12}],9:[function(require,module,exports){\n\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar objecthandlerbase_1 = require(\"./objecthandlerbase\");\nvar ObjectCustomActions = (function (_super) {\n __extends(ObjectCustomActions, _super);\n function ObjectCustomActions() {\n _super.call(this, \"CustomActions\");\n }\n ObjectCustomActions.prototype.ProvisionObjects = function (customactions) {\n var _this = this;\n _super.prototype.scope_started.call(this);\n return new Promise(function (resolve, reject) {\n var clientContext = SP.ClientContext.get_current();\n var userCustomActions = clientContext.get_web().get_userCustomActions();\n clientContext.load(userCustomActions);\n clientContext.executeQueryAsync(function () {\n customactions.forEach(function (obj) {\n var objExists = userCustomActions.get_data().filter(function (userCustomAction) {\n return userCustomAction.get_title() === obj.Title;\n }).length > 0;\n if (!objExists) {\n var objCreationInformation = userCustomActions.add();\n if (obj.Description) {\n objCreationInformation.set_description(obj.Description);\n }\n if (obj.CommandUIExtension) {\n objCreationInformation.set_commandUIExtension(obj.CommandUIExtension);\n }\n if (obj.Group) {\n objCreationInformation.set_group(obj.Group);\n }\n if (obj.Title) {\n objCreationInformation.set_title(obj.Title);\n }\n if (obj.Url) {\n objCreationInformation.set_url(obj.Url);\n }\n if (obj.ScriptBlock) {\n objCreationInformation.set_scriptBlock(obj.ScriptBlock);\n }\n if (obj.ScriptSrc) {\n objCreationInformation.set_scriptSrc(obj.ScriptSrc);\n }\n if (obj.Location) {\n objCreationInformation.set_location(obj.Location);\n }\n if (obj.ImageUrl) {\n objCreationInformation.set_imageUrl(obj.ImageUrl);\n }\n if (obj.Name) {\n objCreationInformation.set_name(obj.Name);\n }\n if (obj.RegistrationId) {\n objCreationInformation.set_registrationId(obj.RegistrationId);\n }\n if (obj.RegistrationType) {\n objCreationInformation.set_registrationType(obj.RegistrationType);\n }\n if (obj.Rights) {\n objCreationInformation.set_rights(obj.Rights);\n }\n if (obj.Sequence) {\n objCreationInformation.set_sequence(obj.Sequence);\n }\n objCreationInformation.update();\n }\n });\n clientContext.executeQueryAsync(function () {\n _super.prototype.scope_ended.call(_this);\n resolve();\n }, function () {\n _super.prototype.scope_ended.call(_this);\n resolve();\n });\n }, function () {\n _super.prototype.scope_ended.call(_this);\n resolve();\n });\n });\n };\n return ObjectCustomActions;\n}(objecthandlerbase_1.ObjectHandlerBase));\nexports.ObjectCustomActions = ObjectCustomActions;\n\n},{\"./objecthandlerbase\":12}],10:[function(require,module,exports){\n\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar objecthandlerbase_1 = require(\"./objecthandlerbase\");\nvar ObjectFeatures = (function (_super) {\n __extends(ObjectFeatures, _super);\n function ObjectFeatures() {\n _super.call(this, \"Features\");\n }\n ObjectFeatures.prototype.ProvisionObjects = function (features) {\n var _this = this;\n _super.prototype.scope_started.call(this);\n return new Promise(function (resolve, reject) {\n var clientContext = SP.ClientContext.get_current();\n var web = clientContext.get_web();\n var webFeatures = web.get_features();\n features.forEach(function (f) {\n if (f.Deactivate === true) {\n webFeatures.remove(new SP.Guid(f.ID), true);\n }\n else {\n webFeatures.add(new SP.Guid(f.ID), true, SP.FeatureDefinitionScope.none);\n }\n });\n web.update();\n clientContext.load(webFeatures);\n clientContext.executeQueryAsync(function () {\n _super.prototype.scope_ended.call(_this);\n resolve();\n }, function () {\n _super.prototype.scope_ended.call(_this);\n resolve();\n });\n });\n };\n return ObjectFeatures;\n}(objecthandlerbase_1.ObjectHandlerBase));\nexports.ObjectFeatures = ObjectFeatures;\n\n},{\"./objecthandlerbase\":12}],11:[function(require,module,exports){\n\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar CoreUtil = require(\"../../../utils/util\");\nvar util_1 = require(\"../util\");\nvar objecthandlerbase_1 = require(\"./objecthandlerbase\");\nvar ObjectFiles = (function (_super) {\n __extends(ObjectFiles, _super);\n function ObjectFiles() {\n _super.call(this, \"Files\");\n }\n ObjectFiles.prototype.ProvisionObjects = function (objects) {\n var _this = this;\n _super.prototype.scope_started.call(this);\n return new Promise(function (resolve, reject) {\n var clientContext = SP.ClientContext.get_current();\n var web = clientContext.get_web();\n var fileInfos = [];\n var promises = [];\n objects.forEach(function (obj, index) {\n promises.push(_this.httpClient.fetchRaw(util_1.Util.replaceUrlTokens(obj.Src)).then(function (response) {\n return response.text();\n }));\n });\n Promise.all(promises).then(function (responses) {\n responses.forEach(function (response, index) {\n var obj = objects[index];\n var filename = _this.GetFilenameFromFilePath(obj.Dest);\n var webServerRelativeUrl = _spPageContextInfo.webServerRelativeUrl;\n var folder = web.getFolderByServerRelativeUrl(webServerRelativeUrl + \"/\" + _this.GetFolderFromFilePath(obj.Dest));\n var fi = {\n Contents: response,\n Dest: obj.Dest,\n Filename: filename,\n Folder: folder,\n Instance: null,\n Overwrite: false,\n Properties: [],\n RemoveExistingWebParts: true,\n ServerRelativeUrl: obj.Dest,\n Src: obj.Src,\n Views: [],\n WebParts: [],\n };\n CoreUtil.Util.extend(fi, obj);\n if (fi.Filename.indexOf(\"Form.aspx\") !== -1) {\n return;\n }\n var objCreationInformation = new SP.FileCreationInformation();\n objCreationInformation.set_overwrite(fi.Overwrite);\n objCreationInformation.set_url(fi.Filename);\n objCreationInformation.set_content(new SP.Base64EncodedByteArray());\n for (var i = 0; i < fi.Contents.length; i++) {\n objCreationInformation.get_content().append(fi.Contents.charCodeAt(i));\n }\n clientContext.load(fi.Folder.get_files().add(objCreationInformation));\n fileInfos.push(fi);\n });\n });\n clientContext.executeQueryAsync(function () {\n promises = [];\n fileInfos.forEach(function (fi) {\n if (fi.Properties && Object.keys(fi.Properties).length > 0) {\n promises.push(_this.ApplyFileProperties(fi.Dest, fi.Properties));\n }\n if (fi.WebParts && fi.WebParts.length > 0) {\n promises.push(_this.AddWebPartsToWebPartPage(fi.Dest, fi.Src, fi.WebParts, fi.RemoveExistingWebParts));\n }\n });\n Promise.all(promises).then(function () {\n _this.ModifyHiddenViews(objects).then(function (value) {\n _super.prototype.scope_ended.call(_this);\n resolve(value);\n }, function (error) {\n _super.prototype.scope_ended.call(_this);\n reject(error);\n });\n });\n }, function (error) {\n _super.prototype.scope_ended.call(_this);\n reject(error);\n });\n });\n };\n ObjectFiles.prototype.RemoveWebPartsFromFileIfSpecified = function (clientContext, limitedWebPartManager, shouldRemoveExisting) {\n return new Promise(function (resolve, reject) {\n if (!shouldRemoveExisting) {\n resolve();\n }\n var existingWebParts = limitedWebPartManager.get_webParts();\n clientContext.load(existingWebParts);\n clientContext.executeQueryAsync(function () {\n existingWebParts.get_data().forEach(function (wp) {\n wp.deleteWebPart();\n });\n clientContext.load(existingWebParts);\n clientContext.executeQueryAsync(resolve, reject);\n }, reject);\n });\n };\n ObjectFiles.prototype.GetWebPartXml = function (webParts) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n var promises = [];\n webParts.forEach(function (wp, index) {\n if (wp.Contents.FileUrl) {\n var fileUrl = util_1.Util.replaceUrlTokens(wp.Contents.FileUrl);\n promises.push(_this.httpClient.fetchRaw(fileUrl).then(function (response) {\n return response.text();\n }));\n }\n else {\n promises.push((function () {\n return new Promise(function (res, rej) {\n res();\n });\n })());\n }\n });\n Promise.all(promises).then(function (responses) {\n responses.forEach(function (response, index) {\n var wp = webParts[index];\n if (wp !== null && response && response.length > 0) {\n wp.Contents.Xml = response;\n }\n });\n resolve(webParts);\n });\n });\n };\n ObjectFiles.prototype.AddWebPartsToWebPartPage = function (dest, src, webParts, shouldRemoveExisting) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n var clientContext = SP.ClientContext.get_current();\n var web = clientContext.get_web();\n var fileServerRelativeUrl = _spPageContextInfo.webServerRelativeUrl + \"/\" + dest;\n var file = web.getFileByServerRelativeUrl(fileServerRelativeUrl);\n clientContext.load(file);\n clientContext.executeQueryAsync(function () {\n var limitedWebPartManager = file.getLimitedWebPartManager(SP.WebParts.PersonalizationScope.shared);\n _this.RemoveWebPartsFromFileIfSpecified(clientContext, limitedWebPartManager, shouldRemoveExisting).then(function () {\n _this.GetWebPartXml(webParts).then(function (webPartsWithXml) {\n webPartsWithXml.forEach(function (wp) {\n if (!wp.Contents.Xml) {\n return;\n }\n var oWebPartDefinition = limitedWebPartManager.importWebPart(util_1.Util.replaceUrlTokens(wp.Contents.Xml));\n var oWebPart = oWebPartDefinition.get_webPart();\n limitedWebPartManager.addWebPart(oWebPart, wp.Zone, wp.Order);\n });\n clientContext.executeQueryAsync(resolve, resolve);\n });\n });\n }, resolve);\n });\n };\n ObjectFiles.prototype.ApplyFileProperties = function (dest, fileProperties) {\n return new Promise(function (resolve, reject) {\n var clientContext = SP.ClientContext.get_current();\n var web = clientContext.get_web();\n var fileServerRelativeUrl = _spPageContextInfo.webServerRelativeUrl + \"/\" + dest;\n var file = web.getFileByServerRelativeUrl(fileServerRelativeUrl);\n var listItemAllFields = file.get_listItemAllFields();\n Object.keys(fileProperties).forEach(function (key) {\n listItemAllFields.set_item(key, fileProperties[key]);\n });\n listItemAllFields.update();\n clientContext.executeQueryAsync(resolve, resolve);\n });\n };\n ObjectFiles.prototype.GetViewFromCollectionByUrl = function (viewCollection, url) {\n var serverRelativeUrl = _spPageContextInfo.webServerRelativeUrl + \"/\" + url;\n var viewCollectionEnumerator = viewCollection.getEnumerator();\n while (viewCollectionEnumerator.moveNext()) {\n var view = viewCollectionEnumerator.get_current();\n if (view.get_serverRelativeUrl().toString().toLowerCase() === serverRelativeUrl.toLowerCase()) {\n return view;\n }\n }\n return null;\n };\n ObjectFiles.prototype.ModifyHiddenViews = function (objects) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n var clientContext = SP.ClientContext.get_current();\n var web = clientContext.get_web();\n var mapping = {};\n var lists = [];\n var listViewCollections = [];\n objects.forEach(function (obj) {\n if (!obj.Views) {\n return;\n }\n obj.Views.forEach(function (v) {\n mapping[v.List] = mapping[v.List] || [];\n mapping[v.List].push(CoreUtil.Util.extend(v, { \"Url\": obj.Dest }));\n });\n });\n Object.keys(mapping).forEach(function (l, index) {\n lists.push(web.get_lists().getByTitle(l));\n listViewCollections.push(web.get_lists().getByTitle(l).get_views());\n clientContext.load(lists[index]);\n clientContext.load(listViewCollections[index]);\n });\n clientContext.executeQueryAsync(function () {\n Object.keys(mapping).forEach(function (l, index) {\n var views = mapping[l];\n var list = lists[index];\n var viewCollection = listViewCollections[index];\n views.forEach(function (v) {\n var view = _this.GetViewFromCollectionByUrl(viewCollection, v.Url);\n if (view == null) {\n return;\n }\n if (v.Paged) {\n view.set_paged(v.Paged);\n }\n if (v.Query) {\n view.set_viewQuery(v.Query);\n }\n if (v.RowLimit) {\n view.set_rowLimit(v.RowLimit);\n }\n if (v.ViewFields && v.ViewFields.length > 0) {\n var columns_1 = view.get_viewFields();\n columns_1.removeAll();\n v.ViewFields.forEach(function (vf) {\n columns_1.add(vf);\n });\n }\n view.update();\n });\n clientContext.load(viewCollection);\n list.update();\n });\n clientContext.executeQueryAsync(resolve, resolve);\n }, resolve);\n });\n };\n ObjectFiles.prototype.GetFolderFromFilePath = function (filePath) {\n var split = filePath.split(\"/\");\n return split.splice(0, split.length - 1).join(\"/\");\n };\n ObjectFiles.prototype.GetFilenameFromFilePath = function (filePath) {\n var split = filePath.split(\"/\");\n return split[split.length - 1];\n };\n return ObjectFiles;\n}(objecthandlerbase_1.ObjectHandlerBase));\nexports.ObjectFiles = ObjectFiles;\n;\n\n},{\"../../../utils/util\":23,\"../util\":20,\"./objecthandlerbase\":12}],12:[function(require,module,exports){\n\"use strict\";\nvar httpclient_1 = require(\"../../../net/httpclient\");\nvar logging_1 = require(\"../../../utils/logging\");\nvar ObjectHandlerBase = (function () {\n function ObjectHandlerBase(name) {\n this.name = name;\n this.httpClient = new httpclient_1.HttpClient();\n }\n ObjectHandlerBase.prototype.ProvisionObjects = function (objects, parameters) {\n return new Promise(function (resolve, reject) { resolve(\"Not implemented.\"); });\n };\n ObjectHandlerBase.prototype.scope_started = function () {\n logging_1.Logger.write(this.name + \": Code execution scope started\");\n };\n ObjectHandlerBase.prototype.scope_ended = function () {\n logging_1.Logger.write(this.name + \": Code execution scope stopped\");\n };\n return ObjectHandlerBase;\n}());\nexports.ObjectHandlerBase = ObjectHandlerBase;\n\n},{\"../../../net/httpclient\":5,\"../../../utils/logging\":22}],13:[function(require,module,exports){\n\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar sequencer_1 = require(\"../sequencer/sequencer\");\nvar objecthandlerbase_1 = require(\"./objecthandlerbase\");\nvar ObjectLists = (function (_super) {\n __extends(ObjectLists, _super);\n function ObjectLists() {\n _super.call(this, \"Lists\");\n }\n ObjectLists.prototype.ProvisionObjects = function (objects) {\n var _this = this;\n _super.prototype.scope_started.call(this);\n return new Promise(function (resolve, reject) {\n var clientContext = SP.ClientContext.get_current();\n var lists = clientContext.get_web().get_lists();\n var listInstances = [];\n clientContext.load(lists);\n clientContext.executeQueryAsync(function () {\n objects.forEach(function (obj, index) {\n var existingObj = lists.get_data().filter(function (list) {\n return list.get_title() === obj.Title;\n })[0];\n if (existingObj) {\n if (obj.Description) {\n existingObj.set_description(obj.Description);\n }\n if (obj.EnableVersioning !== undefined) {\n existingObj.set_enableVersioning(obj.EnableVersioning);\n }\n if (obj.EnableMinorVersions !== undefined) {\n existingObj.set_enableMinorVersions(obj.EnableMinorVersions);\n }\n if (obj.EnableModeration !== undefined) {\n existingObj.set_enableModeration(obj.EnableModeration);\n }\n if (obj.EnableFolderCreation !== undefined) {\n existingObj.set_enableFolderCreation(obj.EnableFolderCreation);\n }\n if (obj.EnableAttachments !== undefined) {\n existingObj.set_enableAttachments(obj.EnableAttachments);\n }\n if (obj.NoCrawl !== undefined) {\n existingObj.set_noCrawl(obj.NoCrawl);\n }\n if (obj.DefaultDisplayFormUrl) {\n existingObj.set_defaultDisplayFormUrl(obj.DefaultDisplayFormUrl);\n }\n if (obj.DefaultEditFormUrl) {\n existingObj.set_defaultEditFormUrl(obj.DefaultEditFormUrl);\n }\n if (obj.DefaultNewFormUrl) {\n existingObj.set_defaultNewFormUrl(obj.DefaultNewFormUrl);\n }\n if (obj.DraftVersionVisibility) {\n existingObj.set_draftVersionVisibility(SP.DraftVisibilityType[obj.DraftVersionVisibility]);\n }\n if (obj.ImageUrl) {\n existingObj.set_imageUrl(obj.ImageUrl);\n }\n if (obj.Hidden !== undefined) {\n existingObj.set_hidden(obj.Hidden);\n }\n if (obj.ForceCheckout !== undefined) {\n existingObj.set_forceCheckout(obj.ForceCheckout);\n }\n existingObj.update();\n listInstances.push(existingObj);\n clientContext.load(listInstances[index]);\n }\n else {\n var objCreationInformation = new SP.ListCreationInformation();\n if (obj.Description) {\n objCreationInformation.set_description(obj.Description);\n }\n if (obj.OnQuickLaunch !== undefined) {\n var value = obj.OnQuickLaunch ? SP.QuickLaunchOptions.on : SP.QuickLaunchOptions.off;\n objCreationInformation.set_quickLaunchOption(value);\n }\n if (obj.TemplateType) {\n objCreationInformation.set_templateType(obj.TemplateType);\n }\n if (obj.Title) {\n objCreationInformation.set_title(obj.Title);\n }\n if (obj.Url) {\n objCreationInformation.set_url(obj.Url);\n }\n var createdList = lists.add(objCreationInformation);\n if (obj.EnableVersioning !== undefined) {\n createdList.set_enableVersioning(obj.EnableVersioning);\n }\n if (obj.EnableMinorVersions !== undefined) {\n createdList.set_enableMinorVersions(obj.EnableMinorVersions);\n }\n if (obj.EnableModeration !== undefined) {\n createdList.set_enableModeration(obj.EnableModeration);\n }\n if (obj.EnableFolderCreation !== undefined) {\n createdList.set_enableFolderCreation(obj.EnableFolderCreation);\n }\n if (obj.EnableAttachments !== undefined) {\n createdList.set_enableAttachments(obj.EnableAttachments);\n }\n if (obj.NoCrawl !== undefined) {\n createdList.set_noCrawl(obj.NoCrawl);\n }\n if (obj.DefaultDisplayFormUrl) {\n createdList.set_defaultDisplayFormUrl(obj.DefaultDisplayFormUrl);\n }\n if (obj.DefaultEditFormUrl) {\n createdList.set_defaultEditFormUrl(obj.DefaultEditFormUrl);\n }\n if (obj.DefaultNewFormUrl) {\n createdList.set_defaultNewFormUrl(obj.DefaultNewFormUrl);\n }\n if (obj.DraftVersionVisibility) {\n var value = SP.DraftVisibilityType[obj.DraftVersionVisibility.toLocaleLowerCase()];\n createdList.set_draftVersionVisibility(value);\n }\n if (obj.ImageUrl) {\n createdList.set_imageUrl(obj.ImageUrl);\n }\n if (obj.Hidden !== undefined) {\n createdList.set_hidden(obj.Hidden);\n }\n if (obj.ForceCheckout !== undefined) {\n createdList.set_forceCheckout(obj.ForceCheckout);\n }\n listInstances.push(createdList);\n clientContext.load(listInstances[index]);\n }\n });\n clientContext.executeQueryAsync(function () {\n var sequencer = new sequencer_1.Sequencer([\n _this.ApplyContentTypeBindings,\n _this.ApplyListInstanceFieldRefs,\n _this.ApplyFields,\n _this.ApplyLookupFields,\n _this.ApplyListSecurity,\n _this.CreateViews,\n _this.InsertDataRows,\n _this.CreateFolders,\n ], { ClientContext: clientContext, ListInstances: listInstances, Objects: objects }, _this);\n sequencer.execute().then(function () {\n _super.prototype.scope_ended.call(_this);\n resolve();\n });\n }, function () {\n _super.prototype.scope_ended.call(_this);\n resolve();\n });\n }, function () {\n _super.prototype.scope_ended.call(_this);\n resolve();\n });\n });\n };\n ObjectLists.prototype.EnsureLocationBasedMetadataDefaultsReceiver = function (clientContext, list) {\n var eventReceivers = list.get_eventReceivers();\n var eventRecCreationInfo = new SP.EventReceiverDefinitionCreationInformation();\n eventRecCreationInfo.set_receiverName(\"LocationBasedMetadataDefaultsReceiver ItemAdded\");\n eventRecCreationInfo.set_synchronization(1);\n eventRecCreationInfo.set_sequenceNumber(1000);\n eventRecCreationInfo.set_receiverAssembly(\"Microsoft.Office.DocumentManagement, Version=15.0.0.0, Culture=neutral, \" +\n \"PublicKeyToken=71e9bce111e9429c\");\n eventRecCreationInfo.set_receiverClass(\"Microsoft.Office.DocumentManagement.LocationBasedMetadataDefaultsReceiver\");\n eventRecCreationInfo.set_eventType(SP.EventReceiverType.itemAdded);\n eventReceivers.add(eventRecCreationInfo);\n list.update();\n };\n ObjectLists.prototype.CreateFolders = function (params) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n params.ListInstances.forEach(function (l, index) {\n var obj = params.Objects[index];\n if (!obj.Folders) {\n return;\n }\n var folderServerRelativeUrl = _spPageContextInfo.webServerRelativeUrl + \"/\" + obj.Url;\n var rootFolder = l.get_rootFolder();\n var metadataDefaults = \"\";\n var setMetadataDefaults = false;\n obj.Folders.forEach(function (f) {\n var folderUrl = folderServerRelativeUrl + \"/\" + f.Name;\n rootFolder.get_folders().add(folderUrl);\n if (f.DefaultValues) {\n var keys = Object.keys(f.DefaultValues).length;\n if (keys > 0) {\n metadataDefaults += \"\";\n Object.keys(f.DefaultValues).forEach(function (key) {\n metadataDefaults += \"\" + f.DefaultValues[key] + \"\";\n });\n metadataDefaults += \"\";\n }\n setMetadataDefaults = true;\n }\n });\n metadataDefaults += \"\";\n if (setMetadataDefaults) {\n var metadataDefaultsFileCreateInfo = new SP.FileCreationInformation();\n metadataDefaultsFileCreateInfo.set_url(folderServerRelativeUrl + \"/Forms/client_LocationBasedDefaults.html\");\n metadataDefaultsFileCreateInfo.set_content(new SP.Base64EncodedByteArray());\n metadataDefaultsFileCreateInfo.set_overwrite(true);\n for (var i = 0; i < metadataDefaults.length; i++) {\n metadataDefaultsFileCreateInfo.get_content().append(metadataDefaults.charCodeAt(i));\n }\n rootFolder.get_files().add(metadataDefaultsFileCreateInfo);\n _this.EnsureLocationBasedMetadataDefaultsReceiver(params.ClientContext, l);\n }\n });\n params.ClientContext.executeQueryAsync(resolve, resolve);\n });\n };\n ObjectLists.prototype.ApplyContentTypeBindings = function (params) {\n return new Promise(function (resolve, reject) {\n var webCts = params.ClientContext.get_site().get_rootWeb().get_contentTypes();\n var listCts = [];\n params.ListInstances.forEach(function (l, index) {\n listCts.push(l.get_contentTypes());\n params.ClientContext.load(listCts[index], \"Include(Name,Id)\");\n if (params.Objects[index].ContentTypeBindings) {\n l.set_contentTypesEnabled(true);\n l.update();\n }\n });\n params.ClientContext.load(webCts);\n params.ClientContext.executeQueryAsync(function () {\n params.ListInstances.forEach(function (list, index) {\n var obj = params.Objects[index];\n if (!obj.ContentTypeBindings) {\n return;\n }\n var listContentTypes = listCts[index];\n var existingContentTypes = new Array();\n if (obj.RemoveExistingContentTypes && obj.ContentTypeBindings.length > 0) {\n listContentTypes.get_data().forEach(function (ct) {\n existingContentTypes.push(ct);\n });\n }\n obj.ContentTypeBindings.forEach(function (ctb) {\n listContentTypes.addExistingContentType(webCts.getById(ctb.ContentTypeId));\n });\n if (obj.RemoveExistingContentTypes && obj.ContentTypeBindings.length > 0) {\n for (var j = 0; j < existingContentTypes.length; j++) {\n var ect = existingContentTypes[j];\n ect.deleteObject();\n }\n }\n list.update();\n });\n params.ClientContext.executeQueryAsync(resolve, resolve);\n }, resolve);\n });\n };\n ObjectLists.prototype.ApplyListInstanceFieldRefs = function (params) {\n return new Promise(function (resolve, reject) {\n var siteFields = params.ClientContext.get_site().get_rootWeb().get_fields();\n params.ListInstances.forEach(function (l, index) {\n var obj = params.Objects[index];\n if (obj.FieldRefs) {\n obj.FieldRefs.forEach(function (fr) {\n var field = siteFields.getByInternalNameOrTitle(fr.Name);\n l.get_fields().add(field);\n });\n l.update();\n }\n });\n params.ClientContext.executeQueryAsync(resolve, resolve);\n });\n };\n ObjectLists.prototype.ApplyFields = function (params) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n params.ListInstances.forEach(function (l, index) {\n var obj = params.Objects[index];\n if (obj.Fields) {\n obj.Fields.forEach(function (f) {\n var fieldXml = _this.GetFieldXml(f, params.ListInstances, l);\n var fieldType = _this.GetFieldXmlAttr(fieldXml, \"Type\");\n if (fieldType !== \"Lookup\" && fieldType !== \"LookupMulti\") {\n l.get_fields().addFieldAsXml(fieldXml, true, SP.AddFieldOptions.addToAllContentTypes);\n }\n });\n l.update();\n }\n });\n params.ClientContext.executeQueryAsync(resolve, resolve);\n });\n };\n ObjectLists.prototype.ApplyLookupFields = function (params) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n params.ListInstances.forEach(function (l, index) {\n var obj = params.Objects[index];\n if (obj.Fields) {\n obj.Fields.forEach(function (f) {\n var fieldXml = _this.GetFieldXml(f, params.ListInstances, l);\n if (!fieldXml) {\n return;\n }\n var fieldType = _this.GetFieldXmlAttr(fieldXml, \"Type\");\n if (fieldType === \"Lookup\" || fieldType === \"LookupMulti\") {\n l.get_fields().addFieldAsXml(fieldXml, true, SP.AddFieldOptions.addToAllContentTypes);\n }\n });\n l.update();\n }\n });\n params.ClientContext.executeQueryAsync(resolve, resolve);\n });\n };\n ObjectLists.prototype.GetFieldXmlAttr = function (fieldXml, attr) {\n var regex = new RegExp(attr + '=[\\'|\\\"](?:(.+?))[\\'|\\\"]');\n var match = regex.exec(fieldXml);\n return match[1];\n };\n ObjectLists.prototype.GetFieldXml = function (field, lists, list) {\n var fieldXml = \"\";\n if (!field.SchemaXml) {\n var properties_1 = [];\n Object.keys(field).forEach(function (prop) {\n var value = field[prop];\n properties_1.push(prop + \"=\\\"\" + value + \"\\\"\");\n if (prop === \"List\") {\n var targetList = lists.filter(function (v) {\n return v.get_title() === value;\n });\n if (targetList.length > 0) {\n value = \"{\" + targetList[0].get_id().toString() + \"}\";\n }\n else {\n return null;\n }\n }\n });\n fieldXml = \"\";\n if (field.Type === \"Calculated\") {\n fieldXml += \"\" + field.Formula + \"\";\n }\n fieldXml += \"\";\n }\n return fieldXml;\n };\n ObjectLists.prototype.ApplyListSecurity = function (params) {\n return new Promise(function (resolve, reject) {\n params.ListInstances.forEach(function (l, index) {\n var obj = params.Objects[index];\n if (!obj.Security) {\n return;\n }\n if (obj.Security.BreakRoleInheritance) {\n l.breakRoleInheritance(obj.Security.CopyRoleAssignments, obj.Security.ClearSubscopes);\n l.update();\n params.ClientContext.load(l.get_roleAssignments());\n }\n });\n var web = params.ClientContext.get_web();\n var allProperties = web.get_allProperties();\n var siteGroups = web.get_siteGroups();\n var roleDefinitions = web.get_roleDefinitions();\n params.ClientContext.load(allProperties);\n params.ClientContext.load(roleDefinitions);\n params.ClientContext.executeQueryAsync(function () {\n params.ListInstances.forEach(function (l, index) {\n var obj = params.Objects[index];\n if (!obj.Security) {\n return;\n }\n obj.Security.RoleAssignments.forEach(function (ra) {\n var roleDef = null;\n if (typeof ra.RoleDefinition === \"number\") {\n roleDef = roleDefinitions.getById(ra.RoleDefinition);\n }\n else {\n roleDef = roleDefinitions.getByName(ra.RoleDefinition);\n }\n var roleBindings = SP.RoleDefinitionBindingCollection.newObject(params.ClientContext);\n roleBindings.add(roleDef);\n var principal = null;\n if (ra.Principal.match(/\\{[A-Za-z]*\\}+/g)) {\n var token = ra.Principal.substring(1, ra.Principal.length - 1);\n var groupId = allProperties.get_fieldValues()[(\"vti_\" + token)];\n principal = siteGroups.getById(groupId);\n }\n else {\n principal = siteGroups.getByName(principal);\n }\n l.get_roleAssignments().add(principal, roleBindings);\n });\n l.update();\n });\n params.ClientContext.executeQueryAsync(resolve, resolve);\n }, resolve);\n });\n };\n ObjectLists.prototype.CreateViews = function (params) {\n return new Promise(function (resolve, reject) {\n var listViewCollections = [];\n params.ListInstances.forEach(function (l, index) {\n listViewCollections.push(l.get_views());\n params.ClientContext.load(listViewCollections[index]);\n });\n params.ClientContext.executeQueryAsync(function () {\n params.ListInstances.forEach(function (l, index) {\n var obj = params.Objects[index];\n if (!obj.Views) {\n return;\n }\n listViewCollections.push(l.get_views());\n params.ClientContext.load(listViewCollections[index]);\n obj.Views.forEach(function (v) {\n var viewExists = listViewCollections[index].get_data().filter(function (ev) {\n if (obj.RemoveExistingViews && obj.Views.length > 0) {\n ev.deleteObject();\n return false;\n }\n return ev.get_title() === v.Title;\n }).length > 0;\n if (viewExists) {\n var view = listViewCollections[index].getByTitle(v.Title);\n if (v.Paged) {\n view.set_paged(v.Paged);\n }\n if (v.Query) {\n view.set_viewQuery(v.Query);\n }\n if (v.RowLimit) {\n view.set_rowLimit(v.RowLimit);\n }\n if (v.ViewFields && v.ViewFields.length > 0) {\n var columns_1 = view.get_viewFields();\n columns_1.removeAll();\n v.ViewFields.forEach(function (vf) {\n columns_1.add(vf);\n });\n }\n if (v.Scope) {\n view.set_scope(v.Scope);\n }\n view.update();\n }\n else {\n var viewCreationInformation = new SP.ViewCreationInformation();\n if (v.Title) {\n viewCreationInformation.set_title(v.Title);\n }\n if (v.PersonalView) {\n viewCreationInformation.set_personalView(v.PersonalView);\n }\n if (v.Paged) {\n viewCreationInformation.set_paged(v.Paged);\n }\n if (v.Query) {\n viewCreationInformation.set_query(v.Query);\n }\n if (v.RowLimit) {\n viewCreationInformation.set_rowLimit(v.RowLimit);\n }\n if (v.SetAsDefaultView) {\n viewCreationInformation.set_setAsDefaultView(v.SetAsDefaultView);\n }\n if (v.ViewFields) {\n viewCreationInformation.set_viewFields(v.ViewFields);\n }\n if (v.ViewTypeKind) {\n viewCreationInformation.set_viewTypeKind(SP.ViewType.html);\n }\n var view = l.get_views().add(viewCreationInformation);\n if (v.Scope) {\n view.set_scope(v.Scope);\n view.update();\n }\n l.update();\n }\n params.ClientContext.load(l.get_views());\n });\n });\n params.ClientContext.executeQueryAsync(resolve, resolve);\n }, resolve);\n });\n };\n ObjectLists.prototype.InsertDataRows = function (params) {\n return new Promise(function (resolve, reject) {\n params.ListInstances.forEach(function (l, index) {\n var obj = params.Objects[index];\n if (obj.DataRows) {\n obj.DataRows.forEach(function (r) {\n var item = l.addItem(new SP.ListItemCreationInformation());\n Object.keys(r).forEach(function (key) {\n item.set_item(key, r[key]);\n });\n item.update();\n params.ClientContext.load(item);\n });\n }\n });\n params.ClientContext.executeQueryAsync(resolve, resolve);\n });\n };\n return ObjectLists;\n}(objecthandlerbase_1.ObjectHandlerBase));\nexports.ObjectLists = ObjectLists;\n\n},{\"../sequencer/sequencer\":19,\"./objecthandlerbase\":12}],14:[function(require,module,exports){\n\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar util_1 = require(\"../util\");\nvar objecthandlerbase_1 = require(\"./objecthandlerbase\");\nvar ObjectNavigation = (function (_super) {\n __extends(ObjectNavigation, _super);\n function ObjectNavigation() {\n _super.call(this, \"Navigation\");\n }\n ObjectNavigation.prototype.ProvisionObjects = function (object) {\n var _this = this;\n _super.prototype.scope_started.call(this);\n var clientContext = SP.ClientContext.get_current();\n var navigation = clientContext.get_web().get_navigation();\n return new Promise(function (resolve, reject) {\n _this.ConfigureQuickLaunch(object.QuickLaunch, clientContext, _this.httpClient, navigation).then(function () {\n _super.prototype.scope_ended.call(_this);\n resolve();\n }, function () {\n _super.prototype.scope_ended.call(_this);\n reject();\n });\n });\n };\n ObjectNavigation.prototype.getNodeFromCollectionByTitle = function (nodeCollection, title) {\n var f = nodeCollection.filter(function (val) {\n return val.get_title() === title;\n });\n return f[0] || null;\n };\n ;\n ObjectNavigation.prototype.ConfigureQuickLaunch = function (nodes, clientContext, httpClient, navigation) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n if (nodes.length === 0) {\n resolve();\n }\n else {\n var quickLaunchNodeCollection_1 = navigation.get_quickLaunch();\n clientContext.load(quickLaunchNodeCollection_1);\n clientContext.executeQueryAsync(function () {\n var temporaryQuickLaunch = [];\n var index = quickLaunchNodeCollection_1.get_count() - 1;\n while (index >= 0) {\n var oldNode = quickLaunchNodeCollection_1.itemAt(index);\n temporaryQuickLaunch.push(oldNode);\n oldNode.deleteObject();\n index--;\n }\n clientContext.executeQueryAsync(function () {\n nodes.forEach(function (n) {\n var existingNode = _this.getNodeFromCollectionByTitle(temporaryQuickLaunch, n.Title);\n var newNode = new SP.NavigationNodeCreationInformation();\n newNode.set_title(n.Title);\n newNode.set_url(existingNode ? existingNode.get_url() : util_1.Util.replaceUrlTokens(n.Url));\n newNode.set_asLastNode(true);\n quickLaunchNodeCollection_1.add(newNode);\n });\n clientContext.executeQueryAsync(function () {\n httpClient.get(_spPageContextInfo.webAbsoluteUrl + \"/_api/web/Navigation/QuickLaunch\").then(function (response) {\n response.json().then(function (json) {\n json.value.forEach(function (d) {\n var node = navigation.getNodeById(d.Id);\n var childrenNodeCollection = node.get_children();\n var parentNode = nodes.filter(function (value) { return value.Title === d.Title; })[0];\n if (parentNode && parentNode.Children) {\n parentNode.Children.forEach(function (n) {\n var existingNode = _this.getNodeFromCollectionByTitle(temporaryQuickLaunch, n.Title);\n var newNode = new SP.NavigationNodeCreationInformation();\n newNode.set_title(n.Title);\n newNode.set_url(existingNode\n ? existingNode.get_url()\n : util_1.Util.replaceUrlTokens(n.Url));\n newNode.set_asLastNode(true);\n childrenNodeCollection.add(newNode);\n });\n }\n });\n clientContext.executeQueryAsync(resolve, resolve);\n });\n });\n }, resolve);\n });\n });\n }\n });\n };\n return ObjectNavigation;\n}(objecthandlerbase_1.ObjectHandlerBase));\nexports.ObjectNavigation = ObjectNavigation;\n\n},{\"../util\":20,\"./objecthandlerbase\":12}],15:[function(require,module,exports){\n\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar util_1 = require(\"../util\");\nvar objecthandlerbase_1 = require(\"./objecthandlerbase\");\nvar ObjectPropertyBagEntries = (function (_super) {\n __extends(ObjectPropertyBagEntries, _super);\n function ObjectPropertyBagEntries() {\n _super.call(this, \"PropertyBagEntries\");\n }\n ObjectPropertyBagEntries.prototype.ProvisionObjects = function (entries) {\n var _this = this;\n _super.prototype.scope_started.call(this);\n return new Promise(function (resolve, reject) {\n if (!entries || entries.length === 0) {\n resolve();\n }\n else {\n var clientContext_1 = SP.ClientContext.get_current();\n var web_1 = clientContext_1.get_web();\n var propBag_1 = web_1.get_allProperties();\n var indexedProperties_1 = [];\n for (var i = 0; i < entries.length; i++) {\n var entry = entries[i];\n propBag_1.set_item(entry.Key, entry.Value);\n if (entry.Indexed) {\n indexedProperties_1.push(util_1.Util.encodePropertyKey(entry.Key));\n }\n ;\n }\n ;\n web_1.update();\n clientContext_1.load(propBag_1);\n clientContext_1.executeQueryAsync(function () {\n if (indexedProperties_1.length > 0) {\n propBag_1.set_item(\"vti_indexedpropertykeys\", indexedProperties_1.join(\"|\"));\n web_1.update();\n clientContext_1.executeQueryAsync(function () {\n _super.prototype.scope_ended.call(_this);\n resolve();\n }, function () {\n _super.prototype.scope_ended.call(_this);\n resolve();\n });\n }\n else {\n _super.prototype.scope_ended.call(_this);\n resolve();\n }\n }, function () {\n _super.prototype.scope_ended.call(_this);\n resolve();\n });\n }\n });\n };\n return ObjectPropertyBagEntries;\n}(objecthandlerbase_1.ObjectHandlerBase));\nexports.ObjectPropertyBagEntries = ObjectPropertyBagEntries;\n\n},{\"../util\":20,\"./objecthandlerbase\":12}],16:[function(require,module,exports){\n\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar objecthandlerbase_1 = require(\"./objecthandlerbase\");\nvar ObjectWebSettings = (function (_super) {\n __extends(ObjectWebSettings, _super);\n function ObjectWebSettings() {\n _super.call(this, \"WebSettings\");\n }\n ObjectWebSettings.prototype.ProvisionObjects = function (object) {\n var _this = this;\n _super.prototype.scope_started.call(this);\n return new Promise(function (resolve, reject) {\n var clientContext = SP.ClientContext.get_current();\n var web = clientContext.get_web();\n if (object.WelcomePage) {\n web.get_rootFolder().set_welcomePage(object.WelcomePage);\n web.get_rootFolder().update();\n }\n if (object.MasterUrl) {\n web.set_masterUrl(object.MasterUrl);\n }\n if (object.CustomMasterUrl) {\n web.set_customMasterUrl(object.CustomMasterUrl);\n }\n if (object.SaveSiteAsTemplateEnabled !== undefined) {\n web.set_saveSiteAsTemplateEnabled(object.SaveSiteAsTemplateEnabled);\n }\n if (object.QuickLaunchEnabled !== undefined) {\n web.set_saveSiteAsTemplateEnabled(object.QuickLaunchEnabled);\n }\n if (object.TreeViewEnabled !== undefined) {\n web.set_treeViewEnabled(object.TreeViewEnabled);\n }\n web.update();\n clientContext.load(web);\n clientContext.executeQueryAsync(function () {\n _super.prototype.scope_ended.call(_this);\n resolve();\n }, function () {\n _super.prototype.scope_ended.call(_this);\n resolve();\n });\n });\n };\n return ObjectWebSettings;\n}(objecthandlerbase_1.ObjectHandlerBase));\nexports.ObjectWebSettings = ObjectWebSettings;\n\n},{\"./objecthandlerbase\":12}],17:[function(require,module,exports){\n\"use strict\";\nvar provisioningstep_1 = require(\"./provisioningstep\");\nvar objectnavigation_1 = require(\"./objecthandlers/objectnavigation\");\nvar objectpropertybagentries_1 = require(\"./objecthandlers/objectpropertybagentries\");\nvar objectfeatures_1 = require(\"./objecthandlers/objectfeatures\");\nvar objectwebsettings_1 = require(\"./objecthandlers/objectwebsettings\");\nvar objectcomposedlook_1 = require(\"./objecthandlers/objectcomposedlook\");\nvar objectcustomactions_1 = require(\"./objecthandlers/objectcustomactions\");\nvar objectfiles_1 = require(\"./objecthandlers/objectfiles\");\nvar objectlists_1 = require(\"./objecthandlers/objectlists\");\nvar util_1 = require(\"./util\");\nvar logging_1 = require(\"../../utils/logging\");\nvar httpclient_1 = require(\"../../net/httpclient\");\nvar Provisioning = (function () {\n function Provisioning() {\n this.handlers = {\n \"Navigation\": objectnavigation_1.ObjectNavigation,\n \"PropertyBagEntries\": objectpropertybagentries_1.ObjectPropertyBagEntries,\n \"Features\": objectfeatures_1.ObjectFeatures,\n \"WebSettings\": objectwebsettings_1.ObjectWebSettings,\n \"ComposedLook\": objectcomposedlook_1.ObjectComposedLook,\n \"CustomActions\": objectcustomactions_1.ObjectCustomActions,\n \"Files\": objectfiles_1.ObjectFiles,\n \"Lists\": objectlists_1.ObjectLists,\n };\n this.httpClient = new httpclient_1.HttpClient();\n }\n Provisioning.prototype.applyTemplate = function (path) {\n var _this = this;\n var url = util_1.Util.replaceUrlTokens(path);\n return new Promise(function (resolve, reject) {\n _this.httpClient.get(url).then(function (response) {\n if (response.ok) {\n response.json().then(function (template) {\n _this.start(template, Object.keys(template)).then(resolve, reject);\n });\n }\n else {\n reject(response.statusText);\n }\n }, function (error) {\n logging_1.Logger.write(\"Provisioning: The provided template is invalid\", logging_1.LogLevel.Error);\n });\n });\n };\n Provisioning.prototype.start = function (json, queue) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n _this.startTime = new Date().getTime();\n _this.queueItems = [];\n queue.forEach(function (q, index) {\n if (!_this.handlers[q]) {\n return;\n }\n _this.queueItems.push(new provisioningstep_1.ProvisioningStep(q, index, json[q], json.Parameters, _this.handlers[q]));\n });\n var promises = [];\n promises.push(new Promise(function (res) {\n logging_1.Logger.write(\"Provisioning: Code execution scope started\", logging_1.LogLevel.Info);\n res();\n }));\n var index = 1;\n while (_this.queueItems[index - 1] !== undefined) {\n var i = promises.length - 1;\n promises.push(_this.queueItems[index - 1].execute(promises[i]));\n index++;\n }\n ;\n Promise.all(promises).then(function (value) {\n logging_1.Logger.write(\"Provisioning: Code execution scope ended\", logging_1.LogLevel.Info);\n resolve(value);\n }, function (error) {\n logging_1.Logger.write(\"Provisioning: Code execution scope ended\" + JSON.stringify(error), logging_1.LogLevel.Error);\n reject(error);\n });\n });\n };\n return Provisioning;\n}());\nexports.Provisioning = Provisioning;\n\n},{\"../../net/httpclient\":5,\"../../utils/logging\":22,\"./objecthandlers/objectcomposedlook\":8,\"./objecthandlers/objectcustomactions\":9,\"./objecthandlers/objectfeatures\":10,\"./objecthandlers/objectfiles\":11,\"./objecthandlers/objectlists\":13,\"./objecthandlers/objectnavigation\":14,\"./objecthandlers/objectpropertybagentries\":15,\"./objecthandlers/objectwebsettings\":16,\"./provisioningstep\":18,\"./util\":20}],18:[function(require,module,exports){\n\"use strict\";\nvar ProvisioningStep = (function () {\n function ProvisioningStep(name, index, objects, parameters, handler) {\n this.name = name;\n this.index = index;\n this.objects = objects;\n this.parameters = parameters;\n this.handler = handler;\n }\n ProvisioningStep.prototype.execute = function (dependentPromise) {\n var _this = this;\n var _handler = new this.handler();\n if (!dependentPromise) {\n return _handler.ProvisionObjects(this.objects, this.parameters);\n }\n return new Promise(function (resolve, reject) {\n dependentPromise.then(function () {\n return _handler.ProvisionObjects(_this.objects, _this.parameters).then(resolve, resolve);\n });\n });\n };\n return ProvisioningStep;\n}());\nexports.ProvisioningStep = ProvisioningStep;\n\n},{}],19:[function(require,module,exports){\n\"use strict\";\nvar Sequencer = (function () {\n function Sequencer(functions, parameter, scope) {\n this.functions = functions;\n this.parameter = parameter;\n this.scope = scope;\n }\n Sequencer.prototype.execute = function (progressFunction) {\n var _this = this;\n var promiseSequence = Promise.resolve();\n this.functions.forEach(function (sequenceFunction, functionNr) {\n promiseSequence = promiseSequence.then(function () {\n return sequenceFunction.call(_this.scope, _this.parameter);\n }).then(function (result) {\n if (progressFunction) {\n progressFunction.call(_this, functionNr, _this.functions);\n }\n });\n }, this);\n return promiseSequence;\n };\n return Sequencer;\n}());\nexports.Sequencer = Sequencer;\n\n},{}],20:[function(require,module,exports){\n\"use strict\";\nvar Util = (function () {\n function Util() {\n }\n Util.getRelativeUrl = function (url) {\n return url.replace(document.location.protocol + \"//\" + document.location.hostname, \"\");\n };\n Util.replaceUrlTokens = function (url) {\n return url.replace(/{site}/g, _spPageContextInfo.webAbsoluteUrl)\n .replace(/{sitecollection}/g, _spPageContextInfo.siteAbsoluteUrl)\n .replace(/{themegallery}/g, _spPageContextInfo.siteAbsoluteUrl + \"/_catalogs/theme/15\");\n };\n ;\n Util.encodePropertyKey = function (propKey) {\n var bytes = [];\n for (var i = 0; i < propKey.length; ++i) {\n bytes.push(propKey.charCodeAt(i));\n bytes.push(0);\n }\n var b64encoded = window.btoa(String.fromCharCode.apply(null, bytes));\n return b64encoded;\n };\n return Util;\n}());\nexports.Util = Util;\n\n},{}],21:[function(require,module,exports){\n\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar util_1 = require(\"../../utils/util\");\nvar logging_1 = require(\"../../utils/logging\");\nvar httpclient_1 = require(\"../../net/httpclient\");\nvar pnplibconfig_1 = require(\"../../configuration/pnplibconfig\");\nfunction extractOdataId(candidate) {\n if (candidate.hasOwnProperty(\"odata.id\")) {\n return candidate[\"odata.id\"];\n }\n else if (candidate.hasOwnProperty(\"__metadata\") && candidate.__metadata.hasOwnProperty(\"id\")) {\n return candidate.__metadata.id;\n }\n else {\n logging_1.Logger.log({\n data: candidate,\n level: logging_1.LogLevel.Error,\n message: \"Could not extract odata id in object, you may be using nometadata. Object data logged to logger.\",\n });\n throw new Error(\"Could not extract odata id in object, you may be using nometadata. Object data logged to logger.\");\n }\n}\nexports.extractOdataId = extractOdataId;\nvar ODataParserBase = (function () {\n function ODataParserBase() {\n }\n ODataParserBase.prototype.parse = function (r) {\n return r.json().then(function (json) {\n var result = json;\n if (json.hasOwnProperty(\"d\")) {\n if (json.d.hasOwnProperty(\"results\")) {\n result = json.d.results;\n }\n else {\n result = json.d;\n }\n }\n else if (json.hasOwnProperty(\"value\")) {\n result = json.value;\n }\n return result;\n });\n };\n return ODataParserBase;\n}());\nexports.ODataParserBase = ODataParserBase;\nvar ODataDefaultParser = (function (_super) {\n __extends(ODataDefaultParser, _super);\n function ODataDefaultParser() {\n _super.apply(this, arguments);\n }\n return ODataDefaultParser;\n}(ODataParserBase));\nexports.ODataDefaultParser = ODataDefaultParser;\nvar ODataRawParserImpl = (function () {\n function ODataRawParserImpl() {\n }\n ODataRawParserImpl.prototype.parse = function (r) {\n return r.json();\n };\n return ODataRawParserImpl;\n}());\nexports.ODataRawParserImpl = ODataRawParserImpl;\nvar ODataValueParserImpl = (function (_super) {\n __extends(ODataValueParserImpl, _super);\n function ODataValueParserImpl() {\n _super.apply(this, arguments);\n }\n ODataValueParserImpl.prototype.parse = function (r) {\n return _super.prototype.parse.call(this, r).then(function (d) { return d; });\n };\n return ODataValueParserImpl;\n}(ODataParserBase));\nvar ODataEntityParserImpl = (function (_super) {\n __extends(ODataEntityParserImpl, _super);\n function ODataEntityParserImpl(factory) {\n _super.call(this);\n this.factory = factory;\n }\n ODataEntityParserImpl.prototype.parse = function (r) {\n var _this = this;\n return _super.prototype.parse.call(this, r).then(function (d) {\n var o = new _this.factory(getEntityUrl(d), null);\n return util_1.Util.extend(o, d);\n });\n };\n return ODataEntityParserImpl;\n}(ODataParserBase));\nvar ODataEntityArrayParserImpl = (function (_super) {\n __extends(ODataEntityArrayParserImpl, _super);\n function ODataEntityArrayParserImpl(factory) {\n _super.call(this);\n this.factory = factory;\n }\n ODataEntityArrayParserImpl.prototype.parse = function (r) {\n var _this = this;\n return _super.prototype.parse.call(this, r).then(function (d) {\n return d.map(function (v) {\n var o = new _this.factory(getEntityUrl(v), null);\n return util_1.Util.extend(o, v);\n });\n });\n };\n return ODataEntityArrayParserImpl;\n}(ODataParserBase));\nfunction getEntityUrl(entity) {\n if (entity.hasOwnProperty(\"__metadata\")) {\n return entity.__metadata.uri;\n }\n else if (entity.hasOwnProperty(\"odata.editLink\")) {\n return util_1.Util.combinePaths(\"_api\", entity[\"odata.editLink\"]);\n }\n else {\n logging_1.Logger.write(\"No uri information found in ODataEntity parsing, chaining will fail for this object.\", logging_1.LogLevel.Warning);\n return \"\";\n }\n}\nexports.ODataRaw = new ODataRawParserImpl();\nfunction ODataValue() {\n return new ODataValueParserImpl();\n}\nexports.ODataValue = ODataValue;\nfunction ODataEntity(factory) {\n return new ODataEntityParserImpl(factory);\n}\nexports.ODataEntity = ODataEntity;\nfunction ODataEntityArray(factory) {\n return new ODataEntityArrayParserImpl(factory);\n}\nexports.ODataEntityArray = ODataEntityArray;\nvar ODataBatch = (function () {\n function ODataBatch(_batchId) {\n if (_batchId === void 0) { _batchId = util_1.Util.getGUID(); }\n this._batchId = _batchId;\n this._requests = [];\n this._batchDepCount = 0;\n }\n ODataBatch.prototype.add = function (url, method, options, parser) {\n var info = {\n method: method.toUpperCase(),\n options: options,\n parser: parser,\n reject: null,\n resolve: null,\n url: url,\n };\n var p = new Promise(function (resolve, reject) {\n info.resolve = resolve;\n info.reject = reject;\n });\n this._requests.push(info);\n return p;\n };\n ODataBatch.prototype.incrementBatchDep = function () {\n this._batchDepCount++;\n };\n ODataBatch.prototype.decrementBatchDep = function () {\n this._batchDepCount--;\n };\n ODataBatch.prototype.execute = function () {\n var _this = this;\n return new Promise(function (resolve, reject) {\n if (_this._batchDepCount > 0) {\n setTimeout(function () { return _this.execute(); }, 100);\n }\n else {\n _this.executeImpl().then(function () { return resolve(); }).catch(reject);\n }\n });\n };\n ODataBatch.prototype.executeImpl = function () {\n var _this = this;\n if (this._requests.length < 1) {\n return new Promise(function (r) { return r(); });\n }\n var batchBody = [];\n var currentChangeSetId = \"\";\n this._requests.forEach(function (reqInfo, index) {\n if (reqInfo.method === \"GET\") {\n if (currentChangeSetId.length > 0) {\n batchBody.push(\"--changeset_\" + currentChangeSetId + \"--\\n\\n\");\n currentChangeSetId = \"\";\n }\n batchBody.push(\"--batch_\" + _this._batchId + \"\\n\");\n }\n else {\n if (currentChangeSetId.length < 1) {\n currentChangeSetId = util_1.Util.getGUID();\n batchBody.push(\"--batch_\" + _this._batchId + \"\\n\");\n batchBody.push(\"Content-Type: multipart/mixed; boundary=\\\"changeset_\" + currentChangeSetId + \"\\\"\\n\\n\");\n }\n batchBody.push(\"--changeset_\" + currentChangeSetId + \"\\n\");\n }\n batchBody.push(\"Content-Type: application/http\\n\");\n batchBody.push(\"Content-Transfer-Encoding: binary\\n\\n\");\n var headers = {\n \"Accept\": \"application/json;\",\n };\n if (reqInfo.method !== \"GET\") {\n var method = reqInfo.method;\n if (reqInfo.options && reqInfo.options.headers && reqInfo.options.headers[\"X-HTTP-Method\"] !== typeof undefined) {\n method = reqInfo.options.headers[\"X-HTTP-Method\"];\n delete reqInfo.options.headers[\"X-HTTP-Method\"];\n }\n batchBody.push(method + \" \" + reqInfo.url + \" HTTP/1.1\\n\");\n headers = util_1.Util.extend(headers, { \"Content-Type\": \"application/json;odata=verbose;charset=utf-8\" });\n }\n else {\n batchBody.push(reqInfo.method + \" \" + reqInfo.url + \" HTTP/1.1\\n\");\n }\n if (typeof pnplibconfig_1.RuntimeConfig.headers !== \"undefined\") {\n headers = util_1.Util.extend(headers, pnplibconfig_1.RuntimeConfig.headers);\n }\n if (reqInfo.options && reqInfo.options.headers) {\n headers = util_1.Util.extend(headers, reqInfo.options.headers);\n }\n for (var name_1 in headers) {\n if (headers.hasOwnProperty(name_1)) {\n batchBody.push(name_1 + \": \" + headers[name_1] + \"\\n\");\n }\n }\n batchBody.push(\"\\n\");\n if (reqInfo.options.body) {\n batchBody.push(reqInfo.options.body + \"\\n\\n\");\n }\n });\n if (currentChangeSetId.length > 0) {\n batchBody.push(\"--changeset_\" + currentChangeSetId + \"--\\n\\n\");\n currentChangeSetId = \"\";\n }\n batchBody.push(\"--batch_\" + this._batchId + \"--\\n\");\n var batchHeaders = {\n \"Content-Type\": \"multipart/mixed; boundary=batch_\" + this._batchId,\n };\n var batchOptions = {\n \"body\": batchBody.join(\"\"),\n \"headers\": batchHeaders,\n };\n var client = new httpclient_1.HttpClient();\n return client.post(util_1.Util.makeUrlAbsolute(\"/_api/$batch\"), batchOptions)\n .then(function (r) { return r.text(); })\n .then(this._parseResponse)\n .then(function (responses) {\n if (responses.length !== _this._requests.length) {\n throw new Error(\"Could not properly parse responses to match requests in batch.\");\n }\n var resolutions = [];\n for (var i = 0; i < responses.length; i++) {\n var request = _this._requests[i];\n var response = responses[i];\n if (!response.ok) {\n request.reject(new Error(response.statusText));\n }\n resolutions.push(request.parser.parse(response).then(request.resolve).catch(request.reject));\n }\n return Promise.all(resolutions);\n });\n };\n ODataBatch.prototype._parseResponse = function (body) {\n return new Promise(function (resolve, reject) {\n var responses = [];\n var header = \"--batchresponse_\";\n var statusRegExp = new RegExp(\"^HTTP/[0-9.]+ +([0-9]+) +(.*)\", \"i\");\n var lines = body.split(\"\\n\");\n var state = \"batch\";\n var status;\n var statusText;\n for (var i = 0; i < lines.length; ++i) {\n var line = lines[i];\n switch (state) {\n case \"batch\":\n if (line.substr(0, header.length) === header) {\n state = \"batchHeaders\";\n }\n else {\n if (line.trim() !== \"\") {\n throw new Error(\"Invalid response, line \" + i);\n }\n }\n break;\n case \"batchHeaders\":\n if (line.trim() === \"\") {\n state = \"status\";\n }\n break;\n case \"status\":\n var parts = statusRegExp.exec(line);\n if (parts.length !== 3) {\n throw new Error(\"Invalid status, line \" + i);\n }\n status = parseInt(parts[1], 10);\n statusText = parts[2];\n state = \"statusHeaders\";\n break;\n case \"statusHeaders\":\n if (line.trim() === \"\") {\n state = \"body\";\n }\n break;\n case \"body\":\n var response = void 0;\n if (status === 204) {\n response = new Response();\n }\n else {\n response = new Response(line, { status: status, statusText: statusText });\n }\n responses.push(response);\n state = \"batch\";\n break;\n }\n }\n if (state !== \"status\") {\n reject(new Error(\"Unexpected end of input\"));\n }\n resolve(responses);\n });\n };\n return ODataBatch;\n}());\nexports.ODataBatch = ODataBatch;\n\n},{\"../../configuration/pnplibconfig\":2,\"../../net/httpclient\":5,\"../../utils/logging\":22,\"../../utils/util\":23}],22:[function(require,module,exports){\n\"use strict\";\n(function (LogLevel) {\n LogLevel[LogLevel[\"Verbose\"] = 0] = \"Verbose\";\n LogLevel[LogLevel[\"Info\"] = 1] = \"Info\";\n LogLevel[LogLevel[\"Warning\"] = 2] = \"Warning\";\n LogLevel[LogLevel[\"Error\"] = 3] = \"Error\";\n LogLevel[LogLevel[\"Off\"] = 99] = \"Off\";\n})(exports.LogLevel || (exports.LogLevel = {}));\nvar LogLevel = exports.LogLevel;\nvar Logger = (function () {\n function Logger() {\n }\n Object.defineProperty(Logger, \"activeLogLevel\", {\n get: function () {\n return Logger.instance.activeLogLevel;\n },\n set: function (value) {\n Logger.instance.activeLogLevel = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Logger, \"instance\", {\n get: function () {\n if (typeof Logger._instance === \"undefined\" || Logger._instance === null) {\n Logger._instance = new LoggerImpl();\n }\n return Logger._instance;\n },\n enumerable: true,\n configurable: true\n });\n Logger.subscribe = function () {\n var listeners = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n listeners[_i - 0] = arguments[_i];\n }\n for (var i = 0; i < listeners.length; i++) {\n Logger.instance.subscribe(listeners[i]);\n }\n };\n Logger.clearSubscribers = function () {\n return Logger.instance.clearSubscribers();\n };\n Object.defineProperty(Logger, \"count\", {\n get: function () {\n return Logger.instance.count;\n },\n enumerable: true,\n configurable: true\n });\n Logger.write = function (message, level) {\n if (level === void 0) { level = LogLevel.Verbose; }\n Logger.instance.log({ level: level, message: message });\n };\n Logger.log = function (entry) {\n Logger.instance.log(entry);\n };\n Logger.measure = function (name, f) {\n return Logger.instance.measure(name, f);\n };\n return Logger;\n}());\nexports.Logger = Logger;\nvar LoggerImpl = (function () {\n function LoggerImpl(activeLogLevel, subscribers) {\n if (activeLogLevel === void 0) { activeLogLevel = LogLevel.Warning; }\n if (subscribers === void 0) { subscribers = []; }\n this.activeLogLevel = activeLogLevel;\n this.subscribers = subscribers;\n }\n LoggerImpl.prototype.subscribe = function (listener) {\n this.subscribers.push(listener);\n };\n LoggerImpl.prototype.clearSubscribers = function () {\n var s = this.subscribers.slice(0);\n this.subscribers.length = 0;\n return s;\n };\n Object.defineProperty(LoggerImpl.prototype, \"count\", {\n get: function () {\n return this.subscribers.length;\n },\n enumerable: true,\n configurable: true\n });\n LoggerImpl.prototype.write = function (message, level) {\n if (level === void 0) { level = LogLevel.Verbose; }\n this.log({ level: level, message: message });\n };\n LoggerImpl.prototype.log = function (entry) {\n if (typeof entry === \"undefined\" || entry.level < this.activeLogLevel) {\n return;\n }\n for (var i = 0; i < this.subscribers.length; i++) {\n this.subscribers[i].log(entry);\n }\n };\n LoggerImpl.prototype.measure = function (name, f) {\n console.profile(name);\n try {\n return f();\n }\n finally {\n console.profileEnd();\n }\n };\n return LoggerImpl;\n}());\nvar ConsoleListener = (function () {\n function ConsoleListener() {\n }\n ConsoleListener.prototype.log = function (entry) {\n var msg = this.format(entry);\n switch (entry.level) {\n case LogLevel.Verbose:\n case LogLevel.Info:\n console.log(msg);\n break;\n case LogLevel.Warning:\n console.warn(msg);\n break;\n case LogLevel.Error:\n console.error(msg);\n break;\n }\n };\n ConsoleListener.prototype.format = function (entry) {\n return \"Message: \" + entry.message + \". Data: \" + JSON.stringify(entry.data);\n };\n return ConsoleListener;\n}());\nexports.ConsoleListener = ConsoleListener;\nvar AzureInsightsListener = (function () {\n function AzureInsightsListener(azureInsightsInstrumentationKey) {\n this.azureInsightsInstrumentationKey = azureInsightsInstrumentationKey;\n var appInsights = window[\"appInsights\"] || function (config) {\n function r(config) {\n t[config] = function () {\n var i = arguments;\n t.queue.push(function () { t[config].apply(t, i); });\n };\n }\n var t = { config: config }, u = document, e = window, o = \"script\", s = u.createElement(o), i, f;\n for (s.src = config.url || \"//az416426.vo.msecnd.net/scripts/a/ai.0.js\", u.getElementsByTagName(o)[0].parentNode.appendChild(s), t.cookie = u.cookie, t.queue = [], i = [\"Event\", \"Exception\", \"Metric\", \"PageView\", \"Trace\"]; i.length;) {\n r(\"track\" + i.pop());\n }\n return r(\"setAuthenticatedUserContext\"), r(\"clearAuthenticatedUserContext\"), config.disableExceptionTracking || (i = \"onerror\", r(\"_\" + i), f = e[i], e[i] = function (config, r, u, e, o) {\n var s = f && f(config, r, u, e, o);\n return s !== !0 && t[\"_\" + i](config, r, u, e, o), s;\n }), t;\n }({\n instrumentationKey: this.azureInsightsInstrumentationKey\n });\n window[\"appInsights\"] = appInsights;\n }\n AzureInsightsListener.prototype.log = function (entry) {\n var ai = window[\"appInsights\"];\n var msg = this.format(entry);\n if (entry.level === LogLevel.Error) {\n ai.trackException(msg);\n }\n else {\n ai.trackEvent(msg);\n }\n };\n AzureInsightsListener.prototype.format = function (entry) {\n return \"Message: \" + entry.message + \". Data: \" + JSON.stringify(entry.data);\n };\n return AzureInsightsListener;\n}());\nexports.AzureInsightsListener = AzureInsightsListener;\nvar FunctionListener = (function () {\n function FunctionListener(method) {\n this.method = method;\n }\n FunctionListener.prototype.log = function (entry) {\n this.method(entry);\n };\n return FunctionListener;\n}());\nexports.FunctionListener = FunctionListener;\n\n},{}],23:[function(require,module,exports){\n(function (global){\n\"use strict\";\nvar Util = (function () {\n function Util() {\n }\n Util.getCtxCallback = function (context, method) {\n var params = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n params[_i - 2] = arguments[_i];\n }\n return function () {\n method.apply(context, params);\n };\n };\n Util.urlParamExists = function (name) {\n name = name.replace(/[\\[]/, \"\\\\[\").replace(/[\\]]/, \"\\\\]\");\n var regex = new RegExp(\"[\\\\?&]\" + name + \"=([^&#]*)\");\n return regex.test(location.search);\n };\n Util.getUrlParamByName = function (name) {\n name = name.replace(/[\\[]/, \"\\\\[\").replace(/[\\]]/, \"\\\\]\");\n var regex = new RegExp(\"[\\\\?&]\" + name + \"=([^&#]*)\");\n var results = regex.exec(location.search);\n return results == null ? \"\" : decodeURIComponent(results[1].replace(/\\+/g, \" \"));\n };\n Util.getUrlParamBoolByName = function (name) {\n var p = this.getUrlParamByName(name);\n var isFalse = (p === \"\" || /false|0/i.test(p));\n return !isFalse;\n };\n Util.stringInsert = function (target, index, s) {\n if (index > 0) {\n return target.substring(0, index) + s + target.substring(index, target.length);\n }\n return s + target;\n };\n Util.dateAdd = function (date, interval, units) {\n var ret = new Date(date.toLocaleString());\n switch (interval.toLowerCase()) {\n case \"year\":\n ret.setFullYear(ret.getFullYear() + units);\n break;\n case \"quarter\":\n ret.setMonth(ret.getMonth() + 3 * units);\n break;\n case \"month\":\n ret.setMonth(ret.getMonth() + units);\n break;\n case \"week\":\n ret.setDate(ret.getDate() + 7 * units);\n break;\n case \"day\":\n ret.setDate(ret.getDate() + units);\n break;\n case \"hour\":\n ret.setTime(ret.getTime() + units * 3600000);\n break;\n case \"minute\":\n ret.setTime(ret.getTime() + units * 60000);\n break;\n case \"second\":\n ret.setTime(ret.getTime() + units * 1000);\n break;\n default:\n ret = undefined;\n break;\n }\n return ret;\n };\n Util.loadStylesheet = function (path, avoidCache) {\n if (avoidCache) {\n path += \"?\" + encodeURIComponent((new Date()).getTime().toString());\n }\n var head = document.getElementsByTagName(\"head\");\n if (head.length > 0) {\n var e = document.createElement(\"link\");\n head[0].appendChild(e);\n e.setAttribute(\"type\", \"text/css\");\n e.setAttribute(\"rel\", \"stylesheet\");\n e.setAttribute(\"href\", path);\n }\n };\n Util.combinePaths = function () {\n var paths = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n paths[_i - 0] = arguments[_i];\n }\n var parts = [];\n for (var i = 0; i < paths.length; i++) {\n if (typeof paths[i] !== \"undefined\" && paths[i] !== null) {\n parts.push(paths[i].replace(/^[\\\\|\\/]/, \"\").replace(/[\\\\|\\/]$/, \"\"));\n }\n }\n return parts.join(\"/\").replace(/\\\\/, \"/\");\n };\n Util.getRandomString = function (chars) {\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n for (var i = 0; i < chars; i++) {\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n }\n return text;\n };\n Util.getGUID = function () {\n var d = new Date().getTime();\n var guid = \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g, function (c) {\n var r = (d + Math.random() * 16) % 16 | 0;\n d = Math.floor(d / 16);\n return (c === \"x\" ? r : (r & 0x3 | 0x8)).toString(16);\n });\n return guid;\n };\n Util.isFunction = function (candidateFunction) {\n return typeof candidateFunction === \"function\";\n };\n Util.isArray = function (array) {\n if (Array.isArray) {\n return Array.isArray(array);\n }\n return array && typeof array.length === \"number\" && array.constructor === Array;\n };\n Util.stringIsNullOrEmpty = function (s) {\n return typeof s === \"undefined\" || s === null || s === \"\";\n };\n Util.extend = function (target, source, noOverwrite) {\n if (noOverwrite === void 0) { noOverwrite = false; }\n var result = {};\n for (var id in target) {\n result[id] = target[id];\n }\n var check = noOverwrite ? function (o, i) { return !o.hasOwnProperty(i); } : function (o, i) { return true; };\n for (var id in source) {\n if (check(result, id)) {\n result[id] = source[id];\n }\n }\n return result;\n };\n Util.applyMixins = function (derivedCtor) {\n var baseCtors = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n baseCtors[_i - 1] = arguments[_i];\n }\n baseCtors.forEach(function (baseCtor) {\n Object.getOwnPropertyNames(baseCtor.prototype).forEach(function (name) {\n derivedCtor.prototype[name] = baseCtor.prototype[name];\n });\n });\n };\n Util.isUrlAbsolute = function (url) {\n return /^https?:\\/\\/|^\\/\\//i.test(url);\n };\n Util.makeUrlAbsolute = function (url) {\n if (Util.isUrlAbsolute(url)) {\n return url;\n }\n if (typeof global._spPageContextInfo !== \"undefined\") {\n if (global._spPageContextInfo.hasOwnProperty(\"webAbsoluteUrl\")) {\n return Util.combinePaths(global._spPageContextInfo.webAbsoluteUrl, url);\n }\n else if (global._spPageContextInfo.hasOwnProperty(\"webServerRelativeUrl\")) {\n return Util.combinePaths(global._spPageContextInfo.webServerRelativeUrl, url);\n }\n }\n else {\n return url;\n }\n };\n return Util;\n}());\nexports.Util = Util;\n\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n},{}]},{},[17])(17)\n});"]} \ No newline at end of file +{"version":3,"sources":["pnp-provisioning.min.js"],"names":["f","exports","module","define","amd","g","window","global","self","this","$pnp","Provisioning","e","t","n","r","s","o","u","a","require","i","Error","code","l","call","length","1","util_1","Dictionary","keys","values","prototype","get","key","index","indexOf","add","push","merge","source","Util","isFunction","sourceAsDictionary","getKeys","sourceAsHash","hasOwnProperty","remove","val","splice","getValues","clear","count","../utils/util","2","setRuntimeConfig","config","_runtimeConfig","set","RuntimeConfigImpl","_headers","_defaultCachingStore","_defaultCachingTimeoutSeconds","_globalCacheDisable","_useSPRequestExecutor","headers","globalCacheDisable","defaultCachingStore","defaultCachingTimeoutSeconds","useSPRequestExecutor","_useNodeClient","_nodeClientData","nodeClientOptions","_spPageContextInfo","webAbsoluteUrl","siteUrl","Object","defineProperty","enumerable","configurable","RuntimeConfig","3","collections_1","odata_1","CachedDigest","DigestCache","_httpClient","_digests","getDigest","webUrl","cachedDigest","now","Date","expiration","Promise","resolve","value","url","combinePaths","fetchRaw","cache","credentials","Accept","Content-type","method","then","response","parser","ODataDefaultParser","parse","d","GetContextWebInformation","data","newCachedDigest","FormDigestValue","seconds","FormDigestTimeoutSeconds","setTime","getTime","../collections/collections","../sharepoint/rest/odata","4","FetchClient","fetch","options","5","fetchclient_1","digestcache_1","pnplibconfig_1","sprequestexecutorclient_1","nodefetchclient_1","HttpClient","_impl","getFetchImpl","_digestCache","opts","extend","Headers","mergeHeaders","has","append","toUpperCase","substr","digest","_this","rawHeaders","retry","ctx","catch","delay","status","reject","attempts","retryCount","setTimeout","getCtxCallback","retryContext","post","patch","delete","SPRequestExecutorClient","useNodeFetchClient","nodeRequestOptions","NodeFetchClient","clientId","clientSecret","target","temp","Request","forEach","name","../configuration/pnplibconfig","./digestcache","./fetchclient","./nodefetchclient","./sprequestexecutorclient","6","_clientId","_clientSecret","_realm","7","convertToResponse","spResponse","responseHeaders","h","Response","body","statusCode","statusText","SP","RequestExecutor","iterator","addinWebUrl","substring","executor","entries","next","done","requestOptions","error","success","binaryStringRequestBody","executeAsync","8","__extends","b","__","constructor","p","create","objecthandlerbase_1","ObjectComposedLook","_super","ProvisionObjects","object","scope_started","clientContext","ClientContext","get_current","web","get_web","colorPaletteUrl","ColorPaletteUrl","replaceUrlTokens","fontSchemeUrl","FontSchemeUrl","backgroundImageUrl","BackgroundImageUrl","applyTheme","getRelativeUrl","update","executeQueryAsync","scope_ended","ObjectHandlerBase","../util","./objecthandlerbase","9","ObjectCustomActions","customactions","userCustomActions","get_userCustomActions","load","obj","objExists","get_data","filter","userCustomAction","get_title","Title","objCreationInformation","Description","set_description","CommandUIExtension","set_commandUIExtension","Group","set_group","set_title","Url","set_url","ScriptBlock","set_scriptBlock","ScriptSrc","set_scriptSrc","Location","set_location","ImageUrl","set_imageUrl","Name","set_name","RegistrationId","set_registrationId","RegistrationType","set_registrationType","Rights","set_rights","Sequence","set_sequence","10","ObjectFeatures","features","webFeatures","get_features","Deactivate","Guid","ID","FeatureDefinitionScope","none","11","CoreUtil","ObjectFiles","objects","fileInfos","promises","httpClient","Src","text","all","responses","filename","GetFilenameFromFilePath","Dest","webServerRelativeUrl","folder","getFolderByServerRelativeUrl","GetFolderFromFilePath","fi","Contents","Filename","Folder","Instance","Overwrite","Properties","RemoveExistingWebParts","ServerRelativeUrl","Views","WebParts","FileCreationInformation","set_overwrite","set_content","Base64EncodedByteArray","get_content","charCodeAt","get_files","ApplyFileProperties","AddWebPartsToWebPartPage","ModifyHiddenViews","RemoveWebPartsFromFileIfSpecified","limitedWebPartManager","shouldRemoveExisting","existingWebParts","get_webParts","wp","deleteWebPart","GetWebPartXml","webParts","FileUrl","fileUrl","res","rej","Xml","dest","src","fileServerRelativeUrl","file","getFileByServerRelativeUrl","getLimitedWebPartManager","PersonalizationScope","shared","webPartsWithXml","oWebPartDefinition","importWebPart","oWebPart","get_webPart","addWebPart","Zone","Order","fileProperties","listItemAllFields","get_listItemAllFields","set_item","GetViewFromCollectionByUrl","viewCollection","serverRelativeUrl","viewCollectionEnumerator","getEnumerator","moveNext","view","get_serverRelativeUrl","toString","toLowerCase","mapping","lists","listViewCollections","v","List","get_lists","getByTitle","get_views","views","list","Paged","set_paged","Query","set_viewQuery","RowLimit","set_rowLimit","ViewFields","columns_1","get_viewFields","removeAll","vf","filePath","split","join","../../../utils/util","12","httpclient_1","logging_1","parameters","Logger","write","../../../net/httpclient","../../../utils/logging","13","sequencer_1","ObjectLists","listInstances","existingObj","undefined","EnableVersioning","set_enableVersioning","EnableMinorVersions","set_enableMinorVersions","EnableModeration","set_enableModeration","EnableFolderCreation","set_enableFolderCreation","EnableAttachments","set_enableAttachments","NoCrawl","set_noCrawl","DefaultDisplayFormUrl","set_defaultDisplayFormUrl","DefaultEditFormUrl","set_defaultEditFormUrl","DefaultNewFormUrl","set_defaultNewFormUrl","DraftVersionVisibility","set_draftVersionVisibility","DraftVisibilityType","Hidden","set_hidden","ForceCheckout","set_forceCheckout","ListCreationInformation","OnQuickLaunch","QuickLaunchOptions","on","off","set_quickLaunchOption","TemplateType","set_templateType","createdList","toLocaleLowerCase","sequencer","Sequencer","ApplyContentTypeBindings","ApplyListInstanceFieldRefs","ApplyFields","ApplyLookupFields","ApplyListSecurity","CreateViews","InsertDataRows","CreateFolders","ListInstances","Objects","execute","EnsureLocationBasedMetadataDefaultsReceiver","eventReceivers","get_eventReceivers","eventRecCreationInfo","EventReceiverDefinitionCreationInformation","set_receiverName","set_synchronization","set_sequenceNumber","set_receiverAssembly","set_receiverClass","set_eventType","EventReceiverType","itemAdded","params","Folders","folderServerRelativeUrl","rootFolder","get_rootFolder","metadataDefaults","setMetadataDefaults","folderUrl","get_folders","DefaultValues","metadataDefaultsFileCreateInfo","webCts","get_site","get_rootWeb","get_contentTypes","listCts","ContentTypeBindings","set_contentTypesEnabled","listContentTypes","existingContentTypes","Array","RemoveExistingContentTypes","ct","ctb","addExistingContentType","getById","ContentTypeId","j","ect","deleteObject","siteFields","get_fields","FieldRefs","fr","field","getByInternalNameOrTitle","Fields","fieldXml","GetFieldXml","fieldType","GetFieldXmlAttr","addFieldAsXml","AddFieldOptions","addToAllContentTypes","attr","regex","RegExp","match","exec","SchemaXml","properties_1","prop","targetList","get_id","Type","Formula","Security","BreakRoleInheritance","breakRoleInheritance","CopyRoleAssignments","ClearSubscopes","get_roleAssignments","allProperties","get_allProperties","siteGroups","get_siteGroups","roleDefinitions","get_roleDefinitions","RoleAssignments","ra","roleDef","RoleDefinition","getByName","roleBindings","RoleDefinitionBindingCollection","newObject","principal","Principal","token","groupId","get_fieldValues","viewExists","ev","RemoveExistingViews","Scope","set_scope","viewCreationInformation","ViewCreationInformation","PersonalView","set_personalView","set_query","SetAsDefaultView","set_setAsDefaultView","set_viewFields","ViewTypeKind","set_viewTypeKind","ViewType","html","DataRows","item","addItem","ListItemCreationInformation","../sequencer/sequencer","14","ObjectNavigation","navigation","get_navigation","ConfigureQuickLaunch","QuickLaunch","getNodeFromCollectionByTitle","nodeCollection","title","nodes","quickLaunchNodeCollection_1","get_quickLaunch","temporaryQuickLaunch","get_count","oldNode","itemAt","existingNode","newNode","NavigationNodeCreationInformation","get_url","set_asLastNode","json","node","getNodeById","Id","childrenNodeCollection","get_children","parentNode","Children","15","ObjectPropertyBagEntries","clientContext_1","web_1","propBag_1","indexedProperties_1","entry","Key","Value","Indexed","encodePropertyKey","16","ObjectWebSettings","WelcomePage","set_welcomePage","MasterUrl","set_masterUrl","CustomMasterUrl","set_customMasterUrl","SaveSiteAsTemplateEnabled","set_saveSiteAsTemplateEnabled","QuickLaunchEnabled","TreeViewEnabled","set_treeViewEnabled","17","provisioningstep_1","objectnavigation_1","objectpropertybagentries_1","objectfeatures_1","objectwebsettings_1","objectcomposedlook_1","objectcustomactions_1","objectfiles_1","objectlists_1","handlers","Navigation","PropertyBagEntries","Features","WebSettings","ComposedLook","CustomActions","Files","Lists","applyTemplate","path","ok","template","start","LogLevel","queue","startTime","queueItems","q","ProvisioningStep","Parameters","Info","JSON","stringify","../../net/httpclient","../../utils/logging","./objecthandlers/objectcomposedlook","./objecthandlers/objectcustomactions","./objecthandlers/objectfeatures","./objecthandlers/objectfiles","./objecthandlers/objectlists","./objecthandlers/objectnavigation","./objecthandlers/objectpropertybagentries","./objecthandlers/objectwebsettings","./provisioningstep","./util","18","handler","dependentPromise","_handler","19","functions","parameter","scope","progressFunction","promiseSequence","sequenceFunction","functionNr","result","20","replace","document","location","protocol","hostname","siteAbsoluteUrl","propKey","bytes","b64encoded","btoa","String","fromCharCode","apply","21","extractOdataId","candidate","__metadata","id","log","level","message","getEntityUrl","entity","uri","Warning","ODataValue","ODataValueParserImpl","ODataEntity","factory","ODataEntityParserImpl","ODataEntityArray","ODataEntityArrayParserImpl","ODataParserBase","parseODataJSON","results","arguments","ODataRawParserImpl","map","ODataRaw","ODataBatch","baseUrl","_batchId","getGUID","_requests","_batchDependencies","info","addBatchDependency","resolver","promise","executeImpl","batchBody","currentChangeSetId","reqInfo","Content-Type","name_1","batchHeaders","batchOptions","client","requestUrl","makeUrlAbsolute","_parseResponse","chain","_loop_1","request","_","header","statusRegExp","lines","state","line","trim","parts","parseInt","../../configuration/pnplibconfig","../../utils/util","22","instance","activeLogLevel","_instance","LoggerImpl","subscribe","listeners","_i","clearSubscribers","Verbose","measure","subscribers","listener","slice","console","profile","profileEnd","ConsoleListener","msg","format","warn","AzureInsightsListener","azureInsightsInstrumentationKey","appInsights","createElement","getElementsByTagName","appendChild","cookie","pop","disableExceptionTracking","instrumentationKey","ai","trackException","trackEvent","FunctionListener","23","context","urlParamExists","test","search","getUrlParamByName","decodeURIComponent","getUrlParamBoolByName","isFalse","stringInsert","dateAdd","date","interval","units","ret","toLocaleString","setFullYear","getFullYear","setMonth","getMonth","setDate","getDate","loadStylesheet","avoidCache","encodeURIComponent","head","setAttribute","paths","getRandomString","chars","possible","charAt","Math","floor","random","guid","c","candidateFunction","isArray","array","stringIsNullOrEmpty","noOverwrite","check","applyMixins","derivedCtor","baseCtors","baseCtor","getOwnPropertyNames","isUrlAbsolute"],"mappings":";;;;;;;;CAAA,SAAUA,GAAG,GAAoB,gBAAVC,UAAoC,mBAATC,QAAsBA,OAAOD,QAAQD,QAAS,IAAmB,kBAATG,SAAqBA,OAAOC,IAAKD,UAAUH,OAAO,CAAC,GAAIK,EAAkCA,GAAb,mBAATC,QAAwBA,OAA+B,mBAATC,QAAwBA,OAA6B,mBAAPC,MAAsBA,KAAYC,MAAMJ,EAAEK,OAASL,EAAEK,UAAYC,aAAeX,MAAO,WAAqC,MAAO,SAAUY,GAAEC,EAAEC,EAAEC,GAAG,QAASC,GAAEC,EAAEC,GAAG,IAAIJ,EAAEG,GAAG,CAAC,IAAIJ,EAAEI,GAAG,CAAC,GAAIE,GAAkB,kBAATC,UAAqBA,OAAQ,KAAIF,GAAGC,EAAE,MAAOA,GAAEF,GAAE,EAAI,IAAGI,EAAE,MAAOA,GAAEJ,G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AAQ6xB,GAChB,SAAhBA,IAA0BA,GAAc,EAC5C,IAAIzJ,KACJ,KAAK,GAAImB,KAAMzhB,GACXsgB,EAAOmB,GAAMzhB,EAAOyhB,EAExB,IAAIuI,GAAQD,EAAc,SAAUpzB,EAAGI,GAAK,OAAQJ,EAAE6B,eAAezB,IAAQ,SAAUJ,EAAGI,GAAK,OAAO,EACtG,KAAK,GAAI0qB,KAAMvpB,GACP8xB,EAAM1J,EAAQmB,KACdnB,EAAOmB,GAAMvpB,EAAOupB,GAG5B,OAAOnB,IAEXnoB,EAAK8xB,YAAc,SAAUC,GAEzB,IAAK,GADDC,MACKzE,EAAK,EAAGA,EAAK/C,UAAUvrB,OAAQsuB,IACpCyE,EAAUzE,EAAK,GAAK/C,UAAU+C,EAElCyE,GAAUhqB,QAAQ,SAAUiqB,GACxB9vB,OAAO+vB,oBAAoBD,EAAS1yB,WAAWyI,QAAQ,SAAUC,GAC7D8pB,EAAYxyB,UAAU0I,GAAQgqB,EAAS1yB,UAAU0I,QAI7DjI,EAAKmyB,cAAgB,SAAU3uB,GAC3B,MAAO,sBAAsB8rB,KAAK9rB,IAEtCxD,EAAKgsB,gBAAkB,SAAUxoB,GAC7B,MAAIxD,GAAKmyB,cAAc3uB,GACZA,EAE8B,mBAA9B1F,GAAOkE,mBASPwB,EARH1F,EAAOkE,mBAAmB3B,eAAe,kBAClCL,EAAKyD,aAAa3F,EAAOkE,mBAAmBC,eAAgBuB,GAE9D1F,EAAOkE,mBAAmB3B,eAAe,wBACvCL,EAAKyD,aAAa3F,EAAOkE,mBAAmBoO,qBAAsB5M,GADxE,QAQNxD,IAEXxC,GAAQwC,KAAOA,IAEZhB,KAAKhB,KAAuB,mBAAXF,QAAyBA,OAAyB,mBAATC,MAAuBA,KAAyB,mBAAXF,QAAyBA,qBAChH,KAAK","file":"pnp-provisioning.min.js","sourcesContent":["(function(f){if(typeof exports===\"object\"&&typeof module!==\"undefined\"){module.exports=f()}else if(typeof define===\"function\"&&define.amd){define([],f)}else{var g;if(typeof window!==\"undefined\"){g=window}else if(typeof global!==\"undefined\"){g=global}else if(typeof self!==\"undefined\"){g=self}else{g=this}(g.$pnp || (g.$pnp = {})).Provisioning = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o -1) {\n this.values[index] = o;\n }\n else {\n this.keys.push(key);\n this.values.push(o);\n }\n };\n Dictionary.prototype.merge = function (source) {\n if (util_1.Util.isFunction(source[\"getKeys\"])) {\n var sourceAsDictionary = source;\n var keys = sourceAsDictionary.getKeys();\n var l = keys.length;\n for (var i = 0; i < l; i++) {\n this.add(keys[i], sourceAsDictionary.get(keys[i]));\n }\n }\n else {\n var sourceAsHash = source;\n for (var key in sourceAsHash) {\n if (sourceAsHash.hasOwnProperty(key)) {\n this.add(key, source[key]);\n }\n }\n }\n };\n Dictionary.prototype.remove = function (key) {\n var index = this.keys.indexOf(key);\n if (index < 0) {\n return null;\n }\n var val = this.values[index];\n this.keys.splice(index, 1);\n this.values.splice(index, 1);\n return val;\n };\n Dictionary.prototype.getKeys = function () {\n return this.keys;\n };\n Dictionary.prototype.getValues = function () {\n return this.values;\n };\n Dictionary.prototype.clear = function () {\n this.keys = [];\n this.values = [];\n };\n Dictionary.prototype.count = function () {\n return this.keys.length;\n };\n return Dictionary;\n}());\nexports.Dictionary = Dictionary;\n\n},{\"../utils/util\":23}],2:[function(require,module,exports){\n(function (global){\n\"use strict\";\nvar RuntimeConfigImpl = (function () {\n function RuntimeConfigImpl() {\n this._headers = null;\n this._defaultCachingStore = \"session\";\n this._defaultCachingTimeoutSeconds = 30;\n this._globalCacheDisable = false;\n this._useSPRequestExecutor = false;\n }\n RuntimeConfigImpl.prototype.set = function (config) {\n if (config.hasOwnProperty(\"headers\")) {\n this._headers = config.headers;\n }\n if (config.hasOwnProperty(\"globalCacheDisable\")) {\n this._globalCacheDisable = config.globalCacheDisable;\n }\n if (config.hasOwnProperty(\"defaultCachingStore\")) {\n this._defaultCachingStore = config.defaultCachingStore;\n }\n if (config.hasOwnProperty(\"defaultCachingTimeoutSeconds\")) {\n this._defaultCachingTimeoutSeconds = config.defaultCachingTimeoutSeconds;\n }\n if (config.hasOwnProperty(\"useSPRequestExecutor\")) {\n this._useSPRequestExecutor = config.useSPRequestExecutor;\n }\n if (config.hasOwnProperty(\"nodeClientOptions\")) {\n this._useNodeClient = true;\n this._useSPRequestExecutor = false;\n this._nodeClientData = config.nodeClientOptions;\n global._spPageContextInfo = {\n webAbsoluteUrl: config.nodeClientOptions.siteUrl,\n };\n }\n };\n Object.defineProperty(RuntimeConfigImpl.prototype, \"headers\", {\n get: function () {\n return this._headers;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RuntimeConfigImpl.prototype, \"defaultCachingStore\", {\n get: function () {\n return this._defaultCachingStore;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RuntimeConfigImpl.prototype, \"defaultCachingTimeoutSeconds\", {\n get: function () {\n return this._defaultCachingTimeoutSeconds;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RuntimeConfigImpl.prototype, \"globalCacheDisable\", {\n get: function () {\n return this._globalCacheDisable;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RuntimeConfigImpl.prototype, \"useSPRequestExecutor\", {\n get: function () {\n return this._useSPRequestExecutor;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RuntimeConfigImpl.prototype, \"useNodeFetchClient\", {\n get: function () {\n return this._useNodeClient;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RuntimeConfigImpl.prototype, \"nodeRequestOptions\", {\n get: function () {\n return this._nodeClientData;\n },\n enumerable: true,\n configurable: true\n });\n return RuntimeConfigImpl;\n}());\nexports.RuntimeConfigImpl = RuntimeConfigImpl;\nvar _runtimeConfig = new RuntimeConfigImpl();\nexports.RuntimeConfig = _runtimeConfig;\nfunction setRuntimeConfig(config) {\n _runtimeConfig.set(config);\n}\nexports.setRuntimeConfig = setRuntimeConfig;\n\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n},{}],3:[function(require,module,exports){\n\"use strict\";\nvar collections_1 = require(\"../collections/collections\");\nvar util_1 = require(\"../utils/util\");\nvar odata_1 = require(\"../sharepoint/rest/odata\");\nvar CachedDigest = (function () {\n function CachedDigest() {\n }\n return CachedDigest;\n}());\nexports.CachedDigest = CachedDigest;\nvar DigestCache = (function () {\n function DigestCache(_httpClient, _digests) {\n if (_digests === void 0) { _digests = new collections_1.Dictionary(); }\n this._httpClient = _httpClient;\n this._digests = _digests;\n }\n DigestCache.prototype.getDigest = function (webUrl) {\n var self = this;\n var cachedDigest = this._digests.get(webUrl);\n if (cachedDigest !== null) {\n var now = new Date();\n if (now < cachedDigest.expiration) {\n return Promise.resolve(cachedDigest.value);\n }\n }\n var url = util_1.Util.combinePaths(webUrl, \"/_api/contextinfo\");\n return self._httpClient.fetchRaw(url, {\n cache: \"no-cache\",\n credentials: \"same-origin\",\n headers: {\n \"Accept\": \"application/json;odata=verbose\",\n \"Content-type\": \"application/json;odata=verbose;charset=utf-8\",\n },\n method: \"POST\",\n }).then(function (response) {\n var parser = new odata_1.ODataDefaultParser();\n return parser.parse(response).then(function (d) { return d.GetContextWebInformation; });\n }).then(function (data) {\n var newCachedDigest = new CachedDigest();\n newCachedDigest.value = data.FormDigestValue;\n var seconds = data.FormDigestTimeoutSeconds;\n var expiration = new Date();\n expiration.setTime(expiration.getTime() + 1000 * seconds);\n newCachedDigest.expiration = expiration;\n self._digests.add(webUrl, newCachedDigest);\n return newCachedDigest.value;\n });\n };\n DigestCache.prototype.clear = function () {\n this._digests.clear();\n };\n return DigestCache;\n}());\nexports.DigestCache = DigestCache;\n\n},{\"../collections/collections\":1,\"../sharepoint/rest/odata\":21,\"../utils/util\":23}],4:[function(require,module,exports){\n(function (global){\n\"use strict\";\nvar FetchClient = (function () {\n function FetchClient() {\n }\n FetchClient.prototype.fetch = function (url, options) {\n return global.fetch(url, options);\n };\n return FetchClient;\n}());\nexports.FetchClient = FetchClient;\n\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n},{}],5:[function(require,module,exports){\n\"use strict\";\nvar fetchclient_1 = require(\"./fetchclient\");\nvar digestcache_1 = require(\"./digestcache\");\nvar util_1 = require(\"../utils/util\");\nvar pnplibconfig_1 = require(\"../configuration/pnplibconfig\");\nvar sprequestexecutorclient_1 = require(\"./sprequestexecutorclient\");\nvar nodefetchclient_1 = require(\"./nodefetchclient\");\nvar HttpClient = (function () {\n function HttpClient() {\n this._impl = this.getFetchImpl();\n this._digestCache = new digestcache_1.DigestCache(this);\n }\n HttpClient.prototype.fetch = function (url, options) {\n if (options === void 0) { options = {}; }\n var self = this;\n var opts = util_1.Util.extend(options, { cache: \"no-cache\", credentials: \"same-origin\" }, true);\n var headers = new Headers();\n this.mergeHeaders(headers, pnplibconfig_1.RuntimeConfig.headers);\n this.mergeHeaders(headers, options.headers);\n if (!headers.has(\"Accept\")) {\n headers.append(\"Accept\", \"application/json\");\n }\n if (!headers.has(\"Content-Type\")) {\n headers.append(\"Content-Type\", \"application/json;odata=verbose;charset=utf-8\");\n }\n if (!headers.has(\"X-ClientService-ClientTag\")) {\n headers.append(\"X-ClientService-ClientTag\", \"PnPCoreJS:1.0.6\");\n }\n opts = util_1.Util.extend(opts, { headers: headers });\n if (opts.method && opts.method.toUpperCase() !== \"GET\") {\n if (!headers.has(\"X-RequestDigest\")) {\n var index = url.indexOf(\"_api/\");\n if (index < 0) {\n throw new Error(\"Unable to determine API url\");\n }\n var webUrl = url.substr(0, index);\n return this._digestCache.getDigest(webUrl)\n .then(function (digest) {\n headers.append(\"X-RequestDigest\", digest);\n return self.fetchRaw(url, opts);\n });\n }\n }\n return self.fetchRaw(url, opts);\n };\n HttpClient.prototype.fetchRaw = function (url, options) {\n var _this = this;\n if (options === void 0) { options = {}; }\n var rawHeaders = new Headers();\n this.mergeHeaders(rawHeaders, options.headers);\n options = util_1.Util.extend(options, { headers: rawHeaders });\n var retry = function (ctx) {\n _this._impl.fetch(url, options).then(function (response) { return ctx.resolve(response); }).catch(function (response) {\n var delay = ctx.delay;\n if (response.status !== 429 && response.status !== 503) {\n ctx.reject(response);\n }\n ctx.delay *= 2;\n ctx.attempts++;\n if (ctx.retryCount <= ctx.attempts) {\n ctx.reject(response);\n }\n setTimeout(util_1.Util.getCtxCallback(_this, retry, ctx), delay);\n });\n };\n return new Promise(function (resolve, reject) {\n var retryContext = {\n attempts: 0,\n delay: 100,\n reject: reject,\n resolve: resolve,\n retryCount: 7,\n };\n retry.call(_this, retryContext);\n });\n };\n HttpClient.prototype.get = function (url, options) {\n if (options === void 0) { options = {}; }\n var opts = util_1.Util.extend(options, { method: \"GET\" });\n return this.fetch(url, opts);\n };\n HttpClient.prototype.post = function (url, options) {\n if (options === void 0) { options = {}; }\n var opts = util_1.Util.extend(options, { method: \"POST\" });\n return this.fetch(url, opts);\n };\n HttpClient.prototype.patch = function (url, options) {\n if (options === void 0) { options = {}; }\n var opts = util_1.Util.extend(options, { method: \"PATCH\" });\n return this.fetch(url, opts);\n };\n HttpClient.prototype.delete = function (url, options) {\n if (options === void 0) { options = {}; }\n var opts = util_1.Util.extend(options, { method: \"DELETE\" });\n return this.fetch(url, opts);\n };\n HttpClient.prototype.getFetchImpl = function () {\n if (pnplibconfig_1.RuntimeConfig.useSPRequestExecutor) {\n return new sprequestexecutorclient_1.SPRequestExecutorClient();\n }\n else if (pnplibconfig_1.RuntimeConfig.useNodeFetchClient) {\n var opts = pnplibconfig_1.RuntimeConfig.nodeRequestOptions;\n return new nodefetchclient_1.NodeFetchClient(opts.siteUrl, opts.clientId, opts.clientSecret);\n }\n else {\n return new fetchclient_1.FetchClient();\n }\n };\n HttpClient.prototype.mergeHeaders = function (target, source) {\n if (typeof source !== \"undefined\" && source !== null) {\n var temp = new Request(\"\", { headers: source });\n temp.headers.forEach(function (value, name) {\n target.append(name, value);\n });\n }\n };\n return HttpClient;\n}());\nexports.HttpClient = HttpClient;\n\n},{\"../configuration/pnplibconfig\":2,\"../utils/util\":23,\"./digestcache\":3,\"./fetchclient\":4,\"./nodefetchclient\":6,\"./sprequestexecutorclient\":7}],6:[function(require,module,exports){\n\"use strict\";\nvar NodeFetchClient = (function () {\n function NodeFetchClient(siteUrl, _clientId, _clientSecret, _realm) {\n if (_realm === void 0) { _realm = \"\"; }\n this.siteUrl = siteUrl;\n this._clientId = _clientId;\n this._clientSecret = _clientSecret;\n this._realm = _realm;\n }\n NodeFetchClient.prototype.fetch = function (url, options) {\n throw new Error(\"Using NodeFetchClient in the browser is not supported.\");\n };\n return NodeFetchClient;\n}());\nexports.NodeFetchClient = NodeFetchClient;\n\n},{}],7:[function(require,module,exports){\n\"use strict\";\nvar util_1 = require(\"../utils/util\");\nvar SPRequestExecutorClient = (function () {\n function SPRequestExecutorClient() {\n this.convertToResponse = function (spResponse) {\n var responseHeaders = new Headers();\n for (var h in spResponse.headers) {\n if (spResponse.headers[h]) {\n responseHeaders.append(h, spResponse.headers[h]);\n }\n }\n return new Response(spResponse.body, {\n headers: responseHeaders,\n status: spResponse.statusCode,\n statusText: spResponse.statusText,\n });\n };\n }\n SPRequestExecutorClient.prototype.fetch = function (url, options) {\n var _this = this;\n if (typeof SP === \"undefined\" || typeof SP.RequestExecutor === \"undefined\") {\n throw new Error(\"SP.RequestExecutor is undefined. \" +\n \"Load the SP.RequestExecutor.js library (/_layouts/15/SP.RequestExecutor.js) before loading the PnP JS Core library.\");\n }\n var addinWebUrl = url.substring(0, url.indexOf(\"/_api\")), executor = new SP.RequestExecutor(addinWebUrl), headers = {}, iterator, temp;\n if (options.headers && options.headers instanceof Headers) {\n iterator = options.headers.entries();\n temp = iterator.next();\n while (!temp.done) {\n headers[temp.value[0]] = temp.value[1];\n temp = iterator.next();\n }\n }\n else {\n headers = options.headers;\n }\n return new Promise(function (resolve, reject) {\n var requestOptions = {\n error: function (error) {\n reject(_this.convertToResponse(error));\n },\n headers: headers,\n method: options.method,\n success: function (response) {\n resolve(_this.convertToResponse(response));\n },\n url: url,\n };\n if (options.body) {\n util_1.Util.extend(requestOptions, { body: options.body });\n }\n else {\n util_1.Util.extend(requestOptions, { binaryStringRequestBody: true });\n }\n executor.executeAsync(requestOptions);\n });\n };\n return SPRequestExecutorClient;\n}());\nexports.SPRequestExecutorClient = SPRequestExecutorClient;\n\n},{\"../utils/util\":23}],8:[function(require,module,exports){\n\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar util_1 = require(\"../util\");\nvar objecthandlerbase_1 = require(\"./objecthandlerbase\");\nvar ObjectComposedLook = (function (_super) {\n __extends(ObjectComposedLook, _super);\n function ObjectComposedLook() {\n _super.call(this, \"ComposedLook\");\n }\n ObjectComposedLook.prototype.ProvisionObjects = function (object) {\n var _this = this;\n _super.prototype.scope_started.call(this);\n return new Promise(function (resolve, reject) {\n var clientContext = SP.ClientContext.get_current();\n var web = clientContext.get_web();\n var colorPaletteUrl = object.ColorPaletteUrl ? util_1.Util.replaceUrlTokens(object.ColorPaletteUrl) : \"\";\n var fontSchemeUrl = object.FontSchemeUrl ? util_1.Util.replaceUrlTokens(object.FontSchemeUrl) : \"\";\n var backgroundImageUrl = object.BackgroundImageUrl ? util_1.Util.replaceUrlTokens(object.BackgroundImageUrl) : null;\n web.applyTheme(util_1.Util.getRelativeUrl(colorPaletteUrl), util_1.Util.getRelativeUrl(fontSchemeUrl), backgroundImageUrl, true);\n web.update();\n clientContext.executeQueryAsync(function () {\n _super.prototype.scope_ended.call(_this);\n resolve();\n }, function () {\n _super.prototype.scope_ended.call(_this);\n resolve();\n });\n });\n };\n return ObjectComposedLook;\n}(objecthandlerbase_1.ObjectHandlerBase));\nexports.ObjectComposedLook = ObjectComposedLook;\n\n},{\"../util\":20,\"./objecthandlerbase\":12}],9:[function(require,module,exports){\n\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar objecthandlerbase_1 = require(\"./objecthandlerbase\");\nvar ObjectCustomActions = (function (_super) {\n __extends(ObjectCustomActions, _super);\n function ObjectCustomActions() {\n _super.call(this, \"CustomActions\");\n }\n ObjectCustomActions.prototype.ProvisionObjects = function (customactions) {\n var _this = this;\n _super.prototype.scope_started.call(this);\n return new Promise(function (resolve, reject) {\n var clientContext = SP.ClientContext.get_current();\n var userCustomActions = clientContext.get_web().get_userCustomActions();\n clientContext.load(userCustomActions);\n clientContext.executeQueryAsync(function () {\n customactions.forEach(function (obj) {\n var objExists = userCustomActions.get_data().filter(function (userCustomAction) {\n return userCustomAction.get_title() === obj.Title;\n }).length > 0;\n if (!objExists) {\n var objCreationInformation = userCustomActions.add();\n if (obj.Description) {\n objCreationInformation.set_description(obj.Description);\n }\n if (obj.CommandUIExtension) {\n objCreationInformation.set_commandUIExtension(obj.CommandUIExtension);\n }\n if (obj.Group) {\n objCreationInformation.set_group(obj.Group);\n }\n if (obj.Title) {\n objCreationInformation.set_title(obj.Title);\n }\n if (obj.Url) {\n objCreationInformation.set_url(obj.Url);\n }\n if (obj.ScriptBlock) {\n objCreationInformation.set_scriptBlock(obj.ScriptBlock);\n }\n if (obj.ScriptSrc) {\n objCreationInformation.set_scriptSrc(obj.ScriptSrc);\n }\n if (obj.Location) {\n objCreationInformation.set_location(obj.Location);\n }\n if (obj.ImageUrl) {\n objCreationInformation.set_imageUrl(obj.ImageUrl);\n }\n if (obj.Name) {\n objCreationInformation.set_name(obj.Name);\n }\n if (obj.RegistrationId) {\n objCreationInformation.set_registrationId(obj.RegistrationId);\n }\n if (obj.RegistrationType) {\n objCreationInformation.set_registrationType(obj.RegistrationType);\n }\n if (obj.Rights) {\n objCreationInformation.set_rights(obj.Rights);\n }\n if (obj.Sequence) {\n objCreationInformation.set_sequence(obj.Sequence);\n }\n objCreationInformation.update();\n }\n });\n clientContext.executeQueryAsync(function () {\n _super.prototype.scope_ended.call(_this);\n resolve();\n }, function () {\n _super.prototype.scope_ended.call(_this);\n resolve();\n });\n }, function () {\n _super.prototype.scope_ended.call(_this);\n resolve();\n });\n });\n };\n return ObjectCustomActions;\n}(objecthandlerbase_1.ObjectHandlerBase));\nexports.ObjectCustomActions = ObjectCustomActions;\n\n},{\"./objecthandlerbase\":12}],10:[function(require,module,exports){\n\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar objecthandlerbase_1 = require(\"./objecthandlerbase\");\nvar ObjectFeatures = (function (_super) {\n __extends(ObjectFeatures, _super);\n function ObjectFeatures() {\n _super.call(this, \"Features\");\n }\n ObjectFeatures.prototype.ProvisionObjects = function (features) {\n var _this = this;\n _super.prototype.scope_started.call(this);\n return new Promise(function (resolve, reject) {\n var clientContext = SP.ClientContext.get_current();\n var web = clientContext.get_web();\n var webFeatures = web.get_features();\n features.forEach(function (f) {\n if (f.Deactivate === true) {\n webFeatures.remove(new SP.Guid(f.ID), true);\n }\n else {\n webFeatures.add(new SP.Guid(f.ID), true, SP.FeatureDefinitionScope.none);\n }\n });\n web.update();\n clientContext.load(webFeatures);\n clientContext.executeQueryAsync(function () {\n _super.prototype.scope_ended.call(_this);\n resolve();\n }, function () {\n _super.prototype.scope_ended.call(_this);\n resolve();\n });\n });\n };\n return ObjectFeatures;\n}(objecthandlerbase_1.ObjectHandlerBase));\nexports.ObjectFeatures = ObjectFeatures;\n\n},{\"./objecthandlerbase\":12}],11:[function(require,module,exports){\n\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar CoreUtil = require(\"../../../utils/util\");\nvar util_1 = require(\"../util\");\nvar objecthandlerbase_1 = require(\"./objecthandlerbase\");\nvar ObjectFiles = (function (_super) {\n __extends(ObjectFiles, _super);\n function ObjectFiles() {\n _super.call(this, \"Files\");\n }\n ObjectFiles.prototype.ProvisionObjects = function (objects) {\n var _this = this;\n _super.prototype.scope_started.call(this);\n return new Promise(function (resolve, reject) {\n var clientContext = SP.ClientContext.get_current();\n var web = clientContext.get_web();\n var fileInfos = [];\n var promises = [];\n objects.forEach(function (obj, index) {\n promises.push(_this.httpClient.fetchRaw(util_1.Util.replaceUrlTokens(obj.Src)).then(function (response) {\n return response.text();\n }));\n });\n Promise.all(promises).then(function (responses) {\n responses.forEach(function (response, index) {\n var obj = objects[index];\n var filename = _this.GetFilenameFromFilePath(obj.Dest);\n var webServerRelativeUrl = _spPageContextInfo.webServerRelativeUrl;\n var folder = web.getFolderByServerRelativeUrl(webServerRelativeUrl + \"/\" + _this.GetFolderFromFilePath(obj.Dest));\n var fi = {\n Contents: response,\n Dest: obj.Dest,\n Filename: filename,\n Folder: folder,\n Instance: null,\n Overwrite: false,\n Properties: [],\n RemoveExistingWebParts: true,\n ServerRelativeUrl: obj.Dest,\n Src: obj.Src,\n Views: [],\n WebParts: [],\n };\n CoreUtil.Util.extend(fi, obj);\n if (fi.Filename.indexOf(\"Form.aspx\") !== -1) {\n return;\n }\n var objCreationInformation = new SP.FileCreationInformation();\n objCreationInformation.set_overwrite(fi.Overwrite);\n objCreationInformation.set_url(fi.Filename);\n objCreationInformation.set_content(new SP.Base64EncodedByteArray());\n for (var i = 0; i < fi.Contents.length; i++) {\n objCreationInformation.get_content().append(fi.Contents.charCodeAt(i));\n }\n clientContext.load(fi.Folder.get_files().add(objCreationInformation));\n fileInfos.push(fi);\n });\n });\n clientContext.executeQueryAsync(function () {\n promises = [];\n fileInfos.forEach(function (fi) {\n if (fi.Properties && Object.keys(fi.Properties).length > 0) {\n promises.push(_this.ApplyFileProperties(fi.Dest, fi.Properties));\n }\n if (fi.WebParts && fi.WebParts.length > 0) {\n promises.push(_this.AddWebPartsToWebPartPage(fi.Dest, fi.Src, fi.WebParts, fi.RemoveExistingWebParts));\n }\n });\n Promise.all(promises).then(function () {\n _this.ModifyHiddenViews(objects).then(function (value) {\n _super.prototype.scope_ended.call(_this);\n resolve(value);\n }, function (error) {\n _super.prototype.scope_ended.call(_this);\n reject(error);\n });\n });\n }, function (error) {\n _super.prototype.scope_ended.call(_this);\n reject(error);\n });\n });\n };\n ObjectFiles.prototype.RemoveWebPartsFromFileIfSpecified = function (clientContext, limitedWebPartManager, shouldRemoveExisting) {\n return new Promise(function (resolve, reject) {\n if (!shouldRemoveExisting) {\n resolve();\n }\n var existingWebParts = limitedWebPartManager.get_webParts();\n clientContext.load(existingWebParts);\n clientContext.executeQueryAsync(function () {\n existingWebParts.get_data().forEach(function (wp) {\n wp.deleteWebPart();\n });\n clientContext.load(existingWebParts);\n clientContext.executeQueryAsync(resolve, reject);\n }, reject);\n });\n };\n ObjectFiles.prototype.GetWebPartXml = function (webParts) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n var promises = [];\n webParts.forEach(function (wp, index) {\n if (wp.Contents.FileUrl) {\n var fileUrl = util_1.Util.replaceUrlTokens(wp.Contents.FileUrl);\n promises.push(_this.httpClient.fetchRaw(fileUrl).then(function (response) {\n return response.text();\n }));\n }\n else {\n promises.push((function () {\n return new Promise(function (res, rej) {\n res();\n });\n })());\n }\n });\n Promise.all(promises).then(function (responses) {\n responses.forEach(function (response, index) {\n var wp = webParts[index];\n if (wp !== null && response && response.length > 0) {\n wp.Contents.Xml = response;\n }\n });\n resolve(webParts);\n });\n });\n };\n ObjectFiles.prototype.AddWebPartsToWebPartPage = function (dest, src, webParts, shouldRemoveExisting) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n var clientContext = SP.ClientContext.get_current();\n var web = clientContext.get_web();\n var fileServerRelativeUrl = _spPageContextInfo.webServerRelativeUrl + \"/\" + dest;\n var file = web.getFileByServerRelativeUrl(fileServerRelativeUrl);\n clientContext.load(file);\n clientContext.executeQueryAsync(function () {\n var limitedWebPartManager = file.getLimitedWebPartManager(SP.WebParts.PersonalizationScope.shared);\n _this.RemoveWebPartsFromFileIfSpecified(clientContext, limitedWebPartManager, shouldRemoveExisting).then(function () {\n _this.GetWebPartXml(webParts).then(function (webPartsWithXml) {\n webPartsWithXml.forEach(function (wp) {\n if (!wp.Contents.Xml) {\n return;\n }\n var oWebPartDefinition = limitedWebPartManager.importWebPart(util_1.Util.replaceUrlTokens(wp.Contents.Xml));\n var oWebPart = oWebPartDefinition.get_webPart();\n limitedWebPartManager.addWebPart(oWebPart, wp.Zone, wp.Order);\n });\n clientContext.executeQueryAsync(resolve, resolve);\n });\n });\n }, resolve);\n });\n };\n ObjectFiles.prototype.ApplyFileProperties = function (dest, fileProperties) {\n return new Promise(function (resolve, reject) {\n var clientContext = SP.ClientContext.get_current();\n var web = clientContext.get_web();\n var fileServerRelativeUrl = _spPageContextInfo.webServerRelativeUrl + \"/\" + dest;\n var file = web.getFileByServerRelativeUrl(fileServerRelativeUrl);\n var listItemAllFields = file.get_listItemAllFields();\n Object.keys(fileProperties).forEach(function (key) {\n listItemAllFields.set_item(key, fileProperties[key]);\n });\n listItemAllFields.update();\n clientContext.executeQueryAsync(resolve, resolve);\n });\n };\n ObjectFiles.prototype.GetViewFromCollectionByUrl = function (viewCollection, url) {\n var serverRelativeUrl = _spPageContextInfo.webServerRelativeUrl + \"/\" + url;\n var viewCollectionEnumerator = viewCollection.getEnumerator();\n while (viewCollectionEnumerator.moveNext()) {\n var view = viewCollectionEnumerator.get_current();\n if (view.get_serverRelativeUrl().toString().toLowerCase() === serverRelativeUrl.toLowerCase()) {\n return view;\n }\n }\n return null;\n };\n ObjectFiles.prototype.ModifyHiddenViews = function (objects) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n var clientContext = SP.ClientContext.get_current();\n var web = clientContext.get_web();\n var mapping = {};\n var lists = [];\n var listViewCollections = [];\n objects.forEach(function (obj) {\n if (!obj.Views) {\n return;\n }\n obj.Views.forEach(function (v) {\n mapping[v.List] = mapping[v.List] || [];\n mapping[v.List].push(CoreUtil.Util.extend(v, { \"Url\": obj.Dest }));\n });\n });\n Object.keys(mapping).forEach(function (l, index) {\n lists.push(web.get_lists().getByTitle(l));\n listViewCollections.push(web.get_lists().getByTitle(l).get_views());\n clientContext.load(lists[index]);\n clientContext.load(listViewCollections[index]);\n });\n clientContext.executeQueryAsync(function () {\n Object.keys(mapping).forEach(function (l, index) {\n var views = mapping[l];\n var list = lists[index];\n var viewCollection = listViewCollections[index];\n views.forEach(function (v) {\n var view = _this.GetViewFromCollectionByUrl(viewCollection, v.Url);\n if (view == null) {\n return;\n }\n if (v.Paged) {\n view.set_paged(v.Paged);\n }\n if (v.Query) {\n view.set_viewQuery(v.Query);\n }\n if (v.RowLimit) {\n view.set_rowLimit(v.RowLimit);\n }\n if (v.ViewFields && v.ViewFields.length > 0) {\n var columns_1 = view.get_viewFields();\n columns_1.removeAll();\n v.ViewFields.forEach(function (vf) {\n columns_1.add(vf);\n });\n }\n view.update();\n });\n clientContext.load(viewCollection);\n list.update();\n });\n clientContext.executeQueryAsync(resolve, resolve);\n }, resolve);\n });\n };\n ObjectFiles.prototype.GetFolderFromFilePath = function (filePath) {\n var split = filePath.split(\"/\");\n return split.splice(0, split.length - 1).join(\"/\");\n };\n ObjectFiles.prototype.GetFilenameFromFilePath = function (filePath) {\n var split = filePath.split(\"/\");\n return split[split.length - 1];\n };\n return ObjectFiles;\n}(objecthandlerbase_1.ObjectHandlerBase));\nexports.ObjectFiles = ObjectFiles;\n;\n\n},{\"../../../utils/util\":23,\"../util\":20,\"./objecthandlerbase\":12}],12:[function(require,module,exports){\n\"use strict\";\nvar httpclient_1 = require(\"../../../net/httpclient\");\nvar logging_1 = require(\"../../../utils/logging\");\nvar ObjectHandlerBase = (function () {\n function ObjectHandlerBase(name) {\n this.name = name;\n this.httpClient = new httpclient_1.HttpClient();\n }\n ObjectHandlerBase.prototype.ProvisionObjects = function (objects, parameters) {\n return new Promise(function (resolve, reject) { resolve(\"Not implemented.\"); });\n };\n ObjectHandlerBase.prototype.scope_started = function () {\n logging_1.Logger.write(this.name + \": Code execution scope started\");\n };\n ObjectHandlerBase.prototype.scope_ended = function () {\n logging_1.Logger.write(this.name + \": Code execution scope stopped\");\n };\n return ObjectHandlerBase;\n}());\nexports.ObjectHandlerBase = ObjectHandlerBase;\n\n},{\"../../../net/httpclient\":5,\"../../../utils/logging\":22}],13:[function(require,module,exports){\n\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar sequencer_1 = require(\"../sequencer/sequencer\");\nvar objecthandlerbase_1 = require(\"./objecthandlerbase\");\nvar ObjectLists = (function (_super) {\n __extends(ObjectLists, _super);\n function ObjectLists() {\n _super.call(this, \"Lists\");\n }\n ObjectLists.prototype.ProvisionObjects = function (objects) {\n var _this = this;\n _super.prototype.scope_started.call(this);\n return new Promise(function (resolve, reject) {\n var clientContext = SP.ClientContext.get_current();\n var lists = clientContext.get_web().get_lists();\n var listInstances = [];\n clientContext.load(lists);\n clientContext.executeQueryAsync(function () {\n objects.forEach(function (obj, index) {\n var existingObj = lists.get_data().filter(function (list) {\n return list.get_title() === obj.Title;\n })[0];\n if (existingObj) {\n if (obj.Description) {\n existingObj.set_description(obj.Description);\n }\n if (obj.EnableVersioning !== undefined) {\n existingObj.set_enableVersioning(obj.EnableVersioning);\n }\n if (obj.EnableMinorVersions !== undefined) {\n existingObj.set_enableMinorVersions(obj.EnableMinorVersions);\n }\n if (obj.EnableModeration !== undefined) {\n existingObj.set_enableModeration(obj.EnableModeration);\n }\n if (obj.EnableFolderCreation !== undefined) {\n existingObj.set_enableFolderCreation(obj.EnableFolderCreation);\n }\n if (obj.EnableAttachments !== undefined) {\n existingObj.set_enableAttachments(obj.EnableAttachments);\n }\n if (obj.NoCrawl !== undefined) {\n existingObj.set_noCrawl(obj.NoCrawl);\n }\n if (obj.DefaultDisplayFormUrl) {\n existingObj.set_defaultDisplayFormUrl(obj.DefaultDisplayFormUrl);\n }\n if (obj.DefaultEditFormUrl) {\n existingObj.set_defaultEditFormUrl(obj.DefaultEditFormUrl);\n }\n if (obj.DefaultNewFormUrl) {\n existingObj.set_defaultNewFormUrl(obj.DefaultNewFormUrl);\n }\n if (obj.DraftVersionVisibility) {\n existingObj.set_draftVersionVisibility(SP.DraftVisibilityType[obj.DraftVersionVisibility]);\n }\n if (obj.ImageUrl) {\n existingObj.set_imageUrl(obj.ImageUrl);\n }\n if (obj.Hidden !== undefined) {\n existingObj.set_hidden(obj.Hidden);\n }\n if (obj.ForceCheckout !== undefined) {\n existingObj.set_forceCheckout(obj.ForceCheckout);\n }\n existingObj.update();\n listInstances.push(existingObj);\n clientContext.load(listInstances[index]);\n }\n else {\n var objCreationInformation = new SP.ListCreationInformation();\n if (obj.Description) {\n objCreationInformation.set_description(obj.Description);\n }\n if (obj.OnQuickLaunch !== undefined) {\n var value = obj.OnQuickLaunch ? SP.QuickLaunchOptions.on : SP.QuickLaunchOptions.off;\n objCreationInformation.set_quickLaunchOption(value);\n }\n if (obj.TemplateType) {\n objCreationInformation.set_templateType(obj.TemplateType);\n }\n if (obj.Title) {\n objCreationInformation.set_title(obj.Title);\n }\n if (obj.Url) {\n objCreationInformation.set_url(obj.Url);\n }\n var createdList = lists.add(objCreationInformation);\n if (obj.EnableVersioning !== undefined) {\n createdList.set_enableVersioning(obj.EnableVersioning);\n }\n if (obj.EnableMinorVersions !== undefined) {\n createdList.set_enableMinorVersions(obj.EnableMinorVersions);\n }\n if (obj.EnableModeration !== undefined) {\n createdList.set_enableModeration(obj.EnableModeration);\n }\n if (obj.EnableFolderCreation !== undefined) {\n createdList.set_enableFolderCreation(obj.EnableFolderCreation);\n }\n if (obj.EnableAttachments !== undefined) {\n createdList.set_enableAttachments(obj.EnableAttachments);\n }\n if (obj.NoCrawl !== undefined) {\n createdList.set_noCrawl(obj.NoCrawl);\n }\n if (obj.DefaultDisplayFormUrl) {\n createdList.set_defaultDisplayFormUrl(obj.DefaultDisplayFormUrl);\n }\n if (obj.DefaultEditFormUrl) {\n createdList.set_defaultEditFormUrl(obj.DefaultEditFormUrl);\n }\n if (obj.DefaultNewFormUrl) {\n createdList.set_defaultNewFormUrl(obj.DefaultNewFormUrl);\n }\n if (obj.DraftVersionVisibility) {\n var value = SP.DraftVisibilityType[obj.DraftVersionVisibility.toLocaleLowerCase()];\n createdList.set_draftVersionVisibility(value);\n }\n if (obj.ImageUrl) {\n createdList.set_imageUrl(obj.ImageUrl);\n }\n if (obj.Hidden !== undefined) {\n createdList.set_hidden(obj.Hidden);\n }\n if (obj.ForceCheckout !== undefined) {\n createdList.set_forceCheckout(obj.ForceCheckout);\n }\n listInstances.push(createdList);\n clientContext.load(listInstances[index]);\n }\n });\n clientContext.executeQueryAsync(function () {\n var sequencer = new sequencer_1.Sequencer([\n _this.ApplyContentTypeBindings,\n _this.ApplyListInstanceFieldRefs,\n _this.ApplyFields,\n _this.ApplyLookupFields,\n _this.ApplyListSecurity,\n _this.CreateViews,\n _this.InsertDataRows,\n _this.CreateFolders,\n ], { ClientContext: clientContext, ListInstances: listInstances, Objects: objects }, _this);\n sequencer.execute().then(function () {\n _super.prototype.scope_ended.call(_this);\n resolve();\n });\n }, function () {\n _super.prototype.scope_ended.call(_this);\n resolve();\n });\n }, function () {\n _super.prototype.scope_ended.call(_this);\n resolve();\n });\n });\n };\n ObjectLists.prototype.EnsureLocationBasedMetadataDefaultsReceiver = function (clientContext, list) {\n var eventReceivers = list.get_eventReceivers();\n var eventRecCreationInfo = new SP.EventReceiverDefinitionCreationInformation();\n eventRecCreationInfo.set_receiverName(\"LocationBasedMetadataDefaultsReceiver ItemAdded\");\n eventRecCreationInfo.set_synchronization(1);\n eventRecCreationInfo.set_sequenceNumber(1000);\n eventRecCreationInfo.set_receiverAssembly(\"Microsoft.Office.DocumentManagement, Version=15.0.0.0, Culture=neutral, \" +\n \"PublicKeyToken=71e9bce111e9429c\");\n eventRecCreationInfo.set_receiverClass(\"Microsoft.Office.DocumentManagement.LocationBasedMetadataDefaultsReceiver\");\n eventRecCreationInfo.set_eventType(SP.EventReceiverType.itemAdded);\n eventReceivers.add(eventRecCreationInfo);\n list.update();\n };\n ObjectLists.prototype.CreateFolders = function (params) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n params.ListInstances.forEach(function (l, index) {\n var obj = params.Objects[index];\n if (!obj.Folders) {\n return;\n }\n var folderServerRelativeUrl = _spPageContextInfo.webServerRelativeUrl + \"/\" + obj.Url;\n var rootFolder = l.get_rootFolder();\n var metadataDefaults = \"\";\n var setMetadataDefaults = false;\n obj.Folders.forEach(function (f) {\n var folderUrl = folderServerRelativeUrl + \"/\" + f.Name;\n rootFolder.get_folders().add(folderUrl);\n if (f.DefaultValues) {\n var keys = Object.keys(f.DefaultValues).length;\n if (keys > 0) {\n metadataDefaults += \"\";\n Object.keys(f.DefaultValues).forEach(function (key) {\n metadataDefaults += \"\" + f.DefaultValues[key] + \"\";\n });\n metadataDefaults += \"\";\n }\n setMetadataDefaults = true;\n }\n });\n metadataDefaults += \"\";\n if (setMetadataDefaults) {\n var metadataDefaultsFileCreateInfo = new SP.FileCreationInformation();\n metadataDefaultsFileCreateInfo.set_url(folderServerRelativeUrl + \"/Forms/client_LocationBasedDefaults.html\");\n metadataDefaultsFileCreateInfo.set_content(new SP.Base64EncodedByteArray());\n metadataDefaultsFileCreateInfo.set_overwrite(true);\n for (var i = 0; i < metadataDefaults.length; i++) {\n metadataDefaultsFileCreateInfo.get_content().append(metadataDefaults.charCodeAt(i));\n }\n rootFolder.get_files().add(metadataDefaultsFileCreateInfo);\n _this.EnsureLocationBasedMetadataDefaultsReceiver(params.ClientContext, l);\n }\n });\n params.ClientContext.executeQueryAsync(resolve, resolve);\n });\n };\n ObjectLists.prototype.ApplyContentTypeBindings = function (params) {\n return new Promise(function (resolve, reject) {\n var webCts = params.ClientContext.get_site().get_rootWeb().get_contentTypes();\n var listCts = [];\n params.ListInstances.forEach(function (l, index) {\n listCts.push(l.get_contentTypes());\n params.ClientContext.load(listCts[index], \"Include(Name,Id)\");\n if (params.Objects[index].ContentTypeBindings) {\n l.set_contentTypesEnabled(true);\n l.update();\n }\n });\n params.ClientContext.load(webCts);\n params.ClientContext.executeQueryAsync(function () {\n params.ListInstances.forEach(function (list, index) {\n var obj = params.Objects[index];\n if (!obj.ContentTypeBindings) {\n return;\n }\n var listContentTypes = listCts[index];\n var existingContentTypes = new Array();\n if (obj.RemoveExistingContentTypes && obj.ContentTypeBindings.length > 0) {\n listContentTypes.get_data().forEach(function (ct) {\n existingContentTypes.push(ct);\n });\n }\n obj.ContentTypeBindings.forEach(function (ctb) {\n listContentTypes.addExistingContentType(webCts.getById(ctb.ContentTypeId));\n });\n if (obj.RemoveExistingContentTypes && obj.ContentTypeBindings.length > 0) {\n for (var j = 0; j < existingContentTypes.length; j++) {\n var ect = existingContentTypes[j];\n ect.deleteObject();\n }\n }\n list.update();\n });\n params.ClientContext.executeQueryAsync(resolve, resolve);\n }, resolve);\n });\n };\n ObjectLists.prototype.ApplyListInstanceFieldRefs = function (params) {\n return new Promise(function (resolve, reject) {\n var siteFields = params.ClientContext.get_site().get_rootWeb().get_fields();\n params.ListInstances.forEach(function (l, index) {\n var obj = params.Objects[index];\n if (obj.FieldRefs) {\n obj.FieldRefs.forEach(function (fr) {\n var field = siteFields.getByInternalNameOrTitle(fr.Name);\n l.get_fields().add(field);\n });\n l.update();\n }\n });\n params.ClientContext.executeQueryAsync(resolve, resolve);\n });\n };\n ObjectLists.prototype.ApplyFields = function (params) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n params.ListInstances.forEach(function (l, index) {\n var obj = params.Objects[index];\n if (obj.Fields) {\n obj.Fields.forEach(function (f) {\n var fieldXml = _this.GetFieldXml(f, params.ListInstances, l);\n var fieldType = _this.GetFieldXmlAttr(fieldXml, \"Type\");\n if (fieldType !== \"Lookup\" && fieldType !== \"LookupMulti\") {\n l.get_fields().addFieldAsXml(fieldXml, true, SP.AddFieldOptions.addToAllContentTypes);\n }\n });\n l.update();\n }\n });\n params.ClientContext.executeQueryAsync(resolve, resolve);\n });\n };\n ObjectLists.prototype.ApplyLookupFields = function (params) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n params.ListInstances.forEach(function (l, index) {\n var obj = params.Objects[index];\n if (obj.Fields) {\n obj.Fields.forEach(function (f) {\n var fieldXml = _this.GetFieldXml(f, params.ListInstances, l);\n if (!fieldXml) {\n return;\n }\n var fieldType = _this.GetFieldXmlAttr(fieldXml, \"Type\");\n if (fieldType === \"Lookup\" || fieldType === \"LookupMulti\") {\n l.get_fields().addFieldAsXml(fieldXml, true, SP.AddFieldOptions.addToAllContentTypes);\n }\n });\n l.update();\n }\n });\n params.ClientContext.executeQueryAsync(resolve, resolve);\n });\n };\n ObjectLists.prototype.GetFieldXmlAttr = function (fieldXml, attr) {\n var regex = new RegExp(attr + '=[\\'|\\\"](?:(.+?))[\\'|\\\"]');\n var match = regex.exec(fieldXml);\n return match[1];\n };\n ObjectLists.prototype.GetFieldXml = function (field, lists, list) {\n var fieldXml = \"\";\n if (!field.SchemaXml) {\n var properties_1 = [];\n Object.keys(field).forEach(function (prop) {\n var value = field[prop];\n properties_1.push(prop + \"=\\\"\" + value + \"\\\"\");\n if (prop === \"List\") {\n var targetList = lists.filter(function (v) {\n return v.get_title() === value;\n });\n if (targetList.length > 0) {\n value = \"{\" + targetList[0].get_id().toString() + \"}\";\n }\n else {\n return null;\n }\n }\n });\n fieldXml = \"\";\n if (field.Type === \"Calculated\") {\n fieldXml += \"\" + field.Formula + \"\";\n }\n fieldXml += \"\";\n }\n return fieldXml;\n };\n ObjectLists.prototype.ApplyListSecurity = function (params) {\n return new Promise(function (resolve, reject) {\n params.ListInstances.forEach(function (l, index) {\n var obj = params.Objects[index];\n if (!obj.Security) {\n return;\n }\n if (obj.Security.BreakRoleInheritance) {\n l.breakRoleInheritance(obj.Security.CopyRoleAssignments, obj.Security.ClearSubscopes);\n l.update();\n params.ClientContext.load(l.get_roleAssignments());\n }\n });\n var web = params.ClientContext.get_web();\n var allProperties = web.get_allProperties();\n var siteGroups = web.get_siteGroups();\n var roleDefinitions = web.get_roleDefinitions();\n params.ClientContext.load(allProperties);\n params.ClientContext.load(roleDefinitions);\n params.ClientContext.executeQueryAsync(function () {\n params.ListInstances.forEach(function (l, index) {\n var obj = params.Objects[index];\n if (!obj.Security) {\n return;\n }\n obj.Security.RoleAssignments.forEach(function (ra) {\n var roleDef = null;\n if (typeof ra.RoleDefinition === \"number\") {\n roleDef = roleDefinitions.getById(ra.RoleDefinition);\n }\n else {\n roleDef = roleDefinitions.getByName(ra.RoleDefinition);\n }\n var roleBindings = SP.RoleDefinitionBindingCollection.newObject(params.ClientContext);\n roleBindings.add(roleDef);\n var principal = null;\n if (ra.Principal.match(/\\{[A-Za-z]*\\}+/g)) {\n var token = ra.Principal.substring(1, ra.Principal.length - 1);\n var groupId = allProperties.get_fieldValues()[(\"vti_\" + token)];\n principal = siteGroups.getById(groupId);\n }\n else {\n principal = siteGroups.getByName(principal);\n }\n l.get_roleAssignments().add(principal, roleBindings);\n });\n l.update();\n });\n params.ClientContext.executeQueryAsync(resolve, resolve);\n }, resolve);\n });\n };\n ObjectLists.prototype.CreateViews = function (params) {\n return new Promise(function (resolve, reject) {\n var listViewCollections = [];\n params.ListInstances.forEach(function (l, index) {\n listViewCollections.push(l.get_views());\n params.ClientContext.load(listViewCollections[index]);\n });\n params.ClientContext.executeQueryAsync(function () {\n params.ListInstances.forEach(function (l, index) {\n var obj = params.Objects[index];\n if (!obj.Views) {\n return;\n }\n listViewCollections.push(l.get_views());\n params.ClientContext.load(listViewCollections[index]);\n obj.Views.forEach(function (v) {\n var viewExists = listViewCollections[index].get_data().filter(function (ev) {\n if (obj.RemoveExistingViews && obj.Views.length > 0) {\n ev.deleteObject();\n return false;\n }\n return ev.get_title() === v.Title;\n }).length > 0;\n if (viewExists) {\n var view = listViewCollections[index].getByTitle(v.Title);\n if (v.Paged) {\n view.set_paged(v.Paged);\n }\n if (v.Query) {\n view.set_viewQuery(v.Query);\n }\n if (v.RowLimit) {\n view.set_rowLimit(v.RowLimit);\n }\n if (v.ViewFields && v.ViewFields.length > 0) {\n var columns_1 = view.get_viewFields();\n columns_1.removeAll();\n v.ViewFields.forEach(function (vf) {\n columns_1.add(vf);\n });\n }\n if (v.Scope) {\n view.set_scope(v.Scope);\n }\n view.update();\n }\n else {\n var viewCreationInformation = new SP.ViewCreationInformation();\n if (v.Title) {\n viewCreationInformation.set_title(v.Title);\n }\n if (v.PersonalView) {\n viewCreationInformation.set_personalView(v.PersonalView);\n }\n if (v.Paged) {\n viewCreationInformation.set_paged(v.Paged);\n }\n if (v.Query) {\n viewCreationInformation.set_query(v.Query);\n }\n if (v.RowLimit) {\n viewCreationInformation.set_rowLimit(v.RowLimit);\n }\n if (v.SetAsDefaultView) {\n viewCreationInformation.set_setAsDefaultView(v.SetAsDefaultView);\n }\n if (v.ViewFields) {\n viewCreationInformation.set_viewFields(v.ViewFields);\n }\n if (v.ViewTypeKind) {\n viewCreationInformation.set_viewTypeKind(SP.ViewType.html);\n }\n var view = l.get_views().add(viewCreationInformation);\n if (v.Scope) {\n view.set_scope(v.Scope);\n view.update();\n }\n l.update();\n }\n params.ClientContext.load(l.get_views());\n });\n });\n params.ClientContext.executeQueryAsync(resolve, resolve);\n }, resolve);\n });\n };\n ObjectLists.prototype.InsertDataRows = function (params) {\n return new Promise(function (resolve, reject) {\n params.ListInstances.forEach(function (l, index) {\n var obj = params.Objects[index];\n if (obj.DataRows) {\n obj.DataRows.forEach(function (r) {\n var item = l.addItem(new SP.ListItemCreationInformation());\n Object.keys(r).forEach(function (key) {\n item.set_item(key, r[key]);\n });\n item.update();\n params.ClientContext.load(item);\n });\n }\n });\n params.ClientContext.executeQueryAsync(resolve, resolve);\n });\n };\n return ObjectLists;\n}(objecthandlerbase_1.ObjectHandlerBase));\nexports.ObjectLists = ObjectLists;\n\n},{\"../sequencer/sequencer\":19,\"./objecthandlerbase\":12}],14:[function(require,module,exports){\n\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar util_1 = require(\"../util\");\nvar objecthandlerbase_1 = require(\"./objecthandlerbase\");\nvar ObjectNavigation = (function (_super) {\n __extends(ObjectNavigation, _super);\n function ObjectNavigation() {\n _super.call(this, \"Navigation\");\n }\n ObjectNavigation.prototype.ProvisionObjects = function (object) {\n var _this = this;\n _super.prototype.scope_started.call(this);\n var clientContext = SP.ClientContext.get_current();\n var navigation = clientContext.get_web().get_navigation();\n return new Promise(function (resolve, reject) {\n _this.ConfigureQuickLaunch(object.QuickLaunch, clientContext, _this.httpClient, navigation).then(function () {\n _super.prototype.scope_ended.call(_this);\n resolve();\n }, function () {\n _super.prototype.scope_ended.call(_this);\n reject();\n });\n });\n };\n ObjectNavigation.prototype.getNodeFromCollectionByTitle = function (nodeCollection, title) {\n var f = nodeCollection.filter(function (val) {\n return val.get_title() === title;\n });\n return f[0] || null;\n };\n ;\n ObjectNavigation.prototype.ConfigureQuickLaunch = function (nodes, clientContext, httpClient, navigation) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n if (nodes.length === 0) {\n resolve();\n }\n else {\n var quickLaunchNodeCollection_1 = navigation.get_quickLaunch();\n clientContext.load(quickLaunchNodeCollection_1);\n clientContext.executeQueryAsync(function () {\n var temporaryQuickLaunch = [];\n var index = quickLaunchNodeCollection_1.get_count() - 1;\n while (index >= 0) {\n var oldNode = quickLaunchNodeCollection_1.itemAt(index);\n temporaryQuickLaunch.push(oldNode);\n oldNode.deleteObject();\n index--;\n }\n clientContext.executeQueryAsync(function () {\n nodes.forEach(function (n) {\n var existingNode = _this.getNodeFromCollectionByTitle(temporaryQuickLaunch, n.Title);\n var newNode = new SP.NavigationNodeCreationInformation();\n newNode.set_title(n.Title);\n newNode.set_url(existingNode ? existingNode.get_url() : util_1.Util.replaceUrlTokens(n.Url));\n newNode.set_asLastNode(true);\n quickLaunchNodeCollection_1.add(newNode);\n });\n clientContext.executeQueryAsync(function () {\n httpClient.get(_spPageContextInfo.webAbsoluteUrl + \"/_api/web/Navigation/QuickLaunch\").then(function (response) {\n response.json().then(function (json) {\n json.value.forEach(function (d) {\n var node = navigation.getNodeById(d.Id);\n var childrenNodeCollection = node.get_children();\n var parentNode = nodes.filter(function (value) { return value.Title === d.Title; })[0];\n if (parentNode && parentNode.Children) {\n parentNode.Children.forEach(function (n) {\n var existingNode = _this.getNodeFromCollectionByTitle(temporaryQuickLaunch, n.Title);\n var newNode = new SP.NavigationNodeCreationInformation();\n newNode.set_title(n.Title);\n newNode.set_url(existingNode\n ? existingNode.get_url()\n : util_1.Util.replaceUrlTokens(n.Url));\n newNode.set_asLastNode(true);\n childrenNodeCollection.add(newNode);\n });\n }\n });\n clientContext.executeQueryAsync(resolve, resolve);\n });\n });\n }, resolve);\n });\n });\n }\n });\n };\n return ObjectNavigation;\n}(objecthandlerbase_1.ObjectHandlerBase));\nexports.ObjectNavigation = ObjectNavigation;\n\n},{\"../util\":20,\"./objecthandlerbase\":12}],15:[function(require,module,exports){\n\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar util_1 = require(\"../util\");\nvar objecthandlerbase_1 = require(\"./objecthandlerbase\");\nvar ObjectPropertyBagEntries = (function (_super) {\n __extends(ObjectPropertyBagEntries, _super);\n function ObjectPropertyBagEntries() {\n _super.call(this, \"PropertyBagEntries\");\n }\n ObjectPropertyBagEntries.prototype.ProvisionObjects = function (entries) {\n var _this = this;\n _super.prototype.scope_started.call(this);\n return new Promise(function (resolve, reject) {\n if (!entries || entries.length === 0) {\n resolve();\n }\n else {\n var clientContext_1 = SP.ClientContext.get_current();\n var web_1 = clientContext_1.get_web();\n var propBag_1 = web_1.get_allProperties();\n var indexedProperties_1 = [];\n for (var i = 0; i < entries.length; i++) {\n var entry = entries[i];\n propBag_1.set_item(entry.Key, entry.Value);\n if (entry.Indexed) {\n indexedProperties_1.push(util_1.Util.encodePropertyKey(entry.Key));\n }\n ;\n }\n ;\n web_1.update();\n clientContext_1.load(propBag_1);\n clientContext_1.executeQueryAsync(function () {\n if (indexedProperties_1.length > 0) {\n propBag_1.set_item(\"vti_indexedpropertykeys\", indexedProperties_1.join(\"|\"));\n web_1.update();\n clientContext_1.executeQueryAsync(function () {\n _super.prototype.scope_ended.call(_this);\n resolve();\n }, function () {\n _super.prototype.scope_ended.call(_this);\n resolve();\n });\n }\n else {\n _super.prototype.scope_ended.call(_this);\n resolve();\n }\n }, function () {\n _super.prototype.scope_ended.call(_this);\n resolve();\n });\n }\n });\n };\n return ObjectPropertyBagEntries;\n}(objecthandlerbase_1.ObjectHandlerBase));\nexports.ObjectPropertyBagEntries = ObjectPropertyBagEntries;\n\n},{\"../util\":20,\"./objecthandlerbase\":12}],16:[function(require,module,exports){\n\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar objecthandlerbase_1 = require(\"./objecthandlerbase\");\nvar ObjectWebSettings = (function (_super) {\n __extends(ObjectWebSettings, _super);\n function ObjectWebSettings() {\n _super.call(this, \"WebSettings\");\n }\n ObjectWebSettings.prototype.ProvisionObjects = function (object) {\n var _this = this;\n _super.prototype.scope_started.call(this);\n return new Promise(function (resolve, reject) {\n var clientContext = SP.ClientContext.get_current();\n var web = clientContext.get_web();\n if (object.WelcomePage) {\n web.get_rootFolder().set_welcomePage(object.WelcomePage);\n web.get_rootFolder().update();\n }\n if (object.MasterUrl) {\n web.set_masterUrl(object.MasterUrl);\n }\n if (object.CustomMasterUrl) {\n web.set_customMasterUrl(object.CustomMasterUrl);\n }\n if (object.SaveSiteAsTemplateEnabled !== undefined) {\n web.set_saveSiteAsTemplateEnabled(object.SaveSiteAsTemplateEnabled);\n }\n if (object.QuickLaunchEnabled !== undefined) {\n web.set_saveSiteAsTemplateEnabled(object.QuickLaunchEnabled);\n }\n if (object.TreeViewEnabled !== undefined) {\n web.set_treeViewEnabled(object.TreeViewEnabled);\n }\n web.update();\n clientContext.load(web);\n clientContext.executeQueryAsync(function () {\n _super.prototype.scope_ended.call(_this);\n resolve();\n }, function () {\n _super.prototype.scope_ended.call(_this);\n resolve();\n });\n });\n };\n return ObjectWebSettings;\n}(objecthandlerbase_1.ObjectHandlerBase));\nexports.ObjectWebSettings = ObjectWebSettings;\n\n},{\"./objecthandlerbase\":12}],17:[function(require,module,exports){\n\"use strict\";\nvar provisioningstep_1 = require(\"./provisioningstep\");\nvar objectnavigation_1 = require(\"./objecthandlers/objectnavigation\");\nvar objectpropertybagentries_1 = require(\"./objecthandlers/objectpropertybagentries\");\nvar objectfeatures_1 = require(\"./objecthandlers/objectfeatures\");\nvar objectwebsettings_1 = require(\"./objecthandlers/objectwebsettings\");\nvar objectcomposedlook_1 = require(\"./objecthandlers/objectcomposedlook\");\nvar objectcustomactions_1 = require(\"./objecthandlers/objectcustomactions\");\nvar objectfiles_1 = require(\"./objecthandlers/objectfiles\");\nvar objectlists_1 = require(\"./objecthandlers/objectlists\");\nvar util_1 = require(\"./util\");\nvar logging_1 = require(\"../../utils/logging\");\nvar httpclient_1 = require(\"../../net/httpclient\");\nvar Provisioning = (function () {\n function Provisioning() {\n this.handlers = {\n \"Navigation\": objectnavigation_1.ObjectNavigation,\n \"PropertyBagEntries\": objectpropertybagentries_1.ObjectPropertyBagEntries,\n \"Features\": objectfeatures_1.ObjectFeatures,\n \"WebSettings\": objectwebsettings_1.ObjectWebSettings,\n \"ComposedLook\": objectcomposedlook_1.ObjectComposedLook,\n \"CustomActions\": objectcustomactions_1.ObjectCustomActions,\n \"Files\": objectfiles_1.ObjectFiles,\n \"Lists\": objectlists_1.ObjectLists,\n };\n this.httpClient = new httpclient_1.HttpClient();\n }\n Provisioning.prototype.applyTemplate = function (path) {\n var _this = this;\n var url = util_1.Util.replaceUrlTokens(path);\n return new Promise(function (resolve, reject) {\n _this.httpClient.get(url).then(function (response) {\n if (response.ok) {\n response.json().then(function (template) {\n _this.start(template, Object.keys(template)).then(resolve, reject);\n });\n }\n else {\n reject(response.statusText);\n }\n }, function (error) {\n logging_1.Logger.write(\"Provisioning: The provided template is invalid\", logging_1.LogLevel.Error);\n });\n });\n };\n Provisioning.prototype.start = function (json, queue) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n _this.startTime = new Date().getTime();\n _this.queueItems = [];\n queue.forEach(function (q, index) {\n if (!_this.handlers[q]) {\n return;\n }\n _this.queueItems.push(new provisioningstep_1.ProvisioningStep(q, index, json[q], json.Parameters, _this.handlers[q]));\n });\n var promises = [];\n promises.push(new Promise(function (res) {\n logging_1.Logger.write(\"Provisioning: Code execution scope started\", logging_1.LogLevel.Info);\n res();\n }));\n var index = 1;\n while (_this.queueItems[index - 1] !== undefined) {\n var i = promises.length - 1;\n promises.push(_this.queueItems[index - 1].execute(promises[i]));\n index++;\n }\n ;\n Promise.all(promises).then(function (value) {\n logging_1.Logger.write(\"Provisioning: Code execution scope ended\", logging_1.LogLevel.Info);\n resolve(value);\n }, function (error) {\n logging_1.Logger.write(\"Provisioning: Code execution scope ended\" + JSON.stringify(error), logging_1.LogLevel.Error);\n reject(error);\n });\n });\n };\n return Provisioning;\n}());\nexports.Provisioning = Provisioning;\n\n},{\"../../net/httpclient\":5,\"../../utils/logging\":22,\"./objecthandlers/objectcomposedlook\":8,\"./objecthandlers/objectcustomactions\":9,\"./objecthandlers/objectfeatures\":10,\"./objecthandlers/objectfiles\":11,\"./objecthandlers/objectlists\":13,\"./objecthandlers/objectnavigation\":14,\"./objecthandlers/objectpropertybagentries\":15,\"./objecthandlers/objectwebsettings\":16,\"./provisioningstep\":18,\"./util\":20}],18:[function(require,module,exports){\n\"use strict\";\nvar ProvisioningStep = (function () {\n function ProvisioningStep(name, index, objects, parameters, handler) {\n this.name = name;\n this.index = index;\n this.objects = objects;\n this.parameters = parameters;\n this.handler = handler;\n }\n ProvisioningStep.prototype.execute = function (dependentPromise) {\n var _this = this;\n var _handler = new this.handler();\n if (!dependentPromise) {\n return _handler.ProvisionObjects(this.objects, this.parameters);\n }\n return new Promise(function (resolve, reject) {\n dependentPromise.then(function () {\n return _handler.ProvisionObjects(_this.objects, _this.parameters).then(resolve, resolve);\n });\n });\n };\n return ProvisioningStep;\n}());\nexports.ProvisioningStep = ProvisioningStep;\n\n},{}],19:[function(require,module,exports){\n\"use strict\";\nvar Sequencer = (function () {\n function Sequencer(functions, parameter, scope) {\n this.functions = functions;\n this.parameter = parameter;\n this.scope = scope;\n }\n Sequencer.prototype.execute = function (progressFunction) {\n var _this = this;\n var promiseSequence = Promise.resolve();\n this.functions.forEach(function (sequenceFunction, functionNr) {\n promiseSequence = promiseSequence.then(function () {\n return sequenceFunction.call(_this.scope, _this.parameter);\n }).then(function (result) {\n if (progressFunction) {\n progressFunction.call(_this, functionNr, _this.functions);\n }\n });\n }, this);\n return promiseSequence;\n };\n return Sequencer;\n}());\nexports.Sequencer = Sequencer;\n\n},{}],20:[function(require,module,exports){\n\"use strict\";\nvar Util = (function () {\n function Util() {\n }\n Util.getRelativeUrl = function (url) {\n return url.replace(document.location.protocol + \"//\" + document.location.hostname, \"\");\n };\n Util.replaceUrlTokens = function (url) {\n return url.replace(/{site}/g, _spPageContextInfo.webAbsoluteUrl)\n .replace(/{sitecollection}/g, _spPageContextInfo.siteAbsoluteUrl)\n .replace(/{themegallery}/g, _spPageContextInfo.siteAbsoluteUrl + \"/_catalogs/theme/15\");\n };\n ;\n Util.encodePropertyKey = function (propKey) {\n var bytes = [];\n for (var i = 0; i < propKey.length; ++i) {\n bytes.push(propKey.charCodeAt(i));\n bytes.push(0);\n }\n var b64encoded = window.btoa(String.fromCharCode.apply(null, bytes));\n return b64encoded;\n };\n return Util;\n}());\nexports.Util = Util;\n\n},{}],21:[function(require,module,exports){\n\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar util_1 = require(\"../../utils/util\");\nvar logging_1 = require(\"../../utils/logging\");\nvar httpclient_1 = require(\"../../net/httpclient\");\nvar pnplibconfig_1 = require(\"../../configuration/pnplibconfig\");\nfunction extractOdataId(candidate) {\n if (candidate.hasOwnProperty(\"odata.id\")) {\n return candidate[\"odata.id\"];\n }\n else if (candidate.hasOwnProperty(\"__metadata\") && candidate.__metadata.hasOwnProperty(\"id\")) {\n return candidate.__metadata.id;\n }\n else {\n logging_1.Logger.log({\n data: candidate,\n level: logging_1.LogLevel.Error,\n message: \"Could not extract odata id in object, you may be using nometadata. Object data logged to logger.\",\n });\n throw new Error(\"Could not extract odata id in object, you may be using nometadata. Object data logged to logger.\");\n }\n}\nexports.extractOdataId = extractOdataId;\nvar ODataParserBase = (function () {\n function ODataParserBase() {\n }\n ODataParserBase.prototype.parse = function (r) {\n var _this = this;\n return r.json().then(function (json) { return _this.parseODataJSON(json); });\n };\n ODataParserBase.prototype.parseODataJSON = function (json) {\n var result = json;\n if (json.hasOwnProperty(\"d\")) {\n if (json.d.hasOwnProperty(\"results\")) {\n result = json.d.results;\n }\n else {\n result = json.d;\n }\n }\n else if (json.hasOwnProperty(\"value\")) {\n result = json.value;\n }\n return result;\n };\n return ODataParserBase;\n}());\nexports.ODataParserBase = ODataParserBase;\nvar ODataDefaultParser = (function (_super) {\n __extends(ODataDefaultParser, _super);\n function ODataDefaultParser() {\n _super.apply(this, arguments);\n }\n return ODataDefaultParser;\n}(ODataParserBase));\nexports.ODataDefaultParser = ODataDefaultParser;\nvar ODataRawParserImpl = (function () {\n function ODataRawParserImpl() {\n }\n ODataRawParserImpl.prototype.parse = function (r) {\n return r.json();\n };\n return ODataRawParserImpl;\n}());\nexports.ODataRawParserImpl = ODataRawParserImpl;\nvar ODataValueParserImpl = (function (_super) {\n __extends(ODataValueParserImpl, _super);\n function ODataValueParserImpl() {\n _super.apply(this, arguments);\n }\n ODataValueParserImpl.prototype.parse = function (r) {\n return _super.prototype.parse.call(this, r).then(function (d) { return d; });\n };\n return ODataValueParserImpl;\n}(ODataParserBase));\nvar ODataEntityParserImpl = (function (_super) {\n __extends(ODataEntityParserImpl, _super);\n function ODataEntityParserImpl(factory) {\n _super.call(this);\n this.factory = factory;\n }\n ODataEntityParserImpl.prototype.parse = function (r) {\n var _this = this;\n return _super.prototype.parse.call(this, r).then(function (d) {\n var o = new _this.factory(getEntityUrl(d), null);\n return util_1.Util.extend(o, d);\n });\n };\n return ODataEntityParserImpl;\n}(ODataParserBase));\nvar ODataEntityArrayParserImpl = (function (_super) {\n __extends(ODataEntityArrayParserImpl, _super);\n function ODataEntityArrayParserImpl(factory) {\n _super.call(this);\n this.factory = factory;\n }\n ODataEntityArrayParserImpl.prototype.parse = function (r) {\n var _this = this;\n return _super.prototype.parse.call(this, r).then(function (d) {\n return d.map(function (v) {\n var o = new _this.factory(getEntityUrl(v), null);\n return util_1.Util.extend(o, v);\n });\n });\n };\n return ODataEntityArrayParserImpl;\n}(ODataParserBase));\nfunction getEntityUrl(entity) {\n if (entity.hasOwnProperty(\"__metadata\")) {\n return entity.__metadata.uri;\n }\n else if (entity.hasOwnProperty(\"odata.editLink\")) {\n return util_1.Util.combinePaths(\"_api\", entity[\"odata.editLink\"]);\n }\n else {\n logging_1.Logger.write(\"No uri information found in ODataEntity parsing, chaining will fail for this object.\", logging_1.LogLevel.Warning);\n return \"\";\n }\n}\nexports.ODataRaw = new ODataRawParserImpl();\nfunction ODataValue() {\n return new ODataValueParserImpl();\n}\nexports.ODataValue = ODataValue;\nfunction ODataEntity(factory) {\n return new ODataEntityParserImpl(factory);\n}\nexports.ODataEntity = ODataEntity;\nfunction ODataEntityArray(factory) {\n return new ODataEntityArrayParserImpl(factory);\n}\nexports.ODataEntityArray = ODataEntityArray;\nvar ODataBatch = (function () {\n function ODataBatch(baseUrl, _batchId) {\n if (_batchId === void 0) { _batchId = util_1.Util.getGUID(); }\n this.baseUrl = baseUrl;\n this._batchId = _batchId;\n this._requests = [];\n this._batchDependencies = Promise.resolve();\n }\n ODataBatch.prototype.add = function (url, method, options, parser) {\n var info = {\n method: method.toUpperCase(),\n options: options,\n parser: parser,\n reject: null,\n resolve: null,\n url: url,\n };\n var p = new Promise(function (resolve, reject) {\n info.resolve = resolve;\n info.reject = reject;\n });\n this._requests.push(info);\n return p;\n };\n ODataBatch.prototype.addBatchDependency = function () {\n var resolver;\n var promise = new Promise(function (resolve) {\n resolver = resolve;\n });\n this._batchDependencies = this._batchDependencies.then(function () { return promise; });\n return resolver;\n };\n ODataBatch.prototype.execute = function () {\n var _this = this;\n return this._batchDependencies.then(function () { return _this.executeImpl(); });\n };\n ODataBatch.prototype.executeImpl = function () {\n var _this = this;\n if (this._requests.length < 1) {\n return Promise.resolve();\n }\n var batchBody = [];\n var currentChangeSetId = \"\";\n this._requests.forEach(function (reqInfo, index) {\n if (reqInfo.method === \"GET\") {\n if (currentChangeSetId.length > 0) {\n batchBody.push(\"--changeset_\" + currentChangeSetId + \"--\\n\\n\");\n currentChangeSetId = \"\";\n }\n batchBody.push(\"--batch_\" + _this._batchId + \"\\n\");\n }\n else {\n if (currentChangeSetId.length < 1) {\n currentChangeSetId = util_1.Util.getGUID();\n batchBody.push(\"--batch_\" + _this._batchId + \"\\n\");\n batchBody.push(\"Content-Type: multipart/mixed; boundary=\\\"changeset_\" + currentChangeSetId + \"\\\"\\n\\n\");\n }\n batchBody.push(\"--changeset_\" + currentChangeSetId + \"\\n\");\n }\n batchBody.push(\"Content-Type: application/http\\n\");\n batchBody.push(\"Content-Transfer-Encoding: binary\\n\\n\");\n var headers = {\n \"Accept\": \"application/json;\",\n };\n if (reqInfo.method !== \"GET\") {\n var method = reqInfo.method;\n if (reqInfo.options && reqInfo.options.headers && reqInfo.options.headers[\"X-HTTP-Method\"] !== typeof undefined) {\n method = reqInfo.options.headers[\"X-HTTP-Method\"];\n delete reqInfo.options.headers[\"X-HTTP-Method\"];\n }\n batchBody.push(method + \" \" + reqInfo.url + \" HTTP/1.1\\n\");\n headers = util_1.Util.extend(headers, { \"Content-Type\": \"application/json;odata=verbose;charset=utf-8\" });\n }\n else {\n batchBody.push(reqInfo.method + \" \" + reqInfo.url + \" HTTP/1.1\\n\");\n }\n if (typeof pnplibconfig_1.RuntimeConfig.headers !== \"undefined\") {\n headers = util_1.Util.extend(headers, pnplibconfig_1.RuntimeConfig.headers);\n }\n if (reqInfo.options && reqInfo.options.headers) {\n headers = util_1.Util.extend(headers, reqInfo.options.headers);\n }\n for (var name_1 in headers) {\n if (headers.hasOwnProperty(name_1)) {\n batchBody.push(name_1 + \": \" + headers[name_1] + \"\\n\");\n }\n }\n batchBody.push(\"\\n\");\n if (reqInfo.options.body) {\n batchBody.push(reqInfo.options.body + \"\\n\\n\");\n }\n });\n if (currentChangeSetId.length > 0) {\n batchBody.push(\"--changeset_\" + currentChangeSetId + \"--\\n\\n\");\n currentChangeSetId = \"\";\n }\n batchBody.push(\"--batch_\" + this._batchId + \"--\\n\");\n var batchHeaders = {\n \"Content-Type\": \"multipart/mixed; boundary=batch_\" + this._batchId,\n };\n var batchOptions = {\n \"body\": batchBody.join(\"\"),\n \"headers\": batchHeaders,\n };\n var client = new httpclient_1.HttpClient();\n var requestUrl = util_1.Util.makeUrlAbsolute(util_1.Util.combinePaths(this.baseUrl, \"/_api/$batch\"));\n return client.post(requestUrl, batchOptions)\n .then(function (r) { return r.text(); })\n .then(this._parseResponse)\n .then(function (responses) {\n if (responses.length !== _this._requests.length) {\n throw new Error(\"Could not properly parse responses to match requests in batch.\");\n }\n var chain = Promise.resolve();\n var _loop_1 = function(i) {\n var request = _this._requests[i];\n var response = responses[i];\n if (!response.ok) {\n request.reject(new Error(response.statusText));\n }\n chain = chain.then(function (_) { return request.parser.parse(response).then(request.resolve).catch(request.reject); });\n };\n for (var i = 0; i < responses.length; i++) {\n _loop_1(i);\n }\n return chain;\n });\n };\n ODataBatch.prototype._parseResponse = function (body) {\n return new Promise(function (resolve, reject) {\n var responses = [];\n var header = \"--batchresponse_\";\n var statusRegExp = new RegExp(\"^HTTP/[0-9.]+ +([0-9]+) +(.*)\", \"i\");\n var lines = body.split(\"\\n\");\n var state = \"batch\";\n var status;\n var statusText;\n for (var i = 0; i < lines.length; ++i) {\n var line = lines[i];\n switch (state) {\n case \"batch\":\n if (line.substr(0, header.length) === header) {\n state = \"batchHeaders\";\n }\n else {\n if (line.trim() !== \"\") {\n throw new Error(\"Invalid response, line \" + i);\n }\n }\n break;\n case \"batchHeaders\":\n if (line.trim() === \"\") {\n state = \"status\";\n }\n break;\n case \"status\":\n var parts = statusRegExp.exec(line);\n if (parts.length !== 3) {\n throw new Error(\"Invalid status, line \" + i);\n }\n status = parseInt(parts[1], 10);\n statusText = parts[2];\n state = \"statusHeaders\";\n break;\n case \"statusHeaders\":\n if (line.trim() === \"\") {\n state = \"body\";\n }\n break;\n case \"body\":\n var response = void 0;\n if (status === 204) {\n response = new Response();\n }\n else {\n response = new Response(line, { status: status, statusText: statusText });\n }\n responses.push(response);\n state = \"batch\";\n break;\n }\n }\n if (state !== \"status\") {\n reject(new Error(\"Unexpected end of input\"));\n }\n resolve(responses);\n });\n };\n return ODataBatch;\n}());\nexports.ODataBatch = ODataBatch;\n\n},{\"../../configuration/pnplibconfig\":2,\"../../net/httpclient\":5,\"../../utils/logging\":22,\"../../utils/util\":23}],22:[function(require,module,exports){\n\"use strict\";\n(function (LogLevel) {\n LogLevel[LogLevel[\"Verbose\"] = 0] = \"Verbose\";\n LogLevel[LogLevel[\"Info\"] = 1] = \"Info\";\n LogLevel[LogLevel[\"Warning\"] = 2] = \"Warning\";\n LogLevel[LogLevel[\"Error\"] = 3] = \"Error\";\n LogLevel[LogLevel[\"Off\"] = 99] = \"Off\";\n})(exports.LogLevel || (exports.LogLevel = {}));\nvar LogLevel = exports.LogLevel;\nvar Logger = (function () {\n function Logger() {\n }\n Object.defineProperty(Logger, \"activeLogLevel\", {\n get: function () {\n return Logger.instance.activeLogLevel;\n },\n set: function (value) {\n Logger.instance.activeLogLevel = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Logger, \"instance\", {\n get: function () {\n if (typeof Logger._instance === \"undefined\" || Logger._instance === null) {\n Logger._instance = new LoggerImpl();\n }\n return Logger._instance;\n },\n enumerable: true,\n configurable: true\n });\n Logger.subscribe = function () {\n var listeners = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n listeners[_i - 0] = arguments[_i];\n }\n for (var i = 0; i < listeners.length; i++) {\n Logger.instance.subscribe(listeners[i]);\n }\n };\n Logger.clearSubscribers = function () {\n return Logger.instance.clearSubscribers();\n };\n Object.defineProperty(Logger, \"count\", {\n get: function () {\n return Logger.instance.count;\n },\n enumerable: true,\n configurable: true\n });\n Logger.write = function (message, level) {\n if (level === void 0) { level = LogLevel.Verbose; }\n Logger.instance.log({ level: level, message: message });\n };\n Logger.log = function (entry) {\n Logger.instance.log(entry);\n };\n Logger.measure = function (name, f) {\n return Logger.instance.measure(name, f);\n };\n return Logger;\n}());\nexports.Logger = Logger;\nvar LoggerImpl = (function () {\n function LoggerImpl(activeLogLevel, subscribers) {\n if (activeLogLevel === void 0) { activeLogLevel = LogLevel.Warning; }\n if (subscribers === void 0) { subscribers = []; }\n this.activeLogLevel = activeLogLevel;\n this.subscribers = subscribers;\n }\n LoggerImpl.prototype.subscribe = function (listener) {\n this.subscribers.push(listener);\n };\n LoggerImpl.prototype.clearSubscribers = function () {\n var s = this.subscribers.slice(0);\n this.subscribers.length = 0;\n return s;\n };\n Object.defineProperty(LoggerImpl.prototype, \"count\", {\n get: function () {\n return this.subscribers.length;\n },\n enumerable: true,\n configurable: true\n });\n LoggerImpl.prototype.write = function (message, level) {\n if (level === void 0) { level = LogLevel.Verbose; }\n this.log({ level: level, message: message });\n };\n LoggerImpl.prototype.log = function (entry) {\n if (typeof entry === \"undefined\" || entry.level < this.activeLogLevel) {\n return;\n }\n for (var i = 0; i < this.subscribers.length; i++) {\n this.subscribers[i].log(entry);\n }\n };\n LoggerImpl.prototype.measure = function (name, f) {\n console.profile(name);\n try {\n return f();\n }\n finally {\n console.profileEnd();\n }\n };\n return LoggerImpl;\n}());\nvar ConsoleListener = (function () {\n function ConsoleListener() {\n }\n ConsoleListener.prototype.log = function (entry) {\n var msg = this.format(entry);\n switch (entry.level) {\n case LogLevel.Verbose:\n case LogLevel.Info:\n console.log(msg);\n break;\n case LogLevel.Warning:\n console.warn(msg);\n break;\n case LogLevel.Error:\n console.error(msg);\n break;\n }\n };\n ConsoleListener.prototype.format = function (entry) {\n return \"Message: \" + entry.message + \". Data: \" + JSON.stringify(entry.data);\n };\n return ConsoleListener;\n}());\nexports.ConsoleListener = ConsoleListener;\nvar AzureInsightsListener = (function () {\n function AzureInsightsListener(azureInsightsInstrumentationKey) {\n this.azureInsightsInstrumentationKey = azureInsightsInstrumentationKey;\n var appInsights = window[\"appInsights\"] || function (config) {\n function r(config) {\n t[config] = function () {\n var i = arguments;\n t.queue.push(function () { t[config].apply(t, i); });\n };\n }\n var t = { config: config }, u = document, e = window, o = \"script\", s = u.createElement(o), i, f;\n for (s.src = config.url || \"//az416426.vo.msecnd.net/scripts/a/ai.0.js\", u.getElementsByTagName(o)[0].parentNode.appendChild(s), t.cookie = u.cookie, t.queue = [], i = [\"Event\", \"Exception\", \"Metric\", \"PageView\", \"Trace\"]; i.length;) {\n r(\"track\" + i.pop());\n }\n return r(\"setAuthenticatedUserContext\"), r(\"clearAuthenticatedUserContext\"), config.disableExceptionTracking || (i = \"onerror\", r(\"_\" + i), f = e[i], e[i] = function (config, r, u, e, o) {\n var s = f && f(config, r, u, e, o);\n return s !== !0 && t[\"_\" + i](config, r, u, e, o), s;\n }), t;\n }({\n instrumentationKey: this.azureInsightsInstrumentationKey\n });\n window[\"appInsights\"] = appInsights;\n }\n AzureInsightsListener.prototype.log = function (entry) {\n var ai = window[\"appInsights\"];\n var msg = this.format(entry);\n if (entry.level === LogLevel.Error) {\n ai.trackException(msg);\n }\n else {\n ai.trackEvent(msg);\n }\n };\n AzureInsightsListener.prototype.format = function (entry) {\n return \"Message: \" + entry.message + \". Data: \" + JSON.stringify(entry.data);\n };\n return AzureInsightsListener;\n}());\nexports.AzureInsightsListener = AzureInsightsListener;\nvar FunctionListener = (function () {\n function FunctionListener(method) {\n this.method = method;\n }\n FunctionListener.prototype.log = function (entry) {\n this.method(entry);\n };\n return FunctionListener;\n}());\nexports.FunctionListener = FunctionListener;\n\n},{}],23:[function(require,module,exports){\n(function (global){\n\"use strict\";\nvar Util = (function () {\n function Util() {\n }\n Util.getCtxCallback = function (context, method) {\n var params = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n params[_i - 2] = arguments[_i];\n }\n return function () {\n method.apply(context, params);\n };\n };\n Util.urlParamExists = function (name) {\n name = name.replace(/[\\[]/, \"\\\\[\").replace(/[\\]]/, \"\\\\]\");\n var regex = new RegExp(\"[\\\\?&]\" + name + \"=([^&#]*)\");\n return regex.test(location.search);\n };\n Util.getUrlParamByName = function (name) {\n name = name.replace(/[\\[]/, \"\\\\[\").replace(/[\\]]/, \"\\\\]\");\n var regex = new RegExp(\"[\\\\?&]\" + name + \"=([^&#]*)\");\n var results = regex.exec(location.search);\n return results == null ? \"\" : decodeURIComponent(results[1].replace(/\\+/g, \" \"));\n };\n Util.getUrlParamBoolByName = function (name) {\n var p = this.getUrlParamByName(name);\n var isFalse = (p === \"\" || /false|0/i.test(p));\n return !isFalse;\n };\n Util.stringInsert = function (target, index, s) {\n if (index > 0) {\n return target.substring(0, index) + s + target.substring(index, target.length);\n }\n return s + target;\n };\n Util.dateAdd = function (date, interval, units) {\n var ret = new Date(date.toLocaleString());\n switch (interval.toLowerCase()) {\n case \"year\":\n ret.setFullYear(ret.getFullYear() + units);\n break;\n case \"quarter\":\n ret.setMonth(ret.getMonth() + 3 * units);\n break;\n case \"month\":\n ret.setMonth(ret.getMonth() + units);\n break;\n case \"week\":\n ret.setDate(ret.getDate() + 7 * units);\n break;\n case \"day\":\n ret.setDate(ret.getDate() + units);\n break;\n case \"hour\":\n ret.setTime(ret.getTime() + units * 3600000);\n break;\n case \"minute\":\n ret.setTime(ret.getTime() + units * 60000);\n break;\n case \"second\":\n ret.setTime(ret.getTime() + units * 1000);\n break;\n default:\n ret = undefined;\n break;\n }\n return ret;\n };\n Util.loadStylesheet = function (path, avoidCache) {\n if (avoidCache) {\n path += \"?\" + encodeURIComponent((new Date()).getTime().toString());\n }\n var head = document.getElementsByTagName(\"head\");\n if (head.length > 0) {\n var e = document.createElement(\"link\");\n head[0].appendChild(e);\n e.setAttribute(\"type\", \"text/css\");\n e.setAttribute(\"rel\", \"stylesheet\");\n e.setAttribute(\"href\", path);\n }\n };\n Util.combinePaths = function () {\n var paths = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n paths[_i - 0] = arguments[_i];\n }\n var parts = [];\n for (var i = 0; i < paths.length; i++) {\n if (typeof paths[i] !== \"undefined\" && paths[i] !== null) {\n parts.push(paths[i].replace(/^[\\\\|\\/]/, \"\").replace(/[\\\\|\\/]$/, \"\"));\n }\n }\n return parts.join(\"/\").replace(/\\\\/, \"/\");\n };\n Util.getRandomString = function (chars) {\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n for (var i = 0; i < chars; i++) {\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n }\n return text;\n };\n Util.getGUID = function () {\n var d = new Date().getTime();\n var guid = \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g, function (c) {\n var r = (d + Math.random() * 16) % 16 | 0;\n d = Math.floor(d / 16);\n return (c === \"x\" ? r : (r & 0x3 | 0x8)).toString(16);\n });\n return guid;\n };\n Util.isFunction = function (candidateFunction) {\n return typeof candidateFunction === \"function\";\n };\n Util.isArray = function (array) {\n if (Array.isArray) {\n return Array.isArray(array);\n }\n return array && typeof array.length === \"number\" && array.constructor === Array;\n };\n Util.stringIsNullOrEmpty = function (s) {\n return typeof s === \"undefined\" || s === null || s === \"\";\n };\n Util.extend = function (target, source, noOverwrite) {\n if (noOverwrite === void 0) { noOverwrite = false; }\n var result = {};\n for (var id in target) {\n result[id] = target[id];\n }\n var check = noOverwrite ? function (o, i) { return !o.hasOwnProperty(i); } : function (o, i) { return true; };\n for (var id in source) {\n if (check(result, id)) {\n result[id] = source[id];\n }\n }\n return result;\n };\n Util.applyMixins = function (derivedCtor) {\n var baseCtors = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n baseCtors[_i - 1] = arguments[_i];\n }\n baseCtors.forEach(function (baseCtor) {\n Object.getOwnPropertyNames(baseCtor.prototype).forEach(function (name) {\n derivedCtor.prototype[name] = baseCtor.prototype[name];\n });\n });\n };\n Util.isUrlAbsolute = function (url) {\n return /^https?:\\/\\/|^\\/\\//i.test(url);\n };\n Util.makeUrlAbsolute = function (url) {\n if (Util.isUrlAbsolute(url)) {\n return url;\n }\n if (typeof global._spPageContextInfo !== \"undefined\") {\n if (global._spPageContextInfo.hasOwnProperty(\"webAbsoluteUrl\")) {\n return Util.combinePaths(global._spPageContextInfo.webAbsoluteUrl, url);\n }\n else if (global._spPageContextInfo.hasOwnProperty(\"webServerRelativeUrl\")) {\n return Util.combinePaths(global._spPageContextInfo.webServerRelativeUrl, url);\n }\n }\n else {\n return url;\n }\n };\n return Util;\n}());\nexports.Util = Util;\n\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n},{}]},{},[17])(17)\n});"]} \ No newline at end of file diff --git a/dist/pnp.d.ts b/dist/pnp.d.ts index 53876416..f42d200f 100644 --- a/dist/pnp.d.ts +++ b/dist/pnp.d.ts @@ -91,7 +91,7 @@ declare module "utils/util" { */ static stringIsNullOrEmpty(s: string): boolean; /** - * Provides functionality to extend the given object by doign a shallow copy + * 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 @@ -333,15 +333,6 @@ declare module "configuration/providers/cachingConfigurationProvider" { private selectPnPCache(); } } -declare module "net/fetchclient" { - import { HttpClientImpl } from "net/httpclient"; - /** - * Makes requests using the fetch API - */ - export class FetchClient implements HttpClientImpl { - fetch(url: string, options: any): Promise; - } -} declare module "utils/logging" { /** * A set of logging levels @@ -492,6 +483,15 @@ declare module "utils/logging" { log(entry: LogEntry): void; } } +declare module "net/fetchclient" { + import { HttpClientImpl } from "net/httpclient"; + /** + * Makes requests using the fetch API + */ + export class FetchClient implements HttpClientImpl { + fetch(url: string, options: any): Promise; + } +} declare module "configuration/pnplibconfig" { import { TypedHash } from "collections/collections"; export interface NodeClientData { @@ -554,6 +554,7 @@ declare module "sharepoint/rest/odata" { } export abstract class ODataParserBase implements ODataParser { parse(r: Response): Promise; + protected parseODataJSON(json: any): U; } export class ODataDefaultParser extends ODataParserBase { } @@ -568,10 +569,11 @@ declare module "sharepoint/rest/odata" { * Manages a batch of OData operations */ export class ODataBatch { + private baseUrl; private _batchId; - private _batchDepCount; + private _batchDependencies; private _requests; - constructor(_batchId?: string); + constructor(baseUrl: string, _batchId?: string); /** * Adds a request to a batch (not designed for public use) * @@ -581,8 +583,7 @@ declare module "sharepoint/rest/odata" { * @param parser The parser that will hadle the results of the request */ add(url: string, method: string, options: any, parser: ODataParser): Promise; - incrementBatchDep(): void; - decrementBatchDep(): void; + addBatchDependency(): () => void; /** * Execute the current batch and resolve the associated promises * @@ -680,6 +681,8 @@ declare module "net/httpclient" { fetchRaw(url: string, options?: FetchOptions): Promise; get(url: string, options?: FetchOptions): Promise; post(url: string, options?: FetchOptions): Promise; + patch(url: string, options?: FetchOptions): Promise; + delete(url: string, options?: FetchOptions): Promise; protected getFetchImpl(): HttpClientImpl; private mergeHeaders(target, source); } @@ -760,13 +763,9 @@ declare module "sharepoint/rest/queryable" { */ protected append(pathPart: string): void; /** - * Blocks a batch call from occuring, MUST be cleared with clearBatchDependency before a request will execute + * Blocks a batch call from occuring, MUST be cleared by calling the returned function */ - protected addBatchDependency(): void; - /** - * Clears a batch request dependency - */ - protected clearBatchDependency(): void; + protected addBatchDependency(): () => void; /** * Indicates if the current query has a batch associated * @@ -798,6 +797,7 @@ declare module "sharepoint/rest/queryable" { * * let b = pnp.sp.createBatch(); * pnp.sp.web.inBatch(b).get().then(...); + * b.execute().then(...) * ``` */ inBatch(batch: ODataBatch): this; @@ -808,7 +808,7 @@ declare module "sharepoint/rest/queryable" { */ usingCaching(options?: ICachingOptions): this; /** - * Gets the currentl url, made server relative or absolute based on the availability of the _spPageContextInfo object + * Gets the currentl url, made absolute based on the availability of the _spPageContextInfo object * */ toUrl(): string; @@ -825,8 +825,10 @@ declare module "sharepoint/rest/queryable" { getAs(parser?: ODataParser, getOptions?: FetchOptions): Promise; protected post(postOptions?: FetchOptions, parser?: ODataParser): Promise; protected postAs(postOptions?: FetchOptions, parser?: ODataParser): Promise; + protected patch(patchOptions?: FetchOptions, parser?: ODataParser): Promise; + protected delete(deleteOptions?: FetchOptions, parser?: ODataParser): Promise; /** - * Gets a parent for this isntance as specified + * Gets a parent for this instance as specified * * @param factory The contructor for the class to create */ @@ -835,6 +837,9 @@ declare module "sharepoint/rest/queryable" { }, baseUrl?: string | Queryable, path?: string): T; private getImpl(getOptions, parser); private postImpl(postOptions, parser); + private patchImpl(patchOptions, parser); + private deleteImpl(deleteOptions, parser); + private processHttpClientResponse(response, parser); } /** * Represents a REST collection which can be filtered, paged, and selected @@ -846,38 +851,38 @@ declare module "sharepoint/rest/queryable" { * * @param filter The string representing the filter query */ - filter(filter: string): QueryableCollection; + filter(filter: string): this; /** * Choose which fields to return * * @param selects One or more fields to return */ - select(...selects: string[]): QueryableCollection; + select(...selects: string[]): this; /** * Expands fields such as lookups to get additional data * * @param expands The Fields for which to expand the values */ - expand(...expands: string[]): QueryableCollection; + expand(...expands: string[]): 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) */ - orderBy(orderBy: string, ascending?: boolean): QueryableCollection; + orderBy(orderBy: string, ascending?: boolean): this; /** * Skips the specified number of items * * @param skip The number of items to skip */ - skip(skip: number): QueryableCollection; + skip(skip: number): this; /** * Limits the query to only return the specified number of items * * @param top The query row limit */ - top(top: number): QueryableCollection; + top(top: number): this; } /** * Represents an instance that can be selected @@ -889,13 +894,13 @@ declare module "sharepoint/rest/queryable" { * * @param selects One or more fields to return */ - select(...selects: string[]): QueryableInstance; + select(...selects: string[]): this; /** * Expands fields such as lookups to get additional data * * @param expands The Fields for which to expand the values */ - expand(...expands: string[]): QueryableInstance; + expand(...expands: string[]): this; } } declare module "sharepoint/rest/types" { @@ -1828,6 +1833,15 @@ declare module "sharepoint/rest/queryablesecurable" { declare module "sharepoint/rest/files" { import { Queryable, QueryableCollection, QueryableInstance } from "sharepoint/rest/queryable"; import { Item } from "sharepoint/rest/items"; + import { ODataParser } from "sharepoint/rest/odata"; + export interface ChunkedFileUploadProgressData { + stage: "starting" | "continue" | "finishing"; + blockNumber: number; + totalBlocks: number; + chunkSize: number; + currentPointer: number; + fileSize: number; + } /** * Describes a collection of File objects * @@ -1849,11 +1863,22 @@ declare module "sharepoint/rest/files" { * Uploads a file. * * @param url The folder-relative url of the file. - * @param shouldOverWrite Should a file with the same name in the same location be overwritten? * @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. */ add(url: string, content: Blob, shouldOverWrite?: boolean): Promise; + /** + * Uploads a file. + * + * @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. + */ + addChunked(url: string, content: Blob, progress?: (data: ChunkedFileUploadProgressData) => void, shouldOverWrite?: boolean, chunkSize?: number): Promise; /** * Adds a ghosted file to an existing list or document library. * @@ -1885,11 +1910,6 @@ declare module "sharepoint/rest/files" { * */ readonly versions: Versions; - /** - * Gets the contents of the file - If the file is not JSON a custom parser function should be used with the get call - * - */ - readonly value: Queryable; /** * Approves the file submitted for content approval with the specified comment. * Only documents in lists that are enabled for content approval can be approved. @@ -1918,18 +1938,6 @@ declare module "sharepoint/rest/files" { * Checks out the file from a document library. */ checkout(): Promise; - /** - * 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. - */ - continueUpload(uploadId: string, fileOffset: number, b: Blob): Promise; /** * Copies the file to the destination url. * @@ -1950,17 +1958,6 @@ declare module "sharepoint/rest/files" { * @param comment The comment for the denial. */ deny(comment?: string): Promise; - /** - * 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. - */ - finishUpload(uploadId: string, fileOffset: number, fragment: Blob): Promise; /** * 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. @@ -1975,11 +1972,6 @@ declare module "sharepoint/rest/files" { * @param moveOperations The bitwise MoveOperations value for how to move the file. */ moveTo(url: string, moveOperations?: MoveOperations): Promise; - /** - * Opens the file as a stream. - * - */ - openBinaryStream(): Queryable; /** * Submits the file for content approval with the specified comment. * @@ -1993,11 +1985,45 @@ declare module "sharepoint/rest/files" { */ recycle(): Promise; /** - * Uploads a binary file. + * Reverts an existing checkout for the file. + * + */ + undoCheckout(): Promise; + /** + * Removes the file from content approval or unpublish a major version. + * + * @param comment The comment for the unpublish operation. Its length must be <= 1023. + */ + unpublish(comment?: string): Promise; + /** + * Gets the contents of the file as text + * + */ + getText(): Promise; + /** + * Gets the contents of the file as a blob, does not work in Node.js + * + */ + getBlob(): Promise; + /** + * Gets the contents of a file as an ArrayBuffer, works in Node.js + */ + getBuffer(): Promise; + /** + * Sets the content of a file, for large files use setContentChunked + * + * @param content The file content + * + */ + setContent(content: string | ArrayBuffer | Blob): Promise; + /** + * Sets the contents of a file using a chunked upload approach * - * @data The file contents. + * @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) */ - saveBinaryStream(data: Blob): Promise; + setContentChunked(file: Blob, progress?: (data: ChunkedFileUploadProgressData) => void, chunkSize?: number): Promise; /** * Starts a new chunk upload session and uploads the first fragment. * The current file content is not changed when this method completes. @@ -2012,18 +2038,39 @@ declare module "sharepoint/rest/files" { * @param fragment The file contents. * @returns The size of the total uploaded data in bytes. */ - startUpload(uploadId: string, fragment: Blob): Promise; + private startUpload(uploadId, fragment); /** - * Reverts an existing checkout for the file. + * 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. */ - undoCheckout(): Promise; + private continueUpload(uploadId, fileOffset, fragment); /** - * Removes the file from content approval or unpublish a major version. + * 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 comment The comment for the unpublish operation. Its length must be <= 1023. + * @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. */ - unpublish(comment?: string): Promise; + private finishUpload(uploadId, fileOffset, fragment); + } + export class TextFileParser implements ODataParser { + parse(r: Response): Promise; + } + export class BlobFileParser implements ODataParser { + parse(r: Response): Promise; + } + export class BufferFileParser implements ODataParser { + parse(r: any): Promise; } /** * Describes a collection of Version objects @@ -2205,6 +2252,7 @@ declare module "sharepoint/rest/folders" { } } declare module "sharepoint/rest/contenttypes" { + import { TypedHash } from "collections/collections"; import { Queryable, QueryableCollection, QueryableInstance } from "sharepoint/rest/queryable"; /** * Describes a collection of content types @@ -2221,6 +2269,23 @@ declare module "sharepoint/rest/contenttypes" { * Gets a ContentType by content type id */ getById(id: string): ContentType; + /** + * Adds an existing contenttype to a content type collection + * + * @param contentTypeId in the following format, for example: 0x010102 + */ + addAvailableContentType(contentTypeId: string): Promise; + /** + * 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 + * + */ + add(id: string, name: string, description?: string, group?: string, additionalSettings?: TypedHash): Promise; } /** * Describes a single ContentType instance @@ -2250,6 +2315,10 @@ declare module "sharepoint/rest/contenttypes" { */ readonly workflowAssociations: Queryable; } + export interface ContentTypeAddResult { + contentType: ContentType; + data: any; + } } declare module "sharepoint/rest/items" { import { Queryable, QueryableCollection, QueryableInstance } from "sharepoint/rest/queryable"; @@ -2280,7 +2349,7 @@ declare module "sharepoint/rest/items" { * * @param skip The starting id where the page should start, use with top to specify pages */ - skip(skip: number): QueryableCollection; + skip(skip: number): this; /** * Gets a collection designed to aid in paging through data * @@ -2388,25 +2457,13 @@ declare module "sharepoint/rest/items" { * Provides paging functionality for list items */ export class PagedItemCollection { - /** - * Contains the results of the query - */ - results: T; - /** - * The url to the next set of results - */ private nextUrl; + results: T; + constructor(nextUrl: string, results: T); /** * If true there are more results available in the set, otherwise there are not */ readonly hasNext: boolean; - /** - * Creats a new instance of the PagedItemCollection class from the response - * - * @param r Response instance from which this collection will be created - * - */ - static fromResponse(r: Response): Promise>; /** * Gets the next set of results, or resolves to null if no results are available */ @@ -2705,6 +2762,61 @@ declare module "sharepoint/rest/forms" { constructor(baseUrl: string | Queryable, path?: string); } } +declare module "sharepoint/rest/subscriptions" { + import { Queryable, QueryableCollection, QueryableInstance } from "sharepoint/rest/queryable"; + /** + * Describes a collection of webhook subscriptions + * + */ + export class Subscriptions extends QueryableCollection { + /** + * Creates a new instance of the Subscriptions class + * + * @param baseUrl - The url or Queryable which forms the parent of this webhook subscriptions collection + */ + constructor(baseUrl: string | Queryable, path?: string); + /** + * Returns all the webhook subscriptions or the specified webhook subscription + * + */ + getById(subscriptionId: string): Subscription; + /** + * Create a new webhook subscription + * + */ + add(notificationUrl: string, expirationDate: string, clientState?: string): Promise; + } + /** + * Describes a single webhook subscription instance + * + */ + export class Subscription extends QueryableInstance { + /** + * Creates a new instance of the Subscription class + * + * @param baseUrl - The url or Queryable which forms the parent of this webhook subscription instance + */ + constructor(baseUrl: string | Queryable, path?: string); + /** + * Update a webhook subscription + * + */ + update(expirationDate: string): Promise; + /** + * Remove a webhook subscription + * + */ + delete(): Promise; + } + export interface SubscriptionAddResult { + subscription: Subscription; + data: any; + } + export interface SubscriptionUpdateResult { + subscription: Subscription; + data: any; + } +} declare module "sharepoint/rest/usercustomactions" { import { Queryable, QueryableInstance, QueryableCollection } from "sharepoint/rest/queryable"; import { TypedHash } from "collections/collections"; @@ -2748,6 +2860,7 @@ declare module "sharepoint/rest/lists" { import { ContentTypes } from "sharepoint/rest/contenttypes"; import { Fields } from "sharepoint/rest/fields"; import { Forms } from "sharepoint/rest/forms"; + import { Subscriptions } from "sharepoint/rest/subscriptions"; import { Queryable, QueryableInstance, QueryableCollection } from "sharepoint/rest/queryable"; import { QueryableSecurable } from "sharepoint/rest/queryablesecurable"; import { TypedHash } from "collections/collections"; @@ -2873,6 +2986,11 @@ declare module "sharepoint/rest/lists" { * */ readonly informationRightsManagementSettings: Queryable; + /** + * Gets the webhook subscriptions of this list + * + */ + readonly subscriptions: Subscriptions; /** * Gets a view by view guid id * @@ -3023,6 +3141,7 @@ declare module "sharepoint/rest/webs" { import { List } from "sharepoint/rest/lists"; import { SiteUsers, SiteUser } from "sharepoint/rest/siteusers"; import { UserCustomActions } from "sharepoint/rest/usercustomactions"; + import { ODataBatch } from "sharepoint/rest/odata"; export class Webs extends QueryableCollection { constructor(baseUrl: string | Queryable, webPath?: string); /** @@ -3095,6 +3214,11 @@ declare module "sharepoint/rest/webs" { * */ readonly roleDefinitions: RoleDefinitions; + /** + * Creates a new batch for requests within the context of context this web + * + */ + createBatch(): ODataBatch; /** * Get a folder by server relative url * @@ -3427,7 +3551,7 @@ declare module "sharepoint/rest/search" { /** * The set of refiners to return in a search result. */ - Refiners?: string[]; + Refiners?: string; /** * The additional query terms to append to the query. */ @@ -3460,6 +3584,10 @@ declare module "sharepoint/rest/search" { * Custom tags that identify the query. You can specify multiple query tags */ QueryTag?: string[]; + /** + * Properties to be used to configure the search query + */ + Properties?: SearchProperty[]; /** * A Boolean value that specifies whether to return personal favorites with the search results. */ @@ -3521,7 +3649,7 @@ declare module "sharepoint/rest/search" { * ....... * @returns Promise */ - execute(query: SearchQuery): Promise; + execute(query: SearchQuery): Promise; } /** * Describes the SearchResults class, which returns the formatted and raw version of the query response @@ -3568,6 +3696,20 @@ declare module "sharepoint/rest/search" { */ Direction: SortDirection; } + /** + * Defines one search property + */ + export interface SearchProperty { + Name: string; + Value: SearchPropertyValue; + } + /** + * Defines one search property value + */ + export interface SearchPropertyValue { + StrVal: string; + QueryPropertyValueTypeIndex: QueryPropertyValueType; + } /** * defines the SortDirection enum */ @@ -3607,11 +3749,6 @@ declare module "sharepoint/rest/search" { ResultHasTag = 7, ManualCondition = 8, } - /** - * Defines how search results are sorted. - */ - export interface QueryProperty { - } /** * Specifies the type value for the property */ @@ -3624,11 +3761,86 @@ declare module "sharepoint/rest/search" { UnSupportedType = 5, } } +declare module "sharepoint/rest/searchsuggest" { + import { Queryable, QueryableInstance } from "sharepoint/rest/queryable"; + /** + * Defines a query execute against the search/suggest endpoint (see https://msdn.microsoft.com/en-us/library/office/dn194079.aspx) + */ + export interface SearchSuggestQuery { + /** + * A string that contains the text for the search query. + */ + querytext: string; + /** + * The number of query suggestions to retrieve. Must be greater than zero (0). The default value is 5. + */ + count?: number; + /** + * The number of personal results to retrieve. Must be greater than zero (0). The default value is 5. + */ + personalCount?: number; + /** + * A Boolean value that specifies whether to retrieve pre-query or post-query suggestions. true to return pre-query suggestions; otherwise, false. The default value is false. + */ + preQuery?: boolean; + /** + * A Boolean value that specifies whether to hit-highlight or format in bold the query suggestions. true to format in bold the terms in the returned query suggestions + * that match terms in the specified query; otherwise, false. The default value is true. + */ + hitHighlighting?: boolean; + /** + * A Boolean value that specifies whether to capitalize the first letter in each term in the returned query suggestions. true to capitalize the first letter in each term; + * otherwise, false. The default value is false. + */ + capitalize?: boolean; + /** + * The locale ID (LCID) for the query (see https://msdn.microsoft.com/en-us/library/cc233982.aspx). + */ + culture?: string; + /** + * A Boolean value that specifies whether stemming is enabled. true to enable stemming; otherwise, false. The default value is true. + */ + stemming?: boolean; + /** + * A Boolean value that specifies whether to include people names in the returned query suggestions. true to include people names in the returned query suggestions; + * otherwise, false. The default value is true. + */ + includePeople?: boolean; + /** + * A Boolean value that specifies whether to turn on query rules for this query. true to turn on query rules; otherwise, false. The default value is true. + */ + queryRules?: boolean; + /** + * A Boolean value that specifies whether to return query suggestions for prefix matches. true to return query suggestions based on prefix matches, otherwise, false when + * query suggestions should match the full query word. + */ + prefixMatch?: boolean; + } + export class SearchSuggest extends QueryableInstance { + constructor(baseUrl: string | Queryable, path?: string); + execute(query: SearchSuggestQuery): Promise; + private mapQueryToQueryString(query); + } + export class SearchSuggestResult { + PeopleNames: string[]; + PersonalResults: PersonalResultSuggestion[]; + Queries: any[]; + constructor(json: any); + } + export interface PersonalResultSuggestion { + HighlightedTitle?: string; + IsBestBet?: boolean; + Title?: string; + TypeId?: string; + Url?: string; + } +} declare module "sharepoint/rest/site" { import { Queryable, QueryableInstance } from "sharepoint/rest/queryable"; import { Web } from "sharepoint/rest/webs"; import { UserCustomActions } from "sharepoint/rest/usercustomactions"; import { ContextInfo, DocumentLibraryInformation } from "sharepoint/rest/types"; + import { ODataBatch } from "sharepoint/rest/odata"; /** * Describes a site collection * @@ -3666,6 +3878,11 @@ declare module "sharepoint/rest/site" { * @param absolutePageUrl The absolute url of the page */ getWebUrlFromPageUrl(absolutePageUrl: string): Promise; + /** + * Creates a new batch for requests within the context of context this site + * + */ + createBatch(): ODataBatch; } } declare module "utils/files" { @@ -3803,7 +4020,8 @@ declare module "sharepoint/rest/userprofiles" { } } declare module "sharepoint/rest/rest" { - import { SearchQuery, SearchResult } from "sharepoint/rest/search"; + import { SearchQuery, SearchResults } from "sharepoint/rest/search"; + import { SearchSuggestQuery, SearchSuggestResult } from "sharepoint/rest/searchsuggest"; import { Site } from "sharepoint/rest/site"; import { Web } from "sharepoint/rest/webs"; import { UserProfileQuery } from "sharepoint/rest/userprofiles"; @@ -3817,7 +4035,13 @@ declare module "sharepoint/rest/rest" { * * @param query The SearchQuery definition */ - search(query: string | SearchQuery): Promise; + searchSuggest(query: string | SearchSuggestQuery): Promise; + /** + * Executes a search against this web context + * + * @param query The SearchQuery definition + */ + search(query: string | SearchQuery): Promise; /** * Begins a site collection scoped REST request * @@ -3866,16 +4090,18 @@ declare module "sharepoint/rest/rest" { declare module "sharepoint/rest/index" { export * from "sharepoint/rest/caching"; export { FieldAddResult, FieldUpdateResult } from "sharepoint/rest/fields"; - export { CheckinType, FileAddResult, WebPartsPersonalizationScope, MoveOperations, TemplateFileType } from "sharepoint/rest/files"; + export { CheckinType, FileAddResult, WebPartsPersonalizationScope, MoveOperations, TemplateFileType, TextFileParser, BlobFileParser, BufferFileParser, ChunkedFileUploadProgressData } from "sharepoint/rest/files"; export { FolderAddResult } from "sharepoint/rest/folders"; export { ItemAddResult, ItemUpdateResult, PagedItemCollection } from "sharepoint/rest/items"; export { ListAddResult, ListUpdateResult, ListEnsureResult } from "sharepoint/rest/lists"; export { extractOdataId, ODataParser, ODataParserBase, ODataDefaultParser, ODataRaw, ODataValue, ODataEntity, ODataEntityArray } from "sharepoint/rest/odata"; export { RoleDefinitionUpdateResult, RoleDefinitionAddResult, RoleDefinitionBindings } from "sharepoint/rest/roles"; - export { SearchQuery, SearchResult, Sort, SortDirection, ReorderingRule, ReorderingRuleMatchType, QueryPropertyValueType } from "sharepoint/rest/search"; + export { Search, SearchProperty, SearchPropertyValue, SearchQuery, SearchResult, SearchResults, Sort, SortDirection, ReorderingRule, ReorderingRuleMatchType, QueryPropertyValueType } from "sharepoint/rest/search"; + export { SearchSuggest, SearchSuggestQuery, SearchSuggestResult, PersonalResultSuggestion } from "sharepoint/rest/searchsuggest"; export { Site } from "sharepoint/rest/site"; export { SiteGroupAddResult } from "sharepoint/rest/sitegroups"; export { UserUpdateResult, UserProps } from "sharepoint/rest/siteusers"; + export { SubscriptionAddResult, SubscriptionUpdateResult } from "sharepoint/rest/subscriptions"; export * from "sharepoint/rest/types"; export { UserCustomActionAddResult, UserCustomActionUpdateResult } from "sharepoint/rest/usercustomactions"; export { ViewAddResult, ViewUpdateResult } from "sharepoint/rest/views"; diff --git a/dist/pnp.js b/dist/pnp.js index 4be1f793..862af81c 100644 --- a/dist/pnp.js +++ b/dist/pnp.js @@ -1,10 +1,10 @@ /** - * sp-pnp-js v1.0.5 - A reusable JavaScript library targeting SharePoint client-side development. + * sp-pnp-js v1.0.6 - A reusable JavaScript library targeting SharePoint client-side development. * MIT (https://github.com/OfficeDev/PnP-JS-Core/blob/master/LICENSE) * Copyright (c) 2016 Microsoft * docs: http://officedev.github.io/PnP-JS-Core - * source: https://github.com/OfficeDev/PnP-JS-Core - * bugs: https://github.com/OfficeDev/PnP-JS-Core/issues + * source: https://github.com/SharePoint/PnP-JS-Core + * bugs: https://github.com/SharePoint/PnP-JS-Core/issues */ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.$pnp = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o 0) { - setTimeout(function () { return _this.execute(); }, 100); - } - else { - _this.executeImpl().then(function () { return resolve(); }).catch(reject); - } - }); + return this._batchDependencies.then(function () { return _this.executeImpl(); }); }; ODataBatch.prototype.executeImpl = function () { var _this = this; if (this._requests.length < 1) { - return new Promise(function (r) { return r(); }); + return Promise.resolve(); } var batchBody = []; var currentChangeSetId = ""; @@ -2049,23 +2179,27 @@ var ODataBatch = (function () { "headers": batchHeaders, }; var client = new httpclient_1.HttpClient(); - return client.post(util_1.Util.makeUrlAbsolute("/_api/$batch"), batchOptions) + var requestUrl = util_1.Util.makeUrlAbsolute(util_1.Util.combinePaths(this.baseUrl, "/_api/$batch")); + return client.post(requestUrl, batchOptions) .then(function (r) { return r.text(); }) .then(this._parseResponse) .then(function (responses) { if (responses.length !== _this._requests.length) { throw new Error("Could not properly parse responses to match requests in batch."); } - var resolutions = []; - for (var i = 0; i < responses.length; i++) { + var chain = Promise.resolve(); + var _loop_1 = function(i) { var request = _this._requests[i]; var response = responses[i]; if (!response.ok) { request.reject(new Error(response.statusText)); } - resolutions.push(request.parser.parse(response).then(request.resolve).catch(request.reject)); + chain = chain.then(function (_) { return request.parser.parse(response).then(request.resolve).catch(request.reject); }); + }; + for (var i = 0; i < responses.length; i++) { + _loop_1(i); } - return Promise.all(resolutions); + return chain; }); }; ODataBatch.prototype._parseResponse = function (body) { @@ -2132,7 +2266,7 @@ var ODataBatch = (function () { }()); exports.ODataBatch = ODataBatch; -},{"../../configuration/pnplibconfig":3,"../../net/httpclient":9,"../../utils/logging":41,"../../utils/util":43}],24:[function(require,module,exports){ +},{"../../configuration/pnplibconfig":3,"../../net/httpclient":9,"../../utils/logging":43,"../../utils/util":45}],24:[function(require,module,exports){ "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; @@ -2140,6 +2274,7 @@ var __extends = (this && this.__extends) || function (d, b) { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var util_1 = require("../../utils/util"); +var logging_1 = require("../../utils/logging"); var collections_1 = require("../../collections/collections"); var httpclient_1 = require("../../net/httpclient"); var odata_1 = require("./odata"); @@ -2151,7 +2286,7 @@ var Queryable = (function () { this._batch = null; if (typeof baseUrl === "string") { var urlStr = baseUrl; - if (urlStr.lastIndexOf("/") < 0) { + if (util_1.Util.isUrlAbsolute(urlStr) || urlStr.lastIndexOf("/") < 0) { this._parentUrl = urlStr; this._url = util_1.Util.combinePaths(urlStr, path); } @@ -2170,9 +2305,6 @@ var Queryable = (function () { else { var q = baseUrl; this._parentUrl = q._url; - if (!this.hasBatch && q.hasBatch) { - this._batch = q._batch; - } var target = q._query.get("@target"); if (target !== null) { this._query.add("@target", target); @@ -2187,14 +2319,10 @@ var Queryable = (function () { this._url = util_1.Util.combinePaths(this._url, pathPart); }; Queryable.prototype.addBatchDependency = function () { - if (this._batch !== null) { - this._batch.incrementBatchDep(); - } - }; - Queryable.prototype.clearBatchDependency = function () { - if (this._batch !== null) { - this._batch.decrementBatchDep(); + if (this.hasBatch) { + return this._batch.addBatchDependency(); } + return function () { return null; }; }; Object.defineProperty(Queryable.prototype, "hasBatch", { get: function () { @@ -2264,6 +2392,16 @@ var Queryable = (function () { if (parser === void 0) { parser = new odata_1.ODataDefaultParser(); } return this.postImpl(postOptions, parser); }; + Queryable.prototype.patch = function (patchOptions, parser) { + if (patchOptions === void 0) { patchOptions = {}; } + if (parser === void 0) { parser = new odata_1.ODataDefaultParser(); } + return this.patchImpl(patchOptions, parser); + }; + Queryable.prototype.delete = function (deleteOptions, parser) { + if (deleteOptions === void 0) { deleteOptions = {}; } + if (parser === void 0) { parser = new odata_1.ODataDefaultParser(); } + return this.deleteImpl(deleteOptions, parser); + }; Queryable.prototype.getParent = function (factory, baseUrl, path) { if (baseUrl === void 0) { baseUrl = this.parentUrl; } var parent = new factory(baseUrl, path); @@ -2274,6 +2412,7 @@ var Queryable = (function () { return parent; }; Queryable.prototype.getImpl = function (getOptions, parser) { + var _this = this; if (getOptions === void 0) { getOptions = {}; } if (this._useCaching) { var options = new caching_1.CachingOptions(this.toUrlAndQuery().toLowerCase()); @@ -2288,37 +2427,69 @@ var Queryable = (function () { } parser = new caching_1.CachingParserWrapper(parser, options); } - if (this._batch === null) { + if (!this.hasBatch) { var client = new httpclient_1.HttpClient(); return client.get(this.toUrlAndQuery(), getOptions).then(function (response) { - if (!response.ok) { - throw "Error making GET request: " + response.statusText; - } - return parser.parse(response); + return _this.processHttpClientResponse(response, parser); }); } else { - return this._batch.add(this.toUrlAndQuery(), "GET", {}, parser); + return this._batch.add(this.toUrlAndQuery(), "GET", getOptions, parser); } }; Queryable.prototype.postImpl = function (postOptions, parser) { - if (this._batch === null) { + var _this = this; + if (!this.hasBatch) { var client = new httpclient_1.HttpClient(); return client.post(this.toUrlAndQuery(), postOptions).then(function (response) { - if (!response.ok) { - throw "Error making POST request: " + response.statusText; - } - if ((response.headers.has("Content-Length") && parseFloat(response.headers.get("Content-Length")) === 0) - || response.status === 204) { - return new Promise(function (resolve, reject) { resolve({}); }); - } - return parser.parse(response); + return _this.processHttpClientResponse(response, parser); }); } else { return this._batch.add(this.toUrlAndQuery(), "POST", postOptions, parser); } }; + Queryable.prototype.patchImpl = function (patchOptions, parser) { + var _this = this; + if (!this.hasBatch) { + var client = new httpclient_1.HttpClient(); + return client.patch(this.toUrlAndQuery(), patchOptions).then(function (response) { + return _this.processHttpClientResponse(response, parser); + }); + } + else { + return this._batch.add(this.toUrlAndQuery(), "PATCH", patchOptions, parser); + } + }; + Queryable.prototype.deleteImpl = function (deleteOptions, parser) { + var _this = this; + if (!this.hasBatch) { + var client = new httpclient_1.HttpClient(); + return client.delete(this.toUrlAndQuery(), deleteOptions).then(function (response) { + return _this.processHttpClientResponse(response, parser); + }); + } + else { + return this._batch.add(this.toUrlAndQuery(), "DELETE", deleteOptions, parser); + } + }; + Queryable.prototype.processHttpClientResponse = function (response, parser) { + if (!response.ok) { + response.text().then(function (text) { + logging_1.Logger.log({ + data: response, + level: logging_1.LogLevel.Error, + message: text, + }); + throw "Error making HttpClient request in queryable: " + response.statusText; + }); + } + if ((response.headers.has("Content-Length") && parseFloat(response.headers.get("Content-Length")) === 0) + || response.status === 204) { + return new Promise(function (resolve, reject) { resolve({}); }); + } + return parser.parse(response); + }; return Queryable; }()); exports.Queryable = Queryable; @@ -2398,7 +2569,7 @@ var QueryableInstance = (function (_super) { }(Queryable)); exports.QueryableInstance = QueryableInstance; -},{"../../collections/collections":1,"../../configuration/pnplibconfig":3,"../../net/httpclient":9,"../../utils/util":43,"./caching":13,"./odata":23}],25:[function(require,module,exports){ +},{"../../collections/collections":1,"../../configuration/pnplibconfig":3,"../../net/httpclient":9,"../../utils/logging":43,"../../utils/util":45,"./caching":13,"./odata":23}],25:[function(require,module,exports){ "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; @@ -2486,14 +2657,24 @@ exports.QuickLaunch = QuickLaunch; },{"./queryable":24}],27:[function(require,module,exports){ "use strict"; var search_1 = require("./search"); +var searchsuggest_1 = require("./searchsuggest"); var site_1 = require("./site"); var webs_1 = require("./webs"); var util_1 = require("../../utils/util"); var userprofiles_1 = require("./userprofiles"); -var odata_1 = require("./odata"); var Rest = (function () { function Rest() { } + Rest.prototype.searchSuggest = function (query) { + var finalQuery; + if (typeof query === "string") { + finalQuery = { querytext: query }; + } + else { + finalQuery = query; + } + return new searchsuggest_1.SearchSuggest("").execute(finalQuery); + }; Rest.prototype.search = function (query) { var finalQuery; if (typeof query === "string") { @@ -2526,7 +2707,7 @@ var Rest = (function () { configurable: true }); Rest.prototype.createBatch = function () { - return new odata_1.ODataBatch(); + return this.web.createBatch(); }; Rest.prototype.crossDomainSite = function (addInWebUrl, hostWebUrl) { return this._cdImpl(site_1.Site, addInWebUrl, hostWebUrl, "site"); @@ -2550,7 +2731,7 @@ var Rest = (function () { }()); exports.Rest = Rest; -},{"../../utils/util":43,"./odata":23,"./search":29,"./site":30,"./userprofiles":36,"./webs":38}],28:[function(require,module,exports){ +},{"../../utils/util":45,"./search":29,"./searchsuggest":30,"./site":31,"./userprofiles":38,"./webs":40}],28:[function(require,module,exports){ "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; @@ -2695,7 +2876,7 @@ var RoleDefinitionBindings = (function (_super) { }(queryable_1.QueryableCollection)); exports.RoleDefinitionBindings = RoleDefinitionBindings; -},{"../../utils/util":43,"./queryable":24,"./sitegroups":31}],29:[function(require,module,exports){ +},{"../../utils/util":45,"./queryable":24,"./sitegroups":32}],29:[function(require,module,exports){ "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; @@ -2703,6 +2884,7 @@ var __extends = (this && this.__extends) || function (d, b) { d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var queryable_1 = require("./queryable"); +var util_1 = require("../../utils/util"); var Search = (function (_super) { __extends(Search, _super); function Search(baseUrl, path) { @@ -2718,9 +2900,6 @@ var Search = (function (_super) { if (formattedBody.RefinementFilters) { formattedBody.RefinementFilters = { results: query.RefinementFilters }; } - if (formattedBody.Refiners) { - formattedBody.Refiners = { results: query.Refiners }; - } if (formattedBody.SortList) { formattedBody.SortList = { results: query.SortList }; } @@ -2730,7 +2909,14 @@ var Search = (function (_super) { if (formattedBody.ReorderingRules) { formattedBody.ReorderingRules = { results: query.ReorderingRules }; } - var postBody = JSON.stringify({ request: formattedBody }); + 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; @@ -2796,7 +2982,78 @@ var ReorderingRuleMatchType = exports.ReorderingRuleMatchType; })(exports.QueryPropertyValueType || (exports.QueryPropertyValueType = {})); var QueryPropertyValueType = exports.QueryPropertyValueType; -},{"./queryable":24}],30:[function(require,module,exports){ +},{"../../utils/util":45,"./queryable":24}],30:[function(require,module,exports){ +"use strict"; +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var queryable_1 = require("./queryable"); +var SearchSuggest = (function (_super) { + __extends(SearchSuggest, _super); + function SearchSuggest(baseUrl, path) { + if (path === void 0) { path = "_api/search/suggest"; } + _super.call(this, baseUrl, path); + } + 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")) { + 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; + +},{"./queryable":24}],31:[function(require,module,exports){ "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; @@ -2806,6 +3063,7 @@ var __extends = (this && this.__extends) || function (d, b) { var queryable_1 = require("./queryable"); var webs_1 = require("./webs"); var usercustomactions_1 = require("./usercustomactions"); +var odata_1 = require("./odata"); var Site = (function (_super) { __extends(Site, _super); function Site(baseUrl, path) { @@ -2863,11 +3121,14 @@ var Site = (function (_super) { } }); }; + Site.prototype.createBatch = function () { + return new odata_1.ODataBatch(this.parentUrl); + }; return Site; }(queryable_1.QueryableInstance)); exports.Site = Site; -},{"./queryable":24,"./usercustomactions":35,"./webs":38}],31:[function(require,module,exports){ +},{"./odata":23,"./queryable":24,"./usercustomactions":37,"./webs":40}],32:[function(require,module,exports){ "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; @@ -2956,7 +3217,7 @@ var SiteGroup = (function (_super) { }(queryable_1.QueryableInstance)); exports.SiteGroup = SiteGroup; -},{"../../utils/util":43,"./queryable":24,"./siteusers":32}],32:[function(require,module,exports){ +},{"../../utils/util":45,"./queryable":24,"./siteusers":33}],33:[function(require,module,exports){ "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; @@ -3039,7 +3300,62 @@ var SiteUser = (function (_super) { }(queryable_1.QueryableInstance)); exports.SiteUser = SiteUser; -},{"../../utils/util":43,"./queryable":24,"./sitegroups":31}],33:[function(require,module,exports){ +},{"../../utils/util":45,"./queryable":24,"./sitegroups":32}],34:[function(require,module,exports){ +"use strict"; +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var queryable_1 = require("./queryable"); +var Subscriptions = (function (_super) { + __extends(Subscriptions, _super); + function Subscriptions(baseUrl, path) { + if (path === void 0) { path = "subscriptions"; } + _super.call(this, baseUrl, path); + } + Subscriptions.prototype.getById = function (subscriptionId) { + var subscription = new Subscription(this); + subscription.concat("('" + subscriptionId + "')"); + return subscription; + }; + Subscriptions.prototype.add = function (notificationUrl, expirationDate, clientState) { + var _this = this; + var postBody = JSON.stringify({ + "resource": this.toUrl(), + "notificationUrl": notificationUrl, + "expirationDateTime": expirationDate, + "clientState": clientState || "pnp-js-core-subscription", + }); + 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; +var Subscription = (function (_super) { + __extends(Subscription, _super); + function Subscription(baseUrl, path) { + _super.call(this, baseUrl, path); + } + 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 }; + }); + }; + Subscription.prototype.delete = function () { + return _super.prototype.delete.call(this); + }; + return Subscription; +}(queryable_1.QueryableInstance)); +exports.Subscription = Subscription; + +},{"./queryable":24}],35:[function(require,module,exports){ "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; @@ -3056,7 +3372,7 @@ var TopNavigationBar = (function (_super) { }(queryable_1.QueryableInstance)); exports.TopNavigationBar = TopNavigationBar; -},{"./queryable":24}],34:[function(require,module,exports){ +},{"./queryable":24}],36:[function(require,module,exports){ "use strict"; (function (ControlMode) { ControlMode[ControlMode["Display"] = 1] = "Display"; @@ -3162,7 +3478,7 @@ var PrincipalType = exports.PrincipalType; })(exports.PageType || (exports.PageType = {})); var PageType = exports.PageType; -},{}],35:[function(require,module,exports){ +},{}],37:[function(require,module,exports){ "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; @@ -3223,7 +3539,7 @@ var UserCustomAction = (function (_super) { }(queryable_1.QueryableInstance)); exports.UserCustomAction = UserCustomAction; -},{"../../utils/util":43,"./queryable":24}],36:[function(require,module,exports){ +},{"../../utils/util":45,"./queryable":24}],38:[function(require,module,exports){ "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; @@ -3407,7 +3723,7 @@ var ProfileLoader = (function (_super) { return ProfileLoader; }(queryable_1.Queryable)); -},{"../../utils/files":40,"./odata":23,"./queryable":24}],37:[function(require,module,exports){ +},{"../../utils/files":42,"./odata":23,"./queryable":24}],39:[function(require,module,exports){ "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; @@ -3522,7 +3838,7 @@ var ViewFields = (function (_super) { }(queryable_1.QueryableCollection)); exports.ViewFields = ViewFields; -},{"../../utils/util":43,"./queryable":24}],38:[function(require,module,exports){ +},{"../../utils/util":45,"./queryable":24}],40:[function(require,module,exports){ "use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; @@ -3663,6 +3979,9 @@ var Web = (function (_super) { enumerable: true, configurable: true }); + Web.prototype.createBatch = function () { + return new odata_1.ODataBatch(this.parentUrl); + }; Web.prototype.getFolderByServerRelativeUrl = function (folderRelativeUrl) { return new folders_1.Folder(this, "getFolderByServerRelativeUrl('" + folderRelativeUrl + "')"); }; @@ -3762,7 +4081,7 @@ var Web = (function (_super) { }(queryablesecurable_1.QueryableSecurable)); exports.Web = Web; -},{"../../utils/util":43,"./contenttypes":14,"./fields":15,"./files":16,"./folders":17,"./lists":21,"./navigation":22,"./odata":23,"./queryable":24,"./queryablesecurable":25,"./roles":28,"./sitegroups":31,"./siteusers":32,"./usercustomactions":35}],39:[function(require,module,exports){ +},{"../../utils/util":45,"./contenttypes":14,"./fields":15,"./files":16,"./folders":17,"./lists":21,"./navigation":22,"./odata":23,"./queryable":24,"./queryablesecurable":25,"./roles":28,"./sitegroups":32,"./siteusers":33,"./usercustomactions":37}],41:[function(require,module,exports){ "use strict"; function __export(m) { for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; @@ -3776,7 +4095,7 @@ var util_1 = require("../utils/util"); exports.Util = util_1.Util; __export(require("../utils/logging")); -},{"../collections/collections":1,"../net/httpclient":9,"../sharepoint/rest/index":19,"../utils/logging":41,"../utils/util":43}],40:[function(require,module,exports){ +},{"../collections/collections":1,"../net/httpclient":9,"../sharepoint/rest/index":19,"../utils/logging":43,"../utils/util":45}],42:[function(require,module,exports){ "use strict"; function readBlobAsText(blob) { return readBlobAs(blob, "string"); @@ -3803,7 +4122,7 @@ function readBlobAs(blob, mode) { }); } -},{}],41:[function(require,module,exports){ +},{}],43:[function(require,module,exports){ "use strict"; (function (LogLevel) { LogLevel[LogLevel["Verbose"] = 0] = "Verbose"; @@ -3987,7 +4306,7 @@ var FunctionListener = (function () { }()); exports.FunctionListener = FunctionListener; -},{}],42:[function(require,module,exports){ +},{}],44:[function(require,module,exports){ "use strict"; var util_1 = require("./util"); var PnPClientStorageWrapper = (function () { @@ -4036,7 +4355,7 @@ var PnPClientStorageWrapper = (function () { var o = _this.get(key); if (o == null) { getter().then(function (d) { - _this.put(key, d); + _this.put(key, d, expire); resolve(d); }); } @@ -4074,7 +4393,7 @@ var PnPClientStorage = (function () { }()); exports.PnPClientStorage = PnPClientStorage; -},{"./util":43}],43:[function(require,module,exports){ +},{"./util":45}],45:[function(require,module,exports){ (function (global){ "use strict"; var Util = (function () { diff --git a/dist/pnp.js.map b/dist/pnp.js.map index 01edbc5a..ecaeab6c 100644 --- a/dist/pnp.js.map +++ b/dist/pnp.js.map @@ -1 +1 @@ -{"version":3,"sources":["node_modules/browserify/node_modules/browser-pack/_prelude.js","build/src/collections/collections.js","build/src/configuration/configuration.js","build/src/configuration/pnplibconfig.js","build/src/configuration/providers/cachingConfigurationProvider.js","build/src/configuration/providers/providers.js","build/src/configuration/providers/spListConfigurationProvider.js","build/src/net/digestcache.js","build/src/net/fetchclient.js","build/src/net/httpclient.js","build/src/net/nodefetchclientbrowser.js","build/src/net/sprequestexecutorclient.js","build/src/pnp.js","build/src/sharepoint/rest/caching.js","build/src/sharepoint/rest/contenttypes.js","build/src/sharepoint/rest/fields.js","build/src/sharepoint/rest/files.js","build/src/sharepoint/rest/folders.js","build/src/sharepoint/rest/forms.js","build/src/sharepoint/rest/index.js","build/src/sharepoint/rest/items.js","build/src/sharepoint/rest/lists.js","build/src/sharepoint/rest/navigation.js","build/src/sharepoint/rest/odata.js","build/src/sharepoint/rest/queryable.js","build/src/sharepoint/rest/queryablesecurable.js","build/src/sharepoint/rest/quicklaunch.js","build/src/sharepoint/rest/rest.js","build/src/sharepoint/rest/roles.js","build/src/sharepoint/rest/search.js","build/src/sharepoint/rest/site.js","build/src/sharepoint/rest/sitegroups.js","build/src/sharepoint/rest/siteusers.js","build/src/sharepoint/rest/topnavigationbar.js","build/src/sharepoint/rest/types.js","build/src/sharepoint/rest/usercustomactions.js","build/src/sharepoint/rest/userprofiles.js","build/src/sharepoint/rest/views.js","build/src/sharepoint/rest/webs.js","build/src/types/index.js","build/src/utils/files.js","build/src/utils/logging.js","build/src/utils/storage.js","build/src/utils/util.js"],"names":[],"mappings":";;;;;;;;AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AClDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AC5FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1CA;AACA;AACA;AACA;AACA;AACA;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;ACtDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9MA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5QA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9OA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;ACrFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"pnp.js","sourcesContent":["(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o -1) {\n this.values[index] = o;\n }\n else {\n this.keys.push(key);\n this.values.push(o);\n }\n };\n Dictionary.prototype.merge = function (source) {\n if (util_1.Util.isFunction(source[\"getKeys\"])) {\n var sourceAsDictionary = source;\n var keys = sourceAsDictionary.getKeys();\n var l = keys.length;\n for (var i = 0; i < l; i++) {\n this.add(keys[i], sourceAsDictionary.get(keys[i]));\n }\n }\n else {\n var sourceAsHash = source;\n for (var key in sourceAsHash) {\n if (sourceAsHash.hasOwnProperty(key)) {\n this.add(key, source[key]);\n }\n }\n }\n };\n Dictionary.prototype.remove = function (key) {\n var index = this.keys.indexOf(key);\n if (index < 0) {\n return null;\n }\n var val = this.values[index];\n this.keys.splice(index, 1);\n this.values.splice(index, 1);\n return val;\n };\n Dictionary.prototype.getKeys = function () {\n return this.keys;\n };\n Dictionary.prototype.getValues = function () {\n return this.values;\n };\n Dictionary.prototype.clear = function () {\n this.keys = [];\n this.values = [];\n };\n Dictionary.prototype.count = function () {\n return this.keys.length;\n };\n return Dictionary;\n}());\nexports.Dictionary = Dictionary;\n","\"use strict\";\nvar Collections = require(\"../collections/collections\");\nvar providers = require(\"./providers/providers\");\nvar Settings = (function () {\n function Settings() {\n this.Providers = providers;\n this._settings = new Collections.Dictionary();\n }\n Settings.prototype.add = function (key, value) {\n this._settings.add(key, value);\n };\n Settings.prototype.addJSON = function (key, value) {\n this._settings.add(key, JSON.stringify(value));\n };\n Settings.prototype.apply = function (hash) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n try {\n _this._settings.merge(hash);\n resolve();\n }\n catch (e) {\n reject(e);\n }\n });\n };\n Settings.prototype.load = function (provider) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n provider.getConfiguration().then(function (value) {\n _this._settings.merge(value);\n resolve();\n }).catch(function (reason) {\n reject(reason);\n });\n });\n };\n Settings.prototype.get = function (key) {\n return this._settings.get(key);\n };\n Settings.prototype.getJSON = function (key) {\n var o = this.get(key);\n if (typeof o === \"undefined\" || o === null) {\n return o;\n }\n return JSON.parse(o);\n };\n return Settings;\n}());\nexports.Settings = Settings;\n","\"use strict\";\nvar RuntimeConfigImpl = (function () {\n function RuntimeConfigImpl() {\n this._headers = null;\n this._defaultCachingStore = \"session\";\n this._defaultCachingTimeoutSeconds = 30;\n this._globalCacheDisable = false;\n this._useSPRequestExecutor = false;\n }\n RuntimeConfigImpl.prototype.set = function (config) {\n if (config.hasOwnProperty(\"headers\")) {\n this._headers = config.headers;\n }\n if (config.hasOwnProperty(\"globalCacheDisable\")) {\n this._globalCacheDisable = config.globalCacheDisable;\n }\n if (config.hasOwnProperty(\"defaultCachingStore\")) {\n this._defaultCachingStore = config.defaultCachingStore;\n }\n if (config.hasOwnProperty(\"defaultCachingTimeoutSeconds\")) {\n this._defaultCachingTimeoutSeconds = config.defaultCachingTimeoutSeconds;\n }\n if (config.hasOwnProperty(\"useSPRequestExecutor\")) {\n this._useSPRequestExecutor = config.useSPRequestExecutor;\n }\n if (config.hasOwnProperty(\"nodeClientOptions\")) {\n this._useNodeClient = true;\n this._useSPRequestExecutor = false;\n this._nodeClientData = config.nodeClientOptions;\n global._spPageContextInfo = {\n webAbsoluteUrl: config.nodeClientOptions.siteUrl,\n };\n }\n };\n Object.defineProperty(RuntimeConfigImpl.prototype, \"headers\", {\n get: function () {\n return this._headers;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RuntimeConfigImpl.prototype, \"defaultCachingStore\", {\n get: function () {\n return this._defaultCachingStore;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RuntimeConfigImpl.prototype, \"defaultCachingTimeoutSeconds\", {\n get: function () {\n return this._defaultCachingTimeoutSeconds;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RuntimeConfigImpl.prototype, \"globalCacheDisable\", {\n get: function () {\n return this._globalCacheDisable;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RuntimeConfigImpl.prototype, \"useSPRequestExecutor\", {\n get: function () {\n return this._useSPRequestExecutor;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RuntimeConfigImpl.prototype, \"useNodeFetchClient\", {\n get: function () {\n return this._useNodeClient;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RuntimeConfigImpl.prototype, \"nodeRequestOptions\", {\n get: function () {\n return this._nodeClientData;\n },\n enumerable: true,\n configurable: true\n });\n return RuntimeConfigImpl;\n}());\nexports.RuntimeConfigImpl = RuntimeConfigImpl;\nvar _runtimeConfig = new RuntimeConfigImpl();\nexports.RuntimeConfig = _runtimeConfig;\nfunction setRuntimeConfig(config) {\n _runtimeConfig.set(config);\n}\nexports.setRuntimeConfig = setRuntimeConfig;\n","\"use strict\";\nvar storage = require(\"../../utils/storage\");\nvar CachingConfigurationProvider = (function () {\n function CachingConfigurationProvider(wrappedProvider, cacheKey, cacheStore) {\n this.wrappedProvider = wrappedProvider;\n this.store = (cacheStore) ? cacheStore : this.selectPnPCache();\n this.cacheKey = \"_configcache_\" + cacheKey;\n }\n CachingConfigurationProvider.prototype.getWrappedProvider = function () {\n return this.wrappedProvider;\n };\n CachingConfigurationProvider.prototype.getConfiguration = function () {\n var _this = this;\n if ((!this.store) || (!this.store.enabled)) {\n return this.wrappedProvider.getConfiguration();\n }\n var cachedConfig = this.store.get(this.cacheKey);\n if (cachedConfig) {\n return new Promise(function (resolve, reject) {\n resolve(cachedConfig);\n });\n }\n var providerPromise = this.wrappedProvider.getConfiguration();\n providerPromise.then(function (providedConfig) {\n _this.store.put(_this.cacheKey, providedConfig);\n });\n return providerPromise;\n };\n CachingConfigurationProvider.prototype.selectPnPCache = function () {\n var pnpCache = new storage.PnPClientStorage();\n if ((pnpCache.local) && (pnpCache.local.enabled)) {\n return pnpCache.local;\n }\n if ((pnpCache.session) && (pnpCache.session.enabled)) {\n return pnpCache.session;\n }\n throw new Error(\"Cannot create a caching configuration provider since cache is not available.\");\n };\n return CachingConfigurationProvider;\n}());\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = CachingConfigurationProvider;\n","\"use strict\";\nvar cachingConfigurationProvider_1 = require(\"./cachingConfigurationProvider\");\nvar spListConfigurationProvider_1 = require(\"./spListConfigurationProvider\");\nexports.CachingConfigurationProvider = cachingConfigurationProvider_1.default;\nexports.SPListConfigurationProvider = spListConfigurationProvider_1.default;\n","\"use strict\";\nvar cachingConfigurationProvider_1 = require(\"./cachingConfigurationProvider\");\nvar SPListConfigurationProvider = (function () {\n function SPListConfigurationProvider(sourceWeb, sourceListTitle) {\n if (sourceListTitle === void 0) { sourceListTitle = \"config\"; }\n this.sourceWeb = sourceWeb;\n this.sourceListTitle = sourceListTitle;\n }\n Object.defineProperty(SPListConfigurationProvider.prototype, \"web\", {\n get: function () {\n return this.sourceWeb;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SPListConfigurationProvider.prototype, \"listTitle\", {\n get: function () {\n return this.sourceListTitle;\n },\n enumerable: true,\n configurable: true\n });\n SPListConfigurationProvider.prototype.getConfiguration = function () {\n return this.web.lists.getByTitle(this.listTitle).items.select(\"Title\", \"Value\")\n .getAs().then(function (data) {\n var configuration = {};\n data.forEach(function (i) {\n configuration[i.Title] = i.Value;\n });\n return configuration;\n });\n };\n SPListConfigurationProvider.prototype.asCaching = function () {\n var cacheKey = \"splist_\" + this.web.toUrl() + \"+\" + this.listTitle;\n return new cachingConfigurationProvider_1.default(this, cacheKey);\n };\n return SPListConfigurationProvider;\n}());\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = SPListConfigurationProvider;\n","\"use strict\";\nvar collections_1 = require(\"../collections/collections\");\nvar util_1 = require(\"../utils/util\");\nvar odata_1 = require(\"../sharepoint/rest/odata\");\nvar CachedDigest = (function () {\n function CachedDigest() {\n }\n return CachedDigest;\n}());\nexports.CachedDigest = CachedDigest;\nvar DigestCache = (function () {\n function DigestCache(_httpClient, _digests) {\n if (_digests === void 0) { _digests = new collections_1.Dictionary(); }\n this._httpClient = _httpClient;\n this._digests = _digests;\n }\n DigestCache.prototype.getDigest = function (webUrl) {\n var self = this;\n var cachedDigest = this._digests.get(webUrl);\n if (cachedDigest !== null) {\n var now = new Date();\n if (now < cachedDigest.expiration) {\n return Promise.resolve(cachedDigest.value);\n }\n }\n var url = util_1.Util.combinePaths(webUrl, \"/_api/contextinfo\");\n return self._httpClient.fetchRaw(url, {\n cache: \"no-cache\",\n credentials: \"same-origin\",\n headers: {\n \"Accept\": \"application/json;odata=verbose\",\n \"Content-type\": \"application/json;odata=verbose;charset=utf-8\",\n },\n method: \"POST\",\n }).then(function (response) {\n var parser = new odata_1.ODataDefaultParser();\n return parser.parse(response).then(function (d) { return d.GetContextWebInformation; });\n }).then(function (data) {\n var newCachedDigest = new CachedDigest();\n newCachedDigest.value = data.FormDigestValue;\n var seconds = data.FormDigestTimeoutSeconds;\n var expiration = new Date();\n expiration.setTime(expiration.getTime() + 1000 * seconds);\n newCachedDigest.expiration = expiration;\n self._digests.add(webUrl, newCachedDigest);\n return newCachedDigest.value;\n });\n };\n DigestCache.prototype.clear = function () {\n this._digests.clear();\n };\n return DigestCache;\n}());\nexports.DigestCache = DigestCache;\n","\"use strict\";\nvar FetchClient = (function () {\n function FetchClient() {\n }\n FetchClient.prototype.fetch = function (url, options) {\n return global.fetch(url, options);\n };\n return FetchClient;\n}());\nexports.FetchClient = FetchClient;\n","\"use strict\";\nvar fetchclient_1 = require(\"./fetchclient\");\nvar digestcache_1 = require(\"./digestcache\");\nvar util_1 = require(\"../utils/util\");\nvar pnplibconfig_1 = require(\"../configuration/pnplibconfig\");\nvar sprequestexecutorclient_1 = require(\"./sprequestexecutorclient\");\nvar nodefetchclient_1 = require(\"./nodefetchclient\");\nvar HttpClient = (function () {\n function HttpClient() {\n this._impl = this.getFetchImpl();\n this._digestCache = new digestcache_1.DigestCache(this);\n }\n HttpClient.prototype.fetch = function (url, options) {\n if (options === void 0) { options = {}; }\n var self = this;\n var opts = util_1.Util.extend(options, { cache: \"no-cache\", credentials: \"same-origin\" }, true);\n var headers = new Headers();\n this.mergeHeaders(headers, pnplibconfig_1.RuntimeConfig.headers);\n this.mergeHeaders(headers, options.headers);\n if (!headers.has(\"Accept\")) {\n headers.append(\"Accept\", \"application/json\");\n }\n if (!headers.has(\"Content-Type\")) {\n headers.append(\"Content-Type\", \"application/json;odata=verbose;charset=utf-8\");\n }\n if (!headers.has(\"X-ClientService-ClientTag\")) {\n headers.append(\"X-ClientService-ClientTag\", \"PnPCoreJS:1.0.5\");\n }\n opts = util_1.Util.extend(opts, { headers: headers });\n if (opts.method && opts.method.toUpperCase() !== \"GET\") {\n if (!headers.has(\"X-RequestDigest\")) {\n var index = url.indexOf(\"_api/\");\n if (index < 0) {\n throw new Error(\"Unable to determine API url\");\n }\n var webUrl = url.substr(0, index);\n return this._digestCache.getDigest(webUrl)\n .then(function (digest) {\n headers.append(\"X-RequestDigest\", digest);\n return self.fetchRaw(url, opts);\n });\n }\n }\n return self.fetchRaw(url, opts);\n };\n HttpClient.prototype.fetchRaw = function (url, options) {\n var _this = this;\n if (options === void 0) { options = {}; }\n var rawHeaders = new Headers();\n this.mergeHeaders(rawHeaders, options.headers);\n options = util_1.Util.extend(options, { headers: rawHeaders });\n var retry = function (ctx) {\n _this._impl.fetch(url, options).then(function (response) { return ctx.resolve(response); }).catch(function (response) {\n var delay = ctx.delay;\n if (response.status !== 429 && response.status !== 503) {\n ctx.reject(response);\n }\n ctx.delay *= 2;\n ctx.attempts++;\n if (ctx.retryCount <= ctx.attempts) {\n ctx.reject(response);\n }\n setTimeout(util_1.Util.getCtxCallback(_this, retry, ctx), delay);\n });\n };\n return new Promise(function (resolve, reject) {\n var retryContext = {\n attempts: 0,\n delay: 100,\n reject: reject,\n resolve: resolve,\n retryCount: 7,\n };\n retry.call(_this, retryContext);\n });\n };\n HttpClient.prototype.get = function (url, options) {\n if (options === void 0) { options = {}; }\n var opts = util_1.Util.extend(options, { method: \"GET\" });\n return this.fetch(url, opts);\n };\n HttpClient.prototype.post = function (url, options) {\n if (options === void 0) { options = {}; }\n var opts = util_1.Util.extend(options, { method: \"POST\" });\n return this.fetch(url, opts);\n };\n HttpClient.prototype.getFetchImpl = function () {\n if (pnplibconfig_1.RuntimeConfig.useSPRequestExecutor) {\n return new sprequestexecutorclient_1.SPRequestExecutorClient();\n }\n else if (pnplibconfig_1.RuntimeConfig.useNodeFetchClient) {\n var opts = pnplibconfig_1.RuntimeConfig.nodeRequestOptions;\n return new nodefetchclient_1.NodeFetchClient(opts.siteUrl, opts.clientId, opts.clientSecret);\n }\n else {\n return new fetchclient_1.FetchClient();\n }\n };\n HttpClient.prototype.mergeHeaders = function (target, source) {\n if (typeof source !== \"undefined\" && source !== null) {\n var temp = new Request(\"\", { headers: source });\n temp.headers.forEach(function (value, name) {\n target.append(name, value);\n });\n }\n };\n return HttpClient;\n}());\nexports.HttpClient = HttpClient;\n","\"use strict\";\nvar NodeFetchClient = (function () {\n function NodeFetchClient(siteUrl, _clientId, _clientSecret, _realm) {\n if (_realm === void 0) { _realm = \"\"; }\n this.siteUrl = siteUrl;\n this._clientId = _clientId;\n this._clientSecret = _clientSecret;\n this._realm = _realm;\n }\n NodeFetchClient.prototype.fetch = function (url, options) {\n throw new Error(\"Using NodeFetchClient in the browser is not supported.\");\n };\n return NodeFetchClient;\n}());\nexports.NodeFetchClient = NodeFetchClient;\n","\"use strict\";\nvar util_1 = require(\"../utils/util\");\nvar SPRequestExecutorClient = (function () {\n function SPRequestExecutorClient() {\n this.convertToResponse = function (spResponse) {\n var responseHeaders = new Headers();\n for (var h in spResponse.headers) {\n if (spResponse.headers[h]) {\n responseHeaders.append(h, spResponse.headers[h]);\n }\n }\n return new Response(spResponse.body, {\n headers: responseHeaders,\n status: spResponse.statusCode,\n statusText: spResponse.statusText,\n });\n };\n }\n SPRequestExecutorClient.prototype.fetch = function (url, options) {\n var _this = this;\n if (typeof SP === \"undefined\" || typeof SP.RequestExecutor === \"undefined\") {\n throw new Error(\"SP.RequestExecutor is undefined. \" +\n \"Load the SP.RequestExecutor.js library (/_layouts/15/SP.RequestExecutor.js) before loading the PnP JS Core library.\");\n }\n var addinWebUrl = url.substring(0, url.indexOf(\"/_api\")), executor = new SP.RequestExecutor(addinWebUrl), headers = {}, iterator, temp;\n if (options.headers && options.headers instanceof Headers) {\n iterator = options.headers.entries();\n temp = iterator.next();\n while (!temp.done) {\n headers[temp.value[0]] = temp.value[1];\n temp = iterator.next();\n }\n }\n else {\n headers = options.headers;\n }\n return new Promise(function (resolve, reject) {\n var requestOptions = {\n error: function (error) {\n reject(_this.convertToResponse(error));\n },\n headers: headers,\n method: options.method,\n success: function (response) {\n resolve(_this.convertToResponse(response));\n },\n url: url,\n };\n if (options.body) {\n util_1.Util.extend(requestOptions, { body: options.body });\n }\n else {\n util_1.Util.extend(requestOptions, { binaryStringRequestBody: true });\n }\n executor.executeAsync(requestOptions);\n });\n };\n return SPRequestExecutorClient;\n}());\nexports.SPRequestExecutorClient = SPRequestExecutorClient;\n","\"use strict\";\nfunction __export(m) {\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\n}\nvar util_1 = require(\"./utils/util\");\nvar storage_1 = require(\"./utils/storage\");\nvar configuration_1 = require(\"./configuration/configuration\");\nvar logging_1 = require(\"./utils/logging\");\nvar rest_1 = require(\"./sharepoint/rest/rest\");\nvar pnplibconfig_1 = require(\"./configuration/pnplibconfig\");\nexports.util = util_1.Util;\nexports.sp = new rest_1.Rest();\nexports.storage = new storage_1.PnPClientStorage();\nexports.config = new configuration_1.Settings();\nexports.log = logging_1.Logger;\nexports.setup = pnplibconfig_1.setRuntimeConfig;\n__export(require(\"./types/index\"));\nvar Def = {\n config: exports.config,\n log: exports.log,\n setup: exports.setup,\n sp: exports.sp,\n storage: exports.storage,\n util: exports.util,\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = Def;\n","\"use strict\";\nvar storage_1 = require(\"../../utils/storage\");\nvar util_1 = require(\"../../utils/util\");\nvar pnplibconfig_1 = require(\"../../configuration/pnplibconfig\");\nvar CachingOptions = (function () {\n function CachingOptions(key) {\n this.key = key;\n this.expiration = util_1.Util.dateAdd(new Date(), \"second\", pnplibconfig_1.RuntimeConfig.defaultCachingTimeoutSeconds);\n this.storeName = pnplibconfig_1.RuntimeConfig.defaultCachingStore;\n }\n Object.defineProperty(CachingOptions.prototype, \"store\", {\n get: function () {\n if (this.storeName === \"local\") {\n return CachingOptions.storage.local;\n }\n else {\n return CachingOptions.storage.session;\n }\n },\n enumerable: true,\n configurable: true\n });\n CachingOptions.storage = new storage_1.PnPClientStorage();\n return CachingOptions;\n}());\nexports.CachingOptions = CachingOptions;\nvar CachingParserWrapper = (function () {\n function CachingParserWrapper(_parser, _cacheOptions) {\n this._parser = _parser;\n this._cacheOptions = _cacheOptions;\n }\n CachingParserWrapper.prototype.parse = function (response) {\n var _this = this;\n return this._parser.parse(response).then(function (data) {\n if (_this._cacheOptions.store !== null) {\n _this._cacheOptions.store.put(_this._cacheOptions.key, data, _this._cacheOptions.expiration);\n }\n return data;\n });\n };\n return CachingParserWrapper;\n}());\nexports.CachingParserWrapper = CachingParserWrapper;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar ContentTypes = (function (_super) {\n __extends(ContentTypes, _super);\n function ContentTypes(baseUrl, path) {\n if (path === void 0) { path = \"contenttypes\"; }\n _super.call(this, baseUrl, path);\n }\n ContentTypes.prototype.getById = function (id) {\n var ct = new ContentType(this);\n ct.concat(\"('\" + id + \"')\");\n return ct;\n };\n return ContentTypes;\n}(queryable_1.QueryableCollection));\nexports.ContentTypes = ContentTypes;\nvar ContentType = (function (_super) {\n __extends(ContentType, _super);\n function ContentType(baseUrl, path) {\n _super.call(this, baseUrl, path);\n }\n Object.defineProperty(ContentType.prototype, \"fieldLinks\", {\n get: function () {\n return new queryable_1.Queryable(this, \"fieldLinks\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ContentType.prototype, \"fields\", {\n get: function () {\n return new queryable_1.Queryable(this, \"fields\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ContentType.prototype, \"parent\", {\n get: function () {\n return new ContentType(this, \"parent\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ContentType.prototype, \"workflowAssociations\", {\n get: function () {\n return new queryable_1.Queryable(this, \"workflowAssociations\");\n },\n enumerable: true,\n configurable: true\n });\n return ContentType;\n}(queryable_1.QueryableInstance));\nexports.ContentType = ContentType;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar util_1 = require(\"../../utils/util\");\nvar Types = require(\"./types\");\nvar Fields = (function (_super) {\n __extends(Fields, _super);\n function Fields(baseUrl, path) {\n if (path === void 0) { path = \"fields\"; }\n _super.call(this, baseUrl, path);\n }\n Fields.prototype.getByTitle = function (title) {\n return new Field(this, \"getByTitle('\" + title + \"')\");\n };\n Fields.prototype.getByInternalNameOrTitle = function (name) {\n return new Field(this, \"getByInternalNameOrTitle('\" + name + \"')\");\n };\n Fields.prototype.getById = function (id) {\n var f = new Field(this);\n f.concat(\"('\" + id + \"')\");\n return f;\n };\n Fields.prototype.createFieldAsXml = function (xml) {\n var _this = this;\n var info;\n if (typeof xml === \"string\") {\n info = { SchemaXml: xml };\n }\n else {\n info = xml;\n }\n var postBody = JSON.stringify({\n \"parameters\": util_1.Util.extend({\n \"__metadata\": {\n \"type\": \"SP.XmlSchemaFieldCreationInformation\",\n },\n }, info),\n });\n var q = new Fields(this, \"createfieldasxml\");\n return q.postAs({ body: postBody }).then(function (data) {\n return {\n data: data,\n field: _this.getById(data.Id),\n };\n });\n };\n Fields.prototype.add = function (title, fieldType, properties) {\n var _this = this;\n if (properties === void 0) { properties = {}; }\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": fieldType },\n \"Title\": title,\n }, properties));\n return this.postAs({ body: postBody }).then(function (data) {\n return {\n data: data,\n field: _this.getById(data.Id),\n };\n });\n };\n Fields.prototype.addText = function (title, maxLength, properties) {\n if (maxLength === void 0) { maxLength = 255; }\n var props = {\n FieldTypeKind: 2,\n };\n return this.add(title, \"SP.FieldText\", util_1.Util.extend(props, properties));\n };\n Fields.prototype.addCalculated = function (title, formula, dateFormat, outputType, properties) {\n if (outputType === void 0) { outputType = Types.FieldTypes.Text; }\n var props = {\n DateFormat: dateFormat,\n FieldTypeKind: 17,\n Formula: formula,\n OutputType: outputType,\n };\n return this.add(title, \"SP.FieldCalculated\", util_1.Util.extend(props, properties));\n };\n Fields.prototype.addDateTime = function (title, displayFormat, calendarType, friendlyDisplayFormat, properties) {\n if (displayFormat === void 0) { displayFormat = Types.DateTimeFieldFormatType.DateOnly; }\n if (calendarType === void 0) { calendarType = Types.CalendarType.Gregorian; }\n if (friendlyDisplayFormat === void 0) { friendlyDisplayFormat = 0; }\n var props = {\n DateTimeCalendarType: calendarType,\n DisplayFormat: displayFormat,\n FieldTypeKind: 4,\n FriendlyDisplayFormat: friendlyDisplayFormat,\n };\n return this.add(title, \"SP.FieldDateTime\", util_1.Util.extend(props, properties));\n };\n Fields.prototype.addNumber = function (title, minValue, maxValue, properties) {\n var props = { FieldTypeKind: 9 };\n if (typeof minValue !== \"undefined\") {\n props = util_1.Util.extend({ MinimumValue: minValue }, props);\n }\n if (typeof maxValue !== \"undefined\") {\n props = util_1.Util.extend({ MaximumValue: maxValue }, props);\n }\n return this.add(title, \"SP.FieldNumber\", util_1.Util.extend(props, properties));\n };\n Fields.prototype.addCurrency = function (title, minValue, maxValue, currencyLocalId, properties) {\n if (currencyLocalId === void 0) { currencyLocalId = 1033; }\n var props = {\n CurrencyLocaleId: currencyLocalId,\n FieldTypeKind: 10,\n };\n if (typeof minValue !== \"undefined\") {\n props = util_1.Util.extend({ MinimumValue: minValue }, props);\n }\n if (typeof maxValue !== \"undefined\") {\n props = util_1.Util.extend({ MaximumValue: maxValue }, props);\n }\n return this.add(title, \"SP.FieldCurrency\", util_1.Util.extend(props, properties));\n };\n Fields.prototype.addMultilineText = function (title, numberOfLines, richText, restrictedMode, appendOnly, allowHyperlink, properties) {\n if (numberOfLines === void 0) { numberOfLines = 6; }\n if (richText === void 0) { richText = true; }\n if (restrictedMode === void 0) { restrictedMode = false; }\n if (appendOnly === void 0) { appendOnly = false; }\n if (allowHyperlink === void 0) { allowHyperlink = true; }\n var props = {\n AllowHyperlink: allowHyperlink,\n AppendOnly: appendOnly,\n FieldTypeKind: 3,\n NumberOfLines: numberOfLines,\n RestrictedMode: restrictedMode,\n RichText: richText,\n };\n return this.add(title, \"SP.FieldMultiLineText\", util_1.Util.extend(props, properties));\n };\n Fields.prototype.addUrl = function (title, displayFormat, properties) {\n if (displayFormat === void 0) { displayFormat = Types.UrlFieldFormatType.Hyperlink; }\n var props = {\n DisplayFormat: displayFormat,\n FieldTypeKind: 11,\n };\n return this.add(title, \"SP.FieldUrl\", util_1.Util.extend(props, properties));\n };\n return Fields;\n}(queryable_1.QueryableCollection));\nexports.Fields = Fields;\nvar Field = (function (_super) {\n __extends(Field, _super);\n function Field(baseUrl, path) {\n _super.call(this, baseUrl, path);\n }\n Field.prototype.update = function (properties, fieldType) {\n var _this = this;\n if (fieldType === void 0) { fieldType = \"SP.Field\"; }\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": fieldType },\n }, properties));\n return this.post({\n body: postBody,\n headers: {\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n return {\n data: data,\n field: _this,\n };\n });\n };\n Field.prototype.delete = function () {\n return this.post({\n headers: {\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n Field.prototype.setShowInDisplayForm = function (show) {\n var q = new Field(this, \"setshowindisplayform(\" + show + \")\");\n return q.post();\n };\n Field.prototype.setShowInEditForm = function (show) {\n var q = new Field(this, \"setshowineditform(\" + show + \")\");\n return q.post();\n };\n Field.prototype.setShowInNewForm = function (show) {\n var q = new Field(this, \"setshowinnewform(\" + show + \")\");\n return q.post();\n };\n return Field;\n}(queryable_1.QueryableInstance));\nexports.Field = Field;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar items_1 = require(\"./items\");\nvar Files = (function (_super) {\n __extends(Files, _super);\n function Files(baseUrl, path) {\n if (path === void 0) { path = \"files\"; }\n _super.call(this, baseUrl, path);\n }\n Files.prototype.getByName = function (name) {\n var f = new File(this);\n f.concat(\"('\" + name + \"')\");\n return f;\n };\n Files.prototype.add = function (url, content, shouldOverWrite) {\n var _this = this;\n if (shouldOverWrite === void 0) { shouldOverWrite = true; }\n return new Files(this, \"add(overwrite=\" + shouldOverWrite + \",url='\" + url + \"')\")\n .post({ body: content }).then(function (response) {\n return {\n data: response,\n file: _this.getByName(url),\n };\n });\n };\n Files.prototype.addTemplateFile = function (fileUrl, templateFileType) {\n var _this = this;\n return new Files(this, \"addTemplateFile(urloffile='\" + fileUrl + \"',templatefiletype=\" + templateFileType + \")\")\n .post().then(function (response) {\n return {\n data: response,\n file: _this.getByName(fileUrl),\n };\n });\n };\n return Files;\n}(queryable_1.QueryableCollection));\nexports.Files = Files;\nvar File = (function (_super) {\n __extends(File, _super);\n function File(baseUrl, path) {\n _super.call(this, baseUrl, path);\n }\n Object.defineProperty(File.prototype, \"listItemAllFields\", {\n get: function () {\n return new items_1.Item(this, \"listItemAllFields\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(File.prototype, \"versions\", {\n get: function () {\n return new Versions(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(File.prototype, \"value\", {\n get: function () {\n return new queryable_1.Queryable(this, \"$value\");\n },\n enumerable: true,\n configurable: true\n });\n File.prototype.approve = function (comment) {\n return new File(this, \"approve(comment='\" + comment + \"')\").post();\n };\n File.prototype.cancelUpload = function (uploadId) {\n return new File(this, \"cancelUpload(uploadId=guid'\" + uploadId + \"')\").post();\n };\n File.prototype.checkin = function (comment, checkinType) {\n if (comment === void 0) { comment = \"\"; }\n if (checkinType === void 0) { checkinType = CheckinType.Major; }\n return new File(this, \"checkin(comment='\" + comment + \"',checkintype=\" + checkinType + \")\").post();\n };\n File.prototype.checkout = function () {\n return new File(this, \"checkout\").post();\n };\n File.prototype.continueUpload = function (uploadId, fileOffset, b) {\n return new File(this, \"continueUpload(uploadId=guid'\" + uploadId + \"',fileOffset=\" + fileOffset + \")\").postAs({ body: b });\n };\n File.prototype.copyTo = function (url, shouldOverWrite) {\n if (shouldOverWrite === void 0) { shouldOverWrite = true; }\n return new File(this, \"copyTo(strnewurl='\" + url + \"',boverwrite=\" + shouldOverWrite + \")\").post();\n };\n File.prototype.delete = function (eTag) {\n if (eTag === void 0) { eTag = \"*\"; }\n return new File(this).post({\n headers: {\n \"IF-Match\": eTag,\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n File.prototype.deny = function (comment) {\n if (comment === void 0) { comment = \"\"; }\n return new File(this, \"deny(comment='\" + comment + \"')\").post();\n };\n File.prototype.finishUpload = function (uploadId, fileOffset, fragment) {\n return new File(this, \"finishUpload(uploadId=guid'\" + uploadId + \"',fileOffset=\" + fileOffset + \")\")\n .postAs({ body: fragment }).then(function (response) {\n return {\n data: response,\n file: new File(response.ServerRelativeUrl),\n };\n });\n };\n File.prototype.getLimitedWebPartManager = function (scope) {\n if (scope === void 0) { scope = WebPartsPersonalizationScope.User; }\n return new queryable_1.Queryable(this, \"getLimitedWebPartManager(scope=\" + scope + \")\");\n };\n File.prototype.moveTo = function (url, moveOperations) {\n if (moveOperations === void 0) { moveOperations = MoveOperations.Overwrite; }\n return new File(this, \"moveTo(newurl='\" + url + \"',flags=\" + moveOperations + \")\").post();\n };\n File.prototype.openBinaryStream = function () {\n return new queryable_1.Queryable(this, \"openBinaryStream\");\n };\n File.prototype.publish = function (comment) {\n if (comment === void 0) { comment = \"\"; }\n return new File(this, \"publish(comment='\" + comment + \"')\").post();\n };\n File.prototype.recycle = function () {\n return new File(this, \"recycle\").post();\n };\n File.prototype.saveBinaryStream = function (data) {\n return new File(this, \"saveBinary\").post({ body: data });\n };\n File.prototype.startUpload = function (uploadId, fragment) {\n return new File(this, \"startUpload(uploadId=guid'\" + uploadId + \"')\").postAs({ body: fragment });\n };\n File.prototype.undoCheckout = function () {\n return new File(this, \"undoCheckout\").post();\n };\n File.prototype.unpublish = function (comment) {\n if (comment === void 0) { comment = \"\"; }\n if (comment.length > 1023) {\n throw new Error(\"The maximum comment length is 1023 characters.\");\n }\n return new File(this, \"unpublish(comment='\" + comment + \"')\").post();\n };\n return File;\n}(queryable_1.QueryableInstance));\nexports.File = File;\nvar Versions = (function (_super) {\n __extends(Versions, _super);\n function Versions(baseUrl, path) {\n if (path === void 0) { path = \"versions\"; }\n _super.call(this, baseUrl, path);\n }\n Versions.prototype.getById = function (versionId) {\n var v = new Version(this);\n v.concat(\"(\" + versionId + \")\");\n return v;\n };\n Versions.prototype.deleteAll = function () {\n return new Versions(this, \"deleteAll\").post();\n };\n Versions.prototype.deleteById = function (versionId) {\n return new Versions(this, \"deleteById(vid=\" + versionId + \")\").post();\n };\n Versions.prototype.deleteByLabel = function (label) {\n return new Versions(this, \"deleteByLabel(versionlabel='\" + label + \"')\").post();\n };\n Versions.prototype.restoreByLabel = function (label) {\n return new Versions(this, \"restoreByLabel(versionlabel='\" + label + \"')\").post();\n };\n return Versions;\n}(queryable_1.QueryableCollection));\nexports.Versions = Versions;\nvar Version = (function (_super) {\n __extends(Version, _super);\n function Version(baseUrl, path) {\n _super.call(this, baseUrl, path);\n }\n Version.prototype.delete = function (eTag) {\n if (eTag === void 0) { eTag = \"*\"; }\n return this.post({\n headers: {\n \"IF-Match\": eTag,\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n return Version;\n}(queryable_1.QueryableInstance));\nexports.Version = Version;\n(function (CheckinType) {\n CheckinType[CheckinType[\"Minor\"] = 0] = \"Minor\";\n CheckinType[CheckinType[\"Major\"] = 1] = \"Major\";\n CheckinType[CheckinType[\"Overwrite\"] = 2] = \"Overwrite\";\n})(exports.CheckinType || (exports.CheckinType = {}));\nvar CheckinType = exports.CheckinType;\n(function (WebPartsPersonalizationScope) {\n WebPartsPersonalizationScope[WebPartsPersonalizationScope[\"User\"] = 0] = \"User\";\n WebPartsPersonalizationScope[WebPartsPersonalizationScope[\"Shared\"] = 1] = \"Shared\";\n})(exports.WebPartsPersonalizationScope || (exports.WebPartsPersonalizationScope = {}));\nvar WebPartsPersonalizationScope = exports.WebPartsPersonalizationScope;\n(function (MoveOperations) {\n MoveOperations[MoveOperations[\"Overwrite\"] = 1] = \"Overwrite\";\n MoveOperations[MoveOperations[\"AllowBrokenThickets\"] = 8] = \"AllowBrokenThickets\";\n})(exports.MoveOperations || (exports.MoveOperations = {}));\nvar MoveOperations = exports.MoveOperations;\n(function (TemplateFileType) {\n TemplateFileType[TemplateFileType[\"StandardPage\"] = 0] = \"StandardPage\";\n TemplateFileType[TemplateFileType[\"WikiPage\"] = 1] = \"WikiPage\";\n TemplateFileType[TemplateFileType[\"FormPage\"] = 2] = \"FormPage\";\n})(exports.TemplateFileType || (exports.TemplateFileType = {}));\nvar TemplateFileType = exports.TemplateFileType;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar files_1 = require(\"./files\");\nvar items_1 = require(\"./items\");\nvar Folders = (function (_super) {\n __extends(Folders, _super);\n function Folders(baseUrl, path) {\n if (path === void 0) { path = \"folders\"; }\n _super.call(this, baseUrl, path);\n }\n Folders.prototype.getByName = function (name) {\n var f = new Folder(this);\n f.concat(\"('\" + name + \"')\");\n return f;\n };\n Folders.prototype.add = function (url) {\n var _this = this;\n return new Folders(this, \"add('\" + url + \"')\").post().then(function (response) {\n return {\n data: response,\n folder: _this.getByName(url),\n };\n });\n };\n return Folders;\n}(queryable_1.QueryableCollection));\nexports.Folders = Folders;\nvar Folder = (function (_super) {\n __extends(Folder, _super);\n function Folder(baseUrl, path) {\n _super.call(this, baseUrl, path);\n }\n Object.defineProperty(Folder.prototype, \"contentTypeOrder\", {\n get: function () {\n return new queryable_1.QueryableCollection(this, \"contentTypeOrder\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Folder.prototype, \"files\", {\n get: function () {\n return new files_1.Files(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Folder.prototype, \"folders\", {\n get: function () {\n return new Folders(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Folder.prototype, \"listItemAllFields\", {\n get: function () {\n return new items_1.Item(this, \"listItemAllFields\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Folder.prototype, \"parentFolder\", {\n get: function () {\n return new Folder(this, \"parentFolder\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Folder.prototype, \"properties\", {\n get: function () {\n return new queryable_1.QueryableInstance(this, \"properties\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Folder.prototype, \"serverRelativeUrl\", {\n get: function () {\n return new queryable_1.Queryable(this, \"serverRelativeUrl\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Folder.prototype, \"uniqueContentTypeOrder\", {\n get: function () {\n return new queryable_1.QueryableCollection(this, \"uniqueContentTypeOrder\");\n },\n enumerable: true,\n configurable: true\n });\n Folder.prototype.delete = function (eTag) {\n if (eTag === void 0) { eTag = \"*\"; }\n return new Folder(this).post({\n headers: {\n \"IF-Match\": eTag,\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n Folder.prototype.recycle = function () {\n return new Folder(this, \"recycle\").post();\n };\n return Folder;\n}(queryable_1.QueryableInstance));\nexports.Folder = Folder;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar Forms = (function (_super) {\n __extends(Forms, _super);\n function Forms(baseUrl, path) {\n if (path === void 0) { path = \"forms\"; }\n _super.call(this, baseUrl, path);\n }\n Forms.prototype.getById = function (id) {\n var i = new Form(this);\n i.concat(\"('\" + id + \"')\");\n return i;\n };\n return Forms;\n}(queryable_1.QueryableCollection));\nexports.Forms = Forms;\nvar Form = (function (_super) {\n __extends(Form, _super);\n function Form(baseUrl, path) {\n _super.call(this, baseUrl, path);\n }\n return Form;\n}(queryable_1.QueryableInstance));\nexports.Form = Form;\n","\"use strict\";\nfunction __export(m) {\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\n}\n__export(require(\"./caching\"));\nvar files_1 = require(\"./files\");\nexports.CheckinType = files_1.CheckinType;\nexports.WebPartsPersonalizationScope = files_1.WebPartsPersonalizationScope;\nexports.MoveOperations = files_1.MoveOperations;\nexports.TemplateFileType = files_1.TemplateFileType;\nvar items_1 = require(\"./items\");\nexports.PagedItemCollection = items_1.PagedItemCollection;\nvar odata_1 = require(\"./odata\");\nexports.extractOdataId = odata_1.extractOdataId;\nexports.ODataParserBase = odata_1.ODataParserBase;\nexports.ODataDefaultParser = odata_1.ODataDefaultParser;\nexports.ODataRaw = odata_1.ODataRaw;\nexports.ODataValue = odata_1.ODataValue;\nexports.ODataEntity = odata_1.ODataEntity;\nexports.ODataEntityArray = odata_1.ODataEntityArray;\nvar roles_1 = require(\"./roles\");\nexports.RoleDefinitionBindings = roles_1.RoleDefinitionBindings;\nvar search_1 = require(\"./search\");\nexports.SearchResult = search_1.SearchResult;\nexports.SortDirection = search_1.SortDirection;\nexports.ReorderingRuleMatchType = search_1.ReorderingRuleMatchType;\nexports.QueryPropertyValueType = search_1.QueryPropertyValueType;\nvar site_1 = require(\"./site\");\nexports.Site = site_1.Site;\n__export(require(\"./types\"));\nvar webs_1 = require(\"./webs\");\nexports.Web = webs_1.Web;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar queryablesecurable_1 = require(\"./queryablesecurable\");\nvar folders_1 = require(\"./folders\");\nvar contenttypes_1 = require(\"./contenttypes\");\nvar util_1 = require(\"../../utils/util\");\nvar odata_1 = require(\"./odata\");\nvar Items = (function (_super) {\n __extends(Items, _super);\n function Items(baseUrl, path) {\n if (path === void 0) { path = \"items\"; }\n _super.call(this, baseUrl, path);\n }\n Items.prototype.getById = function (id) {\n var i = new Item(this);\n i.concat(\"(\" + id + \")\");\n return i;\n };\n Items.prototype.skip = function (skip) {\n this._query.add(\"$skiptoken\", encodeURIComponent(\"Paged=TRUE&p_ID=\" + skip));\n return this;\n };\n Items.prototype.getPaged = function () {\n return this.getAs(new PagedItemCollectionParser());\n };\n Items.prototype.add = function (properties) {\n var _this = this;\n if (properties === void 0) { properties = {}; }\n this.addBatchDependency();\n var parentList = this.getParent(queryable_1.QueryableInstance);\n return parentList.select(\"ListItemEntityTypeFullName\").getAs().then(function (d) {\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": d.ListItemEntityTypeFullName },\n }, properties));\n var promise = _this.postAs({ body: postBody }).then(function (data) {\n return {\n data: data,\n item: _this.getById(data.Id),\n };\n });\n _this.clearBatchDependency();\n return promise;\n });\n };\n return Items;\n}(queryable_1.QueryableCollection));\nexports.Items = Items;\nvar PagedItemCollectionParser = (function (_super) {\n __extends(PagedItemCollectionParser, _super);\n function PagedItemCollectionParser() {\n _super.apply(this, arguments);\n }\n PagedItemCollectionParser.prototype.parse = function (r) {\n return PagedItemCollection.fromResponse(r);\n };\n return PagedItemCollectionParser;\n}(odata_1.ODataParserBase));\nvar Item = (function (_super) {\n __extends(Item, _super);\n function Item(baseUrl, path) {\n _super.call(this, baseUrl, path);\n }\n Object.defineProperty(Item.prototype, \"attachmentFiles\", {\n get: function () {\n return new queryable_1.QueryableCollection(this, \"AttachmentFiles\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Item.prototype, \"contentType\", {\n get: function () {\n return new contenttypes_1.ContentType(this, \"ContentType\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Item.prototype, \"effectiveBasePermissions\", {\n get: function () {\n return new queryable_1.Queryable(this, \"EffectiveBasePermissions\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Item.prototype, \"effectiveBasePermissionsForUI\", {\n get: function () {\n return new queryable_1.Queryable(this, \"EffectiveBasePermissionsForUI\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Item.prototype, \"fieldValuesAsHTML\", {\n get: function () {\n return new queryable_1.QueryableInstance(this, \"FieldValuesAsHTML\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Item.prototype, \"fieldValuesAsText\", {\n get: function () {\n return new queryable_1.QueryableInstance(this, \"FieldValuesAsText\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Item.prototype, \"fieldValuesForEdit\", {\n get: function () {\n return new queryable_1.QueryableInstance(this, \"FieldValuesForEdit\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Item.prototype, \"folder\", {\n get: function () {\n return new folders_1.Folder(this, \"Folder\");\n },\n enumerable: true,\n configurable: true\n });\n Item.prototype.update = function (properties, eTag) {\n var _this = this;\n if (eTag === void 0) { eTag = \"*\"; }\n this.addBatchDependency();\n var parentList = this.getParent(queryable_1.QueryableInstance, this.parentUrl.substr(0, this.parentUrl.lastIndexOf(\"/\")));\n return parentList.select(\"ListItemEntityTypeFullName\").getAs().then(function (d) {\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": d.ListItemEntityTypeFullName },\n }, properties));\n var promise = _this.post({\n body: postBody,\n headers: {\n \"IF-Match\": eTag,\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n return {\n data: data,\n item: _this,\n };\n });\n _this.clearBatchDependency();\n return promise;\n });\n };\n Item.prototype.delete = function (eTag) {\n if (eTag === void 0) { eTag = \"*\"; }\n return this.post({\n headers: {\n \"IF-Match\": eTag,\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n Item.prototype.recycle = function () {\n var i = new Item(this, \"recycle\");\n return i.post();\n };\n Item.prototype.getWopiFrameUrl = function (action) {\n if (action === void 0) { action = 0; }\n var i = new Item(this, \"getWOPIFrameUrl(@action)\");\n i._query.add(\"@action\", action);\n return i.post().then(function (data) {\n return data.GetWOPIFrameUrl;\n });\n };\n Item.prototype.validateUpdateListItem = function (formValues, newDocumentUpdate) {\n if (newDocumentUpdate === void 0) { newDocumentUpdate = false; }\n var postBody = JSON.stringify({ \"formValues\": formValues, bNewDocumentUpdate: newDocumentUpdate });\n var item = new Item(this, \"validateupdatelistitem\");\n return item.post({ body: postBody });\n };\n return Item;\n}(queryablesecurable_1.QueryableSecurable));\nexports.Item = Item;\nvar PagedItemCollection = (function () {\n function PagedItemCollection() {\n }\n Object.defineProperty(PagedItemCollection.prototype, \"hasNext\", {\n get: function () {\n return typeof this.nextUrl === \"string\" && this.nextUrl.length > 0;\n },\n enumerable: true,\n configurable: true\n });\n PagedItemCollection.fromResponse = function (r) {\n return r.json().then(function (d) {\n var col = new PagedItemCollection();\n col.nextUrl = d[\"odata.nextLink\"];\n col.results = d.value;\n return col;\n });\n };\n PagedItemCollection.prototype.getNext = function () {\n if (this.hasNext) {\n var items = new Items(this.nextUrl, null);\n return items.getPaged();\n }\n return new Promise(function (r) { return r(null); });\n };\n return PagedItemCollection;\n}());\nexports.PagedItemCollection = PagedItemCollection;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar items_1 = require(\"./items\");\nvar views_1 = require(\"./views\");\nvar contenttypes_1 = require(\"./contenttypes\");\nvar fields_1 = require(\"./fields\");\nvar forms_1 = require(\"./forms\");\nvar queryable_1 = require(\"./queryable\");\nvar queryablesecurable_1 = require(\"./queryablesecurable\");\nvar util_1 = require(\"../../utils/util\");\nvar usercustomactions_1 = require(\"./usercustomactions\");\nvar odata_1 = require(\"./odata\");\nvar Lists = (function (_super) {\n __extends(Lists, _super);\n function Lists(baseUrl, path) {\n if (path === void 0) { path = \"lists\"; }\n _super.call(this, baseUrl, path);\n }\n Lists.prototype.getByTitle = function (title) {\n return new List(this, \"getByTitle('\" + title + \"')\");\n };\n Lists.prototype.getById = function (id) {\n var list = new List(this);\n list.concat(\"('\" + id + \"')\");\n return list;\n };\n Lists.prototype.add = function (title, description, template, enableContentTypes, additionalSettings) {\n var _this = this;\n if (description === void 0) { description = \"\"; }\n if (template === void 0) { template = 100; }\n if (enableContentTypes === void 0) { enableContentTypes = false; }\n if (additionalSettings === void 0) { additionalSettings = {}; }\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": \"SP.List\" },\n \"AllowContentTypes\": enableContentTypes,\n \"BaseTemplate\": template,\n \"ContentTypesEnabled\": enableContentTypes,\n \"Description\": description,\n \"Title\": title,\n }, additionalSettings));\n return this.post({ body: postBody }).then(function (data) {\n return { data: data, list: _this.getByTitle(title) };\n });\n };\n Lists.prototype.ensure = function (title, description, template, enableContentTypes, additionalSettings) {\n var _this = this;\n if (description === void 0) { description = \"\"; }\n if (template === void 0) { template = 100; }\n if (enableContentTypes === void 0) { enableContentTypes = false; }\n if (additionalSettings === void 0) { additionalSettings = {}; }\n if (this.hasBatch) {\n throw new Error(\"The ensure method is not supported as part of a batch.\");\n }\n return new Promise(function (resolve, reject) {\n var list = _this.getByTitle(title);\n list.get().then(function (d) { return resolve({ created: false, data: d, list: list }); }).catch(function () {\n _this.add(title, description, template, enableContentTypes, additionalSettings).then(function (r) {\n resolve({ created: true, data: r.data, list: _this.getByTitle(title) });\n });\n }).catch(function (e) { return reject(e); });\n });\n };\n Lists.prototype.ensureSiteAssetsLibrary = function () {\n var q = new Lists(this, \"ensuresiteassetslibrary\");\n return q.post().then(function (json) {\n return new List(odata_1.extractOdataId(json));\n });\n };\n Lists.prototype.ensureSitePagesLibrary = function () {\n var q = new Lists(this, \"ensuresitepageslibrary\");\n return q.post().then(function (json) {\n return new List(odata_1.extractOdataId(json));\n });\n };\n return Lists;\n}(queryable_1.QueryableCollection));\nexports.Lists = Lists;\nvar List = (function (_super) {\n __extends(List, _super);\n function List(baseUrl, path) {\n _super.call(this, baseUrl, path);\n }\n Object.defineProperty(List.prototype, \"contentTypes\", {\n get: function () {\n return new contenttypes_1.ContentTypes(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"items\", {\n get: function () {\n return new items_1.Items(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"views\", {\n get: function () {\n return new views_1.Views(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"fields\", {\n get: function () {\n return new fields_1.Fields(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"forms\", {\n get: function () {\n return new forms_1.Forms(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"defaultView\", {\n get: function () {\n return new queryable_1.QueryableInstance(this, \"DefaultView\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"userCustomActions\", {\n get: function () {\n return new usercustomactions_1.UserCustomActions(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"effectiveBasePermissions\", {\n get: function () {\n return new queryable_1.Queryable(this, \"EffectiveBasePermissions\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"eventReceivers\", {\n get: function () {\n return new queryable_1.QueryableCollection(this, \"EventReceivers\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"relatedFields\", {\n get: function () {\n return new queryable_1.Queryable(this, \"getRelatedFields\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"informationRightsManagementSettings\", {\n get: function () {\n return new queryable_1.Queryable(this, \"InformationRightsManagementSettings\");\n },\n enumerable: true,\n configurable: true\n });\n List.prototype.getView = function (viewId) {\n return new views_1.View(this, \"getView('\" + viewId + \"')\");\n };\n List.prototype.update = function (properties, eTag) {\n var _this = this;\n if (eTag === void 0) { eTag = \"*\"; }\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": \"SP.List\" },\n }, properties));\n return this.post({\n body: postBody,\n headers: {\n \"IF-Match\": eTag,\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n var retList = _this;\n if (properties.hasOwnProperty(\"Title\")) {\n retList = _this.getParent(List, _this.parentUrl, \"getByTitle('\" + properties[\"Title\"] + \"')\");\n }\n return {\n data: data,\n list: retList,\n };\n });\n };\n List.prototype.delete = function (eTag) {\n if (eTag === void 0) { eTag = \"*\"; }\n return this.post({\n headers: {\n \"IF-Match\": eTag,\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n List.prototype.getChanges = function (query) {\n var postBody = JSON.stringify({ \"query\": util_1.Util.extend({ \"__metadata\": { \"type\": \"SP.ChangeQuery\" } }, query) });\n var q = new List(this, \"getchanges\");\n return q.post({ body: postBody });\n };\n List.prototype.getItemsByCAMLQuery = function (query) {\n var expands = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n expands[_i - 1] = arguments[_i];\n }\n var postBody = JSON.stringify({ \"query\": util_1.Util.extend({ \"__metadata\": { \"type\": \"SP.CamlQuery\" } }, query) });\n var q = new List(this, \"getitems\");\n q = q.expand.apply(q, expands);\n return q.post({ body: postBody });\n };\n List.prototype.getListItemChangesSinceToken = function (query) {\n var postBody = JSON.stringify({ \"query\": util_1.Util.extend({ \"__metadata\": { \"type\": \"SP.ChangeLogItemQuery\" } }, query) });\n var q = new List(this, \"getlistitemchangessincetoken\");\n return q.post({ body: postBody }, { parse: function (r) { return r.text(); } });\n };\n List.prototype.recycle = function () {\n this.append(\"recycle\");\n return this.post().then(function (data) {\n if (data.hasOwnProperty(\"Recycle\")) {\n return data.Recycle;\n }\n else {\n return data;\n }\n });\n };\n List.prototype.renderListData = function (viewXml) {\n var q = new List(this, \"renderlistdata(@viewXml)\");\n q.query.add(\"@viewXml\", \"'\" + viewXml + \"'\");\n return q.post().then(function (data) {\n data = JSON.parse(data);\n if (data.hasOwnProperty(\"RenderListData\")) {\n return data.RenderListData;\n }\n else {\n return data;\n }\n });\n };\n List.prototype.renderListFormData = function (itemId, formId, mode) {\n var q = new List(this, \"renderlistformdata(itemid=\" + itemId + \", formid='\" + formId + \"', mode=\" + mode + \")\");\n return q.post().then(function (data) {\n data = JSON.parse(data);\n if (data.hasOwnProperty(\"ListData\")) {\n return data.ListData;\n }\n else {\n return data;\n }\n });\n };\n List.prototype.reserveListItemId = function () {\n var q = new List(this, \"reservelistitemid\");\n return q.post().then(function (data) {\n if (data.hasOwnProperty(\"ReserveListItemId\")) {\n return data.ReserveListItemId;\n }\n else {\n return data;\n }\n });\n };\n return List;\n}(queryablesecurable_1.QueryableSecurable));\nexports.List = List;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar quicklaunch_1 = require(\"./quicklaunch\");\nvar topnavigationbar_1 = require(\"./topnavigationbar\");\nvar Navigation = (function (_super) {\n __extends(Navigation, _super);\n function Navigation(baseUrl) {\n _super.call(this, baseUrl, \"navigation\");\n }\n Object.defineProperty(Navigation.prototype, \"quicklaunch\", {\n get: function () {\n return new quicklaunch_1.QuickLaunch(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Navigation.prototype, \"topNavigationBar\", {\n get: function () {\n return new topnavigationbar_1.TopNavigationBar(this);\n },\n enumerable: true,\n configurable: true\n });\n return Navigation;\n}(queryable_1.Queryable));\nexports.Navigation = Navigation;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar util_1 = require(\"../../utils/util\");\nvar logging_1 = require(\"../../utils/logging\");\nvar httpclient_1 = require(\"../../net/httpclient\");\nvar pnplibconfig_1 = require(\"../../configuration/pnplibconfig\");\nfunction extractOdataId(candidate) {\n if (candidate.hasOwnProperty(\"odata.id\")) {\n return candidate[\"odata.id\"];\n }\n else if (candidate.hasOwnProperty(\"__metadata\") && candidate.__metadata.hasOwnProperty(\"id\")) {\n return candidate.__metadata.id;\n }\n else {\n logging_1.Logger.log({\n data: candidate,\n level: logging_1.LogLevel.Error,\n message: \"Could not extract odata id in object, you may be using nometadata. Object data logged to logger.\",\n });\n throw new Error(\"Could not extract odata id in object, you may be using nometadata. Object data logged to logger.\");\n }\n}\nexports.extractOdataId = extractOdataId;\nvar ODataParserBase = (function () {\n function ODataParserBase() {\n }\n ODataParserBase.prototype.parse = function (r) {\n return r.json().then(function (json) {\n var result = json;\n if (json.hasOwnProperty(\"d\")) {\n if (json.d.hasOwnProperty(\"results\")) {\n result = json.d.results;\n }\n else {\n result = json.d;\n }\n }\n else if (json.hasOwnProperty(\"value\")) {\n result = json.value;\n }\n return result;\n });\n };\n return ODataParserBase;\n}());\nexports.ODataParserBase = ODataParserBase;\nvar ODataDefaultParser = (function (_super) {\n __extends(ODataDefaultParser, _super);\n function ODataDefaultParser() {\n _super.apply(this, arguments);\n }\n return ODataDefaultParser;\n}(ODataParserBase));\nexports.ODataDefaultParser = ODataDefaultParser;\nvar ODataRawParserImpl = (function () {\n function ODataRawParserImpl() {\n }\n ODataRawParserImpl.prototype.parse = function (r) {\n return r.json();\n };\n return ODataRawParserImpl;\n}());\nexports.ODataRawParserImpl = ODataRawParserImpl;\nvar ODataValueParserImpl = (function (_super) {\n __extends(ODataValueParserImpl, _super);\n function ODataValueParserImpl() {\n _super.apply(this, arguments);\n }\n ODataValueParserImpl.prototype.parse = function (r) {\n return _super.prototype.parse.call(this, r).then(function (d) { return d; });\n };\n return ODataValueParserImpl;\n}(ODataParserBase));\nvar ODataEntityParserImpl = (function (_super) {\n __extends(ODataEntityParserImpl, _super);\n function ODataEntityParserImpl(factory) {\n _super.call(this);\n this.factory = factory;\n }\n ODataEntityParserImpl.prototype.parse = function (r) {\n var _this = this;\n return _super.prototype.parse.call(this, r).then(function (d) {\n var o = new _this.factory(getEntityUrl(d), null);\n return util_1.Util.extend(o, d);\n });\n };\n return ODataEntityParserImpl;\n}(ODataParserBase));\nvar ODataEntityArrayParserImpl = (function (_super) {\n __extends(ODataEntityArrayParserImpl, _super);\n function ODataEntityArrayParserImpl(factory) {\n _super.call(this);\n this.factory = factory;\n }\n ODataEntityArrayParserImpl.prototype.parse = function (r) {\n var _this = this;\n return _super.prototype.parse.call(this, r).then(function (d) {\n return d.map(function (v) {\n var o = new _this.factory(getEntityUrl(v), null);\n return util_1.Util.extend(o, v);\n });\n });\n };\n return ODataEntityArrayParserImpl;\n}(ODataParserBase));\nfunction getEntityUrl(entity) {\n if (entity.hasOwnProperty(\"__metadata\")) {\n return entity.__metadata.uri;\n }\n else if (entity.hasOwnProperty(\"odata.editLink\")) {\n return util_1.Util.combinePaths(\"_api\", entity[\"odata.editLink\"]);\n }\n else {\n logging_1.Logger.write(\"No uri information found in ODataEntity parsing, chaining will fail for this object.\", logging_1.LogLevel.Warning);\n return \"\";\n }\n}\nexports.ODataRaw = new ODataRawParserImpl();\nfunction ODataValue() {\n return new ODataValueParserImpl();\n}\nexports.ODataValue = ODataValue;\nfunction ODataEntity(factory) {\n return new ODataEntityParserImpl(factory);\n}\nexports.ODataEntity = ODataEntity;\nfunction ODataEntityArray(factory) {\n return new ODataEntityArrayParserImpl(factory);\n}\nexports.ODataEntityArray = ODataEntityArray;\nvar ODataBatch = (function () {\n function ODataBatch(_batchId) {\n if (_batchId === void 0) { _batchId = util_1.Util.getGUID(); }\n this._batchId = _batchId;\n this._requests = [];\n this._batchDepCount = 0;\n }\n ODataBatch.prototype.add = function (url, method, options, parser) {\n var info = {\n method: method.toUpperCase(),\n options: options,\n parser: parser,\n reject: null,\n resolve: null,\n url: url,\n };\n var p = new Promise(function (resolve, reject) {\n info.resolve = resolve;\n info.reject = reject;\n });\n this._requests.push(info);\n return p;\n };\n ODataBatch.prototype.incrementBatchDep = function () {\n this._batchDepCount++;\n };\n ODataBatch.prototype.decrementBatchDep = function () {\n this._batchDepCount--;\n };\n ODataBatch.prototype.execute = function () {\n var _this = this;\n return new Promise(function (resolve, reject) {\n if (_this._batchDepCount > 0) {\n setTimeout(function () { return _this.execute(); }, 100);\n }\n else {\n _this.executeImpl().then(function () { return resolve(); }).catch(reject);\n }\n });\n };\n ODataBatch.prototype.executeImpl = function () {\n var _this = this;\n if (this._requests.length < 1) {\n return new Promise(function (r) { return r(); });\n }\n var batchBody = [];\n var currentChangeSetId = \"\";\n this._requests.forEach(function (reqInfo, index) {\n if (reqInfo.method === \"GET\") {\n if (currentChangeSetId.length > 0) {\n batchBody.push(\"--changeset_\" + currentChangeSetId + \"--\\n\\n\");\n currentChangeSetId = \"\";\n }\n batchBody.push(\"--batch_\" + _this._batchId + \"\\n\");\n }\n else {\n if (currentChangeSetId.length < 1) {\n currentChangeSetId = util_1.Util.getGUID();\n batchBody.push(\"--batch_\" + _this._batchId + \"\\n\");\n batchBody.push(\"Content-Type: multipart/mixed; boundary=\\\"changeset_\" + currentChangeSetId + \"\\\"\\n\\n\");\n }\n batchBody.push(\"--changeset_\" + currentChangeSetId + \"\\n\");\n }\n batchBody.push(\"Content-Type: application/http\\n\");\n batchBody.push(\"Content-Transfer-Encoding: binary\\n\\n\");\n var headers = {\n \"Accept\": \"application/json;\",\n };\n if (reqInfo.method !== \"GET\") {\n var method = reqInfo.method;\n if (reqInfo.options && reqInfo.options.headers && reqInfo.options.headers[\"X-HTTP-Method\"] !== typeof undefined) {\n method = reqInfo.options.headers[\"X-HTTP-Method\"];\n delete reqInfo.options.headers[\"X-HTTP-Method\"];\n }\n batchBody.push(method + \" \" + reqInfo.url + \" HTTP/1.1\\n\");\n headers = util_1.Util.extend(headers, { \"Content-Type\": \"application/json;odata=verbose;charset=utf-8\" });\n }\n else {\n batchBody.push(reqInfo.method + \" \" + reqInfo.url + \" HTTP/1.1\\n\");\n }\n if (typeof pnplibconfig_1.RuntimeConfig.headers !== \"undefined\") {\n headers = util_1.Util.extend(headers, pnplibconfig_1.RuntimeConfig.headers);\n }\n if (reqInfo.options && reqInfo.options.headers) {\n headers = util_1.Util.extend(headers, reqInfo.options.headers);\n }\n for (var name_1 in headers) {\n if (headers.hasOwnProperty(name_1)) {\n batchBody.push(name_1 + \": \" + headers[name_1] + \"\\n\");\n }\n }\n batchBody.push(\"\\n\");\n if (reqInfo.options.body) {\n batchBody.push(reqInfo.options.body + \"\\n\\n\");\n }\n });\n if (currentChangeSetId.length > 0) {\n batchBody.push(\"--changeset_\" + currentChangeSetId + \"--\\n\\n\");\n currentChangeSetId = \"\";\n }\n batchBody.push(\"--batch_\" + this._batchId + \"--\\n\");\n var batchHeaders = {\n \"Content-Type\": \"multipart/mixed; boundary=batch_\" + this._batchId,\n };\n var batchOptions = {\n \"body\": batchBody.join(\"\"),\n \"headers\": batchHeaders,\n };\n var client = new httpclient_1.HttpClient();\n return client.post(util_1.Util.makeUrlAbsolute(\"/_api/$batch\"), batchOptions)\n .then(function (r) { return r.text(); })\n .then(this._parseResponse)\n .then(function (responses) {\n if (responses.length !== _this._requests.length) {\n throw new Error(\"Could not properly parse responses to match requests in batch.\");\n }\n var resolutions = [];\n for (var i = 0; i < responses.length; i++) {\n var request = _this._requests[i];\n var response = responses[i];\n if (!response.ok) {\n request.reject(new Error(response.statusText));\n }\n resolutions.push(request.parser.parse(response).then(request.resolve).catch(request.reject));\n }\n return Promise.all(resolutions);\n });\n };\n ODataBatch.prototype._parseResponse = function (body) {\n return new Promise(function (resolve, reject) {\n var responses = [];\n var header = \"--batchresponse_\";\n var statusRegExp = new RegExp(\"^HTTP/[0-9.]+ +([0-9]+) +(.*)\", \"i\");\n var lines = body.split(\"\\n\");\n var state = \"batch\";\n var status;\n var statusText;\n for (var i = 0; i < lines.length; ++i) {\n var line = lines[i];\n switch (state) {\n case \"batch\":\n if (line.substr(0, header.length) === header) {\n state = \"batchHeaders\";\n }\n else {\n if (line.trim() !== \"\") {\n throw new Error(\"Invalid response, line \" + i);\n }\n }\n break;\n case \"batchHeaders\":\n if (line.trim() === \"\") {\n state = \"status\";\n }\n break;\n case \"status\":\n var parts = statusRegExp.exec(line);\n if (parts.length !== 3) {\n throw new Error(\"Invalid status, line \" + i);\n }\n status = parseInt(parts[1], 10);\n statusText = parts[2];\n state = \"statusHeaders\";\n break;\n case \"statusHeaders\":\n if (line.trim() === \"\") {\n state = \"body\";\n }\n break;\n case \"body\":\n var response = void 0;\n if (status === 204) {\n response = new Response();\n }\n else {\n response = new Response(line, { status: status, statusText: statusText });\n }\n responses.push(response);\n state = \"batch\";\n break;\n }\n }\n if (state !== \"status\") {\n reject(new Error(\"Unexpected end of input\"));\n }\n resolve(responses);\n });\n };\n return ODataBatch;\n}());\nexports.ODataBatch = ODataBatch;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar util_1 = require(\"../../utils/util\");\nvar collections_1 = require(\"../../collections/collections\");\nvar httpclient_1 = require(\"../../net/httpclient\");\nvar odata_1 = require(\"./odata\");\nvar caching_1 = require(\"./caching\");\nvar pnplibconfig_1 = require(\"../../configuration/pnplibconfig\");\nvar Queryable = (function () {\n function Queryable(baseUrl, path) {\n this._query = new collections_1.Dictionary();\n this._batch = null;\n if (typeof baseUrl === \"string\") {\n var urlStr = baseUrl;\n if (urlStr.lastIndexOf(\"/\") < 0) {\n this._parentUrl = urlStr;\n this._url = util_1.Util.combinePaths(urlStr, path);\n }\n else if (urlStr.lastIndexOf(\"/\") > urlStr.lastIndexOf(\"(\")) {\n var index = urlStr.lastIndexOf(\"/\");\n this._parentUrl = urlStr.slice(0, index);\n path = util_1.Util.combinePaths(urlStr.slice(index), path);\n this._url = util_1.Util.combinePaths(this._parentUrl, path);\n }\n else {\n var index = urlStr.lastIndexOf(\"(\");\n this._parentUrl = urlStr.slice(0, index);\n this._url = util_1.Util.combinePaths(urlStr, path);\n }\n }\n else {\n var q = baseUrl;\n this._parentUrl = q._url;\n if (!this.hasBatch && q.hasBatch) {\n this._batch = q._batch;\n }\n var target = q._query.get(\"@target\");\n if (target !== null) {\n this._query.add(\"@target\", target);\n }\n this._url = util_1.Util.combinePaths(this._parentUrl, path);\n }\n }\n Queryable.prototype.concat = function (pathPart) {\n this._url += pathPart;\n };\n Queryable.prototype.append = function (pathPart) {\n this._url = util_1.Util.combinePaths(this._url, pathPart);\n };\n Queryable.prototype.addBatchDependency = function () {\n if (this._batch !== null) {\n this._batch.incrementBatchDep();\n }\n };\n Queryable.prototype.clearBatchDependency = function () {\n if (this._batch !== null) {\n this._batch.decrementBatchDep();\n }\n };\n Object.defineProperty(Queryable.prototype, \"hasBatch\", {\n get: function () {\n return this._batch !== null;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Queryable.prototype, \"parentUrl\", {\n get: function () {\n return this._parentUrl;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Queryable.prototype, \"query\", {\n get: function () {\n return this._query;\n },\n enumerable: true,\n configurable: true\n });\n Queryable.prototype.inBatch = function (batch) {\n if (this._batch !== null) {\n throw new Error(\"This query is already part of a batch.\");\n }\n this._batch = batch;\n return this;\n };\n Queryable.prototype.usingCaching = function (options) {\n if (!pnplibconfig_1.RuntimeConfig.globalCacheDisable) {\n this._useCaching = true;\n this._cachingOptions = options;\n }\n return this;\n };\n Queryable.prototype.toUrl = function () {\n return util_1.Util.makeUrlAbsolute(this._url);\n };\n Queryable.prototype.toUrlAndQuery = function () {\n var _this = this;\n var url = this.toUrl();\n if (this._query.count() > 0) {\n url += \"?\";\n var keys = this._query.getKeys();\n url += keys.map(function (key, ix, arr) { return (key + \"=\" + _this._query.get(key)); }).join(\"&\");\n }\n return url;\n };\n Queryable.prototype.get = function (parser, getOptions) {\n if (parser === void 0) { parser = new odata_1.ODataDefaultParser(); }\n if (getOptions === void 0) { getOptions = {}; }\n return this.getImpl(getOptions, parser);\n };\n Queryable.prototype.getAs = function (parser, getOptions) {\n if (parser === void 0) { parser = new odata_1.ODataDefaultParser(); }\n if (getOptions === void 0) { getOptions = {}; }\n return this.getImpl(getOptions, parser);\n };\n Queryable.prototype.post = function (postOptions, parser) {\n if (postOptions === void 0) { postOptions = {}; }\n if (parser === void 0) { parser = new odata_1.ODataDefaultParser(); }\n return this.postImpl(postOptions, parser);\n };\n Queryable.prototype.postAs = function (postOptions, parser) {\n if (postOptions === void 0) { postOptions = {}; }\n if (parser === void 0) { parser = new odata_1.ODataDefaultParser(); }\n return this.postImpl(postOptions, parser);\n };\n Queryable.prototype.getParent = function (factory, baseUrl, path) {\n if (baseUrl === void 0) { baseUrl = this.parentUrl; }\n var parent = new factory(baseUrl, path);\n var target = this.query.get(\"@target\");\n if (target !== null) {\n parent.query.add(\"@target\", target);\n }\n return parent;\n };\n Queryable.prototype.getImpl = function (getOptions, parser) {\n if (getOptions === void 0) { getOptions = {}; }\n if (this._useCaching) {\n var options = new caching_1.CachingOptions(this.toUrlAndQuery().toLowerCase());\n if (typeof this._cachingOptions !== \"undefined\") {\n options = util_1.Util.extend(options, this._cachingOptions);\n }\n if (options.store !== null) {\n var data_1 = options.store.get(options.key);\n if (data_1 !== null) {\n return new Promise(function (resolve) { return resolve(data_1); });\n }\n }\n parser = new caching_1.CachingParserWrapper(parser, options);\n }\n if (this._batch === null) {\n var client = new httpclient_1.HttpClient();\n return client.get(this.toUrlAndQuery(), getOptions).then(function (response) {\n if (!response.ok) {\n throw \"Error making GET request: \" + response.statusText;\n }\n return parser.parse(response);\n });\n }\n else {\n return this._batch.add(this.toUrlAndQuery(), \"GET\", {}, parser);\n }\n };\n Queryable.prototype.postImpl = function (postOptions, parser) {\n if (this._batch === null) {\n var client = new httpclient_1.HttpClient();\n return client.post(this.toUrlAndQuery(), postOptions).then(function (response) {\n if (!response.ok) {\n throw \"Error making POST request: \" + response.statusText;\n }\n if ((response.headers.has(\"Content-Length\") && parseFloat(response.headers.get(\"Content-Length\")) === 0)\n || response.status === 204) {\n return new Promise(function (resolve, reject) { resolve({}); });\n }\n return parser.parse(response);\n });\n }\n else {\n return this._batch.add(this.toUrlAndQuery(), \"POST\", postOptions, parser);\n }\n };\n return Queryable;\n}());\nexports.Queryable = Queryable;\nvar QueryableCollection = (function (_super) {\n __extends(QueryableCollection, _super);\n function QueryableCollection() {\n _super.apply(this, arguments);\n }\n QueryableCollection.prototype.filter = function (filter) {\n this._query.add(\"$filter\", filter);\n return this;\n };\n QueryableCollection.prototype.select = function () {\n var selects = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n selects[_i - 0] = arguments[_i];\n }\n this._query.add(\"$select\", selects.join(\",\"));\n return this;\n };\n QueryableCollection.prototype.expand = function () {\n var expands = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n expands[_i - 0] = arguments[_i];\n }\n this._query.add(\"$expand\", expands.join(\",\"));\n return this;\n };\n QueryableCollection.prototype.orderBy = function (orderBy, ascending) {\n if (ascending === void 0) { ascending = true; }\n var keys = this._query.getKeys();\n var query = [];\n var asc = ascending ? \" asc\" : \" desc\";\n for (var i = 0; i < keys.length; i++) {\n if (keys[i] === \"$orderby\") {\n query.push(this._query.get(\"$orderby\"));\n break;\n }\n }\n query.push(\"\" + orderBy + asc);\n this._query.add(\"$orderby\", query.join(\",\"));\n return this;\n };\n QueryableCollection.prototype.skip = function (skip) {\n this._query.add(\"$skip\", skip.toString());\n return this;\n };\n QueryableCollection.prototype.top = function (top) {\n this._query.add(\"$top\", top.toString());\n return this;\n };\n return QueryableCollection;\n}(Queryable));\nexports.QueryableCollection = QueryableCollection;\nvar QueryableInstance = (function (_super) {\n __extends(QueryableInstance, _super);\n function QueryableInstance() {\n _super.apply(this, arguments);\n }\n QueryableInstance.prototype.select = function () {\n var selects = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n selects[_i - 0] = arguments[_i];\n }\n this._query.add(\"$select\", selects.join(\",\"));\n return this;\n };\n QueryableInstance.prototype.expand = function () {\n var expands = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n expands[_i - 0] = arguments[_i];\n }\n this._query.add(\"$expand\", expands.join(\",\"));\n return this;\n };\n return QueryableInstance;\n}(Queryable));\nexports.QueryableInstance = QueryableInstance;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar roles_1 = require(\"./roles\");\nvar queryable_1 = require(\"./queryable\");\nvar QueryableSecurable = (function (_super) {\n __extends(QueryableSecurable, _super);\n function QueryableSecurable() {\n _super.apply(this, arguments);\n }\n Object.defineProperty(QueryableSecurable.prototype, \"roleAssignments\", {\n get: function () {\n return new roles_1.RoleAssignments(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(QueryableSecurable.prototype, \"firstUniqueAncestorSecurableObject\", {\n get: function () {\n this.append(\"FirstUniqueAncestorSecurableObject\");\n return new queryable_1.QueryableInstance(this);\n },\n enumerable: true,\n configurable: true\n });\n QueryableSecurable.prototype.getUserEffectivePermissions = function (loginName) {\n this.append(\"getUserEffectivePermissions(@user)\");\n this._query.add(\"@user\", \"'\" + encodeURIComponent(loginName) + \"'\");\n return new queryable_1.Queryable(this);\n };\n QueryableSecurable.prototype.breakRoleInheritance = function (copyRoleAssignments, clearSubscopes) {\n if (copyRoleAssignments === void 0) { copyRoleAssignments = false; }\n if (clearSubscopes === void 0) { clearSubscopes = false; }\n var Breaker = (function (_super) {\n __extends(Breaker, _super);\n function Breaker(baseUrl, copy, clear) {\n _super.call(this, baseUrl, \"breakroleinheritance(copyroleassignments=\" + copy + \", clearsubscopes=\" + clear + \")\");\n }\n Breaker.prototype.break = function () {\n return this.post();\n };\n return Breaker;\n }(queryable_1.Queryable));\n var b = new Breaker(this, copyRoleAssignments, clearSubscopes);\n return b.break();\n };\n QueryableSecurable.prototype.resetRoleInheritance = function () {\n var Resetter = (function (_super) {\n __extends(Resetter, _super);\n function Resetter(baseUrl) {\n _super.call(this, baseUrl, \"resetroleinheritance\");\n }\n Resetter.prototype.reset = function () {\n return this.post();\n };\n return Resetter;\n }(queryable_1.Queryable));\n var r = new Resetter(this);\n return r.reset();\n };\n return QueryableSecurable;\n}(queryable_1.QueryableInstance));\nexports.QueryableSecurable = QueryableSecurable;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar QuickLaunch = (function (_super) {\n __extends(QuickLaunch, _super);\n function QuickLaunch(baseUrl) {\n _super.call(this, baseUrl, \"QuickLaunch\");\n }\n return QuickLaunch;\n}(queryable_1.Queryable));\nexports.QuickLaunch = QuickLaunch;\n","\"use strict\";\nvar search_1 = require(\"./search\");\nvar site_1 = require(\"./site\");\nvar webs_1 = require(\"./webs\");\nvar util_1 = require(\"../../utils/util\");\nvar userprofiles_1 = require(\"./userprofiles\");\nvar odata_1 = require(\"./odata\");\nvar Rest = (function () {\n function Rest() {\n }\n Rest.prototype.search = function (query) {\n var finalQuery;\n if (typeof query === \"string\") {\n finalQuery = { Querytext: query };\n }\n else {\n finalQuery = query;\n }\n return new search_1.Search(\"\").execute(finalQuery);\n };\n Object.defineProperty(Rest.prototype, \"site\", {\n get: function () {\n return new site_1.Site(\"\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Rest.prototype, \"web\", {\n get: function () {\n return new webs_1.Web(\"\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Rest.prototype, \"profiles\", {\n get: function () {\n return new userprofiles_1.UserProfileQuery(\"\");\n },\n enumerable: true,\n configurable: true\n });\n Rest.prototype.createBatch = function () {\n return new odata_1.ODataBatch();\n };\n Rest.prototype.crossDomainSite = function (addInWebUrl, hostWebUrl) {\n return this._cdImpl(site_1.Site, addInWebUrl, hostWebUrl, \"site\");\n };\n Rest.prototype.crossDomainWeb = function (addInWebUrl, hostWebUrl) {\n return this._cdImpl(webs_1.Web, addInWebUrl, hostWebUrl, \"web\");\n };\n Rest.prototype._cdImpl = function (factory, addInWebUrl, hostWebUrl, urlPart) {\n if (!util_1.Util.isUrlAbsolute(addInWebUrl)) {\n throw \"The addInWebUrl parameter must be an absolute url.\";\n }\n if (!util_1.Util.isUrlAbsolute(hostWebUrl)) {\n throw \"The hostWebUrl parameter must be an absolute url.\";\n }\n var url = util_1.Util.combinePaths(addInWebUrl, \"_api/SP.AppContextSite(@target)\");\n var instance = new factory(url, urlPart);\n instance.query.add(\"@target\", \"'\" + encodeURIComponent(hostWebUrl) + \"'\");\n return instance;\n };\n return Rest;\n}());\nexports.Rest = Rest;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar sitegroups_1 = require(\"./sitegroups\");\nvar util_1 = require(\"../../utils/util\");\nvar RoleAssignments = (function (_super) {\n __extends(RoleAssignments, _super);\n function RoleAssignments(baseUrl, path) {\n if (path === void 0) { path = \"roleassignments\"; }\n _super.call(this, baseUrl, path);\n }\n RoleAssignments.prototype.add = function (principalId, roleDefId) {\n var a = new RoleAssignments(this, \"addroleassignment(principalid=\" + principalId + \", roledefid=\" + roleDefId + \")\");\n return a.post();\n };\n RoleAssignments.prototype.remove = function (principalId, roleDefId) {\n var a = new RoleAssignments(this, \"removeroleassignment(principalid=\" + principalId + \", roledefid=\" + roleDefId + \")\");\n return a.post();\n };\n RoleAssignments.prototype.getById = function (id) {\n var ra = new RoleAssignment(this);\n ra.concat(\"(\" + id + \")\");\n return ra;\n };\n return RoleAssignments;\n}(queryable_1.QueryableCollection));\nexports.RoleAssignments = RoleAssignments;\nvar RoleAssignment = (function (_super) {\n __extends(RoleAssignment, _super);\n function RoleAssignment(baseUrl, path) {\n _super.call(this, baseUrl, path);\n }\n Object.defineProperty(RoleAssignment.prototype, \"groups\", {\n get: function () {\n return new sitegroups_1.SiteGroups(this, \"groups\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RoleAssignment.prototype, \"bindings\", {\n get: function () {\n return new RoleDefinitionBindings(this);\n },\n enumerable: true,\n configurable: true\n });\n RoleAssignment.prototype.delete = function () {\n return this.post({\n headers: {\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n return RoleAssignment;\n}(queryable_1.QueryableInstance));\nexports.RoleAssignment = RoleAssignment;\nvar RoleDefinitions = (function (_super) {\n __extends(RoleDefinitions, _super);\n function RoleDefinitions(baseUrl, path) {\n if (path === void 0) { path = \"roledefinitions\"; }\n _super.call(this, baseUrl, path);\n }\n RoleDefinitions.prototype.getById = function (id) {\n return new RoleDefinition(this, \"getById(\" + id + \")\");\n };\n RoleDefinitions.prototype.getByName = function (name) {\n return new RoleDefinition(this, \"getbyname('\" + name + \"')\");\n };\n RoleDefinitions.prototype.getByType = function (roleTypeKind) {\n return new RoleDefinition(this, \"getbytype(\" + roleTypeKind + \")\");\n };\n RoleDefinitions.prototype.add = function (name, description, order, basePermissions) {\n var _this = this;\n var postBody = JSON.stringify({\n BasePermissions: util_1.Util.extend({ __metadata: { type: \"SP.BasePermissions\" } }, basePermissions),\n Description: description,\n Name: name,\n Order: order,\n __metadata: { \"type\": \"SP.RoleDefinition\" },\n });\n return this.post({ body: postBody }).then(function (data) {\n return {\n data: data,\n definition: _this.getById(data.Id),\n };\n });\n };\n return RoleDefinitions;\n}(queryable_1.QueryableCollection));\nexports.RoleDefinitions = RoleDefinitions;\nvar RoleDefinition = (function (_super) {\n __extends(RoleDefinition, _super);\n function RoleDefinition(baseUrl, path) {\n _super.call(this, baseUrl, path);\n }\n RoleDefinition.prototype.update = function (properties) {\n var _this = this;\n if (typeof properties.hasOwnProperty(\"BasePermissions\") !== \"undefined\") {\n properties[\"BasePermissions\"] = util_1.Util.extend({ __metadata: { type: \"SP.BasePermissions\" } }, properties[\"BasePermissions\"]);\n }\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": \"SP.RoleDefinition\" },\n }, properties));\n return this.post({\n body: postBody,\n headers: {\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n var retDef = _this;\n if (properties.hasOwnProperty(\"Name\")) {\n var parent_1 = _this.getParent(RoleDefinitions, _this.parentUrl, \"\");\n retDef = parent_1.getByName(properties[\"Name\"]);\n }\n return {\n data: data,\n definition: retDef,\n };\n });\n };\n RoleDefinition.prototype.delete = function () {\n return this.post({\n headers: {\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n return RoleDefinition;\n}(queryable_1.QueryableInstance));\nexports.RoleDefinition = RoleDefinition;\nvar RoleDefinitionBindings = (function (_super) {\n __extends(RoleDefinitionBindings, _super);\n function RoleDefinitionBindings(baseUrl, path) {\n if (path === void 0) { path = \"roledefinitionbindings\"; }\n _super.call(this, baseUrl, path);\n }\n return RoleDefinitionBindings;\n}(queryable_1.QueryableCollection));\nexports.RoleDefinitionBindings = RoleDefinitionBindings;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar Search = (function (_super) {\n __extends(Search, _super);\n function Search(baseUrl, path) {\n if (path === void 0) { path = \"_api/search/postquery\"; }\n _super.call(this, baseUrl, path);\n }\n Search.prototype.execute = function (query) {\n var formattedBody;\n formattedBody = query;\n if (formattedBody.SelectProperties) {\n formattedBody.SelectProperties = { results: query.SelectProperties };\n }\n if (formattedBody.RefinementFilters) {\n formattedBody.RefinementFilters = { results: query.RefinementFilters };\n }\n if (formattedBody.Refiners) {\n formattedBody.Refiners = { results: query.Refiners };\n }\n if (formattedBody.SortList) {\n formattedBody.SortList = { results: query.SortList };\n }\n if (formattedBody.HithighlightedProperties) {\n formattedBody.HithighlightedProperties = { results: query.HithighlightedProperties };\n }\n if (formattedBody.ReorderingRules) {\n formattedBody.ReorderingRules = { results: query.ReorderingRules };\n }\n var postBody = JSON.stringify({ request: formattedBody });\n return this.post({ body: postBody }).then(function (data) { return new SearchResults(data); });\n };\n return Search;\n}(queryable_1.QueryableInstance));\nexports.Search = Search;\nvar SearchResults = (function () {\n function SearchResults(rawResponse) {\n var response = rawResponse.postquery ? rawResponse.postquery : rawResponse;\n this.PrimarySearchResults = this.formatSearchResults(response.PrimaryQueryResult.RelevantResults.Table.Rows);\n this.RawSearchResults = response;\n this.ElapsedTime = response.ElapsedTime;\n this.RowCount = response.PrimaryQueryResult.RelevantResults.RowCount;\n this.TotalRows = response.PrimaryQueryResult.RelevantResults.TotalRows;\n this.TotalRowsIncludingDuplicates = response.PrimaryQueryResult.RelevantResults.TotalRowsIncludingDuplicates;\n }\n SearchResults.prototype.formatSearchResults = function (rawResults) {\n var results = new Array(), tempResults = rawResults.results ? rawResults.results : rawResults;\n for (var _i = 0, tempResults_1 = tempResults; _i < tempResults_1.length; _i++) {\n var i = tempResults_1[_i];\n results.push(new SearchResult(i.Cells));\n }\n return results;\n };\n return SearchResults;\n}());\nexports.SearchResults = SearchResults;\nvar SearchResult = (function () {\n function SearchResult(rawItem) {\n var item = rawItem.results ? rawItem.results : rawItem;\n for (var _i = 0, item_1 = item; _i < item_1.length; _i++) {\n var i = item_1[_i];\n this[i.Key] = i.Value;\n }\n }\n return SearchResult;\n}());\nexports.SearchResult = SearchResult;\n(function (SortDirection) {\n SortDirection[SortDirection[\"Ascending\"] = 0] = \"Ascending\";\n SortDirection[SortDirection[\"Descending\"] = 1] = \"Descending\";\n SortDirection[SortDirection[\"FQLFormula\"] = 2] = \"FQLFormula\";\n})(exports.SortDirection || (exports.SortDirection = {}));\nvar SortDirection = exports.SortDirection;\n(function (ReorderingRuleMatchType) {\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"ResultContainsKeyword\"] = 0] = \"ResultContainsKeyword\";\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"TitleContainsKeyword\"] = 1] = \"TitleContainsKeyword\";\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"TitleMatchesKeyword\"] = 2] = \"TitleMatchesKeyword\";\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"UrlStartsWith\"] = 3] = \"UrlStartsWith\";\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"UrlExactlyMatches\"] = 4] = \"UrlExactlyMatches\";\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"ContentTypeIs\"] = 5] = \"ContentTypeIs\";\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"FileExtensionMatches\"] = 6] = \"FileExtensionMatches\";\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"ResultHasTag\"] = 7] = \"ResultHasTag\";\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"ManualCondition\"] = 8] = \"ManualCondition\";\n})(exports.ReorderingRuleMatchType || (exports.ReorderingRuleMatchType = {}));\nvar ReorderingRuleMatchType = exports.ReorderingRuleMatchType;\n(function (QueryPropertyValueType) {\n QueryPropertyValueType[QueryPropertyValueType[\"None\"] = 0] = \"None\";\n QueryPropertyValueType[QueryPropertyValueType[\"StringType\"] = 1] = \"StringType\";\n QueryPropertyValueType[QueryPropertyValueType[\"Int32TYpe\"] = 2] = \"Int32TYpe\";\n QueryPropertyValueType[QueryPropertyValueType[\"BooleanType\"] = 3] = \"BooleanType\";\n QueryPropertyValueType[QueryPropertyValueType[\"StringArrayType\"] = 4] = \"StringArrayType\";\n QueryPropertyValueType[QueryPropertyValueType[\"UnSupportedType\"] = 5] = \"UnSupportedType\";\n})(exports.QueryPropertyValueType || (exports.QueryPropertyValueType = {}));\nvar QueryPropertyValueType = exports.QueryPropertyValueType;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar webs_1 = require(\"./webs\");\nvar usercustomactions_1 = require(\"./usercustomactions\");\nvar Site = (function (_super) {\n __extends(Site, _super);\n function Site(baseUrl, path) {\n if (path === void 0) { path = \"_api/site\"; }\n _super.call(this, baseUrl, path);\n }\n Object.defineProperty(Site.prototype, \"rootWeb\", {\n get: function () {\n return new webs_1.Web(this, \"rootweb\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Site.prototype, \"userCustomActions\", {\n get: function () {\n return new usercustomactions_1.UserCustomActions(this);\n },\n enumerable: true,\n configurable: true\n });\n Site.prototype.getContextInfo = function () {\n var q = new Site(\"\", \"_api/contextinfo\");\n return q.post().then(function (data) {\n if (data.hasOwnProperty(\"GetContextWebInformation\")) {\n var info = data.GetContextWebInformation;\n info.SupportedSchemaVersions = info.SupportedSchemaVersions.results;\n return info;\n }\n else {\n return data;\n }\n });\n };\n Site.prototype.getDocumentLibraries = function (absoluteWebUrl) {\n var q = new queryable_1.Queryable(\"\", \"_api/sp.web.getdocumentlibraries(@v)\");\n q.query.add(\"@v\", \"'\" + absoluteWebUrl + \"'\");\n return q.get().then(function (data) {\n if (data.hasOwnProperty(\"GetDocumentLibraries\")) {\n return data.GetDocumentLibraries;\n }\n else {\n return data;\n }\n });\n };\n Site.prototype.getWebUrlFromPageUrl = function (absolutePageUrl) {\n var q = new queryable_1.Queryable(\"\", \"_api/sp.web.getweburlfrompageurl(@v)\");\n q.query.add(\"@v\", \"'\" + absolutePageUrl + \"'\");\n return q.get().then(function (data) {\n if (data.hasOwnProperty(\"GetWebUrlFromPageUrl\")) {\n return data.GetWebUrlFromPageUrl;\n }\n else {\n return data;\n }\n });\n };\n return Site;\n}(queryable_1.QueryableInstance));\nexports.Site = Site;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar siteusers_1 = require(\"./siteusers\");\nvar util_1 = require(\"../../utils/util\");\n(function (PrincipalType) {\n PrincipalType[PrincipalType[\"None\"] = 0] = \"None\";\n PrincipalType[PrincipalType[\"User\"] = 1] = \"User\";\n PrincipalType[PrincipalType[\"DistributionList\"] = 2] = \"DistributionList\";\n PrincipalType[PrincipalType[\"SecurityGroup\"] = 4] = \"SecurityGroup\";\n PrincipalType[PrincipalType[\"SharePointGroup\"] = 8] = \"SharePointGroup\";\n PrincipalType[PrincipalType[\"All\"] = 15] = \"All\";\n})(exports.PrincipalType || (exports.PrincipalType = {}));\nvar PrincipalType = exports.PrincipalType;\nvar SiteGroups = (function (_super) {\n __extends(SiteGroups, _super);\n function SiteGroups(baseUrl, path) {\n if (path === void 0) { path = \"sitegroups\"; }\n _super.call(this, baseUrl, path);\n }\n SiteGroups.prototype.add = function (properties) {\n var _this = this;\n var postBody = JSON.stringify(util_1.Util.extend({ \"__metadata\": { \"type\": \"SP.Group\" } }, properties));\n return this.post({ body: postBody }).then(function (data) {\n return {\n data: data,\n group: _this.getById(data.Id),\n };\n });\n };\n SiteGroups.prototype.getByName = function (groupName) {\n return new SiteGroup(this, \"getByName('\" + groupName + \"')\");\n };\n SiteGroups.prototype.getById = function (id) {\n var sg = new SiteGroup(this);\n sg.concat(\"(\" + id + \")\");\n return sg;\n };\n SiteGroups.prototype.removeById = function (id) {\n var g = new SiteGroups(this, \"removeById('\" + id + \"')\");\n return g.post();\n };\n SiteGroups.prototype.removeByLoginName = function (loginName) {\n var g = new SiteGroups(this, \"removeByLoginName('\" + loginName + \"')\");\n return g.post();\n };\n return SiteGroups;\n}(queryable_1.QueryableCollection));\nexports.SiteGroups = SiteGroups;\nvar SiteGroup = (function (_super) {\n __extends(SiteGroup, _super);\n function SiteGroup(baseUrl, path) {\n _super.call(this, baseUrl, path);\n }\n Object.defineProperty(SiteGroup.prototype, \"users\", {\n get: function () {\n return new siteusers_1.SiteUsers(this, \"users\");\n },\n enumerable: true,\n configurable: true\n });\n SiteGroup.prototype.update = function (properties) {\n var _this = this;\n var postBody = util_1.Util.extend({ \"__metadata\": { \"type\": \"SP.Group\" } }, properties);\n return this.post({\n body: JSON.stringify(postBody),\n headers: {\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n var retGroup = _this;\n if (properties.hasOwnProperty(\"Title\")) {\n retGroup = _this.getParent(SiteGroup, _this.parentUrl, \"getByName('\" + properties[\"Title\"] + \"')\");\n }\n return {\n data: data,\n group: retGroup,\n };\n });\n };\n return SiteGroup;\n}(queryable_1.QueryableInstance));\nexports.SiteGroup = SiteGroup;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar sitegroups_1 = require(\"./sitegroups\");\nvar util_1 = require(\"../../utils/util\");\nvar SiteUsers = (function (_super) {\n __extends(SiteUsers, _super);\n function SiteUsers(baseUrl, path) {\n if (path === void 0) { path = \"siteusers\"; }\n _super.call(this, baseUrl, path);\n }\n SiteUsers.prototype.getByEmail = function (email) {\n return new SiteUser(this, \"getByEmail('\" + email + \"')\");\n };\n SiteUsers.prototype.getById = function (id) {\n return new SiteUser(this, \"getById(\" + id + \")\");\n };\n SiteUsers.prototype.getByLoginName = function (loginName) {\n var su = new SiteUser(this);\n su.concat(\"(@v)\");\n su.query.add(\"@v\", encodeURIComponent(loginName));\n return su;\n };\n SiteUsers.prototype.removeById = function (id) {\n var o = new SiteUsers(this, \"removeById(\" + id + \")\");\n return o.post();\n };\n SiteUsers.prototype.removeByLoginName = function (loginName) {\n var o = new SiteUsers(this, \"removeByLoginName(@v)\");\n o.query.add(\"@v\", encodeURIComponent(loginName));\n return o.post();\n };\n SiteUsers.prototype.add = function (loginName) {\n var _this = this;\n var postBody = JSON.stringify({ \"__metadata\": { \"type\": \"SP.User\" }, LoginName: loginName });\n return this.post({ body: postBody }).then(function (data) { return _this.getByLoginName(loginName); });\n };\n return SiteUsers;\n}(queryable_1.QueryableCollection));\nexports.SiteUsers = SiteUsers;\nvar SiteUser = (function (_super) {\n __extends(SiteUser, _super);\n function SiteUser(baseUrl, path) {\n _super.call(this, baseUrl, path);\n }\n Object.defineProperty(SiteUser.prototype, \"groups\", {\n get: function () {\n return new sitegroups_1.SiteGroups(this, \"groups\");\n },\n enumerable: true,\n configurable: true\n });\n SiteUser.prototype.update = function (properties) {\n var _this = this;\n var postBody = util_1.Util.extend({ \"__metadata\": { \"type\": \"SP.User\" } }, properties);\n return this.post({\n body: JSON.stringify(postBody),\n headers: {\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n return {\n data: data,\n user: _this,\n };\n });\n };\n SiteUser.prototype.delete = function () {\n return this.post({\n headers: {\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n return SiteUser;\n}(queryable_1.QueryableInstance));\nexports.SiteUser = SiteUser;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar TopNavigationBar = (function (_super) {\n __extends(TopNavigationBar, _super);\n function TopNavigationBar(baseUrl) {\n _super.call(this, baseUrl, \"TopNavigationBar\");\n }\n return TopNavigationBar;\n}(queryable_1.QueryableInstance));\nexports.TopNavigationBar = TopNavigationBar;\n","\"use strict\";\n(function (ControlMode) {\n ControlMode[ControlMode[\"Display\"] = 1] = \"Display\";\n ControlMode[ControlMode[\"Edit\"] = 2] = \"Edit\";\n ControlMode[ControlMode[\"New\"] = 3] = \"New\";\n})(exports.ControlMode || (exports.ControlMode = {}));\nvar ControlMode = exports.ControlMode;\n(function (FieldTypes) {\n FieldTypes[FieldTypes[\"Invalid\"] = 0] = \"Invalid\";\n FieldTypes[FieldTypes[\"Integer\"] = 1] = \"Integer\";\n FieldTypes[FieldTypes[\"Text\"] = 2] = \"Text\";\n FieldTypes[FieldTypes[\"Note\"] = 3] = \"Note\";\n FieldTypes[FieldTypes[\"DateTime\"] = 4] = \"DateTime\";\n FieldTypes[FieldTypes[\"Counter\"] = 5] = \"Counter\";\n FieldTypes[FieldTypes[\"Choice\"] = 6] = \"Choice\";\n FieldTypes[FieldTypes[\"Lookup\"] = 7] = \"Lookup\";\n FieldTypes[FieldTypes[\"Boolean\"] = 8] = \"Boolean\";\n FieldTypes[FieldTypes[\"Number\"] = 9] = \"Number\";\n FieldTypes[FieldTypes[\"Currency\"] = 10] = \"Currency\";\n FieldTypes[FieldTypes[\"URL\"] = 11] = \"URL\";\n FieldTypes[FieldTypes[\"Computed\"] = 12] = \"Computed\";\n FieldTypes[FieldTypes[\"Threading\"] = 13] = \"Threading\";\n FieldTypes[FieldTypes[\"Guid\"] = 14] = \"Guid\";\n FieldTypes[FieldTypes[\"MultiChoice\"] = 15] = \"MultiChoice\";\n FieldTypes[FieldTypes[\"GridChoice\"] = 16] = \"GridChoice\";\n FieldTypes[FieldTypes[\"Calculated\"] = 17] = \"Calculated\";\n FieldTypes[FieldTypes[\"File\"] = 18] = \"File\";\n FieldTypes[FieldTypes[\"Attachments\"] = 19] = \"Attachments\";\n FieldTypes[FieldTypes[\"User\"] = 20] = \"User\";\n FieldTypes[FieldTypes[\"Recurrence\"] = 21] = \"Recurrence\";\n FieldTypes[FieldTypes[\"CrossProjectLink\"] = 22] = \"CrossProjectLink\";\n FieldTypes[FieldTypes[\"ModStat\"] = 23] = \"ModStat\";\n FieldTypes[FieldTypes[\"Error\"] = 24] = \"Error\";\n FieldTypes[FieldTypes[\"ContentTypeId\"] = 25] = \"ContentTypeId\";\n FieldTypes[FieldTypes[\"PageSeparator\"] = 26] = \"PageSeparator\";\n FieldTypes[FieldTypes[\"ThreadIndex\"] = 27] = \"ThreadIndex\";\n FieldTypes[FieldTypes[\"WorkflowStatus\"] = 28] = \"WorkflowStatus\";\n FieldTypes[FieldTypes[\"AllDayEvent\"] = 29] = \"AllDayEvent\";\n FieldTypes[FieldTypes[\"WorkflowEventType\"] = 30] = \"WorkflowEventType\";\n})(exports.FieldTypes || (exports.FieldTypes = {}));\nvar FieldTypes = exports.FieldTypes;\n(function (DateTimeFieldFormatType) {\n DateTimeFieldFormatType[DateTimeFieldFormatType[\"DateOnly\"] = 0] = \"DateOnly\";\n DateTimeFieldFormatType[DateTimeFieldFormatType[\"DateTime\"] = 1] = \"DateTime\";\n})(exports.DateTimeFieldFormatType || (exports.DateTimeFieldFormatType = {}));\nvar DateTimeFieldFormatType = exports.DateTimeFieldFormatType;\n(function (AddFieldOptions) {\n AddFieldOptions[AddFieldOptions[\"DefaultValue\"] = 0] = \"DefaultValue\";\n AddFieldOptions[AddFieldOptions[\"AddToDefaultContentType\"] = 1] = \"AddToDefaultContentType\";\n AddFieldOptions[AddFieldOptions[\"AddToNoContentType\"] = 2] = \"AddToNoContentType\";\n AddFieldOptions[AddFieldOptions[\"AddToAllContentTypes\"] = 4] = \"AddToAllContentTypes\";\n AddFieldOptions[AddFieldOptions[\"AddFieldInternalNameHint\"] = 8] = \"AddFieldInternalNameHint\";\n AddFieldOptions[AddFieldOptions[\"AddFieldToDefaultView\"] = 16] = \"AddFieldToDefaultView\";\n AddFieldOptions[AddFieldOptions[\"AddFieldCheckDisplayName\"] = 32] = \"AddFieldCheckDisplayName\";\n})(exports.AddFieldOptions || (exports.AddFieldOptions = {}));\nvar AddFieldOptions = exports.AddFieldOptions;\n(function (CalendarType) {\n CalendarType[CalendarType[\"Gregorian\"] = 1] = \"Gregorian\";\n CalendarType[CalendarType[\"Japan\"] = 3] = \"Japan\";\n CalendarType[CalendarType[\"Taiwan\"] = 4] = \"Taiwan\";\n CalendarType[CalendarType[\"Korea\"] = 5] = \"Korea\";\n CalendarType[CalendarType[\"Hijri\"] = 6] = \"Hijri\";\n CalendarType[CalendarType[\"Thai\"] = 7] = \"Thai\";\n CalendarType[CalendarType[\"Hebrew\"] = 8] = \"Hebrew\";\n CalendarType[CalendarType[\"GregorianMEFrench\"] = 9] = \"GregorianMEFrench\";\n CalendarType[CalendarType[\"GregorianArabic\"] = 10] = \"GregorianArabic\";\n CalendarType[CalendarType[\"GregorianXLITEnglish\"] = 11] = \"GregorianXLITEnglish\";\n CalendarType[CalendarType[\"GregorianXLITFrench\"] = 12] = \"GregorianXLITFrench\";\n CalendarType[CalendarType[\"KoreaJapanLunar\"] = 14] = \"KoreaJapanLunar\";\n CalendarType[CalendarType[\"ChineseLunar\"] = 15] = \"ChineseLunar\";\n CalendarType[CalendarType[\"SakaEra\"] = 16] = \"SakaEra\";\n CalendarType[CalendarType[\"UmAlQura\"] = 23] = \"UmAlQura\";\n})(exports.CalendarType || (exports.CalendarType = {}));\nvar CalendarType = exports.CalendarType;\n(function (UrlFieldFormatType) {\n UrlFieldFormatType[UrlFieldFormatType[\"Hyperlink\"] = 0] = \"Hyperlink\";\n UrlFieldFormatType[UrlFieldFormatType[\"Image\"] = 1] = \"Image\";\n})(exports.UrlFieldFormatType || (exports.UrlFieldFormatType = {}));\nvar UrlFieldFormatType = exports.UrlFieldFormatType;\n(function (PrincipalType) {\n PrincipalType[PrincipalType[\"None\"] = 0] = \"None\";\n PrincipalType[PrincipalType[\"User\"] = 1] = \"User\";\n PrincipalType[PrincipalType[\"DistributionList\"] = 2] = \"DistributionList\";\n PrincipalType[PrincipalType[\"SecurityGroup\"] = 4] = \"SecurityGroup\";\n PrincipalType[PrincipalType[\"SharePointGroup\"] = 8] = \"SharePointGroup\";\n PrincipalType[PrincipalType[\"All\"] = 15] = \"All\";\n})(exports.PrincipalType || (exports.PrincipalType = {}));\nvar PrincipalType = exports.PrincipalType;\n(function (PageType) {\n PageType[PageType[\"Invalid\"] = -1] = \"Invalid\";\n PageType[PageType[\"DefaultView\"] = 0] = \"DefaultView\";\n PageType[PageType[\"NormalView\"] = 1] = \"NormalView\";\n PageType[PageType[\"DialogView\"] = 2] = \"DialogView\";\n PageType[PageType[\"View\"] = 3] = \"View\";\n PageType[PageType[\"DisplayForm\"] = 4] = \"DisplayForm\";\n PageType[PageType[\"DisplayFormDialog\"] = 5] = \"DisplayFormDialog\";\n PageType[PageType[\"EditForm\"] = 6] = \"EditForm\";\n PageType[PageType[\"EditFormDialog\"] = 7] = \"EditFormDialog\";\n PageType[PageType[\"NewForm\"] = 8] = \"NewForm\";\n PageType[PageType[\"NewFormDialog\"] = 9] = \"NewFormDialog\";\n PageType[PageType[\"SolutionForm\"] = 10] = \"SolutionForm\";\n PageType[PageType[\"PAGE_MAXITEMS\"] = 11] = \"PAGE_MAXITEMS\";\n})(exports.PageType || (exports.PageType = {}));\nvar PageType = exports.PageType;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar util_1 = require(\"../../utils/util\");\nvar UserCustomActions = (function (_super) {\n __extends(UserCustomActions, _super);\n function UserCustomActions(baseUrl, path) {\n if (path === void 0) { path = \"usercustomactions\"; }\n _super.call(this, baseUrl, path);\n }\n UserCustomActions.prototype.getById = function (id) {\n return new UserCustomAction(this, \"(\" + id + \")\");\n };\n UserCustomActions.prototype.add = function (properties) {\n var _this = this;\n var postBody = JSON.stringify(util_1.Util.extend({ __metadata: { \"type\": \"SP.UserCustomAction\" } }, properties));\n return this.post({ body: postBody }).then(function (data) {\n return {\n action: _this.getById(data.Id),\n data: data,\n };\n });\n };\n UserCustomActions.prototype.clear = function () {\n var a = new UserCustomActions(this, \"clear\");\n return a.post();\n };\n return UserCustomActions;\n}(queryable_1.QueryableCollection));\nexports.UserCustomActions = UserCustomActions;\nvar UserCustomAction = (function (_super) {\n __extends(UserCustomAction, _super);\n function UserCustomAction(baseUrl, path) {\n _super.call(this, baseUrl, path);\n }\n UserCustomAction.prototype.update = function (properties) {\n var _this = this;\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": \"SP.UserCustomAction\" },\n }, properties));\n return this.post({\n body: postBody,\n headers: {\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n return {\n action: _this,\n data: data,\n };\n });\n };\n return UserCustomAction;\n}(queryable_1.QueryableInstance));\nexports.UserCustomAction = UserCustomAction;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar FileUtil = require(\"../../utils/files\");\nvar odata_1 = require(\"./odata\");\nvar UserProfileQuery = (function (_super) {\n __extends(UserProfileQuery, _super);\n function UserProfileQuery(baseUrl, path) {\n if (path === void 0) { path = \"_api/sp.userprofiles.peoplemanager\"; }\n _super.call(this, baseUrl, path);\n this.profileLoader = new ProfileLoader(baseUrl);\n }\n Object.defineProperty(UserProfileQuery.prototype, \"editProfileLink\", {\n get: function () {\n var q = new UserProfileQuery(this, \"EditProfileLink\");\n return q.getAs(odata_1.ODataValue());\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(UserProfileQuery.prototype, \"isMyPeopleListPublic\", {\n get: function () {\n var q = new UserProfileQuery(this, \"IsMyPeopleListPublic\");\n return q.getAs(odata_1.ODataValue());\n },\n enumerable: true,\n configurable: true\n });\n UserProfileQuery.prototype.amIFollowedBy = function (loginName) {\n var q = new UserProfileQuery(this, \"amifollowedby(@v)\");\n q.query.add(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\n return q.get();\n };\n UserProfileQuery.prototype.amIFollowing = function (loginName) {\n var q = new UserProfileQuery(this, \"amifollowing(@v)\");\n q.query.add(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\n return q.get();\n };\n UserProfileQuery.prototype.getFollowedTags = function (maxCount) {\n if (maxCount === void 0) { maxCount = 20; }\n var q = new UserProfileQuery(this, \"getfollowedtags(\" + maxCount + \")\");\n return q.get();\n };\n UserProfileQuery.prototype.getFollowersFor = function (loginName) {\n var q = new UserProfileQuery(this, \"getfollowersfor(@v)\");\n q.query.add(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\n return q.get();\n };\n Object.defineProperty(UserProfileQuery.prototype, \"myFollowers\", {\n get: function () {\n return new queryable_1.QueryableCollection(this, \"getmyfollowers\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(UserProfileQuery.prototype, \"myProperties\", {\n get: function () {\n return new UserProfileQuery(this, \"getmyproperties\");\n },\n enumerable: true,\n configurable: true\n });\n UserProfileQuery.prototype.getPeopleFollowedBy = function (loginName) {\n var q = new UserProfileQuery(this, \"getpeoplefollowedby(@v)\");\n q.query.add(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\n return q.get();\n };\n UserProfileQuery.prototype.getPropertiesFor = function (loginName) {\n var q = new UserProfileQuery(this, \"getpropertiesfor(@v)\");\n q.query.add(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\n return q.get();\n };\n Object.defineProperty(UserProfileQuery.prototype, \"trendingTags\", {\n get: function () {\n var q = new UserProfileQuery(this, null);\n q.concat(\".gettrendingtags\");\n return q.get();\n },\n enumerable: true,\n configurable: true\n });\n UserProfileQuery.prototype.getUserProfilePropertyFor = function (loginName, propertyName) {\n var q = new UserProfileQuery(this, \"getuserprofilepropertyfor(accountname=@v, propertyname='\" + propertyName + \"')\");\n q.query.add(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\n return q.get();\n };\n UserProfileQuery.prototype.hideSuggestion = function (loginName) {\n var q = new UserProfileQuery(this, \"hidesuggestion(@v)\");\n q.query.add(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\n return q.post();\n };\n UserProfileQuery.prototype.isFollowing = function (follower, followee) {\n var q = new UserProfileQuery(this, null);\n q.concat(\".isfollowing(possiblefolloweraccountname=@v, possiblefolloweeaccountname=@y)\");\n q.query.add(\"@v\", \"'\" + encodeURIComponent(follower) + \"'\");\n q.query.add(\"@y\", \"'\" + encodeURIComponent(followee) + \"'\");\n return q.get();\n };\n UserProfileQuery.prototype.setMyProfilePic = function (profilePicSource) {\n var _this = this;\n return FileUtil.readBlobAsArrayBuffer(profilePicSource).then(function (buffer) {\n var request = new UserProfileQuery(_this, \"setmyprofilepicture\");\n return request.post({\n body: String.fromCharCode.apply(null, new Uint16Array(buffer)),\n });\n });\n };\n UserProfileQuery.prototype.createPersonalSiteEnqueueBulk = function () {\n var emails = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n emails[_i - 0] = arguments[_i];\n }\n return this.profileLoader.createPersonalSiteEnqueueBulk(emails);\n };\n Object.defineProperty(UserProfileQuery.prototype, \"ownerUserProfile\", {\n get: function () {\n return this.profileLoader.ownerUserProfile;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(UserProfileQuery.prototype, \"userProfile\", {\n get: function () {\n return this.profileLoader.userProfile;\n },\n enumerable: true,\n configurable: true\n });\n UserProfileQuery.prototype.createPersonalSite = function (interactiveRequest) {\n if (interactiveRequest === void 0) { interactiveRequest = false; }\n return this.profileLoader.createPersonalSite(interactiveRequest);\n };\n UserProfileQuery.prototype.shareAllSocialData = function (share) {\n return this.profileLoader.shareAllSocialData(share);\n };\n return UserProfileQuery;\n}(queryable_1.QueryableInstance));\nexports.UserProfileQuery = UserProfileQuery;\nvar ProfileLoader = (function (_super) {\n __extends(ProfileLoader, _super);\n function ProfileLoader(baseUrl, path) {\n if (path === void 0) { path = \"_api/sp.userprofiles.profileloader.getprofileloader\"; }\n _super.call(this, baseUrl, path);\n }\n ProfileLoader.prototype.createPersonalSiteEnqueueBulk = function (emails) {\n var q = new ProfileLoader(this, \"createpersonalsiteenqueuebulk\");\n var postBody = JSON.stringify({ \"emailIDs\": emails });\n return q.post({\n body: postBody,\n });\n };\n Object.defineProperty(ProfileLoader.prototype, \"ownerUserProfile\", {\n get: function () {\n var q = this.getParent(ProfileLoader, this.parentUrl, \"_api/sp.userprofiles.profileloader.getowneruserprofile\");\n return q.postAs();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ProfileLoader.prototype, \"userProfile\", {\n get: function () {\n var q = new ProfileLoader(this, \"getuserprofile\");\n return q.postAs();\n },\n enumerable: true,\n configurable: true\n });\n ProfileLoader.prototype.createPersonalSite = function (interactiveRequest) {\n if (interactiveRequest === void 0) { interactiveRequest = false; }\n var q = new ProfileLoader(this, \"getuserprofile/createpersonalsiteenque(\" + interactiveRequest + \")\\\",\");\n return q.post();\n };\n ProfileLoader.prototype.shareAllSocialData = function (share) {\n var q = new ProfileLoader(this, \"getuserprofile/shareallsocialdata(\" + share + \")\\\",\");\n return q.post();\n };\n return ProfileLoader;\n}(queryable_1.Queryable));\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar util_1 = require(\"../../utils/util\");\nvar Views = (function (_super) {\n __extends(Views, _super);\n function Views(baseUrl) {\n _super.call(this, baseUrl, \"views\");\n }\n Views.prototype.getById = function (id) {\n var v = new View(this);\n v.concat(\"('\" + id + \"')\");\n return v;\n };\n Views.prototype.getByTitle = function (title) {\n return new View(this, \"getByTitle('\" + title + \"')\");\n };\n Views.prototype.add = function (title, personalView, additionalSettings) {\n var _this = this;\n if (personalView === void 0) { personalView = false; }\n if (additionalSettings === void 0) { additionalSettings = {}; }\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": \"SP.View\" },\n \"Title\": title,\n \"PersonalView\": personalView,\n }, additionalSettings));\n return this.postAs({ body: postBody }).then(function (data) {\n return {\n data: data,\n view: _this.getById(data.Id),\n };\n });\n };\n return Views;\n}(queryable_1.QueryableCollection));\nexports.Views = Views;\nvar View = (function (_super) {\n __extends(View, _super);\n function View(baseUrl, path) {\n _super.call(this, baseUrl, path);\n }\n Object.defineProperty(View.prototype, \"fields\", {\n get: function () {\n return new ViewFields(this);\n },\n enumerable: true,\n configurable: true\n });\n View.prototype.update = function (properties) {\n var _this = this;\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": \"SP.View\" },\n }, properties));\n return this.post({\n body: postBody,\n headers: {\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n return {\n data: data,\n view: _this,\n };\n });\n };\n View.prototype.delete = function () {\n return this.post({\n headers: {\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n View.prototype.renderAsHtml = function () {\n var q = new queryable_1.Queryable(this, \"renderashtml\");\n return q.get();\n };\n return View;\n}(queryable_1.QueryableInstance));\nexports.View = View;\nvar ViewFields = (function (_super) {\n __extends(ViewFields, _super);\n function ViewFields(baseUrl, path) {\n if (path === void 0) { path = \"viewfields\"; }\n _super.call(this, baseUrl, path);\n }\n ViewFields.prototype.getSchemaXml = function () {\n var q = new queryable_1.Queryable(this, \"schemaxml\");\n return q.get();\n };\n ViewFields.prototype.add = function (fieldTitleOrInternalName) {\n var q = new ViewFields(this, \"addviewfield('\" + fieldTitleOrInternalName + \"')\");\n return q.post();\n };\n ViewFields.prototype.move = function (fieldInternalName, index) {\n var q = new ViewFields(this, \"moveviewfieldto\");\n var postBody = JSON.stringify({ \"field\": fieldInternalName, \"index\": index });\n return q.post({ body: postBody });\n };\n ViewFields.prototype.removeAll = function () {\n var q = new ViewFields(this, \"removeallviewfields\");\n return q.post();\n };\n ViewFields.prototype.remove = function (fieldInternalName) {\n var q = new ViewFields(this, \"removeviewfield('\" + fieldInternalName + \"')\");\n return q.post();\n };\n return ViewFields;\n}(queryable_1.QueryableCollection));\nexports.ViewFields = ViewFields;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar queryablesecurable_1 = require(\"./queryablesecurable\");\nvar lists_1 = require(\"./lists\");\nvar fields_1 = require(\"./fields\");\nvar navigation_1 = require(\"./navigation\");\nvar sitegroups_1 = require(\"./sitegroups\");\nvar contenttypes_1 = require(\"./contenttypes\");\nvar folders_1 = require(\"./folders\");\nvar roles_1 = require(\"./roles\");\nvar files_1 = require(\"./files\");\nvar util_1 = require(\"../../utils/util\");\nvar lists_2 = require(\"./lists\");\nvar siteusers_1 = require(\"./siteusers\");\nvar usercustomactions_1 = require(\"./usercustomactions\");\nvar odata_1 = require(\"./odata\");\nvar Webs = (function (_super) {\n __extends(Webs, _super);\n function Webs(baseUrl, webPath) {\n if (webPath === void 0) { webPath = \"webs\"; }\n _super.call(this, baseUrl, webPath);\n }\n Webs.prototype.add = function (title, url, description, template, language, inheritPermissions, additionalSettings) {\n if (description === void 0) { description = \"\"; }\n if (template === void 0) { template = \"STS\"; }\n if (language === void 0) { language = 1033; }\n if (inheritPermissions === void 0) { inheritPermissions = true; }\n if (additionalSettings === void 0) { additionalSettings = {}; }\n var props = util_1.Util.extend({\n Description: description,\n Language: language,\n Title: title,\n Url: url,\n UseSamePermissionsAsParentSite: inheritPermissions,\n WebTemplate: template,\n }, additionalSettings);\n var postBody = JSON.stringify({\n \"parameters\": util_1.Util.extend({\n \"__metadata\": { \"type\": \"SP.WebCreationInformation\" },\n }, props),\n });\n var q = new Webs(this, \"add\");\n return q.post({ body: postBody }).then(function (data) {\n return {\n data: data,\n web: new Web(odata_1.extractOdataId(data), \"\"),\n };\n });\n };\n return Webs;\n}(queryable_1.QueryableCollection));\nexports.Webs = Webs;\nvar Web = (function (_super) {\n __extends(Web, _super);\n function Web(baseUrl, path) {\n if (path === void 0) { path = \"_api/web\"; }\n _super.call(this, baseUrl, path);\n }\n Object.defineProperty(Web.prototype, \"webs\", {\n get: function () {\n return new Webs(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"contentTypes\", {\n get: function () {\n return new contenttypes_1.ContentTypes(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"lists\", {\n get: function () {\n return new lists_1.Lists(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"fields\", {\n get: function () {\n return new fields_1.Fields(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"availablefields\", {\n get: function () {\n return new fields_1.Fields(this, \"availablefields\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"navigation\", {\n get: function () {\n return new navigation_1.Navigation(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"siteUsers\", {\n get: function () {\n return new siteusers_1.SiteUsers(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"siteGroups\", {\n get: function () {\n return new sitegroups_1.SiteGroups(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"folders\", {\n get: function () {\n return new folders_1.Folders(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"userCustomActions\", {\n get: function () {\n return new usercustomactions_1.UserCustomActions(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"roleDefinitions\", {\n get: function () {\n return new roles_1.RoleDefinitions(this);\n },\n enumerable: true,\n configurable: true\n });\n Web.prototype.getFolderByServerRelativeUrl = function (folderRelativeUrl) {\n return new folders_1.Folder(this, \"getFolderByServerRelativeUrl('\" + folderRelativeUrl + \"')\");\n };\n Web.prototype.getFileByServerRelativeUrl = function (fileRelativeUrl) {\n return new files_1.File(this, \"getFileByServerRelativeUrl('\" + fileRelativeUrl + \"')\");\n };\n Web.prototype.getList = function (listRelativeUrl) {\n return new lists_2.List(this, \"getList('\" + listRelativeUrl + \"')\");\n };\n Web.prototype.update = function (properties) {\n var _this = this;\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": \"SP.Web\" },\n }, properties));\n return this.post({\n body: postBody,\n headers: {\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n return {\n data: data,\n web: _this,\n };\n });\n };\n Web.prototype.delete = function () {\n return this.post({\n headers: {\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n Web.prototype.applyTheme = function (colorPaletteUrl, fontSchemeUrl, backgroundImageUrl, shareGenerated) {\n var postBody = JSON.stringify({\n backgroundImageUrl: backgroundImageUrl,\n colorPaletteUrl: colorPaletteUrl,\n fontSchemeUrl: fontSchemeUrl,\n shareGenerated: shareGenerated,\n });\n var q = new Web(this, \"applytheme\");\n return q.post({ body: postBody });\n };\n Web.prototype.applyWebTemplate = function (template) {\n var q = new Web(this, \"applywebtemplate\");\n q.concat(\"(@t)\");\n q.query.add(\"@t\", template);\n return q.post();\n };\n Web.prototype.doesUserHavePermissions = function (perms) {\n var q = new Web(this, \"doesuserhavepermissions\");\n q.concat(\"(@p)\");\n q.query.add(\"@p\", JSON.stringify(perms));\n return q.get();\n };\n Web.prototype.ensureUser = function (loginName) {\n var postBody = JSON.stringify({\n logonName: loginName,\n });\n var q = new Web(this, \"ensureuser\");\n return q.post({ body: postBody });\n };\n Web.prototype.availableWebTemplates = function (language, includeCrossLanugage) {\n if (language === void 0) { language = 1033; }\n if (includeCrossLanugage === void 0) { includeCrossLanugage = true; }\n return new queryable_1.QueryableCollection(this, \"getavailablewebtemplates(lcid=\" + language + \", doincludecrosslanguage=\" + includeCrossLanugage + \")\");\n };\n Web.prototype.getCatalog = function (type) {\n var q = new Web(this, \"getcatalog(\" + type + \")\");\n q.select(\"Id\");\n return q.get().then(function (data) {\n return new lists_2.List(odata_1.extractOdataId(data));\n });\n };\n Web.prototype.getChanges = function (query) {\n var postBody = JSON.stringify({ \"query\": util_1.Util.extend({ \"__metadata\": { \"type\": \"SP.ChangeQuery\" } }, query) });\n var q = new Web(this, \"getchanges\");\n return q.post({ body: postBody });\n };\n Object.defineProperty(Web.prototype, \"customListTemplate\", {\n get: function () {\n return new queryable_1.QueryableCollection(this, \"getcustomlisttemplates\");\n },\n enumerable: true,\n configurable: true\n });\n Web.prototype.getUserById = function (id) {\n return new siteusers_1.SiteUser(this, \"getUserById(\" + id + \")\");\n };\n Web.prototype.mapToIcon = function (filename, size, progId) {\n if (size === void 0) { size = 0; }\n if (progId === void 0) { progId = \"\"; }\n var q = new Web(this, \"maptoicon(filename='\" + filename + \"', progid='\" + progId + \"', size=\" + size + \")\");\n return q.get();\n };\n return Web;\n}(queryablesecurable_1.QueryableSecurable));\nexports.Web = Web;\n","\"use strict\";\nfunction __export(m) {\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\n}\n__export(require(\"../sharepoint/rest/index\"));\nvar httpclient_1 = require(\"../net/httpclient\");\nexports.HttpClient = httpclient_1.HttpClient;\nvar collections_1 = require(\"../collections/collections\");\nexports.Dictionary = collections_1.Dictionary;\nvar util_1 = require(\"../utils/util\");\nexports.Util = util_1.Util;\n__export(require(\"../utils/logging\"));\n","\"use strict\";\nfunction readBlobAsText(blob) {\n return readBlobAs(blob, \"string\");\n}\nexports.readBlobAsText = readBlobAsText;\nfunction readBlobAsArrayBuffer(blob) {\n return readBlobAs(blob, \"buffer\");\n}\nexports.readBlobAsArrayBuffer = readBlobAsArrayBuffer;\nfunction readBlobAs(blob, mode) {\n return new Promise(function (resolve, reject) {\n var reader = new FileReader();\n reader.onload = function (e) {\n resolve(e.target.result);\n };\n switch (mode) {\n case \"string\":\n reader.readAsText(blob);\n break;\n case \"buffer\":\n reader.readAsArrayBuffer(blob);\n break;\n }\n });\n}\n","\"use strict\";\n(function (LogLevel) {\n LogLevel[LogLevel[\"Verbose\"] = 0] = \"Verbose\";\n LogLevel[LogLevel[\"Info\"] = 1] = \"Info\";\n LogLevel[LogLevel[\"Warning\"] = 2] = \"Warning\";\n LogLevel[LogLevel[\"Error\"] = 3] = \"Error\";\n LogLevel[LogLevel[\"Off\"] = 99] = \"Off\";\n})(exports.LogLevel || (exports.LogLevel = {}));\nvar LogLevel = exports.LogLevel;\nvar Logger = (function () {\n function Logger() {\n }\n Object.defineProperty(Logger, \"activeLogLevel\", {\n get: function () {\n return Logger.instance.activeLogLevel;\n },\n set: function (value) {\n Logger.instance.activeLogLevel = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Logger, \"instance\", {\n get: function () {\n if (typeof Logger._instance === \"undefined\" || Logger._instance === null) {\n Logger._instance = new LoggerImpl();\n }\n return Logger._instance;\n },\n enumerable: true,\n configurable: true\n });\n Logger.subscribe = function () {\n var listeners = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n listeners[_i - 0] = arguments[_i];\n }\n for (var i = 0; i < listeners.length; i++) {\n Logger.instance.subscribe(listeners[i]);\n }\n };\n Logger.clearSubscribers = function () {\n return Logger.instance.clearSubscribers();\n };\n Object.defineProperty(Logger, \"count\", {\n get: function () {\n return Logger.instance.count;\n },\n enumerable: true,\n configurable: true\n });\n Logger.write = function (message, level) {\n if (level === void 0) { level = LogLevel.Verbose; }\n Logger.instance.log({ level: level, message: message });\n };\n Logger.log = function (entry) {\n Logger.instance.log(entry);\n };\n Logger.measure = function (name, f) {\n return Logger.instance.measure(name, f);\n };\n return Logger;\n}());\nexports.Logger = Logger;\nvar LoggerImpl = (function () {\n function LoggerImpl(activeLogLevel, subscribers) {\n if (activeLogLevel === void 0) { activeLogLevel = LogLevel.Warning; }\n if (subscribers === void 0) { subscribers = []; }\n this.activeLogLevel = activeLogLevel;\n this.subscribers = subscribers;\n }\n LoggerImpl.prototype.subscribe = function (listener) {\n this.subscribers.push(listener);\n };\n LoggerImpl.prototype.clearSubscribers = function () {\n var s = this.subscribers.slice(0);\n this.subscribers.length = 0;\n return s;\n };\n Object.defineProperty(LoggerImpl.prototype, \"count\", {\n get: function () {\n return this.subscribers.length;\n },\n enumerable: true,\n configurable: true\n });\n LoggerImpl.prototype.write = function (message, level) {\n if (level === void 0) { level = LogLevel.Verbose; }\n this.log({ level: level, message: message });\n };\n LoggerImpl.prototype.log = function (entry) {\n if (typeof entry === \"undefined\" || entry.level < this.activeLogLevel) {\n return;\n }\n for (var i = 0; i < this.subscribers.length; i++) {\n this.subscribers[i].log(entry);\n }\n };\n LoggerImpl.prototype.measure = function (name, f) {\n console.profile(name);\n try {\n return f();\n }\n finally {\n console.profileEnd();\n }\n };\n return LoggerImpl;\n}());\nvar ConsoleListener = (function () {\n function ConsoleListener() {\n }\n ConsoleListener.prototype.log = function (entry) {\n var msg = this.format(entry);\n switch (entry.level) {\n case LogLevel.Verbose:\n case LogLevel.Info:\n console.log(msg);\n break;\n case LogLevel.Warning:\n console.warn(msg);\n break;\n case LogLevel.Error:\n console.error(msg);\n break;\n }\n };\n ConsoleListener.prototype.format = function (entry) {\n return \"Message: \" + entry.message + \". Data: \" + JSON.stringify(entry.data);\n };\n return ConsoleListener;\n}());\nexports.ConsoleListener = ConsoleListener;\nvar AzureInsightsListener = (function () {\n function AzureInsightsListener(azureInsightsInstrumentationKey) {\n this.azureInsightsInstrumentationKey = azureInsightsInstrumentationKey;\n var appInsights = window[\"appInsights\"] || function (config) {\n function r(config) {\n t[config] = function () {\n var i = arguments;\n t.queue.push(function () { t[config].apply(t, i); });\n };\n }\n var t = { config: config }, u = document, e = window, o = \"script\", s = u.createElement(o), i, f;\n for (s.src = config.url || \"//az416426.vo.msecnd.net/scripts/a/ai.0.js\", u.getElementsByTagName(o)[0].parentNode.appendChild(s), t.cookie = u.cookie, t.queue = [], i = [\"Event\", \"Exception\", \"Metric\", \"PageView\", \"Trace\"]; i.length;) {\n r(\"track\" + i.pop());\n }\n return r(\"setAuthenticatedUserContext\"), r(\"clearAuthenticatedUserContext\"), config.disableExceptionTracking || (i = \"onerror\", r(\"_\" + i), f = e[i], e[i] = function (config, r, u, e, o) {\n var s = f && f(config, r, u, e, o);\n return s !== !0 && t[\"_\" + i](config, r, u, e, o), s;\n }), t;\n }({\n instrumentationKey: this.azureInsightsInstrumentationKey\n });\n window[\"appInsights\"] = appInsights;\n }\n AzureInsightsListener.prototype.log = function (entry) {\n var ai = window[\"appInsights\"];\n var msg = this.format(entry);\n if (entry.level === LogLevel.Error) {\n ai.trackException(msg);\n }\n else {\n ai.trackEvent(msg);\n }\n };\n AzureInsightsListener.prototype.format = function (entry) {\n return \"Message: \" + entry.message + \". Data: \" + JSON.stringify(entry.data);\n };\n return AzureInsightsListener;\n}());\nexports.AzureInsightsListener = AzureInsightsListener;\nvar FunctionListener = (function () {\n function FunctionListener(method) {\n this.method = method;\n }\n FunctionListener.prototype.log = function (entry) {\n this.method(entry);\n };\n return FunctionListener;\n}());\nexports.FunctionListener = FunctionListener;\n","\"use strict\";\nvar util_1 = require(\"./util\");\nvar PnPClientStorageWrapper = (function () {\n function PnPClientStorageWrapper(store, defaultTimeoutMinutes) {\n this.store = store;\n this.defaultTimeoutMinutes = defaultTimeoutMinutes;\n this.defaultTimeoutMinutes = (defaultTimeoutMinutes === void 0) ? 5 : defaultTimeoutMinutes;\n this.enabled = this.test();\n }\n PnPClientStorageWrapper.prototype.get = function (key) {\n if (!this.enabled) {\n return null;\n }\n var o = this.store.getItem(key);\n if (o == null) {\n return null;\n }\n var persistable = JSON.parse(o);\n if (new Date(persistable.expiration) <= new Date()) {\n this.delete(key);\n return null;\n }\n else {\n return persistable.value;\n }\n };\n PnPClientStorageWrapper.prototype.put = function (key, o, expire) {\n if (this.enabled) {\n this.store.setItem(key, this.createPersistable(o, expire));\n }\n };\n PnPClientStorageWrapper.prototype.delete = function (key) {\n if (this.enabled) {\n this.store.removeItem(key);\n }\n };\n PnPClientStorageWrapper.prototype.getOrPut = function (key, getter, expire) {\n var _this = this;\n if (!this.enabled) {\n return getter();\n }\n if (!util_1.Util.isFunction(getter)) {\n throw \"Function expected for parameter 'getter'.\";\n }\n return new Promise(function (resolve, reject) {\n var o = _this.get(key);\n if (o == null) {\n getter().then(function (d) {\n _this.put(key, d);\n resolve(d);\n });\n }\n else {\n resolve(o);\n }\n });\n };\n PnPClientStorageWrapper.prototype.test = function () {\n var str = \"test\";\n try {\n this.store.setItem(str, str);\n this.store.removeItem(str);\n return true;\n }\n catch (e) {\n return false;\n }\n };\n PnPClientStorageWrapper.prototype.createPersistable = function (o, expire) {\n if (typeof expire === \"undefined\") {\n expire = util_1.Util.dateAdd(new Date(), \"minute\", this.defaultTimeoutMinutes);\n }\n return JSON.stringify({ expiration: expire, value: o });\n };\n return PnPClientStorageWrapper;\n}());\nexports.PnPClientStorageWrapper = PnPClientStorageWrapper;\nvar PnPClientStorage = (function () {\n function PnPClientStorage() {\n this.local = typeof localStorage !== \"undefined\" ? new PnPClientStorageWrapper(localStorage) : null;\n this.session = typeof sessionStorage !== \"undefined\" ? new PnPClientStorageWrapper(sessionStorage) : null;\n }\n return PnPClientStorage;\n}());\nexports.PnPClientStorage = PnPClientStorage;\n","\"use strict\";\nvar Util = (function () {\n function Util() {\n }\n Util.getCtxCallback = function (context, method) {\n var params = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n params[_i - 2] = arguments[_i];\n }\n return function () {\n method.apply(context, params);\n };\n };\n Util.urlParamExists = function (name) {\n name = name.replace(/[\\[]/, \"\\\\[\").replace(/[\\]]/, \"\\\\]\");\n var regex = new RegExp(\"[\\\\?&]\" + name + \"=([^&#]*)\");\n return regex.test(location.search);\n };\n Util.getUrlParamByName = function (name) {\n name = name.replace(/[\\[]/, \"\\\\[\").replace(/[\\]]/, \"\\\\]\");\n var regex = new RegExp(\"[\\\\?&]\" + name + \"=([^&#]*)\");\n var results = regex.exec(location.search);\n return results == null ? \"\" : decodeURIComponent(results[1].replace(/\\+/g, \" \"));\n };\n Util.getUrlParamBoolByName = function (name) {\n var p = this.getUrlParamByName(name);\n var isFalse = (p === \"\" || /false|0/i.test(p));\n return !isFalse;\n };\n Util.stringInsert = function (target, index, s) {\n if (index > 0) {\n return target.substring(0, index) + s + target.substring(index, target.length);\n }\n return s + target;\n };\n Util.dateAdd = function (date, interval, units) {\n var ret = new Date(date.toLocaleString());\n switch (interval.toLowerCase()) {\n case \"year\":\n ret.setFullYear(ret.getFullYear() + units);\n break;\n case \"quarter\":\n ret.setMonth(ret.getMonth() + 3 * units);\n break;\n case \"month\":\n ret.setMonth(ret.getMonth() + units);\n break;\n case \"week\":\n ret.setDate(ret.getDate() + 7 * units);\n break;\n case \"day\":\n ret.setDate(ret.getDate() + units);\n break;\n case \"hour\":\n ret.setTime(ret.getTime() + units * 3600000);\n break;\n case \"minute\":\n ret.setTime(ret.getTime() + units * 60000);\n break;\n case \"second\":\n ret.setTime(ret.getTime() + units * 1000);\n break;\n default:\n ret = undefined;\n break;\n }\n return ret;\n };\n Util.loadStylesheet = function (path, avoidCache) {\n if (avoidCache) {\n path += \"?\" + encodeURIComponent((new Date()).getTime().toString());\n }\n var head = document.getElementsByTagName(\"head\");\n if (head.length > 0) {\n var e = document.createElement(\"link\");\n head[0].appendChild(e);\n e.setAttribute(\"type\", \"text/css\");\n e.setAttribute(\"rel\", \"stylesheet\");\n e.setAttribute(\"href\", path);\n }\n };\n Util.combinePaths = function () {\n var paths = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n paths[_i - 0] = arguments[_i];\n }\n var parts = [];\n for (var i = 0; i < paths.length; i++) {\n if (typeof paths[i] !== \"undefined\" && paths[i] !== null) {\n parts.push(paths[i].replace(/^[\\\\|\\/]/, \"\").replace(/[\\\\|\\/]$/, \"\"));\n }\n }\n return parts.join(\"/\").replace(/\\\\/, \"/\");\n };\n Util.getRandomString = function (chars) {\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n for (var i = 0; i < chars; i++) {\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n }\n return text;\n };\n Util.getGUID = function () {\n var d = new Date().getTime();\n var guid = \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g, function (c) {\n var r = (d + Math.random() * 16) % 16 | 0;\n d = Math.floor(d / 16);\n return (c === \"x\" ? r : (r & 0x3 | 0x8)).toString(16);\n });\n return guid;\n };\n Util.isFunction = function (candidateFunction) {\n return typeof candidateFunction === \"function\";\n };\n Util.isArray = function (array) {\n if (Array.isArray) {\n return Array.isArray(array);\n }\n return array && typeof array.length === \"number\" && array.constructor === Array;\n };\n Util.stringIsNullOrEmpty = function (s) {\n return typeof s === \"undefined\" || s === null || s === \"\";\n };\n Util.extend = function (target, source, noOverwrite) {\n if (noOverwrite === void 0) { noOverwrite = false; }\n var result = {};\n for (var id in target) {\n result[id] = target[id];\n }\n var check = noOverwrite ? function (o, i) { return !o.hasOwnProperty(i); } : function (o, i) { return true; };\n for (var id in source) {\n if (check(result, id)) {\n result[id] = source[id];\n }\n }\n return result;\n };\n Util.applyMixins = function (derivedCtor) {\n var baseCtors = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n baseCtors[_i - 1] = arguments[_i];\n }\n baseCtors.forEach(function (baseCtor) {\n Object.getOwnPropertyNames(baseCtor.prototype).forEach(function (name) {\n derivedCtor.prototype[name] = baseCtor.prototype[name];\n });\n });\n };\n Util.isUrlAbsolute = function (url) {\n return /^https?:\\/\\/|^\\/\\//i.test(url);\n };\n Util.makeUrlAbsolute = function (url) {\n if (Util.isUrlAbsolute(url)) {\n return url;\n }\n if (typeof global._spPageContextInfo !== \"undefined\") {\n if (global._spPageContextInfo.hasOwnProperty(\"webAbsoluteUrl\")) {\n return Util.combinePaths(global._spPageContextInfo.webAbsoluteUrl, url);\n }\n else if (global._spPageContextInfo.hasOwnProperty(\"webServerRelativeUrl\")) {\n return Util.combinePaths(global._spPageContextInfo.webServerRelativeUrl, url);\n }\n }\n else {\n return url;\n }\n };\n return Util;\n}());\nexports.Util = Util;\n"]} \ No newline at end of file +{"version":3,"sources":["node_modules/browser-pack/_prelude.js","build/src/collections/collections.js","build/src/configuration/configuration.js","build/src/configuration/pnplibconfig.js","build/src/configuration/providers/cachingConfigurationProvider.js","build/src/configuration/providers/providers.js","build/src/configuration/providers/spListConfigurationProvider.js","build/src/net/digestcache.js","build/src/net/fetchclient.js","build/src/net/httpclient.js","build/src/net/nodefetchclientbrowser.js","build/src/net/sprequestexecutorclient.js","build/src/pnp.js","build/src/sharepoint/rest/caching.js","build/src/sharepoint/rest/contenttypes.js","build/src/sharepoint/rest/fields.js","build/src/sharepoint/rest/files.js","build/src/sharepoint/rest/folders.js","build/src/sharepoint/rest/forms.js","build/src/sharepoint/rest/index.js","build/src/sharepoint/rest/items.js","build/src/sharepoint/rest/lists.js","build/src/sharepoint/rest/navigation.js","build/src/sharepoint/rest/odata.js","build/src/sharepoint/rest/queryable.js","build/src/sharepoint/rest/queryablesecurable.js","build/src/sharepoint/rest/quicklaunch.js","build/src/sharepoint/rest/rest.js","build/src/sharepoint/rest/roles.js","build/src/sharepoint/rest/search.js","build/src/sharepoint/rest/searchsuggest.js","build/src/sharepoint/rest/site.js","build/src/sharepoint/rest/sitegroups.js","build/src/sharepoint/rest/siteusers.js","build/src/sharepoint/rest/subscriptions.js","build/src/sharepoint/rest/topnavigationbar.js","build/src/sharepoint/rest/types.js","build/src/sharepoint/rest/usercustomactions.js","build/src/sharepoint/rest/userprofiles.js","build/src/sharepoint/rest/views.js","build/src/sharepoint/rest/webs.js","build/src/types/index.js","build/src/utils/files.js","build/src/utils/logging.js","build/src/utils/storage.js","build/src/utils/util.js"],"names":[],"mappings":";;;;;;;;AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AClDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AC5FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1CA;AACA;AACA;AACA;AACA;AACA;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;ACtDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrSA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5MA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7SA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;ACrFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"pnp.js","sourcesContent":["(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o -1) {\n this.values[index] = o;\n }\n else {\n this.keys.push(key);\n this.values.push(o);\n }\n };\n Dictionary.prototype.merge = function (source) {\n if (util_1.Util.isFunction(source[\"getKeys\"])) {\n var sourceAsDictionary = source;\n var keys = sourceAsDictionary.getKeys();\n var l = keys.length;\n for (var i = 0; i < l; i++) {\n this.add(keys[i], sourceAsDictionary.get(keys[i]));\n }\n }\n else {\n var sourceAsHash = source;\n for (var key in sourceAsHash) {\n if (sourceAsHash.hasOwnProperty(key)) {\n this.add(key, source[key]);\n }\n }\n }\n };\n Dictionary.prototype.remove = function (key) {\n var index = this.keys.indexOf(key);\n if (index < 0) {\n return null;\n }\n var val = this.values[index];\n this.keys.splice(index, 1);\n this.values.splice(index, 1);\n return val;\n };\n Dictionary.prototype.getKeys = function () {\n return this.keys;\n };\n Dictionary.prototype.getValues = function () {\n return this.values;\n };\n Dictionary.prototype.clear = function () {\n this.keys = [];\n this.values = [];\n };\n Dictionary.prototype.count = function () {\n return this.keys.length;\n };\n return Dictionary;\n}());\nexports.Dictionary = Dictionary;\n","\"use strict\";\nvar Collections = require(\"../collections/collections\");\nvar providers = require(\"./providers/providers\");\nvar Settings = (function () {\n function Settings() {\n this.Providers = providers;\n this._settings = new Collections.Dictionary();\n }\n Settings.prototype.add = function (key, value) {\n this._settings.add(key, value);\n };\n Settings.prototype.addJSON = function (key, value) {\n this._settings.add(key, JSON.stringify(value));\n };\n Settings.prototype.apply = function (hash) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n try {\n _this._settings.merge(hash);\n resolve();\n }\n catch (e) {\n reject(e);\n }\n });\n };\n Settings.prototype.load = function (provider) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n provider.getConfiguration().then(function (value) {\n _this._settings.merge(value);\n resolve();\n }).catch(function (reason) {\n reject(reason);\n });\n });\n };\n Settings.prototype.get = function (key) {\n return this._settings.get(key);\n };\n Settings.prototype.getJSON = function (key) {\n var o = this.get(key);\n if (typeof o === \"undefined\" || o === null) {\n return o;\n }\n return JSON.parse(o);\n };\n return Settings;\n}());\nexports.Settings = Settings;\n","\"use strict\";\nvar RuntimeConfigImpl = (function () {\n function RuntimeConfigImpl() {\n this._headers = null;\n this._defaultCachingStore = \"session\";\n this._defaultCachingTimeoutSeconds = 30;\n this._globalCacheDisable = false;\n this._useSPRequestExecutor = false;\n }\n RuntimeConfigImpl.prototype.set = function (config) {\n if (config.hasOwnProperty(\"headers\")) {\n this._headers = config.headers;\n }\n if (config.hasOwnProperty(\"globalCacheDisable\")) {\n this._globalCacheDisable = config.globalCacheDisable;\n }\n if (config.hasOwnProperty(\"defaultCachingStore\")) {\n this._defaultCachingStore = config.defaultCachingStore;\n }\n if (config.hasOwnProperty(\"defaultCachingTimeoutSeconds\")) {\n this._defaultCachingTimeoutSeconds = config.defaultCachingTimeoutSeconds;\n }\n if (config.hasOwnProperty(\"useSPRequestExecutor\")) {\n this._useSPRequestExecutor = config.useSPRequestExecutor;\n }\n if (config.hasOwnProperty(\"nodeClientOptions\")) {\n this._useNodeClient = true;\n this._useSPRequestExecutor = false;\n this._nodeClientData = config.nodeClientOptions;\n global._spPageContextInfo = {\n webAbsoluteUrl: config.nodeClientOptions.siteUrl,\n };\n }\n };\n Object.defineProperty(RuntimeConfigImpl.prototype, \"headers\", {\n get: function () {\n return this._headers;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RuntimeConfigImpl.prototype, \"defaultCachingStore\", {\n get: function () {\n return this._defaultCachingStore;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RuntimeConfigImpl.prototype, \"defaultCachingTimeoutSeconds\", {\n get: function () {\n return this._defaultCachingTimeoutSeconds;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RuntimeConfigImpl.prototype, \"globalCacheDisable\", {\n get: function () {\n return this._globalCacheDisable;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RuntimeConfigImpl.prototype, \"useSPRequestExecutor\", {\n get: function () {\n return this._useSPRequestExecutor;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RuntimeConfigImpl.prototype, \"useNodeFetchClient\", {\n get: function () {\n return this._useNodeClient;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RuntimeConfigImpl.prototype, \"nodeRequestOptions\", {\n get: function () {\n return this._nodeClientData;\n },\n enumerable: true,\n configurable: true\n });\n return RuntimeConfigImpl;\n}());\nexports.RuntimeConfigImpl = RuntimeConfigImpl;\nvar _runtimeConfig = new RuntimeConfigImpl();\nexports.RuntimeConfig = _runtimeConfig;\nfunction setRuntimeConfig(config) {\n _runtimeConfig.set(config);\n}\nexports.setRuntimeConfig = setRuntimeConfig;\n","\"use strict\";\nvar storage = require(\"../../utils/storage\");\nvar CachingConfigurationProvider = (function () {\n function CachingConfigurationProvider(wrappedProvider, cacheKey, cacheStore) {\n this.wrappedProvider = wrappedProvider;\n this.store = (cacheStore) ? cacheStore : this.selectPnPCache();\n this.cacheKey = \"_configcache_\" + cacheKey;\n }\n CachingConfigurationProvider.prototype.getWrappedProvider = function () {\n return this.wrappedProvider;\n };\n CachingConfigurationProvider.prototype.getConfiguration = function () {\n var _this = this;\n if ((!this.store) || (!this.store.enabled)) {\n return this.wrappedProvider.getConfiguration();\n }\n var cachedConfig = this.store.get(this.cacheKey);\n if (cachedConfig) {\n return new Promise(function (resolve, reject) {\n resolve(cachedConfig);\n });\n }\n var providerPromise = this.wrappedProvider.getConfiguration();\n providerPromise.then(function (providedConfig) {\n _this.store.put(_this.cacheKey, providedConfig);\n });\n return providerPromise;\n };\n CachingConfigurationProvider.prototype.selectPnPCache = function () {\n var pnpCache = new storage.PnPClientStorage();\n if ((pnpCache.local) && (pnpCache.local.enabled)) {\n return pnpCache.local;\n }\n if ((pnpCache.session) && (pnpCache.session.enabled)) {\n return pnpCache.session;\n }\n throw new Error(\"Cannot create a caching configuration provider since cache is not available.\");\n };\n return CachingConfigurationProvider;\n}());\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = CachingConfigurationProvider;\n","\"use strict\";\nvar cachingConfigurationProvider_1 = require(\"./cachingConfigurationProvider\");\nvar spListConfigurationProvider_1 = require(\"./spListConfigurationProvider\");\nexports.CachingConfigurationProvider = cachingConfigurationProvider_1.default;\nexports.SPListConfigurationProvider = spListConfigurationProvider_1.default;\n","\"use strict\";\nvar cachingConfigurationProvider_1 = require(\"./cachingConfigurationProvider\");\nvar SPListConfigurationProvider = (function () {\n function SPListConfigurationProvider(sourceWeb, sourceListTitle) {\n if (sourceListTitle === void 0) { sourceListTitle = \"config\"; }\n this.sourceWeb = sourceWeb;\n this.sourceListTitle = sourceListTitle;\n }\n Object.defineProperty(SPListConfigurationProvider.prototype, \"web\", {\n get: function () {\n return this.sourceWeb;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SPListConfigurationProvider.prototype, \"listTitle\", {\n get: function () {\n return this.sourceListTitle;\n },\n enumerable: true,\n configurable: true\n });\n SPListConfigurationProvider.prototype.getConfiguration = function () {\n return this.web.lists.getByTitle(this.listTitle).items.select(\"Title\", \"Value\")\n .getAs().then(function (data) {\n var configuration = {};\n data.forEach(function (i) {\n configuration[i.Title] = i.Value;\n });\n return configuration;\n });\n };\n SPListConfigurationProvider.prototype.asCaching = function () {\n var cacheKey = \"splist_\" + this.web.toUrl() + \"+\" + this.listTitle;\n return new cachingConfigurationProvider_1.default(this, cacheKey);\n };\n return SPListConfigurationProvider;\n}());\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = SPListConfigurationProvider;\n","\"use strict\";\nvar collections_1 = require(\"../collections/collections\");\nvar util_1 = require(\"../utils/util\");\nvar odata_1 = require(\"../sharepoint/rest/odata\");\nvar CachedDigest = (function () {\n function CachedDigest() {\n }\n return CachedDigest;\n}());\nexports.CachedDigest = CachedDigest;\nvar DigestCache = (function () {\n function DigestCache(_httpClient, _digests) {\n if (_digests === void 0) { _digests = new collections_1.Dictionary(); }\n this._httpClient = _httpClient;\n this._digests = _digests;\n }\n DigestCache.prototype.getDigest = function (webUrl) {\n var self = this;\n var cachedDigest = this._digests.get(webUrl);\n if (cachedDigest !== null) {\n var now = new Date();\n if (now < cachedDigest.expiration) {\n return Promise.resolve(cachedDigest.value);\n }\n }\n var url = util_1.Util.combinePaths(webUrl, \"/_api/contextinfo\");\n return self._httpClient.fetchRaw(url, {\n cache: \"no-cache\",\n credentials: \"same-origin\",\n headers: {\n \"Accept\": \"application/json;odata=verbose\",\n \"Content-type\": \"application/json;odata=verbose;charset=utf-8\",\n },\n method: \"POST\",\n }).then(function (response) {\n var parser = new odata_1.ODataDefaultParser();\n return parser.parse(response).then(function (d) { return d.GetContextWebInformation; });\n }).then(function (data) {\n var newCachedDigest = new CachedDigest();\n newCachedDigest.value = data.FormDigestValue;\n var seconds = data.FormDigestTimeoutSeconds;\n var expiration = new Date();\n expiration.setTime(expiration.getTime() + 1000 * seconds);\n newCachedDigest.expiration = expiration;\n self._digests.add(webUrl, newCachedDigest);\n return newCachedDigest.value;\n });\n };\n DigestCache.prototype.clear = function () {\n this._digests.clear();\n };\n return DigestCache;\n}());\nexports.DigestCache = DigestCache;\n","\"use strict\";\nvar FetchClient = (function () {\n function FetchClient() {\n }\n FetchClient.prototype.fetch = function (url, options) {\n return global.fetch(url, options);\n };\n return FetchClient;\n}());\nexports.FetchClient = FetchClient;\n","\"use strict\";\nvar fetchclient_1 = require(\"./fetchclient\");\nvar digestcache_1 = require(\"./digestcache\");\nvar util_1 = require(\"../utils/util\");\nvar pnplibconfig_1 = require(\"../configuration/pnplibconfig\");\nvar sprequestexecutorclient_1 = require(\"./sprequestexecutorclient\");\nvar nodefetchclient_1 = require(\"./nodefetchclient\");\nvar HttpClient = (function () {\n function HttpClient() {\n this._impl = this.getFetchImpl();\n this._digestCache = new digestcache_1.DigestCache(this);\n }\n HttpClient.prototype.fetch = function (url, options) {\n if (options === void 0) { options = {}; }\n var self = this;\n var opts = util_1.Util.extend(options, { cache: \"no-cache\", credentials: \"same-origin\" }, true);\n var headers = new Headers();\n this.mergeHeaders(headers, pnplibconfig_1.RuntimeConfig.headers);\n this.mergeHeaders(headers, options.headers);\n if (!headers.has(\"Accept\")) {\n headers.append(\"Accept\", \"application/json\");\n }\n if (!headers.has(\"Content-Type\")) {\n headers.append(\"Content-Type\", \"application/json;odata=verbose;charset=utf-8\");\n }\n if (!headers.has(\"X-ClientService-ClientTag\")) {\n headers.append(\"X-ClientService-ClientTag\", \"PnPCoreJS:1.0.6\");\n }\n opts = util_1.Util.extend(opts, { headers: headers });\n if (opts.method && opts.method.toUpperCase() !== \"GET\") {\n if (!headers.has(\"X-RequestDigest\")) {\n var index = url.indexOf(\"_api/\");\n if (index < 0) {\n throw new Error(\"Unable to determine API url\");\n }\n var webUrl = url.substr(0, index);\n return this._digestCache.getDigest(webUrl)\n .then(function (digest) {\n headers.append(\"X-RequestDigest\", digest);\n return self.fetchRaw(url, opts);\n });\n }\n }\n return self.fetchRaw(url, opts);\n };\n HttpClient.prototype.fetchRaw = function (url, options) {\n var _this = this;\n if (options === void 0) { options = {}; }\n var rawHeaders = new Headers();\n this.mergeHeaders(rawHeaders, options.headers);\n options = util_1.Util.extend(options, { headers: rawHeaders });\n var retry = function (ctx) {\n _this._impl.fetch(url, options).then(function (response) { return ctx.resolve(response); }).catch(function (response) {\n var delay = ctx.delay;\n if (response.status !== 429 && response.status !== 503) {\n ctx.reject(response);\n }\n ctx.delay *= 2;\n ctx.attempts++;\n if (ctx.retryCount <= ctx.attempts) {\n ctx.reject(response);\n }\n setTimeout(util_1.Util.getCtxCallback(_this, retry, ctx), delay);\n });\n };\n return new Promise(function (resolve, reject) {\n var retryContext = {\n attempts: 0,\n delay: 100,\n reject: reject,\n resolve: resolve,\n retryCount: 7,\n };\n retry.call(_this, retryContext);\n });\n };\n HttpClient.prototype.get = function (url, options) {\n if (options === void 0) { options = {}; }\n var opts = util_1.Util.extend(options, { method: \"GET\" });\n return this.fetch(url, opts);\n };\n HttpClient.prototype.post = function (url, options) {\n if (options === void 0) { options = {}; }\n var opts = util_1.Util.extend(options, { method: \"POST\" });\n return this.fetch(url, opts);\n };\n HttpClient.prototype.patch = function (url, options) {\n if (options === void 0) { options = {}; }\n var opts = util_1.Util.extend(options, { method: \"PATCH\" });\n return this.fetch(url, opts);\n };\n HttpClient.prototype.delete = function (url, options) {\n if (options === void 0) { options = {}; }\n var opts = util_1.Util.extend(options, { method: \"DELETE\" });\n return this.fetch(url, opts);\n };\n HttpClient.prototype.getFetchImpl = function () {\n if (pnplibconfig_1.RuntimeConfig.useSPRequestExecutor) {\n return new sprequestexecutorclient_1.SPRequestExecutorClient();\n }\n else if (pnplibconfig_1.RuntimeConfig.useNodeFetchClient) {\n var opts = pnplibconfig_1.RuntimeConfig.nodeRequestOptions;\n return new nodefetchclient_1.NodeFetchClient(opts.siteUrl, opts.clientId, opts.clientSecret);\n }\n else {\n return new fetchclient_1.FetchClient();\n }\n };\n HttpClient.prototype.mergeHeaders = function (target, source) {\n if (typeof source !== \"undefined\" && source !== null) {\n var temp = new Request(\"\", { headers: source });\n temp.headers.forEach(function (value, name) {\n target.append(name, value);\n });\n }\n };\n return HttpClient;\n}());\nexports.HttpClient = HttpClient;\n","\"use strict\";\nvar NodeFetchClient = (function () {\n function NodeFetchClient(siteUrl, _clientId, _clientSecret, _realm) {\n if (_realm === void 0) { _realm = \"\"; }\n this.siteUrl = siteUrl;\n this._clientId = _clientId;\n this._clientSecret = _clientSecret;\n this._realm = _realm;\n }\n NodeFetchClient.prototype.fetch = function (url, options) {\n throw new Error(\"Using NodeFetchClient in the browser is not supported.\");\n };\n return NodeFetchClient;\n}());\nexports.NodeFetchClient = NodeFetchClient;\n","\"use strict\";\nvar util_1 = require(\"../utils/util\");\nvar SPRequestExecutorClient = (function () {\n function SPRequestExecutorClient() {\n this.convertToResponse = function (spResponse) {\n var responseHeaders = new Headers();\n for (var h in spResponse.headers) {\n if (spResponse.headers[h]) {\n responseHeaders.append(h, spResponse.headers[h]);\n }\n }\n return new Response(spResponse.body, {\n headers: responseHeaders,\n status: spResponse.statusCode,\n statusText: spResponse.statusText,\n });\n };\n }\n SPRequestExecutorClient.prototype.fetch = function (url, options) {\n var _this = this;\n if (typeof SP === \"undefined\" || typeof SP.RequestExecutor === \"undefined\") {\n throw new Error(\"SP.RequestExecutor is undefined. \" +\n \"Load the SP.RequestExecutor.js library (/_layouts/15/SP.RequestExecutor.js) before loading the PnP JS Core library.\");\n }\n var addinWebUrl = url.substring(0, url.indexOf(\"/_api\")), executor = new SP.RequestExecutor(addinWebUrl), headers = {}, iterator, temp;\n if (options.headers && options.headers instanceof Headers) {\n iterator = options.headers.entries();\n temp = iterator.next();\n while (!temp.done) {\n headers[temp.value[0]] = temp.value[1];\n temp = iterator.next();\n }\n }\n else {\n headers = options.headers;\n }\n return new Promise(function (resolve, reject) {\n var requestOptions = {\n error: function (error) {\n reject(_this.convertToResponse(error));\n },\n headers: headers,\n method: options.method,\n success: function (response) {\n resolve(_this.convertToResponse(response));\n },\n url: url,\n };\n if (options.body) {\n util_1.Util.extend(requestOptions, { body: options.body });\n }\n else {\n util_1.Util.extend(requestOptions, { binaryStringRequestBody: true });\n }\n executor.executeAsync(requestOptions);\n });\n };\n return SPRequestExecutorClient;\n}());\nexports.SPRequestExecutorClient = SPRequestExecutorClient;\n","\"use strict\";\nfunction __export(m) {\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\n}\nvar util_1 = require(\"./utils/util\");\nvar storage_1 = require(\"./utils/storage\");\nvar configuration_1 = require(\"./configuration/configuration\");\nvar logging_1 = require(\"./utils/logging\");\nvar rest_1 = require(\"./sharepoint/rest/rest\");\nvar pnplibconfig_1 = require(\"./configuration/pnplibconfig\");\nexports.util = util_1.Util;\nexports.sp = new rest_1.Rest();\nexports.storage = new storage_1.PnPClientStorage();\nexports.config = new configuration_1.Settings();\nexports.log = logging_1.Logger;\nexports.setup = pnplibconfig_1.setRuntimeConfig;\n__export(require(\"./types/index\"));\nvar Def = {\n config: exports.config,\n log: exports.log,\n setup: exports.setup,\n sp: exports.sp,\n storage: exports.storage,\n util: exports.util,\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = Def;\n","\"use strict\";\nvar storage_1 = require(\"../../utils/storage\");\nvar util_1 = require(\"../../utils/util\");\nvar pnplibconfig_1 = require(\"../../configuration/pnplibconfig\");\nvar CachingOptions = (function () {\n function CachingOptions(key) {\n this.key = key;\n this.expiration = util_1.Util.dateAdd(new Date(), \"second\", pnplibconfig_1.RuntimeConfig.defaultCachingTimeoutSeconds);\n this.storeName = pnplibconfig_1.RuntimeConfig.defaultCachingStore;\n }\n Object.defineProperty(CachingOptions.prototype, \"store\", {\n get: function () {\n if (this.storeName === \"local\") {\n return CachingOptions.storage.local;\n }\n else {\n return CachingOptions.storage.session;\n }\n },\n enumerable: true,\n configurable: true\n });\n CachingOptions.storage = new storage_1.PnPClientStorage();\n return CachingOptions;\n}());\nexports.CachingOptions = CachingOptions;\nvar CachingParserWrapper = (function () {\n function CachingParserWrapper(_parser, _cacheOptions) {\n this._parser = _parser;\n this._cacheOptions = _cacheOptions;\n }\n CachingParserWrapper.prototype.parse = function (response) {\n var _this = this;\n return this._parser.parse(response).then(function (data) {\n if (_this._cacheOptions.store !== null) {\n _this._cacheOptions.store.put(_this._cacheOptions.key, data, _this._cacheOptions.expiration);\n }\n return data;\n });\n };\n return CachingParserWrapper;\n}());\nexports.CachingParserWrapper = CachingParserWrapper;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar util_1 = require(\"../../utils/util\");\nvar queryable_1 = require(\"./queryable\");\nvar ContentTypes = (function (_super) {\n __extends(ContentTypes, _super);\n function ContentTypes(baseUrl, path) {\n if (path === void 0) { path = \"contenttypes\"; }\n _super.call(this, baseUrl, path);\n }\n ContentTypes.prototype.getById = function (id) {\n var ct = new ContentType(this);\n ct.concat(\"('\" + id + \"')\");\n return ct;\n };\n ContentTypes.prototype.addAvailableContentType = function (contentTypeId) {\n var _this = this;\n var postBody = JSON.stringify({\n \"contentTypeId\": contentTypeId,\n });\n return new ContentTypes(this, \"addAvailableContentType\").postAs({ body: postBody }).then(function (data) {\n return {\n contentType: _this.getById(data.id),\n data: data,\n };\n });\n };\n ContentTypes.prototype.add = function (id, name, description, group, additionalSettings) {\n var _this = this;\n if (description === void 0) { description = \"\"; }\n if (group === void 0) { group = \"Custom Content Types\"; }\n if (additionalSettings === void 0) { additionalSettings = {}; }\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": \"SP.ContentType\" },\n \"Id\": { \"StringValue\": id },\n \"Name\": name,\n \"Group\": group,\n \"Description\": description,\n }, additionalSettings));\n return this.post({ body: postBody }).then(function (data) {\n return { contentType: _this.getById(data.id), data: data };\n });\n };\n return ContentTypes;\n}(queryable_1.QueryableCollection));\nexports.ContentTypes = ContentTypes;\nvar ContentType = (function (_super) {\n __extends(ContentType, _super);\n function ContentType(baseUrl, path) {\n _super.call(this, baseUrl, path);\n }\n Object.defineProperty(ContentType.prototype, \"fieldLinks\", {\n get: function () {\n return new queryable_1.Queryable(this, \"fieldLinks\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ContentType.prototype, \"fields\", {\n get: function () {\n return new queryable_1.Queryable(this, \"fields\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ContentType.prototype, \"parent\", {\n get: function () {\n return new ContentType(this, \"parent\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ContentType.prototype, \"workflowAssociations\", {\n get: function () {\n return new queryable_1.Queryable(this, \"workflowAssociations\");\n },\n enumerable: true,\n configurable: true\n });\n return ContentType;\n}(queryable_1.QueryableInstance));\nexports.ContentType = ContentType;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar util_1 = require(\"../../utils/util\");\nvar Types = require(\"./types\");\nvar Fields = (function (_super) {\n __extends(Fields, _super);\n function Fields(baseUrl, path) {\n if (path === void 0) { path = \"fields\"; }\n _super.call(this, baseUrl, path);\n }\n Fields.prototype.getByTitle = function (title) {\n return new Field(this, \"getByTitle('\" + title + \"')\");\n };\n Fields.prototype.getByInternalNameOrTitle = function (name) {\n return new Field(this, \"getByInternalNameOrTitle('\" + name + \"')\");\n };\n Fields.prototype.getById = function (id) {\n var f = new Field(this);\n f.concat(\"('\" + id + \"')\");\n return f;\n };\n Fields.prototype.createFieldAsXml = function (xml) {\n var _this = this;\n var info;\n if (typeof xml === \"string\") {\n info = { SchemaXml: xml };\n }\n else {\n info = xml;\n }\n var postBody = JSON.stringify({\n \"parameters\": util_1.Util.extend({\n \"__metadata\": {\n \"type\": \"SP.XmlSchemaFieldCreationInformation\",\n },\n }, info),\n });\n var q = new Fields(this, \"createfieldasxml\");\n return q.postAs({ body: postBody }).then(function (data) {\n return {\n data: data,\n field: _this.getById(data.Id),\n };\n });\n };\n Fields.prototype.add = function (title, fieldType, properties) {\n var _this = this;\n if (properties === void 0) { properties = {}; }\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": fieldType },\n \"Title\": title,\n }, properties));\n return this.postAs({ body: postBody }).then(function (data) {\n return {\n data: data,\n field: _this.getById(data.Id),\n };\n });\n };\n Fields.prototype.addText = function (title, maxLength, properties) {\n if (maxLength === void 0) { maxLength = 255; }\n var props = {\n FieldTypeKind: 2,\n };\n return this.add(title, \"SP.FieldText\", util_1.Util.extend(props, properties));\n };\n Fields.prototype.addCalculated = function (title, formula, dateFormat, outputType, properties) {\n if (outputType === void 0) { outputType = Types.FieldTypes.Text; }\n var props = {\n DateFormat: dateFormat,\n FieldTypeKind: 17,\n Formula: formula,\n OutputType: outputType,\n };\n return this.add(title, \"SP.FieldCalculated\", util_1.Util.extend(props, properties));\n };\n Fields.prototype.addDateTime = function (title, displayFormat, calendarType, friendlyDisplayFormat, properties) {\n if (displayFormat === void 0) { displayFormat = Types.DateTimeFieldFormatType.DateOnly; }\n if (calendarType === void 0) { calendarType = Types.CalendarType.Gregorian; }\n if (friendlyDisplayFormat === void 0) { friendlyDisplayFormat = 0; }\n var props = {\n DateTimeCalendarType: calendarType,\n DisplayFormat: displayFormat,\n FieldTypeKind: 4,\n FriendlyDisplayFormat: friendlyDisplayFormat,\n };\n return this.add(title, \"SP.FieldDateTime\", util_1.Util.extend(props, properties));\n };\n Fields.prototype.addNumber = function (title, minValue, maxValue, properties) {\n var props = { FieldTypeKind: 9 };\n if (typeof minValue !== \"undefined\") {\n props = util_1.Util.extend({ MinimumValue: minValue }, props);\n }\n if (typeof maxValue !== \"undefined\") {\n props = util_1.Util.extend({ MaximumValue: maxValue }, props);\n }\n return this.add(title, \"SP.FieldNumber\", util_1.Util.extend(props, properties));\n };\n Fields.prototype.addCurrency = function (title, minValue, maxValue, currencyLocalId, properties) {\n if (currencyLocalId === void 0) { currencyLocalId = 1033; }\n var props = {\n CurrencyLocaleId: currencyLocalId,\n FieldTypeKind: 10,\n };\n if (typeof minValue !== \"undefined\") {\n props = util_1.Util.extend({ MinimumValue: minValue }, props);\n }\n if (typeof maxValue !== \"undefined\") {\n props = util_1.Util.extend({ MaximumValue: maxValue }, props);\n }\n return this.add(title, \"SP.FieldCurrency\", util_1.Util.extend(props, properties));\n };\n Fields.prototype.addMultilineText = function (title, numberOfLines, richText, restrictedMode, appendOnly, allowHyperlink, properties) {\n if (numberOfLines === void 0) { numberOfLines = 6; }\n if (richText === void 0) { richText = true; }\n if (restrictedMode === void 0) { restrictedMode = false; }\n if (appendOnly === void 0) { appendOnly = false; }\n if (allowHyperlink === void 0) { allowHyperlink = true; }\n var props = {\n AllowHyperlink: allowHyperlink,\n AppendOnly: appendOnly,\n FieldTypeKind: 3,\n NumberOfLines: numberOfLines,\n RestrictedMode: restrictedMode,\n RichText: richText,\n };\n return this.add(title, \"SP.FieldMultiLineText\", util_1.Util.extend(props, properties));\n };\n Fields.prototype.addUrl = function (title, displayFormat, properties) {\n if (displayFormat === void 0) { displayFormat = Types.UrlFieldFormatType.Hyperlink; }\n var props = {\n DisplayFormat: displayFormat,\n FieldTypeKind: 11,\n };\n return this.add(title, \"SP.FieldUrl\", util_1.Util.extend(props, properties));\n };\n return Fields;\n}(queryable_1.QueryableCollection));\nexports.Fields = Fields;\nvar Field = (function (_super) {\n __extends(Field, _super);\n function Field(baseUrl, path) {\n _super.call(this, baseUrl, path);\n }\n Field.prototype.update = function (properties, fieldType) {\n var _this = this;\n if (fieldType === void 0) { fieldType = \"SP.Field\"; }\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": fieldType },\n }, properties));\n return this.post({\n body: postBody,\n headers: {\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n return {\n data: data,\n field: _this,\n };\n });\n };\n Field.prototype.delete = function () {\n return this.post({\n headers: {\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n Field.prototype.setShowInDisplayForm = function (show) {\n var q = new Field(this, \"setshowindisplayform(\" + show + \")\");\n return q.post();\n };\n Field.prototype.setShowInEditForm = function (show) {\n var q = new Field(this, \"setshowineditform(\" + show + \")\");\n return q.post();\n };\n Field.prototype.setShowInNewForm = function (show) {\n var q = new Field(this, \"setshowinnewform(\" + show + \")\");\n return q.post();\n };\n return Field;\n}(queryable_1.QueryableInstance));\nexports.Field = Field;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar items_1 = require(\"./items\");\nvar util_1 = require(\"../../utils/util\");\nvar Files = (function (_super) {\n __extends(Files, _super);\n function Files(baseUrl, path) {\n if (path === void 0) { path = \"files\"; }\n _super.call(this, baseUrl, path);\n }\n Files.prototype.getByName = function (name) {\n var f = new File(this);\n f.concat(\"('\" + name + \"')\");\n return f;\n };\n Files.prototype.add = function (url, content, shouldOverWrite) {\n var _this = this;\n if (shouldOverWrite === void 0) { shouldOverWrite = true; }\n return new Files(this, \"add(overwrite=\" + shouldOverWrite + \",url='\" + url + \"')\")\n .post({\n body: content,\n }).then(function (response) {\n return {\n data: response,\n file: _this.getByName(url),\n };\n });\n };\n Files.prototype.addChunked = function (url, content, progress, shouldOverWrite, chunkSize) {\n var _this = this;\n if (shouldOverWrite === void 0) { shouldOverWrite = true; }\n if (chunkSize === void 0) { chunkSize = 10485760; }\n var adder = new Files(this, \"add(overwrite=\" + shouldOverWrite + \",url='\" + url + \"')\");\n return adder.post().then(function () { return _this.getByName(url); }).then(function (file) { return file.setContentChunked(content, progress, chunkSize); }).then(function (response) {\n return {\n data: response,\n file: _this.getByName(url),\n };\n });\n };\n Files.prototype.addTemplateFile = function (fileUrl, templateFileType) {\n var _this = this;\n return new Files(this, \"addTemplateFile(urloffile='\" + fileUrl + \"',templatefiletype=\" + templateFileType + \")\")\n .post().then(function (response) {\n return {\n data: response,\n file: _this.getByName(fileUrl),\n };\n });\n };\n return Files;\n}(queryable_1.QueryableCollection));\nexports.Files = Files;\nvar File = (function (_super) {\n __extends(File, _super);\n function File(baseUrl, path) {\n _super.call(this, baseUrl, path);\n }\n Object.defineProperty(File.prototype, \"listItemAllFields\", {\n get: function () {\n return new items_1.Item(this, \"listItemAllFields\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(File.prototype, \"versions\", {\n get: function () {\n return new Versions(this);\n },\n enumerable: true,\n configurable: true\n });\n File.prototype.approve = function (comment) {\n return new File(this, \"approve(comment='\" + comment + \"')\").post();\n };\n File.prototype.cancelUpload = function (uploadId) {\n return new File(this, \"cancelUpload(uploadId=guid'\" + uploadId + \"')\").post();\n };\n File.prototype.checkin = function (comment, checkinType) {\n if (comment === void 0) { comment = \"\"; }\n if (checkinType === void 0) { checkinType = CheckinType.Major; }\n return new File(this, \"checkin(comment='\" + comment + \"',checkintype=\" + checkinType + \")\").post();\n };\n File.prototype.checkout = function () {\n return new File(this, \"checkout\").post();\n };\n File.prototype.copyTo = function (url, shouldOverWrite) {\n if (shouldOverWrite === void 0) { shouldOverWrite = true; }\n return new File(this, \"copyTo(strnewurl='\" + url + \"',boverwrite=\" + shouldOverWrite + \")\").post();\n };\n File.prototype.delete = function (eTag) {\n if (eTag === void 0) { eTag = \"*\"; }\n return new File(this).post({\n headers: {\n \"IF-Match\": eTag,\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n File.prototype.deny = function (comment) {\n if (comment === void 0) { comment = \"\"; }\n return new File(this, \"deny(comment='\" + comment + \"')\").post();\n };\n File.prototype.getLimitedWebPartManager = function (scope) {\n if (scope === void 0) { scope = WebPartsPersonalizationScope.User; }\n return new queryable_1.Queryable(this, \"getLimitedWebPartManager(scope=\" + scope + \")\");\n };\n File.prototype.moveTo = function (url, moveOperations) {\n if (moveOperations === void 0) { moveOperations = MoveOperations.Overwrite; }\n return new File(this, \"moveTo(newurl='\" + url + \"',flags=\" + moveOperations + \")\").post();\n };\n File.prototype.publish = function (comment) {\n if (comment === void 0) { comment = \"\"; }\n return new File(this, \"publish(comment='\" + comment + \"')\").post();\n };\n File.prototype.recycle = function () {\n return new File(this, \"recycle\").post();\n };\n File.prototype.undoCheckout = function () {\n return new File(this, \"undoCheckout\").post();\n };\n File.prototype.unpublish = function (comment) {\n if (comment === void 0) { comment = \"\"; }\n if (comment.length > 1023) {\n throw new Error(\"The maximum comment length is 1023 characters.\");\n }\n return new File(this, \"unpublish(comment='\" + comment + \"')\").post();\n };\n File.prototype.getText = function () {\n return new File(this, \"$value\").get(new TextFileParser(), { headers: { \"binaryStringResponseBody\": \"true\" } });\n };\n File.prototype.getBlob = function () {\n return new File(this, \"$value\").get(new BlobFileParser(), { headers: { \"binaryStringResponseBody\": \"true\" } });\n };\n File.prototype.getBuffer = function () {\n return new File(this, \"$value\").get(new BufferFileParser(), { headers: { \"binaryStringResponseBody\": \"true\" } });\n };\n File.prototype.setContent = function (content) {\n var _this = this;\n var setter = new File(this, \"$value\");\n return setter.post({\n body: content,\n headers: {\n \"X-HTTP-Method\": \"PUT\",\n },\n }).then(function (_) { return new File(_this); });\n };\n File.prototype.setContentChunked = function (file, progress, chunkSize) {\n if (chunkSize === void 0) { chunkSize = 10485760; }\n if (typeof progress === \"undefined\") {\n progress = function (data) { return null; };\n }\n var self = this;\n var fileSize = file.size;\n var blockCount = parseInt((file.size / chunkSize).toString(), 10) + ((file.size % chunkSize === 0) ? 1 : 0);\n console.log(\"blockCount: \" + blockCount);\n var uploadId = util_1.Util.getGUID();\n progress({ blockNumber: 1, chunkSize: chunkSize, currentPointer: 0, fileSize: fileSize, stage: \"starting\", totalBlocks: blockCount });\n var chain = self.startUpload(uploadId, file.slice(0, chunkSize));\n var _loop_1 = function(i) {\n chain = chain.then(function (pointer) {\n progress({ blockNumber: i, chunkSize: chunkSize, currentPointer: pointer, fileSize: fileSize, stage: \"continue\", totalBlocks: blockCount });\n return self.continueUpload(uploadId, pointer, file.slice(pointer, pointer + chunkSize));\n });\n };\n for (var i = 2; i < blockCount; i++) {\n _loop_1(i);\n }\n return chain.then(function (pointer) {\n progress({ blockNumber: blockCount, chunkSize: chunkSize, currentPointer: pointer, fileSize: fileSize, stage: \"finishing\", totalBlocks: blockCount });\n return self.finishUpload(uploadId, pointer, file.slice(pointer));\n }).then(function (_) {\n return self;\n });\n };\n File.prototype.startUpload = function (uploadId, fragment) {\n return new File(this, \"startUpload(uploadId=guid'\" + uploadId + \"')\").postAs({ body: fragment }).then(function (n) { return parseFloat(n); });\n };\n File.prototype.continueUpload = function (uploadId, fileOffset, fragment) {\n return new File(this, \"continueUpload(uploadId=guid'\" + uploadId + \"',fileOffset=\" + fileOffset + \")\").postAs({ body: fragment }).then(function (n) { return parseFloat(n); });\n };\n File.prototype.finishUpload = function (uploadId, fileOffset, fragment) {\n return new File(this, \"finishUpload(uploadId=guid'\" + uploadId + \"',fileOffset=\" + fileOffset + \")\")\n .postAs({ body: fragment }).then(function (response) {\n return {\n data: response,\n file: new File(response.ServerRelativeUrl),\n };\n });\n };\n return File;\n}(queryable_1.QueryableInstance));\nexports.File = File;\nvar TextFileParser = (function () {\n function TextFileParser() {\n }\n TextFileParser.prototype.parse = function (r) {\n return r.text();\n };\n return TextFileParser;\n}());\nexports.TextFileParser = TextFileParser;\nvar BlobFileParser = (function () {\n function BlobFileParser() {\n }\n BlobFileParser.prototype.parse = function (r) {\n return r.blob();\n };\n return BlobFileParser;\n}());\nexports.BlobFileParser = BlobFileParser;\nvar BufferFileParser = (function () {\n function BufferFileParser() {\n }\n BufferFileParser.prototype.parse = function (r) {\n if (util_1.Util.isFunction(r.arrayBuffer)) {\n return r.arrayBuffer();\n }\n return r.buffer();\n };\n return BufferFileParser;\n}());\nexports.BufferFileParser = BufferFileParser;\nvar Versions = (function (_super) {\n __extends(Versions, _super);\n function Versions(baseUrl, path) {\n if (path === void 0) { path = \"versions\"; }\n _super.call(this, baseUrl, path);\n }\n Versions.prototype.getById = function (versionId) {\n var v = new Version(this);\n v.concat(\"(\" + versionId + \")\");\n return v;\n };\n Versions.prototype.deleteAll = function () {\n return new Versions(this, \"deleteAll\").post();\n };\n Versions.prototype.deleteById = function (versionId) {\n return new Versions(this, \"deleteById(vid=\" + versionId + \")\").post();\n };\n Versions.prototype.deleteByLabel = function (label) {\n return new Versions(this, \"deleteByLabel(versionlabel='\" + label + \"')\").post();\n };\n Versions.prototype.restoreByLabel = function (label) {\n return new Versions(this, \"restoreByLabel(versionlabel='\" + label + \"')\").post();\n };\n return Versions;\n}(queryable_1.QueryableCollection));\nexports.Versions = Versions;\nvar Version = (function (_super) {\n __extends(Version, _super);\n function Version(baseUrl, path) {\n _super.call(this, baseUrl, path);\n }\n Version.prototype.delete = function (eTag) {\n if (eTag === void 0) { eTag = \"*\"; }\n return this.post({\n headers: {\n \"IF-Match\": eTag,\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n return Version;\n}(queryable_1.QueryableInstance));\nexports.Version = Version;\n(function (CheckinType) {\n CheckinType[CheckinType[\"Minor\"] = 0] = \"Minor\";\n CheckinType[CheckinType[\"Major\"] = 1] = \"Major\";\n CheckinType[CheckinType[\"Overwrite\"] = 2] = \"Overwrite\";\n})(exports.CheckinType || (exports.CheckinType = {}));\nvar CheckinType = exports.CheckinType;\n(function (WebPartsPersonalizationScope) {\n WebPartsPersonalizationScope[WebPartsPersonalizationScope[\"User\"] = 0] = \"User\";\n WebPartsPersonalizationScope[WebPartsPersonalizationScope[\"Shared\"] = 1] = \"Shared\";\n})(exports.WebPartsPersonalizationScope || (exports.WebPartsPersonalizationScope = {}));\nvar WebPartsPersonalizationScope = exports.WebPartsPersonalizationScope;\n(function (MoveOperations) {\n MoveOperations[MoveOperations[\"Overwrite\"] = 1] = \"Overwrite\";\n MoveOperations[MoveOperations[\"AllowBrokenThickets\"] = 8] = \"AllowBrokenThickets\";\n})(exports.MoveOperations || (exports.MoveOperations = {}));\nvar MoveOperations = exports.MoveOperations;\n(function (TemplateFileType) {\n TemplateFileType[TemplateFileType[\"StandardPage\"] = 0] = \"StandardPage\";\n TemplateFileType[TemplateFileType[\"WikiPage\"] = 1] = \"WikiPage\";\n TemplateFileType[TemplateFileType[\"FormPage\"] = 2] = \"FormPage\";\n})(exports.TemplateFileType || (exports.TemplateFileType = {}));\nvar TemplateFileType = exports.TemplateFileType;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar files_1 = require(\"./files\");\nvar items_1 = require(\"./items\");\nvar Folders = (function (_super) {\n __extends(Folders, _super);\n function Folders(baseUrl, path) {\n if (path === void 0) { path = \"folders\"; }\n _super.call(this, baseUrl, path);\n }\n Folders.prototype.getByName = function (name) {\n var f = new Folder(this);\n f.concat(\"('\" + name + \"')\");\n return f;\n };\n Folders.prototype.add = function (url) {\n var _this = this;\n return new Folders(this, \"add('\" + url + \"')\").post().then(function (response) {\n return {\n data: response,\n folder: _this.getByName(url),\n };\n });\n };\n return Folders;\n}(queryable_1.QueryableCollection));\nexports.Folders = Folders;\nvar Folder = (function (_super) {\n __extends(Folder, _super);\n function Folder(baseUrl, path) {\n _super.call(this, baseUrl, path);\n }\n Object.defineProperty(Folder.prototype, \"contentTypeOrder\", {\n get: function () {\n return new queryable_1.QueryableCollection(this, \"contentTypeOrder\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Folder.prototype, \"files\", {\n get: function () {\n return new files_1.Files(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Folder.prototype, \"folders\", {\n get: function () {\n return new Folders(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Folder.prototype, \"listItemAllFields\", {\n get: function () {\n return new items_1.Item(this, \"listItemAllFields\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Folder.prototype, \"parentFolder\", {\n get: function () {\n return new Folder(this, \"parentFolder\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Folder.prototype, \"properties\", {\n get: function () {\n return new queryable_1.QueryableInstance(this, \"properties\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Folder.prototype, \"serverRelativeUrl\", {\n get: function () {\n return new queryable_1.Queryable(this, \"serverRelativeUrl\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Folder.prototype, \"uniqueContentTypeOrder\", {\n get: function () {\n return new queryable_1.QueryableCollection(this, \"uniqueContentTypeOrder\");\n },\n enumerable: true,\n configurable: true\n });\n Folder.prototype.delete = function (eTag) {\n if (eTag === void 0) { eTag = \"*\"; }\n return new Folder(this).post({\n headers: {\n \"IF-Match\": eTag,\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n Folder.prototype.recycle = function () {\n return new Folder(this, \"recycle\").post();\n };\n return Folder;\n}(queryable_1.QueryableInstance));\nexports.Folder = Folder;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar Forms = (function (_super) {\n __extends(Forms, _super);\n function Forms(baseUrl, path) {\n if (path === void 0) { path = \"forms\"; }\n _super.call(this, baseUrl, path);\n }\n Forms.prototype.getById = function (id) {\n var i = new Form(this);\n i.concat(\"('\" + id + \"')\");\n return i;\n };\n return Forms;\n}(queryable_1.QueryableCollection));\nexports.Forms = Forms;\nvar Form = (function (_super) {\n __extends(Form, _super);\n function Form(baseUrl, path) {\n _super.call(this, baseUrl, path);\n }\n return Form;\n}(queryable_1.QueryableInstance));\nexports.Form = Form;\n","\"use strict\";\nfunction __export(m) {\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\n}\n__export(require(\"./caching\"));\nvar files_1 = require(\"./files\");\nexports.CheckinType = files_1.CheckinType;\nexports.WebPartsPersonalizationScope = files_1.WebPartsPersonalizationScope;\nexports.MoveOperations = files_1.MoveOperations;\nexports.TemplateFileType = files_1.TemplateFileType;\nexports.TextFileParser = files_1.TextFileParser;\nexports.BlobFileParser = files_1.BlobFileParser;\nexports.BufferFileParser = files_1.BufferFileParser;\nvar items_1 = require(\"./items\");\nexports.PagedItemCollection = items_1.PagedItemCollection;\nvar odata_1 = require(\"./odata\");\nexports.extractOdataId = odata_1.extractOdataId;\nexports.ODataParserBase = odata_1.ODataParserBase;\nexports.ODataDefaultParser = odata_1.ODataDefaultParser;\nexports.ODataRaw = odata_1.ODataRaw;\nexports.ODataValue = odata_1.ODataValue;\nexports.ODataEntity = odata_1.ODataEntity;\nexports.ODataEntityArray = odata_1.ODataEntityArray;\nvar roles_1 = require(\"./roles\");\nexports.RoleDefinitionBindings = roles_1.RoleDefinitionBindings;\nvar search_1 = require(\"./search\");\nexports.Search = search_1.Search;\nexports.SearchResult = search_1.SearchResult;\nexports.SearchResults = search_1.SearchResults;\nexports.SortDirection = search_1.SortDirection;\nexports.ReorderingRuleMatchType = search_1.ReorderingRuleMatchType;\nexports.QueryPropertyValueType = search_1.QueryPropertyValueType;\nvar searchsuggest_1 = require(\"./searchsuggest\");\nexports.SearchSuggest = searchsuggest_1.SearchSuggest;\nexports.SearchSuggestResult = searchsuggest_1.SearchSuggestResult;\nvar site_1 = require(\"./site\");\nexports.Site = site_1.Site;\n__export(require(\"./types\"));\nvar webs_1 = require(\"./webs\");\nexports.Web = webs_1.Web;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar queryablesecurable_1 = require(\"./queryablesecurable\");\nvar folders_1 = require(\"./folders\");\nvar contenttypes_1 = require(\"./contenttypes\");\nvar util_1 = require(\"../../utils/util\");\nvar odata_1 = require(\"./odata\");\nvar Items = (function (_super) {\n __extends(Items, _super);\n function Items(baseUrl, path) {\n if (path === void 0) { path = \"items\"; }\n _super.call(this, baseUrl, path);\n }\n Items.prototype.getById = function (id) {\n var i = new Item(this);\n i.concat(\"(\" + id + \")\");\n return i;\n };\n Items.prototype.skip = function (skip) {\n this._query.add(\"$skiptoken\", encodeURIComponent(\"Paged=TRUE&p_ID=\" + skip));\n return this;\n };\n Items.prototype.getPaged = function () {\n return this.getAs(new PagedItemCollectionParser());\n };\n Items.prototype.add = function (properties) {\n var _this = this;\n if (properties === void 0) { properties = {}; }\n var removeDependency = this.addBatchDependency();\n var parentList = this.getParent(queryable_1.QueryableInstance);\n return parentList.select(\"ListItemEntityTypeFullName\").getAs().then(function (d) {\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": d.ListItemEntityTypeFullName },\n }, properties));\n var promise = _this.postAs({ body: postBody }).then(function (data) {\n return {\n data: data,\n item: _this.getById(data.Id),\n };\n });\n removeDependency();\n return promise;\n });\n };\n return Items;\n}(queryable_1.QueryableCollection));\nexports.Items = Items;\nvar Item = (function (_super) {\n __extends(Item, _super);\n function Item(baseUrl, path) {\n _super.call(this, baseUrl, path);\n }\n Object.defineProperty(Item.prototype, \"attachmentFiles\", {\n get: function () {\n return new queryable_1.QueryableCollection(this, \"AttachmentFiles\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Item.prototype, \"contentType\", {\n get: function () {\n return new contenttypes_1.ContentType(this, \"ContentType\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Item.prototype, \"effectiveBasePermissions\", {\n get: function () {\n return new queryable_1.Queryable(this, \"EffectiveBasePermissions\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Item.prototype, \"effectiveBasePermissionsForUI\", {\n get: function () {\n return new queryable_1.Queryable(this, \"EffectiveBasePermissionsForUI\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Item.prototype, \"fieldValuesAsHTML\", {\n get: function () {\n return new queryable_1.QueryableInstance(this, \"FieldValuesAsHTML\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Item.prototype, \"fieldValuesAsText\", {\n get: function () {\n return new queryable_1.QueryableInstance(this, \"FieldValuesAsText\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Item.prototype, \"fieldValuesForEdit\", {\n get: function () {\n return new queryable_1.QueryableInstance(this, \"FieldValuesForEdit\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Item.prototype, \"folder\", {\n get: function () {\n return new folders_1.Folder(this, \"Folder\");\n },\n enumerable: true,\n configurable: true\n });\n Item.prototype.update = function (properties, eTag) {\n var _this = this;\n if (eTag === void 0) { eTag = \"*\"; }\n var removeDependency = this.addBatchDependency();\n var parentList = this.getParent(queryable_1.QueryableInstance, this.parentUrl.substr(0, this.parentUrl.lastIndexOf(\"/\")));\n return parentList.select(\"ListItemEntityTypeFullName\").getAs().then(function (d) {\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": d.ListItemEntityTypeFullName },\n }, properties));\n var promise = _this.post({\n body: postBody,\n headers: {\n \"IF-Match\": eTag,\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n return {\n data: data,\n item: _this,\n };\n });\n removeDependency();\n return promise;\n });\n };\n Item.prototype.delete = function (eTag) {\n if (eTag === void 0) { eTag = \"*\"; }\n return this.post({\n headers: {\n \"IF-Match\": eTag,\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n Item.prototype.recycle = function () {\n var i = new Item(this, \"recycle\");\n return i.post();\n };\n Item.prototype.getWopiFrameUrl = function (action) {\n if (action === void 0) { action = 0; }\n var i = new Item(this, \"getWOPIFrameUrl(@action)\");\n i._query.add(\"@action\", action);\n return i.post().then(function (data) {\n return data.GetWOPIFrameUrl;\n });\n };\n Item.prototype.validateUpdateListItem = function (formValues, newDocumentUpdate) {\n if (newDocumentUpdate === void 0) { newDocumentUpdate = false; }\n var postBody = JSON.stringify({ \"formValues\": formValues, bNewDocumentUpdate: newDocumentUpdate });\n var item = new Item(this, \"validateupdatelistitem\");\n return item.post({ body: postBody });\n };\n return Item;\n}(queryablesecurable_1.QueryableSecurable));\nexports.Item = Item;\nvar PagedItemCollection = (function () {\n function PagedItemCollection(nextUrl, results) {\n this.nextUrl = nextUrl;\n this.results = results;\n }\n Object.defineProperty(PagedItemCollection.prototype, \"hasNext\", {\n get: function () {\n return typeof this.nextUrl === \"string\" && this.nextUrl.length > 0;\n },\n enumerable: true,\n configurable: true\n });\n PagedItemCollection.prototype.getNext = function () {\n if (this.hasNext) {\n var items = new Items(this.nextUrl, null);\n return items.getPaged();\n }\n return new Promise(function (r) { return r(null); });\n };\n return PagedItemCollection;\n}());\nexports.PagedItemCollection = PagedItemCollection;\nvar PagedItemCollectionParser = (function (_super) {\n __extends(PagedItemCollectionParser, _super);\n function PagedItemCollectionParser() {\n _super.apply(this, arguments);\n }\n PagedItemCollectionParser.prototype.parse = function (r) {\n var _this = this;\n return r.json().then(function (json) {\n var nextUrl = json.hasOwnProperty(\"d\") && json.d.hasOwnProperty(\"__next\") ? json.d.__next : json[\"odata.nextLink\"];\n return new PagedItemCollection(nextUrl, _this.parseODataJSON(json));\n });\n };\n return PagedItemCollectionParser;\n}(odata_1.ODataParserBase));\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar items_1 = require(\"./items\");\nvar views_1 = require(\"./views\");\nvar contenttypes_1 = require(\"./contenttypes\");\nvar fields_1 = require(\"./fields\");\nvar forms_1 = require(\"./forms\");\nvar subscriptions_1 = require(\"./subscriptions\");\nvar queryable_1 = require(\"./queryable\");\nvar queryablesecurable_1 = require(\"./queryablesecurable\");\nvar util_1 = require(\"../../utils/util\");\nvar usercustomactions_1 = require(\"./usercustomactions\");\nvar odata_1 = require(\"./odata\");\nvar Lists = (function (_super) {\n __extends(Lists, _super);\n function Lists(baseUrl, path) {\n if (path === void 0) { path = \"lists\"; }\n _super.call(this, baseUrl, path);\n }\n Lists.prototype.getByTitle = function (title) {\n return new List(this, \"getByTitle('\" + title + \"')\");\n };\n Lists.prototype.getById = function (id) {\n var list = new List(this);\n list.concat(\"('\" + id + \"')\");\n return list;\n };\n Lists.prototype.add = function (title, description, template, enableContentTypes, additionalSettings) {\n var _this = this;\n if (description === void 0) { description = \"\"; }\n if (template === void 0) { template = 100; }\n if (enableContentTypes === void 0) { enableContentTypes = false; }\n if (additionalSettings === void 0) { additionalSettings = {}; }\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": \"SP.List\" },\n \"AllowContentTypes\": enableContentTypes,\n \"BaseTemplate\": template,\n \"ContentTypesEnabled\": enableContentTypes,\n \"Description\": description,\n \"Title\": title,\n }, additionalSettings));\n return this.post({ body: postBody }).then(function (data) {\n return { data: data, list: _this.getByTitle(title) };\n });\n };\n Lists.prototype.ensure = function (title, description, template, enableContentTypes, additionalSettings) {\n var _this = this;\n if (description === void 0) { description = \"\"; }\n if (template === void 0) { template = 100; }\n if (enableContentTypes === void 0) { enableContentTypes = false; }\n if (additionalSettings === void 0) { additionalSettings = {}; }\n if (this.hasBatch) {\n throw new Error(\"The ensure method is not supported as part of a batch.\");\n }\n return new Promise(function (resolve, reject) {\n var list = _this.getByTitle(title);\n list.get().then(function (d) { return resolve({ created: false, data: d, list: list }); }).catch(function () {\n _this.add(title, description, template, enableContentTypes, additionalSettings).then(function (r) {\n resolve({ created: true, data: r.data, list: _this.getByTitle(title) });\n });\n }).catch(function (e) { return reject(e); });\n });\n };\n Lists.prototype.ensureSiteAssetsLibrary = function () {\n var q = new Lists(this, \"ensuresiteassetslibrary\");\n return q.post().then(function (json) {\n return new List(odata_1.extractOdataId(json));\n });\n };\n Lists.prototype.ensureSitePagesLibrary = function () {\n var q = new Lists(this, \"ensuresitepageslibrary\");\n return q.post().then(function (json) {\n return new List(odata_1.extractOdataId(json));\n });\n };\n return Lists;\n}(queryable_1.QueryableCollection));\nexports.Lists = Lists;\nvar List = (function (_super) {\n __extends(List, _super);\n function List(baseUrl, path) {\n _super.call(this, baseUrl, path);\n }\n Object.defineProperty(List.prototype, \"contentTypes\", {\n get: function () {\n return new contenttypes_1.ContentTypes(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"items\", {\n get: function () {\n return new items_1.Items(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"views\", {\n get: function () {\n return new views_1.Views(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"fields\", {\n get: function () {\n return new fields_1.Fields(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"forms\", {\n get: function () {\n return new forms_1.Forms(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"defaultView\", {\n get: function () {\n return new queryable_1.QueryableInstance(this, \"DefaultView\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"userCustomActions\", {\n get: function () {\n return new usercustomactions_1.UserCustomActions(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"effectiveBasePermissions\", {\n get: function () {\n return new queryable_1.Queryable(this, \"EffectiveBasePermissions\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"eventReceivers\", {\n get: function () {\n return new queryable_1.QueryableCollection(this, \"EventReceivers\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"relatedFields\", {\n get: function () {\n return new queryable_1.Queryable(this, \"getRelatedFields\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"informationRightsManagementSettings\", {\n get: function () {\n return new queryable_1.Queryable(this, \"InformationRightsManagementSettings\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"subscriptions\", {\n get: function () {\n return new subscriptions_1.Subscriptions(this);\n },\n enumerable: true,\n configurable: true\n });\n List.prototype.getView = function (viewId) {\n return new views_1.View(this, \"getView('\" + viewId + \"')\");\n };\n List.prototype.update = function (properties, eTag) {\n var _this = this;\n if (eTag === void 0) { eTag = \"*\"; }\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": \"SP.List\" },\n }, properties));\n return this.post({\n body: postBody,\n headers: {\n \"IF-Match\": eTag,\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n var retList = _this;\n if (properties.hasOwnProperty(\"Title\")) {\n retList = _this.getParent(List, _this.parentUrl, \"getByTitle('\" + properties[\"Title\"] + \"')\");\n }\n return {\n data: data,\n list: retList,\n };\n });\n };\n List.prototype.delete = function (eTag) {\n if (eTag === void 0) { eTag = \"*\"; }\n return this.post({\n headers: {\n \"IF-Match\": eTag,\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n List.prototype.getChanges = function (query) {\n var postBody = JSON.stringify({ \"query\": util_1.Util.extend({ \"__metadata\": { \"type\": \"SP.ChangeQuery\" } }, query) });\n var q = new List(this, \"getchanges\");\n return q.post({ body: postBody });\n };\n List.prototype.getItemsByCAMLQuery = function (query) {\n var expands = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n expands[_i - 1] = arguments[_i];\n }\n var postBody = JSON.stringify({ \"query\": util_1.Util.extend({ \"__metadata\": { \"type\": \"SP.CamlQuery\" } }, query) });\n var q = new List(this, \"getitems\");\n q = q.expand.apply(q, expands);\n return q.post({ body: postBody });\n };\n List.prototype.getListItemChangesSinceToken = function (query) {\n var postBody = JSON.stringify({ \"query\": util_1.Util.extend({ \"__metadata\": { \"type\": \"SP.ChangeLogItemQuery\" } }, query) });\n var q = new List(this, \"getlistitemchangessincetoken\");\n return q.post({ body: postBody }, { parse: function (r) { return r.text(); } });\n };\n List.prototype.recycle = function () {\n this.append(\"recycle\");\n return this.post().then(function (data) {\n if (data.hasOwnProperty(\"Recycle\")) {\n return data.Recycle;\n }\n else {\n return data;\n }\n });\n };\n List.prototype.renderListData = function (viewXml) {\n var q = new List(this, \"renderlistdata(@viewXml)\");\n q.query.add(\"@viewXml\", \"'\" + viewXml + \"'\");\n return q.post().then(function (data) {\n data = JSON.parse(data);\n if (data.hasOwnProperty(\"RenderListData\")) {\n return data.RenderListData;\n }\n else {\n return data;\n }\n });\n };\n List.prototype.renderListFormData = function (itemId, formId, mode) {\n var q = new List(this, \"renderlistformdata(itemid=\" + itemId + \", formid='\" + formId + \"', mode=\" + mode + \")\");\n return q.post().then(function (data) {\n data = JSON.parse(data);\n if (data.hasOwnProperty(\"ListData\")) {\n return data.ListData;\n }\n else {\n return data;\n }\n });\n };\n List.prototype.reserveListItemId = function () {\n var q = new List(this, \"reservelistitemid\");\n return q.post().then(function (data) {\n if (data.hasOwnProperty(\"ReserveListItemId\")) {\n return data.ReserveListItemId;\n }\n else {\n return data;\n }\n });\n };\n return List;\n}(queryablesecurable_1.QueryableSecurable));\nexports.List = List;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar quicklaunch_1 = require(\"./quicklaunch\");\nvar topnavigationbar_1 = require(\"./topnavigationbar\");\nvar Navigation = (function (_super) {\n __extends(Navigation, _super);\n function Navigation(baseUrl) {\n _super.call(this, baseUrl, \"navigation\");\n }\n Object.defineProperty(Navigation.prototype, \"quicklaunch\", {\n get: function () {\n return new quicklaunch_1.QuickLaunch(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Navigation.prototype, \"topNavigationBar\", {\n get: function () {\n return new topnavigationbar_1.TopNavigationBar(this);\n },\n enumerable: true,\n configurable: true\n });\n return Navigation;\n}(queryable_1.Queryable));\nexports.Navigation = Navigation;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar util_1 = require(\"../../utils/util\");\nvar logging_1 = require(\"../../utils/logging\");\nvar httpclient_1 = require(\"../../net/httpclient\");\nvar pnplibconfig_1 = require(\"../../configuration/pnplibconfig\");\nfunction extractOdataId(candidate) {\n if (candidate.hasOwnProperty(\"odata.id\")) {\n return candidate[\"odata.id\"];\n }\n else if (candidate.hasOwnProperty(\"__metadata\") && candidate.__metadata.hasOwnProperty(\"id\")) {\n return candidate.__metadata.id;\n }\n else {\n logging_1.Logger.log({\n data: candidate,\n level: logging_1.LogLevel.Error,\n message: \"Could not extract odata id in object, you may be using nometadata. Object data logged to logger.\",\n });\n throw new Error(\"Could not extract odata id in object, you may be using nometadata. Object data logged to logger.\");\n }\n}\nexports.extractOdataId = extractOdataId;\nvar ODataParserBase = (function () {\n function ODataParserBase() {\n }\n ODataParserBase.prototype.parse = function (r) {\n var _this = this;\n return r.json().then(function (json) { return _this.parseODataJSON(json); });\n };\n ODataParserBase.prototype.parseODataJSON = function (json) {\n var result = json;\n if (json.hasOwnProperty(\"d\")) {\n if (json.d.hasOwnProperty(\"results\")) {\n result = json.d.results;\n }\n else {\n result = json.d;\n }\n }\n else if (json.hasOwnProperty(\"value\")) {\n result = json.value;\n }\n return result;\n };\n return ODataParserBase;\n}());\nexports.ODataParserBase = ODataParserBase;\nvar ODataDefaultParser = (function (_super) {\n __extends(ODataDefaultParser, _super);\n function ODataDefaultParser() {\n _super.apply(this, arguments);\n }\n return ODataDefaultParser;\n}(ODataParserBase));\nexports.ODataDefaultParser = ODataDefaultParser;\nvar ODataRawParserImpl = (function () {\n function ODataRawParserImpl() {\n }\n ODataRawParserImpl.prototype.parse = function (r) {\n return r.json();\n };\n return ODataRawParserImpl;\n}());\nexports.ODataRawParserImpl = ODataRawParserImpl;\nvar ODataValueParserImpl = (function (_super) {\n __extends(ODataValueParserImpl, _super);\n function ODataValueParserImpl() {\n _super.apply(this, arguments);\n }\n ODataValueParserImpl.prototype.parse = function (r) {\n return _super.prototype.parse.call(this, r).then(function (d) { return d; });\n };\n return ODataValueParserImpl;\n}(ODataParserBase));\nvar ODataEntityParserImpl = (function (_super) {\n __extends(ODataEntityParserImpl, _super);\n function ODataEntityParserImpl(factory) {\n _super.call(this);\n this.factory = factory;\n }\n ODataEntityParserImpl.prototype.parse = function (r) {\n var _this = this;\n return _super.prototype.parse.call(this, r).then(function (d) {\n var o = new _this.factory(getEntityUrl(d), null);\n return util_1.Util.extend(o, d);\n });\n };\n return ODataEntityParserImpl;\n}(ODataParserBase));\nvar ODataEntityArrayParserImpl = (function (_super) {\n __extends(ODataEntityArrayParserImpl, _super);\n function ODataEntityArrayParserImpl(factory) {\n _super.call(this);\n this.factory = factory;\n }\n ODataEntityArrayParserImpl.prototype.parse = function (r) {\n var _this = this;\n return _super.prototype.parse.call(this, r).then(function (d) {\n return d.map(function (v) {\n var o = new _this.factory(getEntityUrl(v), null);\n return util_1.Util.extend(o, v);\n });\n });\n };\n return ODataEntityArrayParserImpl;\n}(ODataParserBase));\nfunction getEntityUrl(entity) {\n if (entity.hasOwnProperty(\"__metadata\")) {\n return entity.__metadata.uri;\n }\n else if (entity.hasOwnProperty(\"odata.editLink\")) {\n return util_1.Util.combinePaths(\"_api\", entity[\"odata.editLink\"]);\n }\n else {\n logging_1.Logger.write(\"No uri information found in ODataEntity parsing, chaining will fail for this object.\", logging_1.LogLevel.Warning);\n return \"\";\n }\n}\nexports.ODataRaw = new ODataRawParserImpl();\nfunction ODataValue() {\n return new ODataValueParserImpl();\n}\nexports.ODataValue = ODataValue;\nfunction ODataEntity(factory) {\n return new ODataEntityParserImpl(factory);\n}\nexports.ODataEntity = ODataEntity;\nfunction ODataEntityArray(factory) {\n return new ODataEntityArrayParserImpl(factory);\n}\nexports.ODataEntityArray = ODataEntityArray;\nvar ODataBatch = (function () {\n function ODataBatch(baseUrl, _batchId) {\n if (_batchId === void 0) { _batchId = util_1.Util.getGUID(); }\n this.baseUrl = baseUrl;\n this._batchId = _batchId;\n this._requests = [];\n this._batchDependencies = Promise.resolve();\n }\n ODataBatch.prototype.add = function (url, method, options, parser) {\n var info = {\n method: method.toUpperCase(),\n options: options,\n parser: parser,\n reject: null,\n resolve: null,\n url: url,\n };\n var p = new Promise(function (resolve, reject) {\n info.resolve = resolve;\n info.reject = reject;\n });\n this._requests.push(info);\n return p;\n };\n ODataBatch.prototype.addBatchDependency = function () {\n var resolver;\n var promise = new Promise(function (resolve) {\n resolver = resolve;\n });\n this._batchDependencies = this._batchDependencies.then(function () { return promise; });\n return resolver;\n };\n ODataBatch.prototype.execute = function () {\n var _this = this;\n return this._batchDependencies.then(function () { return _this.executeImpl(); });\n };\n ODataBatch.prototype.executeImpl = function () {\n var _this = this;\n if (this._requests.length < 1) {\n return Promise.resolve();\n }\n var batchBody = [];\n var currentChangeSetId = \"\";\n this._requests.forEach(function (reqInfo, index) {\n if (reqInfo.method === \"GET\") {\n if (currentChangeSetId.length > 0) {\n batchBody.push(\"--changeset_\" + currentChangeSetId + \"--\\n\\n\");\n currentChangeSetId = \"\";\n }\n batchBody.push(\"--batch_\" + _this._batchId + \"\\n\");\n }\n else {\n if (currentChangeSetId.length < 1) {\n currentChangeSetId = util_1.Util.getGUID();\n batchBody.push(\"--batch_\" + _this._batchId + \"\\n\");\n batchBody.push(\"Content-Type: multipart/mixed; boundary=\\\"changeset_\" + currentChangeSetId + \"\\\"\\n\\n\");\n }\n batchBody.push(\"--changeset_\" + currentChangeSetId + \"\\n\");\n }\n batchBody.push(\"Content-Type: application/http\\n\");\n batchBody.push(\"Content-Transfer-Encoding: binary\\n\\n\");\n var headers = {\n \"Accept\": \"application/json;\",\n };\n if (reqInfo.method !== \"GET\") {\n var method = reqInfo.method;\n if (reqInfo.options && reqInfo.options.headers && reqInfo.options.headers[\"X-HTTP-Method\"] !== typeof undefined) {\n method = reqInfo.options.headers[\"X-HTTP-Method\"];\n delete reqInfo.options.headers[\"X-HTTP-Method\"];\n }\n batchBody.push(method + \" \" + reqInfo.url + \" HTTP/1.1\\n\");\n headers = util_1.Util.extend(headers, { \"Content-Type\": \"application/json;odata=verbose;charset=utf-8\" });\n }\n else {\n batchBody.push(reqInfo.method + \" \" + reqInfo.url + \" HTTP/1.1\\n\");\n }\n if (typeof pnplibconfig_1.RuntimeConfig.headers !== \"undefined\") {\n headers = util_1.Util.extend(headers, pnplibconfig_1.RuntimeConfig.headers);\n }\n if (reqInfo.options && reqInfo.options.headers) {\n headers = util_1.Util.extend(headers, reqInfo.options.headers);\n }\n for (var name_1 in headers) {\n if (headers.hasOwnProperty(name_1)) {\n batchBody.push(name_1 + \": \" + headers[name_1] + \"\\n\");\n }\n }\n batchBody.push(\"\\n\");\n if (reqInfo.options.body) {\n batchBody.push(reqInfo.options.body + \"\\n\\n\");\n }\n });\n if (currentChangeSetId.length > 0) {\n batchBody.push(\"--changeset_\" + currentChangeSetId + \"--\\n\\n\");\n currentChangeSetId = \"\";\n }\n batchBody.push(\"--batch_\" + this._batchId + \"--\\n\");\n var batchHeaders = {\n \"Content-Type\": \"multipart/mixed; boundary=batch_\" + this._batchId,\n };\n var batchOptions = {\n \"body\": batchBody.join(\"\"),\n \"headers\": batchHeaders,\n };\n var client = new httpclient_1.HttpClient();\n var requestUrl = util_1.Util.makeUrlAbsolute(util_1.Util.combinePaths(this.baseUrl, \"/_api/$batch\"));\n return client.post(requestUrl, batchOptions)\n .then(function (r) { return r.text(); })\n .then(this._parseResponse)\n .then(function (responses) {\n if (responses.length !== _this._requests.length) {\n throw new Error(\"Could not properly parse responses to match requests in batch.\");\n }\n var chain = Promise.resolve();\n var _loop_1 = function(i) {\n var request = _this._requests[i];\n var response = responses[i];\n if (!response.ok) {\n request.reject(new Error(response.statusText));\n }\n chain = chain.then(function (_) { return request.parser.parse(response).then(request.resolve).catch(request.reject); });\n };\n for (var i = 0; i < responses.length; i++) {\n _loop_1(i);\n }\n return chain;\n });\n };\n ODataBatch.prototype._parseResponse = function (body) {\n return new Promise(function (resolve, reject) {\n var responses = [];\n var header = \"--batchresponse_\";\n var statusRegExp = new RegExp(\"^HTTP/[0-9.]+ +([0-9]+) +(.*)\", \"i\");\n var lines = body.split(\"\\n\");\n var state = \"batch\";\n var status;\n var statusText;\n for (var i = 0; i < lines.length; ++i) {\n var line = lines[i];\n switch (state) {\n case \"batch\":\n if (line.substr(0, header.length) === header) {\n state = \"batchHeaders\";\n }\n else {\n if (line.trim() !== \"\") {\n throw new Error(\"Invalid response, line \" + i);\n }\n }\n break;\n case \"batchHeaders\":\n if (line.trim() === \"\") {\n state = \"status\";\n }\n break;\n case \"status\":\n var parts = statusRegExp.exec(line);\n if (parts.length !== 3) {\n throw new Error(\"Invalid status, line \" + i);\n }\n status = parseInt(parts[1], 10);\n statusText = parts[2];\n state = \"statusHeaders\";\n break;\n case \"statusHeaders\":\n if (line.trim() === \"\") {\n state = \"body\";\n }\n break;\n case \"body\":\n var response = void 0;\n if (status === 204) {\n response = new Response();\n }\n else {\n response = new Response(line, { status: status, statusText: statusText });\n }\n responses.push(response);\n state = \"batch\";\n break;\n }\n }\n if (state !== \"status\") {\n reject(new Error(\"Unexpected end of input\"));\n }\n resolve(responses);\n });\n };\n return ODataBatch;\n}());\nexports.ODataBatch = ODataBatch;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar util_1 = require(\"../../utils/util\");\nvar logging_1 = require(\"../../utils/logging\");\nvar collections_1 = require(\"../../collections/collections\");\nvar httpclient_1 = require(\"../../net/httpclient\");\nvar odata_1 = require(\"./odata\");\nvar caching_1 = require(\"./caching\");\nvar pnplibconfig_1 = require(\"../../configuration/pnplibconfig\");\nvar Queryable = (function () {\n function Queryable(baseUrl, path) {\n this._query = new collections_1.Dictionary();\n this._batch = null;\n if (typeof baseUrl === \"string\") {\n var urlStr = baseUrl;\n if (util_1.Util.isUrlAbsolute(urlStr) || urlStr.lastIndexOf(\"/\") < 0) {\n this._parentUrl = urlStr;\n this._url = util_1.Util.combinePaths(urlStr, path);\n }\n else if (urlStr.lastIndexOf(\"/\") > urlStr.lastIndexOf(\"(\")) {\n var index = urlStr.lastIndexOf(\"/\");\n this._parentUrl = urlStr.slice(0, index);\n path = util_1.Util.combinePaths(urlStr.slice(index), path);\n this._url = util_1.Util.combinePaths(this._parentUrl, path);\n }\n else {\n var index = urlStr.lastIndexOf(\"(\");\n this._parentUrl = urlStr.slice(0, index);\n this._url = util_1.Util.combinePaths(urlStr, path);\n }\n }\n else {\n var q = baseUrl;\n this._parentUrl = q._url;\n var target = q._query.get(\"@target\");\n if (target !== null) {\n this._query.add(\"@target\", target);\n }\n this._url = util_1.Util.combinePaths(this._parentUrl, path);\n }\n }\n Queryable.prototype.concat = function (pathPart) {\n this._url += pathPart;\n };\n Queryable.prototype.append = function (pathPart) {\n this._url = util_1.Util.combinePaths(this._url, pathPart);\n };\n Queryable.prototype.addBatchDependency = function () {\n if (this.hasBatch) {\n return this._batch.addBatchDependency();\n }\n return function () { return null; };\n };\n Object.defineProperty(Queryable.prototype, \"hasBatch\", {\n get: function () {\n return this._batch !== null;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Queryable.prototype, \"parentUrl\", {\n get: function () {\n return this._parentUrl;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Queryable.prototype, \"query\", {\n get: function () {\n return this._query;\n },\n enumerable: true,\n configurable: true\n });\n Queryable.prototype.inBatch = function (batch) {\n if (this._batch !== null) {\n throw new Error(\"This query is already part of a batch.\");\n }\n this._batch = batch;\n return this;\n };\n Queryable.prototype.usingCaching = function (options) {\n if (!pnplibconfig_1.RuntimeConfig.globalCacheDisable) {\n this._useCaching = true;\n this._cachingOptions = options;\n }\n return this;\n };\n Queryable.prototype.toUrl = function () {\n return util_1.Util.makeUrlAbsolute(this._url);\n };\n Queryable.prototype.toUrlAndQuery = function () {\n var _this = this;\n var url = this.toUrl();\n if (this._query.count() > 0) {\n url += \"?\";\n var keys = this._query.getKeys();\n url += keys.map(function (key, ix, arr) { return (key + \"=\" + _this._query.get(key)); }).join(\"&\");\n }\n return url;\n };\n Queryable.prototype.get = function (parser, getOptions) {\n if (parser === void 0) { parser = new odata_1.ODataDefaultParser(); }\n if (getOptions === void 0) { getOptions = {}; }\n return this.getImpl(getOptions, parser);\n };\n Queryable.prototype.getAs = function (parser, getOptions) {\n if (parser === void 0) { parser = new odata_1.ODataDefaultParser(); }\n if (getOptions === void 0) { getOptions = {}; }\n return this.getImpl(getOptions, parser);\n };\n Queryable.prototype.post = function (postOptions, parser) {\n if (postOptions === void 0) { postOptions = {}; }\n if (parser === void 0) { parser = new odata_1.ODataDefaultParser(); }\n return this.postImpl(postOptions, parser);\n };\n Queryable.prototype.postAs = function (postOptions, parser) {\n if (postOptions === void 0) { postOptions = {}; }\n if (parser === void 0) { parser = new odata_1.ODataDefaultParser(); }\n return this.postImpl(postOptions, parser);\n };\n Queryable.prototype.patch = function (patchOptions, parser) {\n if (patchOptions === void 0) { patchOptions = {}; }\n if (parser === void 0) { parser = new odata_1.ODataDefaultParser(); }\n return this.patchImpl(patchOptions, parser);\n };\n Queryable.prototype.delete = function (deleteOptions, parser) {\n if (deleteOptions === void 0) { deleteOptions = {}; }\n if (parser === void 0) { parser = new odata_1.ODataDefaultParser(); }\n return this.deleteImpl(deleteOptions, parser);\n };\n Queryable.prototype.getParent = function (factory, baseUrl, path) {\n if (baseUrl === void 0) { baseUrl = this.parentUrl; }\n var parent = new factory(baseUrl, path);\n var target = this.query.get(\"@target\");\n if (target !== null) {\n parent.query.add(\"@target\", target);\n }\n return parent;\n };\n Queryable.prototype.getImpl = function (getOptions, parser) {\n var _this = this;\n if (getOptions === void 0) { getOptions = {}; }\n if (this._useCaching) {\n var options = new caching_1.CachingOptions(this.toUrlAndQuery().toLowerCase());\n if (typeof this._cachingOptions !== \"undefined\") {\n options = util_1.Util.extend(options, this._cachingOptions);\n }\n if (options.store !== null) {\n var data_1 = options.store.get(options.key);\n if (data_1 !== null) {\n return new Promise(function (resolve) { return resolve(data_1); });\n }\n }\n parser = new caching_1.CachingParserWrapper(parser, options);\n }\n if (!this.hasBatch) {\n var client = new httpclient_1.HttpClient();\n return client.get(this.toUrlAndQuery(), getOptions).then(function (response) {\n return _this.processHttpClientResponse(response, parser);\n });\n }\n else {\n return this._batch.add(this.toUrlAndQuery(), \"GET\", getOptions, parser);\n }\n };\n Queryable.prototype.postImpl = function (postOptions, parser) {\n var _this = this;\n if (!this.hasBatch) {\n var client = new httpclient_1.HttpClient();\n return client.post(this.toUrlAndQuery(), postOptions).then(function (response) {\n return _this.processHttpClientResponse(response, parser);\n });\n }\n else {\n return this._batch.add(this.toUrlAndQuery(), \"POST\", postOptions, parser);\n }\n };\n Queryable.prototype.patchImpl = function (patchOptions, parser) {\n var _this = this;\n if (!this.hasBatch) {\n var client = new httpclient_1.HttpClient();\n return client.patch(this.toUrlAndQuery(), patchOptions).then(function (response) {\n return _this.processHttpClientResponse(response, parser);\n });\n }\n else {\n return this._batch.add(this.toUrlAndQuery(), \"PATCH\", patchOptions, parser);\n }\n };\n Queryable.prototype.deleteImpl = function (deleteOptions, parser) {\n var _this = this;\n if (!this.hasBatch) {\n var client = new httpclient_1.HttpClient();\n return client.delete(this.toUrlAndQuery(), deleteOptions).then(function (response) {\n return _this.processHttpClientResponse(response, parser);\n });\n }\n else {\n return this._batch.add(this.toUrlAndQuery(), \"DELETE\", deleteOptions, parser);\n }\n };\n Queryable.prototype.processHttpClientResponse = function (response, parser) {\n if (!response.ok) {\n response.text().then(function (text) {\n logging_1.Logger.log({\n data: response,\n level: logging_1.LogLevel.Error,\n message: text,\n });\n throw \"Error making HttpClient request in queryable: \" + response.statusText;\n });\n }\n if ((response.headers.has(\"Content-Length\") && parseFloat(response.headers.get(\"Content-Length\")) === 0)\n || response.status === 204) {\n return new Promise(function (resolve, reject) { resolve({}); });\n }\n return parser.parse(response);\n };\n return Queryable;\n}());\nexports.Queryable = Queryable;\nvar QueryableCollection = (function (_super) {\n __extends(QueryableCollection, _super);\n function QueryableCollection() {\n _super.apply(this, arguments);\n }\n QueryableCollection.prototype.filter = function (filter) {\n this._query.add(\"$filter\", filter);\n return this;\n };\n QueryableCollection.prototype.select = function () {\n var selects = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n selects[_i - 0] = arguments[_i];\n }\n this._query.add(\"$select\", selects.join(\",\"));\n return this;\n };\n QueryableCollection.prototype.expand = function () {\n var expands = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n expands[_i - 0] = arguments[_i];\n }\n this._query.add(\"$expand\", expands.join(\",\"));\n return this;\n };\n QueryableCollection.prototype.orderBy = function (orderBy, ascending) {\n if (ascending === void 0) { ascending = true; }\n var keys = this._query.getKeys();\n var query = [];\n var asc = ascending ? \" asc\" : \" desc\";\n for (var i = 0; i < keys.length; i++) {\n if (keys[i] === \"$orderby\") {\n query.push(this._query.get(\"$orderby\"));\n break;\n }\n }\n query.push(\"\" + orderBy + asc);\n this._query.add(\"$orderby\", query.join(\",\"));\n return this;\n };\n QueryableCollection.prototype.skip = function (skip) {\n this._query.add(\"$skip\", skip.toString());\n return this;\n };\n QueryableCollection.prototype.top = function (top) {\n this._query.add(\"$top\", top.toString());\n return this;\n };\n return QueryableCollection;\n}(Queryable));\nexports.QueryableCollection = QueryableCollection;\nvar QueryableInstance = (function (_super) {\n __extends(QueryableInstance, _super);\n function QueryableInstance() {\n _super.apply(this, arguments);\n }\n QueryableInstance.prototype.select = function () {\n var selects = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n selects[_i - 0] = arguments[_i];\n }\n this._query.add(\"$select\", selects.join(\",\"));\n return this;\n };\n QueryableInstance.prototype.expand = function () {\n var expands = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n expands[_i - 0] = arguments[_i];\n }\n this._query.add(\"$expand\", expands.join(\",\"));\n return this;\n };\n return QueryableInstance;\n}(Queryable));\nexports.QueryableInstance = QueryableInstance;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar roles_1 = require(\"./roles\");\nvar queryable_1 = require(\"./queryable\");\nvar QueryableSecurable = (function (_super) {\n __extends(QueryableSecurable, _super);\n function QueryableSecurable() {\n _super.apply(this, arguments);\n }\n Object.defineProperty(QueryableSecurable.prototype, \"roleAssignments\", {\n get: function () {\n return new roles_1.RoleAssignments(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(QueryableSecurable.prototype, \"firstUniqueAncestorSecurableObject\", {\n get: function () {\n this.append(\"FirstUniqueAncestorSecurableObject\");\n return new queryable_1.QueryableInstance(this);\n },\n enumerable: true,\n configurable: true\n });\n QueryableSecurable.prototype.getUserEffectivePermissions = function (loginName) {\n this.append(\"getUserEffectivePermissions(@user)\");\n this._query.add(\"@user\", \"'\" + encodeURIComponent(loginName) + \"'\");\n return new queryable_1.Queryable(this);\n };\n QueryableSecurable.prototype.breakRoleInheritance = function (copyRoleAssignments, clearSubscopes) {\n if (copyRoleAssignments === void 0) { copyRoleAssignments = false; }\n if (clearSubscopes === void 0) { clearSubscopes = false; }\n var Breaker = (function (_super) {\n __extends(Breaker, _super);\n function Breaker(baseUrl, copy, clear) {\n _super.call(this, baseUrl, \"breakroleinheritance(copyroleassignments=\" + copy + \", clearsubscopes=\" + clear + \")\");\n }\n Breaker.prototype.break = function () {\n return this.post();\n };\n return Breaker;\n }(queryable_1.Queryable));\n var b = new Breaker(this, copyRoleAssignments, clearSubscopes);\n return b.break();\n };\n QueryableSecurable.prototype.resetRoleInheritance = function () {\n var Resetter = (function (_super) {\n __extends(Resetter, _super);\n function Resetter(baseUrl) {\n _super.call(this, baseUrl, \"resetroleinheritance\");\n }\n Resetter.prototype.reset = function () {\n return this.post();\n };\n return Resetter;\n }(queryable_1.Queryable));\n var r = new Resetter(this);\n return r.reset();\n };\n return QueryableSecurable;\n}(queryable_1.QueryableInstance));\nexports.QueryableSecurable = QueryableSecurable;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar QuickLaunch = (function (_super) {\n __extends(QuickLaunch, _super);\n function QuickLaunch(baseUrl) {\n _super.call(this, baseUrl, \"QuickLaunch\");\n }\n return QuickLaunch;\n}(queryable_1.Queryable));\nexports.QuickLaunch = QuickLaunch;\n","\"use strict\";\nvar search_1 = require(\"./search\");\nvar searchsuggest_1 = require(\"./searchsuggest\");\nvar site_1 = require(\"./site\");\nvar webs_1 = require(\"./webs\");\nvar util_1 = require(\"../../utils/util\");\nvar userprofiles_1 = require(\"./userprofiles\");\nvar Rest = (function () {\n function Rest() {\n }\n Rest.prototype.searchSuggest = function (query) {\n var finalQuery;\n if (typeof query === \"string\") {\n finalQuery = { querytext: query };\n }\n else {\n finalQuery = query;\n }\n return new searchsuggest_1.SearchSuggest(\"\").execute(finalQuery);\n };\n Rest.prototype.search = function (query) {\n var finalQuery;\n if (typeof query === \"string\") {\n finalQuery = { Querytext: query };\n }\n else {\n finalQuery = query;\n }\n return new search_1.Search(\"\").execute(finalQuery);\n };\n Object.defineProperty(Rest.prototype, \"site\", {\n get: function () {\n return new site_1.Site(\"\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Rest.prototype, \"web\", {\n get: function () {\n return new webs_1.Web(\"\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Rest.prototype, \"profiles\", {\n get: function () {\n return new userprofiles_1.UserProfileQuery(\"\");\n },\n enumerable: true,\n configurable: true\n });\n Rest.prototype.createBatch = function () {\n return this.web.createBatch();\n };\n Rest.prototype.crossDomainSite = function (addInWebUrl, hostWebUrl) {\n return this._cdImpl(site_1.Site, addInWebUrl, hostWebUrl, \"site\");\n };\n Rest.prototype.crossDomainWeb = function (addInWebUrl, hostWebUrl) {\n return this._cdImpl(webs_1.Web, addInWebUrl, hostWebUrl, \"web\");\n };\n Rest.prototype._cdImpl = function (factory, addInWebUrl, hostWebUrl, urlPart) {\n if (!util_1.Util.isUrlAbsolute(addInWebUrl)) {\n throw \"The addInWebUrl parameter must be an absolute url.\";\n }\n if (!util_1.Util.isUrlAbsolute(hostWebUrl)) {\n throw \"The hostWebUrl parameter must be an absolute url.\";\n }\n var url = util_1.Util.combinePaths(addInWebUrl, \"_api/SP.AppContextSite(@target)\");\n var instance = new factory(url, urlPart);\n instance.query.add(\"@target\", \"'\" + encodeURIComponent(hostWebUrl) + \"'\");\n return instance;\n };\n return Rest;\n}());\nexports.Rest = Rest;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar sitegroups_1 = require(\"./sitegroups\");\nvar util_1 = require(\"../../utils/util\");\nvar RoleAssignments = (function (_super) {\n __extends(RoleAssignments, _super);\n function RoleAssignments(baseUrl, path) {\n if (path === void 0) { path = \"roleassignments\"; }\n _super.call(this, baseUrl, path);\n }\n RoleAssignments.prototype.add = function (principalId, roleDefId) {\n var a = new RoleAssignments(this, \"addroleassignment(principalid=\" + principalId + \", roledefid=\" + roleDefId + \")\");\n return a.post();\n };\n RoleAssignments.prototype.remove = function (principalId, roleDefId) {\n var a = new RoleAssignments(this, \"removeroleassignment(principalid=\" + principalId + \", roledefid=\" + roleDefId + \")\");\n return a.post();\n };\n RoleAssignments.prototype.getById = function (id) {\n var ra = new RoleAssignment(this);\n ra.concat(\"(\" + id + \")\");\n return ra;\n };\n return RoleAssignments;\n}(queryable_1.QueryableCollection));\nexports.RoleAssignments = RoleAssignments;\nvar RoleAssignment = (function (_super) {\n __extends(RoleAssignment, _super);\n function RoleAssignment(baseUrl, path) {\n _super.call(this, baseUrl, path);\n }\n Object.defineProperty(RoleAssignment.prototype, \"groups\", {\n get: function () {\n return new sitegroups_1.SiteGroups(this, \"groups\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RoleAssignment.prototype, \"bindings\", {\n get: function () {\n return new RoleDefinitionBindings(this);\n },\n enumerable: true,\n configurable: true\n });\n RoleAssignment.prototype.delete = function () {\n return this.post({\n headers: {\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n return RoleAssignment;\n}(queryable_1.QueryableInstance));\nexports.RoleAssignment = RoleAssignment;\nvar RoleDefinitions = (function (_super) {\n __extends(RoleDefinitions, _super);\n function RoleDefinitions(baseUrl, path) {\n if (path === void 0) { path = \"roledefinitions\"; }\n _super.call(this, baseUrl, path);\n }\n RoleDefinitions.prototype.getById = function (id) {\n return new RoleDefinition(this, \"getById(\" + id + \")\");\n };\n RoleDefinitions.prototype.getByName = function (name) {\n return new RoleDefinition(this, \"getbyname('\" + name + \"')\");\n };\n RoleDefinitions.prototype.getByType = function (roleTypeKind) {\n return new RoleDefinition(this, \"getbytype(\" + roleTypeKind + \")\");\n };\n RoleDefinitions.prototype.add = function (name, description, order, basePermissions) {\n var _this = this;\n var postBody = JSON.stringify({\n BasePermissions: util_1.Util.extend({ __metadata: { type: \"SP.BasePermissions\" } }, basePermissions),\n Description: description,\n Name: name,\n Order: order,\n __metadata: { \"type\": \"SP.RoleDefinition\" },\n });\n return this.post({ body: postBody }).then(function (data) {\n return {\n data: data,\n definition: _this.getById(data.Id),\n };\n });\n };\n return RoleDefinitions;\n}(queryable_1.QueryableCollection));\nexports.RoleDefinitions = RoleDefinitions;\nvar RoleDefinition = (function (_super) {\n __extends(RoleDefinition, _super);\n function RoleDefinition(baseUrl, path) {\n _super.call(this, baseUrl, path);\n }\n RoleDefinition.prototype.update = function (properties) {\n var _this = this;\n if (typeof properties.hasOwnProperty(\"BasePermissions\") !== \"undefined\") {\n properties[\"BasePermissions\"] = util_1.Util.extend({ __metadata: { type: \"SP.BasePermissions\" } }, properties[\"BasePermissions\"]);\n }\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": \"SP.RoleDefinition\" },\n }, properties));\n return this.post({\n body: postBody,\n headers: {\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n var retDef = _this;\n if (properties.hasOwnProperty(\"Name\")) {\n var parent_1 = _this.getParent(RoleDefinitions, _this.parentUrl, \"\");\n retDef = parent_1.getByName(properties[\"Name\"]);\n }\n return {\n data: data,\n definition: retDef,\n };\n });\n };\n RoleDefinition.prototype.delete = function () {\n return this.post({\n headers: {\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n return RoleDefinition;\n}(queryable_1.QueryableInstance));\nexports.RoleDefinition = RoleDefinition;\nvar RoleDefinitionBindings = (function (_super) {\n __extends(RoleDefinitionBindings, _super);\n function RoleDefinitionBindings(baseUrl, path) {\n if (path === void 0) { path = \"roledefinitionbindings\"; }\n _super.call(this, baseUrl, path);\n }\n return RoleDefinitionBindings;\n}(queryable_1.QueryableCollection));\nexports.RoleDefinitionBindings = RoleDefinitionBindings;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar util_1 = require(\"../../utils/util\");\nvar Search = (function (_super) {\n __extends(Search, _super);\n function Search(baseUrl, path) {\n if (path === void 0) { path = \"_api/search/postquery\"; }\n _super.call(this, baseUrl, path);\n }\n Search.prototype.execute = function (query) {\n var formattedBody;\n formattedBody = query;\n if (formattedBody.SelectProperties) {\n formattedBody.SelectProperties = { results: query.SelectProperties };\n }\n if (formattedBody.RefinementFilters) {\n formattedBody.RefinementFilters = { results: query.RefinementFilters };\n }\n if (formattedBody.SortList) {\n formattedBody.SortList = { results: query.SortList };\n }\n if (formattedBody.HithighlightedProperties) {\n formattedBody.HithighlightedProperties = { results: query.HithighlightedProperties };\n }\n if (formattedBody.ReorderingRules) {\n formattedBody.ReorderingRules = { results: query.ReorderingRules };\n }\n if (formattedBody.Properties) {\n formattedBody.Properties = { results: query.Properties };\n }\n var postBody = JSON.stringify({\n request: util_1.Util.extend({\n \"__metadata\": { \"type\": \"Microsoft.Office.Server.Search.REST.SearchRequest\" },\n }, formattedBody),\n });\n return this.post({ body: postBody }).then(function (data) { return new SearchResults(data); });\n };\n return Search;\n}(queryable_1.QueryableInstance));\nexports.Search = Search;\nvar SearchResults = (function () {\n function SearchResults(rawResponse) {\n var response = rawResponse.postquery ? rawResponse.postquery : rawResponse;\n this.PrimarySearchResults = this.formatSearchResults(response.PrimaryQueryResult.RelevantResults.Table.Rows);\n this.RawSearchResults = response;\n this.ElapsedTime = response.ElapsedTime;\n this.RowCount = response.PrimaryQueryResult.RelevantResults.RowCount;\n this.TotalRows = response.PrimaryQueryResult.RelevantResults.TotalRows;\n this.TotalRowsIncludingDuplicates = response.PrimaryQueryResult.RelevantResults.TotalRowsIncludingDuplicates;\n }\n SearchResults.prototype.formatSearchResults = function (rawResults) {\n var results = new Array(), tempResults = rawResults.results ? rawResults.results : rawResults;\n for (var _i = 0, tempResults_1 = tempResults; _i < tempResults_1.length; _i++) {\n var i = tempResults_1[_i];\n results.push(new SearchResult(i.Cells));\n }\n return results;\n };\n return SearchResults;\n}());\nexports.SearchResults = SearchResults;\nvar SearchResult = (function () {\n function SearchResult(rawItem) {\n var item = rawItem.results ? rawItem.results : rawItem;\n for (var _i = 0, item_1 = item; _i < item_1.length; _i++) {\n var i = item_1[_i];\n this[i.Key] = i.Value;\n }\n }\n return SearchResult;\n}());\nexports.SearchResult = SearchResult;\n(function (SortDirection) {\n SortDirection[SortDirection[\"Ascending\"] = 0] = \"Ascending\";\n SortDirection[SortDirection[\"Descending\"] = 1] = \"Descending\";\n SortDirection[SortDirection[\"FQLFormula\"] = 2] = \"FQLFormula\";\n})(exports.SortDirection || (exports.SortDirection = {}));\nvar SortDirection = exports.SortDirection;\n(function (ReorderingRuleMatchType) {\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"ResultContainsKeyword\"] = 0] = \"ResultContainsKeyword\";\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"TitleContainsKeyword\"] = 1] = \"TitleContainsKeyword\";\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"TitleMatchesKeyword\"] = 2] = \"TitleMatchesKeyword\";\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"UrlStartsWith\"] = 3] = \"UrlStartsWith\";\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"UrlExactlyMatches\"] = 4] = \"UrlExactlyMatches\";\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"ContentTypeIs\"] = 5] = \"ContentTypeIs\";\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"FileExtensionMatches\"] = 6] = \"FileExtensionMatches\";\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"ResultHasTag\"] = 7] = \"ResultHasTag\";\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"ManualCondition\"] = 8] = \"ManualCondition\";\n})(exports.ReorderingRuleMatchType || (exports.ReorderingRuleMatchType = {}));\nvar ReorderingRuleMatchType = exports.ReorderingRuleMatchType;\n(function (QueryPropertyValueType) {\n QueryPropertyValueType[QueryPropertyValueType[\"None\"] = 0] = \"None\";\n QueryPropertyValueType[QueryPropertyValueType[\"StringType\"] = 1] = \"StringType\";\n QueryPropertyValueType[QueryPropertyValueType[\"Int32TYpe\"] = 2] = \"Int32TYpe\";\n QueryPropertyValueType[QueryPropertyValueType[\"BooleanType\"] = 3] = \"BooleanType\";\n QueryPropertyValueType[QueryPropertyValueType[\"StringArrayType\"] = 4] = \"StringArrayType\";\n QueryPropertyValueType[QueryPropertyValueType[\"UnSupportedType\"] = 5] = \"UnSupportedType\";\n})(exports.QueryPropertyValueType || (exports.QueryPropertyValueType = {}));\nvar QueryPropertyValueType = exports.QueryPropertyValueType;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar SearchSuggest = (function (_super) {\n __extends(SearchSuggest, _super);\n function SearchSuggest(baseUrl, path) {\n if (path === void 0) { path = \"_api/search/suggest\"; }\n _super.call(this, baseUrl, path);\n }\n SearchSuggest.prototype.execute = function (query) {\n this.mapQueryToQueryString(query);\n return this.get().then(function (response) { return new SearchSuggestResult(response); });\n };\n SearchSuggest.prototype.mapQueryToQueryString = function (query) {\n this.query.add(\"querytext\", \"'\" + query.querytext + \"'\");\n if (query.hasOwnProperty(\"count\")) {\n this.query.add(\"inumberofquerysuggestions\", query.count.toString());\n }\n if (query.hasOwnProperty(\"personalCount\")) {\n this.query.add(\"inumberofresultsuggestions\", query.personalCount.toString());\n }\n if (query.hasOwnProperty(\"preQuery\")) {\n this.query.add(\"fprequerysuggestions\", query.preQuery.toString());\n }\n if (query.hasOwnProperty(\"hitHighlighting\")) {\n this.query.add(\"fhithighlighting\", query.hitHighlighting.toString());\n }\n if (query.hasOwnProperty(\"capitalize\")) {\n this.query.add(\"fcapitalizefirstletters\", query.capitalize.toString());\n }\n if (query.hasOwnProperty(\"culture\")) {\n this.query.add(\"culture\", query.culture.toString());\n }\n if (query.hasOwnProperty(\"stemming\")) {\n this.query.add(\"enablestemming\", query.stemming.toString());\n }\n if (query.hasOwnProperty(\"includePeople\")) {\n this.query.add(\"showpeoplenamesuggestions\", query.includePeople.toString());\n }\n if (query.hasOwnProperty(\"queryRules\")) {\n this.query.add(\"enablequeryrules\", query.queryRules.toString());\n }\n if (query.hasOwnProperty(\"prefixMatch\")) {\n this.query.add(\"fprefixmatchallterms\", query.prefixMatch.toString());\n }\n };\n return SearchSuggest;\n}(queryable_1.QueryableInstance));\nexports.SearchSuggest = SearchSuggest;\nvar SearchSuggestResult = (function () {\n function SearchSuggestResult(json) {\n if (json.hasOwnProperty(\"suggest\")) {\n this.PeopleNames = json.suggest.PeopleNames.results;\n this.PersonalResults = json.suggest.PersonalResults.results;\n this.Queries = json.suggest.Queries.results;\n }\n else {\n this.PeopleNames = json.PeopleNames;\n this.PersonalResults = json.PersonalResults;\n this.Queries = json.Queries;\n }\n }\n return SearchSuggestResult;\n}());\nexports.SearchSuggestResult = SearchSuggestResult;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar webs_1 = require(\"./webs\");\nvar usercustomactions_1 = require(\"./usercustomactions\");\nvar odata_1 = require(\"./odata\");\nvar Site = (function (_super) {\n __extends(Site, _super);\n function Site(baseUrl, path) {\n if (path === void 0) { path = \"_api/site\"; }\n _super.call(this, baseUrl, path);\n }\n Object.defineProperty(Site.prototype, \"rootWeb\", {\n get: function () {\n return new webs_1.Web(this, \"rootweb\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Site.prototype, \"userCustomActions\", {\n get: function () {\n return new usercustomactions_1.UserCustomActions(this);\n },\n enumerable: true,\n configurable: true\n });\n Site.prototype.getContextInfo = function () {\n var q = new Site(\"\", \"_api/contextinfo\");\n return q.post().then(function (data) {\n if (data.hasOwnProperty(\"GetContextWebInformation\")) {\n var info = data.GetContextWebInformation;\n info.SupportedSchemaVersions = info.SupportedSchemaVersions.results;\n return info;\n }\n else {\n return data;\n }\n });\n };\n Site.prototype.getDocumentLibraries = function (absoluteWebUrl) {\n var q = new queryable_1.Queryable(\"\", \"_api/sp.web.getdocumentlibraries(@v)\");\n q.query.add(\"@v\", \"'\" + absoluteWebUrl + \"'\");\n return q.get().then(function (data) {\n if (data.hasOwnProperty(\"GetDocumentLibraries\")) {\n return data.GetDocumentLibraries;\n }\n else {\n return data;\n }\n });\n };\n Site.prototype.getWebUrlFromPageUrl = function (absolutePageUrl) {\n var q = new queryable_1.Queryable(\"\", \"_api/sp.web.getweburlfrompageurl(@v)\");\n q.query.add(\"@v\", \"'\" + absolutePageUrl + \"'\");\n return q.get().then(function (data) {\n if (data.hasOwnProperty(\"GetWebUrlFromPageUrl\")) {\n return data.GetWebUrlFromPageUrl;\n }\n else {\n return data;\n }\n });\n };\n Site.prototype.createBatch = function () {\n return new odata_1.ODataBatch(this.parentUrl);\n };\n return Site;\n}(queryable_1.QueryableInstance));\nexports.Site = Site;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar siteusers_1 = require(\"./siteusers\");\nvar util_1 = require(\"../../utils/util\");\n(function (PrincipalType) {\n PrincipalType[PrincipalType[\"None\"] = 0] = \"None\";\n PrincipalType[PrincipalType[\"User\"] = 1] = \"User\";\n PrincipalType[PrincipalType[\"DistributionList\"] = 2] = \"DistributionList\";\n PrincipalType[PrincipalType[\"SecurityGroup\"] = 4] = \"SecurityGroup\";\n PrincipalType[PrincipalType[\"SharePointGroup\"] = 8] = \"SharePointGroup\";\n PrincipalType[PrincipalType[\"All\"] = 15] = \"All\";\n})(exports.PrincipalType || (exports.PrincipalType = {}));\nvar PrincipalType = exports.PrincipalType;\nvar SiteGroups = (function (_super) {\n __extends(SiteGroups, _super);\n function SiteGroups(baseUrl, path) {\n if (path === void 0) { path = \"sitegroups\"; }\n _super.call(this, baseUrl, path);\n }\n SiteGroups.prototype.add = function (properties) {\n var _this = this;\n var postBody = JSON.stringify(util_1.Util.extend({ \"__metadata\": { \"type\": \"SP.Group\" } }, properties));\n return this.post({ body: postBody }).then(function (data) {\n return {\n data: data,\n group: _this.getById(data.Id),\n };\n });\n };\n SiteGroups.prototype.getByName = function (groupName) {\n return new SiteGroup(this, \"getByName('\" + groupName + \"')\");\n };\n SiteGroups.prototype.getById = function (id) {\n var sg = new SiteGroup(this);\n sg.concat(\"(\" + id + \")\");\n return sg;\n };\n SiteGroups.prototype.removeById = function (id) {\n var g = new SiteGroups(this, \"removeById('\" + id + \"')\");\n return g.post();\n };\n SiteGroups.prototype.removeByLoginName = function (loginName) {\n var g = new SiteGroups(this, \"removeByLoginName('\" + loginName + \"')\");\n return g.post();\n };\n return SiteGroups;\n}(queryable_1.QueryableCollection));\nexports.SiteGroups = SiteGroups;\nvar SiteGroup = (function (_super) {\n __extends(SiteGroup, _super);\n function SiteGroup(baseUrl, path) {\n _super.call(this, baseUrl, path);\n }\n Object.defineProperty(SiteGroup.prototype, \"users\", {\n get: function () {\n return new siteusers_1.SiteUsers(this, \"users\");\n },\n enumerable: true,\n configurable: true\n });\n SiteGroup.prototype.update = function (properties) {\n var _this = this;\n var postBody = util_1.Util.extend({ \"__metadata\": { \"type\": \"SP.Group\" } }, properties);\n return this.post({\n body: JSON.stringify(postBody),\n headers: {\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n var retGroup = _this;\n if (properties.hasOwnProperty(\"Title\")) {\n retGroup = _this.getParent(SiteGroup, _this.parentUrl, \"getByName('\" + properties[\"Title\"] + \"')\");\n }\n return {\n data: data,\n group: retGroup,\n };\n });\n };\n return SiteGroup;\n}(queryable_1.QueryableInstance));\nexports.SiteGroup = SiteGroup;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar sitegroups_1 = require(\"./sitegroups\");\nvar util_1 = require(\"../../utils/util\");\nvar SiteUsers = (function (_super) {\n __extends(SiteUsers, _super);\n function SiteUsers(baseUrl, path) {\n if (path === void 0) { path = \"siteusers\"; }\n _super.call(this, baseUrl, path);\n }\n SiteUsers.prototype.getByEmail = function (email) {\n return new SiteUser(this, \"getByEmail('\" + email + \"')\");\n };\n SiteUsers.prototype.getById = function (id) {\n return new SiteUser(this, \"getById(\" + id + \")\");\n };\n SiteUsers.prototype.getByLoginName = function (loginName) {\n var su = new SiteUser(this);\n su.concat(\"(@v)\");\n su.query.add(\"@v\", encodeURIComponent(loginName));\n return su;\n };\n SiteUsers.prototype.removeById = function (id) {\n var o = new SiteUsers(this, \"removeById(\" + id + \")\");\n return o.post();\n };\n SiteUsers.prototype.removeByLoginName = function (loginName) {\n var o = new SiteUsers(this, \"removeByLoginName(@v)\");\n o.query.add(\"@v\", encodeURIComponent(loginName));\n return o.post();\n };\n SiteUsers.prototype.add = function (loginName) {\n var _this = this;\n var postBody = JSON.stringify({ \"__metadata\": { \"type\": \"SP.User\" }, LoginName: loginName });\n return this.post({ body: postBody }).then(function (data) { return _this.getByLoginName(loginName); });\n };\n return SiteUsers;\n}(queryable_1.QueryableCollection));\nexports.SiteUsers = SiteUsers;\nvar SiteUser = (function (_super) {\n __extends(SiteUser, _super);\n function SiteUser(baseUrl, path) {\n _super.call(this, baseUrl, path);\n }\n Object.defineProperty(SiteUser.prototype, \"groups\", {\n get: function () {\n return new sitegroups_1.SiteGroups(this, \"groups\");\n },\n enumerable: true,\n configurable: true\n });\n SiteUser.prototype.update = function (properties) {\n var _this = this;\n var postBody = util_1.Util.extend({ \"__metadata\": { \"type\": \"SP.User\" } }, properties);\n return this.post({\n body: JSON.stringify(postBody),\n headers: {\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n return {\n data: data,\n user: _this,\n };\n });\n };\n SiteUser.prototype.delete = function () {\n return this.post({\n headers: {\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n return SiteUser;\n}(queryable_1.QueryableInstance));\nexports.SiteUser = SiteUser;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar Subscriptions = (function (_super) {\n __extends(Subscriptions, _super);\n function Subscriptions(baseUrl, path) {\n if (path === void 0) { path = \"subscriptions\"; }\n _super.call(this, baseUrl, path);\n }\n Subscriptions.prototype.getById = function (subscriptionId) {\n var subscription = new Subscription(this);\n subscription.concat(\"('\" + subscriptionId + \"')\");\n return subscription;\n };\n Subscriptions.prototype.add = function (notificationUrl, expirationDate, clientState) {\n var _this = this;\n var postBody = JSON.stringify({\n \"resource\": this.toUrl(),\n \"notificationUrl\": notificationUrl,\n \"expirationDateTime\": expirationDate,\n \"clientState\": clientState || \"pnp-js-core-subscription\",\n });\n return this.post({ body: postBody, headers: { \"Content-Type\": \"application/json\" } }).then(function (result) {\n return { data: result, subscription: _this.getById(result.id) };\n });\n };\n return Subscriptions;\n}(queryable_1.QueryableCollection));\nexports.Subscriptions = Subscriptions;\nvar Subscription = (function (_super) {\n __extends(Subscription, _super);\n function Subscription(baseUrl, path) {\n _super.call(this, baseUrl, path);\n }\n Subscription.prototype.update = function (expirationDate) {\n var _this = this;\n var postBody = JSON.stringify({\n \"expirationDateTime\": expirationDate,\n });\n return this.patch({ body: postBody, headers: { \"Content-Type\": \"application/json\" } }).then(function (data) {\n return { data: data, subscription: _this };\n });\n };\n Subscription.prototype.delete = function () {\n return _super.prototype.delete.call(this);\n };\n return Subscription;\n}(queryable_1.QueryableInstance));\nexports.Subscription = Subscription;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar TopNavigationBar = (function (_super) {\n __extends(TopNavigationBar, _super);\n function TopNavigationBar(baseUrl) {\n _super.call(this, baseUrl, \"TopNavigationBar\");\n }\n return TopNavigationBar;\n}(queryable_1.QueryableInstance));\nexports.TopNavigationBar = TopNavigationBar;\n","\"use strict\";\n(function (ControlMode) {\n ControlMode[ControlMode[\"Display\"] = 1] = \"Display\";\n ControlMode[ControlMode[\"Edit\"] = 2] = \"Edit\";\n ControlMode[ControlMode[\"New\"] = 3] = \"New\";\n})(exports.ControlMode || (exports.ControlMode = {}));\nvar ControlMode = exports.ControlMode;\n(function (FieldTypes) {\n FieldTypes[FieldTypes[\"Invalid\"] = 0] = \"Invalid\";\n FieldTypes[FieldTypes[\"Integer\"] = 1] = \"Integer\";\n FieldTypes[FieldTypes[\"Text\"] = 2] = \"Text\";\n FieldTypes[FieldTypes[\"Note\"] = 3] = \"Note\";\n FieldTypes[FieldTypes[\"DateTime\"] = 4] = \"DateTime\";\n FieldTypes[FieldTypes[\"Counter\"] = 5] = \"Counter\";\n FieldTypes[FieldTypes[\"Choice\"] = 6] = \"Choice\";\n FieldTypes[FieldTypes[\"Lookup\"] = 7] = \"Lookup\";\n FieldTypes[FieldTypes[\"Boolean\"] = 8] = \"Boolean\";\n FieldTypes[FieldTypes[\"Number\"] = 9] = \"Number\";\n FieldTypes[FieldTypes[\"Currency\"] = 10] = \"Currency\";\n FieldTypes[FieldTypes[\"URL\"] = 11] = \"URL\";\n FieldTypes[FieldTypes[\"Computed\"] = 12] = \"Computed\";\n FieldTypes[FieldTypes[\"Threading\"] = 13] = \"Threading\";\n FieldTypes[FieldTypes[\"Guid\"] = 14] = \"Guid\";\n FieldTypes[FieldTypes[\"MultiChoice\"] = 15] = \"MultiChoice\";\n FieldTypes[FieldTypes[\"GridChoice\"] = 16] = \"GridChoice\";\n FieldTypes[FieldTypes[\"Calculated\"] = 17] = \"Calculated\";\n FieldTypes[FieldTypes[\"File\"] = 18] = \"File\";\n FieldTypes[FieldTypes[\"Attachments\"] = 19] = \"Attachments\";\n FieldTypes[FieldTypes[\"User\"] = 20] = \"User\";\n FieldTypes[FieldTypes[\"Recurrence\"] = 21] = \"Recurrence\";\n FieldTypes[FieldTypes[\"CrossProjectLink\"] = 22] = \"CrossProjectLink\";\n FieldTypes[FieldTypes[\"ModStat\"] = 23] = \"ModStat\";\n FieldTypes[FieldTypes[\"Error\"] = 24] = \"Error\";\n FieldTypes[FieldTypes[\"ContentTypeId\"] = 25] = \"ContentTypeId\";\n FieldTypes[FieldTypes[\"PageSeparator\"] = 26] = \"PageSeparator\";\n FieldTypes[FieldTypes[\"ThreadIndex\"] = 27] = \"ThreadIndex\";\n FieldTypes[FieldTypes[\"WorkflowStatus\"] = 28] = \"WorkflowStatus\";\n FieldTypes[FieldTypes[\"AllDayEvent\"] = 29] = \"AllDayEvent\";\n FieldTypes[FieldTypes[\"WorkflowEventType\"] = 30] = \"WorkflowEventType\";\n})(exports.FieldTypes || (exports.FieldTypes = {}));\nvar FieldTypes = exports.FieldTypes;\n(function (DateTimeFieldFormatType) {\n DateTimeFieldFormatType[DateTimeFieldFormatType[\"DateOnly\"] = 0] = \"DateOnly\";\n DateTimeFieldFormatType[DateTimeFieldFormatType[\"DateTime\"] = 1] = \"DateTime\";\n})(exports.DateTimeFieldFormatType || (exports.DateTimeFieldFormatType = {}));\nvar DateTimeFieldFormatType = exports.DateTimeFieldFormatType;\n(function (AddFieldOptions) {\n AddFieldOptions[AddFieldOptions[\"DefaultValue\"] = 0] = \"DefaultValue\";\n AddFieldOptions[AddFieldOptions[\"AddToDefaultContentType\"] = 1] = \"AddToDefaultContentType\";\n AddFieldOptions[AddFieldOptions[\"AddToNoContentType\"] = 2] = \"AddToNoContentType\";\n AddFieldOptions[AddFieldOptions[\"AddToAllContentTypes\"] = 4] = \"AddToAllContentTypes\";\n AddFieldOptions[AddFieldOptions[\"AddFieldInternalNameHint\"] = 8] = \"AddFieldInternalNameHint\";\n AddFieldOptions[AddFieldOptions[\"AddFieldToDefaultView\"] = 16] = \"AddFieldToDefaultView\";\n AddFieldOptions[AddFieldOptions[\"AddFieldCheckDisplayName\"] = 32] = \"AddFieldCheckDisplayName\";\n})(exports.AddFieldOptions || (exports.AddFieldOptions = {}));\nvar AddFieldOptions = exports.AddFieldOptions;\n(function (CalendarType) {\n CalendarType[CalendarType[\"Gregorian\"] = 1] = \"Gregorian\";\n CalendarType[CalendarType[\"Japan\"] = 3] = \"Japan\";\n CalendarType[CalendarType[\"Taiwan\"] = 4] = \"Taiwan\";\n CalendarType[CalendarType[\"Korea\"] = 5] = \"Korea\";\n CalendarType[CalendarType[\"Hijri\"] = 6] = \"Hijri\";\n CalendarType[CalendarType[\"Thai\"] = 7] = \"Thai\";\n CalendarType[CalendarType[\"Hebrew\"] = 8] = \"Hebrew\";\n CalendarType[CalendarType[\"GregorianMEFrench\"] = 9] = \"GregorianMEFrench\";\n CalendarType[CalendarType[\"GregorianArabic\"] = 10] = \"GregorianArabic\";\n CalendarType[CalendarType[\"GregorianXLITEnglish\"] = 11] = \"GregorianXLITEnglish\";\n CalendarType[CalendarType[\"GregorianXLITFrench\"] = 12] = \"GregorianXLITFrench\";\n CalendarType[CalendarType[\"KoreaJapanLunar\"] = 14] = \"KoreaJapanLunar\";\n CalendarType[CalendarType[\"ChineseLunar\"] = 15] = \"ChineseLunar\";\n CalendarType[CalendarType[\"SakaEra\"] = 16] = \"SakaEra\";\n CalendarType[CalendarType[\"UmAlQura\"] = 23] = \"UmAlQura\";\n})(exports.CalendarType || (exports.CalendarType = {}));\nvar CalendarType = exports.CalendarType;\n(function (UrlFieldFormatType) {\n UrlFieldFormatType[UrlFieldFormatType[\"Hyperlink\"] = 0] = \"Hyperlink\";\n UrlFieldFormatType[UrlFieldFormatType[\"Image\"] = 1] = \"Image\";\n})(exports.UrlFieldFormatType || (exports.UrlFieldFormatType = {}));\nvar UrlFieldFormatType = exports.UrlFieldFormatType;\n(function (PrincipalType) {\n PrincipalType[PrincipalType[\"None\"] = 0] = \"None\";\n PrincipalType[PrincipalType[\"User\"] = 1] = \"User\";\n PrincipalType[PrincipalType[\"DistributionList\"] = 2] = \"DistributionList\";\n PrincipalType[PrincipalType[\"SecurityGroup\"] = 4] = \"SecurityGroup\";\n PrincipalType[PrincipalType[\"SharePointGroup\"] = 8] = \"SharePointGroup\";\n PrincipalType[PrincipalType[\"All\"] = 15] = \"All\";\n})(exports.PrincipalType || (exports.PrincipalType = {}));\nvar PrincipalType = exports.PrincipalType;\n(function (PageType) {\n PageType[PageType[\"Invalid\"] = -1] = \"Invalid\";\n PageType[PageType[\"DefaultView\"] = 0] = \"DefaultView\";\n PageType[PageType[\"NormalView\"] = 1] = \"NormalView\";\n PageType[PageType[\"DialogView\"] = 2] = \"DialogView\";\n PageType[PageType[\"View\"] = 3] = \"View\";\n PageType[PageType[\"DisplayForm\"] = 4] = \"DisplayForm\";\n PageType[PageType[\"DisplayFormDialog\"] = 5] = \"DisplayFormDialog\";\n PageType[PageType[\"EditForm\"] = 6] = \"EditForm\";\n PageType[PageType[\"EditFormDialog\"] = 7] = \"EditFormDialog\";\n PageType[PageType[\"NewForm\"] = 8] = \"NewForm\";\n PageType[PageType[\"NewFormDialog\"] = 9] = \"NewFormDialog\";\n PageType[PageType[\"SolutionForm\"] = 10] = \"SolutionForm\";\n PageType[PageType[\"PAGE_MAXITEMS\"] = 11] = \"PAGE_MAXITEMS\";\n})(exports.PageType || (exports.PageType = {}));\nvar PageType = exports.PageType;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar util_1 = require(\"../../utils/util\");\nvar UserCustomActions = (function (_super) {\n __extends(UserCustomActions, _super);\n function UserCustomActions(baseUrl, path) {\n if (path === void 0) { path = \"usercustomactions\"; }\n _super.call(this, baseUrl, path);\n }\n UserCustomActions.prototype.getById = function (id) {\n return new UserCustomAction(this, \"(\" + id + \")\");\n };\n UserCustomActions.prototype.add = function (properties) {\n var _this = this;\n var postBody = JSON.stringify(util_1.Util.extend({ __metadata: { \"type\": \"SP.UserCustomAction\" } }, properties));\n return this.post({ body: postBody }).then(function (data) {\n return {\n action: _this.getById(data.Id),\n data: data,\n };\n });\n };\n UserCustomActions.prototype.clear = function () {\n var a = new UserCustomActions(this, \"clear\");\n return a.post();\n };\n return UserCustomActions;\n}(queryable_1.QueryableCollection));\nexports.UserCustomActions = UserCustomActions;\nvar UserCustomAction = (function (_super) {\n __extends(UserCustomAction, _super);\n function UserCustomAction(baseUrl, path) {\n _super.call(this, baseUrl, path);\n }\n UserCustomAction.prototype.update = function (properties) {\n var _this = this;\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": \"SP.UserCustomAction\" },\n }, properties));\n return this.post({\n body: postBody,\n headers: {\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n return {\n action: _this,\n data: data,\n };\n });\n };\n return UserCustomAction;\n}(queryable_1.QueryableInstance));\nexports.UserCustomAction = UserCustomAction;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar FileUtil = require(\"../../utils/files\");\nvar odata_1 = require(\"./odata\");\nvar UserProfileQuery = (function (_super) {\n __extends(UserProfileQuery, _super);\n function UserProfileQuery(baseUrl, path) {\n if (path === void 0) { path = \"_api/sp.userprofiles.peoplemanager\"; }\n _super.call(this, baseUrl, path);\n this.profileLoader = new ProfileLoader(baseUrl);\n }\n Object.defineProperty(UserProfileQuery.prototype, \"editProfileLink\", {\n get: function () {\n var q = new UserProfileQuery(this, \"EditProfileLink\");\n return q.getAs(odata_1.ODataValue());\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(UserProfileQuery.prototype, \"isMyPeopleListPublic\", {\n get: function () {\n var q = new UserProfileQuery(this, \"IsMyPeopleListPublic\");\n return q.getAs(odata_1.ODataValue());\n },\n enumerable: true,\n configurable: true\n });\n UserProfileQuery.prototype.amIFollowedBy = function (loginName) {\n var q = new UserProfileQuery(this, \"amifollowedby(@v)\");\n q.query.add(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\n return q.get();\n };\n UserProfileQuery.prototype.amIFollowing = function (loginName) {\n var q = new UserProfileQuery(this, \"amifollowing(@v)\");\n q.query.add(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\n return q.get();\n };\n UserProfileQuery.prototype.getFollowedTags = function (maxCount) {\n if (maxCount === void 0) { maxCount = 20; }\n var q = new UserProfileQuery(this, \"getfollowedtags(\" + maxCount + \")\");\n return q.get();\n };\n UserProfileQuery.prototype.getFollowersFor = function (loginName) {\n var q = new UserProfileQuery(this, \"getfollowersfor(@v)\");\n q.query.add(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\n return q.get();\n };\n Object.defineProperty(UserProfileQuery.prototype, \"myFollowers\", {\n get: function () {\n return new queryable_1.QueryableCollection(this, \"getmyfollowers\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(UserProfileQuery.prototype, \"myProperties\", {\n get: function () {\n return new UserProfileQuery(this, \"getmyproperties\");\n },\n enumerable: true,\n configurable: true\n });\n UserProfileQuery.prototype.getPeopleFollowedBy = function (loginName) {\n var q = new UserProfileQuery(this, \"getpeoplefollowedby(@v)\");\n q.query.add(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\n return q.get();\n };\n UserProfileQuery.prototype.getPropertiesFor = function (loginName) {\n var q = new UserProfileQuery(this, \"getpropertiesfor(@v)\");\n q.query.add(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\n return q.get();\n };\n Object.defineProperty(UserProfileQuery.prototype, \"trendingTags\", {\n get: function () {\n var q = new UserProfileQuery(this, null);\n q.concat(\".gettrendingtags\");\n return q.get();\n },\n enumerable: true,\n configurable: true\n });\n UserProfileQuery.prototype.getUserProfilePropertyFor = function (loginName, propertyName) {\n var q = new UserProfileQuery(this, \"getuserprofilepropertyfor(accountname=@v, propertyname='\" + propertyName + \"')\");\n q.query.add(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\n return q.get();\n };\n UserProfileQuery.prototype.hideSuggestion = function (loginName) {\n var q = new UserProfileQuery(this, \"hidesuggestion(@v)\");\n q.query.add(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\n return q.post();\n };\n UserProfileQuery.prototype.isFollowing = function (follower, followee) {\n var q = new UserProfileQuery(this, null);\n q.concat(\".isfollowing(possiblefolloweraccountname=@v, possiblefolloweeaccountname=@y)\");\n q.query.add(\"@v\", \"'\" + encodeURIComponent(follower) + \"'\");\n q.query.add(\"@y\", \"'\" + encodeURIComponent(followee) + \"'\");\n return q.get();\n };\n UserProfileQuery.prototype.setMyProfilePic = function (profilePicSource) {\n var _this = this;\n return FileUtil.readBlobAsArrayBuffer(profilePicSource).then(function (buffer) {\n var request = new UserProfileQuery(_this, \"setmyprofilepicture\");\n return request.post({\n body: String.fromCharCode.apply(null, new Uint16Array(buffer)),\n });\n });\n };\n UserProfileQuery.prototype.createPersonalSiteEnqueueBulk = function () {\n var emails = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n emails[_i - 0] = arguments[_i];\n }\n return this.profileLoader.createPersonalSiteEnqueueBulk(emails);\n };\n Object.defineProperty(UserProfileQuery.prototype, \"ownerUserProfile\", {\n get: function () {\n return this.profileLoader.ownerUserProfile;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(UserProfileQuery.prototype, \"userProfile\", {\n get: function () {\n return this.profileLoader.userProfile;\n },\n enumerable: true,\n configurable: true\n });\n UserProfileQuery.prototype.createPersonalSite = function (interactiveRequest) {\n if (interactiveRequest === void 0) { interactiveRequest = false; }\n return this.profileLoader.createPersonalSite(interactiveRequest);\n };\n UserProfileQuery.prototype.shareAllSocialData = function (share) {\n return this.profileLoader.shareAllSocialData(share);\n };\n return UserProfileQuery;\n}(queryable_1.QueryableInstance));\nexports.UserProfileQuery = UserProfileQuery;\nvar ProfileLoader = (function (_super) {\n __extends(ProfileLoader, _super);\n function ProfileLoader(baseUrl, path) {\n if (path === void 0) { path = \"_api/sp.userprofiles.profileloader.getprofileloader\"; }\n _super.call(this, baseUrl, path);\n }\n ProfileLoader.prototype.createPersonalSiteEnqueueBulk = function (emails) {\n var q = new ProfileLoader(this, \"createpersonalsiteenqueuebulk\");\n var postBody = JSON.stringify({ \"emailIDs\": emails });\n return q.post({\n body: postBody,\n });\n };\n Object.defineProperty(ProfileLoader.prototype, \"ownerUserProfile\", {\n get: function () {\n var q = this.getParent(ProfileLoader, this.parentUrl, \"_api/sp.userprofiles.profileloader.getowneruserprofile\");\n return q.postAs();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ProfileLoader.prototype, \"userProfile\", {\n get: function () {\n var q = new ProfileLoader(this, \"getuserprofile\");\n return q.postAs();\n },\n enumerable: true,\n configurable: true\n });\n ProfileLoader.prototype.createPersonalSite = function (interactiveRequest) {\n if (interactiveRequest === void 0) { interactiveRequest = false; }\n var q = new ProfileLoader(this, \"getuserprofile/createpersonalsiteenque(\" + interactiveRequest + \")\\\",\");\n return q.post();\n };\n ProfileLoader.prototype.shareAllSocialData = function (share) {\n var q = new ProfileLoader(this, \"getuserprofile/shareallsocialdata(\" + share + \")\\\",\");\n return q.post();\n };\n return ProfileLoader;\n}(queryable_1.Queryable));\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar util_1 = require(\"../../utils/util\");\nvar Views = (function (_super) {\n __extends(Views, _super);\n function Views(baseUrl) {\n _super.call(this, baseUrl, \"views\");\n }\n Views.prototype.getById = function (id) {\n var v = new View(this);\n v.concat(\"('\" + id + \"')\");\n return v;\n };\n Views.prototype.getByTitle = function (title) {\n return new View(this, \"getByTitle('\" + title + \"')\");\n };\n Views.prototype.add = function (title, personalView, additionalSettings) {\n var _this = this;\n if (personalView === void 0) { personalView = false; }\n if (additionalSettings === void 0) { additionalSettings = {}; }\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": \"SP.View\" },\n \"Title\": title,\n \"PersonalView\": personalView,\n }, additionalSettings));\n return this.postAs({ body: postBody }).then(function (data) {\n return {\n data: data,\n view: _this.getById(data.Id),\n };\n });\n };\n return Views;\n}(queryable_1.QueryableCollection));\nexports.Views = Views;\nvar View = (function (_super) {\n __extends(View, _super);\n function View(baseUrl, path) {\n _super.call(this, baseUrl, path);\n }\n Object.defineProperty(View.prototype, \"fields\", {\n get: function () {\n return new ViewFields(this);\n },\n enumerable: true,\n configurable: true\n });\n View.prototype.update = function (properties) {\n var _this = this;\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": \"SP.View\" },\n }, properties));\n return this.post({\n body: postBody,\n headers: {\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n return {\n data: data,\n view: _this,\n };\n });\n };\n View.prototype.delete = function () {\n return this.post({\n headers: {\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n View.prototype.renderAsHtml = function () {\n var q = new queryable_1.Queryable(this, \"renderashtml\");\n return q.get();\n };\n return View;\n}(queryable_1.QueryableInstance));\nexports.View = View;\nvar ViewFields = (function (_super) {\n __extends(ViewFields, _super);\n function ViewFields(baseUrl, path) {\n if (path === void 0) { path = \"viewfields\"; }\n _super.call(this, baseUrl, path);\n }\n ViewFields.prototype.getSchemaXml = function () {\n var q = new queryable_1.Queryable(this, \"schemaxml\");\n return q.get();\n };\n ViewFields.prototype.add = function (fieldTitleOrInternalName) {\n var q = new ViewFields(this, \"addviewfield('\" + fieldTitleOrInternalName + \"')\");\n return q.post();\n };\n ViewFields.prototype.move = function (fieldInternalName, index) {\n var q = new ViewFields(this, \"moveviewfieldto\");\n var postBody = JSON.stringify({ \"field\": fieldInternalName, \"index\": index });\n return q.post({ body: postBody });\n };\n ViewFields.prototype.removeAll = function () {\n var q = new ViewFields(this, \"removeallviewfields\");\n return q.post();\n };\n ViewFields.prototype.remove = function (fieldInternalName) {\n var q = new ViewFields(this, \"removeviewfield('\" + fieldInternalName + \"')\");\n return q.post();\n };\n return ViewFields;\n}(queryable_1.QueryableCollection));\nexports.ViewFields = ViewFields;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar queryablesecurable_1 = require(\"./queryablesecurable\");\nvar lists_1 = require(\"./lists\");\nvar fields_1 = require(\"./fields\");\nvar navigation_1 = require(\"./navigation\");\nvar sitegroups_1 = require(\"./sitegroups\");\nvar contenttypes_1 = require(\"./contenttypes\");\nvar folders_1 = require(\"./folders\");\nvar roles_1 = require(\"./roles\");\nvar files_1 = require(\"./files\");\nvar util_1 = require(\"../../utils/util\");\nvar lists_2 = require(\"./lists\");\nvar siteusers_1 = require(\"./siteusers\");\nvar usercustomactions_1 = require(\"./usercustomactions\");\nvar odata_1 = require(\"./odata\");\nvar Webs = (function (_super) {\n __extends(Webs, _super);\n function Webs(baseUrl, webPath) {\n if (webPath === void 0) { webPath = \"webs\"; }\n _super.call(this, baseUrl, webPath);\n }\n Webs.prototype.add = function (title, url, description, template, language, inheritPermissions, additionalSettings) {\n if (description === void 0) { description = \"\"; }\n if (template === void 0) { template = \"STS\"; }\n if (language === void 0) { language = 1033; }\n if (inheritPermissions === void 0) { inheritPermissions = true; }\n if (additionalSettings === void 0) { additionalSettings = {}; }\n var props = util_1.Util.extend({\n Description: description,\n Language: language,\n Title: title,\n Url: url,\n UseSamePermissionsAsParentSite: inheritPermissions,\n WebTemplate: template,\n }, additionalSettings);\n var postBody = JSON.stringify({\n \"parameters\": util_1.Util.extend({\n \"__metadata\": { \"type\": \"SP.WebCreationInformation\" },\n }, props),\n });\n var q = new Webs(this, \"add\");\n return q.post({ body: postBody }).then(function (data) {\n return {\n data: data,\n web: new Web(odata_1.extractOdataId(data), \"\"),\n };\n });\n };\n return Webs;\n}(queryable_1.QueryableCollection));\nexports.Webs = Webs;\nvar Web = (function (_super) {\n __extends(Web, _super);\n function Web(baseUrl, path) {\n if (path === void 0) { path = \"_api/web\"; }\n _super.call(this, baseUrl, path);\n }\n Object.defineProperty(Web.prototype, \"webs\", {\n get: function () {\n return new Webs(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"contentTypes\", {\n get: function () {\n return new contenttypes_1.ContentTypes(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"lists\", {\n get: function () {\n return new lists_1.Lists(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"fields\", {\n get: function () {\n return new fields_1.Fields(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"availablefields\", {\n get: function () {\n return new fields_1.Fields(this, \"availablefields\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"navigation\", {\n get: function () {\n return new navigation_1.Navigation(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"siteUsers\", {\n get: function () {\n return new siteusers_1.SiteUsers(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"siteGroups\", {\n get: function () {\n return new sitegroups_1.SiteGroups(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"folders\", {\n get: function () {\n return new folders_1.Folders(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"userCustomActions\", {\n get: function () {\n return new usercustomactions_1.UserCustomActions(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"roleDefinitions\", {\n get: function () {\n return new roles_1.RoleDefinitions(this);\n },\n enumerable: true,\n configurable: true\n });\n Web.prototype.createBatch = function () {\n return new odata_1.ODataBatch(this.parentUrl);\n };\n Web.prototype.getFolderByServerRelativeUrl = function (folderRelativeUrl) {\n return new folders_1.Folder(this, \"getFolderByServerRelativeUrl('\" + folderRelativeUrl + \"')\");\n };\n Web.prototype.getFileByServerRelativeUrl = function (fileRelativeUrl) {\n return new files_1.File(this, \"getFileByServerRelativeUrl('\" + fileRelativeUrl + \"')\");\n };\n Web.prototype.getList = function (listRelativeUrl) {\n return new lists_2.List(this, \"getList('\" + listRelativeUrl + \"')\");\n };\n Web.prototype.update = function (properties) {\n var _this = this;\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": \"SP.Web\" },\n }, properties));\n return this.post({\n body: postBody,\n headers: {\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n return {\n data: data,\n web: _this,\n };\n });\n };\n Web.prototype.delete = function () {\n return this.post({\n headers: {\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n Web.prototype.applyTheme = function (colorPaletteUrl, fontSchemeUrl, backgroundImageUrl, shareGenerated) {\n var postBody = JSON.stringify({\n backgroundImageUrl: backgroundImageUrl,\n colorPaletteUrl: colorPaletteUrl,\n fontSchemeUrl: fontSchemeUrl,\n shareGenerated: shareGenerated,\n });\n var q = new Web(this, \"applytheme\");\n return q.post({ body: postBody });\n };\n Web.prototype.applyWebTemplate = function (template) {\n var q = new Web(this, \"applywebtemplate\");\n q.concat(\"(@t)\");\n q.query.add(\"@t\", template);\n return q.post();\n };\n Web.prototype.doesUserHavePermissions = function (perms) {\n var q = new Web(this, \"doesuserhavepermissions\");\n q.concat(\"(@p)\");\n q.query.add(\"@p\", JSON.stringify(perms));\n return q.get();\n };\n Web.prototype.ensureUser = function (loginName) {\n var postBody = JSON.stringify({\n logonName: loginName,\n });\n var q = new Web(this, \"ensureuser\");\n return q.post({ body: postBody });\n };\n Web.prototype.availableWebTemplates = function (language, includeCrossLanugage) {\n if (language === void 0) { language = 1033; }\n if (includeCrossLanugage === void 0) { includeCrossLanugage = true; }\n return new queryable_1.QueryableCollection(this, \"getavailablewebtemplates(lcid=\" + language + \", doincludecrosslanguage=\" + includeCrossLanugage + \")\");\n };\n Web.prototype.getCatalog = function (type) {\n var q = new Web(this, \"getcatalog(\" + type + \")\");\n q.select(\"Id\");\n return q.get().then(function (data) {\n return new lists_2.List(odata_1.extractOdataId(data));\n });\n };\n Web.prototype.getChanges = function (query) {\n var postBody = JSON.stringify({ \"query\": util_1.Util.extend({ \"__metadata\": { \"type\": \"SP.ChangeQuery\" } }, query) });\n var q = new Web(this, \"getchanges\");\n return q.post({ body: postBody });\n };\n Object.defineProperty(Web.prototype, \"customListTemplate\", {\n get: function () {\n return new queryable_1.QueryableCollection(this, \"getcustomlisttemplates\");\n },\n enumerable: true,\n configurable: true\n });\n Web.prototype.getUserById = function (id) {\n return new siteusers_1.SiteUser(this, \"getUserById(\" + id + \")\");\n };\n Web.prototype.mapToIcon = function (filename, size, progId) {\n if (size === void 0) { size = 0; }\n if (progId === void 0) { progId = \"\"; }\n var q = new Web(this, \"maptoicon(filename='\" + filename + \"', progid='\" + progId + \"', size=\" + size + \")\");\n return q.get();\n };\n return Web;\n}(queryablesecurable_1.QueryableSecurable));\nexports.Web = Web;\n","\"use strict\";\nfunction __export(m) {\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\n}\n__export(require(\"../sharepoint/rest/index\"));\nvar httpclient_1 = require(\"../net/httpclient\");\nexports.HttpClient = httpclient_1.HttpClient;\nvar collections_1 = require(\"../collections/collections\");\nexports.Dictionary = collections_1.Dictionary;\nvar util_1 = require(\"../utils/util\");\nexports.Util = util_1.Util;\n__export(require(\"../utils/logging\"));\n","\"use strict\";\nfunction readBlobAsText(blob) {\n return readBlobAs(blob, \"string\");\n}\nexports.readBlobAsText = readBlobAsText;\nfunction readBlobAsArrayBuffer(blob) {\n return readBlobAs(blob, \"buffer\");\n}\nexports.readBlobAsArrayBuffer = readBlobAsArrayBuffer;\nfunction readBlobAs(blob, mode) {\n return new Promise(function (resolve, reject) {\n var reader = new FileReader();\n reader.onload = function (e) {\n resolve(e.target.result);\n };\n switch (mode) {\n case \"string\":\n reader.readAsText(blob);\n break;\n case \"buffer\":\n reader.readAsArrayBuffer(blob);\n break;\n }\n });\n}\n","\"use strict\";\n(function (LogLevel) {\n LogLevel[LogLevel[\"Verbose\"] = 0] = \"Verbose\";\n LogLevel[LogLevel[\"Info\"] = 1] = \"Info\";\n LogLevel[LogLevel[\"Warning\"] = 2] = \"Warning\";\n LogLevel[LogLevel[\"Error\"] = 3] = \"Error\";\n LogLevel[LogLevel[\"Off\"] = 99] = \"Off\";\n})(exports.LogLevel || (exports.LogLevel = {}));\nvar LogLevel = exports.LogLevel;\nvar Logger = (function () {\n function Logger() {\n }\n Object.defineProperty(Logger, \"activeLogLevel\", {\n get: function () {\n return Logger.instance.activeLogLevel;\n },\n set: function (value) {\n Logger.instance.activeLogLevel = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Logger, \"instance\", {\n get: function () {\n if (typeof Logger._instance === \"undefined\" || Logger._instance === null) {\n Logger._instance = new LoggerImpl();\n }\n return Logger._instance;\n },\n enumerable: true,\n configurable: true\n });\n Logger.subscribe = function () {\n var listeners = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n listeners[_i - 0] = arguments[_i];\n }\n for (var i = 0; i < listeners.length; i++) {\n Logger.instance.subscribe(listeners[i]);\n }\n };\n Logger.clearSubscribers = function () {\n return Logger.instance.clearSubscribers();\n };\n Object.defineProperty(Logger, \"count\", {\n get: function () {\n return Logger.instance.count;\n },\n enumerable: true,\n configurable: true\n });\n Logger.write = function (message, level) {\n if (level === void 0) { level = LogLevel.Verbose; }\n Logger.instance.log({ level: level, message: message });\n };\n Logger.log = function (entry) {\n Logger.instance.log(entry);\n };\n Logger.measure = function (name, f) {\n return Logger.instance.measure(name, f);\n };\n return Logger;\n}());\nexports.Logger = Logger;\nvar LoggerImpl = (function () {\n function LoggerImpl(activeLogLevel, subscribers) {\n if (activeLogLevel === void 0) { activeLogLevel = LogLevel.Warning; }\n if (subscribers === void 0) { subscribers = []; }\n this.activeLogLevel = activeLogLevel;\n this.subscribers = subscribers;\n }\n LoggerImpl.prototype.subscribe = function (listener) {\n this.subscribers.push(listener);\n };\n LoggerImpl.prototype.clearSubscribers = function () {\n var s = this.subscribers.slice(0);\n this.subscribers.length = 0;\n return s;\n };\n Object.defineProperty(LoggerImpl.prototype, \"count\", {\n get: function () {\n return this.subscribers.length;\n },\n enumerable: true,\n configurable: true\n });\n LoggerImpl.prototype.write = function (message, level) {\n if (level === void 0) { level = LogLevel.Verbose; }\n this.log({ level: level, message: message });\n };\n LoggerImpl.prototype.log = function (entry) {\n if (typeof entry === \"undefined\" || entry.level < this.activeLogLevel) {\n return;\n }\n for (var i = 0; i < this.subscribers.length; i++) {\n this.subscribers[i].log(entry);\n }\n };\n LoggerImpl.prototype.measure = function (name, f) {\n console.profile(name);\n try {\n return f();\n }\n finally {\n console.profileEnd();\n }\n };\n return LoggerImpl;\n}());\nvar ConsoleListener = (function () {\n function ConsoleListener() {\n }\n ConsoleListener.prototype.log = function (entry) {\n var msg = this.format(entry);\n switch (entry.level) {\n case LogLevel.Verbose:\n case LogLevel.Info:\n console.log(msg);\n break;\n case LogLevel.Warning:\n console.warn(msg);\n break;\n case LogLevel.Error:\n console.error(msg);\n break;\n }\n };\n ConsoleListener.prototype.format = function (entry) {\n return \"Message: \" + entry.message + \". Data: \" + JSON.stringify(entry.data);\n };\n return ConsoleListener;\n}());\nexports.ConsoleListener = ConsoleListener;\nvar AzureInsightsListener = (function () {\n function AzureInsightsListener(azureInsightsInstrumentationKey) {\n this.azureInsightsInstrumentationKey = azureInsightsInstrumentationKey;\n var appInsights = window[\"appInsights\"] || function (config) {\n function r(config) {\n t[config] = function () {\n var i = arguments;\n t.queue.push(function () { t[config].apply(t, i); });\n };\n }\n var t = { config: config }, u = document, e = window, o = \"script\", s = u.createElement(o), i, f;\n for (s.src = config.url || \"//az416426.vo.msecnd.net/scripts/a/ai.0.js\", u.getElementsByTagName(o)[0].parentNode.appendChild(s), t.cookie = u.cookie, t.queue = [], i = [\"Event\", \"Exception\", \"Metric\", \"PageView\", \"Trace\"]; i.length;) {\n r(\"track\" + i.pop());\n }\n return r(\"setAuthenticatedUserContext\"), r(\"clearAuthenticatedUserContext\"), config.disableExceptionTracking || (i = \"onerror\", r(\"_\" + i), f = e[i], e[i] = function (config, r, u, e, o) {\n var s = f && f(config, r, u, e, o);\n return s !== !0 && t[\"_\" + i](config, r, u, e, o), s;\n }), t;\n }({\n instrumentationKey: this.azureInsightsInstrumentationKey\n });\n window[\"appInsights\"] = appInsights;\n }\n AzureInsightsListener.prototype.log = function (entry) {\n var ai = window[\"appInsights\"];\n var msg = this.format(entry);\n if (entry.level === LogLevel.Error) {\n ai.trackException(msg);\n }\n else {\n ai.trackEvent(msg);\n }\n };\n AzureInsightsListener.prototype.format = function (entry) {\n return \"Message: \" + entry.message + \". Data: \" + JSON.stringify(entry.data);\n };\n return AzureInsightsListener;\n}());\nexports.AzureInsightsListener = AzureInsightsListener;\nvar FunctionListener = (function () {\n function FunctionListener(method) {\n this.method = method;\n }\n FunctionListener.prototype.log = function (entry) {\n this.method(entry);\n };\n return FunctionListener;\n}());\nexports.FunctionListener = FunctionListener;\n","\"use strict\";\nvar util_1 = require(\"./util\");\nvar PnPClientStorageWrapper = (function () {\n function PnPClientStorageWrapper(store, defaultTimeoutMinutes) {\n this.store = store;\n this.defaultTimeoutMinutes = defaultTimeoutMinutes;\n this.defaultTimeoutMinutes = (defaultTimeoutMinutes === void 0) ? 5 : defaultTimeoutMinutes;\n this.enabled = this.test();\n }\n PnPClientStorageWrapper.prototype.get = function (key) {\n if (!this.enabled) {\n return null;\n }\n var o = this.store.getItem(key);\n if (o == null) {\n return null;\n }\n var persistable = JSON.parse(o);\n if (new Date(persistable.expiration) <= new Date()) {\n this.delete(key);\n return null;\n }\n else {\n return persistable.value;\n }\n };\n PnPClientStorageWrapper.prototype.put = function (key, o, expire) {\n if (this.enabled) {\n this.store.setItem(key, this.createPersistable(o, expire));\n }\n };\n PnPClientStorageWrapper.prototype.delete = function (key) {\n if (this.enabled) {\n this.store.removeItem(key);\n }\n };\n PnPClientStorageWrapper.prototype.getOrPut = function (key, getter, expire) {\n var _this = this;\n if (!this.enabled) {\n return getter();\n }\n if (!util_1.Util.isFunction(getter)) {\n throw \"Function expected for parameter 'getter'.\";\n }\n return new Promise(function (resolve, reject) {\n var o = _this.get(key);\n if (o == null) {\n getter().then(function (d) {\n _this.put(key, d, expire);\n resolve(d);\n });\n }\n else {\n resolve(o);\n }\n });\n };\n PnPClientStorageWrapper.prototype.test = function () {\n var str = \"test\";\n try {\n this.store.setItem(str, str);\n this.store.removeItem(str);\n return true;\n }\n catch (e) {\n return false;\n }\n };\n PnPClientStorageWrapper.prototype.createPersistable = function (o, expire) {\n if (typeof expire === \"undefined\") {\n expire = util_1.Util.dateAdd(new Date(), \"minute\", this.defaultTimeoutMinutes);\n }\n return JSON.stringify({ expiration: expire, value: o });\n };\n return PnPClientStorageWrapper;\n}());\nexports.PnPClientStorageWrapper = PnPClientStorageWrapper;\nvar PnPClientStorage = (function () {\n function PnPClientStorage() {\n this.local = typeof localStorage !== \"undefined\" ? new PnPClientStorageWrapper(localStorage) : null;\n this.session = typeof sessionStorage !== \"undefined\" ? new PnPClientStorageWrapper(sessionStorage) : null;\n }\n return PnPClientStorage;\n}());\nexports.PnPClientStorage = PnPClientStorage;\n","\"use strict\";\nvar Util = (function () {\n function Util() {\n }\n Util.getCtxCallback = function (context, method) {\n var params = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n params[_i - 2] = arguments[_i];\n }\n return function () {\n method.apply(context, params);\n };\n };\n Util.urlParamExists = function (name) {\n name = name.replace(/[\\[]/, \"\\\\[\").replace(/[\\]]/, \"\\\\]\");\n var regex = new RegExp(\"[\\\\?&]\" + name + \"=([^&#]*)\");\n return regex.test(location.search);\n };\n Util.getUrlParamByName = function (name) {\n name = name.replace(/[\\[]/, \"\\\\[\").replace(/[\\]]/, \"\\\\]\");\n var regex = new RegExp(\"[\\\\?&]\" + name + \"=([^&#]*)\");\n var results = regex.exec(location.search);\n return results == null ? \"\" : decodeURIComponent(results[1].replace(/\\+/g, \" \"));\n };\n Util.getUrlParamBoolByName = function (name) {\n var p = this.getUrlParamByName(name);\n var isFalse = (p === \"\" || /false|0/i.test(p));\n return !isFalse;\n };\n Util.stringInsert = function (target, index, s) {\n if (index > 0) {\n return target.substring(0, index) + s + target.substring(index, target.length);\n }\n return s + target;\n };\n Util.dateAdd = function (date, interval, units) {\n var ret = new Date(date.toLocaleString());\n switch (interval.toLowerCase()) {\n case \"year\":\n ret.setFullYear(ret.getFullYear() + units);\n break;\n case \"quarter\":\n ret.setMonth(ret.getMonth() + 3 * units);\n break;\n case \"month\":\n ret.setMonth(ret.getMonth() + units);\n break;\n case \"week\":\n ret.setDate(ret.getDate() + 7 * units);\n break;\n case \"day\":\n ret.setDate(ret.getDate() + units);\n break;\n case \"hour\":\n ret.setTime(ret.getTime() + units * 3600000);\n break;\n case \"minute\":\n ret.setTime(ret.getTime() + units * 60000);\n break;\n case \"second\":\n ret.setTime(ret.getTime() + units * 1000);\n break;\n default:\n ret = undefined;\n break;\n }\n return ret;\n };\n Util.loadStylesheet = function (path, avoidCache) {\n if (avoidCache) {\n path += \"?\" + encodeURIComponent((new Date()).getTime().toString());\n }\n var head = document.getElementsByTagName(\"head\");\n if (head.length > 0) {\n var e = document.createElement(\"link\");\n head[0].appendChild(e);\n e.setAttribute(\"type\", \"text/css\");\n e.setAttribute(\"rel\", \"stylesheet\");\n e.setAttribute(\"href\", path);\n }\n };\n Util.combinePaths = function () {\n var paths = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n paths[_i - 0] = arguments[_i];\n }\n var parts = [];\n for (var i = 0; i < paths.length; i++) {\n if (typeof paths[i] !== \"undefined\" && paths[i] !== null) {\n parts.push(paths[i].replace(/^[\\\\|\\/]/, \"\").replace(/[\\\\|\\/]$/, \"\"));\n }\n }\n return parts.join(\"/\").replace(/\\\\/, \"/\");\n };\n Util.getRandomString = function (chars) {\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n for (var i = 0; i < chars; i++) {\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n }\n return text;\n };\n Util.getGUID = function () {\n var d = new Date().getTime();\n var guid = \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g, function (c) {\n var r = (d + Math.random() * 16) % 16 | 0;\n d = Math.floor(d / 16);\n return (c === \"x\" ? r : (r & 0x3 | 0x8)).toString(16);\n });\n return guid;\n };\n Util.isFunction = function (candidateFunction) {\n return typeof candidateFunction === \"function\";\n };\n Util.isArray = function (array) {\n if (Array.isArray) {\n return Array.isArray(array);\n }\n return array && typeof array.length === \"number\" && array.constructor === Array;\n };\n Util.stringIsNullOrEmpty = function (s) {\n return typeof s === \"undefined\" || s === null || s === \"\";\n };\n Util.extend = function (target, source, noOverwrite) {\n if (noOverwrite === void 0) { noOverwrite = false; }\n var result = {};\n for (var id in target) {\n result[id] = target[id];\n }\n var check = noOverwrite ? function (o, i) { return !o.hasOwnProperty(i); } : function (o, i) { return true; };\n for (var id in source) {\n if (check(result, id)) {\n result[id] = source[id];\n }\n }\n return result;\n };\n Util.applyMixins = function (derivedCtor) {\n var baseCtors = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n baseCtors[_i - 1] = arguments[_i];\n }\n baseCtors.forEach(function (baseCtor) {\n Object.getOwnPropertyNames(baseCtor.prototype).forEach(function (name) {\n derivedCtor.prototype[name] = baseCtor.prototype[name];\n });\n });\n };\n Util.isUrlAbsolute = function (url) {\n return /^https?:\\/\\/|^\\/\\//i.test(url);\n };\n Util.makeUrlAbsolute = function (url) {\n if (Util.isUrlAbsolute(url)) {\n return url;\n }\n if (typeof global._spPageContextInfo !== \"undefined\") {\n if (global._spPageContextInfo.hasOwnProperty(\"webAbsoluteUrl\")) {\n return Util.combinePaths(global._spPageContextInfo.webAbsoluteUrl, url);\n }\n else if (global._spPageContextInfo.hasOwnProperty(\"webServerRelativeUrl\")) {\n return Util.combinePaths(global._spPageContextInfo.webServerRelativeUrl, url);\n }\n }\n else {\n return url;\n }\n };\n return Util;\n}());\nexports.Util = Util;\n"]} \ No newline at end of file diff --git a/dist/pnp.min.js b/dist/pnp.min.js index 4d08eec4..8d91b746 100644 --- a/dist/pnp.min.js +++ b/dist/pnp.min.js @@ -1,12 +1,12 @@ /** - * sp-pnp-js v1.0.5 - A reusable JavaScript library targeting SharePoint client-side development. + * sp-pnp-js v1.0.6 - A reusable JavaScript library targeting SharePoint client-side development. * MIT (https://github.com/OfficeDev/PnP-JS-Core/blob/master/LICENSE) * Copyright (c) 2016 Microsoft * docs: http://officedev.github.io/PnP-JS-Core - * source: https://github.com/OfficeDev/PnP-JS-Core - * bugs: https://github.com/OfficeDev/PnP-JS-Core/issues + * source: https://github.com/SharePoint/PnP-JS-Core + * bugs: https://github.com/SharePoint/PnP-JS-Core/issues */ -!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.$pnp=e()}}(function(){return function e(t,n,r){function o(a,s){if(!n[a]){if(!t[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(i)return i(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[a]={exports:{}};t[a][0].call(l.exports,function(e){var n=t[a][1][e];return o(n?n:e)},l,l.exports,e,t,n,r)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a-1?this.values[n]=t:(this.keys.push(e),this.values.push(t))},e.prototype.merge=function(e){if(r.Util.isFunction(e.getKeys))for(var t=e,n=t.getKeys(),o=n.length,i=0;i1023)throw new Error("The maximum comment length is 1023 characters.");return new t(this,"unpublish(comment='"+e+"')").post()},t}(o.QueryableInstance);n.File=s;var u=function(e){function t(t,n){void 0===n&&(n="versions"),e.call(this,t,n)}return r(t,e),t.prototype.getById=function(e){var t=new c(this);return t.concat("("+e+")"),t},t.prototype.deleteAll=function(){return new t(this,"deleteAll").post()},t.prototype.deleteById=function(e){return new t(this,"deleteById(vid="+e+")").post()},t.prototype.deleteByLabel=function(e){return new t(this,"deleteByLabel(versionlabel='"+e+"')").post()},t.prototype.restoreByLabel=function(e){return new t(this,"restoreByLabel(versionlabel='"+e+"')").post()},t}(o.QueryableCollection);n.Versions=u;var c=function(e){function t(t,n){e.call(this,t,n)}return r(t,e),t.prototype.delete=function(e){return void 0===e&&(e="*"),this.post({headers:{"IF-Match":e,"X-HTTP-Method":"DELETE"}})},t}(o.QueryableInstance);n.Version=c,function(e){e[e.Minor=0]="Minor",e[e.Major=1]="Major",e[e.Overwrite=2]="Overwrite"}(n.CheckinType||(n.CheckinType={}));var l=n.CheckinType;!function(e){e[e.User=0]="User",e[e.Shared=1]="Shared"}(n.WebPartsPersonalizationScope||(n.WebPartsPersonalizationScope={}));var p=n.WebPartsPersonalizationScope;!function(e){e[e.Overwrite=1]="Overwrite",e[e.AllowBrokenThickets=8]="AllowBrokenThickets"}(n.MoveOperations||(n.MoveOperations={}));var f=n.MoveOperations;!function(e){e[e.StandardPage=0]="StandardPage",e[e.WikiPage=1]="WikiPage",e[e.FormPage=2]="FormPage"}(n.TemplateFileType||(n.TemplateFileType={}));n.TemplateFileType},{"./items":20,"./queryable":24}],17:[function(e,t,n){"use strict";var r=this&&this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},o=e("./queryable"),i=e("./files"),a=e("./items"),s=function(e){function t(t,n){void 0===n&&(n="folders"),e.call(this,t,n)}return r(t,e),t.prototype.getByName=function(e){var t=new u(this);return t.concat("('"+e+"')"),t},t.prototype.add=function(e){var n=this;return new t(this,"add('"+e+"')").post().then(function(t){return{data:t,folder:n.getByName(e)}})},t}(o.QueryableCollection);n.Folders=s;var u=function(e){function t(t,n){e.call(this,t,n)}return r(t,e),Object.defineProperty(t.prototype,"contentTypeOrder",{get:function(){return new o.QueryableCollection(this,"contentTypeOrder")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"files",{get:function(){return new i.Files(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"folders",{get:function(){return new s(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"listItemAllFields",{get:function(){return new a.Item(this,"listItemAllFields")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parentFolder",{get:function(){return new t(this,"parentFolder")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"properties",{get:function(){return new o.QueryableInstance(this,"properties")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"serverRelativeUrl",{get:function(){return new o.Queryable(this,"serverRelativeUrl")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"uniqueContentTypeOrder",{get:function(){return new o.QueryableCollection(this,"uniqueContentTypeOrder")},enumerable:!0,configurable:!0}),t.prototype.delete=function(e){return void 0===e&&(e="*"),new t(this).post({headers:{"IF-Match":e,"X-HTTP-Method":"DELETE"}})},t.prototype.recycle=function(){return new t(this,"recycle").post()},t}(o.QueryableInstance);n.Folder=u},{"./files":16,"./items":20,"./queryable":24}],18:[function(e,t,n){"use strict";var r=this&&this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},o=e("./queryable"),i=function(e){function t(t,n){void 0===n&&(n="forms"),e.call(this,t,n)}return r(t,e),t.prototype.getById=function(e){var t=new a(this);return t.concat("('"+e+"')"),t},t}(o.QueryableCollection);n.Forms=i;var a=function(e){function t(t,n){e.call(this,t,n)}return r(t,e),t}(o.QueryableInstance);n.Form=a},{"./queryable":24}],19:[function(e,t,n){"use strict";function r(e){for(var t in e)n.hasOwnProperty(t)||(n[t]=e[t])}r(e("./caching"));var o=e("./files");n.CheckinType=o.CheckinType,n.WebPartsPersonalizationScope=o.WebPartsPersonalizationScope,n.MoveOperations=o.MoveOperations,n.TemplateFileType=o.TemplateFileType;var i=e("./items");n.PagedItemCollection=i.PagedItemCollection;var a=e("./odata");n.extractOdataId=a.extractOdataId,n.ODataParserBase=a.ODataParserBase,n.ODataDefaultParser=a.ODataDefaultParser,n.ODataRaw=a.ODataRaw,n.ODataValue=a.ODataValue,n.ODataEntity=a.ODataEntity,n.ODataEntityArray=a.ODataEntityArray;var s=e("./roles");n.RoleDefinitionBindings=s.RoleDefinitionBindings;var u=e("./search");n.SearchResult=u.SearchResult,n.SortDirection=u.SortDirection,n.ReorderingRuleMatchType=u.ReorderingRuleMatchType,n.QueryPropertyValueType=u.QueryPropertyValueType;var c=e("./site");n.Site=c.Site,r(e("./types"));var l=e("./webs");n.Web=l.Web},{"./caching":13,"./files":16,"./items":20,"./odata":23,"./roles":28,"./search":29,"./site":30,"./types":34,"./webs":38}],20:[function(e,t,n){"use strict";var r=this&&this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},o=e("./queryable"),i=e("./queryablesecurable"),a=e("./folders"),s=e("./contenttypes"),u=e("../../utils/util"),c=e("./odata"),l=function(e){function t(t,n){void 0===n&&(n="items"),e.call(this,t,n)}return r(t,e),t.prototype.getById=function(e){var t=new f(this);return t.concat("("+e+")"),t},t.prototype.skip=function(e){return this._query.add("$skiptoken",encodeURIComponent("Paged=TRUE&p_ID="+e)),this},t.prototype.getPaged=function(){return this.getAs(new p)},t.prototype.add=function(e){var t=this;void 0===e&&(e={}),this.addBatchDependency();var n=this.getParent(o.QueryableInstance);return n.select("ListItemEntityTypeFullName").getAs().then(function(n){var r=JSON.stringify(u.Util.extend({__metadata:{type:n.ListItemEntityTypeFullName}},e)),o=t.postAs({body:r}).then(function(e){return{data:e,item:t.getById(e.Id)}});return t.clearBatchDependency(),o})},t}(o.QueryableCollection);n.Items=l;var p=function(e){function t(){e.apply(this,arguments)}return r(t,e),t.prototype.parse=function(e){return d.fromResponse(e)},t}(c.ODataParserBase),f=function(e){function t(t,n){e.call(this,t,n)}return r(t,e),Object.defineProperty(t.prototype,"attachmentFiles",{get:function(){return new o.QueryableCollection(this,"AttachmentFiles")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"contentType",{get:function(){return new s.ContentType(this,"ContentType")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"effectiveBasePermissions",{get:function(){return new o.Queryable(this,"EffectiveBasePermissions")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"effectiveBasePermissionsForUI",{get:function(){return new o.Queryable(this,"EffectiveBasePermissionsForUI")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"fieldValuesAsHTML",{get:function(){return new o.QueryableInstance(this,"FieldValuesAsHTML")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"fieldValuesAsText",{get:function(){return new o.QueryableInstance(this,"FieldValuesAsText")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"fieldValuesForEdit",{get:function(){return new o.QueryableInstance(this,"FieldValuesForEdit")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"folder",{get:function(){return new a.Folder(this,"Folder")},enumerable:!0,configurable:!0}),t.prototype.update=function(e,t){var n=this;void 0===t&&(t="*"),this.addBatchDependency();var r=this.getParent(o.QueryableInstance,this.parentUrl.substr(0,this.parentUrl.lastIndexOf("/")));return r.select("ListItemEntityTypeFullName").getAs().then(function(r){var o=JSON.stringify(u.Util.extend({__metadata:{type:r.ListItemEntityTypeFullName}},e)),i=n.post({body:o,headers:{"IF-Match":t,"X-HTTP-Method":"MERGE"}}).then(function(e){return{data:e,item:n}});return n.clearBatchDependency(),i})},t.prototype.delete=function(e){return void 0===e&&(e="*"),this.post({headers:{"IF-Match":e,"X-HTTP-Method":"DELETE"}})},t.prototype.recycle=function(){var e=new t(this,"recycle");return e.post()},t.prototype.getWopiFrameUrl=function(e){void 0===e&&(e=0);var n=new t(this,"getWOPIFrameUrl(@action)");return n._query.add("@action",e),n.post().then(function(e){return e.GetWOPIFrameUrl})},t.prototype.validateUpdateListItem=function(e,n){void 0===n&&(n=!1);var r=JSON.stringify({formValues:e,bNewDocumentUpdate:n}),o=new t(this,"validateupdatelistitem");return o.post({body:r})},t}(i.QueryableSecurable);n.Item=f;var d=function(){function e(){}return Object.defineProperty(e.prototype,"hasNext",{get:function(){return"string"==typeof this.nextUrl&&this.nextUrl.length>0},enumerable:!0,configurable:!0}),e.fromResponse=function(t){return t.json().then(function(t){var n=new e;return n.nextUrl=t["odata.nextLink"],n.results=t.value,n})},e.prototype.getNext=function(){if(this.hasNext){var e=new l(this.nextUrl,null);return e.getPaged()}return new Promise(function(e){return e(null)})},e}();n.PagedItemCollection=d},{"../../utils/util":43,"./contenttypes":14,"./folders":17,"./odata":23,"./queryable":24,"./queryablesecurable":25}],21:[function(e,t,n){"use strict";var r=this&&this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},o=e("./items"),i=e("./views"),a=e("./contenttypes"),s=e("./fields"),u=e("./forms"),c=e("./queryable"),l=e("./queryablesecurable"),p=e("../../utils/util"),f=e("./usercustomactions"),d=e("./odata"),h=function(e){function t(t,n){void 0===n&&(n="lists"),e.call(this,t,n)}return r(t,e),t.prototype.getByTitle=function(e){return new y(this,"getByTitle('"+e+"')")},t.prototype.getById=function(e){var t=new y(this);return t.concat("('"+e+"')"),t},t.prototype.add=function(e,t,n,r,o){var i=this;void 0===t&&(t=""),void 0===n&&(n=100), -void 0===r&&(r=!1),void 0===o&&(o={});var a=JSON.stringify(p.Util.extend({__metadata:{type:"SP.List"},AllowContentTypes:r,BaseTemplate:n,ContentTypesEnabled:r,Description:t,Title:e},o));return this.post({body:a}).then(function(t){return{data:t,list:i.getByTitle(e)}})},t.prototype.ensure=function(e,t,n,r,o){var i=this;if(void 0===t&&(t=""),void 0===n&&(n=100),void 0===r&&(r=!1),void 0===o&&(o={}),this.hasBatch)throw new Error("The ensure method is not supported as part of a batch.");return new Promise(function(a,s){var u=i.getByTitle(e);u.get().then(function(e){return a({created:!1,data:e,list:u})}).catch(function(){i.add(e,t,n,r,o).then(function(t){a({created:!0,data:t.data,list:i.getByTitle(e)})})}).catch(function(e){return s(e)})})},t.prototype.ensureSiteAssetsLibrary=function(){var e=new t(this,"ensuresiteassetslibrary");return e.post().then(function(e){return new y(d.extractOdataId(e))})},t.prototype.ensureSitePagesLibrary=function(){var e=new t(this,"ensuresitepageslibrary");return e.post().then(function(e){return new y(d.extractOdataId(e))})},t}(c.QueryableCollection);n.Lists=h;var y=function(e){function t(t,n){e.call(this,t,n)}return r(t,e),Object.defineProperty(t.prototype,"contentTypes",{get:function(){return new a.ContentTypes(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"items",{get:function(){return new o.Items(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"views",{get:function(){return new i.Views(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"fields",{get:function(){return new s.Fields(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"forms",{get:function(){return new u.Forms(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"defaultView",{get:function(){return new c.QueryableInstance(this,"DefaultView")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"userCustomActions",{get:function(){return new f.UserCustomActions(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"effectiveBasePermissions",{get:function(){return new c.Queryable(this,"EffectiveBasePermissions")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"eventReceivers",{get:function(){return new c.QueryableCollection(this,"EventReceivers")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"relatedFields",{get:function(){return new c.Queryable(this,"getRelatedFields")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"informationRightsManagementSettings",{get:function(){return new c.Queryable(this,"InformationRightsManagementSettings")},enumerable:!0,configurable:!0}),t.prototype.getView=function(e){return new i.View(this,"getView('"+e+"')")},t.prototype.update=function(e,n){var r=this;void 0===n&&(n="*");var o=JSON.stringify(p.Util.extend({__metadata:{type:"SP.List"}},e));return this.post({body:o,headers:{"IF-Match":n,"X-HTTP-Method":"MERGE"}}).then(function(n){var o=r;return e.hasOwnProperty("Title")&&(o=r.getParent(t,r.parentUrl,"getByTitle('"+e.Title+"')")),{data:n,list:o}})},t.prototype.delete=function(e){return void 0===e&&(e="*"),this.post({headers:{"IF-Match":e,"X-HTTP-Method":"DELETE"}})},t.prototype.getChanges=function(e){var n=JSON.stringify({query:p.Util.extend({__metadata:{type:"SP.ChangeQuery"}},e)}),r=new t(this,"getchanges");return r.post({body:n})},t.prototype.getItemsByCAMLQuery=function(e){for(var n=[],r=1;r0?setTimeout(function(){return e.execute()},100):e.executeImpl().then(function(){return t()}).catch(n)})},e.prototype.executeImpl=function(){var e=this;if(this._requests.length<1)return new Promise(function(e){return e()});var t=[],n="";this._requests.forEach(function(r,o){"GET"===r.method?(n.length>0&&(t.push("--changeset_"+n+"--\n\n"),n=""),t.push("--batch_"+e._batchId+"\n")):(n.length<1&&(n=c.Util.getGUID(),t.push("--batch_"+e._batchId+"\n"),t.push('Content-Type: multipart/mixed; boundary="changeset_'+n+'"\n\n')),t.push("--changeset_"+n+"\n")),t.push("Content-Type: application/http\n"),t.push("Content-Transfer-Encoding: binary\n\n");var i={Accept:"application/json;"};if("GET"!==r.method){var a=r.method;r.options&&r.options.headers&&"undefined"!==r.options.headers["X-HTTP-Method"]&&(a=r.options.headers["X-HTTP-Method"],delete r.options.headers["X-HTTP-Method"]),t.push(a+" "+r.url+" HTTP/1.1\n"),i=c.Util.extend(i,{"Content-Type":"application/json;odata=verbose;charset=utf-8"})}else t.push(r.method+" "+r.url+" HTTP/1.1\n");"undefined"!=typeof f.RuntimeConfig.headers&&(i=c.Util.extend(i,f.RuntimeConfig.headers)),r.options&&r.options.headers&&(i=c.Util.extend(i,r.options.headers));for(var s in i)i.hasOwnProperty(s)&&t.push(s+": "+i[s]+"\n");t.push("\n"),r.options.body&&t.push(r.options.body+"\n\n")}),n.length>0&&(t.push("--changeset_"+n+"--\n\n"),n=""),t.push("--batch_"+this._batchId+"--\n");var r={"Content-Type":"multipart/mixed; boundary=batch_"+this._batchId},o={body:t.join(""),headers:r},i=new p.HttpClient;return i.post(c.Util.makeUrlAbsolute("/_api/$batch"),o).then(function(e){return e.text()}).then(this._parseResponse).then(function(t){if(t.length!==e._requests.length)throw new Error("Could not properly parse responses to match requests in batch.");for(var n=[],r=0;rn.lastIndexOf("(")){var r=n.lastIndexOf("/");this._parentUrl=n.slice(0,r),t=o.Util.combinePaths(n.slice(r),t),this._url=o.Util.combinePaths(this._parentUrl,t)}else{var r=n.lastIndexOf("(");this._parentUrl=n.slice(0,r),this._url=o.Util.combinePaths(n,t)}}else{var a=e;this._parentUrl=a._url,!this.hasBatch&&a.hasBatch&&(this._batch=a._batch);var s=a._query.get("@target");null!==s&&this._query.add("@target",s),this._url=o.Util.combinePaths(this._parentUrl,t)}}return e.prototype.concat=function(e){this._url+=e},e.prototype.append=function(e){this._url=o.Util.combinePaths(this._url,e)},e.prototype.addBatchDependency=function(){null!==this._batch&&this._batch.incrementBatchDep()},e.prototype.clearBatchDependency=function(){null!==this._batch&&this._batch.decrementBatchDep()},Object.defineProperty(e.prototype,"hasBatch",{get:function(){return null!==this._batch},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parentUrl",{get:function(){return this._parentUrl},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"query",{get:function(){return this._query},enumerable:!0,configurable:!0}),e.prototype.inBatch=function(e){if(null!==this._batch)throw new Error("This query is already part of a batch.");return this._batch=e,this},e.prototype.usingCaching=function(e){return c.RuntimeConfig.globalCacheDisable||(this._useCaching=!0,this._cachingOptions=e),this},e.prototype.toUrl=function(){return o.Util.makeUrlAbsolute(this._url)},e.prototype.toUrlAndQuery=function(){var e=this,t=this.toUrl();if(this._query.count()>0){t+="?";var n=this._query.getKeys();t+=n.map(function(t,n,r){return t+"="+e._query.get(t)}).join("&")}return t},e.prototype.get=function(e,t){return void 0===e&&(e=new s.ODataDefaultParser),void 0===t&&(t={}),this.getImpl(t,e)},e.prototype.getAs=function(e,t){return void 0===e&&(e=new s.ODataDefaultParser),void 0===t&&(t={}),this.getImpl(t,e)},e.prototype.post=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new s.ODataDefaultParser),this.postImpl(e,t)},e.prototype.postAs=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new s.ODataDefaultParser),this.postImpl(e,t)},e.prototype.getParent=function(e,t,n){void 0===t&&(t=this.parentUrl);var r=new e(t,n),o=this.query.get("@target");return null!==o&&r.query.add("@target",o),r},e.prototype.getImpl=function(e,t){if(void 0===e&&(e={}),this._useCaching){var n=new u.CachingOptions(this.toUrlAndQuery().toLowerCase());if("undefined"!=typeof this._cachingOptions&&(n=o.Util.extend(n,this._cachingOptions)),null!==n.store){var r=n.store.get(n.key);if(null!==r)return new Promise(function(e){return e(r)})}t=new u.CachingParserWrapper(t,n)}if(null===this._batch){var i=new a.HttpClient;return i.get(this.toUrlAndQuery(),e).then(function(e){if(!e.ok)throw"Error making GET request: "+e.statusText;return t.parse(e)})}return this._batch.add(this.toUrlAndQuery(),"GET",{},t)},e.prototype.postImpl=function(e,t){if(null===this._batch){var n=new a.HttpClient;return n.post(this.toUrlAndQuery(),e).then(function(e){if(!e.ok)throw"Error making POST request: "+e.statusText;return e.headers.has("Content-Length")&&0===parseFloat(e.headers.get("Content-Length"))||204===e.status?new Promise(function(e,t){e({})}):t.parse(e)})}return this._batch.add(this.toUrlAndQuery(),"POST",e,t)},e}();n.Queryable=l;var p=function(e){function t(){e.apply(this,arguments)}return r(t,e),t.prototype.filter=function(e){return this._query.add("$filter",e),this},t.prototype.select=function(){for(var e=[],t=0;t0?e.substring(0,t)+n+e.substring(t,e.length):n+e},t.dateAdd=function(e,t,n){var r=new Date(e.toLocaleString());switch(t.toLowerCase()){case"year":r.setFullYear(r.getFullYear()+n);break;case"quarter":r.setMonth(r.getMonth()+3*n);break;case"month":r.setMonth(r.getMonth()+n);break;case"week":r.setDate(r.getDate()+7*n);break;case"day":r.setDate(r.getDate()+n);break;case"hour":r.setTime(r.getTime()+36e5*n);break;case"minute":r.setTime(r.getTime()+6e4*n);break;case"second":r.setTime(r.getTime()+1e3*n);break;default:r=void 0}return r},t.loadStylesheet=function(e,t){t&&(e+="?"+encodeURIComponent((new Date).getTime().toString()));var n=document.getElementsByTagName("head");if(n.length>0){var r=document.createElement("link");n[0].appendChild(r),r.setAttribute("type","text/css"),r.setAttribute("rel","stylesheet"),r.setAttribute("href",e)}},t.combinePaths=function(){for(var e=[],t=0;t-1?this.values[n]=t:(this.keys.push(e),this.values.push(t))},e.prototype.merge=function(e){if(r.Util.isFunction(e.getKeys))for(var t=e,n=t.getKeys(),o=n.length,i=0;i1023)throw new Error("The maximum comment length is 1023 characters.");return new t(this,"unpublish(comment='"+e+"')").post()},t.prototype.getText=function(){return new t(this,"$value").get(new c,{headers:{binaryStringResponseBody:"true"}})},t.prototype.getBlob=function(){return new t(this,"$value").get(new l,{headers:{binaryStringResponseBody:"true"}})},t.prototype.getBuffer=function(){return new t(this,"$value").get(new p,{headers:{binaryStringResponseBody:"true"}})},t.prototype.setContent=function(e){var n=this,r=new t(this,"$value");return r.post({body:e,headers:{"X-HTTP-Method":"PUT"}}).then(function(e){return new t(n)})},t.prototype.setContentChunked=function(e,t,n){void 0===n&&(n=10485760),"undefined"==typeof t&&(t=function(e){return null});var r=this,o=e.size,i=parseInt((e.size/n).toString(),10)+(e.size%n===0?1:0);console.log("blockCount: "+i);var s=a.Util.getGUID();t({blockNumber:1,chunkSize:n,currentPointer:0,fileSize:o,stage:"starting",totalBlocks:i});for(var u=r.startUpload(s,e.slice(0,n)),c=function(a){u=u.then(function(u){return t({blockNumber:a,chunkSize:n,currentPointer:u,fileSize:o,stage:"continue",totalBlocks:i}),r.continueUpload(s,u,e.slice(u,u+n))})},l=2;l0},enumerable:!0,configurable:!0}),e.prototype.getNext=function(){if(this.hasNext){var e=new l(this.nextUrl,null);return e.getPaged()}return new Promise(function(e){return e(null)})},e}();n.PagedItemCollection=f;var d=function(e){function t(){e.apply(this,arguments)}return r(t,e),t.prototype.parse=function(e){var t=this;return e.json().then(function(e){var n=e.hasOwnProperty("d")&&e.d.hasOwnProperty("__next")?e.d.__next:e["odata.nextLink"];return new f(n,t.parseODataJSON(e))})},t}(c.ODataParserBase)},{"../../utils/util":45,"./contenttypes":14,"./folders":17,"./odata":23,"./queryable":24,"./queryablesecurable":25}],21:[function(e,t,n){"use strict";var r=this&&this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},o=e("./items"),i=e("./views"),a=e("./contenttypes"),s=e("./fields"),u=e("./forms"),c=e("./subscriptions"),l=e("./queryable"),p=e("./queryablesecurable"),f=e("../../utils/util"),d=e("./usercustomactions"),h=e("./odata"),y=function(e){function t(t,n){void 0===n&&(n="lists"),e.call(this,t,n)}return r(t,e),t.prototype.getByTitle=function(e){return new g(this,"getByTitle('"+e+"')")},t.prototype.getById=function(e){var t=new g(this);return t.concat("('"+e+"')"),t},t.prototype.add=function(e,t,n,r,o){var i=this;void 0===t&&(t=""),void 0===n&&(n=100),void 0===r&&(r=!1),void 0===o&&(o={});var a=JSON.stringify(f.Util.extend({__metadata:{type:"SP.List"},AllowContentTypes:r,BaseTemplate:n,ContentTypesEnabled:r,Description:t,Title:e},o));return this.post({body:a}).then(function(t){return{data:t,list:i.getByTitle(e)}})},t.prototype.ensure=function(e,t,n,r,o){var i=this;if(void 0===t&&(t=""),void 0===n&&(n=100),void 0===r&&(r=!1),void 0===o&&(o={}),this.hasBatch)throw new Error("The ensure method is not supported as part of a batch.");return new Promise(function(a,s){var u=i.getByTitle(e);u.get().then(function(e){return a({created:!1,data:e,list:u})}).catch(function(){i.add(e,t,n,r,o).then(function(t){a({created:!0,data:t.data,list:i.getByTitle(e)})})}).catch(function(e){return s(e)})})},t.prototype.ensureSiteAssetsLibrary=function(){var e=new t(this,"ensuresiteassetslibrary");return e.post().then(function(e){return new g(h.extractOdataId(e))})},t.prototype.ensureSitePagesLibrary=function(){var e=new t(this,"ensuresitepageslibrary");return e.post().then(function(e){return new g(h.extractOdataId(e))})},t}(l.QueryableCollection);n.Lists=y;var g=function(e){function t(t,n){e.call(this,t,n)}return r(t,e),Object.defineProperty(t.prototype,"contentTypes",{get:function(){return new a.ContentTypes(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"items",{get:function(){return new o.Items(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"views",{get:function(){return new i.Views(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"fields",{get:function(){return new s.Fields(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"forms",{get:function(){return new u.Forms(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"defaultView",{get:function(){return new l.QueryableInstance(this,"DefaultView")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"userCustomActions",{get:function(){return new d.UserCustomActions(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"effectiveBasePermissions",{get:function(){return new l.Queryable(this,"EffectiveBasePermissions")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"eventReceivers",{get:function(){return new l.QueryableCollection(this,"EventReceivers")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"relatedFields",{get:function(){return new l.Queryable(this,"getRelatedFields")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"informationRightsManagementSettings",{get:function(){return new l.Queryable(this,"InformationRightsManagementSettings")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"subscriptions",{get:function(){return new c.Subscriptions(this)},enumerable:!0,configurable:!0}),t.prototype.getView=function(e){return new i.View(this,"getView('"+e+"')")},t.prototype.update=function(e,n){var r=this;void 0===n&&(n="*");var o=JSON.stringify(f.Util.extend({__metadata:{type:"SP.List"}},e));return this.post({body:o,headers:{"IF-Match":n,"X-HTTP-Method":"MERGE"}}).then(function(n){var o=r;return e.hasOwnProperty("Title")&&(o=r.getParent(t,r.parentUrl,"getByTitle('"+e.Title+"')")),{data:n,list:o}})},t.prototype.delete=function(e){return void 0===e&&(e="*"),this.post({headers:{"IF-Match":e,"X-HTTP-Method":"DELETE"}})},t.prototype.getChanges=function(e){var n=JSON.stringify({query:f.Util.extend({__metadata:{type:"SP.ChangeQuery"}},e)}),r=new t(this,"getchanges");return r.post({body:n})},t.prototype.getItemsByCAMLQuery=function(e){for(var n=[],r=1;r0&&(t.push("--changeset_"+n+"--\n\n"),n=""),t.push("--batch_"+e._batchId+"\n")):(n.length<1&&(n=c.Util.getGUID(),t.push("--batch_"+e._batchId+"\n"),t.push('Content-Type: multipart/mixed; boundary="changeset_'+n+'"\n\n')),t.push("--changeset_"+n+"\n")),t.push("Content-Type: application/http\n"),t.push("Content-Transfer-Encoding: binary\n\n");var i={Accept:"application/json;"};if("GET"!==r.method){var a=r.method;r.options&&r.options.headers&&"undefined"!==r.options.headers["X-HTTP-Method"]&&(a=r.options.headers["X-HTTP-Method"],delete r.options.headers["X-HTTP-Method"]),t.push(a+" "+r.url+" HTTP/1.1\n"),i=c.Util.extend(i,{"Content-Type":"application/json;odata=verbose;charset=utf-8"})}else t.push(r.method+" "+r.url+" HTTP/1.1\n");"undefined"!=typeof f.RuntimeConfig.headers&&(i=c.Util.extend(i,f.RuntimeConfig.headers)),r.options&&r.options.headers&&(i=c.Util.extend(i,r.options.headers));for(var s in i)i.hasOwnProperty(s)&&t.push(s+": "+i[s]+"\n");t.push("\n"),r.options.body&&t.push(r.options.body+"\n\n")}),n.length>0&&(t.push("--changeset_"+n+"--\n\n"),n=""),t.push("--batch_"+this._batchId+"--\n");var r={"Content-Type":"multipart/mixed; boundary=batch_"+this._batchId},o={body:t.join(""),headers:r},i=new p.HttpClient,a=c.Util.makeUrlAbsolute(c.Util.combinePaths(this.baseUrl,"/_api/$batch"));return i.post(a,o).then(function(e){return e.text()}).then(this._parseResponse).then(function(t){if(t.length!==e._requests.length)throw new Error("Could not properly parse responses to match requests in batch.");for(var n=Promise.resolve(),r=function(r){var o=e._requests[r],i=t[r];i.ok||o.reject(new Error(i.statusText)),n=n.then(function(e){return o.parser.parse(i).then(o.resolve).catch(o.reject)})},o=0;on.lastIndexOf("(")){var r=n.lastIndexOf("/");this._parentUrl=n.slice(0,r),t=o.Util.combinePaths(n.slice(r),t),this._url=o.Util.combinePaths(this._parentUrl,t)}else{var r=n.lastIndexOf("(");this._parentUrl=n.slice(0,r),this._url=o.Util.combinePaths(n,t)}}else{var i=e;this._parentUrl=i._url;var s=i._query.get("@target");null!==s&&this._query.add("@target",s),this._url=o.Util.combinePaths(this._parentUrl,t)}}return e.prototype.concat=function(e){this._url+=e},e.prototype.append=function(e){this._url=o.Util.combinePaths(this._url,e)},e.prototype.addBatchDependency=function(){return this.hasBatch?this._batch.addBatchDependency():function(){return null}},Object.defineProperty(e.prototype,"hasBatch",{get:function(){return null!==this._batch},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parentUrl",{get:function(){return this._parentUrl},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"query",{get:function(){return this._query},enumerable:!0,configurable:!0}),e.prototype.inBatch=function(e){if(null!==this._batch)throw new Error("This query is already part of a batch.");return this._batch=e,this},e.prototype.usingCaching=function(e){return l.RuntimeConfig.globalCacheDisable||(this._useCaching=!0,this._cachingOptions=e),this},e.prototype.toUrl=function(){return o.Util.makeUrlAbsolute(this._url)},e.prototype.toUrlAndQuery=function(){var e=this,t=this.toUrl();if(this._query.count()>0){t+="?";var n=this._query.getKeys();t+=n.map(function(t,n,r){return t+"="+e._query.get(t)}).join("&")}return t},e.prototype.get=function(e,t){return void 0===e&&(e=new u.ODataDefaultParser),void 0===t&&(t={}),this.getImpl(t,e)},e.prototype.getAs=function(e,t){return void 0===e&&(e=new u.ODataDefaultParser),void 0===t&&(t={}),this.getImpl(t,e)},e.prototype.post=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new u.ODataDefaultParser),this.postImpl(e,t)},e.prototype.postAs=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new u.ODataDefaultParser),this.postImpl(e,t)},e.prototype.patch=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new u.ODataDefaultParser),this.patchImpl(e,t)},e.prototype.delete=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new u.ODataDefaultParser),this.deleteImpl(e,t)},e.prototype.getParent=function(e,t,n){void 0===t&&(t=this.parentUrl);var r=new e(t,n),o=this.query.get("@target");return null!==o&&r.query.add("@target",o),r},e.prototype.getImpl=function(e,t){var n=this;if(void 0===e&&(e={}),this._useCaching){var r=new c.CachingOptions(this.toUrlAndQuery().toLowerCase());if("undefined"!=typeof this._cachingOptions&&(r=o.Util.extend(r,this._cachingOptions)),null!==r.store){var i=r.store.get(r.key);if(null!==i)return new Promise(function(e){return e(i)})}t=new c.CachingParserWrapper(t,r)}if(this.hasBatch)return this._batch.add(this.toUrlAndQuery(),"GET",e,t);var a=new s.HttpClient;return a.get(this.toUrlAndQuery(),e).then(function(e){return n.processHttpClientResponse(e,t)})},e.prototype.postImpl=function(e,t){var n=this;if(this.hasBatch)return this._batch.add(this.toUrlAndQuery(),"POST",e,t);var r=new s.HttpClient;return r.post(this.toUrlAndQuery(),e).then(function(e){return n.processHttpClientResponse(e,t)})},e.prototype.patchImpl=function(e,t){var n=this;if(this.hasBatch)return this._batch.add(this.toUrlAndQuery(),"PATCH",e,t);var r=new s.HttpClient;return r.patch(this.toUrlAndQuery(),e).then(function(e){return n.processHttpClientResponse(e,t)})},e.prototype.deleteImpl=function(e,t){var n=this;if(this.hasBatch)return this._batch.add(this.toUrlAndQuery(),"DELETE",e,t);var r=new s.HttpClient;return r.delete(this.toUrlAndQuery(),e).then(function(e){return n.processHttpClientResponse(e,t)})},e.prototype.processHttpClientResponse=function(e,t){return e.ok||e.text().then(function(t){throw i.Logger.log({data:e,level:i.LogLevel.Error,message:t}),"Error making HttpClient request in queryable: "+e.statusText}),e.headers.has("Content-Length")&&0===parseFloat(e.headers.get("Content-Length"))||204===e.status?new Promise(function(e,t){e({})}):t.parse(e)},e}();n.Queryable=p;var f=function(e){function t(){e.apply(this,arguments)}return r(t,e),t.prototype.filter=function(e){return this._query.add("$filter",e),this},t.prototype.select=function(){for(var e=[],t=0;t0?e.substring(0,t)+n+e.substring(t,e.length):n+e},t.dateAdd=function(e,t,n){var r=new Date(e.toLocaleString());switch(t.toLowerCase()){case"year":r.setFullYear(r.getFullYear()+n);break;case"quarter":r.setMonth(r.getMonth()+3*n);break;case"month":r.setMonth(r.getMonth()+n);break;case"week":r.setDate(r.getDate()+7*n);break;case"day":r.setDate(r.getDate()+n);break;case"hour":r.setTime(r.getTime()+36e5*n);break;case"minute":r.setTime(r.getTime()+6e4*n);break;case"second":r.setTime(r.getTime()+1e3*n);break;default:r=void 0}return r},t.loadStylesheet=function(e,t){t&&(e+="?"+encodeURIComponent((new Date).getTime().toString()));var n=document.getElementsByTagName("head");if(n.length>0){var r=document.createElement("link");n[0].appendChild(r),r.setAttribute("type","text/css"),r.setAttribute("rel","stylesheet"),r.setAttribute("href",e)}},t.combinePaths=function(){for(var e=[],t=0;t -1) {\n this.values[index] = o;\n }\n else {\n this.keys.push(key);\n this.values.push(o);\n }\n };\n Dictionary.prototype.merge = function (source) {\n if (util_1.Util.isFunction(source[\"getKeys\"])) {\n var sourceAsDictionary = source;\n var keys = sourceAsDictionary.getKeys();\n var l = keys.length;\n for (var i = 0; i < l; i++) {\n this.add(keys[i], sourceAsDictionary.get(keys[i]));\n }\n }\n else {\n var sourceAsHash = source;\n for (var key in sourceAsHash) {\n if (sourceAsHash.hasOwnProperty(key)) {\n this.add(key, source[key]);\n }\n }\n }\n };\n Dictionary.prototype.remove = function (key) {\n var index = this.keys.indexOf(key);\n if (index < 0) {\n return null;\n }\n var val = this.values[index];\n this.keys.splice(index, 1);\n this.values.splice(index, 1);\n return val;\n };\n Dictionary.prototype.getKeys = function () {\n return this.keys;\n };\n Dictionary.prototype.getValues = function () {\n return this.values;\n };\n Dictionary.prototype.clear = function () {\n this.keys = [];\n this.values = [];\n };\n Dictionary.prototype.count = function () {\n return this.keys.length;\n };\n return Dictionary;\n}());\nexports.Dictionary = Dictionary;\n","\"use strict\";\nvar Collections = require(\"../collections/collections\");\nvar providers = require(\"./providers/providers\");\nvar Settings = (function () {\n function Settings() {\n this.Providers = providers;\n this._settings = new Collections.Dictionary();\n }\n Settings.prototype.add = function (key, value) {\n this._settings.add(key, value);\n };\n Settings.prototype.addJSON = function (key, value) {\n this._settings.add(key, JSON.stringify(value));\n };\n Settings.prototype.apply = function (hash) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n try {\n _this._settings.merge(hash);\n resolve();\n }\n catch (e) {\n reject(e);\n }\n });\n };\n Settings.prototype.load = function (provider) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n provider.getConfiguration().then(function (value) {\n _this._settings.merge(value);\n resolve();\n }).catch(function (reason) {\n reject(reason);\n });\n });\n };\n Settings.prototype.get = function (key) {\n return this._settings.get(key);\n };\n Settings.prototype.getJSON = function (key) {\n var o = this.get(key);\n if (typeof o === \"undefined\" || o === null) {\n return o;\n }\n return JSON.parse(o);\n };\n return Settings;\n}());\nexports.Settings = Settings;\n","\"use strict\";\nvar RuntimeConfigImpl = (function () {\n function RuntimeConfigImpl() {\n this._headers = null;\n this._defaultCachingStore = \"session\";\n this._defaultCachingTimeoutSeconds = 30;\n this._globalCacheDisable = false;\n this._useSPRequestExecutor = false;\n }\n RuntimeConfigImpl.prototype.set = function (config) {\n if (config.hasOwnProperty(\"headers\")) {\n this._headers = config.headers;\n }\n if (config.hasOwnProperty(\"globalCacheDisable\")) {\n this._globalCacheDisable = config.globalCacheDisable;\n }\n if (config.hasOwnProperty(\"defaultCachingStore\")) {\n this._defaultCachingStore = config.defaultCachingStore;\n }\n if (config.hasOwnProperty(\"defaultCachingTimeoutSeconds\")) {\n this._defaultCachingTimeoutSeconds = config.defaultCachingTimeoutSeconds;\n }\n if (config.hasOwnProperty(\"useSPRequestExecutor\")) {\n this._useSPRequestExecutor = config.useSPRequestExecutor;\n }\n if (config.hasOwnProperty(\"nodeClientOptions\")) {\n this._useNodeClient = true;\n this._useSPRequestExecutor = false;\n this._nodeClientData = config.nodeClientOptions;\n global._spPageContextInfo = {\n webAbsoluteUrl: config.nodeClientOptions.siteUrl,\n };\n }\n };\n Object.defineProperty(RuntimeConfigImpl.prototype, \"headers\", {\n get: function () {\n return this._headers;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RuntimeConfigImpl.prototype, \"defaultCachingStore\", {\n get: function () {\n return this._defaultCachingStore;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RuntimeConfigImpl.prototype, \"defaultCachingTimeoutSeconds\", {\n get: function () {\n return this._defaultCachingTimeoutSeconds;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RuntimeConfigImpl.prototype, \"globalCacheDisable\", {\n get: function () {\n return this._globalCacheDisable;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RuntimeConfigImpl.prototype, \"useSPRequestExecutor\", {\n get: function () {\n return this._useSPRequestExecutor;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RuntimeConfigImpl.prototype, \"useNodeFetchClient\", {\n get: function () {\n return this._useNodeClient;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RuntimeConfigImpl.prototype, \"nodeRequestOptions\", {\n get: function () {\n return this._nodeClientData;\n },\n enumerable: true,\n configurable: true\n });\n return RuntimeConfigImpl;\n}());\nexports.RuntimeConfigImpl = RuntimeConfigImpl;\nvar _runtimeConfig = new RuntimeConfigImpl();\nexports.RuntimeConfig = _runtimeConfig;\nfunction setRuntimeConfig(config) {\n _runtimeConfig.set(config);\n}\nexports.setRuntimeConfig = setRuntimeConfig;\n","\"use strict\";\nvar storage = require(\"../../utils/storage\");\nvar CachingConfigurationProvider = (function () {\n function CachingConfigurationProvider(wrappedProvider, cacheKey, cacheStore) {\n this.wrappedProvider = wrappedProvider;\n this.store = (cacheStore) ? cacheStore : this.selectPnPCache();\n this.cacheKey = \"_configcache_\" + cacheKey;\n }\n CachingConfigurationProvider.prototype.getWrappedProvider = function () {\n return this.wrappedProvider;\n };\n CachingConfigurationProvider.prototype.getConfiguration = function () {\n var _this = this;\n if ((!this.store) || (!this.store.enabled)) {\n return this.wrappedProvider.getConfiguration();\n }\n var cachedConfig = this.store.get(this.cacheKey);\n if (cachedConfig) {\n return new Promise(function (resolve, reject) {\n resolve(cachedConfig);\n });\n }\n var providerPromise = this.wrappedProvider.getConfiguration();\n providerPromise.then(function (providedConfig) {\n _this.store.put(_this.cacheKey, providedConfig);\n });\n return providerPromise;\n };\n CachingConfigurationProvider.prototype.selectPnPCache = function () {\n var pnpCache = new storage.PnPClientStorage();\n if ((pnpCache.local) && (pnpCache.local.enabled)) {\n return pnpCache.local;\n }\n if ((pnpCache.session) && (pnpCache.session.enabled)) {\n return pnpCache.session;\n }\n throw new Error(\"Cannot create a caching configuration provider since cache is not available.\");\n };\n return CachingConfigurationProvider;\n}());\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = CachingConfigurationProvider;\n","\"use strict\";\nvar cachingConfigurationProvider_1 = require(\"./cachingConfigurationProvider\");\nvar spListConfigurationProvider_1 = require(\"./spListConfigurationProvider\");\nexports.CachingConfigurationProvider = cachingConfigurationProvider_1.default;\nexports.SPListConfigurationProvider = spListConfigurationProvider_1.default;\n","\"use strict\";\nvar cachingConfigurationProvider_1 = require(\"./cachingConfigurationProvider\");\nvar SPListConfigurationProvider = (function () {\n function SPListConfigurationProvider(sourceWeb, sourceListTitle) {\n if (sourceListTitle === void 0) { sourceListTitle = \"config\"; }\n this.sourceWeb = sourceWeb;\n this.sourceListTitle = sourceListTitle;\n }\n Object.defineProperty(SPListConfigurationProvider.prototype, \"web\", {\n get: function () {\n return this.sourceWeb;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SPListConfigurationProvider.prototype, \"listTitle\", {\n get: function () {\n return this.sourceListTitle;\n },\n enumerable: true,\n configurable: true\n });\n SPListConfigurationProvider.prototype.getConfiguration = function () {\n return this.web.lists.getByTitle(this.listTitle).items.select(\"Title\", \"Value\")\n .getAs().then(function (data) {\n var configuration = {};\n data.forEach(function (i) {\n configuration[i.Title] = i.Value;\n });\n return configuration;\n });\n };\n SPListConfigurationProvider.prototype.asCaching = function () {\n var cacheKey = \"splist_\" + this.web.toUrl() + \"+\" + this.listTitle;\n return new cachingConfigurationProvider_1.default(this, cacheKey);\n };\n return SPListConfigurationProvider;\n}());\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = SPListConfigurationProvider;\n","\"use strict\";\nvar collections_1 = require(\"../collections/collections\");\nvar util_1 = require(\"../utils/util\");\nvar odata_1 = require(\"../sharepoint/rest/odata\");\nvar CachedDigest = (function () {\n function CachedDigest() {\n }\n return CachedDigest;\n}());\nexports.CachedDigest = CachedDigest;\nvar DigestCache = (function () {\n function DigestCache(_httpClient, _digests) {\n if (_digests === void 0) { _digests = new collections_1.Dictionary(); }\n this._httpClient = _httpClient;\n this._digests = _digests;\n }\n DigestCache.prototype.getDigest = function (webUrl) {\n var self = this;\n var cachedDigest = this._digests.get(webUrl);\n if (cachedDigest !== null) {\n var now = new Date();\n if (now < cachedDigest.expiration) {\n return Promise.resolve(cachedDigest.value);\n }\n }\n var url = util_1.Util.combinePaths(webUrl, \"/_api/contextinfo\");\n return self._httpClient.fetchRaw(url, {\n cache: \"no-cache\",\n credentials: \"same-origin\",\n headers: {\n \"Accept\": \"application/json;odata=verbose\",\n \"Content-type\": \"application/json;odata=verbose;charset=utf-8\",\n },\n method: \"POST\",\n }).then(function (response) {\n var parser = new odata_1.ODataDefaultParser();\n return parser.parse(response).then(function (d) { return d.GetContextWebInformation; });\n }).then(function (data) {\n var newCachedDigest = new CachedDigest();\n newCachedDigest.value = data.FormDigestValue;\n var seconds = data.FormDigestTimeoutSeconds;\n var expiration = new Date();\n expiration.setTime(expiration.getTime() + 1000 * seconds);\n newCachedDigest.expiration = expiration;\n self._digests.add(webUrl, newCachedDigest);\n return newCachedDigest.value;\n });\n };\n DigestCache.prototype.clear = function () {\n this._digests.clear();\n };\n return DigestCache;\n}());\nexports.DigestCache = DigestCache;\n","\"use strict\";\nvar FetchClient = (function () {\n function FetchClient() {\n }\n FetchClient.prototype.fetch = function (url, options) {\n return global.fetch(url, options);\n };\n return FetchClient;\n}());\nexports.FetchClient = FetchClient;\n","\"use strict\";\nvar fetchclient_1 = require(\"./fetchclient\");\nvar digestcache_1 = require(\"./digestcache\");\nvar util_1 = require(\"../utils/util\");\nvar pnplibconfig_1 = require(\"../configuration/pnplibconfig\");\nvar sprequestexecutorclient_1 = require(\"./sprequestexecutorclient\");\nvar nodefetchclient_1 = require(\"./nodefetchclient\");\nvar HttpClient = (function () {\n function HttpClient() {\n this._impl = this.getFetchImpl();\n this._digestCache = new digestcache_1.DigestCache(this);\n }\n HttpClient.prototype.fetch = function (url, options) {\n if (options === void 0) { options = {}; }\n var self = this;\n var opts = util_1.Util.extend(options, { cache: \"no-cache\", credentials: \"same-origin\" }, true);\n var headers = new Headers();\n this.mergeHeaders(headers, pnplibconfig_1.RuntimeConfig.headers);\n this.mergeHeaders(headers, options.headers);\n if (!headers.has(\"Accept\")) {\n headers.append(\"Accept\", \"application/json\");\n }\n if (!headers.has(\"Content-Type\")) {\n headers.append(\"Content-Type\", \"application/json;odata=verbose;charset=utf-8\");\n }\n if (!headers.has(\"X-ClientService-ClientTag\")) {\n headers.append(\"X-ClientService-ClientTag\", \"PnPCoreJS:1.0.5\");\n }\n opts = util_1.Util.extend(opts, { headers: headers });\n if (opts.method && opts.method.toUpperCase() !== \"GET\") {\n if (!headers.has(\"X-RequestDigest\")) {\n var index = url.indexOf(\"_api/\");\n if (index < 0) {\n throw new Error(\"Unable to determine API url\");\n }\n var webUrl = url.substr(0, index);\n return this._digestCache.getDigest(webUrl)\n .then(function (digest) {\n headers.append(\"X-RequestDigest\", digest);\n return self.fetchRaw(url, opts);\n });\n }\n }\n return self.fetchRaw(url, opts);\n };\n HttpClient.prototype.fetchRaw = function (url, options) {\n var _this = this;\n if (options === void 0) { options = {}; }\n var rawHeaders = new Headers();\n this.mergeHeaders(rawHeaders, options.headers);\n options = util_1.Util.extend(options, { headers: rawHeaders });\n var retry = function (ctx) {\n _this._impl.fetch(url, options).then(function (response) { return ctx.resolve(response); }).catch(function (response) {\n var delay = ctx.delay;\n if (response.status !== 429 && response.status !== 503) {\n ctx.reject(response);\n }\n ctx.delay *= 2;\n ctx.attempts++;\n if (ctx.retryCount <= ctx.attempts) {\n ctx.reject(response);\n }\n setTimeout(util_1.Util.getCtxCallback(_this, retry, ctx), delay);\n });\n };\n return new Promise(function (resolve, reject) {\n var retryContext = {\n attempts: 0,\n delay: 100,\n reject: reject,\n resolve: resolve,\n retryCount: 7,\n };\n retry.call(_this, retryContext);\n });\n };\n HttpClient.prototype.get = function (url, options) {\n if (options === void 0) { options = {}; }\n var opts = util_1.Util.extend(options, { method: \"GET\" });\n return this.fetch(url, opts);\n };\n HttpClient.prototype.post = function (url, options) {\n if (options === void 0) { options = {}; }\n var opts = util_1.Util.extend(options, { method: \"POST\" });\n return this.fetch(url, opts);\n };\n HttpClient.prototype.getFetchImpl = function () {\n if (pnplibconfig_1.RuntimeConfig.useSPRequestExecutor) {\n return new sprequestexecutorclient_1.SPRequestExecutorClient();\n }\n else if (pnplibconfig_1.RuntimeConfig.useNodeFetchClient) {\n var opts = pnplibconfig_1.RuntimeConfig.nodeRequestOptions;\n return new nodefetchclient_1.NodeFetchClient(opts.siteUrl, opts.clientId, opts.clientSecret);\n }\n else {\n return new fetchclient_1.FetchClient();\n }\n };\n HttpClient.prototype.mergeHeaders = function (target, source) {\n if (typeof source !== \"undefined\" && source !== null) {\n var temp = new Request(\"\", { headers: source });\n temp.headers.forEach(function (value, name) {\n target.append(name, value);\n });\n }\n };\n return HttpClient;\n}());\nexports.HttpClient = HttpClient;\n","\"use strict\";\nvar NodeFetchClient = (function () {\n function NodeFetchClient(siteUrl, _clientId, _clientSecret, _realm) {\n if (_realm === void 0) { _realm = \"\"; }\n this.siteUrl = siteUrl;\n this._clientId = _clientId;\n this._clientSecret = _clientSecret;\n this._realm = _realm;\n }\n NodeFetchClient.prototype.fetch = function (url, options) {\n throw new Error(\"Using NodeFetchClient in the browser is not supported.\");\n };\n return NodeFetchClient;\n}());\nexports.NodeFetchClient = NodeFetchClient;\n","\"use strict\";\nvar util_1 = require(\"../utils/util\");\nvar SPRequestExecutorClient = (function () {\n function SPRequestExecutorClient() {\n this.convertToResponse = function (spResponse) {\n var responseHeaders = new Headers();\n for (var h in spResponse.headers) {\n if (spResponse.headers[h]) {\n responseHeaders.append(h, spResponse.headers[h]);\n }\n }\n return new Response(spResponse.body, {\n headers: responseHeaders,\n status: spResponse.statusCode,\n statusText: spResponse.statusText,\n });\n };\n }\n SPRequestExecutorClient.prototype.fetch = function (url, options) {\n var _this = this;\n if (typeof SP === \"undefined\" || typeof SP.RequestExecutor === \"undefined\") {\n throw new Error(\"SP.RequestExecutor is undefined. \" +\n \"Load the SP.RequestExecutor.js library (/_layouts/15/SP.RequestExecutor.js) before loading the PnP JS Core library.\");\n }\n var addinWebUrl = url.substring(0, url.indexOf(\"/_api\")), executor = new SP.RequestExecutor(addinWebUrl), headers = {}, iterator, temp;\n if (options.headers && options.headers instanceof Headers) {\n iterator = options.headers.entries();\n temp = iterator.next();\n while (!temp.done) {\n headers[temp.value[0]] = temp.value[1];\n temp = iterator.next();\n }\n }\n else {\n headers = options.headers;\n }\n return new Promise(function (resolve, reject) {\n var requestOptions = {\n error: function (error) {\n reject(_this.convertToResponse(error));\n },\n headers: headers,\n method: options.method,\n success: function (response) {\n resolve(_this.convertToResponse(response));\n },\n url: url,\n };\n if (options.body) {\n util_1.Util.extend(requestOptions, { body: options.body });\n }\n else {\n util_1.Util.extend(requestOptions, { binaryStringRequestBody: true });\n }\n executor.executeAsync(requestOptions);\n });\n };\n return SPRequestExecutorClient;\n}());\nexports.SPRequestExecutorClient = SPRequestExecutorClient;\n","\"use strict\";\nfunction __export(m) {\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\n}\nvar util_1 = require(\"./utils/util\");\nvar storage_1 = require(\"./utils/storage\");\nvar configuration_1 = require(\"./configuration/configuration\");\nvar logging_1 = require(\"./utils/logging\");\nvar rest_1 = require(\"./sharepoint/rest/rest\");\nvar pnplibconfig_1 = require(\"./configuration/pnplibconfig\");\nexports.util = util_1.Util;\nexports.sp = new rest_1.Rest();\nexports.storage = new storage_1.PnPClientStorage();\nexports.config = new configuration_1.Settings();\nexports.log = logging_1.Logger;\nexports.setup = pnplibconfig_1.setRuntimeConfig;\n__export(require(\"./types/index\"));\nvar Def = {\n config: exports.config,\n log: exports.log,\n setup: exports.setup,\n sp: exports.sp,\n storage: exports.storage,\n util: exports.util,\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = Def;\n","\"use strict\";\nvar storage_1 = require(\"../../utils/storage\");\nvar util_1 = require(\"../../utils/util\");\nvar pnplibconfig_1 = require(\"../../configuration/pnplibconfig\");\nvar CachingOptions = (function () {\n function CachingOptions(key) {\n this.key = key;\n this.expiration = util_1.Util.dateAdd(new Date(), \"second\", pnplibconfig_1.RuntimeConfig.defaultCachingTimeoutSeconds);\n this.storeName = pnplibconfig_1.RuntimeConfig.defaultCachingStore;\n }\n Object.defineProperty(CachingOptions.prototype, \"store\", {\n get: function () {\n if (this.storeName === \"local\") {\n return CachingOptions.storage.local;\n }\n else {\n return CachingOptions.storage.session;\n }\n },\n enumerable: true,\n configurable: true\n });\n CachingOptions.storage = new storage_1.PnPClientStorage();\n return CachingOptions;\n}());\nexports.CachingOptions = CachingOptions;\nvar CachingParserWrapper = (function () {\n function CachingParserWrapper(_parser, _cacheOptions) {\n this._parser = _parser;\n this._cacheOptions = _cacheOptions;\n }\n CachingParserWrapper.prototype.parse = function (response) {\n var _this = this;\n return this._parser.parse(response).then(function (data) {\n if (_this._cacheOptions.store !== null) {\n _this._cacheOptions.store.put(_this._cacheOptions.key, data, _this._cacheOptions.expiration);\n }\n return data;\n });\n };\n return CachingParserWrapper;\n}());\nexports.CachingParserWrapper = CachingParserWrapper;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar ContentTypes = (function (_super) {\n __extends(ContentTypes, _super);\n function ContentTypes(baseUrl, path) {\n if (path === void 0) { path = \"contenttypes\"; }\n _super.call(this, baseUrl, path);\n }\n ContentTypes.prototype.getById = function (id) {\n var ct = new ContentType(this);\n ct.concat(\"('\" + id + \"')\");\n return ct;\n };\n return ContentTypes;\n}(queryable_1.QueryableCollection));\nexports.ContentTypes = ContentTypes;\nvar ContentType = (function (_super) {\n __extends(ContentType, _super);\n function ContentType(baseUrl, path) {\n _super.call(this, baseUrl, path);\n }\n Object.defineProperty(ContentType.prototype, \"fieldLinks\", {\n get: function () {\n return new queryable_1.Queryable(this, \"fieldLinks\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ContentType.prototype, \"fields\", {\n get: function () {\n return new queryable_1.Queryable(this, \"fields\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ContentType.prototype, \"parent\", {\n get: function () {\n return new ContentType(this, \"parent\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ContentType.prototype, \"workflowAssociations\", {\n get: function () {\n return new queryable_1.Queryable(this, \"workflowAssociations\");\n },\n enumerable: true,\n configurable: true\n });\n return ContentType;\n}(queryable_1.QueryableInstance));\nexports.ContentType = ContentType;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar util_1 = require(\"../../utils/util\");\nvar Types = require(\"./types\");\nvar Fields = (function (_super) {\n __extends(Fields, _super);\n function Fields(baseUrl, path) {\n if (path === void 0) { path = \"fields\"; }\n _super.call(this, baseUrl, path);\n }\n Fields.prototype.getByTitle = function (title) {\n return new Field(this, \"getByTitle('\" + title + \"')\");\n };\n Fields.prototype.getByInternalNameOrTitle = function (name) {\n return new Field(this, \"getByInternalNameOrTitle('\" + name + \"')\");\n };\n Fields.prototype.getById = function (id) {\n var f = new Field(this);\n f.concat(\"('\" + id + \"')\");\n return f;\n };\n Fields.prototype.createFieldAsXml = function (xml) {\n var _this = this;\n var info;\n if (typeof xml === \"string\") {\n info = { SchemaXml: xml };\n }\n else {\n info = xml;\n }\n var postBody = JSON.stringify({\n \"parameters\": util_1.Util.extend({\n \"__metadata\": {\n \"type\": \"SP.XmlSchemaFieldCreationInformation\",\n },\n }, info),\n });\n var q = new Fields(this, \"createfieldasxml\");\n return q.postAs({ body: postBody }).then(function (data) {\n return {\n data: data,\n field: _this.getById(data.Id),\n };\n });\n };\n Fields.prototype.add = function (title, fieldType, properties) {\n var _this = this;\n if (properties === void 0) { properties = {}; }\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": fieldType },\n \"Title\": title,\n }, properties));\n return this.postAs({ body: postBody }).then(function (data) {\n return {\n data: data,\n field: _this.getById(data.Id),\n };\n });\n };\n Fields.prototype.addText = function (title, maxLength, properties) {\n if (maxLength === void 0) { maxLength = 255; }\n var props = {\n FieldTypeKind: 2,\n };\n return this.add(title, \"SP.FieldText\", util_1.Util.extend(props, properties));\n };\n Fields.prototype.addCalculated = function (title, formula, dateFormat, outputType, properties) {\n if (outputType === void 0) { outputType = Types.FieldTypes.Text; }\n var props = {\n DateFormat: dateFormat,\n FieldTypeKind: 17,\n Formula: formula,\n OutputType: outputType,\n };\n return this.add(title, \"SP.FieldCalculated\", util_1.Util.extend(props, properties));\n };\n Fields.prototype.addDateTime = function (title, displayFormat, calendarType, friendlyDisplayFormat, properties) {\n if (displayFormat === void 0) { displayFormat = Types.DateTimeFieldFormatType.DateOnly; }\n if (calendarType === void 0) { calendarType = Types.CalendarType.Gregorian; }\n if (friendlyDisplayFormat === void 0) { friendlyDisplayFormat = 0; }\n var props = {\n DateTimeCalendarType: calendarType,\n DisplayFormat: displayFormat,\n FieldTypeKind: 4,\n FriendlyDisplayFormat: friendlyDisplayFormat,\n };\n return this.add(title, \"SP.FieldDateTime\", util_1.Util.extend(props, properties));\n };\n Fields.prototype.addNumber = function (title, minValue, maxValue, properties) {\n var props = { FieldTypeKind: 9 };\n if (typeof minValue !== \"undefined\") {\n props = util_1.Util.extend({ MinimumValue: minValue }, props);\n }\n if (typeof maxValue !== \"undefined\") {\n props = util_1.Util.extend({ MaximumValue: maxValue }, props);\n }\n return this.add(title, \"SP.FieldNumber\", util_1.Util.extend(props, properties));\n };\n Fields.prototype.addCurrency = function (title, minValue, maxValue, currencyLocalId, properties) {\n if (currencyLocalId === void 0) { currencyLocalId = 1033; }\n var props = {\n CurrencyLocaleId: currencyLocalId,\n FieldTypeKind: 10,\n };\n if (typeof minValue !== \"undefined\") {\n props = util_1.Util.extend({ MinimumValue: minValue }, props);\n }\n if (typeof maxValue !== \"undefined\") {\n props = util_1.Util.extend({ MaximumValue: maxValue }, props);\n }\n return this.add(title, \"SP.FieldCurrency\", util_1.Util.extend(props, properties));\n };\n Fields.prototype.addMultilineText = function (title, numberOfLines, richText, restrictedMode, appendOnly, allowHyperlink, properties) {\n if (numberOfLines === void 0) { numberOfLines = 6; }\n if (richText === void 0) { richText = true; }\n if (restrictedMode === void 0) { restrictedMode = false; }\n if (appendOnly === void 0) { appendOnly = false; }\n if (allowHyperlink === void 0) { allowHyperlink = true; }\n var props = {\n AllowHyperlink: allowHyperlink,\n AppendOnly: appendOnly,\n FieldTypeKind: 3,\n NumberOfLines: numberOfLines,\n RestrictedMode: restrictedMode,\n RichText: richText,\n };\n return this.add(title, \"SP.FieldMultiLineText\", util_1.Util.extend(props, properties));\n };\n Fields.prototype.addUrl = function (title, displayFormat, properties) {\n if (displayFormat === void 0) { displayFormat = Types.UrlFieldFormatType.Hyperlink; }\n var props = {\n DisplayFormat: displayFormat,\n FieldTypeKind: 11,\n };\n return this.add(title, \"SP.FieldUrl\", util_1.Util.extend(props, properties));\n };\n return Fields;\n}(queryable_1.QueryableCollection));\nexports.Fields = Fields;\nvar Field = (function (_super) {\n __extends(Field, _super);\n function Field(baseUrl, path) {\n _super.call(this, baseUrl, path);\n }\n Field.prototype.update = function (properties, fieldType) {\n var _this = this;\n if (fieldType === void 0) { fieldType = \"SP.Field\"; }\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": fieldType },\n }, properties));\n return this.post({\n body: postBody,\n headers: {\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n return {\n data: data,\n field: _this,\n };\n });\n };\n Field.prototype.delete = function () {\n return this.post({\n headers: {\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n Field.prototype.setShowInDisplayForm = function (show) {\n var q = new Field(this, \"setshowindisplayform(\" + show + \")\");\n return q.post();\n };\n Field.prototype.setShowInEditForm = function (show) {\n var q = new Field(this, \"setshowineditform(\" + show + \")\");\n return q.post();\n };\n Field.prototype.setShowInNewForm = function (show) {\n var q = new Field(this, \"setshowinnewform(\" + show + \")\");\n return q.post();\n };\n return Field;\n}(queryable_1.QueryableInstance));\nexports.Field = Field;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar items_1 = require(\"./items\");\nvar Files = (function (_super) {\n __extends(Files, _super);\n function Files(baseUrl, path) {\n if (path === void 0) { path = \"files\"; }\n _super.call(this, baseUrl, path);\n }\n Files.prototype.getByName = function (name) {\n var f = new File(this);\n f.concat(\"('\" + name + \"')\");\n return f;\n };\n Files.prototype.add = function (url, content, shouldOverWrite) {\n var _this = this;\n if (shouldOverWrite === void 0) { shouldOverWrite = true; }\n return new Files(this, \"add(overwrite=\" + shouldOverWrite + \",url='\" + url + \"')\")\n .post({ body: content }).then(function (response) {\n return {\n data: response,\n file: _this.getByName(url),\n };\n });\n };\n Files.prototype.addTemplateFile = function (fileUrl, templateFileType) {\n var _this = this;\n return new Files(this, \"addTemplateFile(urloffile='\" + fileUrl + \"',templatefiletype=\" + templateFileType + \")\")\n .post().then(function (response) {\n return {\n data: response,\n file: _this.getByName(fileUrl),\n };\n });\n };\n return Files;\n}(queryable_1.QueryableCollection));\nexports.Files = Files;\nvar File = (function (_super) {\n __extends(File, _super);\n function File(baseUrl, path) {\n _super.call(this, baseUrl, path);\n }\n Object.defineProperty(File.prototype, \"listItemAllFields\", {\n get: function () {\n return new items_1.Item(this, \"listItemAllFields\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(File.prototype, \"versions\", {\n get: function () {\n return new Versions(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(File.prototype, \"value\", {\n get: function () {\n return new queryable_1.Queryable(this, \"$value\");\n },\n enumerable: true,\n configurable: true\n });\n File.prototype.approve = function (comment) {\n return new File(this, \"approve(comment='\" + comment + \"')\").post();\n };\n File.prototype.cancelUpload = function (uploadId) {\n return new File(this, \"cancelUpload(uploadId=guid'\" + uploadId + \"')\").post();\n };\n File.prototype.checkin = function (comment, checkinType) {\n if (comment === void 0) { comment = \"\"; }\n if (checkinType === void 0) { checkinType = CheckinType.Major; }\n return new File(this, \"checkin(comment='\" + comment + \"',checkintype=\" + checkinType + \")\").post();\n };\n File.prototype.checkout = function () {\n return new File(this, \"checkout\").post();\n };\n File.prototype.continueUpload = function (uploadId, fileOffset, b) {\n return new File(this, \"continueUpload(uploadId=guid'\" + uploadId + \"',fileOffset=\" + fileOffset + \")\").postAs({ body: b });\n };\n File.prototype.copyTo = function (url, shouldOverWrite) {\n if (shouldOverWrite === void 0) { shouldOverWrite = true; }\n return new File(this, \"copyTo(strnewurl='\" + url + \"',boverwrite=\" + shouldOverWrite + \")\").post();\n };\n File.prototype.delete = function (eTag) {\n if (eTag === void 0) { eTag = \"*\"; }\n return new File(this).post({\n headers: {\n \"IF-Match\": eTag,\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n File.prototype.deny = function (comment) {\n if (comment === void 0) { comment = \"\"; }\n return new File(this, \"deny(comment='\" + comment + \"')\").post();\n };\n File.prototype.finishUpload = function (uploadId, fileOffset, fragment) {\n return new File(this, \"finishUpload(uploadId=guid'\" + uploadId + \"',fileOffset=\" + fileOffset + \")\")\n .postAs({ body: fragment }).then(function (response) {\n return {\n data: response,\n file: new File(response.ServerRelativeUrl),\n };\n });\n };\n File.prototype.getLimitedWebPartManager = function (scope) {\n if (scope === void 0) { scope = WebPartsPersonalizationScope.User; }\n return new queryable_1.Queryable(this, \"getLimitedWebPartManager(scope=\" + scope + \")\");\n };\n File.prototype.moveTo = function (url, moveOperations) {\n if (moveOperations === void 0) { moveOperations = MoveOperations.Overwrite; }\n return new File(this, \"moveTo(newurl='\" + url + \"',flags=\" + moveOperations + \")\").post();\n };\n File.prototype.openBinaryStream = function () {\n return new queryable_1.Queryable(this, \"openBinaryStream\");\n };\n File.prototype.publish = function (comment) {\n if (comment === void 0) { comment = \"\"; }\n return new File(this, \"publish(comment='\" + comment + \"')\").post();\n };\n File.prototype.recycle = function () {\n return new File(this, \"recycle\").post();\n };\n File.prototype.saveBinaryStream = function (data) {\n return new File(this, \"saveBinary\").post({ body: data });\n };\n File.prototype.startUpload = function (uploadId, fragment) {\n return new File(this, \"startUpload(uploadId=guid'\" + uploadId + \"')\").postAs({ body: fragment });\n };\n File.prototype.undoCheckout = function () {\n return new File(this, \"undoCheckout\").post();\n };\n File.prototype.unpublish = function (comment) {\n if (comment === void 0) { comment = \"\"; }\n if (comment.length > 1023) {\n throw new Error(\"The maximum comment length is 1023 characters.\");\n }\n return new File(this, \"unpublish(comment='\" + comment + \"')\").post();\n };\n return File;\n}(queryable_1.QueryableInstance));\nexports.File = File;\nvar Versions = (function (_super) {\n __extends(Versions, _super);\n function Versions(baseUrl, path) {\n if (path === void 0) { path = \"versions\"; }\n _super.call(this, baseUrl, path);\n }\n Versions.prototype.getById = function (versionId) {\n var v = new Version(this);\n v.concat(\"(\" + versionId + \")\");\n return v;\n };\n Versions.prototype.deleteAll = function () {\n return new Versions(this, \"deleteAll\").post();\n };\n Versions.prototype.deleteById = function (versionId) {\n return new Versions(this, \"deleteById(vid=\" + versionId + \")\").post();\n };\n Versions.prototype.deleteByLabel = function (label) {\n return new Versions(this, \"deleteByLabel(versionlabel='\" + label + \"')\").post();\n };\n Versions.prototype.restoreByLabel = function (label) {\n return new Versions(this, \"restoreByLabel(versionlabel='\" + label + \"')\").post();\n };\n return Versions;\n}(queryable_1.QueryableCollection));\nexports.Versions = Versions;\nvar Version = (function (_super) {\n __extends(Version, _super);\n function Version(baseUrl, path) {\n _super.call(this, baseUrl, path);\n }\n Version.prototype.delete = function (eTag) {\n if (eTag === void 0) { eTag = \"*\"; }\n return this.post({\n headers: {\n \"IF-Match\": eTag,\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n return Version;\n}(queryable_1.QueryableInstance));\nexports.Version = Version;\n(function (CheckinType) {\n CheckinType[CheckinType[\"Minor\"] = 0] = \"Minor\";\n CheckinType[CheckinType[\"Major\"] = 1] = \"Major\";\n CheckinType[CheckinType[\"Overwrite\"] = 2] = \"Overwrite\";\n})(exports.CheckinType || (exports.CheckinType = {}));\nvar CheckinType = exports.CheckinType;\n(function (WebPartsPersonalizationScope) {\n WebPartsPersonalizationScope[WebPartsPersonalizationScope[\"User\"] = 0] = \"User\";\n WebPartsPersonalizationScope[WebPartsPersonalizationScope[\"Shared\"] = 1] = \"Shared\";\n})(exports.WebPartsPersonalizationScope || (exports.WebPartsPersonalizationScope = {}));\nvar WebPartsPersonalizationScope = exports.WebPartsPersonalizationScope;\n(function (MoveOperations) {\n MoveOperations[MoveOperations[\"Overwrite\"] = 1] = \"Overwrite\";\n MoveOperations[MoveOperations[\"AllowBrokenThickets\"] = 8] = \"AllowBrokenThickets\";\n})(exports.MoveOperations || (exports.MoveOperations = {}));\nvar MoveOperations = exports.MoveOperations;\n(function (TemplateFileType) {\n TemplateFileType[TemplateFileType[\"StandardPage\"] = 0] = \"StandardPage\";\n TemplateFileType[TemplateFileType[\"WikiPage\"] = 1] = \"WikiPage\";\n TemplateFileType[TemplateFileType[\"FormPage\"] = 2] = \"FormPage\";\n})(exports.TemplateFileType || (exports.TemplateFileType = {}));\nvar TemplateFileType = exports.TemplateFileType;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar files_1 = require(\"./files\");\nvar items_1 = require(\"./items\");\nvar Folders = (function (_super) {\n __extends(Folders, _super);\n function Folders(baseUrl, path) {\n if (path === void 0) { path = \"folders\"; }\n _super.call(this, baseUrl, path);\n }\n Folders.prototype.getByName = function (name) {\n var f = new Folder(this);\n f.concat(\"('\" + name + \"')\");\n return f;\n };\n Folders.prototype.add = function (url) {\n var _this = this;\n return new Folders(this, \"add('\" + url + \"')\").post().then(function (response) {\n return {\n data: response,\n folder: _this.getByName(url),\n };\n });\n };\n return Folders;\n}(queryable_1.QueryableCollection));\nexports.Folders = Folders;\nvar Folder = (function (_super) {\n __extends(Folder, _super);\n function Folder(baseUrl, path) {\n _super.call(this, baseUrl, path);\n }\n Object.defineProperty(Folder.prototype, \"contentTypeOrder\", {\n get: function () {\n return new queryable_1.QueryableCollection(this, \"contentTypeOrder\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Folder.prototype, \"files\", {\n get: function () {\n return new files_1.Files(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Folder.prototype, \"folders\", {\n get: function () {\n return new Folders(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Folder.prototype, \"listItemAllFields\", {\n get: function () {\n return new items_1.Item(this, \"listItemAllFields\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Folder.prototype, \"parentFolder\", {\n get: function () {\n return new Folder(this, \"parentFolder\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Folder.prototype, \"properties\", {\n get: function () {\n return new queryable_1.QueryableInstance(this, \"properties\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Folder.prototype, \"serverRelativeUrl\", {\n get: function () {\n return new queryable_1.Queryable(this, \"serverRelativeUrl\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Folder.prototype, \"uniqueContentTypeOrder\", {\n get: function () {\n return new queryable_1.QueryableCollection(this, \"uniqueContentTypeOrder\");\n },\n enumerable: true,\n configurable: true\n });\n Folder.prototype.delete = function (eTag) {\n if (eTag === void 0) { eTag = \"*\"; }\n return new Folder(this).post({\n headers: {\n \"IF-Match\": eTag,\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n Folder.prototype.recycle = function () {\n return new Folder(this, \"recycle\").post();\n };\n return Folder;\n}(queryable_1.QueryableInstance));\nexports.Folder = Folder;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar Forms = (function (_super) {\n __extends(Forms, _super);\n function Forms(baseUrl, path) {\n if (path === void 0) { path = \"forms\"; }\n _super.call(this, baseUrl, path);\n }\n Forms.prototype.getById = function (id) {\n var i = new Form(this);\n i.concat(\"('\" + id + \"')\");\n return i;\n };\n return Forms;\n}(queryable_1.QueryableCollection));\nexports.Forms = Forms;\nvar Form = (function (_super) {\n __extends(Form, _super);\n function Form(baseUrl, path) {\n _super.call(this, baseUrl, path);\n }\n return Form;\n}(queryable_1.QueryableInstance));\nexports.Form = Form;\n","\"use strict\";\nfunction __export(m) {\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\n}\n__export(require(\"./caching\"));\nvar files_1 = require(\"./files\");\nexports.CheckinType = files_1.CheckinType;\nexports.WebPartsPersonalizationScope = files_1.WebPartsPersonalizationScope;\nexports.MoveOperations = files_1.MoveOperations;\nexports.TemplateFileType = files_1.TemplateFileType;\nvar items_1 = require(\"./items\");\nexports.PagedItemCollection = items_1.PagedItemCollection;\nvar odata_1 = require(\"./odata\");\nexports.extractOdataId = odata_1.extractOdataId;\nexports.ODataParserBase = odata_1.ODataParserBase;\nexports.ODataDefaultParser = odata_1.ODataDefaultParser;\nexports.ODataRaw = odata_1.ODataRaw;\nexports.ODataValue = odata_1.ODataValue;\nexports.ODataEntity = odata_1.ODataEntity;\nexports.ODataEntityArray = odata_1.ODataEntityArray;\nvar roles_1 = require(\"./roles\");\nexports.RoleDefinitionBindings = roles_1.RoleDefinitionBindings;\nvar search_1 = require(\"./search\");\nexports.SearchResult = search_1.SearchResult;\nexports.SortDirection = search_1.SortDirection;\nexports.ReorderingRuleMatchType = search_1.ReorderingRuleMatchType;\nexports.QueryPropertyValueType = search_1.QueryPropertyValueType;\nvar site_1 = require(\"./site\");\nexports.Site = site_1.Site;\n__export(require(\"./types\"));\nvar webs_1 = require(\"./webs\");\nexports.Web = webs_1.Web;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar queryablesecurable_1 = require(\"./queryablesecurable\");\nvar folders_1 = require(\"./folders\");\nvar contenttypes_1 = require(\"./contenttypes\");\nvar util_1 = require(\"../../utils/util\");\nvar odata_1 = require(\"./odata\");\nvar Items = (function (_super) {\n __extends(Items, _super);\n function Items(baseUrl, path) {\n if (path === void 0) { path = \"items\"; }\n _super.call(this, baseUrl, path);\n }\n Items.prototype.getById = function (id) {\n var i = new Item(this);\n i.concat(\"(\" + id + \")\");\n return i;\n };\n Items.prototype.skip = function (skip) {\n this._query.add(\"$skiptoken\", encodeURIComponent(\"Paged=TRUE&p_ID=\" + skip));\n return this;\n };\n Items.prototype.getPaged = function () {\n return this.getAs(new PagedItemCollectionParser());\n };\n Items.prototype.add = function (properties) {\n var _this = this;\n if (properties === void 0) { properties = {}; }\n this.addBatchDependency();\n var parentList = this.getParent(queryable_1.QueryableInstance);\n return parentList.select(\"ListItemEntityTypeFullName\").getAs().then(function (d) {\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": d.ListItemEntityTypeFullName },\n }, properties));\n var promise = _this.postAs({ body: postBody }).then(function (data) {\n return {\n data: data,\n item: _this.getById(data.Id),\n };\n });\n _this.clearBatchDependency();\n return promise;\n });\n };\n return Items;\n}(queryable_1.QueryableCollection));\nexports.Items = Items;\nvar PagedItemCollectionParser = (function (_super) {\n __extends(PagedItemCollectionParser, _super);\n function PagedItemCollectionParser() {\n _super.apply(this, arguments);\n }\n PagedItemCollectionParser.prototype.parse = function (r) {\n return PagedItemCollection.fromResponse(r);\n };\n return PagedItemCollectionParser;\n}(odata_1.ODataParserBase));\nvar Item = (function (_super) {\n __extends(Item, _super);\n function Item(baseUrl, path) {\n _super.call(this, baseUrl, path);\n }\n Object.defineProperty(Item.prototype, \"attachmentFiles\", {\n get: function () {\n return new queryable_1.QueryableCollection(this, \"AttachmentFiles\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Item.prototype, \"contentType\", {\n get: function () {\n return new contenttypes_1.ContentType(this, \"ContentType\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Item.prototype, \"effectiveBasePermissions\", {\n get: function () {\n return new queryable_1.Queryable(this, \"EffectiveBasePermissions\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Item.prototype, \"effectiveBasePermissionsForUI\", {\n get: function () {\n return new queryable_1.Queryable(this, \"EffectiveBasePermissionsForUI\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Item.prototype, \"fieldValuesAsHTML\", {\n get: function () {\n return new queryable_1.QueryableInstance(this, \"FieldValuesAsHTML\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Item.prototype, \"fieldValuesAsText\", {\n get: function () {\n return new queryable_1.QueryableInstance(this, \"FieldValuesAsText\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Item.prototype, \"fieldValuesForEdit\", {\n get: function () {\n return new queryable_1.QueryableInstance(this, \"FieldValuesForEdit\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Item.prototype, \"folder\", {\n get: function () {\n return new folders_1.Folder(this, \"Folder\");\n },\n enumerable: true,\n configurable: true\n });\n Item.prototype.update = function (properties, eTag) {\n var _this = this;\n if (eTag === void 0) { eTag = \"*\"; }\n this.addBatchDependency();\n var parentList = this.getParent(queryable_1.QueryableInstance, this.parentUrl.substr(0, this.parentUrl.lastIndexOf(\"/\")));\n return parentList.select(\"ListItemEntityTypeFullName\").getAs().then(function (d) {\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": d.ListItemEntityTypeFullName },\n }, properties));\n var promise = _this.post({\n body: postBody,\n headers: {\n \"IF-Match\": eTag,\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n return {\n data: data,\n item: _this,\n };\n });\n _this.clearBatchDependency();\n return promise;\n });\n };\n Item.prototype.delete = function (eTag) {\n if (eTag === void 0) { eTag = \"*\"; }\n return this.post({\n headers: {\n \"IF-Match\": eTag,\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n Item.prototype.recycle = function () {\n var i = new Item(this, \"recycle\");\n return i.post();\n };\n Item.prototype.getWopiFrameUrl = function (action) {\n if (action === void 0) { action = 0; }\n var i = new Item(this, \"getWOPIFrameUrl(@action)\");\n i._query.add(\"@action\", action);\n return i.post().then(function (data) {\n return data.GetWOPIFrameUrl;\n });\n };\n Item.prototype.validateUpdateListItem = function (formValues, newDocumentUpdate) {\n if (newDocumentUpdate === void 0) { newDocumentUpdate = false; }\n var postBody = JSON.stringify({ \"formValues\": formValues, bNewDocumentUpdate: newDocumentUpdate });\n var item = new Item(this, \"validateupdatelistitem\");\n return item.post({ body: postBody });\n };\n return Item;\n}(queryablesecurable_1.QueryableSecurable));\nexports.Item = Item;\nvar PagedItemCollection = (function () {\n function PagedItemCollection() {\n }\n Object.defineProperty(PagedItemCollection.prototype, \"hasNext\", {\n get: function () {\n return typeof this.nextUrl === \"string\" && this.nextUrl.length > 0;\n },\n enumerable: true,\n configurable: true\n });\n PagedItemCollection.fromResponse = function (r) {\n return r.json().then(function (d) {\n var col = new PagedItemCollection();\n col.nextUrl = d[\"odata.nextLink\"];\n col.results = d.value;\n return col;\n });\n };\n PagedItemCollection.prototype.getNext = function () {\n if (this.hasNext) {\n var items = new Items(this.nextUrl, null);\n return items.getPaged();\n }\n return new Promise(function (r) { return r(null); });\n };\n return PagedItemCollection;\n}());\nexports.PagedItemCollection = PagedItemCollection;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar items_1 = require(\"./items\");\nvar views_1 = require(\"./views\");\nvar contenttypes_1 = require(\"./contenttypes\");\nvar fields_1 = require(\"./fields\");\nvar forms_1 = require(\"./forms\");\nvar queryable_1 = require(\"./queryable\");\nvar queryablesecurable_1 = require(\"./queryablesecurable\");\nvar util_1 = require(\"../../utils/util\");\nvar usercustomactions_1 = require(\"./usercustomactions\");\nvar odata_1 = require(\"./odata\");\nvar Lists = (function (_super) {\n __extends(Lists, _super);\n function Lists(baseUrl, path) {\n if (path === void 0) { path = \"lists\"; }\n _super.call(this, baseUrl, path);\n }\n Lists.prototype.getByTitle = function (title) {\n return new List(this, \"getByTitle('\" + title + \"')\");\n };\n Lists.prototype.getById = function (id) {\n var list = new List(this);\n list.concat(\"('\" + id + \"')\");\n return list;\n };\n Lists.prototype.add = function (title, description, template, enableContentTypes, additionalSettings) {\n var _this = this;\n if (description === void 0) { description = \"\"; }\n if (template === void 0) { template = 100; }\n if (enableContentTypes === void 0) { enableContentTypes = false; }\n if (additionalSettings === void 0) { additionalSettings = {}; }\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": \"SP.List\" },\n \"AllowContentTypes\": enableContentTypes,\n \"BaseTemplate\": template,\n \"ContentTypesEnabled\": enableContentTypes,\n \"Description\": description,\n \"Title\": title,\n }, additionalSettings));\n return this.post({ body: postBody }).then(function (data) {\n return { data: data, list: _this.getByTitle(title) };\n });\n };\n Lists.prototype.ensure = function (title, description, template, enableContentTypes, additionalSettings) {\n var _this = this;\n if (description === void 0) { description = \"\"; }\n if (template === void 0) { template = 100; }\n if (enableContentTypes === void 0) { enableContentTypes = false; }\n if (additionalSettings === void 0) { additionalSettings = {}; }\n if (this.hasBatch) {\n throw new Error(\"The ensure method is not supported as part of a batch.\");\n }\n return new Promise(function (resolve, reject) {\n var list = _this.getByTitle(title);\n list.get().then(function (d) { return resolve({ created: false, data: d, list: list }); }).catch(function () {\n _this.add(title, description, template, enableContentTypes, additionalSettings).then(function (r) {\n resolve({ created: true, data: r.data, list: _this.getByTitle(title) });\n });\n }).catch(function (e) { return reject(e); });\n });\n };\n Lists.prototype.ensureSiteAssetsLibrary = function () {\n var q = new Lists(this, \"ensuresiteassetslibrary\");\n return q.post().then(function (json) {\n return new List(odata_1.extractOdataId(json));\n });\n };\n Lists.prototype.ensureSitePagesLibrary = function () {\n var q = new Lists(this, \"ensuresitepageslibrary\");\n return q.post().then(function (json) {\n return new List(odata_1.extractOdataId(json));\n });\n };\n return Lists;\n}(queryable_1.QueryableCollection));\nexports.Lists = Lists;\nvar List = (function (_super) {\n __extends(List, _super);\n function List(baseUrl, path) {\n _super.call(this, baseUrl, path);\n }\n Object.defineProperty(List.prototype, \"contentTypes\", {\n get: function () {\n return new contenttypes_1.ContentTypes(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"items\", {\n get: function () {\n return new items_1.Items(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"views\", {\n get: function () {\n return new views_1.Views(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"fields\", {\n get: function () {\n return new fields_1.Fields(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"forms\", {\n get: function () {\n return new forms_1.Forms(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"defaultView\", {\n get: function () {\n return new queryable_1.QueryableInstance(this, \"DefaultView\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"userCustomActions\", {\n get: function () {\n return new usercustomactions_1.UserCustomActions(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"effectiveBasePermissions\", {\n get: function () {\n return new queryable_1.Queryable(this, \"EffectiveBasePermissions\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"eventReceivers\", {\n get: function () {\n return new queryable_1.QueryableCollection(this, \"EventReceivers\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"relatedFields\", {\n get: function () {\n return new queryable_1.Queryable(this, \"getRelatedFields\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"informationRightsManagementSettings\", {\n get: function () {\n return new queryable_1.Queryable(this, \"InformationRightsManagementSettings\");\n },\n enumerable: true,\n configurable: true\n });\n List.prototype.getView = function (viewId) {\n return new views_1.View(this, \"getView('\" + viewId + \"')\");\n };\n List.prototype.update = function (properties, eTag) {\n var _this = this;\n if (eTag === void 0) { eTag = \"*\"; }\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": \"SP.List\" },\n }, properties));\n return this.post({\n body: postBody,\n headers: {\n \"IF-Match\": eTag,\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n var retList = _this;\n if (properties.hasOwnProperty(\"Title\")) {\n retList = _this.getParent(List, _this.parentUrl, \"getByTitle('\" + properties[\"Title\"] + \"')\");\n }\n return {\n data: data,\n list: retList,\n };\n });\n };\n List.prototype.delete = function (eTag) {\n if (eTag === void 0) { eTag = \"*\"; }\n return this.post({\n headers: {\n \"IF-Match\": eTag,\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n List.prototype.getChanges = function (query) {\n var postBody = JSON.stringify({ \"query\": util_1.Util.extend({ \"__metadata\": { \"type\": \"SP.ChangeQuery\" } }, query) });\n var q = new List(this, \"getchanges\");\n return q.post({ body: postBody });\n };\n List.prototype.getItemsByCAMLQuery = function (query) {\n var expands = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n expands[_i - 1] = arguments[_i];\n }\n var postBody = JSON.stringify({ \"query\": util_1.Util.extend({ \"__metadata\": { \"type\": \"SP.CamlQuery\" } }, query) });\n var q = new List(this, \"getitems\");\n q = q.expand.apply(q, expands);\n return q.post({ body: postBody });\n };\n List.prototype.getListItemChangesSinceToken = function (query) {\n var postBody = JSON.stringify({ \"query\": util_1.Util.extend({ \"__metadata\": { \"type\": \"SP.ChangeLogItemQuery\" } }, query) });\n var q = new List(this, \"getlistitemchangessincetoken\");\n return q.post({ body: postBody }, { parse: function (r) { return r.text(); } });\n };\n List.prototype.recycle = function () {\n this.append(\"recycle\");\n return this.post().then(function (data) {\n if (data.hasOwnProperty(\"Recycle\")) {\n return data.Recycle;\n }\n else {\n return data;\n }\n });\n };\n List.prototype.renderListData = function (viewXml) {\n var q = new List(this, \"renderlistdata(@viewXml)\");\n q.query.add(\"@viewXml\", \"'\" + viewXml + \"'\");\n return q.post().then(function (data) {\n data = JSON.parse(data);\n if (data.hasOwnProperty(\"RenderListData\")) {\n return data.RenderListData;\n }\n else {\n return data;\n }\n });\n };\n List.prototype.renderListFormData = function (itemId, formId, mode) {\n var q = new List(this, \"renderlistformdata(itemid=\" + itemId + \", formid='\" + formId + \"', mode=\" + mode + \")\");\n return q.post().then(function (data) {\n data = JSON.parse(data);\n if (data.hasOwnProperty(\"ListData\")) {\n return data.ListData;\n }\n else {\n return data;\n }\n });\n };\n List.prototype.reserveListItemId = function () {\n var q = new List(this, \"reservelistitemid\");\n return q.post().then(function (data) {\n if (data.hasOwnProperty(\"ReserveListItemId\")) {\n return data.ReserveListItemId;\n }\n else {\n return data;\n }\n });\n };\n return List;\n}(queryablesecurable_1.QueryableSecurable));\nexports.List = List;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar quicklaunch_1 = require(\"./quicklaunch\");\nvar topnavigationbar_1 = require(\"./topnavigationbar\");\nvar Navigation = (function (_super) {\n __extends(Navigation, _super);\n function Navigation(baseUrl) {\n _super.call(this, baseUrl, \"navigation\");\n }\n Object.defineProperty(Navigation.prototype, \"quicklaunch\", {\n get: function () {\n return new quicklaunch_1.QuickLaunch(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Navigation.prototype, \"topNavigationBar\", {\n get: function () {\n return new topnavigationbar_1.TopNavigationBar(this);\n },\n enumerable: true,\n configurable: true\n });\n return Navigation;\n}(queryable_1.Queryable));\nexports.Navigation = Navigation;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar util_1 = require(\"../../utils/util\");\nvar logging_1 = require(\"../../utils/logging\");\nvar httpclient_1 = require(\"../../net/httpclient\");\nvar pnplibconfig_1 = require(\"../../configuration/pnplibconfig\");\nfunction extractOdataId(candidate) {\n if (candidate.hasOwnProperty(\"odata.id\")) {\n return candidate[\"odata.id\"];\n }\n else if (candidate.hasOwnProperty(\"__metadata\") && candidate.__metadata.hasOwnProperty(\"id\")) {\n return candidate.__metadata.id;\n }\n else {\n logging_1.Logger.log({\n data: candidate,\n level: logging_1.LogLevel.Error,\n message: \"Could not extract odata id in object, you may be using nometadata. Object data logged to logger.\",\n });\n throw new Error(\"Could not extract odata id in object, you may be using nometadata. Object data logged to logger.\");\n }\n}\nexports.extractOdataId = extractOdataId;\nvar ODataParserBase = (function () {\n function ODataParserBase() {\n }\n ODataParserBase.prototype.parse = function (r) {\n return r.json().then(function (json) {\n var result = json;\n if (json.hasOwnProperty(\"d\")) {\n if (json.d.hasOwnProperty(\"results\")) {\n result = json.d.results;\n }\n else {\n result = json.d;\n }\n }\n else if (json.hasOwnProperty(\"value\")) {\n result = json.value;\n }\n return result;\n });\n };\n return ODataParserBase;\n}());\nexports.ODataParserBase = ODataParserBase;\nvar ODataDefaultParser = (function (_super) {\n __extends(ODataDefaultParser, _super);\n function ODataDefaultParser() {\n _super.apply(this, arguments);\n }\n return ODataDefaultParser;\n}(ODataParserBase));\nexports.ODataDefaultParser = ODataDefaultParser;\nvar ODataRawParserImpl = (function () {\n function ODataRawParserImpl() {\n }\n ODataRawParserImpl.prototype.parse = function (r) {\n return r.json();\n };\n return ODataRawParserImpl;\n}());\nexports.ODataRawParserImpl = ODataRawParserImpl;\nvar ODataValueParserImpl = (function (_super) {\n __extends(ODataValueParserImpl, _super);\n function ODataValueParserImpl() {\n _super.apply(this, arguments);\n }\n ODataValueParserImpl.prototype.parse = function (r) {\n return _super.prototype.parse.call(this, r).then(function (d) { return d; });\n };\n return ODataValueParserImpl;\n}(ODataParserBase));\nvar ODataEntityParserImpl = (function (_super) {\n __extends(ODataEntityParserImpl, _super);\n function ODataEntityParserImpl(factory) {\n _super.call(this);\n this.factory = factory;\n }\n ODataEntityParserImpl.prototype.parse = function (r) {\n var _this = this;\n return _super.prototype.parse.call(this, r).then(function (d) {\n var o = new _this.factory(getEntityUrl(d), null);\n return util_1.Util.extend(o, d);\n });\n };\n return ODataEntityParserImpl;\n}(ODataParserBase));\nvar ODataEntityArrayParserImpl = (function (_super) {\n __extends(ODataEntityArrayParserImpl, _super);\n function ODataEntityArrayParserImpl(factory) {\n _super.call(this);\n this.factory = factory;\n }\n ODataEntityArrayParserImpl.prototype.parse = function (r) {\n var _this = this;\n return _super.prototype.parse.call(this, r).then(function (d) {\n return d.map(function (v) {\n var o = new _this.factory(getEntityUrl(v), null);\n return util_1.Util.extend(o, v);\n });\n });\n };\n return ODataEntityArrayParserImpl;\n}(ODataParserBase));\nfunction getEntityUrl(entity) {\n if (entity.hasOwnProperty(\"__metadata\")) {\n return entity.__metadata.uri;\n }\n else if (entity.hasOwnProperty(\"odata.editLink\")) {\n return util_1.Util.combinePaths(\"_api\", entity[\"odata.editLink\"]);\n }\n else {\n logging_1.Logger.write(\"No uri information found in ODataEntity parsing, chaining will fail for this object.\", logging_1.LogLevel.Warning);\n return \"\";\n }\n}\nexports.ODataRaw = new ODataRawParserImpl();\nfunction ODataValue() {\n return new ODataValueParserImpl();\n}\nexports.ODataValue = ODataValue;\nfunction ODataEntity(factory) {\n return new ODataEntityParserImpl(factory);\n}\nexports.ODataEntity = ODataEntity;\nfunction ODataEntityArray(factory) {\n return new ODataEntityArrayParserImpl(factory);\n}\nexports.ODataEntityArray = ODataEntityArray;\nvar ODataBatch = (function () {\n function ODataBatch(_batchId) {\n if (_batchId === void 0) { _batchId = util_1.Util.getGUID(); }\n this._batchId = _batchId;\n this._requests = [];\n this._batchDepCount = 0;\n }\n ODataBatch.prototype.add = function (url, method, options, parser) {\n var info = {\n method: method.toUpperCase(),\n options: options,\n parser: parser,\n reject: null,\n resolve: null,\n url: url,\n };\n var p = new Promise(function (resolve, reject) {\n info.resolve = resolve;\n info.reject = reject;\n });\n this._requests.push(info);\n return p;\n };\n ODataBatch.prototype.incrementBatchDep = function () {\n this._batchDepCount++;\n };\n ODataBatch.prototype.decrementBatchDep = function () {\n this._batchDepCount--;\n };\n ODataBatch.prototype.execute = function () {\n var _this = this;\n return new Promise(function (resolve, reject) {\n if (_this._batchDepCount > 0) {\n setTimeout(function () { return _this.execute(); }, 100);\n }\n else {\n _this.executeImpl().then(function () { return resolve(); }).catch(reject);\n }\n });\n };\n ODataBatch.prototype.executeImpl = function () {\n var _this = this;\n if (this._requests.length < 1) {\n return new Promise(function (r) { return r(); });\n }\n var batchBody = [];\n var currentChangeSetId = \"\";\n this._requests.forEach(function (reqInfo, index) {\n if (reqInfo.method === \"GET\") {\n if (currentChangeSetId.length > 0) {\n batchBody.push(\"--changeset_\" + currentChangeSetId + \"--\\n\\n\");\n currentChangeSetId = \"\";\n }\n batchBody.push(\"--batch_\" + _this._batchId + \"\\n\");\n }\n else {\n if (currentChangeSetId.length < 1) {\n currentChangeSetId = util_1.Util.getGUID();\n batchBody.push(\"--batch_\" + _this._batchId + \"\\n\");\n batchBody.push(\"Content-Type: multipart/mixed; boundary=\\\"changeset_\" + currentChangeSetId + \"\\\"\\n\\n\");\n }\n batchBody.push(\"--changeset_\" + currentChangeSetId + \"\\n\");\n }\n batchBody.push(\"Content-Type: application/http\\n\");\n batchBody.push(\"Content-Transfer-Encoding: binary\\n\\n\");\n var headers = {\n \"Accept\": \"application/json;\",\n };\n if (reqInfo.method !== \"GET\") {\n var method = reqInfo.method;\n if (reqInfo.options && reqInfo.options.headers && reqInfo.options.headers[\"X-HTTP-Method\"] !== typeof undefined) {\n method = reqInfo.options.headers[\"X-HTTP-Method\"];\n delete reqInfo.options.headers[\"X-HTTP-Method\"];\n }\n batchBody.push(method + \" \" + reqInfo.url + \" HTTP/1.1\\n\");\n headers = util_1.Util.extend(headers, { \"Content-Type\": \"application/json;odata=verbose;charset=utf-8\" });\n }\n else {\n batchBody.push(reqInfo.method + \" \" + reqInfo.url + \" HTTP/1.1\\n\");\n }\n if (typeof pnplibconfig_1.RuntimeConfig.headers !== \"undefined\") {\n headers = util_1.Util.extend(headers, pnplibconfig_1.RuntimeConfig.headers);\n }\n if (reqInfo.options && reqInfo.options.headers) {\n headers = util_1.Util.extend(headers, reqInfo.options.headers);\n }\n for (var name_1 in headers) {\n if (headers.hasOwnProperty(name_1)) {\n batchBody.push(name_1 + \": \" + headers[name_1] + \"\\n\");\n }\n }\n batchBody.push(\"\\n\");\n if (reqInfo.options.body) {\n batchBody.push(reqInfo.options.body + \"\\n\\n\");\n }\n });\n if (currentChangeSetId.length > 0) {\n batchBody.push(\"--changeset_\" + currentChangeSetId + \"--\\n\\n\");\n currentChangeSetId = \"\";\n }\n batchBody.push(\"--batch_\" + this._batchId + \"--\\n\");\n var batchHeaders = {\n \"Content-Type\": \"multipart/mixed; boundary=batch_\" + this._batchId,\n };\n var batchOptions = {\n \"body\": batchBody.join(\"\"),\n \"headers\": batchHeaders,\n };\n var client = new httpclient_1.HttpClient();\n return client.post(util_1.Util.makeUrlAbsolute(\"/_api/$batch\"), batchOptions)\n .then(function (r) { return r.text(); })\n .then(this._parseResponse)\n .then(function (responses) {\n if (responses.length !== _this._requests.length) {\n throw new Error(\"Could not properly parse responses to match requests in batch.\");\n }\n var resolutions = [];\n for (var i = 0; i < responses.length; i++) {\n var request = _this._requests[i];\n var response = responses[i];\n if (!response.ok) {\n request.reject(new Error(response.statusText));\n }\n resolutions.push(request.parser.parse(response).then(request.resolve).catch(request.reject));\n }\n return Promise.all(resolutions);\n });\n };\n ODataBatch.prototype._parseResponse = function (body) {\n return new Promise(function (resolve, reject) {\n var responses = [];\n var header = \"--batchresponse_\";\n var statusRegExp = new RegExp(\"^HTTP/[0-9.]+ +([0-9]+) +(.*)\", \"i\");\n var lines = body.split(\"\\n\");\n var state = \"batch\";\n var status;\n var statusText;\n for (var i = 0; i < lines.length; ++i) {\n var line = lines[i];\n switch (state) {\n case \"batch\":\n if (line.substr(0, header.length) === header) {\n state = \"batchHeaders\";\n }\n else {\n if (line.trim() !== \"\") {\n throw new Error(\"Invalid response, line \" + i);\n }\n }\n break;\n case \"batchHeaders\":\n if (line.trim() === \"\") {\n state = \"status\";\n }\n break;\n case \"status\":\n var parts = statusRegExp.exec(line);\n if (parts.length !== 3) {\n throw new Error(\"Invalid status, line \" + i);\n }\n status = parseInt(parts[1], 10);\n statusText = parts[2];\n state = \"statusHeaders\";\n break;\n case \"statusHeaders\":\n if (line.trim() === \"\") {\n state = \"body\";\n }\n break;\n case \"body\":\n var response = void 0;\n if (status === 204) {\n response = new Response();\n }\n else {\n response = new Response(line, { status: status, statusText: statusText });\n }\n responses.push(response);\n state = \"batch\";\n break;\n }\n }\n if (state !== \"status\") {\n reject(new Error(\"Unexpected end of input\"));\n }\n resolve(responses);\n });\n };\n return ODataBatch;\n}());\nexports.ODataBatch = ODataBatch;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar util_1 = require(\"../../utils/util\");\nvar collections_1 = require(\"../../collections/collections\");\nvar httpclient_1 = require(\"../../net/httpclient\");\nvar odata_1 = require(\"./odata\");\nvar caching_1 = require(\"./caching\");\nvar pnplibconfig_1 = require(\"../../configuration/pnplibconfig\");\nvar Queryable = (function () {\n function Queryable(baseUrl, path) {\n this._query = new collections_1.Dictionary();\n this._batch = null;\n if (typeof baseUrl === \"string\") {\n var urlStr = baseUrl;\n if (urlStr.lastIndexOf(\"/\") < 0) {\n this._parentUrl = urlStr;\n this._url = util_1.Util.combinePaths(urlStr, path);\n }\n else if (urlStr.lastIndexOf(\"/\") > urlStr.lastIndexOf(\"(\")) {\n var index = urlStr.lastIndexOf(\"/\");\n this._parentUrl = urlStr.slice(0, index);\n path = util_1.Util.combinePaths(urlStr.slice(index), path);\n this._url = util_1.Util.combinePaths(this._parentUrl, path);\n }\n else {\n var index = urlStr.lastIndexOf(\"(\");\n this._parentUrl = urlStr.slice(0, index);\n this._url = util_1.Util.combinePaths(urlStr, path);\n }\n }\n else {\n var q = baseUrl;\n this._parentUrl = q._url;\n if (!this.hasBatch && q.hasBatch) {\n this._batch = q._batch;\n }\n var target = q._query.get(\"@target\");\n if (target !== null) {\n this._query.add(\"@target\", target);\n }\n this._url = util_1.Util.combinePaths(this._parentUrl, path);\n }\n }\n Queryable.prototype.concat = function (pathPart) {\n this._url += pathPart;\n };\n Queryable.prototype.append = function (pathPart) {\n this._url = util_1.Util.combinePaths(this._url, pathPart);\n };\n Queryable.prototype.addBatchDependency = function () {\n if (this._batch !== null) {\n this._batch.incrementBatchDep();\n }\n };\n Queryable.prototype.clearBatchDependency = function () {\n if (this._batch !== null) {\n this._batch.decrementBatchDep();\n }\n };\n Object.defineProperty(Queryable.prototype, \"hasBatch\", {\n get: function () {\n return this._batch !== null;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Queryable.prototype, \"parentUrl\", {\n get: function () {\n return this._parentUrl;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Queryable.prototype, \"query\", {\n get: function () {\n return this._query;\n },\n enumerable: true,\n configurable: true\n });\n Queryable.prototype.inBatch = function (batch) {\n if (this._batch !== null) {\n throw new Error(\"This query is already part of a batch.\");\n }\n this._batch = batch;\n return this;\n };\n Queryable.prototype.usingCaching = function (options) {\n if (!pnplibconfig_1.RuntimeConfig.globalCacheDisable) {\n this._useCaching = true;\n this._cachingOptions = options;\n }\n return this;\n };\n Queryable.prototype.toUrl = function () {\n return util_1.Util.makeUrlAbsolute(this._url);\n };\n Queryable.prototype.toUrlAndQuery = function () {\n var _this = this;\n var url = this.toUrl();\n if (this._query.count() > 0) {\n url += \"?\";\n var keys = this._query.getKeys();\n url += keys.map(function (key, ix, arr) { return (key + \"=\" + _this._query.get(key)); }).join(\"&\");\n }\n return url;\n };\n Queryable.prototype.get = function (parser, getOptions) {\n if (parser === void 0) { parser = new odata_1.ODataDefaultParser(); }\n if (getOptions === void 0) { getOptions = {}; }\n return this.getImpl(getOptions, parser);\n };\n Queryable.prototype.getAs = function (parser, getOptions) {\n if (parser === void 0) { parser = new odata_1.ODataDefaultParser(); }\n if (getOptions === void 0) { getOptions = {}; }\n return this.getImpl(getOptions, parser);\n };\n Queryable.prototype.post = function (postOptions, parser) {\n if (postOptions === void 0) { postOptions = {}; }\n if (parser === void 0) { parser = new odata_1.ODataDefaultParser(); }\n return this.postImpl(postOptions, parser);\n };\n Queryable.prototype.postAs = function (postOptions, parser) {\n if (postOptions === void 0) { postOptions = {}; }\n if (parser === void 0) { parser = new odata_1.ODataDefaultParser(); }\n return this.postImpl(postOptions, parser);\n };\n Queryable.prototype.getParent = function (factory, baseUrl, path) {\n if (baseUrl === void 0) { baseUrl = this.parentUrl; }\n var parent = new factory(baseUrl, path);\n var target = this.query.get(\"@target\");\n if (target !== null) {\n parent.query.add(\"@target\", target);\n }\n return parent;\n };\n Queryable.prototype.getImpl = function (getOptions, parser) {\n if (getOptions === void 0) { getOptions = {}; }\n if (this._useCaching) {\n var options = new caching_1.CachingOptions(this.toUrlAndQuery().toLowerCase());\n if (typeof this._cachingOptions !== \"undefined\") {\n options = util_1.Util.extend(options, this._cachingOptions);\n }\n if (options.store !== null) {\n var data_1 = options.store.get(options.key);\n if (data_1 !== null) {\n return new Promise(function (resolve) { return resolve(data_1); });\n }\n }\n parser = new caching_1.CachingParserWrapper(parser, options);\n }\n if (this._batch === null) {\n var client = new httpclient_1.HttpClient();\n return client.get(this.toUrlAndQuery(), getOptions).then(function (response) {\n if (!response.ok) {\n throw \"Error making GET request: \" + response.statusText;\n }\n return parser.parse(response);\n });\n }\n else {\n return this._batch.add(this.toUrlAndQuery(), \"GET\", {}, parser);\n }\n };\n Queryable.prototype.postImpl = function (postOptions, parser) {\n if (this._batch === null) {\n var client = new httpclient_1.HttpClient();\n return client.post(this.toUrlAndQuery(), postOptions).then(function (response) {\n if (!response.ok) {\n throw \"Error making POST request: \" + response.statusText;\n }\n if ((response.headers.has(\"Content-Length\") && parseFloat(response.headers.get(\"Content-Length\")) === 0)\n || response.status === 204) {\n return new Promise(function (resolve, reject) { resolve({}); });\n }\n return parser.parse(response);\n });\n }\n else {\n return this._batch.add(this.toUrlAndQuery(), \"POST\", postOptions, parser);\n }\n };\n return Queryable;\n}());\nexports.Queryable = Queryable;\nvar QueryableCollection = (function (_super) {\n __extends(QueryableCollection, _super);\n function QueryableCollection() {\n _super.apply(this, arguments);\n }\n QueryableCollection.prototype.filter = function (filter) {\n this._query.add(\"$filter\", filter);\n return this;\n };\n QueryableCollection.prototype.select = function () {\n var selects = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n selects[_i - 0] = arguments[_i];\n }\n this._query.add(\"$select\", selects.join(\",\"));\n return this;\n };\n QueryableCollection.prototype.expand = function () {\n var expands = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n expands[_i - 0] = arguments[_i];\n }\n this._query.add(\"$expand\", expands.join(\",\"));\n return this;\n };\n QueryableCollection.prototype.orderBy = function (orderBy, ascending) {\n if (ascending === void 0) { ascending = true; }\n var keys = this._query.getKeys();\n var query = [];\n var asc = ascending ? \" asc\" : \" desc\";\n for (var i = 0; i < keys.length; i++) {\n if (keys[i] === \"$orderby\") {\n query.push(this._query.get(\"$orderby\"));\n break;\n }\n }\n query.push(\"\" + orderBy + asc);\n this._query.add(\"$orderby\", query.join(\",\"));\n return this;\n };\n QueryableCollection.prototype.skip = function (skip) {\n this._query.add(\"$skip\", skip.toString());\n return this;\n };\n QueryableCollection.prototype.top = function (top) {\n this._query.add(\"$top\", top.toString());\n return this;\n };\n return QueryableCollection;\n}(Queryable));\nexports.QueryableCollection = QueryableCollection;\nvar QueryableInstance = (function (_super) {\n __extends(QueryableInstance, _super);\n function QueryableInstance() {\n _super.apply(this, arguments);\n }\n QueryableInstance.prototype.select = function () {\n var selects = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n selects[_i - 0] = arguments[_i];\n }\n this._query.add(\"$select\", selects.join(\",\"));\n return this;\n };\n QueryableInstance.prototype.expand = function () {\n var expands = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n expands[_i - 0] = arguments[_i];\n }\n this._query.add(\"$expand\", expands.join(\",\"));\n return this;\n };\n return QueryableInstance;\n}(Queryable));\nexports.QueryableInstance = QueryableInstance;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar roles_1 = require(\"./roles\");\nvar queryable_1 = require(\"./queryable\");\nvar QueryableSecurable = (function (_super) {\n __extends(QueryableSecurable, _super);\n function QueryableSecurable() {\n _super.apply(this, arguments);\n }\n Object.defineProperty(QueryableSecurable.prototype, \"roleAssignments\", {\n get: function () {\n return new roles_1.RoleAssignments(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(QueryableSecurable.prototype, \"firstUniqueAncestorSecurableObject\", {\n get: function () {\n this.append(\"FirstUniqueAncestorSecurableObject\");\n return new queryable_1.QueryableInstance(this);\n },\n enumerable: true,\n configurable: true\n });\n QueryableSecurable.prototype.getUserEffectivePermissions = function (loginName) {\n this.append(\"getUserEffectivePermissions(@user)\");\n this._query.add(\"@user\", \"'\" + encodeURIComponent(loginName) + \"'\");\n return new queryable_1.Queryable(this);\n };\n QueryableSecurable.prototype.breakRoleInheritance = function (copyRoleAssignments, clearSubscopes) {\n if (copyRoleAssignments === void 0) { copyRoleAssignments = false; }\n if (clearSubscopes === void 0) { clearSubscopes = false; }\n var Breaker = (function (_super) {\n __extends(Breaker, _super);\n function Breaker(baseUrl, copy, clear) {\n _super.call(this, baseUrl, \"breakroleinheritance(copyroleassignments=\" + copy + \", clearsubscopes=\" + clear + \")\");\n }\n Breaker.prototype.break = function () {\n return this.post();\n };\n return Breaker;\n }(queryable_1.Queryable));\n var b = new Breaker(this, copyRoleAssignments, clearSubscopes);\n return b.break();\n };\n QueryableSecurable.prototype.resetRoleInheritance = function () {\n var Resetter = (function (_super) {\n __extends(Resetter, _super);\n function Resetter(baseUrl) {\n _super.call(this, baseUrl, \"resetroleinheritance\");\n }\n Resetter.prototype.reset = function () {\n return this.post();\n };\n return Resetter;\n }(queryable_1.Queryable));\n var r = new Resetter(this);\n return r.reset();\n };\n return QueryableSecurable;\n}(queryable_1.QueryableInstance));\nexports.QueryableSecurable = QueryableSecurable;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar QuickLaunch = (function (_super) {\n __extends(QuickLaunch, _super);\n function QuickLaunch(baseUrl) {\n _super.call(this, baseUrl, \"QuickLaunch\");\n }\n return QuickLaunch;\n}(queryable_1.Queryable));\nexports.QuickLaunch = QuickLaunch;\n","\"use strict\";\nvar search_1 = require(\"./search\");\nvar site_1 = require(\"./site\");\nvar webs_1 = require(\"./webs\");\nvar util_1 = require(\"../../utils/util\");\nvar userprofiles_1 = require(\"./userprofiles\");\nvar odata_1 = require(\"./odata\");\nvar Rest = (function () {\n function Rest() {\n }\n Rest.prototype.search = function (query) {\n var finalQuery;\n if (typeof query === \"string\") {\n finalQuery = { Querytext: query };\n }\n else {\n finalQuery = query;\n }\n return new search_1.Search(\"\").execute(finalQuery);\n };\n Object.defineProperty(Rest.prototype, \"site\", {\n get: function () {\n return new site_1.Site(\"\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Rest.prototype, \"web\", {\n get: function () {\n return new webs_1.Web(\"\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Rest.prototype, \"profiles\", {\n get: function () {\n return new userprofiles_1.UserProfileQuery(\"\");\n },\n enumerable: true,\n configurable: true\n });\n Rest.prototype.createBatch = function () {\n return new odata_1.ODataBatch();\n };\n Rest.prototype.crossDomainSite = function (addInWebUrl, hostWebUrl) {\n return this._cdImpl(site_1.Site, addInWebUrl, hostWebUrl, \"site\");\n };\n Rest.prototype.crossDomainWeb = function (addInWebUrl, hostWebUrl) {\n return this._cdImpl(webs_1.Web, addInWebUrl, hostWebUrl, \"web\");\n };\n Rest.prototype._cdImpl = function (factory, addInWebUrl, hostWebUrl, urlPart) {\n if (!util_1.Util.isUrlAbsolute(addInWebUrl)) {\n throw \"The addInWebUrl parameter must be an absolute url.\";\n }\n if (!util_1.Util.isUrlAbsolute(hostWebUrl)) {\n throw \"The hostWebUrl parameter must be an absolute url.\";\n }\n var url = util_1.Util.combinePaths(addInWebUrl, \"_api/SP.AppContextSite(@target)\");\n var instance = new factory(url, urlPart);\n instance.query.add(\"@target\", \"'\" + encodeURIComponent(hostWebUrl) + \"'\");\n return instance;\n };\n return Rest;\n}());\nexports.Rest = Rest;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar sitegroups_1 = require(\"./sitegroups\");\nvar util_1 = require(\"../../utils/util\");\nvar RoleAssignments = (function (_super) {\n __extends(RoleAssignments, _super);\n function RoleAssignments(baseUrl, path) {\n if (path === void 0) { path = \"roleassignments\"; }\n _super.call(this, baseUrl, path);\n }\n RoleAssignments.prototype.add = function (principalId, roleDefId) {\n var a = new RoleAssignments(this, \"addroleassignment(principalid=\" + principalId + \", roledefid=\" + roleDefId + \")\");\n return a.post();\n };\n RoleAssignments.prototype.remove = function (principalId, roleDefId) {\n var a = new RoleAssignments(this, \"removeroleassignment(principalid=\" + principalId + \", roledefid=\" + roleDefId + \")\");\n return a.post();\n };\n RoleAssignments.prototype.getById = function (id) {\n var ra = new RoleAssignment(this);\n ra.concat(\"(\" + id + \")\");\n return ra;\n };\n return RoleAssignments;\n}(queryable_1.QueryableCollection));\nexports.RoleAssignments = RoleAssignments;\nvar RoleAssignment = (function (_super) {\n __extends(RoleAssignment, _super);\n function RoleAssignment(baseUrl, path) {\n _super.call(this, baseUrl, path);\n }\n Object.defineProperty(RoleAssignment.prototype, \"groups\", {\n get: function () {\n return new sitegroups_1.SiteGroups(this, \"groups\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RoleAssignment.prototype, \"bindings\", {\n get: function () {\n return new RoleDefinitionBindings(this);\n },\n enumerable: true,\n configurable: true\n });\n RoleAssignment.prototype.delete = function () {\n return this.post({\n headers: {\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n return RoleAssignment;\n}(queryable_1.QueryableInstance));\nexports.RoleAssignment = RoleAssignment;\nvar RoleDefinitions = (function (_super) {\n __extends(RoleDefinitions, _super);\n function RoleDefinitions(baseUrl, path) {\n if (path === void 0) { path = \"roledefinitions\"; }\n _super.call(this, baseUrl, path);\n }\n RoleDefinitions.prototype.getById = function (id) {\n return new RoleDefinition(this, \"getById(\" + id + \")\");\n };\n RoleDefinitions.prototype.getByName = function (name) {\n return new RoleDefinition(this, \"getbyname('\" + name + \"')\");\n };\n RoleDefinitions.prototype.getByType = function (roleTypeKind) {\n return new RoleDefinition(this, \"getbytype(\" + roleTypeKind + \")\");\n };\n RoleDefinitions.prototype.add = function (name, description, order, basePermissions) {\n var _this = this;\n var postBody = JSON.stringify({\n BasePermissions: util_1.Util.extend({ __metadata: { type: \"SP.BasePermissions\" } }, basePermissions),\n Description: description,\n Name: name,\n Order: order,\n __metadata: { \"type\": \"SP.RoleDefinition\" },\n });\n return this.post({ body: postBody }).then(function (data) {\n return {\n data: data,\n definition: _this.getById(data.Id),\n };\n });\n };\n return RoleDefinitions;\n}(queryable_1.QueryableCollection));\nexports.RoleDefinitions = RoleDefinitions;\nvar RoleDefinition = (function (_super) {\n __extends(RoleDefinition, _super);\n function RoleDefinition(baseUrl, path) {\n _super.call(this, baseUrl, path);\n }\n RoleDefinition.prototype.update = function (properties) {\n var _this = this;\n if (typeof properties.hasOwnProperty(\"BasePermissions\") !== \"undefined\") {\n properties[\"BasePermissions\"] = util_1.Util.extend({ __metadata: { type: \"SP.BasePermissions\" } }, properties[\"BasePermissions\"]);\n }\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": \"SP.RoleDefinition\" },\n }, properties));\n return this.post({\n body: postBody,\n headers: {\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n var retDef = _this;\n if (properties.hasOwnProperty(\"Name\")) {\n var parent_1 = _this.getParent(RoleDefinitions, _this.parentUrl, \"\");\n retDef = parent_1.getByName(properties[\"Name\"]);\n }\n return {\n data: data,\n definition: retDef,\n };\n });\n };\n RoleDefinition.prototype.delete = function () {\n return this.post({\n headers: {\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n return RoleDefinition;\n}(queryable_1.QueryableInstance));\nexports.RoleDefinition = RoleDefinition;\nvar RoleDefinitionBindings = (function (_super) {\n __extends(RoleDefinitionBindings, _super);\n function RoleDefinitionBindings(baseUrl, path) {\n if (path === void 0) { path = \"roledefinitionbindings\"; }\n _super.call(this, baseUrl, path);\n }\n return RoleDefinitionBindings;\n}(queryable_1.QueryableCollection));\nexports.RoleDefinitionBindings = RoleDefinitionBindings;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar Search = (function (_super) {\n __extends(Search, _super);\n function Search(baseUrl, path) {\n if (path === void 0) { path = \"_api/search/postquery\"; }\n _super.call(this, baseUrl, path);\n }\n Search.prototype.execute = function (query) {\n var formattedBody;\n formattedBody = query;\n if (formattedBody.SelectProperties) {\n formattedBody.SelectProperties = { results: query.SelectProperties };\n }\n if (formattedBody.RefinementFilters) {\n formattedBody.RefinementFilters = { results: query.RefinementFilters };\n }\n if (formattedBody.Refiners) {\n formattedBody.Refiners = { results: query.Refiners };\n }\n if (formattedBody.SortList) {\n formattedBody.SortList = { results: query.SortList };\n }\n if (formattedBody.HithighlightedProperties) {\n formattedBody.HithighlightedProperties = { results: query.HithighlightedProperties };\n }\n if (formattedBody.ReorderingRules) {\n formattedBody.ReorderingRules = { results: query.ReorderingRules };\n }\n var postBody = JSON.stringify({ request: formattedBody });\n return this.post({ body: postBody }).then(function (data) { return new SearchResults(data); });\n };\n return Search;\n}(queryable_1.QueryableInstance));\nexports.Search = Search;\nvar SearchResults = (function () {\n function SearchResults(rawResponse) {\n var response = rawResponse.postquery ? rawResponse.postquery : rawResponse;\n this.PrimarySearchResults = this.formatSearchResults(response.PrimaryQueryResult.RelevantResults.Table.Rows);\n this.RawSearchResults = response;\n this.ElapsedTime = response.ElapsedTime;\n this.RowCount = response.PrimaryQueryResult.RelevantResults.RowCount;\n this.TotalRows = response.PrimaryQueryResult.RelevantResults.TotalRows;\n this.TotalRowsIncludingDuplicates = response.PrimaryQueryResult.RelevantResults.TotalRowsIncludingDuplicates;\n }\n SearchResults.prototype.formatSearchResults = function (rawResults) {\n var results = new Array(), tempResults = rawResults.results ? rawResults.results : rawResults;\n for (var _i = 0, tempResults_1 = tempResults; _i < tempResults_1.length; _i++) {\n var i = tempResults_1[_i];\n results.push(new SearchResult(i.Cells));\n }\n return results;\n };\n return SearchResults;\n}());\nexports.SearchResults = SearchResults;\nvar SearchResult = (function () {\n function SearchResult(rawItem) {\n var item = rawItem.results ? rawItem.results : rawItem;\n for (var _i = 0, item_1 = item; _i < item_1.length; _i++) {\n var i = item_1[_i];\n this[i.Key] = i.Value;\n }\n }\n return SearchResult;\n}());\nexports.SearchResult = SearchResult;\n(function (SortDirection) {\n SortDirection[SortDirection[\"Ascending\"] = 0] = \"Ascending\";\n SortDirection[SortDirection[\"Descending\"] = 1] = \"Descending\";\n SortDirection[SortDirection[\"FQLFormula\"] = 2] = \"FQLFormula\";\n})(exports.SortDirection || (exports.SortDirection = {}));\nvar SortDirection = exports.SortDirection;\n(function (ReorderingRuleMatchType) {\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"ResultContainsKeyword\"] = 0] = \"ResultContainsKeyword\";\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"TitleContainsKeyword\"] = 1] = \"TitleContainsKeyword\";\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"TitleMatchesKeyword\"] = 2] = \"TitleMatchesKeyword\";\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"UrlStartsWith\"] = 3] = \"UrlStartsWith\";\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"UrlExactlyMatches\"] = 4] = \"UrlExactlyMatches\";\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"ContentTypeIs\"] = 5] = \"ContentTypeIs\";\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"FileExtensionMatches\"] = 6] = \"FileExtensionMatches\";\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"ResultHasTag\"] = 7] = \"ResultHasTag\";\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"ManualCondition\"] = 8] = \"ManualCondition\";\n})(exports.ReorderingRuleMatchType || (exports.ReorderingRuleMatchType = {}));\nvar ReorderingRuleMatchType = exports.ReorderingRuleMatchType;\n(function (QueryPropertyValueType) {\n QueryPropertyValueType[QueryPropertyValueType[\"None\"] = 0] = \"None\";\n QueryPropertyValueType[QueryPropertyValueType[\"StringType\"] = 1] = \"StringType\";\n QueryPropertyValueType[QueryPropertyValueType[\"Int32TYpe\"] = 2] = \"Int32TYpe\";\n QueryPropertyValueType[QueryPropertyValueType[\"BooleanType\"] = 3] = \"BooleanType\";\n QueryPropertyValueType[QueryPropertyValueType[\"StringArrayType\"] = 4] = \"StringArrayType\";\n QueryPropertyValueType[QueryPropertyValueType[\"UnSupportedType\"] = 5] = \"UnSupportedType\";\n})(exports.QueryPropertyValueType || (exports.QueryPropertyValueType = {}));\nvar QueryPropertyValueType = exports.QueryPropertyValueType;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar webs_1 = require(\"./webs\");\nvar usercustomactions_1 = require(\"./usercustomactions\");\nvar Site = (function (_super) {\n __extends(Site, _super);\n function Site(baseUrl, path) {\n if (path === void 0) { path = \"_api/site\"; }\n _super.call(this, baseUrl, path);\n }\n Object.defineProperty(Site.prototype, \"rootWeb\", {\n get: function () {\n return new webs_1.Web(this, \"rootweb\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Site.prototype, \"userCustomActions\", {\n get: function () {\n return new usercustomactions_1.UserCustomActions(this);\n },\n enumerable: true,\n configurable: true\n });\n Site.prototype.getContextInfo = function () {\n var q = new Site(\"\", \"_api/contextinfo\");\n return q.post().then(function (data) {\n if (data.hasOwnProperty(\"GetContextWebInformation\")) {\n var info = data.GetContextWebInformation;\n info.SupportedSchemaVersions = info.SupportedSchemaVersions.results;\n return info;\n }\n else {\n return data;\n }\n });\n };\n Site.prototype.getDocumentLibraries = function (absoluteWebUrl) {\n var q = new queryable_1.Queryable(\"\", \"_api/sp.web.getdocumentlibraries(@v)\");\n q.query.add(\"@v\", \"'\" + absoluteWebUrl + \"'\");\n return q.get().then(function (data) {\n if (data.hasOwnProperty(\"GetDocumentLibraries\")) {\n return data.GetDocumentLibraries;\n }\n else {\n return data;\n }\n });\n };\n Site.prototype.getWebUrlFromPageUrl = function (absolutePageUrl) {\n var q = new queryable_1.Queryable(\"\", \"_api/sp.web.getweburlfrompageurl(@v)\");\n q.query.add(\"@v\", \"'\" + absolutePageUrl + \"'\");\n return q.get().then(function (data) {\n if (data.hasOwnProperty(\"GetWebUrlFromPageUrl\")) {\n return data.GetWebUrlFromPageUrl;\n }\n else {\n return data;\n }\n });\n };\n return Site;\n}(queryable_1.QueryableInstance));\nexports.Site = Site;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar siteusers_1 = require(\"./siteusers\");\nvar util_1 = require(\"../../utils/util\");\n(function (PrincipalType) {\n PrincipalType[PrincipalType[\"None\"] = 0] = \"None\";\n PrincipalType[PrincipalType[\"User\"] = 1] = \"User\";\n PrincipalType[PrincipalType[\"DistributionList\"] = 2] = \"DistributionList\";\n PrincipalType[PrincipalType[\"SecurityGroup\"] = 4] = \"SecurityGroup\";\n PrincipalType[PrincipalType[\"SharePointGroup\"] = 8] = \"SharePointGroup\";\n PrincipalType[PrincipalType[\"All\"] = 15] = \"All\";\n})(exports.PrincipalType || (exports.PrincipalType = {}));\nvar PrincipalType = exports.PrincipalType;\nvar SiteGroups = (function (_super) {\n __extends(SiteGroups, _super);\n function SiteGroups(baseUrl, path) {\n if (path === void 0) { path = \"sitegroups\"; }\n _super.call(this, baseUrl, path);\n }\n SiteGroups.prototype.add = function (properties) {\n var _this = this;\n var postBody = JSON.stringify(util_1.Util.extend({ \"__metadata\": { \"type\": \"SP.Group\" } }, properties));\n return this.post({ body: postBody }).then(function (data) {\n return {\n data: data,\n group: _this.getById(data.Id),\n };\n });\n };\n SiteGroups.prototype.getByName = function (groupName) {\n return new SiteGroup(this, \"getByName('\" + groupName + \"')\");\n };\n SiteGroups.prototype.getById = function (id) {\n var sg = new SiteGroup(this);\n sg.concat(\"(\" + id + \")\");\n return sg;\n };\n SiteGroups.prototype.removeById = function (id) {\n var g = new SiteGroups(this, \"removeById('\" + id + \"')\");\n return g.post();\n };\n SiteGroups.prototype.removeByLoginName = function (loginName) {\n var g = new SiteGroups(this, \"removeByLoginName('\" + loginName + \"')\");\n return g.post();\n };\n return SiteGroups;\n}(queryable_1.QueryableCollection));\nexports.SiteGroups = SiteGroups;\nvar SiteGroup = (function (_super) {\n __extends(SiteGroup, _super);\n function SiteGroup(baseUrl, path) {\n _super.call(this, baseUrl, path);\n }\n Object.defineProperty(SiteGroup.prototype, \"users\", {\n get: function () {\n return new siteusers_1.SiteUsers(this, \"users\");\n },\n enumerable: true,\n configurable: true\n });\n SiteGroup.prototype.update = function (properties) {\n var _this = this;\n var postBody = util_1.Util.extend({ \"__metadata\": { \"type\": \"SP.Group\" } }, properties);\n return this.post({\n body: JSON.stringify(postBody),\n headers: {\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n var retGroup = _this;\n if (properties.hasOwnProperty(\"Title\")) {\n retGroup = _this.getParent(SiteGroup, _this.parentUrl, \"getByName('\" + properties[\"Title\"] + \"')\");\n }\n return {\n data: data,\n group: retGroup,\n };\n });\n };\n return SiteGroup;\n}(queryable_1.QueryableInstance));\nexports.SiteGroup = SiteGroup;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar sitegroups_1 = require(\"./sitegroups\");\nvar util_1 = require(\"../../utils/util\");\nvar SiteUsers = (function (_super) {\n __extends(SiteUsers, _super);\n function SiteUsers(baseUrl, path) {\n if (path === void 0) { path = \"siteusers\"; }\n _super.call(this, baseUrl, path);\n }\n SiteUsers.prototype.getByEmail = function (email) {\n return new SiteUser(this, \"getByEmail('\" + email + \"')\");\n };\n SiteUsers.prototype.getById = function (id) {\n return new SiteUser(this, \"getById(\" + id + \")\");\n };\n SiteUsers.prototype.getByLoginName = function (loginName) {\n var su = new SiteUser(this);\n su.concat(\"(@v)\");\n su.query.add(\"@v\", encodeURIComponent(loginName));\n return su;\n };\n SiteUsers.prototype.removeById = function (id) {\n var o = new SiteUsers(this, \"removeById(\" + id + \")\");\n return o.post();\n };\n SiteUsers.prototype.removeByLoginName = function (loginName) {\n var o = new SiteUsers(this, \"removeByLoginName(@v)\");\n o.query.add(\"@v\", encodeURIComponent(loginName));\n return o.post();\n };\n SiteUsers.prototype.add = function (loginName) {\n var _this = this;\n var postBody = JSON.stringify({ \"__metadata\": { \"type\": \"SP.User\" }, LoginName: loginName });\n return this.post({ body: postBody }).then(function (data) { return _this.getByLoginName(loginName); });\n };\n return SiteUsers;\n}(queryable_1.QueryableCollection));\nexports.SiteUsers = SiteUsers;\nvar SiteUser = (function (_super) {\n __extends(SiteUser, _super);\n function SiteUser(baseUrl, path) {\n _super.call(this, baseUrl, path);\n }\n Object.defineProperty(SiteUser.prototype, \"groups\", {\n get: function () {\n return new sitegroups_1.SiteGroups(this, \"groups\");\n },\n enumerable: true,\n configurable: true\n });\n SiteUser.prototype.update = function (properties) {\n var _this = this;\n var postBody = util_1.Util.extend({ \"__metadata\": { \"type\": \"SP.User\" } }, properties);\n return this.post({\n body: JSON.stringify(postBody),\n headers: {\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n return {\n data: data,\n user: _this,\n };\n });\n };\n SiteUser.prototype.delete = function () {\n return this.post({\n headers: {\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n return SiteUser;\n}(queryable_1.QueryableInstance));\nexports.SiteUser = SiteUser;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar TopNavigationBar = (function (_super) {\n __extends(TopNavigationBar, _super);\n function TopNavigationBar(baseUrl) {\n _super.call(this, baseUrl, \"TopNavigationBar\");\n }\n return TopNavigationBar;\n}(queryable_1.QueryableInstance));\nexports.TopNavigationBar = TopNavigationBar;\n","\"use strict\";\n(function (ControlMode) {\n ControlMode[ControlMode[\"Display\"] = 1] = \"Display\";\n ControlMode[ControlMode[\"Edit\"] = 2] = \"Edit\";\n ControlMode[ControlMode[\"New\"] = 3] = \"New\";\n})(exports.ControlMode || (exports.ControlMode = {}));\nvar ControlMode = exports.ControlMode;\n(function (FieldTypes) {\n FieldTypes[FieldTypes[\"Invalid\"] = 0] = \"Invalid\";\n FieldTypes[FieldTypes[\"Integer\"] = 1] = \"Integer\";\n FieldTypes[FieldTypes[\"Text\"] = 2] = \"Text\";\n FieldTypes[FieldTypes[\"Note\"] = 3] = \"Note\";\n FieldTypes[FieldTypes[\"DateTime\"] = 4] = \"DateTime\";\n FieldTypes[FieldTypes[\"Counter\"] = 5] = \"Counter\";\n FieldTypes[FieldTypes[\"Choice\"] = 6] = \"Choice\";\n FieldTypes[FieldTypes[\"Lookup\"] = 7] = \"Lookup\";\n FieldTypes[FieldTypes[\"Boolean\"] = 8] = \"Boolean\";\n FieldTypes[FieldTypes[\"Number\"] = 9] = \"Number\";\n FieldTypes[FieldTypes[\"Currency\"] = 10] = \"Currency\";\n FieldTypes[FieldTypes[\"URL\"] = 11] = \"URL\";\n FieldTypes[FieldTypes[\"Computed\"] = 12] = \"Computed\";\n FieldTypes[FieldTypes[\"Threading\"] = 13] = \"Threading\";\n FieldTypes[FieldTypes[\"Guid\"] = 14] = \"Guid\";\n FieldTypes[FieldTypes[\"MultiChoice\"] = 15] = \"MultiChoice\";\n FieldTypes[FieldTypes[\"GridChoice\"] = 16] = \"GridChoice\";\n FieldTypes[FieldTypes[\"Calculated\"] = 17] = \"Calculated\";\n FieldTypes[FieldTypes[\"File\"] = 18] = \"File\";\n FieldTypes[FieldTypes[\"Attachments\"] = 19] = \"Attachments\";\n FieldTypes[FieldTypes[\"User\"] = 20] = \"User\";\n FieldTypes[FieldTypes[\"Recurrence\"] = 21] = \"Recurrence\";\n FieldTypes[FieldTypes[\"CrossProjectLink\"] = 22] = \"CrossProjectLink\";\n FieldTypes[FieldTypes[\"ModStat\"] = 23] = \"ModStat\";\n FieldTypes[FieldTypes[\"Error\"] = 24] = \"Error\";\n FieldTypes[FieldTypes[\"ContentTypeId\"] = 25] = \"ContentTypeId\";\n FieldTypes[FieldTypes[\"PageSeparator\"] = 26] = \"PageSeparator\";\n FieldTypes[FieldTypes[\"ThreadIndex\"] = 27] = \"ThreadIndex\";\n FieldTypes[FieldTypes[\"WorkflowStatus\"] = 28] = \"WorkflowStatus\";\n FieldTypes[FieldTypes[\"AllDayEvent\"] = 29] = \"AllDayEvent\";\n FieldTypes[FieldTypes[\"WorkflowEventType\"] = 30] = \"WorkflowEventType\";\n})(exports.FieldTypes || (exports.FieldTypes = {}));\nvar FieldTypes = exports.FieldTypes;\n(function (DateTimeFieldFormatType) {\n DateTimeFieldFormatType[DateTimeFieldFormatType[\"DateOnly\"] = 0] = \"DateOnly\";\n DateTimeFieldFormatType[DateTimeFieldFormatType[\"DateTime\"] = 1] = \"DateTime\";\n})(exports.DateTimeFieldFormatType || (exports.DateTimeFieldFormatType = {}));\nvar DateTimeFieldFormatType = exports.DateTimeFieldFormatType;\n(function (AddFieldOptions) {\n AddFieldOptions[AddFieldOptions[\"DefaultValue\"] = 0] = \"DefaultValue\";\n AddFieldOptions[AddFieldOptions[\"AddToDefaultContentType\"] = 1] = \"AddToDefaultContentType\";\n AddFieldOptions[AddFieldOptions[\"AddToNoContentType\"] = 2] = \"AddToNoContentType\";\n AddFieldOptions[AddFieldOptions[\"AddToAllContentTypes\"] = 4] = \"AddToAllContentTypes\";\n AddFieldOptions[AddFieldOptions[\"AddFieldInternalNameHint\"] = 8] = \"AddFieldInternalNameHint\";\n AddFieldOptions[AddFieldOptions[\"AddFieldToDefaultView\"] = 16] = \"AddFieldToDefaultView\";\n AddFieldOptions[AddFieldOptions[\"AddFieldCheckDisplayName\"] = 32] = \"AddFieldCheckDisplayName\";\n})(exports.AddFieldOptions || (exports.AddFieldOptions = {}));\nvar AddFieldOptions = exports.AddFieldOptions;\n(function (CalendarType) {\n CalendarType[CalendarType[\"Gregorian\"] = 1] = \"Gregorian\";\n CalendarType[CalendarType[\"Japan\"] = 3] = \"Japan\";\n CalendarType[CalendarType[\"Taiwan\"] = 4] = \"Taiwan\";\n CalendarType[CalendarType[\"Korea\"] = 5] = \"Korea\";\n CalendarType[CalendarType[\"Hijri\"] = 6] = \"Hijri\";\n CalendarType[CalendarType[\"Thai\"] = 7] = \"Thai\";\n CalendarType[CalendarType[\"Hebrew\"] = 8] = \"Hebrew\";\n CalendarType[CalendarType[\"GregorianMEFrench\"] = 9] = \"GregorianMEFrench\";\n CalendarType[CalendarType[\"GregorianArabic\"] = 10] = \"GregorianArabic\";\n CalendarType[CalendarType[\"GregorianXLITEnglish\"] = 11] = \"GregorianXLITEnglish\";\n CalendarType[CalendarType[\"GregorianXLITFrench\"] = 12] = \"GregorianXLITFrench\";\n CalendarType[CalendarType[\"KoreaJapanLunar\"] = 14] = \"KoreaJapanLunar\";\n CalendarType[CalendarType[\"ChineseLunar\"] = 15] = \"ChineseLunar\";\n CalendarType[CalendarType[\"SakaEra\"] = 16] = \"SakaEra\";\n CalendarType[CalendarType[\"UmAlQura\"] = 23] = \"UmAlQura\";\n})(exports.CalendarType || (exports.CalendarType = {}));\nvar CalendarType = exports.CalendarType;\n(function (UrlFieldFormatType) {\n UrlFieldFormatType[UrlFieldFormatType[\"Hyperlink\"] = 0] = \"Hyperlink\";\n UrlFieldFormatType[UrlFieldFormatType[\"Image\"] = 1] = \"Image\";\n})(exports.UrlFieldFormatType || (exports.UrlFieldFormatType = {}));\nvar UrlFieldFormatType = exports.UrlFieldFormatType;\n(function (PrincipalType) {\n PrincipalType[PrincipalType[\"None\"] = 0] = \"None\";\n PrincipalType[PrincipalType[\"User\"] = 1] = \"User\";\n PrincipalType[PrincipalType[\"DistributionList\"] = 2] = \"DistributionList\";\n PrincipalType[PrincipalType[\"SecurityGroup\"] = 4] = \"SecurityGroup\";\n PrincipalType[PrincipalType[\"SharePointGroup\"] = 8] = \"SharePointGroup\";\n PrincipalType[PrincipalType[\"All\"] = 15] = \"All\";\n})(exports.PrincipalType || (exports.PrincipalType = {}));\nvar PrincipalType = exports.PrincipalType;\n(function (PageType) {\n PageType[PageType[\"Invalid\"] = -1] = \"Invalid\";\n PageType[PageType[\"DefaultView\"] = 0] = \"DefaultView\";\n PageType[PageType[\"NormalView\"] = 1] = \"NormalView\";\n PageType[PageType[\"DialogView\"] = 2] = \"DialogView\";\n PageType[PageType[\"View\"] = 3] = \"View\";\n PageType[PageType[\"DisplayForm\"] = 4] = \"DisplayForm\";\n PageType[PageType[\"DisplayFormDialog\"] = 5] = \"DisplayFormDialog\";\n PageType[PageType[\"EditForm\"] = 6] = \"EditForm\";\n PageType[PageType[\"EditFormDialog\"] = 7] = \"EditFormDialog\";\n PageType[PageType[\"NewForm\"] = 8] = \"NewForm\";\n PageType[PageType[\"NewFormDialog\"] = 9] = \"NewFormDialog\";\n PageType[PageType[\"SolutionForm\"] = 10] = \"SolutionForm\";\n PageType[PageType[\"PAGE_MAXITEMS\"] = 11] = \"PAGE_MAXITEMS\";\n})(exports.PageType || (exports.PageType = {}));\nvar PageType = exports.PageType;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar util_1 = require(\"../../utils/util\");\nvar UserCustomActions = (function (_super) {\n __extends(UserCustomActions, _super);\n function UserCustomActions(baseUrl, path) {\n if (path === void 0) { path = \"usercustomactions\"; }\n _super.call(this, baseUrl, path);\n }\n UserCustomActions.prototype.getById = function (id) {\n return new UserCustomAction(this, \"(\" + id + \")\");\n };\n UserCustomActions.prototype.add = function (properties) {\n var _this = this;\n var postBody = JSON.stringify(util_1.Util.extend({ __metadata: { \"type\": \"SP.UserCustomAction\" } }, properties));\n return this.post({ body: postBody }).then(function (data) {\n return {\n action: _this.getById(data.Id),\n data: data,\n };\n });\n };\n UserCustomActions.prototype.clear = function () {\n var a = new UserCustomActions(this, \"clear\");\n return a.post();\n };\n return UserCustomActions;\n}(queryable_1.QueryableCollection));\nexports.UserCustomActions = UserCustomActions;\nvar UserCustomAction = (function (_super) {\n __extends(UserCustomAction, _super);\n function UserCustomAction(baseUrl, path) {\n _super.call(this, baseUrl, path);\n }\n UserCustomAction.prototype.update = function (properties) {\n var _this = this;\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": \"SP.UserCustomAction\" },\n }, properties));\n return this.post({\n body: postBody,\n headers: {\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n return {\n action: _this,\n data: data,\n };\n });\n };\n return UserCustomAction;\n}(queryable_1.QueryableInstance));\nexports.UserCustomAction = UserCustomAction;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar FileUtil = require(\"../../utils/files\");\nvar odata_1 = require(\"./odata\");\nvar UserProfileQuery = (function (_super) {\n __extends(UserProfileQuery, _super);\n function UserProfileQuery(baseUrl, path) {\n if (path === void 0) { path = \"_api/sp.userprofiles.peoplemanager\"; }\n _super.call(this, baseUrl, path);\n this.profileLoader = new ProfileLoader(baseUrl);\n }\n Object.defineProperty(UserProfileQuery.prototype, \"editProfileLink\", {\n get: function () {\n var q = new UserProfileQuery(this, \"EditProfileLink\");\n return q.getAs(odata_1.ODataValue());\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(UserProfileQuery.prototype, \"isMyPeopleListPublic\", {\n get: function () {\n var q = new UserProfileQuery(this, \"IsMyPeopleListPublic\");\n return q.getAs(odata_1.ODataValue());\n },\n enumerable: true,\n configurable: true\n });\n UserProfileQuery.prototype.amIFollowedBy = function (loginName) {\n var q = new UserProfileQuery(this, \"amifollowedby(@v)\");\n q.query.add(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\n return q.get();\n };\n UserProfileQuery.prototype.amIFollowing = function (loginName) {\n var q = new UserProfileQuery(this, \"amifollowing(@v)\");\n q.query.add(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\n return q.get();\n };\n UserProfileQuery.prototype.getFollowedTags = function (maxCount) {\n if (maxCount === void 0) { maxCount = 20; }\n var q = new UserProfileQuery(this, \"getfollowedtags(\" + maxCount + \")\");\n return q.get();\n };\n UserProfileQuery.prototype.getFollowersFor = function (loginName) {\n var q = new UserProfileQuery(this, \"getfollowersfor(@v)\");\n q.query.add(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\n return q.get();\n };\n Object.defineProperty(UserProfileQuery.prototype, \"myFollowers\", {\n get: function () {\n return new queryable_1.QueryableCollection(this, \"getmyfollowers\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(UserProfileQuery.prototype, \"myProperties\", {\n get: function () {\n return new UserProfileQuery(this, \"getmyproperties\");\n },\n enumerable: true,\n configurable: true\n });\n UserProfileQuery.prototype.getPeopleFollowedBy = function (loginName) {\n var q = new UserProfileQuery(this, \"getpeoplefollowedby(@v)\");\n q.query.add(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\n return q.get();\n };\n UserProfileQuery.prototype.getPropertiesFor = function (loginName) {\n var q = new UserProfileQuery(this, \"getpropertiesfor(@v)\");\n q.query.add(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\n return q.get();\n };\n Object.defineProperty(UserProfileQuery.prototype, \"trendingTags\", {\n get: function () {\n var q = new UserProfileQuery(this, null);\n q.concat(\".gettrendingtags\");\n return q.get();\n },\n enumerable: true,\n configurable: true\n });\n UserProfileQuery.prototype.getUserProfilePropertyFor = function (loginName, propertyName) {\n var q = new UserProfileQuery(this, \"getuserprofilepropertyfor(accountname=@v, propertyname='\" + propertyName + \"')\");\n q.query.add(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\n return q.get();\n };\n UserProfileQuery.prototype.hideSuggestion = function (loginName) {\n var q = new UserProfileQuery(this, \"hidesuggestion(@v)\");\n q.query.add(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\n return q.post();\n };\n UserProfileQuery.prototype.isFollowing = function (follower, followee) {\n var q = new UserProfileQuery(this, null);\n q.concat(\".isfollowing(possiblefolloweraccountname=@v, possiblefolloweeaccountname=@y)\");\n q.query.add(\"@v\", \"'\" + encodeURIComponent(follower) + \"'\");\n q.query.add(\"@y\", \"'\" + encodeURIComponent(followee) + \"'\");\n return q.get();\n };\n UserProfileQuery.prototype.setMyProfilePic = function (profilePicSource) {\n var _this = this;\n return FileUtil.readBlobAsArrayBuffer(profilePicSource).then(function (buffer) {\n var request = new UserProfileQuery(_this, \"setmyprofilepicture\");\n return request.post({\n body: String.fromCharCode.apply(null, new Uint16Array(buffer)),\n });\n });\n };\n UserProfileQuery.prototype.createPersonalSiteEnqueueBulk = function () {\n var emails = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n emails[_i - 0] = arguments[_i];\n }\n return this.profileLoader.createPersonalSiteEnqueueBulk(emails);\n };\n Object.defineProperty(UserProfileQuery.prototype, \"ownerUserProfile\", {\n get: function () {\n return this.profileLoader.ownerUserProfile;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(UserProfileQuery.prototype, \"userProfile\", {\n get: function () {\n return this.profileLoader.userProfile;\n },\n enumerable: true,\n configurable: true\n });\n UserProfileQuery.prototype.createPersonalSite = function (interactiveRequest) {\n if (interactiveRequest === void 0) { interactiveRequest = false; }\n return this.profileLoader.createPersonalSite(interactiveRequest);\n };\n UserProfileQuery.prototype.shareAllSocialData = function (share) {\n return this.profileLoader.shareAllSocialData(share);\n };\n return UserProfileQuery;\n}(queryable_1.QueryableInstance));\nexports.UserProfileQuery = UserProfileQuery;\nvar ProfileLoader = (function (_super) {\n __extends(ProfileLoader, _super);\n function ProfileLoader(baseUrl, path) {\n if (path === void 0) { path = \"_api/sp.userprofiles.profileloader.getprofileloader\"; }\n _super.call(this, baseUrl, path);\n }\n ProfileLoader.prototype.createPersonalSiteEnqueueBulk = function (emails) {\n var q = new ProfileLoader(this, \"createpersonalsiteenqueuebulk\");\n var postBody = JSON.stringify({ \"emailIDs\": emails });\n return q.post({\n body: postBody,\n });\n };\n Object.defineProperty(ProfileLoader.prototype, \"ownerUserProfile\", {\n get: function () {\n var q = this.getParent(ProfileLoader, this.parentUrl, \"_api/sp.userprofiles.profileloader.getowneruserprofile\");\n return q.postAs();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ProfileLoader.prototype, \"userProfile\", {\n get: function () {\n var q = new ProfileLoader(this, \"getuserprofile\");\n return q.postAs();\n },\n enumerable: true,\n configurable: true\n });\n ProfileLoader.prototype.createPersonalSite = function (interactiveRequest) {\n if (interactiveRequest === void 0) { interactiveRequest = false; }\n var q = new ProfileLoader(this, \"getuserprofile/createpersonalsiteenque(\" + interactiveRequest + \")\\\",\");\n return q.post();\n };\n ProfileLoader.prototype.shareAllSocialData = function (share) {\n var q = new ProfileLoader(this, \"getuserprofile/shareallsocialdata(\" + share + \")\\\",\");\n return q.post();\n };\n return ProfileLoader;\n}(queryable_1.Queryable));\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar util_1 = require(\"../../utils/util\");\nvar Views = (function (_super) {\n __extends(Views, _super);\n function Views(baseUrl) {\n _super.call(this, baseUrl, \"views\");\n }\n Views.prototype.getById = function (id) {\n var v = new View(this);\n v.concat(\"('\" + id + \"')\");\n return v;\n };\n Views.prototype.getByTitle = function (title) {\n return new View(this, \"getByTitle('\" + title + \"')\");\n };\n Views.prototype.add = function (title, personalView, additionalSettings) {\n var _this = this;\n if (personalView === void 0) { personalView = false; }\n if (additionalSettings === void 0) { additionalSettings = {}; }\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": \"SP.View\" },\n \"Title\": title,\n \"PersonalView\": personalView,\n }, additionalSettings));\n return this.postAs({ body: postBody }).then(function (data) {\n return {\n data: data,\n view: _this.getById(data.Id),\n };\n });\n };\n return Views;\n}(queryable_1.QueryableCollection));\nexports.Views = Views;\nvar View = (function (_super) {\n __extends(View, _super);\n function View(baseUrl, path) {\n _super.call(this, baseUrl, path);\n }\n Object.defineProperty(View.prototype, \"fields\", {\n get: function () {\n return new ViewFields(this);\n },\n enumerable: true,\n configurable: true\n });\n View.prototype.update = function (properties) {\n var _this = this;\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": \"SP.View\" },\n }, properties));\n return this.post({\n body: postBody,\n headers: {\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n return {\n data: data,\n view: _this,\n };\n });\n };\n View.prototype.delete = function () {\n return this.post({\n headers: {\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n View.prototype.renderAsHtml = function () {\n var q = new queryable_1.Queryable(this, \"renderashtml\");\n return q.get();\n };\n return View;\n}(queryable_1.QueryableInstance));\nexports.View = View;\nvar ViewFields = (function (_super) {\n __extends(ViewFields, _super);\n function ViewFields(baseUrl, path) {\n if (path === void 0) { path = \"viewfields\"; }\n _super.call(this, baseUrl, path);\n }\n ViewFields.prototype.getSchemaXml = function () {\n var q = new queryable_1.Queryable(this, \"schemaxml\");\n return q.get();\n };\n ViewFields.prototype.add = function (fieldTitleOrInternalName) {\n var q = new ViewFields(this, \"addviewfield('\" + fieldTitleOrInternalName + \"')\");\n return q.post();\n };\n ViewFields.prototype.move = function (fieldInternalName, index) {\n var q = new ViewFields(this, \"moveviewfieldto\");\n var postBody = JSON.stringify({ \"field\": fieldInternalName, \"index\": index });\n return q.post({ body: postBody });\n };\n ViewFields.prototype.removeAll = function () {\n var q = new ViewFields(this, \"removeallviewfields\");\n return q.post();\n };\n ViewFields.prototype.remove = function (fieldInternalName) {\n var q = new ViewFields(this, \"removeviewfield('\" + fieldInternalName + \"')\");\n return q.post();\n };\n return ViewFields;\n}(queryable_1.QueryableCollection));\nexports.ViewFields = ViewFields;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar queryablesecurable_1 = require(\"./queryablesecurable\");\nvar lists_1 = require(\"./lists\");\nvar fields_1 = require(\"./fields\");\nvar navigation_1 = require(\"./navigation\");\nvar sitegroups_1 = require(\"./sitegroups\");\nvar contenttypes_1 = require(\"./contenttypes\");\nvar folders_1 = require(\"./folders\");\nvar roles_1 = require(\"./roles\");\nvar files_1 = require(\"./files\");\nvar util_1 = require(\"../../utils/util\");\nvar lists_2 = require(\"./lists\");\nvar siteusers_1 = require(\"./siteusers\");\nvar usercustomactions_1 = require(\"./usercustomactions\");\nvar odata_1 = require(\"./odata\");\nvar Webs = (function (_super) {\n __extends(Webs, _super);\n function Webs(baseUrl, webPath) {\n if (webPath === void 0) { webPath = \"webs\"; }\n _super.call(this, baseUrl, webPath);\n }\n Webs.prototype.add = function (title, url, description, template, language, inheritPermissions, additionalSettings) {\n if (description === void 0) { description = \"\"; }\n if (template === void 0) { template = \"STS\"; }\n if (language === void 0) { language = 1033; }\n if (inheritPermissions === void 0) { inheritPermissions = true; }\n if (additionalSettings === void 0) { additionalSettings = {}; }\n var props = util_1.Util.extend({\n Description: description,\n Language: language,\n Title: title,\n Url: url,\n UseSamePermissionsAsParentSite: inheritPermissions,\n WebTemplate: template,\n }, additionalSettings);\n var postBody = JSON.stringify({\n \"parameters\": util_1.Util.extend({\n \"__metadata\": { \"type\": \"SP.WebCreationInformation\" },\n }, props),\n });\n var q = new Webs(this, \"add\");\n return q.post({ body: postBody }).then(function (data) {\n return {\n data: data,\n web: new Web(odata_1.extractOdataId(data), \"\"),\n };\n });\n };\n return Webs;\n}(queryable_1.QueryableCollection));\nexports.Webs = Webs;\nvar Web = (function (_super) {\n __extends(Web, _super);\n function Web(baseUrl, path) {\n if (path === void 0) { path = \"_api/web\"; }\n _super.call(this, baseUrl, path);\n }\n Object.defineProperty(Web.prototype, \"webs\", {\n get: function () {\n return new Webs(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"contentTypes\", {\n get: function () {\n return new contenttypes_1.ContentTypes(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"lists\", {\n get: function () {\n return new lists_1.Lists(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"fields\", {\n get: function () {\n return new fields_1.Fields(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"availablefields\", {\n get: function () {\n return new fields_1.Fields(this, \"availablefields\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"navigation\", {\n get: function () {\n return new navigation_1.Navigation(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"siteUsers\", {\n get: function () {\n return new siteusers_1.SiteUsers(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"siteGroups\", {\n get: function () {\n return new sitegroups_1.SiteGroups(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"folders\", {\n get: function () {\n return new folders_1.Folders(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"userCustomActions\", {\n get: function () {\n return new usercustomactions_1.UserCustomActions(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"roleDefinitions\", {\n get: function () {\n return new roles_1.RoleDefinitions(this);\n },\n enumerable: true,\n configurable: true\n });\n Web.prototype.getFolderByServerRelativeUrl = function (folderRelativeUrl) {\n return new folders_1.Folder(this, \"getFolderByServerRelativeUrl('\" + folderRelativeUrl + \"')\");\n };\n Web.prototype.getFileByServerRelativeUrl = function (fileRelativeUrl) {\n return new files_1.File(this, \"getFileByServerRelativeUrl('\" + fileRelativeUrl + \"')\");\n };\n Web.prototype.getList = function (listRelativeUrl) {\n return new lists_2.List(this, \"getList('\" + listRelativeUrl + \"')\");\n };\n Web.prototype.update = function (properties) {\n var _this = this;\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": \"SP.Web\" },\n }, properties));\n return this.post({\n body: postBody,\n headers: {\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n return {\n data: data,\n web: _this,\n };\n });\n };\n Web.prototype.delete = function () {\n return this.post({\n headers: {\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n Web.prototype.applyTheme = function (colorPaletteUrl, fontSchemeUrl, backgroundImageUrl, shareGenerated) {\n var postBody = JSON.stringify({\n backgroundImageUrl: backgroundImageUrl,\n colorPaletteUrl: colorPaletteUrl,\n fontSchemeUrl: fontSchemeUrl,\n shareGenerated: shareGenerated,\n });\n var q = new Web(this, \"applytheme\");\n return q.post({ body: postBody });\n };\n Web.prototype.applyWebTemplate = function (template) {\n var q = new Web(this, \"applywebtemplate\");\n q.concat(\"(@t)\");\n q.query.add(\"@t\", template);\n return q.post();\n };\n Web.prototype.doesUserHavePermissions = function (perms) {\n var q = new Web(this, \"doesuserhavepermissions\");\n q.concat(\"(@p)\");\n q.query.add(\"@p\", JSON.stringify(perms));\n return q.get();\n };\n Web.prototype.ensureUser = function (loginName) {\n var postBody = JSON.stringify({\n logonName: loginName,\n });\n var q = new Web(this, \"ensureuser\");\n return q.post({ body: postBody });\n };\n Web.prototype.availableWebTemplates = function (language, includeCrossLanugage) {\n if (language === void 0) { language = 1033; }\n if (includeCrossLanugage === void 0) { includeCrossLanugage = true; }\n return new queryable_1.QueryableCollection(this, \"getavailablewebtemplates(lcid=\" + language + \", doincludecrosslanguage=\" + includeCrossLanugage + \")\");\n };\n Web.prototype.getCatalog = function (type) {\n var q = new Web(this, \"getcatalog(\" + type + \")\");\n q.select(\"Id\");\n return q.get().then(function (data) {\n return new lists_2.List(odata_1.extractOdataId(data));\n });\n };\n Web.prototype.getChanges = function (query) {\n var postBody = JSON.stringify({ \"query\": util_1.Util.extend({ \"__metadata\": { \"type\": \"SP.ChangeQuery\" } }, query) });\n var q = new Web(this, \"getchanges\");\n return q.post({ body: postBody });\n };\n Object.defineProperty(Web.prototype, \"customListTemplate\", {\n get: function () {\n return new queryable_1.QueryableCollection(this, \"getcustomlisttemplates\");\n },\n enumerable: true,\n configurable: true\n });\n Web.prototype.getUserById = function (id) {\n return new siteusers_1.SiteUser(this, \"getUserById(\" + id + \")\");\n };\n Web.prototype.mapToIcon = function (filename, size, progId) {\n if (size === void 0) { size = 0; }\n if (progId === void 0) { progId = \"\"; }\n var q = new Web(this, \"maptoicon(filename='\" + filename + \"', progid='\" + progId + \"', size=\" + size + \")\");\n return q.get();\n };\n return Web;\n}(queryablesecurable_1.QueryableSecurable));\nexports.Web = Web;\n","\"use strict\";\nfunction __export(m) {\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\n}\n__export(require(\"../sharepoint/rest/index\"));\nvar httpclient_1 = require(\"../net/httpclient\");\nexports.HttpClient = httpclient_1.HttpClient;\nvar collections_1 = require(\"../collections/collections\");\nexports.Dictionary = collections_1.Dictionary;\nvar util_1 = require(\"../utils/util\");\nexports.Util = util_1.Util;\n__export(require(\"../utils/logging\"));\n","\"use strict\";\nfunction readBlobAsText(blob) {\n return readBlobAs(blob, \"string\");\n}\nexports.readBlobAsText = readBlobAsText;\nfunction readBlobAsArrayBuffer(blob) {\n return readBlobAs(blob, \"buffer\");\n}\nexports.readBlobAsArrayBuffer = readBlobAsArrayBuffer;\nfunction readBlobAs(blob, mode) {\n return new Promise(function (resolve, reject) {\n var reader = new FileReader();\n reader.onload = function (e) {\n resolve(e.target.result);\n };\n switch (mode) {\n case \"string\":\n reader.readAsText(blob);\n break;\n case \"buffer\":\n reader.readAsArrayBuffer(blob);\n break;\n }\n });\n}\n","\"use strict\";\n(function (LogLevel) {\n LogLevel[LogLevel[\"Verbose\"] = 0] = \"Verbose\";\n LogLevel[LogLevel[\"Info\"] = 1] = \"Info\";\n LogLevel[LogLevel[\"Warning\"] = 2] = \"Warning\";\n LogLevel[LogLevel[\"Error\"] = 3] = \"Error\";\n LogLevel[LogLevel[\"Off\"] = 99] = \"Off\";\n})(exports.LogLevel || (exports.LogLevel = {}));\nvar LogLevel = exports.LogLevel;\nvar Logger = (function () {\n function Logger() {\n }\n Object.defineProperty(Logger, \"activeLogLevel\", {\n get: function () {\n return Logger.instance.activeLogLevel;\n },\n set: function (value) {\n Logger.instance.activeLogLevel = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Logger, \"instance\", {\n get: function () {\n if (typeof Logger._instance === \"undefined\" || Logger._instance === null) {\n Logger._instance = new LoggerImpl();\n }\n return Logger._instance;\n },\n enumerable: true,\n configurable: true\n });\n Logger.subscribe = function () {\n var listeners = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n listeners[_i - 0] = arguments[_i];\n }\n for (var i = 0; i < listeners.length; i++) {\n Logger.instance.subscribe(listeners[i]);\n }\n };\n Logger.clearSubscribers = function () {\n return Logger.instance.clearSubscribers();\n };\n Object.defineProperty(Logger, \"count\", {\n get: function () {\n return Logger.instance.count;\n },\n enumerable: true,\n configurable: true\n });\n Logger.write = function (message, level) {\n if (level === void 0) { level = LogLevel.Verbose; }\n Logger.instance.log({ level: level, message: message });\n };\n Logger.log = function (entry) {\n Logger.instance.log(entry);\n };\n Logger.measure = function (name, f) {\n return Logger.instance.measure(name, f);\n };\n return Logger;\n}());\nexports.Logger = Logger;\nvar LoggerImpl = (function () {\n function LoggerImpl(activeLogLevel, subscribers) {\n if (activeLogLevel === void 0) { activeLogLevel = LogLevel.Warning; }\n if (subscribers === void 0) { subscribers = []; }\n this.activeLogLevel = activeLogLevel;\n this.subscribers = subscribers;\n }\n LoggerImpl.prototype.subscribe = function (listener) {\n this.subscribers.push(listener);\n };\n LoggerImpl.prototype.clearSubscribers = function () {\n var s = this.subscribers.slice(0);\n this.subscribers.length = 0;\n return s;\n };\n Object.defineProperty(LoggerImpl.prototype, \"count\", {\n get: function () {\n return this.subscribers.length;\n },\n enumerable: true,\n configurable: true\n });\n LoggerImpl.prototype.write = function (message, level) {\n if (level === void 0) { level = LogLevel.Verbose; }\n this.log({ level: level, message: message });\n };\n LoggerImpl.prototype.log = function (entry) {\n if (typeof entry === \"undefined\" || entry.level < this.activeLogLevel) {\n return;\n }\n for (var i = 0; i < this.subscribers.length; i++) {\n this.subscribers[i].log(entry);\n }\n };\n LoggerImpl.prototype.measure = function (name, f) {\n console.profile(name);\n try {\n return f();\n }\n finally {\n console.profileEnd();\n }\n };\n return LoggerImpl;\n}());\nvar ConsoleListener = (function () {\n function ConsoleListener() {\n }\n ConsoleListener.prototype.log = function (entry) {\n var msg = this.format(entry);\n switch (entry.level) {\n case LogLevel.Verbose:\n case LogLevel.Info:\n console.log(msg);\n break;\n case LogLevel.Warning:\n console.warn(msg);\n break;\n case LogLevel.Error:\n console.error(msg);\n break;\n }\n };\n ConsoleListener.prototype.format = function (entry) {\n return \"Message: \" + entry.message + \". Data: \" + JSON.stringify(entry.data);\n };\n return ConsoleListener;\n}());\nexports.ConsoleListener = ConsoleListener;\nvar AzureInsightsListener = (function () {\n function AzureInsightsListener(azureInsightsInstrumentationKey) {\n this.azureInsightsInstrumentationKey = azureInsightsInstrumentationKey;\n var appInsights = window[\"appInsights\"] || function (config) {\n function r(config) {\n t[config] = function () {\n var i = arguments;\n t.queue.push(function () { t[config].apply(t, i); });\n };\n }\n var t = { config: config }, u = document, e = window, o = \"script\", s = u.createElement(o), i, f;\n for (s.src = config.url || \"//az416426.vo.msecnd.net/scripts/a/ai.0.js\", u.getElementsByTagName(o)[0].parentNode.appendChild(s), t.cookie = u.cookie, t.queue = [], i = [\"Event\", \"Exception\", \"Metric\", \"PageView\", \"Trace\"]; i.length;) {\n r(\"track\" + i.pop());\n }\n return r(\"setAuthenticatedUserContext\"), r(\"clearAuthenticatedUserContext\"), config.disableExceptionTracking || (i = \"onerror\", r(\"_\" + i), f = e[i], e[i] = function (config, r, u, e, o) {\n var s = f && f(config, r, u, e, o);\n return s !== !0 && t[\"_\" + i](config, r, u, e, o), s;\n }), t;\n }({\n instrumentationKey: this.azureInsightsInstrumentationKey\n });\n window[\"appInsights\"] = appInsights;\n }\n AzureInsightsListener.prototype.log = function (entry) {\n var ai = window[\"appInsights\"];\n var msg = this.format(entry);\n if (entry.level === LogLevel.Error) {\n ai.trackException(msg);\n }\n else {\n ai.trackEvent(msg);\n }\n };\n AzureInsightsListener.prototype.format = function (entry) {\n return \"Message: \" + entry.message + \". Data: \" + JSON.stringify(entry.data);\n };\n return AzureInsightsListener;\n}());\nexports.AzureInsightsListener = AzureInsightsListener;\nvar FunctionListener = (function () {\n function FunctionListener(method) {\n this.method = method;\n }\n FunctionListener.prototype.log = function (entry) {\n this.method(entry);\n };\n return FunctionListener;\n}());\nexports.FunctionListener = FunctionListener;\n","\"use strict\";\nvar util_1 = require(\"./util\");\nvar PnPClientStorageWrapper = (function () {\n function PnPClientStorageWrapper(store, defaultTimeoutMinutes) {\n this.store = store;\n this.defaultTimeoutMinutes = defaultTimeoutMinutes;\n this.defaultTimeoutMinutes = (defaultTimeoutMinutes === void 0) ? 5 : defaultTimeoutMinutes;\n this.enabled = this.test();\n }\n PnPClientStorageWrapper.prototype.get = function (key) {\n if (!this.enabled) {\n return null;\n }\n var o = this.store.getItem(key);\n if (o == null) {\n return null;\n }\n var persistable = JSON.parse(o);\n if (new Date(persistable.expiration) <= new Date()) {\n this.delete(key);\n return null;\n }\n else {\n return persistable.value;\n }\n };\n PnPClientStorageWrapper.prototype.put = function (key, o, expire) {\n if (this.enabled) {\n this.store.setItem(key, this.createPersistable(o, expire));\n }\n };\n PnPClientStorageWrapper.prototype.delete = function (key) {\n if (this.enabled) {\n this.store.removeItem(key);\n }\n };\n PnPClientStorageWrapper.prototype.getOrPut = function (key, getter, expire) {\n var _this = this;\n if (!this.enabled) {\n return getter();\n }\n if (!util_1.Util.isFunction(getter)) {\n throw \"Function expected for parameter 'getter'.\";\n }\n return new Promise(function (resolve, reject) {\n var o = _this.get(key);\n if (o == null) {\n getter().then(function (d) {\n _this.put(key, d);\n resolve(d);\n });\n }\n else {\n resolve(o);\n }\n });\n };\n PnPClientStorageWrapper.prototype.test = function () {\n var str = \"test\";\n try {\n this.store.setItem(str, str);\n this.store.removeItem(str);\n return true;\n }\n catch (e) {\n return false;\n }\n };\n PnPClientStorageWrapper.prototype.createPersistable = function (o, expire) {\n if (typeof expire === \"undefined\") {\n expire = util_1.Util.dateAdd(new Date(), \"minute\", this.defaultTimeoutMinutes);\n }\n return JSON.stringify({ expiration: expire, value: o });\n };\n return PnPClientStorageWrapper;\n}());\nexports.PnPClientStorageWrapper = PnPClientStorageWrapper;\nvar PnPClientStorage = (function () {\n function PnPClientStorage() {\n this.local = typeof localStorage !== \"undefined\" ? new PnPClientStorageWrapper(localStorage) : null;\n this.session = typeof sessionStorage !== \"undefined\" ? new PnPClientStorageWrapper(sessionStorage) : null;\n }\n return PnPClientStorage;\n}());\nexports.PnPClientStorage = PnPClientStorage;\n","\"use strict\";\nvar Util = (function () {\n function Util() {\n }\n Util.getCtxCallback = function (context, method) {\n var params = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n params[_i - 2] = arguments[_i];\n }\n return function () {\n method.apply(context, params);\n };\n };\n Util.urlParamExists = function (name) {\n name = name.replace(/[\\[]/, \"\\\\[\").replace(/[\\]]/, \"\\\\]\");\n var regex = new RegExp(\"[\\\\?&]\" + name + \"=([^&#]*)\");\n return regex.test(location.search);\n };\n Util.getUrlParamByName = function (name) {\n name = name.replace(/[\\[]/, \"\\\\[\").replace(/[\\]]/, \"\\\\]\");\n var regex = new RegExp(\"[\\\\?&]\" + name + \"=([^&#]*)\");\n var results = regex.exec(location.search);\n return results == null ? \"\" : decodeURIComponent(results[1].replace(/\\+/g, \" \"));\n };\n Util.getUrlParamBoolByName = function (name) {\n var p = this.getUrlParamByName(name);\n var isFalse = (p === \"\" || /false|0/i.test(p));\n return !isFalse;\n };\n Util.stringInsert = function (target, index, s) {\n if (index > 0) {\n return target.substring(0, index) + s + target.substring(index, target.length);\n }\n return s + target;\n };\n Util.dateAdd = function (date, interval, units) {\n var ret = new Date(date.toLocaleString());\n switch (interval.toLowerCase()) {\n case \"year\":\n ret.setFullYear(ret.getFullYear() + units);\n break;\n case \"quarter\":\n ret.setMonth(ret.getMonth() + 3 * units);\n break;\n case \"month\":\n ret.setMonth(ret.getMonth() + units);\n break;\n case \"week\":\n ret.setDate(ret.getDate() + 7 * units);\n break;\n case \"day\":\n ret.setDate(ret.getDate() + units);\n break;\n case \"hour\":\n ret.setTime(ret.getTime() + units * 3600000);\n break;\n case \"minute\":\n ret.setTime(ret.getTime() + units * 60000);\n break;\n case \"second\":\n ret.setTime(ret.getTime() + units * 1000);\n break;\n default:\n ret = undefined;\n break;\n }\n return ret;\n };\n Util.loadStylesheet = function (path, avoidCache) {\n if (avoidCache) {\n path += \"?\" + encodeURIComponent((new Date()).getTime().toString());\n }\n var head = document.getElementsByTagName(\"head\");\n if (head.length > 0) {\n var e = document.createElement(\"link\");\n head[0].appendChild(e);\n e.setAttribute(\"type\", \"text/css\");\n e.setAttribute(\"rel\", \"stylesheet\");\n e.setAttribute(\"href\", path);\n }\n };\n Util.combinePaths = function () {\n var paths = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n paths[_i - 0] = arguments[_i];\n }\n var parts = [];\n for (var i = 0; i < paths.length; i++) {\n if (typeof paths[i] !== \"undefined\" && paths[i] !== null) {\n parts.push(paths[i].replace(/^[\\\\|\\/]/, \"\").replace(/[\\\\|\\/]$/, \"\"));\n }\n }\n return parts.join(\"/\").replace(/\\\\/, \"/\");\n };\n Util.getRandomString = function (chars) {\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n for (var i = 0; i < chars; i++) {\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n }\n return text;\n };\n Util.getGUID = function () {\n var d = new Date().getTime();\n var guid = \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g, function (c) {\n var r = (d + Math.random() * 16) % 16 | 0;\n d = Math.floor(d / 16);\n return (c === \"x\" ? r : (r & 0x3 | 0x8)).toString(16);\n });\n return guid;\n };\n Util.isFunction = function (candidateFunction) {\n return typeof candidateFunction === \"function\";\n };\n Util.isArray = function (array) {\n if (Array.isArray) {\n return Array.isArray(array);\n }\n return array && typeof array.length === \"number\" && array.constructor === Array;\n };\n Util.stringIsNullOrEmpty = function (s) {\n return typeof s === \"undefined\" || s === null || s === \"\";\n };\n Util.extend = function (target, source, noOverwrite) {\n if (noOverwrite === void 0) { noOverwrite = false; }\n var result = {};\n for (var id in target) {\n result[id] = target[id];\n }\n var check = noOverwrite ? function (o, i) { return !o.hasOwnProperty(i); } : function (o, i) { return true; };\n for (var id in source) {\n if (check(result, id)) {\n result[id] = source[id];\n }\n }\n return result;\n };\n Util.applyMixins = function (derivedCtor) {\n var baseCtors = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n baseCtors[_i - 1] = arguments[_i];\n }\n baseCtors.forEach(function (baseCtor) {\n Object.getOwnPropertyNames(baseCtor.prototype).forEach(function (name) {\n derivedCtor.prototype[name] = baseCtor.prototype[name];\n });\n });\n };\n Util.isUrlAbsolute = function (url) {\n return /^https?:\\/\\/|^\\/\\//i.test(url);\n };\n Util.makeUrlAbsolute = function (url) {\n if (Util.isUrlAbsolute(url)) {\n return url;\n }\n if (typeof global._spPageContextInfo !== \"undefined\") {\n if (global._spPageContextInfo.hasOwnProperty(\"webAbsoluteUrl\")) {\n return Util.combinePaths(global._spPageContextInfo.webAbsoluteUrl, url);\n }\n else if (global._spPageContextInfo.hasOwnProperty(\"webServerRelativeUrl\")) {\n return Util.combinePaths(global._spPageContextInfo.webServerRelativeUrl, url);\n }\n }\n else {\n return url;\n }\n };\n return Util;\n}());\nexports.Util = Util;\n"]} \ No newline at end of file +{"version":3,"sources":["node_modules/browser-pack/_prelude.js","build/src/collections/collections.js","build/src/configuration/configuration.js","build/src/configuration/pnplibconfig.js","build/src/configuration/providers/cachingConfigurationProvider.js","build/src/configuration/providers/providers.js","build/src/configuration/providers/spListConfigurationProvider.js","build/src/net/digestcache.js","build/src/net/fetchclient.js","build/src/net/httpclient.js","build/src/net/nodefetchclientbrowser.js","build/src/net/sprequestexecutorclient.js","build/src/pnp.js","build/src/sharepoint/rest/caching.js","build/src/sharepoint/rest/contenttypes.js","build/src/sharepoint/rest/fields.js","build/src/sharepoint/rest/files.js","build/src/sharepoint/rest/folders.js","build/src/sharepoint/rest/forms.js","build/src/sharepoint/rest/index.js","build/src/sharepoint/rest/items.js","build/src/sharepoint/rest/lists.js","build/src/sharepoint/rest/navigation.js","build/src/sharepoint/rest/odata.js","build/src/sharepoint/rest/queryable.js","build/src/sharepoint/rest/queryablesecurable.js","build/src/sharepoint/rest/quicklaunch.js","build/src/sharepoint/rest/rest.js","build/src/sharepoint/rest/roles.js","build/src/sharepoint/rest/search.js","build/src/sharepoint/rest/searchsuggest.js","build/src/sharepoint/rest/site.js","build/src/sharepoint/rest/sitegroups.js","build/src/sharepoint/rest/siteusers.js","build/src/sharepoint/rest/subscriptions.js","build/src/sharepoint/rest/topnavigationbar.js","build/src/sharepoint/rest/types.js","build/src/sharepoint/rest/usercustomactions.js","build/src/sharepoint/rest/userprofiles.js","build/src/sharepoint/rest/views.js","build/src/sharepoint/rest/webs.js","build/src/types/index.js","build/src/utils/files.js","build/src/utils/logging.js","build/src/utils/storage.js","build/src/utils/util.js"],"names":["f","exports","module","define","amd","g","window","global","self","this","$pnp","e","t","n","r","s","o","u","a","require","i","Error","code","l","call","length","1","util_1","Dictionary","keys","values","prototype","get","key","index","indexOf","add","push","merge","source","Util","isFunction","sourceAsDictionary","getKeys","sourceAsHash","hasOwnProperty","remove","val","splice","getValues","clear","count","Collections","providers","Settings","Providers","_settings","value","addJSON","JSON","stringify","apply","hash","_this","Promise","resolve","reject","load","provider","getConfiguration","then","catch","reason","getJSON","parse","setRuntimeConfig","config","_runtimeConfig","set","RuntimeConfigImpl","_headers","_defaultCachingStore","_defaultCachingTimeoutSeconds","_globalCacheDisable","_useSPRequestExecutor","headers","globalCacheDisable","defaultCachingStore","defaultCachingTimeoutSeconds","useSPRequestExecutor","_useNodeClient","_nodeClientData","nodeClientOptions","_spPageContextInfo","webAbsoluteUrl","siteUrl","Object","defineProperty","enumerable","configurable","RuntimeConfig","storage","CachingConfigurationProvider","wrappedProvider","cacheKey","cacheStore","store","selectPnPCache","getWrappedProvider","enabled","cachedConfig","providerPromise","providedConfig","put","pnpCache","PnPClientStorage","local","session","default","cachingConfigurationProvider_1","spListConfigurationProvider_1","SPListConfigurationProvider","sourceWeb","sourceListTitle","web","lists","getByTitle","listTitle","items","select","getAs","data","configuration","forEach","Title","Value","asCaching","toUrl","collections_1","odata_1","CachedDigest","DigestCache","_httpClient","_digests","getDigest","webUrl","cachedDigest","now","Date","expiration","url","combinePaths","fetchRaw","cache","credentials","Accept","Content-type","method","response","parser","ODataDefaultParser","d","GetContextWebInformation","newCachedDigest","FormDigestValue","seconds","FormDigestTimeoutSeconds","setTime","getTime","FetchClient","fetch","options","fetchclient_1","digestcache_1","pnplibconfig_1","sprequestexecutorclient_1","nodefetchclient_1","HttpClient","_impl","getFetchImpl","_digestCache","opts","extend","Headers","mergeHeaders","has","append","toUpperCase","substr","digest","rawHeaders","retry","ctx","delay","status","attempts","retryCount","setTimeout","getCtxCallback","retryContext","post","patch","delete","SPRequestExecutorClient","useNodeFetchClient","nodeRequestOptions","NodeFetchClient","clientId","clientSecret","target","temp","Request","name","_clientId","_clientSecret","_realm","convertToResponse","spResponse","responseHeaders","h","Response","body","statusCode","statusText","SP","RequestExecutor","iterator","addinWebUrl","substring","executor","entries","next","done","requestOptions","error","success","binaryStringRequestBody","executeAsync","__export","m","p","storage_1","configuration_1","logging_1","rest_1","util","sp","Rest","log","Logger","setup","Def","CachingOptions","dateAdd","storeName","CachingParserWrapper","_parser","_cacheOptions","__extends","b","__","constructor","create","queryable_1","ContentTypes","_super","baseUrl","path","getById","id","ct","ContentType","concat","addAvailableContentType","contentTypeId","postBody","postAs","contentType","description","group","additionalSettings","__metadata","type","Id","StringValue","Name","Group","Description","QueryableCollection","Queryable","QueryableInstance","Types","Fields","title","Field","getByInternalNameOrTitle","createFieldAsXml","xml","info","SchemaXml","parameters","q","field","fieldType","properties","addText","maxLength","props","FieldTypeKind","addCalculated","formula","dateFormat","outputType","FieldTypes","Text","DateFormat","Formula","OutputType","addDateTime","displayFormat","calendarType","friendlyDisplayFormat","DateTimeFieldFormatType","DateOnly","CalendarType","Gregorian","DateTimeCalendarType","DisplayFormat","FriendlyDisplayFormat","addNumber","minValue","maxValue","MinimumValue","MaximumValue","addCurrency","currencyLocalId","CurrencyLocaleId","addMultilineText","numberOfLines","richText","restrictedMode","appendOnly","allowHyperlink","AllowHyperlink","AppendOnly","NumberOfLines","RestrictedMode","RichText","addUrl","UrlFieldFormatType","Hyperlink","update","X-HTTP-Method","setShowInDisplayForm","show","setShowInEditForm","setShowInNewForm","items_1","Files","getByName","File","content","shouldOverWrite","file","addChunked","progress","chunkSize","adder","setContentChunked","addTemplateFile","fileUrl","templateFileType","Item","Versions","approve","comment","cancelUpload","uploadId","checkin","checkinType","CheckinType","Major","checkout","copyTo","eTag","IF-Match","deny","getLimitedWebPartManager","scope","WebPartsPersonalizationScope","User","moveTo","moveOperations","MoveOperations","Overwrite","publish","recycle","undoCheckout","unpublish","getText","TextFileParser","binaryStringResponseBody","getBlob","BlobFileParser","getBuffer","BufferFileParser","setContent","setter","_","fileSize","size","blockCount","parseInt","toString","console","getGUID","blockNumber","currentPointer","stage","totalBlocks","chain","startUpload","slice","_loop_1","pointer","continueUpload","finishUpload","fragment","parseFloat","fileOffset","ServerRelativeUrl","text","blob","arrayBuffer","buffer","versionId","v","Version","deleteAll","deleteById","deleteByLabel","label","restoreByLabel","TemplateFileType","files_1","Folders","Folder","folder","Forms","Form","PagedItemCollection","extractOdataId","ODataParserBase","ODataRaw","ODataValue","ODataEntity","ODataEntityArray","roles_1","RoleDefinitionBindings","search_1","Search","SearchResult","SearchResults","SortDirection","ReorderingRuleMatchType","QueryPropertyValueType","searchsuggest_1","SearchSuggest","SearchSuggestResult","site_1","Site","webs_1","Web","queryablesecurable_1","folders_1","contenttypes_1","Items","skip","_query","encodeURIComponent","getPaged","PagedItemCollectionParser","removeDependency","addBatchDependency","parentList","getParent","ListItemEntityTypeFullName","promise","item","parentUrl","lastIndexOf","getWopiFrameUrl","action","GetWOPIFrameUrl","validateUpdateListItem","formValues","newDocumentUpdate","bNewDocumentUpdate","QueryableSecurable","nextUrl","results","getNext","hasNext","arguments","json","__next","parseODataJSON","views_1","fields_1","forms_1","subscriptions_1","usercustomactions_1","Lists","List","list","template","enableContentTypes","AllowContentTypes","BaseTemplate","ContentTypesEnabled","ensure","hasBatch","created","ensureSiteAssetsLibrary","ensureSitePagesLibrary","Views","UserCustomActions","Subscriptions","getView","viewId","View","retList","getChanges","query","getItemsByCAMLQuery","expands","_i","expand","getListItemChangesSinceToken","Recycle","renderListData","viewXml","RenderListData","renderListFormData","itemId","formId","mode","ListData","reserveListItemId","ReserveListItemId","quicklaunch_1","topnavigationbar_1","Navigation","QuickLaunch","TopNavigationBar","candidate","level","LogLevel","message","getEntityUrl","entity","uri","write","Warning","ODataValueParserImpl","factory","ODataEntityParserImpl","ODataEntityArrayParserImpl","httpclient_1","result","ODataRawParserImpl","map","ODataBatch","_batchId","_requests","_batchDependencies","resolver","execute","executeImpl","batchBody","currentChangeSetId","reqInfo","Content-Type","name_1","batchHeaders","batchOptions","join","client","requestUrl","makeUrlAbsolute","_parseResponse","responses","request","ok","header","statusRegExp","RegExp","lines","split","state","line","trim","parts","exec","caching_1","_batch","urlStr","isUrlAbsolute","_parentUrl","_url","pathPart","inBatch","batch","usingCaching","_useCaching","_cachingOptions","toUrlAndQuery","ix","arr","getOptions","getImpl","postOptions","postImpl","patchOptions","patchImpl","deleteOptions","deleteImpl","parent","toLowerCase","data_1","processHttpClientResponse","filter","selects","orderBy","ascending","asc","top","RoleAssignments","getUserEffectivePermissions","loginName","breakRoleInheritance","copyRoleAssignments","clearSubscopes","Breaker","copy","break","resetRoleInheritance","Resetter","reset","userprofiles_1","searchSuggest","finalQuery","querytext","search","Querytext","UserProfileQuery","createBatch","crossDomainSite","addInWebUrl","hostWebUrl","_cdImpl","crossDomainWeb","urlPart","instance","sitegroups_1","principalId","roleDefId","ra","RoleAssignment","SiteGroups","RoleDefinitions","RoleDefinition","getByType","roleTypeKind","order","basePermissions","BasePermissions","Order","definition","retDef","parent_1","formattedBody","SelectProperties","RefinementFilters","SortList","HithighlightedProperties","ReorderingRules","Properties","rawResponse","postquery","PrimarySearchResults","formatSearchResults","PrimaryQueryResult","RelevantResults","Table","Rows","RawSearchResults","ElapsedTime","RowCount","TotalRows","TotalRowsIncludingDuplicates","rawResults","Array","tempResults","tempResults_1","Cells","rawItem","item_1","Key","mapQueryToQueryString","personalCount","preQuery","hitHighlighting","capitalize","culture","stemming","includePeople","queryRules","prefixMatch","PeopleNames","suggest","PersonalResults","Queries","getContextInfo","SupportedSchemaVersions","getDocumentLibraries","absoluteWebUrl","GetDocumentLibraries","getWebUrlFromPageUrl","absolutePageUrl","GetWebUrlFromPageUrl","siteusers_1","PrincipalType","groupName","SiteGroup","sg","removeById","removeByLoginName","SiteUsers","retGroup","getByEmail","email","SiteUser","getByLoginName","su","LoginName","user","subscriptionId","subscription","Subscription","notificationUrl","expirationDate","clientState","resource","expirationDateTime","ControlMode","AddFieldOptions","PageType","UserCustomAction","FileUtil","profileLoader","ProfileLoader","amIFollowedBy","amIFollowing","getFollowedTags","maxCount","getFollowersFor","getPeopleFollowedBy","getPropertiesFor","getUserProfilePropertyFor","propertyName","hideSuggestion","isFollowing","follower","followee","setMyProfilePic","profilePicSource","readBlobAsArrayBuffer","String","fromCharCode","Uint16Array","createPersonalSiteEnqueueBulk","emails","ownerUserProfile","userProfile","createPersonalSite","interactiveRequest","shareAllSocialData","share","emailIDs","personalView","PersonalView","view","ViewFields","renderAsHtml","getSchemaXml","fieldTitleOrInternalName","move","fieldInternalName","removeAll","lists_1","navigation_1","lists_2","Webs","webPath","language","inheritPermissions","Language","Url","UseSamePermissionsAsParentSite","WebTemplate","getFolderByServerRelativeUrl","folderRelativeUrl","getFileByServerRelativeUrl","fileRelativeUrl","getList","listRelativeUrl","applyTheme","colorPaletteUrl","fontSchemeUrl","backgroundImageUrl","shareGenerated","applyWebTemplate","doesUserHavePermissions","perms","ensureUser","logonName","availableWebTemplates","includeCrossLanugage","getCatalog","getUserById","mapToIcon","filename","progId","readBlobAsText","readBlobAs","reader","FileReader","onload","readAsText","readAsArrayBuffer","activeLogLevel","_instance","LoggerImpl","subscribe","listeners","clearSubscribers","Verbose","entry","measure","subscribers","listener","profile","profileEnd","ConsoleListener","msg","format","Info","warn","AzureInsightsListener","azureInsightsInstrumentationKey","appInsights","queue","document","createElement","src","getElementsByTagName","parentNode","appendChild","cookie","pop","disableExceptionTracking","instrumentationKey","ai","trackException","trackEvent","FunctionListener","PnPClientStorageWrapper","defaultTimeoutMinutes","test","getItem","persistable","expire","setItem","createPersistable","removeItem","getOrPut","getter","str","localStorage","sessionStorage","context","params","urlParamExists","replace","regex","location","getUrlParamByName","decodeURIComponent","getUrlParamBoolByName","isFalse","stringInsert","date","interval","units","ret","toLocaleString","setFullYear","getFullYear","setMonth","getMonth","setDate","getDate","undefined","loadStylesheet","avoidCache","head","setAttribute","paths","getRandomString","chars","possible","charAt","Math","floor","random","guid","c","candidateFunction","isArray","array","stringIsNullOrEmpty","noOverwrite","check","applyMixins","derivedCtor","baseCtors","baseCtor","getOwnPropertyNames","webServerRelativeUrl"],"mappings":";;;;;;;;CAAA,SAAAA,GAAA,GAAA,gBAAAC,UAAA,mBAAAC,QAAAA,OAAAD,QAAAD,QAAA,IAAA,kBAAAG,SAAAA,OAAAC,IAAAD,UAAAH,OAAA,CAAA,GAAAK,EAAAA,GAAA,mBAAAC,QAAAA,OAAA,mBAAAC,QAAAA,OAAA,mBAAAC,MAAAA,KAAAC,KAAAJ,EAAAK,KAAAV,MAAA,WAAA,MAAA,SAAAW,GAAAC,EAAAC,EAAAC,GAAA,QAAAC,GAAAC,EAAAC,GAAA,IAAAJ,EAAAG,GAAA,CAAA,IAAAJ,EAAAI,GAAA,CAAA,GAAAE,GAAA,kBAAAC,UAAAA,OAAA,KAAAF,GAAAC,EAAA,MAAAA,GAAAF,GAAA,EAAA,IAAAI,EAAA,MAAAA,GAAAJ,GAAA,EAAA,IAAAhB,GAAA,GAAAqB,OAAA,uBAAAL,EAAA,IAAA,MAAAhB,GAAAsB,KAAA,mBAAAtB,EAAA,GAAAuB,GAAAV,EAAAG,IAAAf,WAAAW,GAAAI,GAAA,GAAAQ,KAAAD,EAAAtB,QAAA,SAAAU,GAAA,GAAAE,GAAAD,EAAAI,GAAA,GAAAL,EAAA,OAAAI,GAAAF,EAAAA,EAAAF,IAAAY,EAAAA,EAAAtB,QAAAU,EAAAC,EAAAC,EAAAC,GAAA,MAAAD,GAAAG,GAAAf,QAAA,IAAA,GAAAmB,GAAA,kBAAAD,UAAAA,QAAAH,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(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o -1) {\n this.values[index] = o;\n }\n else {\n this.keys.push(key);\n this.values.push(o);\n }\n };\n Dictionary.prototype.merge = function (source) {\n if (util_1.Util.isFunction(source[\"getKeys\"])) {\n var sourceAsDictionary = source;\n var keys = sourceAsDictionary.getKeys();\n var l = keys.length;\n for (var i = 0; i < l; i++) {\n this.add(keys[i], sourceAsDictionary.get(keys[i]));\n }\n }\n else {\n var sourceAsHash = source;\n for (var key in sourceAsHash) {\n if (sourceAsHash.hasOwnProperty(key)) {\n this.add(key, source[key]);\n }\n }\n }\n };\n Dictionary.prototype.remove = function (key) {\n var index = this.keys.indexOf(key);\n if (index < 0) {\n return null;\n }\n var val = this.values[index];\n this.keys.splice(index, 1);\n this.values.splice(index, 1);\n return val;\n };\n Dictionary.prototype.getKeys = function () {\n return this.keys;\n };\n Dictionary.prototype.getValues = function () {\n return this.values;\n };\n Dictionary.prototype.clear = function () {\n this.keys = [];\n this.values = [];\n };\n Dictionary.prototype.count = function () {\n return this.keys.length;\n };\n return Dictionary;\n}());\nexports.Dictionary = Dictionary;\n","\"use strict\";\nvar Collections = require(\"../collections/collections\");\nvar providers = require(\"./providers/providers\");\nvar Settings = (function () {\n function Settings() {\n this.Providers = providers;\n this._settings = new Collections.Dictionary();\n }\n Settings.prototype.add = function (key, value) {\n this._settings.add(key, value);\n };\n Settings.prototype.addJSON = function (key, value) {\n this._settings.add(key, JSON.stringify(value));\n };\n Settings.prototype.apply = function (hash) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n try {\n _this._settings.merge(hash);\n resolve();\n }\n catch (e) {\n reject(e);\n }\n });\n };\n Settings.prototype.load = function (provider) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n provider.getConfiguration().then(function (value) {\n _this._settings.merge(value);\n resolve();\n }).catch(function (reason) {\n reject(reason);\n });\n });\n };\n Settings.prototype.get = function (key) {\n return this._settings.get(key);\n };\n Settings.prototype.getJSON = function (key) {\n var o = this.get(key);\n if (typeof o === \"undefined\" || o === null) {\n return o;\n }\n return JSON.parse(o);\n };\n return Settings;\n}());\nexports.Settings = Settings;\n","\"use strict\";\nvar RuntimeConfigImpl = (function () {\n function RuntimeConfigImpl() {\n this._headers = null;\n this._defaultCachingStore = \"session\";\n this._defaultCachingTimeoutSeconds = 30;\n this._globalCacheDisable = false;\n this._useSPRequestExecutor = false;\n }\n RuntimeConfigImpl.prototype.set = function (config) {\n if (config.hasOwnProperty(\"headers\")) {\n this._headers = config.headers;\n }\n if (config.hasOwnProperty(\"globalCacheDisable\")) {\n this._globalCacheDisable = config.globalCacheDisable;\n }\n if (config.hasOwnProperty(\"defaultCachingStore\")) {\n this._defaultCachingStore = config.defaultCachingStore;\n }\n if (config.hasOwnProperty(\"defaultCachingTimeoutSeconds\")) {\n this._defaultCachingTimeoutSeconds = config.defaultCachingTimeoutSeconds;\n }\n if (config.hasOwnProperty(\"useSPRequestExecutor\")) {\n this._useSPRequestExecutor = config.useSPRequestExecutor;\n }\n if (config.hasOwnProperty(\"nodeClientOptions\")) {\n this._useNodeClient = true;\n this._useSPRequestExecutor = false;\n this._nodeClientData = config.nodeClientOptions;\n global._spPageContextInfo = {\n webAbsoluteUrl: config.nodeClientOptions.siteUrl,\n };\n }\n };\n Object.defineProperty(RuntimeConfigImpl.prototype, \"headers\", {\n get: function () {\n return this._headers;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RuntimeConfigImpl.prototype, \"defaultCachingStore\", {\n get: function () {\n return this._defaultCachingStore;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RuntimeConfigImpl.prototype, \"defaultCachingTimeoutSeconds\", {\n get: function () {\n return this._defaultCachingTimeoutSeconds;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RuntimeConfigImpl.prototype, \"globalCacheDisable\", {\n get: function () {\n return this._globalCacheDisable;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RuntimeConfigImpl.prototype, \"useSPRequestExecutor\", {\n get: function () {\n return this._useSPRequestExecutor;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RuntimeConfigImpl.prototype, \"useNodeFetchClient\", {\n get: function () {\n return this._useNodeClient;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RuntimeConfigImpl.prototype, \"nodeRequestOptions\", {\n get: function () {\n return this._nodeClientData;\n },\n enumerable: true,\n configurable: true\n });\n return RuntimeConfigImpl;\n}());\nexports.RuntimeConfigImpl = RuntimeConfigImpl;\nvar _runtimeConfig = new RuntimeConfigImpl();\nexports.RuntimeConfig = _runtimeConfig;\nfunction setRuntimeConfig(config) {\n _runtimeConfig.set(config);\n}\nexports.setRuntimeConfig = setRuntimeConfig;\n","\"use strict\";\nvar storage = require(\"../../utils/storage\");\nvar CachingConfigurationProvider = (function () {\n function CachingConfigurationProvider(wrappedProvider, cacheKey, cacheStore) {\n this.wrappedProvider = wrappedProvider;\n this.store = (cacheStore) ? cacheStore : this.selectPnPCache();\n this.cacheKey = \"_configcache_\" + cacheKey;\n }\n CachingConfigurationProvider.prototype.getWrappedProvider = function () {\n return this.wrappedProvider;\n };\n CachingConfigurationProvider.prototype.getConfiguration = function () {\n var _this = this;\n if ((!this.store) || (!this.store.enabled)) {\n return this.wrappedProvider.getConfiguration();\n }\n var cachedConfig = this.store.get(this.cacheKey);\n if (cachedConfig) {\n return new Promise(function (resolve, reject) {\n resolve(cachedConfig);\n });\n }\n var providerPromise = this.wrappedProvider.getConfiguration();\n providerPromise.then(function (providedConfig) {\n _this.store.put(_this.cacheKey, providedConfig);\n });\n return providerPromise;\n };\n CachingConfigurationProvider.prototype.selectPnPCache = function () {\n var pnpCache = new storage.PnPClientStorage();\n if ((pnpCache.local) && (pnpCache.local.enabled)) {\n return pnpCache.local;\n }\n if ((pnpCache.session) && (pnpCache.session.enabled)) {\n return pnpCache.session;\n }\n throw new Error(\"Cannot create a caching configuration provider since cache is not available.\");\n };\n return CachingConfigurationProvider;\n}());\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = CachingConfigurationProvider;\n","\"use strict\";\nvar cachingConfigurationProvider_1 = require(\"./cachingConfigurationProvider\");\nvar spListConfigurationProvider_1 = require(\"./spListConfigurationProvider\");\nexports.CachingConfigurationProvider = cachingConfigurationProvider_1.default;\nexports.SPListConfigurationProvider = spListConfigurationProvider_1.default;\n","\"use strict\";\nvar cachingConfigurationProvider_1 = require(\"./cachingConfigurationProvider\");\nvar SPListConfigurationProvider = (function () {\n function SPListConfigurationProvider(sourceWeb, sourceListTitle) {\n if (sourceListTitle === void 0) { sourceListTitle = \"config\"; }\n this.sourceWeb = sourceWeb;\n this.sourceListTitle = sourceListTitle;\n }\n Object.defineProperty(SPListConfigurationProvider.prototype, \"web\", {\n get: function () {\n return this.sourceWeb;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SPListConfigurationProvider.prototype, \"listTitle\", {\n get: function () {\n return this.sourceListTitle;\n },\n enumerable: true,\n configurable: true\n });\n SPListConfigurationProvider.prototype.getConfiguration = function () {\n return this.web.lists.getByTitle(this.listTitle).items.select(\"Title\", \"Value\")\n .getAs().then(function (data) {\n var configuration = {};\n data.forEach(function (i) {\n configuration[i.Title] = i.Value;\n });\n return configuration;\n });\n };\n SPListConfigurationProvider.prototype.asCaching = function () {\n var cacheKey = \"splist_\" + this.web.toUrl() + \"+\" + this.listTitle;\n return new cachingConfigurationProvider_1.default(this, cacheKey);\n };\n return SPListConfigurationProvider;\n}());\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = SPListConfigurationProvider;\n","\"use strict\";\nvar collections_1 = require(\"../collections/collections\");\nvar util_1 = require(\"../utils/util\");\nvar odata_1 = require(\"../sharepoint/rest/odata\");\nvar CachedDigest = (function () {\n function CachedDigest() {\n }\n return CachedDigest;\n}());\nexports.CachedDigest = CachedDigest;\nvar DigestCache = (function () {\n function DigestCache(_httpClient, _digests) {\n if (_digests === void 0) { _digests = new collections_1.Dictionary(); }\n this._httpClient = _httpClient;\n this._digests = _digests;\n }\n DigestCache.prototype.getDigest = function (webUrl) {\n var self = this;\n var cachedDigest = this._digests.get(webUrl);\n if (cachedDigest !== null) {\n var now = new Date();\n if (now < cachedDigest.expiration) {\n return Promise.resolve(cachedDigest.value);\n }\n }\n var url = util_1.Util.combinePaths(webUrl, \"/_api/contextinfo\");\n return self._httpClient.fetchRaw(url, {\n cache: \"no-cache\",\n credentials: \"same-origin\",\n headers: {\n \"Accept\": \"application/json;odata=verbose\",\n \"Content-type\": \"application/json;odata=verbose;charset=utf-8\",\n },\n method: \"POST\",\n }).then(function (response) {\n var parser = new odata_1.ODataDefaultParser();\n return parser.parse(response).then(function (d) { return d.GetContextWebInformation; });\n }).then(function (data) {\n var newCachedDigest = new CachedDigest();\n newCachedDigest.value = data.FormDigestValue;\n var seconds = data.FormDigestTimeoutSeconds;\n var expiration = new Date();\n expiration.setTime(expiration.getTime() + 1000 * seconds);\n newCachedDigest.expiration = expiration;\n self._digests.add(webUrl, newCachedDigest);\n return newCachedDigest.value;\n });\n };\n DigestCache.prototype.clear = function () {\n this._digests.clear();\n };\n return DigestCache;\n}());\nexports.DigestCache = DigestCache;\n","\"use strict\";\nvar FetchClient = (function () {\n function FetchClient() {\n }\n FetchClient.prototype.fetch = function (url, options) {\n return global.fetch(url, options);\n };\n return FetchClient;\n}());\nexports.FetchClient = FetchClient;\n","\"use strict\";\nvar fetchclient_1 = require(\"./fetchclient\");\nvar digestcache_1 = require(\"./digestcache\");\nvar util_1 = require(\"../utils/util\");\nvar pnplibconfig_1 = require(\"../configuration/pnplibconfig\");\nvar sprequestexecutorclient_1 = require(\"./sprequestexecutorclient\");\nvar nodefetchclient_1 = require(\"./nodefetchclient\");\nvar HttpClient = (function () {\n function HttpClient() {\n this._impl = this.getFetchImpl();\n this._digestCache = new digestcache_1.DigestCache(this);\n }\n HttpClient.prototype.fetch = function (url, options) {\n if (options === void 0) { options = {}; }\n var self = this;\n var opts = util_1.Util.extend(options, { cache: \"no-cache\", credentials: \"same-origin\" }, true);\n var headers = new Headers();\n this.mergeHeaders(headers, pnplibconfig_1.RuntimeConfig.headers);\n this.mergeHeaders(headers, options.headers);\n if (!headers.has(\"Accept\")) {\n headers.append(\"Accept\", \"application/json\");\n }\n if (!headers.has(\"Content-Type\")) {\n headers.append(\"Content-Type\", \"application/json;odata=verbose;charset=utf-8\");\n }\n if (!headers.has(\"X-ClientService-ClientTag\")) {\n headers.append(\"X-ClientService-ClientTag\", \"PnPCoreJS:1.0.6\");\n }\n opts = util_1.Util.extend(opts, { headers: headers });\n if (opts.method && opts.method.toUpperCase() !== \"GET\") {\n if (!headers.has(\"X-RequestDigest\")) {\n var index = url.indexOf(\"_api/\");\n if (index < 0) {\n throw new Error(\"Unable to determine API url\");\n }\n var webUrl = url.substr(0, index);\n return this._digestCache.getDigest(webUrl)\n .then(function (digest) {\n headers.append(\"X-RequestDigest\", digest);\n return self.fetchRaw(url, opts);\n });\n }\n }\n return self.fetchRaw(url, opts);\n };\n HttpClient.prototype.fetchRaw = function (url, options) {\n var _this = this;\n if (options === void 0) { options = {}; }\n var rawHeaders = new Headers();\n this.mergeHeaders(rawHeaders, options.headers);\n options = util_1.Util.extend(options, { headers: rawHeaders });\n var retry = function (ctx) {\n _this._impl.fetch(url, options).then(function (response) { return ctx.resolve(response); }).catch(function (response) {\n var delay = ctx.delay;\n if (response.status !== 429 && response.status !== 503) {\n ctx.reject(response);\n }\n ctx.delay *= 2;\n ctx.attempts++;\n if (ctx.retryCount <= ctx.attempts) {\n ctx.reject(response);\n }\n setTimeout(util_1.Util.getCtxCallback(_this, retry, ctx), delay);\n });\n };\n return new Promise(function (resolve, reject) {\n var retryContext = {\n attempts: 0,\n delay: 100,\n reject: reject,\n resolve: resolve,\n retryCount: 7,\n };\n retry.call(_this, retryContext);\n });\n };\n HttpClient.prototype.get = function (url, options) {\n if (options === void 0) { options = {}; }\n var opts = util_1.Util.extend(options, { method: \"GET\" });\n return this.fetch(url, opts);\n };\n HttpClient.prototype.post = function (url, options) {\n if (options === void 0) { options = {}; }\n var opts = util_1.Util.extend(options, { method: \"POST\" });\n return this.fetch(url, opts);\n };\n HttpClient.prototype.patch = function (url, options) {\n if (options === void 0) { options = {}; }\n var opts = util_1.Util.extend(options, { method: \"PATCH\" });\n return this.fetch(url, opts);\n };\n HttpClient.prototype.delete = function (url, options) {\n if (options === void 0) { options = {}; }\n var opts = util_1.Util.extend(options, { method: \"DELETE\" });\n return this.fetch(url, opts);\n };\n HttpClient.prototype.getFetchImpl = function () {\n if (pnplibconfig_1.RuntimeConfig.useSPRequestExecutor) {\n return new sprequestexecutorclient_1.SPRequestExecutorClient();\n }\n else if (pnplibconfig_1.RuntimeConfig.useNodeFetchClient) {\n var opts = pnplibconfig_1.RuntimeConfig.nodeRequestOptions;\n return new nodefetchclient_1.NodeFetchClient(opts.siteUrl, opts.clientId, opts.clientSecret);\n }\n else {\n return new fetchclient_1.FetchClient();\n }\n };\n HttpClient.prototype.mergeHeaders = function (target, source) {\n if (typeof source !== \"undefined\" && source !== null) {\n var temp = new Request(\"\", { headers: source });\n temp.headers.forEach(function (value, name) {\n target.append(name, value);\n });\n }\n };\n return HttpClient;\n}());\nexports.HttpClient = HttpClient;\n","\"use strict\";\nvar NodeFetchClient = (function () {\n function NodeFetchClient(siteUrl, _clientId, _clientSecret, _realm) {\n if (_realm === void 0) { _realm = \"\"; }\n this.siteUrl = siteUrl;\n this._clientId = _clientId;\n this._clientSecret = _clientSecret;\n this._realm = _realm;\n }\n NodeFetchClient.prototype.fetch = function (url, options) {\n throw new Error(\"Using NodeFetchClient in the browser is not supported.\");\n };\n return NodeFetchClient;\n}());\nexports.NodeFetchClient = NodeFetchClient;\n","\"use strict\";\nvar util_1 = require(\"../utils/util\");\nvar SPRequestExecutorClient = (function () {\n function SPRequestExecutorClient() {\n this.convertToResponse = function (spResponse) {\n var responseHeaders = new Headers();\n for (var h in spResponse.headers) {\n if (spResponse.headers[h]) {\n responseHeaders.append(h, spResponse.headers[h]);\n }\n }\n return new Response(spResponse.body, {\n headers: responseHeaders,\n status: spResponse.statusCode,\n statusText: spResponse.statusText,\n });\n };\n }\n SPRequestExecutorClient.prototype.fetch = function (url, options) {\n var _this = this;\n if (typeof SP === \"undefined\" || typeof SP.RequestExecutor === \"undefined\") {\n throw new Error(\"SP.RequestExecutor is undefined. \" +\n \"Load the SP.RequestExecutor.js library (/_layouts/15/SP.RequestExecutor.js) before loading the PnP JS Core library.\");\n }\n var addinWebUrl = url.substring(0, url.indexOf(\"/_api\")), executor = new SP.RequestExecutor(addinWebUrl), headers = {}, iterator, temp;\n if (options.headers && options.headers instanceof Headers) {\n iterator = options.headers.entries();\n temp = iterator.next();\n while (!temp.done) {\n headers[temp.value[0]] = temp.value[1];\n temp = iterator.next();\n }\n }\n else {\n headers = options.headers;\n }\n return new Promise(function (resolve, reject) {\n var requestOptions = {\n error: function (error) {\n reject(_this.convertToResponse(error));\n },\n headers: headers,\n method: options.method,\n success: function (response) {\n resolve(_this.convertToResponse(response));\n },\n url: url,\n };\n if (options.body) {\n util_1.Util.extend(requestOptions, { body: options.body });\n }\n else {\n util_1.Util.extend(requestOptions, { binaryStringRequestBody: true });\n }\n executor.executeAsync(requestOptions);\n });\n };\n return SPRequestExecutorClient;\n}());\nexports.SPRequestExecutorClient = SPRequestExecutorClient;\n","\"use strict\";\nfunction __export(m) {\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\n}\nvar util_1 = require(\"./utils/util\");\nvar storage_1 = require(\"./utils/storage\");\nvar configuration_1 = require(\"./configuration/configuration\");\nvar logging_1 = require(\"./utils/logging\");\nvar rest_1 = require(\"./sharepoint/rest/rest\");\nvar pnplibconfig_1 = require(\"./configuration/pnplibconfig\");\nexports.util = util_1.Util;\nexports.sp = new rest_1.Rest();\nexports.storage = new storage_1.PnPClientStorage();\nexports.config = new configuration_1.Settings();\nexports.log = logging_1.Logger;\nexports.setup = pnplibconfig_1.setRuntimeConfig;\n__export(require(\"./types/index\"));\nvar Def = {\n config: exports.config,\n log: exports.log,\n setup: exports.setup,\n sp: exports.sp,\n storage: exports.storage,\n util: exports.util,\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = Def;\n","\"use strict\";\nvar storage_1 = require(\"../../utils/storage\");\nvar util_1 = require(\"../../utils/util\");\nvar pnplibconfig_1 = require(\"../../configuration/pnplibconfig\");\nvar CachingOptions = (function () {\n function CachingOptions(key) {\n this.key = key;\n this.expiration = util_1.Util.dateAdd(new Date(), \"second\", pnplibconfig_1.RuntimeConfig.defaultCachingTimeoutSeconds);\n this.storeName = pnplibconfig_1.RuntimeConfig.defaultCachingStore;\n }\n Object.defineProperty(CachingOptions.prototype, \"store\", {\n get: function () {\n if (this.storeName === \"local\") {\n return CachingOptions.storage.local;\n }\n else {\n return CachingOptions.storage.session;\n }\n },\n enumerable: true,\n configurable: true\n });\n CachingOptions.storage = new storage_1.PnPClientStorage();\n return CachingOptions;\n}());\nexports.CachingOptions = CachingOptions;\nvar CachingParserWrapper = (function () {\n function CachingParserWrapper(_parser, _cacheOptions) {\n this._parser = _parser;\n this._cacheOptions = _cacheOptions;\n }\n CachingParserWrapper.prototype.parse = function (response) {\n var _this = this;\n return this._parser.parse(response).then(function (data) {\n if (_this._cacheOptions.store !== null) {\n _this._cacheOptions.store.put(_this._cacheOptions.key, data, _this._cacheOptions.expiration);\n }\n return data;\n });\n };\n return CachingParserWrapper;\n}());\nexports.CachingParserWrapper = CachingParserWrapper;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar util_1 = require(\"../../utils/util\");\nvar queryable_1 = require(\"./queryable\");\nvar ContentTypes = (function (_super) {\n __extends(ContentTypes, _super);\n function ContentTypes(baseUrl, path) {\n if (path === void 0) { path = \"contenttypes\"; }\n _super.call(this, baseUrl, path);\n }\n ContentTypes.prototype.getById = function (id) {\n var ct = new ContentType(this);\n ct.concat(\"('\" + id + \"')\");\n return ct;\n };\n ContentTypes.prototype.addAvailableContentType = function (contentTypeId) {\n var _this = this;\n var postBody = JSON.stringify({\n \"contentTypeId\": contentTypeId,\n });\n return new ContentTypes(this, \"addAvailableContentType\").postAs({ body: postBody }).then(function (data) {\n return {\n contentType: _this.getById(data.id),\n data: data,\n };\n });\n };\n ContentTypes.prototype.add = function (id, name, description, group, additionalSettings) {\n var _this = this;\n if (description === void 0) { description = \"\"; }\n if (group === void 0) { group = \"Custom Content Types\"; }\n if (additionalSettings === void 0) { additionalSettings = {}; }\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": \"SP.ContentType\" },\n \"Id\": { \"StringValue\": id },\n \"Name\": name,\n \"Group\": group,\n \"Description\": description,\n }, additionalSettings));\n return this.post({ body: postBody }).then(function (data) {\n return { contentType: _this.getById(data.id), data: data };\n });\n };\n return ContentTypes;\n}(queryable_1.QueryableCollection));\nexports.ContentTypes = ContentTypes;\nvar ContentType = (function (_super) {\n __extends(ContentType, _super);\n function ContentType(baseUrl, path) {\n _super.call(this, baseUrl, path);\n }\n Object.defineProperty(ContentType.prototype, \"fieldLinks\", {\n get: function () {\n return new queryable_1.Queryable(this, \"fieldLinks\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ContentType.prototype, \"fields\", {\n get: function () {\n return new queryable_1.Queryable(this, \"fields\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ContentType.prototype, \"parent\", {\n get: function () {\n return new ContentType(this, \"parent\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ContentType.prototype, \"workflowAssociations\", {\n get: function () {\n return new queryable_1.Queryable(this, \"workflowAssociations\");\n },\n enumerable: true,\n configurable: true\n });\n return ContentType;\n}(queryable_1.QueryableInstance));\nexports.ContentType = ContentType;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar util_1 = require(\"../../utils/util\");\nvar Types = require(\"./types\");\nvar Fields = (function (_super) {\n __extends(Fields, _super);\n function Fields(baseUrl, path) {\n if (path === void 0) { path = \"fields\"; }\n _super.call(this, baseUrl, path);\n }\n Fields.prototype.getByTitle = function (title) {\n return new Field(this, \"getByTitle('\" + title + \"')\");\n };\n Fields.prototype.getByInternalNameOrTitle = function (name) {\n return new Field(this, \"getByInternalNameOrTitle('\" + name + \"')\");\n };\n Fields.prototype.getById = function (id) {\n var f = new Field(this);\n f.concat(\"('\" + id + \"')\");\n return f;\n };\n Fields.prototype.createFieldAsXml = function (xml) {\n var _this = this;\n var info;\n if (typeof xml === \"string\") {\n info = { SchemaXml: xml };\n }\n else {\n info = xml;\n }\n var postBody = JSON.stringify({\n \"parameters\": util_1.Util.extend({\n \"__metadata\": {\n \"type\": \"SP.XmlSchemaFieldCreationInformation\",\n },\n }, info),\n });\n var q = new Fields(this, \"createfieldasxml\");\n return q.postAs({ body: postBody }).then(function (data) {\n return {\n data: data,\n field: _this.getById(data.Id),\n };\n });\n };\n Fields.prototype.add = function (title, fieldType, properties) {\n var _this = this;\n if (properties === void 0) { properties = {}; }\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": fieldType },\n \"Title\": title,\n }, properties));\n return this.postAs({ body: postBody }).then(function (data) {\n return {\n data: data,\n field: _this.getById(data.Id),\n };\n });\n };\n Fields.prototype.addText = function (title, maxLength, properties) {\n if (maxLength === void 0) { maxLength = 255; }\n var props = {\n FieldTypeKind: 2,\n };\n return this.add(title, \"SP.FieldText\", util_1.Util.extend(props, properties));\n };\n Fields.prototype.addCalculated = function (title, formula, dateFormat, outputType, properties) {\n if (outputType === void 0) { outputType = Types.FieldTypes.Text; }\n var props = {\n DateFormat: dateFormat,\n FieldTypeKind: 17,\n Formula: formula,\n OutputType: outputType,\n };\n return this.add(title, \"SP.FieldCalculated\", util_1.Util.extend(props, properties));\n };\n Fields.prototype.addDateTime = function (title, displayFormat, calendarType, friendlyDisplayFormat, properties) {\n if (displayFormat === void 0) { displayFormat = Types.DateTimeFieldFormatType.DateOnly; }\n if (calendarType === void 0) { calendarType = Types.CalendarType.Gregorian; }\n if (friendlyDisplayFormat === void 0) { friendlyDisplayFormat = 0; }\n var props = {\n DateTimeCalendarType: calendarType,\n DisplayFormat: displayFormat,\n FieldTypeKind: 4,\n FriendlyDisplayFormat: friendlyDisplayFormat,\n };\n return this.add(title, \"SP.FieldDateTime\", util_1.Util.extend(props, properties));\n };\n Fields.prototype.addNumber = function (title, minValue, maxValue, properties) {\n var props = { FieldTypeKind: 9 };\n if (typeof minValue !== \"undefined\") {\n props = util_1.Util.extend({ MinimumValue: minValue }, props);\n }\n if (typeof maxValue !== \"undefined\") {\n props = util_1.Util.extend({ MaximumValue: maxValue }, props);\n }\n return this.add(title, \"SP.FieldNumber\", util_1.Util.extend(props, properties));\n };\n Fields.prototype.addCurrency = function (title, minValue, maxValue, currencyLocalId, properties) {\n if (currencyLocalId === void 0) { currencyLocalId = 1033; }\n var props = {\n CurrencyLocaleId: currencyLocalId,\n FieldTypeKind: 10,\n };\n if (typeof minValue !== \"undefined\") {\n props = util_1.Util.extend({ MinimumValue: minValue }, props);\n }\n if (typeof maxValue !== \"undefined\") {\n props = util_1.Util.extend({ MaximumValue: maxValue }, props);\n }\n return this.add(title, \"SP.FieldCurrency\", util_1.Util.extend(props, properties));\n };\n Fields.prototype.addMultilineText = function (title, numberOfLines, richText, restrictedMode, appendOnly, allowHyperlink, properties) {\n if (numberOfLines === void 0) { numberOfLines = 6; }\n if (richText === void 0) { richText = true; }\n if (restrictedMode === void 0) { restrictedMode = false; }\n if (appendOnly === void 0) { appendOnly = false; }\n if (allowHyperlink === void 0) { allowHyperlink = true; }\n var props = {\n AllowHyperlink: allowHyperlink,\n AppendOnly: appendOnly,\n FieldTypeKind: 3,\n NumberOfLines: numberOfLines,\n RestrictedMode: restrictedMode,\n RichText: richText,\n };\n return this.add(title, \"SP.FieldMultiLineText\", util_1.Util.extend(props, properties));\n };\n Fields.prototype.addUrl = function (title, displayFormat, properties) {\n if (displayFormat === void 0) { displayFormat = Types.UrlFieldFormatType.Hyperlink; }\n var props = {\n DisplayFormat: displayFormat,\n FieldTypeKind: 11,\n };\n return this.add(title, \"SP.FieldUrl\", util_1.Util.extend(props, properties));\n };\n return Fields;\n}(queryable_1.QueryableCollection));\nexports.Fields = Fields;\nvar Field = (function (_super) {\n __extends(Field, _super);\n function Field(baseUrl, path) {\n _super.call(this, baseUrl, path);\n }\n Field.prototype.update = function (properties, fieldType) {\n var _this = this;\n if (fieldType === void 0) { fieldType = \"SP.Field\"; }\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": fieldType },\n }, properties));\n return this.post({\n body: postBody,\n headers: {\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n return {\n data: data,\n field: _this,\n };\n });\n };\n Field.prototype.delete = function () {\n return this.post({\n headers: {\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n Field.prototype.setShowInDisplayForm = function (show) {\n var q = new Field(this, \"setshowindisplayform(\" + show + \")\");\n return q.post();\n };\n Field.prototype.setShowInEditForm = function (show) {\n var q = new Field(this, \"setshowineditform(\" + show + \")\");\n return q.post();\n };\n Field.prototype.setShowInNewForm = function (show) {\n var q = new Field(this, \"setshowinnewform(\" + show + \")\");\n return q.post();\n };\n return Field;\n}(queryable_1.QueryableInstance));\nexports.Field = Field;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar items_1 = require(\"./items\");\nvar util_1 = require(\"../../utils/util\");\nvar Files = (function (_super) {\n __extends(Files, _super);\n function Files(baseUrl, path) {\n if (path === void 0) { path = \"files\"; }\n _super.call(this, baseUrl, path);\n }\n Files.prototype.getByName = function (name) {\n var f = new File(this);\n f.concat(\"('\" + name + \"')\");\n return f;\n };\n Files.prototype.add = function (url, content, shouldOverWrite) {\n var _this = this;\n if (shouldOverWrite === void 0) { shouldOverWrite = true; }\n return new Files(this, \"add(overwrite=\" + shouldOverWrite + \",url='\" + url + \"')\")\n .post({\n body: content,\n }).then(function (response) {\n return {\n data: response,\n file: _this.getByName(url),\n };\n });\n };\n Files.prototype.addChunked = function (url, content, progress, shouldOverWrite, chunkSize) {\n var _this = this;\n if (shouldOverWrite === void 0) { shouldOverWrite = true; }\n if (chunkSize === void 0) { chunkSize = 10485760; }\n var adder = new Files(this, \"add(overwrite=\" + shouldOverWrite + \",url='\" + url + \"')\");\n return adder.post().then(function () { return _this.getByName(url); }).then(function (file) { return file.setContentChunked(content, progress, chunkSize); }).then(function (response) {\n return {\n data: response,\n file: _this.getByName(url),\n };\n });\n };\n Files.prototype.addTemplateFile = function (fileUrl, templateFileType) {\n var _this = this;\n return new Files(this, \"addTemplateFile(urloffile='\" + fileUrl + \"',templatefiletype=\" + templateFileType + \")\")\n .post().then(function (response) {\n return {\n data: response,\n file: _this.getByName(fileUrl),\n };\n });\n };\n return Files;\n}(queryable_1.QueryableCollection));\nexports.Files = Files;\nvar File = (function (_super) {\n __extends(File, _super);\n function File(baseUrl, path) {\n _super.call(this, baseUrl, path);\n }\n Object.defineProperty(File.prototype, \"listItemAllFields\", {\n get: function () {\n return new items_1.Item(this, \"listItemAllFields\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(File.prototype, \"versions\", {\n get: function () {\n return new Versions(this);\n },\n enumerable: true,\n configurable: true\n });\n File.prototype.approve = function (comment) {\n return new File(this, \"approve(comment='\" + comment + \"')\").post();\n };\n File.prototype.cancelUpload = function (uploadId) {\n return new File(this, \"cancelUpload(uploadId=guid'\" + uploadId + \"')\").post();\n };\n File.prototype.checkin = function (comment, checkinType) {\n if (comment === void 0) { comment = \"\"; }\n if (checkinType === void 0) { checkinType = CheckinType.Major; }\n return new File(this, \"checkin(comment='\" + comment + \"',checkintype=\" + checkinType + \")\").post();\n };\n File.prototype.checkout = function () {\n return new File(this, \"checkout\").post();\n };\n File.prototype.copyTo = function (url, shouldOverWrite) {\n if (shouldOverWrite === void 0) { shouldOverWrite = true; }\n return new File(this, \"copyTo(strnewurl='\" + url + \"',boverwrite=\" + shouldOverWrite + \")\").post();\n };\n File.prototype.delete = function (eTag) {\n if (eTag === void 0) { eTag = \"*\"; }\n return new File(this).post({\n headers: {\n \"IF-Match\": eTag,\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n File.prototype.deny = function (comment) {\n if (comment === void 0) { comment = \"\"; }\n return new File(this, \"deny(comment='\" + comment + \"')\").post();\n };\n File.prototype.getLimitedWebPartManager = function (scope) {\n if (scope === void 0) { scope = WebPartsPersonalizationScope.User; }\n return new queryable_1.Queryable(this, \"getLimitedWebPartManager(scope=\" + scope + \")\");\n };\n File.prototype.moveTo = function (url, moveOperations) {\n if (moveOperations === void 0) { moveOperations = MoveOperations.Overwrite; }\n return new File(this, \"moveTo(newurl='\" + url + \"',flags=\" + moveOperations + \")\").post();\n };\n File.prototype.publish = function (comment) {\n if (comment === void 0) { comment = \"\"; }\n return new File(this, \"publish(comment='\" + comment + \"')\").post();\n };\n File.prototype.recycle = function () {\n return new File(this, \"recycle\").post();\n };\n File.prototype.undoCheckout = function () {\n return new File(this, \"undoCheckout\").post();\n };\n File.prototype.unpublish = function (comment) {\n if (comment === void 0) { comment = \"\"; }\n if (comment.length > 1023) {\n throw new Error(\"The maximum comment length is 1023 characters.\");\n }\n return new File(this, \"unpublish(comment='\" + comment + \"')\").post();\n };\n File.prototype.getText = function () {\n return new File(this, \"$value\").get(new TextFileParser(), { headers: { \"binaryStringResponseBody\": \"true\" } });\n };\n File.prototype.getBlob = function () {\n return new File(this, \"$value\").get(new BlobFileParser(), { headers: { \"binaryStringResponseBody\": \"true\" } });\n };\n File.prototype.getBuffer = function () {\n return new File(this, \"$value\").get(new BufferFileParser(), { headers: { \"binaryStringResponseBody\": \"true\" } });\n };\n File.prototype.setContent = function (content) {\n var _this = this;\n var setter = new File(this, \"$value\");\n return setter.post({\n body: content,\n headers: {\n \"X-HTTP-Method\": \"PUT\",\n },\n }).then(function (_) { return new File(_this); });\n };\n File.prototype.setContentChunked = function (file, progress, chunkSize) {\n if (chunkSize === void 0) { chunkSize = 10485760; }\n if (typeof progress === \"undefined\") {\n progress = function (data) { return null; };\n }\n var self = this;\n var fileSize = file.size;\n var blockCount = parseInt((file.size / chunkSize).toString(), 10) + ((file.size % chunkSize === 0) ? 1 : 0);\n console.log(\"blockCount: \" + blockCount);\n var uploadId = util_1.Util.getGUID();\n progress({ blockNumber: 1, chunkSize: chunkSize, currentPointer: 0, fileSize: fileSize, stage: \"starting\", totalBlocks: blockCount });\n var chain = self.startUpload(uploadId, file.slice(0, chunkSize));\n var _loop_1 = function(i) {\n chain = chain.then(function (pointer) {\n progress({ blockNumber: i, chunkSize: chunkSize, currentPointer: pointer, fileSize: fileSize, stage: \"continue\", totalBlocks: blockCount });\n return self.continueUpload(uploadId, pointer, file.slice(pointer, pointer + chunkSize));\n });\n };\n for (var i = 2; i < blockCount; i++) {\n _loop_1(i);\n }\n return chain.then(function (pointer) {\n progress({ blockNumber: blockCount, chunkSize: chunkSize, currentPointer: pointer, fileSize: fileSize, stage: \"finishing\", totalBlocks: blockCount });\n return self.finishUpload(uploadId, pointer, file.slice(pointer));\n }).then(function (_) {\n return self;\n });\n };\n File.prototype.startUpload = function (uploadId, fragment) {\n return new File(this, \"startUpload(uploadId=guid'\" + uploadId + \"')\").postAs({ body: fragment }).then(function (n) { return parseFloat(n); });\n };\n File.prototype.continueUpload = function (uploadId, fileOffset, fragment) {\n return new File(this, \"continueUpload(uploadId=guid'\" + uploadId + \"',fileOffset=\" + fileOffset + \")\").postAs({ body: fragment }).then(function (n) { return parseFloat(n); });\n };\n File.prototype.finishUpload = function (uploadId, fileOffset, fragment) {\n return new File(this, \"finishUpload(uploadId=guid'\" + uploadId + \"',fileOffset=\" + fileOffset + \")\")\n .postAs({ body: fragment }).then(function (response) {\n return {\n data: response,\n file: new File(response.ServerRelativeUrl),\n };\n });\n };\n return File;\n}(queryable_1.QueryableInstance));\nexports.File = File;\nvar TextFileParser = (function () {\n function TextFileParser() {\n }\n TextFileParser.prototype.parse = function (r) {\n return r.text();\n };\n return TextFileParser;\n}());\nexports.TextFileParser = TextFileParser;\nvar BlobFileParser = (function () {\n function BlobFileParser() {\n }\n BlobFileParser.prototype.parse = function (r) {\n return r.blob();\n };\n return BlobFileParser;\n}());\nexports.BlobFileParser = BlobFileParser;\nvar BufferFileParser = (function () {\n function BufferFileParser() {\n }\n BufferFileParser.prototype.parse = function (r) {\n if (util_1.Util.isFunction(r.arrayBuffer)) {\n return r.arrayBuffer();\n }\n return r.buffer();\n };\n return BufferFileParser;\n}());\nexports.BufferFileParser = BufferFileParser;\nvar Versions = (function (_super) {\n __extends(Versions, _super);\n function Versions(baseUrl, path) {\n if (path === void 0) { path = \"versions\"; }\n _super.call(this, baseUrl, path);\n }\n Versions.prototype.getById = function (versionId) {\n var v = new Version(this);\n v.concat(\"(\" + versionId + \")\");\n return v;\n };\n Versions.prototype.deleteAll = function () {\n return new Versions(this, \"deleteAll\").post();\n };\n Versions.prototype.deleteById = function (versionId) {\n return new Versions(this, \"deleteById(vid=\" + versionId + \")\").post();\n };\n Versions.prototype.deleteByLabel = function (label) {\n return new Versions(this, \"deleteByLabel(versionlabel='\" + label + \"')\").post();\n };\n Versions.prototype.restoreByLabel = function (label) {\n return new Versions(this, \"restoreByLabel(versionlabel='\" + label + \"')\").post();\n };\n return Versions;\n}(queryable_1.QueryableCollection));\nexports.Versions = Versions;\nvar Version = (function (_super) {\n __extends(Version, _super);\n function Version(baseUrl, path) {\n _super.call(this, baseUrl, path);\n }\n Version.prototype.delete = function (eTag) {\n if (eTag === void 0) { eTag = \"*\"; }\n return this.post({\n headers: {\n \"IF-Match\": eTag,\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n return Version;\n}(queryable_1.QueryableInstance));\nexports.Version = Version;\n(function (CheckinType) {\n CheckinType[CheckinType[\"Minor\"] = 0] = \"Minor\";\n CheckinType[CheckinType[\"Major\"] = 1] = \"Major\";\n CheckinType[CheckinType[\"Overwrite\"] = 2] = \"Overwrite\";\n})(exports.CheckinType || (exports.CheckinType = {}));\nvar CheckinType = exports.CheckinType;\n(function (WebPartsPersonalizationScope) {\n WebPartsPersonalizationScope[WebPartsPersonalizationScope[\"User\"] = 0] = \"User\";\n WebPartsPersonalizationScope[WebPartsPersonalizationScope[\"Shared\"] = 1] = \"Shared\";\n})(exports.WebPartsPersonalizationScope || (exports.WebPartsPersonalizationScope = {}));\nvar WebPartsPersonalizationScope = exports.WebPartsPersonalizationScope;\n(function (MoveOperations) {\n MoveOperations[MoveOperations[\"Overwrite\"] = 1] = \"Overwrite\";\n MoveOperations[MoveOperations[\"AllowBrokenThickets\"] = 8] = \"AllowBrokenThickets\";\n})(exports.MoveOperations || (exports.MoveOperations = {}));\nvar MoveOperations = exports.MoveOperations;\n(function (TemplateFileType) {\n TemplateFileType[TemplateFileType[\"StandardPage\"] = 0] = \"StandardPage\";\n TemplateFileType[TemplateFileType[\"WikiPage\"] = 1] = \"WikiPage\";\n TemplateFileType[TemplateFileType[\"FormPage\"] = 2] = \"FormPage\";\n})(exports.TemplateFileType || (exports.TemplateFileType = {}));\nvar TemplateFileType = exports.TemplateFileType;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar files_1 = require(\"./files\");\nvar items_1 = require(\"./items\");\nvar Folders = (function (_super) {\n __extends(Folders, _super);\n function Folders(baseUrl, path) {\n if (path === void 0) { path = \"folders\"; }\n _super.call(this, baseUrl, path);\n }\n Folders.prototype.getByName = function (name) {\n var f = new Folder(this);\n f.concat(\"('\" + name + \"')\");\n return f;\n };\n Folders.prototype.add = function (url) {\n var _this = this;\n return new Folders(this, \"add('\" + url + \"')\").post().then(function (response) {\n return {\n data: response,\n folder: _this.getByName(url),\n };\n });\n };\n return Folders;\n}(queryable_1.QueryableCollection));\nexports.Folders = Folders;\nvar Folder = (function (_super) {\n __extends(Folder, _super);\n function Folder(baseUrl, path) {\n _super.call(this, baseUrl, path);\n }\n Object.defineProperty(Folder.prototype, \"contentTypeOrder\", {\n get: function () {\n return new queryable_1.QueryableCollection(this, \"contentTypeOrder\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Folder.prototype, \"files\", {\n get: function () {\n return new files_1.Files(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Folder.prototype, \"folders\", {\n get: function () {\n return new Folders(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Folder.prototype, \"listItemAllFields\", {\n get: function () {\n return new items_1.Item(this, \"listItemAllFields\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Folder.prototype, \"parentFolder\", {\n get: function () {\n return new Folder(this, \"parentFolder\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Folder.prototype, \"properties\", {\n get: function () {\n return new queryable_1.QueryableInstance(this, \"properties\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Folder.prototype, \"serverRelativeUrl\", {\n get: function () {\n return new queryable_1.Queryable(this, \"serverRelativeUrl\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Folder.prototype, \"uniqueContentTypeOrder\", {\n get: function () {\n return new queryable_1.QueryableCollection(this, \"uniqueContentTypeOrder\");\n },\n enumerable: true,\n configurable: true\n });\n Folder.prototype.delete = function (eTag) {\n if (eTag === void 0) { eTag = \"*\"; }\n return new Folder(this).post({\n headers: {\n \"IF-Match\": eTag,\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n Folder.prototype.recycle = function () {\n return new Folder(this, \"recycle\").post();\n };\n return Folder;\n}(queryable_1.QueryableInstance));\nexports.Folder = Folder;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar Forms = (function (_super) {\n __extends(Forms, _super);\n function Forms(baseUrl, path) {\n if (path === void 0) { path = \"forms\"; }\n _super.call(this, baseUrl, path);\n }\n Forms.prototype.getById = function (id) {\n var i = new Form(this);\n i.concat(\"('\" + id + \"')\");\n return i;\n };\n return Forms;\n}(queryable_1.QueryableCollection));\nexports.Forms = Forms;\nvar Form = (function (_super) {\n __extends(Form, _super);\n function Form(baseUrl, path) {\n _super.call(this, baseUrl, path);\n }\n return Form;\n}(queryable_1.QueryableInstance));\nexports.Form = Form;\n","\"use strict\";\nfunction __export(m) {\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\n}\n__export(require(\"./caching\"));\nvar files_1 = require(\"./files\");\nexports.CheckinType = files_1.CheckinType;\nexports.WebPartsPersonalizationScope = files_1.WebPartsPersonalizationScope;\nexports.MoveOperations = files_1.MoveOperations;\nexports.TemplateFileType = files_1.TemplateFileType;\nexports.TextFileParser = files_1.TextFileParser;\nexports.BlobFileParser = files_1.BlobFileParser;\nexports.BufferFileParser = files_1.BufferFileParser;\nvar items_1 = require(\"./items\");\nexports.PagedItemCollection = items_1.PagedItemCollection;\nvar odata_1 = require(\"./odata\");\nexports.extractOdataId = odata_1.extractOdataId;\nexports.ODataParserBase = odata_1.ODataParserBase;\nexports.ODataDefaultParser = odata_1.ODataDefaultParser;\nexports.ODataRaw = odata_1.ODataRaw;\nexports.ODataValue = odata_1.ODataValue;\nexports.ODataEntity = odata_1.ODataEntity;\nexports.ODataEntityArray = odata_1.ODataEntityArray;\nvar roles_1 = require(\"./roles\");\nexports.RoleDefinitionBindings = roles_1.RoleDefinitionBindings;\nvar search_1 = require(\"./search\");\nexports.Search = search_1.Search;\nexports.SearchResult = search_1.SearchResult;\nexports.SearchResults = search_1.SearchResults;\nexports.SortDirection = search_1.SortDirection;\nexports.ReorderingRuleMatchType = search_1.ReorderingRuleMatchType;\nexports.QueryPropertyValueType = search_1.QueryPropertyValueType;\nvar searchsuggest_1 = require(\"./searchsuggest\");\nexports.SearchSuggest = searchsuggest_1.SearchSuggest;\nexports.SearchSuggestResult = searchsuggest_1.SearchSuggestResult;\nvar site_1 = require(\"./site\");\nexports.Site = site_1.Site;\n__export(require(\"./types\"));\nvar webs_1 = require(\"./webs\");\nexports.Web = webs_1.Web;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar queryablesecurable_1 = require(\"./queryablesecurable\");\nvar folders_1 = require(\"./folders\");\nvar contenttypes_1 = require(\"./contenttypes\");\nvar util_1 = require(\"../../utils/util\");\nvar odata_1 = require(\"./odata\");\nvar Items = (function (_super) {\n __extends(Items, _super);\n function Items(baseUrl, path) {\n if (path === void 0) { path = \"items\"; }\n _super.call(this, baseUrl, path);\n }\n Items.prototype.getById = function (id) {\n var i = new Item(this);\n i.concat(\"(\" + id + \")\");\n return i;\n };\n Items.prototype.skip = function (skip) {\n this._query.add(\"$skiptoken\", encodeURIComponent(\"Paged=TRUE&p_ID=\" + skip));\n return this;\n };\n Items.prototype.getPaged = function () {\n return this.getAs(new PagedItemCollectionParser());\n };\n Items.prototype.add = function (properties) {\n var _this = this;\n if (properties === void 0) { properties = {}; }\n var removeDependency = this.addBatchDependency();\n var parentList = this.getParent(queryable_1.QueryableInstance);\n return parentList.select(\"ListItemEntityTypeFullName\").getAs().then(function (d) {\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": d.ListItemEntityTypeFullName },\n }, properties));\n var promise = _this.postAs({ body: postBody }).then(function (data) {\n return {\n data: data,\n item: _this.getById(data.Id),\n };\n });\n removeDependency();\n return promise;\n });\n };\n return Items;\n}(queryable_1.QueryableCollection));\nexports.Items = Items;\nvar Item = (function (_super) {\n __extends(Item, _super);\n function Item(baseUrl, path) {\n _super.call(this, baseUrl, path);\n }\n Object.defineProperty(Item.prototype, \"attachmentFiles\", {\n get: function () {\n return new queryable_1.QueryableCollection(this, \"AttachmentFiles\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Item.prototype, \"contentType\", {\n get: function () {\n return new contenttypes_1.ContentType(this, \"ContentType\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Item.prototype, \"effectiveBasePermissions\", {\n get: function () {\n return new queryable_1.Queryable(this, \"EffectiveBasePermissions\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Item.prototype, \"effectiveBasePermissionsForUI\", {\n get: function () {\n return new queryable_1.Queryable(this, \"EffectiveBasePermissionsForUI\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Item.prototype, \"fieldValuesAsHTML\", {\n get: function () {\n return new queryable_1.QueryableInstance(this, \"FieldValuesAsHTML\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Item.prototype, \"fieldValuesAsText\", {\n get: function () {\n return new queryable_1.QueryableInstance(this, \"FieldValuesAsText\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Item.prototype, \"fieldValuesForEdit\", {\n get: function () {\n return new queryable_1.QueryableInstance(this, \"FieldValuesForEdit\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Item.prototype, \"folder\", {\n get: function () {\n return new folders_1.Folder(this, \"Folder\");\n },\n enumerable: true,\n configurable: true\n });\n Item.prototype.update = function (properties, eTag) {\n var _this = this;\n if (eTag === void 0) { eTag = \"*\"; }\n var removeDependency = this.addBatchDependency();\n var parentList = this.getParent(queryable_1.QueryableInstance, this.parentUrl.substr(0, this.parentUrl.lastIndexOf(\"/\")));\n return parentList.select(\"ListItemEntityTypeFullName\").getAs().then(function (d) {\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": d.ListItemEntityTypeFullName },\n }, properties));\n var promise = _this.post({\n body: postBody,\n headers: {\n \"IF-Match\": eTag,\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n return {\n data: data,\n item: _this,\n };\n });\n removeDependency();\n return promise;\n });\n };\n Item.prototype.delete = function (eTag) {\n if (eTag === void 0) { eTag = \"*\"; }\n return this.post({\n headers: {\n \"IF-Match\": eTag,\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n Item.prototype.recycle = function () {\n var i = new Item(this, \"recycle\");\n return i.post();\n };\n Item.prototype.getWopiFrameUrl = function (action) {\n if (action === void 0) { action = 0; }\n var i = new Item(this, \"getWOPIFrameUrl(@action)\");\n i._query.add(\"@action\", action);\n return i.post().then(function (data) {\n return data.GetWOPIFrameUrl;\n });\n };\n Item.prototype.validateUpdateListItem = function (formValues, newDocumentUpdate) {\n if (newDocumentUpdate === void 0) { newDocumentUpdate = false; }\n var postBody = JSON.stringify({ \"formValues\": formValues, bNewDocumentUpdate: newDocumentUpdate });\n var item = new Item(this, \"validateupdatelistitem\");\n return item.post({ body: postBody });\n };\n return Item;\n}(queryablesecurable_1.QueryableSecurable));\nexports.Item = Item;\nvar PagedItemCollection = (function () {\n function PagedItemCollection(nextUrl, results) {\n this.nextUrl = nextUrl;\n this.results = results;\n }\n Object.defineProperty(PagedItemCollection.prototype, \"hasNext\", {\n get: function () {\n return typeof this.nextUrl === \"string\" && this.nextUrl.length > 0;\n },\n enumerable: true,\n configurable: true\n });\n PagedItemCollection.prototype.getNext = function () {\n if (this.hasNext) {\n var items = new Items(this.nextUrl, null);\n return items.getPaged();\n }\n return new Promise(function (r) { return r(null); });\n };\n return PagedItemCollection;\n}());\nexports.PagedItemCollection = PagedItemCollection;\nvar PagedItemCollectionParser = (function (_super) {\n __extends(PagedItemCollectionParser, _super);\n function PagedItemCollectionParser() {\n _super.apply(this, arguments);\n }\n PagedItemCollectionParser.prototype.parse = function (r) {\n var _this = this;\n return r.json().then(function (json) {\n var nextUrl = json.hasOwnProperty(\"d\") && json.d.hasOwnProperty(\"__next\") ? json.d.__next : json[\"odata.nextLink\"];\n return new PagedItemCollection(nextUrl, _this.parseODataJSON(json));\n });\n };\n return PagedItemCollectionParser;\n}(odata_1.ODataParserBase));\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar items_1 = require(\"./items\");\nvar views_1 = require(\"./views\");\nvar contenttypes_1 = require(\"./contenttypes\");\nvar fields_1 = require(\"./fields\");\nvar forms_1 = require(\"./forms\");\nvar subscriptions_1 = require(\"./subscriptions\");\nvar queryable_1 = require(\"./queryable\");\nvar queryablesecurable_1 = require(\"./queryablesecurable\");\nvar util_1 = require(\"../../utils/util\");\nvar usercustomactions_1 = require(\"./usercustomactions\");\nvar odata_1 = require(\"./odata\");\nvar Lists = (function (_super) {\n __extends(Lists, _super);\n function Lists(baseUrl, path) {\n if (path === void 0) { path = \"lists\"; }\n _super.call(this, baseUrl, path);\n }\n Lists.prototype.getByTitle = function (title) {\n return new List(this, \"getByTitle('\" + title + \"')\");\n };\n Lists.prototype.getById = function (id) {\n var list = new List(this);\n list.concat(\"('\" + id + \"')\");\n return list;\n };\n Lists.prototype.add = function (title, description, template, enableContentTypes, additionalSettings) {\n var _this = this;\n if (description === void 0) { description = \"\"; }\n if (template === void 0) { template = 100; }\n if (enableContentTypes === void 0) { enableContentTypes = false; }\n if (additionalSettings === void 0) { additionalSettings = {}; }\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": \"SP.List\" },\n \"AllowContentTypes\": enableContentTypes,\n \"BaseTemplate\": template,\n \"ContentTypesEnabled\": enableContentTypes,\n \"Description\": description,\n \"Title\": title,\n }, additionalSettings));\n return this.post({ body: postBody }).then(function (data) {\n return { data: data, list: _this.getByTitle(title) };\n });\n };\n Lists.prototype.ensure = function (title, description, template, enableContentTypes, additionalSettings) {\n var _this = this;\n if (description === void 0) { description = \"\"; }\n if (template === void 0) { template = 100; }\n if (enableContentTypes === void 0) { enableContentTypes = false; }\n if (additionalSettings === void 0) { additionalSettings = {}; }\n if (this.hasBatch) {\n throw new Error(\"The ensure method is not supported as part of a batch.\");\n }\n return new Promise(function (resolve, reject) {\n var list = _this.getByTitle(title);\n list.get().then(function (d) { return resolve({ created: false, data: d, list: list }); }).catch(function () {\n _this.add(title, description, template, enableContentTypes, additionalSettings).then(function (r) {\n resolve({ created: true, data: r.data, list: _this.getByTitle(title) });\n });\n }).catch(function (e) { return reject(e); });\n });\n };\n Lists.prototype.ensureSiteAssetsLibrary = function () {\n var q = new Lists(this, \"ensuresiteassetslibrary\");\n return q.post().then(function (json) {\n return new List(odata_1.extractOdataId(json));\n });\n };\n Lists.prototype.ensureSitePagesLibrary = function () {\n var q = new Lists(this, \"ensuresitepageslibrary\");\n return q.post().then(function (json) {\n return new List(odata_1.extractOdataId(json));\n });\n };\n return Lists;\n}(queryable_1.QueryableCollection));\nexports.Lists = Lists;\nvar List = (function (_super) {\n __extends(List, _super);\n function List(baseUrl, path) {\n _super.call(this, baseUrl, path);\n }\n Object.defineProperty(List.prototype, \"contentTypes\", {\n get: function () {\n return new contenttypes_1.ContentTypes(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"items\", {\n get: function () {\n return new items_1.Items(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"views\", {\n get: function () {\n return new views_1.Views(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"fields\", {\n get: function () {\n return new fields_1.Fields(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"forms\", {\n get: function () {\n return new forms_1.Forms(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"defaultView\", {\n get: function () {\n return new queryable_1.QueryableInstance(this, \"DefaultView\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"userCustomActions\", {\n get: function () {\n return new usercustomactions_1.UserCustomActions(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"effectiveBasePermissions\", {\n get: function () {\n return new queryable_1.Queryable(this, \"EffectiveBasePermissions\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"eventReceivers\", {\n get: function () {\n return new queryable_1.QueryableCollection(this, \"EventReceivers\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"relatedFields\", {\n get: function () {\n return new queryable_1.Queryable(this, \"getRelatedFields\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"informationRightsManagementSettings\", {\n get: function () {\n return new queryable_1.Queryable(this, \"InformationRightsManagementSettings\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"subscriptions\", {\n get: function () {\n return new subscriptions_1.Subscriptions(this);\n },\n enumerable: true,\n configurable: true\n });\n List.prototype.getView = function (viewId) {\n return new views_1.View(this, \"getView('\" + viewId + \"')\");\n };\n List.prototype.update = function (properties, eTag) {\n var _this = this;\n if (eTag === void 0) { eTag = \"*\"; }\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": \"SP.List\" },\n }, properties));\n return this.post({\n body: postBody,\n headers: {\n \"IF-Match\": eTag,\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n var retList = _this;\n if (properties.hasOwnProperty(\"Title\")) {\n retList = _this.getParent(List, _this.parentUrl, \"getByTitle('\" + properties[\"Title\"] + \"')\");\n }\n return {\n data: data,\n list: retList,\n };\n });\n };\n List.prototype.delete = function (eTag) {\n if (eTag === void 0) { eTag = \"*\"; }\n return this.post({\n headers: {\n \"IF-Match\": eTag,\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n List.prototype.getChanges = function (query) {\n var postBody = JSON.stringify({ \"query\": util_1.Util.extend({ \"__metadata\": { \"type\": \"SP.ChangeQuery\" } }, query) });\n var q = new List(this, \"getchanges\");\n return q.post({ body: postBody });\n };\n List.prototype.getItemsByCAMLQuery = function (query) {\n var expands = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n expands[_i - 1] = arguments[_i];\n }\n var postBody = JSON.stringify({ \"query\": util_1.Util.extend({ \"__metadata\": { \"type\": \"SP.CamlQuery\" } }, query) });\n var q = new List(this, \"getitems\");\n q = q.expand.apply(q, expands);\n return q.post({ body: postBody });\n };\n List.prototype.getListItemChangesSinceToken = function (query) {\n var postBody = JSON.stringify({ \"query\": util_1.Util.extend({ \"__metadata\": { \"type\": \"SP.ChangeLogItemQuery\" } }, query) });\n var q = new List(this, \"getlistitemchangessincetoken\");\n return q.post({ body: postBody }, { parse: function (r) { return r.text(); } });\n };\n List.prototype.recycle = function () {\n this.append(\"recycle\");\n return this.post().then(function (data) {\n if (data.hasOwnProperty(\"Recycle\")) {\n return data.Recycle;\n }\n else {\n return data;\n }\n });\n };\n List.prototype.renderListData = function (viewXml) {\n var q = new List(this, \"renderlistdata(@viewXml)\");\n q.query.add(\"@viewXml\", \"'\" + viewXml + \"'\");\n return q.post().then(function (data) {\n data = JSON.parse(data);\n if (data.hasOwnProperty(\"RenderListData\")) {\n return data.RenderListData;\n }\n else {\n return data;\n }\n });\n };\n List.prototype.renderListFormData = function (itemId, formId, mode) {\n var q = new List(this, \"renderlistformdata(itemid=\" + itemId + \", formid='\" + formId + \"', mode=\" + mode + \")\");\n return q.post().then(function (data) {\n data = JSON.parse(data);\n if (data.hasOwnProperty(\"ListData\")) {\n return data.ListData;\n }\n else {\n return data;\n }\n });\n };\n List.prototype.reserveListItemId = function () {\n var q = new List(this, \"reservelistitemid\");\n return q.post().then(function (data) {\n if (data.hasOwnProperty(\"ReserveListItemId\")) {\n return data.ReserveListItemId;\n }\n else {\n return data;\n }\n });\n };\n return List;\n}(queryablesecurable_1.QueryableSecurable));\nexports.List = List;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar quicklaunch_1 = require(\"./quicklaunch\");\nvar topnavigationbar_1 = require(\"./topnavigationbar\");\nvar Navigation = (function (_super) {\n __extends(Navigation, _super);\n function Navigation(baseUrl) {\n _super.call(this, baseUrl, \"navigation\");\n }\n Object.defineProperty(Navigation.prototype, \"quicklaunch\", {\n get: function () {\n return new quicklaunch_1.QuickLaunch(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Navigation.prototype, \"topNavigationBar\", {\n get: function () {\n return new topnavigationbar_1.TopNavigationBar(this);\n },\n enumerable: true,\n configurable: true\n });\n return Navigation;\n}(queryable_1.Queryable));\nexports.Navigation = Navigation;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar util_1 = require(\"../../utils/util\");\nvar logging_1 = require(\"../../utils/logging\");\nvar httpclient_1 = require(\"../../net/httpclient\");\nvar pnplibconfig_1 = require(\"../../configuration/pnplibconfig\");\nfunction extractOdataId(candidate) {\n if (candidate.hasOwnProperty(\"odata.id\")) {\n return candidate[\"odata.id\"];\n }\n else if (candidate.hasOwnProperty(\"__metadata\") && candidate.__metadata.hasOwnProperty(\"id\")) {\n return candidate.__metadata.id;\n }\n else {\n logging_1.Logger.log({\n data: candidate,\n level: logging_1.LogLevel.Error,\n message: \"Could not extract odata id in object, you may be using nometadata. Object data logged to logger.\",\n });\n throw new Error(\"Could not extract odata id in object, you may be using nometadata. Object data logged to logger.\");\n }\n}\nexports.extractOdataId = extractOdataId;\nvar ODataParserBase = (function () {\n function ODataParserBase() {\n }\n ODataParserBase.prototype.parse = function (r) {\n var _this = this;\n return r.json().then(function (json) { return _this.parseODataJSON(json); });\n };\n ODataParserBase.prototype.parseODataJSON = function (json) {\n var result = json;\n if (json.hasOwnProperty(\"d\")) {\n if (json.d.hasOwnProperty(\"results\")) {\n result = json.d.results;\n }\n else {\n result = json.d;\n }\n }\n else if (json.hasOwnProperty(\"value\")) {\n result = json.value;\n }\n return result;\n };\n return ODataParserBase;\n}());\nexports.ODataParserBase = ODataParserBase;\nvar ODataDefaultParser = (function (_super) {\n __extends(ODataDefaultParser, _super);\n function ODataDefaultParser() {\n _super.apply(this, arguments);\n }\n return ODataDefaultParser;\n}(ODataParserBase));\nexports.ODataDefaultParser = ODataDefaultParser;\nvar ODataRawParserImpl = (function () {\n function ODataRawParserImpl() {\n }\n ODataRawParserImpl.prototype.parse = function (r) {\n return r.json();\n };\n return ODataRawParserImpl;\n}());\nexports.ODataRawParserImpl = ODataRawParserImpl;\nvar ODataValueParserImpl = (function (_super) {\n __extends(ODataValueParserImpl, _super);\n function ODataValueParserImpl() {\n _super.apply(this, arguments);\n }\n ODataValueParserImpl.prototype.parse = function (r) {\n return _super.prototype.parse.call(this, r).then(function (d) { return d; });\n };\n return ODataValueParserImpl;\n}(ODataParserBase));\nvar ODataEntityParserImpl = (function (_super) {\n __extends(ODataEntityParserImpl, _super);\n function ODataEntityParserImpl(factory) {\n _super.call(this);\n this.factory = factory;\n }\n ODataEntityParserImpl.prototype.parse = function (r) {\n var _this = this;\n return _super.prototype.parse.call(this, r).then(function (d) {\n var o = new _this.factory(getEntityUrl(d), null);\n return util_1.Util.extend(o, d);\n });\n };\n return ODataEntityParserImpl;\n}(ODataParserBase));\nvar ODataEntityArrayParserImpl = (function (_super) {\n __extends(ODataEntityArrayParserImpl, _super);\n function ODataEntityArrayParserImpl(factory) {\n _super.call(this);\n this.factory = factory;\n }\n ODataEntityArrayParserImpl.prototype.parse = function (r) {\n var _this = this;\n return _super.prototype.parse.call(this, r).then(function (d) {\n return d.map(function (v) {\n var o = new _this.factory(getEntityUrl(v), null);\n return util_1.Util.extend(o, v);\n });\n });\n };\n return ODataEntityArrayParserImpl;\n}(ODataParserBase));\nfunction getEntityUrl(entity) {\n if (entity.hasOwnProperty(\"__metadata\")) {\n return entity.__metadata.uri;\n }\n else if (entity.hasOwnProperty(\"odata.editLink\")) {\n return util_1.Util.combinePaths(\"_api\", entity[\"odata.editLink\"]);\n }\n else {\n logging_1.Logger.write(\"No uri information found in ODataEntity parsing, chaining will fail for this object.\", logging_1.LogLevel.Warning);\n return \"\";\n }\n}\nexports.ODataRaw = new ODataRawParserImpl();\nfunction ODataValue() {\n return new ODataValueParserImpl();\n}\nexports.ODataValue = ODataValue;\nfunction ODataEntity(factory) {\n return new ODataEntityParserImpl(factory);\n}\nexports.ODataEntity = ODataEntity;\nfunction ODataEntityArray(factory) {\n return new ODataEntityArrayParserImpl(factory);\n}\nexports.ODataEntityArray = ODataEntityArray;\nvar ODataBatch = (function () {\n function ODataBatch(baseUrl, _batchId) {\n if (_batchId === void 0) { _batchId = util_1.Util.getGUID(); }\n this.baseUrl = baseUrl;\n this._batchId = _batchId;\n this._requests = [];\n this._batchDependencies = Promise.resolve();\n }\n ODataBatch.prototype.add = function (url, method, options, parser) {\n var info = {\n method: method.toUpperCase(),\n options: options,\n parser: parser,\n reject: null,\n resolve: null,\n url: url,\n };\n var p = new Promise(function (resolve, reject) {\n info.resolve = resolve;\n info.reject = reject;\n });\n this._requests.push(info);\n return p;\n };\n ODataBatch.prototype.addBatchDependency = function () {\n var resolver;\n var promise = new Promise(function (resolve) {\n resolver = resolve;\n });\n this._batchDependencies = this._batchDependencies.then(function () { return promise; });\n return resolver;\n };\n ODataBatch.prototype.execute = function () {\n var _this = this;\n return this._batchDependencies.then(function () { return _this.executeImpl(); });\n };\n ODataBatch.prototype.executeImpl = function () {\n var _this = this;\n if (this._requests.length < 1) {\n return Promise.resolve();\n }\n var batchBody = [];\n var currentChangeSetId = \"\";\n this._requests.forEach(function (reqInfo, index) {\n if (reqInfo.method === \"GET\") {\n if (currentChangeSetId.length > 0) {\n batchBody.push(\"--changeset_\" + currentChangeSetId + \"--\\n\\n\");\n currentChangeSetId = \"\";\n }\n batchBody.push(\"--batch_\" + _this._batchId + \"\\n\");\n }\n else {\n if (currentChangeSetId.length < 1) {\n currentChangeSetId = util_1.Util.getGUID();\n batchBody.push(\"--batch_\" + _this._batchId + \"\\n\");\n batchBody.push(\"Content-Type: multipart/mixed; boundary=\\\"changeset_\" + currentChangeSetId + \"\\\"\\n\\n\");\n }\n batchBody.push(\"--changeset_\" + currentChangeSetId + \"\\n\");\n }\n batchBody.push(\"Content-Type: application/http\\n\");\n batchBody.push(\"Content-Transfer-Encoding: binary\\n\\n\");\n var headers = {\n \"Accept\": \"application/json;\",\n };\n if (reqInfo.method !== \"GET\") {\n var method = reqInfo.method;\n if (reqInfo.options && reqInfo.options.headers && reqInfo.options.headers[\"X-HTTP-Method\"] !== typeof undefined) {\n method = reqInfo.options.headers[\"X-HTTP-Method\"];\n delete reqInfo.options.headers[\"X-HTTP-Method\"];\n }\n batchBody.push(method + \" \" + reqInfo.url + \" HTTP/1.1\\n\");\n headers = util_1.Util.extend(headers, { \"Content-Type\": \"application/json;odata=verbose;charset=utf-8\" });\n }\n else {\n batchBody.push(reqInfo.method + \" \" + reqInfo.url + \" HTTP/1.1\\n\");\n }\n if (typeof pnplibconfig_1.RuntimeConfig.headers !== \"undefined\") {\n headers = util_1.Util.extend(headers, pnplibconfig_1.RuntimeConfig.headers);\n }\n if (reqInfo.options && reqInfo.options.headers) {\n headers = util_1.Util.extend(headers, reqInfo.options.headers);\n }\n for (var name_1 in headers) {\n if (headers.hasOwnProperty(name_1)) {\n batchBody.push(name_1 + \": \" + headers[name_1] + \"\\n\");\n }\n }\n batchBody.push(\"\\n\");\n if (reqInfo.options.body) {\n batchBody.push(reqInfo.options.body + \"\\n\\n\");\n }\n });\n if (currentChangeSetId.length > 0) {\n batchBody.push(\"--changeset_\" + currentChangeSetId + \"--\\n\\n\");\n currentChangeSetId = \"\";\n }\n batchBody.push(\"--batch_\" + this._batchId + \"--\\n\");\n var batchHeaders = {\n \"Content-Type\": \"multipart/mixed; boundary=batch_\" + this._batchId,\n };\n var batchOptions = {\n \"body\": batchBody.join(\"\"),\n \"headers\": batchHeaders,\n };\n var client = new httpclient_1.HttpClient();\n var requestUrl = util_1.Util.makeUrlAbsolute(util_1.Util.combinePaths(this.baseUrl, \"/_api/$batch\"));\n return client.post(requestUrl, batchOptions)\n .then(function (r) { return r.text(); })\n .then(this._parseResponse)\n .then(function (responses) {\n if (responses.length !== _this._requests.length) {\n throw new Error(\"Could not properly parse responses to match requests in batch.\");\n }\n var chain = Promise.resolve();\n var _loop_1 = function(i) {\n var request = _this._requests[i];\n var response = responses[i];\n if (!response.ok) {\n request.reject(new Error(response.statusText));\n }\n chain = chain.then(function (_) { return request.parser.parse(response).then(request.resolve).catch(request.reject); });\n };\n for (var i = 0; i < responses.length; i++) {\n _loop_1(i);\n }\n return chain;\n });\n };\n ODataBatch.prototype._parseResponse = function (body) {\n return new Promise(function (resolve, reject) {\n var responses = [];\n var header = \"--batchresponse_\";\n var statusRegExp = new RegExp(\"^HTTP/[0-9.]+ +([0-9]+) +(.*)\", \"i\");\n var lines = body.split(\"\\n\");\n var state = \"batch\";\n var status;\n var statusText;\n for (var i = 0; i < lines.length; ++i) {\n var line = lines[i];\n switch (state) {\n case \"batch\":\n if (line.substr(0, header.length) === header) {\n state = \"batchHeaders\";\n }\n else {\n if (line.trim() !== \"\") {\n throw new Error(\"Invalid response, line \" + i);\n }\n }\n break;\n case \"batchHeaders\":\n if (line.trim() === \"\") {\n state = \"status\";\n }\n break;\n case \"status\":\n var parts = statusRegExp.exec(line);\n if (parts.length !== 3) {\n throw new Error(\"Invalid status, line \" + i);\n }\n status = parseInt(parts[1], 10);\n statusText = parts[2];\n state = \"statusHeaders\";\n break;\n case \"statusHeaders\":\n if (line.trim() === \"\") {\n state = \"body\";\n }\n break;\n case \"body\":\n var response = void 0;\n if (status === 204) {\n response = new Response();\n }\n else {\n response = new Response(line, { status: status, statusText: statusText });\n }\n responses.push(response);\n state = \"batch\";\n break;\n }\n }\n if (state !== \"status\") {\n reject(new Error(\"Unexpected end of input\"));\n }\n resolve(responses);\n });\n };\n return ODataBatch;\n}());\nexports.ODataBatch = ODataBatch;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar util_1 = require(\"../../utils/util\");\nvar logging_1 = require(\"../../utils/logging\");\nvar collections_1 = require(\"../../collections/collections\");\nvar httpclient_1 = require(\"../../net/httpclient\");\nvar odata_1 = require(\"./odata\");\nvar caching_1 = require(\"./caching\");\nvar pnplibconfig_1 = require(\"../../configuration/pnplibconfig\");\nvar Queryable = (function () {\n function Queryable(baseUrl, path) {\n this._query = new collections_1.Dictionary();\n this._batch = null;\n if (typeof baseUrl === \"string\") {\n var urlStr = baseUrl;\n if (util_1.Util.isUrlAbsolute(urlStr) || urlStr.lastIndexOf(\"/\") < 0) {\n this._parentUrl = urlStr;\n this._url = util_1.Util.combinePaths(urlStr, path);\n }\n else if (urlStr.lastIndexOf(\"/\") > urlStr.lastIndexOf(\"(\")) {\n var index = urlStr.lastIndexOf(\"/\");\n this._parentUrl = urlStr.slice(0, index);\n path = util_1.Util.combinePaths(urlStr.slice(index), path);\n this._url = util_1.Util.combinePaths(this._parentUrl, path);\n }\n else {\n var index = urlStr.lastIndexOf(\"(\");\n this._parentUrl = urlStr.slice(0, index);\n this._url = util_1.Util.combinePaths(urlStr, path);\n }\n }\n else {\n var q = baseUrl;\n this._parentUrl = q._url;\n var target = q._query.get(\"@target\");\n if (target !== null) {\n this._query.add(\"@target\", target);\n }\n this._url = util_1.Util.combinePaths(this._parentUrl, path);\n }\n }\n Queryable.prototype.concat = function (pathPart) {\n this._url += pathPart;\n };\n Queryable.prototype.append = function (pathPart) {\n this._url = util_1.Util.combinePaths(this._url, pathPart);\n };\n Queryable.prototype.addBatchDependency = function () {\n if (this.hasBatch) {\n return this._batch.addBatchDependency();\n }\n return function () { return null; };\n };\n Object.defineProperty(Queryable.prototype, \"hasBatch\", {\n get: function () {\n return this._batch !== null;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Queryable.prototype, \"parentUrl\", {\n get: function () {\n return this._parentUrl;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Queryable.prototype, \"query\", {\n get: function () {\n return this._query;\n },\n enumerable: true,\n configurable: true\n });\n Queryable.prototype.inBatch = function (batch) {\n if (this._batch !== null) {\n throw new Error(\"This query is already part of a batch.\");\n }\n this._batch = batch;\n return this;\n };\n Queryable.prototype.usingCaching = function (options) {\n if (!pnplibconfig_1.RuntimeConfig.globalCacheDisable) {\n this._useCaching = true;\n this._cachingOptions = options;\n }\n return this;\n };\n Queryable.prototype.toUrl = function () {\n return util_1.Util.makeUrlAbsolute(this._url);\n };\n Queryable.prototype.toUrlAndQuery = function () {\n var _this = this;\n var url = this.toUrl();\n if (this._query.count() > 0) {\n url += \"?\";\n var keys = this._query.getKeys();\n url += keys.map(function (key, ix, arr) { return (key + \"=\" + _this._query.get(key)); }).join(\"&\");\n }\n return url;\n };\n Queryable.prototype.get = function (parser, getOptions) {\n if (parser === void 0) { parser = new odata_1.ODataDefaultParser(); }\n if (getOptions === void 0) { getOptions = {}; }\n return this.getImpl(getOptions, parser);\n };\n Queryable.prototype.getAs = function (parser, getOptions) {\n if (parser === void 0) { parser = new odata_1.ODataDefaultParser(); }\n if (getOptions === void 0) { getOptions = {}; }\n return this.getImpl(getOptions, parser);\n };\n Queryable.prototype.post = function (postOptions, parser) {\n if (postOptions === void 0) { postOptions = {}; }\n if (parser === void 0) { parser = new odata_1.ODataDefaultParser(); }\n return this.postImpl(postOptions, parser);\n };\n Queryable.prototype.postAs = function (postOptions, parser) {\n if (postOptions === void 0) { postOptions = {}; }\n if (parser === void 0) { parser = new odata_1.ODataDefaultParser(); }\n return this.postImpl(postOptions, parser);\n };\n Queryable.prototype.patch = function (patchOptions, parser) {\n if (patchOptions === void 0) { patchOptions = {}; }\n if (parser === void 0) { parser = new odata_1.ODataDefaultParser(); }\n return this.patchImpl(patchOptions, parser);\n };\n Queryable.prototype.delete = function (deleteOptions, parser) {\n if (deleteOptions === void 0) { deleteOptions = {}; }\n if (parser === void 0) { parser = new odata_1.ODataDefaultParser(); }\n return this.deleteImpl(deleteOptions, parser);\n };\n Queryable.prototype.getParent = function (factory, baseUrl, path) {\n if (baseUrl === void 0) { baseUrl = this.parentUrl; }\n var parent = new factory(baseUrl, path);\n var target = this.query.get(\"@target\");\n if (target !== null) {\n parent.query.add(\"@target\", target);\n }\n return parent;\n };\n Queryable.prototype.getImpl = function (getOptions, parser) {\n var _this = this;\n if (getOptions === void 0) { getOptions = {}; }\n if (this._useCaching) {\n var options = new caching_1.CachingOptions(this.toUrlAndQuery().toLowerCase());\n if (typeof this._cachingOptions !== \"undefined\") {\n options = util_1.Util.extend(options, this._cachingOptions);\n }\n if (options.store !== null) {\n var data_1 = options.store.get(options.key);\n if (data_1 !== null) {\n return new Promise(function (resolve) { return resolve(data_1); });\n }\n }\n parser = new caching_1.CachingParserWrapper(parser, options);\n }\n if (!this.hasBatch) {\n var client = new httpclient_1.HttpClient();\n return client.get(this.toUrlAndQuery(), getOptions).then(function (response) {\n return _this.processHttpClientResponse(response, parser);\n });\n }\n else {\n return this._batch.add(this.toUrlAndQuery(), \"GET\", getOptions, parser);\n }\n };\n Queryable.prototype.postImpl = function (postOptions, parser) {\n var _this = this;\n if (!this.hasBatch) {\n var client = new httpclient_1.HttpClient();\n return client.post(this.toUrlAndQuery(), postOptions).then(function (response) {\n return _this.processHttpClientResponse(response, parser);\n });\n }\n else {\n return this._batch.add(this.toUrlAndQuery(), \"POST\", postOptions, parser);\n }\n };\n Queryable.prototype.patchImpl = function (patchOptions, parser) {\n var _this = this;\n if (!this.hasBatch) {\n var client = new httpclient_1.HttpClient();\n return client.patch(this.toUrlAndQuery(), patchOptions).then(function (response) {\n return _this.processHttpClientResponse(response, parser);\n });\n }\n else {\n return this._batch.add(this.toUrlAndQuery(), \"PATCH\", patchOptions, parser);\n }\n };\n Queryable.prototype.deleteImpl = function (deleteOptions, parser) {\n var _this = this;\n if (!this.hasBatch) {\n var client = new httpclient_1.HttpClient();\n return client.delete(this.toUrlAndQuery(), deleteOptions).then(function (response) {\n return _this.processHttpClientResponse(response, parser);\n });\n }\n else {\n return this._batch.add(this.toUrlAndQuery(), \"DELETE\", deleteOptions, parser);\n }\n };\n Queryable.prototype.processHttpClientResponse = function (response, parser) {\n if (!response.ok) {\n response.text().then(function (text) {\n logging_1.Logger.log({\n data: response,\n level: logging_1.LogLevel.Error,\n message: text,\n });\n throw \"Error making HttpClient request in queryable: \" + response.statusText;\n });\n }\n if ((response.headers.has(\"Content-Length\") && parseFloat(response.headers.get(\"Content-Length\")) === 0)\n || response.status === 204) {\n return new Promise(function (resolve, reject) { resolve({}); });\n }\n return parser.parse(response);\n };\n return Queryable;\n}());\nexports.Queryable = Queryable;\nvar QueryableCollection = (function (_super) {\n __extends(QueryableCollection, _super);\n function QueryableCollection() {\n _super.apply(this, arguments);\n }\n QueryableCollection.prototype.filter = function (filter) {\n this._query.add(\"$filter\", filter);\n return this;\n };\n QueryableCollection.prototype.select = function () {\n var selects = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n selects[_i - 0] = arguments[_i];\n }\n this._query.add(\"$select\", selects.join(\",\"));\n return this;\n };\n QueryableCollection.prototype.expand = function () {\n var expands = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n expands[_i - 0] = arguments[_i];\n }\n this._query.add(\"$expand\", expands.join(\",\"));\n return this;\n };\n QueryableCollection.prototype.orderBy = function (orderBy, ascending) {\n if (ascending === void 0) { ascending = true; }\n var keys = this._query.getKeys();\n var query = [];\n var asc = ascending ? \" asc\" : \" desc\";\n for (var i = 0; i < keys.length; i++) {\n if (keys[i] === \"$orderby\") {\n query.push(this._query.get(\"$orderby\"));\n break;\n }\n }\n query.push(\"\" + orderBy + asc);\n this._query.add(\"$orderby\", query.join(\",\"));\n return this;\n };\n QueryableCollection.prototype.skip = function (skip) {\n this._query.add(\"$skip\", skip.toString());\n return this;\n };\n QueryableCollection.prototype.top = function (top) {\n this._query.add(\"$top\", top.toString());\n return this;\n };\n return QueryableCollection;\n}(Queryable));\nexports.QueryableCollection = QueryableCollection;\nvar QueryableInstance = (function (_super) {\n __extends(QueryableInstance, _super);\n function QueryableInstance() {\n _super.apply(this, arguments);\n }\n QueryableInstance.prototype.select = function () {\n var selects = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n selects[_i - 0] = arguments[_i];\n }\n this._query.add(\"$select\", selects.join(\",\"));\n return this;\n };\n QueryableInstance.prototype.expand = function () {\n var expands = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n expands[_i - 0] = arguments[_i];\n }\n this._query.add(\"$expand\", expands.join(\",\"));\n return this;\n };\n return QueryableInstance;\n}(Queryable));\nexports.QueryableInstance = QueryableInstance;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar roles_1 = require(\"./roles\");\nvar queryable_1 = require(\"./queryable\");\nvar QueryableSecurable = (function (_super) {\n __extends(QueryableSecurable, _super);\n function QueryableSecurable() {\n _super.apply(this, arguments);\n }\n Object.defineProperty(QueryableSecurable.prototype, \"roleAssignments\", {\n get: function () {\n return new roles_1.RoleAssignments(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(QueryableSecurable.prototype, \"firstUniqueAncestorSecurableObject\", {\n get: function () {\n this.append(\"FirstUniqueAncestorSecurableObject\");\n return new queryable_1.QueryableInstance(this);\n },\n enumerable: true,\n configurable: true\n });\n QueryableSecurable.prototype.getUserEffectivePermissions = function (loginName) {\n this.append(\"getUserEffectivePermissions(@user)\");\n this._query.add(\"@user\", \"'\" + encodeURIComponent(loginName) + \"'\");\n return new queryable_1.Queryable(this);\n };\n QueryableSecurable.prototype.breakRoleInheritance = function (copyRoleAssignments, clearSubscopes) {\n if (copyRoleAssignments === void 0) { copyRoleAssignments = false; }\n if (clearSubscopes === void 0) { clearSubscopes = false; }\n var Breaker = (function (_super) {\n __extends(Breaker, _super);\n function Breaker(baseUrl, copy, clear) {\n _super.call(this, baseUrl, \"breakroleinheritance(copyroleassignments=\" + copy + \", clearsubscopes=\" + clear + \")\");\n }\n Breaker.prototype.break = function () {\n return this.post();\n };\n return Breaker;\n }(queryable_1.Queryable));\n var b = new Breaker(this, copyRoleAssignments, clearSubscopes);\n return b.break();\n };\n QueryableSecurable.prototype.resetRoleInheritance = function () {\n var Resetter = (function (_super) {\n __extends(Resetter, _super);\n function Resetter(baseUrl) {\n _super.call(this, baseUrl, \"resetroleinheritance\");\n }\n Resetter.prototype.reset = function () {\n return this.post();\n };\n return Resetter;\n }(queryable_1.Queryable));\n var r = new Resetter(this);\n return r.reset();\n };\n return QueryableSecurable;\n}(queryable_1.QueryableInstance));\nexports.QueryableSecurable = QueryableSecurable;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar QuickLaunch = (function (_super) {\n __extends(QuickLaunch, _super);\n function QuickLaunch(baseUrl) {\n _super.call(this, baseUrl, \"QuickLaunch\");\n }\n return QuickLaunch;\n}(queryable_1.Queryable));\nexports.QuickLaunch = QuickLaunch;\n","\"use strict\";\nvar search_1 = require(\"./search\");\nvar searchsuggest_1 = require(\"./searchsuggest\");\nvar site_1 = require(\"./site\");\nvar webs_1 = require(\"./webs\");\nvar util_1 = require(\"../../utils/util\");\nvar userprofiles_1 = require(\"./userprofiles\");\nvar Rest = (function () {\n function Rest() {\n }\n Rest.prototype.searchSuggest = function (query) {\n var finalQuery;\n if (typeof query === \"string\") {\n finalQuery = { querytext: query };\n }\n else {\n finalQuery = query;\n }\n return new searchsuggest_1.SearchSuggest(\"\").execute(finalQuery);\n };\n Rest.prototype.search = function (query) {\n var finalQuery;\n if (typeof query === \"string\") {\n finalQuery = { Querytext: query };\n }\n else {\n finalQuery = query;\n }\n return new search_1.Search(\"\").execute(finalQuery);\n };\n Object.defineProperty(Rest.prototype, \"site\", {\n get: function () {\n return new site_1.Site(\"\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Rest.prototype, \"web\", {\n get: function () {\n return new webs_1.Web(\"\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Rest.prototype, \"profiles\", {\n get: function () {\n return new userprofiles_1.UserProfileQuery(\"\");\n },\n enumerable: true,\n configurable: true\n });\n Rest.prototype.createBatch = function () {\n return this.web.createBatch();\n };\n Rest.prototype.crossDomainSite = function (addInWebUrl, hostWebUrl) {\n return this._cdImpl(site_1.Site, addInWebUrl, hostWebUrl, \"site\");\n };\n Rest.prototype.crossDomainWeb = function (addInWebUrl, hostWebUrl) {\n return this._cdImpl(webs_1.Web, addInWebUrl, hostWebUrl, \"web\");\n };\n Rest.prototype._cdImpl = function (factory, addInWebUrl, hostWebUrl, urlPart) {\n if (!util_1.Util.isUrlAbsolute(addInWebUrl)) {\n throw \"The addInWebUrl parameter must be an absolute url.\";\n }\n if (!util_1.Util.isUrlAbsolute(hostWebUrl)) {\n throw \"The hostWebUrl parameter must be an absolute url.\";\n }\n var url = util_1.Util.combinePaths(addInWebUrl, \"_api/SP.AppContextSite(@target)\");\n var instance = new factory(url, urlPart);\n instance.query.add(\"@target\", \"'\" + encodeURIComponent(hostWebUrl) + \"'\");\n return instance;\n };\n return Rest;\n}());\nexports.Rest = Rest;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar sitegroups_1 = require(\"./sitegroups\");\nvar util_1 = require(\"../../utils/util\");\nvar RoleAssignments = (function (_super) {\n __extends(RoleAssignments, _super);\n function RoleAssignments(baseUrl, path) {\n if (path === void 0) { path = \"roleassignments\"; }\n _super.call(this, baseUrl, path);\n }\n RoleAssignments.prototype.add = function (principalId, roleDefId) {\n var a = new RoleAssignments(this, \"addroleassignment(principalid=\" + principalId + \", roledefid=\" + roleDefId + \")\");\n return a.post();\n };\n RoleAssignments.prototype.remove = function (principalId, roleDefId) {\n var a = new RoleAssignments(this, \"removeroleassignment(principalid=\" + principalId + \", roledefid=\" + roleDefId + \")\");\n return a.post();\n };\n RoleAssignments.prototype.getById = function (id) {\n var ra = new RoleAssignment(this);\n ra.concat(\"(\" + id + \")\");\n return ra;\n };\n return RoleAssignments;\n}(queryable_1.QueryableCollection));\nexports.RoleAssignments = RoleAssignments;\nvar RoleAssignment = (function (_super) {\n __extends(RoleAssignment, _super);\n function RoleAssignment(baseUrl, path) {\n _super.call(this, baseUrl, path);\n }\n Object.defineProperty(RoleAssignment.prototype, \"groups\", {\n get: function () {\n return new sitegroups_1.SiteGroups(this, \"groups\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RoleAssignment.prototype, \"bindings\", {\n get: function () {\n return new RoleDefinitionBindings(this);\n },\n enumerable: true,\n configurable: true\n });\n RoleAssignment.prototype.delete = function () {\n return this.post({\n headers: {\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n return RoleAssignment;\n}(queryable_1.QueryableInstance));\nexports.RoleAssignment = RoleAssignment;\nvar RoleDefinitions = (function (_super) {\n __extends(RoleDefinitions, _super);\n function RoleDefinitions(baseUrl, path) {\n if (path === void 0) { path = \"roledefinitions\"; }\n _super.call(this, baseUrl, path);\n }\n RoleDefinitions.prototype.getById = function (id) {\n return new RoleDefinition(this, \"getById(\" + id + \")\");\n };\n RoleDefinitions.prototype.getByName = function (name) {\n return new RoleDefinition(this, \"getbyname('\" + name + \"')\");\n };\n RoleDefinitions.prototype.getByType = function (roleTypeKind) {\n return new RoleDefinition(this, \"getbytype(\" + roleTypeKind + \")\");\n };\n RoleDefinitions.prototype.add = function (name, description, order, basePermissions) {\n var _this = this;\n var postBody = JSON.stringify({\n BasePermissions: util_1.Util.extend({ __metadata: { type: \"SP.BasePermissions\" } }, basePermissions),\n Description: description,\n Name: name,\n Order: order,\n __metadata: { \"type\": \"SP.RoleDefinition\" },\n });\n return this.post({ body: postBody }).then(function (data) {\n return {\n data: data,\n definition: _this.getById(data.Id),\n };\n });\n };\n return RoleDefinitions;\n}(queryable_1.QueryableCollection));\nexports.RoleDefinitions = RoleDefinitions;\nvar RoleDefinition = (function (_super) {\n __extends(RoleDefinition, _super);\n function RoleDefinition(baseUrl, path) {\n _super.call(this, baseUrl, path);\n }\n RoleDefinition.prototype.update = function (properties) {\n var _this = this;\n if (typeof properties.hasOwnProperty(\"BasePermissions\") !== \"undefined\") {\n properties[\"BasePermissions\"] = util_1.Util.extend({ __metadata: { type: \"SP.BasePermissions\" } }, properties[\"BasePermissions\"]);\n }\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": \"SP.RoleDefinition\" },\n }, properties));\n return this.post({\n body: postBody,\n headers: {\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n var retDef = _this;\n if (properties.hasOwnProperty(\"Name\")) {\n var parent_1 = _this.getParent(RoleDefinitions, _this.parentUrl, \"\");\n retDef = parent_1.getByName(properties[\"Name\"]);\n }\n return {\n data: data,\n definition: retDef,\n };\n });\n };\n RoleDefinition.prototype.delete = function () {\n return this.post({\n headers: {\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n return RoleDefinition;\n}(queryable_1.QueryableInstance));\nexports.RoleDefinition = RoleDefinition;\nvar RoleDefinitionBindings = (function (_super) {\n __extends(RoleDefinitionBindings, _super);\n function RoleDefinitionBindings(baseUrl, path) {\n if (path === void 0) { path = \"roledefinitionbindings\"; }\n _super.call(this, baseUrl, path);\n }\n return RoleDefinitionBindings;\n}(queryable_1.QueryableCollection));\nexports.RoleDefinitionBindings = RoleDefinitionBindings;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar util_1 = require(\"../../utils/util\");\nvar Search = (function (_super) {\n __extends(Search, _super);\n function Search(baseUrl, path) {\n if (path === void 0) { path = \"_api/search/postquery\"; }\n _super.call(this, baseUrl, path);\n }\n Search.prototype.execute = function (query) {\n var formattedBody;\n formattedBody = query;\n if (formattedBody.SelectProperties) {\n formattedBody.SelectProperties = { results: query.SelectProperties };\n }\n if (formattedBody.RefinementFilters) {\n formattedBody.RefinementFilters = { results: query.RefinementFilters };\n }\n if (formattedBody.SortList) {\n formattedBody.SortList = { results: query.SortList };\n }\n if (formattedBody.HithighlightedProperties) {\n formattedBody.HithighlightedProperties = { results: query.HithighlightedProperties };\n }\n if (formattedBody.ReorderingRules) {\n formattedBody.ReorderingRules = { results: query.ReorderingRules };\n }\n if (formattedBody.Properties) {\n formattedBody.Properties = { results: query.Properties };\n }\n var postBody = JSON.stringify({\n request: util_1.Util.extend({\n \"__metadata\": { \"type\": \"Microsoft.Office.Server.Search.REST.SearchRequest\" },\n }, formattedBody),\n });\n return this.post({ body: postBody }).then(function (data) { return new SearchResults(data); });\n };\n return Search;\n}(queryable_1.QueryableInstance));\nexports.Search = Search;\nvar SearchResults = (function () {\n function SearchResults(rawResponse) {\n var response = rawResponse.postquery ? rawResponse.postquery : rawResponse;\n this.PrimarySearchResults = this.formatSearchResults(response.PrimaryQueryResult.RelevantResults.Table.Rows);\n this.RawSearchResults = response;\n this.ElapsedTime = response.ElapsedTime;\n this.RowCount = response.PrimaryQueryResult.RelevantResults.RowCount;\n this.TotalRows = response.PrimaryQueryResult.RelevantResults.TotalRows;\n this.TotalRowsIncludingDuplicates = response.PrimaryQueryResult.RelevantResults.TotalRowsIncludingDuplicates;\n }\n SearchResults.prototype.formatSearchResults = function (rawResults) {\n var results = new Array(), tempResults = rawResults.results ? rawResults.results : rawResults;\n for (var _i = 0, tempResults_1 = tempResults; _i < tempResults_1.length; _i++) {\n var i = tempResults_1[_i];\n results.push(new SearchResult(i.Cells));\n }\n return results;\n };\n return SearchResults;\n}());\nexports.SearchResults = SearchResults;\nvar SearchResult = (function () {\n function SearchResult(rawItem) {\n var item = rawItem.results ? rawItem.results : rawItem;\n for (var _i = 0, item_1 = item; _i < item_1.length; _i++) {\n var i = item_1[_i];\n this[i.Key] = i.Value;\n }\n }\n return SearchResult;\n}());\nexports.SearchResult = SearchResult;\n(function (SortDirection) {\n SortDirection[SortDirection[\"Ascending\"] = 0] = \"Ascending\";\n SortDirection[SortDirection[\"Descending\"] = 1] = \"Descending\";\n SortDirection[SortDirection[\"FQLFormula\"] = 2] = \"FQLFormula\";\n})(exports.SortDirection || (exports.SortDirection = {}));\nvar SortDirection = exports.SortDirection;\n(function (ReorderingRuleMatchType) {\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"ResultContainsKeyword\"] = 0] = \"ResultContainsKeyword\";\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"TitleContainsKeyword\"] = 1] = \"TitleContainsKeyword\";\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"TitleMatchesKeyword\"] = 2] = \"TitleMatchesKeyword\";\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"UrlStartsWith\"] = 3] = \"UrlStartsWith\";\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"UrlExactlyMatches\"] = 4] = \"UrlExactlyMatches\";\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"ContentTypeIs\"] = 5] = \"ContentTypeIs\";\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"FileExtensionMatches\"] = 6] = \"FileExtensionMatches\";\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"ResultHasTag\"] = 7] = \"ResultHasTag\";\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"ManualCondition\"] = 8] = \"ManualCondition\";\n})(exports.ReorderingRuleMatchType || (exports.ReorderingRuleMatchType = {}));\nvar ReorderingRuleMatchType = exports.ReorderingRuleMatchType;\n(function (QueryPropertyValueType) {\n QueryPropertyValueType[QueryPropertyValueType[\"None\"] = 0] = \"None\";\n QueryPropertyValueType[QueryPropertyValueType[\"StringType\"] = 1] = \"StringType\";\n QueryPropertyValueType[QueryPropertyValueType[\"Int32TYpe\"] = 2] = \"Int32TYpe\";\n QueryPropertyValueType[QueryPropertyValueType[\"BooleanType\"] = 3] = \"BooleanType\";\n QueryPropertyValueType[QueryPropertyValueType[\"StringArrayType\"] = 4] = \"StringArrayType\";\n QueryPropertyValueType[QueryPropertyValueType[\"UnSupportedType\"] = 5] = \"UnSupportedType\";\n})(exports.QueryPropertyValueType || (exports.QueryPropertyValueType = {}));\nvar QueryPropertyValueType = exports.QueryPropertyValueType;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar SearchSuggest = (function (_super) {\n __extends(SearchSuggest, _super);\n function SearchSuggest(baseUrl, path) {\n if (path === void 0) { path = \"_api/search/suggest\"; }\n _super.call(this, baseUrl, path);\n }\n SearchSuggest.prototype.execute = function (query) {\n this.mapQueryToQueryString(query);\n return this.get().then(function (response) { return new SearchSuggestResult(response); });\n };\n SearchSuggest.prototype.mapQueryToQueryString = function (query) {\n this.query.add(\"querytext\", \"'\" + query.querytext + \"'\");\n if (query.hasOwnProperty(\"count\")) {\n this.query.add(\"inumberofquerysuggestions\", query.count.toString());\n }\n if (query.hasOwnProperty(\"personalCount\")) {\n this.query.add(\"inumberofresultsuggestions\", query.personalCount.toString());\n }\n if (query.hasOwnProperty(\"preQuery\")) {\n this.query.add(\"fprequerysuggestions\", query.preQuery.toString());\n }\n if (query.hasOwnProperty(\"hitHighlighting\")) {\n this.query.add(\"fhithighlighting\", query.hitHighlighting.toString());\n }\n if (query.hasOwnProperty(\"capitalize\")) {\n this.query.add(\"fcapitalizefirstletters\", query.capitalize.toString());\n }\n if (query.hasOwnProperty(\"culture\")) {\n this.query.add(\"culture\", query.culture.toString());\n }\n if (query.hasOwnProperty(\"stemming\")) {\n this.query.add(\"enablestemming\", query.stemming.toString());\n }\n if (query.hasOwnProperty(\"includePeople\")) {\n this.query.add(\"showpeoplenamesuggestions\", query.includePeople.toString());\n }\n if (query.hasOwnProperty(\"queryRules\")) {\n this.query.add(\"enablequeryrules\", query.queryRules.toString());\n }\n if (query.hasOwnProperty(\"prefixMatch\")) {\n this.query.add(\"fprefixmatchallterms\", query.prefixMatch.toString());\n }\n };\n return SearchSuggest;\n}(queryable_1.QueryableInstance));\nexports.SearchSuggest = SearchSuggest;\nvar SearchSuggestResult = (function () {\n function SearchSuggestResult(json) {\n if (json.hasOwnProperty(\"suggest\")) {\n this.PeopleNames = json.suggest.PeopleNames.results;\n this.PersonalResults = json.suggest.PersonalResults.results;\n this.Queries = json.suggest.Queries.results;\n }\n else {\n this.PeopleNames = json.PeopleNames;\n this.PersonalResults = json.PersonalResults;\n this.Queries = json.Queries;\n }\n }\n return SearchSuggestResult;\n}());\nexports.SearchSuggestResult = SearchSuggestResult;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar webs_1 = require(\"./webs\");\nvar usercustomactions_1 = require(\"./usercustomactions\");\nvar odata_1 = require(\"./odata\");\nvar Site = (function (_super) {\n __extends(Site, _super);\n function Site(baseUrl, path) {\n if (path === void 0) { path = \"_api/site\"; }\n _super.call(this, baseUrl, path);\n }\n Object.defineProperty(Site.prototype, \"rootWeb\", {\n get: function () {\n return new webs_1.Web(this, \"rootweb\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Site.prototype, \"userCustomActions\", {\n get: function () {\n return new usercustomactions_1.UserCustomActions(this);\n },\n enumerable: true,\n configurable: true\n });\n Site.prototype.getContextInfo = function () {\n var q = new Site(\"\", \"_api/contextinfo\");\n return q.post().then(function (data) {\n if (data.hasOwnProperty(\"GetContextWebInformation\")) {\n var info = data.GetContextWebInformation;\n info.SupportedSchemaVersions = info.SupportedSchemaVersions.results;\n return info;\n }\n else {\n return data;\n }\n });\n };\n Site.prototype.getDocumentLibraries = function (absoluteWebUrl) {\n var q = new queryable_1.Queryable(\"\", \"_api/sp.web.getdocumentlibraries(@v)\");\n q.query.add(\"@v\", \"'\" + absoluteWebUrl + \"'\");\n return q.get().then(function (data) {\n if (data.hasOwnProperty(\"GetDocumentLibraries\")) {\n return data.GetDocumentLibraries;\n }\n else {\n return data;\n }\n });\n };\n Site.prototype.getWebUrlFromPageUrl = function (absolutePageUrl) {\n var q = new queryable_1.Queryable(\"\", \"_api/sp.web.getweburlfrompageurl(@v)\");\n q.query.add(\"@v\", \"'\" + absolutePageUrl + \"'\");\n return q.get().then(function (data) {\n if (data.hasOwnProperty(\"GetWebUrlFromPageUrl\")) {\n return data.GetWebUrlFromPageUrl;\n }\n else {\n return data;\n }\n });\n };\n Site.prototype.createBatch = function () {\n return new odata_1.ODataBatch(this.parentUrl);\n };\n return Site;\n}(queryable_1.QueryableInstance));\nexports.Site = Site;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar siteusers_1 = require(\"./siteusers\");\nvar util_1 = require(\"../../utils/util\");\n(function (PrincipalType) {\n PrincipalType[PrincipalType[\"None\"] = 0] = \"None\";\n PrincipalType[PrincipalType[\"User\"] = 1] = \"User\";\n PrincipalType[PrincipalType[\"DistributionList\"] = 2] = \"DistributionList\";\n PrincipalType[PrincipalType[\"SecurityGroup\"] = 4] = \"SecurityGroup\";\n PrincipalType[PrincipalType[\"SharePointGroup\"] = 8] = \"SharePointGroup\";\n PrincipalType[PrincipalType[\"All\"] = 15] = \"All\";\n})(exports.PrincipalType || (exports.PrincipalType = {}));\nvar PrincipalType = exports.PrincipalType;\nvar SiteGroups = (function (_super) {\n __extends(SiteGroups, _super);\n function SiteGroups(baseUrl, path) {\n if (path === void 0) { path = \"sitegroups\"; }\n _super.call(this, baseUrl, path);\n }\n SiteGroups.prototype.add = function (properties) {\n var _this = this;\n var postBody = JSON.stringify(util_1.Util.extend({ \"__metadata\": { \"type\": \"SP.Group\" } }, properties));\n return this.post({ body: postBody }).then(function (data) {\n return {\n data: data,\n group: _this.getById(data.Id),\n };\n });\n };\n SiteGroups.prototype.getByName = function (groupName) {\n return new SiteGroup(this, \"getByName('\" + groupName + \"')\");\n };\n SiteGroups.prototype.getById = function (id) {\n var sg = new SiteGroup(this);\n sg.concat(\"(\" + id + \")\");\n return sg;\n };\n SiteGroups.prototype.removeById = function (id) {\n var g = new SiteGroups(this, \"removeById('\" + id + \"')\");\n return g.post();\n };\n SiteGroups.prototype.removeByLoginName = function (loginName) {\n var g = new SiteGroups(this, \"removeByLoginName('\" + loginName + \"')\");\n return g.post();\n };\n return SiteGroups;\n}(queryable_1.QueryableCollection));\nexports.SiteGroups = SiteGroups;\nvar SiteGroup = (function (_super) {\n __extends(SiteGroup, _super);\n function SiteGroup(baseUrl, path) {\n _super.call(this, baseUrl, path);\n }\n Object.defineProperty(SiteGroup.prototype, \"users\", {\n get: function () {\n return new siteusers_1.SiteUsers(this, \"users\");\n },\n enumerable: true,\n configurable: true\n });\n SiteGroup.prototype.update = function (properties) {\n var _this = this;\n var postBody = util_1.Util.extend({ \"__metadata\": { \"type\": \"SP.Group\" } }, properties);\n return this.post({\n body: JSON.stringify(postBody),\n headers: {\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n var retGroup = _this;\n if (properties.hasOwnProperty(\"Title\")) {\n retGroup = _this.getParent(SiteGroup, _this.parentUrl, \"getByName('\" + properties[\"Title\"] + \"')\");\n }\n return {\n data: data,\n group: retGroup,\n };\n });\n };\n return SiteGroup;\n}(queryable_1.QueryableInstance));\nexports.SiteGroup = SiteGroup;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar sitegroups_1 = require(\"./sitegroups\");\nvar util_1 = require(\"../../utils/util\");\nvar SiteUsers = (function (_super) {\n __extends(SiteUsers, _super);\n function SiteUsers(baseUrl, path) {\n if (path === void 0) { path = \"siteusers\"; }\n _super.call(this, baseUrl, path);\n }\n SiteUsers.prototype.getByEmail = function (email) {\n return new SiteUser(this, \"getByEmail('\" + email + \"')\");\n };\n SiteUsers.prototype.getById = function (id) {\n return new SiteUser(this, \"getById(\" + id + \")\");\n };\n SiteUsers.prototype.getByLoginName = function (loginName) {\n var su = new SiteUser(this);\n su.concat(\"(@v)\");\n su.query.add(\"@v\", encodeURIComponent(loginName));\n return su;\n };\n SiteUsers.prototype.removeById = function (id) {\n var o = new SiteUsers(this, \"removeById(\" + id + \")\");\n return o.post();\n };\n SiteUsers.prototype.removeByLoginName = function (loginName) {\n var o = new SiteUsers(this, \"removeByLoginName(@v)\");\n o.query.add(\"@v\", encodeURIComponent(loginName));\n return o.post();\n };\n SiteUsers.prototype.add = function (loginName) {\n var _this = this;\n var postBody = JSON.stringify({ \"__metadata\": { \"type\": \"SP.User\" }, LoginName: loginName });\n return this.post({ body: postBody }).then(function (data) { return _this.getByLoginName(loginName); });\n };\n return SiteUsers;\n}(queryable_1.QueryableCollection));\nexports.SiteUsers = SiteUsers;\nvar SiteUser = (function (_super) {\n __extends(SiteUser, _super);\n function SiteUser(baseUrl, path) {\n _super.call(this, baseUrl, path);\n }\n Object.defineProperty(SiteUser.prototype, \"groups\", {\n get: function () {\n return new sitegroups_1.SiteGroups(this, \"groups\");\n },\n enumerable: true,\n configurable: true\n });\n SiteUser.prototype.update = function (properties) {\n var _this = this;\n var postBody = util_1.Util.extend({ \"__metadata\": { \"type\": \"SP.User\" } }, properties);\n return this.post({\n body: JSON.stringify(postBody),\n headers: {\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n return {\n data: data,\n user: _this,\n };\n });\n };\n SiteUser.prototype.delete = function () {\n return this.post({\n headers: {\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n return SiteUser;\n}(queryable_1.QueryableInstance));\nexports.SiteUser = SiteUser;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar Subscriptions = (function (_super) {\n __extends(Subscriptions, _super);\n function Subscriptions(baseUrl, path) {\n if (path === void 0) { path = \"subscriptions\"; }\n _super.call(this, baseUrl, path);\n }\n Subscriptions.prototype.getById = function (subscriptionId) {\n var subscription = new Subscription(this);\n subscription.concat(\"('\" + subscriptionId + \"')\");\n return subscription;\n };\n Subscriptions.prototype.add = function (notificationUrl, expirationDate, clientState) {\n var _this = this;\n var postBody = JSON.stringify({\n \"resource\": this.toUrl(),\n \"notificationUrl\": notificationUrl,\n \"expirationDateTime\": expirationDate,\n \"clientState\": clientState || \"pnp-js-core-subscription\",\n });\n return this.post({ body: postBody, headers: { \"Content-Type\": \"application/json\" } }).then(function (result) {\n return { data: result, subscription: _this.getById(result.id) };\n });\n };\n return Subscriptions;\n}(queryable_1.QueryableCollection));\nexports.Subscriptions = Subscriptions;\nvar Subscription = (function (_super) {\n __extends(Subscription, _super);\n function Subscription(baseUrl, path) {\n _super.call(this, baseUrl, path);\n }\n Subscription.prototype.update = function (expirationDate) {\n var _this = this;\n var postBody = JSON.stringify({\n \"expirationDateTime\": expirationDate,\n });\n return this.patch({ body: postBody, headers: { \"Content-Type\": \"application/json\" } }).then(function (data) {\n return { data: data, subscription: _this };\n });\n };\n Subscription.prototype.delete = function () {\n return _super.prototype.delete.call(this);\n };\n return Subscription;\n}(queryable_1.QueryableInstance));\nexports.Subscription = Subscription;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar TopNavigationBar = (function (_super) {\n __extends(TopNavigationBar, _super);\n function TopNavigationBar(baseUrl) {\n _super.call(this, baseUrl, \"TopNavigationBar\");\n }\n return TopNavigationBar;\n}(queryable_1.QueryableInstance));\nexports.TopNavigationBar = TopNavigationBar;\n","\"use strict\";\n(function (ControlMode) {\n ControlMode[ControlMode[\"Display\"] = 1] = \"Display\";\n ControlMode[ControlMode[\"Edit\"] = 2] = \"Edit\";\n ControlMode[ControlMode[\"New\"] = 3] = \"New\";\n})(exports.ControlMode || (exports.ControlMode = {}));\nvar ControlMode = exports.ControlMode;\n(function (FieldTypes) {\n FieldTypes[FieldTypes[\"Invalid\"] = 0] = \"Invalid\";\n FieldTypes[FieldTypes[\"Integer\"] = 1] = \"Integer\";\n FieldTypes[FieldTypes[\"Text\"] = 2] = \"Text\";\n FieldTypes[FieldTypes[\"Note\"] = 3] = \"Note\";\n FieldTypes[FieldTypes[\"DateTime\"] = 4] = \"DateTime\";\n FieldTypes[FieldTypes[\"Counter\"] = 5] = \"Counter\";\n FieldTypes[FieldTypes[\"Choice\"] = 6] = \"Choice\";\n FieldTypes[FieldTypes[\"Lookup\"] = 7] = \"Lookup\";\n FieldTypes[FieldTypes[\"Boolean\"] = 8] = \"Boolean\";\n FieldTypes[FieldTypes[\"Number\"] = 9] = \"Number\";\n FieldTypes[FieldTypes[\"Currency\"] = 10] = \"Currency\";\n FieldTypes[FieldTypes[\"URL\"] = 11] = \"URL\";\n FieldTypes[FieldTypes[\"Computed\"] = 12] = \"Computed\";\n FieldTypes[FieldTypes[\"Threading\"] = 13] = \"Threading\";\n FieldTypes[FieldTypes[\"Guid\"] = 14] = \"Guid\";\n FieldTypes[FieldTypes[\"MultiChoice\"] = 15] = \"MultiChoice\";\n FieldTypes[FieldTypes[\"GridChoice\"] = 16] = \"GridChoice\";\n FieldTypes[FieldTypes[\"Calculated\"] = 17] = \"Calculated\";\n FieldTypes[FieldTypes[\"File\"] = 18] = \"File\";\n FieldTypes[FieldTypes[\"Attachments\"] = 19] = \"Attachments\";\n FieldTypes[FieldTypes[\"User\"] = 20] = \"User\";\n FieldTypes[FieldTypes[\"Recurrence\"] = 21] = \"Recurrence\";\n FieldTypes[FieldTypes[\"CrossProjectLink\"] = 22] = \"CrossProjectLink\";\n FieldTypes[FieldTypes[\"ModStat\"] = 23] = \"ModStat\";\n FieldTypes[FieldTypes[\"Error\"] = 24] = \"Error\";\n FieldTypes[FieldTypes[\"ContentTypeId\"] = 25] = \"ContentTypeId\";\n FieldTypes[FieldTypes[\"PageSeparator\"] = 26] = \"PageSeparator\";\n FieldTypes[FieldTypes[\"ThreadIndex\"] = 27] = \"ThreadIndex\";\n FieldTypes[FieldTypes[\"WorkflowStatus\"] = 28] = \"WorkflowStatus\";\n FieldTypes[FieldTypes[\"AllDayEvent\"] = 29] = \"AllDayEvent\";\n FieldTypes[FieldTypes[\"WorkflowEventType\"] = 30] = \"WorkflowEventType\";\n})(exports.FieldTypes || (exports.FieldTypes = {}));\nvar FieldTypes = exports.FieldTypes;\n(function (DateTimeFieldFormatType) {\n DateTimeFieldFormatType[DateTimeFieldFormatType[\"DateOnly\"] = 0] = \"DateOnly\";\n DateTimeFieldFormatType[DateTimeFieldFormatType[\"DateTime\"] = 1] = \"DateTime\";\n})(exports.DateTimeFieldFormatType || (exports.DateTimeFieldFormatType = {}));\nvar DateTimeFieldFormatType = exports.DateTimeFieldFormatType;\n(function (AddFieldOptions) {\n AddFieldOptions[AddFieldOptions[\"DefaultValue\"] = 0] = \"DefaultValue\";\n AddFieldOptions[AddFieldOptions[\"AddToDefaultContentType\"] = 1] = \"AddToDefaultContentType\";\n AddFieldOptions[AddFieldOptions[\"AddToNoContentType\"] = 2] = \"AddToNoContentType\";\n AddFieldOptions[AddFieldOptions[\"AddToAllContentTypes\"] = 4] = \"AddToAllContentTypes\";\n AddFieldOptions[AddFieldOptions[\"AddFieldInternalNameHint\"] = 8] = \"AddFieldInternalNameHint\";\n AddFieldOptions[AddFieldOptions[\"AddFieldToDefaultView\"] = 16] = \"AddFieldToDefaultView\";\n AddFieldOptions[AddFieldOptions[\"AddFieldCheckDisplayName\"] = 32] = \"AddFieldCheckDisplayName\";\n})(exports.AddFieldOptions || (exports.AddFieldOptions = {}));\nvar AddFieldOptions = exports.AddFieldOptions;\n(function (CalendarType) {\n CalendarType[CalendarType[\"Gregorian\"] = 1] = \"Gregorian\";\n CalendarType[CalendarType[\"Japan\"] = 3] = \"Japan\";\n CalendarType[CalendarType[\"Taiwan\"] = 4] = \"Taiwan\";\n CalendarType[CalendarType[\"Korea\"] = 5] = \"Korea\";\n CalendarType[CalendarType[\"Hijri\"] = 6] = \"Hijri\";\n CalendarType[CalendarType[\"Thai\"] = 7] = \"Thai\";\n CalendarType[CalendarType[\"Hebrew\"] = 8] = \"Hebrew\";\n CalendarType[CalendarType[\"GregorianMEFrench\"] = 9] = \"GregorianMEFrench\";\n CalendarType[CalendarType[\"GregorianArabic\"] = 10] = \"GregorianArabic\";\n CalendarType[CalendarType[\"GregorianXLITEnglish\"] = 11] = \"GregorianXLITEnglish\";\n CalendarType[CalendarType[\"GregorianXLITFrench\"] = 12] = \"GregorianXLITFrench\";\n CalendarType[CalendarType[\"KoreaJapanLunar\"] = 14] = \"KoreaJapanLunar\";\n CalendarType[CalendarType[\"ChineseLunar\"] = 15] = \"ChineseLunar\";\n CalendarType[CalendarType[\"SakaEra\"] = 16] = \"SakaEra\";\n CalendarType[CalendarType[\"UmAlQura\"] = 23] = \"UmAlQura\";\n})(exports.CalendarType || (exports.CalendarType = {}));\nvar CalendarType = exports.CalendarType;\n(function (UrlFieldFormatType) {\n UrlFieldFormatType[UrlFieldFormatType[\"Hyperlink\"] = 0] = \"Hyperlink\";\n UrlFieldFormatType[UrlFieldFormatType[\"Image\"] = 1] = \"Image\";\n})(exports.UrlFieldFormatType || (exports.UrlFieldFormatType = {}));\nvar UrlFieldFormatType = exports.UrlFieldFormatType;\n(function (PrincipalType) {\n PrincipalType[PrincipalType[\"None\"] = 0] = \"None\";\n PrincipalType[PrincipalType[\"User\"] = 1] = \"User\";\n PrincipalType[PrincipalType[\"DistributionList\"] = 2] = \"DistributionList\";\n PrincipalType[PrincipalType[\"SecurityGroup\"] = 4] = \"SecurityGroup\";\n PrincipalType[PrincipalType[\"SharePointGroup\"] = 8] = \"SharePointGroup\";\n PrincipalType[PrincipalType[\"All\"] = 15] = \"All\";\n})(exports.PrincipalType || (exports.PrincipalType = {}));\nvar PrincipalType = exports.PrincipalType;\n(function (PageType) {\n PageType[PageType[\"Invalid\"] = -1] = \"Invalid\";\n PageType[PageType[\"DefaultView\"] = 0] = \"DefaultView\";\n PageType[PageType[\"NormalView\"] = 1] = \"NormalView\";\n PageType[PageType[\"DialogView\"] = 2] = \"DialogView\";\n PageType[PageType[\"View\"] = 3] = \"View\";\n PageType[PageType[\"DisplayForm\"] = 4] = \"DisplayForm\";\n PageType[PageType[\"DisplayFormDialog\"] = 5] = \"DisplayFormDialog\";\n PageType[PageType[\"EditForm\"] = 6] = \"EditForm\";\n PageType[PageType[\"EditFormDialog\"] = 7] = \"EditFormDialog\";\n PageType[PageType[\"NewForm\"] = 8] = \"NewForm\";\n PageType[PageType[\"NewFormDialog\"] = 9] = \"NewFormDialog\";\n PageType[PageType[\"SolutionForm\"] = 10] = \"SolutionForm\";\n PageType[PageType[\"PAGE_MAXITEMS\"] = 11] = \"PAGE_MAXITEMS\";\n})(exports.PageType || (exports.PageType = {}));\nvar PageType = exports.PageType;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar util_1 = require(\"../../utils/util\");\nvar UserCustomActions = (function (_super) {\n __extends(UserCustomActions, _super);\n function UserCustomActions(baseUrl, path) {\n if (path === void 0) { path = \"usercustomactions\"; }\n _super.call(this, baseUrl, path);\n }\n UserCustomActions.prototype.getById = function (id) {\n return new UserCustomAction(this, \"(\" + id + \")\");\n };\n UserCustomActions.prototype.add = function (properties) {\n var _this = this;\n var postBody = JSON.stringify(util_1.Util.extend({ __metadata: { \"type\": \"SP.UserCustomAction\" } }, properties));\n return this.post({ body: postBody }).then(function (data) {\n return {\n action: _this.getById(data.Id),\n data: data,\n };\n });\n };\n UserCustomActions.prototype.clear = function () {\n var a = new UserCustomActions(this, \"clear\");\n return a.post();\n };\n return UserCustomActions;\n}(queryable_1.QueryableCollection));\nexports.UserCustomActions = UserCustomActions;\nvar UserCustomAction = (function (_super) {\n __extends(UserCustomAction, _super);\n function UserCustomAction(baseUrl, path) {\n _super.call(this, baseUrl, path);\n }\n UserCustomAction.prototype.update = function (properties) {\n var _this = this;\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": \"SP.UserCustomAction\" },\n }, properties));\n return this.post({\n body: postBody,\n headers: {\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n return {\n action: _this,\n data: data,\n };\n });\n };\n return UserCustomAction;\n}(queryable_1.QueryableInstance));\nexports.UserCustomAction = UserCustomAction;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar FileUtil = require(\"../../utils/files\");\nvar odata_1 = require(\"./odata\");\nvar UserProfileQuery = (function (_super) {\n __extends(UserProfileQuery, _super);\n function UserProfileQuery(baseUrl, path) {\n if (path === void 0) { path = \"_api/sp.userprofiles.peoplemanager\"; }\n _super.call(this, baseUrl, path);\n this.profileLoader = new ProfileLoader(baseUrl);\n }\n Object.defineProperty(UserProfileQuery.prototype, \"editProfileLink\", {\n get: function () {\n var q = new UserProfileQuery(this, \"EditProfileLink\");\n return q.getAs(odata_1.ODataValue());\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(UserProfileQuery.prototype, \"isMyPeopleListPublic\", {\n get: function () {\n var q = new UserProfileQuery(this, \"IsMyPeopleListPublic\");\n return q.getAs(odata_1.ODataValue());\n },\n enumerable: true,\n configurable: true\n });\n UserProfileQuery.prototype.amIFollowedBy = function (loginName) {\n var q = new UserProfileQuery(this, \"amifollowedby(@v)\");\n q.query.add(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\n return q.get();\n };\n UserProfileQuery.prototype.amIFollowing = function (loginName) {\n var q = new UserProfileQuery(this, \"amifollowing(@v)\");\n q.query.add(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\n return q.get();\n };\n UserProfileQuery.prototype.getFollowedTags = function (maxCount) {\n if (maxCount === void 0) { maxCount = 20; }\n var q = new UserProfileQuery(this, \"getfollowedtags(\" + maxCount + \")\");\n return q.get();\n };\n UserProfileQuery.prototype.getFollowersFor = function (loginName) {\n var q = new UserProfileQuery(this, \"getfollowersfor(@v)\");\n q.query.add(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\n return q.get();\n };\n Object.defineProperty(UserProfileQuery.prototype, \"myFollowers\", {\n get: function () {\n return new queryable_1.QueryableCollection(this, \"getmyfollowers\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(UserProfileQuery.prototype, \"myProperties\", {\n get: function () {\n return new UserProfileQuery(this, \"getmyproperties\");\n },\n enumerable: true,\n configurable: true\n });\n UserProfileQuery.prototype.getPeopleFollowedBy = function (loginName) {\n var q = new UserProfileQuery(this, \"getpeoplefollowedby(@v)\");\n q.query.add(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\n return q.get();\n };\n UserProfileQuery.prototype.getPropertiesFor = function (loginName) {\n var q = new UserProfileQuery(this, \"getpropertiesfor(@v)\");\n q.query.add(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\n return q.get();\n };\n Object.defineProperty(UserProfileQuery.prototype, \"trendingTags\", {\n get: function () {\n var q = new UserProfileQuery(this, null);\n q.concat(\".gettrendingtags\");\n return q.get();\n },\n enumerable: true,\n configurable: true\n });\n UserProfileQuery.prototype.getUserProfilePropertyFor = function (loginName, propertyName) {\n var q = new UserProfileQuery(this, \"getuserprofilepropertyfor(accountname=@v, propertyname='\" + propertyName + \"')\");\n q.query.add(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\n return q.get();\n };\n UserProfileQuery.prototype.hideSuggestion = function (loginName) {\n var q = new UserProfileQuery(this, \"hidesuggestion(@v)\");\n q.query.add(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\n return q.post();\n };\n UserProfileQuery.prototype.isFollowing = function (follower, followee) {\n var q = new UserProfileQuery(this, null);\n q.concat(\".isfollowing(possiblefolloweraccountname=@v, possiblefolloweeaccountname=@y)\");\n q.query.add(\"@v\", \"'\" + encodeURIComponent(follower) + \"'\");\n q.query.add(\"@y\", \"'\" + encodeURIComponent(followee) + \"'\");\n return q.get();\n };\n UserProfileQuery.prototype.setMyProfilePic = function (profilePicSource) {\n var _this = this;\n return FileUtil.readBlobAsArrayBuffer(profilePicSource).then(function (buffer) {\n var request = new UserProfileQuery(_this, \"setmyprofilepicture\");\n return request.post({\n body: String.fromCharCode.apply(null, new Uint16Array(buffer)),\n });\n });\n };\n UserProfileQuery.prototype.createPersonalSiteEnqueueBulk = function () {\n var emails = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n emails[_i - 0] = arguments[_i];\n }\n return this.profileLoader.createPersonalSiteEnqueueBulk(emails);\n };\n Object.defineProperty(UserProfileQuery.prototype, \"ownerUserProfile\", {\n get: function () {\n return this.profileLoader.ownerUserProfile;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(UserProfileQuery.prototype, \"userProfile\", {\n get: function () {\n return this.profileLoader.userProfile;\n },\n enumerable: true,\n configurable: true\n });\n UserProfileQuery.prototype.createPersonalSite = function (interactiveRequest) {\n if (interactiveRequest === void 0) { interactiveRequest = false; }\n return this.profileLoader.createPersonalSite(interactiveRequest);\n };\n UserProfileQuery.prototype.shareAllSocialData = function (share) {\n return this.profileLoader.shareAllSocialData(share);\n };\n return UserProfileQuery;\n}(queryable_1.QueryableInstance));\nexports.UserProfileQuery = UserProfileQuery;\nvar ProfileLoader = (function (_super) {\n __extends(ProfileLoader, _super);\n function ProfileLoader(baseUrl, path) {\n if (path === void 0) { path = \"_api/sp.userprofiles.profileloader.getprofileloader\"; }\n _super.call(this, baseUrl, path);\n }\n ProfileLoader.prototype.createPersonalSiteEnqueueBulk = function (emails) {\n var q = new ProfileLoader(this, \"createpersonalsiteenqueuebulk\");\n var postBody = JSON.stringify({ \"emailIDs\": emails });\n return q.post({\n body: postBody,\n });\n };\n Object.defineProperty(ProfileLoader.prototype, \"ownerUserProfile\", {\n get: function () {\n var q = this.getParent(ProfileLoader, this.parentUrl, \"_api/sp.userprofiles.profileloader.getowneruserprofile\");\n return q.postAs();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ProfileLoader.prototype, \"userProfile\", {\n get: function () {\n var q = new ProfileLoader(this, \"getuserprofile\");\n return q.postAs();\n },\n enumerable: true,\n configurable: true\n });\n ProfileLoader.prototype.createPersonalSite = function (interactiveRequest) {\n if (interactiveRequest === void 0) { interactiveRequest = false; }\n var q = new ProfileLoader(this, \"getuserprofile/createpersonalsiteenque(\" + interactiveRequest + \")\\\",\");\n return q.post();\n };\n ProfileLoader.prototype.shareAllSocialData = function (share) {\n var q = new ProfileLoader(this, \"getuserprofile/shareallsocialdata(\" + share + \")\\\",\");\n return q.post();\n };\n return ProfileLoader;\n}(queryable_1.Queryable));\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar util_1 = require(\"../../utils/util\");\nvar Views = (function (_super) {\n __extends(Views, _super);\n function Views(baseUrl) {\n _super.call(this, baseUrl, \"views\");\n }\n Views.prototype.getById = function (id) {\n var v = new View(this);\n v.concat(\"('\" + id + \"')\");\n return v;\n };\n Views.prototype.getByTitle = function (title) {\n return new View(this, \"getByTitle('\" + title + \"')\");\n };\n Views.prototype.add = function (title, personalView, additionalSettings) {\n var _this = this;\n if (personalView === void 0) { personalView = false; }\n if (additionalSettings === void 0) { additionalSettings = {}; }\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": \"SP.View\" },\n \"Title\": title,\n \"PersonalView\": personalView,\n }, additionalSettings));\n return this.postAs({ body: postBody }).then(function (data) {\n return {\n data: data,\n view: _this.getById(data.Id),\n };\n });\n };\n return Views;\n}(queryable_1.QueryableCollection));\nexports.Views = Views;\nvar View = (function (_super) {\n __extends(View, _super);\n function View(baseUrl, path) {\n _super.call(this, baseUrl, path);\n }\n Object.defineProperty(View.prototype, \"fields\", {\n get: function () {\n return new ViewFields(this);\n },\n enumerable: true,\n configurable: true\n });\n View.prototype.update = function (properties) {\n var _this = this;\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": \"SP.View\" },\n }, properties));\n return this.post({\n body: postBody,\n headers: {\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n return {\n data: data,\n view: _this,\n };\n });\n };\n View.prototype.delete = function () {\n return this.post({\n headers: {\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n View.prototype.renderAsHtml = function () {\n var q = new queryable_1.Queryable(this, \"renderashtml\");\n return q.get();\n };\n return View;\n}(queryable_1.QueryableInstance));\nexports.View = View;\nvar ViewFields = (function (_super) {\n __extends(ViewFields, _super);\n function ViewFields(baseUrl, path) {\n if (path === void 0) { path = \"viewfields\"; }\n _super.call(this, baseUrl, path);\n }\n ViewFields.prototype.getSchemaXml = function () {\n var q = new queryable_1.Queryable(this, \"schemaxml\");\n return q.get();\n };\n ViewFields.prototype.add = function (fieldTitleOrInternalName) {\n var q = new ViewFields(this, \"addviewfield('\" + fieldTitleOrInternalName + \"')\");\n return q.post();\n };\n ViewFields.prototype.move = function (fieldInternalName, index) {\n var q = new ViewFields(this, \"moveviewfieldto\");\n var postBody = JSON.stringify({ \"field\": fieldInternalName, \"index\": index });\n return q.post({ body: postBody });\n };\n ViewFields.prototype.removeAll = function () {\n var q = new ViewFields(this, \"removeallviewfields\");\n return q.post();\n };\n ViewFields.prototype.remove = function (fieldInternalName) {\n var q = new ViewFields(this, \"removeviewfield('\" + fieldInternalName + \"')\");\n return q.post();\n };\n return ViewFields;\n}(queryable_1.QueryableCollection));\nexports.ViewFields = ViewFields;\n","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar queryable_1 = require(\"./queryable\");\nvar queryablesecurable_1 = require(\"./queryablesecurable\");\nvar lists_1 = require(\"./lists\");\nvar fields_1 = require(\"./fields\");\nvar navigation_1 = require(\"./navigation\");\nvar sitegroups_1 = require(\"./sitegroups\");\nvar contenttypes_1 = require(\"./contenttypes\");\nvar folders_1 = require(\"./folders\");\nvar roles_1 = require(\"./roles\");\nvar files_1 = require(\"./files\");\nvar util_1 = require(\"../../utils/util\");\nvar lists_2 = require(\"./lists\");\nvar siteusers_1 = require(\"./siteusers\");\nvar usercustomactions_1 = require(\"./usercustomactions\");\nvar odata_1 = require(\"./odata\");\nvar Webs = (function (_super) {\n __extends(Webs, _super);\n function Webs(baseUrl, webPath) {\n if (webPath === void 0) { webPath = \"webs\"; }\n _super.call(this, baseUrl, webPath);\n }\n Webs.prototype.add = function (title, url, description, template, language, inheritPermissions, additionalSettings) {\n if (description === void 0) { description = \"\"; }\n if (template === void 0) { template = \"STS\"; }\n if (language === void 0) { language = 1033; }\n if (inheritPermissions === void 0) { inheritPermissions = true; }\n if (additionalSettings === void 0) { additionalSettings = {}; }\n var props = util_1.Util.extend({\n Description: description,\n Language: language,\n Title: title,\n Url: url,\n UseSamePermissionsAsParentSite: inheritPermissions,\n WebTemplate: template,\n }, additionalSettings);\n var postBody = JSON.stringify({\n \"parameters\": util_1.Util.extend({\n \"__metadata\": { \"type\": \"SP.WebCreationInformation\" },\n }, props),\n });\n var q = new Webs(this, \"add\");\n return q.post({ body: postBody }).then(function (data) {\n return {\n data: data,\n web: new Web(odata_1.extractOdataId(data), \"\"),\n };\n });\n };\n return Webs;\n}(queryable_1.QueryableCollection));\nexports.Webs = Webs;\nvar Web = (function (_super) {\n __extends(Web, _super);\n function Web(baseUrl, path) {\n if (path === void 0) { path = \"_api/web\"; }\n _super.call(this, baseUrl, path);\n }\n Object.defineProperty(Web.prototype, \"webs\", {\n get: function () {\n return new Webs(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"contentTypes\", {\n get: function () {\n return new contenttypes_1.ContentTypes(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"lists\", {\n get: function () {\n return new lists_1.Lists(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"fields\", {\n get: function () {\n return new fields_1.Fields(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"availablefields\", {\n get: function () {\n return new fields_1.Fields(this, \"availablefields\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"navigation\", {\n get: function () {\n return new navigation_1.Navigation(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"siteUsers\", {\n get: function () {\n return new siteusers_1.SiteUsers(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"siteGroups\", {\n get: function () {\n return new sitegroups_1.SiteGroups(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"folders\", {\n get: function () {\n return new folders_1.Folders(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"userCustomActions\", {\n get: function () {\n return new usercustomactions_1.UserCustomActions(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"roleDefinitions\", {\n get: function () {\n return new roles_1.RoleDefinitions(this);\n },\n enumerable: true,\n configurable: true\n });\n Web.prototype.createBatch = function () {\n return new odata_1.ODataBatch(this.parentUrl);\n };\n Web.prototype.getFolderByServerRelativeUrl = function (folderRelativeUrl) {\n return new folders_1.Folder(this, \"getFolderByServerRelativeUrl('\" + folderRelativeUrl + \"')\");\n };\n Web.prototype.getFileByServerRelativeUrl = function (fileRelativeUrl) {\n return new files_1.File(this, \"getFileByServerRelativeUrl('\" + fileRelativeUrl + \"')\");\n };\n Web.prototype.getList = function (listRelativeUrl) {\n return new lists_2.List(this, \"getList('\" + listRelativeUrl + \"')\");\n };\n Web.prototype.update = function (properties) {\n var _this = this;\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": \"SP.Web\" },\n }, properties));\n return this.post({\n body: postBody,\n headers: {\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n return {\n data: data,\n web: _this,\n };\n });\n };\n Web.prototype.delete = function () {\n return this.post({\n headers: {\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n Web.prototype.applyTheme = function (colorPaletteUrl, fontSchemeUrl, backgroundImageUrl, shareGenerated) {\n var postBody = JSON.stringify({\n backgroundImageUrl: backgroundImageUrl,\n colorPaletteUrl: colorPaletteUrl,\n fontSchemeUrl: fontSchemeUrl,\n shareGenerated: shareGenerated,\n });\n var q = new Web(this, \"applytheme\");\n return q.post({ body: postBody });\n };\n Web.prototype.applyWebTemplate = function (template) {\n var q = new Web(this, \"applywebtemplate\");\n q.concat(\"(@t)\");\n q.query.add(\"@t\", template);\n return q.post();\n };\n Web.prototype.doesUserHavePermissions = function (perms) {\n var q = new Web(this, \"doesuserhavepermissions\");\n q.concat(\"(@p)\");\n q.query.add(\"@p\", JSON.stringify(perms));\n return q.get();\n };\n Web.prototype.ensureUser = function (loginName) {\n var postBody = JSON.stringify({\n logonName: loginName,\n });\n var q = new Web(this, \"ensureuser\");\n return q.post({ body: postBody });\n };\n Web.prototype.availableWebTemplates = function (language, includeCrossLanugage) {\n if (language === void 0) { language = 1033; }\n if (includeCrossLanugage === void 0) { includeCrossLanugage = true; }\n return new queryable_1.QueryableCollection(this, \"getavailablewebtemplates(lcid=\" + language + \", doincludecrosslanguage=\" + includeCrossLanugage + \")\");\n };\n Web.prototype.getCatalog = function (type) {\n var q = new Web(this, \"getcatalog(\" + type + \")\");\n q.select(\"Id\");\n return q.get().then(function (data) {\n return new lists_2.List(odata_1.extractOdataId(data));\n });\n };\n Web.prototype.getChanges = function (query) {\n var postBody = JSON.stringify({ \"query\": util_1.Util.extend({ \"__metadata\": { \"type\": \"SP.ChangeQuery\" } }, query) });\n var q = new Web(this, \"getchanges\");\n return q.post({ body: postBody });\n };\n Object.defineProperty(Web.prototype, \"customListTemplate\", {\n get: function () {\n return new queryable_1.QueryableCollection(this, \"getcustomlisttemplates\");\n },\n enumerable: true,\n configurable: true\n });\n Web.prototype.getUserById = function (id) {\n return new siteusers_1.SiteUser(this, \"getUserById(\" + id + \")\");\n };\n Web.prototype.mapToIcon = function (filename, size, progId) {\n if (size === void 0) { size = 0; }\n if (progId === void 0) { progId = \"\"; }\n var q = new Web(this, \"maptoicon(filename='\" + filename + \"', progid='\" + progId + \"', size=\" + size + \")\");\n return q.get();\n };\n return Web;\n}(queryablesecurable_1.QueryableSecurable));\nexports.Web = Web;\n","\"use strict\";\nfunction __export(m) {\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\n}\n__export(require(\"../sharepoint/rest/index\"));\nvar httpclient_1 = require(\"../net/httpclient\");\nexports.HttpClient = httpclient_1.HttpClient;\nvar collections_1 = require(\"../collections/collections\");\nexports.Dictionary = collections_1.Dictionary;\nvar util_1 = require(\"../utils/util\");\nexports.Util = util_1.Util;\n__export(require(\"../utils/logging\"));\n","\"use strict\";\nfunction readBlobAsText(blob) {\n return readBlobAs(blob, \"string\");\n}\nexports.readBlobAsText = readBlobAsText;\nfunction readBlobAsArrayBuffer(blob) {\n return readBlobAs(blob, \"buffer\");\n}\nexports.readBlobAsArrayBuffer = readBlobAsArrayBuffer;\nfunction readBlobAs(blob, mode) {\n return new Promise(function (resolve, reject) {\n var reader = new FileReader();\n reader.onload = function (e) {\n resolve(e.target.result);\n };\n switch (mode) {\n case \"string\":\n reader.readAsText(blob);\n break;\n case \"buffer\":\n reader.readAsArrayBuffer(blob);\n break;\n }\n });\n}\n","\"use strict\";\n(function (LogLevel) {\n LogLevel[LogLevel[\"Verbose\"] = 0] = \"Verbose\";\n LogLevel[LogLevel[\"Info\"] = 1] = \"Info\";\n LogLevel[LogLevel[\"Warning\"] = 2] = \"Warning\";\n LogLevel[LogLevel[\"Error\"] = 3] = \"Error\";\n LogLevel[LogLevel[\"Off\"] = 99] = \"Off\";\n})(exports.LogLevel || (exports.LogLevel = {}));\nvar LogLevel = exports.LogLevel;\nvar Logger = (function () {\n function Logger() {\n }\n Object.defineProperty(Logger, \"activeLogLevel\", {\n get: function () {\n return Logger.instance.activeLogLevel;\n },\n set: function (value) {\n Logger.instance.activeLogLevel = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Logger, \"instance\", {\n get: function () {\n if (typeof Logger._instance === \"undefined\" || Logger._instance === null) {\n Logger._instance = new LoggerImpl();\n }\n return Logger._instance;\n },\n enumerable: true,\n configurable: true\n });\n Logger.subscribe = function () {\n var listeners = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n listeners[_i - 0] = arguments[_i];\n }\n for (var i = 0; i < listeners.length; i++) {\n Logger.instance.subscribe(listeners[i]);\n }\n };\n Logger.clearSubscribers = function () {\n return Logger.instance.clearSubscribers();\n };\n Object.defineProperty(Logger, \"count\", {\n get: function () {\n return Logger.instance.count;\n },\n enumerable: true,\n configurable: true\n });\n Logger.write = function (message, level) {\n if (level === void 0) { level = LogLevel.Verbose; }\n Logger.instance.log({ level: level, message: message });\n };\n Logger.log = function (entry) {\n Logger.instance.log(entry);\n };\n Logger.measure = function (name, f) {\n return Logger.instance.measure(name, f);\n };\n return Logger;\n}());\nexports.Logger = Logger;\nvar LoggerImpl = (function () {\n function LoggerImpl(activeLogLevel, subscribers) {\n if (activeLogLevel === void 0) { activeLogLevel = LogLevel.Warning; }\n if (subscribers === void 0) { subscribers = []; }\n this.activeLogLevel = activeLogLevel;\n this.subscribers = subscribers;\n }\n LoggerImpl.prototype.subscribe = function (listener) {\n this.subscribers.push(listener);\n };\n LoggerImpl.prototype.clearSubscribers = function () {\n var s = this.subscribers.slice(0);\n this.subscribers.length = 0;\n return s;\n };\n Object.defineProperty(LoggerImpl.prototype, \"count\", {\n get: function () {\n return this.subscribers.length;\n },\n enumerable: true,\n configurable: true\n });\n LoggerImpl.prototype.write = function (message, level) {\n if (level === void 0) { level = LogLevel.Verbose; }\n this.log({ level: level, message: message });\n };\n LoggerImpl.prototype.log = function (entry) {\n if (typeof entry === \"undefined\" || entry.level < this.activeLogLevel) {\n return;\n }\n for (var i = 0; i < this.subscribers.length; i++) {\n this.subscribers[i].log(entry);\n }\n };\n LoggerImpl.prototype.measure = function (name, f) {\n console.profile(name);\n try {\n return f();\n }\n finally {\n console.profileEnd();\n }\n };\n return LoggerImpl;\n}());\nvar ConsoleListener = (function () {\n function ConsoleListener() {\n }\n ConsoleListener.prototype.log = function (entry) {\n var msg = this.format(entry);\n switch (entry.level) {\n case LogLevel.Verbose:\n case LogLevel.Info:\n console.log(msg);\n break;\n case LogLevel.Warning:\n console.warn(msg);\n break;\n case LogLevel.Error:\n console.error(msg);\n break;\n }\n };\n ConsoleListener.prototype.format = function (entry) {\n return \"Message: \" + entry.message + \". Data: \" + JSON.stringify(entry.data);\n };\n return ConsoleListener;\n}());\nexports.ConsoleListener = ConsoleListener;\nvar AzureInsightsListener = (function () {\n function AzureInsightsListener(azureInsightsInstrumentationKey) {\n this.azureInsightsInstrumentationKey = azureInsightsInstrumentationKey;\n var appInsights = window[\"appInsights\"] || function (config) {\n function r(config) {\n t[config] = function () {\n var i = arguments;\n t.queue.push(function () { t[config].apply(t, i); });\n };\n }\n var t = { config: config }, u = document, e = window, o = \"script\", s = u.createElement(o), i, f;\n for (s.src = config.url || \"//az416426.vo.msecnd.net/scripts/a/ai.0.js\", u.getElementsByTagName(o)[0].parentNode.appendChild(s), t.cookie = u.cookie, t.queue = [], i = [\"Event\", \"Exception\", \"Metric\", \"PageView\", \"Trace\"]; i.length;) {\n r(\"track\" + i.pop());\n }\n return r(\"setAuthenticatedUserContext\"), r(\"clearAuthenticatedUserContext\"), config.disableExceptionTracking || (i = \"onerror\", r(\"_\" + i), f = e[i], e[i] = function (config, r, u, e, o) {\n var s = f && f(config, r, u, e, o);\n return s !== !0 && t[\"_\" + i](config, r, u, e, o), s;\n }), t;\n }({\n instrumentationKey: this.azureInsightsInstrumentationKey\n });\n window[\"appInsights\"] = appInsights;\n }\n AzureInsightsListener.prototype.log = function (entry) {\n var ai = window[\"appInsights\"];\n var msg = this.format(entry);\n if (entry.level === LogLevel.Error) {\n ai.trackException(msg);\n }\n else {\n ai.trackEvent(msg);\n }\n };\n AzureInsightsListener.prototype.format = function (entry) {\n return \"Message: \" + entry.message + \". Data: \" + JSON.stringify(entry.data);\n };\n return AzureInsightsListener;\n}());\nexports.AzureInsightsListener = AzureInsightsListener;\nvar FunctionListener = (function () {\n function FunctionListener(method) {\n this.method = method;\n }\n FunctionListener.prototype.log = function (entry) {\n this.method(entry);\n };\n return FunctionListener;\n}());\nexports.FunctionListener = FunctionListener;\n","\"use strict\";\nvar util_1 = require(\"./util\");\nvar PnPClientStorageWrapper = (function () {\n function PnPClientStorageWrapper(store, defaultTimeoutMinutes) {\n this.store = store;\n this.defaultTimeoutMinutes = defaultTimeoutMinutes;\n this.defaultTimeoutMinutes = (defaultTimeoutMinutes === void 0) ? 5 : defaultTimeoutMinutes;\n this.enabled = this.test();\n }\n PnPClientStorageWrapper.prototype.get = function (key) {\n if (!this.enabled) {\n return null;\n }\n var o = this.store.getItem(key);\n if (o == null) {\n return null;\n }\n var persistable = JSON.parse(o);\n if (new Date(persistable.expiration) <= new Date()) {\n this.delete(key);\n return null;\n }\n else {\n return persistable.value;\n }\n };\n PnPClientStorageWrapper.prototype.put = function (key, o, expire) {\n if (this.enabled) {\n this.store.setItem(key, this.createPersistable(o, expire));\n }\n };\n PnPClientStorageWrapper.prototype.delete = function (key) {\n if (this.enabled) {\n this.store.removeItem(key);\n }\n };\n PnPClientStorageWrapper.prototype.getOrPut = function (key, getter, expire) {\n var _this = this;\n if (!this.enabled) {\n return getter();\n }\n if (!util_1.Util.isFunction(getter)) {\n throw \"Function expected for parameter 'getter'.\";\n }\n return new Promise(function (resolve, reject) {\n var o = _this.get(key);\n if (o == null) {\n getter().then(function (d) {\n _this.put(key, d, expire);\n resolve(d);\n });\n }\n else {\n resolve(o);\n }\n });\n };\n PnPClientStorageWrapper.prototype.test = function () {\n var str = \"test\";\n try {\n this.store.setItem(str, str);\n this.store.removeItem(str);\n return true;\n }\n catch (e) {\n return false;\n }\n };\n PnPClientStorageWrapper.prototype.createPersistable = function (o, expire) {\n if (typeof expire === \"undefined\") {\n expire = util_1.Util.dateAdd(new Date(), \"minute\", this.defaultTimeoutMinutes);\n }\n return JSON.stringify({ expiration: expire, value: o });\n };\n return PnPClientStorageWrapper;\n}());\nexports.PnPClientStorageWrapper = PnPClientStorageWrapper;\nvar PnPClientStorage = (function () {\n function PnPClientStorage() {\n this.local = typeof localStorage !== \"undefined\" ? new PnPClientStorageWrapper(localStorage) : null;\n this.session = typeof sessionStorage !== \"undefined\" ? new PnPClientStorageWrapper(sessionStorage) : null;\n }\n return PnPClientStorage;\n}());\nexports.PnPClientStorage = PnPClientStorage;\n","\"use strict\";\nvar Util = (function () {\n function Util() {\n }\n Util.getCtxCallback = function (context, method) {\n var params = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n params[_i - 2] = arguments[_i];\n }\n return function () {\n method.apply(context, params);\n };\n };\n Util.urlParamExists = function (name) {\n name = name.replace(/[\\[]/, \"\\\\[\").replace(/[\\]]/, \"\\\\]\");\n var regex = new RegExp(\"[\\\\?&]\" + name + \"=([^&#]*)\");\n return regex.test(location.search);\n };\n Util.getUrlParamByName = function (name) {\n name = name.replace(/[\\[]/, \"\\\\[\").replace(/[\\]]/, \"\\\\]\");\n var regex = new RegExp(\"[\\\\?&]\" + name + \"=([^&#]*)\");\n var results = regex.exec(location.search);\n return results == null ? \"\" : decodeURIComponent(results[1].replace(/\\+/g, \" \"));\n };\n Util.getUrlParamBoolByName = function (name) {\n var p = this.getUrlParamByName(name);\n var isFalse = (p === \"\" || /false|0/i.test(p));\n return !isFalse;\n };\n Util.stringInsert = function (target, index, s) {\n if (index > 0) {\n return target.substring(0, index) + s + target.substring(index, target.length);\n }\n return s + target;\n };\n Util.dateAdd = function (date, interval, units) {\n var ret = new Date(date.toLocaleString());\n switch (interval.toLowerCase()) {\n case \"year\":\n ret.setFullYear(ret.getFullYear() + units);\n break;\n case \"quarter\":\n ret.setMonth(ret.getMonth() + 3 * units);\n break;\n case \"month\":\n ret.setMonth(ret.getMonth() + units);\n break;\n case \"week\":\n ret.setDate(ret.getDate() + 7 * units);\n break;\n case \"day\":\n ret.setDate(ret.getDate() + units);\n break;\n case \"hour\":\n ret.setTime(ret.getTime() + units * 3600000);\n break;\n case \"minute\":\n ret.setTime(ret.getTime() + units * 60000);\n break;\n case \"second\":\n ret.setTime(ret.getTime() + units * 1000);\n break;\n default:\n ret = undefined;\n break;\n }\n return ret;\n };\n Util.loadStylesheet = function (path, avoidCache) {\n if (avoidCache) {\n path += \"?\" + encodeURIComponent((new Date()).getTime().toString());\n }\n var head = document.getElementsByTagName(\"head\");\n if (head.length > 0) {\n var e = document.createElement(\"link\");\n head[0].appendChild(e);\n e.setAttribute(\"type\", \"text/css\");\n e.setAttribute(\"rel\", \"stylesheet\");\n e.setAttribute(\"href\", path);\n }\n };\n Util.combinePaths = function () {\n var paths = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n paths[_i - 0] = arguments[_i];\n }\n var parts = [];\n for (var i = 0; i < paths.length; i++) {\n if (typeof paths[i] !== \"undefined\" && paths[i] !== null) {\n parts.push(paths[i].replace(/^[\\\\|\\/]/, \"\").replace(/[\\\\|\\/]$/, \"\"));\n }\n }\n return parts.join(\"/\").replace(/\\\\/, \"/\");\n };\n Util.getRandomString = function (chars) {\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n for (var i = 0; i < chars; i++) {\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n }\n return text;\n };\n Util.getGUID = function () {\n var d = new Date().getTime();\n var guid = \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g, function (c) {\n var r = (d + Math.random() * 16) % 16 | 0;\n d = Math.floor(d / 16);\n return (c === \"x\" ? r : (r & 0x3 | 0x8)).toString(16);\n });\n return guid;\n };\n Util.isFunction = function (candidateFunction) {\n return typeof candidateFunction === \"function\";\n };\n Util.isArray = function (array) {\n if (Array.isArray) {\n return Array.isArray(array);\n }\n return array && typeof array.length === \"number\" && array.constructor === Array;\n };\n Util.stringIsNullOrEmpty = function (s) {\n return typeof s === \"undefined\" || s === null || s === \"\";\n };\n Util.extend = function (target, source, noOverwrite) {\n if (noOverwrite === void 0) { noOverwrite = false; }\n var result = {};\n for (var id in target) {\n result[id] = target[id];\n }\n var check = noOverwrite ? function (o, i) { return !o.hasOwnProperty(i); } : function (o, i) { return true; };\n for (var id in source) {\n if (check(result, id)) {\n result[id] = source[id];\n }\n }\n return result;\n };\n Util.applyMixins = function (derivedCtor) {\n var baseCtors = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n baseCtors[_i - 1] = arguments[_i];\n }\n baseCtors.forEach(function (baseCtor) {\n Object.getOwnPropertyNames(baseCtor.prototype).forEach(function (name) {\n derivedCtor.prototype[name] = baseCtor.prototype[name];\n });\n });\n };\n Util.isUrlAbsolute = function (url) {\n return /^https?:\\/\\/|^\\/\\//i.test(url);\n };\n Util.makeUrlAbsolute = function (url) {\n if (Util.isUrlAbsolute(url)) {\n return url;\n }\n if (typeof global._spPageContextInfo !== \"undefined\") {\n if (global._spPageContextInfo.hasOwnProperty(\"webAbsoluteUrl\")) {\n return Util.combinePaths(global._spPageContextInfo.webAbsoluteUrl, url);\n }\n else if (global._spPageContextInfo.hasOwnProperty(\"webServerRelativeUrl\")) {\n return Util.combinePaths(global._spPageContextInfo.webServerRelativeUrl, url);\n }\n }\n else {\n return url;\n }\n };\n return Util;\n}());\nexports.Util = Util;\n"]} \ No newline at end of file