]*data-sp-htmlproperties[^>]*?>/i, function (markup) {\r\n return markup.replace(/^
]*data-sp-htmlproperties[^>]*?>/i, \"\").replace(/<\\/div>$/i, \"\");\r\n });\r\n this.htmlProperties = htmlProps.length > 0 ? htmlProps[0] : \"\";\r\n };\r\n ClientSideWebpart.prototype.getControlData = function () {\r\n return {\r\n controlType: this.controlType,\r\n id: this.id,\r\n position: {\r\n controlIndex: this.order,\r\n sectionFactor: this.column.factor,\r\n sectionIndex: this.column.order,\r\n zoneIndex: this.column.section.order,\r\n },\r\n webPartId: this.webPartId,\r\n };\r\n };\r\n ClientSideWebpart.prototype.renderHtmlProperties = function () {\r\n var html = [];\r\n if (this.serverProcessedContent === undefined || this.serverProcessedContent === null) {\r\n html.push(this.htmlProperties);\r\n }\r\n else if (this.serverProcessedContent !== undefined) {\r\n if (this.serverProcessedContent.searchablePlainTexts !== undefined) {\r\n var keys = Object.keys(this.serverProcessedContent.searchablePlainTexts);\r\n for (var i = 0; i < keys.length; i++) {\r\n html.push(\"
\");\r\n html.push(this.serverProcessedContent.searchablePlainTexts[keys[i]]);\r\n html.push(\"
\");\r\n }\r\n }\r\n if (this.serverProcessedContent.imageSources !== undefined) {\r\n var keys = Object.keys(this.serverProcessedContent.imageSources);\r\n for (var i = 0; i < keys.length; i++) {\r\n html.push(\"
\");\r\n }\r\n }\r\n if (this.serverProcessedContent.links !== undefined) {\r\n var keys = Object.keys(this.serverProcessedContent.links);\r\n for (var i = 0; i < keys.length; i++) {\r\n html.push(\"
\");\r\n }\r\n }\r\n }\r\n return html.join(\"\");\r\n };\r\n ClientSideWebpart.prototype.parseJsonProperties = function (props) {\r\n // If the web part has the serverProcessedContent property then keep this one as it might be needed as input to render the web part HTML later on\r\n if (props.webPartData !== undefined && props.webPartData.serverProcessedContent !== undefined) {\r\n this.serverProcessedContent = props.webPartData.serverProcessedContent;\r\n }\r\n else if (props.serverProcessedContent !== undefined) {\r\n this.serverProcessedContent = props.serverProcessedContent;\r\n }\r\n else {\r\n this.serverProcessedContent = null;\r\n }\r\n if (props.webPartData !== undefined && props.webPartData.properties !== undefined) {\r\n return props.webPartData.properties;\r\n }\r\n else if (props.properties !== undefined) {\r\n return props.properties;\r\n }\r\n else {\r\n return props;\r\n }\r\n };\r\n return ClientSideWebpart;\r\n}(ClientSidePart));\n\n/**\r\n * Represents a collection of navigation nodes\r\n *\r\n */\r\nvar NavigationNodes = /** @class */ (function (_super) {\r\n __extends(NavigationNodes, _super);\r\n function NavigationNodes() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.getById = _this._getById(NavigationNode);\r\n return _this;\r\n }\r\n /**\r\n * Adds a new node to the collection\r\n *\r\n * @param title Display name of the node\r\n * @param url The url of the node\r\n * @param visible If true the node is visible, otherwise it is hidden (default: true)\r\n */\r\n NavigationNodes.prototype.add = function (title, url, visible) {\r\n var _this = this;\r\n if (visible === void 0) { visible = true; }\r\n var postBody = jsS(extend(metadata(\"SP.NavigationNode\"), {\r\n IsVisible: visible,\r\n Title: title,\r\n Url: url,\r\n }));\r\n return this.clone(NavigationNodes, null).postCore({ body: postBody }).then(function (data) {\r\n return {\r\n data: data,\r\n node: _this.getById(data.Id),\r\n };\r\n });\r\n };\r\n /**\r\n * Moves a node to be after another node in the navigation\r\n *\r\n * @param nodeId Id of the node to move\r\n * @param previousNodeId Id of the node after which we move the node specified by nodeId\r\n */\r\n NavigationNodes.prototype.moveAfter = function (nodeId, previousNodeId) {\r\n var postBody = jsS({\r\n nodeId: nodeId,\r\n previousNodeId: previousNodeId,\r\n });\r\n return this.clone(NavigationNodes, \"MoveAfter\").postCore({ body: postBody });\r\n };\r\n return NavigationNodes;\r\n}(SharePointQueryableCollection));\r\n/**\r\n * Represents an instance of a navigation node\r\n *\r\n */\r\nvar NavigationNode = /** @class */ (function (_super) {\r\n __extends(NavigationNode, _super);\r\n function NavigationNode() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n Object.defineProperty(NavigationNode.prototype, \"children\", {\r\n /**\r\n * Represents the child nodes of this node\r\n */\r\n get: function () {\r\n return new NavigationNodes(this, \"Children\");\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Deletes this node and any child nodes\r\n */\r\n NavigationNode.prototype.delete = function () {\r\n return _super.prototype.deleteCore.call(this);\r\n };\r\n return NavigationNode;\r\n}(SharePointQueryableInstance));\r\n/**\r\n * Exposes the navigation components\r\n *\r\n */\r\nvar Navigation = /** @class */ (function (_super) {\r\n __extends(Navigation, _super);\r\n function Navigation() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n Object.defineProperty(Navigation.prototype, \"quicklaunch\", {\r\n /**\r\n * Gets the quicklaunch navigation nodes for the current context\r\n *\r\n */\r\n get: function () {\r\n return new NavigationNodes(this, \"quicklaunch\");\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Navigation.prototype, \"topNavigationBar\", {\r\n /**\r\n * Gets the top bar navigation nodes for the current context\r\n *\r\n */\r\n get: function () {\r\n return new NavigationNodes(this, \"topnavigationbar\");\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Navigation = __decorate([\r\n defaultPath(\"navigation\")\r\n ], Navigation);\r\n return Navigation;\r\n}(SharePointQueryable));\r\n/**\r\n * Represents the top level navigation service\r\n */\r\nvar NavigationService = /** @class */ (function (_super) {\r\n __extends(NavigationService, _super);\r\n function NavigationService(path) {\r\n if (path === void 0) { path = null; }\r\n return _super.call(this, \"_api/navigation\", path) || this;\r\n }\r\n /**\r\n * The MenuState service operation returns a Menu-State (dump) of a SiteMapProvider on a site.\r\n *\r\n * @param menuNodeKey MenuNode.Key of the start node within the SiteMapProvider If no key is provided the SiteMapProvider.RootNode will be the root of the menu state.\r\n * @param depth Depth of the dump. If no value is provided a dump with the depth of 10 is returned\r\n * @param mapProviderName The name identifying the SiteMapProvider to be used\r\n * @param customProperties comma seperated list of custom properties to be returned.\r\n */\r\n NavigationService.prototype.getMenuState = function (menuNodeKey, depth, mapProviderName, customProperties) {\r\n if (menuNodeKey === void 0) { menuNodeKey = null; }\r\n if (depth === void 0) { depth = 10; }\r\n if (mapProviderName === void 0) { mapProviderName = null; }\r\n if (customProperties === void 0) { customProperties = null; }\r\n return (new NavigationService(\"MenuState\")).postCore({\r\n body: jsS({\r\n customProperties: customProperties,\r\n depth: depth,\r\n mapProviderName: mapProviderName,\r\n menuNodeKey: menuNodeKey,\r\n }),\r\n });\r\n };\r\n /**\r\n * Tries to get a SiteMapNode.Key for a given URL within a site collection.\r\n *\r\n * @param currentUrl A url representing the SiteMapNode\r\n * @param mapProviderName The name identifying the SiteMapProvider to be used\r\n */\r\n NavigationService.prototype.getMenuNodeKey = function (currentUrl, mapProviderName) {\r\n if (mapProviderName === void 0) { mapProviderName = null; }\r\n return (new NavigationService(\"MenuNodeKey\")).postCore({\r\n body: jsS({\r\n currentUrl: currentUrl,\r\n mapProviderName: mapProviderName,\r\n }),\r\n });\r\n };\r\n return NavigationService;\r\n}(SharePointQueryable));\n\n/**\r\n * Describes regional settings ODada object\r\n */\r\nvar RegionalSettings = /** @class */ (function (_super) {\r\n __extends(RegionalSettings, _super);\r\n function RegionalSettings() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n Object.defineProperty(RegionalSettings.prototype, \"installedLanguages\", {\r\n /**\r\n * Gets the collection of languages used in a server farm.\r\n */\r\n get: function () {\r\n return new InstalledLanguages(this);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(RegionalSettings.prototype, \"globalInstalledLanguages\", {\r\n /**\r\n * Gets the collection of language packs that are installed on the server.\r\n */\r\n get: function () {\r\n return new InstalledLanguages(this, \"globalinstalledlanguages\");\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(RegionalSettings.prototype, \"timeZone\", {\r\n /**\r\n * Gets time zone\r\n */\r\n get: function () {\r\n return new TimeZone(this);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(RegionalSettings.prototype, \"timeZones\", {\r\n /**\r\n * Gets time zones\r\n */\r\n get: function () {\r\n return new TimeZones(this);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n RegionalSettings = __decorate([\r\n defaultPath(\"regionalsettings\")\r\n ], RegionalSettings);\r\n return RegionalSettings;\r\n}(SharePointQueryableInstance));\r\n/**\r\n * Describes installed languages ODada queriable collection\r\n */\r\nvar InstalledLanguages = /** @class */ (function (_super) {\r\n __extends(InstalledLanguages, _super);\r\n function InstalledLanguages() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n InstalledLanguages = __decorate([\r\n defaultPath(\"installedlanguages\")\r\n ], InstalledLanguages);\r\n return InstalledLanguages;\r\n}(SharePointQueryableCollection));\r\n/**\r\n * Describes TimeZone ODada object\r\n */\r\nvar TimeZone = /** @class */ (function (_super) {\r\n __extends(TimeZone, _super);\r\n function TimeZone() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n TimeZone_1 = TimeZone;\r\n /**\r\n * Gets an Local Time by UTC Time\r\n *\r\n * @param utcTime UTC Time as Date or ISO String\r\n */\r\n TimeZone.prototype.utcToLocalTime = function (utcTime) {\r\n var dateIsoString;\r\n if (typeof utcTime === \"string\") {\r\n dateIsoString = utcTime;\r\n }\r\n else {\r\n dateIsoString = utcTime.toISOString();\r\n }\r\n return this.clone(TimeZone_1, \"utctolocaltime('\" + dateIsoString + \"')\")\r\n .postCore()\r\n .then(function (res) { return hOP(res, \"UTCToLocalTime\") ? res.UTCToLocalTime : res; });\r\n };\r\n /**\r\n * Gets an UTC Time by Local Time\r\n *\r\n * @param localTime Local Time as Date or ISO String\r\n */\r\n TimeZone.prototype.localTimeToUTC = function (localTime) {\r\n var dateIsoString;\r\n if (typeof localTime === \"string\") {\r\n dateIsoString = localTime;\r\n }\r\n else {\r\n dateIsoString = dateAdd(localTime, \"minute\", localTime.getTimezoneOffset() * -1).toISOString();\r\n }\r\n return this.clone(TimeZone_1, \"localtimetoutc('\" + dateIsoString + \"')\")\r\n .postCore()\r\n .then(function (res) { return hOP(res, \"LocalTimeToUTC\") ? res.LocalTimeToUTC : res; });\r\n };\r\n var TimeZone_1;\r\n TimeZone = TimeZone_1 = __decorate([\r\n defaultPath(\"timezone\")\r\n ], TimeZone);\r\n return TimeZone;\r\n}(SharePointQueryableInstance));\r\n/**\r\n * Describes time zones queriable collection\r\n */\r\nvar TimeZones = /** @class */ (function (_super) {\r\n __extends(TimeZones, _super);\r\n function TimeZones() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n TimeZones_1 = TimeZones;\r\n // https://msdn.microsoft.com/en-us/library/office/jj247008.aspx - timezones ids\r\n /**\r\n * Gets an TimeZone by id\r\n *\r\n * @param id The integer id of the timezone to retrieve\r\n */\r\n TimeZones.prototype.getById = function (id) {\r\n // do the post and merge the result into a TimeZone instance so the data and methods are available\r\n return this.clone(TimeZones_1, \"GetById(\" + id + \")\").postCore({}, spODataEntity(TimeZone));\r\n };\r\n var TimeZones_1;\r\n TimeZones = TimeZones_1 = __decorate([\r\n defaultPath(\"timezones\")\r\n ], TimeZones);\r\n return TimeZones;\r\n}(SharePointQueryableCollection));\n\nvar funcs = new Map([\r\n [\"text\", \"Querytext\"],\r\n [\"template\", \"QueryTemplate\"],\r\n [\"sourceId\", \"SourceId\"],\r\n [\"trimDuplicatesIncludeId\", \"\"],\r\n [\"startRow\", \"\"],\r\n [\"rowLimit\", \"\"],\r\n [\"rankingModelId\", \"\"],\r\n [\"rowsPerPage\", \"\"],\r\n [\"selectProperties\", \"\"],\r\n [\"culture\", \"\"],\r\n [\"timeZoneId\", \"\"],\r\n [\"refinementFilters\", \"\"],\r\n [\"refiners\", \"\"],\r\n [\"hiddenConstraints\", \"\"],\r\n [\"sortList\", \"\"],\r\n [\"timeout\", \"\"],\r\n [\"hithighlightedProperties\", \"\"],\r\n [\"clientType\", \"\"],\r\n [\"personalizationData\", \"\"],\r\n [\"resultsURL\", \"\"],\r\n [\"queryTag\", \"\"],\r\n [\"properties\", \"\"],\r\n [\"queryTemplatePropertiesUrl\", \"\"],\r\n [\"reorderingRules\", \"\"],\r\n [\"hitHighlightedMultivaluePropertyLimit\", \"\"],\r\n [\"collapseSpecification\", \"\"],\r\n [\"uiLanguage\", \"\"],\r\n [\"desiredSnippetLength\", \"\"],\r\n [\"maxSnippetLength\", \"\"],\r\n [\"summaryLength\", \"\"],\r\n]);\r\nvar props = new Map([]);\r\nfunction toPropCase(str) {\r\n return str.replace(/^(.)/, function ($1) { return $1.toUpperCase(); });\r\n}\r\n/**\r\n * Creates a new instance of the SearchQueryBuilder\r\n *\r\n * @param queryText Initial query text\r\n * @param _query Any initial query configuration\r\n */\r\nfunction SearchQueryBuilder(queryText, _query) {\r\n if (queryText === void 0) { queryText = \"\"; }\r\n if (_query === void 0) { _query = {}; }\r\n return new Proxy({\r\n query: Object.assign({\r\n Querytext: queryText,\r\n }, _query),\r\n }, {\r\n get: function (self, propertyKey, proxy) {\r\n var pk = propertyKey.toString();\r\n if (pk === \"toSearchQuery\") {\r\n return function () { return self.query; };\r\n }\r\n if (funcs.has(pk)) {\r\n return function () {\r\n var value = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n value[_i] = arguments[_i];\r\n }\r\n var mappedPk = funcs.get(pk);\r\n self.query[mappedPk.length > 0 ? mappedPk : toPropCase(pk)] = value.length > 1 ? value : value[0];\r\n return proxy;\r\n };\r\n }\r\n var propKey = props.has(pk) ? props.get(pk) : toPropCase(pk);\r\n self.query[propKey] = true;\r\n return proxy;\r\n },\r\n });\r\n}\r\n/**\r\n * Describes the search API\r\n *\r\n */\r\nvar Search = /** @class */ (function (_super) {\r\n __extends(Search, _super);\r\n function Search() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n /**\r\n * @returns Promise\r\n */\r\n Search.prototype.execute = function (queryInit) {\r\n var _this = this;\r\n var query = this.parseQuery(queryInit);\r\n var formattedBody;\r\n formattedBody = query;\r\n if (formattedBody.SelectProperties) {\r\n formattedBody.SelectProperties = this.fixupProp(query.SelectProperties);\r\n }\r\n if (formattedBody.RefinementFilters) {\r\n formattedBody.RefinementFilters = this.fixupProp(query.RefinementFilters);\r\n }\r\n if (formattedBody.SortList) {\r\n formattedBody.SortList = this.fixupProp(query.SortList);\r\n }\r\n if (formattedBody.HithighlightedProperties) {\r\n formattedBody.HithighlightedProperties = this.fixupProp(query.HitHighlightedProperties);\r\n }\r\n if (formattedBody.ReorderingRules) {\r\n formattedBody.ReorderingRules = this.fixupProp(query.ReorderingRules);\r\n }\r\n if (formattedBody.Properties) {\r\n formattedBody.Properties = this.fixupProp(query.Properties);\r\n }\r\n var postBody = jsS({\r\n request: extend(metadata(\"Microsoft.Office.Server.Search.REST.SearchRequest\"), formattedBody),\r\n });\r\n // if we are using caching with this search request, then we need to handle some work upfront to enable that\r\n if (this._useCaching) {\r\n // force use of the cache for this request if .usingCaching was called\r\n this._forceCaching = true;\r\n // because all the requests use the same url they would collide in the cache we use a special key\r\n var cacheKey = \"PnPjs.SearchWithCaching(\" + getHashCode(postBody) + \")\";\r\n if (objectDefinedNotNull(this._cachingOptions)) {\r\n // if our key ends in the postquery url we overwrite it\r\n if (/\\/_api\\/search\\/postquery$/i.test(this._cachingOptions.key)) {\r\n this._cachingOptions.key = cacheKey;\r\n }\r\n }\r\n else {\r\n this._cachingOptions = new CachingOptions(cacheKey);\r\n }\r\n }\r\n return this.postCore({ body: postBody }).then(function (data) { return new SearchResults(data, _this.toUrl(), query); });\r\n };\r\n /**\r\n * Fixes up properties that expect to consist of a \"results\" collection when needed\r\n *\r\n * @param prop property to fixup for container struct\r\n */\r\n Search.prototype.fixupProp = function (prop) {\r\n return hOP(prop, \"results\") ? prop : { results: prop };\r\n };\r\n /**\r\n * Translates one of the query initializers into a SearchQuery instance\r\n *\r\n * @param query\r\n */\r\n Search.prototype.parseQuery = function (query) {\r\n var finalQuery;\r\n if (typeof query === \"string\") {\r\n finalQuery = { Querytext: query };\r\n }\r\n else if (query.toSearchQuery) {\r\n finalQuery = query.toSearchQuery();\r\n }\r\n else {\r\n finalQuery = query;\r\n }\r\n return finalQuery;\r\n };\r\n Search = __decorate([\r\n defaultPath(\"_api/search/postquery\")\r\n ], Search);\r\n return Search;\r\n}(SharePointQueryableInstance));\r\n/**\r\n * Describes the SearchResults class, which returns the formatted and raw version of the query response\r\n */\r\nvar SearchResults = /** @class */ (function () {\r\n /**\r\n * Creates a new instance of the SearchResult class\r\n *\r\n */\r\n function SearchResults(rawResponse, _url, _query, _raw, _primary) {\r\n if (_raw === void 0) { _raw = null; }\r\n if (_primary === void 0) { _primary = null; }\r\n this._url = _url;\r\n this._query = _query;\r\n this._raw = _raw;\r\n this._primary = _primary;\r\n this._raw = rawResponse.postquery ? rawResponse.postquery : rawResponse;\r\n }\r\n Object.defineProperty(SearchResults.prototype, \"ElapsedTime\", {\r\n get: function () {\r\n return this.RawSearchResults.ElapsedTime;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(SearchResults.prototype, \"RowCount\", {\r\n get: function () {\r\n return this.RawSearchResults.PrimaryQueryResult.RelevantResults.RowCount;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(SearchResults.prototype, \"TotalRows\", {\r\n get: function () {\r\n return this.RawSearchResults.PrimaryQueryResult.RelevantResults.TotalRows;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(SearchResults.prototype, \"TotalRowsIncludingDuplicates\", {\r\n get: function () {\r\n return this.RawSearchResults.PrimaryQueryResult.RelevantResults.TotalRowsIncludingDuplicates;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(SearchResults.prototype, \"RawSearchResults\", {\r\n get: function () {\r\n return this._raw;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(SearchResults.prototype, \"PrimarySearchResults\", {\r\n get: function () {\r\n if (this._primary === null) {\r\n this._primary = this.formatSearchResults(this._raw.PrimaryQueryResult.RelevantResults.Table.Rows);\r\n }\r\n return this._primary;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Gets a page of results\r\n *\r\n * @param pageNumber Index of the page to return. Used to determine StartRow\r\n * @param pageSize Optional, items per page (default = 10)\r\n */\r\n SearchResults.prototype.getPage = function (pageNumber, pageSize) {\r\n // if we got all the available rows we don't have another page\r\n if (this.TotalRows < this.RowCount) {\r\n return Promise.resolve(null);\r\n }\r\n // if pageSize is supplied, then we use that regardless of any previous values\r\n // otherwise get the previous RowLimit or default to 10\r\n var rows = pageSize !== undefined ? pageSize : hOP(this._query, \"RowLimit\") ? this._query.RowLimit : 10;\r\n var query = extend(this._query, {\r\n RowLimit: rows,\r\n StartRow: rows * (pageNumber - 1),\r\n });\r\n // we have reached the end\r\n if (query.StartRow > this.TotalRows) {\r\n return Promise.resolve(null);\r\n }\r\n var search = new Search(this._url, null);\r\n return search.execute(query);\r\n };\r\n /**\r\n * Formats a search results array\r\n *\r\n * @param rawResults The array to process\r\n */\r\n SearchResults.prototype.formatSearchResults = function (rawResults) {\r\n var results = new Array();\r\n var tempResults = rawResults.results ? rawResults.results : rawResults;\r\n for (var _i = 0, tempResults_1 = tempResults; _i < tempResults_1.length; _i++) {\r\n var tempResult = tempResults_1[_i];\r\n var cells = tempResult.Cells.results ? tempResult.Cells.results : tempResult.Cells;\r\n results.push(cells.reduce(function (res, cell) {\r\n Object.defineProperty(res, cell.Key, {\r\n configurable: false,\r\n enumerable: true,\r\n value: cell.Value,\r\n writable: false,\r\n });\r\n return res;\r\n }, {}));\r\n }\r\n return results;\r\n };\r\n return SearchResults;\r\n}());\r\n/**\r\n * defines the SortDirection enum\r\n */\r\nvar SortDirection;\r\n(function (SortDirection) {\r\n SortDirection[SortDirection[\"Ascending\"] = 0] = \"Ascending\";\r\n SortDirection[SortDirection[\"Descending\"] = 1] = \"Descending\";\r\n SortDirection[SortDirection[\"FQLFormula\"] = 2] = \"FQLFormula\";\r\n})(SortDirection || (SortDirection = {}));\r\n/**\r\n * defines the ReorderingRuleMatchType enum\r\n */\r\nvar ReorderingRuleMatchType;\r\n(function (ReorderingRuleMatchType) {\r\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"ResultContainsKeyword\"] = 0] = \"ResultContainsKeyword\";\r\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"TitleContainsKeyword\"] = 1] = \"TitleContainsKeyword\";\r\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"TitleMatchesKeyword\"] = 2] = \"TitleMatchesKeyword\";\r\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"UrlStartsWith\"] = 3] = \"UrlStartsWith\";\r\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"UrlExactlyMatches\"] = 4] = \"UrlExactlyMatches\";\r\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"ContentTypeIs\"] = 5] = \"ContentTypeIs\";\r\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"FileExtensionMatches\"] = 6] = \"FileExtensionMatches\";\r\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"ResultHasTag\"] = 7] = \"ResultHasTag\";\r\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"ManualCondition\"] = 8] = \"ManualCondition\";\r\n})(ReorderingRuleMatchType || (ReorderingRuleMatchType = {}));\r\n/**\r\n * Specifies the type value for the property\r\n */\r\nvar QueryPropertyValueType;\r\n(function (QueryPropertyValueType) {\r\n QueryPropertyValueType[QueryPropertyValueType[\"None\"] = 0] = \"None\";\r\n QueryPropertyValueType[QueryPropertyValueType[\"StringType\"] = 1] = \"StringType\";\r\n QueryPropertyValueType[QueryPropertyValueType[\"Int32Type\"] = 2] = \"Int32Type\";\r\n QueryPropertyValueType[QueryPropertyValueType[\"BooleanType\"] = 3] = \"BooleanType\";\r\n QueryPropertyValueType[QueryPropertyValueType[\"StringArrayType\"] = 4] = \"StringArrayType\";\r\n QueryPropertyValueType[QueryPropertyValueType[\"UnSupportedType\"] = 5] = \"UnSupportedType\";\r\n})(QueryPropertyValueType || (QueryPropertyValueType = {}));\r\nvar SearchBuiltInSourceId = /** @class */ (function () {\r\n function SearchBuiltInSourceId() {\r\n }\r\n SearchBuiltInSourceId.Documents = \"e7ec8cee-ded8-43c9-beb5-436b54b31e84\";\r\n SearchBuiltInSourceId.ItemsMatchingContentType = \"5dc9f503-801e-4ced-8a2c-5d1237132419\";\r\n SearchBuiltInSourceId.ItemsMatchingTag = \"e1327b9c-2b8c-4b23-99c9-3730cb29c3f7\";\r\n SearchBuiltInSourceId.ItemsRelatedToCurrentUser = \"48fec42e-4a92-48ce-8363-c2703a40e67d\";\r\n SearchBuiltInSourceId.ItemsWithSameKeywordAsThisItem = \"5c069288-1d17-454a-8ac6-9c642a065f48\";\r\n SearchBuiltInSourceId.LocalPeopleResults = \"b09a7990-05ea-4af9-81ef-edfab16c4e31\";\r\n SearchBuiltInSourceId.LocalReportsAndDataResults = \"203fba36-2763-4060-9931-911ac8c0583b\";\r\n SearchBuiltInSourceId.LocalSharePointResults = \"8413cd39-2156-4e00-b54d-11efd9abdb89\";\r\n SearchBuiltInSourceId.LocalVideoResults = \"78b793ce-7956-4669-aa3b-451fc5defebf\";\r\n SearchBuiltInSourceId.Pages = \"5e34578e-4d08-4edc-8bf3-002acf3cdbcc\";\r\n SearchBuiltInSourceId.Pictures = \"38403c8c-3975-41a8-826e-717f2d41568a\";\r\n SearchBuiltInSourceId.Popular = \"97c71db1-58ce-4891-8b64-585bc2326c12\";\r\n SearchBuiltInSourceId.RecentlyChangedItems = \"ba63bbae-fa9c-42c0-b027-9a878f16557c\";\r\n SearchBuiltInSourceId.RecommendedItems = \"ec675252-14fa-4fbe-84dd-8d098ed74181\";\r\n SearchBuiltInSourceId.Wiki = \"9479bf85-e257-4318-b5a8-81a180f5faa1\";\r\n return SearchBuiltInSourceId;\r\n}());\n\nvar SearchSuggest = /** @class */ (function (_super) {\r\n __extends(SearchSuggest, _super);\r\n function SearchSuggest() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n SearchSuggest.prototype.execute = function (query) {\r\n this.mapQueryToQueryString(query);\r\n return this.get().then(function (response) {\r\n var mapper = hOP(response, \"suggest\") ? function (s) { return response.suggest[s].results; } : function (s) { return response[s]; };\r\n return {\r\n PeopleNames: mapper(\"PeopleNames\"),\r\n PersonalResults: mapper(\"PersonalResults\"),\r\n Queries: mapper(\"Queries\"),\r\n };\r\n });\r\n };\r\n SearchSuggest.prototype.mapQueryToQueryString = function (query) {\r\n var _this = this;\r\n var setProp = function (q) { return function (checkProp) { return function (sp) {\r\n if (hOP(q, checkProp)) {\r\n _this.query.set(sp, q[checkProp].toString());\r\n }\r\n }; }; };\r\n this.query.set(\"querytext\", \"'\" + query.querytext + \"'\");\r\n var querySetter = setProp(query);\r\n querySetter(\"count\")(\"inumberofquerysuggestions\");\r\n querySetter(\"personalCount\")(\"inumberofresultsuggestions\");\r\n querySetter(\"preQuery\")(\"fprequerysuggestions\");\r\n querySetter(\"hitHighlighting\")(\"fhithighlighting\");\r\n querySetter(\"capitalize\")(\"fcapitalizefirstletters\");\r\n querySetter(\"culture\")(\"culture\");\r\n querySetter(\"stemming\")(\"enablestemming\");\r\n querySetter(\"includePeople\")(\"showpeoplenamesuggestions\");\r\n querySetter(\"queryRules\")(\"enablequeryrules\");\r\n querySetter(\"prefixMatch\")(\"fprefixmatchallterms\");\r\n };\r\n SearchSuggest = __decorate([\r\n defaultPath(\"_api/search/suggest\")\r\n ], SearchSuggest);\r\n return SearchSuggest;\r\n}(SharePointQueryableInstance));\n\n/**\r\n * Describes a collection of List objects\r\n *\r\n */\r\nvar Features = /** @class */ (function (_super) {\r\n __extends(Features, _super);\r\n function Features() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n /**\r\n * Gets a list from the collection by guid id\r\n *\r\n * @param id The Id of the feature (GUID)\r\n */\r\n _this.getById = _this._getById(Feature);\r\n return _this;\r\n }\r\n Features_1 = Features;\r\n /**\r\n * Adds a new list to the collection\r\n *\r\n * @param id The Id of the feature (GUID)\r\n * @param force If true the feature activation will be forced\r\n */\r\n Features.prototype.add = function (id, force) {\r\n var _this = this;\r\n if (force === void 0) { force = false; }\r\n return this.clone(Features_1, \"add\").postCore({\r\n body: jsS({\r\n featdefScope: 0,\r\n featureId: id,\r\n force: force,\r\n }),\r\n }).then(function (data) {\r\n return {\r\n data: data,\r\n feature: _this.getById(id),\r\n };\r\n });\r\n };\r\n /**\r\n * Removes (deactivates) a feature from the collection\r\n *\r\n * @param id The Id of the feature (GUID)\r\n * @param force If true the feature deactivation will be forced\r\n */\r\n Features.prototype.remove = function (id, force) {\r\n if (force === void 0) { force = false; }\r\n return this.clone(Features_1, \"remove\").postCore({\r\n body: jsS({\r\n featureId: id,\r\n force: force,\r\n }),\r\n });\r\n };\r\n var Features_1;\r\n Features = Features_1 = __decorate([\r\n defaultPath(\"features\")\r\n ], Features);\r\n return Features;\r\n}(SharePointQueryableCollection));\r\nvar Feature = /** @class */ (function (_super) {\r\n __extends(Feature, _super);\r\n function Feature() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n /**\r\n * Removes (deactivates) a feature from the collection\r\n *\r\n * @param force If true the feature deactivation will be forced\r\n */\r\n Feature.prototype.deactivate = function (force) {\r\n var _this = this;\r\n if (force === void 0) { force = false; }\r\n var removeDependency = this.addBatchDependency();\r\n var idGet = new Feature(this).select(\"DefinitionId\");\r\n return idGet.get().then(function (feature) {\r\n var promise = _this.getParent(Features, _this.parentUrl, \"\", _this.batch).remove(feature.DefinitionId, force);\r\n removeDependency();\r\n return promise;\r\n });\r\n };\r\n return Feature;\r\n}(SharePointQueryableInstance));\n\nvar RelatedItemManagerImpl = /** @class */ (function (_super) {\r\n __extends(RelatedItemManagerImpl, _super);\r\n function RelatedItemManagerImpl() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n RelatedItemManagerImpl_1 = RelatedItemManagerImpl;\r\n RelatedItemManagerImpl.FromUrl = function (url) {\r\n if (url === null) {\r\n return new RelatedItemManagerImpl_1(\"\");\r\n }\r\n var index = url.indexOf(\"_api/\");\r\n if (index > -1) {\r\n return new RelatedItemManagerImpl_1(url.substr(0, index));\r\n }\r\n return new RelatedItemManagerImpl_1(url);\r\n };\r\n RelatedItemManagerImpl.prototype.getRelatedItems = function (sourceListName, sourceItemId) {\r\n var query = this.clone(RelatedItemManagerImpl_1, null);\r\n query.concat(\".GetRelatedItems\");\r\n return query.postCore({\r\n body: jsS({\r\n SourceItemID: sourceItemId,\r\n SourceListName: sourceListName,\r\n }),\r\n });\r\n };\r\n RelatedItemManagerImpl.prototype.getPageOneRelatedItems = function (sourceListName, sourceItemId) {\r\n var query = this.clone(RelatedItemManagerImpl_1, null);\r\n query.concat(\".GetPageOneRelatedItems\");\r\n return query.postCore({\r\n body: jsS({\r\n SourceItemID: sourceItemId,\r\n SourceListName: sourceListName,\r\n }),\r\n });\r\n };\r\n RelatedItemManagerImpl.prototype.addSingleLink = function (sourceListName, sourceItemId, sourceWebUrl, targetListName, targetItemID, targetWebUrl, tryAddReverseLink) {\r\n if (tryAddReverseLink === void 0) { tryAddReverseLink = false; }\r\n var query = this.clone(RelatedItemManagerImpl_1, null);\r\n query.concat(\".AddSingleLink\");\r\n return query.postCore({\r\n body: jsS({\r\n SourceItemID: sourceItemId,\r\n SourceListName: sourceListName,\r\n SourceWebUrl: sourceWebUrl,\r\n TargetItemID: targetItemID,\r\n TargetListName: targetListName,\r\n TargetWebUrl: targetWebUrl,\r\n TryAddReverseLink: tryAddReverseLink,\r\n }),\r\n });\r\n };\r\n /**\r\n * Adds a related item link from an item specified by list name and item id, to an item specified by url\r\n *\r\n * @param sourceListName The source list name or list id\r\n * @param sourceItemId The source item id\r\n * @param targetItemUrl The target item url\r\n * @param tryAddReverseLink If set to true try to add the reverse link (will not return error if it fails)\r\n */\r\n RelatedItemManagerImpl.prototype.addSingleLinkToUrl = function (sourceListName, sourceItemId, targetItemUrl, tryAddReverseLink) {\r\n if (tryAddReverseLink === void 0) { tryAddReverseLink = false; }\r\n var query = this.clone(RelatedItemManagerImpl_1, null);\r\n query.concat(\".AddSingleLinkToUrl\");\r\n return query.postCore({\r\n body: jsS({\r\n SourceItemID: sourceItemId,\r\n SourceListName: sourceListName,\r\n TargetItemUrl: targetItemUrl,\r\n TryAddReverseLink: tryAddReverseLink,\r\n }),\r\n });\r\n };\r\n /**\r\n * Adds a related item link from an item specified by url, to an item specified by list name and item id\r\n *\r\n * @param sourceItemUrl The source item url\r\n * @param targetListName The target list name or list id\r\n * @param targetItemId The target item id\r\n * @param tryAddReverseLink If set to true try to add the reverse link (will not return error if it fails)\r\n */\r\n RelatedItemManagerImpl.prototype.addSingleLinkFromUrl = function (sourceItemUrl, targetListName, targetItemId, tryAddReverseLink) {\r\n if (tryAddReverseLink === void 0) { tryAddReverseLink = false; }\r\n var query = this.clone(RelatedItemManagerImpl_1, null);\r\n query.concat(\".AddSingleLinkFromUrl\");\r\n return query.postCore({\r\n body: jsS({\r\n SourceItemUrl: sourceItemUrl,\r\n TargetItemID: targetItemId,\r\n TargetListName: targetListName,\r\n TryAddReverseLink: tryAddReverseLink,\r\n }),\r\n });\r\n };\r\n RelatedItemManagerImpl.prototype.deleteSingleLink = function (sourceListName, sourceItemId, sourceWebUrl, targetListName, targetItemId, targetWebUrl, tryDeleteReverseLink) {\r\n if (tryDeleteReverseLink === void 0) { tryDeleteReverseLink = false; }\r\n var query = this.clone(RelatedItemManagerImpl_1, null);\r\n query.concat(\".DeleteSingleLink\");\r\n return query.postCore({\r\n body: jsS({\r\n SourceItemID: sourceItemId,\r\n SourceListName: sourceListName,\r\n SourceWebUrl: sourceWebUrl,\r\n TargetItemID: targetItemId,\r\n TargetListName: targetListName,\r\n TargetWebUrl: targetWebUrl,\r\n TryDeleteReverseLink: tryDeleteReverseLink,\r\n }),\r\n });\r\n };\r\n var RelatedItemManagerImpl_1;\r\n RelatedItemManagerImpl = RelatedItemManagerImpl_1 = __decorate([\r\n defaultPath(\"_api/SP.RelatedItemManager\")\r\n ], RelatedItemManagerImpl);\r\n return RelatedItemManagerImpl;\r\n}(SharePointQueryable));\n\n/**\r\n * Describes a collection of webs\r\n *\r\n */\r\nvar Webs = /** @class */ (function (_super) {\r\n __extends(Webs, _super);\r\n function Webs() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n Webs_1 = Webs;\r\n /**\r\n * Adds a new web to the collection\r\n *\r\n * @param title The new web's title\r\n * @param url The new web's relative url\r\n * @param description The new web's description\r\n * @param template The new web's template internal name (default = STS)\r\n * @param language The locale id that specifies the new web's language (default = 1033 [English, US])\r\n * @param inheritPermissions When true, permissions will be inherited from the new web's parent (default = true)\r\n */\r\n Webs.prototype.add = function (title, url, description, template, language, inheritPermissions) {\r\n if (description === void 0) { description = \"\"; }\r\n if (template === void 0) { template = \"STS\"; }\r\n if (language === void 0) { language = 1033; }\r\n if (inheritPermissions === void 0) { inheritPermissions = true; }\r\n var props = {\r\n Description: description,\r\n Language: language,\r\n Title: title,\r\n Url: url,\r\n UseSamePermissionsAsParentSite: inheritPermissions,\r\n WebTemplate: template,\r\n };\r\n var postBody = jsS({\r\n \"parameters\": extend({\r\n \"__metadata\": { \"type\": \"SP.WebCreationInformation\" },\r\n }, props),\r\n });\r\n return this.clone(Webs_1, \"add\").postCore({ body: postBody }).then(function (data) {\r\n return {\r\n data: data,\r\n web: new Web(odataUrlFrom(data).replace(/_api\\/web\\/?/i, \"\")),\r\n };\r\n });\r\n };\r\n var Webs_1;\r\n Webs = Webs_1 = __decorate([\r\n defaultPath(\"webs\")\r\n ], Webs);\r\n return Webs;\r\n}(SharePointQueryableCollection));\r\n/**\r\n * Describes a collection of web infos\r\n *\r\n */\r\nvar WebInfos = /** @class */ (function (_super) {\r\n __extends(WebInfos, _super);\r\n function WebInfos() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n WebInfos = __decorate([\r\n defaultPath(\"webinfos\")\r\n ], WebInfos);\r\n return WebInfos;\r\n}(SharePointQueryableCollection));\r\n/**\r\n * Describes a web\r\n *\r\n */\r\nvar Web = /** @class */ (function (_super) {\r\n __extends(Web, _super);\r\n function Web() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n Web_1 = Web;\r\n /**\r\n * Creates a new web instance from the given url by indexing the location of the /_api/\r\n * segment. If this is not found the method creates a new web with the entire string as\r\n * supplied.\r\n *\r\n * @param url\r\n */\r\n Web.fromUrl = function (url, path) {\r\n return new Web_1(extractWebUrl(url), path);\r\n };\r\n Object.defineProperty(Web.prototype, \"webs\", {\r\n /**\r\n * Gets this web's subwebs\r\n *\r\n */\r\n get: function () {\r\n return new Webs(this);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Gets this web's parent web and data\r\n *\r\n */\r\n Web.prototype.getParentWeb = function () {\r\n var _this = this;\r\n return this.select(\"ParentWeb/Id\").expand(\"ParentWeb\").get()\r\n .then(function (_a) {\r\n var ParentWeb = _a.ParentWeb;\r\n return new Site(_this.toUrlAndQuery().split(\"/_api\")[0]).openWebById(ParentWeb.Id);\r\n });\r\n };\r\n /**\r\n * Returns a collection of objects that contain metadata about subsites of the current site in which the current user is a member.\r\n *\r\n * @param nWebTemplateFilter Specifies the site definition (default = -1)\r\n * @param nConfigurationFilter A 16-bit integer that specifies the identifier of a configuration (default = -1)\r\n */\r\n Web.prototype.getSubwebsFilteredForCurrentUser = function (nWebTemplateFilter, nConfigurationFilter) {\r\n if (nWebTemplateFilter === void 0) { nWebTemplateFilter = -1; }\r\n if (nConfigurationFilter === void 0) { nConfigurationFilter = -1; }\r\n return this.clone(Webs, \"getSubwebsFilteredForCurrentUser(nWebTemplateFilter=\" + nWebTemplateFilter + \",nConfigurationFilter=\" + nConfigurationFilter + \")\");\r\n };\r\n Object.defineProperty(Web.prototype, \"allProperties\", {\r\n /**\r\n * Allows access to the web's all properties collection\r\n */\r\n get: function () {\r\n return this.clone(SharePointQueryableCollection, \"allproperties\");\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Web.prototype, \"webinfos\", {\r\n /**\r\n * Gets a collection of WebInfos for this web's subwebs\r\n *\r\n */\r\n get: function () {\r\n return new WebInfos(this);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Web.prototype, \"contentTypes\", {\r\n /**\r\n * Gets the content types available in this web\r\n *\r\n */\r\n get: function () {\r\n return new ContentTypes(this);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Web.prototype, \"lists\", {\r\n /**\r\n * Gets the lists in this web\r\n *\r\n */\r\n get: function () {\r\n return new Lists(this);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Web.prototype, \"fields\", {\r\n /**\r\n * Gets the fields in this web\r\n *\r\n */\r\n get: function () {\r\n return new Fields(this);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Web.prototype, \"features\", {\r\n /**\r\n * Gets the active features for this web\r\n *\r\n */\r\n get: function () {\r\n return new Features(this);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Web.prototype, \"availablefields\", {\r\n /**\r\n * Gets the available fields in this web\r\n *\r\n */\r\n get: function () {\r\n return new Fields(this, \"availablefields\");\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Web.prototype, \"navigation\", {\r\n /**\r\n * Gets the navigation options in this web\r\n *\r\n */\r\n get: function () {\r\n return new Navigation(this);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Web.prototype, \"siteUsers\", {\r\n /**\r\n * Gets the site users\r\n *\r\n */\r\n get: function () {\r\n return new SiteUsers(this);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Web.prototype, \"siteGroups\", {\r\n /**\r\n * Gets the site groups\r\n *\r\n */\r\n get: function () {\r\n return new SiteGroups(this);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Web.prototype, \"siteUserInfoList\", {\r\n /**\r\n * Gets site user info list\r\n *\r\n */\r\n get: function () {\r\n return new List(this, \"siteuserinfolist\");\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Web.prototype, \"regionalSettings\", {\r\n /**\r\n * Gets regional settings\r\n *\r\n */\r\n get: function () {\r\n return new RegionalSettings(this);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Web.prototype, \"currentUser\", {\r\n /**\r\n * Gets the current user\r\n */\r\n get: function () {\r\n return new CurrentUser(this);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Web.prototype, \"folders\", {\r\n /**\r\n * Gets the top-level folders in this web\r\n *\r\n */\r\n get: function () {\r\n return new Folders(this);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Web.prototype, \"userCustomActions\", {\r\n /**\r\n * Gets all user custom actions for this web\r\n *\r\n */\r\n get: function () {\r\n return new UserCustomActions(this);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Web.prototype, \"roleDefinitions\", {\r\n /**\r\n * Gets the collection of RoleDefinition resources\r\n *\r\n */\r\n get: function () {\r\n return new RoleDefinitions(this);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Web.prototype, \"relatedItems\", {\r\n /**\r\n * Provides an interface to manage related items\r\n *\r\n */\r\n get: function () {\r\n return RelatedItemManagerImpl.FromUrl(this.toUrl());\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Creates a new batch for requests within the context of this web\r\n *\r\n */\r\n Web.prototype.createBatch = function () {\r\n return new SPBatch(this.parentUrl);\r\n };\r\n Object.defineProperty(Web.prototype, \"rootFolder\", {\r\n /**\r\n * Gets the root folder of this web\r\n *\r\n */\r\n get: function () {\r\n return new Folder(this, \"rootFolder\");\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Web.prototype, \"associatedOwnerGroup\", {\r\n /**\r\n * Gets the associated owner group for this web\r\n *\r\n */\r\n get: function () {\r\n return new SiteGroup(this, \"associatedownergroup\");\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Web.prototype, \"associatedMemberGroup\", {\r\n /**\r\n * Gets the associated member group for this web\r\n *\r\n */\r\n get: function () {\r\n return new SiteGroup(this, \"associatedmembergroup\");\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Web.prototype, \"associatedVisitorGroup\", {\r\n /**\r\n * Gets the associated visitor group for this web\r\n *\r\n */\r\n get: function () {\r\n return new SiteGroup(this, \"associatedvisitorgroup\");\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Gets a folder by server relative url\r\n *\r\n * @param folderRelativeUrl The server relative path to the folder (including /sites/ if applicable)\r\n */\r\n Web.prototype.getFolderByServerRelativeUrl = function (folderRelativeUrl) {\r\n return new Folder(this, \"getFolderByServerRelativeUrl('\" + folderRelativeUrl + \"')\");\r\n };\r\n /**\r\n * Gets a folder by server relative relative path if your folder name contains # and % characters\r\n * you need to first encode the file name using encodeURIComponent() and then pass the url\r\n * let url = \"/sites/test/Shared Documents/\" + encodeURIComponent(\"%123\");\r\n * This works only in SharePoint online.\r\n *\r\n * @param folderRelativeUrl The server relative path to the folder (including /sites/ if applicable)\r\n */\r\n Web.prototype.getFolderByServerRelativePath = function (folderRelativeUrl) {\r\n return new Folder(this, \"getFolderByServerRelativePath(decodedUrl='\" + folderRelativeUrl + \"')\");\r\n };\r\n /**\r\n * Gets a file by server relative url\r\n *\r\n * @param fileRelativeUrl The server relative path to the file (including /sites/ if applicable)\r\n */\r\n Web.prototype.getFileByServerRelativeUrl = function (fileRelativeUrl) {\r\n return new File(this, \"getFileByServerRelativeUrl('\" + fileRelativeUrl + \"')\");\r\n };\r\n /**\r\n * Gets a file by server relative url if your file name contains # and % characters\r\n * you need to first encode the file name using encodeURIComponent() and then pass the url\r\n * let url = \"/sites/test/Shared Documents/\" + encodeURIComponent(\"%123.docx\");\r\n *\r\n * @param fileRelativeUrl The server relative path to the file (including /sites/ if applicable)\r\n */\r\n Web.prototype.getFileByServerRelativePath = function (fileRelativeUrl) {\r\n return new File(this, \"getFileByServerRelativePath(decodedUrl='\" + fileRelativeUrl + \"')\");\r\n };\r\n /**\r\n * Gets a list by server relative url (list's root folder)\r\n *\r\n * @param listRelativeUrl The server relative path to the list's root folder (including /sites/ if applicable)\r\n */\r\n Web.prototype.getList = function (listRelativeUrl) {\r\n return new List(this, \"getList('\" + listRelativeUrl + \"')\");\r\n };\r\n /**\r\n * Updates this web instance with the supplied properties\r\n *\r\n * @param properties A plain object hash of values to update for the web\r\n */\r\n Web.prototype.update = function (properties) {\r\n var _this = this;\r\n var postBody = jsS(extend({\r\n \"__metadata\": { \"type\": \"SP.Web\" },\r\n }, properties));\r\n return this.postCore({\r\n body: postBody,\r\n headers: {\r\n \"X-HTTP-Method\": \"MERGE\",\r\n },\r\n }).then(function (data) {\r\n return {\r\n data: data,\r\n web: _this,\r\n };\r\n });\r\n };\r\n /**\r\n * Deletes this web\r\n *\r\n */\r\n Web.prototype.delete = function () {\r\n return _super.prototype.deleteCore.call(this);\r\n };\r\n /**\r\n * Applies the theme specified by the contents of each of the files specified in the arguments to the site\r\n *\r\n * @param colorPaletteUrl The server-relative URL of the color palette file\r\n * @param fontSchemeUrl The server-relative URL of the font scheme\r\n * @param backgroundImageUrl The server-relative URL of the background image\r\n * @param shareGenerated When true, the generated theme files are stored in the root site. When false, they are stored in this web\r\n */\r\n Web.prototype.applyTheme = function (colorPaletteUrl, fontSchemeUrl, backgroundImageUrl, shareGenerated) {\r\n var postBody = jsS({\r\n backgroundImageUrl: backgroundImageUrl,\r\n colorPaletteUrl: colorPaletteUrl,\r\n fontSchemeUrl: fontSchemeUrl,\r\n shareGenerated: shareGenerated,\r\n });\r\n return this.clone(Web_1, \"applytheme\").postCore({ body: postBody });\r\n };\r\n /**\r\n * Applies the specified site definition or site template to the Web site that has no template applied to it\r\n *\r\n * @param template Name of the site definition or the name of the site template\r\n */\r\n Web.prototype.applyWebTemplate = function (template) {\r\n var q = this.clone(Web_1, \"applywebtemplate\");\r\n q.concat(\"(@t)\");\r\n q.query.set(\"@t\", template);\r\n return q.postCore();\r\n };\r\n /**\r\n * Checks whether the specified login name belongs to a valid user in the web. If the user doesn't exist, adds the user to the web.\r\n *\r\n * @param loginName The login name of the user (ex: i:0#.f|membership|user@domain.onmicrosoft.com)\r\n */\r\n Web.prototype.ensureUser = function (loginName) {\r\n var postBody = jsS({\r\n logonName: loginName,\r\n });\r\n return this.clone(Web_1, \"ensureuser\").postCore({ body: postBody }).then(function (data) {\r\n return {\r\n data: data,\r\n user: new SiteUser(odataUrlFrom(data)),\r\n };\r\n });\r\n };\r\n /**\r\n * Returns a collection of site templates available for the site\r\n *\r\n * @param language The locale id of the site templates to retrieve (default = 1033 [English, US])\r\n * @param includeCrossLanguage When true, includes language-neutral site templates; otherwise false (default = true)\r\n */\r\n Web.prototype.availableWebTemplates = function (language, includeCrossLanugage) {\r\n if (language === void 0) { language = 1033; }\r\n if (includeCrossLanugage === void 0) { includeCrossLanugage = true; }\r\n return new SharePointQueryableCollection(this, \"getavailablewebtemplates(lcid=\" + language + \", doincludecrosslanguage=\" + includeCrossLanugage + \")\");\r\n };\r\n /**\r\n * Returns the list gallery on the site\r\n *\r\n * @param type The gallery type - WebTemplateCatalog = 111, WebPartCatalog = 113 ListTemplateCatalog = 114,\r\n * MasterPageCatalog = 116, SolutionCatalog = 121, ThemeCatalog = 123, DesignCatalog = 124, AppDataCatalog = 125\r\n */\r\n Web.prototype.getCatalog = function (type) {\r\n return this.clone(Web_1, \"getcatalog(\" + type + \")\").select(\"Id\").get().then(function (data) {\r\n return new List(odataUrlFrom(data));\r\n });\r\n };\r\n /**\r\n * Returns the collection of changes from the change log that have occurred within the list, based on the specified query\r\n *\r\n * @param query The change query\r\n */\r\n Web.prototype.getChanges = function (query) {\r\n var postBody = jsS({ \"query\": extend({ \"__metadata\": { \"type\": \"SP.ChangeQuery\" } }, query) });\r\n return this.clone(Web_1, \"getchanges\").postCore({ body: postBody });\r\n };\r\n Object.defineProperty(Web.prototype, \"customListTemplate\", {\r\n /**\r\n * Gets the custom list templates for the site\r\n *\r\n */\r\n get: function () {\r\n return new SharePointQueryableCollection(this, \"getcustomlisttemplates\");\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Returns the user corresponding to the specified member identifier for the current site\r\n *\r\n * @param id The id of the user\r\n */\r\n Web.prototype.getUserById = function (id) {\r\n return new SiteUser(this, \"getUserById(\" + id + \")\");\r\n };\r\n /**\r\n * Returns the name of the image file for the icon that is used to represent the specified file\r\n *\r\n * @param filename The file name. If this parameter is empty, the server returns an empty string\r\n * @param size The size of the icon: 16x16 pixels = 0, 32x32 pixels = 1 (default = 0)\r\n * @param progId The ProgID of the application that was used to create the file, in the form OLEServerName.ObjectName\r\n */\r\n Web.prototype.mapToIcon = function (filename, size, progId) {\r\n if (size === void 0) { size = 0; }\r\n if (progId === void 0) { progId = \"\"; }\r\n return this.clone(Web_1, \"maptoicon(filename='\" + filename + \"', progid='\" + progId + \"', size=\" + size + \")\").get();\r\n };\r\n /**\r\n * Returns the tenant property corresponding to the specified key in the app catalog site\r\n *\r\n * @param key Id of storage entity to be set\r\n */\r\n Web.prototype.getStorageEntity = function (key) {\r\n return this.clone(Web_1, \"getStorageEntity('\" + key + \"')\").get();\r\n };\r\n /**\r\n * This will set the storage entity identified by the given key (MUST be called in the context of the app catalog)\r\n *\r\n * @param key Id of storage entity to be set\r\n * @param value Value of storage entity to be set\r\n * @param description Description of storage entity to be set\r\n * @param comments Comments of storage entity to be set\r\n */\r\n Web.prototype.setStorageEntity = function (key, value, description, comments) {\r\n if (description === void 0) { description = \"\"; }\r\n if (comments === void 0) { comments = \"\"; }\r\n return this.clone(Web_1, \"setStorageEntity\").postCore({\r\n body: jsS({\r\n comments: comments,\r\n description: description,\r\n key: key,\r\n value: value,\r\n }),\r\n });\r\n };\r\n /**\r\n * This will remove the storage entity identified by the given key\r\n *\r\n * @param key Id of storage entity to be removed\r\n */\r\n Web.prototype.removeStorageEntity = function (key) {\r\n return this.clone(Web_1, \"removeStorageEntity('\" + key + \"')\").postCore();\r\n };\r\n /**\r\n * Gets the app catalog for this web\r\n *\r\n * @param url Optional url or web containing the app catalog (default: current web)\r\n */\r\n Web.prototype.getAppCatalog = function (url) {\r\n return new AppCatalog(url || this);\r\n };\r\n /**\r\n * Gets the collection of available client side web parts for this web instance\r\n */\r\n Web.prototype.getClientSideWebParts = function () {\r\n return this.clone(SharePointQueryableCollection, \"GetClientSideWebParts\").get();\r\n };\r\n /**\r\n * Creates a new client side page\r\n *\r\n * @param pageName Name of the new page\r\n * @param title Display title of the new page\r\n * @param libraryTitle Title of the library in which to create the new page. Default: \"Site Pages\"\r\n */\r\n Web.prototype.addClientSidePage = function (pageName, title, libraryTitle) {\r\n if (title === void 0) { title = pageName.replace(/\\.[^/.]+$/, \"\"); }\r\n if (libraryTitle === void 0) { libraryTitle = \"Site Pages\"; }\r\n return ClientSidePage.create(this.lists.getByTitle(libraryTitle), pageName, title);\r\n };\r\n /**\r\n * Creates a new client side page using the library path\r\n *\r\n * @param pageName Name of the new page\r\n * @param listRelativePath The server relative path to the list's root folder (including /sites/ if applicable)\r\n * @param title Display title of the new page\r\n */\r\n Web.prototype.addClientSidePageByPath = function (pageName, listRelativePath, title) {\r\n if (title === void 0) { title = pageName.replace(/\\.[^/.]+$/, \"\"); }\r\n return ClientSidePage.create(this.getList(listRelativePath), pageName, title);\r\n };\r\n var Web_1;\r\n Web = Web_1 = __decorate([\r\n defaultPath(\"_api/web\")\r\n ], Web);\r\n return Web;\r\n}(SharePointQueryableShareableWeb));\n\n/**\r\n * Describes a site collection\r\n *\r\n */\r\nvar Site = /** @class */ (function (_super) {\r\n __extends(Site, _super);\r\n function Site() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n Site_1 = Site;\r\n Object.defineProperty(Site.prototype, \"rootWeb\", {\r\n /**\r\n * Gets the root web of the site collection\r\n *\r\n */\r\n get: function () {\r\n return new Web(this, \"rootweb\");\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Site.prototype, \"features\", {\r\n /**\r\n * Gets the active features for this site collection\r\n *\r\n */\r\n get: function () {\r\n return new Features(this);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Site.prototype, \"userCustomActions\", {\r\n /**\r\n * Gets all custom actions for this site collection\r\n *\r\n */\r\n get: function () {\r\n return new UserCustomActions(this);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Gets a Web instance representing the root web of the site collection\r\n * correctly setup for chaining within the library\r\n */\r\n Site.prototype.getRootWeb = function () {\r\n return this.rootWeb.select(\"Url\").get().then(function (web) { return new Web(web.Url); });\r\n };\r\n /**\r\n * Gets the context information for this site collection\r\n */\r\n Site.prototype.getContextInfo = function () {\r\n var q = new Site_1(this.parentUrl, \"_api/contextinfo\");\r\n return q.postCore().then(function (data) {\r\n if (hOP(data, \"GetContextWebInformation\")) {\r\n var info = data.GetContextWebInformation;\r\n info.SupportedSchemaVersions = info.SupportedSchemaVersions.results;\r\n return info;\r\n }\r\n else {\r\n return data;\r\n }\r\n });\r\n };\r\n /**\r\n * Gets the document libraries on a site. Static method. (SharePoint Online only)\r\n *\r\n * @param absoluteWebUrl The absolute url of the web whose document libraries should be returned\r\n */\r\n Site.prototype.getDocumentLibraries = function (absoluteWebUrl) {\r\n var q = new SharePointQueryable(\"\", \"_api/sp.web.getdocumentlibraries(@v)\");\r\n q.query.set(\"@v\", \"'\" + absoluteWebUrl + \"'\");\r\n return q.get().then(function (data) {\r\n if (hOP(data, \"GetDocumentLibraries\")) {\r\n return data.GetDocumentLibraries;\r\n }\r\n else {\r\n return data;\r\n }\r\n });\r\n };\r\n /**\r\n * Gets the site url from a page url\r\n *\r\n * @param absolutePageUrl The absolute url of the page\r\n */\r\n Site.prototype.getWebUrlFromPageUrl = function (absolutePageUrl) {\r\n var q = new SharePointQueryable(\"\", \"_api/sp.web.getweburlfrompageurl(@v)\");\r\n q.query.set(\"@v\", \"'\" + absolutePageUrl + \"'\");\r\n return q.get().then(function (data) {\r\n if (hOP(data, \"GetWebUrlFromPageUrl\")) {\r\n return data.GetWebUrlFromPageUrl;\r\n }\r\n else {\r\n return data;\r\n }\r\n });\r\n };\r\n /**\r\n * Creates a new batch for requests within the context of this site collection\r\n *\r\n */\r\n Site.prototype.createBatch = function () {\r\n return new SPBatch(this.parentUrl);\r\n };\r\n /**\r\n * Opens a web by id (using POST)\r\n *\r\n * @param webId The GUID id of the web to open\r\n */\r\n Site.prototype.openWebById = function (webId) {\r\n return this.clone(Site_1, \"openWebById('\" + webId + \"')\").postCore().then(function (d) { return ({\r\n data: d,\r\n web: Web.fromUrl(d[\"odata.id\"] || d.__metadata.uri),\r\n }); });\r\n };\r\n var Site_1;\r\n Site = Site_1 = __decorate([\r\n defaultPath(\"_api/site\")\r\n ], Site);\r\n return Site;\r\n}(SharePointQueryableInstance));\n\nvar UserProfileQuery = /** @class */ (function (_super) {\r\n __extends(UserProfileQuery, _super);\r\n /**\r\n * Creates a new instance of the UserProfileQuery class\r\n *\r\n * @param baseUrl The url or SharePointQueryable which forms the parent of this user profile query\r\n */\r\n function UserProfileQuery(baseUrl, path) {\r\n if (path === void 0) { path = \"_api/sp.userprofiles.peoplemanager\"; }\r\n var _this = _super.call(this, baseUrl, path) || this;\r\n _this.clientPeoplePickerQuery = (new ClientPeoplePickerQuery(baseUrl)).configureFrom(_this);\r\n _this.profileLoader = (new ProfileLoader(baseUrl)).configureFrom(_this);\r\n return _this;\r\n }\r\n Object.defineProperty(UserProfileQuery.prototype, \"editProfileLink\", {\r\n /**\r\n * The url of the edit profile page for the current user\r\n */\r\n get: function () {\r\n return this.clone(UserProfileQuery, \"EditProfileLink\").get();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(UserProfileQuery.prototype, \"isMyPeopleListPublic\", {\r\n /**\r\n * A boolean value that indicates whether the current user's \"People I'm Following\" list is public\r\n */\r\n get: function () {\r\n return this.clone(UserProfileQuery, \"IsMyPeopleListPublic\").get();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * A boolean value that indicates whether the current user is being followed by the specified user\r\n *\r\n * @param loginName The account name of the user\r\n */\r\n UserProfileQuery.prototype.amIFollowedBy = function (loginName) {\r\n var q = this.clone(UserProfileQuery, \"amifollowedby(@v)\");\r\n q.query.set(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\r\n return q.get();\r\n };\r\n /**\r\n * A boolean value that indicates whether the current user is following the specified user\r\n *\r\n * @param loginName The account name of the user\r\n */\r\n UserProfileQuery.prototype.amIFollowing = function (loginName) {\r\n var q = this.clone(UserProfileQuery, \"amifollowing(@v)\");\r\n q.query.set(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\r\n return q.get();\r\n };\r\n /**\r\n * Gets tags that the current user is following\r\n *\r\n * @param maxCount The maximum number of tags to retrieve (default is 20)\r\n */\r\n UserProfileQuery.prototype.getFollowedTags = function (maxCount) {\r\n if (maxCount === void 0) { maxCount = 20; }\r\n return this.clone(UserProfileQuery, \"getfollowedtags(\" + maxCount + \")\").get();\r\n };\r\n /**\r\n * Gets the people who are following the specified user\r\n *\r\n * @param loginName The account name of the user\r\n */\r\n UserProfileQuery.prototype.getFollowersFor = function (loginName) {\r\n var q = this.clone(UserProfileQuery, \"getfollowersfor(@v)\");\r\n q.query.set(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\r\n return q.get();\r\n };\r\n Object.defineProperty(UserProfileQuery.prototype, \"myFollowers\", {\r\n /**\r\n * Gets the people who are following the current user\r\n *\r\n */\r\n get: function () {\r\n return new SharePointQueryableCollection(this, \"getmyfollowers\");\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(UserProfileQuery.prototype, \"myProperties\", {\r\n /**\r\n * Gets user properties for the current user\r\n *\r\n */\r\n get: function () {\r\n return new UserProfileQuery(this, \"getmyproperties\");\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Gets the people who the specified user is following\r\n *\r\n * @param loginName The account name of the user.\r\n */\r\n UserProfileQuery.prototype.getPeopleFollowedBy = function (loginName) {\r\n var q = this.clone(UserProfileQuery, \"getpeoplefollowedby(@v)\");\r\n q.query.set(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\r\n return q.get();\r\n };\r\n /**\r\n * Gets user properties for the specified user.\r\n *\r\n * @param loginName The account name of the user.\r\n */\r\n UserProfileQuery.prototype.getPropertiesFor = function (loginName) {\r\n var q = this.clone(UserProfileQuery, \"getpropertiesfor(@v)\");\r\n q.query.set(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\r\n return q.get();\r\n };\r\n Object.defineProperty(UserProfileQuery.prototype, \"trendingTags\", {\r\n /**\r\n * Gets the 20 most popular hash tags over the past week, sorted so that the most popular tag appears first\r\n *\r\n */\r\n get: function () {\r\n var q = this.clone(UserProfileQuery, null);\r\n q.concat(\".gettrendingtags\");\r\n return q.get();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Gets the specified user profile property for the specified user\r\n *\r\n * @param loginName The account name of the user\r\n * @param propertyName The case-sensitive name of the property to get\r\n */\r\n UserProfileQuery.prototype.getUserProfilePropertyFor = function (loginName, propertyName) {\r\n var q = this.clone(UserProfileQuery, \"getuserprofilepropertyfor(accountname=@v, propertyname='\" + propertyName + \"')\");\r\n q.query.set(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\r\n return q.get();\r\n };\r\n /**\r\n * Removes the specified user from the user's list of suggested people to follow\r\n *\r\n * @param loginName The account name of the user\r\n */\r\n UserProfileQuery.prototype.hideSuggestion = function (loginName) {\r\n var q = this.clone(UserProfileQuery, \"hidesuggestion(@v)\");\r\n q.query.set(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\r\n return q.postCore();\r\n };\r\n /**\r\n * A boolean values that indicates whether the first user is following the second user\r\n *\r\n * @param follower The account name of the user who might be following the followee\r\n * @param followee The account name of the user who might be followed by the follower\r\n */\r\n UserProfileQuery.prototype.isFollowing = function (follower, followee) {\r\n var q = this.clone(UserProfileQuery, null);\r\n q.concat(\".isfollowing(possiblefolloweraccountname=@v, possiblefolloweeaccountname=@y)\");\r\n q.query.set(\"@v\", \"'\" + encodeURIComponent(follower) + \"'\");\r\n q.query.set(\"@y\", \"'\" + encodeURIComponent(followee) + \"'\");\r\n return q.get();\r\n };\r\n /**\r\n * Uploads and sets the user profile picture (Users can upload a picture to their own profile only). Not supported for batching.\r\n *\r\n * @param profilePicSource Blob data representing the user's picture in BMP, JPEG, or PNG format of up to 4.76MB\r\n */\r\n UserProfileQuery.prototype.setMyProfilePic = function (profilePicSource) {\r\n var _this = this;\r\n return new Promise(function (resolve, reject) {\r\n var buffer = null;\r\n var reader = new FileReader();\r\n reader.onload = function (e) { return buffer = e.target.result; };\r\n reader.readAsArrayBuffer(profilePicSource);\r\n var request = new UserProfileQuery(_this, \"setmyprofilepicture\");\r\n request.postCore({\r\n body: String.fromCharCode.apply(null, new Uint16Array(buffer)),\r\n }).then(function (_) { return resolve(); }).catch(function (e) { return reject(e); });\r\n });\r\n };\r\n /**\r\n * Sets single value User Profile property\r\n *\r\n * @param accountName The account name of the user\r\n * @param propertyName Property name\r\n * @param propertyValue Property value\r\n */\r\n UserProfileQuery.prototype.setSingleValueProfileProperty = function (accountName, propertyName, propertyValue) {\r\n var postBody = jsS({\r\n accountName: accountName,\r\n propertyName: propertyName,\r\n propertyValue: propertyValue,\r\n });\r\n return this.clone(UserProfileQuery, \"SetSingleValueProfileProperty\")\r\n .postCore({ body: postBody });\r\n };\r\n /**\r\n * Sets multi valued User Profile property\r\n *\r\n * @param accountName The account name of the user\r\n * @param propertyName Property name\r\n * @param propertyValues Property values\r\n */\r\n UserProfileQuery.prototype.setMultiValuedProfileProperty = function (accountName, propertyName, propertyValues) {\r\n var postBody = jsS({\r\n accountName: accountName,\r\n propertyName: propertyName,\r\n propertyValues: propertyValues,\r\n });\r\n return this.clone(UserProfileQuery, \"SetMultiValuedProfileProperty\")\r\n .postCore({ body: postBody });\r\n };\r\n /**\r\n * Provisions one or more users' personal sites. (My Site administrator on SharePoint Online only)\r\n *\r\n * @param emails The email addresses of the users to provision sites for\r\n */\r\n UserProfileQuery.prototype.createPersonalSiteEnqueueBulk = function () {\r\n var emails = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n emails[_i] = arguments[_i];\r\n }\r\n return this.profileLoader.createPersonalSiteEnqueueBulk(emails);\r\n };\r\n Object.defineProperty(UserProfileQuery.prototype, \"ownerUserProfile\", {\r\n /**\r\n * Gets the user profile of the site owner\r\n *\r\n */\r\n get: function () {\r\n return this.profileLoader.ownerUserProfile;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(UserProfileQuery.prototype, \"userProfile\", {\r\n /**\r\n * Gets the user profile for the current user\r\n */\r\n get: function () {\r\n return this.profileLoader.userProfile;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Enqueues creating a personal site for this user, which can be used to share documents, web pages, and other files\r\n *\r\n * @param interactiveRequest true if interactively (web) initiated request, or false (default) if non-interactively (client) initiated request\r\n */\r\n UserProfileQuery.prototype.createPersonalSite = function (interactiveRequest) {\r\n if (interactiveRequest === void 0) { interactiveRequest = false; }\r\n return this.profileLoader.createPersonalSite(interactiveRequest);\r\n };\r\n /**\r\n * Sets the privacy settings for this profile\r\n *\r\n * @param share true to make all social data public; false to make all social data private\r\n */\r\n UserProfileQuery.prototype.shareAllSocialData = function (share) {\r\n return this.profileLoader.shareAllSocialData(share);\r\n };\r\n /**\r\n * Resolves user or group using specified query parameters\r\n *\r\n * @param queryParams The query parameters used to perform resolve\r\n */\r\n UserProfileQuery.prototype.clientPeoplePickerResolveUser = function (queryParams) {\r\n return this.clientPeoplePickerQuery.clientPeoplePickerResolveUser(queryParams);\r\n };\r\n /**\r\n * Searches for users or groups using specified query parameters\r\n *\r\n * @param queryParams The query parameters used to perform search\r\n */\r\n UserProfileQuery.prototype.clientPeoplePickerSearchUser = function (queryParams) {\r\n return this.clientPeoplePickerQuery.clientPeoplePickerSearchUser(queryParams);\r\n };\r\n return UserProfileQuery;\r\n}(SharePointQueryableInstance));\r\nvar ProfileLoader = /** @class */ (function (_super) {\r\n __extends(ProfileLoader, _super);\r\n function ProfileLoader() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n ProfileLoader_1 = ProfileLoader;\r\n /**\r\n * Provisions one or more users' personal sites. (My Site administrator on SharePoint Online only) Doesn't support batching\r\n *\r\n * @param emails The email addresses of the users to provision sites for\r\n */\r\n ProfileLoader.prototype.createPersonalSiteEnqueueBulk = function (emails) {\r\n return this.clone(ProfileLoader_1, \"createpersonalsiteenqueuebulk\", false).postCore({\r\n body: jsS({ \"emailIDs\": emails }),\r\n });\r\n };\r\n Object.defineProperty(ProfileLoader.prototype, \"ownerUserProfile\", {\r\n /**\r\n * Gets the user profile of the site owner.\r\n *\r\n */\r\n get: function () {\r\n var q = this.getParent(ProfileLoader_1, this.parentUrl, \"_api/sp.userprofiles.profileloader.getowneruserprofile\");\r\n if (this.hasBatch) {\r\n q = q.inBatch(this.batch);\r\n }\r\n return q.postCore();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ProfileLoader.prototype, \"userProfile\", {\r\n /**\r\n * Gets the user profile of the current user.\r\n *\r\n */\r\n get: function () {\r\n return this.clone(ProfileLoader_1, \"getuserprofile\").postCore();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Enqueues creating a personal site for this user, which can be used to share documents, web pages, and other files.\r\n *\r\n * @param interactiveRequest true if interactively (web) initiated request, or false (default) if non-interactively (client) initiated request\r\n */\r\n ProfileLoader.prototype.createPersonalSite = function (interactiveRequest) {\r\n if (interactiveRequest === void 0) { interactiveRequest = false; }\r\n return this.clone(ProfileLoader_1, \"getuserprofile/createpersonalsiteenque(\" + interactiveRequest + \")\").postCore();\r\n };\r\n /**\r\n * Sets the privacy settings for this profile\r\n *\r\n * @param share true to make all social data public; false to make all social data private.\r\n */\r\n ProfileLoader.prototype.shareAllSocialData = function (share) {\r\n return this.clone(ProfileLoader_1, \"getuserprofile/shareallsocialdata(\" + share + \")\").postCore();\r\n };\r\n var ProfileLoader_1;\r\n ProfileLoader = ProfileLoader_1 = __decorate([\r\n defaultPath(\"_api/sp.userprofiles.profileloader.getprofileloader\")\r\n ], ProfileLoader);\r\n return ProfileLoader;\r\n}(SharePointQueryable));\r\nvar ClientPeoplePickerQuery = /** @class */ (function (_super) {\r\n __extends(ClientPeoplePickerQuery, _super);\r\n function ClientPeoplePickerQuery() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n ClientPeoplePickerQuery_1 = ClientPeoplePickerQuery;\r\n /**\r\n * Resolves user or group using specified query parameters\r\n *\r\n * @param queryParams The query parameters used to perform resolve\r\n */\r\n ClientPeoplePickerQuery.prototype.clientPeoplePickerResolveUser = function (queryParams) {\r\n var q = this.clone(ClientPeoplePickerQuery_1, null);\r\n q.concat(\".clientpeoplepickerresolveuser\");\r\n return q.postCore({\r\n body: this.createClientPeoplePickerQueryParametersRequestBody(queryParams),\r\n })\r\n .then(function (res) {\r\n if (typeof res === \"object\") {\r\n return res.ClientPeoplePickerResolveUser;\r\n }\r\n return res;\r\n })\r\n .then(JSON.parse);\r\n };\r\n /**\r\n * Searches for users or groups using specified query parameters\r\n *\r\n * @param queryParams The query parameters used to perform search\r\n */\r\n ClientPeoplePickerQuery.prototype.clientPeoplePickerSearchUser = function (queryParams) {\r\n var q = this.clone(ClientPeoplePickerQuery_1, null);\r\n q.concat(\".clientpeoplepickersearchuser\");\r\n return q.postCore({\r\n body: this.createClientPeoplePickerQueryParametersRequestBody(queryParams),\r\n })\r\n .then(function (res) {\r\n if (typeof res === \"object\") {\r\n return res.ClientPeoplePickerSearchUser;\r\n }\r\n return res;\r\n })\r\n .then(JSON.parse);\r\n };\r\n /**\r\n * Creates ClientPeoplePickerQueryParameters request body\r\n *\r\n * @param queryParams The query parameters to create request body\r\n */\r\n ClientPeoplePickerQuery.prototype.createClientPeoplePickerQueryParametersRequestBody = function (queryParams) {\r\n return jsS({\r\n \"queryParams\": extend(metadata(\"SP.UI.ApplicationPages.ClientPeoplePickerQueryParameters\"), queryParams),\r\n });\r\n };\r\n var ClientPeoplePickerQuery_1;\r\n ClientPeoplePickerQuery = ClientPeoplePickerQuery_1 = __decorate([\r\n defaultPath(\"_api/sp.ui.applicationpages.clientpeoplepickerwebserviceinterface\")\r\n ], ClientPeoplePickerQuery);\r\n return ClientPeoplePickerQuery;\r\n}(SharePointQueryable));\n\n/**\r\n * Exposes social following methods\r\n */\r\nvar SocialQuery = /** @class */ (function (_super) {\r\n __extends(SocialQuery, _super);\r\n function SocialQuery() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n SocialQuery_1 = SocialQuery;\r\n Object.defineProperty(SocialQuery.prototype, \"my\", {\r\n get: function () {\r\n return new MySocialQuery(this);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Gets a URI to a site that lists the current user's followed sites.\r\n */\r\n SocialQuery.prototype.getFollowedSitesUri = function () {\r\n return this.clone(SocialQuery_1, \"FollowedSitesUri\").get().then(function (r) {\r\n return r.FollowedSitesUri || r;\r\n });\r\n };\r\n /**\r\n * Gets a URI to a site that lists the current user's followed documents.\r\n */\r\n SocialQuery.prototype.getFollowedDocumentsUri = function () {\r\n return this.clone(SocialQuery_1, \"FollowedDocumentsUri\").get().then(function (r) {\r\n return r.FollowedDocumentsUri || r;\r\n });\r\n };\r\n /**\r\n * Makes the current user start following a user, document, site, or tag\r\n *\r\n * @param actorInfo The actor to start following\r\n */\r\n SocialQuery.prototype.follow = function (actorInfo) {\r\n return this.clone(SocialQuery_1, \"follow\").postCore({ body: this.createSocialActorInfoRequestBody(actorInfo) });\r\n };\r\n /**\r\n * Indicates whether the current user is following a specified user, document, site, or tag\r\n *\r\n * @param actorInfo The actor to find the following status for\r\n */\r\n SocialQuery.prototype.isFollowed = function (actorInfo) {\r\n return this.clone(SocialQuery_1, \"isfollowed\").postCore({ body: this.createSocialActorInfoRequestBody(actorInfo) });\r\n };\r\n /**\r\n * Makes the current user stop following a user, document, site, or tag\r\n *\r\n * @param actorInfo The actor to stop following\r\n */\r\n SocialQuery.prototype.stopFollowing = function (actorInfo) {\r\n return this.clone(SocialQuery_1, \"stopfollowing\").postCore({ body: this.createSocialActorInfoRequestBody(actorInfo) });\r\n };\r\n /**\r\n * Creates SocialActorInfo request body\r\n *\r\n * @param actorInfo The actor to create request body\r\n */\r\n SocialQuery.prototype.createSocialActorInfoRequestBody = function (actorInfo) {\r\n return jsS({\r\n \"actor\": Object.assign(metadata(\"SP.Social.SocialActorInfo\"), {\r\n Id: null,\r\n }, actorInfo),\r\n });\r\n };\r\n var SocialQuery_1;\r\n SocialQuery = SocialQuery_1 = __decorate([\r\n defaultPath(\"_api/social.following\")\r\n ], SocialQuery);\r\n return SocialQuery;\r\n}(SharePointQueryableInstance));\r\nvar MySocialQuery = /** @class */ (function (_super) {\r\n __extends(MySocialQuery, _super);\r\n function MySocialQuery() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n MySocialQuery_1 = MySocialQuery;\r\n /**\r\n * Gets users, documents, sites, and tags that the current user is following.\r\n *\r\n * @param types Bitwise set of SocialActorTypes to retrieve\r\n */\r\n MySocialQuery.prototype.followed = function (types) {\r\n return this.clone(MySocialQuery_1, \"followed(types=\" + types + \")\").get().then(function (r) {\r\n return hOP(r, \"Followed\") ? r.Followed.results : r;\r\n });\r\n };\r\n /**\r\n * Gets the count of users, documents, sites, and tags that the current user is following.\r\n *\r\n * @param types Bitwise set of SocialActorTypes to retrieve\r\n */\r\n MySocialQuery.prototype.followedCount = function (types) {\r\n return this.clone(MySocialQuery_1, \"followedcount(types=\" + types + \")\").get().then(function (r) {\r\n return r.FollowedCount || r;\r\n });\r\n };\r\n /**\r\n * Gets the users who are following the current user.\r\n */\r\n MySocialQuery.prototype.followers = function () {\r\n return this.clone(MySocialQuery_1, \"followers\").get().then(function (r) {\r\n return hOP(r, \"Followers\") ? r.Followers.results : r;\r\n });\r\n };\r\n /**\r\n * Gets users who the current user might want to follow.\r\n */\r\n MySocialQuery.prototype.suggestions = function () {\r\n return this.clone(MySocialQuery_1, \"suggestions\").get().then(function (r) {\r\n return hOP(r, \"Suggestions\") ? r.Suggestions.results : r;\r\n });\r\n };\r\n var MySocialQuery_1;\r\n MySocialQuery = MySocialQuery_1 = __decorate([\r\n defaultPath(\"my\")\r\n ], MySocialQuery);\r\n return MySocialQuery;\r\n}(SharePointQueryableInstance));\r\n/**\r\n * Social actor type\r\n *\r\n */\r\nvar SocialActorType;\r\n(function (SocialActorType) {\r\n SocialActorType[SocialActorType[\"User\"] = 0] = \"User\";\r\n SocialActorType[SocialActorType[\"Document\"] = 1] = \"Document\";\r\n SocialActorType[SocialActorType[\"Site\"] = 2] = \"Site\";\r\n SocialActorType[SocialActorType[\"Tag\"] = 3] = \"Tag\";\r\n})(SocialActorType || (SocialActorType = {}));\r\n/**\r\n * Social actor type\r\n *\r\n */\r\n/* tslint:disable:no-bitwise */\r\nvar SocialActorTypes;\r\n(function (SocialActorTypes) {\r\n SocialActorTypes[SocialActorTypes[\"None\"] = 0] = \"None\";\r\n SocialActorTypes[SocialActorTypes[\"User\"] = 1] = \"User\";\r\n SocialActorTypes[SocialActorTypes[\"Document\"] = 2] = \"Document\";\r\n SocialActorTypes[SocialActorTypes[\"Site\"] = 4] = \"Site\";\r\n SocialActorTypes[SocialActorTypes[\"Tag\"] = 8] = \"Tag\";\r\n /**\r\n * The set excludes documents and sites that do not have feeds.\r\n */\r\n SocialActorTypes[SocialActorTypes[\"ExcludeContentWithoutFeeds\"] = 268435456] = \"ExcludeContentWithoutFeeds\";\r\n /**\r\n * The set includes group sites\r\n */\r\n SocialActorTypes[SocialActorTypes[\"IncludeGroupsSites\"] = 536870912] = \"IncludeGroupsSites\";\r\n /**\r\n * The set includes only items created within the last 24 hours\r\n */\r\n SocialActorTypes[SocialActorTypes[\"WithinLast24Hours\"] = 1073741824] = \"WithinLast24Hours\";\r\n})(SocialActorTypes || (SocialActorTypes = {}));\r\n/* tslint:enable */\r\n/**\r\n * Result from following\r\n *\r\n */\r\nvar SocialFollowResult;\r\n(function (SocialFollowResult) {\r\n SocialFollowResult[SocialFollowResult[\"Ok\"] = 0] = \"Ok\";\r\n SocialFollowResult[SocialFollowResult[\"AlreadyFollowing\"] = 1] = \"AlreadyFollowing\";\r\n SocialFollowResult[SocialFollowResult[\"LimitReached\"] = 2] = \"LimitReached\";\r\n SocialFollowResult[SocialFollowResult[\"InternalError\"] = 3] = \"InternalError\";\r\n})(SocialFollowResult || (SocialFollowResult = {}));\r\n/**\r\n * Specifies an exception or status code.\r\n */\r\nvar SocialStatusCode;\r\n(function (SocialStatusCode) {\r\n /**\r\n * The operation completed successfully\r\n */\r\n SocialStatusCode[SocialStatusCode[\"OK\"] = 0] = \"OK\";\r\n /**\r\n * The request is invalid.\r\n */\r\n SocialStatusCode[SocialStatusCode[\"InvalidRequest\"] = 1] = \"InvalidRequest\";\r\n /**\r\n * The current user is not authorized to perform the operation.\r\n */\r\n SocialStatusCode[SocialStatusCode[\"AccessDenied\"] = 2] = \"AccessDenied\";\r\n /**\r\n * The target of the operation was not found.\r\n */\r\n SocialStatusCode[SocialStatusCode[\"ItemNotFound\"] = 3] = \"ItemNotFound\";\r\n /**\r\n * The operation is invalid for the target's current state.\r\n */\r\n SocialStatusCode[SocialStatusCode[\"InvalidOperation\"] = 4] = \"InvalidOperation\";\r\n /**\r\n * The operation completed without modifying the target.\r\n */\r\n SocialStatusCode[SocialStatusCode[\"ItemNotModified\"] = 5] = \"ItemNotModified\";\r\n /**\r\n * The operation failed because an internal error occurred.\r\n */\r\n SocialStatusCode[SocialStatusCode[\"InternalError\"] = 6] = \"InternalError\";\r\n /**\r\n * The operation failed because the server could not access the distributed cache.\r\n */\r\n SocialStatusCode[SocialStatusCode[\"CacheReadError\"] = 7] = \"CacheReadError\";\r\n /**\r\n * The operation succeeded but the server could not update the distributed cache.\r\n */\r\n SocialStatusCode[SocialStatusCode[\"CacheUpdateError\"] = 8] = \"CacheUpdateError\";\r\n /**\r\n * No personal site exists for the current user, and no further information is available.\r\n */\r\n SocialStatusCode[SocialStatusCode[\"PersonalSiteNotFound\"] = 9] = \"PersonalSiteNotFound\";\r\n /**\r\n * No personal site exists for the current user, and a previous attempt to create one failed.\r\n */\r\n SocialStatusCode[SocialStatusCode[\"FailedToCreatePersonalSite\"] = 10] = \"FailedToCreatePersonalSite\";\r\n /**\r\n * No personal site exists for the current user, and a previous attempt to create one was not authorized.\r\n */\r\n SocialStatusCode[SocialStatusCode[\"NotAuthorizedToCreatePersonalSite\"] = 11] = \"NotAuthorizedToCreatePersonalSite\";\r\n /**\r\n * No personal site exists for the current user, and no attempt should be made to create one.\r\n */\r\n SocialStatusCode[SocialStatusCode[\"CannotCreatePersonalSite\"] = 12] = \"CannotCreatePersonalSite\";\r\n /**\r\n * The operation was rejected because an internal limit had been reached.\r\n */\r\n SocialStatusCode[SocialStatusCode[\"LimitReached\"] = 13] = \"LimitReached\";\r\n /**\r\n * The operation failed because an error occurred during the processing of the specified attachment.\r\n */\r\n SocialStatusCode[SocialStatusCode[\"AttachmentError\"] = 14] = \"AttachmentError\";\r\n /**\r\n * The operation succeeded with recoverable errors; the returned data is incomplete.\r\n */\r\n SocialStatusCode[SocialStatusCode[\"PartialData\"] = 15] = \"PartialData\";\r\n /**\r\n * A required SharePoint feature is not enabled.\r\n */\r\n SocialStatusCode[SocialStatusCode[\"FeatureDisabled\"] = 16] = \"FeatureDisabled\";\r\n /**\r\n * The site's storage quota has been exceeded.\r\n */\r\n SocialStatusCode[SocialStatusCode[\"StorageQuotaExceeded\"] = 17] = \"StorageQuotaExceeded\";\r\n /**\r\n * The operation failed because the server could not access the database.\r\n */\r\n SocialStatusCode[SocialStatusCode[\"DatabaseError\"] = 18] = \"DatabaseError\";\r\n})(SocialStatusCode || (SocialStatusCode = {}));\n\n/**\r\n * Allows for calling of the static SP.Utilities.Utility methods by supplying the method name\r\n */\r\nvar UtilityMethod = /** @class */ (function (_super) {\r\n __extends(UtilityMethod, _super);\r\n /**\r\n * Creates a new instance of the Utility method class\r\n *\r\n * @param baseUrl The parent url provider\r\n * @param methodName The static method name to call on the utility class\r\n */\r\n function UtilityMethod(baseUrl, methodName) {\r\n return _super.call(this, UtilityMethod.getBaseUrl(baseUrl), \"_api/SP.Utilities.Utility.\" + methodName) || this;\r\n }\r\n UtilityMethod.getBaseUrl = function (candidate) {\r\n if (typeof candidate === \"string\") {\r\n return candidate;\r\n }\r\n var c = candidate;\r\n var url = c.toUrl();\r\n var index = url.indexOf(\"_api/\");\r\n if (index < 0) {\r\n return url;\r\n }\r\n return url.substr(0, index);\r\n };\r\n UtilityMethod.prototype.excute = function (props) {\r\n return this.postCore({\r\n body: jsS(props),\r\n });\r\n };\r\n /**\r\n * Sends an email based on the supplied properties\r\n *\r\n * @param props The properties of the email to send\r\n */\r\n UtilityMethod.prototype.sendEmail = function (props) {\r\n var params = {\r\n properties: extend(metadata(\"SP.Utilities.EmailProperties\"), {\r\n Body: props.Body,\r\n From: props.From,\r\n Subject: props.Subject,\r\n }),\r\n };\r\n if (props.To && props.To.length > 0) {\r\n params.properties = extend(params.properties, {\r\n To: { results: props.To },\r\n });\r\n }\r\n if (props.CC && props.CC.length > 0) {\r\n params.properties = extend(params.properties, {\r\n CC: { results: props.CC },\r\n });\r\n }\r\n if (props.BCC && props.BCC.length > 0) {\r\n params.properties = extend(params.properties, {\r\n BCC: { results: props.BCC },\r\n });\r\n }\r\n if (props.AdditionalHeaders) {\r\n params.properties = extend(params.properties, {\r\n AdditionalHeaders: props.AdditionalHeaders,\r\n });\r\n }\r\n return this.clone(UtilityMethod, \"SendEmail\", true).excute(params);\r\n };\r\n UtilityMethod.prototype.getCurrentUserEmailAddresses = function () {\r\n return this.clone(UtilityMethod, \"GetCurrentUserEmailAddresses\", true).excute({});\r\n };\r\n UtilityMethod.prototype.resolvePrincipal = function (input, scopes, sources, inputIsEmailOnly, addToUserInfoList, matchUserInfoList) {\r\n if (matchUserInfoList === void 0) { matchUserInfoList = false; }\r\n var params = {\r\n addToUserInfoList: addToUserInfoList,\r\n input: input,\r\n inputIsEmailOnly: inputIsEmailOnly,\r\n matchUserInfoList: matchUserInfoList,\r\n scopes: scopes,\r\n sources: sources,\r\n };\r\n return this.clone(UtilityMethod, \"ResolvePrincipalInCurrentContext\", true).excute(params);\r\n };\r\n UtilityMethod.prototype.searchPrincipals = function (input, scopes, sources, groupName, maxCount) {\r\n var params = {\r\n groupName: groupName,\r\n input: input,\r\n maxCount: maxCount,\r\n scopes: scopes,\r\n sources: sources,\r\n };\r\n return this.clone(UtilityMethod, \"SearchPrincipalsUsingContextWeb\", true).excute(params);\r\n };\r\n UtilityMethod.prototype.createEmailBodyForInvitation = function (pageAddress) {\r\n var params = {\r\n pageAddress: pageAddress,\r\n };\r\n return this.clone(UtilityMethod, \"CreateEmailBodyForInvitation\", true).excute(params);\r\n };\r\n UtilityMethod.prototype.expandGroupsToPrincipals = function (inputs, maxCount) {\r\n if (maxCount === void 0) { maxCount = 30; }\r\n var params = {\r\n inputs: inputs,\r\n maxCount: maxCount,\r\n };\r\n return this.clone(UtilityMethod, \"ExpandGroupsToPrincipals\", true).excute(params);\r\n };\r\n UtilityMethod.prototype.createWikiPage = function (info) {\r\n return this.clone(UtilityMethod, \"CreateWikiPageInContextWeb\", true).excute({\r\n parameters: info,\r\n }).then(function (r) {\r\n return {\r\n data: r,\r\n file: new File(odataUrlFrom(r)),\r\n };\r\n });\r\n };\r\n return UtilityMethod;\r\n}(SharePointQueryable));\n\n/**\r\n * Root of the SharePoint REST module\r\n */\r\nvar SPRest = /** @class */ (function () {\r\n /**\r\n * Creates a new instance of the SPRest class\r\n *\r\n * @param options Additional options\r\n * @param baseUrl A string that should form the base part of the url\r\n */\r\n function SPRest(_options, _baseUrl) {\r\n if (_options === void 0) { _options = {}; }\r\n if (_baseUrl === void 0) { _baseUrl = \"\"; }\r\n this._options = _options;\r\n this._baseUrl = _baseUrl;\r\n }\r\n /**\r\n * Configures instance with additional options and baseUrl.\r\n * Provided configuration used by other objects in a chain\r\n *\r\n * @param options Additional options\r\n * @param baseUrl A string that should form the base part of the url\r\n */\r\n SPRest.prototype.configure = function (options, baseUrl) {\r\n if (baseUrl === void 0) { baseUrl = \"\"; }\r\n return new SPRest(options, baseUrl);\r\n };\r\n /**\r\n * Global SharePoint configuration options\r\n *\r\n * @param config The SharePoint configuration to apply\r\n */\r\n SPRest.prototype.setup = function (config) {\r\n setup(config);\r\n };\r\n /**\r\n * Executes a search against this web context\r\n *\r\n * @param query The SearchQuery definition\r\n */\r\n SPRest.prototype.searchSuggest = function (query) {\r\n var finalQuery;\r\n if (typeof query === \"string\") {\r\n finalQuery = { querytext: query };\r\n }\r\n else {\r\n finalQuery = query;\r\n }\r\n return this.create(SearchSuggest).execute(finalQuery);\r\n };\r\n /**\r\n * Executes a search against this web context\r\n *\r\n * @param query The SearchQuery definition\r\n */\r\n SPRest.prototype.search = function (query) {\r\n return this.create(Search).execute(query);\r\n };\r\n /**\r\n * Executes the provided search query, caching the results\r\n *\r\n * @param query The SearchQuery definition\r\n * @param options The set of caching options used to store the results\r\n */\r\n SPRest.prototype.searchWithCaching = function (query, options) {\r\n return this.create(Search).usingCaching(options).execute(query);\r\n };\r\n Object.defineProperty(SPRest.prototype, \"site\", {\r\n /**\r\n * Begins a site collection scoped REST request\r\n *\r\n */\r\n get: function () {\r\n return this.create(Site);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(SPRest.prototype, \"web\", {\r\n /**\r\n * Begins a web scoped REST request\r\n *\r\n */\r\n get: function () {\r\n return this.create(Web);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(SPRest.prototype, \"profiles\", {\r\n /**\r\n * Access to user profile methods\r\n *\r\n */\r\n get: function () {\r\n return this.create(UserProfileQuery);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(SPRest.prototype, \"social\", {\r\n /**\r\n * Access to social methods\r\n */\r\n get: function () {\r\n return this.create(SocialQuery);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(SPRest.prototype, \"navigation\", {\r\n /**\r\n * Access to the site collection level navigation service\r\n */\r\n get: function () {\r\n return new NavigationService();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Creates a new batch object for use with the SharePointQueryable.addToBatch method\r\n *\r\n */\r\n SPRest.prototype.createBatch = function () {\r\n return this.web.createBatch();\r\n };\r\n Object.defineProperty(SPRest.prototype, \"utility\", {\r\n /**\r\n * Static utilities methods from SP.Utilities.Utility\r\n */\r\n get: function () {\r\n return this.create(UtilityMethod, \"\");\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Handles creating and configuring the objects returned from this class\r\n *\r\n * @param fm The factory method used to create the instance\r\n * @param path Optional additional path information to pass to the factory method\r\n */\r\n SPRest.prototype.create = function (fm, path) {\r\n return new fm(this._baseUrl, path).configure(this._options);\r\n };\r\n return SPRest;\r\n}());\r\nvar sp = new SPRest();\n\nexport { odataUrlFrom, spODataEntity, spODataEntityArray, SharePointQueryable, SharePointQueryableInstance, SharePointQueryableCollection, SharePointQueryableSecurable, FileFolderShared, SharePointQueryableShareable, SharePointQueryableShareableFile, SharePointQueryableShareableFolder, SharePointQueryableShareableItem, SharePointQueryableShareableWeb, AppCatalog, App, SPBatch, ContentType, ContentTypes, FieldLink, FieldLinks, Field, Fields, CheckinType, WebPartsPersonalizationScope, MoveOperations, TemplateFileType, File, Files, Folder, Folders, SPHttpClient, Item, Items, ItemVersion, ItemVersions, PagedItemCollection, NavigationNodes, NavigationNode, NavigationService, List, Lists, RegionalSettings, InstalledLanguages, TimeZone, TimeZones, sp, SPRest, RoleDefinitionBindings, Search, SearchQueryBuilder, SearchResults, SortDirection, ReorderingRuleMatchType, QueryPropertyValueType, SearchBuiltInSourceId, SearchSuggest, Site, UserProfileQuery, toAbsoluteUrl, extractWebUrl, UtilityMethod, View, Views, ViewFields, WebPartDefinitions, WebPartDefinition, WebPart, Web, PromotedState, ClientSidePage, CanvasSection, CanvasControl, CanvasColumn, ClientSidePart, ClientSideText, ClientSideWebpart, Comments, Comment, Replies, SocialQuery, MySocialQuery, SocialActorType, SocialActorTypes, SocialFollowResult, SocialStatusCode, ControlMode, FieldTypes, DateTimeFieldFormatType, AddFieldOptions, CalendarType, UrlFieldFormatType, PermissionKind, PrincipalType$1 as PrincipalType, PrincipalSource, RoleType, PageType, SharingLinkKind, SharingRole, SharingOperationStatusCode, SPSharedObjectType, SharingDomainRestrictionMode, RenderListDataOptions, FieldUserSelectionMode, ChoiceFieldFormatType, UrlZone };\n//# sourceMappingURL=sp.es5.js.map\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./dist/packages/sp/dist/sp.es5.js\n// module id = 15\n// module chunks = 0"],"sourceRoot":""}