]*data-sp-htmlproperties[^>]*?>/i, function (markup) {
return markup.replace(/^
]*data-sp-htmlproperties[^>]*?>/i, "").replace(/<\/div>$/i, "");
});
this.htmlProperties = htmlProps.length > 0 ? htmlProps[0] : "";
};
ClientSideWebpart.prototype.getControlData = function () {
return {
controlType: this.controlType,
id: this.id,
position: {
controlIndex: this.order,
sectionFactor: this.column.factor,
sectionIndex: this.column.order,
zoneIndex: this.column.section.order,
},
webPartId: this.webPartId,
};
};
ClientSideWebpart.prototype.renderHtmlProperties = function () {
var html = [];
if (this.serverProcessedContent === undefined || this.serverProcessedContent === null) {
html.push(this.htmlProperties);
}
else if (this.serverProcessedContent !== undefined) {
if (this.serverProcessedContent.searchablePlainTexts !== undefined) {
var keys = Object.keys(this.serverProcessedContent.searchablePlainTexts);
for (var i = 0; i < keys.length; i++) {
html.push("
");
html.push(this.serverProcessedContent.searchablePlainTexts[keys[i]]);
html.push("
");
}
}
if (this.serverProcessedContent.imageSources !== undefined) {
var keys = Object.keys(this.serverProcessedContent.imageSources);
for (var i = 0; i < keys.length; i++) {
html.push("
");
}
}
if (this.serverProcessedContent.links !== undefined) {
var keys = Object.keys(this.serverProcessedContent.links);
for (var i = 0; i < keys.length; i++) {
html.push("
");
}
}
}
return html.join("");
};
ClientSideWebpart.prototype.parseJsonProperties = function (props) {
// 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
if (props.webPartData !== undefined && props.webPartData.serverProcessedContent !== undefined) {
this.serverProcessedContent = props.webPartData.serverProcessedContent;
}
else if (props.serverProcessedContent !== undefined) {
this.serverProcessedContent = props.serverProcessedContent;
}
else {
this.serverProcessedContent = null;
}
if (props.webPartData !== undefined && props.webPartData.properties !== undefined) {
return props.webPartData.properties;
}
else if (props.properties !== undefined) {
return props.properties;
}
else {
return props;
}
};
return ClientSideWebpart;
}(ClientSidePart));
/**
* Represents a collection of navigation nodes
*
*/
var NavigationNodes = /** @class */ (function (_super) {
Object(__WEBPACK_IMPORTED_MODULE_1_tslib__["b" /* __extends */])(NavigationNodes, _super);
function NavigationNodes() {
return _super !== null && _super.apply(this, arguments) || this;
}
/**
* Gets a navigation node by id
*
* @param id The id of the node
*/
NavigationNodes.prototype.getById = function (id) {
var node = new NavigationNode(this);
node.concat("(" + id + ")");
return node;
};
/**
* Adds a new node to the collection
*
* @param title Display name of the node
* @param url The url of the node
* @param visible If true the node is visible, otherwise it is hidden (default: true)
*/
NavigationNodes.prototype.add = function (title, url, visible) {
var _this = this;
if (visible === void 0) { visible = true; }
var postBody = Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["n" /* jsS */])(Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["f" /* extend */])(metadata("SP.NavigationNode"), {
IsVisible: visible,
Title: title,
Url: url,
}));
return this.clone(NavigationNodes, null).postCore({ body: postBody }).then(function (data) {
return {
data: data,
node: _this.getById(data.Id),
};
});
};
/**
* Moves a node to be after another node in the navigation
*
* @param nodeId Id of the node to move
* @param previousNodeId Id of the node after which we move the node specified by nodeId
*/
NavigationNodes.prototype.moveAfter = function (nodeId, previousNodeId) {
var postBody = Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["n" /* jsS */])({
nodeId: nodeId,
previousNodeId: previousNodeId,
});
return this.clone(NavigationNodes, "MoveAfter").postCore({ body: postBody });
};
return NavigationNodes;
}(SharePointQueryableCollection));
/**
* Represents an instance of a navigation node
*
*/
var NavigationNode = /** @class */ (function (_super) {
Object(__WEBPACK_IMPORTED_MODULE_1_tslib__["b" /* __extends */])(NavigationNode, _super);
function NavigationNode() {
return _super !== null && _super.apply(this, arguments) || this;
}
Object.defineProperty(NavigationNode.prototype, "children", {
/**
* Represents the child nodes of this node
*/
get: function () {
return new NavigationNodes(this, "Children");
},
enumerable: true,
configurable: true
});
/**
* Deletes this node and any child nodes
*/
NavigationNode.prototype.delete = function () {
return _super.prototype.deleteCore.call(this);
};
return NavigationNode;
}(SharePointQueryableInstance));
/**
* Exposes the navigation components
*
*/
var Navigation = /** @class */ (function (_super) {
Object(__WEBPACK_IMPORTED_MODULE_1_tslib__["b" /* __extends */])(Navigation, _super);
function Navigation() {
return _super !== null && _super.apply(this, arguments) || this;
}
Object.defineProperty(Navigation.prototype, "quicklaunch", {
/**
* Gets the quicklaunch navigation nodes for the current context
*
*/
get: function () {
return new NavigationNodes(this, "quicklaunch");
},
enumerable: true,
configurable: true
});
Object.defineProperty(Navigation.prototype, "topNavigationBar", {
/**
* Gets the top bar navigation nodes for the current context
*
*/
get: function () {
return new NavigationNodes(this, "topnavigationbar");
},
enumerable: true,
configurable: true
});
Navigation = Object(__WEBPACK_IMPORTED_MODULE_1_tslib__["a" /* __decorate */])([
defaultPath("navigation")
], Navigation);
return Navigation;
}(SharePointQueryable));
/**
* Represents the top level navigation service
*/
var NavigationService = /** @class */ (function (_super) {
Object(__WEBPACK_IMPORTED_MODULE_1_tslib__["b" /* __extends */])(NavigationService, _super);
function NavigationService(path) {
if (path === void 0) { path = null; }
return _super.call(this, "_api/navigation", path) || this;
}
/**
* The MenuState service operation returns a Menu-State (dump) of a SiteMapProvider on a site.
*
* @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.
* @param depth Depth of the dump. If no value is provided a dump with the depth of 10 is returned
* @param mapProviderName The name identifying the SiteMapProvider to be used
* @param customProperties comma seperated list of custom properties to be returned.
*/
NavigationService.prototype.getMenuState = function (menuNodeKey, depth, mapProviderName, customProperties) {
if (menuNodeKey === void 0) { menuNodeKey = null; }
if (depth === void 0) { depth = 10; }
if (mapProviderName === void 0) { mapProviderName = null; }
if (customProperties === void 0) { customProperties = null; }
return (new NavigationService("MenuState")).postCore({
body: Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["n" /* jsS */])({
customProperties: customProperties,
depth: depth,
mapProviderName: mapProviderName,
menuNodeKey: menuNodeKey,
}),
});
};
/**
* Tries to get a SiteMapNode.Key for a given URL within a site collection.
*
* @param currentUrl A url representing the SiteMapNode
* @param mapProviderName The name identifying the SiteMapProvider to be used
*/
NavigationService.prototype.getMenuNodeKey = function (currentUrl, mapProviderName) {
if (mapProviderName === void 0) { mapProviderName = null; }
return (new NavigationService("MenuNodeKey")).postCore({
body: Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["n" /* jsS */])({
currentUrl: currentUrl,
mapProviderName: mapProviderName,
}),
});
};
return NavigationService;
}(SharePointQueryable));
/**
* Describes regional settings ODada object
*/
var RegionalSettings = /** @class */ (function (_super) {
Object(__WEBPACK_IMPORTED_MODULE_1_tslib__["b" /* __extends */])(RegionalSettings, _super);
function RegionalSettings() {
return _super !== null && _super.apply(this, arguments) || this;
}
Object.defineProperty(RegionalSettings.prototype, "installedLanguages", {
/**
* Gets the collection of languages used in a server farm.
*/
get: function () {
return new InstalledLanguages(this);
},
enumerable: true,
configurable: true
});
Object.defineProperty(RegionalSettings.prototype, "globalInstalledLanguages", {
/**
* Gets the collection of language packs that are installed on the server.
*/
get: function () {
return new InstalledLanguages(this, "globalinstalledlanguages");
},
enumerable: true,
configurable: true
});
Object.defineProperty(RegionalSettings.prototype, "timeZone", {
/**
* Gets time zone
*/
get: function () {
return new TimeZone(this);
},
enumerable: true,
configurable: true
});
Object.defineProperty(RegionalSettings.prototype, "timeZones", {
/**
* Gets time zones
*/
get: function () {
return new TimeZones(this);
},
enumerable: true,
configurable: true
});
RegionalSettings = Object(__WEBPACK_IMPORTED_MODULE_1_tslib__["a" /* __decorate */])([
defaultPath("regionalsettings")
], RegionalSettings);
return RegionalSettings;
}(SharePointQueryableInstance));
/**
* Describes installed languages ODada queriable collection
*/
var InstalledLanguages = /** @class */ (function (_super) {
Object(__WEBPACK_IMPORTED_MODULE_1_tslib__["b" /* __extends */])(InstalledLanguages, _super);
function InstalledLanguages() {
return _super !== null && _super.apply(this, arguments) || this;
}
InstalledLanguages = Object(__WEBPACK_IMPORTED_MODULE_1_tslib__["a" /* __decorate */])([
defaultPath("installedlanguages")
], InstalledLanguages);
return InstalledLanguages;
}(SharePointQueryableCollection));
/**
* Describes TimeZone ODada object
*/
var TimeZone = /** @class */ (function (_super) {
Object(__WEBPACK_IMPORTED_MODULE_1_tslib__["b" /* __extends */])(TimeZone, _super);
function TimeZone() {
return _super !== null && _super.apply(this, arguments) || this;
}
TimeZone_1 = TimeZone;
/**
* Gets an Local Time by UTC Time
*
* @param utcTime UTC Time as Date or ISO String
*/
TimeZone.prototype.utcToLocalTime = function (utcTime) {
var dateIsoString;
if (typeof utcTime === "string") {
dateIsoString = utcTime;
}
else {
dateIsoString = utcTime.toISOString();
}
return this.clone(TimeZone_1, "utctolocaltime('" + dateIsoString + "')")
.postCore()
.then(function (res) { return Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["k" /* hOP */])(res, "UTCToLocalTime") ? res.UTCToLocalTime : res; });
};
/**
* Gets an UTC Time by Local Time
*
* @param localTime Local Time as Date or ISO String
*/
TimeZone.prototype.localTimeToUTC = function (localTime) {
var dateIsoString;
if (typeof localTime === "string") {
dateIsoString = localTime;
}
else {
dateIsoString = Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["e" /* dateAdd */])(localTime, "minute", localTime.getTimezoneOffset() * -1).toISOString();
}
return this.clone(TimeZone_1, "localtimetoutc('" + dateIsoString + "')")
.postCore()
.then(function (res) { return Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["k" /* hOP */])(res, "LocalTimeToUTC") ? res.LocalTimeToUTC : res; });
};
var TimeZone_1;
TimeZone = TimeZone_1 = Object(__WEBPACK_IMPORTED_MODULE_1_tslib__["a" /* __decorate */])([
defaultPath("timezone")
], TimeZone);
return TimeZone;
}(SharePointQueryableInstance));
/**
* Describes time zones queriable collection
*/
var TimeZones = /** @class */ (function (_super) {
Object(__WEBPACK_IMPORTED_MODULE_1_tslib__["b" /* __extends */])(TimeZones, _super);
function TimeZones() {
return _super !== null && _super.apply(this, arguments) || this;
}
TimeZones_1 = TimeZones;
// https://msdn.microsoft.com/en-us/library/office/jj247008.aspx - timezones ids
/**
* Gets an TimeZone by id
*
* @param id The integer id of the timezone to retrieve
*/
TimeZones.prototype.getById = function (id) {
// do the post and merge the result into a TimeZone instance so the data and methods are available
return this.clone(TimeZones_1, "GetById(" + id + ")").postCore({}, spODataEntity(TimeZone));
};
var TimeZones_1;
TimeZones = TimeZones_1 = Object(__WEBPACK_IMPORTED_MODULE_1_tslib__["a" /* __decorate */])([
defaultPath("timezones")
], TimeZones);
return TimeZones;
}(SharePointQueryableCollection));
var funcs = new Map([
["text", "Querytext"],
["template", "QueryTemplate"],
["sourceId", "SourceId"],
["trimDuplicatesIncludeId", ""],
["startRow", ""],
["rowLimit", ""],
["rankingModelId", ""],
["rowsPerPage", ""],
["selectProperties", ""],
["culture", ""],
["timeZoneId", ""],
["refinementFilters", ""],
["refiners", ""],
["hiddenConstraints", ""],
["sortList", ""],
["timeout", ""],
["hithighlightedProperties", ""],
["clientType", ""],
["personalizationData", ""],
["resultsURL", ""],
["queryTag", ""],
["properties", ""],
["queryTemplatePropertiesUrl", ""],
["reorderingRules", ""],
["hitHighlightedMultivaluePropertyLimit", ""],
["collapseSpecification", ""],
["uiLanguage", ""],
["desiredSnippetLength", ""],
["maxSnippetLength", ""],
["summaryLength", ""],
]);
var props = new Map([]);
function toPropCase(str) {
return str.replace(/^(.)/, function ($1) { return $1.toUpperCase(); });
}
/**
* Creates a new instance of the SearchQueryBuilder
*
* @param queryText Initial query text
* @param _query Any initial query configuration
*/
function SearchQueryBuilder(queryText, _query) {
if (queryText === void 0) { queryText = ""; }
if (_query === void 0) { _query = {}; }
return new Proxy({
query: Object.assign({
Querytext: queryText,
}, _query),
}, {
get: function (self, propertyKey, proxy) {
var pk = propertyKey.toString();
if (pk === "toSearchQuery") {
return function () { return self.query; };
}
if (funcs.has(pk)) {
return function () {
var value = [];
for (var _i = 0; _i < arguments.length; _i++) {
value[_i] = arguments[_i];
}
var mappedPk = funcs.get(pk);
self.query[mappedPk.length > 0 ? mappedPk : toPropCase(pk)] = value.length > 1 ? value : value[0];
return proxy;
};
}
var propKey = props.has(pk) ? props.get(pk) : toPropCase(pk);
self.query[propKey] = true;
return proxy;
},
});
}
/**
* Describes the search API
*
*/
var Search = /** @class */ (function (_super) {
Object(__WEBPACK_IMPORTED_MODULE_1_tslib__["b" /* __extends */])(Search, _super);
function Search() {
return _super !== null && _super.apply(this, arguments) || this;
}
/**
* @returns Promise
*/
Search.prototype.execute = function (queryInit) {
var _this = this;
var query = this.parseQuery(queryInit);
var formattedBody;
formattedBody = query;
if (formattedBody.SelectProperties) {
formattedBody.SelectProperties = this.fixupProp(query.SelectProperties);
}
if (formattedBody.RefinementFilters) {
formattedBody.RefinementFilters = this.fixupProp(query.RefinementFilters);
}
if (formattedBody.SortList) {
formattedBody.SortList = this.fixupProp(query.SortList);
}
if (formattedBody.HithighlightedProperties) {
formattedBody.HithighlightedProperties = this.fixupProp(query.HitHighlightedProperties);
}
if (formattedBody.ReorderingRules) {
formattedBody.ReorderingRules = this.fixupProp(query.ReorderingRules);
}
if (formattedBody.Properties) {
formattedBody.Properties = this.fixupProp(query.Properties);
}
var postBody = Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["n" /* jsS */])({
request: Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["f" /* extend */])(metadata("Microsoft.Office.Server.Search.REST.SearchRequest"), formattedBody),
});
// if we are using caching with this search request, then we need to handle some work upfront to enable that
if (this._useCaching) {
// force use of the cache for this request if .usingCaching was called
this._forceCaching = true;
// because all the requests use the same url they would collide in the cache we use a special key
var cacheKey = "PnPjs.SearchWithCaching(" + Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["j" /* getHashCode */])(postBody) + ")";
if (Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["q" /* objectDefinedNotNull */])(this._cachingOptions)) {
// if our key ends in the postquery url we overwrite it
if (/\/_api\/search\/postquery$/i.test(this._cachingOptions.key)) {
this._cachingOptions.key = cacheKey;
}
}
else {
this._cachingOptions = new __WEBPACK_IMPORTED_MODULE_3__pnp_odata__["c" /* CachingOptions */](cacheKey);
}
}
return this.postCore({ body: postBody }).then(function (data) { return new SearchResults(data, _this.toUrl(), query); });
};
/**
* Fixes up properties that expect to consist of a "results" collection when needed
*
* @param prop property to fixup for container struct
*/
Search.prototype.fixupProp = function (prop) {
return Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["k" /* hOP */])(prop, "results") ? prop : { results: prop };
};
/**
* Translates one of the query initializers into a SearchQuery instance
*
* @param query
*/
Search.prototype.parseQuery = function (query) {
var finalQuery;
if (typeof query === "string") {
finalQuery = { Querytext: query };
}
else if (query.toSearchQuery) {
finalQuery = query.toSearchQuery();
}
else {
finalQuery = query;
}
return finalQuery;
};
Search = Object(__WEBPACK_IMPORTED_MODULE_1_tslib__["a" /* __decorate */])([
defaultPath("_api/search/postquery")
], Search);
return Search;
}(SharePointQueryableInstance));
/**
* Describes the SearchResults class, which returns the formatted and raw version of the query response
*/
var SearchResults = /** @class */ (function () {
/**
* Creates a new instance of the SearchResult class
*
*/
function SearchResults(rawResponse, _url, _query, _raw, _primary) {
if (_raw === void 0) { _raw = null; }
if (_primary === void 0) { _primary = null; }
this._url = _url;
this._query = _query;
this._raw = _raw;
this._primary = _primary;
this._raw = rawResponse.postquery ? rawResponse.postquery : rawResponse;
}
Object.defineProperty(SearchResults.prototype, "ElapsedTime", {
get: function () {
return this.RawSearchResults.ElapsedTime;
},
enumerable: true,
configurable: true
});
Object.defineProperty(SearchResults.prototype, "RowCount", {
get: function () {
return this.RawSearchResults.PrimaryQueryResult.RelevantResults.RowCount;
},
enumerable: true,
configurable: true
});
Object.defineProperty(SearchResults.prototype, "TotalRows", {
get: function () {
return this.RawSearchResults.PrimaryQueryResult.RelevantResults.TotalRows;
},
enumerable: true,
configurable: true
});
Object.defineProperty(SearchResults.prototype, "TotalRowsIncludingDuplicates", {
get: function () {
return this.RawSearchResults.PrimaryQueryResult.RelevantResults.TotalRowsIncludingDuplicates;
},
enumerable: true,
configurable: true
});
Object.defineProperty(SearchResults.prototype, "RawSearchResults", {
get: function () {
return this._raw;
},
enumerable: true,
configurable: true
});
Object.defineProperty(SearchResults.prototype, "PrimarySearchResults", {
get: function () {
if (this._primary === null) {
this._primary = this.formatSearchResults(this._raw.PrimaryQueryResult.RelevantResults.Table.Rows);
}
return this._primary;
},
enumerable: true,
configurable: true
});
/**
* Gets a page of results
*
* @param pageNumber Index of the page to return. Used to determine StartRow
* @param pageSize Optional, items per page (default = 10)
*/
SearchResults.prototype.getPage = function (pageNumber, pageSize) {
// if we got all the available rows we don't have another page
if (this.TotalRows < this.RowCount) {
return Promise.resolve(null);
}
// if pageSize is supplied, then we use that regardless of any previous values
// otherwise get the previous RowLimit or default to 10
var rows = pageSize !== undefined ? pageSize : Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["k" /* hOP */])(this._query, "RowLimit") ? this._query.RowLimit : 10;
var query = Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["f" /* extend */])(this._query, {
RowLimit: rows,
StartRow: rows * (pageNumber - 1),
});
// we have reached the end
if (query.StartRow > this.TotalRows) {
return Promise.resolve(null);
}
var search = new Search(this._url, null);
return search.execute(query);
};
/**
* Formats a search results array
*
* @param rawResults The array to process
*/
SearchResults.prototype.formatSearchResults = function (rawResults) {
var results = new Array();
var tempResults = rawResults.results ? rawResults.results : rawResults;
for (var _i = 0, tempResults_1 = tempResults; _i < tempResults_1.length; _i++) {
var tempResult = tempResults_1[_i];
var cells = tempResult.Cells.results ? tempResult.Cells.results : tempResult.Cells;
results.push(cells.reduce(function (res, cell) {
Object.defineProperty(res, cell.Key, {
configurable: false,
enumerable: true,
value: cell.Value,
writable: false,
});
return res;
}, {}));
}
return results;
};
return SearchResults;
}());
/**
* defines the SortDirection enum
*/
var SortDirection;
(function (SortDirection) {
SortDirection[SortDirection["Ascending"] = 0] = "Ascending";
SortDirection[SortDirection["Descending"] = 1] = "Descending";
SortDirection[SortDirection["FQLFormula"] = 2] = "FQLFormula";
})(SortDirection || (SortDirection = {}));
/**
* defines the ReorderingRuleMatchType enum
*/
var ReorderingRuleMatchType;
(function (ReorderingRuleMatchType) {
ReorderingRuleMatchType[ReorderingRuleMatchType["ResultContainsKeyword"] = 0] = "ResultContainsKeyword";
ReorderingRuleMatchType[ReorderingRuleMatchType["TitleContainsKeyword"] = 1] = "TitleContainsKeyword";
ReorderingRuleMatchType[ReorderingRuleMatchType["TitleMatchesKeyword"] = 2] = "TitleMatchesKeyword";
ReorderingRuleMatchType[ReorderingRuleMatchType["UrlStartsWith"] = 3] = "UrlStartsWith";
ReorderingRuleMatchType[ReorderingRuleMatchType["UrlExactlyMatches"] = 4] = "UrlExactlyMatches";
ReorderingRuleMatchType[ReorderingRuleMatchType["ContentTypeIs"] = 5] = "ContentTypeIs";
ReorderingRuleMatchType[ReorderingRuleMatchType["FileExtensionMatches"] = 6] = "FileExtensionMatches";
ReorderingRuleMatchType[ReorderingRuleMatchType["ResultHasTag"] = 7] = "ResultHasTag";
ReorderingRuleMatchType[ReorderingRuleMatchType["ManualCondition"] = 8] = "ManualCondition";
})(ReorderingRuleMatchType || (ReorderingRuleMatchType = {}));
/**
* Specifies the type value for the property
*/
var QueryPropertyValueType;
(function (QueryPropertyValueType) {
QueryPropertyValueType[QueryPropertyValueType["None"] = 0] = "None";
QueryPropertyValueType[QueryPropertyValueType["StringType"] = 1] = "StringType";
QueryPropertyValueType[QueryPropertyValueType["Int32Type"] = 2] = "Int32Type";
QueryPropertyValueType[QueryPropertyValueType["BooleanType"] = 3] = "BooleanType";
QueryPropertyValueType[QueryPropertyValueType["StringArrayType"] = 4] = "StringArrayType";
QueryPropertyValueType[QueryPropertyValueType["UnSupportedType"] = 5] = "UnSupportedType";
})(QueryPropertyValueType || (QueryPropertyValueType = {}));
var SearchBuiltInSourceId = /** @class */ (function () {
function SearchBuiltInSourceId() {
}
SearchBuiltInSourceId.Documents = "e7ec8cee-ded8-43c9-beb5-436b54b31e84";
SearchBuiltInSourceId.ItemsMatchingContentType = "5dc9f503-801e-4ced-8a2c-5d1237132419";
SearchBuiltInSourceId.ItemsMatchingTag = "e1327b9c-2b8c-4b23-99c9-3730cb29c3f7";
SearchBuiltInSourceId.ItemsRelatedToCurrentUser = "48fec42e-4a92-48ce-8363-c2703a40e67d";
SearchBuiltInSourceId.ItemsWithSameKeywordAsThisItem = "5c069288-1d17-454a-8ac6-9c642a065f48";
SearchBuiltInSourceId.LocalPeopleResults = "b09a7990-05ea-4af9-81ef-edfab16c4e31";
SearchBuiltInSourceId.LocalReportsAndDataResults = "203fba36-2763-4060-9931-911ac8c0583b";
SearchBuiltInSourceId.LocalSharePointResults = "8413cd39-2156-4e00-b54d-11efd9abdb89";
SearchBuiltInSourceId.LocalVideoResults = "78b793ce-7956-4669-aa3b-451fc5defebf";
SearchBuiltInSourceId.Pages = "5e34578e-4d08-4edc-8bf3-002acf3cdbcc";
SearchBuiltInSourceId.Pictures = "38403c8c-3975-41a8-826e-717f2d41568a";
SearchBuiltInSourceId.Popular = "97c71db1-58ce-4891-8b64-585bc2326c12";
SearchBuiltInSourceId.RecentlyChangedItems = "ba63bbae-fa9c-42c0-b027-9a878f16557c";
SearchBuiltInSourceId.RecommendedItems = "ec675252-14fa-4fbe-84dd-8d098ed74181";
SearchBuiltInSourceId.Wiki = "9479bf85-e257-4318-b5a8-81a180f5faa1";
return SearchBuiltInSourceId;
}());
var SearchSuggest = /** @class */ (function (_super) {
Object(__WEBPACK_IMPORTED_MODULE_1_tslib__["b" /* __extends */])(SearchSuggest, _super);
function SearchSuggest() {
return _super !== null && _super.apply(this, arguments) || this;
}
SearchSuggest.prototype.execute = function (query) {
this.mapQueryToQueryString(query);
return this.get().then(function (response) {
var mapper = Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["k" /* hOP */])(response, "suggest") ? function (s) { return response.suggest[s].results; } : function (s) { return response[s]; };
return {
PeopleNames: mapper("PeopleNames"),
PersonalResults: mapper("PersonalResults"),
Queries: mapper("Queries"),
};
});
};
SearchSuggest.prototype.mapQueryToQueryString = function (query) {
var _this = this;
var setProp = function (q) { return function (checkProp) { return function (sp) {
if (Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["k" /* hOP */])(q, checkProp)) {
_this.query.set(sp, q[checkProp].toString());
}
}; }; };
this.query.set("querytext", "'" + query.querytext + "'");
var querySetter = setProp(query);
querySetter("count")("inumberofquerysuggestions");
querySetter("personalCount")("inumberofresultsuggestions");
querySetter("preQuery")("fprequerysuggestions");
querySetter("hitHighlighting")("fhithighlighting");
querySetter("capitalize")("fcapitalizefirstletters");
querySetter("culture")("culture");
querySetter("stemming")("enablestemming");
querySetter("includePeople")("showpeoplenamesuggestions");
querySetter("queryRules")("enablequeryrules");
querySetter("prefixMatch")("fprefixmatchallterms");
};
SearchSuggest = Object(__WEBPACK_IMPORTED_MODULE_1_tslib__["a" /* __decorate */])([
defaultPath("_api/search/suggest")
], SearchSuggest);
return SearchSuggest;
}(SharePointQueryableInstance));
/**
* Describes a collection of List objects
*
*/
var Features = /** @class */ (function (_super) {
Object(__WEBPACK_IMPORTED_MODULE_1_tslib__["b" /* __extends */])(Features, _super);
function Features() {
return _super !== null && _super.apply(this, arguments) || this;
}
Features_1 = Features;
/**
* Adds a new list to the collection
*
* @param id The Id of the feature (GUID)
* @param force If true the feature activation will be forced
*/
Features.prototype.add = function (id, force) {
var _this = this;
if (force === void 0) { force = false; }
return this.clone(Features_1, "add").postCore({
body: Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["n" /* jsS */])({
featdefScope: 0,
featureId: id,
force: force,
}),
}).then(function (data) {
return {
data: data,
feature: _this.getById(id),
};
});
};
/**
* Gets a list from the collection by guid id
*
* @param id The Id of the feature (GUID)
*/
Features.prototype.getById = function (id) {
var feature = new Feature(this);
feature.concat("('" + id + "')");
return feature;
};
/**
* Removes (deactivates) a feature from the collection
*
* @param id The Id of the feature (GUID)
* @param force If true the feature deactivation will be forced
*/
Features.prototype.remove = function (id, force) {
if (force === void 0) { force = false; }
return this.clone(Features_1, "remove").postCore({
body: Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["n" /* jsS */])({
featureId: id,
force: force,
}),
});
};
var Features_1;
Features = Features_1 = Object(__WEBPACK_IMPORTED_MODULE_1_tslib__["a" /* __decorate */])([
defaultPath("features")
], Features);
return Features;
}(SharePointQueryableCollection));
var Feature = /** @class */ (function (_super) {
Object(__WEBPACK_IMPORTED_MODULE_1_tslib__["b" /* __extends */])(Feature, _super);
function Feature() {
return _super !== null && _super.apply(this, arguments) || this;
}
/**
* Removes (deactivates) a feature from the collection
*
* @param force If true the feature deactivation will be forced
*/
Feature.prototype.deactivate = function (force) {
var _this = this;
if (force === void 0) { force = false; }
var removeDependency = this.addBatchDependency();
var idGet = new Feature(this).select("DefinitionId");
return idGet.get().then(function (feature) {
var promise = _this.getParent(Features, _this.parentUrl, "", _this.batch).remove(feature.DefinitionId, force);
removeDependency();
return promise;
});
};
return Feature;
}(SharePointQueryableInstance));
var RelatedItemManagerImpl = /** @class */ (function (_super) {
Object(__WEBPACK_IMPORTED_MODULE_1_tslib__["b" /* __extends */])(RelatedItemManagerImpl, _super);
function RelatedItemManagerImpl() {
return _super !== null && _super.apply(this, arguments) || this;
}
RelatedItemManagerImpl_1 = RelatedItemManagerImpl;
RelatedItemManagerImpl.FromUrl = function (url) {
if (url === null) {
return new RelatedItemManagerImpl_1("");
}
var index = url.indexOf("_api/");
if (index > -1) {
return new RelatedItemManagerImpl_1(url.substr(0, index));
}
return new RelatedItemManagerImpl_1(url);
};
RelatedItemManagerImpl.prototype.getRelatedItems = function (sourceListName, sourceItemId) {
var query = this.clone(RelatedItemManagerImpl_1, null);
query.concat(".GetRelatedItems");
return query.postCore({
body: Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["n" /* jsS */])({
SourceItemID: sourceItemId,
SourceListName: sourceListName,
}),
});
};
RelatedItemManagerImpl.prototype.getPageOneRelatedItems = function (sourceListName, sourceItemId) {
var query = this.clone(RelatedItemManagerImpl_1, null);
query.concat(".GetPageOneRelatedItems");
return query.postCore({
body: Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["n" /* jsS */])({
SourceItemID: sourceItemId,
SourceListName: sourceListName,
}),
});
};
RelatedItemManagerImpl.prototype.addSingleLink = function (sourceListName, sourceItemId, sourceWebUrl, targetListName, targetItemID, targetWebUrl, tryAddReverseLink) {
if (tryAddReverseLink === void 0) { tryAddReverseLink = false; }
var query = this.clone(RelatedItemManagerImpl_1, null);
query.concat(".AddSingleLink");
return query.postCore({
body: Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["n" /* jsS */])({
SourceItemID: sourceItemId,
SourceListName: sourceListName,
SourceWebUrl: sourceWebUrl,
TargetItemID: targetItemID,
TargetListName: targetListName,
TargetWebUrl: targetWebUrl,
TryAddReverseLink: tryAddReverseLink,
}),
});
};
/**
* Adds a related item link from an item specified by list name and item id, to an item specified by url
*
* @param sourceListName The source list name or list id
* @param sourceItemId The source item id
* @param targetItemUrl The target item url
* @param tryAddReverseLink If set to true try to add the reverse link (will not return error if it fails)
*/
RelatedItemManagerImpl.prototype.addSingleLinkToUrl = function (sourceListName, sourceItemId, targetItemUrl, tryAddReverseLink) {
if (tryAddReverseLink === void 0) { tryAddReverseLink = false; }
var query = this.clone(RelatedItemManagerImpl_1, null);
query.concat(".AddSingleLinkToUrl");
return query.postCore({
body: Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["n" /* jsS */])({
SourceItemID: sourceItemId,
SourceListName: sourceListName,
TargetItemUrl: targetItemUrl,
TryAddReverseLink: tryAddReverseLink,
}),
});
};
/**
* Adds a related item link from an item specified by url, to an item specified by list name and item id
*
* @param sourceItemUrl The source item url
* @param targetListName The target list name or list id
* @param targetItemId The target item id
* @param tryAddReverseLink If set to true try to add the reverse link (will not return error if it fails)
*/
RelatedItemManagerImpl.prototype.addSingleLinkFromUrl = function (sourceItemUrl, targetListName, targetItemId, tryAddReverseLink) {
if (tryAddReverseLink === void 0) { tryAddReverseLink = false; }
var query = this.clone(RelatedItemManagerImpl_1, null);
query.concat(".AddSingleLinkFromUrl");
return query.postCore({
body: Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["n" /* jsS */])({
SourceItemUrl: sourceItemUrl,
TargetItemID: targetItemId,
TargetListName: targetListName,
TryAddReverseLink: tryAddReverseLink,
}),
});
};
RelatedItemManagerImpl.prototype.deleteSingleLink = function (sourceListName, sourceItemId, sourceWebUrl, targetListName, targetItemId, targetWebUrl, tryDeleteReverseLink) {
if (tryDeleteReverseLink === void 0) { tryDeleteReverseLink = false; }
var query = this.clone(RelatedItemManagerImpl_1, null);
query.concat(".DeleteSingleLink");
return query.postCore({
body: Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["n" /* jsS */])({
SourceItemID: sourceItemId,
SourceListName: sourceListName,
SourceWebUrl: sourceWebUrl,
TargetItemID: targetItemId,
TargetListName: targetListName,
TargetWebUrl: targetWebUrl,
TryDeleteReverseLink: tryDeleteReverseLink,
}),
});
};
var RelatedItemManagerImpl_1;
RelatedItemManagerImpl = RelatedItemManagerImpl_1 = Object(__WEBPACK_IMPORTED_MODULE_1_tslib__["a" /* __decorate */])([
defaultPath("_api/SP.RelatedItemManager")
], RelatedItemManagerImpl);
return RelatedItemManagerImpl;
}(SharePointQueryable));
/**
* Describes a collection of webs
*
*/
var Webs = /** @class */ (function (_super) {
Object(__WEBPACK_IMPORTED_MODULE_1_tslib__["b" /* __extends */])(Webs, _super);
function Webs() {
return _super !== null && _super.apply(this, arguments) || this;
}
Webs_1 = Webs;
/**
* Adds a new web to the collection
*
* @param title The new web's title
* @param url The new web's relative url
* @param description The new web's description
* @param template The new web's template internal name (default = STS)
* @param language The locale id that specifies the new web's language (default = 1033 [English, US])
* @param inheritPermissions When true, permissions will be inherited from the new web's parent (default = true)
*/
Webs.prototype.add = function (title, url, description, template, language, inheritPermissions) {
if (description === void 0) { description = ""; }
if (template === void 0) { template = "STS"; }
if (language === void 0) { language = 1033; }
if (inheritPermissions === void 0) { inheritPermissions = true; }
var props = {
Description: description,
Language: language,
Title: title,
Url: url,
UseSamePermissionsAsParentSite: inheritPermissions,
WebTemplate: template,
};
var postBody = Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["n" /* jsS */])({
"parameters": Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["f" /* extend */])({
"__metadata": { "type": "SP.WebCreationInformation" },
}, props),
});
return this.clone(Webs_1, "add").postCore({ body: postBody }).then(function (data) {
return {
data: data,
web: new Web(odataUrlFrom(data).replace(/_api\/web\/?/i, "")),
};
});
};
var Webs_1;
Webs = Webs_1 = Object(__WEBPACK_IMPORTED_MODULE_1_tslib__["a" /* __decorate */])([
defaultPath("webs")
], Webs);
return Webs;
}(SharePointQueryableCollection));
/**
* Describes a collection of web infos
*
*/
var WebInfos = /** @class */ (function (_super) {
Object(__WEBPACK_IMPORTED_MODULE_1_tslib__["b" /* __extends */])(WebInfos, _super);
function WebInfos() {
return _super !== null && _super.apply(this, arguments) || this;
}
WebInfos = Object(__WEBPACK_IMPORTED_MODULE_1_tslib__["a" /* __decorate */])([
defaultPath("webinfos")
], WebInfos);
return WebInfos;
}(SharePointQueryableCollection));
/**
* Describes a web
*
*/
var Web = /** @class */ (function (_super) {
Object(__WEBPACK_IMPORTED_MODULE_1_tslib__["b" /* __extends */])(Web, _super);
function Web() {
return _super !== null && _super.apply(this, arguments) || this;
}
Web_1 = Web;
/**
* Creates a new web instance from the given url by indexing the location of the /_api/
* segment. If this is not found the method creates a new web with the entire string as
* supplied.
*
* @param url
*/
Web.fromUrl = function (url, path) {
return new Web_1(extractWebUrl(url), path);
};
Object.defineProperty(Web.prototype, "webs", {
/**
* Gets this web's subwebs
*
*/
get: function () {
return new Webs(this);
},
enumerable: true,
configurable: true
});
/**
* Gets this web's parent web and data
*
*/
Web.prototype.getParentWeb = function () {
var _this = this;
return this.select("ParentWeb/Id").expand("ParentWeb").get()
.then(function (_a) {
var ParentWeb = _a.ParentWeb;
return new Site(_this.toUrlAndQuery().split("/_api")[0]).openWebById(ParentWeb.Id);
});
};
/**
* Returns a collection of objects that contain metadata about subsites of the current site in which the current user is a member.
*
* @param nWebTemplateFilter Specifies the site definition (default = -1)
* @param nConfigurationFilter A 16-bit integer that specifies the identifier of a configuration (default = -1)
*/
Web.prototype.getSubwebsFilteredForCurrentUser = function (nWebTemplateFilter, nConfigurationFilter) {
if (nWebTemplateFilter === void 0) { nWebTemplateFilter = -1; }
if (nConfigurationFilter === void 0) { nConfigurationFilter = -1; }
return this.clone(Webs, "getSubwebsFilteredForCurrentUser(nWebTemplateFilter=" + nWebTemplateFilter + ",nConfigurationFilter=" + nConfigurationFilter + ")");
};
Object.defineProperty(Web.prototype, "allProperties", {
/**
* Allows access to the web's all properties collection
*/
get: function () {
return this.clone(SharePointQueryableCollection, "allproperties");
},
enumerable: true,
configurable: true
});
Object.defineProperty(Web.prototype, "webinfos", {
/**
* Gets a collection of WebInfos for this web's subwebs
*
*/
get: function () {
return new WebInfos(this);
},
enumerable: true,
configurable: true
});
Object.defineProperty(Web.prototype, "contentTypes", {
/**
* Gets the content types available in this web
*
*/
get: function () {
return new ContentTypes(this);
},
enumerable: true,
configurable: true
});
Object.defineProperty(Web.prototype, "lists", {
/**
* Gets the lists in this web
*
*/
get: function () {
return new Lists(this);
},
enumerable: true,
configurable: true
});
Object.defineProperty(Web.prototype, "fields", {
/**
* Gets the fields in this web
*
*/
get: function () {
return new Fields(this);
},
enumerable: true,
configurable: true
});
Object.defineProperty(Web.prototype, "features", {
/**
* Gets the active features for this web
*
*/
get: function () {
return new Features(this);
},
enumerable: true,
configurable: true
});
Object.defineProperty(Web.prototype, "availablefields", {
/**
* Gets the available fields in this web
*
*/
get: function () {
return new Fields(this, "availablefields");
},
enumerable: true,
configurable: true
});
Object.defineProperty(Web.prototype, "navigation", {
/**
* Gets the navigation options in this web
*
*/
get: function () {
return new Navigation(this);
},
enumerable: true,
configurable: true
});
Object.defineProperty(Web.prototype, "siteUsers", {
/**
* Gets the site users
*
*/
get: function () {
return new SiteUsers(this);
},
enumerable: true,
configurable: true
});
Object.defineProperty(Web.prototype, "siteGroups", {
/**
* Gets the site groups
*
*/
get: function () {
return new SiteGroups(this);
},
enumerable: true,
configurable: true
});
Object.defineProperty(Web.prototype, "siteUserInfoList", {
/**
* Gets site user info list
*
*/
get: function () {
return new List(this, "siteuserinfolist");
},
enumerable: true,
configurable: true
});
Object.defineProperty(Web.prototype, "regionalSettings", {
/**
* Gets regional settings
*
*/
get: function () {
return new RegionalSettings(this);
},
enumerable: true,
configurable: true
});
Object.defineProperty(Web.prototype, "currentUser", {
/**
* Gets the current user
*/
get: function () {
return new CurrentUser(this);
},
enumerable: true,
configurable: true
});
Object.defineProperty(Web.prototype, "folders", {
/**
* Gets the top-level folders in this web
*
*/
get: function () {
return new Folders(this);
},
enumerable: true,
configurable: true
});
Object.defineProperty(Web.prototype, "userCustomActions", {
/**
* Gets all user custom actions for this web
*
*/
get: function () {
return new UserCustomActions(this);
},
enumerable: true,
configurable: true
});
Object.defineProperty(Web.prototype, "roleDefinitions", {
/**
* Gets the collection of RoleDefinition resources
*
*/
get: function () {
return new RoleDefinitions(this);
},
enumerable: true,
configurable: true
});
Object.defineProperty(Web.prototype, "relatedItems", {
/**
* Provides an interface to manage related items
*
*/
get: function () {
return RelatedItemManagerImpl.FromUrl(this.toUrl());
},
enumerable: true,
configurable: true
});
/**
* Creates a new batch for requests within the context of this web
*
*/
Web.prototype.createBatch = function () {
return new SPBatch(this.parentUrl);
};
Object.defineProperty(Web.prototype, "rootFolder", {
/**
* Gets the root folder of this web
*
*/
get: function () {
return new Folder(this, "rootFolder");
},
enumerable: true,
configurable: true
});
Object.defineProperty(Web.prototype, "associatedOwnerGroup", {
/**
* Gets the associated owner group for this web
*
*/
get: function () {
return new SiteGroup(this, "associatedownergroup");
},
enumerable: true,
configurable: true
});
Object.defineProperty(Web.prototype, "associatedMemberGroup", {
/**
* Gets the associated member group for this web
*
*/
get: function () {
return new SiteGroup(this, "associatedmembergroup");
},
enumerable: true,
configurable: true
});
Object.defineProperty(Web.prototype, "associatedVisitorGroup", {
/**
* Gets the associated visitor group for this web
*
*/
get: function () {
return new SiteGroup(this, "associatedvisitorgroup");
},
enumerable: true,
configurable: true
});
/**
* Gets a folder by server relative url
*
* @param folderRelativeUrl The server relative path to the folder (including /sites/ if applicable)
*/
Web.prototype.getFolderByServerRelativeUrl = function (folderRelativeUrl) {
return new Folder(this, "getFolderByServerRelativeUrl('" + folderRelativeUrl + "')");
};
/**
* Gets a folder by server relative relative path if your folder name contains # and % characters
* you need to first encode the file name using encodeURIComponent() and then pass the url
* let url = "/sites/test/Shared Documents/" + encodeURIComponent("%123");
* This works only in SharePoint online.
*
* @param folderRelativeUrl The server relative path to the folder (including /sites/ if applicable)
*/
Web.prototype.getFolderByServerRelativePath = function (folderRelativeUrl) {
return new Folder(this, "getFolderByServerRelativePath(decodedUrl='" + folderRelativeUrl + "')");
};
/**
* Gets a file by server relative url
*
* @param fileRelativeUrl The server relative path to the file (including /sites/ if applicable)
*/
Web.prototype.getFileByServerRelativeUrl = function (fileRelativeUrl) {
return new File(this, "getFileByServerRelativeUrl('" + fileRelativeUrl + "')");
};
/**
* Gets a file by server relative url if your file name contains # and % characters
* you need to first encode the file name using encodeURIComponent() and then pass the url
* let url = "/sites/test/Shared Documents/" + encodeURIComponent("%123.docx");
*
* @param fileRelativeUrl The server relative path to the file (including /sites/ if applicable)
*/
Web.prototype.getFileByServerRelativePath = function (fileRelativeUrl) {
return new File(this, "getFileByServerRelativePath(decodedUrl='" + fileRelativeUrl + "')");
};
/**
* Gets a list by server relative url (list's root folder)
*
* @param listRelativeUrl The server relative path to the list's root folder (including /sites/ if applicable)
*/
Web.prototype.getList = function (listRelativeUrl) {
return new List(this, "getList('" + listRelativeUrl + "')");
};
/**
* Updates this web instance with the supplied properties
*
* @param properties A plain object hash of values to update for the web
*/
Web.prototype.update = function (properties) {
var _this = this;
var postBody = Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["n" /* jsS */])(Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["f" /* extend */])({
"__metadata": { "type": "SP.Web" },
}, properties));
return this.postCore({
body: postBody,
headers: {
"X-HTTP-Method": "MERGE",
},
}).then(function (data) {
return {
data: data,
web: _this,
};
});
};
/**
* Deletes this web
*
*/
Web.prototype.delete = function () {
return _super.prototype.deleteCore.call(this);
};
/**
* Applies the theme specified by the contents of each of the files specified in the arguments to the site
*
* @param colorPaletteUrl The server-relative URL of the color palette file
* @param fontSchemeUrl The server-relative URL of the font scheme
* @param backgroundImageUrl The server-relative URL of the background image
* @param shareGenerated When true, the generated theme files are stored in the root site. When false, they are stored in this web
*/
Web.prototype.applyTheme = function (colorPaletteUrl, fontSchemeUrl, backgroundImageUrl, shareGenerated) {
var postBody = Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["n" /* jsS */])({
backgroundImageUrl: backgroundImageUrl,
colorPaletteUrl: colorPaletteUrl,
fontSchemeUrl: fontSchemeUrl,
shareGenerated: shareGenerated,
});
return this.clone(Web_1, "applytheme").postCore({ body: postBody });
};
/**
* Applies the specified site definition or site template to the Web site that has no template applied to it
*
* @param template Name of the site definition or the name of the site template
*/
Web.prototype.applyWebTemplate = function (template) {
var q = this.clone(Web_1, "applywebtemplate");
q.concat("(@t)");
q.query.set("@t", template);
return q.postCore();
};
/**
* 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.
*
* @param loginName The login name of the user (ex: i:0#.f|membership|user@domain.onmicrosoft.com)
*/
Web.prototype.ensureUser = function (loginName) {
var postBody = Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["n" /* jsS */])({
logonName: loginName,
});
return this.clone(Web_1, "ensureuser").postCore({ body: postBody }).then(function (data) {
return {
data: data,
user: new SiteUser(odataUrlFrom(data)),
};
});
};
/**
* Returns a collection of site templates available for the site
*
* @param language The locale id of the site templates to retrieve (default = 1033 [English, US])
* @param includeCrossLanguage When true, includes language-neutral site templates; otherwise false (default = true)
*/
Web.prototype.availableWebTemplates = function (language, includeCrossLanugage) {
if (language === void 0) { language = 1033; }
if (includeCrossLanugage === void 0) { includeCrossLanugage = true; }
return new SharePointQueryableCollection(this, "getavailablewebtemplates(lcid=" + language + ", doincludecrosslanguage=" + includeCrossLanugage + ")");
};
/**
* Returns the list gallery on the site
*
* @param type The gallery type - WebTemplateCatalog = 111, WebPartCatalog = 113 ListTemplateCatalog = 114,
* MasterPageCatalog = 116, SolutionCatalog = 121, ThemeCatalog = 123, DesignCatalog = 124, AppDataCatalog = 125
*/
Web.prototype.getCatalog = function (type) {
return this.clone(Web_1, "getcatalog(" + type + ")").select("Id").get().then(function (data) {
return new List(odataUrlFrom(data));
});
};
/**
* Returns the collection of changes from the change log that have occurred within the list, based on the specified query
*
* @param query The change query
*/
Web.prototype.getChanges = function (query) {
var postBody = Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["n" /* jsS */])({ "query": Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["f" /* extend */])({ "__metadata": { "type": "SP.ChangeQuery" } }, query) });
return this.clone(Web_1, "getchanges").postCore({ body: postBody });
};
Object.defineProperty(Web.prototype, "customListTemplate", {
/**
* Gets the custom list templates for the site
*
*/
get: function () {
return new SharePointQueryableCollection(this, "getcustomlisttemplates");
},
enumerable: true,
configurable: true
});
/**
* Returns the user corresponding to the specified member identifier for the current site
*
* @param id The id of the user
*/
Web.prototype.getUserById = function (id) {
return new SiteUser(this, "getUserById(" + id + ")");
};
/**
* Returns the name of the image file for the icon that is used to represent the specified file
*
* @param filename The file name. If this parameter is empty, the server returns an empty string
* @param size The size of the icon: 16x16 pixels = 0, 32x32 pixels = 1 (default = 0)
* @param progId The ProgID of the application that was used to create the file, in the form OLEServerName.ObjectName
*/
Web.prototype.mapToIcon = function (filename, size, progId) {
if (size === void 0) { size = 0; }
if (progId === void 0) { progId = ""; }
return this.clone(Web_1, "maptoicon(filename='" + filename + "', progid='" + progId + "', size=" + size + ")").get();
};
/**
* Returns the tenant property corresponding to the specified key in the app catalog site
*
* @param key Id of storage entity to be set
*/
Web.prototype.getStorageEntity = function (key) {
return this.clone(Web_1, "getStorageEntity('" + key + "')").get();
};
/**
* This will set the storage entity identified by the given key (MUST be called in the context of the app catalog)
*
* @param key Id of storage entity to be set
* @param value Value of storage entity to be set
* @param description Description of storage entity to be set
* @param comments Comments of storage entity to be set
*/
Web.prototype.setStorageEntity = function (key, value, description, comments) {
if (description === void 0) { description = ""; }
if (comments === void 0) { comments = ""; }
return this.clone(Web_1, "setStorageEntity").postCore({
body: Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["n" /* jsS */])({
comments: comments,
description: description,
key: key,
value: value,
}),
});
};
/**
* This will remove the storage entity identified by the given key
*
* @param key Id of storage entity to be removed
*/
Web.prototype.removeStorageEntity = function (key) {
return this.clone(Web_1, "removeStorageEntity('" + key + "')").postCore();
};
/**
* Gets the app catalog for this web
*
* @param url Optional url or web containing the app catalog (default: current web)
*/
Web.prototype.getAppCatalog = function (url) {
return new AppCatalog(url || this);
};
/**
* Gets the collection of available client side web parts for this web instance
*/
Web.prototype.getClientSideWebParts = function () {
return this.clone(SharePointQueryableCollection, "GetClientSideWebParts").get();
};
/**
* Creates a new client side page
*
* @param pageName Name of the new page
* @param title Display title of the new page
* @param libraryTitle Title of the library in which to create the new page. Default: "Site Pages"
*/
Web.prototype.addClientSidePage = function (pageName, title, libraryTitle) {
if (title === void 0) { title = pageName.replace(/\.[^/.]+$/, ""); }
if (libraryTitle === void 0) { libraryTitle = "Site Pages"; }
return ClientSidePage.create(this.lists.getByTitle(libraryTitle), pageName, title);
};
/**
* Creates a new client side page using the library path
*
* @param pageName Name of the new page
* @param listRelativePath The server relative path to the list's root folder (including /sites/ if applicable)
* @param title Display title of the new page
*/
Web.prototype.addClientSidePageByPath = function (pageName, listRelativePath, title) {
if (title === void 0) { title = pageName.replace(/\.[^/.]+$/, ""); }
return ClientSidePage.create(this.getList(listRelativePath), pageName, title);
};
var Web_1;
Web = Web_1 = Object(__WEBPACK_IMPORTED_MODULE_1_tslib__["a" /* __decorate */])([
defaultPath("_api/web")
], Web);
return Web;
}(SharePointQueryableShareableWeb));
/**
* Describes a site collection
*
*/
var Site = /** @class */ (function (_super) {
Object(__WEBPACK_IMPORTED_MODULE_1_tslib__["b" /* __extends */])(Site, _super);
function Site() {
return _super !== null && _super.apply(this, arguments) || this;
}
Site_1 = Site;
Object.defineProperty(Site.prototype, "rootWeb", {
/**
* Gets the root web of the site collection
*
*/
get: function () {
return new Web(this, "rootweb");
},
enumerable: true,
configurable: true
});
Object.defineProperty(Site.prototype, "features", {
/**
* Gets the active features for this site collection
*
*/
get: function () {
return new Features(this);
},
enumerable: true,
configurable: true
});
Object.defineProperty(Site.prototype, "userCustomActions", {
/**
* Gets all custom actions for this site collection
*
*/
get: function () {
return new UserCustomActions(this);
},
enumerable: true,
configurable: true
});
/**
* Gets a Web instance representing the root web of the site collection
* correctly setup for chaining within the library
*/
Site.prototype.getRootWeb = function () {
return this.rootWeb.select("Url").get().then(function (web) { return new Web(web.Url); });
};
/**
* Gets the context information for this site collection
*/
Site.prototype.getContextInfo = function () {
var q = new Site_1(this.parentUrl, "_api/contextinfo");
return q.postCore().then(function (data) {
if (Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["k" /* hOP */])(data, "GetContextWebInformation")) {
var info = data.GetContextWebInformation;
info.SupportedSchemaVersions = info.SupportedSchemaVersions.results;
return info;
}
else {
return data;
}
});
};
/**
* Gets the document libraries on a site. Static method. (SharePoint Online only)
*
* @param absoluteWebUrl The absolute url of the web whose document libraries should be returned
*/
Site.prototype.getDocumentLibraries = function (absoluteWebUrl) {
var q = new SharePointQueryable("", "_api/sp.web.getdocumentlibraries(@v)");
q.query.set("@v", "'" + absoluteWebUrl + "'");
return q.get().then(function (data) {
if (Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["k" /* hOP */])(data, "GetDocumentLibraries")) {
return data.GetDocumentLibraries;
}
else {
return data;
}
});
};
/**
* Gets the site url from a page url
*
* @param absolutePageUrl The absolute url of the page
*/
Site.prototype.getWebUrlFromPageUrl = function (absolutePageUrl) {
var q = new SharePointQueryable("", "_api/sp.web.getweburlfrompageurl(@v)");
q.query.set("@v", "'" + absolutePageUrl + "'");
return q.get().then(function (data) {
if (Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["k" /* hOP */])(data, "GetWebUrlFromPageUrl")) {
return data.GetWebUrlFromPageUrl;
}
else {
return data;
}
});
};
/**
* Creates a new batch for requests within the context of this site collection
*
*/
Site.prototype.createBatch = function () {
return new SPBatch(this.parentUrl);
};
/**
* Opens a web by id (using POST)
*
* @param webId The GUID id of the web to open
*/
Site.prototype.openWebById = function (webId) {
return this.clone(Site_1, "openWebById('" + webId + "')").postCore().then(function (d) { return ({
data: d,
web: Web.fromUrl(d["odata.id"] || d.__metadata.uri),
}); });
};
var Site_1;
Site = Site_1 = Object(__WEBPACK_IMPORTED_MODULE_1_tslib__["a" /* __decorate */])([
defaultPath("_api/site")
], Site);
return Site;
}(SharePointQueryableInstance));
var UserProfileQuery = /** @class */ (function (_super) {
Object(__WEBPACK_IMPORTED_MODULE_1_tslib__["b" /* __extends */])(UserProfileQuery, _super);
/**
* Creates a new instance of the UserProfileQuery class
*
* @param baseUrl The url or SharePointQueryable which forms the parent of this user profile query
*/
function UserProfileQuery(baseUrl, path) {
if (path === void 0) { path = "_api/sp.userprofiles.peoplemanager"; }
var _this = _super.call(this, baseUrl, path) || this;
_this.clientPeoplePickerQuery = (new ClientPeoplePickerQuery(baseUrl)).configureFrom(_this);
_this.profileLoader = (new ProfileLoader(baseUrl)).configureFrom(_this);
return _this;
}
Object.defineProperty(UserProfileQuery.prototype, "editProfileLink", {
/**
* The url of the edit profile page for the current user
*/
get: function () {
return this.clone(UserProfileQuery, "EditProfileLink").get();
},
enumerable: true,
configurable: true
});
Object.defineProperty(UserProfileQuery.prototype, "isMyPeopleListPublic", {
/**
* A boolean value that indicates whether the current user's "People I'm Following" list is public
*/
get: function () {
return this.clone(UserProfileQuery, "IsMyPeopleListPublic").get();
},
enumerable: true,
configurable: true
});
/**
* A boolean value that indicates whether the current user is being followed by the specified user
*
* @param loginName The account name of the user
*/
UserProfileQuery.prototype.amIFollowedBy = function (loginName) {
var q = this.clone(UserProfileQuery, "amifollowedby(@v)");
q.query.set("@v", "'" + encodeURIComponent(loginName) + "'");
return q.get();
};
/**
* A boolean value that indicates whether the current user is following the specified user
*
* @param loginName The account name of the user
*/
UserProfileQuery.prototype.amIFollowing = function (loginName) {
var q = this.clone(UserProfileQuery, "amifollowing(@v)");
q.query.set("@v", "'" + encodeURIComponent(loginName) + "'");
return q.get();
};
/**
* Gets tags that the current user is following
*
* @param maxCount The maximum number of tags to retrieve (default is 20)
*/
UserProfileQuery.prototype.getFollowedTags = function (maxCount) {
if (maxCount === void 0) { maxCount = 20; }
return this.clone(UserProfileQuery, "getfollowedtags(" + maxCount + ")").get();
};
/**
* Gets the people who are following the specified user
*
* @param loginName The account name of the user
*/
UserProfileQuery.prototype.getFollowersFor = function (loginName) {
var q = this.clone(UserProfileQuery, "getfollowersfor(@v)");
q.query.set("@v", "'" + encodeURIComponent(loginName) + "'");
return q.get();
};
Object.defineProperty(UserProfileQuery.prototype, "myFollowers", {
/**
* Gets the people who are following the current user
*
*/
get: function () {
return new SharePointQueryableCollection(this, "getmyfollowers");
},
enumerable: true,
configurable: true
});
Object.defineProperty(UserProfileQuery.prototype, "myProperties", {
/**
* Gets user properties for the current user
*
*/
get: function () {
return new UserProfileQuery(this, "getmyproperties");
},
enumerable: true,
configurable: true
});
/**
* Gets the people who the specified user is following
*
* @param loginName The account name of the user.
*/
UserProfileQuery.prototype.getPeopleFollowedBy = function (loginName) {
var q = this.clone(UserProfileQuery, "getpeoplefollowedby(@v)");
q.query.set("@v", "'" + encodeURIComponent(loginName) + "'");
return q.get();
};
/**
* Gets user properties for the specified user.
*
* @param loginName The account name of the user.
*/
UserProfileQuery.prototype.getPropertiesFor = function (loginName) {
var q = this.clone(UserProfileQuery, "getpropertiesfor(@v)");
q.query.set("@v", "'" + encodeURIComponent(loginName) + "'");
return q.get();
};
Object.defineProperty(UserProfileQuery.prototype, "trendingTags", {
/**
* Gets the 20 most popular hash tags over the past week, sorted so that the most popular tag appears first
*
*/
get: function () {
var q = this.clone(UserProfileQuery, null);
q.concat(".gettrendingtags");
return q.get();
},
enumerable: true,
configurable: true
});
/**
* Gets the specified user profile property for the specified user
*
* @param loginName The account name of the user
* @param propertyName The case-sensitive name of the property to get
*/
UserProfileQuery.prototype.getUserProfilePropertyFor = function (loginName, propertyName) {
var q = this.clone(UserProfileQuery, "getuserprofilepropertyfor(accountname=@v, propertyname='" + propertyName + "')");
q.query.set("@v", "'" + encodeURIComponent(loginName) + "'");
return q.get();
};
/**
* Removes the specified user from the user's list of suggested people to follow
*
* @param loginName The account name of the user
*/
UserProfileQuery.prototype.hideSuggestion = function (loginName) {
var q = this.clone(UserProfileQuery, "hidesuggestion(@v)");
q.query.set("@v", "'" + encodeURIComponent(loginName) + "'");
return q.postCore();
};
/**
* A boolean values that indicates whether the first user is following the second user
*
* @param follower The account name of the user who might be following the followee
* @param followee The account name of the user who might be followed by the follower
*/
UserProfileQuery.prototype.isFollowing = function (follower, followee) {
var q = this.clone(UserProfileQuery, null);
q.concat(".isfollowing(possiblefolloweraccountname=@v, possiblefolloweeaccountname=@y)");
q.query.set("@v", "'" + encodeURIComponent(follower) + "'");
q.query.set("@y", "'" + encodeURIComponent(followee) + "'");
return q.get();
};
/**
* Uploads and sets the user profile picture (Users can upload a picture to their own profile only). Not supported for batching.
*
* @param profilePicSource Blob data representing the user's picture in BMP, JPEG, or PNG format of up to 4.76MB
*/
UserProfileQuery.prototype.setMyProfilePic = function (profilePicSource) {
var _this = this;
return new Promise(function (resolve, reject) {
var buffer = null;
var reader = new FileReader();
reader.onload = function (e) { return buffer = e.target.result; };
reader.readAsArrayBuffer(profilePicSource);
var request = new UserProfileQuery(_this, "setmyprofilepicture");
request.postCore({
body: String.fromCharCode.apply(null, new Uint16Array(buffer)),
}).then(function (_) { return resolve(); }).catch(function (e) { return reject(e); });
});
};
/**
* Sets single value User Profile property
*
* @param accountName The account name of the user
* @param propertyName Property name
* @param propertyValue Property value
*/
UserProfileQuery.prototype.setSingleValueProfileProperty = function (accountName, propertyName, propertyValue) {
var postBody = Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["n" /* jsS */])({
accountName: accountName,
propertyName: propertyName,
propertyValue: propertyValue,
});
return this.clone(UserProfileQuery, "SetSingleValueProfileProperty")
.postCore({ body: postBody });
};
/**
* Sets multi valued User Profile property
*
* @param accountName The account name of the user
* @param propertyName Property name
* @param propertyValues Property values
*/
UserProfileQuery.prototype.setMultiValuedProfileProperty = function (accountName, propertyName, propertyValues) {
var postBody = Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["n" /* jsS */])({
accountName: accountName,
propertyName: propertyName,
propertyValues: propertyValues,
});
return this.clone(UserProfileQuery, "SetMultiValuedProfileProperty")
.postCore({ body: postBody });
};
/**
* Provisions one or more users' personal sites. (My Site administrator on SharePoint Online only)
*
* @param emails The email addresses of the users to provision sites for
*/
UserProfileQuery.prototype.createPersonalSiteEnqueueBulk = function () {
var emails = [];
for (var _i = 0; _i < arguments.length; _i++) {
emails[_i] = arguments[_i];
}
return this.profileLoader.createPersonalSiteEnqueueBulk(emails);
};
Object.defineProperty(UserProfileQuery.prototype, "ownerUserProfile", {
/**
* Gets the user profile of the site owner
*
*/
get: function () {
return this.profileLoader.ownerUserProfile;
},
enumerable: true,
configurable: true
});
Object.defineProperty(UserProfileQuery.prototype, "userProfile", {
/**
* Gets the user profile for the current user
*/
get: function () {
return this.profileLoader.userProfile;
},
enumerable: true,
configurable: true
});
/**
* Enqueues creating a personal site for this user, which can be used to share documents, web pages, and other files
*
* @param interactiveRequest true if interactively (web) initiated request, or false (default) if non-interactively (client) initiated request
*/
UserProfileQuery.prototype.createPersonalSite = function (interactiveRequest) {
if (interactiveRequest === void 0) { interactiveRequest = false; }
return this.profileLoader.createPersonalSite(interactiveRequest);
};
/**
* Sets the privacy settings for this profile
*
* @param share true to make all social data public; false to make all social data private
*/
UserProfileQuery.prototype.shareAllSocialData = function (share) {
return this.profileLoader.shareAllSocialData(share);
};
/**
* Resolves user or group using specified query parameters
*
* @param queryParams The query parameters used to perform resolve
*/
UserProfileQuery.prototype.clientPeoplePickerResolveUser = function (queryParams) {
return this.clientPeoplePickerQuery.clientPeoplePickerResolveUser(queryParams);
};
/**
* Searches for users or groups using specified query parameters
*
* @param queryParams The query parameters used to perform search
*/
UserProfileQuery.prototype.clientPeoplePickerSearchUser = function (queryParams) {
return this.clientPeoplePickerQuery.clientPeoplePickerSearchUser(queryParams);
};
return UserProfileQuery;
}(SharePointQueryableInstance));
var ProfileLoader = /** @class */ (function (_super) {
Object(__WEBPACK_IMPORTED_MODULE_1_tslib__["b" /* __extends */])(ProfileLoader, _super);
function ProfileLoader() {
return _super !== null && _super.apply(this, arguments) || this;
}
ProfileLoader_1 = ProfileLoader;
/**
* Provisions one or more users' personal sites. (My Site administrator on SharePoint Online only) Doesn't support batching
*
* @param emails The email addresses of the users to provision sites for
*/
ProfileLoader.prototype.createPersonalSiteEnqueueBulk = function (emails) {
return this.clone(ProfileLoader_1, "createpersonalsiteenqueuebulk", false).postCore({
body: Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["n" /* jsS */])({ "emailIDs": emails }),
});
};
Object.defineProperty(ProfileLoader.prototype, "ownerUserProfile", {
/**
* Gets the user profile of the site owner.
*
*/
get: function () {
var q = this.getParent(ProfileLoader_1, this.parentUrl, "_api/sp.userprofiles.profileloader.getowneruserprofile");
if (this.hasBatch) {
q = q.inBatch(this.batch);
}
return q.postCore();
},
enumerable: true,
configurable: true
});
Object.defineProperty(ProfileLoader.prototype, "userProfile", {
/**
* Gets the user profile of the current user.
*
*/
get: function () {
return this.clone(ProfileLoader_1, "getuserprofile").postCore();
},
enumerable: true,
configurable: true
});
/**
* Enqueues creating a personal site for this user, which can be used to share documents, web pages, and other files.
*
* @param interactiveRequest true if interactively (web) initiated request, or false (default) if non-interactively (client) initiated request
*/
ProfileLoader.prototype.createPersonalSite = function (interactiveRequest) {
if (interactiveRequest === void 0) { interactiveRequest = false; }
return this.clone(ProfileLoader_1, "getuserprofile/createpersonalsiteenque(" + interactiveRequest + ")").postCore();
};
/**
* Sets the privacy settings for this profile
*
* @param share true to make all social data public; false to make all social data private.
*/
ProfileLoader.prototype.shareAllSocialData = function (share) {
return this.clone(ProfileLoader_1, "getuserprofile/shareallsocialdata(" + share + ")").postCore();
};
var ProfileLoader_1;
ProfileLoader = ProfileLoader_1 = Object(__WEBPACK_IMPORTED_MODULE_1_tslib__["a" /* __decorate */])([
defaultPath("_api/sp.userprofiles.profileloader.getprofileloader")
], ProfileLoader);
return ProfileLoader;
}(SharePointQueryable));
var ClientPeoplePickerQuery = /** @class */ (function (_super) {
Object(__WEBPACK_IMPORTED_MODULE_1_tslib__["b" /* __extends */])(ClientPeoplePickerQuery, _super);
function ClientPeoplePickerQuery() {
return _super !== null && _super.apply(this, arguments) || this;
}
ClientPeoplePickerQuery_1 = ClientPeoplePickerQuery;
/**
* Resolves user or group using specified query parameters
*
* @param queryParams The query parameters used to perform resolve
*/
ClientPeoplePickerQuery.prototype.clientPeoplePickerResolveUser = function (queryParams) {
var q = this.clone(ClientPeoplePickerQuery_1, null);
q.concat(".clientpeoplepickerresolveuser");
return q.postCore({
body: this.createClientPeoplePickerQueryParametersRequestBody(queryParams),
})
.then(function (res) {
if (typeof res === "object") {
return res.ClientPeoplePickerResolveUser;
}
return res;
})
.then(JSON.parse);
};
/**
* Searches for users or groups using specified query parameters
*
* @param queryParams The query parameters used to perform search
*/
ClientPeoplePickerQuery.prototype.clientPeoplePickerSearchUser = function (queryParams) {
var q = this.clone(ClientPeoplePickerQuery_1, null);
q.concat(".clientpeoplepickersearchuser");
return q.postCore({
body: this.createClientPeoplePickerQueryParametersRequestBody(queryParams),
})
.then(function (res) {
if (typeof res === "object") {
return res.ClientPeoplePickerSearchUser;
}
return res;
})
.then(JSON.parse);
};
/**
* Creates ClientPeoplePickerQueryParameters request body
*
* @param queryParams The query parameters to create request body
*/
ClientPeoplePickerQuery.prototype.createClientPeoplePickerQueryParametersRequestBody = function (queryParams) {
return Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["n" /* jsS */])({
"queryParams": Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["f" /* extend */])(metadata("SP.UI.ApplicationPages.ClientPeoplePickerQueryParameters"), queryParams),
});
};
var ClientPeoplePickerQuery_1;
ClientPeoplePickerQuery = ClientPeoplePickerQuery_1 = Object(__WEBPACK_IMPORTED_MODULE_1_tslib__["a" /* __decorate */])([
defaultPath("_api/sp.ui.applicationpages.clientpeoplepickerwebserviceinterface")
], ClientPeoplePickerQuery);
return ClientPeoplePickerQuery;
}(SharePointQueryable));
/**
* Exposes social following methods
*/
var SocialQuery = /** @class */ (function (_super) {
Object(__WEBPACK_IMPORTED_MODULE_1_tslib__["b" /* __extends */])(SocialQuery, _super);
function SocialQuery() {
return _super !== null && _super.apply(this, arguments) || this;
}
SocialQuery_1 = SocialQuery;
Object.defineProperty(SocialQuery.prototype, "my", {
get: function () {
return new MySocialQuery(this);
},
enumerable: true,
configurable: true
});
/**
* Gets a URI to a site that lists the current user's followed sites.
*/
SocialQuery.prototype.getFollowedSitesUri = function () {
return this.clone(SocialQuery_1, "FollowedSitesUri").get().then(function (r) {
return r.FollowedSitesUri || r;
});
};
/**
* Gets a URI to a site that lists the current user's followed documents.
*/
SocialQuery.prototype.getFollowedDocumentsUri = function () {
return this.clone(SocialQuery_1, "FollowedDocumentsUri").get().then(function (r) {
return r.FollowedDocumentsUri || r;
});
};
/**
* Makes the current user start following a user, document, site, or tag
*
* @param actorInfo The actor to start following
*/
SocialQuery.prototype.follow = function (actorInfo) {
return this.clone(SocialQuery_1, "follow").postCore({ body: this.createSocialActorInfoRequestBody(actorInfo) });
};
/**
* Indicates whether the current user is following a specified user, document, site, or tag
*
* @param actorInfo The actor to find the following status for
*/
SocialQuery.prototype.isFollowed = function (actorInfo) {
return this.clone(SocialQuery_1, "isfollowed").postCore({ body: this.createSocialActorInfoRequestBody(actorInfo) });
};
/**
* Makes the current user stop following a user, document, site, or tag
*
* @param actorInfo The actor to stop following
*/
SocialQuery.prototype.stopFollowing = function (actorInfo) {
return this.clone(SocialQuery_1, "stopfollowing").postCore({ body: this.createSocialActorInfoRequestBody(actorInfo) });
};
/**
* Creates SocialActorInfo request body
*
* @param actorInfo The actor to create request body
*/
SocialQuery.prototype.createSocialActorInfoRequestBody = function (actorInfo) {
return Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["n" /* jsS */])({
"actor": Object.assign(metadata("SP.Social.SocialActorInfo"), {
Id: null,
}, actorInfo),
});
};
var SocialQuery_1;
SocialQuery = SocialQuery_1 = Object(__WEBPACK_IMPORTED_MODULE_1_tslib__["a" /* __decorate */])([
defaultPath("_api/social.following")
], SocialQuery);
return SocialQuery;
}(SharePointQueryableInstance));
var MySocialQuery = /** @class */ (function (_super) {
Object(__WEBPACK_IMPORTED_MODULE_1_tslib__["b" /* __extends */])(MySocialQuery, _super);
function MySocialQuery() {
return _super !== null && _super.apply(this, arguments) || this;
}
MySocialQuery_1 = MySocialQuery;
/**
* Gets users, documents, sites, and tags that the current user is following.
*
* @param types Bitwise set of SocialActorTypes to retrieve
*/
MySocialQuery.prototype.followed = function (types) {
return this.clone(MySocialQuery_1, "followed(types=" + types + ")").get().then(function (r) {
return Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["k" /* hOP */])(r, "Followed") ? r.Followed.results : r;
});
};
/**
* Gets the count of users, documents, sites, and tags that the current user is following.
*
* @param types Bitwise set of SocialActorTypes to retrieve
*/
MySocialQuery.prototype.followedCount = function (types) {
return this.clone(MySocialQuery_1, "followedcount(types=" + types + ")").get().then(function (r) {
return r.FollowedCount || r;
});
};
/**
* Gets the users who are following the current user.
*/
MySocialQuery.prototype.followers = function () {
return this.clone(MySocialQuery_1, "followers").get().then(function (r) {
return Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["k" /* hOP */])(r, "Followers") ? r.Followers.results : r;
});
};
/**
* Gets users who the current user might want to follow.
*/
MySocialQuery.prototype.suggestions = function () {
return this.clone(MySocialQuery_1, "suggestions").get().then(function (r) {
return Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["k" /* hOP */])(r, "Suggestions") ? r.Suggestions.results : r;
});
};
var MySocialQuery_1;
MySocialQuery = MySocialQuery_1 = Object(__WEBPACK_IMPORTED_MODULE_1_tslib__["a" /* __decorate */])([
defaultPath("my")
], MySocialQuery);
return MySocialQuery;
}(SharePointQueryableInstance));
/**
* Social actor type
*
*/
var SocialActorType;
(function (SocialActorType) {
SocialActorType[SocialActorType["User"] = 0] = "User";
SocialActorType[SocialActorType["Document"] = 1] = "Document";
SocialActorType[SocialActorType["Site"] = 2] = "Site";
SocialActorType[SocialActorType["Tag"] = 3] = "Tag";
})(SocialActorType || (SocialActorType = {}));
/**
* Social actor type
*
*/
/* tslint:disable:no-bitwise */
var SocialActorTypes;
(function (SocialActorTypes) {
SocialActorTypes[SocialActorTypes["None"] = 0] = "None";
SocialActorTypes[SocialActorTypes["User"] = 1] = "User";
SocialActorTypes[SocialActorTypes["Document"] = 2] = "Document";
SocialActorTypes[SocialActorTypes["Site"] = 4] = "Site";
SocialActorTypes[SocialActorTypes["Tag"] = 8] = "Tag";
/**
* The set excludes documents and sites that do not have feeds.
*/
SocialActorTypes[SocialActorTypes["ExcludeContentWithoutFeeds"] = 268435456] = "ExcludeContentWithoutFeeds";
/**
* The set includes group sites
*/
SocialActorTypes[SocialActorTypes["IncludeGroupsSites"] = 536870912] = "IncludeGroupsSites";
/**
* The set includes only items created within the last 24 hours
*/
SocialActorTypes[SocialActorTypes["WithinLast24Hours"] = 1073741824] = "WithinLast24Hours";
})(SocialActorTypes || (SocialActorTypes = {}));
/* tslint:enable */
/**
* Result from following
*
*/
var SocialFollowResult;
(function (SocialFollowResult) {
SocialFollowResult[SocialFollowResult["Ok"] = 0] = "Ok";
SocialFollowResult[SocialFollowResult["AlreadyFollowing"] = 1] = "AlreadyFollowing";
SocialFollowResult[SocialFollowResult["LimitReached"] = 2] = "LimitReached";
SocialFollowResult[SocialFollowResult["InternalError"] = 3] = "InternalError";
})(SocialFollowResult || (SocialFollowResult = {}));
/**
* Specifies an exception or status code.
*/
var SocialStatusCode;
(function (SocialStatusCode) {
/**
* The operation completed successfully
*/
SocialStatusCode[SocialStatusCode["OK"] = 0] = "OK";
/**
* The request is invalid.
*/
SocialStatusCode[SocialStatusCode["InvalidRequest"] = 1] = "InvalidRequest";
/**
* The current user is not authorized to perform the operation.
*/
SocialStatusCode[SocialStatusCode["AccessDenied"] = 2] = "AccessDenied";
/**
* The target of the operation was not found.
*/
SocialStatusCode[SocialStatusCode["ItemNotFound"] = 3] = "ItemNotFound";
/**
* The operation is invalid for the target's current state.
*/
SocialStatusCode[SocialStatusCode["InvalidOperation"] = 4] = "InvalidOperation";
/**
* The operation completed without modifying the target.
*/
SocialStatusCode[SocialStatusCode["ItemNotModified"] = 5] = "ItemNotModified";
/**
* The operation failed because an internal error occurred.
*/
SocialStatusCode[SocialStatusCode["InternalError"] = 6] = "InternalError";
/**
* The operation failed because the server could not access the distributed cache.
*/
SocialStatusCode[SocialStatusCode["CacheReadError"] = 7] = "CacheReadError";
/**
* The operation succeeded but the server could not update the distributed cache.
*/
SocialStatusCode[SocialStatusCode["CacheUpdateError"] = 8] = "CacheUpdateError";
/**
* No personal site exists for the current user, and no further information is available.
*/
SocialStatusCode[SocialStatusCode["PersonalSiteNotFound"] = 9] = "PersonalSiteNotFound";
/**
* No personal site exists for the current user, and a previous attempt to create one failed.
*/
SocialStatusCode[SocialStatusCode["FailedToCreatePersonalSite"] = 10] = "FailedToCreatePersonalSite";
/**
* No personal site exists for the current user, and a previous attempt to create one was not authorized.
*/
SocialStatusCode[SocialStatusCode["NotAuthorizedToCreatePersonalSite"] = 11] = "NotAuthorizedToCreatePersonalSite";
/**
* No personal site exists for the current user, and no attempt should be made to create one.
*/
SocialStatusCode[SocialStatusCode["CannotCreatePersonalSite"] = 12] = "CannotCreatePersonalSite";
/**
* The operation was rejected because an internal limit had been reached.
*/
SocialStatusCode[SocialStatusCode["LimitReached"] = 13] = "LimitReached";
/**
* The operation failed because an error occurred during the processing of the specified attachment.
*/
SocialStatusCode[SocialStatusCode["AttachmentError"] = 14] = "AttachmentError";
/**
* The operation succeeded with recoverable errors; the returned data is incomplete.
*/
SocialStatusCode[SocialStatusCode["PartialData"] = 15] = "PartialData";
/**
* A required SharePoint feature is not enabled.
*/
SocialStatusCode[SocialStatusCode["FeatureDisabled"] = 16] = "FeatureDisabled";
/**
* The site's storage quota has been exceeded.
*/
SocialStatusCode[SocialStatusCode["StorageQuotaExceeded"] = 17] = "StorageQuotaExceeded";
/**
* The operation failed because the server could not access the database.
*/
SocialStatusCode[SocialStatusCode["DatabaseError"] = 18] = "DatabaseError";
})(SocialStatusCode || (SocialStatusCode = {}));
/**
* Allows for calling of the static SP.Utilities.Utility methods by supplying the method name
*/
var UtilityMethod = /** @class */ (function (_super) {
Object(__WEBPACK_IMPORTED_MODULE_1_tslib__["b" /* __extends */])(UtilityMethod, _super);
/**
* Creates a new instance of the Utility method class
*
* @param baseUrl The parent url provider
* @param methodName The static method name to call on the utility class
*/
function UtilityMethod(baseUrl, methodName) {
return _super.call(this, UtilityMethod.getBaseUrl(baseUrl), "_api/SP.Utilities.Utility." + methodName) || this;
}
UtilityMethod.getBaseUrl = function (candidate) {
if (typeof candidate === "string") {
return candidate;
}
var c = candidate;
var url = c.toUrl();
var index = url.indexOf("_api/");
if (index < 0) {
return url;
}
return url.substr(0, index);
};
UtilityMethod.prototype.excute = function (props) {
return this.postCore({
body: Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["n" /* jsS */])(props),
});
};
/**
* Sends an email based on the supplied properties
*
* @param props The properties of the email to send
*/
UtilityMethod.prototype.sendEmail = function (props) {
var params = {
properties: Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["f" /* extend */])(metadata("SP.Utilities.EmailProperties"), {
Body: props.Body,
From: props.From,
Subject: props.Subject,
}),
};
if (props.To && props.To.length > 0) {
params.properties = Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["f" /* extend */])(params.properties, {
To: { results: props.To },
});
}
if (props.CC && props.CC.length > 0) {
params.properties = Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["f" /* extend */])(params.properties, {
CC: { results: props.CC },
});
}
if (props.BCC && props.BCC.length > 0) {
params.properties = Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["f" /* extend */])(params.properties, {
BCC: { results: props.BCC },
});
}
if (props.AdditionalHeaders) {
params.properties = Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["f" /* extend */])(params.properties, {
AdditionalHeaders: props.AdditionalHeaders,
});
}
return this.clone(UtilityMethod, "SendEmail", true).excute(params);
};
UtilityMethod.prototype.getCurrentUserEmailAddresses = function () {
return this.clone(UtilityMethod, "GetCurrentUserEmailAddresses", true).excute({});
};
UtilityMethod.prototype.resolvePrincipal = function (input, scopes, sources, inputIsEmailOnly, addToUserInfoList, matchUserInfoList) {
if (matchUserInfoList === void 0) { matchUserInfoList = false; }
var params = {
addToUserInfoList: addToUserInfoList,
input: input,
inputIsEmailOnly: inputIsEmailOnly,
matchUserInfoList: matchUserInfoList,
scopes: scopes,
sources: sources,
};
return this.clone(UtilityMethod, "ResolvePrincipalInCurrentContext", true).excute(params);
};
UtilityMethod.prototype.searchPrincipals = function (input, scopes, sources, groupName, maxCount) {
var params = {
groupName: groupName,
input: input,
maxCount: maxCount,
scopes: scopes,
sources: sources,
};
return this.clone(UtilityMethod, "SearchPrincipalsUsingContextWeb", true).excute(params);
};
UtilityMethod.prototype.createEmailBodyForInvitation = function (pageAddress) {
var params = {
pageAddress: pageAddress,
};
return this.clone(UtilityMethod, "CreateEmailBodyForInvitation", true).excute(params);
};
UtilityMethod.prototype.expandGroupsToPrincipals = function (inputs, maxCount) {
if (maxCount === void 0) { maxCount = 30; }
var params = {
inputs: inputs,
maxCount: maxCount,
};
return this.clone(UtilityMethod, "ExpandGroupsToPrincipals", true).excute(params);
};
UtilityMethod.prototype.createWikiPage = function (info) {
return this.clone(UtilityMethod, "CreateWikiPageInContextWeb", true).excute({
parameters: info,
}).then(function (r) {
return {
data: r,
file: new File(odataUrlFrom(r)),
};
});
};
return UtilityMethod;
}(SharePointQueryable));
/**
* Root of the SharePoint REST module
*/
var SPRest = /** @class */ (function () {
/**
* Creates a new instance of the SPRest class
*
* @param options Additional options
* @param baseUrl A string that should form the base part of the url
*/
function SPRest(_options, _baseUrl) {
if (_options === void 0) { _options = {}; }
if (_baseUrl === void 0) { _baseUrl = ""; }
this._options = _options;
this._baseUrl = _baseUrl;
}
/**
* Configures instance with additional options and baseUrl.
* Provided configuration used by other objects in a chain
*
* @param options Additional options
* @param baseUrl A string that should form the base part of the url
*/
SPRest.prototype.configure = function (options, baseUrl) {
if (baseUrl === void 0) { baseUrl = ""; }
return new SPRest(options, baseUrl);
};
/**
* Global SharePoint configuration options
*
* @param config The SharePoint configuration to apply
*/
SPRest.prototype.setup = function (config) {
setup(config);
};
/**
* Executes a search against this web context
*
* @param query The SearchQuery definition
*/
SPRest.prototype.searchSuggest = function (query) {
var finalQuery;
if (typeof query === "string") {
finalQuery = { querytext: query };
}
else {
finalQuery = query;
}
return this.create(SearchSuggest).execute(finalQuery);
};
/**
* Executes a search against this web context
*
* @param query The SearchQuery definition
*/
SPRest.prototype.search = function (query) {
return this.create(Search).execute(query);
};
/**
* Executes the provided search query, caching the results
*
* @param query The SearchQuery definition
* @param options The set of caching options used to store the results
*/
SPRest.prototype.searchWithCaching = function (query, options) {
return this.create(Search).usingCaching(options).execute(query);
};
Object.defineProperty(SPRest.prototype, "site", {
/**
* Begins a site collection scoped REST request
*
*/
get: function () {
return this.create(Site);
},
enumerable: true,
configurable: true
});
Object.defineProperty(SPRest.prototype, "web", {
/**
* Begins a web scoped REST request
*
*/
get: function () {
return this.create(Web);
},
enumerable: true,
configurable: true
});
Object.defineProperty(SPRest.prototype, "profiles", {
/**
* Access to user profile methods
*
*/
get: function () {
return this.create(UserProfileQuery);
},
enumerable: true,
configurable: true
});
Object.defineProperty(SPRest.prototype, "social", {
/**
* Access to social methods
*/
get: function () {
return this.create(SocialQuery);
},
enumerable: true,
configurable: true
});
Object.defineProperty(SPRest.prototype, "navigation", {
/**
* Access to the site collection level navigation service
*/
get: function () {
return new NavigationService();
},
enumerable: true,
configurable: true
});
/**
* Creates a new batch object for use with the SharePointQueryable.addToBatch method
*
*/
SPRest.prototype.createBatch = function () {
return this.web.createBatch();
};
Object.defineProperty(SPRest.prototype, "utility", {
/**
* Static utilities methods from SP.Utilities.Utility
*/
get: function () {
return this.create(UtilityMethod, "");
},
enumerable: true,
configurable: true
});
/**
* Handles creating and configuring the objects returned from this class
*
* @param fm The factory method used to create the instance
* @param path Optional additional path information to pass to the factory method
*/
SPRest.prototype.create = function (fm, path) {
return new fm(this._baseUrl, path).configure(this._options);
};
return SPRest;
}());
var sp = new SPRest();
//# sourceMappingURL=sp.es5.js.map
/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(10)))
/***/ }),
/* 10 */
/***/ (function(module, exports) {
var g;
// This works in non-strict mode
g = (function() {
return this;
})();
try {
// This works if eval is allowed (see CSP)
g = g || Function("return this")() || (1,eval)("this");
} catch(e) {
// This works if the window reference is available
if(typeof window === "object")
g = window;
}
// g can still be undefined, but nothing to do about it...
// We return undefined, instead of nothing here, so it's
// easier to handle this case. if(!global) { ...}
module.exports = g;
/***/ }),
/* 11 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return CachingOptions; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return CachingParserWrapper; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return ODataParserBase; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return ODataDefaultParser; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return TextParser; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return BlobParser; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return JSONParser; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return BufferParser; });
/* unused harmony export LambdaParser */
/* unused harmony export setResult */
/* unused harmony export pipe */
/* unused harmony export requestPipelineMethod */
/* unused harmony export PipelineMethods */
/* unused harmony export getDefaultPipeline */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return Queryable; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return ODataQueryable; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return ODataBatch; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__pnp_common__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_tslib__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__pnp_logging__ = __webpack_require__(4);
/**
@license
* @pnp/odata v1.2.1 - pnp - provides shared odata functionality and base classes
* MIT (https://github.com/pnp/pnpjs/blob/master/LICENSE)
* Copyright (c) 2018 Microsoft
* docs: https://pnp.github.io/pnpjs/
* source: https:github.com/pnp/pnpjs
* bugs: https://github.com/pnp/pnpjs/issues
*/
var CachingOptions = /** @class */ (function () {
function CachingOptions(key) {
this.key = key;
this.expiration = Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["e" /* dateAdd */])(new Date(), "second", __WEBPACK_IMPORTED_MODULE_0__pnp_common__["c" /* RuntimeConfig */].defaultCachingTimeoutSeconds);
this.storeName = __WEBPACK_IMPORTED_MODULE_0__pnp_common__["c" /* RuntimeConfig */].defaultCachingStore;
}
Object.defineProperty(CachingOptions.prototype, "store", {
get: function () {
if (this.storeName === "local") {
return CachingOptions.storage.local;
}
else {
return CachingOptions.storage.session;
}
},
enumerable: true,
configurable: true
});
CachingOptions.storage = new __WEBPACK_IMPORTED_MODULE_0__pnp_common__["b" /* PnPClientStorage */]();
return CachingOptions;
}());
var CachingParserWrapper = /** @class */ (function () {
function CachingParserWrapper(parser, cacheOptions) {
this.parser = parser;
this.cacheOptions = cacheOptions;
}
CachingParserWrapper.prototype.parse = function (response) {
var _this = this;
return this.parser.parse(response).then(function (r) { return _this.cacheData(r); });
};
CachingParserWrapper.prototype.cacheData = function (data) {
if (this.cacheOptions.store !== null) {
this.cacheOptions.store.put(this.cacheOptions.key, data, this.cacheOptions.expiration);
}
return data;
};
return CachingParserWrapper;
}());
var ODataParserBase = /** @class */ (function () {
function ODataParserBase() {
}
ODataParserBase.prototype.parse = function (r) {
var _this = this;
return new Promise(function (resolve, reject) {
if (_this.handleError(r, reject)) {
_this.parseImpl(r, resolve, reject);
}
});
};
ODataParserBase.prototype.parseImpl = function (r, resolve, reject) {
var _this = this;
if ((r.headers.has("Content-Length") && parseFloat(r.headers.get("Content-Length")) === 0) || r.status === 204) {
resolve({});
}
else {
// patch to handle cases of 200 response with no or whitespace only bodies (#487 & #545)
r.text()
.then(function (txt) { return txt.replace(/\s/ig, "").length > 0 ? JSON.parse(txt) : {}; })
.then(function (json) { return resolve(_this.parseODataJSON(json)); })
.catch(function (e) { return reject(e); });
}
};
/**
* Handles a response with ok === false by parsing the body and creating a ProcessHttpClientResponseException
* which is passed to the reject delegate. This method returns true if there is no error, otherwise false
*
* @param r Current response object
* @param reject reject delegate for the surrounding promise
*/
ODataParserBase.prototype.handleError = function (r, reject) {
if (!r.ok) {
// read the response as text, it may not be valid json
r.json().then(function (json) {
// include the headers as they contain diagnostic information
var data = {
responseBody: json,
responseHeaders: r.headers,
};
reject(new Error("Error making HttpClient request in queryable: [" + r.status + "] " + r.statusText + " ::> " + JSON.stringify(data)));
}).catch(function (e) {
reject(new Error("Error making HttpClient request in queryable: [" + r.status + "] " + r.statusText + " ::> " + e));
});
}
return r.ok;
};
/**
* Normalizes the json response by removing the various nested levels
*
* @param json json object to parse
*/
ODataParserBase.prototype.parseODataJSON = function (json) {
var result = json;
if (Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["k" /* hOP */])(json, "d")) {
if (Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["k" /* hOP */])(json.d, "results")) {
result = json.d.results;
}
else {
result = json.d;
}
}
else if (Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["k" /* hOP */])(json, "value")) {
result = json.value;
}
return result;
};
return ODataParserBase;
}());
var ODataDefaultParser = /** @class */ (function (_super) {
Object(__WEBPACK_IMPORTED_MODULE_1_tslib__["b" /* __extends */])(ODataDefaultParser, _super);
function ODataDefaultParser() {
return _super !== null && _super.apply(this, arguments) || this;
}
return ODataDefaultParser;
}(ODataParserBase));
var TextParser = /** @class */ (function (_super) {
Object(__WEBPACK_IMPORTED_MODULE_1_tslib__["b" /* __extends */])(TextParser, _super);
function TextParser() {
return _super !== null && _super.apply(this, arguments) || this;
}
TextParser.prototype.parseImpl = function (r, resolve) {
r.text().then(resolve);
};
return TextParser;
}(ODataParserBase));
var BlobParser = /** @class */ (function (_super) {
Object(__WEBPACK_IMPORTED_MODULE_1_tslib__["b" /* __extends */])(BlobParser, _super);
function BlobParser() {
return _super !== null && _super.apply(this, arguments) || this;
}
BlobParser.prototype.parseImpl = function (r, resolve) {
r.blob().then(resolve);
};
return BlobParser;
}(ODataParserBase));
var JSONParser = /** @class */ (function (_super) {
Object(__WEBPACK_IMPORTED_MODULE_1_tslib__["b" /* __extends */])(JSONParser, _super);
function JSONParser() {
return _super !== null && _super.apply(this, arguments) || this;
}
JSONParser.prototype.parseImpl = function (r, resolve) {
r.json().then(resolve);
};
return JSONParser;
}(ODataParserBase));
var BufferParser = /** @class */ (function (_super) {
Object(__WEBPACK_IMPORTED_MODULE_1_tslib__["b" /* __extends */])(BufferParser, _super);
function BufferParser() {
return _super !== null && _super.apply(this, arguments) || this;
}
BufferParser.prototype.parseImpl = function (r, resolve) {
if (Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["l" /* isFunc */])(r.arrayBuffer)) {
r.arrayBuffer().then(resolve);
}
else {
r.buffer().then(resolve);
}
};
return BufferParser;
}(ODataParserBase));
var LambdaParser = /** @class */ (function () {
function LambdaParser(parser) {
this.parser = parser;
}
LambdaParser.prototype.parse = function (r) {
return this.parser(r);
};
return LambdaParser;
}());
/**
* Resolves the context's result value
*
* @param context The current context
*/
function returnResult(context) {
__WEBPACK_IMPORTED_MODULE_2__pnp_logging__["a" /* Logger */].log({
data: __WEBPACK_IMPORTED_MODULE_2__pnp_logging__["a" /* Logger */].activeLogLevel === 0 /* Verbose */ ? context.result : {},
level: 1 /* Info */,
message: "[" + context.requestId + "] (" + (new Date()).getTime() + ") Returning result from pipeline. Set logging to verbose to see data.",
});
return Promise.resolve(context.result || null);
}
/**
* Sets the result on the context
*/
function setResult(context, value) {
return new Promise(function (resolve) {
context.result = value;
context.hasResult = true;
resolve(context);
});
}
/**
* Invokes the next method in the provided context's pipeline
*
* @param c The current request context
*/
function next(c) {
if (c.pipeline.length > 0) {
return c.pipeline.shift()(c);
}
else {
return Promise.resolve(c);
}
}
/**
* Executes the current request context's pipeline
*
* @param context Current context
*/
function pipe(context) {
if (context.pipeline.length < 1) {
__WEBPACK_IMPORTED_MODULE_2__pnp_logging__["a" /* Logger */].write("[" + context.requestId + "] (" + (new Date()).getTime() + ") Request pipeline contains no methods!", 2 /* Warning */);
}
var promise = next(context).then(function (ctx) { return returnResult(ctx); }).catch(function (e) {
__WEBPACK_IMPORTED_MODULE_2__pnp_logging__["a" /* Logger */].error(e);
throw e;
});
if (context.isBatched) {
// this will block the batch's execute method from returning until the child requets have been resolved
context.batch.addResolveBatchDependency(promise);
}
return promise;
}
/**
* decorator factory applied to methods in the pipeline to control behavior
*/
function requestPipelineMethod(alwaysRun) {
if (alwaysRun === void 0) { alwaysRun = false; }
return function (target, propertyKey, descriptor) {
var method = descriptor.value;
descriptor.value = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
// if we have a result already in the pipeline, pass it along and don't call the tagged method
if (!alwaysRun && args.length > 0 && Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["k" /* hOP */])(args[0], "hasResult") && args[0].hasResult) {
__WEBPACK_IMPORTED_MODULE_2__pnp_logging__["a" /* Logger */].write("[" + args[0].requestId + "] (" + (new Date()).getTime() + ") Skipping request pipeline method " + propertyKey + ", existing result in pipeline.", 0 /* Verbose */);
return Promise.resolve(args[0]);
}
// apply the tagged method
__WEBPACK_IMPORTED_MODULE_2__pnp_logging__["a" /* Logger */].write("[" + args[0].requestId + "] (" + (new Date()).getTime() + ") Calling request pipeline method " + propertyKey + ".", 0 /* Verbose */);
// then chain the next method in the context's pipeline - allows for dynamic pipeline
return method.apply(target, args).then(function (ctx) { return next(ctx); });
};
};
}
/**
* Contains the methods used within the request pipeline
*/
var PipelineMethods = /** @class */ (function () {
function PipelineMethods() {
}
/**
* Logs the start of the request
*/
PipelineMethods.logStart = function (context) {
return new Promise(function (resolve) {
__WEBPACK_IMPORTED_MODULE_2__pnp_logging__["a" /* Logger */].log({
data: __WEBPACK_IMPORTED_MODULE_2__pnp_logging__["a" /* Logger */].activeLogLevel === 1 /* Info */ ? {} : context,
level: 1 /* Info */,
message: "[" + context.requestId + "] (" + (new Date()).getTime() + ") Beginning " + context.verb + " request (" + context.requestAbsoluteUrl + ")",
});
resolve(context);
});
};
/**
* Handles caching of the request
*/
PipelineMethods.caching = function (context) {
return new Promise(function (resolve) {
// handle caching, if applicable
if (context.isCached) {
__WEBPACK_IMPORTED_MODULE_2__pnp_logging__["a" /* Logger */].write("[" + context.requestId + "] (" + (new Date()).getTime() + ") Caching is enabled for request, checking cache...", 1 /* Info */);
var cacheOptions = new CachingOptions(context.requestAbsoluteUrl.toLowerCase());
if (context.cachingOptions !== undefined) {
cacheOptions = Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["f" /* extend */])(cacheOptions, context.cachingOptions);
}
// we may not have a valid store
if (cacheOptions.store !== null) {
// check if we have the data in cache and if so resolve the promise and return
var data = cacheOptions.store.get(cacheOptions.key);
if (data !== null) {
// ensure we clear any held batch dependency we are resolving from the cache
__WEBPACK_IMPORTED_MODULE_2__pnp_logging__["a" /* Logger */].log({
data: __WEBPACK_IMPORTED_MODULE_2__pnp_logging__["a" /* Logger */].activeLogLevel === 1 /* Info */ ? {} : data,
level: 1 /* Info */,
message: "[" + context.requestId + "] (" + (new Date()).getTime() + ") Value returned from cache.",
});
if (Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["l" /* isFunc */])(context.batchDependency)) {
context.batchDependency();
}
// handle the case where a parser needs to take special actions with a cached result
if (Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["k" /* hOP */])(context.parser, "hydrate")) {
data = context.parser.hydrate(data);
}
return setResult(context, data).then(function (ctx) { return resolve(ctx); });
}
}
__WEBPACK_IMPORTED_MODULE_2__pnp_logging__["a" /* Logger */].write("[" + context.requestId + "] (" + (new Date()).getTime() + ") Value not found in cache.", 1 /* Info */);
// if we don't then wrap the supplied parser in the caching parser wrapper
// and send things on their way
context.parser = new CachingParserWrapper(context.parser, cacheOptions);
}
return resolve(context);
});
};
/**
* Sends the request
*/
PipelineMethods.send = function (context) {
return new Promise(function (resolve, reject) {
// send or batch the request
if (context.isBatched) {
// we are in a batch, so add to batch, remove dependency, and resolve with the batch's promise
var p = context.batch.add(context.requestAbsoluteUrl, context.verb, context.options, context.parser, context.requestId);
// we release the dependency here to ensure the batch does not execute until the request is added to the batch
if (Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["l" /* isFunc */])(context.batchDependency)) {
context.batchDependency();
}
__WEBPACK_IMPORTED_MODULE_2__pnp_logging__["a" /* Logger */].write("[" + context.requestId + "] (" + (new Date()).getTime() + ") Batching request in batch " + context.batch.batchId + ".", 1 /* Info */);
// we set the result as the promise which will be resolved by the batch's execution
resolve(setResult(context, p));
}
else {
__WEBPACK_IMPORTED_MODULE_2__pnp_logging__["a" /* Logger */].write("[" + context.requestId + "] (" + (new Date()).getTime() + ") Sending request.", 1 /* Info */);
// we are not part of a batch, so proceed as normal
var client = context.clientFactory();
var opts = Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["f" /* extend */])(context.options || {}, { method: context.verb });
client.fetch(context.requestAbsoluteUrl, opts)
.then(function (response) { return context.parser.parse(response); })
.then(function (result) { return setResult(context, result); })
.then(function (ctx) { return resolve(ctx); })
.catch(function (e) { return reject(e); });
}
});
};
/**
* Logs the end of the request
*/
PipelineMethods.logEnd = function (context) {
return new Promise(function (resolve) {
if (context.isBatched) {
__WEBPACK_IMPORTED_MODULE_2__pnp_logging__["a" /* Logger */].log({
data: __WEBPACK_IMPORTED_MODULE_2__pnp_logging__["a" /* Logger */].activeLogLevel === 1 /* Info */ ? {} : context,
level: 1 /* Info */,
message: "[" + context.requestId + "] (" + (new Date()).getTime() + ") " + context.verb + " request will complete in batch " + context.batch.batchId + ".",
});
}
else {
__WEBPACK_IMPORTED_MODULE_2__pnp_logging__["a" /* Logger */].log({
data: __WEBPACK_IMPORTED_MODULE_2__pnp_logging__["a" /* Logger */].activeLogLevel === 1 /* Info */ ? {} : context,
level: 1 /* Info */,
message: "[" + context.requestId + "] (" + (new Date()).getTime() + ") Completing " + context.verb + " request.",
});
}
resolve(context);
});
};
Object(__WEBPACK_IMPORTED_MODULE_1_tslib__["a" /* __decorate */])([
requestPipelineMethod(true)
], PipelineMethods, "logStart", null);
Object(__WEBPACK_IMPORTED_MODULE_1_tslib__["a" /* __decorate */])([
requestPipelineMethod()
], PipelineMethods, "caching", null);
Object(__WEBPACK_IMPORTED_MODULE_1_tslib__["a" /* __decorate */])([
requestPipelineMethod()
], PipelineMethods, "send", null);
Object(__WEBPACK_IMPORTED_MODULE_1_tslib__["a" /* __decorate */])([
requestPipelineMethod(true)
], PipelineMethods, "logEnd", null);
return PipelineMethods;
}());
function getDefaultPipeline() {
return [
PipelineMethods.logStart,
PipelineMethods.caching,
PipelineMethods.send,
PipelineMethods.logEnd,
].slice(0);
}
var Queryable = /** @class */ (function () {
function Queryable() {
this._query = new Map();
this._options = {};
this._url = "";
this._parentUrl = "";
this._useCaching = false;
this._cachingOptions = null;
}
/**
* Gets the currentl url
*
*/
Queryable.prototype.toUrl = function () {
return this._url;
};
/**
* Directly concatonates the supplied string to the current url, not normalizing "/" chars
*
* @param pathPart The string to concatonate to the url
*/
Queryable.prototype.concat = function (pathPart) {
this._url += pathPart;
return this;
};
Object.defineProperty(Queryable.prototype, "query", {
/**
* Provides access to the query builder for this url
*
*/
get: function () {
return this._query;
},
enumerable: true,
configurable: true
});
/**
* Sets custom options for current object and all derived objects accessible via chaining
*
* @param options custom options
*/
Queryable.prototype.configure = function (options) {
Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["p" /* mergeOptions */])(this._options, options);
return this;
};
/**
* Configures this instance from the configure options of the supplied instance
*
* @param o Instance from which options should be taken
*/
Queryable.prototype.configureFrom = function (o) {
Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["p" /* mergeOptions */])(this._options, o._options);
return this;
};
/**
* Enables caching for this request
*
* @param options Defines the options used when caching this request
*/
Queryable.prototype.usingCaching = function (options) {
if (!__WEBPACK_IMPORTED_MODULE_0__pnp_common__["c" /* RuntimeConfig */].globalCacheDisable) {
this._useCaching = true;
if (options !== undefined) {
this._cachingOptions = options;
}
}
return this;
};
Queryable.prototype.getCore = function (parser, options) {
if (parser === void 0) { parser = new JSONParser(); }
if (options === void 0) { options = {}; }
return this.toRequestContext("GET", options, parser, getDefaultPipeline()).then(function (context) { return pipe(context); });
};
Queryable.prototype.postCore = function (options, parser) {
if (options === void 0) { options = {}; }
if (parser === void 0) { parser = new JSONParser(); }
return this.toRequestContext("POST", options, parser, getDefaultPipeline()).then(function (context) { return pipe(context); });
};
Queryable.prototype.patchCore = function (options, parser) {
if (options === void 0) { options = {}; }
if (parser === void 0) { parser = new JSONParser(); }
return this.toRequestContext("PATCH", options, parser, getDefaultPipeline()).then(function (context) { return pipe(context); });
};
Queryable.prototype.deleteCore = function (options, parser) {
if (options === void 0) { options = {}; }
if (parser === void 0) { parser = new JSONParser(); }
return this.toRequestContext("DELETE", options, parser, getDefaultPipeline()).then(function (context) { return pipe(context); });
};
Queryable.prototype.putCore = function (options, parser) {
if (options === void 0) { options = {}; }
if (parser === void 0) { parser = new JSONParser(); }
return this.toRequestContext("PUT", options, parser, getDefaultPipeline()).then(function (context) { return pipe(context); });
};
/**
* Appends the given string and normalizes "/" chars
*
* @param pathPart The string to append
*/
Queryable.prototype.append = function (pathPart) {
this._url = Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["d" /* combine */])(this._url, pathPart);
};
Object.defineProperty(Queryable.prototype, "parentUrl", {
/**
* Gets the parent url used when creating this instance
*
*/
get: function () {
return this._parentUrl;
},
enumerable: true,
configurable: true
});
/**
* Extends this queryable from the provided parent
*
* @param parent Parent queryable from which we will derive a base url
* @param path Additional path
*/
Queryable.prototype.extend = function (parent, path) {
this._parentUrl = parent._url;
this._url = Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["d" /* combine */])(this._parentUrl, path);
this.configureFrom(parent);
};
return Queryable;
}());
var ODataQueryable = /** @class */ (function (_super) {
Object(__WEBPACK_IMPORTED_MODULE_1_tslib__["b" /* __extends */])(ODataQueryable, _super);
function ODataQueryable() {
var _this = _super.call(this) || this;
_this._batch = null;
return _this;
}
/**
* Adds this query to the supplied batch
*
* @example
* ```
*
* let b = pnp.sp.createBatch();
* pnp.sp.web.inBatch(b).get().then(...);
* b.execute().then(...)
* ```
*/
ODataQueryable.prototype.inBatch = function (batch) {
if (this.batch !== null) {
throw new Error("This query is already part of a batch.");
}
this._batch = batch;
return this;
};
/**
* Gets the currentl url
*
*/
ODataQueryable.prototype.toUrl = function () {
return this._url;
};
/**
* Executes the currently built request
*
* @param parser Allows you to specify a parser to handle the result
* @param getOptions The options used for this request
*/
ODataQueryable.prototype.get = function (parser, options) {
if (parser === void 0) { parser = new ODataDefaultParser(); }
if (options === void 0) { options = {}; }
return this.getCore(parser, options);
};
ODataQueryable.prototype.getCore = function (parser, options) {
if (parser === void 0) { parser = new ODataDefaultParser(); }
if (options === void 0) { options = {}; }
return this.toRequestContext("GET", options, parser, getDefaultPipeline()).then(function (context) { return pipe(context); });
};
ODataQueryable.prototype.postCore = function (options, parser) {
if (options === void 0) { options = {}; }
if (parser === void 0) { parser = new ODataDefaultParser(); }
return this.toRequestContext("POST", options, parser, getDefaultPipeline()).then(function (context) { return pipe(context); });
};
ODataQueryable.prototype.patchCore = function (options, parser) {
if (options === void 0) { options = {}; }
if (parser === void 0) { parser = new ODataDefaultParser(); }
return this.toRequestContext("PATCH", options, parser, getDefaultPipeline()).then(function (context) { return pipe(context); });
};
ODataQueryable.prototype.deleteCore = function (options, parser) {
if (options === void 0) { options = {}; }
if (parser === void 0) { parser = new ODataDefaultParser(); }
return this.toRequestContext("DELETE", options, parser, getDefaultPipeline()).then(function (context) { return pipe(context); });
};
ODataQueryable.prototype.putCore = function (options, parser) {
if (options === void 0) { options = {}; }
if (parser === void 0) { parser = new ODataDefaultParser(); }
return this.toRequestContext("PUT", options, parser, getDefaultPipeline()).then(function (context) { return pipe(context); });
};
/**
* Blocks a batch call from occuring, MUST be cleared by calling the returned function
*/
ODataQueryable.prototype.addBatchDependency = function () {
if (this._batch !== null) {
return this._batch.addDependency();
}
return function () { return null; };
};
Object.defineProperty(ODataQueryable.prototype, "hasBatch", {
/**
* Indicates if the current query has a batch associated
*
*/
get: function () {
return Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["q" /* objectDefinedNotNull */])(this._batch);
},
enumerable: true,
configurable: true
});
Object.defineProperty(ODataQueryable.prototype, "batch", {
/**
* The batch currently associated with this query or null
*
*/
get: function () {
return this.hasBatch ? this._batch : null;
},
enumerable: true,
configurable: true
});
return ODataQueryable;
}(Queryable));
var ODataBatch = /** @class */ (function () {
function ODataBatch(_batchId) {
if (_batchId === void 0) { _batchId = Object(__WEBPACK_IMPORTED_MODULE_0__pnp_common__["i" /* getGUID */])(); }
this._batchId = _batchId;
this._reqs = [];
this._deps = [];
this._rDeps = [];
}
Object.defineProperty(ODataBatch.prototype, "batchId", {
get: function () {
return this._batchId;
},
enumerable: true,
configurable: true
});
Object.defineProperty(ODataBatch.prototype, "requests", {
/**
* The requests contained in this batch
*/
get: function () {
return this._reqs;
},
enumerable: true,
configurable: true
});
/**
*
* @param url Request url
* @param method Request method (GET, POST, etc)
* @param options Any request options
* @param parser The parser used to handle the eventual return from the query
* @param id An identifier used to track a request within a batch
*/
ODataBatch.prototype.add = function (url, method, options, parser, id) {
var info = {
id: id,
method: method.toUpperCase(),
options: options,
parser: parser,
reject: null,
resolve: null,
url: url,
};
var p = new Promise(function (resolve, reject) {
info.resolve = resolve;
info.reject = reject;
});
this._reqs.push(info);
return p;
};
/**
* Adds a dependency insuring that some set of actions will occur before a batch is processed.
* MUST be cleared using the returned resolve delegate to allow batches to run
*/
ODataBatch.prototype.addDependency = function () {
var resolver = function () { return void (0); };
this._deps.push(new Promise(function (resolve) {
resolver = resolve;
}));
return resolver;
};
/**
* The batch's execute method will not resolve util any promises added here resolve
*
* @param p The dependent promise
*/
ODataBatch.prototype.addResolveBatchDependency = function (p) {
this._rDeps.push(p);
};
/**
* Execute the current batch and resolve the associated promises
*
* @returns A promise which will be resolved once all of the batch's child promises have resolved
*/
ODataBatch.prototype.execute = function () {
var _this = this;
// we need to check the dependencies twice due to how different engines handle things.
// We can get a second set of promises added during the first set resolving
return Promise.all(this._deps)
.then(function () { return Promise.all(_this._deps); })
.then(function () { return _this.executeImpl(); })
.then(function () { return Promise.all(_this._rDeps); })
.then(function () { return void (0); });
};
return ODataBatch;
}());
//# sourceMappingURL=odata.es5.js.map
/***/ }),
/* 12 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return Labels; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Label; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__pnp_sp_clientsvc__ = __webpack_require__(2);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__pnp_common__ = __webpack_require__(1);
/**
* Represents a collection of labels
*/
var Labels = /** @class */ (function (_super) {
__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](Labels, _super);
function Labels(parent, _objectPaths) {
if (parent === void 0) { parent = ""; }
if (_objectPaths === void 0) { _objectPaths = null; }
var _this = _super.call(this, parent, _objectPaths) || this;
_this._objectPaths.add(Object(__WEBPACK_IMPORTED_MODULE_1__pnp_sp_clientsvc__["i" /* property */])("Labels"));
return _this;
}
/**
* Gets a label from the collection by its value
*
* @param value The value to retrieve
*/
Labels.prototype.getByValue = function (value) {
var params = __WEBPACK_IMPORTED_MODULE_1__pnp_sp_clientsvc__["b" /* MethodParams */].build().string(value);
return this.getChild(Label, "GetByValue", params);
};
/**
* Loads the data and merges with with the ILabel instances
*/
Labels.prototype.get = function () {
var _this = this;
return this.sendGetCollection(function (d) {
if (!Object(__WEBPACK_IMPORTED_MODULE_2__pnp_common__["s" /* stringIsNullOrEmpty */])(d.Value)) {
return _this.getByValue(d.Value);
}
throw new Error("Could not find Value in Labels.get(). You must include at least one of these in your select fields.");
});
};
return Labels;
}(__WEBPACK_IMPORTED_MODULE_1__pnp_sp_clientsvc__["a" /* ClientSvcQueryable */]));
/**
* Represents a label instance
*/
var Label = /** @class */ (function (_super) {
__WEBPACK_IMPORTED_MODULE_0_tslib__["b" /* __extends */](Label, _super);
function Label() {
return _super !== null && _super.apply(this, arguments) || this;
}
/**
* Gets the data for this Label
*/
Label.prototype.get = function () {
return this.sendGet(Label);
};
/**
* Sets this label as the default
*/
Label.prototype.setAsDefaultForLanguage = function () {
return this.invokeNonQuery("SetAsDefaultForLanguage");
};
/**
* Deletes this label
*/
Label.prototype.delete = function () {
return this.invokeNonQuery("DeleteObject");
};
return Label;
}(__WEBPACK_IMPORTED_MODULE_1__pnp_sp_clientsvc__["a" /* ClientSvcQueryable */]));
//# sourceMappingURL=labels.js.map
/***/ }),
/* 13 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__src_taxonomy__ = __webpack_require__(14);
/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "taxonomy", function() { return __WEBPACK_IMPORTED_MODULE_0__src_taxonomy__["n"]; });
/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "Labels", function() { return __WEBPACK_IMPORTED_MODULE_0__src_taxonomy__["d"]; });
/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "Label", function() { return __WEBPACK_IMPORTED_MODULE_0__src_taxonomy__["c"]; });
/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "Session", function() { return __WEBPACK_IMPORTED_MODULE_0__src_taxonomy__["e"]; });
/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "TermGroup", function() { return __WEBPACK_IMPORTED_MODULE_0__src_taxonomy__["h"]; });
/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "Terms", function() { return __WEBPACK_IMPORTED_MODULE_0__src_taxonomy__["m"]; });
/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "Term", function() { return __WEBPACK_IMPORTED_MODULE_0__src_taxonomy__["g"]; });
/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "TermSets", function() { return __WEBPACK_IMPORTED_MODULE_0__src_taxonomy__["j"]; });
/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "TermSet", function() { return __WEBPACK_IMPORTED_MODULE_0__src_taxonomy__["i"]; });
/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "TermStores", function() { return __WEBPACK_IMPORTED_MODULE_0__src_taxonomy__["l"]; });
/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "TermStore", function() { return __WEBPACK_IMPORTED_MODULE_0__src_taxonomy__["k"]; });
/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "StringMatchOption", function() { return __WEBPACK_IMPORTED_MODULE_0__src_taxonomy__["f"]; });
/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "ChangedItemType", function() { return __WEBPACK_IMPORTED_MODULE_0__src_taxonomy__["a"]; });
/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "ChangedOperationType", function() { return __WEBPACK_IMPORTED_MODULE_0__src_taxonomy__["b"]; });
//# sourceMappingURL=index.js.map
/***/ }),
/* 14 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return taxonomy; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__session__ = __webpack_require__(8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__labels__ = __webpack_require__(12);
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "c", function() { return __WEBPACK_IMPORTED_MODULE_1__labels__["a"]; });
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "d", function() { return __WEBPACK_IMPORTED_MODULE_1__labels__["b"]; });
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "e", function() { return __WEBPACK_IMPORTED_MODULE_0__session__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__termgroup__ = __webpack_require__(6);
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "h", function() { return __WEBPACK_IMPORTED_MODULE_2__termgroup__["a"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__terms__ = __webpack_require__(7);
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "g", function() { return __WEBPACK_IMPORTED_MODULE_3__terms__["a"]; });
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "m", function() { return __WEBPACK_IMPORTED_MODULE_3__terms__["b"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__termsets__ = __webpack_require__(3);
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "i", function() { return __WEBPACK_IMPORTED_MODULE_4__termsets__["a"]; });
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "j", function() { return __WEBPACK_IMPORTED_MODULE_4__termsets__["b"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__termstores__ = __webpack_require__(5);
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "k", function() { return __WEBPACK_IMPORTED_MODULE_5__termstores__["a"]; });
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "l", function() { return __WEBPACK_IMPORTED_MODULE_5__termstores__["b"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__types__ = __webpack_require__(16);
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_6__types__["a"]; });
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_6__types__["b"]; });
/* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "f", function() { return __WEBPACK_IMPORTED_MODULE_6__types__["c"]; });
// export an existing session instance
var taxonomy = new __WEBPACK_IMPORTED_MODULE_0__session__["a" /* Session */]();
//# sourceMappingURL=taxonomy.js.map
/***/ }),
/* 15 */
/***/ (function(module, exports) {
/*! adal-angular v1.0.17 2018-02-27 */
var AuthenticationContext=function(){"use strict";return AuthenticationContext=function(a){if(this.REQUEST_TYPE={LOGIN:"LOGIN",RENEW_TOKEN:"RENEW_TOKEN",UNKNOWN:"UNKNOWN"},this.RESPONSE_TYPE={ID_TOKEN_TOKEN:"id_token token",TOKEN:"token"},this.CONSTANTS={ACCESS_TOKEN:"access_token",EXPIRES_IN:"expires_in",ID_TOKEN:"id_token",ERROR_DESCRIPTION:"error_description",SESSION_STATE:"session_state",ERROR:"error",STORAGE:{TOKEN_KEYS:"adal.token.keys",ACCESS_TOKEN_KEY:"adal.access.token.key",EXPIRATION_KEY:"adal.expiration.key",STATE_LOGIN:"adal.state.login",STATE_RENEW:"adal.state.renew",NONCE_IDTOKEN:"adal.nonce.idtoken",SESSION_STATE:"adal.session.state",USERNAME:"adal.username",IDTOKEN:"adal.idtoken",ERROR:"adal.error",ERROR_DESCRIPTION:"adal.error.description",LOGIN_REQUEST:"adal.login.request",LOGIN_ERROR:"adal.login.error",RENEW_STATUS:"adal.token.renew.status",ANGULAR_LOGIN_REQUEST:"adal.angular.login.request"},RESOURCE_DELIMETER:"|",CACHE_DELIMETER:"||",LOADFRAME_TIMEOUT:6e3,TOKEN_RENEW_STATUS_CANCELED:"Canceled",TOKEN_RENEW_STATUS_COMPLETED:"Completed",TOKEN_RENEW_STATUS_IN_PROGRESS:"In Progress",LOGGING_LEVEL:{ERROR:0,WARN:1,INFO:2,VERBOSE:3},LEVEL_STRING_MAP:{0:"ERROR:",1:"WARNING:",2:"INFO:",3:"VERBOSE:"},POPUP_WIDTH:483,POPUP_HEIGHT:600},AuthenticationContext.prototype._singletonInstance)return AuthenticationContext.prototype._singletonInstance;if(AuthenticationContext.prototype._singletonInstance=this,this.instance="https://login.microsoftonline.com/",this.config={},this.callback=null,this.popUp=!1,this.isAngular=!1,this._user=null,this._activeRenewals={},this._loginInProgress=!1,this._acquireTokenInProgress=!1,this._renewStates=[],this._callBackMappedToRenewStates={},this._callBacksMappedToRenewStates={},this._openedWindows=[],this._requestType=this.REQUEST_TYPE.LOGIN,window._adalInstance=this,a.displayCall&&"function"!=typeof a.displayCall)throw new Error("displayCall is not a function");if(!a.clientId)throw new Error("clientId is required");this.config=this._cloneConfig(a),void 0===this.config.navigateToLoginRequestUrl&&(this.config.navigateToLoginRequestUrl=!0),this.config.popUp&&(this.popUp=!0),this.config.callback&&"function"==typeof this.config.callback&&(this.callback=this.config.callback),this.config.instance&&(this.instance=this.config.instance),this.config.loginResource||(this.config.loginResource=this.config.clientId),this.config.redirectUri||(this.config.redirectUri=window.location.href.split("?")[0].split("#")[0]),this.config.postLogoutRedirectUri||(this.config.postLogoutRedirectUri=window.location.href.split("?")[0].split("#")[0]),this.config.anonymousEndpoints||(this.config.anonymousEndpoints=[]),this.config.isAngular&&(this.isAngular=this.config.isAngular),this.config.loadFrameTimeout&&(this.CONSTANTS.LOADFRAME_TIMEOUT=this.config.loadFrameTimeout)},"undefined"!=typeof window&&(window.Logging={piiLoggingEnabled:!1,level:0,log:function(a){}}),AuthenticationContext.prototype.login=function(){if(this._loginInProgress)return void this.info("Login in progress");this._loginInProgress=!0;var a=this._guid();this.config.state=a,this._idTokenNonce=this._guid();var b=this._getItem(this.CONSTANTS.STORAGE.ANGULAR_LOGIN_REQUEST);b&&""!==b?this._saveItem(this.CONSTANTS.STORAGE.ANGULAR_LOGIN_REQUEST,""):b=window.location.href,this.verbose("Expected state: "+a+" startPage:"+b),this._saveItem(this.CONSTANTS.STORAGE.LOGIN_REQUEST,b),this._saveItem(this.CONSTANTS.STORAGE.LOGIN_ERROR,""),this._saveItem(this.CONSTANTS.STORAGE.STATE_LOGIN,a,!0),this._saveItem(this.CONSTANTS.STORAGE.NONCE_IDTOKEN,this._idTokenNonce,!0),this._saveItem(this.CONSTANTS.STORAGE.ERROR,""),this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION,"");var c=this._getNavigateUrl("id_token",null)+"&nonce="+encodeURIComponent(this._idTokenNonce);this.config.displayCall?this.config.displayCall(c):this.popUp?(this._saveItem(this.CONSTANTS.STORAGE.STATE_LOGIN,""),this._renewStates.push(a),this.registerCallback(a,this.config.clientId,this.callback),this._loginPopup(c)):this.promptUser(c)},AuthenticationContext.prototype._openPopup=function(a,b,c,d){try{var e=window.screenLeft?window.screenLeft:window.screenX,f=window.screenTop?window.screenTop:window.screenY,g=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,h=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,i=g/2-c/2+e,j=h/2-d/2+f,k=window.open(a,b,"width="+c+", height="+d+", top="+j+", left="+i);return k.focus&&k.focus(),k}catch(a){return this.warn("Error opening popup, "+a.message),this._loginInProgress=!1,this._acquireTokenInProgress=!1,null}},AuthenticationContext.prototype._handlePopupError=function(a,b,c,d,e){this.warn(d),this._saveItem(this.CONSTANTS.STORAGE.ERROR,c),this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION,d),this._saveItem(this.CONSTANTS.STORAGE.LOGIN_ERROR,e),b&&this._activeRenewals[b]&&(this._activeRenewals[b]=null),this._loginInProgress=!1,this._acquireTokenInProgress=!1,a&&a(d,null,c)},AuthenticationContext.prototype._loginPopup=function(a,b,c){var d=this._openPopup(a,"login",this.CONSTANTS.POPUP_WIDTH,this.CONSTANTS.POPUP_HEIGHT),e=c||this.callback;if(null==d){var f="Popup Window is null. This can happen if you are using IE";return void this._handlePopupError(e,b,"Error opening popup",f,f)}if(this._openedWindows.push(d),-1!=this.config.redirectUri.indexOf("#"))var g=this.config.redirectUri.split("#")[0];else var g=this.config.redirectUri;var h=this,i=window.setInterval(function(){if(!d||d.closed||void 0===d.closed){var a="Popup Window closed",c="Popup Window closed by UI action/ Popup Window handle destroyed due to cross zone navigation in IE/Edge";return h.isAngular&&h._broadcast("adal:popUpClosed",c+h.CONSTANTS.RESOURCE_DELIMETER+a),h._handlePopupError(e,b,a,c,c),void window.clearInterval(i)}try{var f=d.location;if(-1!=encodeURI(f.href).indexOf(encodeURI(g)))return h.isAngular?h._broadcast("adal:popUpHashChanged",f.hash):h.handleWindowCallback(f.hash),window.clearInterval(i),h._loginInProgress=!1,h._acquireTokenInProgress=!1,h.info("Closing popup window"),h._openedWindows=[],void d.close()}catch(a){}},1)},AuthenticationContext.prototype._broadcast=function(a,b){!function(){function a(a,b){b=b||{bubbles:!1,cancelable:!1,detail:void 0};var c=document.createEvent("CustomEvent");return c.initCustomEvent(a,b.bubbles,b.cancelable,b.detail),c}if("function"==typeof window.CustomEvent)return!1;a.prototype=window.Event.prototype,window.CustomEvent=a}();var c=new CustomEvent(a,{detail:b});window.dispatchEvent(c)},AuthenticationContext.prototype.loginInProgress=function(){return this._loginInProgress},AuthenticationContext.prototype._hasResource=function(a){var b=this._getItem(this.CONSTANTS.STORAGE.TOKEN_KEYS);return b&&!this._isEmpty(b)&&b.indexOf(a+this.CONSTANTS.RESOURCE_DELIMETER)>-1},AuthenticationContext.prototype.getCachedToken=function(a){if(!this._hasResource(a))return null;var b=this._getItem(this.CONSTANTS.STORAGE.ACCESS_TOKEN_KEY+a),c=this._getItem(this.CONSTANTS.STORAGE.EXPIRATION_KEY+a),d=this.config.expireOffsetSeconds||300;return c&&c>this._now()+d?b:(this._saveItem(this.CONSTANTS.STORAGE.ACCESS_TOKEN_KEY+a,""),this._saveItem(this.CONSTANTS.STORAGE.EXPIRATION_KEY+a,0),null)},AuthenticationContext.prototype.getCachedUser=function(){if(this._user)return this._user;var a=this._getItem(this.CONSTANTS.STORAGE.IDTOKEN);return this._user=this._createUser(a),this._user},AuthenticationContext.prototype.registerCallback=function(a,b,c){this._activeRenewals[b]=a,this._callBacksMappedToRenewStates[a]||(this._callBacksMappedToRenewStates[a]=[]);var d=this;this._callBacksMappedToRenewStates[a].push(c),this._callBackMappedToRenewStates[a]||(this._callBackMappedToRenewStates[a]=function(c,e,f,g){d._activeRenewals[b]=null;for(var h=0;h
-1)){var b=this._user.profile.upn.split("@");a+="&domain_hint="+encodeURIComponent(b[b.length-1])}return a},AuthenticationContext.prototype._createUser=function(a){var b=null,c=this._extractIdToken(a);return c&&c.hasOwnProperty("aud")&&(c.aud.toLowerCase()===this.config.clientId.toLowerCase()?(b={userName:"",profile:c},c.hasOwnProperty("upn")?b.userName=c.upn:c.hasOwnProperty("email")&&(b.userName=c.email)):this.warn("IdToken has invalid aud field")),b},AuthenticationContext.prototype._getHash=function(a){return a.indexOf("#/")>-1?a=a.substring(a.indexOf("#/")+2):a.indexOf("#")>-1&&(a=a.substring(1)),a},AuthenticationContext.prototype.isCallback=function(a){a=this._getHash(a);var b=this._deserialize(a);return b.hasOwnProperty(this.CONSTANTS.ERROR_DESCRIPTION)||b.hasOwnProperty(this.CONSTANTS.ACCESS_TOKEN)||b.hasOwnProperty(this.CONSTANTS.ID_TOKEN)},AuthenticationContext.prototype.getLoginError=function(){return this._getItem(this.CONSTANTS.STORAGE.LOGIN_ERROR)},AuthenticationContext.prototype.getRequestInfo=function(a){a=this._getHash(a);var b=this._deserialize(a),c={valid:!1,parameters:{},stateMatch:!1,stateResponse:"",requestType:this.REQUEST_TYPE.UNKNOWN};if(b&&(c.parameters=b,b.hasOwnProperty(this.CONSTANTS.ERROR_DESCRIPTION)||b.hasOwnProperty(this.CONSTANTS.ACCESS_TOKEN)||b.hasOwnProperty(this.CONSTANTS.ID_TOKEN))){c.valid=!0;var d="";if(!b.hasOwnProperty("state"))return this.warn("No state returned"),c;if(this.verbose("State: "+b.state),d=b.state,c.stateResponse=d,this._matchState(c))return c;if(!c.stateMatch&&window.parent){c.requestType=this._requestType;for(var e=this._renewStates,f=0;f-1&&b+1-1)return null;if(this.config&&this.config.endpoints)for(var c in this.config.endpoints)if(a.indexOf(c)>-1)return this.config.endpoints[c];return a.indexOf("http://")>-1||a.indexOf("https://")>-1?this._getHostFromUri(a)===this._getHostFromUri(this.config.redirectUri)?this.config.loginResource:null:this.config.loginResource},AuthenticationContext.prototype._getHostFromUri=function(a){var b=String(a).replace(/^(https?:)\/\//,"");return b=b.split("/")[0]},AuthenticationContext.prototype.handleWindowCallback=function(a){if(null==a&&(a=window.location.hash),this.isCallback(a)){var b=null,c=!1;this._openedWindows.length>0&&this._openedWindows[this._openedWindows.length-1].opener&&this._openedWindows[this._openedWindows.length-1].opener._adalInstance?(b=this._openedWindows[this._openedWindows.length-1].opener._adalInstance,c=!0):window.parent&&window.parent._adalInstance&&(b=window.parent._adalInstance);var d,e,f=b.getRequestInfo(a),g=null;e=c||window.parent!==window?b._callBackMappedToRenewStates[f.stateResponse]:b.callback,b.info("Returned from redirect url"),b.saveTokenFromHash(f),f.requestType===this.REQUEST_TYPE.RENEW_TOKEN&&window.parent?(window.parent!==window?b.verbose("Window is in iframe, acquiring token silently"):b.verbose("acquiring token interactive in progress"),d=f.parameters[b.CONSTANTS.ACCESS_TOKEN]||f.parameters[b.CONSTANTS.ID_TOKEN],g=b.CONSTANTS.ACCESS_TOKEN):f.requestType===this.REQUEST_TYPE.LOGIN&&(d=f.parameters[b.CONSTANTS.ID_TOKEN],g=b.CONSTANTS.ID_TOKEN);var h=f.parameters[b.CONSTANTS.ERROR_DESCRIPTION],i=f.parameters[b.CONSTANTS.ERROR];try{e&&e(h,d,i,g)}catch(a){b.error("Error occurred in user defined callback function: "+a)}window.parent!==window||c||(b.config.navigateToLoginRequestUrl?window.location.href=b._getItem(b.CONSTANTS.STORAGE.LOGIN_REQUEST):window.location.hash="")}},AuthenticationContext.prototype._getNavigateUrl=function(a,b){var c="common";this.config.tenant&&(c=this.config.tenant);var d=this.instance+c+"/oauth2/authorize"+this._serialize(a,this.config,b)+this._addLibMetadata();return this.info("Navigate url:"+d),d},AuthenticationContext.prototype._extractIdToken=function(a){var b=this._decodeJwt(a);if(!b)return null;try{var c=b.JWSPayload,d=this._base64DecodeStringUrlSafe(c);return d?JSON.parse(d):(this.info("The returned id_token could not be base64 url safe decoded."),null)}catch(a){this.error("The returned id_token could not be decoded",a)}return null},AuthenticationContext.prototype._base64DecodeStringUrlSafe=function(a){return a=a.replace(/-/g,"+").replace(/_/g,"/"),window.atob?decodeURIComponent(escape(window.atob(a))):decodeURIComponent(escape(this._decode(a)))},AuthenticationContext.prototype._decode=function(a){var b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";a=String(a).replace(/=+$/,"");var c=a.length;if(c%4==1)throw new Error("The token to be decoded is not correctly encoded.");for(var d,e,f,g,h,i,j,k,l="",m=0;m>16&255,j=h>>8&255,l+=String.fromCharCode(i,j);break}if(m+1===c-1){h=d<<18|e<<12,i=h>>16&255,l+=String.fromCharCode(i);break}h=d<<18|e<<12|f<<6|g,i=h>>16&255,j=h>>8&255,k=255&h,l+=String.fromCharCode(i,j,k)}return l},AuthenticationContext.prototype._decodeJwt=function(a){if(this._isEmpty(a))return null;var b=/^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/,c=b.exec(a);return!c||c.length<4?(this.warn("The returned id_token is not parseable."),null):{header:c[1],JWSPayload:c[2],JWSSig:c[3]}},AuthenticationContext.prototype._convertUrlSafeToRegularBase64EncodedString=function(a){return a.replace("-","+").replace("_","/")},AuthenticationContext.prototype._serialize=function(a,b,c){var d=[];if(null!==b){d.push("?response_type="+a),d.push("client_id="+encodeURIComponent(b.clientId)),c&&d.push("resource="+encodeURIComponent(c)),d.push("redirect_uri="+encodeURIComponent(b.redirectUri)),d.push("state="+encodeURIComponent(b.state)),b.hasOwnProperty("slice")&&d.push("slice="+encodeURIComponent(b.slice)),b.hasOwnProperty("extraQueryParameter")&&d.push(b.extraQueryParameter);var e=b.correlationId?b.correlationId:this._guid();d.push("client-request-id="+encodeURIComponent(e))}return d.join("&")},AuthenticationContext.prototype._deserialize=function(a){var b,c=/\+/g,d=/([^&=]+)=([^&]*)/g,e=function(a){return decodeURIComponent(a.replace(c," "))},f={};for(b=d.exec(a);b;)f[e(b[1])]=e(b[2]),b=d.exec(a);return f},AuthenticationContext.prototype._decimalToHex=function(a){for(var b=a.toString(16);b.length<2;)b="0"+b;return b},AuthenticationContext.prototype._guid=function(){var a=window.crypto||window.msCrypto;if(a&&a.getRandomValues){var b=new Uint8Array(16);return a.getRandomValues(b),b[6]|=64,b[6]&=79,b[8]|=128,b[8]&=191,this._decimalToHex(b[0])+this._decimalToHex(b[1])+this._decimalToHex(b[2])+this._decimalToHex(b[3])+"-"+this._decimalToHex(b[4])+this._decimalToHex(b[5])+"-"+this._decimalToHex(b[6])+this._decimalToHex(b[7])+"-"+this._decimalToHex(b[8])+this._decimalToHex(b[9])+"-"+this._decimalToHex(b[10])+this._decimalToHex(b[11])+this._decimalToHex(b[12])+this._decimalToHex(b[13])+this._decimalToHex(b[14])+this._decimalToHex(b[15])}for(var c="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx",d="0123456789abcdef",e=0,f="",g=0;g<36;g++)"-"!==c[g]&&"4"!==c[g]&&(e=16*Math.random()|0),"x"===c[g]?f+=d[e]:"y"===c[g]?(e&=3,e|=8,f+=d[e]):f+=c[g];return f},AuthenticationContext.prototype._expiresIn=function(a){return a||(a=3599),this._now()+parseInt(a,10)},AuthenticationContext.prototype._now=function(){return Math.round((new Date).getTime()/1e3)},AuthenticationContext.prototype._addAdalFrame=function(a){if(void 0!==a){this.info("Add adal frame to document:"+a);var b=document.getElementById(a);if(!b){if(document.createElement&&document.documentElement&&(window.opera||-1===window.navigator.userAgent.indexOf("MSIE 5.0"))){var c=document.createElement("iframe");c.setAttribute("id",a),c.setAttribute("aria-hidden","true"),c.style.visibility="hidden",c.style.position="absolute",c.style.width=c.style.height=c.borderWidth="0px",b=document.getElementsByTagName("body")[0].appendChild(c)}else document.body&&document.body.insertAdjacentHTML&&document.body.insertAdjacentHTML("beforeEnd",'');window.frames&&window.frames[a]&&(b=window.frames[a])}return b}},AuthenticationContext.prototype._saveItem=function(a,b,c){if(this.config&&this.config.cacheLocation&&"localStorage"===this.config.cacheLocation){if(!this._supportsLocalStorage())return this.info("Local storage is not supported"),!1;if(c){var d=this._getItem(a)||"";localStorage.setItem(a,d+b+this.CONSTANTS.CACHE_DELIMETER)}else localStorage.setItem(a,b);return!0}return this._supportsSessionStorage()?(sessionStorage.setItem(a,b),!0):(this.info("Session storage is not supported"),!1)},AuthenticationContext.prototype._getItem=function(a){return this.config&&this.config.cacheLocation&&"localStorage"===this.config.cacheLocation?this._supportsLocalStorage()?localStorage.getItem(a):(this.info("Local storage is not supported"),null):this._supportsSessionStorage()?sessionStorage.getItem(a):(this.info("Session storage is not supported"),null)},AuthenticationContext.prototype._supportsLocalStorage=function(){try{return!!window.localStorage&&(window.localStorage.setItem("storageTest","A"),"A"==window.localStorage.getItem("storageTest")&&(window.localStorage.removeItem("storageTest"),!window.localStorage.getItem("storageTest")))}catch(a){return!1}},AuthenticationContext.prototype._supportsSessionStorage=function(){try{return!!window.sessionStorage&&(window.sessionStorage.setItem("storageTest","A"),"A"==window.sessionStorage.getItem("storageTest")&&(window.sessionStorage.removeItem("storageTest"),!window.sessionStorage.getItem("storageTest")))}catch(a){return!1}},AuthenticationContext.prototype._cloneConfig=function(a){if(null===a||"object"!=typeof a)return a;var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b},AuthenticationContext.prototype._addLibMetadata=function(){return"&x-client-SKU=Js&x-client-Ver="+this._libVersion()},AuthenticationContext.prototype.log=function(a,b,c,d){if(a<=Logging.level){if(!Logging.piiLoggingEnabled&&d)return;var e=(new Date).toUTCString(),f="";f=this.config.correlationId?e+":"+this.config.correlationId+"-"+this._libVersion()+"-"+this.CONSTANTS.LEVEL_STRING_MAP[a]+" "+b:e+":"+this._libVersion()+"-"+this.CONSTANTS.LEVEL_STRING_MAP[a]+" "+b,c&&(f+="\nstack:\n"+c.stack),Logging.log(f)}},AuthenticationContext.prototype.error=function(a,b){this.log(this.CONSTANTS.LOGGING_LEVEL.ERROR,a,b)},AuthenticationContext.prototype.warn=function(a){this.log(this.CONSTANTS.LOGGING_LEVEL.WARN,a,null)},AuthenticationContext.prototype.info=function(a){
this.log(this.CONSTANTS.LOGGING_LEVEL.INFO,a,null)},AuthenticationContext.prototype.verbose=function(a){this.log(this.CONSTANTS.LOGGING_LEVEL.VERBOSE,a,null)},AuthenticationContext.prototype.errorPii=function(a,b){this.log(this.CONSTANTS.LOGGING_LEVEL.ERROR,a,b,!0)},AuthenticationContext.prototype.warnPii=function(a){this.log(this.CONSTANTS.LOGGING_LEVEL.WARN,a,null,!0)},AuthenticationContext.prototype.infoPii=function(a){this.log(this.CONSTANTS.LOGGING_LEVEL.INFO,a,null,!0)},AuthenticationContext.prototype.verbosePii=function(a){this.log(this.CONSTANTS.LOGGING_LEVEL.VERBOSE,a,null,!0)},AuthenticationContext.prototype._libVersion=function(){return"1.0.17"},"undefined"!=typeof module&&module.exports&&(module.exports=AuthenticationContext,module.exports.inject=function(a){return new AuthenticationContext(a)}),AuthenticationContext}();
/***/ }),
/* 16 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return StringMatchOption; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ChangedItemType; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return ChangedOperationType; });
var StringMatchOption;
(function (StringMatchOption) {
StringMatchOption[StringMatchOption["StartsWith"] = 0] = "StartsWith";
StringMatchOption[StringMatchOption["ExactMatch"] = 1] = "ExactMatch";
})(StringMatchOption || (StringMatchOption = {}));
var ChangedItemType;
(function (ChangedItemType) {
ChangedItemType[ChangedItemType["Unknown"] = 0] = "Unknown";
ChangedItemType[ChangedItemType["Term"] = 1] = "Term";
ChangedItemType[ChangedItemType["TermSet"] = 2] = "TermSet";
ChangedItemType[ChangedItemType["Group"] = 3] = "Group";
ChangedItemType[ChangedItemType["TermStore"] = 4] = "TermStore";
ChangedItemType[ChangedItemType["Site"] = 5] = "Site";
})(ChangedItemType || (ChangedItemType = {}));
var ChangedOperationType;
(function (ChangedOperationType) {
ChangedOperationType[ChangedOperationType["Unknown"] = 0] = "Unknown";
ChangedOperationType[ChangedOperationType["Add"] = 1] = "Add";
ChangedOperationType[ChangedOperationType["Edit"] = 2] = "Edit";
ChangedOperationType[ChangedOperationType["DeleteObject"] = 3] = "DeleteObject";
ChangedOperationType[ChangedOperationType["Move"] = 4] = "Move";
ChangedOperationType[ChangedOperationType["Copy"] = 5] = "Copy";
ChangedOperationType[ChangedOperationType["PathChange"] = 6] = "PathChange";
ChangedOperationType[ChangedOperationType["Merge"] = 7] = "Merge";
ChangedOperationType[ChangedOperationType["ImportObject"] = 8] = "ImportObject";
ChangedOperationType[ChangedOperationType["Restore"] = 9] = "Restore";
})(ChangedOperationType || (ChangedOperationType = {}));
//# sourceMappingURL=types.js.map
/***/ })
/******/ ]);
});
//# sourceMappingURL=sp-taxonomy.es5.umd.bundle.js.map