diff --git a/dist/pnp-global-shim.d.ts b/dist/pnp-global-shim.d.ts new file mode 100644 index 00000000..f6bae7e8 --- /dev/null +++ b/dist/pnp-global-shim.d.ts @@ -0,0 +1,3 @@ +/// +export * from "pnp"; +export as namespace $pnp; \ No newline at end of file diff --git a/dist/pnp.d.ts b/dist/pnp.d.ts new file mode 100644 index 00000000..7976ecb8 --- /dev/null +++ b/dist/pnp.d.ts @@ -0,0 +1,5708 @@ +declare module "collections/collections" { + /** + * Interface defining an object with a known property type + */ + export interface TypedHash { + [key: string]: T; + } + /** + * Generic dictionary + */ + export class Dictionary { + private keys; + private values; + /** + * Creates a new instance of the Dictionary class + * + * @constructor + */ + constructor(keys?: string[], values?: T[]); + /** + * Gets a value from the collection using the specified key + * + * @param key The key whose value we want to return, returns null if the key does not exist + */ + get(key: string): T; + /** + * Adds the supplied key and value to the dictionary + * + * @param key The key to add + * @param o The value to add + */ + add(key: string, o: T): void; + /** + * Merges the supplied typed hash into this dictionary instance. Existing values are updated and new ones are created as appropriate. + */ + merge(source: TypedHash | Dictionary): void; + /** + * Removes a value from the dictionary + * + * @param key The key of the key/value pair to remove. Returns null if the key was not found. + */ + remove(key: string): T; + /** + * Returns all the keys currently in the dictionary as an array + */ + getKeys(): string[]; + /** + * Returns all the values currently in the dictionary as an array + */ + getValues(): T[]; + /** + * Clears the current dictionary + */ + clear(): void; + /** + * Gets a count of the items currently in the dictionary + */ + count(): number; + } +} +declare module "utils/logging" { + /** + * A set of logging levels + * + */ + export enum LogLevel { + Verbose = 0, + Info = 1, + Warning = 2, + Error = 3, + Off = 99, + } + /** + * Interface that defines a log entry + * + */ + export interface LogEntry { + /** + * The main message to be logged + */ + message: string; + /** + * The level of information this message represents + */ + level: LogLevel; + /** + * Any associated data that a given logging listener may choose to log or ignore + */ + data?: any; + } + /** + * Interface that defines a log listner + * + */ + export interface LogListener { + /** + * Any associated data that a given logging listener may choose to log or ignore + * + * @param entry The information to be logged + */ + log(entry: LogEntry): void; + } + /** + * Class used to subscribe ILogListener and log messages throughout an application + * + */ + export class Logger { + private static _instance; + static activeLogLevel: LogLevel; + private static readonly instance; + /** + * Adds ILogListener instances to the set of subscribed listeners + * + * @param listeners One or more listeners to subscribe to this log + */ + static subscribe(...listeners: LogListener[]): void; + /** + * Clears the subscribers collection, returning the collection before modifiction + */ + static clearSubscribers(): LogListener[]; + /** + * Gets the current subscriber count + */ + static readonly count: number; + /** + * Writes the supplied string to the subscribed listeners + * + * @param message The message to write + * @param level [Optional] if supplied will be used as the level of the entry (Default: LogLevel.Verbose) + */ + static write(message: string, level?: LogLevel): void; + /** + * Writes the supplied string to the subscribed listeners + * + * @param json The json object to stringify and write + * @param level [Optional] if supplied will be used as the level of the entry (Default: LogLevel.Verbose) + */ + static writeJSON(json: any, level?: LogLevel): void; + /** + * Logs the supplied entry to the subscribed listeners + * + * @param entry The message to log + */ + static log(entry: LogEntry): void; + /** + * Logs performance tracking data for the the execution duration of the supplied function using console.profile + * + * @param name The name of this profile boundary + * @param f The function to execute and track within this performance boundary + */ + static measure(name: string, f: () => T): T; + } + /** + * Implementation of ILogListener which logs to the browser console + * + */ + export class ConsoleListener implements LogListener { + /** + * Any associated data that a given logging listener may choose to log or ignore + * + * @param entry The information to be logged + */ + log(entry: LogEntry): void; + /** + * Formats the message + * + * @param entry The information to format into a string + */ + private format(entry); + } + /** + * Implementation of ILogListener which logs to the supplied function + * + */ + export class FunctionListener implements LogListener { + private method; + /** + * Creates a new instance of the FunctionListener class + * + * @constructor + * @param method The method to which any logging data will be passed + */ + constructor(method: (entry: LogEntry) => void); + /** + * Any associated data that a given logging listener may choose to log or ignore + * + * @param entry The information to be logged + */ + log(entry: LogEntry): void; + } +} +declare module "utils/decorators" { + export function deprecated(message: string): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void; +} +declare module "utils/storage" { + /** + * A wrapper class to provide a consistent interface to browser based storage + * + */ + export class PnPClientStorageWrapper implements PnPClientStore { + private store; + defaultTimeoutMinutes: number; + /** + * True if the wrapped storage is available; otherwise, false + */ + enabled: boolean; + /** + * Creates a new instance of the PnPClientStorageWrapper class + * + * @constructor + */ + constructor(store: Storage, defaultTimeoutMinutes?: number); + /** + * Get a value from storage, or null if that value does not exist + * + * @param key The key whose value we want to retrieve + */ + get(key: string): T; + /** + * Adds a value to the underlying storage + * + * @param key The key to use when storing the provided value + * @param o The value to store + * @param expire Optional, if provided the expiration of the item, otherwise the default is used + */ + put(key: string, o: any, expire?: Date): void; + /** + * Deletes a value from the underlying storage + * + * @param key The key of the pair we want to remove from storage + */ + delete(key: string): void; + /** + * Gets an item from the underlying storage, or adds it if it does not exist using the supplied getter function + * + * @param key The key to use when storing the provided value + * @param getter A function which will upon execution provide the desired value + * @param expire Optional, if provided the expiration of the item, otherwise the default is used + */ + getOrPut(key: string, getter: () => Promise, expire?: Date): Promise; + /** + * Used to determine if the wrapped storage is available currently + */ + private test(); + /** + * Creates the persistable to store + */ + private createPersistable(o, expire?); + } + /** + * Interface which defines the operations provided by a client storage object + */ + export interface PnPClientStore { + /** + * True if the wrapped storage is available; otherwise, false + */ + enabled: boolean; + /** + * Get a value from storage, or null if that value does not exist + * + * @param key The key whose value we want to retrieve + */ + get(key: string): any; + /** + * Adds a value to the underlying storage + * + * @param key The key to use when storing the provided value + * @param o The value to store + * @param expire Optional, if provided the expiration of the item, otherwise the default is used + */ + put(key: string, o: any, expire?: Date): void; + /** + * Deletes a value from the underlying storage + * + * @param key The key of the pair we want to remove from storage + */ + delete(key: string): void; + /** + * Gets an item from the underlying storage, or adds it if it does not exist using the supplied getter function + * + * @param key The key to use when storing the provided value + * @param getter A function which will upon execution provide the desired value + * @param expire Optional, if provided the expiration of the item, otherwise the default is used + */ + getOrPut(key: string, getter: Function, expire?: Date): any; + } + /** + * A class that will establish wrappers for both local and session storage + */ + export class PnPClientStorage { + /** + * Provides access to the local storage of the browser + */ + local: PnPClientStore; + /** + * Provides access to the session storage of the browser + */ + session: PnPClientStore; + /** + * Creates a new instance of the PnPClientStorage class + * + * @constructor + */ + constructor(); + } +} +declare module "sharepoint/caching" { + import { ODataParser } from "sharepoint/odata"; + import { PnPClientStore, PnPClientStorage } from "utils/storage"; + export interface ICachingOptions { + expiration?: Date; + storeName?: "session" | "local"; + key: string; + } + export class CachingOptions implements ICachingOptions { + key: string; + protected static storage: PnPClientStorage; + expiration: Date; + storeName: "session" | "local"; + constructor(key: string); + readonly store: PnPClientStore; + } + export class CachingParserWrapper implements ODataParser { + private _parser; + private _cacheOptions; + constructor(_parser: ODataParser, _cacheOptions: CachingOptions); + parse(response: Response): Promise; + } +} +declare module "utils/exceptions" { + /** + * Represents an exception with an HttpClient request + * + */ + export class ProcessHttpClientResponseException extends Error { + readonly status: number; + readonly statusText: string; + readonly data: any; + constructor(status: number, statusText: string, data: any); + } + export class NoCacheAvailableException extends Error { + constructor(msg?: string); + } + export class APIUrlException extends Error { + constructor(msg?: string); + } + export class AuthUrlException extends Error { + constructor(data: any, msg?: string); + } + export class NodeFetchClientUnsupportedException extends Error { + constructor(msg?: string); + } + export class SPRequestExecutorUndefinedException extends Error { + constructor(); + } + export class MaxCommentLengthException extends Error { + constructor(msg?: string); + } + export class NotSupportedInBatchException extends Error { + constructor(operation?: string); + } + export class ODataIdException extends Error { + constructor(data: any, msg?: string); + } + export class BatchParseException extends Error { + constructor(msg: string); + } + export class AlreadyInBatchException extends Error { + constructor(msg?: string); + } + export class FunctionExpectedException extends Error { + constructor(msg?: string); + } + export class UrlException extends Error { + constructor(msg: string); + } +} +declare module "sharepoint/queryablerequest" { + import { ODataParser, ODataBatch } from "sharepoint/odata"; + import { ICachingOptions } from "sharepoint/caching"; + import { FetchOptions } from "net/httpclient"; + /** + * Defines the context for a given request to be processed in the pipeline + */ + export interface RequestContext { + batch: ODataBatch; + batchDependency: () => void; + cachingOptions: ICachingOptions; + isBatched: boolean; + isCached: boolean; + requestAbsoluteUrl: string; + verb: string; + options: FetchOptions; + parser: ODataParser; + hasResult?: boolean; + result?: T; + requestId: string; + } + /** + * Processes a given context through the request pipeline + * + * @param context The request context we are processing + */ + export function pipe(context: RequestContext): Promise; +} +declare module "sharepoint/queryable" { + import { Dictionary } from "collections/collections"; + import { FetchOptions } from "net/httpclient"; + import { ODataParser, ODataBatch } from "sharepoint/odata"; + import { ICachingOptions } from "sharepoint/caching"; + export interface QueryableConstructor { + new (baseUrl: string | Queryable, path?: string): T; + } + /** + * Queryable Base Class + * + */ + export class Queryable { + /** + * Tracks the query parts of the url + */ + protected _query: Dictionary; + /** + * Tracks the batch of which this query may be part + */ + private _batch; + /** + * Tracks the url as it is built + */ + private _url; + /** + * Stores the parent url used to create this instance, for recursing back up the tree if needed + */ + private _parentUrl; + /** + * Explicitly tracks if we are using caching for this request + */ + private _useCaching; + /** + * Any options that were supplied when caching was enabled + */ + private _cachingOptions; + /** + * Directly concatonates the supplied string to the current url, not normalizing "/" chars + * + * @param pathPart The string to concatonate to the url + */ + concat(pathPart: string): void; + /** + * Appends the given string and normalizes "/" chars + * + * @param pathPart The string to append + */ + protected append(pathPart: string): void; + /** + * Blocks a batch call from occuring, MUST be cleared by calling the returned function + */ + protected addBatchDependency(): () => void; + /** + * Indicates if the current query has a batch associated + * + */ + protected readonly hasBatch: boolean; + /** + * The batch currently associated with this query or null + * + */ + protected readonly batch: ODataBatch; + /** + * Gets the parent url used when creating this instance + * + */ + protected readonly parentUrl: string; + /** + * Provides access to the query builder for this url + * + */ + readonly query: Dictionary; + /** + * Creates a new instance of the Queryable class + * + * @constructor + * @param baseUrl A string or Queryable that should form the base part of the url + * + */ + constructor(baseUrl: string | Queryable, path?: string); + /** + * Creates a new instance of the supplied factory and extends this into that new instance + * + * @param factory constructor for the new queryable + */ + as(factory: QueryableConstructor): T; + /** + * Adds this query to the supplied batch + * + * @example + * ``` + * + * let b = pnp.sp.createBatch(); + * pnp.sp.web.inBatch(b).get().then(...); + * b.execute().then(...) + * ``` + */ + inBatch(batch: ODataBatch): this; + /** + * Enables caching for this request + * + * @param options Defines the options used when caching this request + */ + usingCaching(options?: ICachingOptions): this; + /** + * Gets the currentl url, made absolute based on the availability of the _spPageContextInfo object + * + */ + toUrl(): string; + /** + * Gets the full url with query information + * + */ + toUrlAndQuery(): string; + /** + * Gets a parent for this instance as specified + * + * @param factory The contructor for the class to create + */ + protected getParent(factory: QueryableConstructor, baseUrl?: string | Queryable, path?: string, batch?: ODataBatch): T; + /** + * Clones this queryable into a new queryable instance of T + * @param factory Constructor used to create the new instance + * @param additionalPath Any additional path to include in the clone + * @param includeBatch If true this instance's batch will be added to the cloned instance + */ + protected clone(factory: QueryableConstructor, additionalPath?: string, includeBatch?: boolean): T; + /** + * 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 + */ + get(parser?: ODataParser, getOptions?: FetchOptions): Promise; + getAs(parser?: ODataParser, getOptions?: FetchOptions): Promise; + protected post(postOptions?: FetchOptions, parser?: ODataParser): Promise; + protected postAs(postOptions?: FetchOptions, parser?: ODataParser): Promise; + protected patch(patchOptions?: FetchOptions, parser?: ODataParser): Promise; + protected delete(deleteOptions?: FetchOptions, parser?: ODataParser): Promise; + private toRequestContext(verb, options, parser); + } + /** + * Represents a REST collection which can be filtered, paged, and selected + * + */ + export class QueryableCollection extends Queryable { + /** + * Filters the returned collection (https://msdn.microsoft.com/en-us/library/office/fp142385.aspx#bk_supported) + * + * @param filter The string representing the filter query + */ + filter(filter: string): this; + /** + * Choose which fields to return + * + * @param selects One or more fields to return + */ + select(...selects: string[]): this; + /** + * Expands fields such as lookups to get additional data + * + * @param expands The Fields for which to expand the values + */ + expand(...expands: string[]): this; + /** + * Orders based on the supplied fields ascending + * + * @param orderby The name of the field to sort on + * @param ascending If false DESC is appended, otherwise ASC (default) + */ + orderBy(orderBy: string, ascending?: boolean): this; + /** + * Skips the specified number of items + * + * @param skip The number of items to skip + */ + skip(skip: number): this; + /** + * Limits the query to only return the specified number of items + * + * @param top The query row limit + */ + top(top: number): this; + } + /** + * Represents an instance that can be selected + * + */ + export class QueryableInstance extends Queryable { + /** + * Choose which fields to return + * + * @param selects One or more fields to return + */ + select(...selects: string[]): this; + /** + * Expands fields such as lookups to get additional data + * + * @param expands The Fields for which to expand the values + */ + expand(...expands: string[]): this; + } +} +declare module "sharepoint/odata" { + import { QueryableConstructor } from "sharepoint/queryable"; + export function extractOdataId(candidate: any): string; + export interface ODataParser { + parse(r: Response): Promise; + } + export abstract class ODataParserBase implements ODataParser { + parse(r: Response): Promise; + protected handleError(r: Response, reject: (reason?: any) => void): boolean; + protected parseODataJSON(json: any): U; + } + export class ODataDefaultParser extends ODataParserBase { + } + export class ODataRawParserImpl implements ODataParser { + parse(r: Response): Promise; + } + export function getEntityUrl(entity: any): string; + export let ODataRaw: ODataRawParserImpl; + export function ODataValue(): ODataParser; + export function ODataEntity(factory: QueryableConstructor): ODataParser; + export function ODataEntityArray(factory: QueryableConstructor): ODataParser; + /** + * Manages a batch of OData operations + */ + export class ODataBatch { + private baseUrl; + private _batchId; + private _dependencies; + private _requests; + constructor(baseUrl: string, _batchId?: string); + /** + * Adds a request to a batch (not designed for public use) + * + * @param url The full url of the request + * @param method The http method GET, POST, etc + * @param options Any options to include in the request + * @param parser The parser that will hadle the results of the request + */ + add(url: string, method: string, options: any, parser: ODataParser): Promise; + /** + * 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 + */ + addDependency(): () => void; + /** + * 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 + */ + execute(): Promise; + private executeImpl(); + /** + * Parses the response from a batch request into an array of Response instances + * + * @param body Text body of the response from the batch request + */ + private _parseResponse(body); + } + export class TextFileParser implements ODataParser { + parse(r: Response): Promise; + } + export class BlobFileParser implements ODataParser { + parse(r: Response): Promise; + } + export class JSONFileParser implements ODataParser { + parse(r: Response): Promise; + } + export class BufferFileParser implements ODataParser { + parse(r: any): Promise; + } +} +declare module "net/digestcache" { + import { Dictionary } from "collections/collections"; + import { HttpClient } from "net/httpclient"; + export class CachedDigest { + expiration: Date; + value: string; + } + export class DigestCache { + private _httpClient; + private _digests; + constructor(_httpClient: HttpClient, _digests?: Dictionary); + getDigest(webUrl: string): Promise; + clear(): void; + } +} +declare module "net/httpclient" { + export interface FetchOptions { + method?: string; + headers?: string[][] | { + [key: string]: string; + }; + body?: any; + mode?: "navigate" | "same-origin" | "no-cors" | "cors"; + credentials?: "omit" | "same-origin" | "include"; + cache?: "default" | "no-store" | "reload" | "no-cache" | "force-cache" | "only-if-cached"; + } + export class HttpClient { + private _digestCache; + private _impl; + constructor(); + fetch(url: string, options?: FetchOptions): Promise; + fetchRaw(url: string, options?: FetchOptions): Promise; + get(url: string, options?: FetchOptions): Promise; + post(url: string, options?: FetchOptions): Promise; + patch(url: string, options?: FetchOptions): Promise; + delete(url: string, options?: FetchOptions): Promise; + private mergeHeaders(target, source); + } + export interface HttpClientImpl { + fetch(url: string, options: FetchOptions): Promise; + } +} +declare module "net/fetchclient" { + import { HttpClientImpl } from "net/httpclient"; + /** + * Makes requests using the fetch API + */ + export class FetchClient implements HttpClientImpl { + fetch(url: string, options: any): Promise; + } +} +declare module "configuration/pnplibconfig" { + import { TypedHash } from "collections/collections"; + import { HttpClientImpl } from "net/httpclient"; + export interface LibraryConfiguration { + /** + * Any headers to apply to all requests + */ + headers?: TypedHash; + /** + * Allows caching to be global disabled, default: false + */ + globalCacheDisable?: boolean; + /** + * Defines the default store used by the usingCaching method, default: session + */ + defaultCachingStore?: "session" | "local"; + /** + * Defines the default timeout in seconds used by the usingCaching method, default 30 + */ + defaultCachingTimeoutSeconds?: number; + /** + * Defines a factory method used to create fetch clients + */ + fetchClientFactory?: () => HttpClientImpl; + /** + * The base url used for all requests + */ + baseUrl?: string; + /** + * Used to supply the current context from an SPFx webpart to the library + */ + spfxContext?: any; + } + export class RuntimeConfigImpl { + private _headers; + private _defaultCachingStore; + private _defaultCachingTimeoutSeconds; + private _globalCacheDisable; + private _fetchClientFactory; + private _baseUrl; + private _spfxContext; + constructor(); + set(config: LibraryConfiguration): void; + readonly headers: TypedHash; + readonly defaultCachingStore: "session" | "local"; + readonly defaultCachingTimeoutSeconds: number; + readonly globalCacheDisable: boolean; + readonly fetchClientFactory: () => HttpClientImpl; + readonly baseUrl: string; + } + export let RuntimeConfig: RuntimeConfigImpl; + export function setRuntimeConfig(config: LibraryConfiguration): void; +} +declare module "utils/util" { + import { TypedHash } from "collections/collections"; + export class Util { + /** + * Gets a callback function which will maintain context across async calls. + * Allows for the calling pattern getCtxCallback(thisobj, method, methodarg1, methodarg2, ...) + * + * @param context The object that will be the 'this' value in the callback + * @param method The method to which we will apply the context and parameters + * @param params Optional, additional arguments to supply to the wrapped method when it is invoked + */ + static getCtxCallback(context: any, method: Function, ...params: any[]): Function; + /** + * Tests if a url param exists + * + * @param name The name of the url paramter to check + */ + static urlParamExists(name: string): boolean; + /** + * Gets a url param value by name + * + * @param name The name of the paramter for which we want the value + */ + static getUrlParamByName(name: string): string; + /** + * Gets a url param by name and attempts to parse a bool value + * + * @param name The name of the paramter for which we want the boolean value + */ + static getUrlParamBoolByName(name: string): boolean; + /** + * Inserts the string s into the string target as the index specified by index + * + * @param target The string into which we will insert s + * @param index The location in target to insert s (zero based) + * @param s The string to insert into target at position index + */ + static stringInsert(target: string, index: number, s: string): string; + /** + * Adds a value to a date + * + * @param date The date to which we will add units, done in local time + * @param interval The name of the interval to add, one of: ['year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second'] + * @param units The amount to add to date of the given interval + * + * http://stackoverflow.com/questions/1197928/how-to-add-30-minutes-to-a-javascript-date-object + */ + static dateAdd(date: Date, interval: string, units: number): Date; + /** + * Loads a stylesheet into the current page + * + * @param path The url to the stylesheet + * @param avoidCache If true a value will be appended as a query string to avoid browser caching issues + */ + static loadStylesheet(path: string, avoidCache: boolean): void; + /** + * Combines an arbitrary set of paths ensuring that the slashes are normalized + * + * @param paths 0 to n path parts to combine + */ + static combinePaths(...paths: string[]): string; + /** + * Gets a random string of chars length + * + * @param chars The length of the random string to generate + */ + static getRandomString(chars: number): string; + /** + * Gets a random GUID value + * + * http://stackoverflow.com/questions/105034/create-guid-uuid-in-javascript + */ + static getGUID(): string; + /** + * Determines if a given value is a function + * + * @param candidateFunction The thing to test for being a function + */ + static isFunction(candidateFunction: any): boolean; + /** + * @returns whether the provided parameter is a JavaScript Array or not. + */ + static isArray(array: any): boolean; + /** + * Determines if a string is null or empty or undefined + * + * @param s The string to test + */ + static stringIsNullOrEmpty(s: string): boolean; + /** + * Provides functionality to extend the given object by doing a shallow copy + * + * @param target The object to which properties will be copied + * @param source The source object from which properties will be copied + * @param noOverwrite If true existing properties on the target are not overwritten from the source + * + */ + static extend(target: any, source: TypedHash, noOverwrite?: boolean): any; + /** + * Determines if a given url is absolute + * + * @param url The url to check to see if it is absolute + */ + static isUrlAbsolute(url: string): boolean; + /** + * Attempts to make the supplied relative url absolute based on the _spPageContextInfo object, if available + * + * @param url The relative url to make absolute + */ + static makeUrlAbsolute(url: string): string; + /** + * Ensures that a given url is absolute for the current web based on context + * + * @param candidateUrl The url to make absolute + * + */ + static toAbsoluteUrl(candidateUrl: string): Promise; + } +} +declare module "configuration/configuration" { + import { TypedHash } from "collections/collections"; + /** + * Interface for configuration providers + * + */ + export interface IConfigurationProvider { + /** + * Gets the configuration from the provider + */ + getConfiguration(): Promise>; + } + /** + * Class used to manage the current application settings + * + */ + export class Settings { + /** + * The settings currently stored in this instance + */ + private _settings; + /** + * Creates a new instance of the settings class + * + * @constructor + */ + constructor(); + /** + * Adds a new single setting, or overwrites a previous setting with the same key + * + * @param {string} key The key used to store this setting + * @param {string} value The setting value to store + */ + add(key: string, value: string): void; + /** + * Adds a JSON value to the collection as a string, you must use getJSON to rehydrate the object when read + * + * @param {string} key The key used to store this setting + * @param {any} value The setting value to store + */ + addJSON(key: string, value: any): void; + /** + * Applies the supplied hash to the setting collection overwriting any existing value, or created new values + * + * @param {TypedHash} hash The set of values to add + */ + apply(hash: TypedHash): Promise; + /** + * Loads configuration settings into the collection from the supplied provider and returns a Promise + * + * @param {IConfigurationProvider} provider The provider from which we will load the settings + */ + load(provider: IConfigurationProvider): Promise; + /** + * Gets a value from the configuration + * + * @param {string} key The key whose value we want to return. Returns null if the key does not exist + * @return {string} string value from the configuration + */ + get(key: string): string; + /** + * Gets a JSON value, rehydrating the stored string to the original object + * + * @param {string} key The key whose value we want to return. Returns null if the key does not exist + * @return {any} object from the configuration + */ + getJSON(key: string): any; + } +} +declare module "sharepoint/search" { + import { Queryable, QueryableInstance } from "sharepoint/queryable"; + /** + * Describes the SearchQuery interface + */ + export interface SearchQuery { + /** + * A string that contains the text for the search query. + */ + Querytext: string; + /** + * A string that contains the text that replaces the query text, as part of a query transform. + */ + QueryTemplate?: string; + /** + * A Boolean value that specifies whether the result tables that are returned for + * the result block are mixed with the result tables that are returned for the original query. + */ + EnableInterleaving?: boolean; + /** + * A Boolean value that specifies whether stemming is enabled. + */ + EnableStemming?: boolean; + /** + * A Boolean value that specifies whether duplicate items are removed from the results. + */ + TrimDuplicates?: boolean; + /** + * A Boolean value that specifies whether the exact terms in the search query are used to find matches, or if nicknames are used also. + */ + EnableNicknames?: boolean; + /** + * A Boolean value that specifies whether the query uses the FAST Query Language (FQL). + */ + EnableFql?: boolean; + /** + * A Boolean value that specifies whether the phonetic forms of the query terms are used to find matches. + */ + EnablePhonetic?: boolean; + /** + * A Boolean value that specifies whether to perform result type processing for the query. + */ + BypassResultTypes?: boolean; + /** + * A Boolean value that specifies whether to return best bet results for the query. + * This parameter is used only when EnableQueryRules is set to true, otherwise it is ignored. + */ + ProcessBestBets?: boolean; + /** + * A Boolean value that specifies whether to enable query rules for the query. + */ + EnableQueryRules?: boolean; + /** + * A Boolean value that specifies whether to sort search results. + */ + EnableSorting?: boolean; + /** + * Specifies whether to return block rank log information in the BlockRankLog property of the interleaved result table. + * A block rank log contains the textual information on the block score and the documents that were de-duplicated. + */ + GenerateBlockRankLog?: boolean; + /** + * The result source ID to use for executing the search query. + */ + SourceId?: string; + /** + * The ID of the ranking model to use for the query. + */ + RankingModelId?: string; + /** + * The first row that is included in the search results that are returned. + * You use this parameter when you want to implement paging for search results. + */ + StartRow?: number; + /** + * The maximum number of rows overall that are returned in the search results. + * Compared to RowsPerPage, RowLimit is the maximum number of rows returned overall. + */ + RowLimit?: number; + /** + * The maximum number of rows to return per page. + * Compared to RowLimit, RowsPerPage refers to the maximum number of rows to return per page, + * and is used primarily when you want to implement paging for search results. + */ + RowsPerPage?: number; + /** + * The managed properties to return in the search results. + */ + SelectProperties?: string[]; + /** + * The locale ID (LCID) for the query. + */ + Culture?: number; + /** + * The set of refinement filters used when issuing a refinement query (FQL) + */ + RefinementFilters?: string[]; + /** + * The set of refiners to return in a search result. + */ + Refiners?: string; + /** + * The additional query terms to append to the query. + */ + HiddenConstraints?: string; + /** + * The list of properties by which the search results are ordered. + */ + SortList?: Sort[]; + /** + * The amount of time in milliseconds before the query request times out. + */ + Timeout?: number; + /** + * The properties to highlight in the search result summary when the property value matches the search terms entered by the user. + */ + HithighlightedProperties?: string[]; + /** + * The type of the client that issued the query. + */ + ClientType?: string; + /** + * The GUID for the user who submitted the search query. + */ + PersonalizationData?: string; + /** + * The URL for the search results page. + */ + ResultsURL?: string; + /** + * Custom tags that identify the query. You can specify multiple query tags + */ + QueryTag?: string[]; + /** + * Properties to be used to configure the search query + */ + Properties?: SearchProperty[]; + /** + * A Boolean value that specifies whether to return personal favorites with the search results. + */ + ProcessPersonalFavorites?: boolean; + /** + * The location of the queryparametertemplate.xml file. This file is used to enable anonymous users to make Search REST queries. + */ + QueryTemplatePropertiesUrl?: string; + /** + * Special rules for reordering search results. + * These rules can specify that documents matching certain conditions are ranked higher or lower in the results. + * This property applies only when search results are sorted based on rank. + */ + ReorderingRules?: ReorderingRule[]; + /** + * The number of properties to show hit highlighting for in the search results. + */ + HitHighlightedMultivaluePropertyLimit?: number; + /** + * A Boolean value that specifies whether the hit highlighted properties can be ordered. + */ + EnableOrderingHitHighlightedProperty?: boolean; + /** + * The managed properties that are used to determine how to collapse individual search results. + * Results are collapsed into one or a specified number of results if they match any of the individual collapse specifications. + * In a collapse specification, results are collapsed if their properties match all individual properties in the collapse specification. + */ + CollapseSpecification?: string; + /** + * The locale identifier (LCID) of the user interface + */ + UIlanguage?: number; + /** + * The preferred number of characters to display in the hit-highlighted summary generated for a search result. + */ + DesiredSnippetLength?: number; + /** + * The maximum number of characters to display in the hit-highlighted summary generated for a search result. + */ + MaxSnippetLength?: number; + /** + * The number of characters to display in the result summary for a search result. + */ + SummaryLength?: number; + } + /** + * Describes the search API + * + */ + export class Search extends QueryableInstance { + /** + * Creates a new instance of the Search class + * + * @param baseUrl The url for the search context + * @param query The SearchQuery object to execute + */ + constructor(baseUrl: string | Queryable, path?: string); + /** + * ....... + * @returns Promise + */ + execute(query: SearchQuery): Promise; + } + /** + * Describes the SearchResults class, which returns the formatted and raw version of the query response + */ + export class SearchResults { + PrimarySearchResults: any; + RawSearchResults: any; + RowCount: number; + TotalRows: number; + TotalRowsIncludingDuplicates: number; + ElapsedTime: number; + /** + * Creates a new instance of the SearchResult class + * + */ + constructor(rawResponse: any); + /** + * Formats a search results array + * + * @param rawResults The array to process + */ + protected formatSearchResults(rawResults: Array | any): SearchResult[]; + } + /** + * Describes the SearchResult class + */ + export class SearchResult { + /** + * Creates a new instance of the SearchResult class + * + */ + constructor(rawItem: any); + } + /** + * Defines how search results are sorted. + */ + export interface Sort { + /** + * The name for a property by which the search results are ordered. + */ + Property: string; + /** + * The direction in which search results are ordered. + */ + Direction: SortDirection; + } + /** + * Defines one search property + */ + export interface SearchProperty { + Name: string; + Value: SearchPropertyValue; + } + /** + * Defines one search property value + */ + export interface SearchPropertyValue { + StrVal: string; + QueryPropertyValueTypeIndex: QueryPropertyValueType; + } + /** + * defines the SortDirection enum + */ + export enum SortDirection { + Ascending = 0, + Descending = 1, + FQLFormula = 2, + } + /** + * Defines how ReorderingRule interface, used for reordering results + */ + export interface ReorderingRule { + /** + * The value to match on + */ + MatchValue: string; + /** + * The rank boosting + */ + Boost: number; + /** + * The rank boosting + */ + MatchType: ReorderingRuleMatchType; + } + /** + * defines the ReorderingRuleMatchType enum + */ + export enum ReorderingRuleMatchType { + ResultContainsKeyword = 0, + TitleContainsKeyword = 1, + TitleMatchesKeyword = 2, + UrlStartsWith = 3, + UrlExactlyMatches = 4, + ContentTypeIs = 5, + FileExtensionMatches = 6, + ResultHasTag = 7, + ManualCondition = 8, + } + /** + * Specifies the type value for the property + */ + export enum QueryPropertyValueType { + None = 0, + StringType = 1, + Int32TYpe = 2, + BooleanType = 3, + StringArrayType = 4, + UnSupportedType = 5, + } +} +declare module "sharepoint/searchsuggest" { + import { Queryable, QueryableInstance } from "sharepoint/queryable"; + /** + * Defines a query execute against the search/suggest endpoint (see https://msdn.microsoft.com/en-us/library/office/dn194079.aspx) + */ + export interface SearchSuggestQuery { + /** + * A string that contains the text for the search query. + */ + querytext: string; + /** + * The number of query suggestions to retrieve. Must be greater than zero (0). The default value is 5. + */ + count?: number; + /** + * The number of personal results to retrieve. Must be greater than zero (0). The default value is 5. + */ + personalCount?: number; + /** + * A Boolean value that specifies whether to retrieve pre-query or post-query suggestions. true to return pre-query suggestions; otherwise, false. The default value is false. + */ + preQuery?: boolean; + /** + * A Boolean value that specifies whether to hit-highlight or format in bold the query suggestions. true to format in bold the terms in the returned query suggestions + * that match terms in the specified query; otherwise, false. The default value is true. + */ + hitHighlighting?: boolean; + /** + * A Boolean value that specifies whether to capitalize the first letter in each term in the returned query suggestions. true to capitalize the first letter in each term; + * otherwise, false. The default value is false. + */ + capitalize?: boolean; + /** + * The locale ID (LCID) for the query (see https://msdn.microsoft.com/en-us/library/cc233982.aspx). + */ + culture?: string; + /** + * A Boolean value that specifies whether stemming is enabled. true to enable stemming; otherwise, false. The default value is true. + */ + stemming?: boolean; + /** + * A Boolean value that specifies whether to include people names in the returned query suggestions. true to include people names in the returned query suggestions; + * otherwise, false. The default value is true. + */ + includePeople?: boolean; + /** + * A Boolean value that specifies whether to turn on query rules for this query. true to turn on query rules; otherwise, false. The default value is true. + */ + queryRules?: boolean; + /** + * A Boolean value that specifies whether to return query suggestions for prefix matches. true to return query suggestions based on prefix matches, otherwise, false when + * query suggestions should match the full query word. + */ + prefixMatch?: boolean; + } + export class SearchSuggest extends QueryableInstance { + constructor(baseUrl: string | Queryable, path?: string); + execute(query: SearchSuggestQuery): Promise; + private mapQueryToQueryString(query); + } + export class SearchSuggestResult { + PeopleNames: string[]; + PersonalResults: PersonalResultSuggestion[]; + Queries: any[]; + constructor(json: any); + } + export interface PersonalResultSuggestion { + HighlightedTitle?: string; + IsBestBet?: boolean; + Title?: string; + TypeId?: string; + Url?: string; + } +} +declare module "sharepoint/siteusers" { + import { Queryable, QueryableInstance, QueryableCollection } from "sharepoint/queryable"; + import { SiteGroups } from "sharepoint/sitegroups"; + import { TypedHash } from "collections/collections"; + /** + * Properties that provide both a getter, and a setter. + * + */ + export interface UserUpdateResult { + user: SiteUser; + data: any; + } + /** + * Describes a collection of all site collection users + * + */ + export class SiteUsers extends QueryableCollection { + /** + * Creates a new instance of the Users class + * + * @param baseUrl The url or Queryable which forms the parent of this user collection + */ + constructor(baseUrl: string | Queryable, path?: string); + /** + * Gets a user from the collection by email + * + * @param email The email of the user + */ + getByEmail(email: string): SiteUser; + /** + * Gets a user from the collection by id + * + * @param id The id of the user + */ + getById(id: number): SiteUser; + /** + * Gets a user from the collection by login name + * + * @param loginName The email address of the user + */ + getByLoginName(loginName: string): SiteUser; + /** + * Removes a user from the collection by id + * + * @param id The id of the user + */ + removeById(id: number | Queryable): Promise; + /** + * Removes a user from the collection by login name + * + * @param loginName The login name of the user + */ + removeByLoginName(loginName: string): Promise; + /** + * Add a user to a group + * + * @param loginName The login name of the user to add to the group + * + */ + add(loginName: string): Promise; + } + /** + * Describes a single user + * + */ + export class SiteUser extends QueryableInstance { + /** + * Get's the groups for this user. + * + */ + readonly groups: SiteGroups; + /** + * Updates this user instance with the supplied properties + * + * @param properties A plain object of property names and values to update for the user + */ + update(properties: TypedHash): Promise; + /** + * Delete this user + * + */ + delete(): Promise; + } + /** + * Represents the current user + */ + export class CurrentUser extends QueryableInstance { + constructor(baseUrl: string | Queryable, path?: string); + } + export interface SiteUserProps { + Email: string; + Id: number; + IsHiddenInUI: boolean; + IsShareByEmailGuestUser: boolean; + IsSiteAdmin: boolean; + LoginName: string; + PrincipalType: number; + Title: string; + } +} +declare module "sharepoint/sitegroups" { + import { Queryable, QueryableInstance, QueryableCollection } from "sharepoint/queryable"; + import { SiteUsers } from "sharepoint/siteusers"; + import { TypedHash } from "collections/collections"; + /** + * Principal Type enum + * + */ + export enum PrincipalType { + None = 0, + User = 1, + DistributionList = 2, + SecurityGroup = 4, + SharePointGroup = 8, + All = 15, + } + /** + * Result from adding a group. + * + */ + export interface GroupUpdateResult { + group: SiteGroup; + data: any; + } + /** + * Results from updating a group + * + */ + export interface GroupAddResult { + group: SiteGroup; + data: any; + } + /** + * Describes a collection of site users + * + */ + export class SiteGroups extends QueryableCollection { + /** + * Creates a new instance of the SiteUsers class + * + * @param baseUrl The url or Queryable which forms the parent of this user collection + */ + constructor(baseUrl: string | Queryable, path?: string); + /** + * Adds a new group to the site collection + * + * @param props The properties to be updated + */ + add(properties: TypedHash): Promise; + /** + * Gets a group from the collection by name + * + * @param email The name of the group + */ + getByName(groupName: string): SiteGroup; + /** + * Gets a group from the collection by id + * + * @param id The id of the group + */ + getById(id: number): SiteGroup; + /** + * Removes the group with the specified member ID from the collection. + * + * @param id The id of the group to remove + */ + removeById(id: number): Promise; + /** + * Removes a user from the collection by login name + * + * @param loginName The login name of the user + */ + removeByLoginName(loginName: string): Promise; + } + /** + * Describes a single group + * + */ + export class SiteGroup extends QueryableInstance { + /** + * Get's the users for this group + * + */ + readonly users: SiteUsers; + /** + * Updates this group instance with the supplied properties + * + * @param properties A GroupWriteableProperties object of property names and values to update for the user + */ + update(properties: TypedHash): Promise; + } + export interface SiteGroupAddResult { + group: SiteGroup; + data: any; + } +} +declare module "sharepoint/types" { + /** + * Represents the unique sequential location of a change within the change log. + */ + export interface ChangeToken { + /** + * Gets or sets a string value that contains the serialized representation of the change token generated by the protocol server. + */ + StringValue: string; + } + /** + * Defines a query that is performed against the change log. + */ + export interface ChangeQuery { + /** + * Gets or sets a value that specifies whether add changes are included in the query. + */ + Add?: boolean; + /** + * Gets or sets a value that specifies whether changes to alerts are included in the query. + */ + Alert?: boolean; + /** + * Gets or sets a value that specifies the end date and end time for changes that are returned through the query. + */ + ChangeTokenEnd?: ChangeToken; + /** + * Gets or sets a value that specifies the start date and start time for changes that are returned through the query. + */ + ChangeTokenStart?: ChangeToken; + /** + * Gets or sets a value that specifies whether changes to content types are included in the query. + */ + ContentType?: boolean; + /** + * Gets or sets a value that specifies whether deleted objects are included in the query. + */ + DeleteObject?: boolean; + /** + * Gets or sets a value that specifies whether changes to fields are included in the query. + */ + Field?: boolean; + /** + * Gets or sets a value that specifies whether changes to files are included in the query. + */ + File?: boolean; + /** + * Gets or sets value that specifies whether changes to folders are included in the query. + */ + Folder?: boolean; + /** + * Gets or sets a value that specifies whether changes to groups are included in the query. + */ + Group?: boolean; + /** + * Gets or sets a value that specifies whether adding users to groups is included in the query. + */ + GroupMembershipAdd?: boolean; + /** + * Gets or sets a value that specifies whether deleting users from the groups is included in the query. + */ + GroupMembershipDelete?: boolean; + /** + * Gets or sets a value that specifies whether general changes to list items are included in the query. + */ + Item?: boolean; + /** + * Gets or sets a value that specifies whether changes to lists are included in the query. + */ + List?: boolean; + /** + * Gets or sets a value that specifies whether move changes are included in the query. + */ + Move?: boolean; + /** + * Gets or sets a value that specifies whether changes to the navigation structure of a site collection are included in the query. + */ + Navigation?: boolean; + /** + * Gets or sets a value that specifies whether renaming changes are included in the query. + */ + Rename?: boolean; + /** + * Gets or sets a value that specifies whether restoring items from the recycle bin or from backups is included in the query. + */ + Restore?: boolean; + /** + * Gets or sets a value that specifies whether adding role assignments is included in the query. + */ + RoleAssignmentAdd?: boolean; + /** + * Gets or sets a value that specifies whether adding role assignments is included in the query. + */ + RoleAssignmentDelete?: boolean; + /** + * Gets or sets a value that specifies whether adding role assignments is included in the query. + */ + RoleDefinitionAdd?: boolean; + /** + * Gets or sets a value that specifies whether adding role assignments is included in the query. + */ + RoleDefinitionDelete?: boolean; + /** + * Gets or sets a value that specifies whether adding role assignments is included in the query. + */ + RoleDefinitionUpdate?: boolean; + /** + * Gets or sets a value that specifies whether modifications to security policies are included in the query. + */ + SecurityPolicy?: boolean; + /** + * Gets or sets a value that specifies whether changes to site collections are included in the query. + */ + Site?: boolean; + /** + * Gets or sets a value that specifies whether updates made using the item SystemUpdate method are included in the query. + */ + SystemUpdate?: boolean; + /** + * Gets or sets a value that specifies whether update changes are included in the query. + */ + Update?: boolean; + /** + * Gets or sets a value that specifies whether changes to users are included in the query. + */ + User?: boolean; + /** + * Gets or sets a value that specifies whether changes to views are included in the query. + */ + View?: boolean; + /** + * Gets or sets a value that specifies whether changes to Web sites are included in the query. + */ + Web?: boolean; + } + /** + * Specifies a Collaborative Application Markup Language (CAML) query on a list or joined lists. + */ + export interface CamlQuery { + /** + * Gets or sets a value that indicates whether the query returns dates in Coordinated Universal Time (UTC) format. + */ + DatesInUtc?: boolean; + /** + * Gets or sets a value that specifies the server relative URL of a list folder from which results will be returned. + */ + FolderServerRelativeUrl?: string; + /** + * Gets or sets a value that specifies the information required to get the next page of data for the list view. + */ + ListItemCollectionPosition?: ListItemCollectionPosition; + /** + * Gets or sets value that specifies the XML schema that defines the list view. + */ + ViewXml?: string; + } + /** + * Specifies the information required to get the next page of data for a list view. + */ + export interface ListItemCollectionPosition { + /** + * Gets or sets a value that specifies information, as name-value pairs, required to get the next page of data for a list view. + */ + PagingInfo: string; + } + /** + * Represents the input parameter of the GetListItemChangesSinceToken method. + */ + export interface ChangeLogitemQuery { + /** + * The change token for the request. + */ + ChangeToken?: string; + /** + * The XML element that defines custom filtering for the query. + */ + Contains?: string; + /** + * The records from the list to return and their return order. + */ + Query?: string; + /** + * The options for modifying the query. + */ + QueryOptions?: string; + /** + * RowLimit + */ + RowLimit?: string; + /** + * The names of the fields to include in the query result. + */ + ViewFields?: string; + /** + * The GUID of the view. + */ + ViewName?: string; + } + /** + * Determines the display mode of the given control or view + */ + export enum ControlMode { + Display = 1, + Edit = 2, + New = 3, + } + /** + * Represents properties of a list item field and its value. + */ + export interface ListItemFormUpdateValue { + /** + * The error message result after validating the value for the field. + */ + ErrorMessage?: string; + /** + * The internal name of the field. + */ + FieldName?: string; + /** + * The value of the field, in string format. + */ + FieldValue?: string; + /** + * Indicates whether there was an error result after validating the value for the field. + */ + HasException?: boolean; + } + /** + * Specifies the type of the field. + */ + export enum FieldTypes { + Invalid = 0, + Integer = 1, + Text = 2, + Note = 3, + DateTime = 4, + Counter = 5, + Choice = 6, + Lookup = 7, + Boolean = 8, + Number = 9, + Currency = 10, + URL = 11, + Computed = 12, + Threading = 13, + Guid = 14, + MultiChoice = 15, + GridChoice = 16, + Calculated = 17, + File = 18, + Attachments = 19, + User = 20, + Recurrence = 21, + CrossProjectLink = 22, + ModStat = 23, + Error = 24, + ContentTypeId = 25, + PageSeparator = 26, + ThreadIndex = 27, + WorkflowStatus = 28, + AllDayEvent = 29, + WorkflowEventType = 30, + } + export enum DateTimeFieldFormatType { + DateOnly = 0, + DateTime = 1, + } + /** + * Specifies the control settings while adding a field. + */ + export enum AddFieldOptions { + /** + * Specify that a new field added to the list must also be added to the default content type in the site collection + */ + DefaultValue = 0, + /** + * Specify that a new field added to the list must also be added to the default content type in the site collection. + */ + AddToDefaultContentType = 1, + /** + * Specify that a new field must not be added to any other content type + */ + AddToNoContentType = 2, + /** + * Specify that a new field that is added to the specified list must also be added to all content types in the site collection + */ + AddToAllContentTypes = 4, + /** + * Specify adding an internal field name hint for the purpose of avoiding possible database locking or field renaming operations + */ + AddFieldInternalNameHint = 8, + /** + * Specify that a new field that is added to the specified list must also be added to the default list view + */ + AddFieldToDefaultView = 16, + /** + * Specify to confirm that no other field has the same display name + */ + AddFieldCheckDisplayName = 32, + } + export interface XmlSchemaFieldCreationInformation { + Options?: AddFieldOptions; + SchemaXml: string; + } + export enum CalendarType { + Gregorian = 1, + Japan = 3, + Taiwan = 4, + Korea = 5, + Hijri = 6, + Thai = 7, + Hebrew = 8, + GregorianMEFrench = 9, + GregorianArabic = 10, + GregorianXLITEnglish = 11, + GregorianXLITFrench = 12, + KoreaJapanLunar = 14, + ChineseLunar = 15, + SakaEra = 16, + UmAlQura = 23, + } + export enum UrlFieldFormatType { + Hyperlink = 0, + Image = 1, + } + export interface BasePermissions { + Low: number; + High: number; + } + export enum PermissionKind { + /** + * Has no permissions on the Site. Not available through the user interface. + */ + EmptyMask = 0, + /** + * View items in lists, documents in document libraries, and Web discussion comments. + */ + ViewListItems = 1, + /** + * Add items to lists, documents to document libraries, and Web discussion comments. + */ + AddListItems = 2, + /** + * Edit items in lists, edit documents in document libraries, edit Web discussion comments + * in documents, and customize Web Part Pages in document libraries. + */ + EditListItems = 3, + /** + * Delete items from a list, documents from a document library, and Web discussion + * comments in documents. + */ + DeleteListItems = 4, + /** + * Approve a minor version of a list item or document. + */ + ApproveItems = 5, + /** + * View the source of documents with server-side file handlers. + */ + OpenItems = 6, + /** + * View past versions of a list item or document. + */ + ViewVersions = 7, + /** + * Delete past versions of a list item or document. + */ + DeleteVersions = 8, + /** + * Discard or check in a document which is checked out to another user. + */ + CancelCheckout = 9, + /** + * Create, change, and delete personal views of lists. + */ + ManagePersonalViews = 10, + /** + * Create and delete lists, add or remove columns in a list, and add or remove public views of a list. + */ + ManageLists = 12, + /** + * View forms, views, and application pages, and enumerate lists. + */ + ViewFormPages = 13, + /** + * Make content of a list or document library retrieveable for anonymous users through SharePoint search. + * The list permissions in the site do not change. + */ + AnonymousSearchAccessList = 14, + /** + * Allow users to open a Site, list, or folder to access items inside that container. + */ + Open = 17, + /** + * View pages in a Site. + */ + ViewPages = 18, + /** + * Add, change, or delete HTML pages or Web Part Pages, and edit the Site using + * a Windows SharePoint Services compatible editor. + */ + AddAndCustomizePages = 19, + /** + * Apply a theme or borders to the entire Site. + */ + ApplyThemeAndBorder = 20, + /** + * Apply a style sheet (.css file) to the Site. + */ + ApplyStyleSheets = 21, + /** + * View reports on Site usage. + */ + ViewUsageData = 22, + /** + * Create a Site using Self-Service Site Creation. + */ + CreateSSCSite = 23, + /** + * Create subsites such as team sites, Meeting Workspace sites, and Document Workspace sites. + */ + ManageSubwebs = 24, + /** + * Create a group of users that can be used anywhere within the site collection. + */ + CreateGroups = 25, + /** + * Create and change permission levels on the Site and assign permissions to users + * and groups. + */ + ManagePermissions = 26, + /** + * Enumerate files and folders in a Site using Microsoft Office SharePoint Designer + * and WebDAV interfaces. + */ + BrowseDirectories = 27, + /** + * View information about users of the Site. + */ + BrowseUserInfo = 28, + /** + * Add or remove personal Web Parts on a Web Part Page. + */ + AddDelPrivateWebParts = 29, + /** + * Update Web Parts to display personalized information. + */ + UpdatePersonalWebParts = 30, + /** + * Grant the ability to perform all administration tasks for the Site as well as + * manage content, activate, deactivate, or edit properties of Site scoped Features + * through the object model or through the user interface (UI). When granted on the + * root Site of a Site Collection, activate, deactivate, or edit properties of + * site collection scoped Features through the object model. To browse to the Site + * Collection Features page and activate or deactivate Site Collection scoped Features + * through the UI, you must be a Site Collection administrator. + */ + ManageWeb = 31, + /** + * Content of lists and document libraries in the Web site will be retrieveable for anonymous users through + * SharePoint search if the list or document library has AnonymousSearchAccessList set. + */ + AnonymousSearchAccessWebLists = 32, + /** + * Use features that launch client applications. Otherwise, users must work on documents + * locally and upload changes. + */ + UseClientIntegration = 37, + /** + * Use SOAP, WebDAV, or Microsoft Office SharePoint Designer interfaces to access the Site. + */ + UseRemoteAPIs = 38, + /** + * Manage alerts for all users of the Site. + */ + ManageAlerts = 39, + /** + * Create e-mail alerts. + */ + CreateAlerts = 40, + /** + * Allows a user to change his or her user information, such as adding a picture. + */ + EditMyUserInfo = 41, + /** + * Enumerate permissions on Site, list, folder, document, or list item. + */ + EnumeratePermissions = 63, + /** + * Has all permissions on the Site. Not available through the user interface. + */ + FullMask = 65, + } + export interface FollowedContent { + FollowedDocumentsUrl: string; + FollowedSitesUrl: string; + } + export interface UserProfile { + /** + * An object containing the user's FollowedDocumentsUrl and FollowedSitesUrl. + */ + FollowedContent?: FollowedContent; + /** + * The account name of the user. (SharePoint Online only) + */ + AccountName?: string; + /** + * The display name of the user. (SharePoint Online only) + */ + DisplayName?: string; + /** + * The FirstRun flag of the user. (SharePoint Online only) + */ + O15FirstRunExperience?: number; + /** + * The personal site of the user. + */ + PersonalSite?: string; + /** + * The capabilities of the user's personal site. Represents a bitwise PersonalSiteCapabilities value: + * None = 0; Profile Value = 1; Social Value = 2; Storage Value = 4; MyTasksDashboard Value = 8; Education Value = 16; Guest Value = 32. + */ + PersonalSiteCapabilities?: number; + /** + * The error thrown when the user's personal site was first created, if any. (SharePoint Online only) + */ + PersonalSiteFirstCreationError?: string; + /** + * The date and time when the user's personal site was first created. (SharePoint Online only) + */ + PersonalSiteFirstCreationTime?: Date; + /** + * The status for the state of the personal site instantiation + */ + PersonalSiteInstantiationState?: number; + /** + * The date and time when the user's personal site was last created. (SharePoint Online only) + */ + PersonalSiteLastCreationTime?: Date; + /** + * The number of attempts made to create the user's personal site. (SharePoint Online only) + */ + PersonalSiteNumberOfRetries?: number; + /** + * Indicates whether the user's picture is imported from Exchange. + */ + PictureImportEnabled?: boolean; + /** + * The public URL of the personal site of the current user. (SharePoint Online only) + */ + PublicUrl?: string; + /** + * The URL used to create the user's personal site. + */ + UrlToCreatePersonalSite?: string; + } + export interface HashTag { + /** + * The hash tag's internal name. + */ + Name?: string; + /** + * The number of times that the hash tag is used. + */ + UseCount?: number; + } + export interface HashTagCollection { + Items: HashTag[]; + } + export interface UserIdInfo { + NameId?: string; + NameIdIssuer?: string; + } + export enum PrincipalType { + None = 0, + User = 1, + DistributionList = 2, + SecurityGroup = 4, + SharePointGroup = 8, + All = 15, + } + export enum RoleType { + None = 0, + Guest = 1, + Reader = 2, + Contributor = 3, + WebDesigner = 4, + Administrator = 5, + } + export interface PrincipalInfo { + email: string; + id: number; + isActive: boolean; + isExternal: boolean; + jobTitle: string; + loginName: string; + name: string; + principalType: PrincipalType; + userId: UserIdInfo; + } + export interface DocumentLibraryInformation { + AbsoluteUrl?: string; + Modified?: Date; + ModifiedFriendlyDisplay?: string; + ServerRelativeUrl?: string; + Title?: string; + } + export interface ContextInfo { + FormDigestTimeoutSeconds?: number; + FormDigestValue?: number; + LibraryVersion?: string; + SiteFullUrl?: string; + SupportedSchemaVersions?: string[]; + WebFullUrl?: string; + } + export interface RenderListData { + Row: any[]; + FirstRow: number; + FolderPermissions: string; + LastRow: number; + FilterLink: string; + ForceNoHierarchy: string; + HierarchyHasIndention: string; + } + export enum PageType { + Invalid = -1, + DefaultView = 0, + NormalView = 1, + DialogView = 2, + View = 3, + DisplayForm = 4, + DisplayFormDialog = 5, + EditForm = 6, + EditFormDialog = 7, + NewForm = 8, + NewFormDialog = 9, + SolutionForm = 10, + PAGE_MAXITEMS = 11, + } + export interface ListFormData { + ContentType?: string; + Title?: string; + Author?: string; + Editor?: string; + Created?: Date; + Modified: Date; + Attachments?: any; + ListSchema?: any; + FormControlMode?: number; + FieldControlModes?: { + Title?: number; + Author?: number; + Editor?: number; + Created?: number; + Modified?: number; + Attachments?: number; + }; + WebAttributes?: { + WebUrl?: string; + EffectivePresenceEnabled?: boolean; + AllowScriptableWebParts?: boolean; + PermissionCustomizePages?: boolean; + LCID?: number; + CurrentUserId?: number; + }; + ItemAttributes?: { + Id?: number; + FsObjType?: number; + ExternalListItem?: boolean; + Url?: string; + EffectiveBasePermissionsLow?: number; + EffectiveBasePermissionsHigh?: number; + }; + ListAttributes?: { + Id?: string; + BaseType?: number; + Direction?: string; + ListTemplateType?: number; + DefaultItemOpen?: number; + EnableVersioning?: boolean; + }; + CSRCustomLayout?: boolean; + PostBackRequired?: boolean; + PreviousPostBackHandled?: boolean; + UploadMode?: boolean; + SubmitButtonID?: string; + ItemContentTypeName?: string; + ItemContentTypeId?: string; + JSLinks?: string; + } + export enum SharingLinkKind { + /** + * Uninitialized link + */ + Uninitialized = 0, + /** + * Direct link to the object being shared + */ + Direct = 1, + /** + * Organization-shareable link to the object being shared with view permissions + */ + OrganizationView = 2, + /** + * Organization-shareable link to the object being shared with edit permissions + */ + OrganizationEdit = 3, + /** + * View only anonymous link + */ + AnonymousView = 4, + /** + * Read/Write anonymous link + */ + AnonymousEdit = 5, + /** + * Flexible sharing Link where properties can change without affecting link URL + */ + Flexible = 6, + } + export interface ShareObjectOptions { + url?: string; + loginNames?: string | string[]; + role: SharingRole; + emailData?: SharingEmailData; + group?: RoleType; + propagateAcl?: boolean; + includeAnonymousLinkInEmail?: boolean; + useSimplifiedRoles?: boolean; + } + /** + * Indicates the role of the sharing link + */ + export enum SharingRole { + None = 0, + View = 1, + Edit = 2, + Owner = 3, + } + /** + * Represents email data. + */ + export interface SharingEmailData { + /** + * The e-mail subject. + */ + subject?: string; + /** + * The e-mail body. + */ + body: string; + } + export interface ShareLinkSettings { + /** + * The optional unique identifier of an existing sharing link to be retrieved and updated if necessary. + */ + shareId?: string; + /** + * The kind of the sharing link to be created. + */ + linkKind: SharingLinkKind; + /** + * A date/time string for which the format conforms to the ISO 8601:2004(E) complete representation for calendar date and time of day and + * which represents the time and date of expiry for the anonymous link. Both the minutes and hour value must be specified for the + * difference between the local and UTC time. Midnight is represented as 00:00:00. + */ + expiration?: string; + /** + * The role to be used for the sharing link. This is required for Flexible links, and ignored for legacy link kinds. + */ + role?: SharingRole; + /** + * Indicates if the sharing link, should support anonymous access. This is required for Flexible links, and ignored for legacy link kinds. + */ + allowAnonymousAccess?: boolean; + } + export interface ShareLinkRequest { + /** + * A string of JSON representing users in people picker format. Only needed if an e-mail notification should be sent. + */ + peoplePickerInput?: string; + /** + * Whether to create the link or not if it doesn't exist yet. + */ + createLink: boolean; + /** + * The e-mail data. Only needed if an e-mail notification should be sent. + */ + emailData?: SharingEmailData; + /** + * The settings for the sharing link to be created/updated + */ + settings: ShareLinkSettings; + } + /** + * Represents a response for sharing a link + */ + export interface ShareLinkResponse { + /** + * A SharingLinkInfo that represents the sharing link. Will be populated if sharing operation is returning a sharing link. + */ + sharingLinkInfo: SharingLinkInfo; + } + export interface SharingLinkInfo { + AllowsAnonymousAccess: boolean; + Created: string; + CreatedBy: PrincipalInfo; + Expiration: string; + IsActive: boolean; + IsEditLink: boolean; + IsFormsLink: boolean; + IsUnhealthy: boolean; + LastModified: string; + LastModifiedBy: PrincipalInfo; + LinkKind: SharingLinkKind; + ShareId: string; + Url: string; + } + export enum SharingOperationStatusCode { + /** + * The share operation completed without errors. + */ + CompletedSuccessfully = 0, + /** + * The share operation completed and generated requests for access. + */ + AccessRequestsQueued = 1, + /** + * The share operation failed as there were no resolved users. + */ + NoResolvedUsers = -1, + /** + * The share operation failed due to insufficient permissions. + */ + AccessDenied = -2, + /** + * The share operation failed when attempting a cross site share, which is not supported. + */ + CrossSiteRequestNotSupported = -3, + /** + * The sharing operation failed due to an unknown error. + */ + UnknowError = -4, + /** + * The text you typed is too long. Please shorten it. + */ + EmailBodyTooLong = -5, + /** + * The maximum number of unique scopes in the list has been exceeded. + */ + ListUniqueScopesExceeded = -6, + /** + * The share operation failed because a sharing capability is disabled in the site. + */ + CapabilityDisabled = -7, + /** + * The specified object for the share operation is not supported. + */ + ObjectNotSupported = -8, + /** + * A SharePoint group cannot contain another SharePoint group. + */ + NestedGroupsNotSupported = -9, + } + export interface SharingResult { + /** + * The relative URL of a page which can be navigated to, to show permissions. + */ + PermissionsPageRelativeUrl?: string; + /** + * A collection of users which have new pending access requests as a result of sharing. + */ + UsersWithAccessRequests?: any[]; + /** + * An enumeration which summarizes the result of the sharing operation. + */ + StatusCode?: SharingOperationStatusCode; + /** + * An error message about the failure if sharing was unsuccessful. + */ + ErrorMessage?: string; + /** + * A list of UserSharingResults from attempting to share a securable with unique permissions. + */ + UniquelyPermissionedUsers?: UserSharingResult[]; + /** + * Groups which were granted permissions. + */ + GroupsSharedWith?: any[]; + /** + * The SharePoint group users were added to, if any were added to a group. + */ + GroupUsersAddedTo?: any; + /** + * A list of users being added to a SharePoint permissions goup + */ + UsersAddedToGroup?: UserSharingResult[]; + /** + * A list of SPInvitationCreationResult for external users being invited to have access. + */ + InvitedUsers?: SPInvitationCreationResult[]; + /** + * The name of the securable being shared. + */ + Name?: string; + /** + * The url of the securable being shared. + */ + Url?: string; + /** + * IconUrl + */ + IconUrl?: string; + } + export interface UserSharingResult { + IsUserKnown?: boolean; + Status?: boolean; + Message?: string; + User?: string; + DisplayName?: string; + Email?: string; + CurrentRole?: SharingRole; + AllowedRoles?: SharingRole[]; + InvitationLink?: string; + } + export interface SPInvitationCreationResult { + Succeeded?: boolean; + Email?: string; + InvitationLink?: string; + } + export interface SharingRecipient { + email?: string; + alias?: string; + } + export interface SharingEntityPermission { + /** + * The Input Entity provided to the Call. + */ + inputEntity: string; + /** + * The Resolved Entity after resolving using PeoplePicker API. + */ + resolvedEntity: string; + /** + * Does the Entity have Access to the Securable Object + */ + hasAccess: boolean; + /** + * Role of the Entity on ListItem + */ + role: SharingRole; + } + export interface SharingInformationRequest { + /** + * Max Principal's to return. + */ + maxPrincipalsToReturn: number; + /** + * Supported Features (For future use by Office Client). + */ + clientSupportedFeatures: string; + } + export interface ObjectSharingSettings { + /** + * The URL pointing to the containing SPWeb object + */ + WebUrl: string; + /** + * The unique ID of the parent list (if applicable) + */ + ListId?: string; + /** + * The list item ID (if applicable) + */ + ItemId?: string; + /** + * The object title + */ + ItemName: string; + /** + * The server relative object URL + */ + ItemUrl: string; + /** + * Contains information about the sharing state of a shareable object + */ + ObjectSharingInformation: any; + /** + * Boolean indicating whether the sharing context operates under the access request mode + */ + AccessRequestMode: boolean; + /** + * Boolean indicating whether the sharing context operates under the permissions only mode + * (i.e. adding to a group or hiding the groups dropdown in the SharePoint UI) + */ + PermissionsOnlyMode: boolean; + /** + * URL of the site from which the shared object inherits permissions + */ + InheritingWebLink: string; + /** + * Boolean flag denoting if guest users are enabled for the site collection + */ + ShareByEmailEnabled: boolean; + /** + * Boolean indicating whether the current user is a guest user + */ + IsGuestUser: boolean; + /** + * Boolean indicating whether the site has the standard "Editor" role + */ + HasEditRole: boolean; + /** + * Boolean indicating whether the site has the standard "Reader" role + */ + HasReadRole: boolean; + /** + * Boolean indicating whether the object to share is a picture library + */ + IsPictureLibrary: boolean; + /** + * Boolean indicating whether the folder object can be shared + */ + CanShareFolder: boolean; + /** + * Boolean indicating whether email invitations can be sent + */ + CanSendEmail: boolean; + /** + * Default share link type + */ + DefaultShareLinkType: SharingLinkKind; + /** + * Boolean indicating whether the object to share supports ACL propagation + */ + SupportsAclPropagation: boolean; + /** + * Boolean indicating whether the current user can only share within the tenancy + */ + CanCurrentUserShareInternally: boolean; + /** + * Boolean indicating whether the current user can share outside the tenancy, by inviting external users + */ + CanCurrentUserShareExternally: boolean; + /** + * Boolean indicating whether the current user can retrieve an anonymous View link, if one has already been created + * If one has not been created, the user cannot create one + */ + CanCurrentUserRetrieveReadonlyLink: boolean; + /** + * Boolean indicating whether the current user can create or disable an anonymous Edit link + */ + CanCurrentUserManageReadonlyLink: boolean; + /** + * Boolean indicating whether the current user can retrieve an anonymous Edit link, if one has already been created + * If one has not been created, the user cannot create one + */ + CanCurrentUserRetrieveReadWriteLink: boolean; + /** + * Boolean indicating whether the current user can create or disable an anonymous Edit link + */ + CanCurrentUserManageReadWriteLink: boolean; + /** + * Boolean indicating whether the current user can retrieve an organization View link, if one has already been created + * If one has not been created, the user cannot create one + */ + CanCurrentUserRetrieveOrganizationReadonlyLink: boolean; + /** + * Boolean indicating whether the current user can create or disable an organization Edit link + */ + CanCurrentUserManageOrganizationReadonlyLink: boolean; + /** + * Boolean indicating whether the current user can retrieve an organization Edit link, if one has already been created + * If one has not been created, the user cannot create one + */ + CanCurrentUserRetrieveOrganizationReadWriteLink: boolean; + /** + * Boolean indicating whether the current user can create or disable an organization Edit link + */ + CanCurrentUserManageOrganizationReadWriteLink: boolean; + /** + * Boolean indicating whether the current user can make use of Share-By-Link + */ + CanSendLink: boolean; + /** + * Boolean indicating whether the client logic should warn the user + * that they are about to share with external email addresses. + */ + ShowExternalSharingWarning: boolean; + /** + * A list of SharingPermissionInformation objects that can be used to share + */ + SharingPermissions: any[]; + /** + * A dictionary object that lists the display name and the id of + * the SharePoint simplified roles (edit, view) + */ + SimplifiedRoles: { + [key: string]: string; + }; + /** + * A dictionary object that lists the display name and the id of the SharePoint groups + */ + GroupsList: { + [key: string]: string; + }; + /** + * A dictionary object that lists the display name and the id of the SharePoint regular roles + */ + Roles: { + [key: string]: string; + }; + /** + * An object containing the SharePoint UI specific sharing settings. + */ + SharePointSettings: any; + /** + * Boolean indicating whether the current user is a site collection administrator + */ + IsUserSiteAdmin: boolean; + /** + * A value that indicates number of days an anonymous link can be valid before it expires + */ + RequiredAnonymousLinkExpirationInDays: number; + } + export interface SharingInformation { + /** + * External Sharing. + */ + canAddExternalPrincipal?: boolean; + /** + * Internal Sharing. + */ + canAddInternalPrincipal?: boolean; + /** + * Can Send Email. + */ + canSendEmail?: boolean; + /** + * Can Use Simplified Roles present in Roles Enum. + */ + canUseSimplifiedRoles?: boolean; + /** + * Has Unique Permissions. + */ + hasUniquePermissions?: boolean; + /** + * Current Users Role on the Item. + */ + currentRole?: SharingRole; + /** + * Does the User+Item require Approval from Admin for Sharing. + */ + requiresAccessApproval?: boolean; + /** + * (Owners only)Whether there are pending access requests for the securable object. + */ + hasPendingAccessRequests?: boolean; + /** + * (Owners only)The link to the access requests page for the securable object, or an empty string if the link is not available. + */ + pendingAccessRequestsLink?: string; + /** + * sharedObjectType + */ + sharedObjectType?: SPSharedObjectType; + /** + * Url for the Securable Object (Encoded). + */ + directUrl?: string; + /** + * Parent Web Url for the Securable Object (Encoded). + */ + webUrl?: string; + /** + * Default SharingLinkKind. + */ + defaultLinkKind?: SharingLinkKind; + /** + * Tenant's SharingDomainRestrictionMode. + */ + domainRestrictionMode?: SharingDomainRestrictionMode; + /** + * Tenant's RestrictedDomains. + */ + RestrictedDomains?: string; + /** + * Tenant's Anonymous Link Expiration Restriction in Days. + */ + anonymousLinkExpirationRestrictionDays?: number; + /** + * The PermissionCollection that are on the Securable Object (Princpals & Links) + */ + permissionsInformation?: any; + /** + * PickerSettings used by the PeoplePicker Control. + */ + pickerSettings?: any; + } + export enum SPSharedObjectType { + Unknown = 0, + File = 1, + Folder = 2, + Item = 3, + List = 4, + Web = 5, + Max = 6, + } + export enum SharingDomainRestrictionMode { + None = 0, + AllowList = 1, + BlockList = 2, + } +} +declare module "sharepoint/roles" { + import { Queryable, QueryableInstance, QueryableCollection } from "sharepoint/queryable"; + import { SiteGroups } from "sharepoint/sitegroups"; + import { BasePermissions } from "sharepoint/types"; + import { TypedHash } from "collections/collections"; + /** + * Describes a set of role assignments for the current scope + * + */ + export class RoleAssignments extends QueryableCollection { + /** + * Creates a new instance of the RoleAssignments class + * + * @param baseUrl The url or Queryable which forms the parent of this fields collection + */ + constructor(baseUrl: string | Queryable, path?: string); + /** + * Adds a new role assignment with the specified principal and role definitions to the collection. + * + * @param principalId The ID of the user or group to assign permissions to + * @param roleDefId The ID of the role definition that defines the permissions to assign + * + */ + add(principalId: number, roleDefId: number): Promise; + /** + * Removes the role assignment with the specified principal and role definition from the collection + * + * @param principalId The ID of the user or group in the role assignment. + * @param roleDefId The ID of the role definition in the role assignment + * + */ + remove(principalId: number, roleDefId: number): Promise; + /** + * Gets the role assignment associated with the specified principal ID from the collection. + * + * @param id The id of the role assignment + */ + getById(id: number): RoleAssignment; + } + export class RoleAssignment extends QueryableInstance { + readonly groups: SiteGroups; + /** + * Get the role definition bindings for this role assignment + * + */ + readonly bindings: RoleDefinitionBindings; + /** + * Delete this role assignment + * + */ + delete(): Promise; + } + export class RoleDefinitions extends QueryableCollection { + /** + * Creates a new instance of the RoleDefinitions class + * + * @param baseUrl The url or Queryable which forms the parent of this fields collection + * @param path + * + */ + constructor(baseUrl: string | Queryable, path?: string); + /** + * Gets the role definition with the specified ID from the collection. + * + * @param id The ID of the role definition. + * + */ + getById(id: number): RoleDefinition; + /** + * Gets the role definition with the specified name. + * + * @param name The name of the role definition. + * + */ + getByName(name: string): RoleDefinition; + /** + * Gets the role definition with the specified type. + * + * @param name The name of the role definition. + * + */ + getByType(roleTypeKind: number): RoleDefinition; + /** + * Create a role definition + * + * @param name The new role definition's name + * @param description The new role definition's description + * @param order The order in which the role definition appears + * @param basePermissions The permissions mask for this role definition + * + */ + add(name: string, description: string, order: number, basePermissions: BasePermissions): Promise; + } + export class RoleDefinition extends QueryableInstance { + /** + * Updates this web intance with the supplied properties + * + * @param properties A plain object hash of values to update for the web + */ + update(properties: TypedHash): Promise; + /** + * Delete this role definition + * + */ + delete(): Promise; + } + export interface RoleDefinitionUpdateResult { + definition: RoleDefinition; + data: any; + } + export interface RoleDefinitionAddResult { + definition: RoleDefinition; + data: any; + } + export class RoleDefinitionBindings extends QueryableCollection { + constructor(baseUrl: string | Queryable, path?: string); + } +} +declare module "sharepoint/queryablesecurable" { + import { RoleAssignments } from "sharepoint/roles"; + import { BasePermissions, PermissionKind } from "sharepoint/types"; + import { QueryableInstance } from "sharepoint/queryable"; + export class QueryableSecurable extends QueryableInstance { + /** + * Gets the set of role assignments for this item + * + */ + readonly roleAssignments: RoleAssignments; + /** + * Gets the closest securable up the security hierarchy whose permissions are applied to this list item + * + */ + readonly firstUniqueAncestorSecurableObject: QueryableInstance; + /** + * Gets the effective permissions for the user supplied + * + * @param loginName The claims username for the user (ex: i:0#.f|membership|user@domain.com) + */ + getUserEffectivePermissions(loginName: string): Promise; + /** + * Gets the effective permissions for the current user + */ + getCurrentUserEffectivePermissions(): Promise; + /** + * Breaks the security inheritance at this level optinally copying permissions and clearing subscopes + * + * @param copyRoleAssignments If true the permissions are copied from the current parent scope + * @param clearSubscopes Optional. true to make all child securable objects inherit role assignments from the current object + */ + breakRoleInheritance(copyRoleAssignments?: boolean, clearSubscopes?: boolean): Promise; + /** + * Removes the local role assignments so that it re-inherit role assignments from the parent object. + * + */ + resetRoleInheritance(): Promise; + /** + * Determines if a given user has the appropriate permissions + * + * @param loginName The user to check + * @param permission The permission being checked + */ + userHasPermissions(loginName: string, permission: PermissionKind): Promise; + /** + * Determines if the current user has the requested permissions + * + * @param permission The permission we wish to check + */ + currentUserHasPermissions(permission: PermissionKind): Promise; + /** + * Taken from sp.js, checks the supplied permissions against the mask + * + * @param value The security principal's permissions on the given object + * @param perm The permission checked against the value + */ + hasPermissions(value: BasePermissions, perm: PermissionKind): boolean; + } +} +declare module "sharepoint/queryableshareable" { + import { Queryable, QueryableInstance } from "sharepoint/queryable"; + import { QueryableSecurable } from "sharepoint/queryablesecurable"; + import { RoleType, SharingLinkKind, ShareLinkResponse, SharingRole, SharingEmailData, SharingResult, SharingRecipient, SharingEntityPermission, SharingInformationRequest, ObjectSharingSettings, SharingInformation, ShareObjectOptions } from "sharepoint/types"; + /** + * Internal helper class used to augment classes to include sharing functionality + */ + export class QueryableShareable extends Queryable { + /** + * Gets a sharing link for the supplied + * + * @param kind The kind of link to share + * @param expiration The optional expiration for this link + */ + getShareLink(kind: SharingLinkKind, expiration?: Date): Promise; + /** + * Shares this instance with the supplied users + * + * @param loginNames Resolved login names to share + * @param role The role + * @param requireSignin True to require the user is authenticated, otherwise false + * @param propagateAcl True to apply this share to all children + * @param emailData If supplied an email will be sent with the indicated properties + */ + shareWith(loginNames: string | string[], role: SharingRole, requireSignin?: boolean, propagateAcl?: boolean, emailData?: SharingEmailData): Promise; + /** + * Shares an object based on the supplied options + * + * @param options The set of options to send to the ShareObject method + * @param bypass If true any processing is skipped and the options are sent directly to the ShareObject method + */ + shareObject(options: ShareObjectOptions, bypass?: boolean): Promise; + /** + * Calls the web's UnshareObject method + * + * @param url The url of the object to unshare + */ + unshareObjectWeb(url: string): Promise; + /** + * Checks Permissions on the list of Users and returns back role the users have on the Item. + * + * @param recipients The array of Entities for which Permissions need to be checked. + */ + checkPermissions(recipients: SharingRecipient[]): Promise; + /** + * Get Sharing Information. + * + * @param request The SharingInformationRequest Object. + */ + getSharingInformation(request?: SharingInformationRequest): Promise; + /** + * Gets the sharing settings of an item. + * + * @param useSimplifiedRoles Determines whether to use simplified roles. + */ + getObjectSharingSettings(useSimplifiedRoles?: boolean): Promise; + /** + * Unshares this object + */ + unshareObject(): Promise; + /** + * Deletes a link by type + * + * @param kind Deletes a sharing link by the kind of link + */ + deleteLinkByKind(kind: SharingLinkKind): Promise; + /** + * Removes the specified link to the item. + * + * @param kind The kind of link to be deleted. + * @param shareId + */ + unshareLink(kind: SharingLinkKind, shareId?: string): Promise; + /** + * Calculates the roleValue string used in the sharing query + * + * @param role The Sharing Role + * @param group The Group type + */ + protected getRoleValue(role: SharingRole, group: RoleType): Promise; + private getShareObjectWeb(candidate); + private sendShareObjectRequest(options); + } + export class QueryableShareableWeb extends QueryableSecurable { + /** + * Shares this web with the supplied users + * @param loginNames The resolved login names to share + * @param role The role to share this web + * @param emailData Optional email data + */ + shareWith(loginNames: string | string[], role?: SharingRole, emailData?: SharingEmailData): Promise; + /** + * Provides direct access to the static web.ShareObject method + * + * @param url The url to share + * @param loginNames Resolved loginnames string[] of a single login name string + * @param roleValue Role value + * @param emailData Optional email data + * @param groupId Optional group id + * @param propagateAcl + * @param includeAnonymousLinkInEmail + * @param useSimplifiedRoles + */ + shareObject(url: string, loginNames: string | string[], role: SharingRole, emailData?: SharingEmailData, group?: RoleType, propagateAcl?: boolean, includeAnonymousLinkInEmail?: boolean, useSimplifiedRoles?: boolean): Promise; + /** + * Supplies a method to pass any set of arguments to ShareObject + * + * @param options The set of options to send to ShareObject + */ + shareObjectRaw(options: any): Promise; + /** + * Unshares the object + * + * @param url The url of the object to stop sharing + */ + unshareObject(url: string): Promise; + } + export class QueryableShareableItem extends QueryableSecurable { + /** + * Gets a link suitable for sharing for this item + * + * @param kind The type of link to share + * @param expiration The optional expiration date + */ + getShareLink(kind?: SharingLinkKind, expiration?: Date): Promise; + /** + * Shares this item with one or more users + * + * @param loginNames string or string[] of resolved login names to which this item will be shared + * @param role The role (View | Edit) applied to the share + * @param emailData Optional, if inlucded an email will be sent. Note subject currently has no effect. + */ + shareWith(loginNames: string | string[], role?: SharingRole, requireSignin?: boolean, emailData?: SharingEmailData): Promise; + /** + * Checks Permissions on the list of Users and returns back role the users have on the Item. + * + * @param recipients The array of Entities for which Permissions need to be checked. + */ + checkSharingPermissions(recipients: SharingRecipient[]): Promise; + /** + * Get Sharing Information. + * + * @param request The SharingInformationRequest Object. + */ + getSharingInformation(request?: SharingInformationRequest): Promise; + /** + * Gets the sharing settings of an item. + * + * @param useSimplifiedRoles Determines whether to use simplified roles. + */ + getObjectSharingSettings(useSimplifiedRoles?: boolean): Promise; + /** + * Unshare this item + */ + unshare(): Promise; + /** + * Deletes a sharing link by kind + * + * @param kind Deletes a sharing link by the kind of link + */ + deleteSharingLinkByKind(kind: SharingLinkKind): Promise; + /** + * Removes the specified link to the item. + * + * @param kind The kind of link to be deleted. + * @param shareId + */ + unshareLink(kind: SharingLinkKind, shareId?: string): Promise; + } + export class FileFolderShared extends QueryableInstance { + /** + * Gets a link suitable for sharing + * + * @param kind The kind of link to get + * @param expiration Optional, an expiration for this link + */ + getShareLink(kind?: SharingLinkKind, expiration?: Date): Promise; + /** + * Checks Permissions on the list of Users and returns back role the users have on the Item. + * + * @param recipients The array of Entities for which Permissions need to be checked. + */ + checkSharingPermissions(recipients: SharingRecipient[]): Promise; + /** + * Get Sharing Information. + * + * @param request The SharingInformationRequest Object. + */ + getSharingInformation(request?: SharingInformationRequest): Promise; + /** + * Gets the sharing settings of an item. + * + * @param useSimplifiedRoles Determines whether to use simplified roles. + */ + getObjectSharingSettings(useSimplifiedRoles?: boolean): Promise; + /** + * Unshare this item + */ + unshare(): Promise; + /** + * Deletes a sharing link by the kind of link + * + * @param kind The kind of link to be deleted. + */ + deleteSharingLinkByKind(kind: SharingLinkKind): Promise; + /** + * Removes the specified link to the item. + * + * @param kind The kind of link to be deleted. + * @param shareId The share id to delete + */ + unshareLink(kind: SharingLinkKind, shareId?: string): Promise; + /** + * For files and folders we need to use the associated item end point + */ + protected getShareable(): Promise; + } + export class QueryableShareableFile extends FileFolderShared { + /** + * Shares this item with one or more users + * + * @param loginNames string or string[] of resolved login names to which this item will be shared + * @param role The role (View | Edit) applied to the share + * @param shareEverything Share everything in this folder, even items with unique permissions. + * @param requireSignin If true the user must signin to view link, otherwise anyone with the link can access the resource + * @param emailData Optional, if inlucded an email will be sent. Note subject currently has no effect. + */ + shareWith(loginNames: string | string[], role?: SharingRole, requireSignin?: boolean, emailData?: SharingEmailData): Promise; + } + export class QueryableShareableFolder extends FileFolderShared { + /** + * Shares this item with one or more users + * + * @param loginNames string or string[] of resolved login names to which this item will be shared + * @param role The role (View | Edit) applied to the share + * @param shareEverything Share everything in this folder, even items with unique permissions. + * @param requireSignin If true the user must signin to view link, otherwise anyone with the link can access the resource + * @param emailData Optional, if inlucded an email will be sent. Note subject currently has no effect. + */ + shareWith(loginNames: string | string[], role?: SharingRole, requireSignin?: boolean, shareEverything?: boolean, emailData?: SharingEmailData): Promise; + } +} +declare module "sharepoint/webparts" { + import { Queryable, QueryableInstance, QueryableCollection } from "sharepoint/queryable"; + export class LimitedWebPartManager extends Queryable { + /** + * Gets the set of web part definitions contained by this web part manager + * + */ + readonly webparts: WebPartDefinitions; + /** + * Exports a webpart definition + * + * @param id the GUID id of the definition to export + */ + export(id: string): Promise; + /** + * Imports a webpart + * + * @param xml webpart definition which must be valid XML in the .dwp or .webpart format + */ + import(xml: string): Promise; + } + export class WebPartDefinitions extends QueryableCollection { + /** + * Gets a web part definition from the collection by id + * + * @param id GUID id of the web part definition to get + */ + getById(id: string): WebPartDefinition; + } + export class WebPartDefinition extends QueryableInstance { + /** + * Gets the webpart information associated with this definition + */ + readonly webpart: WebPart; + /** + * Removes a webpart from a page, all settings will be lost + */ + delete(): Promise; + } + export class WebPart extends QueryableInstance { + /** + * Creates a new instance of the WebPart class + * + * @param baseUrl The url or Queryable which forms the parent of this fields collection + * @param path Optional, if supplied will be appended to the supplied baseUrl + */ + constructor(baseUrl: string | Queryable, path?: string); + } +} +declare module "sharepoint/files" { + import { Queryable, QueryableCollection, QueryableInstance } from "sharepoint/queryable"; + import { LimitedWebPartManager } from "sharepoint/webparts"; + import { Item } from "sharepoint/items"; + import { QueryableShareableFile } from "sharepoint/queryableshareable"; + export interface ChunkedFileUploadProgressData { + stage: "starting" | "continue" | "finishing"; + blockNumber: number; + totalBlocks: number; + chunkSize: number; + currentPointer: number; + fileSize: number; + } + /** + * Describes a collection of File objects + * + */ + export class Files extends QueryableCollection { + /** + * Creates a new instance of the Files class + * + * @param baseUrl The url or Queryable which forms the parent of this fields collection + */ + constructor(baseUrl: string | Queryable, path?: string); + /** + * Gets a File by filename + * + * @param name The name of the file, including extension. + */ + getByName(name: string): File; + /** + * Uploads a file. Not supported for batching + * + * @param url The folder-relative url of the file. + * @param content The file contents blob. + * @param shouldOverWrite Should a file with the same name in the same location be overwritten? (default: true) + * @returns The new File and the raw response. + */ + add(url: string, content: string | ArrayBuffer | Blob, shouldOverWrite?: boolean): Promise; + /** + * Uploads a file. Not supported for batching + * + * @param url The folder-relative url of the file. + * @param content The Blob file content to add + * @param progress A callback function which can be used to track the progress of the upload + * @param shouldOverWrite Should a file with the same name in the same location be overwritten? (default: true) + * @param chunkSize The size of each file slice, in bytes (default: 10485760) + * @returns The new File and the raw response. + */ + addChunked(url: string, content: string | ArrayBuffer | Blob, progress?: (data: ChunkedFileUploadProgressData) => void, shouldOverWrite?: boolean, chunkSize?: number): Promise; + /** + * Adds a ghosted file to an existing list or document library. Not supported for batching. + * + * @param fileUrl The server-relative url where you want to save the file. + * @param templateFileType The type of use to create the file. + * @returns The template file that was added and the raw response. + */ + addTemplateFile(fileUrl: string, templateFileType: TemplateFileType): Promise; + } + /** + * Describes a single File instance + * + */ + export class File extends QueryableShareableFile { + /** + * Gets a value that specifies the list item field values for the list item corresponding to the file. + * + */ + readonly listItemAllFields: QueryableCollection; + /** + * Gets a collection of versions + * + */ + readonly versions: Versions; + /** + * Approves the file submitted for content approval with the specified comment. + * Only documents in lists that are enabled for content approval can be approved. + * + * @param comment The comment for the approval. + */ + approve(comment: string): Promise; + /** + * Stops the chunk upload session without saving the uploaded data. Does not support batching. + * If the file doesn’t already exist in the library, the partially uploaded file will be deleted. + * Use this in response to user action (as in a request to cancel an upload) or an error or exception. + * Use the uploadId value that was passed to the StartUpload method that started the upload session. + * This method is currently available only on Office 365. + * + * @param uploadId The unique identifier of the upload session. + */ + cancelUpload(uploadId: string): Promise; + /** + * Checks the file in to a document library based on the check-in type. + * + * @param comment A comment for the check-in. Its length must be <= 1023. + * @param checkinType The check-in type for the file. + */ + checkin(comment?: string, checkinType?: CheckinType): Promise; + /** + * Checks out the file from a document library. + */ + checkout(): Promise; + /** + * Copies the file to the destination url. + * + * @param url The absolute url or server relative url of the destination file path to copy to. + * @param shouldOverWrite Should a file with the same name in the same location be overwritten? + */ + copyTo(url: string, shouldOverWrite?: boolean): Promise; + /** + * Delete this file. + * + * @param eTag Value used in the IF-Match header, by default "*" + */ + delete(eTag?: string): Promise; + /** + * Denies approval for a file that was submitted for content approval. + * Only documents in lists that are enabled for content approval can be denied. + * + * @param comment The comment for the denial. + */ + deny(comment?: string): Promise; + /** + * Specifies the control set used to access, modify, or add Web Parts associated with this Web Part Page and view. + * An exception is thrown if the file is not an ASPX page. + * + * @param scope The WebPartsPersonalizationScope view on the Web Parts page. + */ + getLimitedWebPartManager(scope?: WebPartsPersonalizationScope): LimitedWebPartManager; + /** + * Moves the file to the specified destination url. + * + * @param url The absolute url or server relative url of the destination file path to move to. + * @param moveOperations The bitwise MoveOperations value for how to move the file. + */ + moveTo(url: string, moveOperations?: MoveOperations): Promise; + /** + * Submits the file for content approval with the specified comment. + * + * @param comment The comment for the published file. Its length must be <= 1023. + */ + publish(comment?: string): Promise; + /** + * Moves the file to the Recycle Bin and returns the identifier of the new Recycle Bin item. + * + * @returns The GUID of the recycled file. + */ + recycle(): Promise; + /** + * Reverts an existing checkout for the file. + * + */ + undoCheckout(): Promise; + /** + * Removes the file from content approval or unpublish a major version. + * + * @param comment The comment for the unpublish operation. Its length must be <= 1023. + */ + unpublish(comment?: string): Promise; + /** + * Gets the contents of the file as text. Not supported in batching. + * + */ + getText(): Promise; + /** + * Gets the contents of the file as a blob, does not work in Node.js. Not supported in batching. + * + */ + getBlob(): Promise; + /** + * Gets the contents of a file as an ArrayBuffer, works in Node.js. Not supported in batching. + */ + getBuffer(): Promise; + /** + * Gets the contents of a file as an ArrayBuffer, works in Node.js. Not supported in batching. + */ + getJSON(): Promise; + /** + * Sets the content of a file, for large files use setContentChunked. Not supported in batching. + * + * @param content The file content + * + */ + setContent(content: string | ArrayBuffer | Blob): Promise; + /** + * Gets the associated list item for this folder, loading the default properties + */ + getItem(...selects: string[]): Promise; + /** + * Sets the contents of a file using a chunked upload approach. Not supported in batching. + * + * @param file The file to upload + * @param progress A callback function which can be used to track the progress of the upload + * @param chunkSize The size of each file slice, in bytes (default: 10485760) + */ + setContentChunked(file: Blob, progress?: (data: ChunkedFileUploadProgressData) => void, chunkSize?: number): Promise; + /** + * Starts a new chunk upload session and uploads the first fragment. + * The current file content is not changed when this method completes. + * The method is idempotent (and therefore does not change the result) as long as you use the same values for uploadId and stream. + * The upload session ends either when you use the CancelUpload method or when you successfully + * complete the upload session by passing the rest of the file contents through the ContinueUpload and FinishUpload methods. + * The StartUpload and ContinueUpload methods return the size of the running total of uploaded data in bytes, + * so you can pass those return values to subsequent uses of ContinueUpload and FinishUpload. + * This method is currently available only on Office 365. + * + * @param uploadId The unique identifier of the upload session. + * @param fragment The file contents. + * @returns The size of the total uploaded data in bytes. + */ + private startUpload(uploadId, fragment); + /** + * Continues the chunk upload session with an additional fragment. + * The current file content is not changed. + * Use the uploadId value that was passed to the StartUpload method that started the upload session. + * This method is currently available only on Office 365. + * + * @param uploadId The unique identifier of the upload session. + * @param fileOffset The size of the offset into the file where the fragment starts. + * @param fragment The file contents. + * @returns The size of the total uploaded data in bytes. + */ + private continueUpload(uploadId, fileOffset, fragment); + /** + * Uploads the last file fragment and commits the file. The current file content is changed when this method completes. + * Use the uploadId value that was passed to the StartUpload method that started the upload session. + * This method is currently available only on Office 365. + * + * @param uploadId The unique identifier of the upload session. + * @param fileOffset The size of the offset into the file where the fragment starts. + * @param fragment The file contents. + * @returns The newly uploaded file. + */ + private finishUpload(uploadId, fileOffset, fragment); + } + /** + * Describes a collection of Version objects + * + */ + export class Versions extends QueryableCollection { + /** + * Creates a new instance of the File class + * + * @param baseUrl The url or Queryable which forms the parent of this fields collection + */ + constructor(baseUrl: string | Queryable, path?: string); + /** + * Gets a version by id + * + * @param versionId The id of the version to retrieve + */ + getById(versionId: number): Version; + /** + * Deletes all the file version objects in the collection. + * + */ + deleteAll(): Promise; + /** + * Deletes the specified version of the file. + * + * @param versionId The ID of the file version to delete. + */ + deleteById(versionId: number): Promise; + /** + * Deletes the file version object with the specified version label. + * + * @param label The version label of the file version to delete, for example: 1.2 + */ + deleteByLabel(label: string): Promise; + /** + * Creates a new file version from the file specified by the version label. + * + * @param label The version label of the file version to restore, for example: 1.2 + */ + restoreByLabel(label: string): Promise; + } + /** + * Describes a single Version instance + * + */ + export class Version extends QueryableInstance { + /** + * Delete a specific version of a file. + * + * @param eTag Value used in the IF-Match header, by default "*" + */ + delete(eTag?: string): Promise; + } + export enum CheckinType { + Minor = 0, + Major = 1, + Overwrite = 2, + } + export interface FileAddResult { + file: File; + data: any; + } + export enum WebPartsPersonalizationScope { + User = 0, + Shared = 1, + } + export enum MoveOperations { + Overwrite = 1, + AllowBrokenThickets = 8, + } + export enum TemplateFileType { + StandardPage = 0, + WikiPage = 1, + FormPage = 2, + } +} +declare module "sharepoint/folders" { + import { Queryable, QueryableCollection, QueryableInstance } from "sharepoint/queryable"; + import { QueryableShareableFolder } from "sharepoint/queryableshareable"; + import { Files } from "sharepoint/files"; + import { TypedHash } from "collections/collections"; + import { Item } from "sharepoint/items"; + /** + * Describes a collection of Folder objects + * + */ + export class Folders extends QueryableCollection { + /** + * Creates a new instance of the Folders class + * + * @param baseUrl The url or Queryable which forms the parent of this fields collection + */ + constructor(baseUrl: string | Queryable, path?: string); + /** + * Gets a folder by folder name + * + */ + getByName(name: string): Folder; + /** + * Adds a new folder to the current folder (relative) or any folder (absolute) + * + * @param url The relative or absolute url where the new folder will be created. Urls starting with a forward slash are absolute. + * @returns The new Folder and the raw response. + */ + add(url: string): Promise; + } + /** + * Describes a single Folder instance + * + */ + export class Folder extends QueryableShareableFolder { + /** + * Specifies the sequence in which content types are displayed. + * + */ + readonly contentTypeOrder: QueryableCollection; + /** + * Gets this folder's files + * + */ + readonly files: Files; + /** + * Gets this folder's sub folders + * + */ + readonly folders: Folders; + /** + * Gets this folder's list item field values + * + */ + readonly listItemAllFields: QueryableCollection; + /** + * Gets the parent folder, if available + * + */ + readonly parentFolder: Folder; + /** + * Gets this folder's properties + * + */ + readonly properties: QueryableInstance; + /** + * Gets this folder's server relative url + * + */ + readonly serverRelativeUrl: Queryable; + /** + * Gets a value that specifies the content type order. + * + */ + readonly uniqueContentTypeOrder: QueryableCollection; + update(properties: TypedHash): Promise; + /** + * Delete this folder + * + * @param eTag Value used in the IF-Match header, by default "*" + */ + delete(eTag?: string): Promise; + /** + * Moves the folder to the Recycle Bin and returns the identifier of the new Recycle Bin item. + */ + recycle(): Promise; + /** + * Gets the associated list item for this folder, loading the default properties + */ + getItem(...selects: string[]): Promise; + } + export interface FolderAddResult { + folder: Folder; + data: any; + } + export interface FolderUpdateResult { + folder: Folder; + data: any; + } +} +declare module "sharepoint/contenttypes" { + import { TypedHash } from "collections/collections"; + import { Queryable, QueryableCollection, QueryableInstance } from "sharepoint/queryable"; + /** + * Describes a collection of content types + * + */ + export class ContentTypes extends QueryableCollection { + /** + * Creates a new instance of the ContentTypes class + * + * @param baseUrl The url or Queryable which forms the parent of this content types collection + */ + constructor(baseUrl: string | Queryable, path?: string); + /** + * Gets a ContentType by content type id + */ + getById(id: string): ContentType; + /** + * Adds an existing contenttype to a content type collection + * + * @param contentTypeId in the following format, for example: 0x010102 + */ + addAvailableContentType(contentTypeId: string): Promise; + /** + * Adds a new content type to the collection + * + * @param id The desired content type id for the new content type (also determines the parent content type) + * @param name The name of the content type + * @param description The description of the content type + * @param group The group in which to add the content type + * @param additionalSettings Any additional settings to provide when creating the content type + * + */ + add(id: string, name: string, description?: string, group?: string, additionalSettings?: TypedHash): Promise; + } + /** + * Describes a single ContentType instance + * + */ + export class ContentType extends QueryableInstance { + /** + * Gets the column (also known as field) references in the content type. + */ + readonly fieldLinks: FieldLinks; + /** + * Gets a value that specifies the collection of fields for the content type. + */ + readonly fields: QueryableCollection; + /** + * Gets the parent content type of the content type. + */ + readonly parent: ContentType; + /** + * Gets a value that specifies the collection of workflow associations for the content type. + */ + readonly workflowAssociations: QueryableCollection; + /** + * Delete this content type + */ + delete(): Promise; + } + export interface ContentTypeAddResult { + contentType: ContentType; + data: any; + } + /** + * Represents a collection of field link instances + */ + export class FieldLinks extends QueryableCollection { + /** + * Creates a new instance of the ContentType class + * + * @param baseUrl The url or Queryable which forms the parent of this content type instance + */ + constructor(baseUrl: string | Queryable, path?: string); + /** + * Gets a FieldLink by GUID id + * + * @param id The GUID id of the field link + */ + getById(id: string): FieldLink; + } + /** + * Represents a field link instance + */ + export class FieldLink extends QueryableInstance { + } +} +declare module "sharepoint/attachmentfiles" { + import { Queryable, QueryableInstance, QueryableCollection } from "sharepoint/queryable"; + export interface AttachmentFileInfo { + name: string; + content: string | Blob | ArrayBuffer; + } + /** + * Describes a collection of Item objects + * + */ + export class AttachmentFiles extends QueryableCollection { + /** + * Creates a new instance of the AttachmentFiles class + * + * @param baseUrl The url or Queryable which forms the parent of this attachments collection + */ + constructor(baseUrl: string | Queryable, path?: string); + /** + * Gets a Attachment File by filename + * + * @param name The name of the file, including extension. + */ + getByName(name: string): AttachmentFile; + /** + * Adds a new attachment to the collection. Not supported for batching. + * + * @param name The name of the file, including extension. + * @param content The Base64 file content. + */ + add(name: string, content: string | Blob | ArrayBuffer): Promise; + /** + * Adds mjultiple new attachment to the collection. Not supported for batching. + * + * @files name The collection of files to add + */ + addMultiple(files: AttachmentFileInfo[]): Promise; + } + /** + * Describes a single attachment file instance + * + */ + export class AttachmentFile extends QueryableInstance { + /** + * Gets the contents of the file as text + * + */ + getText(): Promise; + /** + * Gets the contents of the file as a blob, does not work in Node.js + * + */ + getBlob(): Promise; + /** + * Gets the contents of a file as an ArrayBuffer, works in Node.js + */ + getBuffer(): Promise; + /** + * Gets the contents of a file as an ArrayBuffer, works in Node.js + */ + getJSON(): Promise; + /** + * Sets the content of a file. Not supported for batching + * + * @param content The value to set for the file contents + */ + setContent(content: string | ArrayBuffer | Blob): Promise; + /** + * Delete this attachment file + * + * @param eTag Value used in the IF-Match header, by default "*" + */ + delete(eTag?: string): Promise; + } + export interface AttachmentFileAddResult { + file: AttachmentFile; + data: any; + } +} +declare module "sharepoint/items" { + import { Queryable, QueryableCollection, QueryableInstance } from "sharepoint/queryable"; + import { QueryableShareableItem } from "sharepoint/queryableshareable"; + import { Folder } from "sharepoint/folders"; + import { File } from "sharepoint/files"; + import { ContentType } from "sharepoint/contenttypes"; + import { TypedHash } from "collections/collections"; + import { ListItemFormUpdateValue } from "sharepoint/types"; + import { AttachmentFiles } from "sharepoint/attachmentfiles"; + /** + * Describes a collection of Item objects + * + */ + export class Items extends QueryableCollection { + /** + * Creates a new instance of the Items class + * + * @param baseUrl The url or Queryable which forms the parent of this fields collection + */ + constructor(baseUrl: string | Queryable, path?: string); + /** + * Gets an Item by id + * + * @param id The integer id of the item to retrieve + */ + getById(id: number): Item; + /** + * Skips the specified number of items (https://msdn.microsoft.com/en-us/library/office/fp142385.aspx#sectionSection6) + * + * @param skip The starting id where the page should start, use with top to specify pages + */ + skip(skip: number): this; + /** + * Gets a collection designed to aid in paging through data + * + */ + getPaged(): Promise>; + /** + * Adds a new item to the collection + * + * @param properties The new items's properties + */ + add(properties?: TypedHash, listItemEntityTypeFullName?: string): Promise; + /** + * Ensures we have the proper list item entity type name, either from the value provided or from the list + * + * @param candidatelistItemEntityTypeFullName The potential type name + */ + private ensureListItemEntityTypeName(candidatelistItemEntityTypeFullName); + } + /** + * Descrines a single Item instance + * + */ + export class Item extends QueryableShareableItem { + /** + * Gets the set of attachments for this item + * + */ + readonly attachmentFiles: AttachmentFiles; + /** + * Gets the content type for this item + * + */ + readonly contentType: ContentType; + /** + * Gets the effective base permissions for the item + * + */ + readonly effectiveBasePermissions: Queryable; + /** + * Gets the effective base permissions for the item in a UI context + * + */ + readonly effectiveBasePermissionsForUI: Queryable; + /** + * Gets the field values for this list item in their HTML representation + * + */ + readonly fieldValuesAsHTML: QueryableInstance; + /** + * Gets the field values for this list item in their text representation + * + */ + readonly fieldValuesAsText: QueryableInstance; + /** + * Gets the field values for this list item for use in editing controls + * + */ + readonly fieldValuesForEdit: QueryableInstance; + /** + * Gets the folder associated with this list item (if this item represents a folder) + * + */ + readonly folder: Folder; + /** + * Gets the folder associated with this list item (if this item represents a folder) + * + */ + readonly file: File; + /** + * Updates this list intance with the supplied properties + * + * @param properties A plain object hash of values to update for the list + * @param eTag Value used in the IF-Match header, by default "*" + */ + update(properties: TypedHash, eTag?: string): Promise; + /** + * Delete this item + * + * @param eTag Value used in the IF-Match header, by default "*" + */ + delete(eTag?: string): Promise; + /** + * Moves the list item to the Recycle Bin and returns the identifier of the new Recycle Bin item. + */ + recycle(): Promise; + /** + * Gets a string representation of the full URL to the WOPI frame. + * If there is no associated WOPI application, or no associated action, an empty string is returned. + * + * @param action Display mode: 0: view, 1: edit, 2: mobileView, 3: interactivePreview + */ + getWopiFrameUrl(action?: number): Promise; + /** + * Validates and sets the values of the specified collection of fields for the list item. + * + * @param formValues The fields to change and their new values. + * @param newDocumentUpdate true if the list item is a document being updated after upload; otherwise false. + */ + validateUpdateListItem(formValues: ListItemFormUpdateValue[], newDocumentUpdate?: boolean): Promise; + } + export interface ItemAddResult { + item: Item; + data: any; + } + export interface ItemUpdateResult { + item: Item; + data: ItemUpdateResultData; + } + export interface ItemUpdateResultData { + "odata.etag": string; + } + /** + * Provides paging functionality for list items + */ + export class PagedItemCollection { + private nextUrl; + results: T; + constructor(nextUrl: string, results: T); + /** + * If true there are more results available in the set, otherwise there are not + */ + readonly hasNext: boolean; + /** + * Gets the next set of results, or resolves to null if no results are available + */ + getNext(): Promise>; + } +} +declare module "sharepoint/views" { + import { Queryable, QueryableCollection, QueryableInstance } from "sharepoint/queryable"; + import { TypedHash } from "collections/collections"; + /** + * Describes the views available in the current context + * + */ + export class Views extends QueryableCollection { + /** + * Creates a new instance of the Views class + * + * @param baseUrl The url or Queryable which forms the parent of this fields collection + */ + constructor(baseUrl: string | Queryable, path?: string); + /** + * Gets a view by guid id + * + * @param id The GUID id of the view + */ + getById(id: string): View; + /** + * Gets a view by title (case-sensitive) + * + * @param title The case-sensitive title of the view + */ + getByTitle(title: string): View; + /** + * Adds a new view to the collection + * + * @param title The new views's title + * @param personalView True if this is a personal view, otherwise false, default = false + * @param additionalSettings Will be passed as part of the view creation body + */ + add(title: string, personalView?: boolean, additionalSettings?: TypedHash): Promise; + } + /** + * Describes a single View instance + * + */ + export class View extends QueryableInstance { + readonly fields: ViewFields; + /** + * Updates this view intance with the supplied properties + * + * @param properties A plain object hash of values to update for the view + */ + update(properties: TypedHash): Promise; + /** + * Delete this view + * + */ + delete(): Promise; + /** + * Returns the list view as HTML. + * + */ + renderAsHtml(): Promise; + } + export class ViewFields extends QueryableCollection { + constructor(baseUrl: string | Queryable, path?: string); + /** + * Gets a value that specifies the XML schema that represents the collection. + */ + getSchemaXml(): Promise; + /** + * Adds the field with the specified field internal name or display name to the collection. + * + * @param fieldTitleOrInternalName The case-sensitive internal name or display name of the field to add. + */ + add(fieldTitleOrInternalName: string): Promise; + /** + * Moves the field with the specified field internal name to the specified position in the collection. + * + * @param fieldInternalName The case-sensitive internal name of the field to move. + * @param index The zero-based index of the new position for the field. + */ + move(fieldInternalName: string, index: number): Promise; + /** + * Removes all the fields from the collection. + */ + removeAll(): Promise; + /** + * Removes the field with the specified field internal name from the collection. + * + * @param fieldInternalName The case-sensitive internal name of the field to remove from the view. + */ + remove(fieldInternalName: string): Promise; + } + export interface ViewAddResult { + view: View; + data: any; + } + export interface ViewUpdateResult { + view: View; + data: any; + } +} +declare module "sharepoint/fields" { + import { Queryable, QueryableCollection, QueryableInstance } from "sharepoint/queryable"; + import { TypedHash } from "collections/collections"; + import { XmlSchemaFieldCreationInformation, DateTimeFieldFormatType, FieldTypes, CalendarType, UrlFieldFormatType } from "sharepoint/types"; + /** + * Describes a collection of Field objects + * + */ + export class Fields extends QueryableCollection { + /** + * Creates a new instance of the Fields class + * + * @param baseUrl The url or Queryable which forms the parent of this fields collection + */ + constructor(baseUrl: string | Queryable, path?: string); + /** + * Gets a field from the collection by title + * + * @param title The case-sensitive title of the field + */ + getByTitle(title: string): Field; + /** + * Gets a field from the collection by using internal name or title + * + * @param name The case-sensitive internal name or title of the field + */ + getByInternalNameOrTitle(name: string): Field; + /** + * Gets a list from the collection by guid id + * + * @param title The Id of the list + */ + getById(id: string): Field; + /** + * Creates a field based on the specified schema + */ + createFieldAsXml(xml: string | XmlSchemaFieldCreationInformation): Promise; + /** + * Adds a new list to the collection + * + * @param title The new field's title + * @param fieldType The new field's type (ex: SP.FieldText) + * @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx) + */ + add(title: string, fieldType: string, properties?: TypedHash): Promise; + /** + * Adds a new SP.FieldText to the collection + * + * @param title The field title + * @param maxLength The maximum number of characters allowed in the value of the field. + * @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx) + */ + addText(title: string, maxLength?: number, properties?: TypedHash): Promise; + /** + * Adds a new SP.FieldCalculated to the collection + * + * @param title The field title. + * @param formula The formula for the field. + * @param dateFormat The date and time format that is displayed in the field. + * @param outputType Specifies the output format for the field. Represents a FieldType value. + * @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx) + */ + addCalculated(title: string, formula: string, dateFormat: DateTimeFieldFormatType, outputType?: FieldTypes, properties?: TypedHash): Promise; + /** + * Adds a new SP.FieldDateTime to the collection + * + * @param title The field title + * @param displayFormat The format of the date and time that is displayed in the field. + * @param calendarType Specifies the calendar type of the field. + * @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx) + */ + addDateTime(title: string, displayFormat?: DateTimeFieldFormatType, calendarType?: CalendarType, friendlyDisplayFormat?: number, properties?: TypedHash): Promise; + /** + * Adds a new SP.FieldNumber to the collection + * + * @param title The field title + * @param minValue The field's minimum value + * @param maxValue The field's maximum value + * @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx) + */ + addNumber(title: string, minValue?: number, maxValue?: number, properties?: TypedHash): Promise; + /** + * Adds a new SP.FieldCurrency to the collection + * + * @param title The field title + * @param minValue The field's minimum value + * @param maxValue The field's maximum value + * @param currencyLocalId Specifies the language code identifier (LCID) used to format the value of the field + * @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx) + */ + addCurrency(title: string, minValue?: number, maxValue?: number, currencyLocalId?: number, properties?: TypedHash): Promise; + /** + * Adds a new SP.FieldMultiLineText to the collection + * + * @param title The field title + * @param numberOfLines Specifies the number of lines of text to display for the field. + * @param richText Specifies whether the field supports rich formatting. + * @param restrictedMode Specifies whether the field supports a subset of rich formatting. + * @param appendOnly Specifies whether all changes to the value of the field are displayed in list forms. + * @param allowHyperlink Specifies whether a hyperlink is allowed as a value of the field. + * @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx) + * + */ + addMultilineText(title: string, numberOfLines?: number, richText?: boolean, restrictedMode?: boolean, appendOnly?: boolean, allowHyperlink?: boolean, properties?: TypedHash): Promise; + /** + * Adds a new SP.FieldUrl to the collection + * + * @param title The field title + */ + addUrl(title: string, displayFormat?: UrlFieldFormatType, properties?: TypedHash): Promise; + } + /** + * Describes a single of Field instance + * + */ + export class Field extends QueryableInstance { + /** + * Updates this field intance with the supplied properties + * + * @param properties A plain object hash of values to update for the list + * @param fieldType The type value, required to update child field type properties + */ + update(properties: TypedHash, fieldType?: string): Promise; + /** + * Delete this fields + * + */ + delete(): Promise; + /** + * Sets the value of the ShowInDisplayForm property for this field. + */ + setShowInDisplayForm(show: boolean): Promise; + /** + * Sets the value of the ShowInEditForm property for this field. + */ + setShowInEditForm(show: boolean): Promise; + /** + * Sets the value of the ShowInNewForm property for this field. + */ + setShowInNewForm(show: boolean): Promise; + } + /** + * This interface defines the result of adding a field + */ + export interface FieldAddResult { + data: any; + field: Field; + } + export interface FieldUpdateResult { + data: any; + field: Field; + } +} +declare module "sharepoint/forms" { + import { Queryable, QueryableCollection, QueryableInstance } from "sharepoint/queryable"; + /** + * Describes a collection of Field objects + * + */ + export class Forms extends QueryableCollection { + /** + * Creates a new instance of the Fields class + * + * @param baseUrl The url or Queryable which forms the parent of this fields collection + */ + constructor(baseUrl: string | Queryable, path?: string); + /** + * Gets a form by id + * + * @param id The guid id of the item to retrieve + */ + getById(id: string): Form; + } + /** + * Describes a single of Form instance + * + */ + export class Form extends QueryableInstance { + } +} +declare module "sharepoint/subscriptions" { + import { Queryable, QueryableCollection, QueryableInstance } from "sharepoint/queryable"; + /** + * Describes a collection of webhook subscriptions + * + */ + export class Subscriptions extends QueryableCollection { + /** + * Creates a new instance of the Subscriptions class + * + * @param baseUrl - The url or Queryable which forms the parent of this webhook subscriptions collection + */ + constructor(baseUrl: string | Queryable, path?: string); + /** + * Returns all the webhook subscriptions or the specified webhook subscription + * + */ + getById(subscriptionId: string): Subscription; + /** + * Create a new webhook subscription + * + */ + add(notificationUrl: string, expirationDate: string, clientState?: string): Promise; + } + /** + * Describes a single webhook subscription instance + * + */ + export class Subscription extends QueryableInstance { + /** + * Update a webhook subscription + * + */ + update(expirationDate: string): Promise; + /** + * Remove a webhook subscription + * + */ + delete(): Promise; + } + export interface SubscriptionAddResult { + subscription: Subscription; + data: any; + } + export interface SubscriptionUpdateResult { + subscription: Subscription; + data: any; + } +} +declare module "sharepoint/usercustomactions" { + import { Queryable, QueryableInstance, QueryableCollection } from "sharepoint/queryable"; + import { TypedHash } from "collections/collections"; + export class UserCustomActions extends QueryableCollection { + constructor(baseUrl: string | Queryable, path?: string); + /** + * Returns the custom action with the specified identifier. + * + * @param id The GUID ID of the user custom action to get. + */ + getById(id: string): UserCustomAction; + /** + * Create a custom action + * + * @param creationInfo The information which defines the new custom action + * + */ + add(properties: TypedHash): Promise; + /** + * Deletes all custom actions in the collection. + * + */ + clear(): Promise; + } + export class UserCustomAction extends QueryableInstance { + update(properties: TypedHash): Promise; + /** + * Remove a custom action + * + */ + delete(): Promise; + } + export interface UserCustomActionAddResult { + data: any; + action: UserCustomAction; + } + export interface UserCustomActionUpdateResult { + data: any; + action: UserCustomAction; + } +} +declare module "sharepoint/lists" { + import { Items } from "sharepoint/items"; + import { Views, View } from "sharepoint/views"; + import { ContentTypes } from "sharepoint/contenttypes"; + import { Fields } from "sharepoint/fields"; + import { Forms } from "sharepoint/forms"; + import { Subscriptions } from "sharepoint/subscriptions"; + import { Queryable, QueryableInstance, QueryableCollection } from "sharepoint/queryable"; + import { QueryableSecurable } from "sharepoint/queryablesecurable"; + import { TypedHash } from "collections/collections"; + import { ControlMode, RenderListData, ChangeQuery, CamlQuery, ChangeLogitemQuery, ListFormData } from "sharepoint/types"; + import { UserCustomActions } from "sharepoint/usercustomactions"; + import { Folder } from "sharepoint/folders"; + /** + * Describes a collection of List objects + * + */ + export class Lists extends QueryableCollection { + /** + * Creates a new instance of the Lists class + * + * @param baseUrl The url or Queryable which forms the parent of this fields collection + */ + constructor(baseUrl: string | Queryable, path?: string); + /** + * Gets a list from the collection by title + * + * @param title The title of the list + */ + getByTitle(title: string): List; + /** + * Gets a list from the collection by guid id + * + * @param id The Id of the list (GUID) + */ + getById(id: string): List; + /** + * Adds a new list to the collection + * + * @param title The new list's title + * @param description The new list's description + * @param template The list template value + * @param enableContentTypes If true content types will be allowed and enabled, otherwise they will be disallowed and not enabled + * @param additionalSettings Will be passed as part of the list creation body + */ + add(title: string, description?: string, template?: number, enableContentTypes?: boolean, additionalSettings?: TypedHash): Promise; + /** + * Ensures that the specified list exists in the collection (note: this method not supported for batching) + * + * @param title The new list's title + * @param description The new list's description + * @param template The list template value + * @param enableContentTypes If true content types will be allowed and enabled, otherwise they will be disallowed and not enabled + * @param additionalSettings Will be passed as part of the list creation body or used to update an existing list + */ + ensure(title: string, description?: string, template?: number, enableContentTypes?: boolean, additionalSettings?: TypedHash): Promise; + /** + * Gets a list that is the default asset location for images or other files, which the users upload to their wiki pages. + */ + ensureSiteAssetsLibrary(): Promise; + /** + * Gets a list that is the default location for wiki pages. + */ + ensureSitePagesLibrary(): Promise; + } + /** + * Describes a single List instance + * + */ + export class List extends QueryableSecurable { + /** + * Gets the content types in this list + * + */ + readonly contentTypes: ContentTypes; + /** + * Gets the items in this list + * + */ + readonly items: Items; + /** + * Gets the views in this list + * + */ + readonly views: Views; + /** + * Gets the fields in this list + * + */ + readonly fields: Fields; + /** + * Gets the forms in this list + * + */ + readonly forms: Forms; + /** + * Gets the default view of this list + * + */ + readonly defaultView: QueryableInstance; + /** + * Get all custom actions on a site collection + * + */ + readonly userCustomActions: UserCustomActions; + /** + * Gets the effective base permissions of this list + * + */ + readonly effectiveBasePermissions: Queryable; + /** + * Gets the event receivers attached to this list + * + */ + readonly eventReceivers: QueryableCollection; + /** + * Gets the related fields of this list + * + */ + readonly relatedFields: Queryable; + /** + * Gets the IRM settings for this list + * + */ + readonly informationRightsManagementSettings: Queryable; + /** + * Gets the webhook subscriptions of this list + * + */ + readonly subscriptions: Subscriptions; + /** + * The root folder of the list + */ + readonly rootFolder: Folder; + /** + * Gets a view by view guid id + * + */ + getView(viewId: string): View; + /** + * Updates this list intance with the supplied properties + * + * @param properties A plain object hash of values to update for the list + * @param eTag Value used in the IF-Match header, by default "*" + */ + update(properties: TypedHash, eTag?: string): Promise; + /** + * Delete this list + * + * @param eTag Value used in the IF-Match header, by default "*" + */ + delete(eTag?: string): Promise; + /** + * Returns the collection of changes from the change log that have occurred within the list, based on the specified query. + */ + getChanges(query: ChangeQuery): Promise; + /** + * Returns a collection of items from the list based on the specified query. + * + * @param CamlQuery The Query schema of Collaborative Application Markup + * Language (CAML) is used in various ways within the context of Microsoft SharePoint Foundation + * to define queries against list data. + * see: + * + * https://msdn.microsoft.com/en-us/library/office/ms467521.aspx + * + * @param expands A URI with a $expand System Query Option indicates that Entries associated with + * the Entry or Collection of Entries identified by the Resource Path + * section of the URI must be represented inline (i.e. eagerly loaded). + * see: + * + * https://msdn.microsoft.com/en-us/library/office/fp142385.aspx + * + * http://www.odata.org/documentation/odata-version-2-0/uri-conventions/#ExpandSystemQueryOption + */ + getItemsByCAMLQuery(query: CamlQuery, ...expands: string[]): Promise; + /** + * See: https://msdn.microsoft.com/en-us/library/office/dn292554.aspx + */ + getListItemChangesSinceToken(query: ChangeLogitemQuery): Promise; + /** + * Moves the list to the Recycle Bin and returns the identifier of the new Recycle Bin item. + */ + recycle(): Promise; + /** + * Renders list data based on the view xml provided + */ + renderListData(viewXml: string): Promise; + /** + * Gets the field values and field schema attributes for a list item. + */ + renderListFormData(itemId: number, formId: string, mode: ControlMode): Promise; + /** + * Reserves a list item ID for idempotent list item creation. + */ + reserveListItemId(): Promise; + /** + * Returns the ListItemEntityTypeFullName for this list, used when adding/updating list items. Does not support batching. + * + */ + getListItemEntityTypeFullName(): Promise; + } + export interface ListAddResult { + list: List; + data: any; + } + export interface ListUpdateResult { + list: List; + data: any; + } + export interface ListEnsureResult { + list: List; + created: boolean; + data: any; + } +} +declare module "sharepoint/navigation" { + import { TypedHash } from "collections/collections"; + import { Queryable, QueryableInstance, QueryableCollection } from "sharepoint/queryable"; + export interface NavigationNodeAddResult { + data: any; + node: NavigationNode; + } + export interface NavigationNodeUpdateResult { + data: any; + node: NavigationNode; + } + /** + * Represents a collection of navigation nodes + * + */ + export class NavigationNodes extends QueryableCollection { + /** + * Gets a navigation node by id + * + * @param id The id of the node + */ + getById(id: number): NavigationNode; + /** + * 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) + */ + add(title: string, url: string, visible?: boolean): Promise; + /** + * 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 + */ + moveAfter(nodeId: number, previousNodeId: number): Promise; + } + export class NavigationNode extends QueryableInstance { + /** + * Represents the child nodes of this node + */ + readonly children: NavigationNodes; + /** + * Updates this node based on the supplied properties + * + * @param properties The hash of key/value pairs to update + */ + update(properties: TypedHash): Promise; + /** + * Deletes this node and any child nodes + */ + delete(): Promise; + } + /** + * Exposes the navigation components + * + */ + export class Navigation extends Queryable { + /** + * Creates a new instance of the Lists class + * + * @param baseUrl The url or Queryable which forms the parent of this fields collection + */ + constructor(baseUrl: string | Queryable, path?: string); + /** + * Gets the quicklaunch navigation for the current context + * + */ + readonly quicklaunch: NavigationNodes; + /** + * Gets the top bar navigation navigation for the current context + * + */ + readonly topNavigationBar: NavigationNodes; + } +} +declare module "sharepoint/features" { + import { Queryable, QueryableInstance, QueryableCollection } from "sharepoint/queryable"; + /** + * Describes a collection of List objects + * + */ + export class Features extends QueryableCollection { + /** + * Creates a new instance of the Lists class + * + * @param baseUrl The url or Queryable which forms the parent of this fields collection + */ + constructor(baseUrl: string | Queryable, path?: string); + /** + * Gets a list from the collection by guid id + * + * @param id The Id of the feature (GUID) + */ + getById(id: string): Feature; + /** + * Adds a new list to the collection + * + * @param id The Id of the feature (GUID) + * @param force If true the feature activation will be forced + */ + add(id: string, force?: boolean): Promise; + /** + * 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 + */ + remove(id: string, force?: boolean): Promise; + } + export class Feature extends QueryableInstance { + /** + * Removes (deactivates) a feature from the collection + * + * @param force If true the feature deactivation will be forced + */ + deactivate(force?: boolean): Promise; + } + export interface FeatureAddResult { + data: any; + feature: Feature; + } +} +declare module "sharepoint/relateditems" { + import { Queryable } from "sharepoint/queryable"; + export interface RelatedItem { + ListId: string; + ItemId: number; + Url: string; + Title: string; + WebId: string; + IconUrl: string; + } + export interface RelatedItemManger { + getRelatedItems(sourceListName: string, sourceItemId: number): Promise; + getPageOneRelatedItems(sourceListName: string, sourceItemId: number): Promise; + addSingleLink(sourceListName: string, sourceItemId: number, sourceWebUrl: string, targetListName: string, targetItemID: number, targetWebUrl: string, tryAddReverseLink?: boolean): Promise; + /** + * 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) + */ + addSingleLinkToUrl(sourceListName: string, sourceItemId: number, targetItemUrl: string, tryAddReverseLink?: boolean): Promise; + /** + * 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) + */ + addSingleLinkFromUrl(sourceItemUrl: string, targetListName: string, targetItemId: number, tryAddReverseLink?: boolean): Promise; + deleteSingleLink(sourceListName: string, sourceItemId: number, sourceWebUrl: string, targetListName: string, targetItemId: number, targetWebUrl: string, tryDeleteReverseLink?: boolean): Promise; + } + export class RelatedItemManagerImpl extends Queryable implements RelatedItemManger { + static FromUrl(url: string): RelatedItemManagerImpl; + constructor(baseUrl: string | Queryable, path?: string); + getRelatedItems(sourceListName: string, sourceItemId: number): Promise; + getPageOneRelatedItems(sourceListName: string, sourceItemId: number): Promise; + addSingleLink(sourceListName: string, sourceItemId: number, sourceWebUrl: string, targetListName: string, targetItemID: number, targetWebUrl: string, tryAddReverseLink?: boolean): Promise; + /** + * 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) + */ + addSingleLinkToUrl(sourceListName: string, sourceItemId: number, targetItemUrl: string, tryAddReverseLink?: boolean): Promise; + /** + * 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) + */ + addSingleLinkFromUrl(sourceItemUrl: string, targetListName: string, targetItemId: number, tryAddReverseLink?: boolean): Promise; + deleteSingleLink(sourceListName: string, sourceItemId: number, sourceWebUrl: string, targetListName: string, targetItemId: number, targetWebUrl: string, tryDeleteReverseLink?: boolean): Promise; + } +} +declare module "sharepoint/webs" { + import { Queryable, QueryableCollection } from "sharepoint/queryable"; + import { Lists } from "sharepoint/lists"; + import { Fields } from "sharepoint/fields"; + import { Navigation } from "sharepoint/navigation"; + import { SiteGroups, SiteGroup } from "sharepoint/sitegroups"; + import { ContentTypes } from "sharepoint/contenttypes"; + import { Folders, Folder } from "sharepoint/folders"; + import { RoleDefinitions } from "sharepoint/roles"; + import { File } from "sharepoint/files"; + import { TypedHash } from "collections/collections"; + import { BasePermissions, ChangeQuery } from "sharepoint/types"; + import { List } from "sharepoint/lists"; + import { SiteUsers, SiteUser, CurrentUser, SiteUserProps } from "sharepoint/siteusers"; + import { UserCustomActions } from "sharepoint/usercustomactions"; + import { ODataBatch } from "sharepoint/odata"; + import { Features } from "sharepoint/features"; + import { QueryableShareableWeb } from "sharepoint/queryableshareable"; + import { RelatedItemManger } from "sharepoint/relateditems"; + export class Webs extends QueryableCollection { + constructor(baseUrl: string | Queryable, webPath?: string); + /** + * Adds a new web to the collection + * + * @param title The new web's title + * @param url The new web's relative url + * @param description The web web's description + * @param template The web's template + * @param language The language code to use for this web + * @param inheritPermissions If true permissions will be inherited from the partent web + * @param additionalSettings Will be passed as part of the web creation body + */ + add(title: string, url: string, description?: string, template?: string, language?: number, inheritPermissions?: boolean, additionalSettings?: TypedHash): Promise; + } + /** + * Describes a web + * + */ + export class Web extends QueryableShareableWeb { + /** + * 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 + */ + static fromUrl(url: string, path?: string): Web; + constructor(baseUrl: string | Queryable, path?: string); + readonly webs: Webs; + /** + * Get the content types available in this web + * + */ + readonly contentTypes: ContentTypes; + /** + * Get the lists in this web + * + */ + readonly lists: Lists; + /** + * Gets the fields in this web + * + */ + readonly fields: Fields; + /** + * Gets the active features for this web + * + */ + readonly features: Features; + /** + * Gets the available fields in this web + * + */ + readonly availablefields: Fields; + /** + * Get the navigation options in this web + * + */ + readonly navigation: Navigation; + /** + * Gets the site users + * + */ + readonly siteUsers: SiteUsers; + /** + * Gets the site groups + * + */ + readonly siteGroups: SiteGroups; + /** + * Gets the current user + */ + readonly currentUser: CurrentUser; + /** + * Get the folders in this web + * + */ + readonly folders: Folders; + /** + * Get all custom actions on a site + * + */ + readonly userCustomActions: UserCustomActions; + /** + * Gets the collection of RoleDefinition resources. + * + */ + readonly roleDefinitions: RoleDefinitions; + /** + * Provides an interface to manage related items + * + */ + readonly relatedItems: RelatedItemManger; + /** + * Creates a new batch for requests within the context of context this web + * + */ + createBatch(): ODataBatch; + /** + * The root folder of the web + */ + readonly rootFolder: Folder; + readonly associatedOwnerGroup: SiteGroup; + readonly associatedMemberGroup: SiteGroup; + readonly associatedVisitorGroup: SiteGroup; + /** + * Get a folder by server relative url + * + * @param folderRelativeUrl the server relative path to the folder (including /sites/ if applicable) + */ + getFolderByServerRelativeUrl(folderRelativeUrl: string): Folder; + /** + * Get a file by server relative url + * + * @param fileRelativeUrl the server relative path to the file (including /sites/ if applicable) + */ + getFileByServerRelativeUrl(fileRelativeUrl: string): File; + /** + * Get a list by server relative url (list's root folder) + * + * @param listRelativeUrl the server relative path to the list's root folder (including /sites/ if applicable) + */ + getList(listRelativeUrl: string): List; + /** + * Updates this web intance with the supplied properties + * + * @param properties A plain object hash of values to update for the web + */ + update(properties: TypedHash): Promise; + /** + * Delete this web + * + */ + delete(): Promise; + /** + * Applies the theme specified by the contents of each of the files specified in the arguments to the site. + * + * @param colorPaletteUrl Server-relative URL of the color palette file. + * @param fontSchemeUrl Server-relative URL of the font scheme. + * @param backgroundImageUrl Server-relative URL of the background image. + * @param shareGenerated true to store the generated theme files in the root site, or false to store them in this site. + */ + applyTheme(colorPaletteUrl: string, fontSchemeUrl: string, backgroundImageUrl: string, shareGenerated: boolean): Promise; + /** + * 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 + */ + applyWebTemplate(template: string): Promise; + /** + * Returns whether the current user has the given set of permissions. + * + * @param perms The high and low permission range. + */ + doesUserHavePermissions(perms: BasePermissions): Promise; + /** + * Checks whether the specified login name belongs to a valid user in the site. If the user doesn't exist, adds the user to the site. + * + * @param loginName The login name of the user (ex: i:0#.f|membership|user@domain.onmicrosoft.com) + */ + ensureUser(loginName: string): Promise; + /** + * Returns a collection of site templates available for the site. + * + * @param language The LCID of the site templates to get. + * @param true to include language-neutral site templates; otherwise false + */ + availableWebTemplates(language?: number, includeCrossLanugage?: boolean): QueryableCollection; + /** + * 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 + */ + getCatalog(type: number): Promise; + /** + * Returns the collection of changes from the change log that have occurred within the list, based on the specified query. + */ + getChanges(query: ChangeQuery): Promise; + /** + * Gets the custom list templates for the site. + * + */ + readonly customListTemplate: QueryableCollection; + /** + * Returns the user corresponding to the specified member identifier for the current site. + * + * @param id The ID of the user. + */ + getUserById(id: number): SiteUser; + /** + * Returns the name of the image file for the icon that is used to represent the specified file. + * + * @param filename The file name. If this parameter is empty, the server returns an empty string. + * @param size The size of the icon: 16x16 pixels = 0, 32x32 pixels = 1. + * @param progId The ProgID of the application that was used to create the file, in the form OLEServerName.ObjectName + */ + mapToIcon(filename: string, size?: number, progId?: string): Promise; + } + export interface WebAddResult { + data: any; + web: Web; + } + export interface WebUpdateResult { + data: any; + web: Web; + } + export interface GetCatalogResult { + data: any; + list: List; + } + export interface WebEnsureUserResult { + data: SiteUserProps; + user: SiteUser; + } +} +declare module "sharepoint/site" { + import { Queryable, QueryableInstance } from "sharepoint/queryable"; + import { Web } from "sharepoint/webs"; + import { UserCustomActions } from "sharepoint/usercustomactions"; + import { ContextInfo, DocumentLibraryInformation } from "sharepoint/types"; + import { ODataBatch } from "sharepoint/odata"; + import { Features } from "sharepoint/features"; + /** + * Describes a site collection + * + */ + export class Site extends QueryableInstance { + /** + * Creates a new instance of the RoleAssignments class + * + * @param baseUrl The url or Queryable which forms the parent of this fields collection + */ + constructor(baseUrl: string | Queryable, path?: string); + /** + * Gets the root web of the site collection + * + */ + readonly rootWeb: Web; + /** + * Gets the active features for this site + * + */ + readonly features: Features; + /** + * Get all custom actions on a site collection + * + */ + readonly userCustomActions: UserCustomActions; + /** + * Gets the context information for the site. + */ + getContextInfo(): Promise; + /** + * 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 + */ + getDocumentLibraries(absoluteWebUrl: string): Promise; + /** + * Gets the site URL from a page URL. + * + * @param absolutePageUrl The absolute url of the page + */ + getWebUrlFromPageUrl(absolutePageUrl: string): Promise; + /** + * Creates a new batch for requests within the context of context this site + * + */ + createBatch(): ODataBatch; + } +} +declare module "utils/files" { + /** + * Reads a blob as text + * + * @param blob The data to read + */ + export function readBlobAsText(blob: Blob): Promise; + /** + * Reads a blob into an array buffer + * + * @param blob The data to read + */ + export function readBlobAsArrayBuffer(blob: Blob): Promise; +} +declare module "sharepoint/userprofiles" { + import { Queryable, QueryableInstance, QueryableCollection } from "sharepoint/queryable"; + import { HashTagCollection, UserProfile } from "sharepoint/types"; + export class UserProfileQuery extends QueryableInstance { + private profileLoader; + constructor(baseUrl: string | Queryable, path?: string); + /** + * The URL of the edit profile page for the current user. + */ + readonly editProfileLink: Promise; + /** + * A Boolean value that indicates whether the current user's People I'm Following list is public. + */ + readonly isMyPeopleListPublic: Promise; + /** + * A Boolean value that indicates whether the current user's People I'm Following list is public. + * + * @param loginName The account name of the user + */ + amIFollowedBy(loginName: string): Promise; + /** + * Checks whether the current user is following the specified user. + * + * @param loginName The account name of the user + */ + amIFollowing(loginName: string): Promise; + /** + * Gets tags that the user is following. + * + * @param maxCount The maximum number of tags to get. + */ + getFollowedTags(maxCount?: number): Promise; + /** + * Gets the people who are following the specified user. + * + * @param loginName The account name of the user. + */ + getFollowersFor(loginName: string): Promise; + /** + * Gets the people who are following the current user. + * + */ + readonly myFollowers: QueryableCollection; + /** + * Gets user properties for the current user. + * + */ + readonly myProperties: QueryableInstance; + /** + * Gets the people who the specified user is following. + * + * @param loginName The account name of the user. + */ + getPeopleFollowedBy(loginName: string): Promise; + /** + * Gets user properties for the specified user. + * + * @param loginName The account name of the user. + */ + getPropertiesFor(loginName: string): Promise; + /** + * Gets the most popular tags. + * + */ + readonly trendingTags: Promise; + /** + * 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. + */ + getUserProfilePropertyFor(loginName: string, propertyName: string): Promise; + /** + * Removes the specified user from the user's list of suggested people to follow. + * + * @param loginName The account name of the user. + */ + hideSuggestion(loginName: string): Promise; + /** + * Checks whether the first user is following the second user. + * + * @param follower The account name of the user who might be following followee. + * @param followee The account name of the user who might be followed. + */ + isFollowing(follower: string, followee: string): Promise; + /** + * Uploads and sets the user profile picture. Not supported for batching. + * + * @param profilePicSource Blob data representing the user's picture + */ + setMyProfilePic(profilePicSource: Blob): Promise; + /** + * 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 + */ + createPersonalSiteEnqueueBulk(...emails: string[]): Promise; + /** + * Gets the user profile of the site owner. + * + */ + readonly ownerUserProfile: Promise; + /** + * Gets the user profile that corresponds to the current user. + */ + readonly userProfile: Promise; + /** + * Enqueues creating a personal site for this user, which can be used to share documents, web pages, and other files. + * + * @param interactiveRequest true if interactively (web) initiated request, or false if non-interactively (client) initiated request + */ + createPersonalSite(interactiveRequest?: boolean): Promise; + /** + * Sets the privacy settings for this profile. + * + * @param share true to make all social data public; false to make all social data private. + */ + shareAllSocialData(share: boolean): Promise; + } +} +declare module "sharepoint/rest" { + import { SearchQuery, SearchResults } from "sharepoint/search"; + import { SearchSuggestQuery, SearchSuggestResult } from "sharepoint/searchsuggest"; + import { Site } from "sharepoint/site"; + import { Web } from "sharepoint/webs"; + import { UserProfileQuery } from "sharepoint/userprofiles"; + import { ODataBatch } from "sharepoint/odata"; + /** + * Root of the SharePoint REST module + */ + export class Rest { + /** + * Executes a search against this web context + * + * @param query The SearchQuery definition + */ + searchSuggest(query: string | SearchSuggestQuery): Promise; + /** + * Executes a search against this web context + * + * @param query The SearchQuery definition + */ + search(query: string | SearchQuery): Promise; + /** + * Begins a site collection scoped REST request + * + */ + readonly site: Site; + /** + * Begins a web scoped REST request + * + */ + readonly web: Web; + /** + * Access to user profile methods + * + */ + readonly profiles: UserProfileQuery; + /** + * Creates a new batch object for use with the Queryable.addToBatch method + * + */ + createBatch(): ODataBatch; + /** + * Begins a cross-domain, host site scoped REST request, for use in add-in webs + * + * @param addInWebUrl The absolute url of the add-in web + * @param hostWebUrl The absolute url of the host web + */ + crossDomainSite(addInWebUrl: string, hostWebUrl: string): Site; + /** + * Begins a cross-domain, host web scoped REST request, for use in add-in webs + * + * @param addInWebUrl The absolute url of the add-in web + * @param hostWebUrl The absolute url of the host web + */ + crossDomainWeb(addInWebUrl: string, hostWebUrl: string): Web; + /** + * Implements the creation of cross domain REST urls + * + * @param factory The constructor of the object to create Site | Web + * @param addInWebUrl The absolute url of the add-in web + * @param hostWebUrl The absolute url of the host web + * @param urlPart String part to append to the url "site" | "web" + */ + private _cdImpl(factory, addInWebUrl, hostWebUrl, urlPart); + } +} +declare module "sharepoint/index" { + export * from "sharepoint/caching"; + export { AttachmentFileAddResult, AttachmentFileInfo } from "sharepoint/attachmentfiles"; + export { FieldAddResult, FieldUpdateResult } from "sharepoint/fields"; + export { CheckinType, FileAddResult, WebPartsPersonalizationScope, MoveOperations, TemplateFileType, ChunkedFileUploadProgressData } from "sharepoint/files"; + export { FeatureAddResult } from "sharepoint/features"; + export { FolderAddResult, Folder, Folders } from "sharepoint/folders"; + export { Item, Items, ItemAddResult, ItemUpdateResult, ItemUpdateResultData, PagedItemCollection } from "sharepoint/items"; + export { NavigationNodeAddResult, NavigationNodeUpdateResult, NavigationNodes, NavigationNode } from "sharepoint/navigation"; + export { List, Lists, ListAddResult, ListUpdateResult, ListEnsureResult } from "sharepoint/lists"; + export { extractOdataId, ODataParser, ODataParserBase, ODataDefaultParser, ODataRaw, ODataValue, ODataEntity, ODataEntityArray, TextFileParser, BlobFileParser, BufferFileParser, JSONFileParser } from "sharepoint/odata"; + export { Queryable, QueryableInstance, QueryableCollection, QueryableConstructor } from "sharepoint/queryable"; + export { RelatedItem, RelatedItemManger } from "sharepoint/relateditems"; + export { RoleDefinitionUpdateResult, RoleDefinitionAddResult, RoleDefinitionBindings } from "sharepoint/roles"; + export { Search, SearchProperty, SearchPropertyValue, SearchQuery, SearchResult, SearchResults, Sort, SortDirection, ReorderingRule, ReorderingRuleMatchType, QueryPropertyValueType } from "sharepoint/search"; + export { SearchSuggest, SearchSuggestQuery, SearchSuggestResult, PersonalResultSuggestion } from "sharepoint/searchsuggest"; + export { Site } from "sharepoint/site"; + export { SiteGroupAddResult } from "sharepoint/sitegroups"; + export { UserUpdateResult, SiteUserProps } from "sharepoint/siteusers"; + export { SubscriptionAddResult, SubscriptionUpdateResult } from "sharepoint/subscriptions"; + export * from "sharepoint/types"; + export { UserCustomActionAddResult, UserCustomActionUpdateResult } from "sharepoint/usercustomactions"; + export { ViewAddResult, ViewUpdateResult } from "sharepoint/views"; + export { Web, WebAddResult, WebUpdateResult, GetCatalogResult, WebEnsureUserResult } from "sharepoint/webs"; +} +declare module "net/sprequestexecutorclient" { + import { HttpClientImpl } from "net/httpclient"; + /** + * Makes requests using the SP.RequestExecutor library. + */ + export class SPRequestExecutorClient implements HttpClientImpl { + /** + * Fetches a URL using the SP.RequestExecutor library. + */ + fetch(url: string, options: any): Promise; + /** + * Converts a SharePoint REST API response to a fetch API response. + */ + private convertToResponse; + } +} +declare module "net/nodefetchclient" { + import { HttpClientImpl } from "net/httpclient"; + export interface AuthToken { + token_type: string; + expires_in: string; + not_before: string; + expires_on: string; + resource: string; + access_token: string; + } + /** + * Fetch client for use within nodejs, requires you register a client id and secret with app only permissions + */ + export class NodeFetchClient implements HttpClientImpl { + siteUrl: string; + private _clientId; + private _clientSecret; + private _realm; + private static SharePointServicePrincipal; + private token; + constructor(siteUrl: string, _clientId: string, _clientSecret: string, _realm?: string); + fetch(url: string, options: any): Promise; + /** + * Gets an add-in only authentication token based on the supplied site url, client id and secret + */ + getAddInOnlyAccessToken(): Promise; + private getRealm(); + private getAuthUrl(realm); + private getFormattedPrincipal(principalName, hostName, realm); + private toDate(epoch); + } +} +declare module "configuration/providers/cachingConfigurationProvider" { + import { IConfigurationProvider } from "configuration/configuration"; + import { TypedHash } from "collections/collections"; + import * as storage from "utils/storage"; + /** + * A caching provider which can wrap other non-caching providers + * + */ + export default class CachingConfigurationProvider implements IConfigurationProvider { + private wrappedProvider; + private store; + private cacheKey; + /** + * Creates a new caching configuration provider + * @constructor + * @param {IConfigurationProvider} wrappedProvider Provider which will be used to fetch the configuration + * @param {string} cacheKey Key that will be used to store cached items to the cache + * @param {IPnPClientStore} cacheStore OPTIONAL storage, which will be used to store cached settings. + */ + constructor(wrappedProvider: IConfigurationProvider, cacheKey: string, cacheStore?: storage.PnPClientStore); + /** + * Gets the wrapped configuration providers + * + * @return {IConfigurationProvider} Wrapped configuration provider + */ + getWrappedProvider(): IConfigurationProvider; + /** + * Loads the configuration values either from the cache or from the wrapped provider + * + * @return {Promise>} Promise of loaded configuration values + */ + getConfiguration(): Promise>; + private selectPnPCache(); + } +} +declare module "configuration/providers/spListConfigurationProvider" { + import { IConfigurationProvider } from "configuration/configuration"; + import { TypedHash } from "collections/collections"; + import { default as CachingConfigurationProvider } from "configuration/providers/cachingConfigurationProvider"; + import { Web } from "sharepoint/webs"; + /** + * A configuration provider which loads configuration values from a SharePoint list + * + */ + export default class SPListConfigurationProvider implements IConfigurationProvider { + private sourceWeb; + private sourceListTitle; + /** + * Creates a new SharePoint list based configuration provider + * @constructor + * @param {string} webUrl Url of the SharePoint site, where the configuration list is located + * @param {string} listTitle Title of the SharePoint list, which contains the configuration settings (optional, default = "config") + */ + constructor(sourceWeb: Web, sourceListTitle?: string); + /** + * Gets the url of the SharePoint site, where the configuration list is located + * + * @return {string} Url address of the site + */ + readonly web: Web; + /** + * Gets the title of the SharePoint list, which contains the configuration settings + * + * @return {string} List title + */ + readonly listTitle: string; + /** + * Loads the configuration values from the SharePoint list + * + * @return {Promise>} Promise of loaded configuration values + */ + getConfiguration(): Promise>; + /** + * Wraps the current provider in a cache enabled provider + * + * @return {CachingConfigurationProvider} Caching providers which wraps the current provider + */ + asCaching(): CachingConfigurationProvider; + } +} +declare module "configuration/providers/index" { + export { default as CachingConfigurationProvider } from "configuration/providers/cachingConfigurationProvider"; + export { default as SPListConfigurationProvider } from "configuration/providers/spListConfigurationProvider"; +} +declare module "types/index" { + export * from "sharepoint/index"; + export { FetchOptions, HttpClient, HttpClientImpl } from "net/httpclient"; + export { SPRequestExecutorClient } from "net/sprequestexecutorclient"; + export { NodeFetchClient } from "net/nodefetchclient"; + export { FetchClient } from "net/fetchclient"; + export { IConfigurationProvider } from "configuration/configuration"; + export * from "configuration/providers/index"; + export { LibraryConfiguration } from "configuration/pnplibconfig"; + export { TypedHash, Dictionary } from "collections/collections"; + export { Util } from "utils/util"; + export * from "utils/logging"; + export * from "utils/exceptions"; +} +declare module "pnp" { + import { Util } from "utils/util"; + import { PnPClientStorage } from "utils/storage"; + import { Settings } from "configuration/configuration"; + import { Logger } from "utils/logging"; + import { Rest } from "sharepoint/rest"; + import { LibraryConfiguration } from "configuration/pnplibconfig"; + /** + * Root class of the Patterns and Practices namespace, provides an entry point to the library + */ + /** + * Utility methods + */ + export const util: typeof Util; + /** + * Provides access to the REST interface + */ + export const sp: Rest; + /** + * Provides access to local and session storage + */ + export const storage: PnPClientStorage; + /** + * Global configuration instance to which providers can be added + */ + export const config: Settings; + /** + * Global logging instance to which subscribers can be registered and messages written + */ + export const log: typeof Logger; + /** + * Allows for the configuration of the library + */ + export const setup: (config: LibraryConfiguration) => void; + /** + * Expose a subset of classes from the library for public consumption + */ + export * from "types/index"; + const Def: { + config: Settings; + log: typeof Logger; + setup: (config: LibraryConfiguration) => void; + sp: Rest; + storage: PnPClientStorage; + util: typeof Util; + }; + export default Def; +} +declare module "net/nodefetchclientbrowser" { + import { HttpClientImpl } from "net/httpclient"; + /** + * This module is substituted for the NodeFetchClient.ts during the packaging process. This helps to reduce the pnp.js file size by + * not including all of the node dependencies + */ + export class NodeFetchClient implements HttpClientImpl { + /** + * Always throws an error that NodeFetchClient is not supported for use in the browser + */ + fetch(): Promise; + } +} +declare module "types/locale" { + export enum Locale { + AfrikaansSouthAfrica = 1078, + AlbanianAlbania = 1052, + Alsatian = 1156, + AmharicEthiopia = 1118, + ArabicSaudiArabia = 1025, + ArabicAlgeria = 5121, + ArabicBahrain = 15361, + ArabicEgypt = 3073, + ArabicIraq = 2049, + ArabicJordan = 11265, + ArabicKuwait = 13313, + ArabicLebanon = 12289, + ArabicLibya = 4097, + ArabicMorocco = 6145, + ArabicOman = 8193, + ArabicQatar = 16385, + ArabicSyria = 10241, + ArabicTunisia = 7169, + ArabicUAE = 14337, + ArabicYemen = 9217, + ArmenianArmenia = 1067, + Assamese = 1101, + AzeriCyrillic = 2092, + AzeriLatin = 1068, + Bashkir = 1133, + Basque = 1069, + Belarusian = 1059, + BengaliIndia = 1093, + BengaliBangladesh = 2117, + BosnianBosniaHerzegovina = 5146, + Breton = 1150, + Bulgarian = 1026, + Burmese = 1109, + Catalan = 1027, + CherokeeUnitedStates = 1116, + ChinesePeoplesRepublicofChina = 2052, + ChineseSingapore = 4100, + ChineseTaiwan = 1028, + ChineseHongKongSAR = 3076, + ChineseMacaoSAR = 5124, + Corsican = 1155, + Croatian = 1050, + CroatianBosniaHerzegovina = 4122, + Czech = 1029, + Danish = 1030, + Dari = 1164, + Divehi = 1125, + DutchNetherlands = 1043, + DutchBelgium = 2067, + Edo = 1126, + EnglishUnitedStates = 1033, + EnglishUnitedKingdom = 2057, + EnglishAustralia = 3081, + EnglishBelize = 10249, + EnglishCanada = 4105, + EnglishCaribbean = 9225, + EnglishHongKongSAR = 15369, + EnglishIndia = 16393, + EnglishIndonesia = 14345, + EnglishIreland = 6153, + EnglishJamaica = 8201, + EnglishMalaysia = 17417, + EnglishNewZealand = 5129, + EnglishPhilippines = 13321, + EnglishSingapore = 18441, + EnglishSouthAfrica = 7177, + EnglishTrinidad = 11273, + EnglishZimbabwe = 12297, + Estonian = 1061, + Faroese = 1080, + Farsi = 1065, + Filipino = 1124, + Finnish = 1035, + FrenchFrance = 1036, + FrenchBelgium = 2060, + FrenchCameroon = 11276, + FrenchCanada = 3084, + FrenchDemocraticRepofCongo = 9228, + FrenchCotedIvoire = 12300, + FrenchHaiti = 15372, + FrenchLuxembourg = 5132, + FrenchMali = 13324, + FrenchMonaco = 6156, + FrenchMorocco = 14348, + FrenchNorthAfrica = 58380, + FrenchReunion = 8204, + FrenchSenegal = 10252, + FrenchSwitzerland = 4108, + FrenchWestIndies = 7180, + FrisianNetherlands = 1122, + FulfuldeNigeria = 1127, + FYROMacedonian = 1071, + Galician = 1110, + Georgian = 1079, + GermanGermany = 1031, + GermanAustria = 3079, + GermanLiechtenstein = 5127, + GermanLuxembourg = 4103, + GermanSwitzerland = 2055, + Greek = 1032, + Greenlandic = 1135, + GuaraniParaguay = 1140, + Gujarati = 1095, + HausaNigeria = 1128, + HawaiianUnitedStates = 1141, + Hebrew = 1037, + Hindi = 1081, + Hungarian = 1038, + IbibioNigeria = 1129, + Icelandic = 1039, + IgboNigeria = 1136, + Indonesian = 1057, + Inuktitut = 1117, + Irish = 2108, + ItalianItaly = 1040, + ItalianSwitzerland = 2064, + Japanese = 1041, + Kiche = 1158, + Kannada = 1099, + KanuriNigeria = 1137, + Kashmiri = 2144, + KashmiriArabic = 1120, + Kazakh = 1087, + Khmer = 1107, + Kinyarwanda = 1159, + Konkani = 1111, + Korean = 1042, + KyrgyzCyrillic = 1088, + Lao = 1108, + Latin = 1142, + Latvian = 1062, + Lithuanian = 1063, + Luxembourgish = 1134, + MalayMalaysia = 1086, + MalayBruneiDarussalam = 2110, + Malayalam = 1100, + Maltese = 1082, + Manipuri = 1112, + MaoriNewZealand = 1153, + Mapudungun = 1146, + Marathi = 1102, + Mohawk = 1148, + MongolianCyrillic = 1104, + MongolianMongolian = 2128, + Nepali = 1121, + NepaliIndia = 2145, + NorwegianBokmål = 1044, + NorwegianNynorsk = 2068, + Occitan = 1154, + Oriya = 1096, + Oromo = 1138, + Papiamentu = 1145, + Pashto = 1123, + Polish = 1045, + PortugueseBrazil = 1046, + PortuguesePortugal = 2070, + Punjabi = 1094, + PunjabiPakistan = 2118, + QuechaBolivia = 1131, + QuechaEcuador = 2155, + QuechaPeru = 3179, + RhaetoRomanic = 1047, + Romanian = 1048, + RomanianMoldava = 2072, + Russian = 1049, + RussianMoldava = 2073, + SamiLappish = 1083, + Sanskrit = 1103, + ScottishGaelic = 1084, + Sepedi = 1132, + SerbianCyrillic = 3098, + SerbianLatin = 2074, + SindhiIndia = 1113, + SindhiPakistan = 2137, + SinhaleseSriLanka = 1115, + Slovak = 1051, + Slovenian = 1060, + Somali = 1143, + Sorbian = 1070, + SpanishSpainModernSort = 3082, + SpanishSpainTraditionalSort = 1034, + SpanishArgentina = 11274, + SpanishBolivia = 16394, + SpanishChile = 13322, + SpanishColombia = 9226, + SpanishCostaRica = 5130, + SpanishDominicanRepublic = 7178, + SpanishEcuador = 12298, + SpanishElSalvador = 17418, + SpanishGuatemala = 4106, + SpanishHonduras = 18442, + SpanishLatinAmerica = 22538, + SpanishMexico = 2058, + SpanishNicaragua = 19466, + SpanishPanama = 6154, + SpanishParaguay = 15370, + SpanishPeru = 10250, + SpanishPuertoRico = 20490, + SpanishUnitedStates = 21514, + SpanishUruguay = 14346, + SpanishVenezuela = 8202, + Sutu = 1072, + Swahili = 1089, + Swedish = 1053, + SwedishFinland = 2077, + Syriac = 1114, + Tajik = 1064, + TamazightArabic = 1119, + TamazightLatin = 2143, + Tamil = 1097, + Tatar = 1092, + Telugu = 1098, + Thai = 1054, + TibetanBhutan = 2129, + TibetanPeoplesRepublicofChina = 1105, + TigrignaEritrea = 2163, + TigrignaEthiopia = 1139, + Tsonga = 1073, + Tswana = 1074, + Turkish = 1055, + Turkmen = 1090, + UighurChina = 1152, + Ukrainian = 1058, + Urdu = 1056, + UrduIndia = 2080, + UzbekCyrillic = 2115, + UzbekLatin = 1091, + Venda = 1075, + Vietnamese = 1066, + Welsh = 1106, + Wolof = 1160, + Xhosa = 1076, + Yakut = 1157, + Yi = 1144, + Yiddish = 1085, + Yoruba = 1130, + Zulu = 1077, + HIDHumanInterfaceDevice = 1279, + } +} diff --git a/dist/pnp.js b/dist/pnp.js new file mode 100644 index 00000000..0b230b65 --- /dev/null +++ b/dist/pnp.js @@ -0,0 +1,9357 @@ +/** + * sp-pnp-js v2.0.3 - A JavaScript library for SharePoint development. + * MIT (https://github.com/SharePoint/PnP-JS-Core/blob/master/LICENSE) + * Copyright (c) 2017 Microsoft + * docs: http://officedev.github.io/PnP-JS-Core + * source: https://github.com/SharePoint/PnP-JS-Core + * bugs: https://github.com/SharePoint/PnP-JS-Core/issues + */ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(); + else if(typeof define === 'function' && define.amd) + define([], factory); + else if(typeof exports === 'object') + exports["$pnp"] = factory(); + else + root["$pnp"] = factory(); +})(this, function() { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) +/******/ return installedModules[moduleId].exports; +/******/ +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // identity function for calling harmony imports with the correct context +/******/ __webpack_require__.i = function(value) { return value; }; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { +/******/ configurable: false, +/******/ enumerable: true, +/******/ get: getter +/******/ }); +/******/ } +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = "/assets/"; +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = 41); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(global) { +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var decorators_1 = __webpack_require__(31); +var pnplibconfig_1 = __webpack_require__(4); +var Util = (function () { + function Util() { + } + /** + * Gets a callback function which will maintain context across async calls. + * Allows for the calling pattern getCtxCallback(thisobj, method, methodarg1, methodarg2, ...) + * + * @param context The object that will be the 'this' value in the callback + * @param method The method to which we will apply the context and parameters + * @param params Optional, additional arguments to supply to the wrapped method when it is invoked + */ + Util.getCtxCallback = function (context, method) { + var params = []; + for (var _i = 2; _i < arguments.length; _i++) { + params[_i - 2] = arguments[_i]; + } + return function () { + method.apply(context, params); + }; + }; + /** + * Tests if a url param exists + * + * @param name The name of the url paramter to check + */ + Util.urlParamExists = function (name) { + name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); + var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"); + return regex.test(location.search); + }; + /** + * Gets a url param value by name + * + * @param name The name of the paramter for which we want the value + */ + Util.getUrlParamByName = function (name) { + name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); + var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"); + var results = regex.exec(location.search); + return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")); + }; + /** + * Gets a url param by name and attempts to parse a bool value + * + * @param name The name of the paramter for which we want the boolean value + */ + Util.getUrlParamBoolByName = function (name) { + var p = this.getUrlParamByName(name); + var isFalse = (p === "" || /false|0/i.test(p)); + return !isFalse; + }; + /** + * Inserts the string s into the string target as the index specified by index + * + * @param target The string into which we will insert s + * @param index The location in target to insert s (zero based) + * @param s The string to insert into target at position index + */ + Util.stringInsert = function (target, index, s) { + if (index > 0) { + return target.substring(0, index) + s + target.substring(index, target.length); + } + return s + target; + }; + /** + * Adds a value to a date + * + * @param date The date to which we will add units, done in local time + * @param interval The name of the interval to add, one of: ['year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second'] + * @param units The amount to add to date of the given interval + * + * http://stackoverflow.com/questions/1197928/how-to-add-30-minutes-to-a-javascript-date-object + */ + Util.dateAdd = function (date, interval, units) { + var ret = new Date(date.toLocaleString()); // don't change original date + switch (interval.toLowerCase()) { + case "year": + ret.setFullYear(ret.getFullYear() + units); + break; + case "quarter": + ret.setMonth(ret.getMonth() + 3 * units); + break; + case "month": + ret.setMonth(ret.getMonth() + units); + break; + case "week": + ret.setDate(ret.getDate() + 7 * units); + break; + case "day": + ret.setDate(ret.getDate() + units); + break; + case "hour": + ret.setTime(ret.getTime() + units * 3600000); + break; + case "minute": + ret.setTime(ret.getTime() + units * 60000); + break; + case "second": + ret.setTime(ret.getTime() + units * 1000); + break; + default: + ret = undefined; + break; + } + return ret; + }; + /** + * Loads a stylesheet into the current page + * + * @param path The url to the stylesheet + * @param avoidCache If true a value will be appended as a query string to avoid browser caching issues + */ + Util.loadStylesheet = function (path, avoidCache) { + if (avoidCache) { + path += "?" + encodeURIComponent((new Date()).getTime().toString()); + } + var head = document.getElementsByTagName("head"); + if (head.length > 0) { + var e = document.createElement("link"); + head[0].appendChild(e); + e.setAttribute("type", "text/css"); + e.setAttribute("rel", "stylesheet"); + e.setAttribute("href", path); + } + }; + /** + * Combines an arbitrary set of paths ensuring that the slashes are normalized + * + * @param paths 0 to n path parts to combine + */ + Util.combinePaths = function () { + var paths = []; + for (var _i = 0; _i < arguments.length; _i++) { + paths[_i] = arguments[_i]; + } + return paths + .filter(function (path) { return typeof path !== "undefined" && path !== null; }) + .map(function (path) { return path.replace(/^[\\|\/]/, "").replace(/[\\|\/]$/, ""); }) + .join("/") + .replace(/\\/g, "/"); + }; + /** + * Gets a random string of chars length + * + * @param chars The length of the random string to generate + */ + Util.getRandomString = function (chars) { + var text = new Array(chars); + var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; + for (var i = 0; i < chars; i++) { + text[i] = possible.charAt(Math.floor(Math.random() * possible.length)); + } + return text.join(""); + }; + /** + * Gets a random GUID value + * + * http://stackoverflow.com/questions/105034/create-guid-uuid-in-javascript + */ + /* tslint:disable no-bitwise */ + Util.getGUID = function () { + var d = new Date().getTime(); + var guid = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (c) { + var r = (d + Math.random() * 16) % 16 | 0; + d = Math.floor(d / 16); + return (c === "x" ? r : (r & 0x3 | 0x8)).toString(16); + }); + return guid; + }; + /* tslint:enable */ + /** + * Determines if a given value is a function + * + * @param candidateFunction The thing to test for being a function + */ + Util.isFunction = function (candidateFunction) { + return typeof candidateFunction === "function"; + }; + /** + * @returns whether the provided parameter is a JavaScript Array or not. + */ + Util.isArray = function (array) { + if (Array.isArray) { + return Array.isArray(array); + } + return array && typeof array.length === "number" && array.constructor === Array; + }; + /** + * Determines if a string is null or empty or undefined + * + * @param s The string to test + */ + Util.stringIsNullOrEmpty = function (s) { + return typeof s === "undefined" || s === null || s === ""; + }; + /** + * Provides functionality to extend the given object by doing a shallow copy + * + * @param target The object to which properties will be copied + * @param source The source object from which properties will be copied + * @param noOverwrite If true existing properties on the target are not overwritten from the source + * + */ + Util.extend = function (target, source, noOverwrite) { + if (noOverwrite === void 0) { noOverwrite = false; } + if (source === null || typeof source === "undefined") { + return target; + } + // ensure we don't overwrite things we don't want overwritten + var check = noOverwrite ? function (o, i) { return !(i in o); } : function () { return true; }; + return Object.getOwnPropertyNames(source) + .filter(function (v) { return check(target, v); }) + .reduce(function (t, v) { + t[v] = source[v]; + return t; + }, target); + }; + /** + * Determines if a given url is absolute + * + * @param url The url to check to see if it is absolute + */ + Util.isUrlAbsolute = function (url) { + return /^https?:\/\/|^\/\//i.test(url); + }; + /** + * Attempts to make the supplied relative url absolute based on the _spPageContextInfo object, if available + * + * @param url The relative url to make absolute + */ + Util.makeUrlAbsolute = function (url) { + if (Util.isUrlAbsolute(url)) { + return url; + } + if (typeof global._spPageContextInfo !== "undefined") { + if (global._spPageContextInfo.hasOwnProperty("webAbsoluteUrl")) { + return Util.combinePaths(global._spPageContextInfo.webAbsoluteUrl, url); + } + else if (global._spPageContextInfo.hasOwnProperty("webServerRelativeUrl")) { + return Util.combinePaths(global._spPageContextInfo.webServerRelativeUrl, url); + } + } + else { + return url; + } + }; + /** + * Ensures that a given url is absolute for the current web based on context + * + * @param candidateUrl The url to make absolute + * + */ + Util.toAbsoluteUrl = function (candidateUrl) { + return new Promise(function (resolve) { + if (Util.isUrlAbsolute(candidateUrl)) { + // if we are already absolute, then just return the url + return resolve(candidateUrl); + } + if (pnplibconfig_1.RuntimeConfig.baseUrl !== null) { + // base url specified either with baseUrl of spfxContext config property + return resolve(Util.combinePaths(pnplibconfig_1.RuntimeConfig.baseUrl, candidateUrl)); + } + if (typeof global._spPageContextInfo !== "undefined") { + // operating in classic pages + if (global._spPageContextInfo.hasOwnProperty("webAbsoluteUrl")) { + return resolve(Util.combinePaths(global._spPageContextInfo.webAbsoluteUrl, candidateUrl)); + } + else if (global._spPageContextInfo.hasOwnProperty("webServerRelativeUrl")) { + return resolve(Util.combinePaths(global._spPageContextInfo.webServerRelativeUrl, candidateUrl)); + } + } + // does window.location exist and have _layouts in it? + if (typeof global.location !== "undefined") { + var index = global.location.toString().toLowerCase().indexOf("/_layouts/"); + if (index > 0) { + // we are likely in the workbench in /_layouts/ + return resolve(Util.combinePaths(global.location.toString().substr(0, index), candidateUrl)); + } + } + return resolve(candidateUrl); + }); + }; + return Util; +}()); +__decorate([ + decorators_1.deprecated("The Util.makeUrlAbsolute method is deprecated and will be removed from future releases. Use Util.toAbsoluteUrl instead") +], Util, "makeUrlAbsolute", null); +exports.Util = Util; + +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(32))) + +/***/ }), +/* 1 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var util_1 = __webpack_require__(0); +var collections_1 = __webpack_require__(6); +var odata_1 = __webpack_require__(2); +var pnplibconfig_1 = __webpack_require__(4); +var exceptions_1 = __webpack_require__(3); +var queryablerequest_1 = __webpack_require__(45); +var logging_1 = __webpack_require__(5); +/** + * Queryable Base Class + * + */ +var Queryable = (function () { + /** + * Creates a new instance of the Queryable class + * + * @constructor + * @param baseUrl A string or Queryable that should form the base part of the url + * + */ + function Queryable(baseUrl, path) { + this._query = new collections_1.Dictionary(); + this._batch = null; + if (typeof baseUrl === "string") { + // we need to do some extra parsing to get the parent url correct if we are + // being created from just a string. + var urlStr = baseUrl; + if (util_1.Util.isUrlAbsolute(urlStr) || urlStr.lastIndexOf("/") < 0) { + this._parentUrl = urlStr; + this._url = util_1.Util.combinePaths(urlStr, path); + } + else if (urlStr.lastIndexOf("/") > urlStr.lastIndexOf("(")) { + // .../items(19)/fields + var index = urlStr.lastIndexOf("/"); + this._parentUrl = urlStr.slice(0, index); + path = util_1.Util.combinePaths(urlStr.slice(index), path); + this._url = util_1.Util.combinePaths(this._parentUrl, path); + } + else { + // .../items(19) + var index = urlStr.lastIndexOf("("); + this._parentUrl = urlStr.slice(0, index); + this._url = util_1.Util.combinePaths(urlStr, path); + } + } + else { + var q = baseUrl; + this._parentUrl = q._url; + var target = q._query.get("@target"); + if (target !== null) { + this._query.add("@target", target); + } + this._url = util_1.Util.combinePaths(this._parentUrl, path); + } + } + /** + * Directly concatonates the supplied string to the current url, not normalizing "/" chars + * + * @param pathPart The string to concatonate to the url + */ + Queryable.prototype.concat = function (pathPart) { + this._url += pathPart; + }; + /** + * Appends the given string and normalizes "/" chars + * + * @param pathPart The string to append + */ + Queryable.prototype.append = function (pathPart) { + this._url = util_1.Util.combinePaths(this._url, pathPart); + }; + /** + * Blocks a batch call from occuring, MUST be cleared by calling the returned function + */ + Queryable.prototype.addBatchDependency = function () { + if (this.hasBatch) { + return this._batch.addDependency(); + } + return function () { return null; }; + }; + Object.defineProperty(Queryable.prototype, "hasBatch", { + /** + * Indicates if the current query has a batch associated + * + */ + get: function () { + return this._batch !== null; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Queryable.prototype, "batch", { + /** + * The batch currently associated with this query or null + * + */ + get: function () { + return this.hasBatch ? this._batch : null; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Queryable.prototype, "parentUrl", { + /** + * Gets the parent url used when creating this instance + * + */ + get: function () { + return this._parentUrl; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Queryable.prototype, "query", { + /** + * Provides access to the query builder for this url + * + */ + get: function () { + return this._query; + }, + enumerable: true, + configurable: true + }); + /** + * Creates a new instance of the supplied factory and extends this into that new instance + * + * @param factory constructor for the new queryable + */ + Queryable.prototype.as = function (factory) { + var o = new factory(this._url, null); + return util_1.Util.extend(o, this, true); + }; + /** + * Adds this query to the supplied batch + * + * @example + * ``` + * + * let b = pnp.sp.createBatch(); + * pnp.sp.web.inBatch(b).get().then(...); + * b.execute().then(...) + * ``` + */ + Queryable.prototype.inBatch = function (batch) { + if (this._batch !== null) { + throw new exceptions_1.AlreadyInBatchException(); + } + this._batch = batch; + return this; + }; + /** + * Enables caching for this request + * + * @param options Defines the options used when caching this request + */ + Queryable.prototype.usingCaching = function (options) { + if (!pnplibconfig_1.RuntimeConfig.globalCacheDisable) { + this._useCaching = true; + this._cachingOptions = options; + } + return this; + }; + /** + * Gets the currentl url, made absolute based on the availability of the _spPageContextInfo object + * + */ + Queryable.prototype.toUrl = function () { + return this._url; + }; + /** + * Gets the full url with query information + * + */ + Queryable.prototype.toUrlAndQuery = function () { + var aliasedParams = new collections_1.Dictionary(); + var url = this.toUrl().replace(/'!(@.*?)::(.*?)'/ig, function (match, labelName, value) { + logging_1.Logger.write("Rewriting aliased parameter from match " + match + " to label: " + labelName + " value: " + value, logging_1.LogLevel.Verbose); + aliasedParams.add(labelName, "'" + value + "'"); + return labelName; + }); + // inlude our explicitly set query string params + aliasedParams.merge(this._query); + if (aliasedParams.count() > 0) { + url += "?" + aliasedParams.getKeys().map(function (key) { return key + "=" + aliasedParams.get(key); }).join("&"); + } + return url; + }; + /** + * Gets a parent for this instance as specified + * + * @param factory The contructor for the class to create + */ + Queryable.prototype.getParent = function (factory, baseUrl, path, batch) { + if (baseUrl === void 0) { baseUrl = this.parentUrl; } + var parent = new factory(baseUrl, path); + var target = this.query.get("@target"); + if (target !== null) { + parent.query.add("@target", target); + } + if (typeof batch !== "undefined") { + parent = parent.inBatch(batch); + } + return parent; + }; + /** + * Clones this queryable into a new queryable instance of T + * @param factory Constructor used to create the new instance + * @param additionalPath Any additional path to include in the clone + * @param includeBatch If true this instance's batch will be added to the cloned instance + */ + Queryable.prototype.clone = function (factory, additionalPath, includeBatch) { + if (includeBatch === void 0) { includeBatch = false; } + var clone = new factory(this, additionalPath); + var target = this.query.get("@target"); + if (target !== null) { + clone.query.add("@target", target); + } + if (includeBatch && this.hasBatch) { + clone = clone.inBatch(this.batch); + } + return clone; + }; + /** + * Executes the currently built request + * + * @param parser Allows you to specify a parser to handle the result + * @param getOptions The options used for this request + */ + Queryable.prototype.get = function (parser, getOptions) { + if (parser === void 0) { parser = new odata_1.ODataDefaultParser(); } + if (getOptions === void 0) { getOptions = {}; } + return this.toRequestContext("GET", getOptions, parser).then(function (context) { return queryablerequest_1.pipe(context); }); + }; + Queryable.prototype.getAs = function (parser, getOptions) { + if (parser === void 0) { parser = new odata_1.ODataDefaultParser(); } + if (getOptions === void 0) { getOptions = {}; } + return this.toRequestContext("GET", getOptions, parser).then(function (context) { return queryablerequest_1.pipe(context); }); + }; + Queryable.prototype.post = function (postOptions, parser) { + if (postOptions === void 0) { postOptions = {}; } + if (parser === void 0) { parser = new odata_1.ODataDefaultParser(); } + return this.toRequestContext("POST", postOptions, parser).then(function (context) { return queryablerequest_1.pipe(context); }); + }; + Queryable.prototype.postAs = function (postOptions, parser) { + if (postOptions === void 0) { postOptions = {}; } + if (parser === void 0) { parser = new odata_1.ODataDefaultParser(); } + return this.toRequestContext("POST", postOptions, parser).then(function (context) { return queryablerequest_1.pipe(context); }); + }; + Queryable.prototype.patch = function (patchOptions, parser) { + if (patchOptions === void 0) { patchOptions = {}; } + if (parser === void 0) { parser = new odata_1.ODataDefaultParser(); } + return this.toRequestContext("PATCH", patchOptions, parser).then(function (context) { return queryablerequest_1.pipe(context); }); + }; + Queryable.prototype.delete = function (deleteOptions, parser) { + if (deleteOptions === void 0) { deleteOptions = {}; } + if (parser === void 0) { parser = new odata_1.ODataDefaultParser(); } + return this.toRequestContext("DELETE", deleteOptions, parser).then(function (context) { return queryablerequest_1.pipe(context); }); + }; + Queryable.prototype.toRequestContext = function (verb, options, parser) { + var _this = this; + if (options === void 0) { options = {}; } + var dependencyDispose = this.hasBatch ? this.addBatchDependency() : function () { return; }; + return util_1.Util.toAbsoluteUrl(this.toUrlAndQuery()).then(function (url) { + // build our request context + var context = { + batch: _this._batch, + batchDependency: dependencyDispose, + cachingOptions: _this._cachingOptions, + isBatched: _this.hasBatch, + isCached: _this._useCaching, + options: options, + parser: parser, + requestAbsoluteUrl: url, + requestId: util_1.Util.getGUID(), + verb: verb, + }; + return context; + }); + }; + return Queryable; +}()); +exports.Queryable = Queryable; +/** + * Represents a REST collection which can be filtered, paged, and selected + * + */ +var QueryableCollection = (function (_super) { + __extends(QueryableCollection, _super); + function QueryableCollection() { + return _super !== null && _super.apply(this, arguments) || this; + } + /** + * Filters the returned collection (https://msdn.microsoft.com/en-us/library/office/fp142385.aspx#bk_supported) + * + * @param filter The string representing the filter query + */ + QueryableCollection.prototype.filter = function (filter) { + this._query.add("$filter", filter); + return this; + }; + /** + * Choose which fields to return + * + * @param selects One or more fields to return + */ + QueryableCollection.prototype.select = function () { + var selects = []; + for (var _i = 0; _i < arguments.length; _i++) { + selects[_i] = arguments[_i]; + } + if (selects.length > 0) { + this._query.add("$select", selects.join(",")); + } + return this; + }; + /** + * Expands fields such as lookups to get additional data + * + * @param expands The Fields for which to expand the values + */ + QueryableCollection.prototype.expand = function () { + var expands = []; + for (var _i = 0; _i < arguments.length; _i++) { + expands[_i] = arguments[_i]; + } + if (expands.length > 0) { + this._query.add("$expand", expands.join(",")); + } + return this; + }; + /** + * Orders based on the supplied fields ascending + * + * @param orderby The name of the field to sort on + * @param ascending If false DESC is appended, otherwise ASC (default) + */ + QueryableCollection.prototype.orderBy = function (orderBy, ascending) { + if (ascending === void 0) { ascending = true; } + var keys = this._query.getKeys(); + var query = []; + var asc = ascending ? " asc" : " desc"; + for (var i = 0; i < keys.length; i++) { + if (keys[i] === "$orderby") { + query.push(this._query.get("$orderby")); + break; + } + } + query.push("" + orderBy + asc); + this._query.add("$orderby", query.join(",")); + return this; + }; + /** + * Skips the specified number of items + * + * @param skip The number of items to skip + */ + QueryableCollection.prototype.skip = function (skip) { + this._query.add("$skip", skip.toString()); + return this; + }; + /** + * Limits the query to only return the specified number of items + * + * @param top The query row limit + */ + QueryableCollection.prototype.top = function (top) { + this._query.add("$top", top.toString()); + return this; + }; + return QueryableCollection; +}(Queryable)); +exports.QueryableCollection = QueryableCollection; +/** + * Represents an instance that can be selected + * + */ +var QueryableInstance = (function (_super) { + __extends(QueryableInstance, _super); + function QueryableInstance() { + return _super !== null && _super.apply(this, arguments) || this; + } + /** + * Choose which fields to return + * + * @param selects One or more fields to return + */ + QueryableInstance.prototype.select = function () { + var selects = []; + for (var _i = 0; _i < arguments.length; _i++) { + selects[_i] = arguments[_i]; + } + if (selects.length > 0) { + this._query.add("$select", selects.join(",")); + } + return this; + }; + /** + * Expands fields such as lookups to get additional data + * + * @param expands The Fields for which to expand the values + */ + QueryableInstance.prototype.expand = function () { + var expands = []; + for (var _i = 0; _i < arguments.length; _i++) { + expands[_i] = arguments[_i]; + } + if (expands.length > 0) { + this._query.add("$expand", expands.join(",")); + } + return this; + }; + return QueryableInstance; +}(Queryable)); +exports.QueryableInstance = QueryableInstance; + + +/***/ }), +/* 2 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var util_1 = __webpack_require__(0); +var logging_1 = __webpack_require__(5); +var httpclient_1 = __webpack_require__(15); +var pnplibconfig_1 = __webpack_require__(4); +var exceptions_1 = __webpack_require__(3); +var exceptions_2 = __webpack_require__(3); +function extractOdataId(candidate) { + if (candidate.hasOwnProperty("odata.id")) { + return candidate["odata.id"]; + } + else if (candidate.hasOwnProperty("__metadata") && candidate.__metadata.hasOwnProperty("id")) { + return candidate.__metadata.id; + } + else { + throw new exceptions_1.ODataIdException(candidate); + } +} +exports.extractOdataId = extractOdataId; +var ODataParserBase = (function () { + function ODataParserBase() { + } + ODataParserBase.prototype.parse = function (r) { + var _this = this; + return new Promise(function (resolve, reject) { + if (_this.handleError(r, reject)) { + if ((r.headers.has("Content-Length") && parseFloat(r.headers.get("Content-Length")) === 0) || r.status === 204) { + resolve({}); + } + else { + r.json().then(function (json) { return resolve(_this.parseODataJSON(json)); }).catch(function (e) { return reject(e); }); + } + } + }); + }; + ODataParserBase.prototype.handleError = function (r, reject) { + if (!r.ok) { + r.json().then(function (json) { + // include the headers as they contain diagnostic information + var data = { + responseBody: json, + responseHeaders: r.headers, + }; + reject(new exceptions_2.ProcessHttpClientResponseException(r.status, r.statusText, data)); + }).catch(function (e) { + // we failed to read the body - possibly it is empty. Let's report the original status that caused + // the request to fail and log the error with parsing the body if anyone needs it for debugging + logging_1.Logger.log({ + data: e, + level: logging_1.LogLevel.Warning, + message: "There was an error parsing the error response body. See data for details.", + }); + // include the headers as they contain diagnostic information + var data = { + responseBody: "[[body not available]]", + responseHeaders: r.headers, + }; + reject(new exceptions_2.ProcessHttpClientResponseException(r.status, r.statusText, data)); + }); + } + return r.ok; + }; + ODataParserBase.prototype.parseODataJSON = function (json) { + var result = json; + if (json.hasOwnProperty("d")) { + if (json.d.hasOwnProperty("results")) { + result = json.d.results; + } + else { + result = json.d; + } + } + else if (json.hasOwnProperty("value")) { + result = json.value; + } + return result; + }; + return ODataParserBase; +}()); +exports.ODataParserBase = ODataParserBase; +var ODataDefaultParser = (function (_super) { + __extends(ODataDefaultParser, _super); + function ODataDefaultParser() { + return _super !== null && _super.apply(this, arguments) || this; + } + return ODataDefaultParser; +}(ODataParserBase)); +exports.ODataDefaultParser = ODataDefaultParser; +var ODataRawParserImpl = (function () { + function ODataRawParserImpl() { + } + ODataRawParserImpl.prototype.parse = function (r) { + return r.json(); + }; + return ODataRawParserImpl; +}()); +exports.ODataRawParserImpl = ODataRawParserImpl; +var ODataValueParserImpl = (function (_super) { + __extends(ODataValueParserImpl, _super); + function ODataValueParserImpl() { + return _super !== null && _super.apply(this, arguments) || this; + } + ODataValueParserImpl.prototype.parse = function (r) { + return _super.prototype.parse.call(this, r).then(function (d) { return d; }); + }; + return ODataValueParserImpl; +}(ODataParserBase)); +var ODataEntityParserImpl = (function (_super) { + __extends(ODataEntityParserImpl, _super); + function ODataEntityParserImpl(factory) { + var _this = _super.call(this) || this; + _this.factory = factory; + return _this; + } + ODataEntityParserImpl.prototype.parse = function (r) { + var _this = this; + return _super.prototype.parse.call(this, r).then(function (d) { + var o = new _this.factory(getEntityUrl(d), null); + return util_1.Util.extend(o, d); + }); + }; + return ODataEntityParserImpl; +}(ODataParserBase)); +var ODataEntityArrayParserImpl = (function (_super) { + __extends(ODataEntityArrayParserImpl, _super); + function ODataEntityArrayParserImpl(factory) { + var _this = _super.call(this) || this; + _this.factory = factory; + return _this; + } + ODataEntityArrayParserImpl.prototype.parse = function (r) { + var _this = this; + return _super.prototype.parse.call(this, r).then(function (d) { + return d.map(function (v) { + var o = new _this.factory(getEntityUrl(v), null); + return util_1.Util.extend(o, v); + }); + }); + }; + return ODataEntityArrayParserImpl; +}(ODataParserBase)); +function getEntityUrl(entity) { + if (entity.hasOwnProperty("odata.editLink")) { + // we are dealign with minimal metadata (default) + return util_1.Util.combinePaths("_api", entity["odata.editLink"]); + } + else if (entity.hasOwnProperty("__metadata")) { + // we are dealing with verbose, which has an absolute uri + return entity.__metadata.uri; + } + else { + // we are likely dealing with nometadata, so don't error but we won't be able to + // chain off these objects + logging_1.Logger.write("No uri information found in ODataEntity parsing, chaining will fail for this object.", logging_1.LogLevel.Warning); + return ""; + } +} +exports.getEntityUrl = getEntityUrl; +exports.ODataRaw = new ODataRawParserImpl(); +function ODataValue() { + return new ODataValueParserImpl(); +} +exports.ODataValue = ODataValue; +function ODataEntity(factory) { + return new ODataEntityParserImpl(factory); +} +exports.ODataEntity = ODataEntity; +function ODataEntityArray(factory) { + return new ODataEntityArrayParserImpl(factory); +} +exports.ODataEntityArray = ODataEntityArray; +/** + * Manages a batch of OData operations + */ +var ODataBatch = (function () { + function ODataBatch(baseUrl, _batchId) { + if (_batchId === void 0) { _batchId = util_1.Util.getGUID(); } + this.baseUrl = baseUrl; + this._batchId = _batchId; + this._requests = []; + this._dependencies = []; + } + /** + * Adds a request to a batch (not designed for public use) + * + * @param url The full url of the request + * @param method The http method GET, POST, etc + * @param options Any options to include in the request + * @param parser The parser that will hadle the results of the request + */ + ODataBatch.prototype.add = function (url, method, options, parser) { + var info = { + method: method.toUpperCase(), + options: options, + parser: parser, + reject: null, + resolve: null, + url: url, + }; + var p = new Promise(function (resolve, reject) { + info.resolve = resolve; + info.reject = reject; + }); + this._requests.push(info); + return p; + }; + /** + * Adds a dependency insuring that some set of actions will occur before a batch is processed. + * MUST be cleared using the returned resolve delegate to allow batches to run + */ + ODataBatch.prototype.addDependency = function () { + var resolver; + var promise = new Promise(function (resolve) { + resolver = resolve; + }); + this._dependencies.push(promise); + return resolver; + }; + /** + * Execute the current batch and resolve the associated promises + * + * @returns A promise which will be resolved once all of the batch's child promises have resolved + */ + ODataBatch.prototype.execute = function () { + var _this = this; + // we need to check the dependencies twice due to how different engines handle things. + // We can get a second set of promises added after the first set resolve + return Promise.all(this._dependencies).then(function () { return Promise.all(_this._dependencies); }).then(function () { return _this.executeImpl(); }); + }; + ODataBatch.prototype.executeImpl = function () { + var _this = this; + logging_1.Logger.write("Executing batch with " + this._requests.length + " requests.", logging_1.LogLevel.Info); + // if we don't have any requests, don't bother sending anything + // this could be due to caching further upstream, or just an empty batch + if (this._requests.length < 1) { + logging_1.Logger.write("Resolving empty batch.", logging_1.LogLevel.Info); + return Promise.resolve(); + } + // creating the client here allows the url to be populated for nodejs client as well as potentially + // any other hacks needed for other types of clients. Essentially allows the absoluteRequestUrl + // below to be correct + var client = new httpclient_1.HttpClient(); + // due to timing we need to get the absolute url here so we can use it for all the individual requests + // and for sending the entire batch + return util_1.Util.toAbsoluteUrl(this.baseUrl).then(function (absoluteRequestUrl) { + // build all the requests, send them, pipe results in order to parsers + var batchBody = []; + var currentChangeSetId = ""; + _this._requests.map(function (reqInfo) { + if (reqInfo.method === "GET") { + if (currentChangeSetId.length > 0) { + // end an existing change set + batchBody.push("--changeset_" + currentChangeSetId + "--\n\n"); + currentChangeSetId = ""; + } + batchBody.push("--batch_" + _this._batchId + "\n"); + } + else { + if (currentChangeSetId.length < 1) { + // start new change set + currentChangeSetId = util_1.Util.getGUID(); + batchBody.push("--batch_" + _this._batchId + "\n"); + batchBody.push("Content-Type: multipart/mixed; boundary=\"changeset_" + currentChangeSetId + "\"\n\n"); + } + batchBody.push("--changeset_" + currentChangeSetId + "\n"); + } + // common batch part prefix + batchBody.push("Content-Type: application/http\n"); + batchBody.push("Content-Transfer-Encoding: binary\n\n"); + var headers = { + "Accept": "application/json;", + }; + // this is the url of the individual request within the batch + var url = util_1.Util.isUrlAbsolute(reqInfo.url) ? reqInfo.url : util_1.Util.combinePaths(absoluteRequestUrl, reqInfo.url); + logging_1.Logger.write("Adding request " + reqInfo.method + " " + url + " to batch.", logging_1.LogLevel.Verbose); + if (reqInfo.method !== "GET") { + var method = reqInfo.method; + if (reqInfo.hasOwnProperty("options") && reqInfo.options.hasOwnProperty("headers") && typeof reqInfo.options.headers["X-HTTP-Method"] !== "undefined") { + method = reqInfo.options.headers["X-HTTP-Method"]; + delete reqInfo.options.headers["X-HTTP-Method"]; + } + batchBody.push(method + " " + url + " HTTP/1.1\n"); + headers = util_1.Util.extend(headers, { "Content-Type": "application/json;odata=verbose;charset=utf-8" }); + } + else { + batchBody.push(reqInfo.method + " " + url + " HTTP/1.1\n"); + } + if (typeof pnplibconfig_1.RuntimeConfig.headers !== "undefined") { + headers = util_1.Util.extend(headers, pnplibconfig_1.RuntimeConfig.headers); + } + if (reqInfo.options && reqInfo.options.headers) { + headers = util_1.Util.extend(headers, reqInfo.options.headers); + } + for (var name_1 in headers) { + if (headers.hasOwnProperty(name_1)) { + batchBody.push(name_1 + ": " + headers[name_1] + "\n"); + } + } + batchBody.push("\n"); + if (reqInfo.options.body) { + batchBody.push(reqInfo.options.body + "\n\n"); + } + }); + if (currentChangeSetId.length > 0) { + // Close the changeset + batchBody.push("--changeset_" + currentChangeSetId + "--\n\n"); + currentChangeSetId = ""; + } + batchBody.push("--batch_" + _this._batchId + "--\n"); + var batchHeaders = { + "Content-Type": "multipart/mixed; boundary=batch_" + _this._batchId, + }; + var batchOptions = { + "body": batchBody.join(""), + "headers": batchHeaders, + }; + logging_1.Logger.write("Sending batch request.", logging_1.LogLevel.Info); + return client.post(util_1.Util.combinePaths(absoluteRequestUrl, "/_api/$batch"), batchOptions) + .then(function (r) { return r.text(); }) + .then(_this._parseResponse) + .then(function (responses) { + if (responses.length !== _this._requests.length) { + throw new exceptions_1.BatchParseException("Could not properly parse responses to match requests in batch."); + } + logging_1.Logger.write("Resolving batched requests.", logging_1.LogLevel.Info); + return responses.reduce(function (chain, response, index) { + var request = _this._requests[index]; + logging_1.Logger.write("Resolving request " + request.method + " " + request.url + ".", logging_1.LogLevel.Verbose); + return chain.then(function (_) { return request.parser.parse(response).then(request.resolve).catch(request.reject); }); + }, Promise.resolve()); + }); + }); + }; + /** + * Parses the response from a batch request into an array of Response instances + * + * @param body Text body of the response from the batch request + */ + ODataBatch.prototype._parseResponse = function (body) { + return new Promise(function (resolve, reject) { + var responses = []; + var header = "--batchresponse_"; + // Ex. "HTTP/1.1 500 Internal Server Error" + var statusRegExp = new RegExp("^HTTP/[0-9.]+ +([0-9]+) +(.*)", "i"); + var lines = body.split("\n"); + var state = "batch"; + var status; + var statusText; + for (var i = 0; i < lines.length; ++i) { + var line = lines[i]; + switch (state) { + case "batch": + if (line.substr(0, header.length) === header) { + state = "batchHeaders"; + } + else { + if (line.trim() !== "") { + throw new exceptions_1.BatchParseException("Invalid response, line " + i); + } + } + break; + case "batchHeaders": + if (line.trim() === "") { + state = "status"; + } + break; + case "status": + var parts = statusRegExp.exec(line); + if (parts.length !== 3) { + throw new exceptions_1.BatchParseException("Invalid status, line " + i); + } + status = parseInt(parts[1], 10); + statusText = parts[2]; + state = "statusHeaders"; + break; + case "statusHeaders": + if (line.trim() === "") { + state = "body"; + } + break; + case "body": + responses.push((status === 204) ? new Response() : new Response(line, { status: status, statusText: statusText })); + state = "batch"; + break; + } + } + if (state !== "status") { + reject(new exceptions_1.BatchParseException("Unexpected end of input")); + } + resolve(responses); + }); + }; + return ODataBatch; +}()); +exports.ODataBatch = ODataBatch; +var TextFileParser = (function () { + function TextFileParser() { + } + TextFileParser.prototype.parse = function (r) { + return r.text(); + }; + return TextFileParser; +}()); +exports.TextFileParser = TextFileParser; +var BlobFileParser = (function () { + function BlobFileParser() { + } + BlobFileParser.prototype.parse = function (r) { + return r.blob(); + }; + return BlobFileParser; +}()); +exports.BlobFileParser = BlobFileParser; +var JSONFileParser = (function () { + function JSONFileParser() { + } + JSONFileParser.prototype.parse = function (r) { + return r.json(); + }; + return JSONFileParser; +}()); +exports.JSONFileParser = JSONFileParser; +var BufferFileParser = (function () { + function BufferFileParser() { + } + BufferFileParser.prototype.parse = function (r) { + if (util_1.Util.isFunction(r.arrayBuffer)) { + return r.arrayBuffer(); + } + return r.buffer(); + }; + return BufferFileParser; +}()); +exports.BufferFileParser = BufferFileParser; + + +/***/ }), +/* 3 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var logging_1 = __webpack_require__(5); +function defaultLog(error) { + logging_1.Logger.log({ data: {}, level: logging_1.LogLevel.Error, message: "[" + error.name + "]::" + error.message }); +} +/** + * Represents an exception with an HttpClient request + * + */ +var ProcessHttpClientResponseException = (function (_super) { + __extends(ProcessHttpClientResponseException, _super); + function ProcessHttpClientResponseException(status, statusText, data) { + var _this = _super.call(this, "Error making HttpClient request in queryable: [" + status + "] " + statusText) || this; + _this.status = status; + _this.statusText = statusText; + _this.data = data; + _this.name = "ProcessHttpClientResponseException"; + logging_1.Logger.log({ data: _this.data, level: logging_1.LogLevel.Error, message: _this.message }); + return _this; + } + return ProcessHttpClientResponseException; +}(Error)); +exports.ProcessHttpClientResponseException = ProcessHttpClientResponseException; +var NoCacheAvailableException = (function (_super) { + __extends(NoCacheAvailableException, _super); + function NoCacheAvailableException(msg) { + if (msg === void 0) { msg = "Cannot create a caching configuration provider since cache is not available."; } + var _this = _super.call(this, msg) || this; + _this.name = "NoCacheAvailableException"; + defaultLog(_this); + return _this; + } + return NoCacheAvailableException; +}(Error)); +exports.NoCacheAvailableException = NoCacheAvailableException; +var APIUrlException = (function (_super) { + __extends(APIUrlException, _super); + function APIUrlException(msg) { + if (msg === void 0) { msg = "Unable to determine API url."; } + var _this = _super.call(this, msg) || this; + _this.name = "APIUrlException"; + defaultLog(_this); + return _this; + } + return APIUrlException; +}(Error)); +exports.APIUrlException = APIUrlException; +var AuthUrlException = (function (_super) { + __extends(AuthUrlException, _super); + function AuthUrlException(data, msg) { + if (msg === void 0) { msg = "Auth URL Endpoint could not be determined from data. Data logged."; } + var _this = _super.call(this, msg) || this; + _this.name = "APIUrlException"; + logging_1.Logger.log({ data: data, level: logging_1.LogLevel.Error, message: _this.message }); + return _this; + } + return AuthUrlException; +}(Error)); +exports.AuthUrlException = AuthUrlException; +var NodeFetchClientUnsupportedException = (function (_super) { + __extends(NodeFetchClientUnsupportedException, _super); + function NodeFetchClientUnsupportedException(msg) { + if (msg === void 0) { msg = "Using NodeFetchClient in the browser is not supported."; } + var _this = _super.call(this, msg) || this; + _this.name = "NodeFetchClientUnsupportedException"; + defaultLog(_this); + return _this; + } + return NodeFetchClientUnsupportedException; +}(Error)); +exports.NodeFetchClientUnsupportedException = NodeFetchClientUnsupportedException; +var SPRequestExecutorUndefinedException = (function (_super) { + __extends(SPRequestExecutorUndefinedException, _super); + function SPRequestExecutorUndefinedException() { + var _this = this; + var msg = [ + "SP.RequestExecutor is undefined. ", + "Load the SP.RequestExecutor.js library (/_layouts/15/SP.RequestExecutor.js) before loading the PnP JS Core library.", + ].join(" "); + _this = _super.call(this, msg) || this; + _this.name = "SPRequestExecutorUndefinedException"; + defaultLog(_this); + return _this; + } + return SPRequestExecutorUndefinedException; +}(Error)); +exports.SPRequestExecutorUndefinedException = SPRequestExecutorUndefinedException; +var MaxCommentLengthException = (function (_super) { + __extends(MaxCommentLengthException, _super); + function MaxCommentLengthException(msg) { + if (msg === void 0) { msg = "The maximum comment length is 1023 characters."; } + var _this = _super.call(this, msg) || this; + _this.name = "MaxCommentLengthException"; + defaultLog(_this); + return _this; + } + return MaxCommentLengthException; +}(Error)); +exports.MaxCommentLengthException = MaxCommentLengthException; +var NotSupportedInBatchException = (function (_super) { + __extends(NotSupportedInBatchException, _super); + function NotSupportedInBatchException(operation) { + if (operation === void 0) { operation = "This operation"; } + var _this = _super.call(this, operation + " is not supported as part of a batch.") || this; + _this.name = "NotSupportedInBatchException"; + defaultLog(_this); + return _this; + } + return NotSupportedInBatchException; +}(Error)); +exports.NotSupportedInBatchException = NotSupportedInBatchException; +var ODataIdException = (function (_super) { + __extends(ODataIdException, _super); + function ODataIdException(data, msg) { + if (msg === void 0) { msg = "Could not extract odata id in object, you may be using nometadata. Object data logged to logger."; } + var _this = _super.call(this, msg) || this; + _this.name = "ODataIdException"; + logging_1.Logger.log({ data: data, level: logging_1.LogLevel.Error, message: _this.message }); + return _this; + } + return ODataIdException; +}(Error)); +exports.ODataIdException = ODataIdException; +var BatchParseException = (function (_super) { + __extends(BatchParseException, _super); + function BatchParseException(msg) { + var _this = _super.call(this, msg) || this; + _this.name = "BatchParseException"; + defaultLog(_this); + return _this; + } + return BatchParseException; +}(Error)); +exports.BatchParseException = BatchParseException; +var AlreadyInBatchException = (function (_super) { + __extends(AlreadyInBatchException, _super); + function AlreadyInBatchException(msg) { + if (msg === void 0) { msg = "This query is already part of a batch."; } + var _this = _super.call(this, msg) || this; + _this.name = "AlreadyInBatchException"; + defaultLog(_this); + return _this; + } + return AlreadyInBatchException; +}(Error)); +exports.AlreadyInBatchException = AlreadyInBatchException; +var FunctionExpectedException = (function (_super) { + __extends(FunctionExpectedException, _super); + function FunctionExpectedException(msg) { + if (msg === void 0) { msg = "This query is already part of a batch."; } + var _this = _super.call(this, msg) || this; + _this.name = "FunctionExpectedException"; + defaultLog(_this); + return _this; + } + return FunctionExpectedException; +}(Error)); +exports.FunctionExpectedException = FunctionExpectedException; +var UrlException = (function (_super) { + __extends(UrlException, _super); + function UrlException(msg) { + var _this = _super.call(this, msg) || this; + _this.name = "UrlException"; + defaultLog(_this); + return _this; + } + return UrlException; +}(Error)); +exports.UrlException = UrlException; + + +/***/ }), +/* 4 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var fetchclient_1 = __webpack_require__(21); +var RuntimeConfigImpl = (function () { + function RuntimeConfigImpl() { + // these are our default values for the library + this._headers = null; + this._defaultCachingStore = "session"; + this._defaultCachingTimeoutSeconds = 60; + this._globalCacheDisable = false; + this._fetchClientFactory = function () { return new fetchclient_1.FetchClient(); }; + this._baseUrl = null; + this._spfxContext = null; + } + RuntimeConfigImpl.prototype.set = function (config) { + if (config.hasOwnProperty("headers")) { + this._headers = config.headers; + } + if (config.hasOwnProperty("globalCacheDisable")) { + this._globalCacheDisable = config.globalCacheDisable; + } + if (config.hasOwnProperty("defaultCachingStore")) { + this._defaultCachingStore = config.defaultCachingStore; + } + if (config.hasOwnProperty("defaultCachingTimeoutSeconds")) { + this._defaultCachingTimeoutSeconds = config.defaultCachingTimeoutSeconds; + } + if (config.hasOwnProperty("fetchClientFactory")) { + this._fetchClientFactory = config.fetchClientFactory; + } + if (config.hasOwnProperty("baseUrl")) { + this._baseUrl = config.baseUrl; + } + if (config.hasOwnProperty("spFXContext")) { + this._spfxContext = config.spfxContext; + } + }; + Object.defineProperty(RuntimeConfigImpl.prototype, "headers", { + get: function () { + return this._headers; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(RuntimeConfigImpl.prototype, "defaultCachingStore", { + get: function () { + return this._defaultCachingStore; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(RuntimeConfigImpl.prototype, "defaultCachingTimeoutSeconds", { + get: function () { + return this._defaultCachingTimeoutSeconds; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(RuntimeConfigImpl.prototype, "globalCacheDisable", { + get: function () { + return this._globalCacheDisable; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(RuntimeConfigImpl.prototype, "fetchClientFactory", { + get: function () { + return this._fetchClientFactory; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(RuntimeConfigImpl.prototype, "baseUrl", { + get: function () { + if (this._baseUrl !== null) { + return this._baseUrl; + } + else if (this._spfxContext !== null) { + return this._spfxContext.pageContext.web.absoluteUrl; + } + return null; + }, + enumerable: true, + configurable: true + }); + return RuntimeConfigImpl; +}()); +exports.RuntimeConfigImpl = RuntimeConfigImpl; +var _runtimeConfig = new RuntimeConfigImpl(); +exports.RuntimeConfig = _runtimeConfig; +function setRuntimeConfig(config) { + _runtimeConfig.set(config); +} +exports.setRuntimeConfig = setRuntimeConfig; + + +/***/ }), +/* 5 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * A set of logging levels + * + */ +var LogLevel; +(function (LogLevel) { + LogLevel[LogLevel["Verbose"] = 0] = "Verbose"; + LogLevel[LogLevel["Info"] = 1] = "Info"; + LogLevel[LogLevel["Warning"] = 2] = "Warning"; + LogLevel[LogLevel["Error"] = 3] = "Error"; + LogLevel[LogLevel["Off"] = 99] = "Off"; +})(LogLevel = exports.LogLevel || (exports.LogLevel = {})); +/** + * Class used to subscribe ILogListener and log messages throughout an application + * + */ +var Logger = (function () { + function Logger() { + } + Object.defineProperty(Logger, "activeLogLevel", { + get: function () { + return Logger.instance.activeLogLevel; + }, + set: function (value) { + Logger.instance.activeLogLevel = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Logger, "instance", { + get: function () { + if (typeof Logger._instance === "undefined" || Logger._instance === null) { + Logger._instance = new LoggerImpl(); + } + return Logger._instance; + }, + enumerable: true, + configurable: true + }); + /** + * Adds ILogListener instances to the set of subscribed listeners + * + * @param listeners One or more listeners to subscribe to this log + */ + Logger.subscribe = function () { + var listeners = []; + for (var _i = 0; _i < arguments.length; _i++) { + listeners[_i] = arguments[_i]; + } + listeners.map(function (listener) { return Logger.instance.subscribe(listener); }); + }; + /** + * Clears the subscribers collection, returning the collection before modifiction + */ + Logger.clearSubscribers = function () { + return Logger.instance.clearSubscribers(); + }; + Object.defineProperty(Logger, "count", { + /** + * Gets the current subscriber count + */ + get: function () { + return Logger.instance.count; + }, + enumerable: true, + configurable: true + }); + /** + * Writes the supplied string to the subscribed listeners + * + * @param message The message to write + * @param level [Optional] if supplied will be used as the level of the entry (Default: LogLevel.Verbose) + */ + Logger.write = function (message, level) { + if (level === void 0) { level = LogLevel.Verbose; } + Logger.instance.log({ level: level, message: message }); + }; + /** + * Writes the supplied string to the subscribed listeners + * + * @param json The json object to stringify and write + * @param level [Optional] if supplied will be used as the level of the entry (Default: LogLevel.Verbose) + */ + Logger.writeJSON = function (json, level) { + if (level === void 0) { level = LogLevel.Verbose; } + Logger.instance.log({ level: level, message: JSON.stringify(json) }); + }; + /** + * Logs the supplied entry to the subscribed listeners + * + * @param entry The message to log + */ + Logger.log = function (entry) { + Logger.instance.log(entry); + }; + /** + * Logs performance tracking data for the the execution duration of the supplied function using console.profile + * + * @param name The name of this profile boundary + * @param f The function to execute and track within this performance boundary + */ + Logger.measure = function (name, f) { + return Logger.instance.measure(name, f); + }; + return Logger; +}()); +exports.Logger = Logger; +var LoggerImpl = (function () { + function LoggerImpl(activeLogLevel, subscribers) { + if (activeLogLevel === void 0) { activeLogLevel = LogLevel.Warning; } + if (subscribers === void 0) { subscribers = []; } + this.activeLogLevel = activeLogLevel; + this.subscribers = subscribers; + } + LoggerImpl.prototype.subscribe = function (listener) { + this.subscribers.push(listener); + }; + LoggerImpl.prototype.clearSubscribers = function () { + var s = this.subscribers.slice(0); + this.subscribers.length = 0; + return s; + }; + Object.defineProperty(LoggerImpl.prototype, "count", { + get: function () { + return this.subscribers.length; + }, + enumerable: true, + configurable: true + }); + LoggerImpl.prototype.write = function (message, level) { + if (level === void 0) { level = LogLevel.Verbose; } + this.log({ level: level, message: message }); + }; + LoggerImpl.prototype.log = function (entry) { + if (typeof entry === "undefined" || entry.level < this.activeLogLevel) { + return; + } + this.subscribers.map(function (subscriber) { return subscriber.log(entry); }); + }; + LoggerImpl.prototype.measure = function (name, f) { + console.profile(name); + try { + return f(); + } + finally { + console.profileEnd(); + } + }; + return LoggerImpl; +}()); +/** + * Implementation of ILogListener which logs to the browser console + * + */ +var ConsoleListener = (function () { + function ConsoleListener() { + } + /** + * Any associated data that a given logging listener may choose to log or ignore + * + * @param entry The information to be logged + */ + ConsoleListener.prototype.log = function (entry) { + var msg = this.format(entry); + switch (entry.level) { + case LogLevel.Verbose: + case LogLevel.Info: + console.log(msg); + break; + case LogLevel.Warning: + console.warn(msg); + break; + case LogLevel.Error: + console.error(msg); + break; + } + }; + /** + * Formats the message + * + * @param entry The information to format into a string + */ + ConsoleListener.prototype.format = function (entry) { + return "Message: " + entry.message + " Data: " + JSON.stringify(entry.data); + }; + return ConsoleListener; +}()); +exports.ConsoleListener = ConsoleListener; +/** + * Implementation of ILogListener which logs to the supplied function + * + */ +var FunctionListener = (function () { + /** + * Creates a new instance of the FunctionListener class + * + * @constructor + * @param method The method to which any logging data will be passed + */ + function FunctionListener(method) { + this.method = method; + } + /** + * Any associated data that a given logging listener may choose to log or ignore + * + * @param entry The information to be logged + */ + FunctionListener.prototype.log = function (entry) { + this.method(entry); + }; + return FunctionListener; +}()); +exports.FunctionListener = FunctionListener; + + +/***/ }), +/* 6 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * Generic dictionary + */ +var Dictionary = (function () { + /** + * Creates a new instance of the Dictionary class + * + * @constructor + */ + function Dictionary(keys, values) { + if (keys === void 0) { keys = []; } + if (values === void 0) { values = []; } + this.keys = keys; + this.values = values; + } + /** + * Gets a value from the collection using the specified key + * + * @param key The key whose value we want to return, returns null if the key does not exist + */ + Dictionary.prototype.get = function (key) { + var index = this.keys.indexOf(key); + if (index < 0) { + return null; + } + return this.values[index]; + }; + /** + * Adds the supplied key and value to the dictionary + * + * @param key The key to add + * @param o The value to add + */ + Dictionary.prototype.add = function (key, o) { + var index = this.keys.indexOf(key); + if (index > -1) { + this.values[index] = o; + } + else { + this.keys.push(key); + this.values.push(o); + } + }; + /** + * Merges the supplied typed hash into this dictionary instance. Existing values are updated and new ones are created as appropriate. + */ + Dictionary.prototype.merge = function (source) { + var _this = this; + if ("getKeys" in source) { + var sourceAsDictionary_1 = source; + sourceAsDictionary_1.getKeys().map(function (key) { + _this.add(key, sourceAsDictionary_1.get(key)); + }); + } + else { + var sourceAsHash = source; + for (var key in sourceAsHash) { + if (sourceAsHash.hasOwnProperty(key)) { + this.add(key, sourceAsHash[key]); + } + } + } + }; + /** + * Removes a value from the dictionary + * + * @param key The key of the key/value pair to remove. Returns null if the key was not found. + */ + Dictionary.prototype.remove = function (key) { + var index = this.keys.indexOf(key); + if (index < 0) { + return null; + } + var val = this.values[index]; + this.keys.splice(index, 1); + this.values.splice(index, 1); + return val; + }; + /** + * Returns all the keys currently in the dictionary as an array + */ + Dictionary.prototype.getKeys = function () { + return this.keys; + }; + /** + * Returns all the values currently in the dictionary as an array + */ + Dictionary.prototype.getValues = function () { + return this.values; + }; + /** + * Clears the current dictionary + */ + Dictionary.prototype.clear = function () { + this.keys = []; + this.values = []; + }; + /** + * Gets a count of the items currently in the dictionary + */ + Dictionary.prototype.count = function () { + return this.keys.length; + }; + return Dictionary; +}()); +exports.Dictionary = Dictionary; + + +/***/ }), +/* 7 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var queryable_1 = __webpack_require__(1); +var lists_1 = __webpack_require__(11); +var fields_1 = __webpack_require__(24); +var navigation_1 = __webpack_require__(25); +var sitegroups_1 = __webpack_require__(18); +var contenttypes_1 = __webpack_require__(16); +var folders_1 = __webpack_require__(9); +var roles_1 = __webpack_require__(17); +var files_1 = __webpack_require__(8); +var util_1 = __webpack_require__(0); +var lists_2 = __webpack_require__(11); +var siteusers_1 = __webpack_require__(30); +var usercustomactions_1 = __webpack_require__(19); +var odata_1 = __webpack_require__(2); +var features_1 = __webpack_require__(23); +var decorators_1 = __webpack_require__(31); +var queryableshareable_1 = __webpack_require__(12); +var relateditems_1 = __webpack_require__(46); +var Webs = (function (_super) { + __extends(Webs, _super); + function Webs(baseUrl, webPath) { + if (webPath === void 0) { webPath = "webs"; } + return _super.call(this, baseUrl, webPath) || this; + } + /** + * Adds a new web to the collection + * + * @param title The new web's title + * @param url The new web's relative url + * @param description The web web's description + * @param template The web's template + * @param language The language code to use for this web + * @param inheritPermissions If true permissions will be inherited from the partent web + * @param additionalSettings Will be passed as part of the web creation body + */ + Webs.prototype.add = function (title, url, description, template, language, inheritPermissions, additionalSettings) { + if (description === void 0) { description = ""; } + if (template === void 0) { template = "STS"; } + if (language === void 0) { language = 1033; } + if (inheritPermissions === void 0) { inheritPermissions = true; } + if (additionalSettings === void 0) { additionalSettings = {}; } + var props = util_1.Util.extend({ + Description: description, + Language: language, + Title: title, + Url: url, + UseSamePermissionsAsParentSite: inheritPermissions, + WebTemplate: template, + }, additionalSettings); + var postBody = JSON.stringify({ + "parameters": util_1.Util.extend({ + "__metadata": { "type": "SP.WebCreationInformation" }, + }, props), + }); + return this.clone(Webs, "add", true).post({ body: postBody }).then(function (data) { + return { + data: data, + web: new Web(odata_1.extractOdataId(data).replace(/_api\/web\/?/i, "")), + }; + }); + }; + return Webs; +}(queryable_1.QueryableCollection)); +exports.Webs = Webs; +/** + * Describes a web + * + */ +var Web = (function (_super) { + __extends(Web, _super); + function Web(baseUrl, path) { + if (path === void 0) { path = "_api/web"; } + return _super.call(this, baseUrl, path) || this; + } + /** + * Creates a new web instance from the given url by indexing the location of the /_api/ + * segment. If this is not found the method creates a new web with the entire string as + * supplied. + * + * @param url + */ + Web.fromUrl = function (url, path) { + if (url === null) { + return new Web(""); + } + var index = url.indexOf("_api/"); + if (index > -1) { + return new Web(url.substr(0, index), path); + } + return new Web(url, path); + }; + Object.defineProperty(Web.prototype, "webs", { + get: function () { + return new Webs(this); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Web.prototype, "contentTypes", { + /** + * Get the content types available in this web + * + */ + get: function () { + return new contenttypes_1.ContentTypes(this); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Web.prototype, "lists", { + /** + * Get the lists in this web + * + */ + get: function () { + return new lists_1.Lists(this); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Web.prototype, "fields", { + /** + * Gets the fields in this web + * + */ + get: function () { + return new fields_1.Fields(this); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Web.prototype, "features", { + /** + * Gets the active features for this web + * + */ + get: function () { + return new features_1.Features(this); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Web.prototype, "availablefields", { + /** + * Gets the available fields in this web + * + */ + get: function () { + return new fields_1.Fields(this, "availablefields"); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Web.prototype, "navigation", { + /** + * Get the navigation options in this web + * + */ + get: function () { + return new navigation_1.Navigation(this); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Web.prototype, "siteUsers", { + /** + * Gets the site users + * + */ + get: function () { + return new siteusers_1.SiteUsers(this); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Web.prototype, "siteGroups", { + /** + * Gets the site groups + * + */ + get: function () { + return new sitegroups_1.SiteGroups(this); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Web.prototype, "currentUser", { + /** + * Gets the current user + */ + get: function () { + return new siteusers_1.CurrentUser(this); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Web.prototype, "folders", { + /** + * Get the folders in this web + * + */ + get: function () { + return new folders_1.Folders(this); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Web.prototype, "userCustomActions", { + /** + * Get all custom actions on a site + * + */ + get: function () { + return new usercustomactions_1.UserCustomActions(this); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Web.prototype, "roleDefinitions", { + /** + * Gets the collection of RoleDefinition resources. + * + */ + get: function () { + return new roles_1.RoleDefinitions(this); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Web.prototype, "relatedItems", { + /** + * Provides an interface to manage related items + * + */ + get: function () { + return relateditems_1.RelatedItemManagerImpl.FromUrl(this.toUrl()); + }, + enumerable: true, + configurable: true + }); + /** + * Creates a new batch for requests within the context of context this web + * + */ + Web.prototype.createBatch = function () { + return new odata_1.ODataBatch(this.parentUrl); + }; + Object.defineProperty(Web.prototype, "rootFolder", { + /** + * The root folder of the web + */ + get: function () { + return new folders_1.Folder(this, "rootFolder"); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Web.prototype, "associatedOwnerGroup", { + get: function () { + return new sitegroups_1.SiteGroup(this, "associatedownergroup"); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Web.prototype, "associatedMemberGroup", { + get: function () { + return new sitegroups_1.SiteGroup(this, "associatedmembergroup"); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Web.prototype, "associatedVisitorGroup", { + get: function () { + return new sitegroups_1.SiteGroup(this, "associatedvisitorgroup"); + }, + enumerable: true, + configurable: true + }); + /** + * Get a folder by server relative url + * + * @param folderRelativeUrl the server relative path to the folder (including /sites/ if applicable) + */ + Web.prototype.getFolderByServerRelativeUrl = function (folderRelativeUrl) { + return new folders_1.Folder(this, "getFolderByServerRelativeUrl('" + folderRelativeUrl + "')"); + }; + /** + * Get a file by server relative url + * + * @param fileRelativeUrl the server relative path to the file (including /sites/ if applicable) + */ + Web.prototype.getFileByServerRelativeUrl = function (fileRelativeUrl) { + return new files_1.File(this, "getFileByServerRelativeUrl('" + fileRelativeUrl + "')"); + }; + /** + * Get a list by server relative url (list's root folder) + * + * @param listRelativeUrl the server relative path to the list's root folder (including /sites/ if applicable) + */ + Web.prototype.getList = function (listRelativeUrl) { + return new lists_2.List(this, "getList('" + listRelativeUrl + "')"); + }; + /** + * Updates this web intance with the supplied properties + * + * @param properties A plain object hash of values to update for the web + */ + Web.prototype.update = function (properties) { + var _this = this; + var postBody = JSON.stringify(util_1.Util.extend({ + "__metadata": { "type": "SP.Web" }, + }, properties)); + return this.post({ + body: postBody, + headers: { + "X-HTTP-Method": "MERGE", + }, + }).then(function (data) { + return { + data: data, + web: _this, + }; + }); + }; + /** + * Delete this web + * + */ + Web.prototype.delete = function () { + return _super.prototype.delete.call(this); + }; + /** + * Applies the theme specified by the contents of each of the files specified in the arguments to the site. + * + * @param colorPaletteUrl Server-relative URL of the color palette file. + * @param fontSchemeUrl Server-relative URL of the font scheme. + * @param backgroundImageUrl Server-relative URL of the background image. + * @param shareGenerated true to store the generated theme files in the root site, or false to store them in this site. + */ + Web.prototype.applyTheme = function (colorPaletteUrl, fontSchemeUrl, backgroundImageUrl, shareGenerated) { + var postBody = JSON.stringify({ + backgroundImageUrl: backgroundImageUrl, + colorPaletteUrl: colorPaletteUrl, + fontSchemeUrl: fontSchemeUrl, + shareGenerated: shareGenerated, + }); + return this.clone(Web, "applytheme", true).post({ body: postBody }); + }; + /** + * Applies the specified site definition or site template to the Web site that has no template applied to it. + * + * @param template Name of the site definition or the name of the site template + */ + Web.prototype.applyWebTemplate = function (template) { + var q = this.clone(Web, "applywebtemplate", true); + q.concat("(@t)"); + q.query.add("@t", template); + return q.post(); + }; + /** + * Returns whether the current user has the given set of permissions. + * + * @param perms The high and low permission range. + */ + Web.prototype.doesUserHavePermissions = function (perms) { + var q = this.clone(Web, "doesuserhavepermissions", true); + q.concat("(@p)"); + q.query.add("@p", JSON.stringify(perms)); + return q.get(); + }; + /** + * Checks whether the specified login name belongs to a valid user in the site. If the user doesn't exist, adds the user to the site. + * + * @param loginName The login name of the user (ex: i:0#.f|membership|user@domain.onmicrosoft.com) + */ + Web.prototype.ensureUser = function (loginName) { + var postBody = JSON.stringify({ + logonName: loginName, + }); + return this.clone(Web, "ensureuser", true).post({ body: postBody }).then(function (data) { + return { + data: data, + user: new siteusers_1.SiteUser(odata_1.extractOdataId(data)), + }; + }); + }; + /** + * Returns a collection of site templates available for the site. + * + * @param language The LCID of the site templates to get. + * @param true to include language-neutral site templates; otherwise false + */ + Web.prototype.availableWebTemplates = function (language, includeCrossLanugage) { + if (language === void 0) { language = 1033; } + if (includeCrossLanugage === void 0) { includeCrossLanugage = true; } + return new queryable_1.QueryableCollection(this, "getavailablewebtemplates(lcid=" + language + ", doincludecrosslanguage=" + includeCrossLanugage + ")"); + }; + /** + * Returns the list gallery on the site. + * + * @param type The gallery type - WebTemplateCatalog = 111, WebPartCatalog = 113 ListTemplateCatalog = 114, + * MasterPageCatalog = 116, SolutionCatalog = 121, ThemeCatalog = 123, DesignCatalog = 124, AppDataCatalog = 125 + */ + Web.prototype.getCatalog = function (type) { + return this.clone(Web, "getcatalog(" + type + ")", true).select("Id").get().then(function (data) { + return new lists_2.List(odata_1.extractOdataId(data)); + }); + }; + /** + * Returns the collection of changes from the change log that have occurred within the list, based on the specified query. + */ + Web.prototype.getChanges = function (query) { + var postBody = JSON.stringify({ "query": util_1.Util.extend({ "__metadata": { "type": "SP.ChangeQuery" } }, query) }); + return this.clone(Web, "getchanges", true).post({ body: postBody }); + }; + Object.defineProperty(Web.prototype, "customListTemplate", { + /** + * Gets the custom list templates for the site. + * + */ + get: function () { + return new queryable_1.QueryableCollection(this, "getcustomlisttemplates"); + }, + enumerable: true, + configurable: true + }); + /** + * Returns the user corresponding to the specified member identifier for the current site. + * + * @param id The ID of the user. + */ + Web.prototype.getUserById = function (id) { + return new siteusers_1.SiteUser(this, "getUserById(" + id + ")"); + }; + /** + * Returns the name of the image file for the icon that is used to represent the specified file. + * + * @param filename The file name. If this parameter is empty, the server returns an empty string. + * @param size The size of the icon: 16x16 pixels = 0, 32x32 pixels = 1. + * @param progId The ProgID of the application that was used to create the file, in the form OLEServerName.ObjectName + */ + Web.prototype.mapToIcon = function (filename, size, progId) { + if (size === void 0) { size = 0; } + if (progId === void 0) { progId = ""; } + return this.clone(Web, "maptoicon(filename='" + filename + "', progid='" + progId + "', size=" + size + ")", true).get(); + }; + return Web; +}(queryableshareable_1.QueryableShareableWeb)); +__decorate([ + decorators_1.deprecated("This method will be removed in future releases. Please use the methods found in queryable securable.") +], Web.prototype, "doesUserHavePermissions", null); +exports.Web = Web; + + +/***/ }), +/* 8 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var queryable_1 = __webpack_require__(1); +var odata_1 = __webpack_require__(2); +var util_1 = __webpack_require__(0); +var exceptions_1 = __webpack_require__(3); +var webparts_1 = __webpack_require__(50); +var items_1 = __webpack_require__(10); +var queryableshareable_1 = __webpack_require__(12); +var odata_2 = __webpack_require__(2); +/** + * Describes a collection of File objects + * + */ +var Files = (function (_super) { + __extends(Files, _super); + /** + * Creates a new instance of the Files class + * + * @param baseUrl The url or Queryable which forms the parent of this fields collection + */ + function Files(baseUrl, path) { + if (path === void 0) { path = "files"; } + return _super.call(this, baseUrl, path) || this; + } + /** + * Gets a File by filename + * + * @param name The name of the file, including extension. + */ + Files.prototype.getByName = function (name) { + var f = new File(this); + f.concat("('" + name + "')"); + return f; + }; + /** + * Uploads a file. Not supported for batching + * + * @param url The folder-relative url of the file. + * @param content The file contents blob. + * @param shouldOverWrite Should a file with the same name in the same location be overwritten? (default: true) + * @returns The new File and the raw response. + */ + Files.prototype.add = function (url, content, shouldOverWrite) { + var _this = this; + if (shouldOverWrite === void 0) { shouldOverWrite = true; } + return new Files(this, "add(overwrite=" + shouldOverWrite + ",url='" + url + "')") + .post({ + body: content, + }).then(function (response) { + return { + data: response, + file: _this.getByName(url), + }; + }); + }; + /** + * Uploads a file. Not supported for batching + * + * @param url The folder-relative url of the file. + * @param content The Blob file content to add + * @param progress A callback function which can be used to track the progress of the upload + * @param shouldOverWrite Should a file with the same name in the same location be overwritten? (default: true) + * @param chunkSize The size of each file slice, in bytes (default: 10485760) + * @returns The new File and the raw response. + */ + Files.prototype.addChunked = function (url, content, progress, shouldOverWrite, chunkSize) { + var _this = this; + if (shouldOverWrite === void 0) { shouldOverWrite = true; } + if (chunkSize === void 0) { chunkSize = 10485760; } + var adder = this.clone(Files, "add(overwrite=" + shouldOverWrite + ",url='" + url + "')"); + return adder.post().then(function () { return _this.getByName(url); }).then(function (file) { return file.setContentChunked(content, progress, chunkSize); }).then(function (response) { + return { + data: response, + file: _this.getByName(url), + }; + }); + }; + /** + * Adds a ghosted file to an existing list or document library. Not supported for batching. + * + * @param fileUrl The server-relative url where you want to save the file. + * @param templateFileType The type of use to create the file. + * @returns The template file that was added and the raw response. + */ + Files.prototype.addTemplateFile = function (fileUrl, templateFileType) { + var _this = this; + return this.clone(Files, "addTemplateFile(urloffile='" + fileUrl + "',templatefiletype=" + templateFileType + ")") + .post().then(function (response) { + return { + data: response, + file: _this.getByName(fileUrl), + }; + }); + }; + return Files; +}(queryable_1.QueryableCollection)); +exports.Files = Files; +/** + * Describes a single File instance + * + */ +var File = (function (_super) { + __extends(File, _super); + function File() { + return _super !== null && _super.apply(this, arguments) || this; + } + Object.defineProperty(File.prototype, "listItemAllFields", { + /** + * Gets a value that specifies the list item field values for the list item corresponding to the file. + * + */ + get: function () { + return new queryable_1.QueryableCollection(this, "listItemAllFields"); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(File.prototype, "versions", { + /** + * Gets a collection of versions + * + */ + get: function () { + return new Versions(this); + }, + enumerable: true, + configurable: true + }); + /** + * Approves the file submitted for content approval with the specified comment. + * Only documents in lists that are enabled for content approval can be approved. + * + * @param comment The comment for the approval. + */ + File.prototype.approve = function (comment) { + return this.clone(File, "approve(comment='" + comment + "')", true).post(); + }; + /** + * Stops the chunk upload session without saving the uploaded data. Does not support batching. + * If the file doesn’t already exist in the library, the partially uploaded file will be deleted. + * Use this in response to user action (as in a request to cancel an upload) or an error or exception. + * Use the uploadId value that was passed to the StartUpload method that started the upload session. + * This method is currently available only on Office 365. + * + * @param uploadId The unique identifier of the upload session. + */ + File.prototype.cancelUpload = function (uploadId) { + return this.clone(File, "cancelUpload(uploadId=guid'" + uploadId + "')", false).post(); + }; + /** + * Checks the file in to a document library based on the check-in type. + * + * @param comment A comment for the check-in. Its length must be <= 1023. + * @param checkinType The check-in type for the file. + */ + File.prototype.checkin = function (comment, checkinType) { + if (comment === void 0) { comment = ""; } + if (checkinType === void 0) { checkinType = CheckinType.Major; } + if (comment.length > 1023) { + throw new exceptions_1.MaxCommentLengthException(); + } + return this.clone(File, "checkin(comment='" + comment + "',checkintype=" + checkinType + ")", true).post(); + }; + /** + * Checks out the file from a document library. + */ + File.prototype.checkout = function () { + return this.clone(File, "checkout", true).post(); + }; + /** + * Copies the file to the destination url. + * + * @param url The absolute url or server relative url of the destination file path to copy to. + * @param shouldOverWrite Should a file with the same name in the same location be overwritten? + */ + File.prototype.copyTo = function (url, shouldOverWrite) { + if (shouldOverWrite === void 0) { shouldOverWrite = true; } + return this.clone(File, "copyTo(strnewurl='" + url + "',boverwrite=" + shouldOverWrite + ")", true).post(); + }; + /** + * Delete this file. + * + * @param eTag Value used in the IF-Match header, by default "*" + */ + File.prototype.delete = function (eTag) { + if (eTag === void 0) { eTag = "*"; } + return this.clone(File, null, true).post({ + headers: { + "IF-Match": eTag, + "X-HTTP-Method": "DELETE", + }, + }); + }; + /** + * Denies approval for a file that was submitted for content approval. + * Only documents in lists that are enabled for content approval can be denied. + * + * @param comment The comment for the denial. + */ + File.prototype.deny = function (comment) { + if (comment === void 0) { comment = ""; } + if (comment.length > 1023) { + throw new exceptions_1.MaxCommentLengthException(); + } + return this.clone(File, "deny(comment='" + comment + "')", true).post(); + }; + /** + * Specifies the control set used to access, modify, or add Web Parts associated with this Web Part Page and view. + * An exception is thrown if the file is not an ASPX page. + * + * @param scope The WebPartsPersonalizationScope view on the Web Parts page. + */ + File.prototype.getLimitedWebPartManager = function (scope) { + if (scope === void 0) { scope = WebPartsPersonalizationScope.Shared; } + return new webparts_1.LimitedWebPartManager(this, "getLimitedWebPartManager(scope=" + scope + ")"); + }; + /** + * Moves the file to the specified destination url. + * + * @param url The absolute url or server relative url of the destination file path to move to. + * @param moveOperations The bitwise MoveOperations value for how to move the file. + */ + File.prototype.moveTo = function (url, moveOperations) { + if (moveOperations === void 0) { moveOperations = MoveOperations.Overwrite; } + return this.clone(File, "moveTo(newurl='" + url + "',flags=" + moveOperations + ")", true).post(); + }; + /** + * Submits the file for content approval with the specified comment. + * + * @param comment The comment for the published file. Its length must be <= 1023. + */ + File.prototype.publish = function (comment) { + if (comment === void 0) { comment = ""; } + if (comment.length > 1023) { + throw new exceptions_1.MaxCommentLengthException(); + } + return this.clone(File, "publish(comment='" + comment + "')", true).post(); + }; + /** + * Moves the file to the Recycle Bin and returns the identifier of the new Recycle Bin item. + * + * @returns The GUID of the recycled file. + */ + File.prototype.recycle = function () { + return this.clone(File, "recycle", true).post(); + }; + /** + * Reverts an existing checkout for the file. + * + */ + File.prototype.undoCheckout = function () { + return this.clone(File, "undoCheckout", true).post(); + }; + /** + * Removes the file from content approval or unpublish a major version. + * + * @param comment The comment for the unpublish operation. Its length must be <= 1023. + */ + File.prototype.unpublish = function (comment) { + if (comment === void 0) { comment = ""; } + if (comment.length > 1023) { + throw new exceptions_1.MaxCommentLengthException(); + } + return this.clone(File, "unpublish(comment='" + comment + "')", true).post(); + }; + /** + * Gets the contents of the file as text. Not supported in batching. + * + */ + File.prototype.getText = function () { + return this.clone(File, "$value").get(new odata_1.TextFileParser(), { headers: { "binaryStringResponseBody": "true" } }); + }; + /** + * Gets the contents of the file as a blob, does not work in Node.js. Not supported in batching. + * + */ + File.prototype.getBlob = function () { + return this.clone(File, "$value").get(new odata_1.BlobFileParser(), { headers: { "binaryStringResponseBody": "true" } }); + }; + /** + * Gets the contents of a file as an ArrayBuffer, works in Node.js. Not supported in batching. + */ + File.prototype.getBuffer = function () { + return this.clone(File, "$value").get(new odata_1.BufferFileParser(), { headers: { "binaryStringResponseBody": "true" } }); + }; + /** + * Gets the contents of a file as an ArrayBuffer, works in Node.js. Not supported in batching. + */ + File.prototype.getJSON = function () { + return this.clone(File, "$value").get(new odata_1.JSONFileParser(), { headers: { "binaryStringResponseBody": "true" } }); + }; + /** + * Sets the content of a file, for large files use setContentChunked. Not supported in batching. + * + * @param content The file content + * + */ + File.prototype.setContent = function (content) { + var _this = this; + return this.clone(File, "$value").post({ + body: content, + headers: { + "X-HTTP-Method": "PUT", + }, + }).then(function (_) { return new File(_this); }); + }; + /** + * Gets the associated list item for this folder, loading the default properties + */ + File.prototype.getItem = function () { + var selects = []; + for (var _i = 0; _i < arguments.length; _i++) { + selects[_i] = arguments[_i]; + } + var q = this.listItemAllFields; + return q.select.apply(q, selects).get().then(function (d) { + return util_1.Util.extend(new items_1.Item(odata_2.getEntityUrl(d)), d); + }); + }; + /** + * Sets the contents of a file using a chunked upload approach. Not supported in batching. + * + * @param file The file to upload + * @param progress A callback function which can be used to track the progress of the upload + * @param chunkSize The size of each file slice, in bytes (default: 10485760) + */ + File.prototype.setContentChunked = function (file, progress, chunkSize) { + if (chunkSize === void 0) { chunkSize = 10485760; } + if (typeof progress === "undefined") { + progress = function () { return null; }; + } + var self = this; + var fileSize = file.size; + var blockCount = parseInt((file.size / chunkSize).toString(), 10) + ((file.size % chunkSize === 0) ? 1 : 0); + var uploadId = util_1.Util.getGUID(); + // start the chain with the first fragment + progress({ blockNumber: 1, chunkSize: chunkSize, currentPointer: 0, fileSize: fileSize, stage: "starting", totalBlocks: blockCount }); + var chain = self.startUpload(uploadId, file.slice(0, chunkSize)); + var _loop_1 = function (i) { + chain = chain.then(function (pointer) { + progress({ blockNumber: i, chunkSize: chunkSize, currentPointer: pointer, fileSize: fileSize, stage: "continue", totalBlocks: blockCount }); + return self.continueUpload(uploadId, pointer, file.slice(pointer, pointer + chunkSize)); + }); + }; + // skip the first and last blocks + for (var i = 2; i < blockCount; i++) { + _loop_1(i); + } + return chain.then(function (pointer) { + progress({ blockNumber: blockCount, chunkSize: chunkSize, currentPointer: pointer, fileSize: fileSize, stage: "finishing", totalBlocks: blockCount }); + return self.finishUpload(uploadId, pointer, file.slice(pointer)); + }).then(function (_) { + return self; + }); + }; + /** + * Starts a new chunk upload session and uploads the first fragment. + * The current file content is not changed when this method completes. + * The method is idempotent (and therefore does not change the result) as long as you use the same values for uploadId and stream. + * The upload session ends either when you use the CancelUpload method or when you successfully + * complete the upload session by passing the rest of the file contents through the ContinueUpload and FinishUpload methods. + * The StartUpload and ContinueUpload methods return the size of the running total of uploaded data in bytes, + * so you can pass those return values to subsequent uses of ContinueUpload and FinishUpload. + * This method is currently available only on Office 365. + * + * @param uploadId The unique identifier of the upload session. + * @param fragment The file contents. + * @returns The size of the total uploaded data in bytes. + */ + File.prototype.startUpload = function (uploadId, fragment) { + return this.clone(File, "startUpload(uploadId=guid'" + uploadId + "')").postAs({ body: fragment }).then(function (n) { return parseFloat(n); }); + }; + /** + * Continues the chunk upload session with an additional fragment. + * The current file content is not changed. + * Use the uploadId value that was passed to the StartUpload method that started the upload session. + * This method is currently available only on Office 365. + * + * @param uploadId The unique identifier of the upload session. + * @param fileOffset The size of the offset into the file where the fragment starts. + * @param fragment The file contents. + * @returns The size of the total uploaded data in bytes. + */ + File.prototype.continueUpload = function (uploadId, fileOffset, fragment) { + return this.clone(File, "continueUpload(uploadId=guid'" + uploadId + "',fileOffset=" + fileOffset + ")").postAs({ body: fragment }).then(function (n) { return parseFloat(n); }); + }; + /** + * Uploads the last file fragment and commits the file. The current file content is changed when this method completes. + * Use the uploadId value that was passed to the StartUpload method that started the upload session. + * This method is currently available only on Office 365. + * + * @param uploadId The unique identifier of the upload session. + * @param fileOffset The size of the offset into the file where the fragment starts. + * @param fragment The file contents. + * @returns The newly uploaded file. + */ + File.prototype.finishUpload = function (uploadId, fileOffset, fragment) { + return this.clone(File, "finishUpload(uploadId=guid'" + uploadId + "',fileOffset=" + fileOffset + ")") + .postAs({ body: fragment }).then(function (response) { + return { + data: response, + file: new File(response.ServerRelativeUrl), + }; + }); + }; + return File; +}(queryableshareable_1.QueryableShareableFile)); +exports.File = File; +/** + * Describes a collection of Version objects + * + */ +var Versions = (function (_super) { + __extends(Versions, _super); + /** + * Creates a new instance of the File class + * + * @param baseUrl The url or Queryable which forms the parent of this fields collection + */ + function Versions(baseUrl, path) { + if (path === void 0) { path = "versions"; } + return _super.call(this, baseUrl, path) || this; + } + /** + * Gets a version by id + * + * @param versionId The id of the version to retrieve + */ + Versions.prototype.getById = function (versionId) { + var v = new Version(this); + v.concat("(" + versionId + ")"); + return v; + }; + /** + * Deletes all the file version objects in the collection. + * + */ + Versions.prototype.deleteAll = function () { + return new Versions(this, "deleteAll").post(); + }; + /** + * Deletes the specified version of the file. + * + * @param versionId The ID of the file version to delete. + */ + Versions.prototype.deleteById = function (versionId) { + return this.clone(Versions, "deleteById(vid=" + versionId + ")", true).post(); + }; + /** + * Deletes the file version object with the specified version label. + * + * @param label The version label of the file version to delete, for example: 1.2 + */ + Versions.prototype.deleteByLabel = function (label) { + return this.clone(Versions, "deleteByLabel(versionlabel='" + label + "')", true).post(); + }; + /** + * Creates a new file version from the file specified by the version label. + * + * @param label The version label of the file version to restore, for example: 1.2 + */ + Versions.prototype.restoreByLabel = function (label) { + return this.clone(Versions, "restoreByLabel(versionlabel='" + label + "')", true).post(); + }; + return Versions; +}(queryable_1.QueryableCollection)); +exports.Versions = Versions; +/** + * Describes a single Version instance + * + */ +var Version = (function (_super) { + __extends(Version, _super); + function Version() { + return _super !== null && _super.apply(this, arguments) || this; + } + /** + * Delete a specific version of a file. + * + * @param eTag Value used in the IF-Match header, by default "*" + */ + Version.prototype.delete = function (eTag) { + if (eTag === void 0) { eTag = "*"; } + return this.post({ + headers: { + "IF-Match": eTag, + "X-HTTP-Method": "DELETE", + }, + }); + }; + return Version; +}(queryable_1.QueryableInstance)); +exports.Version = Version; +var CheckinType; +(function (CheckinType) { + CheckinType[CheckinType["Minor"] = 0] = "Minor"; + CheckinType[CheckinType["Major"] = 1] = "Major"; + CheckinType[CheckinType["Overwrite"] = 2] = "Overwrite"; +})(CheckinType = exports.CheckinType || (exports.CheckinType = {})); +var WebPartsPersonalizationScope; +(function (WebPartsPersonalizationScope) { + WebPartsPersonalizationScope[WebPartsPersonalizationScope["User"] = 0] = "User"; + WebPartsPersonalizationScope[WebPartsPersonalizationScope["Shared"] = 1] = "Shared"; +})(WebPartsPersonalizationScope = exports.WebPartsPersonalizationScope || (exports.WebPartsPersonalizationScope = {})); +var MoveOperations; +(function (MoveOperations) { + MoveOperations[MoveOperations["Overwrite"] = 1] = "Overwrite"; + MoveOperations[MoveOperations["AllowBrokenThickets"] = 8] = "AllowBrokenThickets"; +})(MoveOperations = exports.MoveOperations || (exports.MoveOperations = {})); +var TemplateFileType; +(function (TemplateFileType) { + TemplateFileType[TemplateFileType["StandardPage"] = 0] = "StandardPage"; + TemplateFileType[TemplateFileType["WikiPage"] = 1] = "WikiPage"; + TemplateFileType[TemplateFileType["FormPage"] = 2] = "FormPage"; +})(TemplateFileType = exports.TemplateFileType || (exports.TemplateFileType = {})); + + +/***/ }), +/* 9 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var queryable_1 = __webpack_require__(1); +var queryableshareable_1 = __webpack_require__(12); +var files_1 = __webpack_require__(8); +var util_1 = __webpack_require__(0); +var odata_1 = __webpack_require__(2); +var items_1 = __webpack_require__(10); +/** + * Describes a collection of Folder objects + * + */ +var Folders = (function (_super) { + __extends(Folders, _super); + /** + * Creates a new instance of the Folders class + * + * @param baseUrl The url or Queryable which forms the parent of this fields collection + */ + function Folders(baseUrl, path) { + if (path === void 0) { path = "folders"; } + return _super.call(this, baseUrl, path) || this; + } + /** + * Gets a folder by folder name + * + */ + Folders.prototype.getByName = function (name) { + var f = new Folder(this); + f.concat("('" + name + "')"); + return f; + }; + /** + * Adds a new folder to the current folder (relative) or any folder (absolute) + * + * @param url The relative or absolute url where the new folder will be created. Urls starting with a forward slash are absolute. + * @returns The new Folder and the raw response. + */ + Folders.prototype.add = function (url) { + var _this = this; + return this.clone(Folders, "add('" + url + "')", true).post().then(function (response) { + return { + data: response, + folder: _this.getByName(url), + }; + }); + }; + return Folders; +}(queryable_1.QueryableCollection)); +exports.Folders = Folders; +/** + * Describes a single Folder instance + * + */ +var Folder = (function (_super) { + __extends(Folder, _super); + function Folder() { + return _super !== null && _super.apply(this, arguments) || this; + } + Object.defineProperty(Folder.prototype, "contentTypeOrder", { + /** + * Specifies the sequence in which content types are displayed. + * + */ + get: function () { + return new queryable_1.QueryableCollection(this, "contentTypeOrder"); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Folder.prototype, "files", { + /** + * Gets this folder's files + * + */ + get: function () { + return new files_1.Files(this); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Folder.prototype, "folders", { + /** + * Gets this folder's sub folders + * + */ + get: function () { + return new Folders(this); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Folder.prototype, "listItemAllFields", { + /** + * Gets this folder's list item field values + * + */ + get: function () { + return new queryable_1.QueryableCollection(this, "listItemAllFields"); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Folder.prototype, "parentFolder", { + /** + * Gets the parent folder, if available + * + */ + get: function () { + return new Folder(this, "parentFolder"); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Folder.prototype, "properties", { + /** + * Gets this folder's properties + * + */ + get: function () { + return new queryable_1.QueryableInstance(this, "properties"); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Folder.prototype, "serverRelativeUrl", { + /** + * Gets this folder's server relative url + * + */ + get: function () { + return new queryable_1.Queryable(this, "serverRelativeUrl"); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Folder.prototype, "uniqueContentTypeOrder", { + /** + * Gets a value that specifies the content type order. + * + */ + get: function () { + return new queryable_1.QueryableCollection(this, "uniqueContentTypeOrder"); + }, + enumerable: true, + configurable: true + }); + Folder.prototype.update = function (properties) { + var _this = this; + var postBody = JSON.stringify(util_1.Util.extend({ + "__metadata": { "type": "SP.Folder" }, + }, properties)); + return this.post({ + body: postBody, + headers: { + "X-HTTP-Method": "MERGE", + }, + }).then(function (data) { + return { + data: data, + folder: _this, + }; + }); + }; + /** + * Delete this folder + * + * @param eTag Value used in the IF-Match header, by default "*" + */ + Folder.prototype.delete = function (eTag) { + if (eTag === void 0) { eTag = "*"; } + return this.clone(Folder, null, true).post({ + headers: { + "IF-Match": eTag, + "X-HTTP-Method": "DELETE", + }, + }); + }; + /** + * Moves the folder to the Recycle Bin and returns the identifier of the new Recycle Bin item. + */ + Folder.prototype.recycle = function () { + return this.clone(Folder, "recycle", true).post(); + }; + /** + * Gets the associated list item for this folder, loading the default properties + */ + Folder.prototype.getItem = function () { + var selects = []; + for (var _i = 0; _i < arguments.length; _i++) { + selects[_i] = arguments[_i]; + } + var q = this.listItemAllFields; + return q.select.apply(q, selects).get().then(function (d) { + return util_1.Util.extend(new items_1.Item(odata_1.getEntityUrl(d)), d); + }); + }; + return Folder; +}(queryableshareable_1.QueryableShareableFolder)); +exports.Folder = Folder; + + +/***/ }), +/* 10 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var queryable_1 = __webpack_require__(1); +var queryableshareable_1 = __webpack_require__(12); +var folders_1 = __webpack_require__(9); +var files_1 = __webpack_require__(8); +var contenttypes_1 = __webpack_require__(16); +var util_1 = __webpack_require__(0); +var odata_1 = __webpack_require__(2); +var attachmentfiles_1 = __webpack_require__(42); +var lists_1 = __webpack_require__(11); +/** + * Describes a collection of Item objects + * + */ +var Items = (function (_super) { + __extends(Items, _super); + /** + * Creates a new instance of the Items class + * + * @param baseUrl The url or Queryable which forms the parent of this fields collection + */ + function Items(baseUrl, path) { + if (path === void 0) { path = "items"; } + return _super.call(this, baseUrl, path) || this; + } + /** + * Gets an Item by id + * + * @param id The integer id of the item to retrieve + */ + Items.prototype.getById = function (id) { + var i = new Item(this); + i.concat("(" + id + ")"); + return i; + }; + /** + * Skips the specified number of items (https://msdn.microsoft.com/en-us/library/office/fp142385.aspx#sectionSection6) + * + * @param skip The starting id where the page should start, use with top to specify pages + */ + Items.prototype.skip = function (skip) { + this._query.add("$skiptoken", encodeURIComponent("Paged=TRUE&p_ID=" + skip)); + return this; + }; + /** + * Gets a collection designed to aid in paging through data + * + */ + Items.prototype.getPaged = function () { + return this.getAs(new PagedItemCollectionParser()); + }; + // + /** + * Adds a new item to the collection + * + * @param properties The new items's properties + */ + Items.prototype.add = function (properties, listItemEntityTypeFullName) { + var _this = this; + if (properties === void 0) { properties = {}; } + if (listItemEntityTypeFullName === void 0) { listItemEntityTypeFullName = null; } + var removeDependency = this.addBatchDependency(); + return this.ensureListItemEntityTypeName(listItemEntityTypeFullName).then(function (listItemEntityType) { + var postBody = JSON.stringify(util_1.Util.extend({ + "__metadata": { "type": listItemEntityType }, + }, properties)); + var promise = _this.clone(Items, null, true).postAs({ body: postBody }).then(function (data) { + return { + data: data, + item: _this.getById(data.Id), + }; + }); + removeDependency(); + return promise; + }); + }; + /** + * Ensures we have the proper list item entity type name, either from the value provided or from the list + * + * @param candidatelistItemEntityTypeFullName The potential type name + */ + Items.prototype.ensureListItemEntityTypeName = function (candidatelistItemEntityTypeFullName) { + return candidatelistItemEntityTypeFullName ? + Promise.resolve(candidatelistItemEntityTypeFullName) : + this.getParent(lists_1.List).getListItemEntityTypeFullName(); + }; + return Items; +}(queryable_1.QueryableCollection)); +exports.Items = Items; +/** + * Descrines a single Item instance + * + */ +var Item = (function (_super) { + __extends(Item, _super); + function Item() { + return _super !== null && _super.apply(this, arguments) || this; + } + Object.defineProperty(Item.prototype, "attachmentFiles", { + /** + * Gets the set of attachments for this item + * + */ + get: function () { + return new attachmentfiles_1.AttachmentFiles(this); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Item.prototype, "contentType", { + /** + * Gets the content type for this item + * + */ + get: function () { + return new contenttypes_1.ContentType(this, "ContentType"); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Item.prototype, "effectiveBasePermissions", { + /** + * Gets the effective base permissions for the item + * + */ + get: function () { + return new queryable_1.Queryable(this, "EffectiveBasePermissions"); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Item.prototype, "effectiveBasePermissionsForUI", { + /** + * Gets the effective base permissions for the item in a UI context + * + */ + get: function () { + return new queryable_1.Queryable(this, "EffectiveBasePermissionsForUI"); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Item.prototype, "fieldValuesAsHTML", { + /** + * Gets the field values for this list item in their HTML representation + * + */ + get: function () { + return new queryable_1.QueryableInstance(this, "FieldValuesAsHTML"); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Item.prototype, "fieldValuesAsText", { + /** + * Gets the field values for this list item in their text representation + * + */ + get: function () { + return new queryable_1.QueryableInstance(this, "FieldValuesAsText"); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Item.prototype, "fieldValuesForEdit", { + /** + * Gets the field values for this list item for use in editing controls + * + */ + get: function () { + return new queryable_1.QueryableInstance(this, "FieldValuesForEdit"); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Item.prototype, "folder", { + /** + * Gets the folder associated with this list item (if this item represents a folder) + * + */ + get: function () { + return new folders_1.Folder(this, "folder"); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Item.prototype, "file", { + /** + * Gets the folder associated with this list item (if this item represents a folder) + * + */ + get: function () { + return new files_1.File(this, "file"); + }, + enumerable: true, + configurable: true + }); + /** + * Updates this list intance with the supplied properties + * + * @param properties A plain object hash of values to update for the list + * @param eTag Value used in the IF-Match header, by default "*" + */ + Item.prototype.update = function (properties, eTag) { + var _this = this; + if (eTag === void 0) { eTag = "*"; } + return new Promise(function (resolve, reject) { + var removeDependency = _this.addBatchDependency(); + var parentList = _this.getParent(queryable_1.QueryableInstance, _this.parentUrl.substr(0, _this.parentUrl.lastIndexOf("/"))); + parentList.select("ListItemEntityTypeFullName").getAs().then(function (d) { + var postBody = JSON.stringify(util_1.Util.extend({ + "__metadata": { "type": d.ListItemEntityTypeFullName }, + }, properties)); + removeDependency(); + return _this.post({ + body: postBody, + headers: { + "IF-Match": eTag, + "X-HTTP-Method": "MERGE", + }, + }, new ItemUpdatedParser()).then(function (data) { + resolve({ + data: data, + item: _this, + }); + }); + }).catch(function (e) { return reject(e); }); + }); + }; + /** + * Delete this item + * + * @param eTag Value used in the IF-Match header, by default "*" + */ + Item.prototype.delete = function (eTag) { + if (eTag === void 0) { eTag = "*"; } + return this.post({ + headers: { + "IF-Match": eTag, + "X-HTTP-Method": "DELETE", + }, + }); + }; + /** + * Moves the list item to the Recycle Bin and returns the identifier of the new Recycle Bin item. + */ + Item.prototype.recycle = function () { + return this.clone(Item, "recycle", true).post(); + }; + /** + * Gets a string representation of the full URL to the WOPI frame. + * If there is no associated WOPI application, or no associated action, an empty string is returned. + * + * @param action Display mode: 0: view, 1: edit, 2: mobileView, 3: interactivePreview + */ + Item.prototype.getWopiFrameUrl = function (action) { + if (action === void 0) { action = 0; } + var i = this.clone(Item, "getWOPIFrameUrl(@action)", true); + i._query.add("@action", action); + return i.post().then(function (data) { + return data.GetWOPIFrameUrl; + }); + }; + /** + * Validates and sets the values of the specified collection of fields for the list item. + * + * @param formValues The fields to change and their new values. + * @param newDocumentUpdate true if the list item is a document being updated after upload; otherwise false. + */ + Item.prototype.validateUpdateListItem = function (formValues, newDocumentUpdate) { + if (newDocumentUpdate === void 0) { newDocumentUpdate = false; } + return this.clone(Item, "validateupdatelistitem", true).post({ + body: JSON.stringify({ "formValues": formValues, bNewDocumentUpdate: newDocumentUpdate }), + }); + }; + return Item; +}(queryableshareable_1.QueryableShareableItem)); +exports.Item = Item; +/** + * Provides paging functionality for list items + */ +var PagedItemCollection = (function () { + function PagedItemCollection(nextUrl, results) { + this.nextUrl = nextUrl; + this.results = results; + } + Object.defineProperty(PagedItemCollection.prototype, "hasNext", { + /** + * If true there are more results available in the set, otherwise there are not + */ + get: function () { + return typeof this.nextUrl === "string" && this.nextUrl.length > 0; + }, + enumerable: true, + configurable: true + }); + /** + * Gets the next set of results, or resolves to null if no results are available + */ + PagedItemCollection.prototype.getNext = function () { + if (this.hasNext) { + var items = new Items(this.nextUrl, null); + return items.getPaged(); + } + return new Promise(function (r) { return r(null); }); + }; + return PagedItemCollection; +}()); +exports.PagedItemCollection = PagedItemCollection; +var PagedItemCollectionParser = (function (_super) { + __extends(PagedItemCollectionParser, _super); + function PagedItemCollectionParser() { + return _super !== null && _super.apply(this, arguments) || this; + } + PagedItemCollectionParser.prototype.parse = function (r) { + var _this = this; + return new Promise(function (resolve, reject) { + if (_this.handleError(r, reject)) { + r.json().then(function (json) { + var nextUrl = json.hasOwnProperty("d") && json.d.hasOwnProperty("__next") ? json.d.__next : json["odata.nextLink"]; + resolve(new PagedItemCollection(nextUrl, _this.parseODataJSON(json))); + }); + } + }); + }; + return PagedItemCollectionParser; +}(odata_1.ODataParserBase)); +var ItemUpdatedParser = (function (_super) { + __extends(ItemUpdatedParser, _super); + function ItemUpdatedParser() { + return _super !== null && _super.apply(this, arguments) || this; + } + ItemUpdatedParser.prototype.parse = function (r) { + var _this = this; + return new Promise(function (resolve, reject) { + if (_this.handleError(r, reject)) { + resolve({ + "odata.etag": r.headers.get("etag"), + }); + } + }); + }; + return ItemUpdatedParser; +}(odata_1.ODataParserBase)); + + +/***/ }), +/* 11 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var items_1 = __webpack_require__(10); +var views_1 = __webpack_require__(49); +var contenttypes_1 = __webpack_require__(16); +var fields_1 = __webpack_require__(24); +var forms_1 = __webpack_require__(43); +var subscriptions_1 = __webpack_require__(47); +var queryable_1 = __webpack_require__(1); +var queryablesecurable_1 = __webpack_require__(26); +var util_1 = __webpack_require__(0); +var usercustomactions_1 = __webpack_require__(19); +var odata_1 = __webpack_require__(2); +var exceptions_1 = __webpack_require__(3); +var folders_1 = __webpack_require__(9); +/** + * Describes a collection of List objects + * + */ +var Lists = (function (_super) { + __extends(Lists, _super); + /** + * Creates a new instance of the Lists class + * + * @param baseUrl The url or Queryable which forms the parent of this fields collection + */ + function Lists(baseUrl, path) { + if (path === void 0) { path = "lists"; } + return _super.call(this, baseUrl, path) || this; + } + /** + * Gets a list from the collection by title + * + * @param title The title of the list + */ + Lists.prototype.getByTitle = function (title) { + return new List(this, "getByTitle('" + title + "')"); + }; + /** + * Gets a list from the collection by guid id + * + * @param id The Id of the list (GUID) + */ + Lists.prototype.getById = function (id) { + var list = new List(this); + list.concat("('" + id + "')"); + return list; + }; + /** + * Adds a new list to the collection + * + * @param title The new list's title + * @param description The new list's description + * @param template The list template value + * @param enableContentTypes If true content types will be allowed and enabled, otherwise they will be disallowed and not enabled + * @param additionalSettings Will be passed as part of the list creation body + */ + Lists.prototype.add = function (title, description, template, enableContentTypes, additionalSettings) { + var _this = this; + if (description === void 0) { description = ""; } + if (template === void 0) { template = 100; } + if (enableContentTypes === void 0) { enableContentTypes = false; } + if (additionalSettings === void 0) { additionalSettings = {}; } + var addSettings = util_1.Util.extend({ + "AllowContentTypes": enableContentTypes, + "BaseTemplate": template, + "ContentTypesEnabled": enableContentTypes, + "Description": description, + "Title": title, + "__metadata": { "type": "SP.List" }, + }, additionalSettings); + return this.post({ body: JSON.stringify(addSettings) }).then(function (data) { + return { data: data, list: _this.getByTitle(addSettings.Title) }; + }); + }; + /** + * Ensures that the specified list exists in the collection (note: this method not supported for batching) + * + * @param title The new list's title + * @param description The new list's description + * @param template The list template value + * @param enableContentTypes If true content types will be allowed and enabled, otherwise they will be disallowed and not enabled + * @param additionalSettings Will be passed as part of the list creation body or used to update an existing list + */ + Lists.prototype.ensure = function (title, description, template, enableContentTypes, additionalSettings) { + var _this = this; + if (description === void 0) { description = ""; } + if (template === void 0) { template = 100; } + if (enableContentTypes === void 0) { enableContentTypes = false; } + if (additionalSettings === void 0) { additionalSettings = {}; } + if (this.hasBatch) { + throw new exceptions_1.NotSupportedInBatchException("The ensure list method"); + } + return new Promise(function (resolve, reject) { + var addOrUpdateSettings = util_1.Util.extend(additionalSettings, { Title: title, Description: description, ContentTypesEnabled: enableContentTypes }, true); + var list = _this.getByTitle(addOrUpdateSettings.Title); + list.get().then(function (_) { + list.update(addOrUpdateSettings).then(function (d) { + resolve({ created: false, data: d, list: _this.getByTitle(addOrUpdateSettings.Title) }); + }).catch(function (e) { return reject(e); }); + }).catch(function (_) { + _this.add(title, description, template, enableContentTypes, addOrUpdateSettings).then(function (r) { + resolve({ created: true, data: r.data, list: _this.getByTitle(addOrUpdateSettings.Title) }); + }).catch(function (e) { return reject(e); }); + }); + }); + }; + /** + * Gets a list that is the default asset location for images or other files, which the users upload to their wiki pages. + */ + Lists.prototype.ensureSiteAssetsLibrary = function () { + return this.clone(Lists, "ensuresiteassetslibrary", true).post().then(function (json) { + return new List(odata_1.extractOdataId(json)); + }); + }; + /** + * Gets a list that is the default location for wiki pages. + */ + Lists.prototype.ensureSitePagesLibrary = function () { + return this.clone(Lists, "ensuresitepageslibrary", true).post().then(function (json) { + return new List(odata_1.extractOdataId(json)); + }); + }; + return Lists; +}(queryable_1.QueryableCollection)); +exports.Lists = Lists; +/** + * Describes a single List instance + * + */ +var List = (function (_super) { + __extends(List, _super); + function List() { + return _super !== null && _super.apply(this, arguments) || this; + } + Object.defineProperty(List.prototype, "contentTypes", { + /** + * Gets the content types in this list + * + */ + get: function () { + return new contenttypes_1.ContentTypes(this); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(List.prototype, "items", { + /** + * Gets the items in this list + * + */ + get: function () { + return new items_1.Items(this); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(List.prototype, "views", { + /** + * Gets the views in this list + * + */ + get: function () { + return new views_1.Views(this); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(List.prototype, "fields", { + /** + * Gets the fields in this list + * + */ + get: function () { + return new fields_1.Fields(this); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(List.prototype, "forms", { + /** + * Gets the forms in this list + * + */ + get: function () { + return new forms_1.Forms(this); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(List.prototype, "defaultView", { + /** + * Gets the default view of this list + * + */ + get: function () { + return new queryable_1.QueryableInstance(this, "DefaultView"); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(List.prototype, "userCustomActions", { + /** + * Get all custom actions on a site collection + * + */ + get: function () { + return new usercustomactions_1.UserCustomActions(this); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(List.prototype, "effectiveBasePermissions", { + /** + * Gets the effective base permissions of this list + * + */ + get: function () { + return new queryable_1.Queryable(this, "EffectiveBasePermissions"); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(List.prototype, "eventReceivers", { + /** + * Gets the event receivers attached to this list + * + */ + get: function () { + return new queryable_1.QueryableCollection(this, "EventReceivers"); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(List.prototype, "relatedFields", { + /** + * Gets the related fields of this list + * + */ + get: function () { + return new queryable_1.Queryable(this, "getRelatedFields"); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(List.prototype, "informationRightsManagementSettings", { + /** + * Gets the IRM settings for this list + * + */ + get: function () { + return new queryable_1.Queryable(this, "InformationRightsManagementSettings"); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(List.prototype, "subscriptions", { + /** + * Gets the webhook subscriptions of this list + * + */ + get: function () { + return new subscriptions_1.Subscriptions(this); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(List.prototype, "rootFolder", { + /** + * The root folder of the list + */ + get: function () { + return new folders_1.Folder(this, "rootFolder"); + }, + enumerable: true, + configurable: true + }); + /** + * Gets a view by view guid id + * + */ + List.prototype.getView = function (viewId) { + return new views_1.View(this, "getView('" + viewId + "')"); + }; + /** + * Updates this list intance with the supplied properties + * + * @param properties A plain object hash of values to update for the list + * @param eTag Value used in the IF-Match header, by default "*" + */ + /* tslint:disable no-string-literal */ + List.prototype.update = function (properties, eTag) { + var _this = this; + if (eTag === void 0) { eTag = "*"; } + var postBody = JSON.stringify(util_1.Util.extend({ + "__metadata": { "type": "SP.List" }, + }, properties)); + return this.post({ + body: postBody, + headers: { + "IF-Match": eTag, + "X-HTTP-Method": "MERGE", + }, + }).then(function (data) { + var retList = _this; + if (properties.hasOwnProperty("Title")) { + retList = _this.getParent(List, _this.parentUrl, "getByTitle('" + properties["Title"] + "')"); + } + return { + data: data, + list: retList, + }; + }); + }; + /* tslint:enable */ + /** + * Delete this list + * + * @param eTag Value used in the IF-Match header, by default "*" + */ + List.prototype.delete = function (eTag) { + if (eTag === void 0) { eTag = "*"; } + return this.post({ + headers: { + "IF-Match": eTag, + "X-HTTP-Method": "DELETE", + }, + }); + }; + /** + * Returns the collection of changes from the change log that have occurred within the list, based on the specified query. + */ + List.prototype.getChanges = function (query) { + return this.clone(List, "getchanges", true).post({ + body: JSON.stringify({ "query": util_1.Util.extend({ "__metadata": { "type": "SP.ChangeQuery" } }, query) }), + }); + }; + /** + * Returns a collection of items from the list based on the specified query. + * + * @param CamlQuery The Query schema of Collaborative Application Markup + * Language (CAML) is used in various ways within the context of Microsoft SharePoint Foundation + * to define queries against list data. + * see: + * + * https://msdn.microsoft.com/en-us/library/office/ms467521.aspx + * + * @param expands A URI with a $expand System Query Option indicates that Entries associated with + * the Entry or Collection of Entries identified by the Resource Path + * section of the URI must be represented inline (i.e. eagerly loaded). + * see: + * + * https://msdn.microsoft.com/en-us/library/office/fp142385.aspx + * + * http://www.odata.org/documentation/odata-version-2-0/uri-conventions/#ExpandSystemQueryOption + */ + List.prototype.getItemsByCAMLQuery = function (query) { + var expands = []; + for (var _i = 1; _i < arguments.length; _i++) { + expands[_i - 1] = arguments[_i]; + } + var q = this.clone(List, "getitems", true); + return q.expand.apply(q, expands).post({ + body: JSON.stringify({ "query": util_1.Util.extend({ "__metadata": { "type": "SP.CamlQuery" } }, query) }), + }); + }; + /** + * See: https://msdn.microsoft.com/en-us/library/office/dn292554.aspx + */ + List.prototype.getListItemChangesSinceToken = function (query) { + return this.clone(List, "getlistitemchangessincetoken", true).post({ + body: JSON.stringify({ "query": util_1.Util.extend({ "__metadata": { "type": "SP.ChangeLogItemQuery" } }, query) }), + }, { parse: function (r) { return r.text(); } }); + }; + /** + * Moves the list to the Recycle Bin and returns the identifier of the new Recycle Bin item. + */ + List.prototype.recycle = function () { + return this.clone(List, "recycle", true).post().then(function (data) { + if (data.hasOwnProperty("Recycle")) { + return data.Recycle; + } + else { + return data; + } + }); + }; + /** + * Renders list data based on the view xml provided + */ + List.prototype.renderListData = function (viewXml) { + var q = this.clone(List, "renderlistdata(@viewXml)"); + q.query.add("@viewXml", "'" + viewXml + "'"); + return q.post().then(function (data) { + // data will be a string, so we parse it again + data = JSON.parse(data); + if (data.hasOwnProperty("RenderListData")) { + return data.RenderListData; + } + else { + return data; + } + }); + }; + /** + * Gets the field values and field schema attributes for a list item. + */ + List.prototype.renderListFormData = function (itemId, formId, mode) { + return this.clone(List, "renderlistformdata(itemid=" + itemId + ", formid='" + formId + "', mode='" + mode + "')", true).post().then(function (data) { + // data will be a string, so we parse it again + data = JSON.parse(data); + if (data.hasOwnProperty("ListData")) { + return data.ListData; + } + else { + return data; + } + }); + }; + /** + * Reserves a list item ID for idempotent list item creation. + */ + List.prototype.reserveListItemId = function () { + return this.clone(List, "reservelistitemid", true).post().then(function (data) { + if (data.hasOwnProperty("ReserveListItemId")) { + return data.ReserveListItemId; + } + else { + return data; + } + }); + }; + /** + * Returns the ListItemEntityTypeFullName for this list, used when adding/updating list items. Does not support batching. + * + */ + List.prototype.getListItemEntityTypeFullName = function () { + return this.clone(List, null).select("ListItemEntityTypeFullName").getAs().then(function (o) { return o.ListItemEntityTypeFullName; }); + }; + return List; +}(queryablesecurable_1.QueryableSecurable)); +exports.List = List; + + +/***/ }), +/* 12 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var util_1 = __webpack_require__(0); +var webs_1 = __webpack_require__(7); +var odata_1 = __webpack_require__(2); +var queryable_1 = __webpack_require__(1); +var queryablesecurable_1 = __webpack_require__(26); +var types_1 = __webpack_require__(13); +/** + * Internal helper class used to augment classes to include sharing functionality + */ +var QueryableShareable = (function (_super) { + __extends(QueryableShareable, _super); + function QueryableShareable() { + return _super !== null && _super.apply(this, arguments) || this; + } + /** + * Gets a sharing link for the supplied + * + * @param kind The kind of link to share + * @param expiration The optional expiration for this link + */ + QueryableShareable.prototype.getShareLink = function (kind, expiration) { + if (expiration === void 0) { expiration = null; } + // date needs to be an ISO string or null + var expString = expiration !== null ? expiration.toISOString() : null; + // clone using the factory and send the request + return this.clone(QueryableShareable, "shareLink", true).postAs({ + body: JSON.stringify({ + request: { + createLink: true, + emailData: null, + settings: { + expiration: expString, + linkKind: kind, + }, + }, + }), + }); + }; + /** + * Shares this instance with the supplied users + * + * @param loginNames Resolved login names to share + * @param role The role + * @param requireSignin True to require the user is authenticated, otherwise false + * @param propagateAcl True to apply this share to all children + * @param emailData If supplied an email will be sent with the indicated properties + */ + QueryableShareable.prototype.shareWith = function (loginNames, role, requireSignin, propagateAcl, emailData) { + var _this = this; + if (requireSignin === void 0) { requireSignin = true; } + if (propagateAcl === void 0) { propagateAcl = false; } + // handle the multiple input types + if (!Array.isArray(loginNames)) { + loginNames = [loginNames]; + } + var userStr = JSON.stringify(loginNames.map(function (login) { return { Key: login }; })); + var roleFilter = role === types_1.SharingRole.Edit ? types_1.RoleType.Contributor : types_1.RoleType.Reader; + // start by looking up the role definition id we need to set the roleValue + return webs_1.Web.fromUrl(this.toUrl()).roleDefinitions.select("Id").filter("RoleTypeKind eq " + roleFilter).get().then(function (def) { + if (!Array.isArray(def) || def.length < 1) { + throw new Error("Could not locate a role defintion with RoleTypeKind " + roleFilter); + } + var postBody = { + includeAnonymousLinkInEmail: requireSignin, + peoplePickerInput: userStr, + propagateAcl: propagateAcl, + roleValue: "role:" + def[0].Id, + useSimplifiedRoles: true, + }; + if (typeof emailData !== "undefined") { + postBody = util_1.Util.extend(postBody, { + emailBody: emailData.body, + emailSubject: typeof emailData.subject !== "undefined" ? "" : emailData.subject, + sendEmail: true, + }); + } + return _this.clone(QueryableShareable, "shareObject", true).postAs({ + body: JSON.stringify(postBody), + }); + }); + }; + /** + * Shares an object based on the supplied options + * + * @param options The set of options to send to the ShareObject method + * @param bypass If true any processing is skipped and the options are sent directly to the ShareObject method + */ + QueryableShareable.prototype.shareObject = function (options, bypass) { + var _this = this; + if (bypass === void 0) { bypass = false; } + if (bypass) { + // if the bypass flag is set send the supplied parameters directly to the service + return this.sendShareObjectRequest(options); + } + // extend our options with some defaults + options = util_1.Util.extend(options, { + group: null, + includeAnonymousLinkInEmail: false, + propagateAcl: false, + useSimplifiedRoles: true, + }, true); + return this.getRoleValue(options.role, options.group).then(function (roleValue) { + // handle the multiple input types + if (!Array.isArray(options.loginNames)) { + options.loginNames = [options.loginNames]; + } + var userStr = JSON.stringify(options.loginNames.map(function (login) { return { Key: login }; })); + var postBody = { + peoplePickerInput: userStr, + roleValue: roleValue, + url: options.url, + }; + if (typeof options.emailData !== "undefined" && options.emailData !== null) { + postBody = util_1.Util.extend(postBody, { + emailBody: options.emailData.body, + emailSubject: typeof options.emailData.subject !== "undefined" ? "Shared for you." : options.emailData.subject, + sendEmail: true, + }); + } + return _this.sendShareObjectRequest(postBody); + }); + }; + /** + * Calls the web's UnshareObject method + * + * @param url The url of the object to unshare + */ + QueryableShareable.prototype.unshareObjectWeb = function (url) { + return this.clone(QueryableShareable, "unshareObject", true).postAs({ + body: JSON.stringify({ + url: url, + }), + }); + }; + /** + * Checks Permissions on the list of Users and returns back role the users have on the Item. + * + * @param recipients The array of Entities for which Permissions need to be checked. + */ + QueryableShareable.prototype.checkPermissions = function (recipients) { + return this.clone(QueryableShareable, "checkPermissions", true).postAs({ + body: JSON.stringify({ + recipients: recipients, + }), + }); + }; + /** + * Get Sharing Information. + * + * @param request The SharingInformationRequest Object. + */ + QueryableShareable.prototype.getSharingInformation = function (request) { + if (request === void 0) { request = null; } + return this.clone(QueryableShareable, "getSharingInformation", true).postAs({ + body: JSON.stringify({ + request: request, + }), + }); + }; + /** + * Gets the sharing settings of an item. + * + * @param useSimplifiedRoles Determines whether to use simplified roles. + */ + QueryableShareable.prototype.getObjectSharingSettings = function (useSimplifiedRoles) { + if (useSimplifiedRoles === void 0) { useSimplifiedRoles = true; } + return this.clone(QueryableShareable, "getObjectSharingSettings", true).postAs({ + body: JSON.stringify({ + useSimplifiedRoles: useSimplifiedRoles, + }), + }); + }; + /** + * Unshares this object + */ + QueryableShareable.prototype.unshareObject = function () { + return this.clone(QueryableShareable, "unshareObject", true).postAs(); + }; + /** + * Deletes a link by type + * + * @param kind Deletes a sharing link by the kind of link + */ + QueryableShareable.prototype.deleteLinkByKind = function (kind) { + return this.clone(QueryableShareable, "deleteLinkByKind", true).post({ + body: JSON.stringify({ linkKind: kind }), + }); + }; + /** + * Removes the specified link to the item. + * + * @param kind The kind of link to be deleted. + * @param shareId + */ + QueryableShareable.prototype.unshareLink = function (kind, shareId) { + if (shareId === void 0) { shareId = "00000000-0000-0000-0000-000000000000"; } + return this.clone(QueryableShareable, "unshareLink", true).post({ + body: JSON.stringify({ linkKind: kind, shareId: shareId }), + }); + }; + /** + * Calculates the roleValue string used in the sharing query + * + * @param role The Sharing Role + * @param group The Group type + */ + QueryableShareable.prototype.getRoleValue = function (role, group) { + // we will give group precedence, because we had to make a choice + if (typeof group !== "undefined" && group !== null) { + switch (group) { + case types_1.RoleType.Contributor: + return webs_1.Web.fromUrl(this.toUrl()).associatedMemberGroup.select("Id").getAs().then(function (g) { return "group: " + g.Id; }); + case types_1.RoleType.Reader: + case types_1.RoleType.Guest: + return webs_1.Web.fromUrl(this.toUrl()).associatedVisitorGroup.select("Id").getAs().then(function (g) { return "group: " + g.Id; }); + default: + throw new Error("Could not determine role value for supplied value. Contributor, Reader, and Guest are supported"); + } + } + else { + var roleFilter = role === types_1.SharingRole.Edit ? types_1.RoleType.Contributor : types_1.RoleType.Reader; + return webs_1.Web.fromUrl(this.toUrl()).roleDefinitions.select("Id").top(1).filter("RoleTypeKind eq " + roleFilter).getAs().then(function (def) { + if (def.length < 1) { + throw new Error("Could not locate associated role definition for supplied role. Edit and View are supported"); + } + return "role: " + def[0].Id; + }); + } + }; + QueryableShareable.prototype.getShareObjectWeb = function (candidate) { + return Promise.resolve(webs_1.Web.fromUrl(candidate, "/_api/SP.Web.ShareObject")); + }; + QueryableShareable.prototype.sendShareObjectRequest = function (options) { + return this.getShareObjectWeb(this.toUrl()).then(function (web) { + return web.expand("UsersWithAccessRequests", "GroupsSharedWith").as(QueryableShareable).post({ + body: JSON.stringify(options), + }); + }); + }; + return QueryableShareable; +}(queryable_1.Queryable)); +exports.QueryableShareable = QueryableShareable; +var QueryableShareableWeb = (function (_super) { + __extends(QueryableShareableWeb, _super); + function QueryableShareableWeb() { + return _super !== null && _super.apply(this, arguments) || this; + } + /** + * Shares this web with the supplied users + * @param loginNames The resolved login names to share + * @param role The role to share this web + * @param emailData Optional email data + */ + QueryableShareableWeb.prototype.shareWith = function (loginNames, role, emailData) { + var _this = this; + if (role === void 0) { role = types_1.SharingRole.View; } + var dependency = this.addBatchDependency(); + return webs_1.Web.fromUrl(this.toUrl(), "/_api/web/url").get().then(function (url) { + dependency(); + return _this.shareObject(util_1.Util.combinePaths(url, "/_layouts/15/aclinv.aspx?forSharing=1&mbypass=1"), loginNames, role, emailData); + }); + }; + /** + * Provides direct access to the static web.ShareObject method + * + * @param url The url to share + * @param loginNames Resolved loginnames string[] of a single login name string + * @param roleValue Role value + * @param emailData Optional email data + * @param groupId Optional group id + * @param propagateAcl + * @param includeAnonymousLinkInEmail + * @param useSimplifiedRoles + */ + QueryableShareableWeb.prototype.shareObject = function (url, loginNames, role, emailData, group, propagateAcl, includeAnonymousLinkInEmail, useSimplifiedRoles) { + if (propagateAcl === void 0) { propagateAcl = false; } + if (includeAnonymousLinkInEmail === void 0) { includeAnonymousLinkInEmail = false; } + if (useSimplifiedRoles === void 0) { useSimplifiedRoles = true; } + return this.clone(QueryableShareable, null, true).shareObject({ + emailData: emailData, + group: group, + includeAnonymousLinkInEmail: includeAnonymousLinkInEmail, + loginNames: loginNames, + propagateAcl: propagateAcl, + role: role, + url: url, + useSimplifiedRoles: useSimplifiedRoles, + }); + }; + /** + * Supplies a method to pass any set of arguments to ShareObject + * + * @param options The set of options to send to ShareObject + */ + QueryableShareableWeb.prototype.shareObjectRaw = function (options) { + return this.clone(QueryableShareable, null, true).shareObject(options, true); + }; + /** + * Unshares the object + * + * @param url The url of the object to stop sharing + */ + QueryableShareableWeb.prototype.unshareObject = function (url) { + return this.clone(QueryableShareable, null, true).unshareObjectWeb(url); + }; + return QueryableShareableWeb; +}(queryablesecurable_1.QueryableSecurable)); +exports.QueryableShareableWeb = QueryableShareableWeb; +var QueryableShareableItem = (function (_super) { + __extends(QueryableShareableItem, _super); + function QueryableShareableItem() { + return _super !== null && _super.apply(this, arguments) || this; + } + /** + * Gets a link suitable for sharing for this item + * + * @param kind The type of link to share + * @param expiration The optional expiration date + */ + QueryableShareableItem.prototype.getShareLink = function (kind, expiration) { + if (kind === void 0) { kind = types_1.SharingLinkKind.OrganizationView; } + if (expiration === void 0) { expiration = null; } + return this.clone(QueryableShareable, null, true).getShareLink(kind, expiration); + }; + /** + * Shares this item with one or more users + * + * @param loginNames string or string[] of resolved login names to which this item will be shared + * @param role The role (View | Edit) applied to the share + * @param emailData Optional, if inlucded an email will be sent. Note subject currently has no effect. + */ + QueryableShareableItem.prototype.shareWith = function (loginNames, role, requireSignin, emailData) { + if (role === void 0) { role = types_1.SharingRole.View; } + if (requireSignin === void 0) { requireSignin = true; } + return this.clone(QueryableShareable, null, true).shareWith(loginNames, role, requireSignin, false, emailData); + }; + /** + * Checks Permissions on the list of Users and returns back role the users have on the Item. + * + * @param recipients The array of Entities for which Permissions need to be checked. + */ + QueryableShareableItem.prototype.checkSharingPermissions = function (recipients) { + return this.clone(QueryableShareable, null, true).checkPermissions(recipients); + }; + /** + * Get Sharing Information. + * + * @param request The SharingInformationRequest Object. + */ + QueryableShareableItem.prototype.getSharingInformation = function (request) { + if (request === void 0) { request = null; } + return this.clone(QueryableShareable, null, true).getSharingInformation(request); + }; + /** + * Gets the sharing settings of an item. + * + * @param useSimplifiedRoles Determines whether to use simplified roles. + */ + QueryableShareableItem.prototype.getObjectSharingSettings = function (useSimplifiedRoles) { + if (useSimplifiedRoles === void 0) { useSimplifiedRoles = true; } + return this.clone(QueryableShareable, null, true).getObjectSharingSettings(useSimplifiedRoles); + }; + /** + * Unshare this item + */ + QueryableShareableItem.prototype.unshare = function () { + return this.clone(QueryableShareable, null, true).unshareObject(); + }; + /** + * Deletes a sharing link by kind + * + * @param kind Deletes a sharing link by the kind of link + */ + QueryableShareableItem.prototype.deleteSharingLinkByKind = function (kind) { + return this.clone(QueryableShareable, null, true).deleteLinkByKind(kind); + }; + /** + * Removes the specified link to the item. + * + * @param kind The kind of link to be deleted. + * @param shareId + */ + QueryableShareableItem.prototype.unshareLink = function (kind, shareId) { + return this.clone(QueryableShareable, null, true).unshareLink(kind, shareId); + }; + return QueryableShareableItem; +}(queryablesecurable_1.QueryableSecurable)); +exports.QueryableShareableItem = QueryableShareableItem; +var FileFolderShared = (function (_super) { + __extends(FileFolderShared, _super); + function FileFolderShared() { + return _super !== null && _super.apply(this, arguments) || this; + } + /** + * Gets a link suitable for sharing + * + * @param kind The kind of link to get + * @param expiration Optional, an expiration for this link + */ + FileFolderShared.prototype.getShareLink = function (kind, expiration) { + if (kind === void 0) { kind = types_1.SharingLinkKind.OrganizationView; } + if (expiration === void 0) { expiration = null; } + var dependency = this.addBatchDependency(); + return this.getShareable().then(function (shareable) { + dependency(); + return shareable.getShareLink(kind, expiration); + }); + }; + /** + * Checks Permissions on the list of Users and returns back role the users have on the Item. + * + * @param recipients The array of Entities for which Permissions need to be checked. + */ + FileFolderShared.prototype.checkSharingPermissions = function (recipients) { + var dependency = this.addBatchDependency(); + return this.getShareable().then(function (shareable) { + dependency(); + return shareable.checkPermissions(recipients); + }); + }; + /** + * Get Sharing Information. + * + * @param request The SharingInformationRequest Object. + */ + FileFolderShared.prototype.getSharingInformation = function (request) { + if (request === void 0) { request = null; } + var dependency = this.addBatchDependency(); + return this.getShareable().then(function (shareable) { + dependency(); + return shareable.getSharingInformation(request); + }); + }; + /** + * Gets the sharing settings of an item. + * + * @param useSimplifiedRoles Determines whether to use simplified roles. + */ + FileFolderShared.prototype.getObjectSharingSettings = function (useSimplifiedRoles) { + if (useSimplifiedRoles === void 0) { useSimplifiedRoles = true; } + var dependency = this.addBatchDependency(); + return this.getShareable().then(function (shareable) { + dependency(); + return shareable.getObjectSharingSettings(useSimplifiedRoles); + }); + }; + /** + * Unshare this item + */ + FileFolderShared.prototype.unshare = function () { + var dependency = this.addBatchDependency(); + return this.getShareable().then(function (shareable) { + dependency(); + return shareable.unshareObject(); + }); + }; + /** + * Deletes a sharing link by the kind of link + * + * @param kind The kind of link to be deleted. + */ + FileFolderShared.prototype.deleteSharingLinkByKind = function (kind) { + var dependency = this.addBatchDependency(); + return this.getShareable().then(function (shareable) { + dependency(); + return shareable.deleteLinkByKind(kind); + }); + }; + /** + * Removes the specified link to the item. + * + * @param kind The kind of link to be deleted. + * @param shareId The share id to delete + */ + FileFolderShared.prototype.unshareLink = function (kind, shareId) { + var dependency = this.addBatchDependency(); + return this.getShareable().then(function (shareable) { + dependency(); + return shareable.unshareLink(kind, shareId); + }); + }; + /** + * For files and folders we need to use the associated item end point + */ + FileFolderShared.prototype.getShareable = function () { + var _this = this; + // sharing only works on the item end point, not the file one - so we create a folder instance with the item url internally + return this.clone(QueryableShareableFile, "listItemAllFields", false).select("odata.editlink").get().then(function (d) { + var shareable = new QueryableShareable(odata_1.getEntityUrl(d)); + // we need to handle batching + if (_this.hasBatch) { + shareable = shareable.inBatch(_this.batch); + } + return shareable; + }); + }; + return FileFolderShared; +}(queryable_1.QueryableInstance)); +exports.FileFolderShared = FileFolderShared; +var QueryableShareableFile = (function (_super) { + __extends(QueryableShareableFile, _super); + function QueryableShareableFile() { + return _super !== null && _super.apply(this, arguments) || this; + } + /** + * Shares this item with one or more users + * + * @param loginNames string or string[] of resolved login names to which this item will be shared + * @param role The role (View | Edit) applied to the share + * @param shareEverything Share everything in this folder, even items with unique permissions. + * @param requireSignin If true the user must signin to view link, otherwise anyone with the link can access the resource + * @param emailData Optional, if inlucded an email will be sent. Note subject currently has no effect. + */ + QueryableShareableFile.prototype.shareWith = function (loginNames, role, requireSignin, emailData) { + if (role === void 0) { role = types_1.SharingRole.View; } + if (requireSignin === void 0) { requireSignin = true; } + var dependency = this.addBatchDependency(); + return this.getShareable().then(function (shareable) { + dependency(); + return shareable.shareWith(loginNames, role, requireSignin, false, emailData); + }); + }; + return QueryableShareableFile; +}(FileFolderShared)); +exports.QueryableShareableFile = QueryableShareableFile; +var QueryableShareableFolder = (function (_super) { + __extends(QueryableShareableFolder, _super); + function QueryableShareableFolder() { + return _super !== null && _super.apply(this, arguments) || this; + } + /** + * Shares this item with one or more users + * + * @param loginNames string or string[] of resolved login names to which this item will be shared + * @param role The role (View | Edit) applied to the share + * @param shareEverything Share everything in this folder, even items with unique permissions. + * @param requireSignin If true the user must signin to view link, otherwise anyone with the link can access the resource + * @param emailData Optional, if inlucded an email will be sent. Note subject currently has no effect. + */ + QueryableShareableFolder.prototype.shareWith = function (loginNames, role, requireSignin, shareEverything, emailData) { + if (role === void 0) { role = types_1.SharingRole.View; } + if (requireSignin === void 0) { requireSignin = true; } + if (shareEverything === void 0) { shareEverything = false; } + var dependency = this.addBatchDependency(); + return this.getShareable().then(function (shareable) { + dependency(); + return shareable.shareWith(loginNames, role, requireSignin, shareEverything, emailData); + }); + }; + return QueryableShareableFolder; +}(FileFolderShared)); +exports.QueryableShareableFolder = QueryableShareableFolder; + + +/***/ }), +/* 13 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// reference: https://msdn.microsoft.com/en-us/library/office/dn600183.aspx + +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * Determines the display mode of the given control or view + */ +var ControlMode; +(function (ControlMode) { + ControlMode[ControlMode["Display"] = 1] = "Display"; + ControlMode[ControlMode["Edit"] = 2] = "Edit"; + ControlMode[ControlMode["New"] = 3] = "New"; +})(ControlMode = exports.ControlMode || (exports.ControlMode = {})); +/** + * Specifies the type of the field. + */ +var FieldTypes; +(function (FieldTypes) { + FieldTypes[FieldTypes["Invalid"] = 0] = "Invalid"; + FieldTypes[FieldTypes["Integer"] = 1] = "Integer"; + FieldTypes[FieldTypes["Text"] = 2] = "Text"; + FieldTypes[FieldTypes["Note"] = 3] = "Note"; + FieldTypes[FieldTypes["DateTime"] = 4] = "DateTime"; + FieldTypes[FieldTypes["Counter"] = 5] = "Counter"; + FieldTypes[FieldTypes["Choice"] = 6] = "Choice"; + FieldTypes[FieldTypes["Lookup"] = 7] = "Lookup"; + FieldTypes[FieldTypes["Boolean"] = 8] = "Boolean"; + FieldTypes[FieldTypes["Number"] = 9] = "Number"; + FieldTypes[FieldTypes["Currency"] = 10] = "Currency"; + FieldTypes[FieldTypes["URL"] = 11] = "URL"; + FieldTypes[FieldTypes["Computed"] = 12] = "Computed"; + FieldTypes[FieldTypes["Threading"] = 13] = "Threading"; + FieldTypes[FieldTypes["Guid"] = 14] = "Guid"; + FieldTypes[FieldTypes["MultiChoice"] = 15] = "MultiChoice"; + FieldTypes[FieldTypes["GridChoice"] = 16] = "GridChoice"; + FieldTypes[FieldTypes["Calculated"] = 17] = "Calculated"; + FieldTypes[FieldTypes["File"] = 18] = "File"; + FieldTypes[FieldTypes["Attachments"] = 19] = "Attachments"; + FieldTypes[FieldTypes["User"] = 20] = "User"; + FieldTypes[FieldTypes["Recurrence"] = 21] = "Recurrence"; + FieldTypes[FieldTypes["CrossProjectLink"] = 22] = "CrossProjectLink"; + FieldTypes[FieldTypes["ModStat"] = 23] = "ModStat"; + FieldTypes[FieldTypes["Error"] = 24] = "Error"; + FieldTypes[FieldTypes["ContentTypeId"] = 25] = "ContentTypeId"; + FieldTypes[FieldTypes["PageSeparator"] = 26] = "PageSeparator"; + FieldTypes[FieldTypes["ThreadIndex"] = 27] = "ThreadIndex"; + FieldTypes[FieldTypes["WorkflowStatus"] = 28] = "WorkflowStatus"; + FieldTypes[FieldTypes["AllDayEvent"] = 29] = "AllDayEvent"; + FieldTypes[FieldTypes["WorkflowEventType"] = 30] = "WorkflowEventType"; +})(FieldTypes = exports.FieldTypes || (exports.FieldTypes = {})); +var DateTimeFieldFormatType; +(function (DateTimeFieldFormatType) { + DateTimeFieldFormatType[DateTimeFieldFormatType["DateOnly"] = 0] = "DateOnly"; + DateTimeFieldFormatType[DateTimeFieldFormatType["DateTime"] = 1] = "DateTime"; +})(DateTimeFieldFormatType = exports.DateTimeFieldFormatType || (exports.DateTimeFieldFormatType = {})); +/** + * Specifies the control settings while adding a field. + */ +var AddFieldOptions; +(function (AddFieldOptions) { + /** + * Specify that a new field added to the list must also be added to the default content type in the site collection + */ + AddFieldOptions[AddFieldOptions["DefaultValue"] = 0] = "DefaultValue"; + /** + * Specify that a new field added to the list must also be added to the default content type in the site collection. + */ + AddFieldOptions[AddFieldOptions["AddToDefaultContentType"] = 1] = "AddToDefaultContentType"; + /** + * Specify that a new field must not be added to any other content type + */ + AddFieldOptions[AddFieldOptions["AddToNoContentType"] = 2] = "AddToNoContentType"; + /** + * Specify that a new field that is added to the specified list must also be added to all content types in the site collection + */ + AddFieldOptions[AddFieldOptions["AddToAllContentTypes"] = 4] = "AddToAllContentTypes"; + /** + * Specify adding an internal field name hint for the purpose of avoiding possible database locking or field renaming operations + */ + AddFieldOptions[AddFieldOptions["AddFieldInternalNameHint"] = 8] = "AddFieldInternalNameHint"; + /** + * Specify that a new field that is added to the specified list must also be added to the default list view + */ + AddFieldOptions[AddFieldOptions["AddFieldToDefaultView"] = 16] = "AddFieldToDefaultView"; + /** + * Specify to confirm that no other field has the same display name + */ + AddFieldOptions[AddFieldOptions["AddFieldCheckDisplayName"] = 32] = "AddFieldCheckDisplayName"; +})(AddFieldOptions = exports.AddFieldOptions || (exports.AddFieldOptions = {})); +var CalendarType; +(function (CalendarType) { + CalendarType[CalendarType["Gregorian"] = 1] = "Gregorian"; + CalendarType[CalendarType["Japan"] = 3] = "Japan"; + CalendarType[CalendarType["Taiwan"] = 4] = "Taiwan"; + CalendarType[CalendarType["Korea"] = 5] = "Korea"; + CalendarType[CalendarType["Hijri"] = 6] = "Hijri"; + CalendarType[CalendarType["Thai"] = 7] = "Thai"; + CalendarType[CalendarType["Hebrew"] = 8] = "Hebrew"; + CalendarType[CalendarType["GregorianMEFrench"] = 9] = "GregorianMEFrench"; + CalendarType[CalendarType["GregorianArabic"] = 10] = "GregorianArabic"; + CalendarType[CalendarType["GregorianXLITEnglish"] = 11] = "GregorianXLITEnglish"; + CalendarType[CalendarType["GregorianXLITFrench"] = 12] = "GregorianXLITFrench"; + CalendarType[CalendarType["KoreaJapanLunar"] = 14] = "KoreaJapanLunar"; + CalendarType[CalendarType["ChineseLunar"] = 15] = "ChineseLunar"; + CalendarType[CalendarType["SakaEra"] = 16] = "SakaEra"; + CalendarType[CalendarType["UmAlQura"] = 23] = "UmAlQura"; +})(CalendarType = exports.CalendarType || (exports.CalendarType = {})); +var UrlFieldFormatType; +(function (UrlFieldFormatType) { + UrlFieldFormatType[UrlFieldFormatType["Hyperlink"] = 0] = "Hyperlink"; + UrlFieldFormatType[UrlFieldFormatType["Image"] = 1] = "Image"; +})(UrlFieldFormatType = exports.UrlFieldFormatType || (exports.UrlFieldFormatType = {})); +var PermissionKind; +(function (PermissionKind) { + /** + * Has no permissions on the Site. Not available through the user interface. + */ + PermissionKind[PermissionKind["EmptyMask"] = 0] = "EmptyMask"; + /** + * View items in lists, documents in document libraries, and Web discussion comments. + */ + PermissionKind[PermissionKind["ViewListItems"] = 1] = "ViewListItems"; + /** + * Add items to lists, documents to document libraries, and Web discussion comments. + */ + PermissionKind[PermissionKind["AddListItems"] = 2] = "AddListItems"; + /** + * Edit items in lists, edit documents in document libraries, edit Web discussion comments + * in documents, and customize Web Part Pages in document libraries. + */ + PermissionKind[PermissionKind["EditListItems"] = 3] = "EditListItems"; + /** + * Delete items from a list, documents from a document library, and Web discussion + * comments in documents. + */ + PermissionKind[PermissionKind["DeleteListItems"] = 4] = "DeleteListItems"; + /** + * Approve a minor version of a list item or document. + */ + PermissionKind[PermissionKind["ApproveItems"] = 5] = "ApproveItems"; + /** + * View the source of documents with server-side file handlers. + */ + PermissionKind[PermissionKind["OpenItems"] = 6] = "OpenItems"; + /** + * View past versions of a list item or document. + */ + PermissionKind[PermissionKind["ViewVersions"] = 7] = "ViewVersions"; + /** + * Delete past versions of a list item or document. + */ + PermissionKind[PermissionKind["DeleteVersions"] = 8] = "DeleteVersions"; + /** + * Discard or check in a document which is checked out to another user. + */ + PermissionKind[PermissionKind["CancelCheckout"] = 9] = "CancelCheckout"; + /** + * Create, change, and delete personal views of lists. + */ + PermissionKind[PermissionKind["ManagePersonalViews"] = 10] = "ManagePersonalViews"; + /** + * Create and delete lists, add or remove columns in a list, and add or remove public views of a list. + */ + PermissionKind[PermissionKind["ManageLists"] = 12] = "ManageLists"; + /** + * View forms, views, and application pages, and enumerate lists. + */ + PermissionKind[PermissionKind["ViewFormPages"] = 13] = "ViewFormPages"; + /** + * Make content of a list or document library retrieveable for anonymous users through SharePoint search. + * The list permissions in the site do not change. + */ + PermissionKind[PermissionKind["AnonymousSearchAccessList"] = 14] = "AnonymousSearchAccessList"; + /** + * Allow users to open a Site, list, or folder to access items inside that container. + */ + PermissionKind[PermissionKind["Open"] = 17] = "Open"; + /** + * View pages in a Site. + */ + PermissionKind[PermissionKind["ViewPages"] = 18] = "ViewPages"; + /** + * Add, change, or delete HTML pages or Web Part Pages, and edit the Site using + * a Windows SharePoint Services compatible editor. + */ + PermissionKind[PermissionKind["AddAndCustomizePages"] = 19] = "AddAndCustomizePages"; + /** + * Apply a theme or borders to the entire Site. + */ + PermissionKind[PermissionKind["ApplyThemeAndBorder"] = 20] = "ApplyThemeAndBorder"; + /** + * Apply a style sheet (.css file) to the Site. + */ + PermissionKind[PermissionKind["ApplyStyleSheets"] = 21] = "ApplyStyleSheets"; + /** + * View reports on Site usage. + */ + PermissionKind[PermissionKind["ViewUsageData"] = 22] = "ViewUsageData"; + /** + * Create a Site using Self-Service Site Creation. + */ + PermissionKind[PermissionKind["CreateSSCSite"] = 23] = "CreateSSCSite"; + /** + * Create subsites such as team sites, Meeting Workspace sites, and Document Workspace sites. + */ + PermissionKind[PermissionKind["ManageSubwebs"] = 24] = "ManageSubwebs"; + /** + * Create a group of users that can be used anywhere within the site collection. + */ + PermissionKind[PermissionKind["CreateGroups"] = 25] = "CreateGroups"; + /** + * Create and change permission levels on the Site and assign permissions to users + * and groups. + */ + PermissionKind[PermissionKind["ManagePermissions"] = 26] = "ManagePermissions"; + /** + * Enumerate files and folders in a Site using Microsoft Office SharePoint Designer + * and WebDAV interfaces. + */ + PermissionKind[PermissionKind["BrowseDirectories"] = 27] = "BrowseDirectories"; + /** + * View information about users of the Site. + */ + PermissionKind[PermissionKind["BrowseUserInfo"] = 28] = "BrowseUserInfo"; + /** + * Add or remove personal Web Parts on a Web Part Page. + */ + PermissionKind[PermissionKind["AddDelPrivateWebParts"] = 29] = "AddDelPrivateWebParts"; + /** + * Update Web Parts to display personalized information. + */ + PermissionKind[PermissionKind["UpdatePersonalWebParts"] = 30] = "UpdatePersonalWebParts"; + /** + * Grant the ability to perform all administration tasks for the Site as well as + * manage content, activate, deactivate, or edit properties of Site scoped Features + * through the object model or through the user interface (UI). When granted on the + * root Site of a Site Collection, activate, deactivate, or edit properties of + * site collection scoped Features through the object model. To browse to the Site + * Collection Features page and activate or deactivate Site Collection scoped Features + * through the UI, you must be a Site Collection administrator. + */ + PermissionKind[PermissionKind["ManageWeb"] = 31] = "ManageWeb"; + /** + * Content of lists and document libraries in the Web site will be retrieveable for anonymous users through + * SharePoint search if the list or document library has AnonymousSearchAccessList set. + */ + PermissionKind[PermissionKind["AnonymousSearchAccessWebLists"] = 32] = "AnonymousSearchAccessWebLists"; + /** + * Use features that launch client applications. Otherwise, users must work on documents + * locally and upload changes. + */ + PermissionKind[PermissionKind["UseClientIntegration"] = 37] = "UseClientIntegration"; + /** + * Use SOAP, WebDAV, or Microsoft Office SharePoint Designer interfaces to access the Site. + */ + PermissionKind[PermissionKind["UseRemoteAPIs"] = 38] = "UseRemoteAPIs"; + /** + * Manage alerts for all users of the Site. + */ + PermissionKind[PermissionKind["ManageAlerts"] = 39] = "ManageAlerts"; + /** + * Create e-mail alerts. + */ + PermissionKind[PermissionKind["CreateAlerts"] = 40] = "CreateAlerts"; + /** + * Allows a user to change his or her user information, such as adding a picture. + */ + PermissionKind[PermissionKind["EditMyUserInfo"] = 41] = "EditMyUserInfo"; + /** + * Enumerate permissions on Site, list, folder, document, or list item. + */ + PermissionKind[PermissionKind["EnumeratePermissions"] = 63] = "EnumeratePermissions"; + /** + * Has all permissions on the Site. Not available through the user interface. + */ + PermissionKind[PermissionKind["FullMask"] = 65] = "FullMask"; +})(PermissionKind = exports.PermissionKind || (exports.PermissionKind = {})); +var PrincipalType; +(function (PrincipalType) { + PrincipalType[PrincipalType["None"] = 0] = "None"; + PrincipalType[PrincipalType["User"] = 1] = "User"; + PrincipalType[PrincipalType["DistributionList"] = 2] = "DistributionList"; + PrincipalType[PrincipalType["SecurityGroup"] = 4] = "SecurityGroup"; + PrincipalType[PrincipalType["SharePointGroup"] = 8] = "SharePointGroup"; + PrincipalType[PrincipalType["All"] = 15] = "All"; +})(PrincipalType = exports.PrincipalType || (exports.PrincipalType = {})); +var RoleType; +(function (RoleType) { + RoleType[RoleType["None"] = 0] = "None"; + RoleType[RoleType["Guest"] = 1] = "Guest"; + RoleType[RoleType["Reader"] = 2] = "Reader"; + RoleType[RoleType["Contributor"] = 3] = "Contributor"; + RoleType[RoleType["WebDesigner"] = 4] = "WebDesigner"; + RoleType[RoleType["Administrator"] = 5] = "Administrator"; +})(RoleType = exports.RoleType || (exports.RoleType = {})); +var PageType; +(function (PageType) { + PageType[PageType["Invalid"] = -1] = "Invalid"; + PageType[PageType["DefaultView"] = 0] = "DefaultView"; + PageType[PageType["NormalView"] = 1] = "NormalView"; + PageType[PageType["DialogView"] = 2] = "DialogView"; + PageType[PageType["View"] = 3] = "View"; + PageType[PageType["DisplayForm"] = 4] = "DisplayForm"; + PageType[PageType["DisplayFormDialog"] = 5] = "DisplayFormDialog"; + PageType[PageType["EditForm"] = 6] = "EditForm"; + PageType[PageType["EditFormDialog"] = 7] = "EditFormDialog"; + PageType[PageType["NewForm"] = 8] = "NewForm"; + PageType[PageType["NewFormDialog"] = 9] = "NewFormDialog"; + PageType[PageType["SolutionForm"] = 10] = "SolutionForm"; + PageType[PageType["PAGE_MAXITEMS"] = 11] = "PAGE_MAXITEMS"; +})(PageType = exports.PageType || (exports.PageType = {})); +var SharingLinkKind; +(function (SharingLinkKind) { + /** + * Uninitialized link + */ + SharingLinkKind[SharingLinkKind["Uninitialized"] = 0] = "Uninitialized"; + /** + * Direct link to the object being shared + */ + SharingLinkKind[SharingLinkKind["Direct"] = 1] = "Direct"; + /** + * Organization-shareable link to the object being shared with view permissions + */ + SharingLinkKind[SharingLinkKind["OrganizationView"] = 2] = "OrganizationView"; + /** + * Organization-shareable link to the object being shared with edit permissions + */ + SharingLinkKind[SharingLinkKind["OrganizationEdit"] = 3] = "OrganizationEdit"; + /** + * View only anonymous link + */ + SharingLinkKind[SharingLinkKind["AnonymousView"] = 4] = "AnonymousView"; + /** + * Read/Write anonymous link + */ + SharingLinkKind[SharingLinkKind["AnonymousEdit"] = 5] = "AnonymousEdit"; + /** + * Flexible sharing Link where properties can change without affecting link URL + */ + SharingLinkKind[SharingLinkKind["Flexible"] = 6] = "Flexible"; +})(SharingLinkKind = exports.SharingLinkKind || (exports.SharingLinkKind = {})); +; +/** + * Indicates the role of the sharing link + */ +var SharingRole; +(function (SharingRole) { + SharingRole[SharingRole["None"] = 0] = "None"; + SharingRole[SharingRole["View"] = 1] = "View"; + SharingRole[SharingRole["Edit"] = 2] = "Edit"; + SharingRole[SharingRole["Owner"] = 3] = "Owner"; +})(SharingRole = exports.SharingRole || (exports.SharingRole = {})); +var SharingOperationStatusCode; +(function (SharingOperationStatusCode) { + /** + * The share operation completed without errors. + */ + SharingOperationStatusCode[SharingOperationStatusCode["CompletedSuccessfully"] = 0] = "CompletedSuccessfully"; + /** + * The share operation completed and generated requests for access. + */ + SharingOperationStatusCode[SharingOperationStatusCode["AccessRequestsQueued"] = 1] = "AccessRequestsQueued"; + /** + * The share operation failed as there were no resolved users. + */ + SharingOperationStatusCode[SharingOperationStatusCode["NoResolvedUsers"] = -1] = "NoResolvedUsers"; + /** + * The share operation failed due to insufficient permissions. + */ + SharingOperationStatusCode[SharingOperationStatusCode["AccessDenied"] = -2] = "AccessDenied"; + /** + * The share operation failed when attempting a cross site share, which is not supported. + */ + SharingOperationStatusCode[SharingOperationStatusCode["CrossSiteRequestNotSupported"] = -3] = "CrossSiteRequestNotSupported"; + /** + * The sharing operation failed due to an unknown error. + */ + SharingOperationStatusCode[SharingOperationStatusCode["UnknowError"] = -4] = "UnknowError"; + /** + * The text you typed is too long. Please shorten it. + */ + SharingOperationStatusCode[SharingOperationStatusCode["EmailBodyTooLong"] = -5] = "EmailBodyTooLong"; + /** + * The maximum number of unique scopes in the list has been exceeded. + */ + SharingOperationStatusCode[SharingOperationStatusCode["ListUniqueScopesExceeded"] = -6] = "ListUniqueScopesExceeded"; + /** + * The share operation failed because a sharing capability is disabled in the site. + */ + SharingOperationStatusCode[SharingOperationStatusCode["CapabilityDisabled"] = -7] = "CapabilityDisabled"; + /** + * The specified object for the share operation is not supported. + */ + SharingOperationStatusCode[SharingOperationStatusCode["ObjectNotSupported"] = -8] = "ObjectNotSupported"; + /** + * A SharePoint group cannot contain another SharePoint group. + */ + SharingOperationStatusCode[SharingOperationStatusCode["NestedGroupsNotSupported"] = -9] = "NestedGroupsNotSupported"; +})(SharingOperationStatusCode = exports.SharingOperationStatusCode || (exports.SharingOperationStatusCode = {})); +var SPSharedObjectType; +(function (SPSharedObjectType) { + SPSharedObjectType[SPSharedObjectType["Unknown"] = 0] = "Unknown"; + SPSharedObjectType[SPSharedObjectType["File"] = 1] = "File"; + SPSharedObjectType[SPSharedObjectType["Folder"] = 2] = "Folder"; + SPSharedObjectType[SPSharedObjectType["Item"] = 3] = "Item"; + SPSharedObjectType[SPSharedObjectType["List"] = 4] = "List"; + SPSharedObjectType[SPSharedObjectType["Web"] = 5] = "Web"; + SPSharedObjectType[SPSharedObjectType["Max"] = 6] = "Max"; +})(SPSharedObjectType = exports.SPSharedObjectType || (exports.SPSharedObjectType = {})); +var SharingDomainRestrictionMode; +(function (SharingDomainRestrictionMode) { + SharingDomainRestrictionMode[SharingDomainRestrictionMode["None"] = 0] = "None"; + SharingDomainRestrictionMode[SharingDomainRestrictionMode["AllowList"] = 1] = "AllowList"; + SharingDomainRestrictionMode[SharingDomainRestrictionMode["BlockList"] = 2] = "BlockList"; +})(SharingDomainRestrictionMode = exports.SharingDomainRestrictionMode || (exports.SharingDomainRestrictionMode = {})); +; + + +/***/ }), +/* 14 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var util_1 = __webpack_require__(0); +var collections_1 = __webpack_require__(6); +var pnplibconfig_1 = __webpack_require__(4); +/** + * A wrapper class to provide a consistent interface to browser based storage + * + */ +var PnPClientStorageWrapper = (function () { + /** + * Creates a new instance of the PnPClientStorageWrapper class + * + * @constructor + */ + function PnPClientStorageWrapper(store, defaultTimeoutMinutes) { + this.store = store; + this.defaultTimeoutMinutes = defaultTimeoutMinutes; + this.defaultTimeoutMinutes = (defaultTimeoutMinutes === void 0) ? -1 : defaultTimeoutMinutes; + this.enabled = this.test(); + } + /** + * Get a value from storage, or null if that value does not exist + * + * @param key The key whose value we want to retrieve + */ + PnPClientStorageWrapper.prototype.get = function (key) { + if (!this.enabled) { + return null; + } + var o = this.store.getItem(key); + if (o == null) { + return null; + } + var persistable = JSON.parse(o); + if (new Date(persistable.expiration) <= new Date()) { + this.delete(key); + return null; + } + else { + return persistable.value; + } + }; + /** + * Adds a value to the underlying storage + * + * @param key The key to use when storing the provided value + * @param o The value to store + * @param expire Optional, if provided the expiration of the item, otherwise the default is used + */ + PnPClientStorageWrapper.prototype.put = function (key, o, expire) { + if (this.enabled) { + this.store.setItem(key, this.createPersistable(o, expire)); + } + }; + /** + * Deletes a value from the underlying storage + * + * @param key The key of the pair we want to remove from storage + */ + PnPClientStorageWrapper.prototype.delete = function (key) { + if (this.enabled) { + this.store.removeItem(key); + } + }; + /** + * Gets an item from the underlying storage, or adds it if it does not exist using the supplied getter function + * + * @param key The key to use when storing the provided value + * @param getter A function which will upon execution provide the desired value + * @param expire Optional, if provided the expiration of the item, otherwise the default is used + */ + PnPClientStorageWrapper.prototype.getOrPut = function (key, getter, expire) { + var _this = this; + if (!this.enabled) { + return getter(); + } + return new Promise(function (resolve) { + var o = _this.get(key); + if (o == null) { + getter().then(function (d) { + _this.put(key, d, expire); + resolve(d); + }); + } + else { + resolve(o); + } + }); + }; + /** + * Used to determine if the wrapped storage is available currently + */ + PnPClientStorageWrapper.prototype.test = function () { + var str = "test"; + try { + this.store.setItem(str, str); + this.store.removeItem(str); + return true; + } + catch (e) { + return false; + } + }; + /** + * Creates the persistable to store + */ + PnPClientStorageWrapper.prototype.createPersistable = function (o, expire) { + if (typeof expire === "undefined") { + // ensure we are by default inline with the global library setting + var defaultTimeout = pnplibconfig_1.RuntimeConfig.defaultCachingTimeoutSeconds; + if (this.defaultTimeoutMinutes > 0) { + defaultTimeout = this.defaultTimeoutMinutes * 60; + } + expire = util_1.Util.dateAdd(new Date(), "second", defaultTimeout); + } + return JSON.stringify({ expiration: expire, value: o }); + }; + return PnPClientStorageWrapper; +}()); +exports.PnPClientStorageWrapper = PnPClientStorageWrapper; +/** + * A thin implementation of in-memory storage for use in nodejs + */ +var MemoryStorage = (function () { + function MemoryStorage(_store) { + if (_store === void 0) { _store = new collections_1.Dictionary(); } + this._store = _store; + } + Object.defineProperty(MemoryStorage.prototype, "length", { + get: function () { + return this._store.count(); + }, + enumerable: true, + configurable: true + }); + MemoryStorage.prototype.clear = function () { + this._store.clear(); + }; + MemoryStorage.prototype.getItem = function (key) { + return this._store.get(key); + }; + MemoryStorage.prototype.key = function (index) { + return this._store.getKeys()[index]; + }; + MemoryStorage.prototype.removeItem = function (key) { + this._store.remove(key); + }; + MemoryStorage.prototype.setItem = function (key, data) { + this._store.add(key, data); + }; + return MemoryStorage; +}()); +/** + * A class that will establish wrappers for both local and session storage + */ +var PnPClientStorage = (function () { + /** + * Creates a new instance of the PnPClientStorage class + * + * @constructor + */ + function PnPClientStorage() { + this.local = typeof localStorage !== "undefined" ? new PnPClientStorageWrapper(localStorage) : new PnPClientStorageWrapper(new MemoryStorage()); + this.session = typeof sessionStorage !== "undefined" ? new PnPClientStorageWrapper(sessionStorage) : new PnPClientStorageWrapper(new MemoryStorage()); + } + return PnPClientStorage; +}()); +exports.PnPClientStorage = PnPClientStorage; + + +/***/ }), +/* 15 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var digestcache_1 = __webpack_require__(38); +var util_1 = __webpack_require__(0); +var pnplibconfig_1 = __webpack_require__(4); +var exceptions_1 = __webpack_require__(3); +var HttpClient = (function () { + function HttpClient() { + this._impl = pnplibconfig_1.RuntimeConfig.fetchClientFactory(); + this._digestCache = new digestcache_1.DigestCache(this); + } + HttpClient.prototype.fetch = function (url, options) { + var _this = this; + if (options === void 0) { options = {}; } + var opts = util_1.Util.extend(options, { cache: "no-cache", credentials: "same-origin" }, true); + var headers = new Headers(); + // first we add the global headers so they can be overwritten by any passed in locally to this call + this.mergeHeaders(headers, pnplibconfig_1.RuntimeConfig.headers); + // second we add the local options so we can overwrite the globals + this.mergeHeaders(headers, options.headers); + // lastly we apply any default headers we need that may not exist + if (!headers.has("Accept")) { + headers.append("Accept", "application/json"); + } + if (!headers.has("Content-Type")) { + headers.append("Content-Type", "application/json;odata=verbose;charset=utf-8"); + } + if (!headers.has("X-ClientService-ClientTag")) { + headers.append("X-ClientService-ClientTag", "PnPCoreJS:2.0.3"); + } + opts = util_1.Util.extend(opts, { headers: headers }); + if (opts.method && opts.method.toUpperCase() !== "GET") { + if (!headers.has("X-RequestDigest")) { + var index = url.indexOf("_api/"); + if (index < 0) { + throw new exceptions_1.APIUrlException(); + } + var webUrl = url.substr(0, index); + return this._digestCache.getDigest(webUrl) + .then(function (digest) { + headers.append("X-RequestDigest", digest); + return _this.fetchRaw(url, opts); + }); + } + } + return this.fetchRaw(url, opts); + }; + HttpClient.prototype.fetchRaw = function (url, options) { + var _this = this; + if (options === void 0) { options = {}; } + // here we need to normalize the headers + var rawHeaders = new Headers(); + this.mergeHeaders(rawHeaders, options.headers); + options = util_1.Util.extend(options, { headers: rawHeaders }); + var retry = function (ctx) { + _this._impl.fetch(url, options).then(function (response) { return ctx.resolve(response); }).catch(function (response) { + // grab our current delay + var delay = ctx.delay; + // Check if request was throttled - http status code 429 + // Check is request failed due to server unavailable - http status code 503 + if (response.status !== 429 && response.status !== 503) { + ctx.reject(response); + } + // Increment our counters. + ctx.delay *= 2; + ctx.attempts++; + // If we have exceeded the retry count, reject. + if (ctx.retryCount <= ctx.attempts) { + ctx.reject(response); + } + // Set our retry timeout for {delay} milliseconds. + setTimeout(util_1.Util.getCtxCallback(_this, retry, ctx), delay); + }); + }; + return new Promise(function (resolve, reject) { + var retryContext = { + attempts: 0, + delay: 100, + reject: reject, + resolve: resolve, + retryCount: 7, + }; + retry.call(_this, retryContext); + }); + }; + HttpClient.prototype.get = function (url, options) { + if (options === void 0) { options = {}; } + var opts = util_1.Util.extend(options, { method: "GET" }); + return this.fetch(url, opts); + }; + HttpClient.prototype.post = function (url, options) { + if (options === void 0) { options = {}; } + var opts = util_1.Util.extend(options, { method: "POST" }); + return this.fetch(url, opts); + }; + HttpClient.prototype.patch = function (url, options) { + if (options === void 0) { options = {}; } + var opts = util_1.Util.extend(options, { method: "PATCH" }); + return this.fetch(url, opts); + }; + HttpClient.prototype.delete = function (url, options) { + if (options === void 0) { options = {}; } + var opts = util_1.Util.extend(options, { method: "DELETE" }); + return this.fetch(url, opts); + }; + HttpClient.prototype.mergeHeaders = function (target, source) { + if (typeof source !== "undefined" && source !== null) { + var temp = new Request("", { headers: source }); + temp.headers.forEach(function (value, name) { + target.append(name, value); + }); + } + }; + return HttpClient; +}()); +exports.HttpClient = HttpClient; +; + + +/***/ }), +/* 16 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var util_1 = __webpack_require__(0); +var queryable_1 = __webpack_require__(1); +/** + * Describes a collection of content types + * + */ +var ContentTypes = (function (_super) { + __extends(ContentTypes, _super); + /** + * Creates a new instance of the ContentTypes class + * + * @param baseUrl The url or Queryable which forms the parent of this content types collection + */ + function ContentTypes(baseUrl, path) { + if (path === void 0) { path = "contenttypes"; } + return _super.call(this, baseUrl, path) || this; + } + /** + * Gets a ContentType by content type id + */ + ContentTypes.prototype.getById = function (id) { + var ct = new ContentType(this); + ct.concat("('" + id + "')"); + return ct; + }; + /** + * Adds an existing contenttype to a content type collection + * + * @param contentTypeId in the following format, for example: 0x010102 + */ + ContentTypes.prototype.addAvailableContentType = function (contentTypeId) { + var _this = this; + var postBody = JSON.stringify({ + "contentTypeId": contentTypeId, + }); + return this.clone(ContentTypes, "addAvailableContentType", true).postAs({ body: postBody }).then(function (data) { + return { + contentType: _this.getById(data.id), + data: data, + }; + }); + }; + /** + * Adds a new content type to the collection + * + * @param id The desired content type id for the new content type (also determines the parent content type) + * @param name The name of the content type + * @param description The description of the content type + * @param group The group in which to add the content type + * @param additionalSettings Any additional settings to provide when creating the content type + * + */ + ContentTypes.prototype.add = function (id, name, description, group, additionalSettings) { + var _this = this; + if (description === void 0) { description = ""; } + if (group === void 0) { group = "Custom Content Types"; } + if (additionalSettings === void 0) { additionalSettings = {}; } + var postBody = JSON.stringify(util_1.Util.extend({ + "Description": description, + "Group": group, + "Id": { "StringValue": id }, + "Name": name, + "__metadata": { "type": "SP.ContentType" }, + }, additionalSettings)); + return this.post({ body: postBody }).then(function (data) { + return { contentType: _this.getById(data.id), data: data }; + }); + }; + return ContentTypes; +}(queryable_1.QueryableCollection)); +exports.ContentTypes = ContentTypes; +/** + * Describes a single ContentType instance + * + */ +var ContentType = (function (_super) { + __extends(ContentType, _super); + function ContentType() { + return _super !== null && _super.apply(this, arguments) || this; + } + Object.defineProperty(ContentType.prototype, "fieldLinks", { + /** + * Gets the column (also known as field) references in the content type. + */ + get: function () { + return new FieldLinks(this); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ContentType.prototype, "fields", { + /** + * Gets a value that specifies the collection of fields for the content type. + */ + get: function () { + return new queryable_1.QueryableCollection(this, "fields"); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ContentType.prototype, "parent", { + /** + * Gets the parent content type of the content type. + */ + get: function () { + return new ContentType(this, "parent"); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ContentType.prototype, "workflowAssociations", { + /** + * Gets a value that specifies the collection of workflow associations for the content type. + */ + get: function () { + return new queryable_1.QueryableCollection(this, "workflowAssociations"); + }, + enumerable: true, + configurable: true + }); + /** + * Delete this content type + */ + ContentType.prototype.delete = function () { + return this.post({ + headers: { + "X-HTTP-Method": "DELETE", + }, + }); + }; + return ContentType; +}(queryable_1.QueryableInstance)); +exports.ContentType = ContentType; +/** + * Represents a collection of field link instances + */ +var FieldLinks = (function (_super) { + __extends(FieldLinks, _super); + /** + * Creates a new instance of the ContentType class + * + * @param baseUrl The url or Queryable which forms the parent of this content type instance + */ + function FieldLinks(baseUrl, path) { + if (path === void 0) { path = "fieldlinks"; } + return _super.call(this, baseUrl, path) || this; + } + /** + * Gets a FieldLink by GUID id + * + * @param id The GUID id of the field link + */ + FieldLinks.prototype.getById = function (id) { + var fl = new FieldLink(this); + fl.concat("(guid'" + id + "')"); + return fl; + }; + return FieldLinks; +}(queryable_1.QueryableCollection)); +exports.FieldLinks = FieldLinks; +/** + * Represents a field link instance + */ +var FieldLink = (function (_super) { + __extends(FieldLink, _super); + function FieldLink() { + return _super !== null && _super.apply(this, arguments) || this; + } + return FieldLink; +}(queryable_1.QueryableInstance)); +exports.FieldLink = FieldLink; + + +/***/ }), +/* 17 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var queryable_1 = __webpack_require__(1); +var sitegroups_1 = __webpack_require__(18); +var util_1 = __webpack_require__(0); +/** + * Describes a set of role assignments for the current scope + * + */ +var RoleAssignments = (function (_super) { + __extends(RoleAssignments, _super); + /** + * Creates a new instance of the RoleAssignments class + * + * @param baseUrl The url or Queryable which forms the parent of this fields collection + */ + function RoleAssignments(baseUrl, path) { + if (path === void 0) { path = "roleassignments"; } + return _super.call(this, baseUrl, path) || this; + } + /** + * Adds a new role assignment with the specified principal and role definitions to the collection. + * + * @param principalId The ID of the user or group to assign permissions to + * @param roleDefId The ID of the role definition that defines the permissions to assign + * + */ + RoleAssignments.prototype.add = function (principalId, roleDefId) { + return this.clone(RoleAssignments, "addroleassignment(principalid=" + principalId + ", roledefid=" + roleDefId + ")", true).post(); + }; + /** + * Removes the role assignment with the specified principal and role definition from the collection + * + * @param principalId The ID of the user or group in the role assignment. + * @param roleDefId The ID of the role definition in the role assignment + * + */ + RoleAssignments.prototype.remove = function (principalId, roleDefId) { + return this.clone(RoleAssignments, "removeroleassignment(principalid=" + principalId + ", roledefid=" + roleDefId + ")", true).post(); + }; + /** + * Gets the role assignment associated with the specified principal ID from the collection. + * + * @param id The id of the role assignment + */ + RoleAssignments.prototype.getById = function (id) { + var ra = new RoleAssignment(this); + ra.concat("(" + id + ")"); + return ra; + }; + return RoleAssignments; +}(queryable_1.QueryableCollection)); +exports.RoleAssignments = RoleAssignments; +var RoleAssignment = (function (_super) { + __extends(RoleAssignment, _super); + function RoleAssignment() { + return _super !== null && _super.apply(this, arguments) || this; + } + Object.defineProperty(RoleAssignment.prototype, "groups", { + get: function () { + return new sitegroups_1.SiteGroups(this, "groups"); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(RoleAssignment.prototype, "bindings", { + /** + * Get the role definition bindings for this role assignment + * + */ + get: function () { + return new RoleDefinitionBindings(this); + }, + enumerable: true, + configurable: true + }); + /** + * Delete this role assignment + * + */ + RoleAssignment.prototype.delete = function () { + return this.post({ + headers: { + "X-HTTP-Method": "DELETE", + }, + }); + }; + return RoleAssignment; +}(queryable_1.QueryableInstance)); +exports.RoleAssignment = RoleAssignment; +var RoleDefinitions = (function (_super) { + __extends(RoleDefinitions, _super); + /** + * Creates a new instance of the RoleDefinitions class + * + * @param baseUrl The url or Queryable which forms the parent of this fields collection + * @param path + * + */ + function RoleDefinitions(baseUrl, path) { + if (path === void 0) { path = "roledefinitions"; } + return _super.call(this, baseUrl, path) || this; + } + /** + * Gets the role definition with the specified ID from the collection. + * + * @param id The ID of the role definition. + * + */ + RoleDefinitions.prototype.getById = function (id) { + return new RoleDefinition(this, "getById(" + id + ")"); + }; + /** + * Gets the role definition with the specified name. + * + * @param name The name of the role definition. + * + */ + RoleDefinitions.prototype.getByName = function (name) { + return new RoleDefinition(this, "getbyname('" + name + "')"); + }; + /** + * Gets the role definition with the specified type. + * + * @param name The name of the role definition. + * + */ + RoleDefinitions.prototype.getByType = function (roleTypeKind) { + return new RoleDefinition(this, "getbytype(" + roleTypeKind + ")"); + }; + /** + * Create a role definition + * + * @param name The new role definition's name + * @param description The new role definition's description + * @param order The order in which the role definition appears + * @param basePermissions The permissions mask for this role definition + * + */ + RoleDefinitions.prototype.add = function (name, description, order, basePermissions) { + var _this = this; + var postBody = JSON.stringify({ + BasePermissions: util_1.Util.extend({ __metadata: { type: "SP.BasePermissions" } }, basePermissions), + Description: description, + Name: name, + Order: order, + __metadata: { "type": "SP.RoleDefinition" }, + }); + return this.post({ body: postBody }).then(function (data) { + return { + data: data, + definition: _this.getById(data.Id), + }; + }); + }; + return RoleDefinitions; +}(queryable_1.QueryableCollection)); +exports.RoleDefinitions = RoleDefinitions; +var RoleDefinition = (function (_super) { + __extends(RoleDefinition, _super); + function RoleDefinition() { + return _super !== null && _super.apply(this, arguments) || this; + } + /** + * Updates this web intance with the supplied properties + * + * @param properties A plain object hash of values to update for the web + */ + /* tslint:disable no-string-literal */ + RoleDefinition.prototype.update = function (properties) { + var _this = this; + if (typeof properties.hasOwnProperty("BasePermissions") !== "undefined") { + properties["BasePermissions"] = util_1.Util.extend({ __metadata: { type: "SP.BasePermissions" } }, properties["BasePermissions"]); + } + var postBody = JSON.stringify(util_1.Util.extend({ + "__metadata": { "type": "SP.RoleDefinition" }, + }, properties)); + return this.post({ + body: postBody, + headers: { + "X-HTTP-Method": "MERGE", + }, + }).then(function (data) { + var retDef = _this; + if (properties.hasOwnProperty("Name")) { + var parent_1 = _this.getParent(RoleDefinitions, _this.parentUrl, ""); + retDef = parent_1.getByName(properties["Name"]); + } + return { + data: data, + definition: retDef, + }; + }); + }; + /* tslint:enable */ + /** + * Delete this role definition + * + */ + RoleDefinition.prototype.delete = function () { + return this.post({ + headers: { + "X-HTTP-Method": "DELETE", + }, + }); + }; + return RoleDefinition; +}(queryable_1.QueryableInstance)); +exports.RoleDefinition = RoleDefinition; +var RoleDefinitionBindings = (function (_super) { + __extends(RoleDefinitionBindings, _super); + function RoleDefinitionBindings(baseUrl, path) { + if (path === void 0) { path = "roledefinitionbindings"; } + return _super.call(this, baseUrl, path) || this; + } + return RoleDefinitionBindings; +}(queryable_1.QueryableCollection)); +exports.RoleDefinitionBindings = RoleDefinitionBindings; + + +/***/ }), +/* 18 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var queryable_1 = __webpack_require__(1); +var siteusers_1 = __webpack_require__(30); +var util_1 = __webpack_require__(0); +/** + * Principal Type enum + * + */ +var PrincipalType; +(function (PrincipalType) { + PrincipalType[PrincipalType["None"] = 0] = "None"; + PrincipalType[PrincipalType["User"] = 1] = "User"; + PrincipalType[PrincipalType["DistributionList"] = 2] = "DistributionList"; + PrincipalType[PrincipalType["SecurityGroup"] = 4] = "SecurityGroup"; + PrincipalType[PrincipalType["SharePointGroup"] = 8] = "SharePointGroup"; + PrincipalType[PrincipalType["All"] = 15] = "All"; +})(PrincipalType = exports.PrincipalType || (exports.PrincipalType = {})); +/** + * Describes a collection of site users + * + */ +var SiteGroups = (function (_super) { + __extends(SiteGroups, _super); + /** + * Creates a new instance of the SiteUsers class + * + * @param baseUrl The url or Queryable which forms the parent of this user collection + */ + function SiteGroups(baseUrl, path) { + if (path === void 0) { path = "sitegroups"; } + return _super.call(this, baseUrl, path) || this; + } + /** + * Adds a new group to the site collection + * + * @param props The properties to be updated + */ + SiteGroups.prototype.add = function (properties) { + var _this = this; + var postBody = JSON.stringify(util_1.Util.extend({ "__metadata": { "type": "SP.Group" } }, properties)); + return this.post({ body: postBody }).then(function (data) { + return { + data: data, + group: _this.getById(data.Id), + }; + }); + }; + /** + * Gets a group from the collection by name + * + * @param email The name of the group + */ + SiteGroups.prototype.getByName = function (groupName) { + return new SiteGroup(this, "getByName('" + groupName + "')"); + }; + /** + * Gets a group from the collection by id + * + * @param id The id of the group + */ + SiteGroups.prototype.getById = function (id) { + var sg = new SiteGroup(this); + sg.concat("(" + id + ")"); + return sg; + }; + /** + * Removes the group with the specified member ID from the collection. + * + * @param id The id of the group to remove + */ + SiteGroups.prototype.removeById = function (id) { + return this.clone(SiteGroups, "removeById('" + id + "')", true).post(); + }; + /** + * Removes a user from the collection by login name + * + * @param loginName The login name of the user + */ + SiteGroups.prototype.removeByLoginName = function (loginName) { + return this.clone(SiteGroups, "removeByLoginName('" + loginName + "')", true).post(); + }; + return SiteGroups; +}(queryable_1.QueryableCollection)); +exports.SiteGroups = SiteGroups; +/** + * Describes a single group + * + */ +var SiteGroup = (function (_super) { + __extends(SiteGroup, _super); + function SiteGroup() { + return _super !== null && _super.apply(this, arguments) || this; + } + Object.defineProperty(SiteGroup.prototype, "users", { + /** + * Get's the users for this group + * + */ + get: function () { + return new siteusers_1.SiteUsers(this, "users"); + }, + enumerable: true, + configurable: true + }); + /** + * Updates this group instance with the supplied properties + * + * @param properties A GroupWriteableProperties object of property names and values to update for the user + */ + /* tslint:disable no-string-literal */ + SiteGroup.prototype.update = function (properties) { + var _this = this; + var postBody = util_1.Util.extend({ "__metadata": { "type": "SP.Group" } }, properties); + return this.post({ + body: JSON.stringify(postBody), + headers: { + "X-HTTP-Method": "MERGE", + }, + }).then(function (data) { + var retGroup = _this; + if (properties.hasOwnProperty("Title")) { + retGroup = _this.getParent(SiteGroup, _this.parentUrl, "getByName('" + properties["Title"] + "')"); + } + return { + data: data, + group: retGroup, + }; + }); + }; + return SiteGroup; +}(queryable_1.QueryableInstance)); +exports.SiteGroup = SiteGroup; + + +/***/ }), +/* 19 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var queryable_1 = __webpack_require__(1); +var util_1 = __webpack_require__(0); +var UserCustomActions = (function (_super) { + __extends(UserCustomActions, _super); + function UserCustomActions(baseUrl, path) { + if (path === void 0) { path = "usercustomactions"; } + return _super.call(this, baseUrl, path) || this; + } + /** + * Returns the custom action with the specified identifier. + * + * @param id The GUID ID of the user custom action to get. + */ + UserCustomActions.prototype.getById = function (id) { + var uca = new UserCustomAction(this); + uca.concat("('" + id + "')"); + return uca; + }; + /** + * Create a custom action + * + * @param creationInfo The information which defines the new custom action + * + */ + UserCustomActions.prototype.add = function (properties) { + var _this = this; + var postBody = JSON.stringify(util_1.Util.extend({ __metadata: { "type": "SP.UserCustomAction" } }, properties)); + return this.post({ body: postBody }).then(function (data) { + return { + action: _this.getById(data.Id), + data: data, + }; + }); + }; + /** + * Deletes all custom actions in the collection. + * + */ + UserCustomActions.prototype.clear = function () { + return this.clone(UserCustomActions, "clear", true).post(); + }; + return UserCustomActions; +}(queryable_1.QueryableCollection)); +exports.UserCustomActions = UserCustomActions; +var UserCustomAction = (function (_super) { + __extends(UserCustomAction, _super); + function UserCustomAction() { + return _super !== null && _super.apply(this, arguments) || this; + } + UserCustomAction.prototype.update = function (properties) { + var _this = this; + var postBody = JSON.stringify(util_1.Util.extend({ + "__metadata": { "type": "SP.UserCustomAction" }, + }, properties)); + return this.post({ + body: postBody, + headers: { + "X-HTTP-Method": "MERGE", + }, + }).then(function (data) { + return { + action: _this, + data: data, + }; + }); + }; + /** + * Remove a custom action + * + */ + UserCustomAction.prototype.delete = function () { + return _super.prototype.delete.call(this); + }; + return UserCustomAction; +}(queryable_1.QueryableInstance)); +exports.UserCustomAction = UserCustomAction; + + +/***/ }), +/* 20 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var storage = __webpack_require__(14); +var exceptions_1 = __webpack_require__(3); +/** + * A caching provider which can wrap other non-caching providers + * + */ +var CachingConfigurationProvider = (function () { + /** + * Creates a new caching configuration provider + * @constructor + * @param {IConfigurationProvider} wrappedProvider Provider which will be used to fetch the configuration + * @param {string} cacheKey Key that will be used to store cached items to the cache + * @param {IPnPClientStore} cacheStore OPTIONAL storage, which will be used to store cached settings. + */ + function CachingConfigurationProvider(wrappedProvider, cacheKey, cacheStore) { + this.wrappedProvider = wrappedProvider; + this.store = (cacheStore) ? cacheStore : this.selectPnPCache(); + this.cacheKey = "_configcache_" + cacheKey; + } + /** + * Gets the wrapped configuration providers + * + * @return {IConfigurationProvider} Wrapped configuration provider + */ + CachingConfigurationProvider.prototype.getWrappedProvider = function () { + return this.wrappedProvider; + }; + /** + * Loads the configuration values either from the cache or from the wrapped provider + * + * @return {Promise>} Promise of loaded configuration values + */ + CachingConfigurationProvider.prototype.getConfiguration = function () { + var _this = this; + // Cache not available, pass control to the wrapped provider + if ((!this.store) || (!this.store.enabled)) { + return this.wrappedProvider.getConfiguration(); + } + // Value is found in cache, return it directly + var cachedConfig = this.store.get(this.cacheKey); + if (cachedConfig) { + return new Promise(function (resolve) { + resolve(cachedConfig); + }); + } + // Get and cache value from the wrapped provider + var providerPromise = this.wrappedProvider.getConfiguration(); + providerPromise.then(function (providedConfig) { + _this.store.put(_this.cacheKey, providedConfig); + }); + return providerPromise; + }; + CachingConfigurationProvider.prototype.selectPnPCache = function () { + var pnpCache = new storage.PnPClientStorage(); + if ((pnpCache.local) && (pnpCache.local.enabled)) { + return pnpCache.local; + } + if ((pnpCache.session) && (pnpCache.session.enabled)) { + return pnpCache.session; + } + throw new exceptions_1.NoCacheAvailableException(); + }; + return CachingConfigurationProvider; +}()); +exports.default = CachingConfigurationProvider; + + +/***/ }), +/* 21 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(global) { +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * Makes requests using the fetch API + */ +var FetchClient = (function () { + function FetchClient() { + } + FetchClient.prototype.fetch = function (url, options) { + return global.fetch(url, options); + }; + return FetchClient; +}()); +exports.FetchClient = FetchClient; + +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(32))) + +/***/ }), +/* 22 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var storage_1 = __webpack_require__(14); +var util_1 = __webpack_require__(0); +var pnplibconfig_1 = __webpack_require__(4); +var CachingOptions = (function () { + function CachingOptions(key) { + this.key = key; + this.expiration = util_1.Util.dateAdd(new Date(), "second", pnplibconfig_1.RuntimeConfig.defaultCachingTimeoutSeconds); + this.storeName = pnplibconfig_1.RuntimeConfig.defaultCachingStore; + } + Object.defineProperty(CachingOptions.prototype, "store", { + get: function () { + if (this.storeName === "local") { + return CachingOptions.storage.local; + } + else { + return CachingOptions.storage.session; + } + }, + enumerable: true, + configurable: true + }); + return CachingOptions; +}()); +CachingOptions.storage = new storage_1.PnPClientStorage(); +exports.CachingOptions = CachingOptions; +var CachingParserWrapper = (function () { + function CachingParserWrapper(_parser, _cacheOptions) { + this._parser = _parser; + this._cacheOptions = _cacheOptions; + } + CachingParserWrapper.prototype.parse = function (response) { + var _this = this; + // add this to the cache based on the options + return this._parser.parse(response).then(function (data) { + if (_this._cacheOptions.store !== null) { + _this._cacheOptions.store.put(_this._cacheOptions.key, data, _this._cacheOptions.expiration); + } + return data; + }); + }; + return CachingParserWrapper; +}()); +exports.CachingParserWrapper = CachingParserWrapper; + + +/***/ }), +/* 23 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var queryable_1 = __webpack_require__(1); +/** + * Describes a collection of List objects + * + */ +var Features = (function (_super) { + __extends(Features, _super); + /** + * Creates a new instance of the Lists class + * + * @param baseUrl The url or Queryable which forms the parent of this fields collection + */ + function Features(baseUrl, path) { + if (path === void 0) { path = "features"; } + return _super.call(this, baseUrl, path) || this; + } + /** + * Gets a list from the collection by guid id + * + * @param id The Id of the feature (GUID) + */ + Features.prototype.getById = function (id) { + var feature = new Feature(this); + feature.concat("('" + id + "')"); + return feature; + }; + /** + * Adds a new list to the collection + * + * @param id The Id of the feature (GUID) + * @param force If true the feature activation will be forced + */ + Features.prototype.add = function (id, force) { + var _this = this; + if (force === void 0) { force = false; } + return this.clone(Features, "add", true).post({ + body: JSON.stringify({ + featdefScope: 0, + featureId: id, + force: force, + }), + }).then(function (data) { + return { + data: data, + feature: _this.getById(id), + }; + }); + }; + /** + * Removes (deactivates) a feature from the collection + * + * @param id The Id of the feature (GUID) + * @param force If true the feature deactivation will be forced + */ + Features.prototype.remove = function (id, force) { + if (force === void 0) { force = false; } + return this.clone(Features, "remove", true).post({ + body: JSON.stringify({ + featureId: id, + force: force, + }), + }); + }; + return Features; +}(queryable_1.QueryableCollection)); +exports.Features = Features; +var Feature = (function (_super) { + __extends(Feature, _super); + function Feature() { + return _super !== null && _super.apply(this, arguments) || this; + } + /** + * Removes (deactivates) a feature from the collection + * + * @param force If true the feature deactivation will be forced + */ + Feature.prototype.deactivate = function (force) { + var _this = this; + if (force === void 0) { force = false; } + var removeDependency = this.addBatchDependency(); + var idGet = new Feature(this).select("DefinitionId"); + return idGet.getAs().then(function (feature) { + var promise = _this.getParent(Features, _this.parentUrl, "", _this.batch).remove(feature.DefinitionId, force); + removeDependency(); + return promise; + }); + }; + return Feature; +}(queryable_1.QueryableInstance)); +exports.Feature = Feature; + + +/***/ }), +/* 24 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var queryable_1 = __webpack_require__(1); +var util_1 = __webpack_require__(0); +var types_1 = __webpack_require__(13); +/** + * Describes a collection of Field objects + * + */ +var Fields = (function (_super) { + __extends(Fields, _super); + /** + * Creates a new instance of the Fields class + * + * @param baseUrl The url or Queryable which forms the parent of this fields collection + */ + function Fields(baseUrl, path) { + if (path === void 0) { path = "fields"; } + return _super.call(this, baseUrl, path) || this; + } + /** + * Gets a field from the collection by title + * + * @param title The case-sensitive title of the field + */ + Fields.prototype.getByTitle = function (title) { + return new Field(this, "getByTitle('" + title + "')"); + }; + /** + * Gets a field from the collection by using internal name or title + * + * @param name The case-sensitive internal name or title of the field + */ + Fields.prototype.getByInternalNameOrTitle = function (name) { + return new Field(this, "getByInternalNameOrTitle('" + name + "')"); + }; + /** + * Gets a list from the collection by guid id + * + * @param title The Id of the list + */ + Fields.prototype.getById = function (id) { + var f = new Field(this); + f.concat("('" + id + "')"); + return f; + }; + /** + * Creates a field based on the specified schema + */ + Fields.prototype.createFieldAsXml = function (xml) { + var _this = this; + var info; + if (typeof xml === "string") { + info = { SchemaXml: xml }; + } + else { + info = xml; + } + var postBody = JSON.stringify({ + "parameters": util_1.Util.extend({ + "__metadata": { + "type": "SP.XmlSchemaFieldCreationInformation", + }, + }, info), + }); + return this.clone(Fields, "createfieldasxml", true).postAs({ body: postBody }).then(function (data) { + return { + data: data, + field: _this.getById(data.Id), + }; + }); + }; + /** + * Adds a new list to the collection + * + * @param title The new field's title + * @param fieldType The new field's type (ex: SP.FieldText) + * @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx) + */ + Fields.prototype.add = function (title, fieldType, properties) { + var _this = this; + if (properties === void 0) { properties = {}; } + var postBody = JSON.stringify(util_1.Util.extend({ + "Title": title, + "__metadata": { "type": fieldType }, + }, properties)); + return this.clone(Fields, null, true).postAs({ body: postBody }).then(function (data) { + return { + data: data, + field: _this.getById(data.Id), + }; + }); + }; + /** + * Adds a new SP.FieldText to the collection + * + * @param title The field title + * @param maxLength The maximum number of characters allowed in the value of the field. + * @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx) + */ + Fields.prototype.addText = function (title, maxLength, properties) { + if (maxLength === void 0) { maxLength = 255; } + var props = { + FieldTypeKind: 2, + MaxLength: maxLength, + }; + return this.add(title, "SP.FieldText", util_1.Util.extend(props, properties)); + }; + /** + * Adds a new SP.FieldCalculated to the collection + * + * @param title The field title. + * @param formula The formula for the field. + * @param dateFormat The date and time format that is displayed in the field. + * @param outputType Specifies the output format for the field. Represents a FieldType value. + * @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx) + */ + Fields.prototype.addCalculated = function (title, formula, dateFormat, outputType, properties) { + if (outputType === void 0) { outputType = types_1.FieldTypes.Text; } + var props = { + DateFormat: dateFormat, + FieldTypeKind: 17, + Formula: formula, + OutputType: outputType, + }; + return this.add(title, "SP.FieldCalculated", util_1.Util.extend(props, properties)); + }; + /** + * Adds a new SP.FieldDateTime to the collection + * + * @param title The field title + * @param displayFormat The format of the date and time that is displayed in the field. + * @param calendarType Specifies the calendar type of the field. + * @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx) + */ + Fields.prototype.addDateTime = function (title, displayFormat, calendarType, friendlyDisplayFormat, properties) { + if (displayFormat === void 0) { displayFormat = types_1.DateTimeFieldFormatType.DateOnly; } + if (calendarType === void 0) { calendarType = types_1.CalendarType.Gregorian; } + if (friendlyDisplayFormat === void 0) { friendlyDisplayFormat = 0; } + var props = { + DateTimeCalendarType: calendarType, + DisplayFormat: displayFormat, + FieldTypeKind: 4, + FriendlyDisplayFormat: friendlyDisplayFormat, + }; + return this.add(title, "SP.FieldDateTime", util_1.Util.extend(props, properties)); + }; + /** + * Adds a new SP.FieldNumber to the collection + * + * @param title The field title + * @param minValue The field's minimum value + * @param maxValue The field's maximum value + * @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx) + */ + Fields.prototype.addNumber = function (title, minValue, maxValue, properties) { + var props = { FieldTypeKind: 9 }; + if (typeof minValue !== "undefined") { + props = util_1.Util.extend({ MinimumValue: minValue }, props); + } + if (typeof maxValue !== "undefined") { + props = util_1.Util.extend({ MaximumValue: maxValue }, props); + } + return this.add(title, "SP.FieldNumber", util_1.Util.extend(props, properties)); + }; + /** + * Adds a new SP.FieldCurrency to the collection + * + * @param title The field title + * @param minValue The field's minimum value + * @param maxValue The field's maximum value + * @param currencyLocalId Specifies the language code identifier (LCID) used to format the value of the field + * @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx) + */ + Fields.prototype.addCurrency = function (title, minValue, maxValue, currencyLocalId, properties) { + if (currencyLocalId === void 0) { currencyLocalId = 1033; } + var props = { + CurrencyLocaleId: currencyLocalId, + FieldTypeKind: 10, + }; + if (typeof minValue !== "undefined") { + props = util_1.Util.extend({ MinimumValue: minValue }, props); + } + if (typeof maxValue !== "undefined") { + props = util_1.Util.extend({ MaximumValue: maxValue }, props); + } + return this.add(title, "SP.FieldCurrency", util_1.Util.extend(props, properties)); + }; + /** + * Adds a new SP.FieldMultiLineText to the collection + * + * @param title The field title + * @param numberOfLines Specifies the number of lines of text to display for the field. + * @param richText Specifies whether the field supports rich formatting. + * @param restrictedMode Specifies whether the field supports a subset of rich formatting. + * @param appendOnly Specifies whether all changes to the value of the field are displayed in list forms. + * @param allowHyperlink Specifies whether a hyperlink is allowed as a value of the field. + * @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx) + * + */ + Fields.prototype.addMultilineText = function (title, numberOfLines, richText, restrictedMode, appendOnly, allowHyperlink, properties) { + if (numberOfLines === void 0) { numberOfLines = 6; } + if (richText === void 0) { richText = true; } + if (restrictedMode === void 0) { restrictedMode = false; } + if (appendOnly === void 0) { appendOnly = false; } + if (allowHyperlink === void 0) { allowHyperlink = true; } + var props = { + AllowHyperlink: allowHyperlink, + AppendOnly: appendOnly, + FieldTypeKind: 3, + NumberOfLines: numberOfLines, + RestrictedMode: restrictedMode, + RichText: richText, + }; + return this.add(title, "SP.FieldMultiLineText", util_1.Util.extend(props, properties)); + }; + /** + * Adds a new SP.FieldUrl to the collection + * + * @param title The field title + */ + Fields.prototype.addUrl = function (title, displayFormat, properties) { + if (displayFormat === void 0) { displayFormat = types_1.UrlFieldFormatType.Hyperlink; } + var props = { + DisplayFormat: displayFormat, + FieldTypeKind: 11, + }; + return this.add(title, "SP.FieldUrl", util_1.Util.extend(props, properties)); + }; + return Fields; +}(queryable_1.QueryableCollection)); +exports.Fields = Fields; +/** + * Describes a single of Field instance + * + */ +var Field = (function (_super) { + __extends(Field, _super); + function Field() { + return _super !== null && _super.apply(this, arguments) || this; + } + /** + * Updates this field intance with the supplied properties + * + * @param properties A plain object hash of values to update for the list + * @param fieldType The type value, required to update child field type properties + */ + Field.prototype.update = function (properties, fieldType) { + var _this = this; + if (fieldType === void 0) { fieldType = "SP.Field"; } + var postBody = JSON.stringify(util_1.Util.extend({ + "__metadata": { "type": fieldType }, + }, properties)); + return this.post({ + body: postBody, + headers: { + "X-HTTP-Method": "MERGE", + }, + }).then(function (data) { + return { + data: data, + field: _this, + }; + }); + }; + /** + * Delete this fields + * + */ + Field.prototype.delete = function () { + return this.post({ + headers: { + "X-HTTP-Method": "DELETE", + }, + }); + }; + /** + * Sets the value of the ShowInDisplayForm property for this field. + */ + Field.prototype.setShowInDisplayForm = function (show) { + return this.clone(Field, "setshowindisplayform(" + show + ")", true).post(); + }; + /** + * Sets the value of the ShowInEditForm property for this field. + */ + Field.prototype.setShowInEditForm = function (show) { + return this.clone(Field, "setshowineditform(" + show + ")", true).post(); + }; + /** + * Sets the value of the ShowInNewForm property for this field. + */ + Field.prototype.setShowInNewForm = function (show) { + return this.clone(Field, "setshowinnewform(" + show + ")", true).post(); + }; + return Field; +}(queryable_1.QueryableInstance)); +exports.Field = Field; + + +/***/ }), +/* 25 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var util_1 = __webpack_require__(0); +var queryable_1 = __webpack_require__(1); +/** + * Represents a collection of navigation nodes + * + */ +var NavigationNodes = (function (_super) { + __extends(NavigationNodes, _super); + function NavigationNodes() { + return _super !== null && _super.apply(this, arguments) || this; + } + /** + * Gets a navigation node by id + * + * @param id The id of the node + */ + NavigationNodes.prototype.getById = function (id) { + var node = new NavigationNode(this); + node.concat("(" + id + ")"); + return node; + }; + /** + * Adds a new node to the collection + * + * @param title Display name of the node + * @param url The url of the node + * @param visible If true the node is visible, otherwise it is hidden (default: true) + */ + NavigationNodes.prototype.add = function (title, url, visible) { + var _this = this; + if (visible === void 0) { visible = true; } + var postBody = JSON.stringify({ + IsVisible: visible, + Title: title, + Url: url, + "__metadata": { "type": "SP.NavigationNode" }, + }); + return this.clone(NavigationNodes, null, true).post({ body: postBody }).then(function (data) { + return { + data: data, + node: _this.getById(data.Id), + }; + }); + }; + /** + * Moves a node to be after another node in the navigation + * + * @param nodeId Id of the node to move + * @param previousNodeId Id of the node after which we move the node specified by nodeId + */ + NavigationNodes.prototype.moveAfter = function (nodeId, previousNodeId) { + var postBody = JSON.stringify({ + nodeId: nodeId, + previousNodeId: previousNodeId, + }); + return this.clone(NavigationNodes, "MoveAfter", true).post({ body: postBody }); + }; + return NavigationNodes; +}(queryable_1.QueryableCollection)); +exports.NavigationNodes = NavigationNodes; +var NavigationNode = (function (_super) { + __extends(NavigationNode, _super); + function NavigationNode() { + return _super !== null && _super.apply(this, arguments) || this; + } + Object.defineProperty(NavigationNode.prototype, "children", { + /** + * Represents the child nodes of this node + */ + get: function () { + return new NavigationNodes(this, "Children"); + }, + enumerable: true, + configurable: true + }); + /** + * Updates this node based on the supplied properties + * + * @param properties The hash of key/value pairs to update + */ + NavigationNode.prototype.update = function (properties) { + var _this = this; + var postBody = JSON.stringify(util_1.Util.extend({ + "__metadata": { "type": "SP.NavigationNode" }, + }, properties)); + return this.post({ + body: postBody, + headers: { + "X-HTTP-Method": "MERGE", + }, + }).then(function (data) { + return { + data: data, + node: _this, + }; + }); + }; + /** + * Deletes this node and any child nodes + */ + NavigationNode.prototype.delete = function () { + return _super.prototype.delete.call(this); + }; + return NavigationNode; +}(queryable_1.QueryableInstance)); +exports.NavigationNode = NavigationNode; +/** + * Exposes the navigation components + * + */ +var Navigation = (function (_super) { + __extends(Navigation, _super); + /** + * Creates a new instance of the Lists class + * + * @param baseUrl The url or Queryable which forms the parent of this fields collection + */ + function Navigation(baseUrl, path) { + if (path === void 0) { path = "navigation"; } + return _super.call(this, baseUrl, path) || this; + } + Object.defineProperty(Navigation.prototype, "quicklaunch", { + /** + * Gets the quicklaunch navigation for the current context + * + */ + get: function () { + return new NavigationNodes(this, "quicklaunch"); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Navigation.prototype, "topNavigationBar", { + /** + * Gets the top bar navigation navigation for the current context + * + */ + get: function () { + return new NavigationNodes(this, "topnavigationbar"); + }, + enumerable: true, + configurable: true + }); + return Navigation; +}(queryable_1.Queryable)); +exports.Navigation = Navigation; + + +/***/ }), +/* 26 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var webs_1 = __webpack_require__(7); +var roles_1 = __webpack_require__(17); +var types_1 = __webpack_require__(13); +var queryable_1 = __webpack_require__(1); +var QueryableSecurable = (function (_super) { + __extends(QueryableSecurable, _super); + function QueryableSecurable() { + return _super !== null && _super.apply(this, arguments) || this; + } + Object.defineProperty(QueryableSecurable.prototype, "roleAssignments", { + /** + * Gets the set of role assignments for this item + * + */ + get: function () { + return new roles_1.RoleAssignments(this); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(QueryableSecurable.prototype, "firstUniqueAncestorSecurableObject", { + /** + * Gets the closest securable up the security hierarchy whose permissions are applied to this list item + * + */ + get: function () { + return new queryable_1.QueryableInstance(this, "FirstUniqueAncestorSecurableObject"); + }, + enumerable: true, + configurable: true + }); + /** + * Gets the effective permissions for the user supplied + * + * @param loginName The claims username for the user (ex: i:0#.f|membership|user@domain.com) + */ + QueryableSecurable.prototype.getUserEffectivePermissions = function (loginName) { + var q = this.clone(queryable_1.Queryable, "getUserEffectivePermissions(@user)", true); + q.query.add("@user", "'" + encodeURIComponent(loginName) + "'"); + return q.getAs(); + }; + /** + * Gets the effective permissions for the current user + */ + QueryableSecurable.prototype.getCurrentUserEffectivePermissions = function () { + var _this = this; + var w = webs_1.Web.fromUrl(this.toUrl()); + return w.currentUser.select("LoginName").getAs().then(function (user) { + return _this.getUserEffectivePermissions(user.LoginName); + }); + }; + /** + * Breaks the security inheritance at this level optinally copying permissions and clearing subscopes + * + * @param copyRoleAssignments If true the permissions are copied from the current parent scope + * @param clearSubscopes Optional. true to make all child securable objects inherit role assignments from the current object + */ + QueryableSecurable.prototype.breakRoleInheritance = function (copyRoleAssignments, clearSubscopes) { + if (copyRoleAssignments === void 0) { copyRoleAssignments = false; } + if (clearSubscopes === void 0) { clearSubscopes = false; } + return this.clone(QueryableSecurable, "breakroleinheritance(copyroleassignments=" + copyRoleAssignments + ", clearsubscopes=" + clearSubscopes + ")", true).post(); + }; + /** + * Removes the local role assignments so that it re-inherit role assignments from the parent object. + * + */ + QueryableSecurable.prototype.resetRoleInheritance = function () { + return this.clone(QueryableSecurable, "resetroleinheritance", true).post(); + }; + /** + * Determines if a given user has the appropriate permissions + * + * @param loginName The user to check + * @param permission The permission being checked + */ + QueryableSecurable.prototype.userHasPermissions = function (loginName, permission) { + var _this = this; + return this.getUserEffectivePermissions(loginName).then(function (perms) { + return _this.hasPermissions(perms, permission); + }); + }; + /** + * Determines if the current user has the requested permissions + * + * @param permission The permission we wish to check + */ + QueryableSecurable.prototype.currentUserHasPermissions = function (permission) { + var _this = this; + return this.getCurrentUserEffectivePermissions().then(function (perms) { + return _this.hasPermissions(perms, permission); + }); + }; + /** + * Taken from sp.js, checks the supplied permissions against the mask + * + * @param value The security principal's permissions on the given object + * @param perm The permission checked against the value + */ + /* tslint:disable:no-bitwise */ + QueryableSecurable.prototype.hasPermissions = function (value, perm) { + if (!perm) { + return true; + } + if (perm === types_1.PermissionKind.FullMask) { + return (value.High & 32767) === 32767 && value.Low === 65535; + } + perm = perm - 1; + var num = 1; + if (perm >= 0 && perm < 32) { + num = num << perm; + return 0 !== (value.Low & num); + } + else if (perm >= 32 && perm < 64) { + num = num << perm - 32; + return 0 !== (value.High & num); + } + return false; + }; + return QueryableSecurable; +}(queryable_1.QueryableInstance)); +exports.QueryableSecurable = QueryableSecurable; + + +/***/ }), +/* 27 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var queryable_1 = __webpack_require__(1); +var util_1 = __webpack_require__(0); +/** + * Describes the search API + * + */ +var Search = (function (_super) { + __extends(Search, _super); + /** + * Creates a new instance of the Search class + * + * @param baseUrl The url for the search context + * @param query The SearchQuery object to execute + */ + function Search(baseUrl, path) { + if (path === void 0) { path = "_api/search/postquery"; } + return _super.call(this, baseUrl, path) || this; + } + /** + * ....... + * @returns Promise + */ + Search.prototype.execute = function (query) { + var formattedBody; + formattedBody = query; + if (formattedBody.SelectProperties) { + formattedBody.SelectProperties = { results: query.SelectProperties }; + } + if (formattedBody.RefinementFilters) { + formattedBody.RefinementFilters = { results: query.RefinementFilters }; + } + if (formattedBody.SortList) { + formattedBody.SortList = { results: query.SortList }; + } + if (formattedBody.HithighlightedProperties) { + formattedBody.HithighlightedProperties = { results: query.HithighlightedProperties }; + } + if (formattedBody.ReorderingRules) { + formattedBody.ReorderingRules = { results: query.ReorderingRules }; + } + if (formattedBody.Properties) { + formattedBody.Properties = { results: query.Properties }; + } + var postBody = JSON.stringify({ + request: util_1.Util.extend({ + "__metadata": { "type": "Microsoft.Office.Server.Search.REST.SearchRequest" }, + }, formattedBody), + }); + return this.post({ body: postBody }).then(function (data) { return new SearchResults(data); }); + }; + return Search; +}(queryable_1.QueryableInstance)); +exports.Search = Search; +/** + * Describes the SearchResults class, which returns the formatted and raw version of the query response + */ +var SearchResults = (function () { + /** + * Creates a new instance of the SearchResult class + * + */ + function SearchResults(rawResponse) { + var response = rawResponse.postquery ? rawResponse.postquery : rawResponse; + this.PrimarySearchResults = this.formatSearchResults(response.PrimaryQueryResult.RelevantResults.Table.Rows); + this.RawSearchResults = response; + this.ElapsedTime = response.ElapsedTime; + this.RowCount = response.PrimaryQueryResult.RelevantResults.RowCount; + this.TotalRows = response.PrimaryQueryResult.RelevantResults.TotalRows; + this.TotalRowsIncludingDuplicates = response.PrimaryQueryResult.RelevantResults.TotalRowsIncludingDuplicates; + } + /** + * Formats a search results array + * + * @param rawResults The array to process + */ + SearchResults.prototype.formatSearchResults = function (rawResults) { + var results = new Array(), tempResults = rawResults.results ? rawResults.results : rawResults; + for (var _i = 0, tempResults_1 = tempResults; _i < tempResults_1.length; _i++) { + var i = tempResults_1[_i]; + results.push(new SearchResult(i.Cells)); + } + return results; + }; + return SearchResults; +}()); +exports.SearchResults = SearchResults; +/** + * Describes the SearchResult class + */ +var SearchResult = (function () { + /** + * Creates a new instance of the SearchResult class + * + */ + function SearchResult(rawItem) { + var item = rawItem.results ? rawItem.results : rawItem; + for (var _i = 0, item_1 = item; _i < item_1.length; _i++) { + var i = item_1[_i]; + Object.defineProperty(this, i.Key, { + configurable: false, + enumerable: false, + value: i.Value, + writable: false, + }); + } + } + return SearchResult; +}()); +exports.SearchResult = SearchResult; +/** + * defines the SortDirection enum + */ +var SortDirection; +(function (SortDirection) { + SortDirection[SortDirection["Ascending"] = 0] = "Ascending"; + SortDirection[SortDirection["Descending"] = 1] = "Descending"; + SortDirection[SortDirection["FQLFormula"] = 2] = "FQLFormula"; +})(SortDirection = exports.SortDirection || (exports.SortDirection = {})); +/** + * defines the ReorderingRuleMatchType enum + */ +var ReorderingRuleMatchType; +(function (ReorderingRuleMatchType) { + ReorderingRuleMatchType[ReorderingRuleMatchType["ResultContainsKeyword"] = 0] = "ResultContainsKeyword"; + ReorderingRuleMatchType[ReorderingRuleMatchType["TitleContainsKeyword"] = 1] = "TitleContainsKeyword"; + ReorderingRuleMatchType[ReorderingRuleMatchType["TitleMatchesKeyword"] = 2] = "TitleMatchesKeyword"; + ReorderingRuleMatchType[ReorderingRuleMatchType["UrlStartsWith"] = 3] = "UrlStartsWith"; + ReorderingRuleMatchType[ReorderingRuleMatchType["UrlExactlyMatches"] = 4] = "UrlExactlyMatches"; + ReorderingRuleMatchType[ReorderingRuleMatchType["ContentTypeIs"] = 5] = "ContentTypeIs"; + ReorderingRuleMatchType[ReorderingRuleMatchType["FileExtensionMatches"] = 6] = "FileExtensionMatches"; + ReorderingRuleMatchType[ReorderingRuleMatchType["ResultHasTag"] = 7] = "ResultHasTag"; + ReorderingRuleMatchType[ReorderingRuleMatchType["ManualCondition"] = 8] = "ManualCondition"; +})(ReorderingRuleMatchType = exports.ReorderingRuleMatchType || (exports.ReorderingRuleMatchType = {})); +/** + * Specifies the type value for the property + */ +var QueryPropertyValueType; +(function (QueryPropertyValueType) { + QueryPropertyValueType[QueryPropertyValueType["None"] = 0] = "None"; + QueryPropertyValueType[QueryPropertyValueType["StringType"] = 1] = "StringType"; + QueryPropertyValueType[QueryPropertyValueType["Int32TYpe"] = 2] = "Int32TYpe"; + QueryPropertyValueType[QueryPropertyValueType["BooleanType"] = 3] = "BooleanType"; + QueryPropertyValueType[QueryPropertyValueType["StringArrayType"] = 4] = "StringArrayType"; + QueryPropertyValueType[QueryPropertyValueType["UnSupportedType"] = 5] = "UnSupportedType"; +})(QueryPropertyValueType = exports.QueryPropertyValueType || (exports.QueryPropertyValueType = {})); + + +/***/ }), +/* 28 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var queryable_1 = __webpack_require__(1); +var SearchSuggest = (function (_super) { + __extends(SearchSuggest, _super); + function SearchSuggest(baseUrl, path) { + if (path === void 0) { path = "_api/search/suggest"; } + return _super.call(this, baseUrl, path) || this; + } + SearchSuggest.prototype.execute = function (query) { + this.mapQueryToQueryString(query); + return this.get().then(function (response) { return new SearchSuggestResult(response); }); + }; + SearchSuggest.prototype.mapQueryToQueryString = function (query) { + this.query.add("querytext", "'" + query.querytext + "'"); + if (query.hasOwnProperty("count")) { + this.query.add("inumberofquerysuggestions", query.count.toString()); + } + if (query.hasOwnProperty("personalCount")) { + this.query.add("inumberofresultsuggestions", query.personalCount.toString()); + } + if (query.hasOwnProperty("preQuery")) { + this.query.add("fprequerysuggestions", query.preQuery.toString()); + } + if (query.hasOwnProperty("hitHighlighting")) { + this.query.add("fhithighlighting", query.hitHighlighting.toString()); + } + if (query.hasOwnProperty("capitalize")) { + this.query.add("fcapitalizefirstletters", query.capitalize.toString()); + } + if (query.hasOwnProperty("culture")) { + this.query.add("culture", query.culture.toString()); + } + if (query.hasOwnProperty("stemming")) { + this.query.add("enablestemming", query.stemming.toString()); + } + if (query.hasOwnProperty("includePeople")) { + this.query.add("showpeoplenamesuggestions", query.includePeople.toString()); + } + if (query.hasOwnProperty("queryRules")) { + this.query.add("enablequeryrules", query.queryRules.toString()); + } + if (query.hasOwnProperty("prefixMatch")) { + this.query.add("fprefixmatchallterms", query.prefixMatch.toString()); + } + }; + return SearchSuggest; +}(queryable_1.QueryableInstance)); +exports.SearchSuggest = SearchSuggest; +var SearchSuggestResult = (function () { + function SearchSuggestResult(json) { + if (json.hasOwnProperty("suggest")) { + // verbose + this.PeopleNames = json.suggest.PeopleNames.results; + this.PersonalResults = json.suggest.PersonalResults.results; + this.Queries = json.suggest.Queries.results; + } + else { + this.PeopleNames = json.PeopleNames; + this.PersonalResults = json.PersonalResults; + this.Queries = json.Queries; + } + } + return SearchSuggestResult; +}()); +exports.SearchSuggestResult = SearchSuggestResult; + + +/***/ }), +/* 29 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var queryable_1 = __webpack_require__(1); +var webs_1 = __webpack_require__(7); +var usercustomactions_1 = __webpack_require__(19); +var odata_1 = __webpack_require__(2); +var features_1 = __webpack_require__(23); +/** + * Describes a site collection + * + */ +var Site = (function (_super) { + __extends(Site, _super); + /** + * Creates a new instance of the RoleAssignments class + * + * @param baseUrl The url or Queryable which forms the parent of this fields collection + */ + function Site(baseUrl, path) { + if (path === void 0) { path = "_api/site"; } + return _super.call(this, baseUrl, path) || this; + } + Object.defineProperty(Site.prototype, "rootWeb", { + /** + * Gets the root web of the site collection + * + */ + get: function () { + return new webs_1.Web(this, "rootweb"); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Site.prototype, "features", { + /** + * Gets the active features for this site + * + */ + get: function () { + return new features_1.Features(this); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Site.prototype, "userCustomActions", { + /** + * Get all custom actions on a site collection + * + */ + get: function () { + return new usercustomactions_1.UserCustomActions(this); + }, + enumerable: true, + configurable: true + }); + /** + * Gets the context information for the site. + */ + Site.prototype.getContextInfo = function () { + var q = new Site(this.parentUrl, "_api/contextinfo"); + return q.post().then(function (data) { + if (data.hasOwnProperty("GetContextWebInformation")) { + var info = data.GetContextWebInformation; + info.SupportedSchemaVersions = info.SupportedSchemaVersions.results; + return info; + } + else { + return data; + } + }); + }; + /** + * Gets the document libraries on a site. Static method. (SharePoint Online only) + * + * @param absoluteWebUrl The absolute url of the web whose document libraries should be returned + */ + Site.prototype.getDocumentLibraries = function (absoluteWebUrl) { + var q = new queryable_1.Queryable("", "_api/sp.web.getdocumentlibraries(@v)"); + q.query.add("@v", "'" + absoluteWebUrl + "'"); + return q.get().then(function (data) { + if (data.hasOwnProperty("GetDocumentLibraries")) { + return data.GetDocumentLibraries; + } + else { + return data; + } + }); + }; + /** + * Gets the site URL from a page URL. + * + * @param absolutePageUrl The absolute url of the page + */ + Site.prototype.getWebUrlFromPageUrl = function (absolutePageUrl) { + var q = new queryable_1.Queryable("", "_api/sp.web.getweburlfrompageurl(@v)"); + q.query.add("@v", "'" + absolutePageUrl + "'"); + return q.get().then(function (data) { + if (data.hasOwnProperty("GetWebUrlFromPageUrl")) { + return data.GetWebUrlFromPageUrl; + } + else { + return data; + } + }); + }; + /** + * Creates a new batch for requests within the context of context this site + * + */ + Site.prototype.createBatch = function () { + return new odata_1.ODataBatch(this.parentUrl); + }; + return Site; +}(queryable_1.QueryableInstance)); +exports.Site = Site; + + +/***/ }), +/* 30 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var queryable_1 = __webpack_require__(1); +var sitegroups_1 = __webpack_require__(18); +var util_1 = __webpack_require__(0); +/** + * Describes a collection of all site collection users + * + */ +var SiteUsers = (function (_super) { + __extends(SiteUsers, _super); + /** + * Creates a new instance of the Users class + * + * @param baseUrl The url or Queryable which forms the parent of this user collection + */ + function SiteUsers(baseUrl, path) { + if (path === void 0) { path = "siteusers"; } + return _super.call(this, baseUrl, path) || this; + } + /** + * Gets a user from the collection by email + * + * @param email The email of the user + */ + SiteUsers.prototype.getByEmail = function (email) { + return new SiteUser(this, "getByEmail('" + email + "')"); + }; + /** + * Gets a user from the collection by id + * + * @param id The id of the user + */ + SiteUsers.prototype.getById = function (id) { + return new SiteUser(this, "getById(" + id + ")"); + }; + /** + * Gets a user from the collection by login name + * + * @param loginName The email address of the user + */ + SiteUsers.prototype.getByLoginName = function (loginName) { + var su = new SiteUser(this); + su.concat("(@v)"); + su.query.add("@v", "'" + encodeURIComponent(loginName) + "'"); + return su; + }; + /** + * Removes a user from the collection by id + * + * @param id The id of the user + */ + SiteUsers.prototype.removeById = function (id) { + return this.clone(SiteUsers, "removeById(" + id + ")", true).post(); + }; + /** + * Removes a user from the collection by login name + * + * @param loginName The login name of the user + */ + SiteUsers.prototype.removeByLoginName = function (loginName) { + var o = this.clone(SiteUsers, "removeByLoginName(@v)", true); + o.query.add("@v", "'" + encodeURIComponent(loginName) + "'"); + return o.post(); + }; + /** + * Add a user to a group + * + * @param loginName The login name of the user to add to the group + * + */ + SiteUsers.prototype.add = function (loginName) { + var _this = this; + return this.clone(SiteUsers, null, true).post({ + body: JSON.stringify({ "__metadata": { "type": "SP.User" }, LoginName: loginName }), + }).then(function () { return _this.getByLoginName(loginName); }); + }; + return SiteUsers; +}(queryable_1.QueryableCollection)); +exports.SiteUsers = SiteUsers; +/** + * Describes a single user + * + */ +var SiteUser = (function (_super) { + __extends(SiteUser, _super); + function SiteUser() { + return _super !== null && _super.apply(this, arguments) || this; + } + Object.defineProperty(SiteUser.prototype, "groups", { + /** + * Get's the groups for this user. + * + */ + get: function () { + return new sitegroups_1.SiteGroups(this, "groups"); + }, + enumerable: true, + configurable: true + }); + /** + * Updates this user instance with the supplied properties + * + * @param properties A plain object of property names and values to update for the user + */ + SiteUser.prototype.update = function (properties) { + var _this = this; + var postBody = util_1.Util.extend({ "__metadata": { "type": "SP.User" } }, properties); + return this.post({ + body: JSON.stringify(postBody), + headers: { + "X-HTTP-Method": "MERGE", + }, + }).then(function (data) { + return { + data: data, + user: _this, + }; + }); + }; + /** + * Delete this user + * + */ + SiteUser.prototype.delete = function () { + return this.post({ + headers: { + "X-HTTP-Method": "DELETE", + }, + }); + }; + return SiteUser; +}(queryable_1.QueryableInstance)); +exports.SiteUser = SiteUser; +/** + * Represents the current user + */ +var CurrentUser = (function (_super) { + __extends(CurrentUser, _super); + function CurrentUser(baseUrl, path) { + if (path === void 0) { path = "currentuser"; } + return _super.call(this, baseUrl, path) || this; + } + return CurrentUser; +}(queryable_1.QueryableInstance)); +exports.CurrentUser = CurrentUser; + + +/***/ }), +/* 31 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var logging_1 = __webpack_require__(5); +function deprecated(message) { + return function (target, propertyKey, descriptor) { + var method = descriptor.value; + descriptor.value = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + logging_1.Logger.log({ + data: { + descriptor: descriptor, + propertyKey: propertyKey, + target: target, + }, + level: logging_1.LogLevel.Warning, + message: message, + }); + return method.apply(this, args); + }; + }; +} +exports.deprecated = deprecated; + + +/***/ }), +/* 32 */ +/***/ (function(module, exports) { + +var g; + +// This works in non-strict mode +g = (function() { + return this; +})(); + +try { + // This works if eval is allowed (see CSP) + g = g || Function("return this")() || (1,eval)("this"); +} catch(e) { + // This works if the window reference is available + if(typeof window === "object") + g = window; +} + +// g can still be undefined, but nothing to do about it... +// We return undefined, instead of nothing here, so it's +// easier to handle this case. if(!global) { ...} + +module.exports = g; + + +/***/ }), +/* 33 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var collections_1 = __webpack_require__(6); +/** + * Class used to manage the current application settings + * + */ +var Settings = (function () { + /** + * Creates a new instance of the settings class + * + * @constructor + */ + function Settings() { + this._settings = new collections_1.Dictionary(); + } + /** + * Adds a new single setting, or overwrites a previous setting with the same key + * + * @param {string} key The key used to store this setting + * @param {string} value The setting value to store + */ + Settings.prototype.add = function (key, value) { + this._settings.add(key, value); + }; + /** + * Adds a JSON value to the collection as a string, you must use getJSON to rehydrate the object when read + * + * @param {string} key The key used to store this setting + * @param {any} value The setting value to store + */ + Settings.prototype.addJSON = function (key, value) { + this._settings.add(key, JSON.stringify(value)); + }; + /** + * Applies the supplied hash to the setting collection overwriting any existing value, or created new values + * + * @param {TypedHash} hash The set of values to add + */ + Settings.prototype.apply = function (hash) { + var _this = this; + return new Promise(function (resolve, reject) { + try { + _this._settings.merge(hash); + resolve(); + } + catch (e) { + reject(e); + } + }); + }; + /** + * Loads configuration settings into the collection from the supplied provider and returns a Promise + * + * @param {IConfigurationProvider} provider The provider from which we will load the settings + */ + Settings.prototype.load = function (provider) { + var _this = this; + return new Promise(function (resolve, reject) { + provider.getConfiguration().then(function (value) { + _this._settings.merge(value); + resolve(); + }).catch(function (reason) { + reject(reason); + }); + }); + }; + /** + * Gets a value from the configuration + * + * @param {string} key The key whose value we want to return. Returns null if the key does not exist + * @return {string} string value from the configuration + */ + Settings.prototype.get = function (key) { + return this._settings.get(key); + }; + /** + * Gets a JSON value, rehydrating the stored string to the original object + * + * @param {string} key The key whose value we want to return. Returns null if the key does not exist + * @return {any} object from the configuration + */ + Settings.prototype.getJSON = function (key) { + var o = this.get(key); + if (typeof o === "undefined" || o === null) { + return o; + } + return JSON.parse(o); + }; + return Settings; +}()); +exports.Settings = Settings; + + +/***/ }), +/* 34 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var search_1 = __webpack_require__(27); +var searchsuggest_1 = __webpack_require__(28); +var site_1 = __webpack_require__(29); +var webs_1 = __webpack_require__(7); +var util_1 = __webpack_require__(0); +var userprofiles_1 = __webpack_require__(48); +var exceptions_1 = __webpack_require__(3); +/** + * Root of the SharePoint REST module + */ +var Rest = (function () { + function Rest() { + } + /** + * Executes a search against this web context + * + * @param query The SearchQuery definition + */ + Rest.prototype.searchSuggest = function (query) { + var finalQuery; + if (typeof query === "string") { + finalQuery = { querytext: query }; + } + else { + finalQuery = query; + } + return new searchsuggest_1.SearchSuggest("").execute(finalQuery); + }; + /** + * Executes a search against this web context + * + * @param query The SearchQuery definition + */ + Rest.prototype.search = function (query) { + var finalQuery; + if (typeof query === "string") { + finalQuery = { Querytext: query }; + } + else { + finalQuery = query; + } + return new search_1.Search("").execute(finalQuery); + }; + Object.defineProperty(Rest.prototype, "site", { + /** + * Begins a site collection scoped REST request + * + */ + get: function () { + return new site_1.Site(""); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Rest.prototype, "web", { + /** + * Begins a web scoped REST request + * + */ + get: function () { + return new webs_1.Web(""); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Rest.prototype, "profiles", { + /** + * Access to user profile methods + * + */ + get: function () { + return new userprofiles_1.UserProfileQuery(""); + }, + enumerable: true, + configurable: true + }); + /** + * Creates a new batch object for use with the Queryable.addToBatch method + * + */ + Rest.prototype.createBatch = function () { + return this.web.createBatch(); + }; + /** + * Begins a cross-domain, host site scoped REST request, for use in add-in webs + * + * @param addInWebUrl The absolute url of the add-in web + * @param hostWebUrl The absolute url of the host web + */ + Rest.prototype.crossDomainSite = function (addInWebUrl, hostWebUrl) { + return this._cdImpl(site_1.Site, addInWebUrl, hostWebUrl, "site"); + }; + /** + * Begins a cross-domain, host web scoped REST request, for use in add-in webs + * + * @param addInWebUrl The absolute url of the add-in web + * @param hostWebUrl The absolute url of the host web + */ + Rest.prototype.crossDomainWeb = function (addInWebUrl, hostWebUrl) { + return this._cdImpl(webs_1.Web, addInWebUrl, hostWebUrl, "web"); + }; + /** + * Implements the creation of cross domain REST urls + * + * @param factory The constructor of the object to create Site | Web + * @param addInWebUrl The absolute url of the add-in web + * @param hostWebUrl The absolute url of the host web + * @param urlPart String part to append to the url "site" | "web" + */ + Rest.prototype._cdImpl = function (factory, addInWebUrl, hostWebUrl, urlPart) { + if (!util_1.Util.isUrlAbsolute(addInWebUrl)) { + throw new exceptions_1.UrlException("The addInWebUrl parameter must be an absolute url."); + } + if (!util_1.Util.isUrlAbsolute(hostWebUrl)) { + throw new exceptions_1.UrlException("The hostWebUrl parameter must be an absolute url."); + } + var url = util_1.Util.combinePaths(addInWebUrl, "_api/SP.AppContextSite(@target)"); + var instance = new factory(url, urlPart); + instance.query.add("@target", "'" + encodeURIComponent(hostWebUrl) + "'"); + return instance; + }; + return Rest; +}()); +exports.Rest = Rest; + + +/***/ }), +/* 35 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} +Object.defineProperty(exports, "__esModule", { value: true }); +__export(__webpack_require__(44)); +var httpclient_1 = __webpack_require__(15); +exports.HttpClient = httpclient_1.HttpClient; +var sprequestexecutorclient_1 = __webpack_require__(40); +exports.SPRequestExecutorClient = sprequestexecutorclient_1.SPRequestExecutorClient; +var nodefetchclient_1 = __webpack_require__(39); +exports.NodeFetchClient = nodefetchclient_1.NodeFetchClient; +var fetchclient_1 = __webpack_require__(21); +exports.FetchClient = fetchclient_1.FetchClient; +__export(__webpack_require__(36)); +var collections_1 = __webpack_require__(6); +exports.Dictionary = collections_1.Dictionary; +var util_1 = __webpack_require__(0); +exports.Util = util_1.Util; +__export(__webpack_require__(5)); +__export(__webpack_require__(3)); + + +/***/ }), +/* 36 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var cachingConfigurationProvider_1 = __webpack_require__(20); +exports.CachingConfigurationProvider = cachingConfigurationProvider_1.default; +var spListConfigurationProvider_1 = __webpack_require__(37); +exports.SPListConfigurationProvider = spListConfigurationProvider_1.default; + + +/***/ }), +/* 37 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var cachingConfigurationProvider_1 = __webpack_require__(20); +/** + * A configuration provider which loads configuration values from a SharePoint list + * + */ +var SPListConfigurationProvider = (function () { + /** + * Creates a new SharePoint list based configuration provider + * @constructor + * @param {string} webUrl Url of the SharePoint site, where the configuration list is located + * @param {string} listTitle Title of the SharePoint list, which contains the configuration settings (optional, default = "config") + */ + function SPListConfigurationProvider(sourceWeb, sourceListTitle) { + if (sourceListTitle === void 0) { sourceListTitle = "config"; } + this.sourceWeb = sourceWeb; + this.sourceListTitle = sourceListTitle; + } + Object.defineProperty(SPListConfigurationProvider.prototype, "web", { + /** + * Gets the url of the SharePoint site, where the configuration list is located + * + * @return {string} Url address of the site + */ + get: function () { + return this.sourceWeb; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SPListConfigurationProvider.prototype, "listTitle", { + /** + * Gets the title of the SharePoint list, which contains the configuration settings + * + * @return {string} List title + */ + get: function () { + return this.sourceListTitle; + }, + enumerable: true, + configurable: true + }); + /** + * Loads the configuration values from the SharePoint list + * + * @return {Promise>} Promise of loaded configuration values + */ + SPListConfigurationProvider.prototype.getConfiguration = function () { + return this.web.lists.getByTitle(this.listTitle).items.select("Title", "Value") + .getAs().then(function (data) { + return data.reduce(function (configuration, item) { + return Object.defineProperty(configuration, item.Title, { + configurable: false, + enumerable: false, + value: item.Value, + writable: false, + }); + }, {}); + }); + }; + /** + * Wraps the current provider in a cache enabled provider + * + * @return {CachingConfigurationProvider} Caching providers which wraps the current provider + */ + SPListConfigurationProvider.prototype.asCaching = function () { + var cacheKey = "splist_" + this.web.toUrl() + "+" + this.listTitle; + return new cachingConfigurationProvider_1.default(this, cacheKey); + }; + return SPListConfigurationProvider; +}()); +exports.default = SPListConfigurationProvider; + + +/***/ }), +/* 38 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var collections_1 = __webpack_require__(6); +var util_1 = __webpack_require__(0); +var odata_1 = __webpack_require__(2); +var CachedDigest = (function () { + function CachedDigest() { + } + return CachedDigest; +}()); +exports.CachedDigest = CachedDigest; +// allows for the caching of digests across all HttpClient's which each have their own DigestCache wrapper. +var digests = new collections_1.Dictionary(); +var DigestCache = (function () { + function DigestCache(_httpClient, _digests) { + if (_digests === void 0) { _digests = digests; } + this._httpClient = _httpClient; + this._digests = _digests; + } + DigestCache.prototype.getDigest = function (webUrl) { + var _this = this; + var cachedDigest = this._digests.get(webUrl); + if (cachedDigest !== null) { + var now = new Date(); + if (now < cachedDigest.expiration) { + return Promise.resolve(cachedDigest.value); + } + } + var url = util_1.Util.combinePaths(webUrl, "/_api/contextinfo"); + return this._httpClient.fetchRaw(url, { + cache: "no-cache", + credentials: "same-origin", + headers: { + "Accept": "application/json;odata=verbose", + "Content-type": "application/json;odata=verbose;charset=utf-8", + }, + method: "POST", + }).then(function (response) { + var parser = new odata_1.ODataDefaultParser(); + return parser.parse(response).then(function (d) { return d.GetContextWebInformation; }); + }).then(function (data) { + var newCachedDigest = new CachedDigest(); + newCachedDigest.value = data.FormDigestValue; + var seconds = data.FormDigestTimeoutSeconds; + var expiration = new Date(); + expiration.setTime(expiration.getTime() + 1000 * seconds); + newCachedDigest.expiration = expiration; + _this._digests.add(webUrl, newCachedDigest); + return newCachedDigest.value; + }); + }; + DigestCache.prototype.clear = function () { + this._digests.clear(); + }; + return DigestCache; +}()); +exports.DigestCache = DigestCache; + + +/***/ }), +/* 39 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var exceptions_1 = __webpack_require__(3); +/** + * This module is substituted for the NodeFetchClient.ts during the packaging process. This helps to reduce the pnp.js file size by + * not including all of the node dependencies + */ +var NodeFetchClient = (function () { + function NodeFetchClient() { + } + /** + * Always throws an error that NodeFetchClient is not supported for use in the browser + */ + NodeFetchClient.prototype.fetch = function () { + throw new exceptions_1.NodeFetchClientUnsupportedException(); + }; + return NodeFetchClient; +}()); +exports.NodeFetchClient = NodeFetchClient; + + +/***/ }), +/* 40 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var util_1 = __webpack_require__(0); +var exceptions_1 = __webpack_require__(3); +/** + * Makes requests using the SP.RequestExecutor library. + */ +var SPRequestExecutorClient = (function () { + function SPRequestExecutorClient() { + /** + * Converts a SharePoint REST API response to a fetch API response. + */ + this.convertToResponse = function (spResponse) { + var responseHeaders = new Headers(); + for (var h in spResponse.headers) { + if (spResponse.headers[h]) { + responseHeaders.append(h, spResponse.headers[h]); + } + } + // issue #256, Cannot have an empty string body when creating a Response with status 204 + var body = spResponse.statusCode === 204 ? null : spResponse.body; + return new Response(body, { + headers: responseHeaders, + status: spResponse.statusCode, + statusText: spResponse.statusText, + }); + }; + } + /** + * Fetches a URL using the SP.RequestExecutor library. + */ + SPRequestExecutorClient.prototype.fetch = function (url, options) { + var _this = this; + if (typeof SP === "undefined" || typeof SP.RequestExecutor === "undefined") { + throw new exceptions_1.SPRequestExecutorUndefinedException(); + } + var addinWebUrl = url.substring(0, url.indexOf("/_api")), executor = new SP.RequestExecutor(addinWebUrl); + var headers = {}, iterator, temp; + if (options.headers && options.headers instanceof Headers) { + iterator = options.headers.entries(); + temp = iterator.next(); + while (!temp.done) { + headers[temp.value[0]] = temp.value[1]; + temp = iterator.next(); + } + } + else { + headers = options.headers; + } + return new Promise(function (resolve, reject) { + var requestOptions = { + error: function (error) { + reject(_this.convertToResponse(error)); + }, + headers: headers, + method: options.method, + success: function (response) { + resolve(_this.convertToResponse(response)); + }, + url: url, + }; + if (options.body) { + requestOptions = util_1.Util.extend(requestOptions, { body: options.body }); + } + else { + requestOptions = util_1.Util.extend(requestOptions, { binaryStringRequestBody: true }); + } + executor.executeAsync(requestOptions); + }); + }; + return SPRequestExecutorClient; +}()); +exports.SPRequestExecutorClient = SPRequestExecutorClient; + + +/***/ }), +/* 41 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} +Object.defineProperty(exports, "__esModule", { value: true }); +var util_1 = __webpack_require__(0); +var storage_1 = __webpack_require__(14); +var configuration_1 = __webpack_require__(33); +var logging_1 = __webpack_require__(5); +var rest_1 = __webpack_require__(34); +var pnplibconfig_1 = __webpack_require__(4); +/** + * Root class of the Patterns and Practices namespace, provides an entry point to the library + */ +/** + * Utility methods + */ +exports.util = util_1.Util; +/** + * Provides access to the REST interface + */ +exports.sp = new rest_1.Rest(); +/** + * Provides access to local and session storage + */ +exports.storage = new storage_1.PnPClientStorage(); +/** + * Global configuration instance to which providers can be added + */ +exports.config = new configuration_1.Settings(); +/** + * Global logging instance to which subscribers can be registered and messages written + */ +exports.log = logging_1.Logger; +/** + * Allows for the configuration of the library + */ +exports.setup = pnplibconfig_1.setRuntimeConfig; +/** + * Expose a subset of classes from the library for public consumption + */ +__export(__webpack_require__(35)); +// creating this class instead of directly assigning to default fixes issue #116 +var Def = { + /** + * Global configuration instance to which providers can be added + */ + config: exports.config, + /** + * Global logging instance to which subscribers can be registered and messages written + */ + log: exports.log, + /** + * Provides access to local and session storage + */ + setup: exports.setup, + /** + * Provides access to the REST interface + */ + sp: exports.sp, + /** + * Provides access to local and session storage + */ + storage: exports.storage, + /** + * Utility methods + */ + util: exports.util, +}; +/** + * Enables use of the import pnp from syntax + */ +exports.default = Def; + + +/***/ }), +/* 42 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var queryable_1 = __webpack_require__(1); +var odata_1 = __webpack_require__(2); +/** + * Describes a collection of Item objects + * + */ +var AttachmentFiles = (function (_super) { + __extends(AttachmentFiles, _super); + /** + * Creates a new instance of the AttachmentFiles class + * + * @param baseUrl The url or Queryable which forms the parent of this attachments collection + */ + function AttachmentFiles(baseUrl, path) { + if (path === void 0) { path = "AttachmentFiles"; } + return _super.call(this, baseUrl, path) || this; + } + /** + * Gets a Attachment File by filename + * + * @param name The name of the file, including extension. + */ + AttachmentFiles.prototype.getByName = function (name) { + var f = new AttachmentFile(this); + f.concat("('" + name + "')"); + return f; + }; + /** + * Adds a new attachment to the collection. Not supported for batching. + * + * @param name The name of the file, including extension. + * @param content The Base64 file content. + */ + AttachmentFiles.prototype.add = function (name, content) { + var _this = this; + return this.clone(AttachmentFiles, "add(FileName='" + name + "')").post({ + body: content, + }).then(function (response) { + return { + data: response, + file: _this.getByName(name), + }; + }); + }; + /** + * Adds mjultiple new attachment to the collection. Not supported for batching. + * + * @files name The collection of files to add + */ + AttachmentFiles.prototype.addMultiple = function (files) { + var _this = this; + // add the files in series so we don't get update conflicts + return files.reduce(function (chain, file) { return chain.then(function () { return _this.clone(AttachmentFiles, "add(FileName='" + file.name + "')").post({ + body: file.content, + }); }); }, Promise.resolve()); + }; + return AttachmentFiles; +}(queryable_1.QueryableCollection)); +exports.AttachmentFiles = AttachmentFiles; +/** + * Describes a single attachment file instance + * + */ +var AttachmentFile = (function (_super) { + __extends(AttachmentFile, _super); + function AttachmentFile() { + return _super !== null && _super.apply(this, arguments) || this; + } + /** + * Gets the contents of the file as text + * + */ + AttachmentFile.prototype.getText = function () { + return this.clone(AttachmentFile, "$value").get(new odata_1.TextFileParser()); + }; + /** + * Gets the contents of the file as a blob, does not work in Node.js + * + */ + AttachmentFile.prototype.getBlob = function () { + return this.clone(AttachmentFile, "$value").get(new odata_1.BlobFileParser()); + }; + /** + * Gets the contents of a file as an ArrayBuffer, works in Node.js + */ + AttachmentFile.prototype.getBuffer = function () { + return this.clone(AttachmentFile, "$value").get(new odata_1.BufferFileParser()); + }; + /** + * Gets the contents of a file as an ArrayBuffer, works in Node.js + */ + AttachmentFile.prototype.getJSON = function () { + return this.clone(AttachmentFile, "$value").get(new odata_1.JSONFileParser()); + }; + /** + * Sets the content of a file. Not supported for batching + * + * @param content The value to set for the file contents + */ + AttachmentFile.prototype.setContent = function (content) { + var _this = this; + return this.clone(AttachmentFile, "$value").post({ + body: content, + headers: { + "X-HTTP-Method": "PUT", + }, + }).then(function (_) { return new AttachmentFile(_this); }); + }; + /** + * Delete this attachment file + * + * @param eTag Value used in the IF-Match header, by default "*" + */ + AttachmentFile.prototype.delete = function (eTag) { + if (eTag === void 0) { eTag = "*"; } + return this.post({ + headers: { + "IF-Match": eTag, + "X-HTTP-Method": "DELETE", + }, + }); + }; + return AttachmentFile; +}(queryable_1.QueryableInstance)); +exports.AttachmentFile = AttachmentFile; + + +/***/ }), +/* 43 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var queryable_1 = __webpack_require__(1); +/** + * Describes a collection of Field objects + * + */ +var Forms = (function (_super) { + __extends(Forms, _super); + /** + * Creates a new instance of the Fields class + * + * @param baseUrl The url or Queryable which forms the parent of this fields collection + */ + function Forms(baseUrl, path) { + if (path === void 0) { path = "forms"; } + return _super.call(this, baseUrl, path) || this; + } + /** + * Gets a form by id + * + * @param id The guid id of the item to retrieve + */ + Forms.prototype.getById = function (id) { + var i = new Form(this); + i.concat("('" + id + "')"); + return i; + }; + return Forms; +}(queryable_1.QueryableCollection)); +exports.Forms = Forms; +/** + * Describes a single of Form instance + * + */ +var Form = (function (_super) { + __extends(Form, _super); + function Form() { + return _super !== null && _super.apply(this, arguments) || this; + } + return Form; +}(queryable_1.QueryableInstance)); +exports.Form = Form; + + +/***/ }), +/* 44 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} +Object.defineProperty(exports, "__esModule", { value: true }); +__export(__webpack_require__(22)); +var files_1 = __webpack_require__(8); +exports.CheckinType = files_1.CheckinType; +exports.WebPartsPersonalizationScope = files_1.WebPartsPersonalizationScope; +exports.MoveOperations = files_1.MoveOperations; +exports.TemplateFileType = files_1.TemplateFileType; +var folders_1 = __webpack_require__(9); +exports.Folder = folders_1.Folder; +exports.Folders = folders_1.Folders; +var items_1 = __webpack_require__(10); +exports.Item = items_1.Item; +exports.Items = items_1.Items; +exports.PagedItemCollection = items_1.PagedItemCollection; +var navigation_1 = __webpack_require__(25); +exports.NavigationNodes = navigation_1.NavigationNodes; +exports.NavigationNode = navigation_1.NavigationNode; +var lists_1 = __webpack_require__(11); +exports.List = lists_1.List; +exports.Lists = lists_1.Lists; +var odata_1 = __webpack_require__(2); +exports.extractOdataId = odata_1.extractOdataId; +exports.ODataParserBase = odata_1.ODataParserBase; +exports.ODataDefaultParser = odata_1.ODataDefaultParser; +exports.ODataRaw = odata_1.ODataRaw; +exports.ODataValue = odata_1.ODataValue; +exports.ODataEntity = odata_1.ODataEntity; +exports.ODataEntityArray = odata_1.ODataEntityArray; +exports.TextFileParser = odata_1.TextFileParser; +exports.BlobFileParser = odata_1.BlobFileParser; +exports.BufferFileParser = odata_1.BufferFileParser; +exports.JSONFileParser = odata_1.JSONFileParser; +var queryable_1 = __webpack_require__(1); +exports.Queryable = queryable_1.Queryable; +exports.QueryableInstance = queryable_1.QueryableInstance; +exports.QueryableCollection = queryable_1.QueryableCollection; +var roles_1 = __webpack_require__(17); +exports.RoleDefinitionBindings = roles_1.RoleDefinitionBindings; +var search_1 = __webpack_require__(27); +exports.Search = search_1.Search; +exports.SearchResult = search_1.SearchResult; +exports.SearchResults = search_1.SearchResults; +exports.SortDirection = search_1.SortDirection; +exports.ReorderingRuleMatchType = search_1.ReorderingRuleMatchType; +exports.QueryPropertyValueType = search_1.QueryPropertyValueType; +var searchsuggest_1 = __webpack_require__(28); +exports.SearchSuggest = searchsuggest_1.SearchSuggest; +exports.SearchSuggestResult = searchsuggest_1.SearchSuggestResult; +var site_1 = __webpack_require__(29); +exports.Site = site_1.Site; +__export(__webpack_require__(13)); +var webs_1 = __webpack_require__(7); +exports.Web = webs_1.Web; + + +/***/ }), +/* 45 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var caching_1 = __webpack_require__(22); +var httpclient_1 = __webpack_require__(15); +var logging_1 = __webpack_require__(5); +var util_1 = __webpack_require__(0); +/** + * Processes a given context through the request pipeline + * + * @param context The request context we are processing + */ +function pipe(context) { + // this is the beginning of the extensible pipeline in future versions + var pipeline = [ + PipelineMethods.logStart, + PipelineMethods.caching, + PipelineMethods.send, + PipelineMethods.logEnd, + ]; + return pipeline.reduce(function (chain, next) { return chain.then(function (c) { return next(c); }); }, Promise.resolve(context)) + .then(function (ctx) { return PipelineMethods.returnResult(ctx); }) + .catch(function (e) { + logging_1.Logger.log({ + data: e, + level: logging_1.LogLevel.Error, + message: "Error in request pipeline: " + e.message, + }); + throw e; + }); +} +exports.pipe = pipe; +/** + * decorator factory applied to methods in the pipeline to control behavior + */ +function requestPipelineMethod(alwaysRun) { + if (alwaysRun === void 0) { alwaysRun = false; } + return function (target, propertyKey, descriptor) { + var method = descriptor.value; + descriptor.value = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + // if we have a result already in the pipeline, pass it along and don't call the tagged method + if (!alwaysRun && args.length > 0 && args[0].hasOwnProperty("hasResult") && args[0].hasResult) { + logging_1.Logger.write("[" + args[0].requestId + "] (" + (new Date()).getTime() + ") Skipping request pipeline method " + propertyKey + ", existing result in pipeline.", logging_1.LogLevel.Verbose); + return Promise.resolve(args[0]); + } + // apply the tagged method + logging_1.Logger.write("[" + args[0].requestId + "] (" + (new Date()).getTime() + ") Calling request pipeline method " + propertyKey + ".", logging_1.LogLevel.Verbose); + return method.apply(target, args); + }; + }; +} +/** + * Contains the methods used within the request pipeline + */ +var PipelineMethods = (function () { + function PipelineMethods() { + } + /** + * Logs the start of the request + */ + PipelineMethods.logStart = function (context) { + return new Promise(function (resolve) { + logging_1.Logger.log({ + data: logging_1.Logger.activeLogLevel === logging_1.LogLevel.Info ? {} : context, + level: logging_1.LogLevel.Info, + message: "[" + context.requestId + "] (" + (new Date()).getTime() + ") Beginning " + context.verb + " request to " + context.requestAbsoluteUrl, + }); + resolve(context); + }); + }; + /** + * Handles caching of the request + */ + PipelineMethods.caching = function (context) { + return new Promise(function (resolve) { + // handle caching, if applicable + if (context.verb === "GET" && context.isCached) { + logging_1.Logger.write("[" + context.requestId + "] (" + (new Date()).getTime() + ") Caching is enabled for request, checking cache...", logging_1.LogLevel.Info); + var cacheOptions = new caching_1.CachingOptions(context.requestAbsoluteUrl.toLowerCase()); + if (typeof context.cachingOptions !== "undefined") { + cacheOptions = util_1.Util.extend(cacheOptions, context.cachingOptions); + } + // we may not have a valid store, i.e. on node + if (cacheOptions.store !== null) { + // check if we have the data in cache and if so resolve the promise and return + var data = cacheOptions.store.get(cacheOptions.key); + if (data !== null) { + // ensure we clear any help batch dependency we are resolving from the cache + logging_1.Logger.log({ + data: logging_1.Logger.activeLogLevel === logging_1.LogLevel.Info ? {} : data, + level: logging_1.LogLevel.Info, + message: "[" + context.requestId + "] (" + (new Date()).getTime() + ") Value returned from cache.", + }); + context.batchDependency(); + return PipelineMethods.setResult(context, data).then(function (ctx) { return resolve(ctx); }); + } + } + logging_1.Logger.write("[" + context.requestId + "] (" + (new Date()).getTime() + ") Value not found in cache.", logging_1.LogLevel.Info); + // if we don't then wrap the supplied parser in the caching parser wrapper + // and send things on their way + context.parser = new caching_1.CachingParserWrapper(context.parser, cacheOptions); + } + return resolve(context); + }); + }; + /** + * Sends the request + */ + PipelineMethods.send = function (context) { + return new Promise(function (resolve, reject) { + // send or batch the request + if (context.isBatched) { + // we are in a batch, so add to batch, remove dependency, and resolve with the batch's promise + var p = context.batch.add(context.requestAbsoluteUrl, context.verb, context.options, context.parser); + // we release the dependency here to ensure the batch does not execute until the request is added to the batch + context.batchDependency(); + logging_1.Logger.write("[" + context.requestId + "] (" + (new Date()).getTime() + ") Batching request.", logging_1.LogLevel.Info); + resolve(p.then(function (result) { return PipelineMethods.setResult(context, result); })); + } + else { + logging_1.Logger.write("[" + context.requestId + "] (" + (new Date()).getTime() + ") Sending request.", logging_1.LogLevel.Info); + // we are not part of a batch, so proceed as normal + var client = new httpclient_1.HttpClient(); + var opts = util_1.Util.extend(context.options || {}, { method: context.verb }); + client.fetch(context.requestAbsoluteUrl, opts) + .then(function (response) { return context.parser.parse(response); }) + .then(function (result) { return PipelineMethods.setResult(context, result); }) + .then(function (ctx) { return resolve(ctx); }) + .catch(function (e) { return reject(e); }); + } + }); + }; + /** + * Logs the end of the request + */ + PipelineMethods.logEnd = function (context) { + return new Promise(function (resolve) { + logging_1.Logger.log({ + data: logging_1.Logger.activeLogLevel === logging_1.LogLevel.Info ? {} : context, + level: logging_1.LogLevel.Info, + message: "[" + context.requestId + "] (" + (new Date()).getTime() + ") Completing " + context.verb + " request to " + context.requestAbsoluteUrl, + }); + resolve(context); + }); + }; + /** + * At the end of the pipeline resolves the request's result + */ + PipelineMethods.returnResult = function (context) { + logging_1.Logger.log({ + data: context.result, + level: logging_1.LogLevel.Verbose, + message: "[" + context.requestId + "] (" + (new Date()).getTime() + ") Returning, see data property for value.", + }); + return Promise.resolve(context.result); + }; + /** + * Sets the result on the context + */ + PipelineMethods.setResult = function (context, value) { + return new Promise(function (resolve) { + context.result = value; + context.hasResult = true; + resolve(context); + }); + }; + return PipelineMethods; +}()); +__decorate([ + requestPipelineMethod(true) +], PipelineMethods, "logStart", null); +__decorate([ + requestPipelineMethod() +], PipelineMethods, "caching", null); +__decorate([ + requestPipelineMethod() +], PipelineMethods, "send", null); +__decorate([ + requestPipelineMethod(true) +], PipelineMethods, "logEnd", null); +__decorate([ + requestPipelineMethod(true) +], PipelineMethods, "returnResult", null); + + +/***/ }), +/* 46 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var queryable_1 = __webpack_require__(1); +var RelatedItemManagerImpl = (function (_super) { + __extends(RelatedItemManagerImpl, _super); + function RelatedItemManagerImpl(baseUrl, path) { + if (path === void 0) { path = "_api/SP.RelatedItemManager"; } + return _super.call(this, baseUrl, path) || this; + } + RelatedItemManagerImpl.FromUrl = function (url) { + if (url === null) { + return new RelatedItemManagerImpl(""); + } + var index = url.indexOf("_api/"); + if (index > -1) { + return new RelatedItemManagerImpl(url.substr(0, index)); + } + return new RelatedItemManagerImpl(url); + }; + RelatedItemManagerImpl.prototype.getRelatedItems = function (sourceListName, sourceItemId) { + var query = this.clone(RelatedItemManagerImpl, null, true); + query.concat(".GetRelatedItems"); + return query.post({ + body: JSON.stringify({ + SourceItemID: sourceItemId, + SourceListName: sourceListName, + }), + }); + }; + RelatedItemManagerImpl.prototype.getPageOneRelatedItems = function (sourceListName, sourceItemId) { + var query = this.clone(RelatedItemManagerImpl, null, true); + query.concat(".GetPageOneRelatedItems"); + return query.post({ + body: JSON.stringify({ + SourceItemID: sourceItemId, + SourceListName: sourceListName, + }), + }); + }; + RelatedItemManagerImpl.prototype.addSingleLink = function (sourceListName, sourceItemId, sourceWebUrl, targetListName, targetItemID, targetWebUrl, tryAddReverseLink) { + if (tryAddReverseLink === void 0) { tryAddReverseLink = false; } + var query = this.clone(RelatedItemManagerImpl, null, true); + query.concat(".AddSingleLink"); + return query.post({ + body: JSON.stringify({ + SourceItemID: sourceItemId, + SourceListName: sourceListName, + SourceWebUrl: sourceWebUrl, + TargetItemID: targetItemID, + TargetListName: targetListName, + TargetWebUrl: targetWebUrl, + TryAddReverseLink: tryAddReverseLink, + }), + }); + }; + /** + * Adds a related item link from an item specified by list name and item id, to an item specified by url + * + * @param sourceListName The source list name or list id + * @param sourceItemId The source item id + * @param targetItemUrl The target item url + * @param tryAddReverseLink If set to true try to add the reverse link (will not return error if it fails) + */ + RelatedItemManagerImpl.prototype.addSingleLinkToUrl = function (sourceListName, sourceItemId, targetItemUrl, tryAddReverseLink) { + if (tryAddReverseLink === void 0) { tryAddReverseLink = false; } + var query = this.clone(RelatedItemManagerImpl, null, true); + query.concat(".AddSingleLinkToUrl"); + return query.post({ + body: JSON.stringify({ + SourceItemID: sourceItemId, + SourceListName: sourceListName, + TargetItemUrl: targetItemUrl, + TryAddReverseLink: tryAddReverseLink, + }), + }); + }; + /** + * Adds a related item link from an item specified by url, to an item specified by list name and item id + * + * @param sourceItemUrl The source item url + * @param targetListName The target list name or list id + * @param targetItemId The target item id + * @param tryAddReverseLink If set to true try to add the reverse link (will not return error if it fails) + */ + RelatedItemManagerImpl.prototype.addSingleLinkFromUrl = function (sourceItemUrl, targetListName, targetItemId, tryAddReverseLink) { + if (tryAddReverseLink === void 0) { tryAddReverseLink = false; } + var query = this.clone(RelatedItemManagerImpl, null, true); + query.concat(".AddSingleLinkFromUrl"); + return query.post({ + body: JSON.stringify({ + SourceItemUrl: sourceItemUrl, + TargetItemID: targetItemId, + TargetListName: targetListName, + TryAddReverseLink: tryAddReverseLink, + }), + }); + }; + RelatedItemManagerImpl.prototype.deleteSingleLink = function (sourceListName, sourceItemId, sourceWebUrl, targetListName, targetItemId, targetWebUrl, tryDeleteReverseLink) { + if (tryDeleteReverseLink === void 0) { tryDeleteReverseLink = false; } + var query = this.clone(RelatedItemManagerImpl, null, true); + query.concat(".DeleteSingleLink"); + return query.post({ + body: JSON.stringify({ + SourceItemID: sourceItemId, + SourceListName: sourceListName, + SourceWebUrl: sourceWebUrl, + TargetItemID: targetItemId, + TargetListName: targetListName, + TargetWebUrl: targetWebUrl, + TryDeleteReverseLink: tryDeleteReverseLink, + }), + }); + }; + return RelatedItemManagerImpl; +}(queryable_1.Queryable)); +exports.RelatedItemManagerImpl = RelatedItemManagerImpl; + + +/***/ }), +/* 47 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var queryable_1 = __webpack_require__(1); +/** + * Describes a collection of webhook subscriptions + * + */ +var Subscriptions = (function (_super) { + __extends(Subscriptions, _super); + /** + * Creates a new instance of the Subscriptions class + * + * @param baseUrl - The url or Queryable which forms the parent of this webhook subscriptions collection + */ + function Subscriptions(baseUrl, path) { + if (path === void 0) { path = "subscriptions"; } + return _super.call(this, baseUrl, path) || this; + } + /** + * Returns all the webhook subscriptions or the specified webhook subscription + * + */ + Subscriptions.prototype.getById = function (subscriptionId) { + var subscription = new Subscription(this); + subscription.concat("('" + subscriptionId + "')"); + return subscription; + }; + /** + * Create a new webhook subscription + * + */ + Subscriptions.prototype.add = function (notificationUrl, expirationDate, clientState) { + var _this = this; + var postBody = JSON.stringify({ + "clientState": clientState || "pnp-js-core-subscription", + "expirationDateTime": expirationDate, + "notificationUrl": notificationUrl, + "resource": this.toUrl(), + }); + return this.post({ body: postBody, headers: { "Content-Type": "application/json" } }).then(function (result) { + return { data: result, subscription: _this.getById(result.id) }; + }); + }; + return Subscriptions; +}(queryable_1.QueryableCollection)); +exports.Subscriptions = Subscriptions; +/** + * Describes a single webhook subscription instance + * + */ +var Subscription = (function (_super) { + __extends(Subscription, _super); + function Subscription() { + return _super !== null && _super.apply(this, arguments) || this; + } + /** + * Update a webhook subscription + * + */ + Subscription.prototype.update = function (expirationDate) { + var _this = this; + var postBody = JSON.stringify({ + "expirationDateTime": expirationDate, + }); + return this.patch({ body: postBody, headers: { "Content-Type": "application/json" } }).then(function (data) { + return { data: data, subscription: _this }; + }); + }; + /** + * Remove a webhook subscription + * + */ + Subscription.prototype.delete = function () { + return _super.prototype.delete.call(this); + }; + return Subscription; +}(queryable_1.QueryableInstance)); +exports.Subscription = Subscription; + + +/***/ }), +/* 48 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var queryable_1 = __webpack_require__(1); +var files_1 = __webpack_require__(51); +var odata_1 = __webpack_require__(2); +var UserProfileQuery = (function (_super) { + __extends(UserProfileQuery, _super); + function UserProfileQuery(baseUrl, path) { + if (path === void 0) { path = "_api/sp.userprofiles.peoplemanager"; } + var _this = _super.call(this, baseUrl, path) || this; + _this.profileLoader = new ProfileLoader(baseUrl); + return _this; + } + Object.defineProperty(UserProfileQuery.prototype, "editProfileLink", { + /** + * The URL of the edit profile page for the current user. + */ + get: function () { + return this.clone(UserProfileQuery, "EditProfileLink").getAs(odata_1.ODataValue()); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(UserProfileQuery.prototype, "isMyPeopleListPublic", { + /** + * A Boolean value that indicates whether the current user's People I'm Following list is public. + */ + get: function () { + return this.clone(UserProfileQuery, "IsMyPeopleListPublic").getAs(odata_1.ODataValue()); + }, + enumerable: true, + configurable: true + }); + /** + * A Boolean value that indicates whether the current user's People I'm Following list is public. + * + * @param loginName The account name of the user + */ + UserProfileQuery.prototype.amIFollowedBy = function (loginName) { + var q = this.clone(UserProfileQuery, "amifollowedby(@v)", true); + q.query.add("@v", "'" + encodeURIComponent(loginName) + "'"); + return q.get(); + }; + /** + * Checks whether the current user is following the specified user. + * + * @param loginName The account name of the user + */ + UserProfileQuery.prototype.amIFollowing = function (loginName) { + var q = this.clone(UserProfileQuery, "amifollowing(@v)", true); + q.query.add("@v", "'" + encodeURIComponent(loginName) + "'"); + return q.get(); + }; + /** + * Gets tags that the user is following. + * + * @param maxCount The maximum number of tags to get. + */ + UserProfileQuery.prototype.getFollowedTags = function (maxCount) { + if (maxCount === void 0) { maxCount = 20; } + return this.clone(UserProfileQuery, "getfollowedtags(" + maxCount + ")", true).get(); + }; + /** + * Gets the people who are following the specified user. + * + * @param loginName The account name of the user. + */ + UserProfileQuery.prototype.getFollowersFor = function (loginName) { + var q = this.clone(UserProfileQuery, "getfollowersfor(@v)", true); + q.query.add("@v", "'" + encodeURIComponent(loginName) + "'"); + return q.get(); + }; + Object.defineProperty(UserProfileQuery.prototype, "myFollowers", { + /** + * Gets the people who are following the current user. + * + */ + get: function () { + return new queryable_1.QueryableCollection(this, "getmyfollowers"); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(UserProfileQuery.prototype, "myProperties", { + /** + * Gets user properties for the current user. + * + */ + get: function () { + return new UserProfileQuery(this, "getmyproperties"); + }, + enumerable: true, + configurable: true + }); + /** + * Gets the people who the specified user is following. + * + * @param loginName The account name of the user. + */ + UserProfileQuery.prototype.getPeopleFollowedBy = function (loginName) { + var q = this.clone(UserProfileQuery, "getpeoplefollowedby(@v)", true); + q.query.add("@v", "'" + encodeURIComponent(loginName) + "'"); + return q.get(); + }; + /** + * Gets user properties for the specified user. + * + * @param loginName The account name of the user. + */ + UserProfileQuery.prototype.getPropertiesFor = function (loginName) { + var q = this.clone(UserProfileQuery, "getpropertiesfor(@v)", true); + q.query.add("@v", "'" + encodeURIComponent(loginName) + "'"); + return q.get(); + }; + Object.defineProperty(UserProfileQuery.prototype, "trendingTags", { + /** + * Gets the most popular tags. + * + */ + get: function () { + var q = this.clone(UserProfileQuery, null, true); + q.concat(".gettrendingtags"); + return q.get(); + }, + enumerable: true, + configurable: true + }); + /** + * Gets the specified user profile property for the specified user. + * + * @param loginName The account name of the user. + * @param propertyName The case-sensitive name of the property to get. + */ + UserProfileQuery.prototype.getUserProfilePropertyFor = function (loginName, propertyName) { + var q = this.clone(UserProfileQuery, "getuserprofilepropertyfor(accountname=@v, propertyname='" + propertyName + "')", true); + q.query.add("@v", "'" + encodeURIComponent(loginName) + "'"); + return q.get(); + }; + /** + * Removes the specified user from the user's list of suggested people to follow. + * + * @param loginName The account name of the user. + */ + UserProfileQuery.prototype.hideSuggestion = function (loginName) { + var q = this.clone(UserProfileQuery, "hidesuggestion(@v)", true); + q.query.add("@v", "'" + encodeURIComponent(loginName) + "'"); + return q.post(); + }; + /** + * Checks whether the first user is following the second user. + * + * @param follower The account name of the user who might be following followee. + * @param followee The account name of the user who might be followed. + */ + UserProfileQuery.prototype.isFollowing = function (follower, followee) { + var q = this.clone(UserProfileQuery, null, true); + q.concat(".isfollowing(possiblefolloweraccountname=@v, possiblefolloweeaccountname=@y)"); + q.query.add("@v", "'" + encodeURIComponent(follower) + "'"); + q.query.add("@y", "'" + encodeURIComponent(followee) + "'"); + return q.get(); + }; + /** + * Uploads and sets the user profile picture. Not supported for batching. + * + * @param profilePicSource Blob data representing the user's picture + */ + UserProfileQuery.prototype.setMyProfilePic = function (profilePicSource) { + var _this = this; + return new Promise(function (resolve, reject) { + files_1.readBlobAsArrayBuffer(profilePicSource).then(function (buffer) { + var request = new UserProfileQuery(_this, "setmyprofilepicture"); + request.post({ + body: String.fromCharCode.apply(null, new Uint16Array(buffer)), + }).then(function (_) { return resolve(); }); + }).catch(function (e) { return reject(e); }); + }); + }; + /** + * Provisions one or more users' personal sites. (My Site administrator on SharePoint Online only) + * + * @param emails The email addresses of the users to provision sites for + */ + UserProfileQuery.prototype.createPersonalSiteEnqueueBulk = function () { + var emails = []; + for (var _i = 0; _i < arguments.length; _i++) { + emails[_i] = arguments[_i]; + } + return this.profileLoader.createPersonalSiteEnqueueBulk(emails); + }; + Object.defineProperty(UserProfileQuery.prototype, "ownerUserProfile", { + /** + * Gets the user profile of the site owner. + * + */ + get: function () { + return this.profileLoader.ownerUserProfile; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(UserProfileQuery.prototype, "userProfile", { + /** + * Gets the user profile that corresponds to the current user. + */ + get: function () { + return this.profileLoader.userProfile; + }, + enumerable: true, + configurable: true + }); + /** + * Enqueues creating a personal site for this user, which can be used to share documents, web pages, and other files. + * + * @param interactiveRequest true if interactively (web) initiated request, or false if non-interactively (client) initiated request + */ + UserProfileQuery.prototype.createPersonalSite = function (interactiveRequest) { + if (interactiveRequest === void 0) { interactiveRequest = false; } + return this.profileLoader.createPersonalSite(interactiveRequest); + }; + /** + * Sets the privacy settings for this profile. + * + * @param share true to make all social data public; false to make all social data private. + */ + UserProfileQuery.prototype.shareAllSocialData = function (share) { + return this.profileLoader.shareAllSocialData(share); + }; + return UserProfileQuery; +}(queryable_1.QueryableInstance)); +exports.UserProfileQuery = UserProfileQuery; +var ProfileLoader = (function (_super) { + __extends(ProfileLoader, _super); + function ProfileLoader(baseUrl, path) { + if (path === void 0) { path = "_api/sp.userprofiles.profileloader.getprofileloader"; } + return _super.call(this, baseUrl, path) || this; + } + /** + * Provisions one or more users' personal sites. (My Site administrator on SharePoint Online only) + * + * @param emails The email addresses of the users to provision sites for + */ + ProfileLoader.prototype.createPersonalSiteEnqueueBulk = function (emails) { + return this.clone(ProfileLoader, "createpersonalsiteenqueuebulk").post({ + body: JSON.stringify({ "emailIDs": emails }), + }); + }; + Object.defineProperty(ProfileLoader.prototype, "ownerUserProfile", { + /** + * Gets the user profile of the site owner. + * + */ + get: function () { + var q = this.getParent(ProfileLoader, this.parentUrl, "_api/sp.userprofiles.profileloader.getowneruserprofile"); + if (this.hasBatch) { + q = q.inBatch(this.batch); + } + return q.postAs(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ProfileLoader.prototype, "userProfile", { + /** + * Gets the user profile that corresponds to the current user. + * + */ + get: function () { + return this.clone(ProfileLoader, "getuserprofile", true).postAs(); + }, + enumerable: true, + configurable: true + }); + /** + * Enqueues creating a personal site for this user, which can be used to share documents, web pages, and other files. + * + * @param interactiveRequest true if interactively (web) initiated request, or false if non-interactively (client) initiated request + */ + ProfileLoader.prototype.createPersonalSite = function (interactiveRequest) { + if (interactiveRequest === void 0) { interactiveRequest = false; } + return this.clone(ProfileLoader, "getuserprofile/createpersonalsiteenque(" + interactiveRequest + ")", true).post(); + }; + /** + * Sets the privacy settings for this profile. + * + * @param share true to make all social data public; false to make all social data private. + */ + ProfileLoader.prototype.shareAllSocialData = function (share) { + return this.clone(ProfileLoader, "getuserprofile/shareallsocialdata(" + share + ")", true).post(); + }; + return ProfileLoader; +}(queryable_1.Queryable)); + + +/***/ }), +/* 49 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var queryable_1 = __webpack_require__(1); +var util_1 = __webpack_require__(0); +/** + * Describes the views available in the current context + * + */ +var Views = (function (_super) { + __extends(Views, _super); + /** + * Creates a new instance of the Views class + * + * @param baseUrl The url or Queryable which forms the parent of this fields collection + */ + function Views(baseUrl, path) { + if (path === void 0) { path = "views"; } + return _super.call(this, baseUrl, path) || this; + } + /** + * Gets a view by guid id + * + * @param id The GUID id of the view + */ + Views.prototype.getById = function (id) { + var v = new View(this); + v.concat("('" + id + "')"); + return v; + }; + /** + * Gets a view by title (case-sensitive) + * + * @param title The case-sensitive title of the view + */ + Views.prototype.getByTitle = function (title) { + return new View(this, "getByTitle('" + title + "')"); + }; + /** + * Adds a new view to the collection + * + * @param title The new views's title + * @param personalView True if this is a personal view, otherwise false, default = false + * @param additionalSettings Will be passed as part of the view creation body + */ + /*tslint:disable max-line-length */ + Views.prototype.add = function (title, personalView, additionalSettings) { + var _this = this; + if (personalView === void 0) { personalView = false; } + if (additionalSettings === void 0) { additionalSettings = {}; } + var postBody = JSON.stringify(util_1.Util.extend({ + "PersonalView": personalView, + "Title": title, + "__metadata": { "type": "SP.View" }, + }, additionalSettings)); + return this.clone(Views, null, true).postAs({ body: postBody }).then(function (data) { + return { + data: data, + view: _this.getById(data.Id), + }; + }); + }; + return Views; +}(queryable_1.QueryableCollection)); +exports.Views = Views; +/** + * Describes a single View instance + * + */ +var View = (function (_super) { + __extends(View, _super); + function View() { + return _super !== null && _super.apply(this, arguments) || this; + } + Object.defineProperty(View.prototype, "fields", { + get: function () { + return new ViewFields(this); + }, + enumerable: true, + configurable: true + }); + /** + * Updates this view intance with the supplied properties + * + * @param properties A plain object hash of values to update for the view + */ + View.prototype.update = function (properties) { + var _this = this; + var postBody = JSON.stringify(util_1.Util.extend({ + "__metadata": { "type": "SP.View" }, + }, properties)); + return this.post({ + body: postBody, + headers: { + "X-HTTP-Method": "MERGE", + }, + }).then(function (data) { + return { + data: data, + view: _this, + }; + }); + }; + /** + * Delete this view + * + */ + View.prototype.delete = function () { + return this.post({ + headers: { + "X-HTTP-Method": "DELETE", + }, + }); + }; + /** + * Returns the list view as HTML. + * + */ + View.prototype.renderAsHtml = function () { + return this.clone(queryable_1.Queryable, "renderashtml", true).get(); + }; + return View; +}(queryable_1.QueryableInstance)); +exports.View = View; +var ViewFields = (function (_super) { + __extends(ViewFields, _super); + function ViewFields(baseUrl, path) { + if (path === void 0) { path = "viewfields"; } + return _super.call(this, baseUrl, path) || this; + } + /** + * Gets a value that specifies the XML schema that represents the collection. + */ + ViewFields.prototype.getSchemaXml = function () { + return this.clone(queryable_1.Queryable, "schemaxml", true).get(); + }; + /** + * Adds the field with the specified field internal name or display name to the collection. + * + * @param fieldTitleOrInternalName The case-sensitive internal name or display name of the field to add. + */ + ViewFields.prototype.add = function (fieldTitleOrInternalName) { + return this.clone(ViewFields, "addviewfield('" + fieldTitleOrInternalName + "')", true).post(); + }; + /** + * Moves the field with the specified field internal name to the specified position in the collection. + * + * @param fieldInternalName The case-sensitive internal name of the field to move. + * @param index The zero-based index of the new position for the field. + */ + ViewFields.prototype.move = function (fieldInternalName, index) { + return this.clone(ViewFields, "moveviewfieldto", true).post({ + body: JSON.stringify({ "field": fieldInternalName, "index": index }), + }); + }; + /** + * Removes all the fields from the collection. + */ + ViewFields.prototype.removeAll = function () { + return this.clone(ViewFields, "removeallviewfields", true).post(); + }; + /** + * Removes the field with the specified field internal name from the collection. + * + * @param fieldInternalName The case-sensitive internal name of the field to remove from the view. + */ + ViewFields.prototype.remove = function (fieldInternalName) { + return this.clone(ViewFields, "removeviewfield('" + fieldInternalName + "')", true).post(); + }; + return ViewFields; +}(queryable_1.QueryableCollection)); +exports.ViewFields = ViewFields; + + +/***/ }), +/* 50 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var queryable_1 = __webpack_require__(1); +var LimitedWebPartManager = (function (_super) { + __extends(LimitedWebPartManager, _super); + function LimitedWebPartManager() { + return _super !== null && _super.apply(this, arguments) || this; + } + Object.defineProperty(LimitedWebPartManager.prototype, "webparts", { + /** + * Gets the set of web part definitions contained by this web part manager + * + */ + get: function () { + return new WebPartDefinitions(this, "webparts"); + }, + enumerable: true, + configurable: true + }); + /** + * Exports a webpart definition + * + * @param id the GUID id of the definition to export + */ + LimitedWebPartManager.prototype.export = function (id) { + return this.clone(LimitedWebPartManager, "ExportWebPart", true).post({ + body: JSON.stringify({ webPartId: id }), + }); + }; + /** + * Imports a webpart + * + * @param xml webpart definition which must be valid XML in the .dwp or .webpart format + */ + LimitedWebPartManager.prototype.import = function (xml) { + return this.clone(LimitedWebPartManager, "ImportWebPart", true).post({ + body: JSON.stringify({ webPartXml: xml }), + }); + }; + return LimitedWebPartManager; +}(queryable_1.Queryable)); +exports.LimitedWebPartManager = LimitedWebPartManager; +var WebPartDefinitions = (function (_super) { + __extends(WebPartDefinitions, _super); + function WebPartDefinitions() { + return _super !== null && _super.apply(this, arguments) || this; + } + /** + * Gets a web part definition from the collection by id + * + * @param id GUID id of the web part definition to get + */ + WebPartDefinitions.prototype.getById = function (id) { + return new WebPartDefinition(this, "getbyid('" + id + "')"); + }; + return WebPartDefinitions; +}(queryable_1.QueryableCollection)); +exports.WebPartDefinitions = WebPartDefinitions; +var WebPartDefinition = (function (_super) { + __extends(WebPartDefinition, _super); + function WebPartDefinition() { + return _super !== null && _super.apply(this, arguments) || this; + } + Object.defineProperty(WebPartDefinition.prototype, "webpart", { + /** + * Gets the webpart information associated with this definition + */ + get: function () { + return new WebPart(this); + }, + enumerable: true, + configurable: true + }); + /** + * Removes a webpart from a page, all settings will be lost + */ + WebPartDefinition.prototype.delete = function () { + return this.clone(WebPartDefinition, "DeleteWebPart", true).post(); + }; + return WebPartDefinition; +}(queryable_1.QueryableInstance)); +exports.WebPartDefinition = WebPartDefinition; +var WebPart = (function (_super) { + __extends(WebPart, _super); + /** + * Creates a new instance of the WebPart class + * + * @param baseUrl The url or Queryable which forms the parent of this fields collection + * @param path Optional, if supplied will be appended to the supplied baseUrl + */ + function WebPart(baseUrl, path) { + if (path === void 0) { path = "webpart"; } + return _super.call(this, baseUrl, path) || this; + } + return WebPart; +}(queryable_1.QueryableInstance)); +exports.WebPart = WebPart; + + +/***/ }), +/* 51 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * Reads a blob as text + * + * @param blob The data to read + */ +function readBlobAsText(blob) { + return readBlobAs(blob, "string"); +} +exports.readBlobAsText = readBlobAsText; +/** + * Reads a blob into an array buffer + * + * @param blob The data to read + */ +function readBlobAsArrayBuffer(blob) { + return readBlobAs(blob, "buffer"); +} +exports.readBlobAsArrayBuffer = readBlobAsArrayBuffer; +/** + * Generic method to read blob's content + * + * @param blob The data to read + * @param mode The read mode + */ +function readBlobAs(blob, mode) { + return new Promise(function (resolve, reject) { + try { + var reader = new FileReader(); + reader.onload = function (e) { + resolve(e.target.result); + }; + switch (mode) { + case "string": + reader.readAsText(blob); + break; + case "buffer": + reader.readAsArrayBuffer(blob); + break; + } + } + catch (e) { + reject(e); + } + }); +} + + +/***/ }) +/******/ ]); +}); +//# sourceMappingURL=pnp.js.map \ No newline at end of file diff --git a/dist/pnp.js.map b/dist/pnp.js.map new file mode 100644 index 00000000..9845e900 --- /dev/null +++ b/dist/pnp.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap 20c7a391cecc98caef12","webpack:///./lib/utils/util.js","webpack:///./lib/sharepoint/queryable.js","webpack:///./lib/sharepoint/odata.js","webpack:///./lib/utils/exceptions.js","webpack:///./lib/configuration/pnplibconfig.js","webpack:///./lib/utils/logging.js","webpack:///./lib/collections/collections.js","webpack:///./lib/sharepoint/webs.js","webpack:///./lib/sharepoint/files.js","webpack:///./lib/sharepoint/folders.js","webpack:///./lib/sharepoint/items.js","webpack:///./lib/sharepoint/lists.js","webpack:///./lib/sharepoint/queryableshareable.js","webpack:///./lib/sharepoint/types.js","webpack:///./lib/utils/storage.js","webpack:///./lib/net/httpclient.js","webpack:///./lib/sharepoint/contenttypes.js","webpack:///./lib/sharepoint/roles.js","webpack:///./lib/sharepoint/sitegroups.js","webpack:///./lib/sharepoint/usercustomactions.js","webpack:///./lib/configuration/providers/cachingConfigurationProvider.js","webpack:///./lib/net/fetchclient.js","webpack:///./lib/sharepoint/caching.js","webpack:///./lib/sharepoint/features.js","webpack:///./lib/sharepoint/fields.js","webpack:///./lib/sharepoint/navigation.js","webpack:///./lib/sharepoint/queryablesecurable.js","webpack:///./lib/sharepoint/search.js","webpack:///./lib/sharepoint/searchsuggest.js","webpack:///./lib/sharepoint/site.js","webpack:///./lib/sharepoint/siteusers.js","webpack:///./lib/utils/decorators.js","webpack:///(webpack)/buildin/global.js","webpack:///./lib/configuration/configuration.js","webpack:///./lib/sharepoint/rest.js","webpack:///./lib/types/index.js","webpack:///./lib/configuration/providers/index.js","webpack:///./lib/configuration/providers/spListConfigurationProvider.js","webpack:///./lib/net/digestcache.js","webpack:///./lib/net/nodefetchclientbrowser.js","webpack:///./lib/net/sprequestexecutorclient.js","webpack:///./lib/pnp.js","webpack:///./lib/sharepoint/attachmentfiles.js","webpack:///./lib/sharepoint/forms.js","webpack:///./lib/sharepoint/index.js","webpack:///./lib/sharepoint/queryablerequest.js","webpack:///./lib/sharepoint/relateditems.js","webpack:///./lib/sharepoint/subscriptions.js","webpack:///./lib/sharepoint/userprofiles.js","webpack:///./lib/sharepoint/views.js","webpack:///./lib/sharepoint/webparts.js","webpack:///./lib/utils/files.js"],"names":[],"mappings":";;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA,mDAA2C,cAAc;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA;;;;;;;;8CChEA;AACA;AACA;AACA;AACA,4CAA4C,QAAQ;AACpD;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA,qCAAqC,qDAAqD,EAAE;AAC5F,kCAAkC,6DAA6D,EAAE;AACjG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,WAAW;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,qBAAqB;AAC1D;AACA;AACA;AACA;AACA,mDAAmD,kBAAkB,EAAE,gBAAgB,aAAa;AACpG;AACA,kCAAkC,yBAAyB,EAAE;AAC7D;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;;;;;;;;;ACzSA;AACA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,aAAa;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,qEAAqE,2CAA2C,EAAE;AAClH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,0BAA0B;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,sBAAsB;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,2CAA2C;AAC3E,oCAAoC,iBAAiB;AACrD,yFAAyF,yCAAyC,EAAE;AACpI;AACA;AACA,gCAAgC,2CAA2C;AAC3E,oCAAoC,iBAAiB;AACrD,yFAAyF,yCAAyC,EAAE;AACpI;AACA;AACA,qCAAqC,kBAAkB;AACvD,gCAAgC,2CAA2C;AAC3E,2FAA2F,yCAAyC,EAAE;AACtI;AACA;AACA,qCAAqC,kBAAkB;AACvD,gCAAgC,2CAA2C;AAC3E,2FAA2F,yCAAyC,EAAE;AACtI;AACA;AACA,sCAAsC,mBAAmB;AACzD,gCAAgC,2CAA2C;AAC3E,6FAA6F,yCAAyC,EAAE;AACxI;AACA;AACA,uCAAuC,oBAAoB;AAC3D,gCAAgC,2CAA2C;AAC3E,+FAA+F,yCAAyC,EAAE;AAC1I;AACA;AACA;AACA,iCAAiC,cAAc;AAC/C,yFAAyF,QAAQ;AACjG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,kBAAkB;AACrD;AACA;AACA;AACA,uBAAuB,iBAAiB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;ACzaA;AACA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA,mDAAmD,4CAA4C,EAAE,sBAAsB,kBAAkB,EAAE;AAC3I;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uEAAuE,UAAU,EAAE;AACnF;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,kCAAkC;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,yCAAyC,EAAE,oBAAoB,4BAA4B,EAAE;AAC9J;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sEAAsE;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D,mCAAmC,cAAc,gBAAgB;AAC5H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,iBAAiB,EAAE;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,mFAAmF,EAAE;AACzI,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,kBAAkB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+FAA+F,yCAAyC;AACxI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;AC5bA;AACA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD,8CAA8C,cAAc;AAC5D;AACA;AACA,0BAA0B,SAAS,sFAAsF;AACzH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,4EAA4E;AAC1G;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,6BAA6B,sFAAsF;AACnH;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,6BAA6B,sCAAsC;AACnE;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,6BAA6B,2EAA2E;AACxG;AACA;AACA,8BAA8B,sEAAsE;AACpG;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,6BAA6B,gEAAgE;AAC7F;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,6BAA6B,wDAAwD;AACrF;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,mCAAmC,8BAA8B;AACjE;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,6BAA6B,0GAA0G;AACvI;AACA;AACA,8BAA8B,sEAAsE;AACpG;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,6BAA6B,gDAAgD;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,6BAA6B,gDAAgD;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;ACnLA;AACA,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,wCAAwC;AACxF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC7FA;AACA,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,uDAAuD;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA,2CAA2C,4CAA4C,EAAE;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,0BAA0B;AACzD,6BAA6B,iCAAiC;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,0BAA0B;AACzD,6BAA6B,8CAA8C;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,wCAAwC,mCAAmC;AAC3E,qCAAqC,kBAAkB;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,+BAA+B,0BAA0B;AACzD,kBAAkB,iCAAiC;AACnD;AACA;AACA;AACA;AACA;AACA,oDAAoD,8BAA8B,EAAE;AACpF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;ACtNA;AACA,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,WAAW;AACzC,gCAAgC,aAAa;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;AC3GA;AACA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,4CAA4C,QAAQ;AACpD;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,kBAAkB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,kBAAkB;AACvD,kCAAkC,kBAAkB;AACpD,kCAAkC,iBAAiB;AACnD,4CAA4C,2BAA2B;AACvE,4CAA4C,yBAAyB;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,+BAA+B,sCAAsC;AACrE,aAAa;AACb,SAAS;AACT,mDAAmD,iBAAiB;AACpE;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,mBAAmB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,mBAAmB;AAC9C,SAAS;AACT;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,yDAAyD,iBAAiB;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,yDAAyD,iBAAiB;AAC1E;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,8DAA8D;AAC9D;AACA;AACA,kCAAkC,iBAAiB;AACnD,8CAA8C,6BAA6B;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,uCAAuC,8BAA8B,gBAAgB,2BAA2B,EAAE,UAAU;AAC5H,yDAAyD,iBAAiB;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,UAAU;AACxC,gCAAgC,aAAa;AAC7C;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;;;;;;;;ACrdA;AACA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,gBAAgB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,wBAAwB;AACjE;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,wBAAwB;AACjE,mCAAmC,sBAAsB;AACzD;AACA,8CAA8C,6BAA6B,EAAE,wBAAwB,6DAA6D,EAAE;AACpK;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,cAAc;AAC/C,qCAAqC,iCAAiC;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,wBAAwB;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,YAAY;AAC1C;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,cAAc;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,6CAA6C;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,2CAA2C;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,cAAc;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,cAAc;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6EAA6E,WAAW,qCAAqC,EAAE;AAC/H;AACA;AACA;AACA;AACA;AACA;AACA,6EAA6E,WAAW,qCAAqC,EAAE;AAC/H;AACA;AACA;AACA;AACA;AACA,+EAA+E,WAAW,qCAAqC,EAAE;AACjI;AACA;AACA;AACA;AACA;AACA,6EAA6E,WAAW,qCAAqC,EAAE;AAC/H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS,qBAAqB,wBAAwB,EAAE;AACxD;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,sBAAsB;AACzD;AACA,oCAAoC,aAAa;AACjD;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,0HAA0H;AAC5I;AACA;AACA;AACA,0BAA0B,gIAAgI;AAC1J;AACA,aAAa;AACb;AACA;AACA,uBAAuB,gBAAgB;AACvC;AACA;AACA;AACA,sBAAsB,0IAA0I;AAChK;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wFAAwF,iBAAiB,qBAAqB,sBAAsB,EAAE;AACtJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yHAAyH,iBAAiB,qBAAqB,sBAAsB,EAAE;AACvL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,iBAAiB;AACtC;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,mBAAmB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,YAAY;AAC1C;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,gEAAgE;AACjE;AACA;AACA;AACA;AACA,CAAC,mHAAmH;AACpH;AACA;AACA;AACA;AACA,CAAC,yEAAyE;AAC1E;AACA;AACA;AACA;AACA;AACA,CAAC,+EAA+E;;;;;;;;AC7gBhF;AACA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,kBAAkB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,2BAA2B,sBAAsB;AACjD,SAAS;AACT;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,YAAY;AAC1C;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD;;;;;;;;ACjNA;AACA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,gBAAgB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,iBAAiB;AACrD,oDAAoD,mCAAmC;AACvF;AACA;AACA;AACA,+BAA+B,6BAA6B;AAC5D,aAAa;AACb,iEAAiE,iBAAiB;AAClF;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,YAAY;AAC1C;AACA;AACA;AACA;AACA;AACA,mCAAmC,uCAAuC;AAC1E,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB,aAAa,sBAAsB,kBAAkB,EAAE;AACvD,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,YAAY;AAC1C;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,YAAY;AAC5C;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,+FAA+F;AAC/F;AACA;AACA,2CAA2C,2BAA2B;AACtE;AACA,kCAAkC,kEAAkE;AACpG,SAAS;AACT;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,gBAAgB,EAAE;AAC3D;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,SAAS;AACT;AACA;AACA,CAAC;;;;;;;;AClWD;AACA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,gBAAgB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,kBAAkB;AACvD,kCAAkC,gBAAgB;AAClD,4CAA4C,4BAA4B;AACxE,4CAA4C,yBAAyB;AACrE;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,oBAAoB;AAC/C,SAAS;AACT,0BAA0B,oCAAoC;AAC9D,oBAAoB;AACpB,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,kBAAkB;AACvD,kCAAkC,gBAAgB;AAClD,4CAA4C,4BAA4B;AACxE,4CAA4C,yBAAyB;AACrE;AACA;AACA;AACA;AACA,8EAA8E,kFAAkF;AAChK;AACA;AACA;AACA,6BAA6B,6EAA6E;AAC1G,iBAAiB,sBAAsB,kBAAkB,EAAE;AAC3D,aAAa;AACb;AACA,6BAA6B,iFAAiF;AAC9G,iBAAiB,sBAAsB,kBAAkB,EAAE;AAC3D,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,YAAY;AAC1C;AACA,2BAA2B,oBAAoB;AAC/C,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,YAAY;AAC1C;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,8BAA8B,gBAAgB,2BAA2B,EAAE,UAAU;AACvH,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA,kCAAkC,8BAA8B,gBAAgB,yBAAyB,EAAE,UAAU;AACrH,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,8BAA8B,gBAAgB,kCAAkC,EAAE,UAAU;AAC9H,SAAS,GAAG,sBAAsB,iBAAiB,EAAE,EAAE;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,sGAAsG,qCAAqC,EAAE;AAC7I;AACA;AACA,CAAC;AACD;;;;;;;;ACncA;AACA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,mBAAmB;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,sBAAsB;AAC7D,sCAAsC,sBAAsB;AAC5D;AACA;AACA;AACA;AACA,sEAAsE,SAAS,cAAc,EAAE;AAC/F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,gBAAgB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,kFAAkF,SAAS,cAAc,EAAE;AAC3G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,gBAAgB;AACjD;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,2BAA2B;AACvE;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,iBAAiB;AACnD,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,kDAAkD;AACnF;AACA,kCAAkC,mCAAmC;AACrE,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0HAA0H,yBAAyB,EAAE;AACrJ;AACA;AACA,2HAA2H,yBAAyB,EAAE;AACtJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,iCAAiC;AAC/D;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,sBAAsB;AAC5D,qDAAqD,qCAAqC;AAC1F,4CAA4C,2BAA2B;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,iDAAiD;AAC/E,oCAAoC,mBAAmB;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,iCAAiC;AAC/D,uCAAuC,sBAAsB;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,gBAAgB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,2BAA2B;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,iDAAiD;AAC/E,oCAAoC,mBAAmB;AACvD;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,gBAAgB;AACjD;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,2BAA2B;AACvE;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,iCAAiC;AAC/D,uCAAuC,sBAAsB;AAC7D;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,iCAAiC;AAC/D,uCAAuC,sBAAsB;AAC7D,yCAAyC,yBAAyB;AAClE;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD;;;;;;;;ACnjBA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,gEAAgE;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,6DAA6D;AAC9D;AACA;AACA;AACA;AACA,CAAC,oGAAoG;AACrG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,4EAA4E;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,mEAAmE;AACpE;AACA;AACA;AACA;AACA,CAAC,qFAAqF;AACtF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,yEAAyE;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,sEAAsE;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,uDAAuD;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,uDAAuD;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,4EAA4E;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,gEAAgE;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,6GAA6G;AAC9G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,qFAAqF;AACtF;AACA;AACA;AACA;AACA;AACA,CAAC,mHAAmH;AACpH;;;;;;;;AC/ZA;AACA,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,+BAA+B;AAC9D;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,yCAAyC;AACzE;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;ACxKA;AACA,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,cAAc;AAC/C,gDAAgD,gDAAgD;AAChG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6DAA6D,cAAc;AAC3E;AACA;AACA;AACA;AACA,yCAAyC,mBAAmB;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,cAAc;AAC/C;AACA;AACA;AACA,+CAA+C,sBAAsB;AACrE;AACA,sEAAsE,8BAA8B,EAAE;AACtG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,MAAM;AACpD;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,iCAAiC,cAAc;AAC/C,gDAAgD,gBAAgB;AAChE;AACA;AACA;AACA,iCAAiC,cAAc;AAC/C,gDAAgD,iBAAiB;AACjE;AACA;AACA;AACA,iCAAiC,cAAc;AAC/C,gDAAgD,kBAAkB;AAClE;AACA;AACA;AACA,iCAAiC,cAAc;AAC/C,gDAAgD,mBAAmB;AACnE;AACA;AACA;AACA;AACA,wCAAwC,kBAAkB;AAC1D;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,CAAC;AACD;AACA;;;;;;;;ACpHA;AACA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,uBAAuB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,iFAAiF,iBAAiB;AAClG;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,kBAAkB;AACvD,+BAA+B,gCAAgC;AAC/D,4CAA4C,yBAAyB;AACrE;AACA;AACA;AACA,mBAAmB,oBAAoB;AACvC;AACA,2BAA2B,2BAA2B;AACtD,SAAS;AACT,0BAA0B,iBAAiB;AAC3C,oBAAoB;AACpB,SAAS;AACT;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,qBAAqB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;ACtLA;AACA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,0BAA0B;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,0BAA0B;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,cAAc,6BAA6B,EAAE;AAC9F;AACA;AACA;AACA,yBAAyB,8BAA8B;AACvD,SAAS;AACT,0BAA0B,iBAAiB;AAC3C;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gEAAgE,cAAc,6BAA6B,EAAE;AAC7G;AACA;AACA,2BAA2B,8BAA8B;AACzD,SAAS;AACT;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,8BAA8B,iCAAiC;AAC/D;AACA;AACA;AACA,CAAC;AACD;;;;;;;;ACnOA;AACA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,sEAAsE;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,qBAAqB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D,gBAAgB,qBAAqB,EAAE;AACjG,0BAA0B,iBAAiB;AAC3C;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,gBAAgB,qBAAqB,EAAE;AAClF;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD;;;;;;;;AC9IA;AACA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA,8BAA8B,4BAA4B;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D,cAAc,gCAAgC,EAAE;AAC1G,0BAA0B,iBAAiB;AAC3C;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,gCAAgC;AAC3D,SAAS;AACT;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;ACvFA;AACA,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uBAAuB;AACtC,eAAe,OAAO;AACtB,eAAe,gBAAgB;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,2BAA2B;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;8CClEA;AACA,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;ACbA;AACA,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD;;;;;;;;AC5CA;AACA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,mBAAmB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,eAAe;AAC9C;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,eAAe;AAC9C;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,eAAe;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD;;;;;;;;ACrGA;AACA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,iBAAiB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT,oEAAoE,iBAAiB;AACrF;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,iBAAiB;AACrD;AACA;AACA,2BAA2B,oBAAoB;AAC/C,SAAS;AACT,sDAAsD,iBAAiB;AACvE;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,iBAAiB;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,sCAAsC;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,0DAA0D;AACjG,sCAAsC,+CAA+C;AACrF,+CAA+C,2BAA2B;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,wCAAwC,yBAAyB;AACjE;AACA;AACA,wCAAwC,yBAAyB;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,wBAAwB;AACjE;AACA;AACA;AACA;AACA;AACA,wCAAwC,yBAAyB;AACjE;AACA;AACA,wCAAwC,yBAAyB;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,mBAAmB;AAC1D,kCAAkC,iBAAiB;AACnD,wCAAwC,wBAAwB;AAChE,oCAAoC,oBAAoB;AACxD,wCAAwC,uBAAuB;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,sDAAsD;AAC7F;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,wBAAwB;AAC3D;AACA,2BAA2B,oBAAoB;AAC/C,SAAS;AACT;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;AClTA;AACA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,gBAAgB;AACjD;AACA;AACA;AACA;AACA,2BAA2B,8BAA8B;AACzD,SAAS;AACT,6DAA6D,iBAAiB;AAC9E;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,oEAAoE,iBAAiB;AACrF;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,8BAA8B;AACzD,SAAS;AACT;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,qBAAqB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA,CAAC;AACD;;;;;;;;AC7JA;AACA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,6BAA6B;AAC1E,wCAAwC,wBAAwB;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;ACpIA;AACA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,gCAAgC;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C;AAC9C;AACA;AACA,+CAA+C;AAC/C;AACA;AACA,sCAAsC;AACtC;AACA;AACA,sDAAsD;AACtD;AACA;AACA,6CAA6C;AAC7C;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA,+BAA+B,8DAA8D;AAC7F,aAAa;AACb,SAAS;AACT,0BAA0B,iBAAiB,wBAAwB,gCAAgC,EAAE;AACrG;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,2BAA2B;AAChF;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,oBAAoB;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,sEAAsE;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,oGAAoG;AACrG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,iGAAiG;;;;;;;;AC5JlG;AACA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA,8BAA8B,8BAA8B;AAC5D;AACA;AACA;AACA;AACA,oDAAoD,0CAA0C,EAAE;AAChG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;AC3EA;AACA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,oBAAoB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;AC5HA;AACA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,oBAAoB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,gBAAgB,oBAAoB,wBAAwB;AAC9F,SAAS,oBAAoB,wCAAwC,EAAE;AACvE;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,gBAAgB,oBAAoB,EAAE;AACjF;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,sBAAsB;AACpD;AACA;AACA;AACA,CAAC;AACD;;;;;;;;AC3JA;AACA,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,uBAAuB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;;;;;;;ACxBA;;AAEA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;;AAEA;AACA;AACA,4CAA4C;;AAE5C;;;;;;;;ACpBA;AACA,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,IAAI;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,eAAe;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,eAAe,uBAAuB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,gBAAgB,IAAI;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;AC3FA;AACA,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;AC7HA;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACpBA;AACA,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;;;;;;;;ACLA;AACA,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA;AACA,yCAAyC,4BAA4B;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,OAAO;AAC3B;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,oBAAoB,OAAO;AAC3B;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,gBAAgB,2BAA2B;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa,IAAI;AACjB,SAAS;AACT;AACA;AACA;AACA;AACA,gBAAgB,6BAA6B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;ACxEA;AACA,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,kCAAkC,oBAAoB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C;AAC5C,kDAAkD,cAAc;AAChE,aAAa;AACb;AACA,SAAS;AACT;AACA,6DAA6D,mCAAmC,EAAE;AAClG,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;ACxDA;AACA,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;AClBA;AACA,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,qEAAqE,qBAAqB;AAC1F;AACA;AACA,qEAAqE,gCAAgC;AACrG;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD;;;;;;;;ACxEA;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACxEA;AACA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,0BAA0B;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,gCAAgC;AACpF;AACA,SAAS,EAAE,EAAE,EAAE,EAAE;AACjB;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS,qBAAqB,kCAAkC,EAAE;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,YAAY;AAC1C;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,CAAC;AACD;;;;;;;;ACxIA;AACA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,gBAAgB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;ACpDA;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACxDA;AACA;AACA;AACA;AACA,4CAA4C,QAAQ;AACpD;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,iCAAiC,gBAAgB,EAAE,EAAE,EAAE;AAC1G,8BAA8B,0CAA0C,EAAE;AAC1E;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,mBAAmB;AAClD;AACA;AACA;AACA;AACA,4BAA4B,uBAAuB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sFAAsF;AACtF;AACA;AACA,aAAa;AACb;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kGAAkG;AAClG;AACA;AACA,yBAAyB;AACzB;AACA,6FAA6F,qBAAqB,EAAE;AACpH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,mDAAmD,EAAE;AACvG;AACA;AACA;AACA;AACA;AACA,mEAAmE,GAAG,uBAAuB;AAC7F;AACA,+CAA+C,uCAAuC,EAAE;AACxF,6CAA6C,mDAAmD,EAAE;AAClG,0CAA0C,qBAAqB,EAAE;AACjE,yCAAyC,kBAAkB,EAAE;AAC7D;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sFAAsF;AACtF;AACA;AACA,aAAa;AACb;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC/LA;AACA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA,8BAA8B,qCAAqC;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,2CAA2C,2BAA2B;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,2BAA2B;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,2BAA2B;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,8CAA8C,8BAA8B;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,CAAC;AACD;;;;;;;;AC7HA;AACA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,wBAAwB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,0BAA0B,2BAA2B,qCAAqC,EAAE;AAC5F,oBAAoB;AACpB,SAAS;AACT;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,2BAA2B,2BAA2B,qCAAqC,EAAE;AAC7F,oBAAoB;AACpB,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;ACvFA;AACA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,6CAA6C;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,eAAe;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,qBAAqB,kBAAkB,EAAE;AAC1D,aAAa,sBAAsB,kBAAkB,EAAE;AACvD,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,4BAA4B;AACxE;AACA;AACA;AACA;AACA;AACA,wDAAwD;AACxD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,8BAA8B,8DAA8D;AAC5F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,qBAAqB;AACvD,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,4BAA4B;AACxE;AACA;AACA;AACA;AACA;AACA,wDAAwD;AACxD;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;AC5SD;AACA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,gBAAgB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,sBAAsB;AAC5D,4CAA4C,yBAAyB;AACrE;AACA;AACA;AACA,2BAA2B,oBAAoB;AAC/C,SAAS;AACT,qDAAqD,iBAAiB;AACtE;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,oBAAoB;AAC/C,SAAS;AACT;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,8BAA8B,qBAAqB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,6CAA6C;AAC/E,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;ACpLA;AACA;AACA;AACA,UAAU,gBAAgB,sCAAsC,iBAAiB,EAAE;AACnF,yBAAyB,uDAAuD;AAChF;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,gBAAgB;AAClD,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,kBAAkB;AACpD,SAAS;AACT;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,kBAAkB;AAChD;AACA;AACA;AACA,CAAC;AACD;;;;;;;;AC1GA;AACA,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL","file":"pnp.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"$pnp\"] = factory();\n\telse\n\t\troot[\"$pnp\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// identity function for calling harmony imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/assets/\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 41);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 20c7a391cecc98caef12","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar decorators_1 = require(\"./decorators\");\nvar pnplibconfig_1 = require(\"../configuration/pnplibconfig\");\nvar Util = (function () {\n function Util() {\n }\n /**\n * Gets a callback function which will maintain context across async calls.\n * Allows for the calling pattern getCtxCallback(thisobj, method, methodarg1, methodarg2, ...)\n *\n * @param context The object that will be the 'this' value in the callback\n * @param method The method to which we will apply the context and parameters\n * @param params Optional, additional arguments to supply to the wrapped method when it is invoked\n */\n Util.getCtxCallback = function (context, method) {\n var params = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n params[_i - 2] = arguments[_i];\n }\n return function () {\n method.apply(context, params);\n };\n };\n /**\n * Tests if a url param exists\n *\n * @param name The name of the url paramter to check\n */\n Util.urlParamExists = function (name) {\n name = name.replace(/[\\[]/, \"\\\\[\").replace(/[\\]]/, \"\\\\]\");\n var regex = new RegExp(\"[\\\\?&]\" + name + \"=([^&#]*)\");\n return regex.test(location.search);\n };\n /**\n * Gets a url param value by name\n *\n * @param name The name of the paramter for which we want the value\n */\n Util.getUrlParamByName = function (name) {\n name = name.replace(/[\\[]/, \"\\\\[\").replace(/[\\]]/, \"\\\\]\");\n var regex = new RegExp(\"[\\\\?&]\" + name + \"=([^&#]*)\");\n var results = regex.exec(location.search);\n return results == null ? \"\" : decodeURIComponent(results[1].replace(/\\+/g, \" \"));\n };\n /**\n * Gets a url param by name and attempts to parse a bool value\n *\n * @param name The name of the paramter for which we want the boolean value\n */\n Util.getUrlParamBoolByName = function (name) {\n var p = this.getUrlParamByName(name);\n var isFalse = (p === \"\" || /false|0/i.test(p));\n return !isFalse;\n };\n /**\n * Inserts the string s into the string target as the index specified by index\n *\n * @param target The string into which we will insert s\n * @param index The location in target to insert s (zero based)\n * @param s The string to insert into target at position index\n */\n Util.stringInsert = function (target, index, s) {\n if (index > 0) {\n return target.substring(0, index) + s + target.substring(index, target.length);\n }\n return s + target;\n };\n /**\n * Adds a value to a date\n *\n * @param date The date to which we will add units, done in local time\n * @param interval The name of the interval to add, one of: ['year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second']\n * @param units The amount to add to date of the given interval\n *\n * http://stackoverflow.com/questions/1197928/how-to-add-30-minutes-to-a-javascript-date-object\n */\n Util.dateAdd = function (date, interval, units) {\n var ret = new Date(date.toLocaleString()); // don't change original date\n switch (interval.toLowerCase()) {\n case \"year\":\n ret.setFullYear(ret.getFullYear() + units);\n break;\n case \"quarter\":\n ret.setMonth(ret.getMonth() + 3 * units);\n break;\n case \"month\":\n ret.setMonth(ret.getMonth() + units);\n break;\n case \"week\":\n ret.setDate(ret.getDate() + 7 * units);\n break;\n case \"day\":\n ret.setDate(ret.getDate() + units);\n break;\n case \"hour\":\n ret.setTime(ret.getTime() + units * 3600000);\n break;\n case \"minute\":\n ret.setTime(ret.getTime() + units * 60000);\n break;\n case \"second\":\n ret.setTime(ret.getTime() + units * 1000);\n break;\n default:\n ret = undefined;\n break;\n }\n return ret;\n };\n /**\n * Loads a stylesheet into the current page\n *\n * @param path The url to the stylesheet\n * @param avoidCache If true a value will be appended as a query string to avoid browser caching issues\n */\n Util.loadStylesheet = function (path, avoidCache) {\n if (avoidCache) {\n path += \"?\" + encodeURIComponent((new Date()).getTime().toString());\n }\n var head = document.getElementsByTagName(\"head\");\n if (head.length > 0) {\n var e = document.createElement(\"link\");\n head[0].appendChild(e);\n e.setAttribute(\"type\", \"text/css\");\n e.setAttribute(\"rel\", \"stylesheet\");\n e.setAttribute(\"href\", path);\n }\n };\n /**\n * Combines an arbitrary set of paths ensuring that the slashes are normalized\n *\n * @param paths 0 to n path parts to combine\n */\n Util.combinePaths = function () {\n var paths = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n paths[_i] = arguments[_i];\n }\n return paths\n .filter(function (path) { return typeof path !== \"undefined\" && path !== null; })\n .map(function (path) { return path.replace(/^[\\\\|\\/]/, \"\").replace(/[\\\\|\\/]$/, \"\"); })\n .join(\"/\")\n .replace(/\\\\/g, \"/\");\n };\n /**\n * Gets a random string of chars length\n *\n * @param chars The length of the random string to generate\n */\n Util.getRandomString = function (chars) {\n var text = new Array(chars);\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n for (var i = 0; i < chars; i++) {\n text[i] = possible.charAt(Math.floor(Math.random() * possible.length));\n }\n return text.join(\"\");\n };\n /**\n * Gets a random GUID value\n *\n * http://stackoverflow.com/questions/105034/create-guid-uuid-in-javascript\n */\n /* tslint:disable no-bitwise */\n Util.getGUID = function () {\n var d = new Date().getTime();\n var guid = \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g, function (c) {\n var r = (d + Math.random() * 16) % 16 | 0;\n d = Math.floor(d / 16);\n return (c === \"x\" ? r : (r & 0x3 | 0x8)).toString(16);\n });\n return guid;\n };\n /* tslint:enable */\n /**\n * Determines if a given value is a function\n *\n * @param candidateFunction The thing to test for being a function\n */\n Util.isFunction = function (candidateFunction) {\n return typeof candidateFunction === \"function\";\n };\n /**\n * @returns whether the provided parameter is a JavaScript Array or not.\n */\n Util.isArray = function (array) {\n if (Array.isArray) {\n return Array.isArray(array);\n }\n return array && typeof array.length === \"number\" && array.constructor === Array;\n };\n /**\n * Determines if a string is null or empty or undefined\n *\n * @param s The string to test\n */\n Util.stringIsNullOrEmpty = function (s) {\n return typeof s === \"undefined\" || s === null || s === \"\";\n };\n /**\n * Provides functionality to extend the given object by doing a shallow copy\n *\n * @param target The object to which properties will be copied\n * @param source The source object from which properties will be copied\n * @param noOverwrite If true existing properties on the target are not overwritten from the source\n *\n */\n Util.extend = function (target, source, noOverwrite) {\n if (noOverwrite === void 0) { noOverwrite = false; }\n if (source === null || typeof source === \"undefined\") {\n return target;\n }\n // ensure we don't overwrite things we don't want overwritten\n var check = noOverwrite ? function (o, i) { return !(i in o); } : function () { return true; };\n return Object.getOwnPropertyNames(source)\n .filter(function (v) { return check(target, v); })\n .reduce(function (t, v) {\n t[v] = source[v];\n return t;\n }, target);\n };\n /**\n * Determines if a given url is absolute\n *\n * @param url The url to check to see if it is absolute\n */\n Util.isUrlAbsolute = function (url) {\n return /^https?:\\/\\/|^\\/\\//i.test(url);\n };\n /**\n * Attempts to make the supplied relative url absolute based on the _spPageContextInfo object, if available\n *\n * @param url The relative url to make absolute\n */\n Util.makeUrlAbsolute = function (url) {\n if (Util.isUrlAbsolute(url)) {\n return url;\n }\n if (typeof global._spPageContextInfo !== \"undefined\") {\n if (global._spPageContextInfo.hasOwnProperty(\"webAbsoluteUrl\")) {\n return Util.combinePaths(global._spPageContextInfo.webAbsoluteUrl, url);\n }\n else if (global._spPageContextInfo.hasOwnProperty(\"webServerRelativeUrl\")) {\n return Util.combinePaths(global._spPageContextInfo.webServerRelativeUrl, url);\n }\n }\n else {\n return url;\n }\n };\n /**\n * Ensures that a given url is absolute for the current web based on context\n *\n * @param candidateUrl The url to make absolute\n *\n */\n Util.toAbsoluteUrl = function (candidateUrl) {\n return new Promise(function (resolve) {\n if (Util.isUrlAbsolute(candidateUrl)) {\n // if we are already absolute, then just return the url\n return resolve(candidateUrl);\n }\n if (pnplibconfig_1.RuntimeConfig.baseUrl !== null) {\n // base url specified either with baseUrl of spfxContext config property\n return resolve(Util.combinePaths(pnplibconfig_1.RuntimeConfig.baseUrl, candidateUrl));\n }\n if (typeof global._spPageContextInfo !== \"undefined\") {\n // operating in classic pages\n if (global._spPageContextInfo.hasOwnProperty(\"webAbsoluteUrl\")) {\n return resolve(Util.combinePaths(global._spPageContextInfo.webAbsoluteUrl, candidateUrl));\n }\n else if (global._spPageContextInfo.hasOwnProperty(\"webServerRelativeUrl\")) {\n return resolve(Util.combinePaths(global._spPageContextInfo.webServerRelativeUrl, candidateUrl));\n }\n }\n // does window.location exist and have _layouts in it?\n if (typeof global.location !== \"undefined\") {\n var index = global.location.toString().toLowerCase().indexOf(\"/_layouts/\");\n if (index > 0) {\n // we are likely in the workbench in /_layouts/\n return resolve(Util.combinePaths(global.location.toString().substr(0, index), candidateUrl));\n }\n }\n return resolve(candidateUrl);\n });\n };\n return Util;\n}());\n__decorate([\n decorators_1.deprecated(\"The Util.makeUrlAbsolute method is deprecated and will be removed from future releases. Use Util.toAbsoluteUrl instead\")\n], Util, \"makeUrlAbsolute\", null);\nexports.Util = Util;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/utils/util.js\n// module id = 0\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar util_1 = require(\"../utils/util\");\nvar collections_1 = require(\"../collections/collections\");\nvar odata_1 = require(\"./odata\");\nvar pnplibconfig_1 = require(\"../configuration/pnplibconfig\");\nvar exceptions_1 = require(\"../utils/exceptions\");\nvar queryablerequest_1 = require(\"./queryablerequest\");\nvar logging_1 = require(\"../utils/logging\");\n/**\n * Queryable Base Class\n *\n */\nvar Queryable = (function () {\n /**\n * Creates a new instance of the Queryable class\n *\n * @constructor\n * @param baseUrl A string or Queryable that should form the base part of the url\n *\n */\n function Queryable(baseUrl, path) {\n this._query = new collections_1.Dictionary();\n this._batch = null;\n if (typeof baseUrl === \"string\") {\n // we need to do some extra parsing to get the parent url correct if we are\n // being created from just a string.\n var urlStr = baseUrl;\n if (util_1.Util.isUrlAbsolute(urlStr) || urlStr.lastIndexOf(\"/\") < 0) {\n this._parentUrl = urlStr;\n this._url = util_1.Util.combinePaths(urlStr, path);\n }\n else if (urlStr.lastIndexOf(\"/\") > urlStr.lastIndexOf(\"(\")) {\n // .../items(19)/fields\n var index = urlStr.lastIndexOf(\"/\");\n this._parentUrl = urlStr.slice(0, index);\n path = util_1.Util.combinePaths(urlStr.slice(index), path);\n this._url = util_1.Util.combinePaths(this._parentUrl, path);\n }\n else {\n // .../items(19)\n var index = urlStr.lastIndexOf(\"(\");\n this._parentUrl = urlStr.slice(0, index);\n this._url = util_1.Util.combinePaths(urlStr, path);\n }\n }\n else {\n var q = baseUrl;\n this._parentUrl = q._url;\n var target = q._query.get(\"@target\");\n if (target !== null) {\n this._query.add(\"@target\", target);\n }\n this._url = util_1.Util.combinePaths(this._parentUrl, path);\n }\n }\n /**\n * Directly concatonates the supplied string to the current url, not normalizing \"/\" chars\n *\n * @param pathPart The string to concatonate to the url\n */\n Queryable.prototype.concat = function (pathPart) {\n this._url += pathPart;\n };\n /**\n * Appends the given string and normalizes \"/\" chars\n *\n * @param pathPart The string to append\n */\n Queryable.prototype.append = function (pathPart) {\n this._url = util_1.Util.combinePaths(this._url, pathPart);\n };\n /**\n * Blocks a batch call from occuring, MUST be cleared by calling the returned function\n */\n Queryable.prototype.addBatchDependency = function () {\n if (this.hasBatch) {\n return this._batch.addDependency();\n }\n return function () { return null; };\n };\n Object.defineProperty(Queryable.prototype, \"hasBatch\", {\n /**\n * Indicates if the current query has a batch associated\n *\n */\n get: function () {\n return this._batch !== null;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Queryable.prototype, \"batch\", {\n /**\n * The batch currently associated with this query or null\n *\n */\n get: function () {\n return this.hasBatch ? this._batch : null;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Queryable.prototype, \"parentUrl\", {\n /**\n * Gets the parent url used when creating this instance\n *\n */\n get: function () {\n return this._parentUrl;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Queryable.prototype, \"query\", {\n /**\n * Provides access to the query builder for this url\n *\n */\n get: function () {\n return this._query;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Creates a new instance of the supplied factory and extends this into that new instance\n *\n * @param factory constructor for the new queryable\n */\n Queryable.prototype.as = function (factory) {\n var o = new factory(this._url, null);\n return util_1.Util.extend(o, this, true);\n };\n /**\n * Adds this query to the supplied batch\n *\n * @example\n * ```\n *\n * let b = pnp.sp.createBatch();\n * pnp.sp.web.inBatch(b).get().then(...);\n * b.execute().then(...)\n * ```\n */\n Queryable.prototype.inBatch = function (batch) {\n if (this._batch !== null) {\n throw new exceptions_1.AlreadyInBatchException();\n }\n this._batch = batch;\n return this;\n };\n /**\n * Enables caching for this request\n *\n * @param options Defines the options used when caching this request\n */\n Queryable.prototype.usingCaching = function (options) {\n if (!pnplibconfig_1.RuntimeConfig.globalCacheDisable) {\n this._useCaching = true;\n this._cachingOptions = options;\n }\n return this;\n };\n /**\n * Gets the currentl url, made absolute based on the availability of the _spPageContextInfo object\n *\n */\n Queryable.prototype.toUrl = function () {\n return this._url;\n };\n /**\n * Gets the full url with query information\n *\n */\n Queryable.prototype.toUrlAndQuery = function () {\n var aliasedParams = new collections_1.Dictionary();\n var url = this.toUrl().replace(/'!(@.*?)::(.*?)'/ig, function (match, labelName, value) {\n logging_1.Logger.write(\"Rewriting aliased parameter from match \" + match + \" to label: \" + labelName + \" value: \" + value, logging_1.LogLevel.Verbose);\n aliasedParams.add(labelName, \"'\" + value + \"'\");\n return labelName;\n });\n // inlude our explicitly set query string params\n aliasedParams.merge(this._query);\n if (aliasedParams.count() > 0) {\n url += \"?\" + aliasedParams.getKeys().map(function (key) { return key + \"=\" + aliasedParams.get(key); }).join(\"&\");\n }\n return url;\n };\n /**\n * Gets a parent for this instance as specified\n *\n * @param factory The contructor for the class to create\n */\n Queryable.prototype.getParent = function (factory, baseUrl, path, batch) {\n if (baseUrl === void 0) { baseUrl = this.parentUrl; }\n var parent = new factory(baseUrl, path);\n var target = this.query.get(\"@target\");\n if (target !== null) {\n parent.query.add(\"@target\", target);\n }\n if (typeof batch !== \"undefined\") {\n parent = parent.inBatch(batch);\n }\n return parent;\n };\n /**\n * Clones this queryable into a new queryable instance of T\n * @param factory Constructor used to create the new instance\n * @param additionalPath Any additional path to include in the clone\n * @param includeBatch If true this instance's batch will be added to the cloned instance\n */\n Queryable.prototype.clone = function (factory, additionalPath, includeBatch) {\n if (includeBatch === void 0) { includeBatch = false; }\n var clone = new factory(this, additionalPath);\n var target = this.query.get(\"@target\");\n if (target !== null) {\n clone.query.add(\"@target\", target);\n }\n if (includeBatch && this.hasBatch) {\n clone = clone.inBatch(this.batch);\n }\n return clone;\n };\n /**\n * Executes the currently built request\n *\n * @param parser Allows you to specify a parser to handle the result\n * @param getOptions The options used for this request\n */\n Queryable.prototype.get = function (parser, getOptions) {\n if (parser === void 0) { parser = new odata_1.ODataDefaultParser(); }\n if (getOptions === void 0) { getOptions = {}; }\n return this.toRequestContext(\"GET\", getOptions, parser).then(function (context) { return queryablerequest_1.pipe(context); });\n };\n Queryable.prototype.getAs = function (parser, getOptions) {\n if (parser === void 0) { parser = new odata_1.ODataDefaultParser(); }\n if (getOptions === void 0) { getOptions = {}; }\n return this.toRequestContext(\"GET\", getOptions, parser).then(function (context) { return queryablerequest_1.pipe(context); });\n };\n Queryable.prototype.post = function (postOptions, parser) {\n if (postOptions === void 0) { postOptions = {}; }\n if (parser === void 0) { parser = new odata_1.ODataDefaultParser(); }\n return this.toRequestContext(\"POST\", postOptions, parser).then(function (context) { return queryablerequest_1.pipe(context); });\n };\n Queryable.prototype.postAs = function (postOptions, parser) {\n if (postOptions === void 0) { postOptions = {}; }\n if (parser === void 0) { parser = new odata_1.ODataDefaultParser(); }\n return this.toRequestContext(\"POST\", postOptions, parser).then(function (context) { return queryablerequest_1.pipe(context); });\n };\n Queryable.prototype.patch = function (patchOptions, parser) {\n if (patchOptions === void 0) { patchOptions = {}; }\n if (parser === void 0) { parser = new odata_1.ODataDefaultParser(); }\n return this.toRequestContext(\"PATCH\", patchOptions, parser).then(function (context) { return queryablerequest_1.pipe(context); });\n };\n Queryable.prototype.delete = function (deleteOptions, parser) {\n if (deleteOptions === void 0) { deleteOptions = {}; }\n if (parser === void 0) { parser = new odata_1.ODataDefaultParser(); }\n return this.toRequestContext(\"DELETE\", deleteOptions, parser).then(function (context) { return queryablerequest_1.pipe(context); });\n };\n Queryable.prototype.toRequestContext = function (verb, options, parser) {\n var _this = this;\n if (options === void 0) { options = {}; }\n var dependencyDispose = this.hasBatch ? this.addBatchDependency() : function () { return; };\n return util_1.Util.toAbsoluteUrl(this.toUrlAndQuery()).then(function (url) {\n // build our request context\n var context = {\n batch: _this._batch,\n batchDependency: dependencyDispose,\n cachingOptions: _this._cachingOptions,\n isBatched: _this.hasBatch,\n isCached: _this._useCaching,\n options: options,\n parser: parser,\n requestAbsoluteUrl: url,\n requestId: util_1.Util.getGUID(),\n verb: verb,\n };\n return context;\n });\n };\n return Queryable;\n}());\nexports.Queryable = Queryable;\n/**\n * Represents a REST collection which can be filtered, paged, and selected\n *\n */\nvar QueryableCollection = (function (_super) {\n __extends(QueryableCollection, _super);\n function QueryableCollection() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Filters the returned collection (https://msdn.microsoft.com/en-us/library/office/fp142385.aspx#bk_supported)\n *\n * @param filter The string representing the filter query\n */\n QueryableCollection.prototype.filter = function (filter) {\n this._query.add(\"$filter\", filter);\n return this;\n };\n /**\n * Choose which fields to return\n *\n * @param selects One or more fields to return\n */\n QueryableCollection.prototype.select = function () {\n var selects = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n selects[_i] = arguments[_i];\n }\n if (selects.length > 0) {\n this._query.add(\"$select\", selects.join(\",\"));\n }\n return this;\n };\n /**\n * Expands fields such as lookups to get additional data\n *\n * @param expands The Fields for which to expand the values\n */\n QueryableCollection.prototype.expand = function () {\n var expands = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n expands[_i] = arguments[_i];\n }\n if (expands.length > 0) {\n this._query.add(\"$expand\", expands.join(\",\"));\n }\n return this;\n };\n /**\n * Orders based on the supplied fields ascending\n *\n * @param orderby The name of the field to sort on\n * @param ascending If false DESC is appended, otherwise ASC (default)\n */\n QueryableCollection.prototype.orderBy = function (orderBy, ascending) {\n if (ascending === void 0) { ascending = true; }\n var keys = this._query.getKeys();\n var query = [];\n var asc = ascending ? \" asc\" : \" desc\";\n for (var i = 0; i < keys.length; i++) {\n if (keys[i] === \"$orderby\") {\n query.push(this._query.get(\"$orderby\"));\n break;\n }\n }\n query.push(\"\" + orderBy + asc);\n this._query.add(\"$orderby\", query.join(\",\"));\n return this;\n };\n /**\n * Skips the specified number of items\n *\n * @param skip The number of items to skip\n */\n QueryableCollection.prototype.skip = function (skip) {\n this._query.add(\"$skip\", skip.toString());\n return this;\n };\n /**\n * Limits the query to only return the specified number of items\n *\n * @param top The query row limit\n */\n QueryableCollection.prototype.top = function (top) {\n this._query.add(\"$top\", top.toString());\n return this;\n };\n return QueryableCollection;\n}(Queryable));\nexports.QueryableCollection = QueryableCollection;\n/**\n * Represents an instance that can be selected\n *\n */\nvar QueryableInstance = (function (_super) {\n __extends(QueryableInstance, _super);\n function QueryableInstance() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Choose which fields to return\n *\n * @param selects One or more fields to return\n */\n QueryableInstance.prototype.select = function () {\n var selects = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n selects[_i] = arguments[_i];\n }\n if (selects.length > 0) {\n this._query.add(\"$select\", selects.join(\",\"));\n }\n return this;\n };\n /**\n * Expands fields such as lookups to get additional data\n *\n * @param expands The Fields for which to expand the values\n */\n QueryableInstance.prototype.expand = function () {\n var expands = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n expands[_i] = arguments[_i];\n }\n if (expands.length > 0) {\n this._query.add(\"$expand\", expands.join(\",\"));\n }\n return this;\n };\n return QueryableInstance;\n}(Queryable));\nexports.QueryableInstance = QueryableInstance;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/sharepoint/queryable.js\n// module id = 1\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar util_1 = require(\"../utils/util\");\nvar logging_1 = require(\"../utils/logging\");\nvar httpclient_1 = require(\"../net/httpclient\");\nvar pnplibconfig_1 = require(\"../configuration/pnplibconfig\");\nvar exceptions_1 = require(\"../utils/exceptions\");\nvar exceptions_2 = require(\"../utils/exceptions\");\nfunction extractOdataId(candidate) {\n if (candidate.hasOwnProperty(\"odata.id\")) {\n return candidate[\"odata.id\"];\n }\n else if (candidate.hasOwnProperty(\"__metadata\") && candidate.__metadata.hasOwnProperty(\"id\")) {\n return candidate.__metadata.id;\n }\n else {\n throw new exceptions_1.ODataIdException(candidate);\n }\n}\nexports.extractOdataId = extractOdataId;\nvar ODataParserBase = (function () {\n function ODataParserBase() {\n }\n ODataParserBase.prototype.parse = function (r) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n if (_this.handleError(r, reject)) {\n if ((r.headers.has(\"Content-Length\") && parseFloat(r.headers.get(\"Content-Length\")) === 0) || r.status === 204) {\n resolve({});\n }\n else {\n r.json().then(function (json) { return resolve(_this.parseODataJSON(json)); }).catch(function (e) { return reject(e); });\n }\n }\n });\n };\n ODataParserBase.prototype.handleError = function (r, reject) {\n if (!r.ok) {\n r.json().then(function (json) {\n // include the headers as they contain diagnostic information\n var data = {\n responseBody: json,\n responseHeaders: r.headers,\n };\n reject(new exceptions_2.ProcessHttpClientResponseException(r.status, r.statusText, data));\n }).catch(function (e) {\n // we failed to read the body - possibly it is empty. Let's report the original status that caused\n // the request to fail and log the error with parsing the body if anyone needs it for debugging\n logging_1.Logger.log({\n data: e,\n level: logging_1.LogLevel.Warning,\n message: \"There was an error parsing the error response body. See data for details.\",\n });\n // include the headers as they contain diagnostic information\n var data = {\n responseBody: \"[[body not available]]\",\n responseHeaders: r.headers,\n };\n reject(new exceptions_2.ProcessHttpClientResponseException(r.status, r.statusText, data));\n });\n }\n return r.ok;\n };\n ODataParserBase.prototype.parseODataJSON = function (json) {\n var result = json;\n if (json.hasOwnProperty(\"d\")) {\n if (json.d.hasOwnProperty(\"results\")) {\n result = json.d.results;\n }\n else {\n result = json.d;\n }\n }\n else if (json.hasOwnProperty(\"value\")) {\n result = json.value;\n }\n return result;\n };\n return ODataParserBase;\n}());\nexports.ODataParserBase = ODataParserBase;\nvar ODataDefaultParser = (function (_super) {\n __extends(ODataDefaultParser, _super);\n function ODataDefaultParser() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return ODataDefaultParser;\n}(ODataParserBase));\nexports.ODataDefaultParser = ODataDefaultParser;\nvar ODataRawParserImpl = (function () {\n function ODataRawParserImpl() {\n }\n ODataRawParserImpl.prototype.parse = function (r) {\n return r.json();\n };\n return ODataRawParserImpl;\n}());\nexports.ODataRawParserImpl = ODataRawParserImpl;\nvar ODataValueParserImpl = (function (_super) {\n __extends(ODataValueParserImpl, _super);\n function ODataValueParserImpl() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ODataValueParserImpl.prototype.parse = function (r) {\n return _super.prototype.parse.call(this, r).then(function (d) { return d; });\n };\n return ODataValueParserImpl;\n}(ODataParserBase));\nvar ODataEntityParserImpl = (function (_super) {\n __extends(ODataEntityParserImpl, _super);\n function ODataEntityParserImpl(factory) {\n var _this = _super.call(this) || this;\n _this.factory = factory;\n return _this;\n }\n ODataEntityParserImpl.prototype.parse = function (r) {\n var _this = this;\n return _super.prototype.parse.call(this, r).then(function (d) {\n var o = new _this.factory(getEntityUrl(d), null);\n return util_1.Util.extend(o, d);\n });\n };\n return ODataEntityParserImpl;\n}(ODataParserBase));\nvar ODataEntityArrayParserImpl = (function (_super) {\n __extends(ODataEntityArrayParserImpl, _super);\n function ODataEntityArrayParserImpl(factory) {\n var _this = _super.call(this) || this;\n _this.factory = factory;\n return _this;\n }\n ODataEntityArrayParserImpl.prototype.parse = function (r) {\n var _this = this;\n return _super.prototype.parse.call(this, r).then(function (d) {\n return d.map(function (v) {\n var o = new _this.factory(getEntityUrl(v), null);\n return util_1.Util.extend(o, v);\n });\n });\n };\n return ODataEntityArrayParserImpl;\n}(ODataParserBase));\nfunction getEntityUrl(entity) {\n if (entity.hasOwnProperty(\"odata.editLink\")) {\n // we are dealign with minimal metadata (default)\n return util_1.Util.combinePaths(\"_api\", entity[\"odata.editLink\"]);\n }\n else if (entity.hasOwnProperty(\"__metadata\")) {\n // we are dealing with verbose, which has an absolute uri\n return entity.__metadata.uri;\n }\n else {\n // we are likely dealing with nometadata, so don't error but we won't be able to\n // chain off these objects\n logging_1.Logger.write(\"No uri information found in ODataEntity parsing, chaining will fail for this object.\", logging_1.LogLevel.Warning);\n return \"\";\n }\n}\nexports.getEntityUrl = getEntityUrl;\nexports.ODataRaw = new ODataRawParserImpl();\nfunction ODataValue() {\n return new ODataValueParserImpl();\n}\nexports.ODataValue = ODataValue;\nfunction ODataEntity(factory) {\n return new ODataEntityParserImpl(factory);\n}\nexports.ODataEntity = ODataEntity;\nfunction ODataEntityArray(factory) {\n return new ODataEntityArrayParserImpl(factory);\n}\nexports.ODataEntityArray = ODataEntityArray;\n/**\n * Manages a batch of OData operations\n */\nvar ODataBatch = (function () {\n function ODataBatch(baseUrl, _batchId) {\n if (_batchId === void 0) { _batchId = util_1.Util.getGUID(); }\n this.baseUrl = baseUrl;\n this._batchId = _batchId;\n this._requests = [];\n this._dependencies = [];\n }\n /**\n * Adds a request to a batch (not designed for public use)\n *\n * @param url The full url of the request\n * @param method The http method GET, POST, etc\n * @param options Any options to include in the request\n * @param parser The parser that will hadle the results of the request\n */\n ODataBatch.prototype.add = function (url, method, options, parser) {\n var info = {\n method: method.toUpperCase(),\n options: options,\n parser: parser,\n reject: null,\n resolve: null,\n url: url,\n };\n var p = new Promise(function (resolve, reject) {\n info.resolve = resolve;\n info.reject = reject;\n });\n this._requests.push(info);\n return p;\n };\n /**\n * Adds a dependency insuring that some set of actions will occur before a batch is processed.\n * MUST be cleared using the returned resolve delegate to allow batches to run\n */\n ODataBatch.prototype.addDependency = function () {\n var resolver;\n var promise = new Promise(function (resolve) {\n resolver = resolve;\n });\n this._dependencies.push(promise);\n return resolver;\n };\n /**\n * Execute the current batch and resolve the associated promises\n *\n * @returns A promise which will be resolved once all of the batch's child promises have resolved\n */\n ODataBatch.prototype.execute = function () {\n var _this = this;\n // we need to check the dependencies twice due to how different engines handle things.\n // We can get a second set of promises added after the first set resolve\n return Promise.all(this._dependencies).then(function () { return Promise.all(_this._dependencies); }).then(function () { return _this.executeImpl(); });\n };\n ODataBatch.prototype.executeImpl = function () {\n var _this = this;\n logging_1.Logger.write(\"Executing batch with \" + this._requests.length + \" requests.\", logging_1.LogLevel.Info);\n // if we don't have any requests, don't bother sending anything\n // this could be due to caching further upstream, or just an empty batch\n if (this._requests.length < 1) {\n logging_1.Logger.write(\"Resolving empty batch.\", logging_1.LogLevel.Info);\n return Promise.resolve();\n }\n // creating the client here allows the url to be populated for nodejs client as well as potentially\n // any other hacks needed for other types of clients. Essentially allows the absoluteRequestUrl\n // below to be correct\n var client = new httpclient_1.HttpClient();\n // due to timing we need to get the absolute url here so we can use it for all the individual requests\n // and for sending the entire batch\n return util_1.Util.toAbsoluteUrl(this.baseUrl).then(function (absoluteRequestUrl) {\n // build all the requests, send them, pipe results in order to parsers\n var batchBody = [];\n var currentChangeSetId = \"\";\n _this._requests.map(function (reqInfo) {\n if (reqInfo.method === \"GET\") {\n if (currentChangeSetId.length > 0) {\n // end an existing change set\n batchBody.push(\"--changeset_\" + currentChangeSetId + \"--\\n\\n\");\n currentChangeSetId = \"\";\n }\n batchBody.push(\"--batch_\" + _this._batchId + \"\\n\");\n }\n else {\n if (currentChangeSetId.length < 1) {\n // start new change set\n currentChangeSetId = util_1.Util.getGUID();\n batchBody.push(\"--batch_\" + _this._batchId + \"\\n\");\n batchBody.push(\"Content-Type: multipart/mixed; boundary=\\\"changeset_\" + currentChangeSetId + \"\\\"\\n\\n\");\n }\n batchBody.push(\"--changeset_\" + currentChangeSetId + \"\\n\");\n }\n // common batch part prefix\n batchBody.push(\"Content-Type: application/http\\n\");\n batchBody.push(\"Content-Transfer-Encoding: binary\\n\\n\");\n var headers = {\n \"Accept\": \"application/json;\",\n };\n // this is the url of the individual request within the batch\n var url = util_1.Util.isUrlAbsolute(reqInfo.url) ? reqInfo.url : util_1.Util.combinePaths(absoluteRequestUrl, reqInfo.url);\n logging_1.Logger.write(\"Adding request \" + reqInfo.method + \" \" + url + \" to batch.\", logging_1.LogLevel.Verbose);\n if (reqInfo.method !== \"GET\") {\n var method = reqInfo.method;\n if (reqInfo.hasOwnProperty(\"options\") && reqInfo.options.hasOwnProperty(\"headers\") && typeof reqInfo.options.headers[\"X-HTTP-Method\"] !== \"undefined\") {\n method = reqInfo.options.headers[\"X-HTTP-Method\"];\n delete reqInfo.options.headers[\"X-HTTP-Method\"];\n }\n batchBody.push(method + \" \" + url + \" HTTP/1.1\\n\");\n headers = util_1.Util.extend(headers, { \"Content-Type\": \"application/json;odata=verbose;charset=utf-8\" });\n }\n else {\n batchBody.push(reqInfo.method + \" \" + url + \" HTTP/1.1\\n\");\n }\n if (typeof pnplibconfig_1.RuntimeConfig.headers !== \"undefined\") {\n headers = util_1.Util.extend(headers, pnplibconfig_1.RuntimeConfig.headers);\n }\n if (reqInfo.options && reqInfo.options.headers) {\n headers = util_1.Util.extend(headers, reqInfo.options.headers);\n }\n for (var name_1 in headers) {\n if (headers.hasOwnProperty(name_1)) {\n batchBody.push(name_1 + \": \" + headers[name_1] + \"\\n\");\n }\n }\n batchBody.push(\"\\n\");\n if (reqInfo.options.body) {\n batchBody.push(reqInfo.options.body + \"\\n\\n\");\n }\n });\n if (currentChangeSetId.length > 0) {\n // Close the changeset\n batchBody.push(\"--changeset_\" + currentChangeSetId + \"--\\n\\n\");\n currentChangeSetId = \"\";\n }\n batchBody.push(\"--batch_\" + _this._batchId + \"--\\n\");\n var batchHeaders = {\n \"Content-Type\": \"multipart/mixed; boundary=batch_\" + _this._batchId,\n };\n var batchOptions = {\n \"body\": batchBody.join(\"\"),\n \"headers\": batchHeaders,\n };\n logging_1.Logger.write(\"Sending batch request.\", logging_1.LogLevel.Info);\n return client.post(util_1.Util.combinePaths(absoluteRequestUrl, \"/_api/$batch\"), batchOptions)\n .then(function (r) { return r.text(); })\n .then(_this._parseResponse)\n .then(function (responses) {\n if (responses.length !== _this._requests.length) {\n throw new exceptions_1.BatchParseException(\"Could not properly parse responses to match requests in batch.\");\n }\n logging_1.Logger.write(\"Resolving batched requests.\", logging_1.LogLevel.Info);\n return responses.reduce(function (chain, response, index) {\n var request = _this._requests[index];\n logging_1.Logger.write(\"Resolving request \" + request.method + \" \" + request.url + \".\", logging_1.LogLevel.Verbose);\n return chain.then(function (_) { return request.parser.parse(response).then(request.resolve).catch(request.reject); });\n }, Promise.resolve());\n });\n });\n };\n /**\n * Parses the response from a batch request into an array of Response instances\n *\n * @param body Text body of the response from the batch request\n */\n ODataBatch.prototype._parseResponse = function (body) {\n return new Promise(function (resolve, reject) {\n var responses = [];\n var header = \"--batchresponse_\";\n // Ex. \"HTTP/1.1 500 Internal Server Error\"\n var statusRegExp = new RegExp(\"^HTTP/[0-9.]+ +([0-9]+) +(.*)\", \"i\");\n var lines = body.split(\"\\n\");\n var state = \"batch\";\n var status;\n var statusText;\n for (var i = 0; i < lines.length; ++i) {\n var line = lines[i];\n switch (state) {\n case \"batch\":\n if (line.substr(0, header.length) === header) {\n state = \"batchHeaders\";\n }\n else {\n if (line.trim() !== \"\") {\n throw new exceptions_1.BatchParseException(\"Invalid response, line \" + i);\n }\n }\n break;\n case \"batchHeaders\":\n if (line.trim() === \"\") {\n state = \"status\";\n }\n break;\n case \"status\":\n var parts = statusRegExp.exec(line);\n if (parts.length !== 3) {\n throw new exceptions_1.BatchParseException(\"Invalid status, line \" + i);\n }\n status = parseInt(parts[1], 10);\n statusText = parts[2];\n state = \"statusHeaders\";\n break;\n case \"statusHeaders\":\n if (line.trim() === \"\") {\n state = \"body\";\n }\n break;\n case \"body\":\n responses.push((status === 204) ? new Response() : new Response(line, { status: status, statusText: statusText }));\n state = \"batch\";\n break;\n }\n }\n if (state !== \"status\") {\n reject(new exceptions_1.BatchParseException(\"Unexpected end of input\"));\n }\n resolve(responses);\n });\n };\n return ODataBatch;\n}());\nexports.ODataBatch = ODataBatch;\nvar TextFileParser = (function () {\n function TextFileParser() {\n }\n TextFileParser.prototype.parse = function (r) {\n return r.text();\n };\n return TextFileParser;\n}());\nexports.TextFileParser = TextFileParser;\nvar BlobFileParser = (function () {\n function BlobFileParser() {\n }\n BlobFileParser.prototype.parse = function (r) {\n return r.blob();\n };\n return BlobFileParser;\n}());\nexports.BlobFileParser = BlobFileParser;\nvar JSONFileParser = (function () {\n function JSONFileParser() {\n }\n JSONFileParser.prototype.parse = function (r) {\n return r.json();\n };\n return JSONFileParser;\n}());\nexports.JSONFileParser = JSONFileParser;\nvar BufferFileParser = (function () {\n function BufferFileParser() {\n }\n BufferFileParser.prototype.parse = function (r) {\n if (util_1.Util.isFunction(r.arrayBuffer)) {\n return r.arrayBuffer();\n }\n return r.buffer();\n };\n return BufferFileParser;\n}());\nexports.BufferFileParser = BufferFileParser;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/sharepoint/odata.js\n// module id = 2\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar logging_1 = require(\"../utils/logging\");\nfunction defaultLog(error) {\n logging_1.Logger.log({ data: {}, level: logging_1.LogLevel.Error, message: \"[\" + error.name + \"]::\" + error.message });\n}\n/**\n * Represents an exception with an HttpClient request\n *\n */\nvar ProcessHttpClientResponseException = (function (_super) {\n __extends(ProcessHttpClientResponseException, _super);\n function ProcessHttpClientResponseException(status, statusText, data) {\n var _this = _super.call(this, \"Error making HttpClient request in queryable: [\" + status + \"] \" + statusText) || this;\n _this.status = status;\n _this.statusText = statusText;\n _this.data = data;\n _this.name = \"ProcessHttpClientResponseException\";\n logging_1.Logger.log({ data: _this.data, level: logging_1.LogLevel.Error, message: _this.message });\n return _this;\n }\n return ProcessHttpClientResponseException;\n}(Error));\nexports.ProcessHttpClientResponseException = ProcessHttpClientResponseException;\nvar NoCacheAvailableException = (function (_super) {\n __extends(NoCacheAvailableException, _super);\n function NoCacheAvailableException(msg) {\n if (msg === void 0) { msg = \"Cannot create a caching configuration provider since cache is not available.\"; }\n var _this = _super.call(this, msg) || this;\n _this.name = \"NoCacheAvailableException\";\n defaultLog(_this);\n return _this;\n }\n return NoCacheAvailableException;\n}(Error));\nexports.NoCacheAvailableException = NoCacheAvailableException;\nvar APIUrlException = (function (_super) {\n __extends(APIUrlException, _super);\n function APIUrlException(msg) {\n if (msg === void 0) { msg = \"Unable to determine API url.\"; }\n var _this = _super.call(this, msg) || this;\n _this.name = \"APIUrlException\";\n defaultLog(_this);\n return _this;\n }\n return APIUrlException;\n}(Error));\nexports.APIUrlException = APIUrlException;\nvar AuthUrlException = (function (_super) {\n __extends(AuthUrlException, _super);\n function AuthUrlException(data, msg) {\n if (msg === void 0) { msg = \"Auth URL Endpoint could not be determined from data. Data logged.\"; }\n var _this = _super.call(this, msg) || this;\n _this.name = \"APIUrlException\";\n logging_1.Logger.log({ data: data, level: logging_1.LogLevel.Error, message: _this.message });\n return _this;\n }\n return AuthUrlException;\n}(Error));\nexports.AuthUrlException = AuthUrlException;\nvar NodeFetchClientUnsupportedException = (function (_super) {\n __extends(NodeFetchClientUnsupportedException, _super);\n function NodeFetchClientUnsupportedException(msg) {\n if (msg === void 0) { msg = \"Using NodeFetchClient in the browser is not supported.\"; }\n var _this = _super.call(this, msg) || this;\n _this.name = \"NodeFetchClientUnsupportedException\";\n defaultLog(_this);\n return _this;\n }\n return NodeFetchClientUnsupportedException;\n}(Error));\nexports.NodeFetchClientUnsupportedException = NodeFetchClientUnsupportedException;\nvar SPRequestExecutorUndefinedException = (function (_super) {\n __extends(SPRequestExecutorUndefinedException, _super);\n function SPRequestExecutorUndefinedException() {\n var _this = this;\n var msg = [\n \"SP.RequestExecutor is undefined. \",\n \"Load the SP.RequestExecutor.js library (/_layouts/15/SP.RequestExecutor.js) before loading the PnP JS Core library.\",\n ].join(\" \");\n _this = _super.call(this, msg) || this;\n _this.name = \"SPRequestExecutorUndefinedException\";\n defaultLog(_this);\n return _this;\n }\n return SPRequestExecutorUndefinedException;\n}(Error));\nexports.SPRequestExecutorUndefinedException = SPRequestExecutorUndefinedException;\nvar MaxCommentLengthException = (function (_super) {\n __extends(MaxCommentLengthException, _super);\n function MaxCommentLengthException(msg) {\n if (msg === void 0) { msg = \"The maximum comment length is 1023 characters.\"; }\n var _this = _super.call(this, msg) || this;\n _this.name = \"MaxCommentLengthException\";\n defaultLog(_this);\n return _this;\n }\n return MaxCommentLengthException;\n}(Error));\nexports.MaxCommentLengthException = MaxCommentLengthException;\nvar NotSupportedInBatchException = (function (_super) {\n __extends(NotSupportedInBatchException, _super);\n function NotSupportedInBatchException(operation) {\n if (operation === void 0) { operation = \"This operation\"; }\n var _this = _super.call(this, operation + \" is not supported as part of a batch.\") || this;\n _this.name = \"NotSupportedInBatchException\";\n defaultLog(_this);\n return _this;\n }\n return NotSupportedInBatchException;\n}(Error));\nexports.NotSupportedInBatchException = NotSupportedInBatchException;\nvar ODataIdException = (function (_super) {\n __extends(ODataIdException, _super);\n function ODataIdException(data, msg) {\n if (msg === void 0) { msg = \"Could not extract odata id in object, you may be using nometadata. Object data logged to logger.\"; }\n var _this = _super.call(this, msg) || this;\n _this.name = \"ODataIdException\";\n logging_1.Logger.log({ data: data, level: logging_1.LogLevel.Error, message: _this.message });\n return _this;\n }\n return ODataIdException;\n}(Error));\nexports.ODataIdException = ODataIdException;\nvar BatchParseException = (function (_super) {\n __extends(BatchParseException, _super);\n function BatchParseException(msg) {\n var _this = _super.call(this, msg) || this;\n _this.name = \"BatchParseException\";\n defaultLog(_this);\n return _this;\n }\n return BatchParseException;\n}(Error));\nexports.BatchParseException = BatchParseException;\nvar AlreadyInBatchException = (function (_super) {\n __extends(AlreadyInBatchException, _super);\n function AlreadyInBatchException(msg) {\n if (msg === void 0) { msg = \"This query is already part of a batch.\"; }\n var _this = _super.call(this, msg) || this;\n _this.name = \"AlreadyInBatchException\";\n defaultLog(_this);\n return _this;\n }\n return AlreadyInBatchException;\n}(Error));\nexports.AlreadyInBatchException = AlreadyInBatchException;\nvar FunctionExpectedException = (function (_super) {\n __extends(FunctionExpectedException, _super);\n function FunctionExpectedException(msg) {\n if (msg === void 0) { msg = \"This query is already part of a batch.\"; }\n var _this = _super.call(this, msg) || this;\n _this.name = \"FunctionExpectedException\";\n defaultLog(_this);\n return _this;\n }\n return FunctionExpectedException;\n}(Error));\nexports.FunctionExpectedException = FunctionExpectedException;\nvar UrlException = (function (_super) {\n __extends(UrlException, _super);\n function UrlException(msg) {\n var _this = _super.call(this, msg) || this;\n _this.name = \"UrlException\";\n defaultLog(_this);\n return _this;\n }\n return UrlException;\n}(Error));\nexports.UrlException = UrlException;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/utils/exceptions.js\n// module id = 3\n// module chunks = 0","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar fetchclient_1 = require(\"../net/fetchclient\");\nvar RuntimeConfigImpl = (function () {\n function RuntimeConfigImpl() {\n // these are our default values for the library\n this._headers = null;\n this._defaultCachingStore = \"session\";\n this._defaultCachingTimeoutSeconds = 60;\n this._globalCacheDisable = false;\n this._fetchClientFactory = function () { return new fetchclient_1.FetchClient(); };\n this._baseUrl = null;\n this._spfxContext = null;\n }\n RuntimeConfigImpl.prototype.set = function (config) {\n if (config.hasOwnProperty(\"headers\")) {\n this._headers = config.headers;\n }\n if (config.hasOwnProperty(\"globalCacheDisable\")) {\n this._globalCacheDisable = config.globalCacheDisable;\n }\n if (config.hasOwnProperty(\"defaultCachingStore\")) {\n this._defaultCachingStore = config.defaultCachingStore;\n }\n if (config.hasOwnProperty(\"defaultCachingTimeoutSeconds\")) {\n this._defaultCachingTimeoutSeconds = config.defaultCachingTimeoutSeconds;\n }\n if (config.hasOwnProperty(\"fetchClientFactory\")) {\n this._fetchClientFactory = config.fetchClientFactory;\n }\n if (config.hasOwnProperty(\"baseUrl\")) {\n this._baseUrl = config.baseUrl;\n }\n if (config.hasOwnProperty(\"spFXContext\")) {\n this._spfxContext = config.spfxContext;\n }\n };\n Object.defineProperty(RuntimeConfigImpl.prototype, \"headers\", {\n get: function () {\n return this._headers;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RuntimeConfigImpl.prototype, \"defaultCachingStore\", {\n get: function () {\n return this._defaultCachingStore;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RuntimeConfigImpl.prototype, \"defaultCachingTimeoutSeconds\", {\n get: function () {\n return this._defaultCachingTimeoutSeconds;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RuntimeConfigImpl.prototype, \"globalCacheDisable\", {\n get: function () {\n return this._globalCacheDisable;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RuntimeConfigImpl.prototype, \"fetchClientFactory\", {\n get: function () {\n return this._fetchClientFactory;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RuntimeConfigImpl.prototype, \"baseUrl\", {\n get: function () {\n if (this._baseUrl !== null) {\n return this._baseUrl;\n }\n else if (this._spfxContext !== null) {\n return this._spfxContext.pageContext.web.absoluteUrl;\n }\n return null;\n },\n enumerable: true,\n configurable: true\n });\n return RuntimeConfigImpl;\n}());\nexports.RuntimeConfigImpl = RuntimeConfigImpl;\nvar _runtimeConfig = new RuntimeConfigImpl();\nexports.RuntimeConfig = _runtimeConfig;\nfunction setRuntimeConfig(config) {\n _runtimeConfig.set(config);\n}\nexports.setRuntimeConfig = setRuntimeConfig;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/configuration/pnplibconfig.js\n// module id = 4\n// module chunks = 0","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * A set of logging levels\n *\n */\nvar LogLevel;\n(function (LogLevel) {\n LogLevel[LogLevel[\"Verbose\"] = 0] = \"Verbose\";\n LogLevel[LogLevel[\"Info\"] = 1] = \"Info\";\n LogLevel[LogLevel[\"Warning\"] = 2] = \"Warning\";\n LogLevel[LogLevel[\"Error\"] = 3] = \"Error\";\n LogLevel[LogLevel[\"Off\"] = 99] = \"Off\";\n})(LogLevel = exports.LogLevel || (exports.LogLevel = {}));\n/**\n * Class used to subscribe ILogListener and log messages throughout an application\n *\n */\nvar Logger = (function () {\n function Logger() {\n }\n Object.defineProperty(Logger, \"activeLogLevel\", {\n get: function () {\n return Logger.instance.activeLogLevel;\n },\n set: function (value) {\n Logger.instance.activeLogLevel = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Logger, \"instance\", {\n get: function () {\n if (typeof Logger._instance === \"undefined\" || Logger._instance === null) {\n Logger._instance = new LoggerImpl();\n }\n return Logger._instance;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Adds ILogListener instances to the set of subscribed listeners\n *\n * @param listeners One or more listeners to subscribe to this log\n */\n Logger.subscribe = function () {\n var listeners = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n listeners[_i] = arguments[_i];\n }\n listeners.map(function (listener) { return Logger.instance.subscribe(listener); });\n };\n /**\n * Clears the subscribers collection, returning the collection before modifiction\n */\n Logger.clearSubscribers = function () {\n return Logger.instance.clearSubscribers();\n };\n Object.defineProperty(Logger, \"count\", {\n /**\n * Gets the current subscriber count\n */\n get: function () {\n return Logger.instance.count;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Writes the supplied string to the subscribed listeners\n *\n * @param message The message to write\n * @param level [Optional] if supplied will be used as the level of the entry (Default: LogLevel.Verbose)\n */\n Logger.write = function (message, level) {\n if (level === void 0) { level = LogLevel.Verbose; }\n Logger.instance.log({ level: level, message: message });\n };\n /**\n * Writes the supplied string to the subscribed listeners\n *\n * @param json The json object to stringify and write\n * @param level [Optional] if supplied will be used as the level of the entry (Default: LogLevel.Verbose)\n */\n Logger.writeJSON = function (json, level) {\n if (level === void 0) { level = LogLevel.Verbose; }\n Logger.instance.log({ level: level, message: JSON.stringify(json) });\n };\n /**\n * Logs the supplied entry to the subscribed listeners\n *\n * @param entry The message to log\n */\n Logger.log = function (entry) {\n Logger.instance.log(entry);\n };\n /**\n * Logs performance tracking data for the the execution duration of the supplied function using console.profile\n *\n * @param name The name of this profile boundary\n * @param f The function to execute and track within this performance boundary\n */\n Logger.measure = function (name, f) {\n return Logger.instance.measure(name, f);\n };\n return Logger;\n}());\nexports.Logger = Logger;\nvar LoggerImpl = (function () {\n function LoggerImpl(activeLogLevel, subscribers) {\n if (activeLogLevel === void 0) { activeLogLevel = LogLevel.Warning; }\n if (subscribers === void 0) { subscribers = []; }\n this.activeLogLevel = activeLogLevel;\n this.subscribers = subscribers;\n }\n LoggerImpl.prototype.subscribe = function (listener) {\n this.subscribers.push(listener);\n };\n LoggerImpl.prototype.clearSubscribers = function () {\n var s = this.subscribers.slice(0);\n this.subscribers.length = 0;\n return s;\n };\n Object.defineProperty(LoggerImpl.prototype, \"count\", {\n get: function () {\n return this.subscribers.length;\n },\n enumerable: true,\n configurable: true\n });\n LoggerImpl.prototype.write = function (message, level) {\n if (level === void 0) { level = LogLevel.Verbose; }\n this.log({ level: level, message: message });\n };\n LoggerImpl.prototype.log = function (entry) {\n if (typeof entry === \"undefined\" || entry.level < this.activeLogLevel) {\n return;\n }\n this.subscribers.map(function (subscriber) { return subscriber.log(entry); });\n };\n LoggerImpl.prototype.measure = function (name, f) {\n console.profile(name);\n try {\n return f();\n }\n finally {\n console.profileEnd();\n }\n };\n return LoggerImpl;\n}());\n/**\n * Implementation of ILogListener which logs to the browser console\n *\n */\nvar ConsoleListener = (function () {\n function ConsoleListener() {\n }\n /**\n * Any associated data that a given logging listener may choose to log or ignore\n *\n * @param entry The information to be logged\n */\n ConsoleListener.prototype.log = function (entry) {\n var msg = this.format(entry);\n switch (entry.level) {\n case LogLevel.Verbose:\n case LogLevel.Info:\n console.log(msg);\n break;\n case LogLevel.Warning:\n console.warn(msg);\n break;\n case LogLevel.Error:\n console.error(msg);\n break;\n }\n };\n /**\n * Formats the message\n *\n * @param entry The information to format into a string\n */\n ConsoleListener.prototype.format = function (entry) {\n return \"Message: \" + entry.message + \" Data: \" + JSON.stringify(entry.data);\n };\n return ConsoleListener;\n}());\nexports.ConsoleListener = ConsoleListener;\n/**\n * Implementation of ILogListener which logs to the supplied function\n *\n */\nvar FunctionListener = (function () {\n /**\n * Creates a new instance of the FunctionListener class\n *\n * @constructor\n * @param method The method to which any logging data will be passed\n */\n function FunctionListener(method) {\n this.method = method;\n }\n /**\n * Any associated data that a given logging listener may choose to log or ignore\n *\n * @param entry The information to be logged\n */\n FunctionListener.prototype.log = function (entry) {\n this.method(entry);\n };\n return FunctionListener;\n}());\nexports.FunctionListener = FunctionListener;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/utils/logging.js\n// module id = 5\n// module chunks = 0","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Generic dictionary\n */\nvar Dictionary = (function () {\n /**\n * Creates a new instance of the Dictionary class\n *\n * @constructor\n */\n function Dictionary(keys, values) {\n if (keys === void 0) { keys = []; }\n if (values === void 0) { values = []; }\n this.keys = keys;\n this.values = values;\n }\n /**\n * Gets a value from the collection using the specified key\n *\n * @param key The key whose value we want to return, returns null if the key does not exist\n */\n Dictionary.prototype.get = function (key) {\n var index = this.keys.indexOf(key);\n if (index < 0) {\n return null;\n }\n return this.values[index];\n };\n /**\n * Adds the supplied key and value to the dictionary\n *\n * @param key The key to add\n * @param o The value to add\n */\n Dictionary.prototype.add = function (key, o) {\n var index = this.keys.indexOf(key);\n if (index > -1) {\n this.values[index] = o;\n }\n else {\n this.keys.push(key);\n this.values.push(o);\n }\n };\n /**\n * Merges the supplied typed hash into this dictionary instance. Existing values are updated and new ones are created as appropriate.\n */\n Dictionary.prototype.merge = function (source) {\n var _this = this;\n if (\"getKeys\" in source) {\n var sourceAsDictionary_1 = source;\n sourceAsDictionary_1.getKeys().map(function (key) {\n _this.add(key, sourceAsDictionary_1.get(key));\n });\n }\n else {\n var sourceAsHash = source;\n for (var key in sourceAsHash) {\n if (sourceAsHash.hasOwnProperty(key)) {\n this.add(key, sourceAsHash[key]);\n }\n }\n }\n };\n /**\n * Removes a value from the dictionary\n *\n * @param key The key of the key/value pair to remove. Returns null if the key was not found.\n */\n Dictionary.prototype.remove = function (key) {\n var index = this.keys.indexOf(key);\n if (index < 0) {\n return null;\n }\n var val = this.values[index];\n this.keys.splice(index, 1);\n this.values.splice(index, 1);\n return val;\n };\n /**\n * Returns all the keys currently in the dictionary as an array\n */\n Dictionary.prototype.getKeys = function () {\n return this.keys;\n };\n /**\n * Returns all the values currently in the dictionary as an array\n */\n Dictionary.prototype.getValues = function () {\n return this.values;\n };\n /**\n * Clears the current dictionary\n */\n Dictionary.prototype.clear = function () {\n this.keys = [];\n this.values = [];\n };\n /**\n * Gets a count of the items currently in the dictionary\n */\n Dictionary.prototype.count = function () {\n return this.keys.length;\n };\n return Dictionary;\n}());\nexports.Dictionary = Dictionary;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/collections/collections.js\n// module id = 6\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar queryable_1 = require(\"./queryable\");\nvar lists_1 = require(\"./lists\");\nvar fields_1 = require(\"./fields\");\nvar navigation_1 = require(\"./navigation\");\nvar sitegroups_1 = require(\"./sitegroups\");\nvar contenttypes_1 = require(\"./contenttypes\");\nvar folders_1 = require(\"./folders\");\nvar roles_1 = require(\"./roles\");\nvar files_1 = require(\"./files\");\nvar util_1 = require(\"../utils/util\");\nvar lists_2 = require(\"./lists\");\nvar siteusers_1 = require(\"./siteusers\");\nvar usercustomactions_1 = require(\"./usercustomactions\");\nvar odata_1 = require(\"./odata\");\nvar features_1 = require(\"./features\");\nvar decorators_1 = require(\"../utils/decorators\");\nvar queryableshareable_1 = require(\"./queryableshareable\");\nvar relateditems_1 = require(\"./relateditems\");\nvar Webs = (function (_super) {\n __extends(Webs, _super);\n function Webs(baseUrl, webPath) {\n if (webPath === void 0) { webPath = \"webs\"; }\n return _super.call(this, baseUrl, webPath) || this;\n }\n /**\n * Adds a new web to the collection\n *\n * @param title The new web's title\n * @param url The new web's relative url\n * @param description The web web's description\n * @param template The web's template\n * @param language The language code to use for this web\n * @param inheritPermissions If true permissions will be inherited from the partent web\n * @param additionalSettings Will be passed as part of the web creation body\n */\n Webs.prototype.add = function (title, url, description, template, language, inheritPermissions, additionalSettings) {\n if (description === void 0) { description = \"\"; }\n if (template === void 0) { template = \"STS\"; }\n if (language === void 0) { language = 1033; }\n if (inheritPermissions === void 0) { inheritPermissions = true; }\n if (additionalSettings === void 0) { additionalSettings = {}; }\n var props = util_1.Util.extend({\n Description: description,\n Language: language,\n Title: title,\n Url: url,\n UseSamePermissionsAsParentSite: inheritPermissions,\n WebTemplate: template,\n }, additionalSettings);\n var postBody = JSON.stringify({\n \"parameters\": util_1.Util.extend({\n \"__metadata\": { \"type\": \"SP.WebCreationInformation\" },\n }, props),\n });\n return this.clone(Webs, \"add\", true).post({ body: postBody }).then(function (data) {\n return {\n data: data,\n web: new Web(odata_1.extractOdataId(data).replace(/_api\\/web\\/?/i, \"\")),\n };\n });\n };\n return Webs;\n}(queryable_1.QueryableCollection));\nexports.Webs = Webs;\n/**\n * Describes a web\n *\n */\nvar Web = (function (_super) {\n __extends(Web, _super);\n function Web(baseUrl, path) {\n if (path === void 0) { path = \"_api/web\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * Creates a new web instance from the given url by indexing the location of the /_api/\n * segment. If this is not found the method creates a new web with the entire string as\n * supplied.\n *\n * @param url\n */\n Web.fromUrl = function (url, path) {\n if (url === null) {\n return new Web(\"\");\n }\n var index = url.indexOf(\"_api/\");\n if (index > -1) {\n return new Web(url.substr(0, index), path);\n }\n return new Web(url, path);\n };\n Object.defineProperty(Web.prototype, \"webs\", {\n get: function () {\n return new Webs(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"contentTypes\", {\n /**\n * Get the content types available in this web\n *\n */\n get: function () {\n return new contenttypes_1.ContentTypes(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"lists\", {\n /**\n * Get the lists in this web\n *\n */\n get: function () {\n return new lists_1.Lists(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"fields\", {\n /**\n * Gets the fields in this web\n *\n */\n get: function () {\n return new fields_1.Fields(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"features\", {\n /**\n * Gets the active features for this web\n *\n */\n get: function () {\n return new features_1.Features(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"availablefields\", {\n /**\n * Gets the available fields in this web\n *\n */\n get: function () {\n return new fields_1.Fields(this, \"availablefields\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"navigation\", {\n /**\n * Get the navigation options in this web\n *\n */\n get: function () {\n return new navigation_1.Navigation(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"siteUsers\", {\n /**\n * Gets the site users\n *\n */\n get: function () {\n return new siteusers_1.SiteUsers(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"siteGroups\", {\n /**\n * Gets the site groups\n *\n */\n get: function () {\n return new sitegroups_1.SiteGroups(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"currentUser\", {\n /**\n * Gets the current user\n */\n get: function () {\n return new siteusers_1.CurrentUser(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"folders\", {\n /**\n * Get the folders in this web\n *\n */\n get: function () {\n return new folders_1.Folders(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"userCustomActions\", {\n /**\n * Get all custom actions on a site\n *\n */\n get: function () {\n return new usercustomactions_1.UserCustomActions(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"roleDefinitions\", {\n /**\n * Gets the collection of RoleDefinition resources.\n *\n */\n get: function () {\n return new roles_1.RoleDefinitions(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"relatedItems\", {\n /**\n * Provides an interface to manage related items\n *\n */\n get: function () {\n return relateditems_1.RelatedItemManagerImpl.FromUrl(this.toUrl());\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Creates a new batch for requests within the context of context this web\n *\n */\n Web.prototype.createBatch = function () {\n return new odata_1.ODataBatch(this.parentUrl);\n };\n Object.defineProperty(Web.prototype, \"rootFolder\", {\n /**\n * The root folder of the web\n */\n get: function () {\n return new folders_1.Folder(this, \"rootFolder\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"associatedOwnerGroup\", {\n get: function () {\n return new sitegroups_1.SiteGroup(this, \"associatedownergroup\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"associatedMemberGroup\", {\n get: function () {\n return new sitegroups_1.SiteGroup(this, \"associatedmembergroup\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"associatedVisitorGroup\", {\n get: function () {\n return new sitegroups_1.SiteGroup(this, \"associatedvisitorgroup\");\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Get a folder by server relative url\n *\n * @param folderRelativeUrl the server relative path to the folder (including /sites/ if applicable)\n */\n Web.prototype.getFolderByServerRelativeUrl = function (folderRelativeUrl) {\n return new folders_1.Folder(this, \"getFolderByServerRelativeUrl('\" + folderRelativeUrl + \"')\");\n };\n /**\n * Get a file by server relative url\n *\n * @param fileRelativeUrl the server relative path to the file (including /sites/ if applicable)\n */\n Web.prototype.getFileByServerRelativeUrl = function (fileRelativeUrl) {\n return new files_1.File(this, \"getFileByServerRelativeUrl('\" + fileRelativeUrl + \"')\");\n };\n /**\n * Get a list by server relative url (list's root folder)\n *\n * @param listRelativeUrl the server relative path to the list's root folder (including /sites/ if applicable)\n */\n Web.prototype.getList = function (listRelativeUrl) {\n return new lists_2.List(this, \"getList('\" + listRelativeUrl + \"')\");\n };\n /**\n * Updates this web intance with the supplied properties\n *\n * @param properties A plain object hash of values to update for the web\n */\n Web.prototype.update = function (properties) {\n var _this = this;\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": \"SP.Web\" },\n }, properties));\n return this.post({\n body: postBody,\n headers: {\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n return {\n data: data,\n web: _this,\n };\n });\n };\n /**\n * Delete this web\n *\n */\n Web.prototype.delete = function () {\n return _super.prototype.delete.call(this);\n };\n /**\n * Applies the theme specified by the contents of each of the files specified in the arguments to the site.\n *\n * @param colorPaletteUrl Server-relative URL of the color palette file.\n * @param fontSchemeUrl Server-relative URL of the font scheme.\n * @param backgroundImageUrl Server-relative URL of the background image.\n * @param shareGenerated true to store the generated theme files in the root site, or false to store them in this site.\n */\n Web.prototype.applyTheme = function (colorPaletteUrl, fontSchemeUrl, backgroundImageUrl, shareGenerated) {\n var postBody = JSON.stringify({\n backgroundImageUrl: backgroundImageUrl,\n colorPaletteUrl: colorPaletteUrl,\n fontSchemeUrl: fontSchemeUrl,\n shareGenerated: shareGenerated,\n });\n return this.clone(Web, \"applytheme\", true).post({ body: postBody });\n };\n /**\n * Applies the specified site definition or site template to the Web site that has no template applied to it.\n *\n * @param template Name of the site definition or the name of the site template\n */\n Web.prototype.applyWebTemplate = function (template) {\n var q = this.clone(Web, \"applywebtemplate\", true);\n q.concat(\"(@t)\");\n q.query.add(\"@t\", template);\n return q.post();\n };\n /**\n * Returns whether the current user has the given set of permissions.\n *\n * @param perms The high and low permission range.\n */\n Web.prototype.doesUserHavePermissions = function (perms) {\n var q = this.clone(Web, \"doesuserhavepermissions\", true);\n q.concat(\"(@p)\");\n q.query.add(\"@p\", JSON.stringify(perms));\n return q.get();\n };\n /**\n * Checks whether the specified login name belongs to a valid user in the site. If the user doesn't exist, adds the user to the site.\n *\n * @param loginName The login name of the user (ex: i:0#.f|membership|user@domain.onmicrosoft.com)\n */\n Web.prototype.ensureUser = function (loginName) {\n var postBody = JSON.stringify({\n logonName: loginName,\n });\n return this.clone(Web, \"ensureuser\", true).post({ body: postBody }).then(function (data) {\n return {\n data: data,\n user: new siteusers_1.SiteUser(odata_1.extractOdataId(data)),\n };\n });\n };\n /**\n * Returns a collection of site templates available for the site.\n *\n * @param language The LCID of the site templates to get.\n * @param true to include language-neutral site templates; otherwise false\n */\n Web.prototype.availableWebTemplates = function (language, includeCrossLanugage) {\n if (language === void 0) { language = 1033; }\n if (includeCrossLanugage === void 0) { includeCrossLanugage = true; }\n return new queryable_1.QueryableCollection(this, \"getavailablewebtemplates(lcid=\" + language + \", doincludecrosslanguage=\" + includeCrossLanugage + \")\");\n };\n /**\n * Returns the list gallery on the site.\n *\n * @param type The gallery type - WebTemplateCatalog = 111, WebPartCatalog = 113 ListTemplateCatalog = 114,\n * MasterPageCatalog = 116, SolutionCatalog = 121, ThemeCatalog = 123, DesignCatalog = 124, AppDataCatalog = 125\n */\n Web.prototype.getCatalog = function (type) {\n return this.clone(Web, \"getcatalog(\" + type + \")\", true).select(\"Id\").get().then(function (data) {\n return new lists_2.List(odata_1.extractOdataId(data));\n });\n };\n /**\n * Returns the collection of changes from the change log that have occurred within the list, based on the specified query.\n */\n Web.prototype.getChanges = function (query) {\n var postBody = JSON.stringify({ \"query\": util_1.Util.extend({ \"__metadata\": { \"type\": \"SP.ChangeQuery\" } }, query) });\n return this.clone(Web, \"getchanges\", true).post({ body: postBody });\n };\n Object.defineProperty(Web.prototype, \"customListTemplate\", {\n /**\n * Gets the custom list templates for the site.\n *\n */\n get: function () {\n return new queryable_1.QueryableCollection(this, \"getcustomlisttemplates\");\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Returns the user corresponding to the specified member identifier for the current site.\n *\n * @param id The ID of the user.\n */\n Web.prototype.getUserById = function (id) {\n return new siteusers_1.SiteUser(this, \"getUserById(\" + id + \")\");\n };\n /**\n * Returns the name of the image file for the icon that is used to represent the specified file.\n *\n * @param filename The file name. If this parameter is empty, the server returns an empty string.\n * @param size The size of the icon: 16x16 pixels = 0, 32x32 pixels = 1.\n * @param progId The ProgID of the application that was used to create the file, in the form OLEServerName.ObjectName\n */\n Web.prototype.mapToIcon = function (filename, size, progId) {\n if (size === void 0) { size = 0; }\n if (progId === void 0) { progId = \"\"; }\n return this.clone(Web, \"maptoicon(filename='\" + filename + \"', progid='\" + progId + \"', size=\" + size + \")\", true).get();\n };\n return Web;\n}(queryableshareable_1.QueryableShareableWeb));\n__decorate([\n decorators_1.deprecated(\"This method will be removed in future releases. Please use the methods found in queryable securable.\")\n], Web.prototype, \"doesUserHavePermissions\", null);\nexports.Web = Web;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/sharepoint/webs.js\n// module id = 7\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar queryable_1 = require(\"./queryable\");\nvar odata_1 = require(\"./odata\");\nvar util_1 = require(\"../utils/util\");\nvar exceptions_1 = require(\"../utils/exceptions\");\nvar webparts_1 = require(\"./webparts\");\nvar items_1 = require(\"./items\");\nvar queryableshareable_1 = require(\"./queryableshareable\");\nvar odata_2 = require(\"./odata\");\n/**\n * Describes a collection of File objects\n *\n */\nvar Files = (function (_super) {\n __extends(Files, _super);\n /**\n * Creates a new instance of the Files class\n *\n * @param baseUrl The url or Queryable which forms the parent of this fields collection\n */\n function Files(baseUrl, path) {\n if (path === void 0) { path = \"files\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * Gets a File by filename\n *\n * @param name The name of the file, including extension.\n */\n Files.prototype.getByName = function (name) {\n var f = new File(this);\n f.concat(\"('\" + name + \"')\");\n return f;\n };\n /**\n * Uploads a file. Not supported for batching\n *\n * @param url The folder-relative url of the file.\n * @param content The file contents blob.\n * @param shouldOverWrite Should a file with the same name in the same location be overwritten? (default: true)\n * @returns The new File and the raw response.\n */\n Files.prototype.add = function (url, content, shouldOverWrite) {\n var _this = this;\n if (shouldOverWrite === void 0) { shouldOverWrite = true; }\n return new Files(this, \"add(overwrite=\" + shouldOverWrite + \",url='\" + url + \"')\")\n .post({\n body: content,\n }).then(function (response) {\n return {\n data: response,\n file: _this.getByName(url),\n };\n });\n };\n /**\n * Uploads a file. Not supported for batching\n *\n * @param url The folder-relative url of the file.\n * @param content The Blob file content to add\n * @param progress A callback function which can be used to track the progress of the upload\n * @param shouldOverWrite Should a file with the same name in the same location be overwritten? (default: true)\n * @param chunkSize The size of each file slice, in bytes (default: 10485760)\n * @returns The new File and the raw response.\n */\n Files.prototype.addChunked = function (url, content, progress, shouldOverWrite, chunkSize) {\n var _this = this;\n if (shouldOverWrite === void 0) { shouldOverWrite = true; }\n if (chunkSize === void 0) { chunkSize = 10485760; }\n var adder = this.clone(Files, \"add(overwrite=\" + shouldOverWrite + \",url='\" + url + \"')\");\n return adder.post().then(function () { return _this.getByName(url); }).then(function (file) { return file.setContentChunked(content, progress, chunkSize); }).then(function (response) {\n return {\n data: response,\n file: _this.getByName(url),\n };\n });\n };\n /**\n * Adds a ghosted file to an existing list or document library. Not supported for batching.\n *\n * @param fileUrl The server-relative url where you want to save the file.\n * @param templateFileType The type of use to create the file.\n * @returns The template file that was added and the raw response.\n */\n Files.prototype.addTemplateFile = function (fileUrl, templateFileType) {\n var _this = this;\n return this.clone(Files, \"addTemplateFile(urloffile='\" + fileUrl + \"',templatefiletype=\" + templateFileType + \")\")\n .post().then(function (response) {\n return {\n data: response,\n file: _this.getByName(fileUrl),\n };\n });\n };\n return Files;\n}(queryable_1.QueryableCollection));\nexports.Files = Files;\n/**\n * Describes a single File instance\n *\n */\nvar File = (function (_super) {\n __extends(File, _super);\n function File() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(File.prototype, \"listItemAllFields\", {\n /**\n * Gets a value that specifies the list item field values for the list item corresponding to the file.\n *\n */\n get: function () {\n return new queryable_1.QueryableCollection(this, \"listItemAllFields\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(File.prototype, \"versions\", {\n /**\n * Gets a collection of versions\n *\n */\n get: function () {\n return new Versions(this);\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Approves the file submitted for content approval with the specified comment.\n * Only documents in lists that are enabled for content approval can be approved.\n *\n * @param comment The comment for the approval.\n */\n File.prototype.approve = function (comment) {\n return this.clone(File, \"approve(comment='\" + comment + \"')\", true).post();\n };\n /**\n * Stops the chunk upload session without saving the uploaded data. Does not support batching.\n * If the file doesn’t already exist in the library, the partially uploaded file will be deleted.\n * Use this in response to user action (as in a request to cancel an upload) or an error or exception.\n * Use the uploadId value that was passed to the StartUpload method that started the upload session.\n * This method is currently available only on Office 365.\n *\n * @param uploadId The unique identifier of the upload session.\n */\n File.prototype.cancelUpload = function (uploadId) {\n return this.clone(File, \"cancelUpload(uploadId=guid'\" + uploadId + \"')\", false).post();\n };\n /**\n * Checks the file in to a document library based on the check-in type.\n *\n * @param comment A comment for the check-in. Its length must be <= 1023.\n * @param checkinType The check-in type for the file.\n */\n File.prototype.checkin = function (comment, checkinType) {\n if (comment === void 0) { comment = \"\"; }\n if (checkinType === void 0) { checkinType = CheckinType.Major; }\n if (comment.length > 1023) {\n throw new exceptions_1.MaxCommentLengthException();\n }\n return this.clone(File, \"checkin(comment='\" + comment + \"',checkintype=\" + checkinType + \")\", true).post();\n };\n /**\n * Checks out the file from a document library.\n */\n File.prototype.checkout = function () {\n return this.clone(File, \"checkout\", true).post();\n };\n /**\n * Copies the file to the destination url.\n *\n * @param url The absolute url or server relative url of the destination file path to copy to.\n * @param shouldOverWrite Should a file with the same name in the same location be overwritten?\n */\n File.prototype.copyTo = function (url, shouldOverWrite) {\n if (shouldOverWrite === void 0) { shouldOverWrite = true; }\n return this.clone(File, \"copyTo(strnewurl='\" + url + \"',boverwrite=\" + shouldOverWrite + \")\", true).post();\n };\n /**\n * Delete this file.\n *\n * @param eTag Value used in the IF-Match header, by default \"*\"\n */\n File.prototype.delete = function (eTag) {\n if (eTag === void 0) { eTag = \"*\"; }\n return this.clone(File, null, true).post({\n headers: {\n \"IF-Match\": eTag,\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n /**\n * Denies approval for a file that was submitted for content approval.\n * Only documents in lists that are enabled for content approval can be denied.\n *\n * @param comment The comment for the denial.\n */\n File.prototype.deny = function (comment) {\n if (comment === void 0) { comment = \"\"; }\n if (comment.length > 1023) {\n throw new exceptions_1.MaxCommentLengthException();\n }\n return this.clone(File, \"deny(comment='\" + comment + \"')\", true).post();\n };\n /**\n * Specifies the control set used to access, modify, or add Web Parts associated with this Web Part Page and view.\n * An exception is thrown if the file is not an ASPX page.\n *\n * @param scope The WebPartsPersonalizationScope view on the Web Parts page.\n */\n File.prototype.getLimitedWebPartManager = function (scope) {\n if (scope === void 0) { scope = WebPartsPersonalizationScope.Shared; }\n return new webparts_1.LimitedWebPartManager(this, \"getLimitedWebPartManager(scope=\" + scope + \")\");\n };\n /**\n * Moves the file to the specified destination url.\n *\n * @param url The absolute url or server relative url of the destination file path to move to.\n * @param moveOperations The bitwise MoveOperations value for how to move the file.\n */\n File.prototype.moveTo = function (url, moveOperations) {\n if (moveOperations === void 0) { moveOperations = MoveOperations.Overwrite; }\n return this.clone(File, \"moveTo(newurl='\" + url + \"',flags=\" + moveOperations + \")\", true).post();\n };\n /**\n * Submits the file for content approval with the specified comment.\n *\n * @param comment The comment for the published file. Its length must be <= 1023.\n */\n File.prototype.publish = function (comment) {\n if (comment === void 0) { comment = \"\"; }\n if (comment.length > 1023) {\n throw new exceptions_1.MaxCommentLengthException();\n }\n return this.clone(File, \"publish(comment='\" + comment + \"')\", true).post();\n };\n /**\n * Moves the file to the Recycle Bin and returns the identifier of the new Recycle Bin item.\n *\n * @returns The GUID of the recycled file.\n */\n File.prototype.recycle = function () {\n return this.clone(File, \"recycle\", true).post();\n };\n /**\n * Reverts an existing checkout for the file.\n *\n */\n File.prototype.undoCheckout = function () {\n return this.clone(File, \"undoCheckout\", true).post();\n };\n /**\n * Removes the file from content approval or unpublish a major version.\n *\n * @param comment The comment for the unpublish operation. Its length must be <= 1023.\n */\n File.prototype.unpublish = function (comment) {\n if (comment === void 0) { comment = \"\"; }\n if (comment.length > 1023) {\n throw new exceptions_1.MaxCommentLengthException();\n }\n return this.clone(File, \"unpublish(comment='\" + comment + \"')\", true).post();\n };\n /**\n * Gets the contents of the file as text. Not supported in batching.\n *\n */\n File.prototype.getText = function () {\n return this.clone(File, \"$value\").get(new odata_1.TextFileParser(), { headers: { \"binaryStringResponseBody\": \"true\" } });\n };\n /**\n * Gets the contents of the file as a blob, does not work in Node.js. Not supported in batching.\n *\n */\n File.prototype.getBlob = function () {\n return this.clone(File, \"$value\").get(new odata_1.BlobFileParser(), { headers: { \"binaryStringResponseBody\": \"true\" } });\n };\n /**\n * Gets the contents of a file as an ArrayBuffer, works in Node.js. Not supported in batching.\n */\n File.prototype.getBuffer = function () {\n return this.clone(File, \"$value\").get(new odata_1.BufferFileParser(), { headers: { \"binaryStringResponseBody\": \"true\" } });\n };\n /**\n * Gets the contents of a file as an ArrayBuffer, works in Node.js. Not supported in batching.\n */\n File.prototype.getJSON = function () {\n return this.clone(File, \"$value\").get(new odata_1.JSONFileParser(), { headers: { \"binaryStringResponseBody\": \"true\" } });\n };\n /**\n * Sets the content of a file, for large files use setContentChunked. Not supported in batching.\n *\n * @param content The file content\n *\n */\n File.prototype.setContent = function (content) {\n var _this = this;\n return this.clone(File, \"$value\").post({\n body: content,\n headers: {\n \"X-HTTP-Method\": \"PUT\",\n },\n }).then(function (_) { return new File(_this); });\n };\n /**\n * Gets the associated list item for this folder, loading the default properties\n */\n File.prototype.getItem = function () {\n var selects = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n selects[_i] = arguments[_i];\n }\n var q = this.listItemAllFields;\n return q.select.apply(q, selects).get().then(function (d) {\n return util_1.Util.extend(new items_1.Item(odata_2.getEntityUrl(d)), d);\n });\n };\n /**\n * Sets the contents of a file using a chunked upload approach. Not supported in batching.\n *\n * @param file The file to upload\n * @param progress A callback function which can be used to track the progress of the upload\n * @param chunkSize The size of each file slice, in bytes (default: 10485760)\n */\n File.prototype.setContentChunked = function (file, progress, chunkSize) {\n if (chunkSize === void 0) { chunkSize = 10485760; }\n if (typeof progress === \"undefined\") {\n progress = function () { return null; };\n }\n var self = this;\n var fileSize = file.size;\n var blockCount = parseInt((file.size / chunkSize).toString(), 10) + ((file.size % chunkSize === 0) ? 1 : 0);\n var uploadId = util_1.Util.getGUID();\n // start the chain with the first fragment\n progress({ blockNumber: 1, chunkSize: chunkSize, currentPointer: 0, fileSize: fileSize, stage: \"starting\", totalBlocks: blockCount });\n var chain = self.startUpload(uploadId, file.slice(0, chunkSize));\n var _loop_1 = function (i) {\n chain = chain.then(function (pointer) {\n progress({ blockNumber: i, chunkSize: chunkSize, currentPointer: pointer, fileSize: fileSize, stage: \"continue\", totalBlocks: blockCount });\n return self.continueUpload(uploadId, pointer, file.slice(pointer, pointer + chunkSize));\n });\n };\n // skip the first and last blocks\n for (var i = 2; i < blockCount; i++) {\n _loop_1(i);\n }\n return chain.then(function (pointer) {\n progress({ blockNumber: blockCount, chunkSize: chunkSize, currentPointer: pointer, fileSize: fileSize, stage: \"finishing\", totalBlocks: blockCount });\n return self.finishUpload(uploadId, pointer, file.slice(pointer));\n }).then(function (_) {\n return self;\n });\n };\n /**\n * Starts a new chunk upload session and uploads the first fragment.\n * The current file content is not changed when this method completes.\n * The method is idempotent (and therefore does not change the result) as long as you use the same values for uploadId and stream.\n * The upload session ends either when you use the CancelUpload method or when you successfully\n * complete the upload session by passing the rest of the file contents through the ContinueUpload and FinishUpload methods.\n * The StartUpload and ContinueUpload methods return the size of the running total of uploaded data in bytes,\n * so you can pass those return values to subsequent uses of ContinueUpload and FinishUpload.\n * This method is currently available only on Office 365.\n *\n * @param uploadId The unique identifier of the upload session.\n * @param fragment The file contents.\n * @returns The size of the total uploaded data in bytes.\n */\n File.prototype.startUpload = function (uploadId, fragment) {\n return this.clone(File, \"startUpload(uploadId=guid'\" + uploadId + \"')\").postAs({ body: fragment }).then(function (n) { return parseFloat(n); });\n };\n /**\n * Continues the chunk upload session with an additional fragment.\n * The current file content is not changed.\n * Use the uploadId value that was passed to the StartUpload method that started the upload session.\n * This method is currently available only on Office 365.\n *\n * @param uploadId The unique identifier of the upload session.\n * @param fileOffset The size of the offset into the file where the fragment starts.\n * @param fragment The file contents.\n * @returns The size of the total uploaded data in bytes.\n */\n File.prototype.continueUpload = function (uploadId, fileOffset, fragment) {\n return this.clone(File, \"continueUpload(uploadId=guid'\" + uploadId + \"',fileOffset=\" + fileOffset + \")\").postAs({ body: fragment }).then(function (n) { return parseFloat(n); });\n };\n /**\n * Uploads the last file fragment and commits the file. The current file content is changed when this method completes.\n * Use the uploadId value that was passed to the StartUpload method that started the upload session.\n * This method is currently available only on Office 365.\n *\n * @param uploadId The unique identifier of the upload session.\n * @param fileOffset The size of the offset into the file where the fragment starts.\n * @param fragment The file contents.\n * @returns The newly uploaded file.\n */\n File.prototype.finishUpload = function (uploadId, fileOffset, fragment) {\n return this.clone(File, \"finishUpload(uploadId=guid'\" + uploadId + \"',fileOffset=\" + fileOffset + \")\")\n .postAs({ body: fragment }).then(function (response) {\n return {\n data: response,\n file: new File(response.ServerRelativeUrl),\n };\n });\n };\n return File;\n}(queryableshareable_1.QueryableShareableFile));\nexports.File = File;\n/**\n * Describes a collection of Version objects\n *\n */\nvar Versions = (function (_super) {\n __extends(Versions, _super);\n /**\n * Creates a new instance of the File class\n *\n * @param baseUrl The url or Queryable which forms the parent of this fields collection\n */\n function Versions(baseUrl, path) {\n if (path === void 0) { path = \"versions\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * Gets a version by id\n *\n * @param versionId The id of the version to retrieve\n */\n Versions.prototype.getById = function (versionId) {\n var v = new Version(this);\n v.concat(\"(\" + versionId + \")\");\n return v;\n };\n /**\n * Deletes all the file version objects in the collection.\n *\n */\n Versions.prototype.deleteAll = function () {\n return new Versions(this, \"deleteAll\").post();\n };\n /**\n * Deletes the specified version of the file.\n *\n * @param versionId The ID of the file version to delete.\n */\n Versions.prototype.deleteById = function (versionId) {\n return this.clone(Versions, \"deleteById(vid=\" + versionId + \")\", true).post();\n };\n /**\n * Deletes the file version object with the specified version label.\n *\n * @param label The version label of the file version to delete, for example: 1.2\n */\n Versions.prototype.deleteByLabel = function (label) {\n return this.clone(Versions, \"deleteByLabel(versionlabel='\" + label + \"')\", true).post();\n };\n /**\n * Creates a new file version from the file specified by the version label.\n *\n * @param label The version label of the file version to restore, for example: 1.2\n */\n Versions.prototype.restoreByLabel = function (label) {\n return this.clone(Versions, \"restoreByLabel(versionlabel='\" + label + \"')\", true).post();\n };\n return Versions;\n}(queryable_1.QueryableCollection));\nexports.Versions = Versions;\n/**\n * Describes a single Version instance\n *\n */\nvar Version = (function (_super) {\n __extends(Version, _super);\n function Version() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Delete a specific version of a file.\n *\n * @param eTag Value used in the IF-Match header, by default \"*\"\n */\n Version.prototype.delete = function (eTag) {\n if (eTag === void 0) { eTag = \"*\"; }\n return this.post({\n headers: {\n \"IF-Match\": eTag,\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n return Version;\n}(queryable_1.QueryableInstance));\nexports.Version = Version;\nvar CheckinType;\n(function (CheckinType) {\n CheckinType[CheckinType[\"Minor\"] = 0] = \"Minor\";\n CheckinType[CheckinType[\"Major\"] = 1] = \"Major\";\n CheckinType[CheckinType[\"Overwrite\"] = 2] = \"Overwrite\";\n})(CheckinType = exports.CheckinType || (exports.CheckinType = {}));\nvar WebPartsPersonalizationScope;\n(function (WebPartsPersonalizationScope) {\n WebPartsPersonalizationScope[WebPartsPersonalizationScope[\"User\"] = 0] = \"User\";\n WebPartsPersonalizationScope[WebPartsPersonalizationScope[\"Shared\"] = 1] = \"Shared\";\n})(WebPartsPersonalizationScope = exports.WebPartsPersonalizationScope || (exports.WebPartsPersonalizationScope = {}));\nvar MoveOperations;\n(function (MoveOperations) {\n MoveOperations[MoveOperations[\"Overwrite\"] = 1] = \"Overwrite\";\n MoveOperations[MoveOperations[\"AllowBrokenThickets\"] = 8] = \"AllowBrokenThickets\";\n})(MoveOperations = exports.MoveOperations || (exports.MoveOperations = {}));\nvar TemplateFileType;\n(function (TemplateFileType) {\n TemplateFileType[TemplateFileType[\"StandardPage\"] = 0] = \"StandardPage\";\n TemplateFileType[TemplateFileType[\"WikiPage\"] = 1] = \"WikiPage\";\n TemplateFileType[TemplateFileType[\"FormPage\"] = 2] = \"FormPage\";\n})(TemplateFileType = exports.TemplateFileType || (exports.TemplateFileType = {}));\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/sharepoint/files.js\n// module id = 8\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar queryable_1 = require(\"./queryable\");\nvar queryableshareable_1 = require(\"./queryableshareable\");\nvar files_1 = require(\"./files\");\nvar util_1 = require(\"../utils/util\");\nvar odata_1 = require(\"./odata\");\nvar items_1 = require(\"./items\");\n/**\n * Describes a collection of Folder objects\n *\n */\nvar Folders = (function (_super) {\n __extends(Folders, _super);\n /**\n * Creates a new instance of the Folders class\n *\n * @param baseUrl The url or Queryable which forms the parent of this fields collection\n */\n function Folders(baseUrl, path) {\n if (path === void 0) { path = \"folders\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * Gets a folder by folder name\n *\n */\n Folders.prototype.getByName = function (name) {\n var f = new Folder(this);\n f.concat(\"('\" + name + \"')\");\n return f;\n };\n /**\n * Adds a new folder to the current folder (relative) or any folder (absolute)\n *\n * @param url The relative or absolute url where the new folder will be created. Urls starting with a forward slash are absolute.\n * @returns The new Folder and the raw response.\n */\n Folders.prototype.add = function (url) {\n var _this = this;\n return this.clone(Folders, \"add('\" + url + \"')\", true).post().then(function (response) {\n return {\n data: response,\n folder: _this.getByName(url),\n };\n });\n };\n return Folders;\n}(queryable_1.QueryableCollection));\nexports.Folders = Folders;\n/**\n * Describes a single Folder instance\n *\n */\nvar Folder = (function (_super) {\n __extends(Folder, _super);\n function Folder() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(Folder.prototype, \"contentTypeOrder\", {\n /**\n * Specifies the sequence in which content types are displayed.\n *\n */\n get: function () {\n return new queryable_1.QueryableCollection(this, \"contentTypeOrder\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Folder.prototype, \"files\", {\n /**\n * Gets this folder's files\n *\n */\n get: function () {\n return new files_1.Files(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Folder.prototype, \"folders\", {\n /**\n * Gets this folder's sub folders\n *\n */\n get: function () {\n return new Folders(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Folder.prototype, \"listItemAllFields\", {\n /**\n * Gets this folder's list item field values\n *\n */\n get: function () {\n return new queryable_1.QueryableCollection(this, \"listItemAllFields\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Folder.prototype, \"parentFolder\", {\n /**\n * Gets the parent folder, if available\n *\n */\n get: function () {\n return new Folder(this, \"parentFolder\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Folder.prototype, \"properties\", {\n /**\n * Gets this folder's properties\n *\n */\n get: function () {\n return new queryable_1.QueryableInstance(this, \"properties\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Folder.prototype, \"serverRelativeUrl\", {\n /**\n * Gets this folder's server relative url\n *\n */\n get: function () {\n return new queryable_1.Queryable(this, \"serverRelativeUrl\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Folder.prototype, \"uniqueContentTypeOrder\", {\n /**\n * Gets a value that specifies the content type order.\n *\n */\n get: function () {\n return new queryable_1.QueryableCollection(this, \"uniqueContentTypeOrder\");\n },\n enumerable: true,\n configurable: true\n });\n Folder.prototype.update = function (properties) {\n var _this = this;\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": \"SP.Folder\" },\n }, properties));\n return this.post({\n body: postBody,\n headers: {\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n return {\n data: data,\n folder: _this,\n };\n });\n };\n /**\n * Delete this folder\n *\n * @param eTag Value used in the IF-Match header, by default \"*\"\n */\n Folder.prototype.delete = function (eTag) {\n if (eTag === void 0) { eTag = \"*\"; }\n return this.clone(Folder, null, true).post({\n headers: {\n \"IF-Match\": eTag,\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n /**\n * Moves the folder to the Recycle Bin and returns the identifier of the new Recycle Bin item.\n */\n Folder.prototype.recycle = function () {\n return this.clone(Folder, \"recycle\", true).post();\n };\n /**\n * Gets the associated list item for this folder, loading the default properties\n */\n Folder.prototype.getItem = function () {\n var selects = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n selects[_i] = arguments[_i];\n }\n var q = this.listItemAllFields;\n return q.select.apply(q, selects).get().then(function (d) {\n return util_1.Util.extend(new items_1.Item(odata_1.getEntityUrl(d)), d);\n });\n };\n return Folder;\n}(queryableshareable_1.QueryableShareableFolder));\nexports.Folder = Folder;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/sharepoint/folders.js\n// module id = 9\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar queryable_1 = require(\"./queryable\");\nvar queryableshareable_1 = require(\"./queryableshareable\");\nvar folders_1 = require(\"./folders\");\nvar files_1 = require(\"./files\");\nvar contenttypes_1 = require(\"./contenttypes\");\nvar util_1 = require(\"../utils/util\");\nvar odata_1 = require(\"./odata\");\nvar attachmentfiles_1 = require(\"./attachmentfiles\");\nvar lists_1 = require(\"./lists\");\n/**\n * Describes a collection of Item objects\n *\n */\nvar Items = (function (_super) {\n __extends(Items, _super);\n /**\n * Creates a new instance of the Items class\n *\n * @param baseUrl The url or Queryable which forms the parent of this fields collection\n */\n function Items(baseUrl, path) {\n if (path === void 0) { path = \"items\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * Gets an Item by id\n *\n * @param id The integer id of the item to retrieve\n */\n Items.prototype.getById = function (id) {\n var i = new Item(this);\n i.concat(\"(\" + id + \")\");\n return i;\n };\n /**\n * Skips the specified number of items (https://msdn.microsoft.com/en-us/library/office/fp142385.aspx#sectionSection6)\n *\n * @param skip The starting id where the page should start, use with top to specify pages\n */\n Items.prototype.skip = function (skip) {\n this._query.add(\"$skiptoken\", encodeURIComponent(\"Paged=TRUE&p_ID=\" + skip));\n return this;\n };\n /**\n * Gets a collection designed to aid in paging through data\n *\n */\n Items.prototype.getPaged = function () {\n return this.getAs(new PagedItemCollectionParser());\n };\n //\n /**\n * Adds a new item to the collection\n *\n * @param properties The new items's properties\n */\n Items.prototype.add = function (properties, listItemEntityTypeFullName) {\n var _this = this;\n if (properties === void 0) { properties = {}; }\n if (listItemEntityTypeFullName === void 0) { listItemEntityTypeFullName = null; }\n var removeDependency = this.addBatchDependency();\n return this.ensureListItemEntityTypeName(listItemEntityTypeFullName).then(function (listItemEntityType) {\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": listItemEntityType },\n }, properties));\n var promise = _this.clone(Items, null, true).postAs({ body: postBody }).then(function (data) {\n return {\n data: data,\n item: _this.getById(data.Id),\n };\n });\n removeDependency();\n return promise;\n });\n };\n /**\n * Ensures we have the proper list item entity type name, either from the value provided or from the list\n *\n * @param candidatelistItemEntityTypeFullName The potential type name\n */\n Items.prototype.ensureListItemEntityTypeName = function (candidatelistItemEntityTypeFullName) {\n return candidatelistItemEntityTypeFullName ?\n Promise.resolve(candidatelistItemEntityTypeFullName) :\n this.getParent(lists_1.List).getListItemEntityTypeFullName();\n };\n return Items;\n}(queryable_1.QueryableCollection));\nexports.Items = Items;\n/**\n * Descrines a single Item instance\n *\n */\nvar Item = (function (_super) {\n __extends(Item, _super);\n function Item() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(Item.prototype, \"attachmentFiles\", {\n /**\n * Gets the set of attachments for this item\n *\n */\n get: function () {\n return new attachmentfiles_1.AttachmentFiles(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Item.prototype, \"contentType\", {\n /**\n * Gets the content type for this item\n *\n */\n get: function () {\n return new contenttypes_1.ContentType(this, \"ContentType\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Item.prototype, \"effectiveBasePermissions\", {\n /**\n * Gets the effective base permissions for the item\n *\n */\n get: function () {\n return new queryable_1.Queryable(this, \"EffectiveBasePermissions\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Item.prototype, \"effectiveBasePermissionsForUI\", {\n /**\n * Gets the effective base permissions for the item in a UI context\n *\n */\n get: function () {\n return new queryable_1.Queryable(this, \"EffectiveBasePermissionsForUI\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Item.prototype, \"fieldValuesAsHTML\", {\n /**\n * Gets the field values for this list item in their HTML representation\n *\n */\n get: function () {\n return new queryable_1.QueryableInstance(this, \"FieldValuesAsHTML\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Item.prototype, \"fieldValuesAsText\", {\n /**\n * Gets the field values for this list item in their text representation\n *\n */\n get: function () {\n return new queryable_1.QueryableInstance(this, \"FieldValuesAsText\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Item.prototype, \"fieldValuesForEdit\", {\n /**\n * Gets the field values for this list item for use in editing controls\n *\n */\n get: function () {\n return new queryable_1.QueryableInstance(this, \"FieldValuesForEdit\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Item.prototype, \"folder\", {\n /**\n * Gets the folder associated with this list item (if this item represents a folder)\n *\n */\n get: function () {\n return new folders_1.Folder(this, \"folder\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Item.prototype, \"file\", {\n /**\n * Gets the folder associated with this list item (if this item represents a folder)\n *\n */\n get: function () {\n return new files_1.File(this, \"file\");\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Updates this list intance with the supplied properties\n *\n * @param properties A plain object hash of values to update for the list\n * @param eTag Value used in the IF-Match header, by default \"*\"\n */\n Item.prototype.update = function (properties, eTag) {\n var _this = this;\n if (eTag === void 0) { eTag = \"*\"; }\n return new Promise(function (resolve, reject) {\n var removeDependency = _this.addBatchDependency();\n var parentList = _this.getParent(queryable_1.QueryableInstance, _this.parentUrl.substr(0, _this.parentUrl.lastIndexOf(\"/\")));\n parentList.select(\"ListItemEntityTypeFullName\").getAs().then(function (d) {\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": d.ListItemEntityTypeFullName },\n }, properties));\n removeDependency();\n return _this.post({\n body: postBody,\n headers: {\n \"IF-Match\": eTag,\n \"X-HTTP-Method\": \"MERGE\",\n },\n }, new ItemUpdatedParser()).then(function (data) {\n resolve({\n data: data,\n item: _this,\n });\n });\n }).catch(function (e) { return reject(e); });\n });\n };\n /**\n * Delete this item\n *\n * @param eTag Value used in the IF-Match header, by default \"*\"\n */\n Item.prototype.delete = function (eTag) {\n if (eTag === void 0) { eTag = \"*\"; }\n return this.post({\n headers: {\n \"IF-Match\": eTag,\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n /**\n * Moves the list item to the Recycle Bin and returns the identifier of the new Recycle Bin item.\n */\n Item.prototype.recycle = function () {\n return this.clone(Item, \"recycle\", true).post();\n };\n /**\n * Gets a string representation of the full URL to the WOPI frame.\n * If there is no associated WOPI application, or no associated action, an empty string is returned.\n *\n * @param action Display mode: 0: view, 1: edit, 2: mobileView, 3: interactivePreview\n */\n Item.prototype.getWopiFrameUrl = function (action) {\n if (action === void 0) { action = 0; }\n var i = this.clone(Item, \"getWOPIFrameUrl(@action)\", true);\n i._query.add(\"@action\", action);\n return i.post().then(function (data) {\n return data.GetWOPIFrameUrl;\n });\n };\n /**\n * Validates and sets the values of the specified collection of fields for the list item.\n *\n * @param formValues The fields to change and their new values.\n * @param newDocumentUpdate true if the list item is a document being updated after upload; otherwise false.\n */\n Item.prototype.validateUpdateListItem = function (formValues, newDocumentUpdate) {\n if (newDocumentUpdate === void 0) { newDocumentUpdate = false; }\n return this.clone(Item, \"validateupdatelistitem\", true).post({\n body: JSON.stringify({ \"formValues\": formValues, bNewDocumentUpdate: newDocumentUpdate }),\n });\n };\n return Item;\n}(queryableshareable_1.QueryableShareableItem));\nexports.Item = Item;\n/**\n * Provides paging functionality for list items\n */\nvar PagedItemCollection = (function () {\n function PagedItemCollection(nextUrl, results) {\n this.nextUrl = nextUrl;\n this.results = results;\n }\n Object.defineProperty(PagedItemCollection.prototype, \"hasNext\", {\n /**\n * If true there are more results available in the set, otherwise there are not\n */\n get: function () {\n return typeof this.nextUrl === \"string\" && this.nextUrl.length > 0;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Gets the next set of results, or resolves to null if no results are available\n */\n PagedItemCollection.prototype.getNext = function () {\n if (this.hasNext) {\n var items = new Items(this.nextUrl, null);\n return items.getPaged();\n }\n return new Promise(function (r) { return r(null); });\n };\n return PagedItemCollection;\n}());\nexports.PagedItemCollection = PagedItemCollection;\nvar PagedItemCollectionParser = (function (_super) {\n __extends(PagedItemCollectionParser, _super);\n function PagedItemCollectionParser() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n PagedItemCollectionParser.prototype.parse = function (r) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n if (_this.handleError(r, reject)) {\n r.json().then(function (json) {\n var nextUrl = json.hasOwnProperty(\"d\") && json.d.hasOwnProperty(\"__next\") ? json.d.__next : json[\"odata.nextLink\"];\n resolve(new PagedItemCollection(nextUrl, _this.parseODataJSON(json)));\n });\n }\n });\n };\n return PagedItemCollectionParser;\n}(odata_1.ODataParserBase));\nvar ItemUpdatedParser = (function (_super) {\n __extends(ItemUpdatedParser, _super);\n function ItemUpdatedParser() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ItemUpdatedParser.prototype.parse = function (r) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n if (_this.handleError(r, reject)) {\n resolve({\n \"odata.etag\": r.headers.get(\"etag\"),\n });\n }\n });\n };\n return ItemUpdatedParser;\n}(odata_1.ODataParserBase));\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/sharepoint/items.js\n// module id = 10\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar items_1 = require(\"./items\");\nvar views_1 = require(\"./views\");\nvar contenttypes_1 = require(\"./contenttypes\");\nvar fields_1 = require(\"./fields\");\nvar forms_1 = require(\"./forms\");\nvar subscriptions_1 = require(\"./subscriptions\");\nvar queryable_1 = require(\"./queryable\");\nvar queryablesecurable_1 = require(\"./queryablesecurable\");\nvar util_1 = require(\"../utils/util\");\nvar usercustomactions_1 = require(\"./usercustomactions\");\nvar odata_1 = require(\"./odata\");\nvar exceptions_1 = require(\"../utils/exceptions\");\nvar folders_1 = require(\"./folders\");\n/**\n * Describes a collection of List objects\n *\n */\nvar Lists = (function (_super) {\n __extends(Lists, _super);\n /**\n * Creates a new instance of the Lists class\n *\n * @param baseUrl The url or Queryable which forms the parent of this fields collection\n */\n function Lists(baseUrl, path) {\n if (path === void 0) { path = \"lists\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * Gets a list from the collection by title\n *\n * @param title The title of the list\n */\n Lists.prototype.getByTitle = function (title) {\n return new List(this, \"getByTitle('\" + title + \"')\");\n };\n /**\n * Gets a list from the collection by guid id\n *\n * @param id The Id of the list (GUID)\n */\n Lists.prototype.getById = function (id) {\n var list = new List(this);\n list.concat(\"('\" + id + \"')\");\n return list;\n };\n /**\n * Adds a new list to the collection\n *\n * @param title The new list's title\n * @param description The new list's description\n * @param template The list template value\n * @param enableContentTypes If true content types will be allowed and enabled, otherwise they will be disallowed and not enabled\n * @param additionalSettings Will be passed as part of the list creation body\n */\n Lists.prototype.add = function (title, description, template, enableContentTypes, additionalSettings) {\n var _this = this;\n if (description === void 0) { description = \"\"; }\n if (template === void 0) { template = 100; }\n if (enableContentTypes === void 0) { enableContentTypes = false; }\n if (additionalSettings === void 0) { additionalSettings = {}; }\n var addSettings = util_1.Util.extend({\n \"AllowContentTypes\": enableContentTypes,\n \"BaseTemplate\": template,\n \"ContentTypesEnabled\": enableContentTypes,\n \"Description\": description,\n \"Title\": title,\n \"__metadata\": { \"type\": \"SP.List\" },\n }, additionalSettings);\n return this.post({ body: JSON.stringify(addSettings) }).then(function (data) {\n return { data: data, list: _this.getByTitle(addSettings.Title) };\n });\n };\n /**\n * Ensures that the specified list exists in the collection (note: this method not supported for batching)\n *\n * @param title The new list's title\n * @param description The new list's description\n * @param template The list template value\n * @param enableContentTypes If true content types will be allowed and enabled, otherwise they will be disallowed and not enabled\n * @param additionalSettings Will be passed as part of the list creation body or used to update an existing list\n */\n Lists.prototype.ensure = function (title, description, template, enableContentTypes, additionalSettings) {\n var _this = this;\n if (description === void 0) { description = \"\"; }\n if (template === void 0) { template = 100; }\n if (enableContentTypes === void 0) { enableContentTypes = false; }\n if (additionalSettings === void 0) { additionalSettings = {}; }\n if (this.hasBatch) {\n throw new exceptions_1.NotSupportedInBatchException(\"The ensure list method\");\n }\n return new Promise(function (resolve, reject) {\n var addOrUpdateSettings = util_1.Util.extend(additionalSettings, { Title: title, Description: description, ContentTypesEnabled: enableContentTypes }, true);\n var list = _this.getByTitle(addOrUpdateSettings.Title);\n list.get().then(function (_) {\n list.update(addOrUpdateSettings).then(function (d) {\n resolve({ created: false, data: d, list: _this.getByTitle(addOrUpdateSettings.Title) });\n }).catch(function (e) { return reject(e); });\n }).catch(function (_) {\n _this.add(title, description, template, enableContentTypes, addOrUpdateSettings).then(function (r) {\n resolve({ created: true, data: r.data, list: _this.getByTitle(addOrUpdateSettings.Title) });\n }).catch(function (e) { return reject(e); });\n });\n });\n };\n /**\n * Gets a list that is the default asset location for images or other files, which the users upload to their wiki pages.\n */\n Lists.prototype.ensureSiteAssetsLibrary = function () {\n return this.clone(Lists, \"ensuresiteassetslibrary\", true).post().then(function (json) {\n return new List(odata_1.extractOdataId(json));\n });\n };\n /**\n * Gets a list that is the default location for wiki pages.\n */\n Lists.prototype.ensureSitePagesLibrary = function () {\n return this.clone(Lists, \"ensuresitepageslibrary\", true).post().then(function (json) {\n return new List(odata_1.extractOdataId(json));\n });\n };\n return Lists;\n}(queryable_1.QueryableCollection));\nexports.Lists = Lists;\n/**\n * Describes a single List instance\n *\n */\nvar List = (function (_super) {\n __extends(List, _super);\n function List() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(List.prototype, \"contentTypes\", {\n /**\n * Gets the content types in this list\n *\n */\n get: function () {\n return new contenttypes_1.ContentTypes(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"items\", {\n /**\n * Gets the items in this list\n *\n */\n get: function () {\n return new items_1.Items(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"views\", {\n /**\n * Gets the views in this list\n *\n */\n get: function () {\n return new views_1.Views(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"fields\", {\n /**\n * Gets the fields in this list\n *\n */\n get: function () {\n return new fields_1.Fields(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"forms\", {\n /**\n * Gets the forms in this list\n *\n */\n get: function () {\n return new forms_1.Forms(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"defaultView\", {\n /**\n * Gets the default view of this list\n *\n */\n get: function () {\n return new queryable_1.QueryableInstance(this, \"DefaultView\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"userCustomActions\", {\n /**\n * Get all custom actions on a site collection\n *\n */\n get: function () {\n return new usercustomactions_1.UserCustomActions(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"effectiveBasePermissions\", {\n /**\n * Gets the effective base permissions of this list\n *\n */\n get: function () {\n return new queryable_1.Queryable(this, \"EffectiveBasePermissions\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"eventReceivers\", {\n /**\n * Gets the event receivers attached to this list\n *\n */\n get: function () {\n return new queryable_1.QueryableCollection(this, \"EventReceivers\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"relatedFields\", {\n /**\n * Gets the related fields of this list\n *\n */\n get: function () {\n return new queryable_1.Queryable(this, \"getRelatedFields\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"informationRightsManagementSettings\", {\n /**\n * Gets the IRM settings for this list\n *\n */\n get: function () {\n return new queryable_1.Queryable(this, \"InformationRightsManagementSettings\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"subscriptions\", {\n /**\n * Gets the webhook subscriptions of this list\n *\n */\n get: function () {\n return new subscriptions_1.Subscriptions(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"rootFolder\", {\n /**\n * The root folder of the list\n */\n get: function () {\n return new folders_1.Folder(this, \"rootFolder\");\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Gets a view by view guid id\n *\n */\n List.prototype.getView = function (viewId) {\n return new views_1.View(this, \"getView('\" + viewId + \"')\");\n };\n /**\n * Updates this list intance with the supplied properties\n *\n * @param properties A plain object hash of values to update for the list\n * @param eTag Value used in the IF-Match header, by default \"*\"\n */\n /* tslint:disable no-string-literal */\n List.prototype.update = function (properties, eTag) {\n var _this = this;\n if (eTag === void 0) { eTag = \"*\"; }\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": \"SP.List\" },\n }, properties));\n return this.post({\n body: postBody,\n headers: {\n \"IF-Match\": eTag,\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n var retList = _this;\n if (properties.hasOwnProperty(\"Title\")) {\n retList = _this.getParent(List, _this.parentUrl, \"getByTitle('\" + properties[\"Title\"] + \"')\");\n }\n return {\n data: data,\n list: retList,\n };\n });\n };\n /* tslint:enable */\n /**\n * Delete this list\n *\n * @param eTag Value used in the IF-Match header, by default \"*\"\n */\n List.prototype.delete = function (eTag) {\n if (eTag === void 0) { eTag = \"*\"; }\n return this.post({\n headers: {\n \"IF-Match\": eTag,\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n /**\n * Returns the collection of changes from the change log that have occurred within the list, based on the specified query.\n */\n List.prototype.getChanges = function (query) {\n return this.clone(List, \"getchanges\", true).post({\n body: JSON.stringify({ \"query\": util_1.Util.extend({ \"__metadata\": { \"type\": \"SP.ChangeQuery\" } }, query) }),\n });\n };\n /**\n * Returns a collection of items from the list based on the specified query.\n *\n * @param CamlQuery The Query schema of Collaborative Application Markup\n * Language (CAML) is used in various ways within the context of Microsoft SharePoint Foundation\n * to define queries against list data.\n * see:\n *\n * https://msdn.microsoft.com/en-us/library/office/ms467521.aspx\n *\n * @param expands A URI with a $expand System Query Option indicates that Entries associated with\n * the Entry or Collection of Entries identified by the Resource Path\n * section of the URI must be represented inline (i.e. eagerly loaded).\n * see:\n *\n * https://msdn.microsoft.com/en-us/library/office/fp142385.aspx\n *\n * http://www.odata.org/documentation/odata-version-2-0/uri-conventions/#ExpandSystemQueryOption\n */\n List.prototype.getItemsByCAMLQuery = function (query) {\n var expands = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n expands[_i - 1] = arguments[_i];\n }\n var q = this.clone(List, \"getitems\", true);\n return q.expand.apply(q, expands).post({\n body: JSON.stringify({ \"query\": util_1.Util.extend({ \"__metadata\": { \"type\": \"SP.CamlQuery\" } }, query) }),\n });\n };\n /**\n * See: https://msdn.microsoft.com/en-us/library/office/dn292554.aspx\n */\n List.prototype.getListItemChangesSinceToken = function (query) {\n return this.clone(List, \"getlistitemchangessincetoken\", true).post({\n body: JSON.stringify({ \"query\": util_1.Util.extend({ \"__metadata\": { \"type\": \"SP.ChangeLogItemQuery\" } }, query) }),\n }, { parse: function (r) { return r.text(); } });\n };\n /**\n * Moves the list to the Recycle Bin and returns the identifier of the new Recycle Bin item.\n */\n List.prototype.recycle = function () {\n return this.clone(List, \"recycle\", true).post().then(function (data) {\n if (data.hasOwnProperty(\"Recycle\")) {\n return data.Recycle;\n }\n else {\n return data;\n }\n });\n };\n /**\n * Renders list data based on the view xml provided\n */\n List.prototype.renderListData = function (viewXml) {\n var q = this.clone(List, \"renderlistdata(@viewXml)\");\n q.query.add(\"@viewXml\", \"'\" + viewXml + \"'\");\n return q.post().then(function (data) {\n // data will be a string, so we parse it again\n data = JSON.parse(data);\n if (data.hasOwnProperty(\"RenderListData\")) {\n return data.RenderListData;\n }\n else {\n return data;\n }\n });\n };\n /**\n * Gets the field values and field schema attributes for a list item.\n */\n List.prototype.renderListFormData = function (itemId, formId, mode) {\n return this.clone(List, \"renderlistformdata(itemid=\" + itemId + \", formid='\" + formId + \"', mode='\" + mode + \"')\", true).post().then(function (data) {\n // data will be a string, so we parse it again\n data = JSON.parse(data);\n if (data.hasOwnProperty(\"ListData\")) {\n return data.ListData;\n }\n else {\n return data;\n }\n });\n };\n /**\n * Reserves a list item ID for idempotent list item creation.\n */\n List.prototype.reserveListItemId = function () {\n return this.clone(List, \"reservelistitemid\", true).post().then(function (data) {\n if (data.hasOwnProperty(\"ReserveListItemId\")) {\n return data.ReserveListItemId;\n }\n else {\n return data;\n }\n });\n };\n /**\n * Returns the ListItemEntityTypeFullName for this list, used when adding/updating list items. Does not support batching.\n *\n */\n List.prototype.getListItemEntityTypeFullName = function () {\n return this.clone(List, null).select(\"ListItemEntityTypeFullName\").getAs().then(function (o) { return o.ListItemEntityTypeFullName; });\n };\n return List;\n}(queryablesecurable_1.QueryableSecurable));\nexports.List = List;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/sharepoint/lists.js\n// module id = 11\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar util_1 = require(\"../utils/util\");\nvar webs_1 = require(\"./webs\");\nvar odata_1 = require(\"./odata\");\nvar queryable_1 = require(\"./queryable\");\nvar queryablesecurable_1 = require(\"./queryablesecurable\");\nvar types_1 = require(\"./types\");\n/**\n * Internal helper class used to augment classes to include sharing functionality\n */\nvar QueryableShareable = (function (_super) {\n __extends(QueryableShareable, _super);\n function QueryableShareable() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Gets a sharing link for the supplied\n *\n * @param kind The kind of link to share\n * @param expiration The optional expiration for this link\n */\n QueryableShareable.prototype.getShareLink = function (kind, expiration) {\n if (expiration === void 0) { expiration = null; }\n // date needs to be an ISO string or null\n var expString = expiration !== null ? expiration.toISOString() : null;\n // clone using the factory and send the request\n return this.clone(QueryableShareable, \"shareLink\", true).postAs({\n body: JSON.stringify({\n request: {\n createLink: true,\n emailData: null,\n settings: {\n expiration: expString,\n linkKind: kind,\n },\n },\n }),\n });\n };\n /**\n * Shares this instance with the supplied users\n *\n * @param loginNames Resolved login names to share\n * @param role The role\n * @param requireSignin True to require the user is authenticated, otherwise false\n * @param propagateAcl True to apply this share to all children\n * @param emailData If supplied an email will be sent with the indicated properties\n */\n QueryableShareable.prototype.shareWith = function (loginNames, role, requireSignin, propagateAcl, emailData) {\n var _this = this;\n if (requireSignin === void 0) { requireSignin = true; }\n if (propagateAcl === void 0) { propagateAcl = false; }\n // handle the multiple input types\n if (!Array.isArray(loginNames)) {\n loginNames = [loginNames];\n }\n var userStr = JSON.stringify(loginNames.map(function (login) { return { Key: login }; }));\n var roleFilter = role === types_1.SharingRole.Edit ? types_1.RoleType.Contributor : types_1.RoleType.Reader;\n // start by looking up the role definition id we need to set the roleValue\n return webs_1.Web.fromUrl(this.toUrl()).roleDefinitions.select(\"Id\").filter(\"RoleTypeKind eq \" + roleFilter).get().then(function (def) {\n if (!Array.isArray(def) || def.length < 1) {\n throw new Error(\"Could not locate a role defintion with RoleTypeKind \" + roleFilter);\n }\n var postBody = {\n includeAnonymousLinkInEmail: requireSignin,\n peoplePickerInput: userStr,\n propagateAcl: propagateAcl,\n roleValue: \"role:\" + def[0].Id,\n useSimplifiedRoles: true,\n };\n if (typeof emailData !== \"undefined\") {\n postBody = util_1.Util.extend(postBody, {\n emailBody: emailData.body,\n emailSubject: typeof emailData.subject !== \"undefined\" ? \"\" : emailData.subject,\n sendEmail: true,\n });\n }\n return _this.clone(QueryableShareable, \"shareObject\", true).postAs({\n body: JSON.stringify(postBody),\n });\n });\n };\n /**\n * Shares an object based on the supplied options\n *\n * @param options The set of options to send to the ShareObject method\n * @param bypass If true any processing is skipped and the options are sent directly to the ShareObject method\n */\n QueryableShareable.prototype.shareObject = function (options, bypass) {\n var _this = this;\n if (bypass === void 0) { bypass = false; }\n if (bypass) {\n // if the bypass flag is set send the supplied parameters directly to the service\n return this.sendShareObjectRequest(options);\n }\n // extend our options with some defaults\n options = util_1.Util.extend(options, {\n group: null,\n includeAnonymousLinkInEmail: false,\n propagateAcl: false,\n useSimplifiedRoles: true,\n }, true);\n return this.getRoleValue(options.role, options.group).then(function (roleValue) {\n // handle the multiple input types\n if (!Array.isArray(options.loginNames)) {\n options.loginNames = [options.loginNames];\n }\n var userStr = JSON.stringify(options.loginNames.map(function (login) { return { Key: login }; }));\n var postBody = {\n peoplePickerInput: userStr,\n roleValue: roleValue,\n url: options.url,\n };\n if (typeof options.emailData !== \"undefined\" && options.emailData !== null) {\n postBody = util_1.Util.extend(postBody, {\n emailBody: options.emailData.body,\n emailSubject: typeof options.emailData.subject !== \"undefined\" ? \"Shared for you.\" : options.emailData.subject,\n sendEmail: true,\n });\n }\n return _this.sendShareObjectRequest(postBody);\n });\n };\n /**\n * Calls the web's UnshareObject method\n *\n * @param url The url of the object to unshare\n */\n QueryableShareable.prototype.unshareObjectWeb = function (url) {\n return this.clone(QueryableShareable, \"unshareObject\", true).postAs({\n body: JSON.stringify({\n url: url,\n }),\n });\n };\n /**\n * Checks Permissions on the list of Users and returns back role the users have on the Item.\n *\n * @param recipients The array of Entities for which Permissions need to be checked.\n */\n QueryableShareable.prototype.checkPermissions = function (recipients) {\n return this.clone(QueryableShareable, \"checkPermissions\", true).postAs({\n body: JSON.stringify({\n recipients: recipients,\n }),\n });\n };\n /**\n * Get Sharing Information.\n *\n * @param request The SharingInformationRequest Object.\n */\n QueryableShareable.prototype.getSharingInformation = function (request) {\n if (request === void 0) { request = null; }\n return this.clone(QueryableShareable, \"getSharingInformation\", true).postAs({\n body: JSON.stringify({\n request: request,\n }),\n });\n };\n /**\n * Gets the sharing settings of an item.\n *\n * @param useSimplifiedRoles Determines whether to use simplified roles.\n */\n QueryableShareable.prototype.getObjectSharingSettings = function (useSimplifiedRoles) {\n if (useSimplifiedRoles === void 0) { useSimplifiedRoles = true; }\n return this.clone(QueryableShareable, \"getObjectSharingSettings\", true).postAs({\n body: JSON.stringify({\n useSimplifiedRoles: useSimplifiedRoles,\n }),\n });\n };\n /**\n * Unshares this object\n */\n QueryableShareable.prototype.unshareObject = function () {\n return this.clone(QueryableShareable, \"unshareObject\", true).postAs();\n };\n /**\n * Deletes a link by type\n *\n * @param kind Deletes a sharing link by the kind of link\n */\n QueryableShareable.prototype.deleteLinkByKind = function (kind) {\n return this.clone(QueryableShareable, \"deleteLinkByKind\", true).post({\n body: JSON.stringify({ linkKind: kind }),\n });\n };\n /**\n * Removes the specified link to the item.\n *\n * @param kind The kind of link to be deleted.\n * @param shareId\n */\n QueryableShareable.prototype.unshareLink = function (kind, shareId) {\n if (shareId === void 0) { shareId = \"00000000-0000-0000-0000-000000000000\"; }\n return this.clone(QueryableShareable, \"unshareLink\", true).post({\n body: JSON.stringify({ linkKind: kind, shareId: shareId }),\n });\n };\n /**\n * Calculates the roleValue string used in the sharing query\n *\n * @param role The Sharing Role\n * @param group The Group type\n */\n QueryableShareable.prototype.getRoleValue = function (role, group) {\n // we will give group precedence, because we had to make a choice\n if (typeof group !== \"undefined\" && group !== null) {\n switch (group) {\n case types_1.RoleType.Contributor:\n return webs_1.Web.fromUrl(this.toUrl()).associatedMemberGroup.select(\"Id\").getAs().then(function (g) { return \"group: \" + g.Id; });\n case types_1.RoleType.Reader:\n case types_1.RoleType.Guest:\n return webs_1.Web.fromUrl(this.toUrl()).associatedVisitorGroup.select(\"Id\").getAs().then(function (g) { return \"group: \" + g.Id; });\n default:\n throw new Error(\"Could not determine role value for supplied value. Contributor, Reader, and Guest are supported\");\n }\n }\n else {\n var roleFilter = role === types_1.SharingRole.Edit ? types_1.RoleType.Contributor : types_1.RoleType.Reader;\n return webs_1.Web.fromUrl(this.toUrl()).roleDefinitions.select(\"Id\").top(1).filter(\"RoleTypeKind eq \" + roleFilter).getAs().then(function (def) {\n if (def.length < 1) {\n throw new Error(\"Could not locate associated role definition for supplied role. Edit and View are supported\");\n }\n return \"role: \" + def[0].Id;\n });\n }\n };\n QueryableShareable.prototype.getShareObjectWeb = function (candidate) {\n return Promise.resolve(webs_1.Web.fromUrl(candidate, \"/_api/SP.Web.ShareObject\"));\n };\n QueryableShareable.prototype.sendShareObjectRequest = function (options) {\n return this.getShareObjectWeb(this.toUrl()).then(function (web) {\n return web.expand(\"UsersWithAccessRequests\", \"GroupsSharedWith\").as(QueryableShareable).post({\n body: JSON.stringify(options),\n });\n });\n };\n return QueryableShareable;\n}(queryable_1.Queryable));\nexports.QueryableShareable = QueryableShareable;\nvar QueryableShareableWeb = (function (_super) {\n __extends(QueryableShareableWeb, _super);\n function QueryableShareableWeb() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Shares this web with the supplied users\n * @param loginNames The resolved login names to share\n * @param role The role to share this web\n * @param emailData Optional email data\n */\n QueryableShareableWeb.prototype.shareWith = function (loginNames, role, emailData) {\n var _this = this;\n if (role === void 0) { role = types_1.SharingRole.View; }\n var dependency = this.addBatchDependency();\n return webs_1.Web.fromUrl(this.toUrl(), \"/_api/web/url\").get().then(function (url) {\n dependency();\n return _this.shareObject(util_1.Util.combinePaths(url, \"/_layouts/15/aclinv.aspx?forSharing=1&mbypass=1\"), loginNames, role, emailData);\n });\n };\n /**\n * Provides direct access to the static web.ShareObject method\n *\n * @param url The url to share\n * @param loginNames Resolved loginnames string[] of a single login name string\n * @param roleValue Role value\n * @param emailData Optional email data\n * @param groupId Optional group id\n * @param propagateAcl\n * @param includeAnonymousLinkInEmail\n * @param useSimplifiedRoles\n */\n QueryableShareableWeb.prototype.shareObject = function (url, loginNames, role, emailData, group, propagateAcl, includeAnonymousLinkInEmail, useSimplifiedRoles) {\n if (propagateAcl === void 0) { propagateAcl = false; }\n if (includeAnonymousLinkInEmail === void 0) { includeAnonymousLinkInEmail = false; }\n if (useSimplifiedRoles === void 0) { useSimplifiedRoles = true; }\n return this.clone(QueryableShareable, null, true).shareObject({\n emailData: emailData,\n group: group,\n includeAnonymousLinkInEmail: includeAnonymousLinkInEmail,\n loginNames: loginNames,\n propagateAcl: propagateAcl,\n role: role,\n url: url,\n useSimplifiedRoles: useSimplifiedRoles,\n });\n };\n /**\n * Supplies a method to pass any set of arguments to ShareObject\n *\n * @param options The set of options to send to ShareObject\n */\n QueryableShareableWeb.prototype.shareObjectRaw = function (options) {\n return this.clone(QueryableShareable, null, true).shareObject(options, true);\n };\n /**\n * Unshares the object\n *\n * @param url The url of the object to stop sharing\n */\n QueryableShareableWeb.prototype.unshareObject = function (url) {\n return this.clone(QueryableShareable, null, true).unshareObjectWeb(url);\n };\n return QueryableShareableWeb;\n}(queryablesecurable_1.QueryableSecurable));\nexports.QueryableShareableWeb = QueryableShareableWeb;\nvar QueryableShareableItem = (function (_super) {\n __extends(QueryableShareableItem, _super);\n function QueryableShareableItem() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Gets a link suitable for sharing for this item\n *\n * @param kind The type of link to share\n * @param expiration The optional expiration date\n */\n QueryableShareableItem.prototype.getShareLink = function (kind, expiration) {\n if (kind === void 0) { kind = types_1.SharingLinkKind.OrganizationView; }\n if (expiration === void 0) { expiration = null; }\n return this.clone(QueryableShareable, null, true).getShareLink(kind, expiration);\n };\n /**\n * Shares this item with one or more users\n *\n * @param loginNames string or string[] of resolved login names to which this item will be shared\n * @param role The role (View | Edit) applied to the share\n * @param emailData Optional, if inlucded an email will be sent. Note subject currently has no effect.\n */\n QueryableShareableItem.prototype.shareWith = function (loginNames, role, requireSignin, emailData) {\n if (role === void 0) { role = types_1.SharingRole.View; }\n if (requireSignin === void 0) { requireSignin = true; }\n return this.clone(QueryableShareable, null, true).shareWith(loginNames, role, requireSignin, false, emailData);\n };\n /**\n * Checks Permissions on the list of Users and returns back role the users have on the Item.\n *\n * @param recipients The array of Entities for which Permissions need to be checked.\n */\n QueryableShareableItem.prototype.checkSharingPermissions = function (recipients) {\n return this.clone(QueryableShareable, null, true).checkPermissions(recipients);\n };\n /**\n * Get Sharing Information.\n *\n * @param request The SharingInformationRequest Object.\n */\n QueryableShareableItem.prototype.getSharingInformation = function (request) {\n if (request === void 0) { request = null; }\n return this.clone(QueryableShareable, null, true).getSharingInformation(request);\n };\n /**\n * Gets the sharing settings of an item.\n *\n * @param useSimplifiedRoles Determines whether to use simplified roles.\n */\n QueryableShareableItem.prototype.getObjectSharingSettings = function (useSimplifiedRoles) {\n if (useSimplifiedRoles === void 0) { useSimplifiedRoles = true; }\n return this.clone(QueryableShareable, null, true).getObjectSharingSettings(useSimplifiedRoles);\n };\n /**\n * Unshare this item\n */\n QueryableShareableItem.prototype.unshare = function () {\n return this.clone(QueryableShareable, null, true).unshareObject();\n };\n /**\n * Deletes a sharing link by kind\n *\n * @param kind Deletes a sharing link by the kind of link\n */\n QueryableShareableItem.prototype.deleteSharingLinkByKind = function (kind) {\n return this.clone(QueryableShareable, null, true).deleteLinkByKind(kind);\n };\n /**\n * Removes the specified link to the item.\n *\n * @param kind The kind of link to be deleted.\n * @param shareId\n */\n QueryableShareableItem.prototype.unshareLink = function (kind, shareId) {\n return this.clone(QueryableShareable, null, true).unshareLink(kind, shareId);\n };\n return QueryableShareableItem;\n}(queryablesecurable_1.QueryableSecurable));\nexports.QueryableShareableItem = QueryableShareableItem;\nvar FileFolderShared = (function (_super) {\n __extends(FileFolderShared, _super);\n function FileFolderShared() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Gets a link suitable for sharing\n *\n * @param kind The kind of link to get\n * @param expiration Optional, an expiration for this link\n */\n FileFolderShared.prototype.getShareLink = function (kind, expiration) {\n if (kind === void 0) { kind = types_1.SharingLinkKind.OrganizationView; }\n if (expiration === void 0) { expiration = null; }\n var dependency = this.addBatchDependency();\n return this.getShareable().then(function (shareable) {\n dependency();\n return shareable.getShareLink(kind, expiration);\n });\n };\n /**\n * Checks Permissions on the list of Users and returns back role the users have on the Item.\n *\n * @param recipients The array of Entities for which Permissions need to be checked.\n */\n FileFolderShared.prototype.checkSharingPermissions = function (recipients) {\n var dependency = this.addBatchDependency();\n return this.getShareable().then(function (shareable) {\n dependency();\n return shareable.checkPermissions(recipients);\n });\n };\n /**\n * Get Sharing Information.\n *\n * @param request The SharingInformationRequest Object.\n */\n FileFolderShared.prototype.getSharingInformation = function (request) {\n if (request === void 0) { request = null; }\n var dependency = this.addBatchDependency();\n return this.getShareable().then(function (shareable) {\n dependency();\n return shareable.getSharingInformation(request);\n });\n };\n /**\n * Gets the sharing settings of an item.\n *\n * @param useSimplifiedRoles Determines whether to use simplified roles.\n */\n FileFolderShared.prototype.getObjectSharingSettings = function (useSimplifiedRoles) {\n if (useSimplifiedRoles === void 0) { useSimplifiedRoles = true; }\n var dependency = this.addBatchDependency();\n return this.getShareable().then(function (shareable) {\n dependency();\n return shareable.getObjectSharingSettings(useSimplifiedRoles);\n });\n };\n /**\n * Unshare this item\n */\n FileFolderShared.prototype.unshare = function () {\n var dependency = this.addBatchDependency();\n return this.getShareable().then(function (shareable) {\n dependency();\n return shareable.unshareObject();\n });\n };\n /**\n * Deletes a sharing link by the kind of link\n *\n * @param kind The kind of link to be deleted.\n */\n FileFolderShared.prototype.deleteSharingLinkByKind = function (kind) {\n var dependency = this.addBatchDependency();\n return this.getShareable().then(function (shareable) {\n dependency();\n return shareable.deleteLinkByKind(kind);\n });\n };\n /**\n * Removes the specified link to the item.\n *\n * @param kind The kind of link to be deleted.\n * @param shareId The share id to delete\n */\n FileFolderShared.prototype.unshareLink = function (kind, shareId) {\n var dependency = this.addBatchDependency();\n return this.getShareable().then(function (shareable) {\n dependency();\n return shareable.unshareLink(kind, shareId);\n });\n };\n /**\n * For files and folders we need to use the associated item end point\n */\n FileFolderShared.prototype.getShareable = function () {\n var _this = this;\n // sharing only works on the item end point, not the file one - so we create a folder instance with the item url internally\n return this.clone(QueryableShareableFile, \"listItemAllFields\", false).select(\"odata.editlink\").get().then(function (d) {\n var shareable = new QueryableShareable(odata_1.getEntityUrl(d));\n // we need to handle batching\n if (_this.hasBatch) {\n shareable = shareable.inBatch(_this.batch);\n }\n return shareable;\n });\n };\n return FileFolderShared;\n}(queryable_1.QueryableInstance));\nexports.FileFolderShared = FileFolderShared;\nvar QueryableShareableFile = (function (_super) {\n __extends(QueryableShareableFile, _super);\n function QueryableShareableFile() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Shares this item with one or more users\n *\n * @param loginNames string or string[] of resolved login names to which this item will be shared\n * @param role The role (View | Edit) applied to the share\n * @param shareEverything Share everything in this folder, even items with unique permissions.\n * @param requireSignin If true the user must signin to view link, otherwise anyone with the link can access the resource\n * @param emailData Optional, if inlucded an email will be sent. Note subject currently has no effect.\n */\n QueryableShareableFile.prototype.shareWith = function (loginNames, role, requireSignin, emailData) {\n if (role === void 0) { role = types_1.SharingRole.View; }\n if (requireSignin === void 0) { requireSignin = true; }\n var dependency = this.addBatchDependency();\n return this.getShareable().then(function (shareable) {\n dependency();\n return shareable.shareWith(loginNames, role, requireSignin, false, emailData);\n });\n };\n return QueryableShareableFile;\n}(FileFolderShared));\nexports.QueryableShareableFile = QueryableShareableFile;\nvar QueryableShareableFolder = (function (_super) {\n __extends(QueryableShareableFolder, _super);\n function QueryableShareableFolder() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Shares this item with one or more users\n *\n * @param loginNames string or string[] of resolved login names to which this item will be shared\n * @param role The role (View | Edit) applied to the share\n * @param shareEverything Share everything in this folder, even items with unique permissions.\n * @param requireSignin If true the user must signin to view link, otherwise anyone with the link can access the resource\n * @param emailData Optional, if inlucded an email will be sent. Note subject currently has no effect.\n */\n QueryableShareableFolder.prototype.shareWith = function (loginNames, role, requireSignin, shareEverything, emailData) {\n if (role === void 0) { role = types_1.SharingRole.View; }\n if (requireSignin === void 0) { requireSignin = true; }\n if (shareEverything === void 0) { shareEverything = false; }\n var dependency = this.addBatchDependency();\n return this.getShareable().then(function (shareable) {\n dependency();\n return shareable.shareWith(loginNames, role, requireSignin, shareEverything, emailData);\n });\n };\n return QueryableShareableFolder;\n}(FileFolderShared));\nexports.QueryableShareableFolder = QueryableShareableFolder;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/sharepoint/queryableshareable.js\n// module id = 12\n// module chunks = 0","// reference: https://msdn.microsoft.com/en-us/library/office/dn600183.aspx\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Determines the display mode of the given control or view\n */\nvar ControlMode;\n(function (ControlMode) {\n ControlMode[ControlMode[\"Display\"] = 1] = \"Display\";\n ControlMode[ControlMode[\"Edit\"] = 2] = \"Edit\";\n ControlMode[ControlMode[\"New\"] = 3] = \"New\";\n})(ControlMode = exports.ControlMode || (exports.ControlMode = {}));\n/**\n * Specifies the type of the field.\n */\nvar FieldTypes;\n(function (FieldTypes) {\n FieldTypes[FieldTypes[\"Invalid\"] = 0] = \"Invalid\";\n FieldTypes[FieldTypes[\"Integer\"] = 1] = \"Integer\";\n FieldTypes[FieldTypes[\"Text\"] = 2] = \"Text\";\n FieldTypes[FieldTypes[\"Note\"] = 3] = \"Note\";\n FieldTypes[FieldTypes[\"DateTime\"] = 4] = \"DateTime\";\n FieldTypes[FieldTypes[\"Counter\"] = 5] = \"Counter\";\n FieldTypes[FieldTypes[\"Choice\"] = 6] = \"Choice\";\n FieldTypes[FieldTypes[\"Lookup\"] = 7] = \"Lookup\";\n FieldTypes[FieldTypes[\"Boolean\"] = 8] = \"Boolean\";\n FieldTypes[FieldTypes[\"Number\"] = 9] = \"Number\";\n FieldTypes[FieldTypes[\"Currency\"] = 10] = \"Currency\";\n FieldTypes[FieldTypes[\"URL\"] = 11] = \"URL\";\n FieldTypes[FieldTypes[\"Computed\"] = 12] = \"Computed\";\n FieldTypes[FieldTypes[\"Threading\"] = 13] = \"Threading\";\n FieldTypes[FieldTypes[\"Guid\"] = 14] = \"Guid\";\n FieldTypes[FieldTypes[\"MultiChoice\"] = 15] = \"MultiChoice\";\n FieldTypes[FieldTypes[\"GridChoice\"] = 16] = \"GridChoice\";\n FieldTypes[FieldTypes[\"Calculated\"] = 17] = \"Calculated\";\n FieldTypes[FieldTypes[\"File\"] = 18] = \"File\";\n FieldTypes[FieldTypes[\"Attachments\"] = 19] = \"Attachments\";\n FieldTypes[FieldTypes[\"User\"] = 20] = \"User\";\n FieldTypes[FieldTypes[\"Recurrence\"] = 21] = \"Recurrence\";\n FieldTypes[FieldTypes[\"CrossProjectLink\"] = 22] = \"CrossProjectLink\";\n FieldTypes[FieldTypes[\"ModStat\"] = 23] = \"ModStat\";\n FieldTypes[FieldTypes[\"Error\"] = 24] = \"Error\";\n FieldTypes[FieldTypes[\"ContentTypeId\"] = 25] = \"ContentTypeId\";\n FieldTypes[FieldTypes[\"PageSeparator\"] = 26] = \"PageSeparator\";\n FieldTypes[FieldTypes[\"ThreadIndex\"] = 27] = \"ThreadIndex\";\n FieldTypes[FieldTypes[\"WorkflowStatus\"] = 28] = \"WorkflowStatus\";\n FieldTypes[FieldTypes[\"AllDayEvent\"] = 29] = \"AllDayEvent\";\n FieldTypes[FieldTypes[\"WorkflowEventType\"] = 30] = \"WorkflowEventType\";\n})(FieldTypes = exports.FieldTypes || (exports.FieldTypes = {}));\nvar DateTimeFieldFormatType;\n(function (DateTimeFieldFormatType) {\n DateTimeFieldFormatType[DateTimeFieldFormatType[\"DateOnly\"] = 0] = \"DateOnly\";\n DateTimeFieldFormatType[DateTimeFieldFormatType[\"DateTime\"] = 1] = \"DateTime\";\n})(DateTimeFieldFormatType = exports.DateTimeFieldFormatType || (exports.DateTimeFieldFormatType = {}));\n/**\n * Specifies the control settings while adding a field.\n */\nvar AddFieldOptions;\n(function (AddFieldOptions) {\n /**\n * Specify that a new field added to the list must also be added to the default content type in the site collection\n */\n AddFieldOptions[AddFieldOptions[\"DefaultValue\"] = 0] = \"DefaultValue\";\n /**\n * Specify that a new field added to the list must also be added to the default content type in the site collection.\n */\n AddFieldOptions[AddFieldOptions[\"AddToDefaultContentType\"] = 1] = \"AddToDefaultContentType\";\n /**\n * Specify that a new field must not be added to any other content type\n */\n AddFieldOptions[AddFieldOptions[\"AddToNoContentType\"] = 2] = \"AddToNoContentType\";\n /**\n * Specify that a new field that is added to the specified list must also be added to all content types in the site collection\n */\n AddFieldOptions[AddFieldOptions[\"AddToAllContentTypes\"] = 4] = \"AddToAllContentTypes\";\n /**\n * Specify adding an internal field name hint for the purpose of avoiding possible database locking or field renaming operations\n */\n AddFieldOptions[AddFieldOptions[\"AddFieldInternalNameHint\"] = 8] = \"AddFieldInternalNameHint\";\n /**\n * Specify that a new field that is added to the specified list must also be added to the default list view\n */\n AddFieldOptions[AddFieldOptions[\"AddFieldToDefaultView\"] = 16] = \"AddFieldToDefaultView\";\n /**\n * Specify to confirm that no other field has the same display name\n */\n AddFieldOptions[AddFieldOptions[\"AddFieldCheckDisplayName\"] = 32] = \"AddFieldCheckDisplayName\";\n})(AddFieldOptions = exports.AddFieldOptions || (exports.AddFieldOptions = {}));\nvar CalendarType;\n(function (CalendarType) {\n CalendarType[CalendarType[\"Gregorian\"] = 1] = \"Gregorian\";\n CalendarType[CalendarType[\"Japan\"] = 3] = \"Japan\";\n CalendarType[CalendarType[\"Taiwan\"] = 4] = \"Taiwan\";\n CalendarType[CalendarType[\"Korea\"] = 5] = \"Korea\";\n CalendarType[CalendarType[\"Hijri\"] = 6] = \"Hijri\";\n CalendarType[CalendarType[\"Thai\"] = 7] = \"Thai\";\n CalendarType[CalendarType[\"Hebrew\"] = 8] = \"Hebrew\";\n CalendarType[CalendarType[\"GregorianMEFrench\"] = 9] = \"GregorianMEFrench\";\n CalendarType[CalendarType[\"GregorianArabic\"] = 10] = \"GregorianArabic\";\n CalendarType[CalendarType[\"GregorianXLITEnglish\"] = 11] = \"GregorianXLITEnglish\";\n CalendarType[CalendarType[\"GregorianXLITFrench\"] = 12] = \"GregorianXLITFrench\";\n CalendarType[CalendarType[\"KoreaJapanLunar\"] = 14] = \"KoreaJapanLunar\";\n CalendarType[CalendarType[\"ChineseLunar\"] = 15] = \"ChineseLunar\";\n CalendarType[CalendarType[\"SakaEra\"] = 16] = \"SakaEra\";\n CalendarType[CalendarType[\"UmAlQura\"] = 23] = \"UmAlQura\";\n})(CalendarType = exports.CalendarType || (exports.CalendarType = {}));\nvar UrlFieldFormatType;\n(function (UrlFieldFormatType) {\n UrlFieldFormatType[UrlFieldFormatType[\"Hyperlink\"] = 0] = \"Hyperlink\";\n UrlFieldFormatType[UrlFieldFormatType[\"Image\"] = 1] = \"Image\";\n})(UrlFieldFormatType = exports.UrlFieldFormatType || (exports.UrlFieldFormatType = {}));\nvar PermissionKind;\n(function (PermissionKind) {\n /**\n * Has no permissions on the Site. Not available through the user interface.\n */\n PermissionKind[PermissionKind[\"EmptyMask\"] = 0] = \"EmptyMask\";\n /**\n * View items in lists, documents in document libraries, and Web discussion comments.\n */\n PermissionKind[PermissionKind[\"ViewListItems\"] = 1] = \"ViewListItems\";\n /**\n * Add items to lists, documents to document libraries, and Web discussion comments.\n */\n PermissionKind[PermissionKind[\"AddListItems\"] = 2] = \"AddListItems\";\n /**\n * Edit items in lists, edit documents in document libraries, edit Web discussion comments\n * in documents, and customize Web Part Pages in document libraries.\n */\n PermissionKind[PermissionKind[\"EditListItems\"] = 3] = \"EditListItems\";\n /**\n * Delete items from a list, documents from a document library, and Web discussion\n * comments in documents.\n */\n PermissionKind[PermissionKind[\"DeleteListItems\"] = 4] = \"DeleteListItems\";\n /**\n * Approve a minor version of a list item or document.\n */\n PermissionKind[PermissionKind[\"ApproveItems\"] = 5] = \"ApproveItems\";\n /**\n * View the source of documents with server-side file handlers.\n */\n PermissionKind[PermissionKind[\"OpenItems\"] = 6] = \"OpenItems\";\n /**\n * View past versions of a list item or document.\n */\n PermissionKind[PermissionKind[\"ViewVersions\"] = 7] = \"ViewVersions\";\n /**\n * Delete past versions of a list item or document.\n */\n PermissionKind[PermissionKind[\"DeleteVersions\"] = 8] = \"DeleteVersions\";\n /**\n * Discard or check in a document which is checked out to another user.\n */\n PermissionKind[PermissionKind[\"CancelCheckout\"] = 9] = \"CancelCheckout\";\n /**\n * Create, change, and delete personal views of lists.\n */\n PermissionKind[PermissionKind[\"ManagePersonalViews\"] = 10] = \"ManagePersonalViews\";\n /**\n * Create and delete lists, add or remove columns in a list, and add or remove public views of a list.\n */\n PermissionKind[PermissionKind[\"ManageLists\"] = 12] = \"ManageLists\";\n /**\n * View forms, views, and application pages, and enumerate lists.\n */\n PermissionKind[PermissionKind[\"ViewFormPages\"] = 13] = \"ViewFormPages\";\n /**\n * Make content of a list or document library retrieveable for anonymous users through SharePoint search.\n * The list permissions in the site do not change.\n */\n PermissionKind[PermissionKind[\"AnonymousSearchAccessList\"] = 14] = \"AnonymousSearchAccessList\";\n /**\n * Allow users to open a Site, list, or folder to access items inside that container.\n */\n PermissionKind[PermissionKind[\"Open\"] = 17] = \"Open\";\n /**\n * View pages in a Site.\n */\n PermissionKind[PermissionKind[\"ViewPages\"] = 18] = \"ViewPages\";\n /**\n * Add, change, or delete HTML pages or Web Part Pages, and edit the Site using\n * a Windows SharePoint Services compatible editor.\n */\n PermissionKind[PermissionKind[\"AddAndCustomizePages\"] = 19] = \"AddAndCustomizePages\";\n /**\n * Apply a theme or borders to the entire Site.\n */\n PermissionKind[PermissionKind[\"ApplyThemeAndBorder\"] = 20] = \"ApplyThemeAndBorder\";\n /**\n * Apply a style sheet (.css file) to the Site.\n */\n PermissionKind[PermissionKind[\"ApplyStyleSheets\"] = 21] = \"ApplyStyleSheets\";\n /**\n * View reports on Site usage.\n */\n PermissionKind[PermissionKind[\"ViewUsageData\"] = 22] = \"ViewUsageData\";\n /**\n * Create a Site using Self-Service Site Creation.\n */\n PermissionKind[PermissionKind[\"CreateSSCSite\"] = 23] = \"CreateSSCSite\";\n /**\n * Create subsites such as team sites, Meeting Workspace sites, and Document Workspace sites.\n */\n PermissionKind[PermissionKind[\"ManageSubwebs\"] = 24] = \"ManageSubwebs\";\n /**\n * Create a group of users that can be used anywhere within the site collection.\n */\n PermissionKind[PermissionKind[\"CreateGroups\"] = 25] = \"CreateGroups\";\n /**\n * Create and change permission levels on the Site and assign permissions to users\n * and groups.\n */\n PermissionKind[PermissionKind[\"ManagePermissions\"] = 26] = \"ManagePermissions\";\n /**\n * Enumerate files and folders in a Site using Microsoft Office SharePoint Designer\n * and WebDAV interfaces.\n */\n PermissionKind[PermissionKind[\"BrowseDirectories\"] = 27] = \"BrowseDirectories\";\n /**\n * View information about users of the Site.\n */\n PermissionKind[PermissionKind[\"BrowseUserInfo\"] = 28] = \"BrowseUserInfo\";\n /**\n * Add or remove personal Web Parts on a Web Part Page.\n */\n PermissionKind[PermissionKind[\"AddDelPrivateWebParts\"] = 29] = \"AddDelPrivateWebParts\";\n /**\n * Update Web Parts to display personalized information.\n */\n PermissionKind[PermissionKind[\"UpdatePersonalWebParts\"] = 30] = \"UpdatePersonalWebParts\";\n /**\n * Grant the ability to perform all administration tasks for the Site as well as\n * manage content, activate, deactivate, or edit properties of Site scoped Features\n * through the object model or through the user interface (UI). When granted on the\n * root Site of a Site Collection, activate, deactivate, or edit properties of\n * site collection scoped Features through the object model. To browse to the Site\n * Collection Features page and activate or deactivate Site Collection scoped Features\n * through the UI, you must be a Site Collection administrator.\n */\n PermissionKind[PermissionKind[\"ManageWeb\"] = 31] = \"ManageWeb\";\n /**\n * Content of lists and document libraries in the Web site will be retrieveable for anonymous users through\n * SharePoint search if the list or document library has AnonymousSearchAccessList set.\n */\n PermissionKind[PermissionKind[\"AnonymousSearchAccessWebLists\"] = 32] = \"AnonymousSearchAccessWebLists\";\n /**\n * Use features that launch client applications. Otherwise, users must work on documents\n * locally and upload changes.\n */\n PermissionKind[PermissionKind[\"UseClientIntegration\"] = 37] = \"UseClientIntegration\";\n /**\n * Use SOAP, WebDAV, or Microsoft Office SharePoint Designer interfaces to access the Site.\n */\n PermissionKind[PermissionKind[\"UseRemoteAPIs\"] = 38] = \"UseRemoteAPIs\";\n /**\n * Manage alerts for all users of the Site.\n */\n PermissionKind[PermissionKind[\"ManageAlerts\"] = 39] = \"ManageAlerts\";\n /**\n * Create e-mail alerts.\n */\n PermissionKind[PermissionKind[\"CreateAlerts\"] = 40] = \"CreateAlerts\";\n /**\n * Allows a user to change his or her user information, such as adding a picture.\n */\n PermissionKind[PermissionKind[\"EditMyUserInfo\"] = 41] = \"EditMyUserInfo\";\n /**\n * Enumerate permissions on Site, list, folder, document, or list item.\n */\n PermissionKind[PermissionKind[\"EnumeratePermissions\"] = 63] = \"EnumeratePermissions\";\n /**\n * Has all permissions on the Site. Not available through the user interface.\n */\n PermissionKind[PermissionKind[\"FullMask\"] = 65] = \"FullMask\";\n})(PermissionKind = exports.PermissionKind || (exports.PermissionKind = {}));\nvar PrincipalType;\n(function (PrincipalType) {\n PrincipalType[PrincipalType[\"None\"] = 0] = \"None\";\n PrincipalType[PrincipalType[\"User\"] = 1] = \"User\";\n PrincipalType[PrincipalType[\"DistributionList\"] = 2] = \"DistributionList\";\n PrincipalType[PrincipalType[\"SecurityGroup\"] = 4] = \"SecurityGroup\";\n PrincipalType[PrincipalType[\"SharePointGroup\"] = 8] = \"SharePointGroup\";\n PrincipalType[PrincipalType[\"All\"] = 15] = \"All\";\n})(PrincipalType = exports.PrincipalType || (exports.PrincipalType = {}));\nvar RoleType;\n(function (RoleType) {\n RoleType[RoleType[\"None\"] = 0] = \"None\";\n RoleType[RoleType[\"Guest\"] = 1] = \"Guest\";\n RoleType[RoleType[\"Reader\"] = 2] = \"Reader\";\n RoleType[RoleType[\"Contributor\"] = 3] = \"Contributor\";\n RoleType[RoleType[\"WebDesigner\"] = 4] = \"WebDesigner\";\n RoleType[RoleType[\"Administrator\"] = 5] = \"Administrator\";\n})(RoleType = exports.RoleType || (exports.RoleType = {}));\nvar PageType;\n(function (PageType) {\n PageType[PageType[\"Invalid\"] = -1] = \"Invalid\";\n PageType[PageType[\"DefaultView\"] = 0] = \"DefaultView\";\n PageType[PageType[\"NormalView\"] = 1] = \"NormalView\";\n PageType[PageType[\"DialogView\"] = 2] = \"DialogView\";\n PageType[PageType[\"View\"] = 3] = \"View\";\n PageType[PageType[\"DisplayForm\"] = 4] = \"DisplayForm\";\n PageType[PageType[\"DisplayFormDialog\"] = 5] = \"DisplayFormDialog\";\n PageType[PageType[\"EditForm\"] = 6] = \"EditForm\";\n PageType[PageType[\"EditFormDialog\"] = 7] = \"EditFormDialog\";\n PageType[PageType[\"NewForm\"] = 8] = \"NewForm\";\n PageType[PageType[\"NewFormDialog\"] = 9] = \"NewFormDialog\";\n PageType[PageType[\"SolutionForm\"] = 10] = \"SolutionForm\";\n PageType[PageType[\"PAGE_MAXITEMS\"] = 11] = \"PAGE_MAXITEMS\";\n})(PageType = exports.PageType || (exports.PageType = {}));\nvar SharingLinkKind;\n(function (SharingLinkKind) {\n /**\n * Uninitialized link\n */\n SharingLinkKind[SharingLinkKind[\"Uninitialized\"] = 0] = \"Uninitialized\";\n /**\n * Direct link to the object being shared\n */\n SharingLinkKind[SharingLinkKind[\"Direct\"] = 1] = \"Direct\";\n /**\n * Organization-shareable link to the object being shared with view permissions\n */\n SharingLinkKind[SharingLinkKind[\"OrganizationView\"] = 2] = \"OrganizationView\";\n /**\n * Organization-shareable link to the object being shared with edit permissions\n */\n SharingLinkKind[SharingLinkKind[\"OrganizationEdit\"] = 3] = \"OrganizationEdit\";\n /**\n * View only anonymous link\n */\n SharingLinkKind[SharingLinkKind[\"AnonymousView\"] = 4] = \"AnonymousView\";\n /**\n * Read/Write anonymous link\n */\n SharingLinkKind[SharingLinkKind[\"AnonymousEdit\"] = 5] = \"AnonymousEdit\";\n /**\n * Flexible sharing Link where properties can change without affecting link URL\n */\n SharingLinkKind[SharingLinkKind[\"Flexible\"] = 6] = \"Flexible\";\n})(SharingLinkKind = exports.SharingLinkKind || (exports.SharingLinkKind = {}));\n;\n/**\n * Indicates the role of the sharing link\n */\nvar SharingRole;\n(function (SharingRole) {\n SharingRole[SharingRole[\"None\"] = 0] = \"None\";\n SharingRole[SharingRole[\"View\"] = 1] = \"View\";\n SharingRole[SharingRole[\"Edit\"] = 2] = \"Edit\";\n SharingRole[SharingRole[\"Owner\"] = 3] = \"Owner\";\n})(SharingRole = exports.SharingRole || (exports.SharingRole = {}));\nvar SharingOperationStatusCode;\n(function (SharingOperationStatusCode) {\n /**\n * The share operation completed without errors.\n */\n SharingOperationStatusCode[SharingOperationStatusCode[\"CompletedSuccessfully\"] = 0] = \"CompletedSuccessfully\";\n /**\n * The share operation completed and generated requests for access.\n */\n SharingOperationStatusCode[SharingOperationStatusCode[\"AccessRequestsQueued\"] = 1] = \"AccessRequestsQueued\";\n /**\n * The share operation failed as there were no resolved users.\n */\n SharingOperationStatusCode[SharingOperationStatusCode[\"NoResolvedUsers\"] = -1] = \"NoResolvedUsers\";\n /**\n * The share operation failed due to insufficient permissions.\n */\n SharingOperationStatusCode[SharingOperationStatusCode[\"AccessDenied\"] = -2] = \"AccessDenied\";\n /**\n * The share operation failed when attempting a cross site share, which is not supported.\n */\n SharingOperationStatusCode[SharingOperationStatusCode[\"CrossSiteRequestNotSupported\"] = -3] = \"CrossSiteRequestNotSupported\";\n /**\n * The sharing operation failed due to an unknown error.\n */\n SharingOperationStatusCode[SharingOperationStatusCode[\"UnknowError\"] = -4] = \"UnknowError\";\n /**\n * The text you typed is too long. Please shorten it.\n */\n SharingOperationStatusCode[SharingOperationStatusCode[\"EmailBodyTooLong\"] = -5] = \"EmailBodyTooLong\";\n /**\n * The maximum number of unique scopes in the list has been exceeded.\n */\n SharingOperationStatusCode[SharingOperationStatusCode[\"ListUniqueScopesExceeded\"] = -6] = \"ListUniqueScopesExceeded\";\n /**\n * The share operation failed because a sharing capability is disabled in the site.\n */\n SharingOperationStatusCode[SharingOperationStatusCode[\"CapabilityDisabled\"] = -7] = \"CapabilityDisabled\";\n /**\n * The specified object for the share operation is not supported.\n */\n SharingOperationStatusCode[SharingOperationStatusCode[\"ObjectNotSupported\"] = -8] = \"ObjectNotSupported\";\n /**\n * A SharePoint group cannot contain another SharePoint group.\n */\n SharingOperationStatusCode[SharingOperationStatusCode[\"NestedGroupsNotSupported\"] = -9] = \"NestedGroupsNotSupported\";\n})(SharingOperationStatusCode = exports.SharingOperationStatusCode || (exports.SharingOperationStatusCode = {}));\nvar SPSharedObjectType;\n(function (SPSharedObjectType) {\n SPSharedObjectType[SPSharedObjectType[\"Unknown\"] = 0] = \"Unknown\";\n SPSharedObjectType[SPSharedObjectType[\"File\"] = 1] = \"File\";\n SPSharedObjectType[SPSharedObjectType[\"Folder\"] = 2] = \"Folder\";\n SPSharedObjectType[SPSharedObjectType[\"Item\"] = 3] = \"Item\";\n SPSharedObjectType[SPSharedObjectType[\"List\"] = 4] = \"List\";\n SPSharedObjectType[SPSharedObjectType[\"Web\"] = 5] = \"Web\";\n SPSharedObjectType[SPSharedObjectType[\"Max\"] = 6] = \"Max\";\n})(SPSharedObjectType = exports.SPSharedObjectType || (exports.SPSharedObjectType = {}));\nvar SharingDomainRestrictionMode;\n(function (SharingDomainRestrictionMode) {\n SharingDomainRestrictionMode[SharingDomainRestrictionMode[\"None\"] = 0] = \"None\";\n SharingDomainRestrictionMode[SharingDomainRestrictionMode[\"AllowList\"] = 1] = \"AllowList\";\n SharingDomainRestrictionMode[SharingDomainRestrictionMode[\"BlockList\"] = 2] = \"BlockList\";\n})(SharingDomainRestrictionMode = exports.SharingDomainRestrictionMode || (exports.SharingDomainRestrictionMode = {}));\n;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/sharepoint/types.js\n// module id = 13\n// module chunks = 0","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar util_1 = require(\"./util\");\nvar collections_1 = require(\"../collections/collections\");\nvar pnplibconfig_1 = require(\"../configuration/pnplibconfig\");\n/**\n * A wrapper class to provide a consistent interface to browser based storage\n *\n */\nvar PnPClientStorageWrapper = (function () {\n /**\n * Creates a new instance of the PnPClientStorageWrapper class\n *\n * @constructor\n */\n function PnPClientStorageWrapper(store, defaultTimeoutMinutes) {\n this.store = store;\n this.defaultTimeoutMinutes = defaultTimeoutMinutes;\n this.defaultTimeoutMinutes = (defaultTimeoutMinutes === void 0) ? -1 : defaultTimeoutMinutes;\n this.enabled = this.test();\n }\n /**\n * Get a value from storage, or null if that value does not exist\n *\n * @param key The key whose value we want to retrieve\n */\n PnPClientStorageWrapper.prototype.get = function (key) {\n if (!this.enabled) {\n return null;\n }\n var o = this.store.getItem(key);\n if (o == null) {\n return null;\n }\n var persistable = JSON.parse(o);\n if (new Date(persistable.expiration) <= new Date()) {\n this.delete(key);\n return null;\n }\n else {\n return persistable.value;\n }\n };\n /**\n * Adds a value to the underlying storage\n *\n * @param key The key to use when storing the provided value\n * @param o The value to store\n * @param expire Optional, if provided the expiration of the item, otherwise the default is used\n */\n PnPClientStorageWrapper.prototype.put = function (key, o, expire) {\n if (this.enabled) {\n this.store.setItem(key, this.createPersistable(o, expire));\n }\n };\n /**\n * Deletes a value from the underlying storage\n *\n * @param key The key of the pair we want to remove from storage\n */\n PnPClientStorageWrapper.prototype.delete = function (key) {\n if (this.enabled) {\n this.store.removeItem(key);\n }\n };\n /**\n * Gets an item from the underlying storage, or adds it if it does not exist using the supplied getter function\n *\n * @param key The key to use when storing the provided value\n * @param getter A function which will upon execution provide the desired value\n * @param expire Optional, if provided the expiration of the item, otherwise the default is used\n */\n PnPClientStorageWrapper.prototype.getOrPut = function (key, getter, expire) {\n var _this = this;\n if (!this.enabled) {\n return getter();\n }\n return new Promise(function (resolve) {\n var o = _this.get(key);\n if (o == null) {\n getter().then(function (d) {\n _this.put(key, d, expire);\n resolve(d);\n });\n }\n else {\n resolve(o);\n }\n });\n };\n /**\n * Used to determine if the wrapped storage is available currently\n */\n PnPClientStorageWrapper.prototype.test = function () {\n var str = \"test\";\n try {\n this.store.setItem(str, str);\n this.store.removeItem(str);\n return true;\n }\n catch (e) {\n return false;\n }\n };\n /**\n * Creates the persistable to store\n */\n PnPClientStorageWrapper.prototype.createPersistable = function (o, expire) {\n if (typeof expire === \"undefined\") {\n // ensure we are by default inline with the global library setting\n var defaultTimeout = pnplibconfig_1.RuntimeConfig.defaultCachingTimeoutSeconds;\n if (this.defaultTimeoutMinutes > 0) {\n defaultTimeout = this.defaultTimeoutMinutes * 60;\n }\n expire = util_1.Util.dateAdd(new Date(), \"second\", defaultTimeout);\n }\n return JSON.stringify({ expiration: expire, value: o });\n };\n return PnPClientStorageWrapper;\n}());\nexports.PnPClientStorageWrapper = PnPClientStorageWrapper;\n/**\n * A thin implementation of in-memory storage for use in nodejs\n */\nvar MemoryStorage = (function () {\n function MemoryStorage(_store) {\n if (_store === void 0) { _store = new collections_1.Dictionary(); }\n this._store = _store;\n }\n Object.defineProperty(MemoryStorage.prototype, \"length\", {\n get: function () {\n return this._store.count();\n },\n enumerable: true,\n configurable: true\n });\n MemoryStorage.prototype.clear = function () {\n this._store.clear();\n };\n MemoryStorage.prototype.getItem = function (key) {\n return this._store.get(key);\n };\n MemoryStorage.prototype.key = function (index) {\n return this._store.getKeys()[index];\n };\n MemoryStorage.prototype.removeItem = function (key) {\n this._store.remove(key);\n };\n MemoryStorage.prototype.setItem = function (key, data) {\n this._store.add(key, data);\n };\n return MemoryStorage;\n}());\n/**\n * A class that will establish wrappers for both local and session storage\n */\nvar PnPClientStorage = (function () {\n /**\n * Creates a new instance of the PnPClientStorage class\n *\n * @constructor\n */\n function PnPClientStorage() {\n this.local = typeof localStorage !== \"undefined\" ? new PnPClientStorageWrapper(localStorage) : new PnPClientStorageWrapper(new MemoryStorage());\n this.session = typeof sessionStorage !== \"undefined\" ? new PnPClientStorageWrapper(sessionStorage) : new PnPClientStorageWrapper(new MemoryStorage());\n }\n return PnPClientStorage;\n}());\nexports.PnPClientStorage = PnPClientStorage;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/utils/storage.js\n// module id = 14\n// module chunks = 0","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar digestcache_1 = require(\"./digestcache\");\nvar util_1 = require(\"../utils/util\");\nvar pnplibconfig_1 = require(\"../configuration/pnplibconfig\");\nvar exceptions_1 = require(\"../utils/exceptions\");\nvar HttpClient = (function () {\n function HttpClient() {\n this._impl = pnplibconfig_1.RuntimeConfig.fetchClientFactory();\n this._digestCache = new digestcache_1.DigestCache(this);\n }\n HttpClient.prototype.fetch = function (url, options) {\n var _this = this;\n if (options === void 0) { options = {}; }\n var opts = util_1.Util.extend(options, { cache: \"no-cache\", credentials: \"same-origin\" }, true);\n var headers = new Headers();\n // first we add the global headers so they can be overwritten by any passed in locally to this call\n this.mergeHeaders(headers, pnplibconfig_1.RuntimeConfig.headers);\n // second we add the local options so we can overwrite the globals\n this.mergeHeaders(headers, options.headers);\n // lastly we apply any default headers we need that may not exist\n if (!headers.has(\"Accept\")) {\n headers.append(\"Accept\", \"application/json\");\n }\n if (!headers.has(\"Content-Type\")) {\n headers.append(\"Content-Type\", \"application/json;odata=verbose;charset=utf-8\");\n }\n if (!headers.has(\"X-ClientService-ClientTag\")) {\n headers.append(\"X-ClientService-ClientTag\", \"PnPCoreJS:2.0.3\");\n }\n opts = util_1.Util.extend(opts, { headers: headers });\n if (opts.method && opts.method.toUpperCase() !== \"GET\") {\n if (!headers.has(\"X-RequestDigest\")) {\n var index = url.indexOf(\"_api/\");\n if (index < 0) {\n throw new exceptions_1.APIUrlException();\n }\n var webUrl = url.substr(0, index);\n return this._digestCache.getDigest(webUrl)\n .then(function (digest) {\n headers.append(\"X-RequestDigest\", digest);\n return _this.fetchRaw(url, opts);\n });\n }\n }\n return this.fetchRaw(url, opts);\n };\n HttpClient.prototype.fetchRaw = function (url, options) {\n var _this = this;\n if (options === void 0) { options = {}; }\n // here we need to normalize the headers\n var rawHeaders = new Headers();\n this.mergeHeaders(rawHeaders, options.headers);\n options = util_1.Util.extend(options, { headers: rawHeaders });\n var retry = function (ctx) {\n _this._impl.fetch(url, options).then(function (response) { return ctx.resolve(response); }).catch(function (response) {\n // grab our current delay\n var delay = ctx.delay;\n // Check if request was throttled - http status code 429\n // Check is request failed due to server unavailable - http status code 503\n if (response.status !== 429 && response.status !== 503) {\n ctx.reject(response);\n }\n // Increment our counters.\n ctx.delay *= 2;\n ctx.attempts++;\n // If we have exceeded the retry count, reject.\n if (ctx.retryCount <= ctx.attempts) {\n ctx.reject(response);\n }\n // Set our retry timeout for {delay} milliseconds.\n setTimeout(util_1.Util.getCtxCallback(_this, retry, ctx), delay);\n });\n };\n return new Promise(function (resolve, reject) {\n var retryContext = {\n attempts: 0,\n delay: 100,\n reject: reject,\n resolve: resolve,\n retryCount: 7,\n };\n retry.call(_this, retryContext);\n });\n };\n HttpClient.prototype.get = function (url, options) {\n if (options === void 0) { options = {}; }\n var opts = util_1.Util.extend(options, { method: \"GET\" });\n return this.fetch(url, opts);\n };\n HttpClient.prototype.post = function (url, options) {\n if (options === void 0) { options = {}; }\n var opts = util_1.Util.extend(options, { method: \"POST\" });\n return this.fetch(url, opts);\n };\n HttpClient.prototype.patch = function (url, options) {\n if (options === void 0) { options = {}; }\n var opts = util_1.Util.extend(options, { method: \"PATCH\" });\n return this.fetch(url, opts);\n };\n HttpClient.prototype.delete = function (url, options) {\n if (options === void 0) { options = {}; }\n var opts = util_1.Util.extend(options, { method: \"DELETE\" });\n return this.fetch(url, opts);\n };\n HttpClient.prototype.mergeHeaders = function (target, source) {\n if (typeof source !== \"undefined\" && source !== null) {\n var temp = new Request(\"\", { headers: source });\n temp.headers.forEach(function (value, name) {\n target.append(name, value);\n });\n }\n };\n return HttpClient;\n}());\nexports.HttpClient = HttpClient;\n;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/net/httpclient.js\n// module id = 15\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar util_1 = require(\"../utils/util\");\nvar queryable_1 = require(\"./queryable\");\n/**\n * Describes a collection of content types\n *\n */\nvar ContentTypes = (function (_super) {\n __extends(ContentTypes, _super);\n /**\n * Creates a new instance of the ContentTypes class\n *\n * @param baseUrl The url or Queryable which forms the parent of this content types collection\n */\n function ContentTypes(baseUrl, path) {\n if (path === void 0) { path = \"contenttypes\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * Gets a ContentType by content type id\n */\n ContentTypes.prototype.getById = function (id) {\n var ct = new ContentType(this);\n ct.concat(\"('\" + id + \"')\");\n return ct;\n };\n /**\n * Adds an existing contenttype to a content type collection\n *\n * @param contentTypeId in the following format, for example: 0x010102\n */\n ContentTypes.prototype.addAvailableContentType = function (contentTypeId) {\n var _this = this;\n var postBody = JSON.stringify({\n \"contentTypeId\": contentTypeId,\n });\n return this.clone(ContentTypes, \"addAvailableContentType\", true).postAs({ body: postBody }).then(function (data) {\n return {\n contentType: _this.getById(data.id),\n data: data,\n };\n });\n };\n /**\n * Adds a new content type to the collection\n *\n * @param id The desired content type id for the new content type (also determines the parent content type)\n * @param name The name of the content type\n * @param description The description of the content type\n * @param group The group in which to add the content type\n * @param additionalSettings Any additional settings to provide when creating the content type\n *\n */\n ContentTypes.prototype.add = function (id, name, description, group, additionalSettings) {\n var _this = this;\n if (description === void 0) { description = \"\"; }\n if (group === void 0) { group = \"Custom Content Types\"; }\n if (additionalSettings === void 0) { additionalSettings = {}; }\n var postBody = JSON.stringify(util_1.Util.extend({\n \"Description\": description,\n \"Group\": group,\n \"Id\": { \"StringValue\": id },\n \"Name\": name,\n \"__metadata\": { \"type\": \"SP.ContentType\" },\n }, additionalSettings));\n return this.post({ body: postBody }).then(function (data) {\n return { contentType: _this.getById(data.id), data: data };\n });\n };\n return ContentTypes;\n}(queryable_1.QueryableCollection));\nexports.ContentTypes = ContentTypes;\n/**\n * Describes a single ContentType instance\n *\n */\nvar ContentType = (function (_super) {\n __extends(ContentType, _super);\n function ContentType() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(ContentType.prototype, \"fieldLinks\", {\n /**\n * Gets the column (also known as field) references in the content type.\n */\n get: function () {\n return new FieldLinks(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ContentType.prototype, \"fields\", {\n /**\n * Gets a value that specifies the collection of fields for the content type.\n */\n get: function () {\n return new queryable_1.QueryableCollection(this, \"fields\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ContentType.prototype, \"parent\", {\n /**\n * Gets the parent content type of the content type.\n */\n get: function () {\n return new ContentType(this, \"parent\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ContentType.prototype, \"workflowAssociations\", {\n /**\n * Gets a value that specifies the collection of workflow associations for the content type.\n */\n get: function () {\n return new queryable_1.QueryableCollection(this, \"workflowAssociations\");\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Delete this content type\n */\n ContentType.prototype.delete = function () {\n return this.post({\n headers: {\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n return ContentType;\n}(queryable_1.QueryableInstance));\nexports.ContentType = ContentType;\n/**\n * Represents a collection of field link instances\n */\nvar FieldLinks = (function (_super) {\n __extends(FieldLinks, _super);\n /**\n * Creates a new instance of the ContentType class\n *\n * @param baseUrl The url or Queryable which forms the parent of this content type instance\n */\n function FieldLinks(baseUrl, path) {\n if (path === void 0) { path = \"fieldlinks\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * Gets a FieldLink by GUID id\n *\n * @param id The GUID id of the field link\n */\n FieldLinks.prototype.getById = function (id) {\n var fl = new FieldLink(this);\n fl.concat(\"(guid'\" + id + \"')\");\n return fl;\n };\n return FieldLinks;\n}(queryable_1.QueryableCollection));\nexports.FieldLinks = FieldLinks;\n/**\n * Represents a field link instance\n */\nvar FieldLink = (function (_super) {\n __extends(FieldLink, _super);\n function FieldLink() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return FieldLink;\n}(queryable_1.QueryableInstance));\nexports.FieldLink = FieldLink;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/sharepoint/contenttypes.js\n// module id = 16\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar queryable_1 = require(\"./queryable\");\nvar sitegroups_1 = require(\"./sitegroups\");\nvar util_1 = require(\"../utils/util\");\n/**\n * Describes a set of role assignments for the current scope\n *\n */\nvar RoleAssignments = (function (_super) {\n __extends(RoleAssignments, _super);\n /**\n * Creates a new instance of the RoleAssignments class\n *\n * @param baseUrl The url or Queryable which forms the parent of this fields collection\n */\n function RoleAssignments(baseUrl, path) {\n if (path === void 0) { path = \"roleassignments\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * Adds a new role assignment with the specified principal and role definitions to the collection.\n *\n * @param principalId The ID of the user or group to assign permissions to\n * @param roleDefId The ID of the role definition that defines the permissions to assign\n *\n */\n RoleAssignments.prototype.add = function (principalId, roleDefId) {\n return this.clone(RoleAssignments, \"addroleassignment(principalid=\" + principalId + \", roledefid=\" + roleDefId + \")\", true).post();\n };\n /**\n * Removes the role assignment with the specified principal and role definition from the collection\n *\n * @param principalId The ID of the user or group in the role assignment.\n * @param roleDefId The ID of the role definition in the role assignment\n *\n */\n RoleAssignments.prototype.remove = function (principalId, roleDefId) {\n return this.clone(RoleAssignments, \"removeroleassignment(principalid=\" + principalId + \", roledefid=\" + roleDefId + \")\", true).post();\n };\n /**\n * Gets the role assignment associated with the specified principal ID from the collection.\n *\n * @param id The id of the role assignment\n */\n RoleAssignments.prototype.getById = function (id) {\n var ra = new RoleAssignment(this);\n ra.concat(\"(\" + id + \")\");\n return ra;\n };\n return RoleAssignments;\n}(queryable_1.QueryableCollection));\nexports.RoleAssignments = RoleAssignments;\nvar RoleAssignment = (function (_super) {\n __extends(RoleAssignment, _super);\n function RoleAssignment() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(RoleAssignment.prototype, \"groups\", {\n get: function () {\n return new sitegroups_1.SiteGroups(this, \"groups\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RoleAssignment.prototype, \"bindings\", {\n /**\n * Get the role definition bindings for this role assignment\n *\n */\n get: function () {\n return new RoleDefinitionBindings(this);\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Delete this role assignment\n *\n */\n RoleAssignment.prototype.delete = function () {\n return this.post({\n headers: {\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n return RoleAssignment;\n}(queryable_1.QueryableInstance));\nexports.RoleAssignment = RoleAssignment;\nvar RoleDefinitions = (function (_super) {\n __extends(RoleDefinitions, _super);\n /**\n * Creates a new instance of the RoleDefinitions class\n *\n * @param baseUrl The url or Queryable which forms the parent of this fields collection\n * @param path\n *\n */\n function RoleDefinitions(baseUrl, path) {\n if (path === void 0) { path = \"roledefinitions\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * Gets the role definition with the specified ID from the collection.\n *\n * @param id The ID of the role definition.\n *\n */\n RoleDefinitions.prototype.getById = function (id) {\n return new RoleDefinition(this, \"getById(\" + id + \")\");\n };\n /**\n * Gets the role definition with the specified name.\n *\n * @param name The name of the role definition.\n *\n */\n RoleDefinitions.prototype.getByName = function (name) {\n return new RoleDefinition(this, \"getbyname('\" + name + \"')\");\n };\n /**\n * Gets the role definition with the specified type.\n *\n * @param name The name of the role definition.\n *\n */\n RoleDefinitions.prototype.getByType = function (roleTypeKind) {\n return new RoleDefinition(this, \"getbytype(\" + roleTypeKind + \")\");\n };\n /**\n * Create a role definition\n *\n * @param name The new role definition's name\n * @param description The new role definition's description\n * @param order The order in which the role definition appears\n * @param basePermissions The permissions mask for this role definition\n *\n */\n RoleDefinitions.prototype.add = function (name, description, order, basePermissions) {\n var _this = this;\n var postBody = JSON.stringify({\n BasePermissions: util_1.Util.extend({ __metadata: { type: \"SP.BasePermissions\" } }, basePermissions),\n Description: description,\n Name: name,\n Order: order,\n __metadata: { \"type\": \"SP.RoleDefinition\" },\n });\n return this.post({ body: postBody }).then(function (data) {\n return {\n data: data,\n definition: _this.getById(data.Id),\n };\n });\n };\n return RoleDefinitions;\n}(queryable_1.QueryableCollection));\nexports.RoleDefinitions = RoleDefinitions;\nvar RoleDefinition = (function (_super) {\n __extends(RoleDefinition, _super);\n function RoleDefinition() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Updates this web intance with the supplied properties\n *\n * @param properties A plain object hash of values to update for the web\n */\n /* tslint:disable no-string-literal */\n RoleDefinition.prototype.update = function (properties) {\n var _this = this;\n if (typeof properties.hasOwnProperty(\"BasePermissions\") !== \"undefined\") {\n properties[\"BasePermissions\"] = util_1.Util.extend({ __metadata: { type: \"SP.BasePermissions\" } }, properties[\"BasePermissions\"]);\n }\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": \"SP.RoleDefinition\" },\n }, properties));\n return this.post({\n body: postBody,\n headers: {\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n var retDef = _this;\n if (properties.hasOwnProperty(\"Name\")) {\n var parent_1 = _this.getParent(RoleDefinitions, _this.parentUrl, \"\");\n retDef = parent_1.getByName(properties[\"Name\"]);\n }\n return {\n data: data,\n definition: retDef,\n };\n });\n };\n /* tslint:enable */\n /**\n * Delete this role definition\n *\n */\n RoleDefinition.prototype.delete = function () {\n return this.post({\n headers: {\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n return RoleDefinition;\n}(queryable_1.QueryableInstance));\nexports.RoleDefinition = RoleDefinition;\nvar RoleDefinitionBindings = (function (_super) {\n __extends(RoleDefinitionBindings, _super);\n function RoleDefinitionBindings(baseUrl, path) {\n if (path === void 0) { path = \"roledefinitionbindings\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n return RoleDefinitionBindings;\n}(queryable_1.QueryableCollection));\nexports.RoleDefinitionBindings = RoleDefinitionBindings;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/sharepoint/roles.js\n// module id = 17\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar queryable_1 = require(\"./queryable\");\nvar siteusers_1 = require(\"./siteusers\");\nvar util_1 = require(\"../utils/util\");\n/**\n * Principal Type enum\n *\n */\nvar PrincipalType;\n(function (PrincipalType) {\n PrincipalType[PrincipalType[\"None\"] = 0] = \"None\";\n PrincipalType[PrincipalType[\"User\"] = 1] = \"User\";\n PrincipalType[PrincipalType[\"DistributionList\"] = 2] = \"DistributionList\";\n PrincipalType[PrincipalType[\"SecurityGroup\"] = 4] = \"SecurityGroup\";\n PrincipalType[PrincipalType[\"SharePointGroup\"] = 8] = \"SharePointGroup\";\n PrincipalType[PrincipalType[\"All\"] = 15] = \"All\";\n})(PrincipalType = exports.PrincipalType || (exports.PrincipalType = {}));\n/**\n * Describes a collection of site users\n *\n */\nvar SiteGroups = (function (_super) {\n __extends(SiteGroups, _super);\n /**\n * Creates a new instance of the SiteUsers class\n *\n * @param baseUrl The url or Queryable which forms the parent of this user collection\n */\n function SiteGroups(baseUrl, path) {\n if (path === void 0) { path = \"sitegroups\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * Adds a new group to the site collection\n *\n * @param props The properties to be updated\n */\n SiteGroups.prototype.add = function (properties) {\n var _this = this;\n var postBody = JSON.stringify(util_1.Util.extend({ \"__metadata\": { \"type\": \"SP.Group\" } }, properties));\n return this.post({ body: postBody }).then(function (data) {\n return {\n data: data,\n group: _this.getById(data.Id),\n };\n });\n };\n /**\n * Gets a group from the collection by name\n *\n * @param email The name of the group\n */\n SiteGroups.prototype.getByName = function (groupName) {\n return new SiteGroup(this, \"getByName('\" + groupName + \"')\");\n };\n /**\n * Gets a group from the collection by id\n *\n * @param id The id of the group\n */\n SiteGroups.prototype.getById = function (id) {\n var sg = new SiteGroup(this);\n sg.concat(\"(\" + id + \")\");\n return sg;\n };\n /**\n * Removes the group with the specified member ID from the collection.\n *\n * @param id The id of the group to remove\n */\n SiteGroups.prototype.removeById = function (id) {\n return this.clone(SiteGroups, \"removeById('\" + id + \"')\", true).post();\n };\n /**\n * Removes a user from the collection by login name\n *\n * @param loginName The login name of the user\n */\n SiteGroups.prototype.removeByLoginName = function (loginName) {\n return this.clone(SiteGroups, \"removeByLoginName('\" + loginName + \"')\", true).post();\n };\n return SiteGroups;\n}(queryable_1.QueryableCollection));\nexports.SiteGroups = SiteGroups;\n/**\n * Describes a single group\n *\n */\nvar SiteGroup = (function (_super) {\n __extends(SiteGroup, _super);\n function SiteGroup() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(SiteGroup.prototype, \"users\", {\n /**\n * Get's the users for this group\n *\n */\n get: function () {\n return new siteusers_1.SiteUsers(this, \"users\");\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Updates this group instance with the supplied properties\n *\n * @param properties A GroupWriteableProperties object of property names and values to update for the user\n */\n /* tslint:disable no-string-literal */\n SiteGroup.prototype.update = function (properties) {\n var _this = this;\n var postBody = util_1.Util.extend({ \"__metadata\": { \"type\": \"SP.Group\" } }, properties);\n return this.post({\n body: JSON.stringify(postBody),\n headers: {\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n var retGroup = _this;\n if (properties.hasOwnProperty(\"Title\")) {\n retGroup = _this.getParent(SiteGroup, _this.parentUrl, \"getByName('\" + properties[\"Title\"] + \"')\");\n }\n return {\n data: data,\n group: retGroup,\n };\n });\n };\n return SiteGroup;\n}(queryable_1.QueryableInstance));\nexports.SiteGroup = SiteGroup;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/sharepoint/sitegroups.js\n// module id = 18\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar queryable_1 = require(\"./queryable\");\nvar util_1 = require(\"../utils/util\");\nvar UserCustomActions = (function (_super) {\n __extends(UserCustomActions, _super);\n function UserCustomActions(baseUrl, path) {\n if (path === void 0) { path = \"usercustomactions\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * Returns the custom action with the specified identifier.\n *\n * @param id The GUID ID of the user custom action to get.\n */\n UserCustomActions.prototype.getById = function (id) {\n var uca = new UserCustomAction(this);\n uca.concat(\"('\" + id + \"')\");\n return uca;\n };\n /**\n * Create a custom action\n *\n * @param creationInfo The information which defines the new custom action\n *\n */\n UserCustomActions.prototype.add = function (properties) {\n var _this = this;\n var postBody = JSON.stringify(util_1.Util.extend({ __metadata: { \"type\": \"SP.UserCustomAction\" } }, properties));\n return this.post({ body: postBody }).then(function (data) {\n return {\n action: _this.getById(data.Id),\n data: data,\n };\n });\n };\n /**\n * Deletes all custom actions in the collection.\n *\n */\n UserCustomActions.prototype.clear = function () {\n return this.clone(UserCustomActions, \"clear\", true).post();\n };\n return UserCustomActions;\n}(queryable_1.QueryableCollection));\nexports.UserCustomActions = UserCustomActions;\nvar UserCustomAction = (function (_super) {\n __extends(UserCustomAction, _super);\n function UserCustomAction() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n UserCustomAction.prototype.update = function (properties) {\n var _this = this;\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": \"SP.UserCustomAction\" },\n }, properties));\n return this.post({\n body: postBody,\n headers: {\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n return {\n action: _this,\n data: data,\n };\n });\n };\n /**\n * Remove a custom action\n *\n */\n UserCustomAction.prototype.delete = function () {\n return _super.prototype.delete.call(this);\n };\n return UserCustomAction;\n}(queryable_1.QueryableInstance));\nexports.UserCustomAction = UserCustomAction;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/sharepoint/usercustomactions.js\n// module id = 19\n// module chunks = 0","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar storage = require(\"../../utils/storage\");\nvar exceptions_1 = require(\"../../utils/exceptions\");\n/**\n * A caching provider which can wrap other non-caching providers\n *\n */\nvar CachingConfigurationProvider = (function () {\n /**\n * Creates a new caching configuration provider\n * @constructor\n * @param {IConfigurationProvider} wrappedProvider Provider which will be used to fetch the configuration\n * @param {string} cacheKey Key that will be used to store cached items to the cache\n * @param {IPnPClientStore} cacheStore OPTIONAL storage, which will be used to store cached settings.\n */\n function CachingConfigurationProvider(wrappedProvider, cacheKey, cacheStore) {\n this.wrappedProvider = wrappedProvider;\n this.store = (cacheStore) ? cacheStore : this.selectPnPCache();\n this.cacheKey = \"_configcache_\" + cacheKey;\n }\n /**\n * Gets the wrapped configuration providers\n *\n * @return {IConfigurationProvider} Wrapped configuration provider\n */\n CachingConfigurationProvider.prototype.getWrappedProvider = function () {\n return this.wrappedProvider;\n };\n /**\n * Loads the configuration values either from the cache or from the wrapped provider\n *\n * @return {Promise>} Promise of loaded configuration values\n */\n CachingConfigurationProvider.prototype.getConfiguration = function () {\n var _this = this;\n // Cache not available, pass control to the wrapped provider\n if ((!this.store) || (!this.store.enabled)) {\n return this.wrappedProvider.getConfiguration();\n }\n // Value is found in cache, return it directly\n var cachedConfig = this.store.get(this.cacheKey);\n if (cachedConfig) {\n return new Promise(function (resolve) {\n resolve(cachedConfig);\n });\n }\n // Get and cache value from the wrapped provider\n var providerPromise = this.wrappedProvider.getConfiguration();\n providerPromise.then(function (providedConfig) {\n _this.store.put(_this.cacheKey, providedConfig);\n });\n return providerPromise;\n };\n CachingConfigurationProvider.prototype.selectPnPCache = function () {\n var pnpCache = new storage.PnPClientStorage();\n if ((pnpCache.local) && (pnpCache.local.enabled)) {\n return pnpCache.local;\n }\n if ((pnpCache.session) && (pnpCache.session.enabled)) {\n return pnpCache.session;\n }\n throw new exceptions_1.NoCacheAvailableException();\n };\n return CachingConfigurationProvider;\n}());\nexports.default = CachingConfigurationProvider;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/configuration/providers/cachingConfigurationProvider.js\n// module id = 20\n// module chunks = 0","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Makes requests using the fetch API\n */\nvar FetchClient = (function () {\n function FetchClient() {\n }\n FetchClient.prototype.fetch = function (url, options) {\n return global.fetch(url, options);\n };\n return FetchClient;\n}());\nexports.FetchClient = FetchClient;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/net/fetchclient.js\n// module id = 21\n// module chunks = 0","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar storage_1 = require(\"../utils/storage\");\nvar util_1 = require(\"../utils/util\");\nvar pnplibconfig_1 = require(\"../configuration/pnplibconfig\");\nvar CachingOptions = (function () {\n function CachingOptions(key) {\n this.key = key;\n this.expiration = util_1.Util.dateAdd(new Date(), \"second\", pnplibconfig_1.RuntimeConfig.defaultCachingTimeoutSeconds);\n this.storeName = pnplibconfig_1.RuntimeConfig.defaultCachingStore;\n }\n Object.defineProperty(CachingOptions.prototype, \"store\", {\n get: function () {\n if (this.storeName === \"local\") {\n return CachingOptions.storage.local;\n }\n else {\n return CachingOptions.storage.session;\n }\n },\n enumerable: true,\n configurable: true\n });\n return CachingOptions;\n}());\nCachingOptions.storage = new storage_1.PnPClientStorage();\nexports.CachingOptions = CachingOptions;\nvar CachingParserWrapper = (function () {\n function CachingParserWrapper(_parser, _cacheOptions) {\n this._parser = _parser;\n this._cacheOptions = _cacheOptions;\n }\n CachingParserWrapper.prototype.parse = function (response) {\n var _this = this;\n // add this to the cache based on the options\n return this._parser.parse(response).then(function (data) {\n if (_this._cacheOptions.store !== null) {\n _this._cacheOptions.store.put(_this._cacheOptions.key, data, _this._cacheOptions.expiration);\n }\n return data;\n });\n };\n return CachingParserWrapper;\n}());\nexports.CachingParserWrapper = CachingParserWrapper;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/sharepoint/caching.js\n// module id = 22\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar queryable_1 = require(\"./queryable\");\n/**\n * Describes a collection of List objects\n *\n */\nvar Features = (function (_super) {\n __extends(Features, _super);\n /**\n * Creates a new instance of the Lists class\n *\n * @param baseUrl The url or Queryable which forms the parent of this fields collection\n */\n function Features(baseUrl, path) {\n if (path === void 0) { path = \"features\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * Gets a list from the collection by guid id\n *\n * @param id The Id of the feature (GUID)\n */\n Features.prototype.getById = function (id) {\n var feature = new Feature(this);\n feature.concat(\"('\" + id + \"')\");\n return feature;\n };\n /**\n * Adds a new list to the collection\n *\n * @param id The Id of the feature (GUID)\n * @param force If true the feature activation will be forced\n */\n Features.prototype.add = function (id, force) {\n var _this = this;\n if (force === void 0) { force = false; }\n return this.clone(Features, \"add\", true).post({\n body: JSON.stringify({\n featdefScope: 0,\n featureId: id,\n force: force,\n }),\n }).then(function (data) {\n return {\n data: data,\n feature: _this.getById(id),\n };\n });\n };\n /**\n * Removes (deactivates) a feature from the collection\n *\n * @param id The Id of the feature (GUID)\n * @param force If true the feature deactivation will be forced\n */\n Features.prototype.remove = function (id, force) {\n if (force === void 0) { force = false; }\n return this.clone(Features, \"remove\", true).post({\n body: JSON.stringify({\n featureId: id,\n force: force,\n }),\n });\n };\n return Features;\n}(queryable_1.QueryableCollection));\nexports.Features = Features;\nvar Feature = (function (_super) {\n __extends(Feature, _super);\n function Feature() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Removes (deactivates) a feature from the collection\n *\n * @param force If true the feature deactivation will be forced\n */\n Feature.prototype.deactivate = function (force) {\n var _this = this;\n if (force === void 0) { force = false; }\n var removeDependency = this.addBatchDependency();\n var idGet = new Feature(this).select(\"DefinitionId\");\n return idGet.getAs().then(function (feature) {\n var promise = _this.getParent(Features, _this.parentUrl, \"\", _this.batch).remove(feature.DefinitionId, force);\n removeDependency();\n return promise;\n });\n };\n return Feature;\n}(queryable_1.QueryableInstance));\nexports.Feature = Feature;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/sharepoint/features.js\n// module id = 23\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar queryable_1 = require(\"./queryable\");\nvar util_1 = require(\"../utils/util\");\nvar types_1 = require(\"./types\");\n/**\n * Describes a collection of Field objects\n *\n */\nvar Fields = (function (_super) {\n __extends(Fields, _super);\n /**\n * Creates a new instance of the Fields class\n *\n * @param baseUrl The url or Queryable which forms the parent of this fields collection\n */\n function Fields(baseUrl, path) {\n if (path === void 0) { path = \"fields\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * Gets a field from the collection by title\n *\n * @param title The case-sensitive title of the field\n */\n Fields.prototype.getByTitle = function (title) {\n return new Field(this, \"getByTitle('\" + title + \"')\");\n };\n /**\n * Gets a field from the collection by using internal name or title\n *\n * @param name The case-sensitive internal name or title of the field\n */\n Fields.prototype.getByInternalNameOrTitle = function (name) {\n return new Field(this, \"getByInternalNameOrTitle('\" + name + \"')\");\n };\n /**\n * Gets a list from the collection by guid id\n *\n * @param title The Id of the list\n */\n Fields.prototype.getById = function (id) {\n var f = new Field(this);\n f.concat(\"('\" + id + \"')\");\n return f;\n };\n /**\n * Creates a field based on the specified schema\n */\n Fields.prototype.createFieldAsXml = function (xml) {\n var _this = this;\n var info;\n if (typeof xml === \"string\") {\n info = { SchemaXml: xml };\n }\n else {\n info = xml;\n }\n var postBody = JSON.stringify({\n \"parameters\": util_1.Util.extend({\n \"__metadata\": {\n \"type\": \"SP.XmlSchemaFieldCreationInformation\",\n },\n }, info),\n });\n return this.clone(Fields, \"createfieldasxml\", true).postAs({ body: postBody }).then(function (data) {\n return {\n data: data,\n field: _this.getById(data.Id),\n };\n });\n };\n /**\n * Adds a new list to the collection\n *\n * @param title The new field's title\n * @param fieldType The new field's type (ex: SP.FieldText)\n * @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx)\n */\n Fields.prototype.add = function (title, fieldType, properties) {\n var _this = this;\n if (properties === void 0) { properties = {}; }\n var postBody = JSON.stringify(util_1.Util.extend({\n \"Title\": title,\n \"__metadata\": { \"type\": fieldType },\n }, properties));\n return this.clone(Fields, null, true).postAs({ body: postBody }).then(function (data) {\n return {\n data: data,\n field: _this.getById(data.Id),\n };\n });\n };\n /**\n * Adds a new SP.FieldText to the collection\n *\n * @param title The field title\n * @param maxLength The maximum number of characters allowed in the value of the field.\n * @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx)\n */\n Fields.prototype.addText = function (title, maxLength, properties) {\n if (maxLength === void 0) { maxLength = 255; }\n var props = {\n FieldTypeKind: 2,\n MaxLength: maxLength,\n };\n return this.add(title, \"SP.FieldText\", util_1.Util.extend(props, properties));\n };\n /**\n * Adds a new SP.FieldCalculated to the collection\n *\n * @param title The field title.\n * @param formula The formula for the field.\n * @param dateFormat The date and time format that is displayed in the field.\n * @param outputType Specifies the output format for the field. Represents a FieldType value.\n * @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx)\n */\n Fields.prototype.addCalculated = function (title, formula, dateFormat, outputType, properties) {\n if (outputType === void 0) { outputType = types_1.FieldTypes.Text; }\n var props = {\n DateFormat: dateFormat,\n FieldTypeKind: 17,\n Formula: formula,\n OutputType: outputType,\n };\n return this.add(title, \"SP.FieldCalculated\", util_1.Util.extend(props, properties));\n };\n /**\n * Adds a new SP.FieldDateTime to the collection\n *\n * @param title The field title\n * @param displayFormat The format of the date and time that is displayed in the field.\n * @param calendarType Specifies the calendar type of the field.\n * @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx)\n */\n Fields.prototype.addDateTime = function (title, displayFormat, calendarType, friendlyDisplayFormat, properties) {\n if (displayFormat === void 0) { displayFormat = types_1.DateTimeFieldFormatType.DateOnly; }\n if (calendarType === void 0) { calendarType = types_1.CalendarType.Gregorian; }\n if (friendlyDisplayFormat === void 0) { friendlyDisplayFormat = 0; }\n var props = {\n DateTimeCalendarType: calendarType,\n DisplayFormat: displayFormat,\n FieldTypeKind: 4,\n FriendlyDisplayFormat: friendlyDisplayFormat,\n };\n return this.add(title, \"SP.FieldDateTime\", util_1.Util.extend(props, properties));\n };\n /**\n * Adds a new SP.FieldNumber to the collection\n *\n * @param title The field title\n * @param minValue The field's minimum value\n * @param maxValue The field's maximum value\n * @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx)\n */\n Fields.prototype.addNumber = function (title, minValue, maxValue, properties) {\n var props = { FieldTypeKind: 9 };\n if (typeof minValue !== \"undefined\") {\n props = util_1.Util.extend({ MinimumValue: minValue }, props);\n }\n if (typeof maxValue !== \"undefined\") {\n props = util_1.Util.extend({ MaximumValue: maxValue }, props);\n }\n return this.add(title, \"SP.FieldNumber\", util_1.Util.extend(props, properties));\n };\n /**\n * Adds a new SP.FieldCurrency to the collection\n *\n * @param title The field title\n * @param minValue The field's minimum value\n * @param maxValue The field's maximum value\n * @param currencyLocalId Specifies the language code identifier (LCID) used to format the value of the field\n * @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx)\n */\n Fields.prototype.addCurrency = function (title, minValue, maxValue, currencyLocalId, properties) {\n if (currencyLocalId === void 0) { currencyLocalId = 1033; }\n var props = {\n CurrencyLocaleId: currencyLocalId,\n FieldTypeKind: 10,\n };\n if (typeof minValue !== \"undefined\") {\n props = util_1.Util.extend({ MinimumValue: minValue }, props);\n }\n if (typeof maxValue !== \"undefined\") {\n props = util_1.Util.extend({ MaximumValue: maxValue }, props);\n }\n return this.add(title, \"SP.FieldCurrency\", util_1.Util.extend(props, properties));\n };\n /**\n * Adds a new SP.FieldMultiLineText to the collection\n *\n * @param title The field title\n * @param numberOfLines Specifies the number of lines of text to display for the field.\n * @param richText Specifies whether the field supports rich formatting.\n * @param restrictedMode Specifies whether the field supports a subset of rich formatting.\n * @param appendOnly Specifies whether all changes to the value of the field are displayed in list forms.\n * @param allowHyperlink Specifies whether a hyperlink is allowed as a value of the field.\n * @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx)\n *\n */\n Fields.prototype.addMultilineText = function (title, numberOfLines, richText, restrictedMode, appendOnly, allowHyperlink, properties) {\n if (numberOfLines === void 0) { numberOfLines = 6; }\n if (richText === void 0) { richText = true; }\n if (restrictedMode === void 0) { restrictedMode = false; }\n if (appendOnly === void 0) { appendOnly = false; }\n if (allowHyperlink === void 0) { allowHyperlink = true; }\n var props = {\n AllowHyperlink: allowHyperlink,\n AppendOnly: appendOnly,\n FieldTypeKind: 3,\n NumberOfLines: numberOfLines,\n RestrictedMode: restrictedMode,\n RichText: richText,\n };\n return this.add(title, \"SP.FieldMultiLineText\", util_1.Util.extend(props, properties));\n };\n /**\n * Adds a new SP.FieldUrl to the collection\n *\n * @param title The field title\n */\n Fields.prototype.addUrl = function (title, displayFormat, properties) {\n if (displayFormat === void 0) { displayFormat = types_1.UrlFieldFormatType.Hyperlink; }\n var props = {\n DisplayFormat: displayFormat,\n FieldTypeKind: 11,\n };\n return this.add(title, \"SP.FieldUrl\", util_1.Util.extend(props, properties));\n };\n return Fields;\n}(queryable_1.QueryableCollection));\nexports.Fields = Fields;\n/**\n * Describes a single of Field instance\n *\n */\nvar Field = (function (_super) {\n __extends(Field, _super);\n function Field() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Updates this field intance with the supplied properties\n *\n * @param properties A plain object hash of values to update for the list\n * @param fieldType The type value, required to update child field type properties\n */\n Field.prototype.update = function (properties, fieldType) {\n var _this = this;\n if (fieldType === void 0) { fieldType = \"SP.Field\"; }\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": fieldType },\n }, properties));\n return this.post({\n body: postBody,\n headers: {\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n return {\n data: data,\n field: _this,\n };\n });\n };\n /**\n * Delete this fields\n *\n */\n Field.prototype.delete = function () {\n return this.post({\n headers: {\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n /**\n * Sets the value of the ShowInDisplayForm property for this field.\n */\n Field.prototype.setShowInDisplayForm = function (show) {\n return this.clone(Field, \"setshowindisplayform(\" + show + \")\", true).post();\n };\n /**\n * Sets the value of the ShowInEditForm property for this field.\n */\n Field.prototype.setShowInEditForm = function (show) {\n return this.clone(Field, \"setshowineditform(\" + show + \")\", true).post();\n };\n /**\n * Sets the value of the ShowInNewForm property for this field.\n */\n Field.prototype.setShowInNewForm = function (show) {\n return this.clone(Field, \"setshowinnewform(\" + show + \")\", true).post();\n };\n return Field;\n}(queryable_1.QueryableInstance));\nexports.Field = Field;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/sharepoint/fields.js\n// module id = 24\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar util_1 = require(\"../utils/util\");\nvar queryable_1 = require(\"./queryable\");\n/**\n * Represents a collection of navigation nodes\n *\n */\nvar NavigationNodes = (function (_super) {\n __extends(NavigationNodes, _super);\n function NavigationNodes() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Gets a navigation node by id\n *\n * @param id The id of the node\n */\n NavigationNodes.prototype.getById = function (id) {\n var node = new NavigationNode(this);\n node.concat(\"(\" + id + \")\");\n return node;\n };\n /**\n * Adds a new node to the collection\n *\n * @param title Display name of the node\n * @param url The url of the node\n * @param visible If true the node is visible, otherwise it is hidden (default: true)\n */\n NavigationNodes.prototype.add = function (title, url, visible) {\n var _this = this;\n if (visible === void 0) { visible = true; }\n var postBody = JSON.stringify({\n IsVisible: visible,\n Title: title,\n Url: url,\n \"__metadata\": { \"type\": \"SP.NavigationNode\" },\n });\n return this.clone(NavigationNodes, null, true).post({ body: postBody }).then(function (data) {\n return {\n data: data,\n node: _this.getById(data.Id),\n };\n });\n };\n /**\n * Moves a node to be after another node in the navigation\n *\n * @param nodeId Id of the node to move\n * @param previousNodeId Id of the node after which we move the node specified by nodeId\n */\n NavigationNodes.prototype.moveAfter = function (nodeId, previousNodeId) {\n var postBody = JSON.stringify({\n nodeId: nodeId,\n previousNodeId: previousNodeId,\n });\n return this.clone(NavigationNodes, \"MoveAfter\", true).post({ body: postBody });\n };\n return NavigationNodes;\n}(queryable_1.QueryableCollection));\nexports.NavigationNodes = NavigationNodes;\nvar NavigationNode = (function (_super) {\n __extends(NavigationNode, _super);\n function NavigationNode() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(NavigationNode.prototype, \"children\", {\n /**\n * Represents the child nodes of this node\n */\n get: function () {\n return new NavigationNodes(this, \"Children\");\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Updates this node based on the supplied properties\n *\n * @param properties The hash of key/value pairs to update\n */\n NavigationNode.prototype.update = function (properties) {\n var _this = this;\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": \"SP.NavigationNode\" },\n }, properties));\n return this.post({\n body: postBody,\n headers: {\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n return {\n data: data,\n node: _this,\n };\n });\n };\n /**\n * Deletes this node and any child nodes\n */\n NavigationNode.prototype.delete = function () {\n return _super.prototype.delete.call(this);\n };\n return NavigationNode;\n}(queryable_1.QueryableInstance));\nexports.NavigationNode = NavigationNode;\n/**\n * Exposes the navigation components\n *\n */\nvar Navigation = (function (_super) {\n __extends(Navigation, _super);\n /**\n * Creates a new instance of the Lists class\n *\n * @param baseUrl The url or Queryable which forms the parent of this fields collection\n */\n function Navigation(baseUrl, path) {\n if (path === void 0) { path = \"navigation\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n Object.defineProperty(Navigation.prototype, \"quicklaunch\", {\n /**\n * Gets the quicklaunch navigation for the current context\n *\n */\n get: function () {\n return new NavigationNodes(this, \"quicklaunch\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Navigation.prototype, \"topNavigationBar\", {\n /**\n * Gets the top bar navigation navigation for the current context\n *\n */\n get: function () {\n return new NavigationNodes(this, \"topnavigationbar\");\n },\n enumerable: true,\n configurable: true\n });\n return Navigation;\n}(queryable_1.Queryable));\nexports.Navigation = Navigation;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/sharepoint/navigation.js\n// module id = 25\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar webs_1 = require(\"./webs\");\nvar roles_1 = require(\"./roles\");\nvar types_1 = require(\"./types\");\nvar queryable_1 = require(\"./queryable\");\nvar QueryableSecurable = (function (_super) {\n __extends(QueryableSecurable, _super);\n function QueryableSecurable() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(QueryableSecurable.prototype, \"roleAssignments\", {\n /**\n * Gets the set of role assignments for this item\n *\n */\n get: function () {\n return new roles_1.RoleAssignments(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(QueryableSecurable.prototype, \"firstUniqueAncestorSecurableObject\", {\n /**\n * Gets the closest securable up the security hierarchy whose permissions are applied to this list item\n *\n */\n get: function () {\n return new queryable_1.QueryableInstance(this, \"FirstUniqueAncestorSecurableObject\");\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Gets the effective permissions for the user supplied\n *\n * @param loginName The claims username for the user (ex: i:0#.f|membership|user@domain.com)\n */\n QueryableSecurable.prototype.getUserEffectivePermissions = function (loginName) {\n var q = this.clone(queryable_1.Queryable, \"getUserEffectivePermissions(@user)\", true);\n q.query.add(\"@user\", \"'\" + encodeURIComponent(loginName) + \"'\");\n return q.getAs();\n };\n /**\n * Gets the effective permissions for the current user\n */\n QueryableSecurable.prototype.getCurrentUserEffectivePermissions = function () {\n var _this = this;\n var w = webs_1.Web.fromUrl(this.toUrl());\n return w.currentUser.select(\"LoginName\").getAs().then(function (user) {\n return _this.getUserEffectivePermissions(user.LoginName);\n });\n };\n /**\n * Breaks the security inheritance at this level optinally copying permissions and clearing subscopes\n *\n * @param copyRoleAssignments If true the permissions are copied from the current parent scope\n * @param clearSubscopes Optional. true to make all child securable objects inherit role assignments from the current object\n */\n QueryableSecurable.prototype.breakRoleInheritance = function (copyRoleAssignments, clearSubscopes) {\n if (copyRoleAssignments === void 0) { copyRoleAssignments = false; }\n if (clearSubscopes === void 0) { clearSubscopes = false; }\n return this.clone(QueryableSecurable, \"breakroleinheritance(copyroleassignments=\" + copyRoleAssignments + \", clearsubscopes=\" + clearSubscopes + \")\", true).post();\n };\n /**\n * Removes the local role assignments so that it re-inherit role assignments from the parent object.\n *\n */\n QueryableSecurable.prototype.resetRoleInheritance = function () {\n return this.clone(QueryableSecurable, \"resetroleinheritance\", true).post();\n };\n /**\n * Determines if a given user has the appropriate permissions\n *\n * @param loginName The user to check\n * @param permission The permission being checked\n */\n QueryableSecurable.prototype.userHasPermissions = function (loginName, permission) {\n var _this = this;\n return this.getUserEffectivePermissions(loginName).then(function (perms) {\n return _this.hasPermissions(perms, permission);\n });\n };\n /**\n * Determines if the current user has the requested permissions\n *\n * @param permission The permission we wish to check\n */\n QueryableSecurable.prototype.currentUserHasPermissions = function (permission) {\n var _this = this;\n return this.getCurrentUserEffectivePermissions().then(function (perms) {\n return _this.hasPermissions(perms, permission);\n });\n };\n /**\n * Taken from sp.js, checks the supplied permissions against the mask\n *\n * @param value The security principal's permissions on the given object\n * @param perm The permission checked against the value\n */\n /* tslint:disable:no-bitwise */\n QueryableSecurable.prototype.hasPermissions = function (value, perm) {\n if (!perm) {\n return true;\n }\n if (perm === types_1.PermissionKind.FullMask) {\n return (value.High & 32767) === 32767 && value.Low === 65535;\n }\n perm = perm - 1;\n var num = 1;\n if (perm >= 0 && perm < 32) {\n num = num << perm;\n return 0 !== (value.Low & num);\n }\n else if (perm >= 32 && perm < 64) {\n num = num << perm - 32;\n return 0 !== (value.High & num);\n }\n return false;\n };\n return QueryableSecurable;\n}(queryable_1.QueryableInstance));\nexports.QueryableSecurable = QueryableSecurable;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/sharepoint/queryablesecurable.js\n// module id = 26\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar queryable_1 = require(\"./queryable\");\nvar util_1 = require(\"../utils/util\");\n/**\n * Describes the search API\n *\n */\nvar Search = (function (_super) {\n __extends(Search, _super);\n /**\n * Creates a new instance of the Search class\n *\n * @param baseUrl The url for the search context\n * @param query The SearchQuery object to execute\n */\n function Search(baseUrl, path) {\n if (path === void 0) { path = \"_api/search/postquery\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * .......\n * @returns Promise\n */\n Search.prototype.execute = function (query) {\n var formattedBody;\n formattedBody = query;\n if (formattedBody.SelectProperties) {\n formattedBody.SelectProperties = { results: query.SelectProperties };\n }\n if (formattedBody.RefinementFilters) {\n formattedBody.RefinementFilters = { results: query.RefinementFilters };\n }\n if (formattedBody.SortList) {\n formattedBody.SortList = { results: query.SortList };\n }\n if (formattedBody.HithighlightedProperties) {\n formattedBody.HithighlightedProperties = { results: query.HithighlightedProperties };\n }\n if (formattedBody.ReorderingRules) {\n formattedBody.ReorderingRules = { results: query.ReorderingRules };\n }\n if (formattedBody.Properties) {\n formattedBody.Properties = { results: query.Properties };\n }\n var postBody = JSON.stringify({\n request: util_1.Util.extend({\n \"__metadata\": { \"type\": \"Microsoft.Office.Server.Search.REST.SearchRequest\" },\n }, formattedBody),\n });\n return this.post({ body: postBody }).then(function (data) { return new SearchResults(data); });\n };\n return Search;\n}(queryable_1.QueryableInstance));\nexports.Search = Search;\n/**\n * Describes the SearchResults class, which returns the formatted and raw version of the query response\n */\nvar SearchResults = (function () {\n /**\n * Creates a new instance of the SearchResult class\n *\n */\n function SearchResults(rawResponse) {\n var response = rawResponse.postquery ? rawResponse.postquery : rawResponse;\n this.PrimarySearchResults = this.formatSearchResults(response.PrimaryQueryResult.RelevantResults.Table.Rows);\n this.RawSearchResults = response;\n this.ElapsedTime = response.ElapsedTime;\n this.RowCount = response.PrimaryQueryResult.RelevantResults.RowCount;\n this.TotalRows = response.PrimaryQueryResult.RelevantResults.TotalRows;\n this.TotalRowsIncludingDuplicates = response.PrimaryQueryResult.RelevantResults.TotalRowsIncludingDuplicates;\n }\n /**\n * Formats a search results array\n *\n * @param rawResults The array to process\n */\n SearchResults.prototype.formatSearchResults = function (rawResults) {\n var results = new Array(), tempResults = rawResults.results ? rawResults.results : rawResults;\n for (var _i = 0, tempResults_1 = tempResults; _i < tempResults_1.length; _i++) {\n var i = tempResults_1[_i];\n results.push(new SearchResult(i.Cells));\n }\n return results;\n };\n return SearchResults;\n}());\nexports.SearchResults = SearchResults;\n/**\n * Describes the SearchResult class\n */\nvar SearchResult = (function () {\n /**\n * Creates a new instance of the SearchResult class\n *\n */\n function SearchResult(rawItem) {\n var item = rawItem.results ? rawItem.results : rawItem;\n for (var _i = 0, item_1 = item; _i < item_1.length; _i++) {\n var i = item_1[_i];\n Object.defineProperty(this, i.Key, {\n configurable: false,\n enumerable: false,\n value: i.Value,\n writable: false,\n });\n }\n }\n return SearchResult;\n}());\nexports.SearchResult = SearchResult;\n/**\n * defines the SortDirection enum\n */\nvar SortDirection;\n(function (SortDirection) {\n SortDirection[SortDirection[\"Ascending\"] = 0] = \"Ascending\";\n SortDirection[SortDirection[\"Descending\"] = 1] = \"Descending\";\n SortDirection[SortDirection[\"FQLFormula\"] = 2] = \"FQLFormula\";\n})(SortDirection = exports.SortDirection || (exports.SortDirection = {}));\n/**\n * defines the ReorderingRuleMatchType enum\n */\nvar ReorderingRuleMatchType;\n(function (ReorderingRuleMatchType) {\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"ResultContainsKeyword\"] = 0] = \"ResultContainsKeyword\";\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"TitleContainsKeyword\"] = 1] = \"TitleContainsKeyword\";\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"TitleMatchesKeyword\"] = 2] = \"TitleMatchesKeyword\";\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"UrlStartsWith\"] = 3] = \"UrlStartsWith\";\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"UrlExactlyMatches\"] = 4] = \"UrlExactlyMatches\";\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"ContentTypeIs\"] = 5] = \"ContentTypeIs\";\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"FileExtensionMatches\"] = 6] = \"FileExtensionMatches\";\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"ResultHasTag\"] = 7] = \"ResultHasTag\";\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"ManualCondition\"] = 8] = \"ManualCondition\";\n})(ReorderingRuleMatchType = exports.ReorderingRuleMatchType || (exports.ReorderingRuleMatchType = {}));\n/**\n * Specifies the type value for the property\n */\nvar QueryPropertyValueType;\n(function (QueryPropertyValueType) {\n QueryPropertyValueType[QueryPropertyValueType[\"None\"] = 0] = \"None\";\n QueryPropertyValueType[QueryPropertyValueType[\"StringType\"] = 1] = \"StringType\";\n QueryPropertyValueType[QueryPropertyValueType[\"Int32TYpe\"] = 2] = \"Int32TYpe\";\n QueryPropertyValueType[QueryPropertyValueType[\"BooleanType\"] = 3] = \"BooleanType\";\n QueryPropertyValueType[QueryPropertyValueType[\"StringArrayType\"] = 4] = \"StringArrayType\";\n QueryPropertyValueType[QueryPropertyValueType[\"UnSupportedType\"] = 5] = \"UnSupportedType\";\n})(QueryPropertyValueType = exports.QueryPropertyValueType || (exports.QueryPropertyValueType = {}));\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/sharepoint/search.js\n// module id = 27\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar queryable_1 = require(\"./queryable\");\nvar SearchSuggest = (function (_super) {\n __extends(SearchSuggest, _super);\n function SearchSuggest(baseUrl, path) {\n if (path === void 0) { path = \"_api/search/suggest\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n SearchSuggest.prototype.execute = function (query) {\n this.mapQueryToQueryString(query);\n return this.get().then(function (response) { return new SearchSuggestResult(response); });\n };\n SearchSuggest.prototype.mapQueryToQueryString = function (query) {\n this.query.add(\"querytext\", \"'\" + query.querytext + \"'\");\n if (query.hasOwnProperty(\"count\")) {\n this.query.add(\"inumberofquerysuggestions\", query.count.toString());\n }\n if (query.hasOwnProperty(\"personalCount\")) {\n this.query.add(\"inumberofresultsuggestions\", query.personalCount.toString());\n }\n if (query.hasOwnProperty(\"preQuery\")) {\n this.query.add(\"fprequerysuggestions\", query.preQuery.toString());\n }\n if (query.hasOwnProperty(\"hitHighlighting\")) {\n this.query.add(\"fhithighlighting\", query.hitHighlighting.toString());\n }\n if (query.hasOwnProperty(\"capitalize\")) {\n this.query.add(\"fcapitalizefirstletters\", query.capitalize.toString());\n }\n if (query.hasOwnProperty(\"culture\")) {\n this.query.add(\"culture\", query.culture.toString());\n }\n if (query.hasOwnProperty(\"stemming\")) {\n this.query.add(\"enablestemming\", query.stemming.toString());\n }\n if (query.hasOwnProperty(\"includePeople\")) {\n this.query.add(\"showpeoplenamesuggestions\", query.includePeople.toString());\n }\n if (query.hasOwnProperty(\"queryRules\")) {\n this.query.add(\"enablequeryrules\", query.queryRules.toString());\n }\n if (query.hasOwnProperty(\"prefixMatch\")) {\n this.query.add(\"fprefixmatchallterms\", query.prefixMatch.toString());\n }\n };\n return SearchSuggest;\n}(queryable_1.QueryableInstance));\nexports.SearchSuggest = SearchSuggest;\nvar SearchSuggestResult = (function () {\n function SearchSuggestResult(json) {\n if (json.hasOwnProperty(\"suggest\")) {\n // verbose\n this.PeopleNames = json.suggest.PeopleNames.results;\n this.PersonalResults = json.suggest.PersonalResults.results;\n this.Queries = json.suggest.Queries.results;\n }\n else {\n this.PeopleNames = json.PeopleNames;\n this.PersonalResults = json.PersonalResults;\n this.Queries = json.Queries;\n }\n }\n return SearchSuggestResult;\n}());\nexports.SearchSuggestResult = SearchSuggestResult;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/sharepoint/searchsuggest.js\n// module id = 28\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar queryable_1 = require(\"./queryable\");\nvar webs_1 = require(\"./webs\");\nvar usercustomactions_1 = require(\"./usercustomactions\");\nvar odata_1 = require(\"./odata\");\nvar features_1 = require(\"./features\");\n/**\n * Describes a site collection\n *\n */\nvar Site = (function (_super) {\n __extends(Site, _super);\n /**\n * Creates a new instance of the RoleAssignments class\n *\n * @param baseUrl The url or Queryable which forms the parent of this fields collection\n */\n function Site(baseUrl, path) {\n if (path === void 0) { path = \"_api/site\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n Object.defineProperty(Site.prototype, \"rootWeb\", {\n /**\n * Gets the root web of the site collection\n *\n */\n get: function () {\n return new webs_1.Web(this, \"rootweb\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Site.prototype, \"features\", {\n /**\n * Gets the active features for this site\n *\n */\n get: function () {\n return new features_1.Features(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Site.prototype, \"userCustomActions\", {\n /**\n * Get all custom actions on a site collection\n *\n */\n get: function () {\n return new usercustomactions_1.UserCustomActions(this);\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Gets the context information for the site.\n */\n Site.prototype.getContextInfo = function () {\n var q = new Site(this.parentUrl, \"_api/contextinfo\");\n return q.post().then(function (data) {\n if (data.hasOwnProperty(\"GetContextWebInformation\")) {\n var info = data.GetContextWebInformation;\n info.SupportedSchemaVersions = info.SupportedSchemaVersions.results;\n return info;\n }\n else {\n return data;\n }\n });\n };\n /**\n * Gets the document libraries on a site. Static method. (SharePoint Online only)\n *\n * @param absoluteWebUrl The absolute url of the web whose document libraries should be returned\n */\n Site.prototype.getDocumentLibraries = function (absoluteWebUrl) {\n var q = new queryable_1.Queryable(\"\", \"_api/sp.web.getdocumentlibraries(@v)\");\n q.query.add(\"@v\", \"'\" + absoluteWebUrl + \"'\");\n return q.get().then(function (data) {\n if (data.hasOwnProperty(\"GetDocumentLibraries\")) {\n return data.GetDocumentLibraries;\n }\n else {\n return data;\n }\n });\n };\n /**\n * Gets the site URL from a page URL.\n *\n * @param absolutePageUrl The absolute url of the page\n */\n Site.prototype.getWebUrlFromPageUrl = function (absolutePageUrl) {\n var q = new queryable_1.Queryable(\"\", \"_api/sp.web.getweburlfrompageurl(@v)\");\n q.query.add(\"@v\", \"'\" + absolutePageUrl + \"'\");\n return q.get().then(function (data) {\n if (data.hasOwnProperty(\"GetWebUrlFromPageUrl\")) {\n return data.GetWebUrlFromPageUrl;\n }\n else {\n return data;\n }\n });\n };\n /**\n * Creates a new batch for requests within the context of context this site\n *\n */\n Site.prototype.createBatch = function () {\n return new odata_1.ODataBatch(this.parentUrl);\n };\n return Site;\n}(queryable_1.QueryableInstance));\nexports.Site = Site;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/sharepoint/site.js\n// module id = 29\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar queryable_1 = require(\"./queryable\");\nvar sitegroups_1 = require(\"./sitegroups\");\nvar util_1 = require(\"../utils/util\");\n/**\n * Describes a collection of all site collection users\n *\n */\nvar SiteUsers = (function (_super) {\n __extends(SiteUsers, _super);\n /**\n * Creates a new instance of the Users class\n *\n * @param baseUrl The url or Queryable which forms the parent of this user collection\n */\n function SiteUsers(baseUrl, path) {\n if (path === void 0) { path = \"siteusers\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * Gets a user from the collection by email\n *\n * @param email The email of the user\n */\n SiteUsers.prototype.getByEmail = function (email) {\n return new SiteUser(this, \"getByEmail('\" + email + \"')\");\n };\n /**\n * Gets a user from the collection by id\n *\n * @param id The id of the user\n */\n SiteUsers.prototype.getById = function (id) {\n return new SiteUser(this, \"getById(\" + id + \")\");\n };\n /**\n * Gets a user from the collection by login name\n *\n * @param loginName The email address of the user\n */\n SiteUsers.prototype.getByLoginName = function (loginName) {\n var su = new SiteUser(this);\n su.concat(\"(@v)\");\n su.query.add(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\n return su;\n };\n /**\n * Removes a user from the collection by id\n *\n * @param id The id of the user\n */\n SiteUsers.prototype.removeById = function (id) {\n return this.clone(SiteUsers, \"removeById(\" + id + \")\", true).post();\n };\n /**\n * Removes a user from the collection by login name\n *\n * @param loginName The login name of the user\n */\n SiteUsers.prototype.removeByLoginName = function (loginName) {\n var o = this.clone(SiteUsers, \"removeByLoginName(@v)\", true);\n o.query.add(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\n return o.post();\n };\n /**\n * Add a user to a group\n *\n * @param loginName The login name of the user to add to the group\n *\n */\n SiteUsers.prototype.add = function (loginName) {\n var _this = this;\n return this.clone(SiteUsers, null, true).post({\n body: JSON.stringify({ \"__metadata\": { \"type\": \"SP.User\" }, LoginName: loginName }),\n }).then(function () { return _this.getByLoginName(loginName); });\n };\n return SiteUsers;\n}(queryable_1.QueryableCollection));\nexports.SiteUsers = SiteUsers;\n/**\n * Describes a single user\n *\n */\nvar SiteUser = (function (_super) {\n __extends(SiteUser, _super);\n function SiteUser() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(SiteUser.prototype, \"groups\", {\n /**\n * Get's the groups for this user.\n *\n */\n get: function () {\n return new sitegroups_1.SiteGroups(this, \"groups\");\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Updates this user instance with the supplied properties\n *\n * @param properties A plain object of property names and values to update for the user\n */\n SiteUser.prototype.update = function (properties) {\n var _this = this;\n var postBody = util_1.Util.extend({ \"__metadata\": { \"type\": \"SP.User\" } }, properties);\n return this.post({\n body: JSON.stringify(postBody),\n headers: {\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n return {\n data: data,\n user: _this,\n };\n });\n };\n /**\n * Delete this user\n *\n */\n SiteUser.prototype.delete = function () {\n return this.post({\n headers: {\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n return SiteUser;\n}(queryable_1.QueryableInstance));\nexports.SiteUser = SiteUser;\n/**\n * Represents the current user\n */\nvar CurrentUser = (function (_super) {\n __extends(CurrentUser, _super);\n function CurrentUser(baseUrl, path) {\n if (path === void 0) { path = \"currentuser\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n return CurrentUser;\n}(queryable_1.QueryableInstance));\nexports.CurrentUser = CurrentUser;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/sharepoint/siteusers.js\n// module id = 30\n// module chunks = 0","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar logging_1 = require(\"./logging\");\nfunction deprecated(message) {\n return function (target, propertyKey, descriptor) {\n var method = descriptor.value;\n descriptor.value = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n logging_1.Logger.log({\n data: {\n descriptor: descriptor,\n propertyKey: propertyKey,\n target: target,\n },\n level: logging_1.LogLevel.Warning,\n message: message,\n });\n return method.apply(this, args);\n };\n };\n}\nexports.deprecated = deprecated;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/utils/decorators.js\n// module id = 31\n// module chunks = 0","var g;\r\n\r\n// This works in non-strict mode\r\ng = (function() {\r\n\treturn this;\r\n})();\r\n\r\ntry {\r\n\t// This works if eval is allowed (see CSP)\r\n\tg = g || Function(\"return this\")() || (1,eval)(\"this\");\r\n} catch(e) {\r\n\t// This works if the window reference is available\r\n\tif(typeof window === \"object\")\r\n\t\tg = window;\r\n}\r\n\r\n// g can still be undefined, but nothing to do about it...\r\n// We return undefined, instead of nothing here, so it's\r\n// easier to handle this case. if(!global) { ...}\r\n\r\nmodule.exports = g;\r\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// (webpack)/buildin/global.js\n// module id = 32\n// module chunks = 0","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar collections_1 = require(\"../collections/collections\");\n/**\n * Class used to manage the current application settings\n *\n */\nvar Settings = (function () {\n /**\n * Creates a new instance of the settings class\n *\n * @constructor\n */\n function Settings() {\n this._settings = new collections_1.Dictionary();\n }\n /**\n * Adds a new single setting, or overwrites a previous setting with the same key\n *\n * @param {string} key The key used to store this setting\n * @param {string} value The setting value to store\n */\n Settings.prototype.add = function (key, value) {\n this._settings.add(key, value);\n };\n /**\n * Adds a JSON value to the collection as a string, you must use getJSON to rehydrate the object when read\n *\n * @param {string} key The key used to store this setting\n * @param {any} value The setting value to store\n */\n Settings.prototype.addJSON = function (key, value) {\n this._settings.add(key, JSON.stringify(value));\n };\n /**\n * Applies the supplied hash to the setting collection overwriting any existing value, or created new values\n *\n * @param {TypedHash} hash The set of values to add\n */\n Settings.prototype.apply = function (hash) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n try {\n _this._settings.merge(hash);\n resolve();\n }\n catch (e) {\n reject(e);\n }\n });\n };\n /**\n * Loads configuration settings into the collection from the supplied provider and returns a Promise\n *\n * @param {IConfigurationProvider} provider The provider from which we will load the settings\n */\n Settings.prototype.load = function (provider) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n provider.getConfiguration().then(function (value) {\n _this._settings.merge(value);\n resolve();\n }).catch(function (reason) {\n reject(reason);\n });\n });\n };\n /**\n * Gets a value from the configuration\n *\n * @param {string} key The key whose value we want to return. Returns null if the key does not exist\n * @return {string} string value from the configuration\n */\n Settings.prototype.get = function (key) {\n return this._settings.get(key);\n };\n /**\n * Gets a JSON value, rehydrating the stored string to the original object\n *\n * @param {string} key The key whose value we want to return. Returns null if the key does not exist\n * @return {any} object from the configuration\n */\n Settings.prototype.getJSON = function (key) {\n var o = this.get(key);\n if (typeof o === \"undefined\" || o === null) {\n return o;\n }\n return JSON.parse(o);\n };\n return Settings;\n}());\nexports.Settings = Settings;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/configuration/configuration.js\n// module id = 33\n// module chunks = 0","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar search_1 = require(\"./search\");\nvar searchsuggest_1 = require(\"./searchsuggest\");\nvar site_1 = require(\"./site\");\nvar webs_1 = require(\"./webs\");\nvar util_1 = require(\"../utils/util\");\nvar userprofiles_1 = require(\"./userprofiles\");\nvar exceptions_1 = require(\"../utils/exceptions\");\n/**\n * Root of the SharePoint REST module\n */\nvar Rest = (function () {\n function Rest() {\n }\n /**\n * Executes a search against this web context\n *\n * @param query The SearchQuery definition\n */\n Rest.prototype.searchSuggest = function (query) {\n var finalQuery;\n if (typeof query === \"string\") {\n finalQuery = { querytext: query };\n }\n else {\n finalQuery = query;\n }\n return new searchsuggest_1.SearchSuggest(\"\").execute(finalQuery);\n };\n /**\n * Executes a search against this web context\n *\n * @param query The SearchQuery definition\n */\n Rest.prototype.search = function (query) {\n var finalQuery;\n if (typeof query === \"string\") {\n finalQuery = { Querytext: query };\n }\n else {\n finalQuery = query;\n }\n return new search_1.Search(\"\").execute(finalQuery);\n };\n Object.defineProperty(Rest.prototype, \"site\", {\n /**\n * Begins a site collection scoped REST request\n *\n */\n get: function () {\n return new site_1.Site(\"\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Rest.prototype, \"web\", {\n /**\n * Begins a web scoped REST request\n *\n */\n get: function () {\n return new webs_1.Web(\"\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Rest.prototype, \"profiles\", {\n /**\n * Access to user profile methods\n *\n */\n get: function () {\n return new userprofiles_1.UserProfileQuery(\"\");\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Creates a new batch object for use with the Queryable.addToBatch method\n *\n */\n Rest.prototype.createBatch = function () {\n return this.web.createBatch();\n };\n /**\n * Begins a cross-domain, host site scoped REST request, for use in add-in webs\n *\n * @param addInWebUrl The absolute url of the add-in web\n * @param hostWebUrl The absolute url of the host web\n */\n Rest.prototype.crossDomainSite = function (addInWebUrl, hostWebUrl) {\n return this._cdImpl(site_1.Site, addInWebUrl, hostWebUrl, \"site\");\n };\n /**\n * Begins a cross-domain, host web scoped REST request, for use in add-in webs\n *\n * @param addInWebUrl The absolute url of the add-in web\n * @param hostWebUrl The absolute url of the host web\n */\n Rest.prototype.crossDomainWeb = function (addInWebUrl, hostWebUrl) {\n return this._cdImpl(webs_1.Web, addInWebUrl, hostWebUrl, \"web\");\n };\n /**\n * Implements the creation of cross domain REST urls\n *\n * @param factory The constructor of the object to create Site | Web\n * @param addInWebUrl The absolute url of the add-in web\n * @param hostWebUrl The absolute url of the host web\n * @param urlPart String part to append to the url \"site\" | \"web\"\n */\n Rest.prototype._cdImpl = function (factory, addInWebUrl, hostWebUrl, urlPart) {\n if (!util_1.Util.isUrlAbsolute(addInWebUrl)) {\n throw new exceptions_1.UrlException(\"The addInWebUrl parameter must be an absolute url.\");\n }\n if (!util_1.Util.isUrlAbsolute(hostWebUrl)) {\n throw new exceptions_1.UrlException(\"The hostWebUrl parameter must be an absolute url.\");\n }\n var url = util_1.Util.combinePaths(addInWebUrl, \"_api/SP.AppContextSite(@target)\");\n var instance = new factory(url, urlPart);\n instance.query.add(\"@target\", \"'\" + encodeURIComponent(hostWebUrl) + \"'\");\n return instance;\n };\n return Rest;\n}());\nexports.Rest = Rest;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/sharepoint/rest.js\n// module id = 34\n// module chunks = 0","\"use strict\";\nfunction __export(m) {\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\n}\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__export(require(\"../sharepoint/index\"));\nvar httpclient_1 = require(\"../net/httpclient\");\nexports.HttpClient = httpclient_1.HttpClient;\nvar sprequestexecutorclient_1 = require(\"../net/sprequestexecutorclient\");\nexports.SPRequestExecutorClient = sprequestexecutorclient_1.SPRequestExecutorClient;\nvar nodefetchclient_1 = require(\"../net/nodefetchclient\");\nexports.NodeFetchClient = nodefetchclient_1.NodeFetchClient;\nvar fetchclient_1 = require(\"../net/fetchclient\");\nexports.FetchClient = fetchclient_1.FetchClient;\n__export(require(\"../configuration/providers/index\"));\nvar collections_1 = require(\"../collections/collections\");\nexports.Dictionary = collections_1.Dictionary;\nvar util_1 = require(\"../utils/util\");\nexports.Util = util_1.Util;\n__export(require(\"../utils/logging\"));\n__export(require(\"../utils/exceptions\"));\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/types/index.js\n// module id = 35\n// module chunks = 0","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar cachingConfigurationProvider_1 = require(\"./cachingConfigurationProvider\");\nexports.CachingConfigurationProvider = cachingConfigurationProvider_1.default;\nvar spListConfigurationProvider_1 = require(\"./spListConfigurationProvider\");\nexports.SPListConfigurationProvider = spListConfigurationProvider_1.default;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/configuration/providers/index.js\n// module id = 36\n// module chunks = 0","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar cachingConfigurationProvider_1 = require(\"./cachingConfigurationProvider\");\n/**\n * A configuration provider which loads configuration values from a SharePoint list\n *\n */\nvar SPListConfigurationProvider = (function () {\n /**\n * Creates a new SharePoint list based configuration provider\n * @constructor\n * @param {string} webUrl Url of the SharePoint site, where the configuration list is located\n * @param {string} listTitle Title of the SharePoint list, which contains the configuration settings (optional, default = \"config\")\n */\n function SPListConfigurationProvider(sourceWeb, sourceListTitle) {\n if (sourceListTitle === void 0) { sourceListTitle = \"config\"; }\n this.sourceWeb = sourceWeb;\n this.sourceListTitle = sourceListTitle;\n }\n Object.defineProperty(SPListConfigurationProvider.prototype, \"web\", {\n /**\n * Gets the url of the SharePoint site, where the configuration list is located\n *\n * @return {string} Url address of the site\n */\n get: function () {\n return this.sourceWeb;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SPListConfigurationProvider.prototype, \"listTitle\", {\n /**\n * Gets the title of the SharePoint list, which contains the configuration settings\n *\n * @return {string} List title\n */\n get: function () {\n return this.sourceListTitle;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Loads the configuration values from the SharePoint list\n *\n * @return {Promise>} Promise of loaded configuration values\n */\n SPListConfigurationProvider.prototype.getConfiguration = function () {\n return this.web.lists.getByTitle(this.listTitle).items.select(\"Title\", \"Value\")\n .getAs().then(function (data) {\n return data.reduce(function (configuration, item) {\n return Object.defineProperty(configuration, item.Title, {\n configurable: false,\n enumerable: false,\n value: item.Value,\n writable: false,\n });\n }, {});\n });\n };\n /**\n * Wraps the current provider in a cache enabled provider\n *\n * @return {CachingConfigurationProvider} Caching providers which wraps the current provider\n */\n SPListConfigurationProvider.prototype.asCaching = function () {\n var cacheKey = \"splist_\" + this.web.toUrl() + \"+\" + this.listTitle;\n return new cachingConfigurationProvider_1.default(this, cacheKey);\n };\n return SPListConfigurationProvider;\n}());\nexports.default = SPListConfigurationProvider;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/configuration/providers/spListConfigurationProvider.js\n// module id = 37\n// module chunks = 0","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar collections_1 = require(\"../collections/collections\");\nvar util_1 = require(\"../utils/util\");\nvar odata_1 = require(\"../sharepoint/odata\");\nvar CachedDigest = (function () {\n function CachedDigest() {\n }\n return CachedDigest;\n}());\nexports.CachedDigest = CachedDigest;\n// allows for the caching of digests across all HttpClient's which each have their own DigestCache wrapper.\nvar digests = new collections_1.Dictionary();\nvar DigestCache = (function () {\n function DigestCache(_httpClient, _digests) {\n if (_digests === void 0) { _digests = digests; }\n this._httpClient = _httpClient;\n this._digests = _digests;\n }\n DigestCache.prototype.getDigest = function (webUrl) {\n var _this = this;\n var cachedDigest = this._digests.get(webUrl);\n if (cachedDigest !== null) {\n var now = new Date();\n if (now < cachedDigest.expiration) {\n return Promise.resolve(cachedDigest.value);\n }\n }\n var url = util_1.Util.combinePaths(webUrl, \"/_api/contextinfo\");\n return this._httpClient.fetchRaw(url, {\n cache: \"no-cache\",\n credentials: \"same-origin\",\n headers: {\n \"Accept\": \"application/json;odata=verbose\",\n \"Content-type\": \"application/json;odata=verbose;charset=utf-8\",\n },\n method: \"POST\",\n }).then(function (response) {\n var parser = new odata_1.ODataDefaultParser();\n return parser.parse(response).then(function (d) { return d.GetContextWebInformation; });\n }).then(function (data) {\n var newCachedDigest = new CachedDigest();\n newCachedDigest.value = data.FormDigestValue;\n var seconds = data.FormDigestTimeoutSeconds;\n var expiration = new Date();\n expiration.setTime(expiration.getTime() + 1000 * seconds);\n newCachedDigest.expiration = expiration;\n _this._digests.add(webUrl, newCachedDigest);\n return newCachedDigest.value;\n });\n };\n DigestCache.prototype.clear = function () {\n this._digests.clear();\n };\n return DigestCache;\n}());\nexports.DigestCache = DigestCache;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/net/digestcache.js\n// module id = 38\n// module chunks = 0","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar exceptions_1 = require(\"../utils/exceptions\");\n/**\n * This module is substituted for the NodeFetchClient.ts during the packaging process. This helps to reduce the pnp.js file size by\n * not including all of the node dependencies\n */\nvar NodeFetchClient = (function () {\n function NodeFetchClient() {\n }\n /**\n * Always throws an error that NodeFetchClient is not supported for use in the browser\n */\n NodeFetchClient.prototype.fetch = function () {\n throw new exceptions_1.NodeFetchClientUnsupportedException();\n };\n return NodeFetchClient;\n}());\nexports.NodeFetchClient = NodeFetchClient;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/net/nodefetchclientbrowser.js\n// module id = 39\n// module chunks = 0","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar util_1 = require(\"../utils/util\");\nvar exceptions_1 = require(\"../utils/exceptions\");\n/**\n * Makes requests using the SP.RequestExecutor library.\n */\nvar SPRequestExecutorClient = (function () {\n function SPRequestExecutorClient() {\n /**\n * Converts a SharePoint REST API response to a fetch API response.\n */\n this.convertToResponse = function (spResponse) {\n var responseHeaders = new Headers();\n for (var h in spResponse.headers) {\n if (spResponse.headers[h]) {\n responseHeaders.append(h, spResponse.headers[h]);\n }\n }\n // issue #256, Cannot have an empty string body when creating a Response with status 204\n var body = spResponse.statusCode === 204 ? null : spResponse.body;\n return new Response(body, {\n headers: responseHeaders,\n status: spResponse.statusCode,\n statusText: spResponse.statusText,\n });\n };\n }\n /**\n * Fetches a URL using the SP.RequestExecutor library.\n */\n SPRequestExecutorClient.prototype.fetch = function (url, options) {\n var _this = this;\n if (typeof SP === \"undefined\" || typeof SP.RequestExecutor === \"undefined\") {\n throw new exceptions_1.SPRequestExecutorUndefinedException();\n }\n var addinWebUrl = url.substring(0, url.indexOf(\"/_api\")), executor = new SP.RequestExecutor(addinWebUrl);\n var headers = {}, iterator, temp;\n if (options.headers && options.headers instanceof Headers) {\n iterator = options.headers.entries();\n temp = iterator.next();\n while (!temp.done) {\n headers[temp.value[0]] = temp.value[1];\n temp = iterator.next();\n }\n }\n else {\n headers = options.headers;\n }\n return new Promise(function (resolve, reject) {\n var requestOptions = {\n error: function (error) {\n reject(_this.convertToResponse(error));\n },\n headers: headers,\n method: options.method,\n success: function (response) {\n resolve(_this.convertToResponse(response));\n },\n url: url,\n };\n if (options.body) {\n requestOptions = util_1.Util.extend(requestOptions, { body: options.body });\n }\n else {\n requestOptions = util_1.Util.extend(requestOptions, { binaryStringRequestBody: true });\n }\n executor.executeAsync(requestOptions);\n });\n };\n return SPRequestExecutorClient;\n}());\nexports.SPRequestExecutorClient = SPRequestExecutorClient;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/net/sprequestexecutorclient.js\n// module id = 40\n// module chunks = 0","\"use strict\";\nfunction __export(m) {\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\n}\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar util_1 = require(\"./utils/util\");\nvar storage_1 = require(\"./utils/storage\");\nvar configuration_1 = require(\"./configuration/configuration\");\nvar logging_1 = require(\"./utils/logging\");\nvar rest_1 = require(\"./sharepoint/rest\");\nvar pnplibconfig_1 = require(\"./configuration/pnplibconfig\");\n/**\n * Root class of the Patterns and Practices namespace, provides an entry point to the library\n */\n/**\n * Utility methods\n */\nexports.util = util_1.Util;\n/**\n * Provides access to the REST interface\n */\nexports.sp = new rest_1.Rest();\n/**\n * Provides access to local and session storage\n */\nexports.storage = new storage_1.PnPClientStorage();\n/**\n * Global configuration instance to which providers can be added\n */\nexports.config = new configuration_1.Settings();\n/**\n * Global logging instance to which subscribers can be registered and messages written\n */\nexports.log = logging_1.Logger;\n/**\n * Allows for the configuration of the library\n */\nexports.setup = pnplibconfig_1.setRuntimeConfig;\n/**\n * Expose a subset of classes from the library for public consumption\n */\n__export(require(\"./types/index\"));\n// creating this class instead of directly assigning to default fixes issue #116\nvar Def = {\n /**\n * Global configuration instance to which providers can be added\n */\n config: exports.config,\n /**\n * Global logging instance to which subscribers can be registered and messages written\n */\n log: exports.log,\n /**\n * Provides access to local and session storage\n */\n setup: exports.setup,\n /**\n * Provides access to the REST interface\n */\n sp: exports.sp,\n /**\n * Provides access to local and session storage\n */\n storage: exports.storage,\n /**\n * Utility methods\n */\n util: exports.util,\n};\n/**\n * Enables use of the import pnp from syntax\n */\nexports.default = Def;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/pnp.js\n// module id = 41\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar queryable_1 = require(\"./queryable\");\nvar odata_1 = require(\"./odata\");\n/**\n * Describes a collection of Item objects\n *\n */\nvar AttachmentFiles = (function (_super) {\n __extends(AttachmentFiles, _super);\n /**\n * Creates a new instance of the AttachmentFiles class\n *\n * @param baseUrl The url or Queryable which forms the parent of this attachments collection\n */\n function AttachmentFiles(baseUrl, path) {\n if (path === void 0) { path = \"AttachmentFiles\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * Gets a Attachment File by filename\n *\n * @param name The name of the file, including extension.\n */\n AttachmentFiles.prototype.getByName = function (name) {\n var f = new AttachmentFile(this);\n f.concat(\"('\" + name + \"')\");\n return f;\n };\n /**\n * Adds a new attachment to the collection. Not supported for batching.\n *\n * @param name The name of the file, including extension.\n * @param content The Base64 file content.\n */\n AttachmentFiles.prototype.add = function (name, content) {\n var _this = this;\n return this.clone(AttachmentFiles, \"add(FileName='\" + name + \"')\").post({\n body: content,\n }).then(function (response) {\n return {\n data: response,\n file: _this.getByName(name),\n };\n });\n };\n /**\n * Adds mjultiple new attachment to the collection. Not supported for batching.\n *\n * @files name The collection of files to add\n */\n AttachmentFiles.prototype.addMultiple = function (files) {\n var _this = this;\n // add the files in series so we don't get update conflicts\n return files.reduce(function (chain, file) { return chain.then(function () { return _this.clone(AttachmentFiles, \"add(FileName='\" + file.name + \"')\").post({\n body: file.content,\n }); }); }, Promise.resolve());\n };\n return AttachmentFiles;\n}(queryable_1.QueryableCollection));\nexports.AttachmentFiles = AttachmentFiles;\n/**\n * Describes a single attachment file instance\n *\n */\nvar AttachmentFile = (function (_super) {\n __extends(AttachmentFile, _super);\n function AttachmentFile() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Gets the contents of the file as text\n *\n */\n AttachmentFile.prototype.getText = function () {\n return this.clone(AttachmentFile, \"$value\").get(new odata_1.TextFileParser());\n };\n /**\n * Gets the contents of the file as a blob, does not work in Node.js\n *\n */\n AttachmentFile.prototype.getBlob = function () {\n return this.clone(AttachmentFile, \"$value\").get(new odata_1.BlobFileParser());\n };\n /**\n * Gets the contents of a file as an ArrayBuffer, works in Node.js\n */\n AttachmentFile.prototype.getBuffer = function () {\n return this.clone(AttachmentFile, \"$value\").get(new odata_1.BufferFileParser());\n };\n /**\n * Gets the contents of a file as an ArrayBuffer, works in Node.js\n */\n AttachmentFile.prototype.getJSON = function () {\n return this.clone(AttachmentFile, \"$value\").get(new odata_1.JSONFileParser());\n };\n /**\n * Sets the content of a file. Not supported for batching\n *\n * @param content The value to set for the file contents\n */\n AttachmentFile.prototype.setContent = function (content) {\n var _this = this;\n return this.clone(AttachmentFile, \"$value\").post({\n body: content,\n headers: {\n \"X-HTTP-Method\": \"PUT\",\n },\n }).then(function (_) { return new AttachmentFile(_this); });\n };\n /**\n * Delete this attachment file\n *\n * @param eTag Value used in the IF-Match header, by default \"*\"\n */\n AttachmentFile.prototype.delete = function (eTag) {\n if (eTag === void 0) { eTag = \"*\"; }\n return this.post({\n headers: {\n \"IF-Match\": eTag,\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n return AttachmentFile;\n}(queryable_1.QueryableInstance));\nexports.AttachmentFile = AttachmentFile;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/sharepoint/attachmentfiles.js\n// module id = 42\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar queryable_1 = require(\"./queryable\");\n/**\n * Describes a collection of Field objects\n *\n */\nvar Forms = (function (_super) {\n __extends(Forms, _super);\n /**\n * Creates a new instance of the Fields class\n *\n * @param baseUrl The url or Queryable which forms the parent of this fields collection\n */\n function Forms(baseUrl, path) {\n if (path === void 0) { path = \"forms\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * Gets a form by id\n *\n * @param id The guid id of the item to retrieve\n */\n Forms.prototype.getById = function (id) {\n var i = new Form(this);\n i.concat(\"('\" + id + \"')\");\n return i;\n };\n return Forms;\n}(queryable_1.QueryableCollection));\nexports.Forms = Forms;\n/**\n * Describes a single of Form instance\n *\n */\nvar Form = (function (_super) {\n __extends(Form, _super);\n function Form() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return Form;\n}(queryable_1.QueryableInstance));\nexports.Form = Form;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/sharepoint/forms.js\n// module id = 43\n// module chunks = 0","\"use strict\";\nfunction __export(m) {\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\n}\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__export(require(\"./caching\"));\nvar files_1 = require(\"./files\");\nexports.CheckinType = files_1.CheckinType;\nexports.WebPartsPersonalizationScope = files_1.WebPartsPersonalizationScope;\nexports.MoveOperations = files_1.MoveOperations;\nexports.TemplateFileType = files_1.TemplateFileType;\nvar folders_1 = require(\"./folders\");\nexports.Folder = folders_1.Folder;\nexports.Folders = folders_1.Folders;\nvar items_1 = require(\"./items\");\nexports.Item = items_1.Item;\nexports.Items = items_1.Items;\nexports.PagedItemCollection = items_1.PagedItemCollection;\nvar navigation_1 = require(\"./navigation\");\nexports.NavigationNodes = navigation_1.NavigationNodes;\nexports.NavigationNode = navigation_1.NavigationNode;\nvar lists_1 = require(\"./lists\");\nexports.List = lists_1.List;\nexports.Lists = lists_1.Lists;\nvar odata_1 = require(\"./odata\");\nexports.extractOdataId = odata_1.extractOdataId;\nexports.ODataParserBase = odata_1.ODataParserBase;\nexports.ODataDefaultParser = odata_1.ODataDefaultParser;\nexports.ODataRaw = odata_1.ODataRaw;\nexports.ODataValue = odata_1.ODataValue;\nexports.ODataEntity = odata_1.ODataEntity;\nexports.ODataEntityArray = odata_1.ODataEntityArray;\nexports.TextFileParser = odata_1.TextFileParser;\nexports.BlobFileParser = odata_1.BlobFileParser;\nexports.BufferFileParser = odata_1.BufferFileParser;\nexports.JSONFileParser = odata_1.JSONFileParser;\nvar queryable_1 = require(\"./queryable\");\nexports.Queryable = queryable_1.Queryable;\nexports.QueryableInstance = queryable_1.QueryableInstance;\nexports.QueryableCollection = queryable_1.QueryableCollection;\nvar roles_1 = require(\"./roles\");\nexports.RoleDefinitionBindings = roles_1.RoleDefinitionBindings;\nvar search_1 = require(\"./search\");\nexports.Search = search_1.Search;\nexports.SearchResult = search_1.SearchResult;\nexports.SearchResults = search_1.SearchResults;\nexports.SortDirection = search_1.SortDirection;\nexports.ReorderingRuleMatchType = search_1.ReorderingRuleMatchType;\nexports.QueryPropertyValueType = search_1.QueryPropertyValueType;\nvar searchsuggest_1 = require(\"./searchsuggest\");\nexports.SearchSuggest = searchsuggest_1.SearchSuggest;\nexports.SearchSuggestResult = searchsuggest_1.SearchSuggestResult;\nvar site_1 = require(\"./site\");\nexports.Site = site_1.Site;\n__export(require(\"./types\"));\nvar webs_1 = require(\"./webs\");\nexports.Web = webs_1.Web;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/sharepoint/index.js\n// module id = 44\n// module chunks = 0","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar caching_1 = require(\"./caching\");\nvar httpclient_1 = require(\"../net/httpclient\");\nvar logging_1 = require(\"../utils/logging\");\nvar util_1 = require(\"../utils/util\");\n/**\n * Processes a given context through the request pipeline\n *\n * @param context The request context we are processing\n */\nfunction pipe(context) {\n // this is the beginning of the extensible pipeline in future versions\n var pipeline = [\n PipelineMethods.logStart,\n PipelineMethods.caching,\n PipelineMethods.send,\n PipelineMethods.logEnd,\n ];\n return pipeline.reduce(function (chain, next) { return chain.then(function (c) { return next(c); }); }, Promise.resolve(context))\n .then(function (ctx) { return PipelineMethods.returnResult(ctx); })\n .catch(function (e) {\n logging_1.Logger.log({\n data: e,\n level: logging_1.LogLevel.Error,\n message: \"Error in request pipeline: \" + e.message,\n });\n throw e;\n });\n}\nexports.pipe = pipe;\n/**\n * decorator factory applied to methods in the pipeline to control behavior\n */\nfunction requestPipelineMethod(alwaysRun) {\n if (alwaysRun === void 0) { alwaysRun = false; }\n return function (target, propertyKey, descriptor) {\n var method = descriptor.value;\n descriptor.value = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n // if we have a result already in the pipeline, pass it along and don't call the tagged method\n if (!alwaysRun && args.length > 0 && args[0].hasOwnProperty(\"hasResult\") && args[0].hasResult) {\n logging_1.Logger.write(\"[\" + args[0].requestId + \"] (\" + (new Date()).getTime() + \") Skipping request pipeline method \" + propertyKey + \", existing result in pipeline.\", logging_1.LogLevel.Verbose);\n return Promise.resolve(args[0]);\n }\n // apply the tagged method\n logging_1.Logger.write(\"[\" + args[0].requestId + \"] (\" + (new Date()).getTime() + \") Calling request pipeline method \" + propertyKey + \".\", logging_1.LogLevel.Verbose);\n return method.apply(target, args);\n };\n };\n}\n/**\n * Contains the methods used within the request pipeline\n */\nvar PipelineMethods = (function () {\n function PipelineMethods() {\n }\n /**\n * Logs the start of the request\n */\n PipelineMethods.logStart = function (context) {\n return new Promise(function (resolve) {\n logging_1.Logger.log({\n data: logging_1.Logger.activeLogLevel === logging_1.LogLevel.Info ? {} : context,\n level: logging_1.LogLevel.Info,\n message: \"[\" + context.requestId + \"] (\" + (new Date()).getTime() + \") Beginning \" + context.verb + \" request to \" + context.requestAbsoluteUrl,\n });\n resolve(context);\n });\n };\n /**\n * Handles caching of the request\n */\n PipelineMethods.caching = function (context) {\n return new Promise(function (resolve) {\n // handle caching, if applicable\n if (context.verb === \"GET\" && context.isCached) {\n logging_1.Logger.write(\"[\" + context.requestId + \"] (\" + (new Date()).getTime() + \") Caching is enabled for request, checking cache...\", logging_1.LogLevel.Info);\n var cacheOptions = new caching_1.CachingOptions(context.requestAbsoluteUrl.toLowerCase());\n if (typeof context.cachingOptions !== \"undefined\") {\n cacheOptions = util_1.Util.extend(cacheOptions, context.cachingOptions);\n }\n // we may not have a valid store, i.e. on node\n if (cacheOptions.store !== null) {\n // check if we have the data in cache and if so resolve the promise and return\n var data = cacheOptions.store.get(cacheOptions.key);\n if (data !== null) {\n // ensure we clear any help batch dependency we are resolving from the cache\n logging_1.Logger.log({\n data: logging_1.Logger.activeLogLevel === logging_1.LogLevel.Info ? {} : data,\n level: logging_1.LogLevel.Info,\n message: \"[\" + context.requestId + \"] (\" + (new Date()).getTime() + \") Value returned from cache.\",\n });\n context.batchDependency();\n return PipelineMethods.setResult(context, data).then(function (ctx) { return resolve(ctx); });\n }\n }\n logging_1.Logger.write(\"[\" + context.requestId + \"] (\" + (new Date()).getTime() + \") Value not found in cache.\", logging_1.LogLevel.Info);\n // if we don't then wrap the supplied parser in the caching parser wrapper\n // and send things on their way\n context.parser = new caching_1.CachingParserWrapper(context.parser, cacheOptions);\n }\n return resolve(context);\n });\n };\n /**\n * Sends the request\n */\n PipelineMethods.send = function (context) {\n return new Promise(function (resolve, reject) {\n // send or batch the request\n if (context.isBatched) {\n // we are in a batch, so add to batch, remove dependency, and resolve with the batch's promise\n var p = context.batch.add(context.requestAbsoluteUrl, context.verb, context.options, context.parser);\n // we release the dependency here to ensure the batch does not execute until the request is added to the batch\n context.batchDependency();\n logging_1.Logger.write(\"[\" + context.requestId + \"] (\" + (new Date()).getTime() + \") Batching request.\", logging_1.LogLevel.Info);\n resolve(p.then(function (result) { return PipelineMethods.setResult(context, result); }));\n }\n else {\n logging_1.Logger.write(\"[\" + context.requestId + \"] (\" + (new Date()).getTime() + \") Sending request.\", logging_1.LogLevel.Info);\n // we are not part of a batch, so proceed as normal\n var client = new httpclient_1.HttpClient();\n var opts = util_1.Util.extend(context.options || {}, { method: context.verb });\n client.fetch(context.requestAbsoluteUrl, opts)\n .then(function (response) { return context.parser.parse(response); })\n .then(function (result) { return PipelineMethods.setResult(context, result); })\n .then(function (ctx) { return resolve(ctx); })\n .catch(function (e) { return reject(e); });\n }\n });\n };\n /**\n * Logs the end of the request\n */\n PipelineMethods.logEnd = function (context) {\n return new Promise(function (resolve) {\n logging_1.Logger.log({\n data: logging_1.Logger.activeLogLevel === logging_1.LogLevel.Info ? {} : context,\n level: logging_1.LogLevel.Info,\n message: \"[\" + context.requestId + \"] (\" + (new Date()).getTime() + \") Completing \" + context.verb + \" request to \" + context.requestAbsoluteUrl,\n });\n resolve(context);\n });\n };\n /**\n * At the end of the pipeline resolves the request's result\n */\n PipelineMethods.returnResult = function (context) {\n logging_1.Logger.log({\n data: context.result,\n level: logging_1.LogLevel.Verbose,\n message: \"[\" + context.requestId + \"] (\" + (new Date()).getTime() + \") Returning, see data property for value.\",\n });\n return Promise.resolve(context.result);\n };\n /**\n * Sets the result on the context\n */\n PipelineMethods.setResult = function (context, value) {\n return new Promise(function (resolve) {\n context.result = value;\n context.hasResult = true;\n resolve(context);\n });\n };\n return PipelineMethods;\n}());\n__decorate([\n requestPipelineMethod(true)\n], PipelineMethods, \"logStart\", null);\n__decorate([\n requestPipelineMethod()\n], PipelineMethods, \"caching\", null);\n__decorate([\n requestPipelineMethod()\n], PipelineMethods, \"send\", null);\n__decorate([\n requestPipelineMethod(true)\n], PipelineMethods, \"logEnd\", null);\n__decorate([\n requestPipelineMethod(true)\n], PipelineMethods, \"returnResult\", null);\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/sharepoint/queryablerequest.js\n// module id = 45\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar queryable_1 = require(\"./queryable\");\nvar RelatedItemManagerImpl = (function (_super) {\n __extends(RelatedItemManagerImpl, _super);\n function RelatedItemManagerImpl(baseUrl, path) {\n if (path === void 0) { path = \"_api/SP.RelatedItemManager\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n RelatedItemManagerImpl.FromUrl = function (url) {\n if (url === null) {\n return new RelatedItemManagerImpl(\"\");\n }\n var index = url.indexOf(\"_api/\");\n if (index > -1) {\n return new RelatedItemManagerImpl(url.substr(0, index));\n }\n return new RelatedItemManagerImpl(url);\n };\n RelatedItemManagerImpl.prototype.getRelatedItems = function (sourceListName, sourceItemId) {\n var query = this.clone(RelatedItemManagerImpl, null, true);\n query.concat(\".GetRelatedItems\");\n return query.post({\n body: JSON.stringify({\n SourceItemID: sourceItemId,\n SourceListName: sourceListName,\n }),\n });\n };\n RelatedItemManagerImpl.prototype.getPageOneRelatedItems = function (sourceListName, sourceItemId) {\n var query = this.clone(RelatedItemManagerImpl, null, true);\n query.concat(\".GetPageOneRelatedItems\");\n return query.post({\n body: JSON.stringify({\n SourceItemID: sourceItemId,\n SourceListName: sourceListName,\n }),\n });\n };\n RelatedItemManagerImpl.prototype.addSingleLink = function (sourceListName, sourceItemId, sourceWebUrl, targetListName, targetItemID, targetWebUrl, tryAddReverseLink) {\n if (tryAddReverseLink === void 0) { tryAddReverseLink = false; }\n var query = this.clone(RelatedItemManagerImpl, null, true);\n query.concat(\".AddSingleLink\");\n return query.post({\n body: JSON.stringify({\n SourceItemID: sourceItemId,\n SourceListName: sourceListName,\n SourceWebUrl: sourceWebUrl,\n TargetItemID: targetItemID,\n TargetListName: targetListName,\n TargetWebUrl: targetWebUrl,\n TryAddReverseLink: tryAddReverseLink,\n }),\n });\n };\n /**\n * Adds a related item link from an item specified by list name and item id, to an item specified by url\n *\n * @param sourceListName The source list name or list id\n * @param sourceItemId The source item id\n * @param targetItemUrl The target item url\n * @param tryAddReverseLink If set to true try to add the reverse link (will not return error if it fails)\n */\n RelatedItemManagerImpl.prototype.addSingleLinkToUrl = function (sourceListName, sourceItemId, targetItemUrl, tryAddReverseLink) {\n if (tryAddReverseLink === void 0) { tryAddReverseLink = false; }\n var query = this.clone(RelatedItemManagerImpl, null, true);\n query.concat(\".AddSingleLinkToUrl\");\n return query.post({\n body: JSON.stringify({\n SourceItemID: sourceItemId,\n SourceListName: sourceListName,\n TargetItemUrl: targetItemUrl,\n TryAddReverseLink: tryAddReverseLink,\n }),\n });\n };\n /**\n * Adds a related item link from an item specified by url, to an item specified by list name and item id\n *\n * @param sourceItemUrl The source item url\n * @param targetListName The target list name or list id\n * @param targetItemId The target item id\n * @param tryAddReverseLink If set to true try to add the reverse link (will not return error if it fails)\n */\n RelatedItemManagerImpl.prototype.addSingleLinkFromUrl = function (sourceItemUrl, targetListName, targetItemId, tryAddReverseLink) {\n if (tryAddReverseLink === void 0) { tryAddReverseLink = false; }\n var query = this.clone(RelatedItemManagerImpl, null, true);\n query.concat(\".AddSingleLinkFromUrl\");\n return query.post({\n body: JSON.stringify({\n SourceItemUrl: sourceItemUrl,\n TargetItemID: targetItemId,\n TargetListName: targetListName,\n TryAddReverseLink: tryAddReverseLink,\n }),\n });\n };\n RelatedItemManagerImpl.prototype.deleteSingleLink = function (sourceListName, sourceItemId, sourceWebUrl, targetListName, targetItemId, targetWebUrl, tryDeleteReverseLink) {\n if (tryDeleteReverseLink === void 0) { tryDeleteReverseLink = false; }\n var query = this.clone(RelatedItemManagerImpl, null, true);\n query.concat(\".DeleteSingleLink\");\n return query.post({\n body: JSON.stringify({\n SourceItemID: sourceItemId,\n SourceListName: sourceListName,\n SourceWebUrl: sourceWebUrl,\n TargetItemID: targetItemId,\n TargetListName: targetListName,\n TargetWebUrl: targetWebUrl,\n TryDeleteReverseLink: tryDeleteReverseLink,\n }),\n });\n };\n return RelatedItemManagerImpl;\n}(queryable_1.Queryable));\nexports.RelatedItemManagerImpl = RelatedItemManagerImpl;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/sharepoint/relateditems.js\n// module id = 46\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar queryable_1 = require(\"./queryable\");\n/**\n * Describes a collection of webhook subscriptions\n *\n */\nvar Subscriptions = (function (_super) {\n __extends(Subscriptions, _super);\n /**\n * Creates a new instance of the Subscriptions class\n *\n * @param baseUrl - The url or Queryable which forms the parent of this webhook subscriptions collection\n */\n function Subscriptions(baseUrl, path) {\n if (path === void 0) { path = \"subscriptions\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * Returns all the webhook subscriptions or the specified webhook subscription\n *\n */\n Subscriptions.prototype.getById = function (subscriptionId) {\n var subscription = new Subscription(this);\n subscription.concat(\"('\" + subscriptionId + \"')\");\n return subscription;\n };\n /**\n * Create a new webhook subscription\n *\n */\n Subscriptions.prototype.add = function (notificationUrl, expirationDate, clientState) {\n var _this = this;\n var postBody = JSON.stringify({\n \"clientState\": clientState || \"pnp-js-core-subscription\",\n \"expirationDateTime\": expirationDate,\n \"notificationUrl\": notificationUrl,\n \"resource\": this.toUrl(),\n });\n return this.post({ body: postBody, headers: { \"Content-Type\": \"application/json\" } }).then(function (result) {\n return { data: result, subscription: _this.getById(result.id) };\n });\n };\n return Subscriptions;\n}(queryable_1.QueryableCollection));\nexports.Subscriptions = Subscriptions;\n/**\n * Describes a single webhook subscription instance\n *\n */\nvar Subscription = (function (_super) {\n __extends(Subscription, _super);\n function Subscription() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Update a webhook subscription\n *\n */\n Subscription.prototype.update = function (expirationDate) {\n var _this = this;\n var postBody = JSON.stringify({\n \"expirationDateTime\": expirationDate,\n });\n return this.patch({ body: postBody, headers: { \"Content-Type\": \"application/json\" } }).then(function (data) {\n return { data: data, subscription: _this };\n });\n };\n /**\n * Remove a webhook subscription\n *\n */\n Subscription.prototype.delete = function () {\n return _super.prototype.delete.call(this);\n };\n return Subscription;\n}(queryable_1.QueryableInstance));\nexports.Subscription = Subscription;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/sharepoint/subscriptions.js\n// module id = 47\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar queryable_1 = require(\"./queryable\");\nvar files_1 = require(\"../utils/files\");\nvar odata_1 = require(\"./odata\");\nvar UserProfileQuery = (function (_super) {\n __extends(UserProfileQuery, _super);\n function UserProfileQuery(baseUrl, path) {\n if (path === void 0) { path = \"_api/sp.userprofiles.peoplemanager\"; }\n var _this = _super.call(this, baseUrl, path) || this;\n _this.profileLoader = new ProfileLoader(baseUrl);\n return _this;\n }\n Object.defineProperty(UserProfileQuery.prototype, \"editProfileLink\", {\n /**\n * The URL of the edit profile page for the current user.\n */\n get: function () {\n return this.clone(UserProfileQuery, \"EditProfileLink\").getAs(odata_1.ODataValue());\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(UserProfileQuery.prototype, \"isMyPeopleListPublic\", {\n /**\n * A Boolean value that indicates whether the current user's People I'm Following list is public.\n */\n get: function () {\n return this.clone(UserProfileQuery, \"IsMyPeopleListPublic\").getAs(odata_1.ODataValue());\n },\n enumerable: true,\n configurable: true\n });\n /**\n * A Boolean value that indicates whether the current user's People I'm Following list is public.\n *\n * @param loginName The account name of the user\n */\n UserProfileQuery.prototype.amIFollowedBy = function (loginName) {\n var q = this.clone(UserProfileQuery, \"amifollowedby(@v)\", true);\n q.query.add(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\n return q.get();\n };\n /**\n * Checks whether the current user is following the specified user.\n *\n * @param loginName The account name of the user\n */\n UserProfileQuery.prototype.amIFollowing = function (loginName) {\n var q = this.clone(UserProfileQuery, \"amifollowing(@v)\", true);\n q.query.add(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\n return q.get();\n };\n /**\n * Gets tags that the user is following.\n *\n * @param maxCount The maximum number of tags to get.\n */\n UserProfileQuery.prototype.getFollowedTags = function (maxCount) {\n if (maxCount === void 0) { maxCount = 20; }\n return this.clone(UserProfileQuery, \"getfollowedtags(\" + maxCount + \")\", true).get();\n };\n /**\n * Gets the people who are following the specified user.\n *\n * @param loginName The account name of the user.\n */\n UserProfileQuery.prototype.getFollowersFor = function (loginName) {\n var q = this.clone(UserProfileQuery, \"getfollowersfor(@v)\", true);\n q.query.add(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\n return q.get();\n };\n Object.defineProperty(UserProfileQuery.prototype, \"myFollowers\", {\n /**\n * Gets the people who are following the current user.\n *\n */\n get: function () {\n return new queryable_1.QueryableCollection(this, \"getmyfollowers\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(UserProfileQuery.prototype, \"myProperties\", {\n /**\n * Gets user properties for the current user.\n *\n */\n get: function () {\n return new UserProfileQuery(this, \"getmyproperties\");\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Gets the people who the specified user is following.\n *\n * @param loginName The account name of the user.\n */\n UserProfileQuery.prototype.getPeopleFollowedBy = function (loginName) {\n var q = this.clone(UserProfileQuery, \"getpeoplefollowedby(@v)\", true);\n q.query.add(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\n return q.get();\n };\n /**\n * Gets user properties for the specified user.\n *\n * @param loginName The account name of the user.\n */\n UserProfileQuery.prototype.getPropertiesFor = function (loginName) {\n var q = this.clone(UserProfileQuery, \"getpropertiesfor(@v)\", true);\n q.query.add(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\n return q.get();\n };\n Object.defineProperty(UserProfileQuery.prototype, \"trendingTags\", {\n /**\n * Gets the most popular tags.\n *\n */\n get: function () {\n var q = this.clone(UserProfileQuery, null, true);\n q.concat(\".gettrendingtags\");\n return q.get();\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Gets the specified user profile property for the specified user.\n *\n * @param loginName The account name of the user.\n * @param propertyName The case-sensitive name of the property to get.\n */\n UserProfileQuery.prototype.getUserProfilePropertyFor = function (loginName, propertyName) {\n var q = this.clone(UserProfileQuery, \"getuserprofilepropertyfor(accountname=@v, propertyname='\" + propertyName + \"')\", true);\n q.query.add(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\n return q.get();\n };\n /**\n * Removes the specified user from the user's list of suggested people to follow.\n *\n * @param loginName The account name of the user.\n */\n UserProfileQuery.prototype.hideSuggestion = function (loginName) {\n var q = this.clone(UserProfileQuery, \"hidesuggestion(@v)\", true);\n q.query.add(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\n return q.post();\n };\n /**\n * Checks whether the first user is following the second user.\n *\n * @param follower The account name of the user who might be following followee.\n * @param followee The account name of the user who might be followed.\n */\n UserProfileQuery.prototype.isFollowing = function (follower, followee) {\n var q = this.clone(UserProfileQuery, null, true);\n q.concat(\".isfollowing(possiblefolloweraccountname=@v, possiblefolloweeaccountname=@y)\");\n q.query.add(\"@v\", \"'\" + encodeURIComponent(follower) + \"'\");\n q.query.add(\"@y\", \"'\" + encodeURIComponent(followee) + \"'\");\n return q.get();\n };\n /**\n * Uploads and sets the user profile picture. Not supported for batching.\n *\n * @param profilePicSource Blob data representing the user's picture\n */\n UserProfileQuery.prototype.setMyProfilePic = function (profilePicSource) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n files_1.readBlobAsArrayBuffer(profilePicSource).then(function (buffer) {\n var request = new UserProfileQuery(_this, \"setmyprofilepicture\");\n request.post({\n body: String.fromCharCode.apply(null, new Uint16Array(buffer)),\n }).then(function (_) { return resolve(); });\n }).catch(function (e) { return reject(e); });\n });\n };\n /**\n * Provisions one or more users' personal sites. (My Site administrator on SharePoint Online only)\n *\n * @param emails The email addresses of the users to provision sites for\n */\n UserProfileQuery.prototype.createPersonalSiteEnqueueBulk = function () {\n var emails = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n emails[_i] = arguments[_i];\n }\n return this.profileLoader.createPersonalSiteEnqueueBulk(emails);\n };\n Object.defineProperty(UserProfileQuery.prototype, \"ownerUserProfile\", {\n /**\n * Gets the user profile of the site owner.\n *\n */\n get: function () {\n return this.profileLoader.ownerUserProfile;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(UserProfileQuery.prototype, \"userProfile\", {\n /**\n * Gets the user profile that corresponds to the current user.\n */\n get: function () {\n return this.profileLoader.userProfile;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Enqueues creating a personal site for this user, which can be used to share documents, web pages, and other files.\n *\n * @param interactiveRequest true if interactively (web) initiated request, or false if non-interactively (client) initiated request\n */\n UserProfileQuery.prototype.createPersonalSite = function (interactiveRequest) {\n if (interactiveRequest === void 0) { interactiveRequest = false; }\n return this.profileLoader.createPersonalSite(interactiveRequest);\n };\n /**\n * Sets the privacy settings for this profile.\n *\n * @param share true to make all social data public; false to make all social data private.\n */\n UserProfileQuery.prototype.shareAllSocialData = function (share) {\n return this.profileLoader.shareAllSocialData(share);\n };\n return UserProfileQuery;\n}(queryable_1.QueryableInstance));\nexports.UserProfileQuery = UserProfileQuery;\nvar ProfileLoader = (function (_super) {\n __extends(ProfileLoader, _super);\n function ProfileLoader(baseUrl, path) {\n if (path === void 0) { path = \"_api/sp.userprofiles.profileloader.getprofileloader\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * Provisions one or more users' personal sites. (My Site administrator on SharePoint Online only)\n *\n * @param emails The email addresses of the users to provision sites for\n */\n ProfileLoader.prototype.createPersonalSiteEnqueueBulk = function (emails) {\n return this.clone(ProfileLoader, \"createpersonalsiteenqueuebulk\").post({\n body: JSON.stringify({ \"emailIDs\": emails }),\n });\n };\n Object.defineProperty(ProfileLoader.prototype, \"ownerUserProfile\", {\n /**\n * Gets the user profile of the site owner.\n *\n */\n get: function () {\n var q = this.getParent(ProfileLoader, this.parentUrl, \"_api/sp.userprofiles.profileloader.getowneruserprofile\");\n if (this.hasBatch) {\n q = q.inBatch(this.batch);\n }\n return q.postAs();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ProfileLoader.prototype, \"userProfile\", {\n /**\n * Gets the user profile that corresponds to the current user.\n *\n */\n get: function () {\n return this.clone(ProfileLoader, \"getuserprofile\", true).postAs();\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Enqueues creating a personal site for this user, which can be used to share documents, web pages, and other files.\n *\n * @param interactiveRequest true if interactively (web) initiated request, or false if non-interactively (client) initiated request\n */\n ProfileLoader.prototype.createPersonalSite = function (interactiveRequest) {\n if (interactiveRequest === void 0) { interactiveRequest = false; }\n return this.clone(ProfileLoader, \"getuserprofile/createpersonalsiteenque(\" + interactiveRequest + \")\", true).post();\n };\n /**\n * Sets the privacy settings for this profile.\n *\n * @param share true to make all social data public; false to make all social data private.\n */\n ProfileLoader.prototype.shareAllSocialData = function (share) {\n return this.clone(ProfileLoader, \"getuserprofile/shareallsocialdata(\" + share + \")\", true).post();\n };\n return ProfileLoader;\n}(queryable_1.Queryable));\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/sharepoint/userprofiles.js\n// module id = 48\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar queryable_1 = require(\"./queryable\");\nvar util_1 = require(\"../utils/util\");\n/**\n * Describes the views available in the current context\n *\n */\nvar Views = (function (_super) {\n __extends(Views, _super);\n /**\n * Creates a new instance of the Views class\n *\n * @param baseUrl The url or Queryable which forms the parent of this fields collection\n */\n function Views(baseUrl, path) {\n if (path === void 0) { path = \"views\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * Gets a view by guid id\n *\n * @param id The GUID id of the view\n */\n Views.prototype.getById = function (id) {\n var v = new View(this);\n v.concat(\"('\" + id + \"')\");\n return v;\n };\n /**\n * Gets a view by title (case-sensitive)\n *\n * @param title The case-sensitive title of the view\n */\n Views.prototype.getByTitle = function (title) {\n return new View(this, \"getByTitle('\" + title + \"')\");\n };\n /**\n * Adds a new view to the collection\n *\n * @param title The new views's title\n * @param personalView True if this is a personal view, otherwise false, default = false\n * @param additionalSettings Will be passed as part of the view creation body\n */\n /*tslint:disable max-line-length */\n Views.prototype.add = function (title, personalView, additionalSettings) {\n var _this = this;\n if (personalView === void 0) { personalView = false; }\n if (additionalSettings === void 0) { additionalSettings = {}; }\n var postBody = JSON.stringify(util_1.Util.extend({\n \"PersonalView\": personalView,\n \"Title\": title,\n \"__metadata\": { \"type\": \"SP.View\" },\n }, additionalSettings));\n return this.clone(Views, null, true).postAs({ body: postBody }).then(function (data) {\n return {\n data: data,\n view: _this.getById(data.Id),\n };\n });\n };\n return Views;\n}(queryable_1.QueryableCollection));\nexports.Views = Views;\n/**\n * Describes a single View instance\n *\n */\nvar View = (function (_super) {\n __extends(View, _super);\n function View() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(View.prototype, \"fields\", {\n get: function () {\n return new ViewFields(this);\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Updates this view intance with the supplied properties\n *\n * @param properties A plain object hash of values to update for the view\n */\n View.prototype.update = function (properties) {\n var _this = this;\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": \"SP.View\" },\n }, properties));\n return this.post({\n body: postBody,\n headers: {\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n return {\n data: data,\n view: _this,\n };\n });\n };\n /**\n * Delete this view\n *\n */\n View.prototype.delete = function () {\n return this.post({\n headers: {\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n /**\n * Returns the list view as HTML.\n *\n */\n View.prototype.renderAsHtml = function () {\n return this.clone(queryable_1.Queryable, \"renderashtml\", true).get();\n };\n return View;\n}(queryable_1.QueryableInstance));\nexports.View = View;\nvar ViewFields = (function (_super) {\n __extends(ViewFields, _super);\n function ViewFields(baseUrl, path) {\n if (path === void 0) { path = \"viewfields\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * Gets a value that specifies the XML schema that represents the collection.\n */\n ViewFields.prototype.getSchemaXml = function () {\n return this.clone(queryable_1.Queryable, \"schemaxml\", true).get();\n };\n /**\n * Adds the field with the specified field internal name or display name to the collection.\n *\n * @param fieldTitleOrInternalName The case-sensitive internal name or display name of the field to add.\n */\n ViewFields.prototype.add = function (fieldTitleOrInternalName) {\n return this.clone(ViewFields, \"addviewfield('\" + fieldTitleOrInternalName + \"')\", true).post();\n };\n /**\n * Moves the field with the specified field internal name to the specified position in the collection.\n *\n * @param fieldInternalName The case-sensitive internal name of the field to move.\n * @param index The zero-based index of the new position for the field.\n */\n ViewFields.prototype.move = function (fieldInternalName, index) {\n return this.clone(ViewFields, \"moveviewfieldto\", true).post({\n body: JSON.stringify({ \"field\": fieldInternalName, \"index\": index }),\n });\n };\n /**\n * Removes all the fields from the collection.\n */\n ViewFields.prototype.removeAll = function () {\n return this.clone(ViewFields, \"removeallviewfields\", true).post();\n };\n /**\n * Removes the field with the specified field internal name from the collection.\n *\n * @param fieldInternalName The case-sensitive internal name of the field to remove from the view.\n */\n ViewFields.prototype.remove = function (fieldInternalName) {\n return this.clone(ViewFields, \"removeviewfield('\" + fieldInternalName + \"')\", true).post();\n };\n return ViewFields;\n}(queryable_1.QueryableCollection));\nexports.ViewFields = ViewFields;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/sharepoint/views.js\n// module id = 49\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar queryable_1 = require(\"./queryable\");\nvar LimitedWebPartManager = (function (_super) {\n __extends(LimitedWebPartManager, _super);\n function LimitedWebPartManager() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(LimitedWebPartManager.prototype, \"webparts\", {\n /**\n * Gets the set of web part definitions contained by this web part manager\n *\n */\n get: function () {\n return new WebPartDefinitions(this, \"webparts\");\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Exports a webpart definition\n *\n * @param id the GUID id of the definition to export\n */\n LimitedWebPartManager.prototype.export = function (id) {\n return this.clone(LimitedWebPartManager, \"ExportWebPart\", true).post({\n body: JSON.stringify({ webPartId: id }),\n });\n };\n /**\n * Imports a webpart\n *\n * @param xml webpart definition which must be valid XML in the .dwp or .webpart format\n */\n LimitedWebPartManager.prototype.import = function (xml) {\n return this.clone(LimitedWebPartManager, \"ImportWebPart\", true).post({\n body: JSON.stringify({ webPartXml: xml }),\n });\n };\n return LimitedWebPartManager;\n}(queryable_1.Queryable));\nexports.LimitedWebPartManager = LimitedWebPartManager;\nvar WebPartDefinitions = (function (_super) {\n __extends(WebPartDefinitions, _super);\n function WebPartDefinitions() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Gets a web part definition from the collection by id\n *\n * @param id GUID id of the web part definition to get\n */\n WebPartDefinitions.prototype.getById = function (id) {\n return new WebPartDefinition(this, \"getbyid('\" + id + \"')\");\n };\n return WebPartDefinitions;\n}(queryable_1.QueryableCollection));\nexports.WebPartDefinitions = WebPartDefinitions;\nvar WebPartDefinition = (function (_super) {\n __extends(WebPartDefinition, _super);\n function WebPartDefinition() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(WebPartDefinition.prototype, \"webpart\", {\n /**\n * Gets the webpart information associated with this definition\n */\n get: function () {\n return new WebPart(this);\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Removes a webpart from a page, all settings will be lost\n */\n WebPartDefinition.prototype.delete = function () {\n return this.clone(WebPartDefinition, \"DeleteWebPart\", true).post();\n };\n return WebPartDefinition;\n}(queryable_1.QueryableInstance));\nexports.WebPartDefinition = WebPartDefinition;\nvar WebPart = (function (_super) {\n __extends(WebPart, _super);\n /**\n * Creates a new instance of the WebPart class\n *\n * @param baseUrl The url or Queryable which forms the parent of this fields collection\n * @param path Optional, if supplied will be appended to the supplied baseUrl\n */\n function WebPart(baseUrl, path) {\n if (path === void 0) { path = \"webpart\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n return WebPart;\n}(queryable_1.QueryableInstance));\nexports.WebPart = WebPart;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/sharepoint/webparts.js\n// module id = 50\n// module chunks = 0","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Reads a blob as text\n *\n * @param blob The data to read\n */\nfunction readBlobAsText(blob) {\n return readBlobAs(blob, \"string\");\n}\nexports.readBlobAsText = readBlobAsText;\n/**\n * Reads a blob into an array buffer\n *\n * @param blob The data to read\n */\nfunction readBlobAsArrayBuffer(blob) {\n return readBlobAs(blob, \"buffer\");\n}\nexports.readBlobAsArrayBuffer = readBlobAsArrayBuffer;\n/**\n * Generic method to read blob's content\n *\n * @param blob The data to read\n * @param mode The read mode\n */\nfunction readBlobAs(blob, mode) {\n return new Promise(function (resolve, reject) {\n try {\n var reader = new FileReader();\n reader.onload = function (e) {\n resolve(e.target.result);\n };\n switch (mode) {\n case \"string\":\n reader.readAsText(blob);\n break;\n case \"buffer\":\n reader.readAsArrayBuffer(blob);\n break;\n }\n }\n catch (e) {\n reject(e);\n }\n });\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/utils/files.js\n// module id = 51\n// module chunks = 0"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/pnp.min.js b/dist/pnp.min.js new file mode 100644 index 00000000..14b641f3 --- /dev/null +++ b/dist/pnp.min.js @@ -0,0 +1,2 @@ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.$pnp=t():e.$pnp=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/assets/",t(t.s=41)}([function(e,t,n){"use strict";(function(e){var r=this&&this.__decorate||function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a};Object.defineProperty(t,"__esModule",{value:!0});var o=n(31),i=n(4),a=function(){function t(){}return t.getCtxCallback=function(e,t){for(var n=[],r=2;r0?e.substring(0,t)+n+e.substring(t,e.length):n+e},t.dateAdd=function(e,t,n){var r=new Date(e.toLocaleString());switch(t.toLowerCase()){case"year":r.setFullYear(r.getFullYear()+n);break;case"quarter":r.setMonth(r.getMonth()+3*n);break;case"month":r.setMonth(r.getMonth()+n);break;case"week":r.setDate(r.getDate()+7*n);break;case"day":r.setDate(r.getDate()+n);break;case"hour":r.setTime(r.getTime()+36e5*n);break;case"minute":r.setTime(r.getTime()+6e4*n);break;case"second":r.setTime(r.getTime()+1e3*n);break;default:r=void 0}return r},t.loadStylesheet=function(e,t){t&&(e+="?"+encodeURIComponent((new Date).getTime().toString()));var n=document.getElementsByTagName("head");if(n.length>0){var r=document.createElement("link");n[0].appendChild(r),r.setAttribute("type","text/css"),r.setAttribute("rel","stylesheet"),r.setAttribute("href",e)}},t.combinePaths=function(){for(var e=[],t=0;t0)return r(t.combinePaths(e.location.toString().substr(0,o),n))}return r(n)})},t}();r([o.deprecated("The Util.makeUrlAbsolute method is deprecated and will be removed from future releases. Use Util.toAbsoluteUrl instead")],a,"makeUrlAbsolute",null),t.Util=a}).call(t,n(32))},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(0),i=n(6),a=n(2),s=n(4),u=n(3),c=n(45),l=n(5),p=function(){function e(e,t){if(this._query=new i.Dictionary,this._batch=null,"string"==typeof e){var n=e;if(o.Util.isUrlAbsolute(n)||n.lastIndexOf("/")<0)this._parentUrl=n,this._url=o.Util.combinePaths(n,t);else if(n.lastIndexOf("/")>n.lastIndexOf("(")){var r=n.lastIndexOf("/");this._parentUrl=n.slice(0,r),t=o.Util.combinePaths(n.slice(r),t),this._url=o.Util.combinePaths(this._parentUrl,t)}else{var r=n.lastIndexOf("(");this._parentUrl=n.slice(0,r),this._url=o.Util.combinePaths(n,t)}}else{var a=e;this._parentUrl=a._url;var s=a._query.get("@target");null!==s&&this._query.add("@target",s),this._url=o.Util.combinePaths(this._parentUrl,t)}}return e.prototype.concat=function(e){this._url+=e},e.prototype.append=function(e){this._url=o.Util.combinePaths(this._url,e)},e.prototype.addBatchDependency=function(){return this.hasBatch?this._batch.addDependency():function(){return null}},Object.defineProperty(e.prototype,"hasBatch",{get:function(){return null!==this._batch},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"batch",{get:function(){return this.hasBatch?this._batch:null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parentUrl",{get:function(){return this._parentUrl},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"query",{get:function(){return this._query},enumerable:!0,configurable:!0}),e.prototype.as=function(e){var t=new e(this._url,null);return o.Util.extend(t,this,!0)},e.prototype.inBatch=function(e){if(null!==this._batch)throw new u.AlreadyInBatchException;return this._batch=e,this},e.prototype.usingCaching=function(e){return s.RuntimeConfig.globalCacheDisable||(this._useCaching=!0,this._cachingOptions=e),this},e.prototype.toUrl=function(){return this._url},e.prototype.toUrlAndQuery=function(){var e=new i.Dictionary,t=this.toUrl().replace(/'!(@.*?)::(.*?)'/gi,function(t,n,r){return l.Logger.write("Rewriting aliased parameter from match "+t+" to label: "+n+" value: "+r,l.LogLevel.Verbose),e.add(n,"'"+r+"'"),n});return e.merge(this._query),e.count()>0&&(t+="?"+e.getKeys().map(function(t){return t+"="+e.get(t)}).join("&")),t},e.prototype.getParent=function(e,t,n,r){void 0===t&&(t=this.parentUrl);var o=new e(t,n),i=this.query.get("@target");return null!==i&&o.query.add("@target",i),void 0!==r&&(o=o.inBatch(r)),o},e.prototype.clone=function(e,t,n){void 0===n&&(n=!1);var r=new e(this,t),o=this.query.get("@target");return null!==o&&r.query.add("@target",o),n&&this.hasBatch&&(r=r.inBatch(this.batch)),r},e.prototype.get=function(e,t){return void 0===e&&(e=new a.ODataDefaultParser),void 0===t&&(t={}),this.toRequestContext("GET",t,e).then(function(e){return c.pipe(e)})},e.prototype.getAs=function(e,t){return void 0===e&&(e=new a.ODataDefaultParser),void 0===t&&(t={}),this.toRequestContext("GET",t,e).then(function(e){return c.pipe(e)})},e.prototype.post=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new a.ODataDefaultParser),this.toRequestContext("POST",e,t).then(function(e){return c.pipe(e)})},e.prototype.postAs=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new a.ODataDefaultParser),this.toRequestContext("POST",e,t).then(function(e){return c.pipe(e)})},e.prototype.patch=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new a.ODataDefaultParser),this.toRequestContext("PATCH",e,t).then(function(e){return c.pipe(e)})},e.prototype.delete=function(e,t){return void 0===e&&(e={}),void 0===t&&(t=new a.ODataDefaultParser),this.toRequestContext("DELETE",e,t).then(function(e){return c.pipe(e)})},e.prototype.toRequestContext=function(e,t,n){var r=this;void 0===t&&(t={});var i=this.hasBatch?this.addBatchDependency():function(){};return o.Util.toAbsoluteUrl(this.toUrlAndQuery()).then(function(a){return{batch:r._batch,batchDependency:i,cachingOptions:r._cachingOptions,isBatched:r.hasBatch,isCached:r._useCaching,options:t,parser:n,requestAbsoluteUrl:a,requestId:o.Util.getGUID(),verb:e}})},e}();t.Queryable=p;var f=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.filter=function(e){return this._query.add("$filter",e),this},t.prototype.select=function(){for(var e=[],t=0;t0&&this._query.add("$select",e.join(",")),this},t.prototype.expand=function(){for(var e=[],t=0;t0&&this._query.add("$expand",e.join(",")),this},t.prototype.orderBy=function(e,t){void 0===t&&(t=!0);for(var n=this._query.getKeys(),r=[],o=t?" asc":" desc",i=0;i0&&this._query.add("$select",e.join(",")),this},t.prototype.expand=function(){for(var e=[],t=0;t0&&this._query.add("$expand",e.join(",")),this},t}(p);t.QueryableInstance=d},function(e,t,n){"use strict";function r(e){if(e.hasOwnProperty("odata.id"))return e["odata.id"];if(e.hasOwnProperty("__metadata")&&e.__metadata.hasOwnProperty("id"))return e.__metadata.id;throw new d.ODataIdException(e)}function o(e){return e.hasOwnProperty("odata.editLink")?c.Util.combinePaths("_api",e["odata.editLink"]):e.hasOwnProperty("__metadata")?e.__metadata.uri:(l.Logger.write("No uri information found in ODataEntity parsing, chaining will fail for this object.",l.LogLevel.Warning),"")}function i(){return new v}function a(e){return new m(e)}function s(e){return new P(e)}var u=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var c=n(0),l=n(5),p=n(15),f=n(4),d=n(3),h=n(3);t.extractOdataId=r;var y=function(){function e(){}return e.prototype.parse=function(e){var t=this;return new Promise(function(n,r){t.handleError(e,r)&&(e.headers.has("Content-Length")&&0===parseFloat(e.headers.get("Content-Length"))||204===e.status?n({}):e.json().then(function(e){return n(t.parseODataJSON(e))}).catch(function(e){return r(e)}))})},e.prototype.handleError=function(e,t){return e.ok||e.json().then(function(n){var r={responseBody:n,responseHeaders:e.headers};t(new h.ProcessHttpClientResponseException(e.status,e.statusText,r))}).catch(function(n){l.Logger.log({data:n,level:l.LogLevel.Warning,message:"There was an error parsing the error response body. See data for details."});var r={responseBody:"[[body not available]]",responseHeaders:e.headers};t(new h.ProcessHttpClientResponseException(e.status,e.statusText,r))}),e.ok},e.prototype.parseODataJSON=function(e){var t=e;return e.hasOwnProperty("d")?t=e.d.hasOwnProperty("results")?e.d.results:e.d:e.hasOwnProperty("value")&&(t=e.value),t},e}();t.ODataParserBase=y;var g=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return u(t,e),t}(y);t.ODataDefaultParser=g;var b=function(){function e(){}return e.prototype.parse=function(e){return e.json()},e}();t.ODataRawParserImpl=b;var v=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return u(t,e),t.prototype.parse=function(t){return e.prototype.parse.call(this,t).then(function(e){return e})},t}(y),m=function(e){function t(t){var n=e.call(this)||this;return n.factory=t,n}return u(t,e),t.prototype.parse=function(t){var n=this;return e.prototype.parse.call(this,t).then(function(e){var t=new n.factory(o(e),null);return c.Util.extend(t,e)})},t}(y),P=function(e){function t(t){var n=e.call(this)||this;return n.factory=t,n}return u(t,e),t.prototype.parse=function(t){var n=this;return e.prototype.parse.call(this,t).then(function(e){return e.map(function(e){var t=new n.factory(o(e),null);return c.Util.extend(t,e)})})},t}(y);t.getEntityUrl=o,t.ODataRaw=new b,t.ODataValue=i,t.ODataEntity=a,t.ODataEntityArray=s;var w=function(){function e(e,t){void 0===t&&(t=c.Util.getGUID()),this.baseUrl=e,this._batchId=t,this._requests=[],this._dependencies=[]}return e.prototype.add=function(e,t,n,r){var o={method:t.toUpperCase(),options:n,parser:r,reject:null,resolve:null,url:e},i=new Promise(function(e,t){o.resolve=e,o.reject=t});return this._requests.push(o),i},e.prototype.addDependency=function(){var e,t=new Promise(function(t){e=t});return this._dependencies.push(t),e},e.prototype.execute=function(){var e=this;return Promise.all(this._dependencies).then(function(){return Promise.all(e._dependencies)}).then(function(){return e.executeImpl()})},e.prototype.executeImpl=function(){var e=this;if(l.Logger.write("Executing batch with "+this._requests.length+" requests.",l.LogLevel.Info),this._requests.length<1)return l.Logger.write("Resolving empty batch.",l.LogLevel.Info),Promise.resolve();var t=new p.HttpClient;return c.Util.toAbsoluteUrl(this.baseUrl).then(function(n){var r=[],o="";e._requests.map(function(t){"GET"===t.method?(o.length>0&&(r.push("--changeset_"+o+"--\n\n"),o=""),r.push("--batch_"+e._batchId+"\n")):(o.length<1&&(o=c.Util.getGUID(),r.push("--batch_"+e._batchId+"\n"),r.push('Content-Type: multipart/mixed; boundary="changeset_'+o+'"\n\n')),r.push("--changeset_"+o+"\n")),r.push("Content-Type: application/http\n"),r.push("Content-Transfer-Encoding: binary\n\n");var i={Accept:"application/json;"},a=c.Util.isUrlAbsolute(t.url)?t.url:c.Util.combinePaths(n,t.url);if(l.Logger.write("Adding request "+t.method+" "+a+" to batch.",l.LogLevel.Verbose),"GET"!==t.method){var s=t.method;t.hasOwnProperty("options")&&t.options.hasOwnProperty("headers")&&void 0!==t.options.headers["X-HTTP-Method"]&&(s=t.options.headers["X-HTTP-Method"],delete t.options.headers["X-HTTP-Method"]),r.push(s+" "+a+" HTTP/1.1\n"),i=c.Util.extend(i,{"Content-Type":"application/json;odata=verbose;charset=utf-8"})}else r.push(t.method+" "+a+" HTTP/1.1\n");void 0!==f.RuntimeConfig.headers&&(i=c.Util.extend(i,f.RuntimeConfig.headers)),t.options&&t.options.headers&&(i=c.Util.extend(i,t.options.headers));for(var u in i)i.hasOwnProperty(u)&&r.push(u+": "+i[u]+"\n");r.push("\n"),t.options.body&&r.push(t.options.body+"\n\n")}),o.length>0&&(r.push("--changeset_"+o+"--\n\n"),o=""),r.push("--batch_"+e._batchId+"--\n");var i={"Content-Type":"multipart/mixed; boundary=batch_"+e._batchId},a={body:r.join(""),headers:i};return l.Logger.write("Sending batch request.",l.LogLevel.Info),t.post(c.Util.combinePaths(n,"/_api/$batch"),a).then(function(e){return e.text()}).then(e._parseResponse).then(function(t){if(t.length!==e._requests.length)throw new d.BatchParseException("Could not properly parse responses to match requests in batch.");return l.Logger.write("Resolving batched requests.",l.LogLevel.Info),t.reduce(function(t,n,r){var o=e._requests[r];return l.Logger.write("Resolving request "+o.method+" "+o.url+".",l.LogLevel.Verbose),t.then(function(e){return o.parser.parse(n).then(o.resolve).catch(o.reject)})},Promise.resolve())})})},e.prototype._parseResponse=function(e){return new Promise(function(t,n){for(var r,o,i=[],a=new RegExp("^HTTP/[0-9.]+ +([0-9]+) +(.*)","i"),s=e.split("\n"),u="batch",c=0;c-1?this.values[n]=t:(this.keys.push(e),this.values.push(t))},e.prototype.merge=function(e){var t=this;if("getKeys"in e){var n=e;n.getKeys().map(function(e){t.add(e,n.get(e))})}else{var r=e;for(var o in r)r.hasOwnProperty(o)&&this.add(o,r[o])}},e.prototype.remove=function(e){var t=this.keys.indexOf(e);if(t<0)return null;var n=this.values[t];return this.keys.splice(t,1),this.values.splice(t,1),n},e.prototype.getKeys=function(){return this.keys},e.prototype.getValues=function(){return this.values},e.prototype.clear=function(){this.keys=[],this.values=[]},e.prototype.count=function(){return this.keys.length},e}();t.Dictionary=r},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),o=this&&this.__decorate||function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a};Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),a=n(11),s=n(24),u=n(25),c=n(18),l=n(16),p=n(9),f=n(17),d=n(8),h=n(0),y=n(11),g=n(30),b=n(19),v=n(2),m=n(23),P=n(31),w=n(12),_=n(46),O=function(e){function t(t,n){return void 0===n&&(n="webs"),e.call(this,t,n)||this}return r(t,e),t.prototype.add=function(e,n,r,o,i,a,s){void 0===r&&(r=""),void 0===o&&(o="STS"),void 0===i&&(i=1033),void 0===a&&(a=!0),void 0===s&&(s={});var u=h.Util.extend({Description:r,Language:i,Title:e,Url:n,UseSamePermissionsAsParentSite:a,WebTemplate:o},s),c=JSON.stringify({parameters:h.Util.extend({__metadata:{type:"SP.WebCreationInformation"}},u)});return this.clone(t,"add",!0).post({body:c}).then(function(e){return{data:e,web:new S(v.extractOdataId(e).replace(/_api\/web\/?/i,""))}})},t}(i.QueryableCollection);t.Webs=O;var S=function(e){function t(t,n){return void 0===n&&(n="_api/web"),e.call(this,t,n)||this}return r(t,e),t.fromUrl=function(e,n){if(null===e)return new t("");var r=e.indexOf("_api/");return r>-1?new t(e.substr(0,r),n):new t(e,n)},Object.defineProperty(t.prototype,"webs",{get:function(){return new O(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"contentTypes",{get:function(){return new l.ContentTypes(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"lists",{get:function(){return new a.Lists(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"fields",{get:function(){return new s.Fields(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"features",{get:function(){return new m.Features(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"availablefields",{get:function(){return new s.Fields(this,"availablefields")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"navigation",{get:function(){return new u.Navigation(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"siteUsers",{get:function(){return new g.SiteUsers(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"siteGroups",{get:function(){return new c.SiteGroups(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"currentUser",{get:function(){return new g.CurrentUser(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"folders",{get:function(){return new p.Folders(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"userCustomActions",{get:function(){return new b.UserCustomActions(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"roleDefinitions",{get:function(){return new f.RoleDefinitions(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"relatedItems",{get:function(){return _.RelatedItemManagerImpl.FromUrl(this.toUrl())},enumerable:!0,configurable:!0}),t.prototype.createBatch=function(){return new v.ODataBatch(this.parentUrl)},Object.defineProperty(t.prototype,"rootFolder",{get:function(){return new p.Folder(this,"rootFolder")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"associatedOwnerGroup",{get:function(){return new c.SiteGroup(this,"associatedownergroup")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"associatedMemberGroup",{get:function(){return new c.SiteGroup(this,"associatedmembergroup")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"associatedVisitorGroup",{get:function(){return new c.SiteGroup(this,"associatedvisitorgroup")},enumerable:!0,configurable:!0}),t.prototype.getFolderByServerRelativeUrl=function(e){return new p.Folder(this,"getFolderByServerRelativeUrl('"+e+"')")},t.prototype.getFileByServerRelativeUrl=function(e){return new d.File(this,"getFileByServerRelativeUrl('"+e+"')")},t.prototype.getList=function(e){return new y.List(this,"getList('"+e+"')")},t.prototype.update=function(e){var t=this,n=JSON.stringify(h.Util.extend({__metadata:{type:"SP.Web"}},e));return this.post({body:n,headers:{"X-HTTP-Method":"MERGE"}}).then(function(e){return{data:e,web:t}})},t.prototype.delete=function(){return e.prototype.delete.call(this)},t.prototype.applyTheme=function(e,n,r,o){var i=JSON.stringify({backgroundImageUrl:r,colorPaletteUrl:e,fontSchemeUrl:n,shareGenerated:o});return this.clone(t,"applytheme",!0).post({body:i})},t.prototype.applyWebTemplate=function(e){var n=this.clone(t,"applywebtemplate",!0);return n.concat("(@t)"),n.query.add("@t",e),n.post()},t.prototype.doesUserHavePermissions=function(e){var n=this.clone(t,"doesuserhavepermissions",!0);return n.concat("(@p)"),n.query.add("@p",JSON.stringify(e)),n.get()},t.prototype.ensureUser=function(e){var n=JSON.stringify({logonName:e});return this.clone(t,"ensureuser",!0).post({body:n}).then(function(e){return{data:e,user:new g.SiteUser(v.extractOdataId(e))}})},t.prototype.availableWebTemplates=function(e,t){return void 0===e&&(e=1033),void 0===t&&(t=!0),new i.QueryableCollection(this,"getavailablewebtemplates(lcid="+e+", doincludecrosslanguage="+t+")")},t.prototype.getCatalog=function(e){return this.clone(t,"getcatalog("+e+")",!0).select("Id").get().then(function(e){return new y.List(v.extractOdataId(e))})},t.prototype.getChanges=function(e){var n=JSON.stringify({query:h.Util.extend({__metadata:{type:"SP.ChangeQuery"}},e)});return this.clone(t,"getchanges",!0).post({body:n})},Object.defineProperty(t.prototype,"customListTemplate",{get:function(){return new i.QueryableCollection(this,"getcustomlisttemplates")},enumerable:!0,configurable:!0}),t.prototype.getUserById=function(e){return new g.SiteUser(this,"getUserById("+e+")")},t.prototype.mapToIcon=function(e,n,r){return void 0===n&&(n=0),void 0===r&&(r=""),this.clone(t,"maptoicon(filename='"+e+"', progid='"+r+"', size="+n+")",!0).get()},t}(w.QueryableShareableWeb);o([P.deprecated("This method will be removed in future releases. Please use the methods found in queryable securable.")],S.prototype,"doesUserHavePermissions",null),t.Web=S},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(2),a=n(0),s=n(3),u=n(50),c=n(10),l=n(12),p=n(2),f=function(e){function t(t,n){return void 0===n&&(n="files"),e.call(this,t,n)||this}return r(t,e),t.prototype.getByName=function(e){var t=new d(this);return t.concat("('"+e+"')"),t},t.prototype.add=function(e,n,r){var o=this;return void 0===r&&(r=!0),new t(this,"add(overwrite="+r+",url='"+e+"')").post({body:n}).then(function(t){return{data:t,file:o.getByName(e)}})},t.prototype.addChunked=function(e,n,r,o,i){var a=this;return void 0===o&&(o=!0),void 0===i&&(i=10485760),this.clone(t,"add(overwrite="+o+",url='"+e+"')").post().then(function(){return a.getByName(e)}).then(function(e){return e.setContentChunked(n,r,i)}).then(function(t){return{data:t,file:a.getByName(e)}})},t.prototype.addTemplateFile=function(e,n){var r=this;return this.clone(t,"addTemplateFile(urloffile='"+e+"',templatefiletype="+n+")").post().then(function(t){return{data:t,file:r.getByName(e)}})},t}(o.QueryableCollection);t.Files=f;var d=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),Object.defineProperty(t.prototype,"listItemAllFields",{get:function(){return new o.QueryableCollection(this,"listItemAllFields")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"versions",{get:function(){return new h(this)},enumerable:!0,configurable:!0}),t.prototype.approve=function(e){return this.clone(t,"approve(comment='"+e+"')",!0).post()},t.prototype.cancelUpload=function(e){return this.clone(t,"cancelUpload(uploadId=guid'"+e+"')",!1).post()},t.prototype.checkin=function(e,n){if(void 0===e&&(e=""),void 0===n&&(n=g.Major),e.length>1023)throw new s.MaxCommentLengthException;return this.clone(t,"checkin(comment='"+e+"',checkintype="+n+")",!0).post()},t.prototype.checkout=function(){return this.clone(t,"checkout",!0).post()},t.prototype.copyTo=function(e,n){return void 0===n&&(n=!0),this.clone(t,"copyTo(strnewurl='"+e+"',boverwrite="+n+")",!0).post()},t.prototype.delete=function(e){return void 0===e&&(e="*"),this.clone(t,null,!0).post({headers:{"IF-Match":e,"X-HTTP-Method":"DELETE"}})},t.prototype.deny=function(e){if(void 0===e&&(e=""),e.length>1023)throw new s.MaxCommentLengthException;return this.clone(t,"deny(comment='"+e+"')",!0).post()},t.prototype.getLimitedWebPartManager=function(e){return void 0===e&&(e=b.Shared),new u.LimitedWebPartManager(this,"getLimitedWebPartManager(scope="+e+")")},t.prototype.moveTo=function(e,n){return void 0===n&&(n=v.Overwrite),this.clone(t,"moveTo(newurl='"+e+"',flags="+n+")",!0).post()},t.prototype.publish=function(e){if(void 0===e&&(e=""),e.length>1023)throw new s.MaxCommentLengthException;return this.clone(t,"publish(comment='"+e+"')",!0).post()},t.prototype.recycle=function(){return this.clone(t,"recycle",!0).post()},t.prototype.undoCheckout=function(){return this.clone(t,"undoCheckout",!0).post()},t.prototype.unpublish=function(e){if(void 0===e&&(e=""),e.length>1023)throw new s.MaxCommentLengthException;return this.clone(t,"unpublish(comment='"+e+"')",!0).post()},t.prototype.getText=function(){return this.clone(t,"$value").get(new i.TextFileParser,{headers:{binaryStringResponseBody:"true"}})},t.prototype.getBlob=function(){return this.clone(t,"$value").get(new i.BlobFileParser,{headers:{binaryStringResponseBody:"true"}})},t.prototype.getBuffer=function(){return this.clone(t,"$value").get(new i.BufferFileParser,{headers:{binaryStringResponseBody:"true"}})},t.prototype.getJSON=function(){return this.clone(t,"$value").get(new i.JSONFileParser,{headers:{binaryStringResponseBody:"true"}})},t.prototype.setContent=function(e){var n=this;return this.clone(t,"$value").post({body:e,headers:{"X-HTTP-Method":"PUT"}}).then(function(e){return new t(n)})},t.prototype.getItem=function(){for(var e=[],t=0;t0},enumerable:!0,configurable:!0}),e.prototype.getNext=function(){if(this.hasNext){return new d(this.nextUrl,null).getPaged()}return new Promise(function(e){return e(null)})},e}();t.PagedItemCollection=y;var g=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.parse=function(e){var t=this;return new Promise(function(n,r){t.handleError(e,r)&&e.json().then(function(e){var r=e.hasOwnProperty("d")&&e.d.hasOwnProperty("__next")?e.d.__next:e["odata.nextLink"];n(new y(r,t.parseODataJSON(e)))})})},t}(l.ODataParserBase),b=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.parse=function(e){var t=this;return new Promise(function(n,r){t.handleError(e,r)&&n({"odata.etag":e.headers.get("etag")})})},t}(l.ODataParserBase)},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(10),i=n(49),a=n(16),s=n(24),u=n(43),c=n(47),l=n(1),p=n(26),f=n(0),d=n(19),h=n(2),y=n(3),g=n(9),b=function(e){function t(t,n){return void 0===n&&(n="lists"),e.call(this,t,n)||this}return r(t,e),t.prototype.getByTitle=function(e){return new v(this,"getByTitle('"+e+"')")},t.prototype.getById=function(e){var t=new v(this);return t.concat("('"+e+"')"),t},t.prototype.add=function(e,t,n,r,o){var i=this;void 0===t&&(t=""),void 0===n&&(n=100),void 0===r&&(r=!1),void 0===o&&(o={});var a=f.Util.extend({AllowContentTypes:r,BaseTemplate:n,ContentTypesEnabled:r,Description:t,Title:e,__metadata:{type:"SP.List"}},o);return this.post({body:JSON.stringify(a)}).then(function(e){return{data:e,list:i.getByTitle(a.Title)}})},t.prototype.ensure=function(e,t,n,r,o){var i=this;if(void 0===t&&(t=""),void 0===n&&(n=100),void 0===r&&(r=!1),void 0===o&&(o={}),this.hasBatch)throw new y.NotSupportedInBatchException("The ensure list method");return new Promise(function(a,s){var u=f.Util.extend(o,{Title:e,Description:t,ContentTypesEnabled:r},!0),c=i.getByTitle(u.Title);c.get().then(function(e){c.update(u).then(function(e){a({created:!1,data:e,list:i.getByTitle(u.Title)})}).catch(function(e){return s(e)})}).catch(function(o){i.add(e,t,n,r,u).then(function(e){a({created:!0,data:e.data,list:i.getByTitle(u.Title)})}).catch(function(e){return s(e)})})})},t.prototype.ensureSiteAssetsLibrary=function(){return this.clone(t,"ensuresiteassetslibrary",!0).post().then(function(e){return new v(h.extractOdataId(e))})},t.prototype.ensureSitePagesLibrary=function(){return this.clone(t,"ensuresitepageslibrary",!0).post().then(function(e){return new v(h.extractOdataId(e))})},t}(l.QueryableCollection);t.Lists=b;var v=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),Object.defineProperty(t.prototype,"contentTypes",{get:function(){return new a.ContentTypes(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"items",{get:function(){return new o.Items(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"views",{get:function(){return new i.Views(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"fields",{get:function(){return new s.Fields(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"forms",{get:function(){return new u.Forms(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"defaultView",{get:function(){return new l.QueryableInstance(this,"DefaultView")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"userCustomActions",{get:function(){return new d.UserCustomActions(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"effectiveBasePermissions",{get:function(){return new l.Queryable(this,"EffectiveBasePermissions")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"eventReceivers",{get:function(){return new l.QueryableCollection(this,"EventReceivers")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"relatedFields",{get:function(){return new l.Queryable(this,"getRelatedFields")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"informationRightsManagementSettings",{get:function(){return new l.Queryable(this,"InformationRightsManagementSettings")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"subscriptions",{get:function(){return new c.Subscriptions(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rootFolder",{get:function(){return new g.Folder(this,"rootFolder")},enumerable:!0,configurable:!0}),t.prototype.getView=function(e){return new i.View(this,"getView('"+e+"')")},t.prototype.update=function(e,n){var r=this;void 0===n&&(n="*");var o=JSON.stringify(f.Util.extend({__metadata:{type:"SP.List"}},e));return this.post({body:o,headers:{"IF-Match":n,"X-HTTP-Method":"MERGE"}}).then(function(n){var o=r;return e.hasOwnProperty("Title")&&(o=r.getParent(t,r.parentUrl,"getByTitle('"+e.Title+"')")),{data:n,list:o}})},t.prototype.delete=function(e){return void 0===e&&(e="*"),this.post({headers:{"IF-Match":e,"X-HTTP-Method":"DELETE"}})},t.prototype.getChanges=function(e){return this.clone(t,"getchanges",!0).post({body:JSON.stringify({query:f.Util.extend({__metadata:{type:"SP.ChangeQuery"}},e)})})},t.prototype.getItemsByCAMLQuery=function(e){for(var n=[],r=1;r0&&(n=60*this.defaultTimeoutMinutes),t=r.Util.dateAdd(new Date,"second",n)}return JSON.stringify({expiration:t,value:e})},e}();t.PnPClientStorageWrapper=a;var s=function(){function e(e){void 0===e&&(e=new o.Dictionary),this._store=e}return Object.defineProperty(e.prototype,"length",{get:function(){return this._store.count()},enumerable:!0,configurable:!0}),e.prototype.clear=function(){this._store.clear()},e.prototype.getItem=function(e){return this._store.get(e)},e.prototype.key=function(e){return this._store.getKeys()[e]},e.prototype.removeItem=function(e){this._store.remove(e)},e.prototype.setItem=function(e,t){this._store.add(e,t)},e}(),u=function(){function e(){this.local=new a("undefined"!=typeof localStorage?localStorage:new s),this.session=new a("undefined"!=typeof sessionStorage?sessionStorage:new s)}return e}();t.PnPClientStorage=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(38),o=n(0),i=n(4),a=n(3),s=function(){function e(){this._impl=i.RuntimeConfig.fetchClientFactory(),this._digestCache=new r.DigestCache(this)}return e.prototype.fetch=function(e,t){var n=this;void 0===t&&(t={});var r=o.Util.extend(t,{cache:"no-cache",credentials:"same-origin"},!0),s=new Headers;if(this.mergeHeaders(s,i.RuntimeConfig.headers),this.mergeHeaders(s,t.headers),s.has("Accept")||s.append("Accept","application/json"),s.has("Content-Type")||s.append("Content-Type","application/json;odata=verbose;charset=utf-8"),s.has("X-ClientService-ClientTag")||s.append("X-ClientService-ClientTag","PnPCoreJS:2.0.3"),r=o.Util.extend(r,{headers:s}),r.method&&"GET"!==r.method.toUpperCase()&&!s.has("X-RequestDigest")){var u=e.indexOf("_api/");if(u<0)throw new a.APIUrlException;var c=e.substr(0,u);return this._digestCache.getDigest(c).then(function(t){return s.append("X-RequestDigest",t),n.fetchRaw(e,r)})}return this.fetchRaw(e,r)},e.prototype.fetchRaw=function(e,t){var n=this;void 0===t&&(t={});var r=new Headers;this.mergeHeaders(r,t.headers),t=o.Util.extend(t,{headers:r});var i=function(r){n._impl.fetch(e,t).then(function(e){return r.resolve(e)}).catch(function(e){var t=r.delay;429!==e.status&&503!==e.status&&r.reject(e),r.delay*=2,r.attempts++,r.retryCount<=r.attempts&&r.reject(e),setTimeout(o.Util.getCtxCallback(n,i,r),t)})};return new Promise(function(e,t){var r={attempts:0,delay:100,reject:t,resolve:e,retryCount:7};i.call(n,r)})},e.prototype.get=function(e,t){void 0===t&&(t={});var n=o.Util.extend(t,{method:"GET"});return this.fetch(e,n)},e.prototype.post=function(e,t){void 0===t&&(t={});var n=o.Util.extend(t,{method:"POST"});return this.fetch(e,n)},e.prototype.patch=function(e,t){void 0===t&&(t={});var n=o.Util.extend(t,{method:"PATCH"});return this.fetch(e,n)},e.prototype.delete=function(e,t){void 0===t&&(t={});var n=o.Util.extend(t,{method:"DELETE"});return this.fetch(e,n)},e.prototype.mergeHeaders=function(e,t){if(void 0!==t&&null!==t){new Request("",{headers:t}).headers.forEach(function(t,n){e.append(n,t)})}},e}();t.HttpClient=s},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(0),i=n(1),a=function(e){function t(t,n){return void 0===n&&(n="contenttypes"),e.call(this,t,n)||this}return r(t,e),t.prototype.getById=function(e){var t=new s(this);return t.concat("('"+e+"')"),t},t.prototype.addAvailableContentType=function(e){var n=this,r=JSON.stringify({contentTypeId:e});return this.clone(t,"addAvailableContentType",!0).postAs({body:r}).then(function(e){return{contentType:n.getById(e.id),data:e}})},t.prototype.add=function(e,t,n,r,i){var a=this;void 0===n&&(n=""),void 0===r&&(r="Custom Content Types"),void 0===i&&(i={});var s=JSON.stringify(o.Util.extend({Description:n,Group:r,Id:{StringValue:e},Name:t,__metadata:{type:"SP.ContentType"}},i));return this.post({body:s}).then(function(e){return{contentType:a.getById(e.id),data:e}})},t}(i.QueryableCollection);t.ContentTypes=a;var s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),Object.defineProperty(t.prototype,"fieldLinks",{get:function(){return new u(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"fields",{get:function(){return new i.QueryableCollection(this,"fields")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return new t(this,"parent")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"workflowAssociations",{get:function(){return new i.QueryableCollection(this,"workflowAssociations")},enumerable:!0,configurable:!0}),t.prototype.delete=function(){return this.post({headers:{"X-HTTP-Method":"DELETE"}})},t}(i.QueryableInstance);t.ContentType=s;var u=function(e){function t(t,n){return void 0===n&&(n="fieldlinks"),e.call(this,t,n)||this}return r(t,e),t.prototype.getById=function(e){var t=new c(this);return t.concat("(guid'"+e+"')"),t},t}(i.QueryableCollection);t.FieldLinks=u;var c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t}(i.QueryableInstance);t.FieldLink=c},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(18),a=n(0),s=function(e){function t(t,n){return void 0===n&&(n="roleassignments"),e.call(this,t,n)||this}return r(t,e),t.prototype.add=function(e,n){return this.clone(t,"addroleassignment(principalid="+e+", roledefid="+n+")",!0).post()},t.prototype.remove=function(e,n){return this.clone(t,"removeroleassignment(principalid="+e+", roledefid="+n+")",!0).post()},t.prototype.getById=function(e){var t=new u(this);return t.concat("("+e+")"),t},t}(o.QueryableCollection);t.RoleAssignments=s;var u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),Object.defineProperty(t.prototype,"groups",{get:function(){return new i.SiteGroups(this,"groups")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bindings",{get:function(){return new p(this)},enumerable:!0,configurable:!0}),t.prototype.delete=function(){return this.post({headers:{"X-HTTP-Method":"DELETE"}})},t}(o.QueryableInstance);t.RoleAssignment=u;var c=function(e){function t(t,n){return void 0===n&&(n="roledefinitions"),e.call(this,t,n)||this}return r(t,e),t.prototype.getById=function(e){return new l(this,"getById("+e+")")},t.prototype.getByName=function(e){return new l(this,"getbyname('"+e+"')")},t.prototype.getByType=function(e){return new l(this,"getbytype("+e+")")},t.prototype.add=function(e,t,n,r){var o=this,i=JSON.stringify({BasePermissions:a.Util.extend({__metadata:{type:"SP.BasePermissions"}},r),Description:t,Name:e,Order:n,__metadata:{type:"SP.RoleDefinition"}});return this.post({body:i}).then(function(e){return{data:e,definition:o.getById(e.Id)}})},t}(o.QueryableCollection);t.RoleDefinitions=c;var l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.update=function(e){var t=this;void 0!==e.hasOwnProperty("BasePermissions")&&(e.BasePermissions=a.Util.extend({__metadata:{type:"SP.BasePermissions"}},e.BasePermissions));var n=JSON.stringify(a.Util.extend({__metadata:{type:"SP.RoleDefinition"}},e));return this.post({body:n,headers:{"X-HTTP-Method":"MERGE"}}).then(function(n){var r=t;if(e.hasOwnProperty("Name")){r=t.getParent(c,t.parentUrl,"").getByName(e.Name)}return{data:n,definition:r}})},t.prototype.delete=function(){return this.post({headers:{"X-HTTP-Method":"DELETE"}})},t}(o.QueryableInstance);t.RoleDefinition=l;var p=function(e){function t(t,n){return void 0===n&&(n="roledefinitionbindings"),e.call(this,t,n)||this}return r(t,e),t}(o.QueryableCollection);t.RoleDefinitionBindings=p},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(30),a=n(0);!function(e){e[e.None=0]="None",e[e.User=1]="User",e[e.DistributionList=2]="DistributionList",e[e.SecurityGroup=4]="SecurityGroup",e[e.SharePointGroup=8]="SharePointGroup",e[e.All=15]="All"}(t.PrincipalType||(t.PrincipalType={}));var s=function(e){function t(t,n){return void 0===n&&(n="sitegroups"),e.call(this,t,n)||this}return r(t,e),t.prototype.add=function(e){var t=this,n=JSON.stringify(a.Util.extend({__metadata:{type:"SP.Group"}},e));return this.post({body:n}).then(function(e){return{data:e,group:t.getById(e.Id)}})},t.prototype.getByName=function(e){return new u(this,"getByName('"+e+"')")},t.prototype.getById=function(e){var t=new u(this);return t.concat("("+e+")"),t},t.prototype.removeById=function(e){return this.clone(t,"removeById('"+e+"')",!0).post()},t.prototype.removeByLoginName=function(e){return this.clone(t,"removeByLoginName('"+e+"')",!0).post()},t}(o.QueryableCollection);t.SiteGroups=s;var u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),Object.defineProperty(t.prototype,"users",{get:function(){return new i.SiteUsers(this,"users")},enumerable:!0,configurable:!0}),t.prototype.update=function(e){var n=this,r=a.Util.extend({__metadata:{type:"SP.Group"}},e);return this.post({body:JSON.stringify(r),headers:{"X-HTTP-Method":"MERGE"}}).then(function(r){var o=n;return e.hasOwnProperty("Title")&&(o=n.getParent(t,n.parentUrl,"getByName('"+e.Title+"')")),{data:r,group:o}})},t}(o.QueryableInstance);t.SiteGroup=u},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(0),a=function(e){function t(t,n){return void 0===n&&(n="usercustomactions"),e.call(this,t,n)||this}return r(t,e),t.prototype.getById=function(e){var t=new s(this);return t.concat("('"+e+"')"),t},t.prototype.add=function(e){var t=this,n=JSON.stringify(i.Util.extend({__metadata:{type:"SP.UserCustomAction"}},e));return this.post({body:n}).then(function(e){return{action:t.getById(e.Id),data:e}})},t.prototype.clear=function(){return this.clone(t,"clear",!0).post()},t}(o.QueryableCollection);t.UserCustomActions=a;var s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.update=function(e){var t=this,n=JSON.stringify(i.Util.extend({__metadata:{type:"SP.UserCustomAction"}},e));return this.post({body:n,headers:{"X-HTTP-Method":"MERGE"}}).then(function(e){return{action:t,data:e}})},t.prototype.delete=function(){return e.prototype.delete.call(this)},t}(o.QueryableInstance);t.UserCustomAction=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(14),o=n(3),i=function(){function e(e,t,n){this.wrappedProvider=e,this.store=n||this.selectPnPCache(),this.cacheKey="_configcache_"+t}return e.prototype.getWrappedProvider=function(){return this.wrappedProvider},e.prototype.getConfiguration=function(){var e=this;if(!this.store||!this.store.enabled)return this.wrappedProvider.getConfiguration();var t=this.store.get(this.cacheKey);if(t)return new Promise(function(e){e(t)});var n=this.wrappedProvider.getConfiguration();return n.then(function(t){e.store.put(e.cacheKey,t)}),n},e.prototype.selectPnPCache=function(){var e=new r.PnPClientStorage;if(e.local&&e.local.enabled)return e.local;if(e.session&&e.session.enabled)return e.session;throw new o.NoCacheAvailableException},e}();t.default=i},function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function t(){}return t.prototype.fetch=function(t,n){return e.fetch(t,n)},t}();t.FetchClient=n}).call(t,n(32))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(14),o=n(0),i=n(4),a=function(){function e(e){this.key=e,this.expiration=o.Util.dateAdd(new Date,"second",i.RuntimeConfig.defaultCachingTimeoutSeconds),this.storeName=i.RuntimeConfig.defaultCachingStore}return Object.defineProperty(e.prototype,"store",{get:function(){return"local"===this.storeName?e.storage.local:e.storage.session},enumerable:!0,configurable:!0}),e}();a.storage=new r.PnPClientStorage,t.CachingOptions=a;var s=function(){function e(e,t){this._parser=e,this._cacheOptions=t}return e.prototype.parse=function(e){var t=this;return this._parser.parse(e).then(function(e){return null!==t._cacheOptions.store&&t._cacheOptions.store.put(t._cacheOptions.key,e,t._cacheOptions.expiration),e})},e}();t.CachingParserWrapper=s},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=function(e){function t(t,n){return void 0===n&&(n="features"),e.call(this,t,n)||this}return r(t,e),t.prototype.getById=function(e){var t=new a(this);return t.concat("('"+e+"')"),t},t.prototype.add=function(e,n){var r=this;return void 0===n&&(n=!1),this.clone(t,"add",!0).post({body:JSON.stringify({featdefScope:0,featureId:e,force:n})}).then(function(t){return{data:t,feature:r.getById(e)}})},t.prototype.remove=function(e,n){return void 0===n&&(n=!1),this.clone(t,"remove",!0).post({body:JSON.stringify({featureId:e,force:n})})},t}(o.QueryableCollection);t.Features=i;var a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.deactivate=function(e){var n=this;void 0===e&&(e=!1);var r=this.addBatchDependency();return new t(this).select("DefinitionId").getAs().then(function(t){var o=n.getParent(i,n.parentUrl,"",n.batch).remove(t.DefinitionId,e);return r(),o})},t}(o.QueryableInstance);t.Feature=a},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(0),a=n(13),s=function(e){function t(t,n){return void 0===n&&(n="fields"),e.call(this,t,n)||this}return r(t,e),t.prototype.getByTitle=function(e){return new u(this,"getByTitle('"+e+"')")},t.prototype.getByInternalNameOrTitle=function(e){return new u(this,"getByInternalNameOrTitle('"+e+"')")},t.prototype.getById=function(e){var t=new u(this);return t.concat("('"+e+"')"),t},t.prototype.createFieldAsXml=function(e){var n,r=this;n="string"==typeof e?{SchemaXml:e}:e;var o=JSON.stringify({parameters:i.Util.extend({__metadata:{type:"SP.XmlSchemaFieldCreationInformation"}},n)});return this.clone(t,"createfieldasxml",!0).postAs({body:o}).then(function(e){return{data:e,field:r.getById(e.Id)}})},t.prototype.add=function(e,n,r){var o=this;void 0===r&&(r={});var a=JSON.stringify(i.Util.extend({Title:e,__metadata:{type:n}},r));return this.clone(t,null,!0).postAs({body:a}).then(function(e){return{data:e,field:o.getById(e.Id)}})},t.prototype.addText=function(e,t,n){void 0===t&&(t=255);var r={FieldTypeKind:2,MaxLength:t};return this.add(e,"SP.FieldText",i.Util.extend(r,n))},t.prototype.addCalculated=function(e,t,n,r,o){void 0===r&&(r=a.FieldTypes.Text);var s={DateFormat:n,FieldTypeKind:17,Formula:t,OutputType:r};return this.add(e,"SP.FieldCalculated",i.Util.extend(s,o))},t.prototype.addDateTime=function(e,t,n,r,o){void 0===t&&(t=a.DateTimeFieldFormatType.DateOnly),void 0===n&&(n=a.CalendarType.Gregorian),void 0===r&&(r=0);var s={DateTimeCalendarType:n,DisplayFormat:t,FieldTypeKind:4,FriendlyDisplayFormat:r};return this.add(e,"SP.FieldDateTime",i.Util.extend(s,o))},t.prototype.addNumber=function(e,t,n,r){var o={FieldTypeKind:9};return void 0!==t&&(o=i.Util.extend({MinimumValue:t},o)),void 0!==n&&(o=i.Util.extend({MaximumValue:n},o)),this.add(e,"SP.FieldNumber",i.Util.extend(o,r))},t.prototype.addCurrency=function(e,t,n,r,o){void 0===r&&(r=1033);var a={CurrencyLocaleId:r,FieldTypeKind:10};return void 0!==t&&(a=i.Util.extend({MinimumValue:t},a)),void 0!==n&&(a=i.Util.extend({MaximumValue:n},a)),this.add(e,"SP.FieldCurrency",i.Util.extend(a,o))},t.prototype.addMultilineText=function(e,t,n,r,o,a,s){void 0===t&&(t=6),void 0===n&&(n=!0),void 0===r&&(r=!1),void 0===o&&(o=!1),void 0===a&&(a=!0);var u={AllowHyperlink:a,AppendOnly:o,FieldTypeKind:3,NumberOfLines:t,RestrictedMode:r,RichText:n};return this.add(e,"SP.FieldMultiLineText",i.Util.extend(u,s))},t.prototype.addUrl=function(e,t,n){void 0===t&&(t=a.UrlFieldFormatType.Hyperlink);var r={DisplayFormat:t,FieldTypeKind:11};return this.add(e,"SP.FieldUrl",i.Util.extend(r,n))},t}(o.QueryableCollection);t.Fields=s;var u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.update=function(e,t){var n=this;void 0===t&&(t="SP.Field");var r=JSON.stringify(i.Util.extend({__metadata:{type:t}},e));return this.post({body:r,headers:{"X-HTTP-Method":"MERGE"}}).then(function(e){return{data:e,field:n}})},t.prototype.delete=function(){return this.post({headers:{"X-HTTP-Method":"DELETE"}})},t.prototype.setShowInDisplayForm=function(e){return this.clone(t,"setshowindisplayform("+e+")",!0).post()},t.prototype.setShowInEditForm=function(e){return this.clone(t,"setshowineditform("+e+")",!0).post()},t.prototype.setShowInNewForm=function(e){return this.clone(t,"setshowinnewform("+e+")",!0).post()},t}(o.QueryableInstance);t.Field=u},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(0),i=n(1),a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.getById=function(e){var t=new s(this);return t.concat("("+e+")"),t},t.prototype.add=function(e,n,r){var o=this;void 0===r&&(r=!0);var i=JSON.stringify({IsVisible:r,Title:e,Url:n,__metadata:{type:"SP.NavigationNode"}});return this.clone(t,null,!0).post({body:i}).then(function(e){return{data:e,node:o.getById(e.Id)}})},t.prototype.moveAfter=function(e,n){var r=JSON.stringify({nodeId:e,previousNodeId:n});return this.clone(t,"MoveAfter",!0).post({body:r})},t}(i.QueryableCollection);t.NavigationNodes=a;var s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),Object.defineProperty(t.prototype,"children",{get:function(){return new a(this,"Children")},enumerable:!0,configurable:!0}),t.prototype.update=function(e){var t=this,n=JSON.stringify(o.Util.extend({__metadata:{type:"SP.NavigationNode"}},e));return this.post({body:n,headers:{"X-HTTP-Method":"MERGE"}}).then(function(e){return{data:e,node:t}})},t.prototype.delete=function(){return e.prototype.delete.call(this)},t}(i.QueryableInstance);t.NavigationNode=s;var u=function(e){function t(t,n){return void 0===n&&(n="navigation"),e.call(this,t,n)||this}return r(t,e),Object.defineProperty(t.prototype,"quicklaunch",{get:function(){return new a(this,"quicklaunch")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"topNavigationBar",{get:function(){return new a(this,"topnavigationbar")},enumerable:!0,configurable:!0}),t}(i.Queryable);t.Navigation=u},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(7),i=n(17),a=n(13),s=n(1),u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),Object.defineProperty(t.prototype,"roleAssignments",{get:function(){return new i.RoleAssignments(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"firstUniqueAncestorSecurableObject",{get:function(){return new s.QueryableInstance(this,"FirstUniqueAncestorSecurableObject")},enumerable:!0,configurable:!0}),t.prototype.getUserEffectivePermissions=function(e){var t=this.clone(s.Queryable,"getUserEffectivePermissions(@user)",!0);return t.query.add("@user","'"+encodeURIComponent(e)+"'"),t.getAs()},t.prototype.getCurrentUserEffectivePermissions=function(){var e=this;return o.Web.fromUrl(this.toUrl()).currentUser.select("LoginName").getAs().then(function(t){return e.getUserEffectivePermissions(t.LoginName)})},t.prototype.breakRoleInheritance=function(e,n){return void 0===e&&(e=!1),void 0===n&&(n=!1),this.clone(t,"breakroleinheritance(copyroleassignments="+e+", clearsubscopes="+n+")",!0).post()},t.prototype.resetRoleInheritance=function(){return this.clone(t,"resetroleinheritance",!0).post()},t.prototype.userHasPermissions=function(e,t){var n=this;return this.getUserEffectivePermissions(e).then(function(e){return n.hasPermissions(e,t)})},t.prototype.currentUserHasPermissions=function(e){var t=this;return this.getCurrentUserEffectivePermissions().then(function(n){return t.hasPermissions(n,e)})},t.prototype.hasPermissions=function(e,t){if(!t)return!0;if(t===a.PermissionKind.FullMask)return 32767==(32767&e.High)&&65535===e.Low;t-=1;var n=1;return t>=0&&t<32?(n<<=t,0!=(e.Low&n)):t>=32&&t<64&&(n<<=t-32,0!=(e.High&n))},t}(s.QueryableInstance);t.QueryableSecurable=u},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(0),a=function(e){function t(t,n){return void 0===n&&(n="_api/search/postquery"),e.call(this,t,n)||this}return r(t,e),t.prototype.execute=function(e){var t;t=e,t.SelectProperties&&(t.SelectProperties={results:e.SelectProperties}),t.RefinementFilters&&(t.RefinementFilters={results:e.RefinementFilters}),t.SortList&&(t.SortList={results:e.SortList}),t.HithighlightedProperties&&(t.HithighlightedProperties={results:e.HithighlightedProperties}),t.ReorderingRules&&(t.ReorderingRules={results:e.ReorderingRules}),t.Properties&&(t.Properties={results:e.Properties});var n=JSON.stringify({request:i.Util.extend({__metadata:{type:"Microsoft.Office.Server.Search.REST.SearchRequest"}},t)});return this.post({body:n}).then(function(e){return new s(e)})},t}(o.QueryableInstance);t.Search=a;var s=function(){function e(e){var t=e.postquery?e.postquery:e;this.PrimarySearchResults=this.formatSearchResults(t.PrimaryQueryResult.RelevantResults.Table.Rows),this.RawSearchResults=t,this.ElapsedTime=t.ElapsedTime,this.RowCount=t.PrimaryQueryResult.RelevantResults.RowCount,this.TotalRows=t.PrimaryQueryResult.RelevantResults.TotalRows,this.TotalRowsIncludingDuplicates=t.PrimaryQueryResult.RelevantResults.TotalRowsIncludingDuplicates}return e.prototype.formatSearchResults=function(e){for(var t=new Array,n=e.results?e.results:e,r=0,o=n;r0&&r[0].hasOwnProperty("hasResult")&&r[0].hasResult?(u.Logger.write("["+r[0].requestId+"] ("+(new Date).getTime()+") Skipping request pipeline method "+n+", existing result in pipeline.",u.LogLevel.Verbose),Promise.resolve(r[0])):(u.Logger.write("["+r[0].requestId+"] ("+(new Date).getTime()+") Calling request pipeline method "+n+".",u.LogLevel.Verbose),o.apply(t,r))}}}var i=this&&this.__decorate||function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a};Object.defineProperty(t,"__esModule",{value:!0});var a=n(22),s=n(15),u=n(5),c=n(0);t.pipe=r;var l=function(){function e(){}return e.logStart=function(e){return new Promise(function(t){u.Logger.log({data:u.Logger.activeLogLevel===u.LogLevel.Info?{}:e,level:u.LogLevel.Info,message:"["+e.requestId+"] ("+(new Date).getTime()+") Beginning "+e.verb+" request to "+e.requestAbsoluteUrl}),t(e)})},e.caching=function(t){return new Promise(function(n){if("GET"===t.verb&&t.isCached){u.Logger.write("["+t.requestId+"] ("+(new Date).getTime()+") Caching is enabled for request, checking cache...",u.LogLevel.Info);var r=new a.CachingOptions(t.requestAbsoluteUrl.toLowerCase());if(void 0!==t.cachingOptions&&(r=c.Util.extend(r,t.cachingOptions)),null!==r.store){var o=r.store.get(r.key);if(null!==o)return u.Logger.log({data:u.Logger.activeLogLevel===u.LogLevel.Info?{}:o,level:u.LogLevel.Info,message:"["+t.requestId+"] ("+(new Date).getTime()+") Value returned from cache."}),t.batchDependency(),e.setResult(t,o).then(function(e){return n(e)})}u.Logger.write("["+t.requestId+"] ("+(new Date).getTime()+") Value not found in cache.",u.LogLevel.Info),t.parser=new a.CachingParserWrapper(t.parser,r)}return n(t)})},e.send=function(t){return new Promise(function(n,r){if(t.isBatched){var o=t.batch.add(t.requestAbsoluteUrl,t.verb,t.options,t.parser);t.batchDependency(),u.Logger.write("["+t.requestId+"] ("+(new Date).getTime()+") Batching request.",u.LogLevel.Info),n(o.then(function(n){return e.setResult(t,n)}))}else{u.Logger.write("["+t.requestId+"] ("+(new Date).getTime()+") Sending request.",u.LogLevel.Info);var i=new s.HttpClient,a=c.Util.extend(t.options||{},{method:t.verb});i.fetch(t.requestAbsoluteUrl,a).then(function(e){return t.parser.parse(e)}).then(function(n){return e.setResult(t,n)}).then(function(e){return n(e)}).catch(function(e){return r(e)})}})},e.logEnd=function(e){return new Promise(function(t){u.Logger.log({data:u.Logger.activeLogLevel===u.LogLevel.Info?{}:e,level:u.LogLevel.Info,message:"["+e.requestId+"] ("+(new Date).getTime()+") Completing "+e.verb+" request to "+e.requestAbsoluteUrl}),t(e)})},e.returnResult=function(e){return u.Logger.log({data:e.result,level:u.LogLevel.Verbose,message:"["+e.requestId+"] ("+(new Date).getTime()+") Returning, see data property for value."}),Promise.resolve(e.result)},e.setResult=function(e,t){return new Promise(function(n){e.result=t,e.hasResult=!0,n(e)})},e}();i([o(!0)],l,"logStart",null),i([o()],l,"caching",null),i([o()],l,"send",null),i([o(!0)],l,"logEnd",null),i([o(!0)],l,"returnResult",null)},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=function(e){function t(t,n){return void 0===n&&(n="_api/SP.RelatedItemManager"),e.call(this,t,n)||this}return r(t,e),t.FromUrl=function(e){if(null===e)return new t("");var n=e.indexOf("_api/");return new t(n>-1?e.substr(0,n):e)},t.prototype.getRelatedItems=function(e,n){var r=this.clone(t,null,!0);return r.concat(".GetRelatedItems"),r.post({body:JSON.stringify({SourceItemID:n,SourceListName:e})})},t.prototype.getPageOneRelatedItems=function(e,n){var r=this.clone(t,null,!0);return r.concat(".GetPageOneRelatedItems"),r.post({body:JSON.stringify({SourceItemID:n,SourceListName:e})})},t.prototype.addSingleLink=function(e,n,r,o,i,a,s){void 0===s&&(s=!1);var u=this.clone(t,null,!0);return u.concat(".AddSingleLink"),u.post({body:JSON.stringify({SourceItemID:n,SourceListName:e,SourceWebUrl:r,TargetItemID:i,TargetListName:o,TargetWebUrl:a,TryAddReverseLink:s})})},t.prototype.addSingleLinkToUrl=function(e,n,r,o){void 0===o&&(o=!1);var i=this.clone(t,null,!0);return i.concat(".AddSingleLinkToUrl"),i.post({body:JSON.stringify({SourceItemID:n,SourceListName:e,TargetItemUrl:r,TryAddReverseLink:o})})},t.prototype.addSingleLinkFromUrl=function(e,n,r,o){void 0===o&&(o=!1);var i=this.clone(t,null,!0);return i.concat(".AddSingleLinkFromUrl"),i.post({body:JSON.stringify({SourceItemUrl:e,TargetItemID:r,TargetListName:n,TryAddReverseLink:o})})},t.prototype.deleteSingleLink=function(e,n,r,o,i,a,s){void 0===s&&(s=!1);var u=this.clone(t,null,!0);return u.concat(".DeleteSingleLink"),u.post({body:JSON.stringify({SourceItemID:n,SourceListName:e,SourceWebUrl:r,TargetItemID:i,TargetListName:o,TargetWebUrl:a,TryDeleteReverseLink:s})})},t}(o.Queryable);t.RelatedItemManagerImpl=i},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=function(e){function t(t,n){return void 0===n&&(n="subscriptions"),e.call(this,t,n)||this}return r(t,e),t.prototype.getById=function(e){var t=new a(this);return t.concat("('"+e+"')"),t},t.prototype.add=function(e,t,n){var r=this,o=JSON.stringify({clientState:n||"pnp-js-core-subscription",expirationDateTime:t,notificationUrl:e,resource:this.toUrl()});return this.post({body:o,headers:{"Content-Type":"application/json"}}).then(function(e){return{data:e,subscription:r.getById(e.id)}})},t}(o.QueryableCollection);t.Subscriptions=i;var a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.update=function(e){var t=this,n=JSON.stringify({expirationDateTime:e});return this.patch({body:n,headers:{"Content-Type":"application/json"}}).then(function(e){return{data:e,subscription:t}})},t.prototype.delete=function(){return e.prototype.delete.call(this)},t}(o.QueryableInstance);t.Subscription=a},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n(51),a=n(2),s=function(e){function t(t,n){void 0===n&&(n="_api/sp.userprofiles.peoplemanager");var r=e.call(this,t,n)||this;return r.profileLoader=new u(t),r}return r(t,e),Object.defineProperty(t.prototype,"editProfileLink",{get:function(){return this.clone(t,"EditProfileLink").getAs(a.ODataValue())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isMyPeopleListPublic",{get:function(){return this.clone(t,"IsMyPeopleListPublic").getAs(a.ODataValue())},enumerable:!0,configurable:!0}),t.prototype.amIFollowedBy=function(e){var n=this.clone(t,"amifollowedby(@v)",!0);return n.query.add("@v","'"+encodeURIComponent(e)+"'"),n.get()},t.prototype.amIFollowing=function(e){var n=this.clone(t,"amifollowing(@v)",!0);return n.query.add("@v","'"+encodeURIComponent(e)+"'"),n.get()},t.prototype.getFollowedTags=function(e){return void 0===e&&(e=20),this.clone(t,"getfollowedtags("+e+")",!0).get()},t.prototype.getFollowersFor=function(e){var n=this.clone(t,"getfollowersfor(@v)",!0);return n.query.add("@v","'"+encodeURIComponent(e)+"'"),n.get()},Object.defineProperty(t.prototype,"myFollowers",{get:function(){return new o.QueryableCollection(this,"getmyfollowers")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"myProperties",{get:function(){return new t(this,"getmyproperties")},enumerable:!0,configurable:!0}),t.prototype.getPeopleFollowedBy=function(e){var n=this.clone(t,"getpeoplefollowedby(@v)",!0);return n.query.add("@v","'"+encodeURIComponent(e)+"'"),n.get()},t.prototype.getPropertiesFor=function(e){var n=this.clone(t,"getpropertiesfor(@v)",!0);return n.query.add("@v","'"+encodeURIComponent(e)+"'"),n.get()},Object.defineProperty(t.prototype,"trendingTags",{get:function(){var e=this.clone(t,null,!0);return e.concat(".gettrendingtags"),e.get()},enumerable:!0,configurable:!0}),t.prototype.getUserProfilePropertyFor=function(e,n){var r=this.clone(t,"getuserprofilepropertyfor(accountname=@v, propertyname='"+n+"')",!0);return r.query.add("@v","'"+encodeURIComponent(e)+"'"),r.get()},t.prototype.hideSuggestion=function(e){var n=this.clone(t,"hidesuggestion(@v)",!0);return n.query.add("@v","'"+encodeURIComponent(e)+"'"),n.post()},t.prototype.isFollowing=function(e,n){var r=this.clone(t,null,!0);return r.concat(".isfollowing(possiblefolloweraccountname=@v, possiblefolloweeaccountname=@y)"),r.query.add("@v","'"+encodeURIComponent(e)+"'"),r.query.add("@y","'"+encodeURIComponent(n)+"'"),r.get()},t.prototype.setMyProfilePic=function(e){var n=this;return new Promise(function(r,o){i.readBlobAsArrayBuffer(e).then(function(e){new t(n,"setmyprofilepicture").post({body:String.fromCharCode.apply(null,new Uint16Array(e))}).then(function(e){return r()})}).catch(function(e){return o(e)})})},t.prototype.createPersonalSiteEnqueueBulk=function(){for(var e=[],t=0;t= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar decorators_1 = __webpack_require__(31);\nvar pnplibconfig_1 = __webpack_require__(4);\nvar Util = (function () {\n function Util() {\n }\n /**\n * Gets a callback function which will maintain context across async calls.\n * Allows for the calling pattern getCtxCallback(thisobj, method, methodarg1, methodarg2, ...)\n *\n * @param context The object that will be the 'this' value in the callback\n * @param method The method to which we will apply the context and parameters\n * @param params Optional, additional arguments to supply to the wrapped method when it is invoked\n */\n Util.getCtxCallback = function (context, method) {\n var params = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n params[_i - 2] = arguments[_i];\n }\n return function () {\n method.apply(context, params);\n };\n };\n /**\n * Tests if a url param exists\n *\n * @param name The name of the url paramter to check\n */\n Util.urlParamExists = function (name) {\n name = name.replace(/[\\[]/, \"\\\\[\").replace(/[\\]]/, \"\\\\]\");\n var regex = new RegExp(\"[\\\\?&]\" + name + \"=([^&#]*)\");\n return regex.test(location.search);\n };\n /**\n * Gets a url param value by name\n *\n * @param name The name of the paramter for which we want the value\n */\n Util.getUrlParamByName = function (name) {\n name = name.replace(/[\\[]/, \"\\\\[\").replace(/[\\]]/, \"\\\\]\");\n var regex = new RegExp(\"[\\\\?&]\" + name + \"=([^&#]*)\");\n var results = regex.exec(location.search);\n return results == null ? \"\" : decodeURIComponent(results[1].replace(/\\+/g, \" \"));\n };\n /**\n * Gets a url param by name and attempts to parse a bool value\n *\n * @param name The name of the paramter for which we want the boolean value\n */\n Util.getUrlParamBoolByName = function (name) {\n var p = this.getUrlParamByName(name);\n var isFalse = (p === \"\" || /false|0/i.test(p));\n return !isFalse;\n };\n /**\n * Inserts the string s into the string target as the index specified by index\n *\n * @param target The string into which we will insert s\n * @param index The location in target to insert s (zero based)\n * @param s The string to insert into target at position index\n */\n Util.stringInsert = function (target, index, s) {\n if (index > 0) {\n return target.substring(0, index) + s + target.substring(index, target.length);\n }\n return s + target;\n };\n /**\n * Adds a value to a date\n *\n * @param date The date to which we will add units, done in local time\n * @param interval The name of the interval to add, one of: ['year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second']\n * @param units The amount to add to date of the given interval\n *\n * http://stackoverflow.com/questions/1197928/how-to-add-30-minutes-to-a-javascript-date-object\n */\n Util.dateAdd = function (date, interval, units) {\n var ret = new Date(date.toLocaleString()); // don't change original date\n switch (interval.toLowerCase()) {\n case \"year\":\n ret.setFullYear(ret.getFullYear() + units);\n break;\n case \"quarter\":\n ret.setMonth(ret.getMonth() + 3 * units);\n break;\n case \"month\":\n ret.setMonth(ret.getMonth() + units);\n break;\n case \"week\":\n ret.setDate(ret.getDate() + 7 * units);\n break;\n case \"day\":\n ret.setDate(ret.getDate() + units);\n break;\n case \"hour\":\n ret.setTime(ret.getTime() + units * 3600000);\n break;\n case \"minute\":\n ret.setTime(ret.getTime() + units * 60000);\n break;\n case \"second\":\n ret.setTime(ret.getTime() + units * 1000);\n break;\n default:\n ret = undefined;\n break;\n }\n return ret;\n };\n /**\n * Loads a stylesheet into the current page\n *\n * @param path The url to the stylesheet\n * @param avoidCache If true a value will be appended as a query string to avoid browser caching issues\n */\n Util.loadStylesheet = function (path, avoidCache) {\n if (avoidCache) {\n path += \"?\" + encodeURIComponent((new Date()).getTime().toString());\n }\n var head = document.getElementsByTagName(\"head\");\n if (head.length > 0) {\n var e = document.createElement(\"link\");\n head[0].appendChild(e);\n e.setAttribute(\"type\", \"text/css\");\n e.setAttribute(\"rel\", \"stylesheet\");\n e.setAttribute(\"href\", path);\n }\n };\n /**\n * Combines an arbitrary set of paths ensuring that the slashes are normalized\n *\n * @param paths 0 to n path parts to combine\n */\n Util.combinePaths = function () {\n var paths = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n paths[_i] = arguments[_i];\n }\n return paths\n .filter(function (path) { return typeof path !== \"undefined\" && path !== null; })\n .map(function (path) { return path.replace(/^[\\\\|\\/]/, \"\").replace(/[\\\\|\\/]$/, \"\"); })\n .join(\"/\")\n .replace(/\\\\/g, \"/\");\n };\n /**\n * Gets a random string of chars length\n *\n * @param chars The length of the random string to generate\n */\n Util.getRandomString = function (chars) {\n var text = new Array(chars);\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n for (var i = 0; i < chars; i++) {\n text[i] = possible.charAt(Math.floor(Math.random() * possible.length));\n }\n return text.join(\"\");\n };\n /**\n * Gets a random GUID value\n *\n * http://stackoverflow.com/questions/105034/create-guid-uuid-in-javascript\n */\n /* tslint:disable no-bitwise */\n Util.getGUID = function () {\n var d = new Date().getTime();\n var guid = \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g, function (c) {\n var r = (d + Math.random() * 16) % 16 | 0;\n d = Math.floor(d / 16);\n return (c === \"x\" ? r : (r & 0x3 | 0x8)).toString(16);\n });\n return guid;\n };\n /* tslint:enable */\n /**\n * Determines if a given value is a function\n *\n * @param candidateFunction The thing to test for being a function\n */\n Util.isFunction = function (candidateFunction) {\n return typeof candidateFunction === \"function\";\n };\n /**\n * @returns whether the provided parameter is a JavaScript Array or not.\n */\n Util.isArray = function (array) {\n if (Array.isArray) {\n return Array.isArray(array);\n }\n return array && typeof array.length === \"number\" && array.constructor === Array;\n };\n /**\n * Determines if a string is null or empty or undefined\n *\n * @param s The string to test\n */\n Util.stringIsNullOrEmpty = function (s) {\n return typeof s === \"undefined\" || s === null || s === \"\";\n };\n /**\n * Provides functionality to extend the given object by doing a shallow copy\n *\n * @param target The object to which properties will be copied\n * @param source The source object from which properties will be copied\n * @param noOverwrite If true existing properties on the target are not overwritten from the source\n *\n */\n Util.extend = function (target, source, noOverwrite) {\n if (noOverwrite === void 0) { noOverwrite = false; }\n if (source === null || typeof source === \"undefined\") {\n return target;\n }\n // ensure we don't overwrite things we don't want overwritten\n var check = noOverwrite ? function (o, i) { return !(i in o); } : function () { return true; };\n return Object.getOwnPropertyNames(source)\n .filter(function (v) { return check(target, v); })\n .reduce(function (t, v) {\n t[v] = source[v];\n return t;\n }, target);\n };\n /**\n * Determines if a given url is absolute\n *\n * @param url The url to check to see if it is absolute\n */\n Util.isUrlAbsolute = function (url) {\n return /^https?:\\/\\/|^\\/\\//i.test(url);\n };\n /**\n * Attempts to make the supplied relative url absolute based on the _spPageContextInfo object, if available\n *\n * @param url The relative url to make absolute\n */\n Util.makeUrlAbsolute = function (url) {\n if (Util.isUrlAbsolute(url)) {\n return url;\n }\n if (typeof global._spPageContextInfo !== \"undefined\") {\n if (global._spPageContextInfo.hasOwnProperty(\"webAbsoluteUrl\")) {\n return Util.combinePaths(global._spPageContextInfo.webAbsoluteUrl, url);\n }\n else if (global._spPageContextInfo.hasOwnProperty(\"webServerRelativeUrl\")) {\n return Util.combinePaths(global._spPageContextInfo.webServerRelativeUrl, url);\n }\n }\n else {\n return url;\n }\n };\n /**\n * Ensures that a given url is absolute for the current web based on context\n *\n * @param candidateUrl The url to make absolute\n *\n */\n Util.toAbsoluteUrl = function (candidateUrl) {\n return new Promise(function (resolve) {\n if (Util.isUrlAbsolute(candidateUrl)) {\n // if we are already absolute, then just return the url\n return resolve(candidateUrl);\n }\n if (pnplibconfig_1.RuntimeConfig.baseUrl !== null) {\n // base url specified either with baseUrl of spfxContext config property\n return resolve(Util.combinePaths(pnplibconfig_1.RuntimeConfig.baseUrl, candidateUrl));\n }\n if (typeof global._spPageContextInfo !== \"undefined\") {\n // operating in classic pages\n if (global._spPageContextInfo.hasOwnProperty(\"webAbsoluteUrl\")) {\n return resolve(Util.combinePaths(global._spPageContextInfo.webAbsoluteUrl, candidateUrl));\n }\n else if (global._spPageContextInfo.hasOwnProperty(\"webServerRelativeUrl\")) {\n return resolve(Util.combinePaths(global._spPageContextInfo.webServerRelativeUrl, candidateUrl));\n }\n }\n // does window.location exist and have _layouts in it?\n if (typeof global.location !== \"undefined\") {\n var index = global.location.toString().toLowerCase().indexOf(\"/_layouts/\");\n if (index > 0) {\n // we are likely in the workbench in /_layouts/\n return resolve(Util.combinePaths(global.location.toString().substr(0, index), candidateUrl));\n }\n }\n return resolve(candidateUrl);\n });\n };\n return Util;\n}());\n__decorate([\n decorators_1.deprecated(\"The Util.makeUrlAbsolute method is deprecated and will be removed from future releases. Use Util.toAbsoluteUrl instead\")\n], Util, \"makeUrlAbsolute\", null);\nexports.Util = Util;\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(32)))\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar util_1 = __webpack_require__(0);\nvar collections_1 = __webpack_require__(6);\nvar odata_1 = __webpack_require__(2);\nvar pnplibconfig_1 = __webpack_require__(4);\nvar exceptions_1 = __webpack_require__(3);\nvar queryablerequest_1 = __webpack_require__(45);\nvar logging_1 = __webpack_require__(5);\n/**\n * Queryable Base Class\n *\n */\nvar Queryable = (function () {\n /**\n * Creates a new instance of the Queryable class\n *\n * @constructor\n * @param baseUrl A string or Queryable that should form the base part of the url\n *\n */\n function Queryable(baseUrl, path) {\n this._query = new collections_1.Dictionary();\n this._batch = null;\n if (typeof baseUrl === \"string\") {\n // we need to do some extra parsing to get the parent url correct if we are\n // being created from just a string.\n var urlStr = baseUrl;\n if (util_1.Util.isUrlAbsolute(urlStr) || urlStr.lastIndexOf(\"/\") < 0) {\n this._parentUrl = urlStr;\n this._url = util_1.Util.combinePaths(urlStr, path);\n }\n else if (urlStr.lastIndexOf(\"/\") > urlStr.lastIndexOf(\"(\")) {\n // .../items(19)/fields\n var index = urlStr.lastIndexOf(\"/\");\n this._parentUrl = urlStr.slice(0, index);\n path = util_1.Util.combinePaths(urlStr.slice(index), path);\n this._url = util_1.Util.combinePaths(this._parentUrl, path);\n }\n else {\n // .../items(19)\n var index = urlStr.lastIndexOf(\"(\");\n this._parentUrl = urlStr.slice(0, index);\n this._url = util_1.Util.combinePaths(urlStr, path);\n }\n }\n else {\n var q = baseUrl;\n this._parentUrl = q._url;\n var target = q._query.get(\"@target\");\n if (target !== null) {\n this._query.add(\"@target\", target);\n }\n this._url = util_1.Util.combinePaths(this._parentUrl, path);\n }\n }\n /**\n * Directly concatonates the supplied string to the current url, not normalizing \"/\" chars\n *\n * @param pathPart The string to concatonate to the url\n */\n Queryable.prototype.concat = function (pathPart) {\n this._url += pathPart;\n };\n /**\n * Appends the given string and normalizes \"/\" chars\n *\n * @param pathPart The string to append\n */\n Queryable.prototype.append = function (pathPart) {\n this._url = util_1.Util.combinePaths(this._url, pathPart);\n };\n /**\n * Blocks a batch call from occuring, MUST be cleared by calling the returned function\n */\n Queryable.prototype.addBatchDependency = function () {\n if (this.hasBatch) {\n return this._batch.addDependency();\n }\n return function () { return null; };\n };\n Object.defineProperty(Queryable.prototype, \"hasBatch\", {\n /**\n * Indicates if the current query has a batch associated\n *\n */\n get: function () {\n return this._batch !== null;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Queryable.prototype, \"batch\", {\n /**\n * The batch currently associated with this query or null\n *\n */\n get: function () {\n return this.hasBatch ? this._batch : null;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Queryable.prototype, \"parentUrl\", {\n /**\n * Gets the parent url used when creating this instance\n *\n */\n get: function () {\n return this._parentUrl;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Queryable.prototype, \"query\", {\n /**\n * Provides access to the query builder for this url\n *\n */\n get: function () {\n return this._query;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Creates a new instance of the supplied factory and extends this into that new instance\n *\n * @param factory constructor for the new queryable\n */\n Queryable.prototype.as = function (factory) {\n var o = new factory(this._url, null);\n return util_1.Util.extend(o, this, true);\n };\n /**\n * Adds this query to the supplied batch\n *\n * @example\n * ```\n *\n * let b = pnp.sp.createBatch();\n * pnp.sp.web.inBatch(b).get().then(...);\n * b.execute().then(...)\n * ```\n */\n Queryable.prototype.inBatch = function (batch) {\n if (this._batch !== null) {\n throw new exceptions_1.AlreadyInBatchException();\n }\n this._batch = batch;\n return this;\n };\n /**\n * Enables caching for this request\n *\n * @param options Defines the options used when caching this request\n */\n Queryable.prototype.usingCaching = function (options) {\n if (!pnplibconfig_1.RuntimeConfig.globalCacheDisable) {\n this._useCaching = true;\n this._cachingOptions = options;\n }\n return this;\n };\n /**\n * Gets the currentl url, made absolute based on the availability of the _spPageContextInfo object\n *\n */\n Queryable.prototype.toUrl = function () {\n return this._url;\n };\n /**\n * Gets the full url with query information\n *\n */\n Queryable.prototype.toUrlAndQuery = function () {\n var aliasedParams = new collections_1.Dictionary();\n var url = this.toUrl().replace(/'!(@.*?)::(.*?)'/ig, function (match, labelName, value) {\n logging_1.Logger.write(\"Rewriting aliased parameter from match \" + match + \" to label: \" + labelName + \" value: \" + value, logging_1.LogLevel.Verbose);\n aliasedParams.add(labelName, \"'\" + value + \"'\");\n return labelName;\n });\n // inlude our explicitly set query string params\n aliasedParams.merge(this._query);\n if (aliasedParams.count() > 0) {\n url += \"?\" + aliasedParams.getKeys().map(function (key) { return key + \"=\" + aliasedParams.get(key); }).join(\"&\");\n }\n return url;\n };\n /**\n * Gets a parent for this instance as specified\n *\n * @param factory The contructor for the class to create\n */\n Queryable.prototype.getParent = function (factory, baseUrl, path, batch) {\n if (baseUrl === void 0) { baseUrl = this.parentUrl; }\n var parent = new factory(baseUrl, path);\n var target = this.query.get(\"@target\");\n if (target !== null) {\n parent.query.add(\"@target\", target);\n }\n if (typeof batch !== \"undefined\") {\n parent = parent.inBatch(batch);\n }\n return parent;\n };\n /**\n * Clones this queryable into a new queryable instance of T\n * @param factory Constructor used to create the new instance\n * @param additionalPath Any additional path to include in the clone\n * @param includeBatch If true this instance's batch will be added to the cloned instance\n */\n Queryable.prototype.clone = function (factory, additionalPath, includeBatch) {\n if (includeBatch === void 0) { includeBatch = false; }\n var clone = new factory(this, additionalPath);\n var target = this.query.get(\"@target\");\n if (target !== null) {\n clone.query.add(\"@target\", target);\n }\n if (includeBatch && this.hasBatch) {\n clone = clone.inBatch(this.batch);\n }\n return clone;\n };\n /**\n * Executes the currently built request\n *\n * @param parser Allows you to specify a parser to handle the result\n * @param getOptions The options used for this request\n */\n Queryable.prototype.get = function (parser, getOptions) {\n if (parser === void 0) { parser = new odata_1.ODataDefaultParser(); }\n if (getOptions === void 0) { getOptions = {}; }\n return this.toRequestContext(\"GET\", getOptions, parser).then(function (context) { return queryablerequest_1.pipe(context); });\n };\n Queryable.prototype.getAs = function (parser, getOptions) {\n if (parser === void 0) { parser = new odata_1.ODataDefaultParser(); }\n if (getOptions === void 0) { getOptions = {}; }\n return this.toRequestContext(\"GET\", getOptions, parser).then(function (context) { return queryablerequest_1.pipe(context); });\n };\n Queryable.prototype.post = function (postOptions, parser) {\n if (postOptions === void 0) { postOptions = {}; }\n if (parser === void 0) { parser = new odata_1.ODataDefaultParser(); }\n return this.toRequestContext(\"POST\", postOptions, parser).then(function (context) { return queryablerequest_1.pipe(context); });\n };\n Queryable.prototype.postAs = function (postOptions, parser) {\n if (postOptions === void 0) { postOptions = {}; }\n if (parser === void 0) { parser = new odata_1.ODataDefaultParser(); }\n return this.toRequestContext(\"POST\", postOptions, parser).then(function (context) { return queryablerequest_1.pipe(context); });\n };\n Queryable.prototype.patch = function (patchOptions, parser) {\n if (patchOptions === void 0) { patchOptions = {}; }\n if (parser === void 0) { parser = new odata_1.ODataDefaultParser(); }\n return this.toRequestContext(\"PATCH\", patchOptions, parser).then(function (context) { return queryablerequest_1.pipe(context); });\n };\n Queryable.prototype.delete = function (deleteOptions, parser) {\n if (deleteOptions === void 0) { deleteOptions = {}; }\n if (parser === void 0) { parser = new odata_1.ODataDefaultParser(); }\n return this.toRequestContext(\"DELETE\", deleteOptions, parser).then(function (context) { return queryablerequest_1.pipe(context); });\n };\n Queryable.prototype.toRequestContext = function (verb, options, parser) {\n var _this = this;\n if (options === void 0) { options = {}; }\n var dependencyDispose = this.hasBatch ? this.addBatchDependency() : function () { return; };\n return util_1.Util.toAbsoluteUrl(this.toUrlAndQuery()).then(function (url) {\n // build our request context\n var context = {\n batch: _this._batch,\n batchDependency: dependencyDispose,\n cachingOptions: _this._cachingOptions,\n isBatched: _this.hasBatch,\n isCached: _this._useCaching,\n options: options,\n parser: parser,\n requestAbsoluteUrl: url,\n requestId: util_1.Util.getGUID(),\n verb: verb,\n };\n return context;\n });\n };\n return Queryable;\n}());\nexports.Queryable = Queryable;\n/**\n * Represents a REST collection which can be filtered, paged, and selected\n *\n */\nvar QueryableCollection = (function (_super) {\n __extends(QueryableCollection, _super);\n function QueryableCollection() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Filters the returned collection (https://msdn.microsoft.com/en-us/library/office/fp142385.aspx#bk_supported)\n *\n * @param filter The string representing the filter query\n */\n QueryableCollection.prototype.filter = function (filter) {\n this._query.add(\"$filter\", filter);\n return this;\n };\n /**\n * Choose which fields to return\n *\n * @param selects One or more fields to return\n */\n QueryableCollection.prototype.select = function () {\n var selects = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n selects[_i] = arguments[_i];\n }\n if (selects.length > 0) {\n this._query.add(\"$select\", selects.join(\",\"));\n }\n return this;\n };\n /**\n * Expands fields such as lookups to get additional data\n *\n * @param expands The Fields for which to expand the values\n */\n QueryableCollection.prototype.expand = function () {\n var expands = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n expands[_i] = arguments[_i];\n }\n if (expands.length > 0) {\n this._query.add(\"$expand\", expands.join(\",\"));\n }\n return this;\n };\n /**\n * Orders based on the supplied fields ascending\n *\n * @param orderby The name of the field to sort on\n * @param ascending If false DESC is appended, otherwise ASC (default)\n */\n QueryableCollection.prototype.orderBy = function (orderBy, ascending) {\n if (ascending === void 0) { ascending = true; }\n var keys = this._query.getKeys();\n var query = [];\n var asc = ascending ? \" asc\" : \" desc\";\n for (var i = 0; i < keys.length; i++) {\n if (keys[i] === \"$orderby\") {\n query.push(this._query.get(\"$orderby\"));\n break;\n }\n }\n query.push(\"\" + orderBy + asc);\n this._query.add(\"$orderby\", query.join(\",\"));\n return this;\n };\n /**\n * Skips the specified number of items\n *\n * @param skip The number of items to skip\n */\n QueryableCollection.prototype.skip = function (skip) {\n this._query.add(\"$skip\", skip.toString());\n return this;\n };\n /**\n * Limits the query to only return the specified number of items\n *\n * @param top The query row limit\n */\n QueryableCollection.prototype.top = function (top) {\n this._query.add(\"$top\", top.toString());\n return this;\n };\n return QueryableCollection;\n}(Queryable));\nexports.QueryableCollection = QueryableCollection;\n/**\n * Represents an instance that can be selected\n *\n */\nvar QueryableInstance = (function (_super) {\n __extends(QueryableInstance, _super);\n function QueryableInstance() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Choose which fields to return\n *\n * @param selects One or more fields to return\n */\n QueryableInstance.prototype.select = function () {\n var selects = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n selects[_i] = arguments[_i];\n }\n if (selects.length > 0) {\n this._query.add(\"$select\", selects.join(\",\"));\n }\n return this;\n };\n /**\n * Expands fields such as lookups to get additional data\n *\n * @param expands The Fields for which to expand the values\n */\n QueryableInstance.prototype.expand = function () {\n var expands = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n expands[_i] = arguments[_i];\n }\n if (expands.length > 0) {\n this._query.add(\"$expand\", expands.join(\",\"));\n }\n return this;\n };\n return QueryableInstance;\n}(Queryable));\nexports.QueryableInstance = QueryableInstance;\n\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar util_1 = __webpack_require__(0);\nvar logging_1 = __webpack_require__(5);\nvar httpclient_1 = __webpack_require__(15);\nvar pnplibconfig_1 = __webpack_require__(4);\nvar exceptions_1 = __webpack_require__(3);\nvar exceptions_2 = __webpack_require__(3);\nfunction extractOdataId(candidate) {\n if (candidate.hasOwnProperty(\"odata.id\")) {\n return candidate[\"odata.id\"];\n }\n else if (candidate.hasOwnProperty(\"__metadata\") && candidate.__metadata.hasOwnProperty(\"id\")) {\n return candidate.__metadata.id;\n }\n else {\n throw new exceptions_1.ODataIdException(candidate);\n }\n}\nexports.extractOdataId = extractOdataId;\nvar ODataParserBase = (function () {\n function ODataParserBase() {\n }\n ODataParserBase.prototype.parse = function (r) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n if (_this.handleError(r, reject)) {\n if ((r.headers.has(\"Content-Length\") && parseFloat(r.headers.get(\"Content-Length\")) === 0) || r.status === 204) {\n resolve({});\n }\n else {\n r.json().then(function (json) { return resolve(_this.parseODataJSON(json)); }).catch(function (e) { return reject(e); });\n }\n }\n });\n };\n ODataParserBase.prototype.handleError = function (r, reject) {\n if (!r.ok) {\n r.json().then(function (json) {\n // include the headers as they contain diagnostic information\n var data = {\n responseBody: json,\n responseHeaders: r.headers,\n };\n reject(new exceptions_2.ProcessHttpClientResponseException(r.status, r.statusText, data));\n }).catch(function (e) {\n // we failed to read the body - possibly it is empty. Let's report the original status that caused\n // the request to fail and log the error with parsing the body if anyone needs it for debugging\n logging_1.Logger.log({\n data: e,\n level: logging_1.LogLevel.Warning,\n message: \"There was an error parsing the error response body. See data for details.\",\n });\n // include the headers as they contain diagnostic information\n var data = {\n responseBody: \"[[body not available]]\",\n responseHeaders: r.headers,\n };\n reject(new exceptions_2.ProcessHttpClientResponseException(r.status, r.statusText, data));\n });\n }\n return r.ok;\n };\n ODataParserBase.prototype.parseODataJSON = function (json) {\n var result = json;\n if (json.hasOwnProperty(\"d\")) {\n if (json.d.hasOwnProperty(\"results\")) {\n result = json.d.results;\n }\n else {\n result = json.d;\n }\n }\n else if (json.hasOwnProperty(\"value\")) {\n result = json.value;\n }\n return result;\n };\n return ODataParserBase;\n}());\nexports.ODataParserBase = ODataParserBase;\nvar ODataDefaultParser = (function (_super) {\n __extends(ODataDefaultParser, _super);\n function ODataDefaultParser() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return ODataDefaultParser;\n}(ODataParserBase));\nexports.ODataDefaultParser = ODataDefaultParser;\nvar ODataRawParserImpl = (function () {\n function ODataRawParserImpl() {\n }\n ODataRawParserImpl.prototype.parse = function (r) {\n return r.json();\n };\n return ODataRawParserImpl;\n}());\nexports.ODataRawParserImpl = ODataRawParserImpl;\nvar ODataValueParserImpl = (function (_super) {\n __extends(ODataValueParserImpl, _super);\n function ODataValueParserImpl() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ODataValueParserImpl.prototype.parse = function (r) {\n return _super.prototype.parse.call(this, r).then(function (d) { return d; });\n };\n return ODataValueParserImpl;\n}(ODataParserBase));\nvar ODataEntityParserImpl = (function (_super) {\n __extends(ODataEntityParserImpl, _super);\n function ODataEntityParserImpl(factory) {\n var _this = _super.call(this) || this;\n _this.factory = factory;\n return _this;\n }\n ODataEntityParserImpl.prototype.parse = function (r) {\n var _this = this;\n return _super.prototype.parse.call(this, r).then(function (d) {\n var o = new _this.factory(getEntityUrl(d), null);\n return util_1.Util.extend(o, d);\n });\n };\n return ODataEntityParserImpl;\n}(ODataParserBase));\nvar ODataEntityArrayParserImpl = (function (_super) {\n __extends(ODataEntityArrayParserImpl, _super);\n function ODataEntityArrayParserImpl(factory) {\n var _this = _super.call(this) || this;\n _this.factory = factory;\n return _this;\n }\n ODataEntityArrayParserImpl.prototype.parse = function (r) {\n var _this = this;\n return _super.prototype.parse.call(this, r).then(function (d) {\n return d.map(function (v) {\n var o = new _this.factory(getEntityUrl(v), null);\n return util_1.Util.extend(o, v);\n });\n });\n };\n return ODataEntityArrayParserImpl;\n}(ODataParserBase));\nfunction getEntityUrl(entity) {\n if (entity.hasOwnProperty(\"odata.editLink\")) {\n // we are dealign with minimal metadata (default)\n return util_1.Util.combinePaths(\"_api\", entity[\"odata.editLink\"]);\n }\n else if (entity.hasOwnProperty(\"__metadata\")) {\n // we are dealing with verbose, which has an absolute uri\n return entity.__metadata.uri;\n }\n else {\n // we are likely dealing with nometadata, so don't error but we won't be able to\n // chain off these objects\n logging_1.Logger.write(\"No uri information found in ODataEntity parsing, chaining will fail for this object.\", logging_1.LogLevel.Warning);\n return \"\";\n }\n}\nexports.getEntityUrl = getEntityUrl;\nexports.ODataRaw = new ODataRawParserImpl();\nfunction ODataValue() {\n return new ODataValueParserImpl();\n}\nexports.ODataValue = ODataValue;\nfunction ODataEntity(factory) {\n return new ODataEntityParserImpl(factory);\n}\nexports.ODataEntity = ODataEntity;\nfunction ODataEntityArray(factory) {\n return new ODataEntityArrayParserImpl(factory);\n}\nexports.ODataEntityArray = ODataEntityArray;\n/**\n * Manages a batch of OData operations\n */\nvar ODataBatch = (function () {\n function ODataBatch(baseUrl, _batchId) {\n if (_batchId === void 0) { _batchId = util_1.Util.getGUID(); }\n this.baseUrl = baseUrl;\n this._batchId = _batchId;\n this._requests = [];\n this._dependencies = [];\n }\n /**\n * Adds a request to a batch (not designed for public use)\n *\n * @param url The full url of the request\n * @param method The http method GET, POST, etc\n * @param options Any options to include in the request\n * @param parser The parser that will hadle the results of the request\n */\n ODataBatch.prototype.add = function (url, method, options, parser) {\n var info = {\n method: method.toUpperCase(),\n options: options,\n parser: parser,\n reject: null,\n resolve: null,\n url: url,\n };\n var p = new Promise(function (resolve, reject) {\n info.resolve = resolve;\n info.reject = reject;\n });\n this._requests.push(info);\n return p;\n };\n /**\n * Adds a dependency insuring that some set of actions will occur before a batch is processed.\n * MUST be cleared using the returned resolve delegate to allow batches to run\n */\n ODataBatch.prototype.addDependency = function () {\n var resolver;\n var promise = new Promise(function (resolve) {\n resolver = resolve;\n });\n this._dependencies.push(promise);\n return resolver;\n };\n /**\n * Execute the current batch and resolve the associated promises\n *\n * @returns A promise which will be resolved once all of the batch's child promises have resolved\n */\n ODataBatch.prototype.execute = function () {\n var _this = this;\n // we need to check the dependencies twice due to how different engines handle things.\n // We can get a second set of promises added after the first set resolve\n return Promise.all(this._dependencies).then(function () { return Promise.all(_this._dependencies); }).then(function () { return _this.executeImpl(); });\n };\n ODataBatch.prototype.executeImpl = function () {\n var _this = this;\n logging_1.Logger.write(\"Executing batch with \" + this._requests.length + \" requests.\", logging_1.LogLevel.Info);\n // if we don't have any requests, don't bother sending anything\n // this could be due to caching further upstream, or just an empty batch\n if (this._requests.length < 1) {\n logging_1.Logger.write(\"Resolving empty batch.\", logging_1.LogLevel.Info);\n return Promise.resolve();\n }\n // creating the client here allows the url to be populated for nodejs client as well as potentially\n // any other hacks needed for other types of clients. Essentially allows the absoluteRequestUrl\n // below to be correct\n var client = new httpclient_1.HttpClient();\n // due to timing we need to get the absolute url here so we can use it for all the individual requests\n // and for sending the entire batch\n return util_1.Util.toAbsoluteUrl(this.baseUrl).then(function (absoluteRequestUrl) {\n // build all the requests, send them, pipe results in order to parsers\n var batchBody = [];\n var currentChangeSetId = \"\";\n _this._requests.map(function (reqInfo) {\n if (reqInfo.method === \"GET\") {\n if (currentChangeSetId.length > 0) {\n // end an existing change set\n batchBody.push(\"--changeset_\" + currentChangeSetId + \"--\\n\\n\");\n currentChangeSetId = \"\";\n }\n batchBody.push(\"--batch_\" + _this._batchId + \"\\n\");\n }\n else {\n if (currentChangeSetId.length < 1) {\n // start new change set\n currentChangeSetId = util_1.Util.getGUID();\n batchBody.push(\"--batch_\" + _this._batchId + \"\\n\");\n batchBody.push(\"Content-Type: multipart/mixed; boundary=\\\"changeset_\" + currentChangeSetId + \"\\\"\\n\\n\");\n }\n batchBody.push(\"--changeset_\" + currentChangeSetId + \"\\n\");\n }\n // common batch part prefix\n batchBody.push(\"Content-Type: application/http\\n\");\n batchBody.push(\"Content-Transfer-Encoding: binary\\n\\n\");\n var headers = {\n \"Accept\": \"application/json;\",\n };\n // this is the url of the individual request within the batch\n var url = util_1.Util.isUrlAbsolute(reqInfo.url) ? reqInfo.url : util_1.Util.combinePaths(absoluteRequestUrl, reqInfo.url);\n logging_1.Logger.write(\"Adding request \" + reqInfo.method + \" \" + url + \" to batch.\", logging_1.LogLevel.Verbose);\n if (reqInfo.method !== \"GET\") {\n var method = reqInfo.method;\n if (reqInfo.hasOwnProperty(\"options\") && reqInfo.options.hasOwnProperty(\"headers\") && typeof reqInfo.options.headers[\"X-HTTP-Method\"] !== \"undefined\") {\n method = reqInfo.options.headers[\"X-HTTP-Method\"];\n delete reqInfo.options.headers[\"X-HTTP-Method\"];\n }\n batchBody.push(method + \" \" + url + \" HTTP/1.1\\n\");\n headers = util_1.Util.extend(headers, { \"Content-Type\": \"application/json;odata=verbose;charset=utf-8\" });\n }\n else {\n batchBody.push(reqInfo.method + \" \" + url + \" HTTP/1.1\\n\");\n }\n if (typeof pnplibconfig_1.RuntimeConfig.headers !== \"undefined\") {\n headers = util_1.Util.extend(headers, pnplibconfig_1.RuntimeConfig.headers);\n }\n if (reqInfo.options && reqInfo.options.headers) {\n headers = util_1.Util.extend(headers, reqInfo.options.headers);\n }\n for (var name_1 in headers) {\n if (headers.hasOwnProperty(name_1)) {\n batchBody.push(name_1 + \": \" + headers[name_1] + \"\\n\");\n }\n }\n batchBody.push(\"\\n\");\n if (reqInfo.options.body) {\n batchBody.push(reqInfo.options.body + \"\\n\\n\");\n }\n });\n if (currentChangeSetId.length > 0) {\n // Close the changeset\n batchBody.push(\"--changeset_\" + currentChangeSetId + \"--\\n\\n\");\n currentChangeSetId = \"\";\n }\n batchBody.push(\"--batch_\" + _this._batchId + \"--\\n\");\n var batchHeaders = {\n \"Content-Type\": \"multipart/mixed; boundary=batch_\" + _this._batchId,\n };\n var batchOptions = {\n \"body\": batchBody.join(\"\"),\n \"headers\": batchHeaders,\n };\n logging_1.Logger.write(\"Sending batch request.\", logging_1.LogLevel.Info);\n return client.post(util_1.Util.combinePaths(absoluteRequestUrl, \"/_api/$batch\"), batchOptions)\n .then(function (r) { return r.text(); })\n .then(_this._parseResponse)\n .then(function (responses) {\n if (responses.length !== _this._requests.length) {\n throw new exceptions_1.BatchParseException(\"Could not properly parse responses to match requests in batch.\");\n }\n logging_1.Logger.write(\"Resolving batched requests.\", logging_1.LogLevel.Info);\n return responses.reduce(function (chain, response, index) {\n var request = _this._requests[index];\n logging_1.Logger.write(\"Resolving request \" + request.method + \" \" + request.url + \".\", logging_1.LogLevel.Verbose);\n return chain.then(function (_) { return request.parser.parse(response).then(request.resolve).catch(request.reject); });\n }, Promise.resolve());\n });\n });\n };\n /**\n * Parses the response from a batch request into an array of Response instances\n *\n * @param body Text body of the response from the batch request\n */\n ODataBatch.prototype._parseResponse = function (body) {\n return new Promise(function (resolve, reject) {\n var responses = [];\n var header = \"--batchresponse_\";\n // Ex. \"HTTP/1.1 500 Internal Server Error\"\n var statusRegExp = new RegExp(\"^HTTP/[0-9.]+ +([0-9]+) +(.*)\", \"i\");\n var lines = body.split(\"\\n\");\n var state = \"batch\";\n var status;\n var statusText;\n for (var i = 0; i < lines.length; ++i) {\n var line = lines[i];\n switch (state) {\n case \"batch\":\n if (line.substr(0, header.length) === header) {\n state = \"batchHeaders\";\n }\n else {\n if (line.trim() !== \"\") {\n throw new exceptions_1.BatchParseException(\"Invalid response, line \" + i);\n }\n }\n break;\n case \"batchHeaders\":\n if (line.trim() === \"\") {\n state = \"status\";\n }\n break;\n case \"status\":\n var parts = statusRegExp.exec(line);\n if (parts.length !== 3) {\n throw new exceptions_1.BatchParseException(\"Invalid status, line \" + i);\n }\n status = parseInt(parts[1], 10);\n statusText = parts[2];\n state = \"statusHeaders\";\n break;\n case \"statusHeaders\":\n if (line.trim() === \"\") {\n state = \"body\";\n }\n break;\n case \"body\":\n responses.push((status === 204) ? new Response() : new Response(line, { status: status, statusText: statusText }));\n state = \"batch\";\n break;\n }\n }\n if (state !== \"status\") {\n reject(new exceptions_1.BatchParseException(\"Unexpected end of input\"));\n }\n resolve(responses);\n });\n };\n return ODataBatch;\n}());\nexports.ODataBatch = ODataBatch;\nvar TextFileParser = (function () {\n function TextFileParser() {\n }\n TextFileParser.prototype.parse = function (r) {\n return r.text();\n };\n return TextFileParser;\n}());\nexports.TextFileParser = TextFileParser;\nvar BlobFileParser = (function () {\n function BlobFileParser() {\n }\n BlobFileParser.prototype.parse = function (r) {\n return r.blob();\n };\n return BlobFileParser;\n}());\nexports.BlobFileParser = BlobFileParser;\nvar JSONFileParser = (function () {\n function JSONFileParser() {\n }\n JSONFileParser.prototype.parse = function (r) {\n return r.json();\n };\n return JSONFileParser;\n}());\nexports.JSONFileParser = JSONFileParser;\nvar BufferFileParser = (function () {\n function BufferFileParser() {\n }\n BufferFileParser.prototype.parse = function (r) {\n if (util_1.Util.isFunction(r.arrayBuffer)) {\n return r.arrayBuffer();\n }\n return r.buffer();\n };\n return BufferFileParser;\n}());\nexports.BufferFileParser = BufferFileParser;\n\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar logging_1 = __webpack_require__(5);\nfunction defaultLog(error) {\n logging_1.Logger.log({ data: {}, level: logging_1.LogLevel.Error, message: \"[\" + error.name + \"]::\" + error.message });\n}\n/**\n * Represents an exception with an HttpClient request\n *\n */\nvar ProcessHttpClientResponseException = (function (_super) {\n __extends(ProcessHttpClientResponseException, _super);\n function ProcessHttpClientResponseException(status, statusText, data) {\n var _this = _super.call(this, \"Error making HttpClient request in queryable: [\" + status + \"] \" + statusText) || this;\n _this.status = status;\n _this.statusText = statusText;\n _this.data = data;\n _this.name = \"ProcessHttpClientResponseException\";\n logging_1.Logger.log({ data: _this.data, level: logging_1.LogLevel.Error, message: _this.message });\n return _this;\n }\n return ProcessHttpClientResponseException;\n}(Error));\nexports.ProcessHttpClientResponseException = ProcessHttpClientResponseException;\nvar NoCacheAvailableException = (function (_super) {\n __extends(NoCacheAvailableException, _super);\n function NoCacheAvailableException(msg) {\n if (msg === void 0) { msg = \"Cannot create a caching configuration provider since cache is not available.\"; }\n var _this = _super.call(this, msg) || this;\n _this.name = \"NoCacheAvailableException\";\n defaultLog(_this);\n return _this;\n }\n return NoCacheAvailableException;\n}(Error));\nexports.NoCacheAvailableException = NoCacheAvailableException;\nvar APIUrlException = (function (_super) {\n __extends(APIUrlException, _super);\n function APIUrlException(msg) {\n if (msg === void 0) { msg = \"Unable to determine API url.\"; }\n var _this = _super.call(this, msg) || this;\n _this.name = \"APIUrlException\";\n defaultLog(_this);\n return _this;\n }\n return APIUrlException;\n}(Error));\nexports.APIUrlException = APIUrlException;\nvar AuthUrlException = (function (_super) {\n __extends(AuthUrlException, _super);\n function AuthUrlException(data, msg) {\n if (msg === void 0) { msg = \"Auth URL Endpoint could not be determined from data. Data logged.\"; }\n var _this = _super.call(this, msg) || this;\n _this.name = \"APIUrlException\";\n logging_1.Logger.log({ data: data, level: logging_1.LogLevel.Error, message: _this.message });\n return _this;\n }\n return AuthUrlException;\n}(Error));\nexports.AuthUrlException = AuthUrlException;\nvar NodeFetchClientUnsupportedException = (function (_super) {\n __extends(NodeFetchClientUnsupportedException, _super);\n function NodeFetchClientUnsupportedException(msg) {\n if (msg === void 0) { msg = \"Using NodeFetchClient in the browser is not supported.\"; }\n var _this = _super.call(this, msg) || this;\n _this.name = \"NodeFetchClientUnsupportedException\";\n defaultLog(_this);\n return _this;\n }\n return NodeFetchClientUnsupportedException;\n}(Error));\nexports.NodeFetchClientUnsupportedException = NodeFetchClientUnsupportedException;\nvar SPRequestExecutorUndefinedException = (function (_super) {\n __extends(SPRequestExecutorUndefinedException, _super);\n function SPRequestExecutorUndefinedException() {\n var _this = this;\n var msg = [\n \"SP.RequestExecutor is undefined. \",\n \"Load the SP.RequestExecutor.js library (/_layouts/15/SP.RequestExecutor.js) before loading the PnP JS Core library.\",\n ].join(\" \");\n _this = _super.call(this, msg) || this;\n _this.name = \"SPRequestExecutorUndefinedException\";\n defaultLog(_this);\n return _this;\n }\n return SPRequestExecutorUndefinedException;\n}(Error));\nexports.SPRequestExecutorUndefinedException = SPRequestExecutorUndefinedException;\nvar MaxCommentLengthException = (function (_super) {\n __extends(MaxCommentLengthException, _super);\n function MaxCommentLengthException(msg) {\n if (msg === void 0) { msg = \"The maximum comment length is 1023 characters.\"; }\n var _this = _super.call(this, msg) || this;\n _this.name = \"MaxCommentLengthException\";\n defaultLog(_this);\n return _this;\n }\n return MaxCommentLengthException;\n}(Error));\nexports.MaxCommentLengthException = MaxCommentLengthException;\nvar NotSupportedInBatchException = (function (_super) {\n __extends(NotSupportedInBatchException, _super);\n function NotSupportedInBatchException(operation) {\n if (operation === void 0) { operation = \"This operation\"; }\n var _this = _super.call(this, operation + \" is not supported as part of a batch.\") || this;\n _this.name = \"NotSupportedInBatchException\";\n defaultLog(_this);\n return _this;\n }\n return NotSupportedInBatchException;\n}(Error));\nexports.NotSupportedInBatchException = NotSupportedInBatchException;\nvar ODataIdException = (function (_super) {\n __extends(ODataIdException, _super);\n function ODataIdException(data, msg) {\n if (msg === void 0) { msg = \"Could not extract odata id in object, you may be using nometadata. Object data logged to logger.\"; }\n var _this = _super.call(this, msg) || this;\n _this.name = \"ODataIdException\";\n logging_1.Logger.log({ data: data, level: logging_1.LogLevel.Error, message: _this.message });\n return _this;\n }\n return ODataIdException;\n}(Error));\nexports.ODataIdException = ODataIdException;\nvar BatchParseException = (function (_super) {\n __extends(BatchParseException, _super);\n function BatchParseException(msg) {\n var _this = _super.call(this, msg) || this;\n _this.name = \"BatchParseException\";\n defaultLog(_this);\n return _this;\n }\n return BatchParseException;\n}(Error));\nexports.BatchParseException = BatchParseException;\nvar AlreadyInBatchException = (function (_super) {\n __extends(AlreadyInBatchException, _super);\n function AlreadyInBatchException(msg) {\n if (msg === void 0) { msg = \"This query is already part of a batch.\"; }\n var _this = _super.call(this, msg) || this;\n _this.name = \"AlreadyInBatchException\";\n defaultLog(_this);\n return _this;\n }\n return AlreadyInBatchException;\n}(Error));\nexports.AlreadyInBatchException = AlreadyInBatchException;\nvar FunctionExpectedException = (function (_super) {\n __extends(FunctionExpectedException, _super);\n function FunctionExpectedException(msg) {\n if (msg === void 0) { msg = \"This query is already part of a batch.\"; }\n var _this = _super.call(this, msg) || this;\n _this.name = \"FunctionExpectedException\";\n defaultLog(_this);\n return _this;\n }\n return FunctionExpectedException;\n}(Error));\nexports.FunctionExpectedException = FunctionExpectedException;\nvar UrlException = (function (_super) {\n __extends(UrlException, _super);\n function UrlException(msg) {\n var _this = _super.call(this, msg) || this;\n _this.name = \"UrlException\";\n defaultLog(_this);\n return _this;\n }\n return UrlException;\n}(Error));\nexports.UrlException = UrlException;\n\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar fetchclient_1 = __webpack_require__(21);\nvar RuntimeConfigImpl = (function () {\n function RuntimeConfigImpl() {\n // these are our default values for the library\n this._headers = null;\n this._defaultCachingStore = \"session\";\n this._defaultCachingTimeoutSeconds = 60;\n this._globalCacheDisable = false;\n this._fetchClientFactory = function () { return new fetchclient_1.FetchClient(); };\n this._baseUrl = null;\n this._spfxContext = null;\n }\n RuntimeConfigImpl.prototype.set = function (config) {\n if (config.hasOwnProperty(\"headers\")) {\n this._headers = config.headers;\n }\n if (config.hasOwnProperty(\"globalCacheDisable\")) {\n this._globalCacheDisable = config.globalCacheDisable;\n }\n if (config.hasOwnProperty(\"defaultCachingStore\")) {\n this._defaultCachingStore = config.defaultCachingStore;\n }\n if (config.hasOwnProperty(\"defaultCachingTimeoutSeconds\")) {\n this._defaultCachingTimeoutSeconds = config.defaultCachingTimeoutSeconds;\n }\n if (config.hasOwnProperty(\"fetchClientFactory\")) {\n this._fetchClientFactory = config.fetchClientFactory;\n }\n if (config.hasOwnProperty(\"baseUrl\")) {\n this._baseUrl = config.baseUrl;\n }\n if (config.hasOwnProperty(\"spFXContext\")) {\n this._spfxContext = config.spfxContext;\n }\n };\n Object.defineProperty(RuntimeConfigImpl.prototype, \"headers\", {\n get: function () {\n return this._headers;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RuntimeConfigImpl.prototype, \"defaultCachingStore\", {\n get: function () {\n return this._defaultCachingStore;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RuntimeConfigImpl.prototype, \"defaultCachingTimeoutSeconds\", {\n get: function () {\n return this._defaultCachingTimeoutSeconds;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RuntimeConfigImpl.prototype, \"globalCacheDisable\", {\n get: function () {\n return this._globalCacheDisable;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RuntimeConfigImpl.prototype, \"fetchClientFactory\", {\n get: function () {\n return this._fetchClientFactory;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RuntimeConfigImpl.prototype, \"baseUrl\", {\n get: function () {\n if (this._baseUrl !== null) {\n return this._baseUrl;\n }\n else if (this._spfxContext !== null) {\n return this._spfxContext.pageContext.web.absoluteUrl;\n }\n return null;\n },\n enumerable: true,\n configurable: true\n });\n return RuntimeConfigImpl;\n}());\nexports.RuntimeConfigImpl = RuntimeConfigImpl;\nvar _runtimeConfig = new RuntimeConfigImpl();\nexports.RuntimeConfig = _runtimeConfig;\nfunction setRuntimeConfig(config) {\n _runtimeConfig.set(config);\n}\nexports.setRuntimeConfig = setRuntimeConfig;\n\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * A set of logging levels\n *\n */\nvar LogLevel;\n(function (LogLevel) {\n LogLevel[LogLevel[\"Verbose\"] = 0] = \"Verbose\";\n LogLevel[LogLevel[\"Info\"] = 1] = \"Info\";\n LogLevel[LogLevel[\"Warning\"] = 2] = \"Warning\";\n LogLevel[LogLevel[\"Error\"] = 3] = \"Error\";\n LogLevel[LogLevel[\"Off\"] = 99] = \"Off\";\n})(LogLevel = exports.LogLevel || (exports.LogLevel = {}));\n/**\n * Class used to subscribe ILogListener and log messages throughout an application\n *\n */\nvar Logger = (function () {\n function Logger() {\n }\n Object.defineProperty(Logger, \"activeLogLevel\", {\n get: function () {\n return Logger.instance.activeLogLevel;\n },\n set: function (value) {\n Logger.instance.activeLogLevel = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Logger, \"instance\", {\n get: function () {\n if (typeof Logger._instance === \"undefined\" || Logger._instance === null) {\n Logger._instance = new LoggerImpl();\n }\n return Logger._instance;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Adds ILogListener instances to the set of subscribed listeners\n *\n * @param listeners One or more listeners to subscribe to this log\n */\n Logger.subscribe = function () {\n var listeners = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n listeners[_i] = arguments[_i];\n }\n listeners.map(function (listener) { return Logger.instance.subscribe(listener); });\n };\n /**\n * Clears the subscribers collection, returning the collection before modifiction\n */\n Logger.clearSubscribers = function () {\n return Logger.instance.clearSubscribers();\n };\n Object.defineProperty(Logger, \"count\", {\n /**\n * Gets the current subscriber count\n */\n get: function () {\n return Logger.instance.count;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Writes the supplied string to the subscribed listeners\n *\n * @param message The message to write\n * @param level [Optional] if supplied will be used as the level of the entry (Default: LogLevel.Verbose)\n */\n Logger.write = function (message, level) {\n if (level === void 0) { level = LogLevel.Verbose; }\n Logger.instance.log({ level: level, message: message });\n };\n /**\n * Writes the supplied string to the subscribed listeners\n *\n * @param json The json object to stringify and write\n * @param level [Optional] if supplied will be used as the level of the entry (Default: LogLevel.Verbose)\n */\n Logger.writeJSON = function (json, level) {\n if (level === void 0) { level = LogLevel.Verbose; }\n Logger.instance.log({ level: level, message: JSON.stringify(json) });\n };\n /**\n * Logs the supplied entry to the subscribed listeners\n *\n * @param entry The message to log\n */\n Logger.log = function (entry) {\n Logger.instance.log(entry);\n };\n /**\n * Logs performance tracking data for the the execution duration of the supplied function using console.profile\n *\n * @param name The name of this profile boundary\n * @param f The function to execute and track within this performance boundary\n */\n Logger.measure = function (name, f) {\n return Logger.instance.measure(name, f);\n };\n return Logger;\n}());\nexports.Logger = Logger;\nvar LoggerImpl = (function () {\n function LoggerImpl(activeLogLevel, subscribers) {\n if (activeLogLevel === void 0) { activeLogLevel = LogLevel.Warning; }\n if (subscribers === void 0) { subscribers = []; }\n this.activeLogLevel = activeLogLevel;\n this.subscribers = subscribers;\n }\n LoggerImpl.prototype.subscribe = function (listener) {\n this.subscribers.push(listener);\n };\n LoggerImpl.prototype.clearSubscribers = function () {\n var s = this.subscribers.slice(0);\n this.subscribers.length = 0;\n return s;\n };\n Object.defineProperty(LoggerImpl.prototype, \"count\", {\n get: function () {\n return this.subscribers.length;\n },\n enumerable: true,\n configurable: true\n });\n LoggerImpl.prototype.write = function (message, level) {\n if (level === void 0) { level = LogLevel.Verbose; }\n this.log({ level: level, message: message });\n };\n LoggerImpl.prototype.log = function (entry) {\n if (typeof entry === \"undefined\" || entry.level < this.activeLogLevel) {\n return;\n }\n this.subscribers.map(function (subscriber) { return subscriber.log(entry); });\n };\n LoggerImpl.prototype.measure = function (name, f) {\n console.profile(name);\n try {\n return f();\n }\n finally {\n console.profileEnd();\n }\n };\n return LoggerImpl;\n}());\n/**\n * Implementation of ILogListener which logs to the browser console\n *\n */\nvar ConsoleListener = (function () {\n function ConsoleListener() {\n }\n /**\n * Any associated data that a given logging listener may choose to log or ignore\n *\n * @param entry The information to be logged\n */\n ConsoleListener.prototype.log = function (entry) {\n var msg = this.format(entry);\n switch (entry.level) {\n case LogLevel.Verbose:\n case LogLevel.Info:\n console.log(msg);\n break;\n case LogLevel.Warning:\n console.warn(msg);\n break;\n case LogLevel.Error:\n console.error(msg);\n break;\n }\n };\n /**\n * Formats the message\n *\n * @param entry The information to format into a string\n */\n ConsoleListener.prototype.format = function (entry) {\n return \"Message: \" + entry.message + \" Data: \" + JSON.stringify(entry.data);\n };\n return ConsoleListener;\n}());\nexports.ConsoleListener = ConsoleListener;\n/**\n * Implementation of ILogListener which logs to the supplied function\n *\n */\nvar FunctionListener = (function () {\n /**\n * Creates a new instance of the FunctionListener class\n *\n * @constructor\n * @param method The method to which any logging data will be passed\n */\n function FunctionListener(method) {\n this.method = method;\n }\n /**\n * Any associated data that a given logging listener may choose to log or ignore\n *\n * @param entry The information to be logged\n */\n FunctionListener.prototype.log = function (entry) {\n this.method(entry);\n };\n return FunctionListener;\n}());\nexports.FunctionListener = FunctionListener;\n\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Generic dictionary\n */\nvar Dictionary = (function () {\n /**\n * Creates a new instance of the Dictionary class\n *\n * @constructor\n */\n function Dictionary(keys, values) {\n if (keys === void 0) { keys = []; }\n if (values === void 0) { values = []; }\n this.keys = keys;\n this.values = values;\n }\n /**\n * Gets a value from the collection using the specified key\n *\n * @param key The key whose value we want to return, returns null if the key does not exist\n */\n Dictionary.prototype.get = function (key) {\n var index = this.keys.indexOf(key);\n if (index < 0) {\n return null;\n }\n return this.values[index];\n };\n /**\n * Adds the supplied key and value to the dictionary\n *\n * @param key The key to add\n * @param o The value to add\n */\n Dictionary.prototype.add = function (key, o) {\n var index = this.keys.indexOf(key);\n if (index > -1) {\n this.values[index] = o;\n }\n else {\n this.keys.push(key);\n this.values.push(o);\n }\n };\n /**\n * Merges the supplied typed hash into this dictionary instance. Existing values are updated and new ones are created as appropriate.\n */\n Dictionary.prototype.merge = function (source) {\n var _this = this;\n if (\"getKeys\" in source) {\n var sourceAsDictionary_1 = source;\n sourceAsDictionary_1.getKeys().map(function (key) {\n _this.add(key, sourceAsDictionary_1.get(key));\n });\n }\n else {\n var sourceAsHash = source;\n for (var key in sourceAsHash) {\n if (sourceAsHash.hasOwnProperty(key)) {\n this.add(key, sourceAsHash[key]);\n }\n }\n }\n };\n /**\n * Removes a value from the dictionary\n *\n * @param key The key of the key/value pair to remove. Returns null if the key was not found.\n */\n Dictionary.prototype.remove = function (key) {\n var index = this.keys.indexOf(key);\n if (index < 0) {\n return null;\n }\n var val = this.values[index];\n this.keys.splice(index, 1);\n this.values.splice(index, 1);\n return val;\n };\n /**\n * Returns all the keys currently in the dictionary as an array\n */\n Dictionary.prototype.getKeys = function () {\n return this.keys;\n };\n /**\n * Returns all the values currently in the dictionary as an array\n */\n Dictionary.prototype.getValues = function () {\n return this.values;\n };\n /**\n * Clears the current dictionary\n */\n Dictionary.prototype.clear = function () {\n this.keys = [];\n this.values = [];\n };\n /**\n * Gets a count of the items currently in the dictionary\n */\n Dictionary.prototype.count = function () {\n return this.keys.length;\n };\n return Dictionary;\n}());\nexports.Dictionary = Dictionary;\n\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar queryable_1 = __webpack_require__(1);\nvar lists_1 = __webpack_require__(11);\nvar fields_1 = __webpack_require__(24);\nvar navigation_1 = __webpack_require__(25);\nvar sitegroups_1 = __webpack_require__(18);\nvar contenttypes_1 = __webpack_require__(16);\nvar folders_1 = __webpack_require__(9);\nvar roles_1 = __webpack_require__(17);\nvar files_1 = __webpack_require__(8);\nvar util_1 = __webpack_require__(0);\nvar lists_2 = __webpack_require__(11);\nvar siteusers_1 = __webpack_require__(30);\nvar usercustomactions_1 = __webpack_require__(19);\nvar odata_1 = __webpack_require__(2);\nvar features_1 = __webpack_require__(23);\nvar decorators_1 = __webpack_require__(31);\nvar queryableshareable_1 = __webpack_require__(12);\nvar relateditems_1 = __webpack_require__(46);\nvar Webs = (function (_super) {\n __extends(Webs, _super);\n function Webs(baseUrl, webPath) {\n if (webPath === void 0) { webPath = \"webs\"; }\n return _super.call(this, baseUrl, webPath) || this;\n }\n /**\n * Adds a new web to the collection\n *\n * @param title The new web's title\n * @param url The new web's relative url\n * @param description The web web's description\n * @param template The web's template\n * @param language The language code to use for this web\n * @param inheritPermissions If true permissions will be inherited from the partent web\n * @param additionalSettings Will be passed as part of the web creation body\n */\n Webs.prototype.add = function (title, url, description, template, language, inheritPermissions, additionalSettings) {\n if (description === void 0) { description = \"\"; }\n if (template === void 0) { template = \"STS\"; }\n if (language === void 0) { language = 1033; }\n if (inheritPermissions === void 0) { inheritPermissions = true; }\n if (additionalSettings === void 0) { additionalSettings = {}; }\n var props = util_1.Util.extend({\n Description: description,\n Language: language,\n Title: title,\n Url: url,\n UseSamePermissionsAsParentSite: inheritPermissions,\n WebTemplate: template,\n }, additionalSettings);\n var postBody = JSON.stringify({\n \"parameters\": util_1.Util.extend({\n \"__metadata\": { \"type\": \"SP.WebCreationInformation\" },\n }, props),\n });\n return this.clone(Webs, \"add\", true).post({ body: postBody }).then(function (data) {\n return {\n data: data,\n web: new Web(odata_1.extractOdataId(data).replace(/_api\\/web\\/?/i, \"\")),\n };\n });\n };\n return Webs;\n}(queryable_1.QueryableCollection));\nexports.Webs = Webs;\n/**\n * Describes a web\n *\n */\nvar Web = (function (_super) {\n __extends(Web, _super);\n function Web(baseUrl, path) {\n if (path === void 0) { path = \"_api/web\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * Creates a new web instance from the given url by indexing the location of the /_api/\n * segment. If this is not found the method creates a new web with the entire string as\n * supplied.\n *\n * @param url\n */\n Web.fromUrl = function (url, path) {\n if (url === null) {\n return new Web(\"\");\n }\n var index = url.indexOf(\"_api/\");\n if (index > -1) {\n return new Web(url.substr(0, index), path);\n }\n return new Web(url, path);\n };\n Object.defineProperty(Web.prototype, \"webs\", {\n get: function () {\n return new Webs(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"contentTypes\", {\n /**\n * Get the content types available in this web\n *\n */\n get: function () {\n return new contenttypes_1.ContentTypes(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"lists\", {\n /**\n * Get the lists in this web\n *\n */\n get: function () {\n return new lists_1.Lists(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"fields\", {\n /**\n * Gets the fields in this web\n *\n */\n get: function () {\n return new fields_1.Fields(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"features\", {\n /**\n * Gets the active features for this web\n *\n */\n get: function () {\n return new features_1.Features(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"availablefields\", {\n /**\n * Gets the available fields in this web\n *\n */\n get: function () {\n return new fields_1.Fields(this, \"availablefields\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"navigation\", {\n /**\n * Get the navigation options in this web\n *\n */\n get: function () {\n return new navigation_1.Navigation(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"siteUsers\", {\n /**\n * Gets the site users\n *\n */\n get: function () {\n return new siteusers_1.SiteUsers(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"siteGroups\", {\n /**\n * Gets the site groups\n *\n */\n get: function () {\n return new sitegroups_1.SiteGroups(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"currentUser\", {\n /**\n * Gets the current user\n */\n get: function () {\n return new siteusers_1.CurrentUser(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"folders\", {\n /**\n * Get the folders in this web\n *\n */\n get: function () {\n return new folders_1.Folders(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"userCustomActions\", {\n /**\n * Get all custom actions on a site\n *\n */\n get: function () {\n return new usercustomactions_1.UserCustomActions(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"roleDefinitions\", {\n /**\n * Gets the collection of RoleDefinition resources.\n *\n */\n get: function () {\n return new roles_1.RoleDefinitions(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"relatedItems\", {\n /**\n * Provides an interface to manage related items\n *\n */\n get: function () {\n return relateditems_1.RelatedItemManagerImpl.FromUrl(this.toUrl());\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Creates a new batch for requests within the context of context this web\n *\n */\n Web.prototype.createBatch = function () {\n return new odata_1.ODataBatch(this.parentUrl);\n };\n Object.defineProperty(Web.prototype, \"rootFolder\", {\n /**\n * The root folder of the web\n */\n get: function () {\n return new folders_1.Folder(this, \"rootFolder\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"associatedOwnerGroup\", {\n get: function () {\n return new sitegroups_1.SiteGroup(this, \"associatedownergroup\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"associatedMemberGroup\", {\n get: function () {\n return new sitegroups_1.SiteGroup(this, \"associatedmembergroup\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"associatedVisitorGroup\", {\n get: function () {\n return new sitegroups_1.SiteGroup(this, \"associatedvisitorgroup\");\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Get a folder by server relative url\n *\n * @param folderRelativeUrl the server relative path to the folder (including /sites/ if applicable)\n */\n Web.prototype.getFolderByServerRelativeUrl = function (folderRelativeUrl) {\n return new folders_1.Folder(this, \"getFolderByServerRelativeUrl('\" + folderRelativeUrl + \"')\");\n };\n /**\n * Get a file by server relative url\n *\n * @param fileRelativeUrl the server relative path to the file (including /sites/ if applicable)\n */\n Web.prototype.getFileByServerRelativeUrl = function (fileRelativeUrl) {\n return new files_1.File(this, \"getFileByServerRelativeUrl('\" + fileRelativeUrl + \"')\");\n };\n /**\n * Get a list by server relative url (list's root folder)\n *\n * @param listRelativeUrl the server relative path to the list's root folder (including /sites/ if applicable)\n */\n Web.prototype.getList = function (listRelativeUrl) {\n return new lists_2.List(this, \"getList('\" + listRelativeUrl + \"')\");\n };\n /**\n * Updates this web intance with the supplied properties\n *\n * @param properties A plain object hash of values to update for the web\n */\n Web.prototype.update = function (properties) {\n var _this = this;\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": \"SP.Web\" },\n }, properties));\n return this.post({\n body: postBody,\n headers: {\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n return {\n data: data,\n web: _this,\n };\n });\n };\n /**\n * Delete this web\n *\n */\n Web.prototype.delete = function () {\n return _super.prototype.delete.call(this);\n };\n /**\n * Applies the theme specified by the contents of each of the files specified in the arguments to the site.\n *\n * @param colorPaletteUrl Server-relative URL of the color palette file.\n * @param fontSchemeUrl Server-relative URL of the font scheme.\n * @param backgroundImageUrl Server-relative URL of the background image.\n * @param shareGenerated true to store the generated theme files in the root site, or false to store them in this site.\n */\n Web.prototype.applyTheme = function (colorPaletteUrl, fontSchemeUrl, backgroundImageUrl, shareGenerated) {\n var postBody = JSON.stringify({\n backgroundImageUrl: backgroundImageUrl,\n colorPaletteUrl: colorPaletteUrl,\n fontSchemeUrl: fontSchemeUrl,\n shareGenerated: shareGenerated,\n });\n return this.clone(Web, \"applytheme\", true).post({ body: postBody });\n };\n /**\n * Applies the specified site definition or site template to the Web site that has no template applied to it.\n *\n * @param template Name of the site definition or the name of the site template\n */\n Web.prototype.applyWebTemplate = function (template) {\n var q = this.clone(Web, \"applywebtemplate\", true);\n q.concat(\"(@t)\");\n q.query.add(\"@t\", template);\n return q.post();\n };\n /**\n * Returns whether the current user has the given set of permissions.\n *\n * @param perms The high and low permission range.\n */\n Web.prototype.doesUserHavePermissions = function (perms) {\n var q = this.clone(Web, \"doesuserhavepermissions\", true);\n q.concat(\"(@p)\");\n q.query.add(\"@p\", JSON.stringify(perms));\n return q.get();\n };\n /**\n * Checks whether the specified login name belongs to a valid user in the site. If the user doesn't exist, adds the user to the site.\n *\n * @param loginName The login name of the user (ex: i:0#.f|membership|user@domain.onmicrosoft.com)\n */\n Web.prototype.ensureUser = function (loginName) {\n var postBody = JSON.stringify({\n logonName: loginName,\n });\n return this.clone(Web, \"ensureuser\", true).post({ body: postBody }).then(function (data) {\n return {\n data: data,\n user: new siteusers_1.SiteUser(odata_1.extractOdataId(data)),\n };\n });\n };\n /**\n * Returns a collection of site templates available for the site.\n *\n * @param language The LCID of the site templates to get.\n * @param true to include language-neutral site templates; otherwise false\n */\n Web.prototype.availableWebTemplates = function (language, includeCrossLanugage) {\n if (language === void 0) { language = 1033; }\n if (includeCrossLanugage === void 0) { includeCrossLanugage = true; }\n return new queryable_1.QueryableCollection(this, \"getavailablewebtemplates(lcid=\" + language + \", doincludecrosslanguage=\" + includeCrossLanugage + \")\");\n };\n /**\n * Returns the list gallery on the site.\n *\n * @param type The gallery type - WebTemplateCatalog = 111, WebPartCatalog = 113 ListTemplateCatalog = 114,\n * MasterPageCatalog = 116, SolutionCatalog = 121, ThemeCatalog = 123, DesignCatalog = 124, AppDataCatalog = 125\n */\n Web.prototype.getCatalog = function (type) {\n return this.clone(Web, \"getcatalog(\" + type + \")\", true).select(\"Id\").get().then(function (data) {\n return new lists_2.List(odata_1.extractOdataId(data));\n });\n };\n /**\n * Returns the collection of changes from the change log that have occurred within the list, based on the specified query.\n */\n Web.prototype.getChanges = function (query) {\n var postBody = JSON.stringify({ \"query\": util_1.Util.extend({ \"__metadata\": { \"type\": \"SP.ChangeQuery\" } }, query) });\n return this.clone(Web, \"getchanges\", true).post({ body: postBody });\n };\n Object.defineProperty(Web.prototype, \"customListTemplate\", {\n /**\n * Gets the custom list templates for the site.\n *\n */\n get: function () {\n return new queryable_1.QueryableCollection(this, \"getcustomlisttemplates\");\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Returns the user corresponding to the specified member identifier for the current site.\n *\n * @param id The ID of the user.\n */\n Web.prototype.getUserById = function (id) {\n return new siteusers_1.SiteUser(this, \"getUserById(\" + id + \")\");\n };\n /**\n * Returns the name of the image file for the icon that is used to represent the specified file.\n *\n * @param filename The file name. If this parameter is empty, the server returns an empty string.\n * @param size The size of the icon: 16x16 pixels = 0, 32x32 pixels = 1.\n * @param progId The ProgID of the application that was used to create the file, in the form OLEServerName.ObjectName\n */\n Web.prototype.mapToIcon = function (filename, size, progId) {\n if (size === void 0) { size = 0; }\n if (progId === void 0) { progId = \"\"; }\n return this.clone(Web, \"maptoicon(filename='\" + filename + \"', progid='\" + progId + \"', size=\" + size + \")\", true).get();\n };\n return Web;\n}(queryableshareable_1.QueryableShareableWeb));\n__decorate([\n decorators_1.deprecated(\"This method will be removed in future releases. Please use the methods found in queryable securable.\")\n], Web.prototype, \"doesUserHavePermissions\", null);\nexports.Web = Web;\n\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar queryable_1 = __webpack_require__(1);\nvar odata_1 = __webpack_require__(2);\nvar util_1 = __webpack_require__(0);\nvar exceptions_1 = __webpack_require__(3);\nvar webparts_1 = __webpack_require__(50);\nvar items_1 = __webpack_require__(10);\nvar queryableshareable_1 = __webpack_require__(12);\nvar odata_2 = __webpack_require__(2);\n/**\n * Describes a collection of File objects\n *\n */\nvar Files = (function (_super) {\n __extends(Files, _super);\n /**\n * Creates a new instance of the Files class\n *\n * @param baseUrl The url or Queryable which forms the parent of this fields collection\n */\n function Files(baseUrl, path) {\n if (path === void 0) { path = \"files\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * Gets a File by filename\n *\n * @param name The name of the file, including extension.\n */\n Files.prototype.getByName = function (name) {\n var f = new File(this);\n f.concat(\"('\" + name + \"')\");\n return f;\n };\n /**\n * Uploads a file. Not supported for batching\n *\n * @param url The folder-relative url of the file.\n * @param content The file contents blob.\n * @param shouldOverWrite Should a file with the same name in the same location be overwritten? (default: true)\n * @returns The new File and the raw response.\n */\n Files.prototype.add = function (url, content, shouldOverWrite) {\n var _this = this;\n if (shouldOverWrite === void 0) { shouldOverWrite = true; }\n return new Files(this, \"add(overwrite=\" + shouldOverWrite + \",url='\" + url + \"')\")\n .post({\n body: content,\n }).then(function (response) {\n return {\n data: response,\n file: _this.getByName(url),\n };\n });\n };\n /**\n * Uploads a file. Not supported for batching\n *\n * @param url The folder-relative url of the file.\n * @param content The Blob file content to add\n * @param progress A callback function which can be used to track the progress of the upload\n * @param shouldOverWrite Should a file with the same name in the same location be overwritten? (default: true)\n * @param chunkSize The size of each file slice, in bytes (default: 10485760)\n * @returns The new File and the raw response.\n */\n Files.prototype.addChunked = function (url, content, progress, shouldOverWrite, chunkSize) {\n var _this = this;\n if (shouldOverWrite === void 0) { shouldOverWrite = true; }\n if (chunkSize === void 0) { chunkSize = 10485760; }\n var adder = this.clone(Files, \"add(overwrite=\" + shouldOverWrite + \",url='\" + url + \"')\");\n return adder.post().then(function () { return _this.getByName(url); }).then(function (file) { return file.setContentChunked(content, progress, chunkSize); }).then(function (response) {\n return {\n data: response,\n file: _this.getByName(url),\n };\n });\n };\n /**\n * Adds a ghosted file to an existing list or document library. Not supported for batching.\n *\n * @param fileUrl The server-relative url where you want to save the file.\n * @param templateFileType The type of use to create the file.\n * @returns The template file that was added and the raw response.\n */\n Files.prototype.addTemplateFile = function (fileUrl, templateFileType) {\n var _this = this;\n return this.clone(Files, \"addTemplateFile(urloffile='\" + fileUrl + \"',templatefiletype=\" + templateFileType + \")\")\n .post().then(function (response) {\n return {\n data: response,\n file: _this.getByName(fileUrl),\n };\n });\n };\n return Files;\n}(queryable_1.QueryableCollection));\nexports.Files = Files;\n/**\n * Describes a single File instance\n *\n */\nvar File = (function (_super) {\n __extends(File, _super);\n function File() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(File.prototype, \"listItemAllFields\", {\n /**\n * Gets a value that specifies the list item field values for the list item corresponding to the file.\n *\n */\n get: function () {\n return new queryable_1.QueryableCollection(this, \"listItemAllFields\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(File.prototype, \"versions\", {\n /**\n * Gets a collection of versions\n *\n */\n get: function () {\n return new Versions(this);\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Approves the file submitted for content approval with the specified comment.\n * Only documents in lists that are enabled for content approval can be approved.\n *\n * @param comment The comment for the approval.\n */\n File.prototype.approve = function (comment) {\n return this.clone(File, \"approve(comment='\" + comment + \"')\", true).post();\n };\n /**\n * Stops the chunk upload session without saving the uploaded data. Does not support batching.\n * If the file doesn’t already exist in the library, the partially uploaded file will be deleted.\n * Use this in response to user action (as in a request to cancel an upload) or an error or exception.\n * Use the uploadId value that was passed to the StartUpload method that started the upload session.\n * This method is currently available only on Office 365.\n *\n * @param uploadId The unique identifier of the upload session.\n */\n File.prototype.cancelUpload = function (uploadId) {\n return this.clone(File, \"cancelUpload(uploadId=guid'\" + uploadId + \"')\", false).post();\n };\n /**\n * Checks the file in to a document library based on the check-in type.\n *\n * @param comment A comment for the check-in. Its length must be <= 1023.\n * @param checkinType The check-in type for the file.\n */\n File.prototype.checkin = function (comment, checkinType) {\n if (comment === void 0) { comment = \"\"; }\n if (checkinType === void 0) { checkinType = CheckinType.Major; }\n if (comment.length > 1023) {\n throw new exceptions_1.MaxCommentLengthException();\n }\n return this.clone(File, \"checkin(comment='\" + comment + \"',checkintype=\" + checkinType + \")\", true).post();\n };\n /**\n * Checks out the file from a document library.\n */\n File.prototype.checkout = function () {\n return this.clone(File, \"checkout\", true).post();\n };\n /**\n * Copies the file to the destination url.\n *\n * @param url The absolute url or server relative url of the destination file path to copy to.\n * @param shouldOverWrite Should a file with the same name in the same location be overwritten?\n */\n File.prototype.copyTo = function (url, shouldOverWrite) {\n if (shouldOverWrite === void 0) { shouldOverWrite = true; }\n return this.clone(File, \"copyTo(strnewurl='\" + url + \"',boverwrite=\" + shouldOverWrite + \")\", true).post();\n };\n /**\n * Delete this file.\n *\n * @param eTag Value used in the IF-Match header, by default \"*\"\n */\n File.prototype.delete = function (eTag) {\n if (eTag === void 0) { eTag = \"*\"; }\n return this.clone(File, null, true).post({\n headers: {\n \"IF-Match\": eTag,\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n /**\n * Denies approval for a file that was submitted for content approval.\n * Only documents in lists that are enabled for content approval can be denied.\n *\n * @param comment The comment for the denial.\n */\n File.prototype.deny = function (comment) {\n if (comment === void 0) { comment = \"\"; }\n if (comment.length > 1023) {\n throw new exceptions_1.MaxCommentLengthException();\n }\n return this.clone(File, \"deny(comment='\" + comment + \"')\", true).post();\n };\n /**\n * Specifies the control set used to access, modify, or add Web Parts associated with this Web Part Page and view.\n * An exception is thrown if the file is not an ASPX page.\n *\n * @param scope The WebPartsPersonalizationScope view on the Web Parts page.\n */\n File.prototype.getLimitedWebPartManager = function (scope) {\n if (scope === void 0) { scope = WebPartsPersonalizationScope.Shared; }\n return new webparts_1.LimitedWebPartManager(this, \"getLimitedWebPartManager(scope=\" + scope + \")\");\n };\n /**\n * Moves the file to the specified destination url.\n *\n * @param url The absolute url or server relative url of the destination file path to move to.\n * @param moveOperations The bitwise MoveOperations value for how to move the file.\n */\n File.prototype.moveTo = function (url, moveOperations) {\n if (moveOperations === void 0) { moveOperations = MoveOperations.Overwrite; }\n return this.clone(File, \"moveTo(newurl='\" + url + \"',flags=\" + moveOperations + \")\", true).post();\n };\n /**\n * Submits the file for content approval with the specified comment.\n *\n * @param comment The comment for the published file. Its length must be <= 1023.\n */\n File.prototype.publish = function (comment) {\n if (comment === void 0) { comment = \"\"; }\n if (comment.length > 1023) {\n throw new exceptions_1.MaxCommentLengthException();\n }\n return this.clone(File, \"publish(comment='\" + comment + \"')\", true).post();\n };\n /**\n * Moves the file to the Recycle Bin and returns the identifier of the new Recycle Bin item.\n *\n * @returns The GUID of the recycled file.\n */\n File.prototype.recycle = function () {\n return this.clone(File, \"recycle\", true).post();\n };\n /**\n * Reverts an existing checkout for the file.\n *\n */\n File.prototype.undoCheckout = function () {\n return this.clone(File, \"undoCheckout\", true).post();\n };\n /**\n * Removes the file from content approval or unpublish a major version.\n *\n * @param comment The comment for the unpublish operation. Its length must be <= 1023.\n */\n File.prototype.unpublish = function (comment) {\n if (comment === void 0) { comment = \"\"; }\n if (comment.length > 1023) {\n throw new exceptions_1.MaxCommentLengthException();\n }\n return this.clone(File, \"unpublish(comment='\" + comment + \"')\", true).post();\n };\n /**\n * Gets the contents of the file as text. Not supported in batching.\n *\n */\n File.prototype.getText = function () {\n return this.clone(File, \"$value\").get(new odata_1.TextFileParser(), { headers: { \"binaryStringResponseBody\": \"true\" } });\n };\n /**\n * Gets the contents of the file as a blob, does not work in Node.js. Not supported in batching.\n *\n */\n File.prototype.getBlob = function () {\n return this.clone(File, \"$value\").get(new odata_1.BlobFileParser(), { headers: { \"binaryStringResponseBody\": \"true\" } });\n };\n /**\n * Gets the contents of a file as an ArrayBuffer, works in Node.js. Not supported in batching.\n */\n File.prototype.getBuffer = function () {\n return this.clone(File, \"$value\").get(new odata_1.BufferFileParser(), { headers: { \"binaryStringResponseBody\": \"true\" } });\n };\n /**\n * Gets the contents of a file as an ArrayBuffer, works in Node.js. Not supported in batching.\n */\n File.prototype.getJSON = function () {\n return this.clone(File, \"$value\").get(new odata_1.JSONFileParser(), { headers: { \"binaryStringResponseBody\": \"true\" } });\n };\n /**\n * Sets the content of a file, for large files use setContentChunked. Not supported in batching.\n *\n * @param content The file content\n *\n */\n File.prototype.setContent = function (content) {\n var _this = this;\n return this.clone(File, \"$value\").post({\n body: content,\n headers: {\n \"X-HTTP-Method\": \"PUT\",\n },\n }).then(function (_) { return new File(_this); });\n };\n /**\n * Gets the associated list item for this folder, loading the default properties\n */\n File.prototype.getItem = function () {\n var selects = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n selects[_i] = arguments[_i];\n }\n var q = this.listItemAllFields;\n return q.select.apply(q, selects).get().then(function (d) {\n return util_1.Util.extend(new items_1.Item(odata_2.getEntityUrl(d)), d);\n });\n };\n /**\n * Sets the contents of a file using a chunked upload approach. Not supported in batching.\n *\n * @param file The file to upload\n * @param progress A callback function which can be used to track the progress of the upload\n * @param chunkSize The size of each file slice, in bytes (default: 10485760)\n */\n File.prototype.setContentChunked = function (file, progress, chunkSize) {\n if (chunkSize === void 0) { chunkSize = 10485760; }\n if (typeof progress === \"undefined\") {\n progress = function () { return null; };\n }\n var self = this;\n var fileSize = file.size;\n var blockCount = parseInt((file.size / chunkSize).toString(), 10) + ((file.size % chunkSize === 0) ? 1 : 0);\n var uploadId = util_1.Util.getGUID();\n // start the chain with the first fragment\n progress({ blockNumber: 1, chunkSize: chunkSize, currentPointer: 0, fileSize: fileSize, stage: \"starting\", totalBlocks: blockCount });\n var chain = self.startUpload(uploadId, file.slice(0, chunkSize));\n var _loop_1 = function (i) {\n chain = chain.then(function (pointer) {\n progress({ blockNumber: i, chunkSize: chunkSize, currentPointer: pointer, fileSize: fileSize, stage: \"continue\", totalBlocks: blockCount });\n return self.continueUpload(uploadId, pointer, file.slice(pointer, pointer + chunkSize));\n });\n };\n // skip the first and last blocks\n for (var i = 2; i < blockCount; i++) {\n _loop_1(i);\n }\n return chain.then(function (pointer) {\n progress({ blockNumber: blockCount, chunkSize: chunkSize, currentPointer: pointer, fileSize: fileSize, stage: \"finishing\", totalBlocks: blockCount });\n return self.finishUpload(uploadId, pointer, file.slice(pointer));\n }).then(function (_) {\n return self;\n });\n };\n /**\n * Starts a new chunk upload session and uploads the first fragment.\n * The current file content is not changed when this method completes.\n * The method is idempotent (and therefore does not change the result) as long as you use the same values for uploadId and stream.\n * The upload session ends either when you use the CancelUpload method or when you successfully\n * complete the upload session by passing the rest of the file contents through the ContinueUpload and FinishUpload methods.\n * The StartUpload and ContinueUpload methods return the size of the running total of uploaded data in bytes,\n * so you can pass those return values to subsequent uses of ContinueUpload and FinishUpload.\n * This method is currently available only on Office 365.\n *\n * @param uploadId The unique identifier of the upload session.\n * @param fragment The file contents.\n * @returns The size of the total uploaded data in bytes.\n */\n File.prototype.startUpload = function (uploadId, fragment) {\n return this.clone(File, \"startUpload(uploadId=guid'\" + uploadId + \"')\").postAs({ body: fragment }).then(function (n) { return parseFloat(n); });\n };\n /**\n * Continues the chunk upload session with an additional fragment.\n * The current file content is not changed.\n * Use the uploadId value that was passed to the StartUpload method that started the upload session.\n * This method is currently available only on Office 365.\n *\n * @param uploadId The unique identifier of the upload session.\n * @param fileOffset The size of the offset into the file where the fragment starts.\n * @param fragment The file contents.\n * @returns The size of the total uploaded data in bytes.\n */\n File.prototype.continueUpload = function (uploadId, fileOffset, fragment) {\n return this.clone(File, \"continueUpload(uploadId=guid'\" + uploadId + \"',fileOffset=\" + fileOffset + \")\").postAs({ body: fragment }).then(function (n) { return parseFloat(n); });\n };\n /**\n * Uploads the last file fragment and commits the file. The current file content is changed when this method completes.\n * Use the uploadId value that was passed to the StartUpload method that started the upload session.\n * This method is currently available only on Office 365.\n *\n * @param uploadId The unique identifier of the upload session.\n * @param fileOffset The size of the offset into the file where the fragment starts.\n * @param fragment The file contents.\n * @returns The newly uploaded file.\n */\n File.prototype.finishUpload = function (uploadId, fileOffset, fragment) {\n return this.clone(File, \"finishUpload(uploadId=guid'\" + uploadId + \"',fileOffset=\" + fileOffset + \")\")\n .postAs({ body: fragment }).then(function (response) {\n return {\n data: response,\n file: new File(response.ServerRelativeUrl),\n };\n });\n };\n return File;\n}(queryableshareable_1.QueryableShareableFile));\nexports.File = File;\n/**\n * Describes a collection of Version objects\n *\n */\nvar Versions = (function (_super) {\n __extends(Versions, _super);\n /**\n * Creates a new instance of the File class\n *\n * @param baseUrl The url or Queryable which forms the parent of this fields collection\n */\n function Versions(baseUrl, path) {\n if (path === void 0) { path = \"versions\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * Gets a version by id\n *\n * @param versionId The id of the version to retrieve\n */\n Versions.prototype.getById = function (versionId) {\n var v = new Version(this);\n v.concat(\"(\" + versionId + \")\");\n return v;\n };\n /**\n * Deletes all the file version objects in the collection.\n *\n */\n Versions.prototype.deleteAll = function () {\n return new Versions(this, \"deleteAll\").post();\n };\n /**\n * Deletes the specified version of the file.\n *\n * @param versionId The ID of the file version to delete.\n */\n Versions.prototype.deleteById = function (versionId) {\n return this.clone(Versions, \"deleteById(vid=\" + versionId + \")\", true).post();\n };\n /**\n * Deletes the file version object with the specified version label.\n *\n * @param label The version label of the file version to delete, for example: 1.2\n */\n Versions.prototype.deleteByLabel = function (label) {\n return this.clone(Versions, \"deleteByLabel(versionlabel='\" + label + \"')\", true).post();\n };\n /**\n * Creates a new file version from the file specified by the version label.\n *\n * @param label The version label of the file version to restore, for example: 1.2\n */\n Versions.prototype.restoreByLabel = function (label) {\n return this.clone(Versions, \"restoreByLabel(versionlabel='\" + label + \"')\", true).post();\n };\n return Versions;\n}(queryable_1.QueryableCollection));\nexports.Versions = Versions;\n/**\n * Describes a single Version instance\n *\n */\nvar Version = (function (_super) {\n __extends(Version, _super);\n function Version() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Delete a specific version of a file.\n *\n * @param eTag Value used in the IF-Match header, by default \"*\"\n */\n Version.prototype.delete = function (eTag) {\n if (eTag === void 0) { eTag = \"*\"; }\n return this.post({\n headers: {\n \"IF-Match\": eTag,\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n return Version;\n}(queryable_1.QueryableInstance));\nexports.Version = Version;\nvar CheckinType;\n(function (CheckinType) {\n CheckinType[CheckinType[\"Minor\"] = 0] = \"Minor\";\n CheckinType[CheckinType[\"Major\"] = 1] = \"Major\";\n CheckinType[CheckinType[\"Overwrite\"] = 2] = \"Overwrite\";\n})(CheckinType = exports.CheckinType || (exports.CheckinType = {}));\nvar WebPartsPersonalizationScope;\n(function (WebPartsPersonalizationScope) {\n WebPartsPersonalizationScope[WebPartsPersonalizationScope[\"User\"] = 0] = \"User\";\n WebPartsPersonalizationScope[WebPartsPersonalizationScope[\"Shared\"] = 1] = \"Shared\";\n})(WebPartsPersonalizationScope = exports.WebPartsPersonalizationScope || (exports.WebPartsPersonalizationScope = {}));\nvar MoveOperations;\n(function (MoveOperations) {\n MoveOperations[MoveOperations[\"Overwrite\"] = 1] = \"Overwrite\";\n MoveOperations[MoveOperations[\"AllowBrokenThickets\"] = 8] = \"AllowBrokenThickets\";\n})(MoveOperations = exports.MoveOperations || (exports.MoveOperations = {}));\nvar TemplateFileType;\n(function (TemplateFileType) {\n TemplateFileType[TemplateFileType[\"StandardPage\"] = 0] = \"StandardPage\";\n TemplateFileType[TemplateFileType[\"WikiPage\"] = 1] = \"WikiPage\";\n TemplateFileType[TemplateFileType[\"FormPage\"] = 2] = \"FormPage\";\n})(TemplateFileType = exports.TemplateFileType || (exports.TemplateFileType = {}));\n\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar queryable_1 = __webpack_require__(1);\nvar queryableshareable_1 = __webpack_require__(12);\nvar files_1 = __webpack_require__(8);\nvar util_1 = __webpack_require__(0);\nvar odata_1 = __webpack_require__(2);\nvar items_1 = __webpack_require__(10);\n/**\n * Describes a collection of Folder objects\n *\n */\nvar Folders = (function (_super) {\n __extends(Folders, _super);\n /**\n * Creates a new instance of the Folders class\n *\n * @param baseUrl The url or Queryable which forms the parent of this fields collection\n */\n function Folders(baseUrl, path) {\n if (path === void 0) { path = \"folders\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * Gets a folder by folder name\n *\n */\n Folders.prototype.getByName = function (name) {\n var f = new Folder(this);\n f.concat(\"('\" + name + \"')\");\n return f;\n };\n /**\n * Adds a new folder to the current folder (relative) or any folder (absolute)\n *\n * @param url The relative or absolute url where the new folder will be created. Urls starting with a forward slash are absolute.\n * @returns The new Folder and the raw response.\n */\n Folders.prototype.add = function (url) {\n var _this = this;\n return this.clone(Folders, \"add('\" + url + \"')\", true).post().then(function (response) {\n return {\n data: response,\n folder: _this.getByName(url),\n };\n });\n };\n return Folders;\n}(queryable_1.QueryableCollection));\nexports.Folders = Folders;\n/**\n * Describes a single Folder instance\n *\n */\nvar Folder = (function (_super) {\n __extends(Folder, _super);\n function Folder() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(Folder.prototype, \"contentTypeOrder\", {\n /**\n * Specifies the sequence in which content types are displayed.\n *\n */\n get: function () {\n return new queryable_1.QueryableCollection(this, \"contentTypeOrder\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Folder.prototype, \"files\", {\n /**\n * Gets this folder's files\n *\n */\n get: function () {\n return new files_1.Files(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Folder.prototype, \"folders\", {\n /**\n * Gets this folder's sub folders\n *\n */\n get: function () {\n return new Folders(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Folder.prototype, \"listItemAllFields\", {\n /**\n * Gets this folder's list item field values\n *\n */\n get: function () {\n return new queryable_1.QueryableCollection(this, \"listItemAllFields\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Folder.prototype, \"parentFolder\", {\n /**\n * Gets the parent folder, if available\n *\n */\n get: function () {\n return new Folder(this, \"parentFolder\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Folder.prototype, \"properties\", {\n /**\n * Gets this folder's properties\n *\n */\n get: function () {\n return new queryable_1.QueryableInstance(this, \"properties\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Folder.prototype, \"serverRelativeUrl\", {\n /**\n * Gets this folder's server relative url\n *\n */\n get: function () {\n return new queryable_1.Queryable(this, \"serverRelativeUrl\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Folder.prototype, \"uniqueContentTypeOrder\", {\n /**\n * Gets a value that specifies the content type order.\n *\n */\n get: function () {\n return new queryable_1.QueryableCollection(this, \"uniqueContentTypeOrder\");\n },\n enumerable: true,\n configurable: true\n });\n Folder.prototype.update = function (properties) {\n var _this = this;\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": \"SP.Folder\" },\n }, properties));\n return this.post({\n body: postBody,\n headers: {\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n return {\n data: data,\n folder: _this,\n };\n });\n };\n /**\n * Delete this folder\n *\n * @param eTag Value used in the IF-Match header, by default \"*\"\n */\n Folder.prototype.delete = function (eTag) {\n if (eTag === void 0) { eTag = \"*\"; }\n return this.clone(Folder, null, true).post({\n headers: {\n \"IF-Match\": eTag,\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n /**\n * Moves the folder to the Recycle Bin and returns the identifier of the new Recycle Bin item.\n */\n Folder.prototype.recycle = function () {\n return this.clone(Folder, \"recycle\", true).post();\n };\n /**\n * Gets the associated list item for this folder, loading the default properties\n */\n Folder.prototype.getItem = function () {\n var selects = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n selects[_i] = arguments[_i];\n }\n var q = this.listItemAllFields;\n return q.select.apply(q, selects).get().then(function (d) {\n return util_1.Util.extend(new items_1.Item(odata_1.getEntityUrl(d)), d);\n });\n };\n return Folder;\n}(queryableshareable_1.QueryableShareableFolder));\nexports.Folder = Folder;\n\n\n/***/ }),\n/* 10 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar queryable_1 = __webpack_require__(1);\nvar queryableshareable_1 = __webpack_require__(12);\nvar folders_1 = __webpack_require__(9);\nvar files_1 = __webpack_require__(8);\nvar contenttypes_1 = __webpack_require__(16);\nvar util_1 = __webpack_require__(0);\nvar odata_1 = __webpack_require__(2);\nvar attachmentfiles_1 = __webpack_require__(42);\nvar lists_1 = __webpack_require__(11);\n/**\n * Describes a collection of Item objects\n *\n */\nvar Items = (function (_super) {\n __extends(Items, _super);\n /**\n * Creates a new instance of the Items class\n *\n * @param baseUrl The url or Queryable which forms the parent of this fields collection\n */\n function Items(baseUrl, path) {\n if (path === void 0) { path = \"items\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * Gets an Item by id\n *\n * @param id The integer id of the item to retrieve\n */\n Items.prototype.getById = function (id) {\n var i = new Item(this);\n i.concat(\"(\" + id + \")\");\n return i;\n };\n /**\n * Skips the specified number of items (https://msdn.microsoft.com/en-us/library/office/fp142385.aspx#sectionSection6)\n *\n * @param skip The starting id where the page should start, use with top to specify pages\n */\n Items.prototype.skip = function (skip) {\n this._query.add(\"$skiptoken\", encodeURIComponent(\"Paged=TRUE&p_ID=\" + skip));\n return this;\n };\n /**\n * Gets a collection designed to aid in paging through data\n *\n */\n Items.prototype.getPaged = function () {\n return this.getAs(new PagedItemCollectionParser());\n };\n //\n /**\n * Adds a new item to the collection\n *\n * @param properties The new items's properties\n */\n Items.prototype.add = function (properties, listItemEntityTypeFullName) {\n var _this = this;\n if (properties === void 0) { properties = {}; }\n if (listItemEntityTypeFullName === void 0) { listItemEntityTypeFullName = null; }\n var removeDependency = this.addBatchDependency();\n return this.ensureListItemEntityTypeName(listItemEntityTypeFullName).then(function (listItemEntityType) {\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": listItemEntityType },\n }, properties));\n var promise = _this.clone(Items, null, true).postAs({ body: postBody }).then(function (data) {\n return {\n data: data,\n item: _this.getById(data.Id),\n };\n });\n removeDependency();\n return promise;\n });\n };\n /**\n * Ensures we have the proper list item entity type name, either from the value provided or from the list\n *\n * @param candidatelistItemEntityTypeFullName The potential type name\n */\n Items.prototype.ensureListItemEntityTypeName = function (candidatelistItemEntityTypeFullName) {\n return candidatelistItemEntityTypeFullName ?\n Promise.resolve(candidatelistItemEntityTypeFullName) :\n this.getParent(lists_1.List).getListItemEntityTypeFullName();\n };\n return Items;\n}(queryable_1.QueryableCollection));\nexports.Items = Items;\n/**\n * Descrines a single Item instance\n *\n */\nvar Item = (function (_super) {\n __extends(Item, _super);\n function Item() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(Item.prototype, \"attachmentFiles\", {\n /**\n * Gets the set of attachments for this item\n *\n */\n get: function () {\n return new attachmentfiles_1.AttachmentFiles(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Item.prototype, \"contentType\", {\n /**\n * Gets the content type for this item\n *\n */\n get: function () {\n return new contenttypes_1.ContentType(this, \"ContentType\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Item.prototype, \"effectiveBasePermissions\", {\n /**\n * Gets the effective base permissions for the item\n *\n */\n get: function () {\n return new queryable_1.Queryable(this, \"EffectiveBasePermissions\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Item.prototype, \"effectiveBasePermissionsForUI\", {\n /**\n * Gets the effective base permissions for the item in a UI context\n *\n */\n get: function () {\n return new queryable_1.Queryable(this, \"EffectiveBasePermissionsForUI\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Item.prototype, \"fieldValuesAsHTML\", {\n /**\n * Gets the field values for this list item in their HTML representation\n *\n */\n get: function () {\n return new queryable_1.QueryableInstance(this, \"FieldValuesAsHTML\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Item.prototype, \"fieldValuesAsText\", {\n /**\n * Gets the field values for this list item in their text representation\n *\n */\n get: function () {\n return new queryable_1.QueryableInstance(this, \"FieldValuesAsText\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Item.prototype, \"fieldValuesForEdit\", {\n /**\n * Gets the field values for this list item for use in editing controls\n *\n */\n get: function () {\n return new queryable_1.QueryableInstance(this, \"FieldValuesForEdit\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Item.prototype, \"folder\", {\n /**\n * Gets the folder associated with this list item (if this item represents a folder)\n *\n */\n get: function () {\n return new folders_1.Folder(this, \"folder\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Item.prototype, \"file\", {\n /**\n * Gets the folder associated with this list item (if this item represents a folder)\n *\n */\n get: function () {\n return new files_1.File(this, \"file\");\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Updates this list intance with the supplied properties\n *\n * @param properties A plain object hash of values to update for the list\n * @param eTag Value used in the IF-Match header, by default \"*\"\n */\n Item.prototype.update = function (properties, eTag) {\n var _this = this;\n if (eTag === void 0) { eTag = \"*\"; }\n return new Promise(function (resolve, reject) {\n var removeDependency = _this.addBatchDependency();\n var parentList = _this.getParent(queryable_1.QueryableInstance, _this.parentUrl.substr(0, _this.parentUrl.lastIndexOf(\"/\")));\n parentList.select(\"ListItemEntityTypeFullName\").getAs().then(function (d) {\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": d.ListItemEntityTypeFullName },\n }, properties));\n removeDependency();\n return _this.post({\n body: postBody,\n headers: {\n \"IF-Match\": eTag,\n \"X-HTTP-Method\": \"MERGE\",\n },\n }, new ItemUpdatedParser()).then(function (data) {\n resolve({\n data: data,\n item: _this,\n });\n });\n }).catch(function (e) { return reject(e); });\n });\n };\n /**\n * Delete this item\n *\n * @param eTag Value used in the IF-Match header, by default \"*\"\n */\n Item.prototype.delete = function (eTag) {\n if (eTag === void 0) { eTag = \"*\"; }\n return this.post({\n headers: {\n \"IF-Match\": eTag,\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n /**\n * Moves the list item to the Recycle Bin and returns the identifier of the new Recycle Bin item.\n */\n Item.prototype.recycle = function () {\n return this.clone(Item, \"recycle\", true).post();\n };\n /**\n * Gets a string representation of the full URL to the WOPI frame.\n * If there is no associated WOPI application, or no associated action, an empty string is returned.\n *\n * @param action Display mode: 0: view, 1: edit, 2: mobileView, 3: interactivePreview\n */\n Item.prototype.getWopiFrameUrl = function (action) {\n if (action === void 0) { action = 0; }\n var i = this.clone(Item, \"getWOPIFrameUrl(@action)\", true);\n i._query.add(\"@action\", action);\n return i.post().then(function (data) {\n return data.GetWOPIFrameUrl;\n });\n };\n /**\n * Validates and sets the values of the specified collection of fields for the list item.\n *\n * @param formValues The fields to change and their new values.\n * @param newDocumentUpdate true if the list item is a document being updated after upload; otherwise false.\n */\n Item.prototype.validateUpdateListItem = function (formValues, newDocumentUpdate) {\n if (newDocumentUpdate === void 0) { newDocumentUpdate = false; }\n return this.clone(Item, \"validateupdatelistitem\", true).post({\n body: JSON.stringify({ \"formValues\": formValues, bNewDocumentUpdate: newDocumentUpdate }),\n });\n };\n return Item;\n}(queryableshareable_1.QueryableShareableItem));\nexports.Item = Item;\n/**\n * Provides paging functionality for list items\n */\nvar PagedItemCollection = (function () {\n function PagedItemCollection(nextUrl, results) {\n this.nextUrl = nextUrl;\n this.results = results;\n }\n Object.defineProperty(PagedItemCollection.prototype, \"hasNext\", {\n /**\n * If true there are more results available in the set, otherwise there are not\n */\n get: function () {\n return typeof this.nextUrl === \"string\" && this.nextUrl.length > 0;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Gets the next set of results, or resolves to null if no results are available\n */\n PagedItemCollection.prototype.getNext = function () {\n if (this.hasNext) {\n var items = new Items(this.nextUrl, null);\n return items.getPaged();\n }\n return new Promise(function (r) { return r(null); });\n };\n return PagedItemCollection;\n}());\nexports.PagedItemCollection = PagedItemCollection;\nvar PagedItemCollectionParser = (function (_super) {\n __extends(PagedItemCollectionParser, _super);\n function PagedItemCollectionParser() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n PagedItemCollectionParser.prototype.parse = function (r) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n if (_this.handleError(r, reject)) {\n r.json().then(function (json) {\n var nextUrl = json.hasOwnProperty(\"d\") && json.d.hasOwnProperty(\"__next\") ? json.d.__next : json[\"odata.nextLink\"];\n resolve(new PagedItemCollection(nextUrl, _this.parseODataJSON(json)));\n });\n }\n });\n };\n return PagedItemCollectionParser;\n}(odata_1.ODataParserBase));\nvar ItemUpdatedParser = (function (_super) {\n __extends(ItemUpdatedParser, _super);\n function ItemUpdatedParser() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ItemUpdatedParser.prototype.parse = function (r) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n if (_this.handleError(r, reject)) {\n resolve({\n \"odata.etag\": r.headers.get(\"etag\"),\n });\n }\n });\n };\n return ItemUpdatedParser;\n}(odata_1.ODataParserBase));\n\n\n/***/ }),\n/* 11 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar items_1 = __webpack_require__(10);\nvar views_1 = __webpack_require__(49);\nvar contenttypes_1 = __webpack_require__(16);\nvar fields_1 = __webpack_require__(24);\nvar forms_1 = __webpack_require__(43);\nvar subscriptions_1 = __webpack_require__(47);\nvar queryable_1 = __webpack_require__(1);\nvar queryablesecurable_1 = __webpack_require__(26);\nvar util_1 = __webpack_require__(0);\nvar usercustomactions_1 = __webpack_require__(19);\nvar odata_1 = __webpack_require__(2);\nvar exceptions_1 = __webpack_require__(3);\nvar folders_1 = __webpack_require__(9);\n/**\n * Describes a collection of List objects\n *\n */\nvar Lists = (function (_super) {\n __extends(Lists, _super);\n /**\n * Creates a new instance of the Lists class\n *\n * @param baseUrl The url or Queryable which forms the parent of this fields collection\n */\n function Lists(baseUrl, path) {\n if (path === void 0) { path = \"lists\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * Gets a list from the collection by title\n *\n * @param title The title of the list\n */\n Lists.prototype.getByTitle = function (title) {\n return new List(this, \"getByTitle('\" + title + \"')\");\n };\n /**\n * Gets a list from the collection by guid id\n *\n * @param id The Id of the list (GUID)\n */\n Lists.prototype.getById = function (id) {\n var list = new List(this);\n list.concat(\"('\" + id + \"')\");\n return list;\n };\n /**\n * Adds a new list to the collection\n *\n * @param title The new list's title\n * @param description The new list's description\n * @param template The list template value\n * @param enableContentTypes If true content types will be allowed and enabled, otherwise they will be disallowed and not enabled\n * @param additionalSettings Will be passed as part of the list creation body\n */\n Lists.prototype.add = function (title, description, template, enableContentTypes, additionalSettings) {\n var _this = this;\n if (description === void 0) { description = \"\"; }\n if (template === void 0) { template = 100; }\n if (enableContentTypes === void 0) { enableContentTypes = false; }\n if (additionalSettings === void 0) { additionalSettings = {}; }\n var addSettings = util_1.Util.extend({\n \"AllowContentTypes\": enableContentTypes,\n \"BaseTemplate\": template,\n \"ContentTypesEnabled\": enableContentTypes,\n \"Description\": description,\n \"Title\": title,\n \"__metadata\": { \"type\": \"SP.List\" },\n }, additionalSettings);\n return this.post({ body: JSON.stringify(addSettings) }).then(function (data) {\n return { data: data, list: _this.getByTitle(addSettings.Title) };\n });\n };\n /**\n * Ensures that the specified list exists in the collection (note: this method not supported for batching)\n *\n * @param title The new list's title\n * @param description The new list's description\n * @param template The list template value\n * @param enableContentTypes If true content types will be allowed and enabled, otherwise they will be disallowed and not enabled\n * @param additionalSettings Will be passed as part of the list creation body or used to update an existing list\n */\n Lists.prototype.ensure = function (title, description, template, enableContentTypes, additionalSettings) {\n var _this = this;\n if (description === void 0) { description = \"\"; }\n if (template === void 0) { template = 100; }\n if (enableContentTypes === void 0) { enableContentTypes = false; }\n if (additionalSettings === void 0) { additionalSettings = {}; }\n if (this.hasBatch) {\n throw new exceptions_1.NotSupportedInBatchException(\"The ensure list method\");\n }\n return new Promise(function (resolve, reject) {\n var addOrUpdateSettings = util_1.Util.extend(additionalSettings, { Title: title, Description: description, ContentTypesEnabled: enableContentTypes }, true);\n var list = _this.getByTitle(addOrUpdateSettings.Title);\n list.get().then(function (_) {\n list.update(addOrUpdateSettings).then(function (d) {\n resolve({ created: false, data: d, list: _this.getByTitle(addOrUpdateSettings.Title) });\n }).catch(function (e) { return reject(e); });\n }).catch(function (_) {\n _this.add(title, description, template, enableContentTypes, addOrUpdateSettings).then(function (r) {\n resolve({ created: true, data: r.data, list: _this.getByTitle(addOrUpdateSettings.Title) });\n }).catch(function (e) { return reject(e); });\n });\n });\n };\n /**\n * Gets a list that is the default asset location for images or other files, which the users upload to their wiki pages.\n */\n Lists.prototype.ensureSiteAssetsLibrary = function () {\n return this.clone(Lists, \"ensuresiteassetslibrary\", true).post().then(function (json) {\n return new List(odata_1.extractOdataId(json));\n });\n };\n /**\n * Gets a list that is the default location for wiki pages.\n */\n Lists.prototype.ensureSitePagesLibrary = function () {\n return this.clone(Lists, \"ensuresitepageslibrary\", true).post().then(function (json) {\n return new List(odata_1.extractOdataId(json));\n });\n };\n return Lists;\n}(queryable_1.QueryableCollection));\nexports.Lists = Lists;\n/**\n * Describes a single List instance\n *\n */\nvar List = (function (_super) {\n __extends(List, _super);\n function List() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(List.prototype, \"contentTypes\", {\n /**\n * Gets the content types in this list\n *\n */\n get: function () {\n return new contenttypes_1.ContentTypes(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"items\", {\n /**\n * Gets the items in this list\n *\n */\n get: function () {\n return new items_1.Items(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"views\", {\n /**\n * Gets the views in this list\n *\n */\n get: function () {\n return new views_1.Views(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"fields\", {\n /**\n * Gets the fields in this list\n *\n */\n get: function () {\n return new fields_1.Fields(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"forms\", {\n /**\n * Gets the forms in this list\n *\n */\n get: function () {\n return new forms_1.Forms(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"defaultView\", {\n /**\n * Gets the default view of this list\n *\n */\n get: function () {\n return new queryable_1.QueryableInstance(this, \"DefaultView\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"userCustomActions\", {\n /**\n * Get all custom actions on a site collection\n *\n */\n get: function () {\n return new usercustomactions_1.UserCustomActions(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"effectiveBasePermissions\", {\n /**\n * Gets the effective base permissions of this list\n *\n */\n get: function () {\n return new queryable_1.Queryable(this, \"EffectiveBasePermissions\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"eventReceivers\", {\n /**\n * Gets the event receivers attached to this list\n *\n */\n get: function () {\n return new queryable_1.QueryableCollection(this, \"EventReceivers\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"relatedFields\", {\n /**\n * Gets the related fields of this list\n *\n */\n get: function () {\n return new queryable_1.Queryable(this, \"getRelatedFields\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"informationRightsManagementSettings\", {\n /**\n * Gets the IRM settings for this list\n *\n */\n get: function () {\n return new queryable_1.Queryable(this, \"InformationRightsManagementSettings\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"subscriptions\", {\n /**\n * Gets the webhook subscriptions of this list\n *\n */\n get: function () {\n return new subscriptions_1.Subscriptions(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"rootFolder\", {\n /**\n * The root folder of the list\n */\n get: function () {\n return new folders_1.Folder(this, \"rootFolder\");\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Gets a view by view guid id\n *\n */\n List.prototype.getView = function (viewId) {\n return new views_1.View(this, \"getView('\" + viewId + \"')\");\n };\n /**\n * Updates this list intance with the supplied properties\n *\n * @param properties A plain object hash of values to update for the list\n * @param eTag Value used in the IF-Match header, by default \"*\"\n */\n /* tslint:disable no-string-literal */\n List.prototype.update = function (properties, eTag) {\n var _this = this;\n if (eTag === void 0) { eTag = \"*\"; }\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": \"SP.List\" },\n }, properties));\n return this.post({\n body: postBody,\n headers: {\n \"IF-Match\": eTag,\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n var retList = _this;\n if (properties.hasOwnProperty(\"Title\")) {\n retList = _this.getParent(List, _this.parentUrl, \"getByTitle('\" + properties[\"Title\"] + \"')\");\n }\n return {\n data: data,\n list: retList,\n };\n });\n };\n /* tslint:enable */\n /**\n * Delete this list\n *\n * @param eTag Value used in the IF-Match header, by default \"*\"\n */\n List.prototype.delete = function (eTag) {\n if (eTag === void 0) { eTag = \"*\"; }\n return this.post({\n headers: {\n \"IF-Match\": eTag,\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n /**\n * Returns the collection of changes from the change log that have occurred within the list, based on the specified query.\n */\n List.prototype.getChanges = function (query) {\n return this.clone(List, \"getchanges\", true).post({\n body: JSON.stringify({ \"query\": util_1.Util.extend({ \"__metadata\": { \"type\": \"SP.ChangeQuery\" } }, query) }),\n });\n };\n /**\n * Returns a collection of items from the list based on the specified query.\n *\n * @param CamlQuery The Query schema of Collaborative Application Markup\n * Language (CAML) is used in various ways within the context of Microsoft SharePoint Foundation\n * to define queries against list data.\n * see:\n *\n * https://msdn.microsoft.com/en-us/library/office/ms467521.aspx\n *\n * @param expands A URI with a $expand System Query Option indicates that Entries associated with\n * the Entry or Collection of Entries identified by the Resource Path\n * section of the URI must be represented inline (i.e. eagerly loaded).\n * see:\n *\n * https://msdn.microsoft.com/en-us/library/office/fp142385.aspx\n *\n * http://www.odata.org/documentation/odata-version-2-0/uri-conventions/#ExpandSystemQueryOption\n */\n List.prototype.getItemsByCAMLQuery = function (query) {\n var expands = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n expands[_i - 1] = arguments[_i];\n }\n var q = this.clone(List, \"getitems\", true);\n return q.expand.apply(q, expands).post({\n body: JSON.stringify({ \"query\": util_1.Util.extend({ \"__metadata\": { \"type\": \"SP.CamlQuery\" } }, query) }),\n });\n };\n /**\n * See: https://msdn.microsoft.com/en-us/library/office/dn292554.aspx\n */\n List.prototype.getListItemChangesSinceToken = function (query) {\n return this.clone(List, \"getlistitemchangessincetoken\", true).post({\n body: JSON.stringify({ \"query\": util_1.Util.extend({ \"__metadata\": { \"type\": \"SP.ChangeLogItemQuery\" } }, query) }),\n }, { parse: function (r) { return r.text(); } });\n };\n /**\n * Moves the list to the Recycle Bin and returns the identifier of the new Recycle Bin item.\n */\n List.prototype.recycle = function () {\n return this.clone(List, \"recycle\", true).post().then(function (data) {\n if (data.hasOwnProperty(\"Recycle\")) {\n return data.Recycle;\n }\n else {\n return data;\n }\n });\n };\n /**\n * Renders list data based on the view xml provided\n */\n List.prototype.renderListData = function (viewXml) {\n var q = this.clone(List, \"renderlistdata(@viewXml)\");\n q.query.add(\"@viewXml\", \"'\" + viewXml + \"'\");\n return q.post().then(function (data) {\n // data will be a string, so we parse it again\n data = JSON.parse(data);\n if (data.hasOwnProperty(\"RenderListData\")) {\n return data.RenderListData;\n }\n else {\n return data;\n }\n });\n };\n /**\n * Gets the field values and field schema attributes for a list item.\n */\n List.prototype.renderListFormData = function (itemId, formId, mode) {\n return this.clone(List, \"renderlistformdata(itemid=\" + itemId + \", formid='\" + formId + \"', mode='\" + mode + \"')\", true).post().then(function (data) {\n // data will be a string, so we parse it again\n data = JSON.parse(data);\n if (data.hasOwnProperty(\"ListData\")) {\n return data.ListData;\n }\n else {\n return data;\n }\n });\n };\n /**\n * Reserves a list item ID for idempotent list item creation.\n */\n List.prototype.reserveListItemId = function () {\n return this.clone(List, \"reservelistitemid\", true).post().then(function (data) {\n if (data.hasOwnProperty(\"ReserveListItemId\")) {\n return data.ReserveListItemId;\n }\n else {\n return data;\n }\n });\n };\n /**\n * Returns the ListItemEntityTypeFullName for this list, used when adding/updating list items. Does not support batching.\n *\n */\n List.prototype.getListItemEntityTypeFullName = function () {\n return this.clone(List, null).select(\"ListItemEntityTypeFullName\").getAs().then(function (o) { return o.ListItemEntityTypeFullName; });\n };\n return List;\n}(queryablesecurable_1.QueryableSecurable));\nexports.List = List;\n\n\n/***/ }),\n/* 12 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar util_1 = __webpack_require__(0);\nvar webs_1 = __webpack_require__(7);\nvar odata_1 = __webpack_require__(2);\nvar queryable_1 = __webpack_require__(1);\nvar queryablesecurable_1 = __webpack_require__(26);\nvar types_1 = __webpack_require__(13);\n/**\n * Internal helper class used to augment classes to include sharing functionality\n */\nvar QueryableShareable = (function (_super) {\n __extends(QueryableShareable, _super);\n function QueryableShareable() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Gets a sharing link for the supplied\n *\n * @param kind The kind of link to share\n * @param expiration The optional expiration for this link\n */\n QueryableShareable.prototype.getShareLink = function (kind, expiration) {\n if (expiration === void 0) { expiration = null; }\n // date needs to be an ISO string or null\n var expString = expiration !== null ? expiration.toISOString() : null;\n // clone using the factory and send the request\n return this.clone(QueryableShareable, \"shareLink\", true).postAs({\n body: JSON.stringify({\n request: {\n createLink: true,\n emailData: null,\n settings: {\n expiration: expString,\n linkKind: kind,\n },\n },\n }),\n });\n };\n /**\n * Shares this instance with the supplied users\n *\n * @param loginNames Resolved login names to share\n * @param role The role\n * @param requireSignin True to require the user is authenticated, otherwise false\n * @param propagateAcl True to apply this share to all children\n * @param emailData If supplied an email will be sent with the indicated properties\n */\n QueryableShareable.prototype.shareWith = function (loginNames, role, requireSignin, propagateAcl, emailData) {\n var _this = this;\n if (requireSignin === void 0) { requireSignin = true; }\n if (propagateAcl === void 0) { propagateAcl = false; }\n // handle the multiple input types\n if (!Array.isArray(loginNames)) {\n loginNames = [loginNames];\n }\n var userStr = JSON.stringify(loginNames.map(function (login) { return { Key: login }; }));\n var roleFilter = role === types_1.SharingRole.Edit ? types_1.RoleType.Contributor : types_1.RoleType.Reader;\n // start by looking up the role definition id we need to set the roleValue\n return webs_1.Web.fromUrl(this.toUrl()).roleDefinitions.select(\"Id\").filter(\"RoleTypeKind eq \" + roleFilter).get().then(function (def) {\n if (!Array.isArray(def) || def.length < 1) {\n throw new Error(\"Could not locate a role defintion with RoleTypeKind \" + roleFilter);\n }\n var postBody = {\n includeAnonymousLinkInEmail: requireSignin,\n peoplePickerInput: userStr,\n propagateAcl: propagateAcl,\n roleValue: \"role:\" + def[0].Id,\n useSimplifiedRoles: true,\n };\n if (typeof emailData !== \"undefined\") {\n postBody = util_1.Util.extend(postBody, {\n emailBody: emailData.body,\n emailSubject: typeof emailData.subject !== \"undefined\" ? \"\" : emailData.subject,\n sendEmail: true,\n });\n }\n return _this.clone(QueryableShareable, \"shareObject\", true).postAs({\n body: JSON.stringify(postBody),\n });\n });\n };\n /**\n * Shares an object based on the supplied options\n *\n * @param options The set of options to send to the ShareObject method\n * @param bypass If true any processing is skipped and the options are sent directly to the ShareObject method\n */\n QueryableShareable.prototype.shareObject = function (options, bypass) {\n var _this = this;\n if (bypass === void 0) { bypass = false; }\n if (bypass) {\n // if the bypass flag is set send the supplied parameters directly to the service\n return this.sendShareObjectRequest(options);\n }\n // extend our options with some defaults\n options = util_1.Util.extend(options, {\n group: null,\n includeAnonymousLinkInEmail: false,\n propagateAcl: false,\n useSimplifiedRoles: true,\n }, true);\n return this.getRoleValue(options.role, options.group).then(function (roleValue) {\n // handle the multiple input types\n if (!Array.isArray(options.loginNames)) {\n options.loginNames = [options.loginNames];\n }\n var userStr = JSON.stringify(options.loginNames.map(function (login) { return { Key: login }; }));\n var postBody = {\n peoplePickerInput: userStr,\n roleValue: roleValue,\n url: options.url,\n };\n if (typeof options.emailData !== \"undefined\" && options.emailData !== null) {\n postBody = util_1.Util.extend(postBody, {\n emailBody: options.emailData.body,\n emailSubject: typeof options.emailData.subject !== \"undefined\" ? \"Shared for you.\" : options.emailData.subject,\n sendEmail: true,\n });\n }\n return _this.sendShareObjectRequest(postBody);\n });\n };\n /**\n * Calls the web's UnshareObject method\n *\n * @param url The url of the object to unshare\n */\n QueryableShareable.prototype.unshareObjectWeb = function (url) {\n return this.clone(QueryableShareable, \"unshareObject\", true).postAs({\n body: JSON.stringify({\n url: url,\n }),\n });\n };\n /**\n * Checks Permissions on the list of Users and returns back role the users have on the Item.\n *\n * @param recipients The array of Entities for which Permissions need to be checked.\n */\n QueryableShareable.prototype.checkPermissions = function (recipients) {\n return this.clone(QueryableShareable, \"checkPermissions\", true).postAs({\n body: JSON.stringify({\n recipients: recipients,\n }),\n });\n };\n /**\n * Get Sharing Information.\n *\n * @param request The SharingInformationRequest Object.\n */\n QueryableShareable.prototype.getSharingInformation = function (request) {\n if (request === void 0) { request = null; }\n return this.clone(QueryableShareable, \"getSharingInformation\", true).postAs({\n body: JSON.stringify({\n request: request,\n }),\n });\n };\n /**\n * Gets the sharing settings of an item.\n *\n * @param useSimplifiedRoles Determines whether to use simplified roles.\n */\n QueryableShareable.prototype.getObjectSharingSettings = function (useSimplifiedRoles) {\n if (useSimplifiedRoles === void 0) { useSimplifiedRoles = true; }\n return this.clone(QueryableShareable, \"getObjectSharingSettings\", true).postAs({\n body: JSON.stringify({\n useSimplifiedRoles: useSimplifiedRoles,\n }),\n });\n };\n /**\n * Unshares this object\n */\n QueryableShareable.prototype.unshareObject = function () {\n return this.clone(QueryableShareable, \"unshareObject\", true).postAs();\n };\n /**\n * Deletes a link by type\n *\n * @param kind Deletes a sharing link by the kind of link\n */\n QueryableShareable.prototype.deleteLinkByKind = function (kind) {\n return this.clone(QueryableShareable, \"deleteLinkByKind\", true).post({\n body: JSON.stringify({ linkKind: kind }),\n });\n };\n /**\n * Removes the specified link to the item.\n *\n * @param kind The kind of link to be deleted.\n * @param shareId\n */\n QueryableShareable.prototype.unshareLink = function (kind, shareId) {\n if (shareId === void 0) { shareId = \"00000000-0000-0000-0000-000000000000\"; }\n return this.clone(QueryableShareable, \"unshareLink\", true).post({\n body: JSON.stringify({ linkKind: kind, shareId: shareId }),\n });\n };\n /**\n * Calculates the roleValue string used in the sharing query\n *\n * @param role The Sharing Role\n * @param group The Group type\n */\n QueryableShareable.prototype.getRoleValue = function (role, group) {\n // we will give group precedence, because we had to make a choice\n if (typeof group !== \"undefined\" && group !== null) {\n switch (group) {\n case types_1.RoleType.Contributor:\n return webs_1.Web.fromUrl(this.toUrl()).associatedMemberGroup.select(\"Id\").getAs().then(function (g) { return \"group: \" + g.Id; });\n case types_1.RoleType.Reader:\n case types_1.RoleType.Guest:\n return webs_1.Web.fromUrl(this.toUrl()).associatedVisitorGroup.select(\"Id\").getAs().then(function (g) { return \"group: \" + g.Id; });\n default:\n throw new Error(\"Could not determine role value for supplied value. Contributor, Reader, and Guest are supported\");\n }\n }\n else {\n var roleFilter = role === types_1.SharingRole.Edit ? types_1.RoleType.Contributor : types_1.RoleType.Reader;\n return webs_1.Web.fromUrl(this.toUrl()).roleDefinitions.select(\"Id\").top(1).filter(\"RoleTypeKind eq \" + roleFilter).getAs().then(function (def) {\n if (def.length < 1) {\n throw new Error(\"Could not locate associated role definition for supplied role. Edit and View are supported\");\n }\n return \"role: \" + def[0].Id;\n });\n }\n };\n QueryableShareable.prototype.getShareObjectWeb = function (candidate) {\n return Promise.resolve(webs_1.Web.fromUrl(candidate, \"/_api/SP.Web.ShareObject\"));\n };\n QueryableShareable.prototype.sendShareObjectRequest = function (options) {\n return this.getShareObjectWeb(this.toUrl()).then(function (web) {\n return web.expand(\"UsersWithAccessRequests\", \"GroupsSharedWith\").as(QueryableShareable).post({\n body: JSON.stringify(options),\n });\n });\n };\n return QueryableShareable;\n}(queryable_1.Queryable));\nexports.QueryableShareable = QueryableShareable;\nvar QueryableShareableWeb = (function (_super) {\n __extends(QueryableShareableWeb, _super);\n function QueryableShareableWeb() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Shares this web with the supplied users\n * @param loginNames The resolved login names to share\n * @param role The role to share this web\n * @param emailData Optional email data\n */\n QueryableShareableWeb.prototype.shareWith = function (loginNames, role, emailData) {\n var _this = this;\n if (role === void 0) { role = types_1.SharingRole.View; }\n var dependency = this.addBatchDependency();\n return webs_1.Web.fromUrl(this.toUrl(), \"/_api/web/url\").get().then(function (url) {\n dependency();\n return _this.shareObject(util_1.Util.combinePaths(url, \"/_layouts/15/aclinv.aspx?forSharing=1&mbypass=1\"), loginNames, role, emailData);\n });\n };\n /**\n * Provides direct access to the static web.ShareObject method\n *\n * @param url The url to share\n * @param loginNames Resolved loginnames string[] of a single login name string\n * @param roleValue Role value\n * @param emailData Optional email data\n * @param groupId Optional group id\n * @param propagateAcl\n * @param includeAnonymousLinkInEmail\n * @param useSimplifiedRoles\n */\n QueryableShareableWeb.prototype.shareObject = function (url, loginNames, role, emailData, group, propagateAcl, includeAnonymousLinkInEmail, useSimplifiedRoles) {\n if (propagateAcl === void 0) { propagateAcl = false; }\n if (includeAnonymousLinkInEmail === void 0) { includeAnonymousLinkInEmail = false; }\n if (useSimplifiedRoles === void 0) { useSimplifiedRoles = true; }\n return this.clone(QueryableShareable, null, true).shareObject({\n emailData: emailData,\n group: group,\n includeAnonymousLinkInEmail: includeAnonymousLinkInEmail,\n loginNames: loginNames,\n propagateAcl: propagateAcl,\n role: role,\n url: url,\n useSimplifiedRoles: useSimplifiedRoles,\n });\n };\n /**\n * Supplies a method to pass any set of arguments to ShareObject\n *\n * @param options The set of options to send to ShareObject\n */\n QueryableShareableWeb.prototype.shareObjectRaw = function (options) {\n return this.clone(QueryableShareable, null, true).shareObject(options, true);\n };\n /**\n * Unshares the object\n *\n * @param url The url of the object to stop sharing\n */\n QueryableShareableWeb.prototype.unshareObject = function (url) {\n return this.clone(QueryableShareable, null, true).unshareObjectWeb(url);\n };\n return QueryableShareableWeb;\n}(queryablesecurable_1.QueryableSecurable));\nexports.QueryableShareableWeb = QueryableShareableWeb;\nvar QueryableShareableItem = (function (_super) {\n __extends(QueryableShareableItem, _super);\n function QueryableShareableItem() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Gets a link suitable for sharing for this item\n *\n * @param kind The type of link to share\n * @param expiration The optional expiration date\n */\n QueryableShareableItem.prototype.getShareLink = function (kind, expiration) {\n if (kind === void 0) { kind = types_1.SharingLinkKind.OrganizationView; }\n if (expiration === void 0) { expiration = null; }\n return this.clone(QueryableShareable, null, true).getShareLink(kind, expiration);\n };\n /**\n * Shares this item with one or more users\n *\n * @param loginNames string or string[] of resolved login names to which this item will be shared\n * @param role The role (View | Edit) applied to the share\n * @param emailData Optional, if inlucded an email will be sent. Note subject currently has no effect.\n */\n QueryableShareableItem.prototype.shareWith = function (loginNames, role, requireSignin, emailData) {\n if (role === void 0) { role = types_1.SharingRole.View; }\n if (requireSignin === void 0) { requireSignin = true; }\n return this.clone(QueryableShareable, null, true).shareWith(loginNames, role, requireSignin, false, emailData);\n };\n /**\n * Checks Permissions on the list of Users and returns back role the users have on the Item.\n *\n * @param recipients The array of Entities for which Permissions need to be checked.\n */\n QueryableShareableItem.prototype.checkSharingPermissions = function (recipients) {\n return this.clone(QueryableShareable, null, true).checkPermissions(recipients);\n };\n /**\n * Get Sharing Information.\n *\n * @param request The SharingInformationRequest Object.\n */\n QueryableShareableItem.prototype.getSharingInformation = function (request) {\n if (request === void 0) { request = null; }\n return this.clone(QueryableShareable, null, true).getSharingInformation(request);\n };\n /**\n * Gets the sharing settings of an item.\n *\n * @param useSimplifiedRoles Determines whether to use simplified roles.\n */\n QueryableShareableItem.prototype.getObjectSharingSettings = function (useSimplifiedRoles) {\n if (useSimplifiedRoles === void 0) { useSimplifiedRoles = true; }\n return this.clone(QueryableShareable, null, true).getObjectSharingSettings(useSimplifiedRoles);\n };\n /**\n * Unshare this item\n */\n QueryableShareableItem.prototype.unshare = function () {\n return this.clone(QueryableShareable, null, true).unshareObject();\n };\n /**\n * Deletes a sharing link by kind\n *\n * @param kind Deletes a sharing link by the kind of link\n */\n QueryableShareableItem.prototype.deleteSharingLinkByKind = function (kind) {\n return this.clone(QueryableShareable, null, true).deleteLinkByKind(kind);\n };\n /**\n * Removes the specified link to the item.\n *\n * @param kind The kind of link to be deleted.\n * @param shareId\n */\n QueryableShareableItem.prototype.unshareLink = function (kind, shareId) {\n return this.clone(QueryableShareable, null, true).unshareLink(kind, shareId);\n };\n return QueryableShareableItem;\n}(queryablesecurable_1.QueryableSecurable));\nexports.QueryableShareableItem = QueryableShareableItem;\nvar FileFolderShared = (function (_super) {\n __extends(FileFolderShared, _super);\n function FileFolderShared() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Gets a link suitable for sharing\n *\n * @param kind The kind of link to get\n * @param expiration Optional, an expiration for this link\n */\n FileFolderShared.prototype.getShareLink = function (kind, expiration) {\n if (kind === void 0) { kind = types_1.SharingLinkKind.OrganizationView; }\n if (expiration === void 0) { expiration = null; }\n var dependency = this.addBatchDependency();\n return this.getShareable().then(function (shareable) {\n dependency();\n return shareable.getShareLink(kind, expiration);\n });\n };\n /**\n * Checks Permissions on the list of Users and returns back role the users have on the Item.\n *\n * @param recipients The array of Entities for which Permissions need to be checked.\n */\n FileFolderShared.prototype.checkSharingPermissions = function (recipients) {\n var dependency = this.addBatchDependency();\n return this.getShareable().then(function (shareable) {\n dependency();\n return shareable.checkPermissions(recipients);\n });\n };\n /**\n * Get Sharing Information.\n *\n * @param request The SharingInformationRequest Object.\n */\n FileFolderShared.prototype.getSharingInformation = function (request) {\n if (request === void 0) { request = null; }\n var dependency = this.addBatchDependency();\n return this.getShareable().then(function (shareable) {\n dependency();\n return shareable.getSharingInformation(request);\n });\n };\n /**\n * Gets the sharing settings of an item.\n *\n * @param useSimplifiedRoles Determines whether to use simplified roles.\n */\n FileFolderShared.prototype.getObjectSharingSettings = function (useSimplifiedRoles) {\n if (useSimplifiedRoles === void 0) { useSimplifiedRoles = true; }\n var dependency = this.addBatchDependency();\n return this.getShareable().then(function (shareable) {\n dependency();\n return shareable.getObjectSharingSettings(useSimplifiedRoles);\n });\n };\n /**\n * Unshare this item\n */\n FileFolderShared.prototype.unshare = function () {\n var dependency = this.addBatchDependency();\n return this.getShareable().then(function (shareable) {\n dependency();\n return shareable.unshareObject();\n });\n };\n /**\n * Deletes a sharing link by the kind of link\n *\n * @param kind The kind of link to be deleted.\n */\n FileFolderShared.prototype.deleteSharingLinkByKind = function (kind) {\n var dependency = this.addBatchDependency();\n return this.getShareable().then(function (shareable) {\n dependency();\n return shareable.deleteLinkByKind(kind);\n });\n };\n /**\n * Removes the specified link to the item.\n *\n * @param kind The kind of link to be deleted.\n * @param shareId The share id to delete\n */\n FileFolderShared.prototype.unshareLink = function (kind, shareId) {\n var dependency = this.addBatchDependency();\n return this.getShareable().then(function (shareable) {\n dependency();\n return shareable.unshareLink(kind, shareId);\n });\n };\n /**\n * For files and folders we need to use the associated item end point\n */\n FileFolderShared.prototype.getShareable = function () {\n var _this = this;\n // sharing only works on the item end point, not the file one - so we create a folder instance with the item url internally\n return this.clone(QueryableShareableFile, \"listItemAllFields\", false).select(\"odata.editlink\").get().then(function (d) {\n var shareable = new QueryableShareable(odata_1.getEntityUrl(d));\n // we need to handle batching\n if (_this.hasBatch) {\n shareable = shareable.inBatch(_this.batch);\n }\n return shareable;\n });\n };\n return FileFolderShared;\n}(queryable_1.QueryableInstance));\nexports.FileFolderShared = FileFolderShared;\nvar QueryableShareableFile = (function (_super) {\n __extends(QueryableShareableFile, _super);\n function QueryableShareableFile() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Shares this item with one or more users\n *\n * @param loginNames string or string[] of resolved login names to which this item will be shared\n * @param role The role (View | Edit) applied to the share\n * @param shareEverything Share everything in this folder, even items with unique permissions.\n * @param requireSignin If true the user must signin to view link, otherwise anyone with the link can access the resource\n * @param emailData Optional, if inlucded an email will be sent. Note subject currently has no effect.\n */\n QueryableShareableFile.prototype.shareWith = function (loginNames, role, requireSignin, emailData) {\n if (role === void 0) { role = types_1.SharingRole.View; }\n if (requireSignin === void 0) { requireSignin = true; }\n var dependency = this.addBatchDependency();\n return this.getShareable().then(function (shareable) {\n dependency();\n return shareable.shareWith(loginNames, role, requireSignin, false, emailData);\n });\n };\n return QueryableShareableFile;\n}(FileFolderShared));\nexports.QueryableShareableFile = QueryableShareableFile;\nvar QueryableShareableFolder = (function (_super) {\n __extends(QueryableShareableFolder, _super);\n function QueryableShareableFolder() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Shares this item with one or more users\n *\n * @param loginNames string or string[] of resolved login names to which this item will be shared\n * @param role The role (View | Edit) applied to the share\n * @param shareEverything Share everything in this folder, even items with unique permissions.\n * @param requireSignin If true the user must signin to view link, otherwise anyone with the link can access the resource\n * @param emailData Optional, if inlucded an email will be sent. Note subject currently has no effect.\n */\n QueryableShareableFolder.prototype.shareWith = function (loginNames, role, requireSignin, shareEverything, emailData) {\n if (role === void 0) { role = types_1.SharingRole.View; }\n if (requireSignin === void 0) { requireSignin = true; }\n if (shareEverything === void 0) { shareEverything = false; }\n var dependency = this.addBatchDependency();\n return this.getShareable().then(function (shareable) {\n dependency();\n return shareable.shareWith(loginNames, role, requireSignin, shareEverything, emailData);\n });\n };\n return QueryableShareableFolder;\n}(FileFolderShared));\nexports.QueryableShareableFolder = QueryableShareableFolder;\n\n\n/***/ }),\n/* 13 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n// reference: https://msdn.microsoft.com/en-us/library/office/dn600183.aspx\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Determines the display mode of the given control or view\n */\nvar ControlMode;\n(function (ControlMode) {\n ControlMode[ControlMode[\"Display\"] = 1] = \"Display\";\n ControlMode[ControlMode[\"Edit\"] = 2] = \"Edit\";\n ControlMode[ControlMode[\"New\"] = 3] = \"New\";\n})(ControlMode = exports.ControlMode || (exports.ControlMode = {}));\n/**\n * Specifies the type of the field.\n */\nvar FieldTypes;\n(function (FieldTypes) {\n FieldTypes[FieldTypes[\"Invalid\"] = 0] = \"Invalid\";\n FieldTypes[FieldTypes[\"Integer\"] = 1] = \"Integer\";\n FieldTypes[FieldTypes[\"Text\"] = 2] = \"Text\";\n FieldTypes[FieldTypes[\"Note\"] = 3] = \"Note\";\n FieldTypes[FieldTypes[\"DateTime\"] = 4] = \"DateTime\";\n FieldTypes[FieldTypes[\"Counter\"] = 5] = \"Counter\";\n FieldTypes[FieldTypes[\"Choice\"] = 6] = \"Choice\";\n FieldTypes[FieldTypes[\"Lookup\"] = 7] = \"Lookup\";\n FieldTypes[FieldTypes[\"Boolean\"] = 8] = \"Boolean\";\n FieldTypes[FieldTypes[\"Number\"] = 9] = \"Number\";\n FieldTypes[FieldTypes[\"Currency\"] = 10] = \"Currency\";\n FieldTypes[FieldTypes[\"URL\"] = 11] = \"URL\";\n FieldTypes[FieldTypes[\"Computed\"] = 12] = \"Computed\";\n FieldTypes[FieldTypes[\"Threading\"] = 13] = \"Threading\";\n FieldTypes[FieldTypes[\"Guid\"] = 14] = \"Guid\";\n FieldTypes[FieldTypes[\"MultiChoice\"] = 15] = \"MultiChoice\";\n FieldTypes[FieldTypes[\"GridChoice\"] = 16] = \"GridChoice\";\n FieldTypes[FieldTypes[\"Calculated\"] = 17] = \"Calculated\";\n FieldTypes[FieldTypes[\"File\"] = 18] = \"File\";\n FieldTypes[FieldTypes[\"Attachments\"] = 19] = \"Attachments\";\n FieldTypes[FieldTypes[\"User\"] = 20] = \"User\";\n FieldTypes[FieldTypes[\"Recurrence\"] = 21] = \"Recurrence\";\n FieldTypes[FieldTypes[\"CrossProjectLink\"] = 22] = \"CrossProjectLink\";\n FieldTypes[FieldTypes[\"ModStat\"] = 23] = \"ModStat\";\n FieldTypes[FieldTypes[\"Error\"] = 24] = \"Error\";\n FieldTypes[FieldTypes[\"ContentTypeId\"] = 25] = \"ContentTypeId\";\n FieldTypes[FieldTypes[\"PageSeparator\"] = 26] = \"PageSeparator\";\n FieldTypes[FieldTypes[\"ThreadIndex\"] = 27] = \"ThreadIndex\";\n FieldTypes[FieldTypes[\"WorkflowStatus\"] = 28] = \"WorkflowStatus\";\n FieldTypes[FieldTypes[\"AllDayEvent\"] = 29] = \"AllDayEvent\";\n FieldTypes[FieldTypes[\"WorkflowEventType\"] = 30] = \"WorkflowEventType\";\n})(FieldTypes = exports.FieldTypes || (exports.FieldTypes = {}));\nvar DateTimeFieldFormatType;\n(function (DateTimeFieldFormatType) {\n DateTimeFieldFormatType[DateTimeFieldFormatType[\"DateOnly\"] = 0] = \"DateOnly\";\n DateTimeFieldFormatType[DateTimeFieldFormatType[\"DateTime\"] = 1] = \"DateTime\";\n})(DateTimeFieldFormatType = exports.DateTimeFieldFormatType || (exports.DateTimeFieldFormatType = {}));\n/**\n * Specifies the control settings while adding a field.\n */\nvar AddFieldOptions;\n(function (AddFieldOptions) {\n /**\n * Specify that a new field added to the list must also be added to the default content type in the site collection\n */\n AddFieldOptions[AddFieldOptions[\"DefaultValue\"] = 0] = \"DefaultValue\";\n /**\n * Specify that a new field added to the list must also be added to the default content type in the site collection.\n */\n AddFieldOptions[AddFieldOptions[\"AddToDefaultContentType\"] = 1] = \"AddToDefaultContentType\";\n /**\n * Specify that a new field must not be added to any other content type\n */\n AddFieldOptions[AddFieldOptions[\"AddToNoContentType\"] = 2] = \"AddToNoContentType\";\n /**\n * Specify that a new field that is added to the specified list must also be added to all content types in the site collection\n */\n AddFieldOptions[AddFieldOptions[\"AddToAllContentTypes\"] = 4] = \"AddToAllContentTypes\";\n /**\n * Specify adding an internal field name hint for the purpose of avoiding possible database locking or field renaming operations\n */\n AddFieldOptions[AddFieldOptions[\"AddFieldInternalNameHint\"] = 8] = \"AddFieldInternalNameHint\";\n /**\n * Specify that a new field that is added to the specified list must also be added to the default list view\n */\n AddFieldOptions[AddFieldOptions[\"AddFieldToDefaultView\"] = 16] = \"AddFieldToDefaultView\";\n /**\n * Specify to confirm that no other field has the same display name\n */\n AddFieldOptions[AddFieldOptions[\"AddFieldCheckDisplayName\"] = 32] = \"AddFieldCheckDisplayName\";\n})(AddFieldOptions = exports.AddFieldOptions || (exports.AddFieldOptions = {}));\nvar CalendarType;\n(function (CalendarType) {\n CalendarType[CalendarType[\"Gregorian\"] = 1] = \"Gregorian\";\n CalendarType[CalendarType[\"Japan\"] = 3] = \"Japan\";\n CalendarType[CalendarType[\"Taiwan\"] = 4] = \"Taiwan\";\n CalendarType[CalendarType[\"Korea\"] = 5] = \"Korea\";\n CalendarType[CalendarType[\"Hijri\"] = 6] = \"Hijri\";\n CalendarType[CalendarType[\"Thai\"] = 7] = \"Thai\";\n CalendarType[CalendarType[\"Hebrew\"] = 8] = \"Hebrew\";\n CalendarType[CalendarType[\"GregorianMEFrench\"] = 9] = \"GregorianMEFrench\";\n CalendarType[CalendarType[\"GregorianArabic\"] = 10] = \"GregorianArabic\";\n CalendarType[CalendarType[\"GregorianXLITEnglish\"] = 11] = \"GregorianXLITEnglish\";\n CalendarType[CalendarType[\"GregorianXLITFrench\"] = 12] = \"GregorianXLITFrench\";\n CalendarType[CalendarType[\"KoreaJapanLunar\"] = 14] = \"KoreaJapanLunar\";\n CalendarType[CalendarType[\"ChineseLunar\"] = 15] = \"ChineseLunar\";\n CalendarType[CalendarType[\"SakaEra\"] = 16] = \"SakaEra\";\n CalendarType[CalendarType[\"UmAlQura\"] = 23] = \"UmAlQura\";\n})(CalendarType = exports.CalendarType || (exports.CalendarType = {}));\nvar UrlFieldFormatType;\n(function (UrlFieldFormatType) {\n UrlFieldFormatType[UrlFieldFormatType[\"Hyperlink\"] = 0] = \"Hyperlink\";\n UrlFieldFormatType[UrlFieldFormatType[\"Image\"] = 1] = \"Image\";\n})(UrlFieldFormatType = exports.UrlFieldFormatType || (exports.UrlFieldFormatType = {}));\nvar PermissionKind;\n(function (PermissionKind) {\n /**\n * Has no permissions on the Site. Not available through the user interface.\n */\n PermissionKind[PermissionKind[\"EmptyMask\"] = 0] = \"EmptyMask\";\n /**\n * View items in lists, documents in document libraries, and Web discussion comments.\n */\n PermissionKind[PermissionKind[\"ViewListItems\"] = 1] = \"ViewListItems\";\n /**\n * Add items to lists, documents to document libraries, and Web discussion comments.\n */\n PermissionKind[PermissionKind[\"AddListItems\"] = 2] = \"AddListItems\";\n /**\n * Edit items in lists, edit documents in document libraries, edit Web discussion comments\n * in documents, and customize Web Part Pages in document libraries.\n */\n PermissionKind[PermissionKind[\"EditListItems\"] = 3] = \"EditListItems\";\n /**\n * Delete items from a list, documents from a document library, and Web discussion\n * comments in documents.\n */\n PermissionKind[PermissionKind[\"DeleteListItems\"] = 4] = \"DeleteListItems\";\n /**\n * Approve a minor version of a list item or document.\n */\n PermissionKind[PermissionKind[\"ApproveItems\"] = 5] = \"ApproveItems\";\n /**\n * View the source of documents with server-side file handlers.\n */\n PermissionKind[PermissionKind[\"OpenItems\"] = 6] = \"OpenItems\";\n /**\n * View past versions of a list item or document.\n */\n PermissionKind[PermissionKind[\"ViewVersions\"] = 7] = \"ViewVersions\";\n /**\n * Delete past versions of a list item or document.\n */\n PermissionKind[PermissionKind[\"DeleteVersions\"] = 8] = \"DeleteVersions\";\n /**\n * Discard or check in a document which is checked out to another user.\n */\n PermissionKind[PermissionKind[\"CancelCheckout\"] = 9] = \"CancelCheckout\";\n /**\n * Create, change, and delete personal views of lists.\n */\n PermissionKind[PermissionKind[\"ManagePersonalViews\"] = 10] = \"ManagePersonalViews\";\n /**\n * Create and delete lists, add or remove columns in a list, and add or remove public views of a list.\n */\n PermissionKind[PermissionKind[\"ManageLists\"] = 12] = \"ManageLists\";\n /**\n * View forms, views, and application pages, and enumerate lists.\n */\n PermissionKind[PermissionKind[\"ViewFormPages\"] = 13] = \"ViewFormPages\";\n /**\n * Make content of a list or document library retrieveable for anonymous users through SharePoint search.\n * The list permissions in the site do not change.\n */\n PermissionKind[PermissionKind[\"AnonymousSearchAccessList\"] = 14] = \"AnonymousSearchAccessList\";\n /**\n * Allow users to open a Site, list, or folder to access items inside that container.\n */\n PermissionKind[PermissionKind[\"Open\"] = 17] = \"Open\";\n /**\n * View pages in a Site.\n */\n PermissionKind[PermissionKind[\"ViewPages\"] = 18] = \"ViewPages\";\n /**\n * Add, change, or delete HTML pages or Web Part Pages, and edit the Site using\n * a Windows SharePoint Services compatible editor.\n */\n PermissionKind[PermissionKind[\"AddAndCustomizePages\"] = 19] = \"AddAndCustomizePages\";\n /**\n * Apply a theme or borders to the entire Site.\n */\n PermissionKind[PermissionKind[\"ApplyThemeAndBorder\"] = 20] = \"ApplyThemeAndBorder\";\n /**\n * Apply a style sheet (.css file) to the Site.\n */\n PermissionKind[PermissionKind[\"ApplyStyleSheets\"] = 21] = \"ApplyStyleSheets\";\n /**\n * View reports on Site usage.\n */\n PermissionKind[PermissionKind[\"ViewUsageData\"] = 22] = \"ViewUsageData\";\n /**\n * Create a Site using Self-Service Site Creation.\n */\n PermissionKind[PermissionKind[\"CreateSSCSite\"] = 23] = \"CreateSSCSite\";\n /**\n * Create subsites such as team sites, Meeting Workspace sites, and Document Workspace sites.\n */\n PermissionKind[PermissionKind[\"ManageSubwebs\"] = 24] = \"ManageSubwebs\";\n /**\n * Create a group of users that can be used anywhere within the site collection.\n */\n PermissionKind[PermissionKind[\"CreateGroups\"] = 25] = \"CreateGroups\";\n /**\n * Create and change permission levels on the Site and assign permissions to users\n * and groups.\n */\n PermissionKind[PermissionKind[\"ManagePermissions\"] = 26] = \"ManagePermissions\";\n /**\n * Enumerate files and folders in a Site using Microsoft Office SharePoint Designer\n * and WebDAV interfaces.\n */\n PermissionKind[PermissionKind[\"BrowseDirectories\"] = 27] = \"BrowseDirectories\";\n /**\n * View information about users of the Site.\n */\n PermissionKind[PermissionKind[\"BrowseUserInfo\"] = 28] = \"BrowseUserInfo\";\n /**\n * Add or remove personal Web Parts on a Web Part Page.\n */\n PermissionKind[PermissionKind[\"AddDelPrivateWebParts\"] = 29] = \"AddDelPrivateWebParts\";\n /**\n * Update Web Parts to display personalized information.\n */\n PermissionKind[PermissionKind[\"UpdatePersonalWebParts\"] = 30] = \"UpdatePersonalWebParts\";\n /**\n * Grant the ability to perform all administration tasks for the Site as well as\n * manage content, activate, deactivate, or edit properties of Site scoped Features\n * through the object model or through the user interface (UI). When granted on the\n * root Site of a Site Collection, activate, deactivate, or edit properties of\n * site collection scoped Features through the object model. To browse to the Site\n * Collection Features page and activate or deactivate Site Collection scoped Features\n * through the UI, you must be a Site Collection administrator.\n */\n PermissionKind[PermissionKind[\"ManageWeb\"] = 31] = \"ManageWeb\";\n /**\n * Content of lists and document libraries in the Web site will be retrieveable for anonymous users through\n * SharePoint search if the list or document library has AnonymousSearchAccessList set.\n */\n PermissionKind[PermissionKind[\"AnonymousSearchAccessWebLists\"] = 32] = \"AnonymousSearchAccessWebLists\";\n /**\n * Use features that launch client applications. Otherwise, users must work on documents\n * locally and upload changes.\n */\n PermissionKind[PermissionKind[\"UseClientIntegration\"] = 37] = \"UseClientIntegration\";\n /**\n * Use SOAP, WebDAV, or Microsoft Office SharePoint Designer interfaces to access the Site.\n */\n PermissionKind[PermissionKind[\"UseRemoteAPIs\"] = 38] = \"UseRemoteAPIs\";\n /**\n * Manage alerts for all users of the Site.\n */\n PermissionKind[PermissionKind[\"ManageAlerts\"] = 39] = \"ManageAlerts\";\n /**\n * Create e-mail alerts.\n */\n PermissionKind[PermissionKind[\"CreateAlerts\"] = 40] = \"CreateAlerts\";\n /**\n * Allows a user to change his or her user information, such as adding a picture.\n */\n PermissionKind[PermissionKind[\"EditMyUserInfo\"] = 41] = \"EditMyUserInfo\";\n /**\n * Enumerate permissions on Site, list, folder, document, or list item.\n */\n PermissionKind[PermissionKind[\"EnumeratePermissions\"] = 63] = \"EnumeratePermissions\";\n /**\n * Has all permissions on the Site. Not available through the user interface.\n */\n PermissionKind[PermissionKind[\"FullMask\"] = 65] = \"FullMask\";\n})(PermissionKind = exports.PermissionKind || (exports.PermissionKind = {}));\nvar PrincipalType;\n(function (PrincipalType) {\n PrincipalType[PrincipalType[\"None\"] = 0] = \"None\";\n PrincipalType[PrincipalType[\"User\"] = 1] = \"User\";\n PrincipalType[PrincipalType[\"DistributionList\"] = 2] = \"DistributionList\";\n PrincipalType[PrincipalType[\"SecurityGroup\"] = 4] = \"SecurityGroup\";\n PrincipalType[PrincipalType[\"SharePointGroup\"] = 8] = \"SharePointGroup\";\n PrincipalType[PrincipalType[\"All\"] = 15] = \"All\";\n})(PrincipalType = exports.PrincipalType || (exports.PrincipalType = {}));\nvar RoleType;\n(function (RoleType) {\n RoleType[RoleType[\"None\"] = 0] = \"None\";\n RoleType[RoleType[\"Guest\"] = 1] = \"Guest\";\n RoleType[RoleType[\"Reader\"] = 2] = \"Reader\";\n RoleType[RoleType[\"Contributor\"] = 3] = \"Contributor\";\n RoleType[RoleType[\"WebDesigner\"] = 4] = \"WebDesigner\";\n RoleType[RoleType[\"Administrator\"] = 5] = \"Administrator\";\n})(RoleType = exports.RoleType || (exports.RoleType = {}));\nvar PageType;\n(function (PageType) {\n PageType[PageType[\"Invalid\"] = -1] = \"Invalid\";\n PageType[PageType[\"DefaultView\"] = 0] = \"DefaultView\";\n PageType[PageType[\"NormalView\"] = 1] = \"NormalView\";\n PageType[PageType[\"DialogView\"] = 2] = \"DialogView\";\n PageType[PageType[\"View\"] = 3] = \"View\";\n PageType[PageType[\"DisplayForm\"] = 4] = \"DisplayForm\";\n PageType[PageType[\"DisplayFormDialog\"] = 5] = \"DisplayFormDialog\";\n PageType[PageType[\"EditForm\"] = 6] = \"EditForm\";\n PageType[PageType[\"EditFormDialog\"] = 7] = \"EditFormDialog\";\n PageType[PageType[\"NewForm\"] = 8] = \"NewForm\";\n PageType[PageType[\"NewFormDialog\"] = 9] = \"NewFormDialog\";\n PageType[PageType[\"SolutionForm\"] = 10] = \"SolutionForm\";\n PageType[PageType[\"PAGE_MAXITEMS\"] = 11] = \"PAGE_MAXITEMS\";\n})(PageType = exports.PageType || (exports.PageType = {}));\nvar SharingLinkKind;\n(function (SharingLinkKind) {\n /**\n * Uninitialized link\n */\n SharingLinkKind[SharingLinkKind[\"Uninitialized\"] = 0] = \"Uninitialized\";\n /**\n * Direct link to the object being shared\n */\n SharingLinkKind[SharingLinkKind[\"Direct\"] = 1] = \"Direct\";\n /**\n * Organization-shareable link to the object being shared with view permissions\n */\n SharingLinkKind[SharingLinkKind[\"OrganizationView\"] = 2] = \"OrganizationView\";\n /**\n * Organization-shareable link to the object being shared with edit permissions\n */\n SharingLinkKind[SharingLinkKind[\"OrganizationEdit\"] = 3] = \"OrganizationEdit\";\n /**\n * View only anonymous link\n */\n SharingLinkKind[SharingLinkKind[\"AnonymousView\"] = 4] = \"AnonymousView\";\n /**\n * Read/Write anonymous link\n */\n SharingLinkKind[SharingLinkKind[\"AnonymousEdit\"] = 5] = \"AnonymousEdit\";\n /**\n * Flexible sharing Link where properties can change without affecting link URL\n */\n SharingLinkKind[SharingLinkKind[\"Flexible\"] = 6] = \"Flexible\";\n})(SharingLinkKind = exports.SharingLinkKind || (exports.SharingLinkKind = {}));\n;\n/**\n * Indicates the role of the sharing link\n */\nvar SharingRole;\n(function (SharingRole) {\n SharingRole[SharingRole[\"None\"] = 0] = \"None\";\n SharingRole[SharingRole[\"View\"] = 1] = \"View\";\n SharingRole[SharingRole[\"Edit\"] = 2] = \"Edit\";\n SharingRole[SharingRole[\"Owner\"] = 3] = \"Owner\";\n})(SharingRole = exports.SharingRole || (exports.SharingRole = {}));\nvar SharingOperationStatusCode;\n(function (SharingOperationStatusCode) {\n /**\n * The share operation completed without errors.\n */\n SharingOperationStatusCode[SharingOperationStatusCode[\"CompletedSuccessfully\"] = 0] = \"CompletedSuccessfully\";\n /**\n * The share operation completed and generated requests for access.\n */\n SharingOperationStatusCode[SharingOperationStatusCode[\"AccessRequestsQueued\"] = 1] = \"AccessRequestsQueued\";\n /**\n * The share operation failed as there were no resolved users.\n */\n SharingOperationStatusCode[SharingOperationStatusCode[\"NoResolvedUsers\"] = -1] = \"NoResolvedUsers\";\n /**\n * The share operation failed due to insufficient permissions.\n */\n SharingOperationStatusCode[SharingOperationStatusCode[\"AccessDenied\"] = -2] = \"AccessDenied\";\n /**\n * The share operation failed when attempting a cross site share, which is not supported.\n */\n SharingOperationStatusCode[SharingOperationStatusCode[\"CrossSiteRequestNotSupported\"] = -3] = \"CrossSiteRequestNotSupported\";\n /**\n * The sharing operation failed due to an unknown error.\n */\n SharingOperationStatusCode[SharingOperationStatusCode[\"UnknowError\"] = -4] = \"UnknowError\";\n /**\n * The text you typed is too long. Please shorten it.\n */\n SharingOperationStatusCode[SharingOperationStatusCode[\"EmailBodyTooLong\"] = -5] = \"EmailBodyTooLong\";\n /**\n * The maximum number of unique scopes in the list has been exceeded.\n */\n SharingOperationStatusCode[SharingOperationStatusCode[\"ListUniqueScopesExceeded\"] = -6] = \"ListUniqueScopesExceeded\";\n /**\n * The share operation failed because a sharing capability is disabled in the site.\n */\n SharingOperationStatusCode[SharingOperationStatusCode[\"CapabilityDisabled\"] = -7] = \"CapabilityDisabled\";\n /**\n * The specified object for the share operation is not supported.\n */\n SharingOperationStatusCode[SharingOperationStatusCode[\"ObjectNotSupported\"] = -8] = \"ObjectNotSupported\";\n /**\n * A SharePoint group cannot contain another SharePoint group.\n */\n SharingOperationStatusCode[SharingOperationStatusCode[\"NestedGroupsNotSupported\"] = -9] = \"NestedGroupsNotSupported\";\n})(SharingOperationStatusCode = exports.SharingOperationStatusCode || (exports.SharingOperationStatusCode = {}));\nvar SPSharedObjectType;\n(function (SPSharedObjectType) {\n SPSharedObjectType[SPSharedObjectType[\"Unknown\"] = 0] = \"Unknown\";\n SPSharedObjectType[SPSharedObjectType[\"File\"] = 1] = \"File\";\n SPSharedObjectType[SPSharedObjectType[\"Folder\"] = 2] = \"Folder\";\n SPSharedObjectType[SPSharedObjectType[\"Item\"] = 3] = \"Item\";\n SPSharedObjectType[SPSharedObjectType[\"List\"] = 4] = \"List\";\n SPSharedObjectType[SPSharedObjectType[\"Web\"] = 5] = \"Web\";\n SPSharedObjectType[SPSharedObjectType[\"Max\"] = 6] = \"Max\";\n})(SPSharedObjectType = exports.SPSharedObjectType || (exports.SPSharedObjectType = {}));\nvar SharingDomainRestrictionMode;\n(function (SharingDomainRestrictionMode) {\n SharingDomainRestrictionMode[SharingDomainRestrictionMode[\"None\"] = 0] = \"None\";\n SharingDomainRestrictionMode[SharingDomainRestrictionMode[\"AllowList\"] = 1] = \"AllowList\";\n SharingDomainRestrictionMode[SharingDomainRestrictionMode[\"BlockList\"] = 2] = \"BlockList\";\n})(SharingDomainRestrictionMode = exports.SharingDomainRestrictionMode || (exports.SharingDomainRestrictionMode = {}));\n;\n\n\n/***/ }),\n/* 14 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar util_1 = __webpack_require__(0);\nvar collections_1 = __webpack_require__(6);\nvar pnplibconfig_1 = __webpack_require__(4);\n/**\n * A wrapper class to provide a consistent interface to browser based storage\n *\n */\nvar PnPClientStorageWrapper = (function () {\n /**\n * Creates a new instance of the PnPClientStorageWrapper class\n *\n * @constructor\n */\n function PnPClientStorageWrapper(store, defaultTimeoutMinutes) {\n this.store = store;\n this.defaultTimeoutMinutes = defaultTimeoutMinutes;\n this.defaultTimeoutMinutes = (defaultTimeoutMinutes === void 0) ? -1 : defaultTimeoutMinutes;\n this.enabled = this.test();\n }\n /**\n * Get a value from storage, or null if that value does not exist\n *\n * @param key The key whose value we want to retrieve\n */\n PnPClientStorageWrapper.prototype.get = function (key) {\n if (!this.enabled) {\n return null;\n }\n var o = this.store.getItem(key);\n if (o == null) {\n return null;\n }\n var persistable = JSON.parse(o);\n if (new Date(persistable.expiration) <= new Date()) {\n this.delete(key);\n return null;\n }\n else {\n return persistable.value;\n }\n };\n /**\n * Adds a value to the underlying storage\n *\n * @param key The key to use when storing the provided value\n * @param o The value to store\n * @param expire Optional, if provided the expiration of the item, otherwise the default is used\n */\n PnPClientStorageWrapper.prototype.put = function (key, o, expire) {\n if (this.enabled) {\n this.store.setItem(key, this.createPersistable(o, expire));\n }\n };\n /**\n * Deletes a value from the underlying storage\n *\n * @param key The key of the pair we want to remove from storage\n */\n PnPClientStorageWrapper.prototype.delete = function (key) {\n if (this.enabled) {\n this.store.removeItem(key);\n }\n };\n /**\n * Gets an item from the underlying storage, or adds it if it does not exist using the supplied getter function\n *\n * @param key The key to use when storing the provided value\n * @param getter A function which will upon execution provide the desired value\n * @param expire Optional, if provided the expiration of the item, otherwise the default is used\n */\n PnPClientStorageWrapper.prototype.getOrPut = function (key, getter, expire) {\n var _this = this;\n if (!this.enabled) {\n return getter();\n }\n return new Promise(function (resolve) {\n var o = _this.get(key);\n if (o == null) {\n getter().then(function (d) {\n _this.put(key, d, expire);\n resolve(d);\n });\n }\n else {\n resolve(o);\n }\n });\n };\n /**\n * Used to determine if the wrapped storage is available currently\n */\n PnPClientStorageWrapper.prototype.test = function () {\n var str = \"test\";\n try {\n this.store.setItem(str, str);\n this.store.removeItem(str);\n return true;\n }\n catch (e) {\n return false;\n }\n };\n /**\n * Creates the persistable to store\n */\n PnPClientStorageWrapper.prototype.createPersistable = function (o, expire) {\n if (typeof expire === \"undefined\") {\n // ensure we are by default inline with the global library setting\n var defaultTimeout = pnplibconfig_1.RuntimeConfig.defaultCachingTimeoutSeconds;\n if (this.defaultTimeoutMinutes > 0) {\n defaultTimeout = this.defaultTimeoutMinutes * 60;\n }\n expire = util_1.Util.dateAdd(new Date(), \"second\", defaultTimeout);\n }\n return JSON.stringify({ expiration: expire, value: o });\n };\n return PnPClientStorageWrapper;\n}());\nexports.PnPClientStorageWrapper = PnPClientStorageWrapper;\n/**\n * A thin implementation of in-memory storage for use in nodejs\n */\nvar MemoryStorage = (function () {\n function MemoryStorage(_store) {\n if (_store === void 0) { _store = new collections_1.Dictionary(); }\n this._store = _store;\n }\n Object.defineProperty(MemoryStorage.prototype, \"length\", {\n get: function () {\n return this._store.count();\n },\n enumerable: true,\n configurable: true\n });\n MemoryStorage.prototype.clear = function () {\n this._store.clear();\n };\n MemoryStorage.prototype.getItem = function (key) {\n return this._store.get(key);\n };\n MemoryStorage.prototype.key = function (index) {\n return this._store.getKeys()[index];\n };\n MemoryStorage.prototype.removeItem = function (key) {\n this._store.remove(key);\n };\n MemoryStorage.prototype.setItem = function (key, data) {\n this._store.add(key, data);\n };\n return MemoryStorage;\n}());\n/**\n * A class that will establish wrappers for both local and session storage\n */\nvar PnPClientStorage = (function () {\n /**\n * Creates a new instance of the PnPClientStorage class\n *\n * @constructor\n */\n function PnPClientStorage() {\n this.local = typeof localStorage !== \"undefined\" ? new PnPClientStorageWrapper(localStorage) : new PnPClientStorageWrapper(new MemoryStorage());\n this.session = typeof sessionStorage !== \"undefined\" ? new PnPClientStorageWrapper(sessionStorage) : new PnPClientStorageWrapper(new MemoryStorage());\n }\n return PnPClientStorage;\n}());\nexports.PnPClientStorage = PnPClientStorage;\n\n\n/***/ }),\n/* 15 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar digestcache_1 = __webpack_require__(38);\nvar util_1 = __webpack_require__(0);\nvar pnplibconfig_1 = __webpack_require__(4);\nvar exceptions_1 = __webpack_require__(3);\nvar HttpClient = (function () {\n function HttpClient() {\n this._impl = pnplibconfig_1.RuntimeConfig.fetchClientFactory();\n this._digestCache = new digestcache_1.DigestCache(this);\n }\n HttpClient.prototype.fetch = function (url, options) {\n var _this = this;\n if (options === void 0) { options = {}; }\n var opts = util_1.Util.extend(options, { cache: \"no-cache\", credentials: \"same-origin\" }, true);\n var headers = new Headers();\n // first we add the global headers so they can be overwritten by any passed in locally to this call\n this.mergeHeaders(headers, pnplibconfig_1.RuntimeConfig.headers);\n // second we add the local options so we can overwrite the globals\n this.mergeHeaders(headers, options.headers);\n // lastly we apply any default headers we need that may not exist\n if (!headers.has(\"Accept\")) {\n headers.append(\"Accept\", \"application/json\");\n }\n if (!headers.has(\"Content-Type\")) {\n headers.append(\"Content-Type\", \"application/json;odata=verbose;charset=utf-8\");\n }\n if (!headers.has(\"X-ClientService-ClientTag\")) {\n headers.append(\"X-ClientService-ClientTag\", \"PnPCoreJS:2.0.3\");\n }\n opts = util_1.Util.extend(opts, { headers: headers });\n if (opts.method && opts.method.toUpperCase() !== \"GET\") {\n if (!headers.has(\"X-RequestDigest\")) {\n var index = url.indexOf(\"_api/\");\n if (index < 0) {\n throw new exceptions_1.APIUrlException();\n }\n var webUrl = url.substr(0, index);\n return this._digestCache.getDigest(webUrl)\n .then(function (digest) {\n headers.append(\"X-RequestDigest\", digest);\n return _this.fetchRaw(url, opts);\n });\n }\n }\n return this.fetchRaw(url, opts);\n };\n HttpClient.prototype.fetchRaw = function (url, options) {\n var _this = this;\n if (options === void 0) { options = {}; }\n // here we need to normalize the headers\n var rawHeaders = new Headers();\n this.mergeHeaders(rawHeaders, options.headers);\n options = util_1.Util.extend(options, { headers: rawHeaders });\n var retry = function (ctx) {\n _this._impl.fetch(url, options).then(function (response) { return ctx.resolve(response); }).catch(function (response) {\n // grab our current delay\n var delay = ctx.delay;\n // Check if request was throttled - http status code 429\n // Check is request failed due to server unavailable - http status code 503\n if (response.status !== 429 && response.status !== 503) {\n ctx.reject(response);\n }\n // Increment our counters.\n ctx.delay *= 2;\n ctx.attempts++;\n // If we have exceeded the retry count, reject.\n if (ctx.retryCount <= ctx.attempts) {\n ctx.reject(response);\n }\n // Set our retry timeout for {delay} milliseconds.\n setTimeout(util_1.Util.getCtxCallback(_this, retry, ctx), delay);\n });\n };\n return new Promise(function (resolve, reject) {\n var retryContext = {\n attempts: 0,\n delay: 100,\n reject: reject,\n resolve: resolve,\n retryCount: 7,\n };\n retry.call(_this, retryContext);\n });\n };\n HttpClient.prototype.get = function (url, options) {\n if (options === void 0) { options = {}; }\n var opts = util_1.Util.extend(options, { method: \"GET\" });\n return this.fetch(url, opts);\n };\n HttpClient.prototype.post = function (url, options) {\n if (options === void 0) { options = {}; }\n var opts = util_1.Util.extend(options, { method: \"POST\" });\n return this.fetch(url, opts);\n };\n HttpClient.prototype.patch = function (url, options) {\n if (options === void 0) { options = {}; }\n var opts = util_1.Util.extend(options, { method: \"PATCH\" });\n return this.fetch(url, opts);\n };\n HttpClient.prototype.delete = function (url, options) {\n if (options === void 0) { options = {}; }\n var opts = util_1.Util.extend(options, { method: \"DELETE\" });\n return this.fetch(url, opts);\n };\n HttpClient.prototype.mergeHeaders = function (target, source) {\n if (typeof source !== \"undefined\" && source !== null) {\n var temp = new Request(\"\", { headers: source });\n temp.headers.forEach(function (value, name) {\n target.append(name, value);\n });\n }\n };\n return HttpClient;\n}());\nexports.HttpClient = HttpClient;\n;\n\n\n/***/ }),\n/* 16 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar util_1 = __webpack_require__(0);\nvar queryable_1 = __webpack_require__(1);\n/**\n * Describes a collection of content types\n *\n */\nvar ContentTypes = (function (_super) {\n __extends(ContentTypes, _super);\n /**\n * Creates a new instance of the ContentTypes class\n *\n * @param baseUrl The url or Queryable which forms the parent of this content types collection\n */\n function ContentTypes(baseUrl, path) {\n if (path === void 0) { path = \"contenttypes\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * Gets a ContentType by content type id\n */\n ContentTypes.prototype.getById = function (id) {\n var ct = new ContentType(this);\n ct.concat(\"('\" + id + \"')\");\n return ct;\n };\n /**\n * Adds an existing contenttype to a content type collection\n *\n * @param contentTypeId in the following format, for example: 0x010102\n */\n ContentTypes.prototype.addAvailableContentType = function (contentTypeId) {\n var _this = this;\n var postBody = JSON.stringify({\n \"contentTypeId\": contentTypeId,\n });\n return this.clone(ContentTypes, \"addAvailableContentType\", true).postAs({ body: postBody }).then(function (data) {\n return {\n contentType: _this.getById(data.id),\n data: data,\n };\n });\n };\n /**\n * Adds a new content type to the collection\n *\n * @param id The desired content type id for the new content type (also determines the parent content type)\n * @param name The name of the content type\n * @param description The description of the content type\n * @param group The group in which to add the content type\n * @param additionalSettings Any additional settings to provide when creating the content type\n *\n */\n ContentTypes.prototype.add = function (id, name, description, group, additionalSettings) {\n var _this = this;\n if (description === void 0) { description = \"\"; }\n if (group === void 0) { group = \"Custom Content Types\"; }\n if (additionalSettings === void 0) { additionalSettings = {}; }\n var postBody = JSON.stringify(util_1.Util.extend({\n \"Description\": description,\n \"Group\": group,\n \"Id\": { \"StringValue\": id },\n \"Name\": name,\n \"__metadata\": { \"type\": \"SP.ContentType\" },\n }, additionalSettings));\n return this.post({ body: postBody }).then(function (data) {\n return { contentType: _this.getById(data.id), data: data };\n });\n };\n return ContentTypes;\n}(queryable_1.QueryableCollection));\nexports.ContentTypes = ContentTypes;\n/**\n * Describes a single ContentType instance\n *\n */\nvar ContentType = (function (_super) {\n __extends(ContentType, _super);\n function ContentType() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(ContentType.prototype, \"fieldLinks\", {\n /**\n * Gets the column (also known as field) references in the content type.\n */\n get: function () {\n return new FieldLinks(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ContentType.prototype, \"fields\", {\n /**\n * Gets a value that specifies the collection of fields for the content type.\n */\n get: function () {\n return new queryable_1.QueryableCollection(this, \"fields\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ContentType.prototype, \"parent\", {\n /**\n * Gets the parent content type of the content type.\n */\n get: function () {\n return new ContentType(this, \"parent\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ContentType.prototype, \"workflowAssociations\", {\n /**\n * Gets a value that specifies the collection of workflow associations for the content type.\n */\n get: function () {\n return new queryable_1.QueryableCollection(this, \"workflowAssociations\");\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Delete this content type\n */\n ContentType.prototype.delete = function () {\n return this.post({\n headers: {\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n return ContentType;\n}(queryable_1.QueryableInstance));\nexports.ContentType = ContentType;\n/**\n * Represents a collection of field link instances\n */\nvar FieldLinks = (function (_super) {\n __extends(FieldLinks, _super);\n /**\n * Creates a new instance of the ContentType class\n *\n * @param baseUrl The url or Queryable which forms the parent of this content type instance\n */\n function FieldLinks(baseUrl, path) {\n if (path === void 0) { path = \"fieldlinks\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * Gets a FieldLink by GUID id\n *\n * @param id The GUID id of the field link\n */\n FieldLinks.prototype.getById = function (id) {\n var fl = new FieldLink(this);\n fl.concat(\"(guid'\" + id + \"')\");\n return fl;\n };\n return FieldLinks;\n}(queryable_1.QueryableCollection));\nexports.FieldLinks = FieldLinks;\n/**\n * Represents a field link instance\n */\nvar FieldLink = (function (_super) {\n __extends(FieldLink, _super);\n function FieldLink() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return FieldLink;\n}(queryable_1.QueryableInstance));\nexports.FieldLink = FieldLink;\n\n\n/***/ }),\n/* 17 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar queryable_1 = __webpack_require__(1);\nvar sitegroups_1 = __webpack_require__(18);\nvar util_1 = __webpack_require__(0);\n/**\n * Describes a set of role assignments for the current scope\n *\n */\nvar RoleAssignments = (function (_super) {\n __extends(RoleAssignments, _super);\n /**\n * Creates a new instance of the RoleAssignments class\n *\n * @param baseUrl The url or Queryable which forms the parent of this fields collection\n */\n function RoleAssignments(baseUrl, path) {\n if (path === void 0) { path = \"roleassignments\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * Adds a new role assignment with the specified principal and role definitions to the collection.\n *\n * @param principalId The ID of the user or group to assign permissions to\n * @param roleDefId The ID of the role definition that defines the permissions to assign\n *\n */\n RoleAssignments.prototype.add = function (principalId, roleDefId) {\n return this.clone(RoleAssignments, \"addroleassignment(principalid=\" + principalId + \", roledefid=\" + roleDefId + \")\", true).post();\n };\n /**\n * Removes the role assignment with the specified principal and role definition from the collection\n *\n * @param principalId The ID of the user or group in the role assignment.\n * @param roleDefId The ID of the role definition in the role assignment\n *\n */\n RoleAssignments.prototype.remove = function (principalId, roleDefId) {\n return this.clone(RoleAssignments, \"removeroleassignment(principalid=\" + principalId + \", roledefid=\" + roleDefId + \")\", true).post();\n };\n /**\n * Gets the role assignment associated with the specified principal ID from the collection.\n *\n * @param id The id of the role assignment\n */\n RoleAssignments.prototype.getById = function (id) {\n var ra = new RoleAssignment(this);\n ra.concat(\"(\" + id + \")\");\n return ra;\n };\n return RoleAssignments;\n}(queryable_1.QueryableCollection));\nexports.RoleAssignments = RoleAssignments;\nvar RoleAssignment = (function (_super) {\n __extends(RoleAssignment, _super);\n function RoleAssignment() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(RoleAssignment.prototype, \"groups\", {\n get: function () {\n return new sitegroups_1.SiteGroups(this, \"groups\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RoleAssignment.prototype, \"bindings\", {\n /**\n * Get the role definition bindings for this role assignment\n *\n */\n get: function () {\n return new RoleDefinitionBindings(this);\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Delete this role assignment\n *\n */\n RoleAssignment.prototype.delete = function () {\n return this.post({\n headers: {\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n return RoleAssignment;\n}(queryable_1.QueryableInstance));\nexports.RoleAssignment = RoleAssignment;\nvar RoleDefinitions = (function (_super) {\n __extends(RoleDefinitions, _super);\n /**\n * Creates a new instance of the RoleDefinitions class\n *\n * @param baseUrl The url or Queryable which forms the parent of this fields collection\n * @param path\n *\n */\n function RoleDefinitions(baseUrl, path) {\n if (path === void 0) { path = \"roledefinitions\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * Gets the role definition with the specified ID from the collection.\n *\n * @param id The ID of the role definition.\n *\n */\n RoleDefinitions.prototype.getById = function (id) {\n return new RoleDefinition(this, \"getById(\" + id + \")\");\n };\n /**\n * Gets the role definition with the specified name.\n *\n * @param name The name of the role definition.\n *\n */\n RoleDefinitions.prototype.getByName = function (name) {\n return new RoleDefinition(this, \"getbyname('\" + name + \"')\");\n };\n /**\n * Gets the role definition with the specified type.\n *\n * @param name The name of the role definition.\n *\n */\n RoleDefinitions.prototype.getByType = function (roleTypeKind) {\n return new RoleDefinition(this, \"getbytype(\" + roleTypeKind + \")\");\n };\n /**\n * Create a role definition\n *\n * @param name The new role definition's name\n * @param description The new role definition's description\n * @param order The order in which the role definition appears\n * @param basePermissions The permissions mask for this role definition\n *\n */\n RoleDefinitions.prototype.add = function (name, description, order, basePermissions) {\n var _this = this;\n var postBody = JSON.stringify({\n BasePermissions: util_1.Util.extend({ __metadata: { type: \"SP.BasePermissions\" } }, basePermissions),\n Description: description,\n Name: name,\n Order: order,\n __metadata: { \"type\": \"SP.RoleDefinition\" },\n });\n return this.post({ body: postBody }).then(function (data) {\n return {\n data: data,\n definition: _this.getById(data.Id),\n };\n });\n };\n return RoleDefinitions;\n}(queryable_1.QueryableCollection));\nexports.RoleDefinitions = RoleDefinitions;\nvar RoleDefinition = (function (_super) {\n __extends(RoleDefinition, _super);\n function RoleDefinition() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Updates this web intance with the supplied properties\n *\n * @param properties A plain object hash of values to update for the web\n */\n /* tslint:disable no-string-literal */\n RoleDefinition.prototype.update = function (properties) {\n var _this = this;\n if (typeof properties.hasOwnProperty(\"BasePermissions\") !== \"undefined\") {\n properties[\"BasePermissions\"] = util_1.Util.extend({ __metadata: { type: \"SP.BasePermissions\" } }, properties[\"BasePermissions\"]);\n }\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": \"SP.RoleDefinition\" },\n }, properties));\n return this.post({\n body: postBody,\n headers: {\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n var retDef = _this;\n if (properties.hasOwnProperty(\"Name\")) {\n var parent_1 = _this.getParent(RoleDefinitions, _this.parentUrl, \"\");\n retDef = parent_1.getByName(properties[\"Name\"]);\n }\n return {\n data: data,\n definition: retDef,\n };\n });\n };\n /* tslint:enable */\n /**\n * Delete this role definition\n *\n */\n RoleDefinition.prototype.delete = function () {\n return this.post({\n headers: {\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n return RoleDefinition;\n}(queryable_1.QueryableInstance));\nexports.RoleDefinition = RoleDefinition;\nvar RoleDefinitionBindings = (function (_super) {\n __extends(RoleDefinitionBindings, _super);\n function RoleDefinitionBindings(baseUrl, path) {\n if (path === void 0) { path = \"roledefinitionbindings\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n return RoleDefinitionBindings;\n}(queryable_1.QueryableCollection));\nexports.RoleDefinitionBindings = RoleDefinitionBindings;\n\n\n/***/ }),\n/* 18 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar queryable_1 = __webpack_require__(1);\nvar siteusers_1 = __webpack_require__(30);\nvar util_1 = __webpack_require__(0);\n/**\n * Principal Type enum\n *\n */\nvar PrincipalType;\n(function (PrincipalType) {\n PrincipalType[PrincipalType[\"None\"] = 0] = \"None\";\n PrincipalType[PrincipalType[\"User\"] = 1] = \"User\";\n PrincipalType[PrincipalType[\"DistributionList\"] = 2] = \"DistributionList\";\n PrincipalType[PrincipalType[\"SecurityGroup\"] = 4] = \"SecurityGroup\";\n PrincipalType[PrincipalType[\"SharePointGroup\"] = 8] = \"SharePointGroup\";\n PrincipalType[PrincipalType[\"All\"] = 15] = \"All\";\n})(PrincipalType = exports.PrincipalType || (exports.PrincipalType = {}));\n/**\n * Describes a collection of site users\n *\n */\nvar SiteGroups = (function (_super) {\n __extends(SiteGroups, _super);\n /**\n * Creates a new instance of the SiteUsers class\n *\n * @param baseUrl The url or Queryable which forms the parent of this user collection\n */\n function SiteGroups(baseUrl, path) {\n if (path === void 0) { path = \"sitegroups\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * Adds a new group to the site collection\n *\n * @param props The properties to be updated\n */\n SiteGroups.prototype.add = function (properties) {\n var _this = this;\n var postBody = JSON.stringify(util_1.Util.extend({ \"__metadata\": { \"type\": \"SP.Group\" } }, properties));\n return this.post({ body: postBody }).then(function (data) {\n return {\n data: data,\n group: _this.getById(data.Id),\n };\n });\n };\n /**\n * Gets a group from the collection by name\n *\n * @param email The name of the group\n */\n SiteGroups.prototype.getByName = function (groupName) {\n return new SiteGroup(this, \"getByName('\" + groupName + \"')\");\n };\n /**\n * Gets a group from the collection by id\n *\n * @param id The id of the group\n */\n SiteGroups.prototype.getById = function (id) {\n var sg = new SiteGroup(this);\n sg.concat(\"(\" + id + \")\");\n return sg;\n };\n /**\n * Removes the group with the specified member ID from the collection.\n *\n * @param id The id of the group to remove\n */\n SiteGroups.prototype.removeById = function (id) {\n return this.clone(SiteGroups, \"removeById('\" + id + \"')\", true).post();\n };\n /**\n * Removes a user from the collection by login name\n *\n * @param loginName The login name of the user\n */\n SiteGroups.prototype.removeByLoginName = function (loginName) {\n return this.clone(SiteGroups, \"removeByLoginName('\" + loginName + \"')\", true).post();\n };\n return SiteGroups;\n}(queryable_1.QueryableCollection));\nexports.SiteGroups = SiteGroups;\n/**\n * Describes a single group\n *\n */\nvar SiteGroup = (function (_super) {\n __extends(SiteGroup, _super);\n function SiteGroup() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(SiteGroup.prototype, \"users\", {\n /**\n * Get's the users for this group\n *\n */\n get: function () {\n return new siteusers_1.SiteUsers(this, \"users\");\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Updates this group instance with the supplied properties\n *\n * @param properties A GroupWriteableProperties object of property names and values to update for the user\n */\n /* tslint:disable no-string-literal */\n SiteGroup.prototype.update = function (properties) {\n var _this = this;\n var postBody = util_1.Util.extend({ \"__metadata\": { \"type\": \"SP.Group\" } }, properties);\n return this.post({\n body: JSON.stringify(postBody),\n headers: {\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n var retGroup = _this;\n if (properties.hasOwnProperty(\"Title\")) {\n retGroup = _this.getParent(SiteGroup, _this.parentUrl, \"getByName('\" + properties[\"Title\"] + \"')\");\n }\n return {\n data: data,\n group: retGroup,\n };\n });\n };\n return SiteGroup;\n}(queryable_1.QueryableInstance));\nexports.SiteGroup = SiteGroup;\n\n\n/***/ }),\n/* 19 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar queryable_1 = __webpack_require__(1);\nvar util_1 = __webpack_require__(0);\nvar UserCustomActions = (function (_super) {\n __extends(UserCustomActions, _super);\n function UserCustomActions(baseUrl, path) {\n if (path === void 0) { path = \"usercustomactions\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * Returns the custom action with the specified identifier.\n *\n * @param id The GUID ID of the user custom action to get.\n */\n UserCustomActions.prototype.getById = function (id) {\n var uca = new UserCustomAction(this);\n uca.concat(\"('\" + id + \"')\");\n return uca;\n };\n /**\n * Create a custom action\n *\n * @param creationInfo The information which defines the new custom action\n *\n */\n UserCustomActions.prototype.add = function (properties) {\n var _this = this;\n var postBody = JSON.stringify(util_1.Util.extend({ __metadata: { \"type\": \"SP.UserCustomAction\" } }, properties));\n return this.post({ body: postBody }).then(function (data) {\n return {\n action: _this.getById(data.Id),\n data: data,\n };\n });\n };\n /**\n * Deletes all custom actions in the collection.\n *\n */\n UserCustomActions.prototype.clear = function () {\n return this.clone(UserCustomActions, \"clear\", true).post();\n };\n return UserCustomActions;\n}(queryable_1.QueryableCollection));\nexports.UserCustomActions = UserCustomActions;\nvar UserCustomAction = (function (_super) {\n __extends(UserCustomAction, _super);\n function UserCustomAction() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n UserCustomAction.prototype.update = function (properties) {\n var _this = this;\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": \"SP.UserCustomAction\" },\n }, properties));\n return this.post({\n body: postBody,\n headers: {\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n return {\n action: _this,\n data: data,\n };\n });\n };\n /**\n * Remove a custom action\n *\n */\n UserCustomAction.prototype.delete = function () {\n return _super.prototype.delete.call(this);\n };\n return UserCustomAction;\n}(queryable_1.QueryableInstance));\nexports.UserCustomAction = UserCustomAction;\n\n\n/***/ }),\n/* 20 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar storage = __webpack_require__(14);\nvar exceptions_1 = __webpack_require__(3);\n/**\n * A caching provider which can wrap other non-caching providers\n *\n */\nvar CachingConfigurationProvider = (function () {\n /**\n * Creates a new caching configuration provider\n * @constructor\n * @param {IConfigurationProvider} wrappedProvider Provider which will be used to fetch the configuration\n * @param {string} cacheKey Key that will be used to store cached items to the cache\n * @param {IPnPClientStore} cacheStore OPTIONAL storage, which will be used to store cached settings.\n */\n function CachingConfigurationProvider(wrappedProvider, cacheKey, cacheStore) {\n this.wrappedProvider = wrappedProvider;\n this.store = (cacheStore) ? cacheStore : this.selectPnPCache();\n this.cacheKey = \"_configcache_\" + cacheKey;\n }\n /**\n * Gets the wrapped configuration providers\n *\n * @return {IConfigurationProvider} Wrapped configuration provider\n */\n CachingConfigurationProvider.prototype.getWrappedProvider = function () {\n return this.wrappedProvider;\n };\n /**\n * Loads the configuration values either from the cache or from the wrapped provider\n *\n * @return {Promise>} Promise of loaded configuration values\n */\n CachingConfigurationProvider.prototype.getConfiguration = function () {\n var _this = this;\n // Cache not available, pass control to the wrapped provider\n if ((!this.store) || (!this.store.enabled)) {\n return this.wrappedProvider.getConfiguration();\n }\n // Value is found in cache, return it directly\n var cachedConfig = this.store.get(this.cacheKey);\n if (cachedConfig) {\n return new Promise(function (resolve) {\n resolve(cachedConfig);\n });\n }\n // Get and cache value from the wrapped provider\n var providerPromise = this.wrappedProvider.getConfiguration();\n providerPromise.then(function (providedConfig) {\n _this.store.put(_this.cacheKey, providedConfig);\n });\n return providerPromise;\n };\n CachingConfigurationProvider.prototype.selectPnPCache = function () {\n var pnpCache = new storage.PnPClientStorage();\n if ((pnpCache.local) && (pnpCache.local.enabled)) {\n return pnpCache.local;\n }\n if ((pnpCache.session) && (pnpCache.session.enabled)) {\n return pnpCache.session;\n }\n throw new exceptions_1.NoCacheAvailableException();\n };\n return CachingConfigurationProvider;\n}());\nexports.default = CachingConfigurationProvider;\n\n\n/***/ }),\n/* 21 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/* WEBPACK VAR INJECTION */(function(global) {\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Makes requests using the fetch API\n */\nvar FetchClient = (function () {\n function FetchClient() {\n }\n FetchClient.prototype.fetch = function (url, options) {\n return global.fetch(url, options);\n };\n return FetchClient;\n}());\nexports.FetchClient = FetchClient;\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(32)))\n\n/***/ }),\n/* 22 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar storage_1 = __webpack_require__(14);\nvar util_1 = __webpack_require__(0);\nvar pnplibconfig_1 = __webpack_require__(4);\nvar CachingOptions = (function () {\n function CachingOptions(key) {\n this.key = key;\n this.expiration = util_1.Util.dateAdd(new Date(), \"second\", pnplibconfig_1.RuntimeConfig.defaultCachingTimeoutSeconds);\n this.storeName = pnplibconfig_1.RuntimeConfig.defaultCachingStore;\n }\n Object.defineProperty(CachingOptions.prototype, \"store\", {\n get: function () {\n if (this.storeName === \"local\") {\n return CachingOptions.storage.local;\n }\n else {\n return CachingOptions.storage.session;\n }\n },\n enumerable: true,\n configurable: true\n });\n return CachingOptions;\n}());\nCachingOptions.storage = new storage_1.PnPClientStorage();\nexports.CachingOptions = CachingOptions;\nvar CachingParserWrapper = (function () {\n function CachingParserWrapper(_parser, _cacheOptions) {\n this._parser = _parser;\n this._cacheOptions = _cacheOptions;\n }\n CachingParserWrapper.prototype.parse = function (response) {\n var _this = this;\n // add this to the cache based on the options\n return this._parser.parse(response).then(function (data) {\n if (_this._cacheOptions.store !== null) {\n _this._cacheOptions.store.put(_this._cacheOptions.key, data, _this._cacheOptions.expiration);\n }\n return data;\n });\n };\n return CachingParserWrapper;\n}());\nexports.CachingParserWrapper = CachingParserWrapper;\n\n\n/***/ }),\n/* 23 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar queryable_1 = __webpack_require__(1);\n/**\n * Describes a collection of List objects\n *\n */\nvar Features = (function (_super) {\n __extends(Features, _super);\n /**\n * Creates a new instance of the Lists class\n *\n * @param baseUrl The url or Queryable which forms the parent of this fields collection\n */\n function Features(baseUrl, path) {\n if (path === void 0) { path = \"features\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * Gets a list from the collection by guid id\n *\n * @param id The Id of the feature (GUID)\n */\n Features.prototype.getById = function (id) {\n var feature = new Feature(this);\n feature.concat(\"('\" + id + \"')\");\n return feature;\n };\n /**\n * Adds a new list to the collection\n *\n * @param id The Id of the feature (GUID)\n * @param force If true the feature activation will be forced\n */\n Features.prototype.add = function (id, force) {\n var _this = this;\n if (force === void 0) { force = false; }\n return this.clone(Features, \"add\", true).post({\n body: JSON.stringify({\n featdefScope: 0,\n featureId: id,\n force: force,\n }),\n }).then(function (data) {\n return {\n data: data,\n feature: _this.getById(id),\n };\n });\n };\n /**\n * Removes (deactivates) a feature from the collection\n *\n * @param id The Id of the feature (GUID)\n * @param force If true the feature deactivation will be forced\n */\n Features.prototype.remove = function (id, force) {\n if (force === void 0) { force = false; }\n return this.clone(Features, \"remove\", true).post({\n body: JSON.stringify({\n featureId: id,\n force: force,\n }),\n });\n };\n return Features;\n}(queryable_1.QueryableCollection));\nexports.Features = Features;\nvar Feature = (function (_super) {\n __extends(Feature, _super);\n function Feature() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Removes (deactivates) a feature from the collection\n *\n * @param force If true the feature deactivation will be forced\n */\n Feature.prototype.deactivate = function (force) {\n var _this = this;\n if (force === void 0) { force = false; }\n var removeDependency = this.addBatchDependency();\n var idGet = new Feature(this).select(\"DefinitionId\");\n return idGet.getAs().then(function (feature) {\n var promise = _this.getParent(Features, _this.parentUrl, \"\", _this.batch).remove(feature.DefinitionId, force);\n removeDependency();\n return promise;\n });\n };\n return Feature;\n}(queryable_1.QueryableInstance));\nexports.Feature = Feature;\n\n\n/***/ }),\n/* 24 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar queryable_1 = __webpack_require__(1);\nvar util_1 = __webpack_require__(0);\nvar types_1 = __webpack_require__(13);\n/**\n * Describes a collection of Field objects\n *\n */\nvar Fields = (function (_super) {\n __extends(Fields, _super);\n /**\n * Creates a new instance of the Fields class\n *\n * @param baseUrl The url or Queryable which forms the parent of this fields collection\n */\n function Fields(baseUrl, path) {\n if (path === void 0) { path = \"fields\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * Gets a field from the collection by title\n *\n * @param title The case-sensitive title of the field\n */\n Fields.prototype.getByTitle = function (title) {\n return new Field(this, \"getByTitle('\" + title + \"')\");\n };\n /**\n * Gets a field from the collection by using internal name or title\n *\n * @param name The case-sensitive internal name or title of the field\n */\n Fields.prototype.getByInternalNameOrTitle = function (name) {\n return new Field(this, \"getByInternalNameOrTitle('\" + name + \"')\");\n };\n /**\n * Gets a list from the collection by guid id\n *\n * @param title The Id of the list\n */\n Fields.prototype.getById = function (id) {\n var f = new Field(this);\n f.concat(\"('\" + id + \"')\");\n return f;\n };\n /**\n * Creates a field based on the specified schema\n */\n Fields.prototype.createFieldAsXml = function (xml) {\n var _this = this;\n var info;\n if (typeof xml === \"string\") {\n info = { SchemaXml: xml };\n }\n else {\n info = xml;\n }\n var postBody = JSON.stringify({\n \"parameters\": util_1.Util.extend({\n \"__metadata\": {\n \"type\": \"SP.XmlSchemaFieldCreationInformation\",\n },\n }, info),\n });\n return this.clone(Fields, \"createfieldasxml\", true).postAs({ body: postBody }).then(function (data) {\n return {\n data: data,\n field: _this.getById(data.Id),\n };\n });\n };\n /**\n * Adds a new list to the collection\n *\n * @param title The new field's title\n * @param fieldType The new field's type (ex: SP.FieldText)\n * @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx)\n */\n Fields.prototype.add = function (title, fieldType, properties) {\n var _this = this;\n if (properties === void 0) { properties = {}; }\n var postBody = JSON.stringify(util_1.Util.extend({\n \"Title\": title,\n \"__metadata\": { \"type\": fieldType },\n }, properties));\n return this.clone(Fields, null, true).postAs({ body: postBody }).then(function (data) {\n return {\n data: data,\n field: _this.getById(data.Id),\n };\n });\n };\n /**\n * Adds a new SP.FieldText to the collection\n *\n * @param title The field title\n * @param maxLength The maximum number of characters allowed in the value of the field.\n * @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx)\n */\n Fields.prototype.addText = function (title, maxLength, properties) {\n if (maxLength === void 0) { maxLength = 255; }\n var props = {\n FieldTypeKind: 2,\n MaxLength: maxLength,\n };\n return this.add(title, \"SP.FieldText\", util_1.Util.extend(props, properties));\n };\n /**\n * Adds a new SP.FieldCalculated to the collection\n *\n * @param title The field title.\n * @param formula The formula for the field.\n * @param dateFormat The date and time format that is displayed in the field.\n * @param outputType Specifies the output format for the field. Represents a FieldType value.\n * @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx)\n */\n Fields.prototype.addCalculated = function (title, formula, dateFormat, outputType, properties) {\n if (outputType === void 0) { outputType = types_1.FieldTypes.Text; }\n var props = {\n DateFormat: dateFormat,\n FieldTypeKind: 17,\n Formula: formula,\n OutputType: outputType,\n };\n return this.add(title, \"SP.FieldCalculated\", util_1.Util.extend(props, properties));\n };\n /**\n * Adds a new SP.FieldDateTime to the collection\n *\n * @param title The field title\n * @param displayFormat The format of the date and time that is displayed in the field.\n * @param calendarType Specifies the calendar type of the field.\n * @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx)\n */\n Fields.prototype.addDateTime = function (title, displayFormat, calendarType, friendlyDisplayFormat, properties) {\n if (displayFormat === void 0) { displayFormat = types_1.DateTimeFieldFormatType.DateOnly; }\n if (calendarType === void 0) { calendarType = types_1.CalendarType.Gregorian; }\n if (friendlyDisplayFormat === void 0) { friendlyDisplayFormat = 0; }\n var props = {\n DateTimeCalendarType: calendarType,\n DisplayFormat: displayFormat,\n FieldTypeKind: 4,\n FriendlyDisplayFormat: friendlyDisplayFormat,\n };\n return this.add(title, \"SP.FieldDateTime\", util_1.Util.extend(props, properties));\n };\n /**\n * Adds a new SP.FieldNumber to the collection\n *\n * @param title The field title\n * @param minValue The field's minimum value\n * @param maxValue The field's maximum value\n * @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx)\n */\n Fields.prototype.addNumber = function (title, minValue, maxValue, properties) {\n var props = { FieldTypeKind: 9 };\n if (typeof minValue !== \"undefined\") {\n props = util_1.Util.extend({ MinimumValue: minValue }, props);\n }\n if (typeof maxValue !== \"undefined\") {\n props = util_1.Util.extend({ MaximumValue: maxValue }, props);\n }\n return this.add(title, \"SP.FieldNumber\", util_1.Util.extend(props, properties));\n };\n /**\n * Adds a new SP.FieldCurrency to the collection\n *\n * @param title The field title\n * @param minValue The field's minimum value\n * @param maxValue The field's maximum value\n * @param currencyLocalId Specifies the language code identifier (LCID) used to format the value of the field\n * @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx)\n */\n Fields.prototype.addCurrency = function (title, minValue, maxValue, currencyLocalId, properties) {\n if (currencyLocalId === void 0) { currencyLocalId = 1033; }\n var props = {\n CurrencyLocaleId: currencyLocalId,\n FieldTypeKind: 10,\n };\n if (typeof minValue !== \"undefined\") {\n props = util_1.Util.extend({ MinimumValue: minValue }, props);\n }\n if (typeof maxValue !== \"undefined\") {\n props = util_1.Util.extend({ MaximumValue: maxValue }, props);\n }\n return this.add(title, \"SP.FieldCurrency\", util_1.Util.extend(props, properties));\n };\n /**\n * Adds a new SP.FieldMultiLineText to the collection\n *\n * @param title The field title\n * @param numberOfLines Specifies the number of lines of text to display for the field.\n * @param richText Specifies whether the field supports rich formatting.\n * @param restrictedMode Specifies whether the field supports a subset of rich formatting.\n * @param appendOnly Specifies whether all changes to the value of the field are displayed in list forms.\n * @param allowHyperlink Specifies whether a hyperlink is allowed as a value of the field.\n * @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx)\n *\n */\n Fields.prototype.addMultilineText = function (title, numberOfLines, richText, restrictedMode, appendOnly, allowHyperlink, properties) {\n if (numberOfLines === void 0) { numberOfLines = 6; }\n if (richText === void 0) { richText = true; }\n if (restrictedMode === void 0) { restrictedMode = false; }\n if (appendOnly === void 0) { appendOnly = false; }\n if (allowHyperlink === void 0) { allowHyperlink = true; }\n var props = {\n AllowHyperlink: allowHyperlink,\n AppendOnly: appendOnly,\n FieldTypeKind: 3,\n NumberOfLines: numberOfLines,\n RestrictedMode: restrictedMode,\n RichText: richText,\n };\n return this.add(title, \"SP.FieldMultiLineText\", util_1.Util.extend(props, properties));\n };\n /**\n * Adds a new SP.FieldUrl to the collection\n *\n * @param title The field title\n */\n Fields.prototype.addUrl = function (title, displayFormat, properties) {\n if (displayFormat === void 0) { displayFormat = types_1.UrlFieldFormatType.Hyperlink; }\n var props = {\n DisplayFormat: displayFormat,\n FieldTypeKind: 11,\n };\n return this.add(title, \"SP.FieldUrl\", util_1.Util.extend(props, properties));\n };\n return Fields;\n}(queryable_1.QueryableCollection));\nexports.Fields = Fields;\n/**\n * Describes a single of Field instance\n *\n */\nvar Field = (function (_super) {\n __extends(Field, _super);\n function Field() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Updates this field intance with the supplied properties\n *\n * @param properties A plain object hash of values to update for the list\n * @param fieldType The type value, required to update child field type properties\n */\n Field.prototype.update = function (properties, fieldType) {\n var _this = this;\n if (fieldType === void 0) { fieldType = \"SP.Field\"; }\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": fieldType },\n }, properties));\n return this.post({\n body: postBody,\n headers: {\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n return {\n data: data,\n field: _this,\n };\n });\n };\n /**\n * Delete this fields\n *\n */\n Field.prototype.delete = function () {\n return this.post({\n headers: {\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n /**\n * Sets the value of the ShowInDisplayForm property for this field.\n */\n Field.prototype.setShowInDisplayForm = function (show) {\n return this.clone(Field, \"setshowindisplayform(\" + show + \")\", true).post();\n };\n /**\n * Sets the value of the ShowInEditForm property for this field.\n */\n Field.prototype.setShowInEditForm = function (show) {\n return this.clone(Field, \"setshowineditform(\" + show + \")\", true).post();\n };\n /**\n * Sets the value of the ShowInNewForm property for this field.\n */\n Field.prototype.setShowInNewForm = function (show) {\n return this.clone(Field, \"setshowinnewform(\" + show + \")\", true).post();\n };\n return Field;\n}(queryable_1.QueryableInstance));\nexports.Field = Field;\n\n\n/***/ }),\n/* 25 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar util_1 = __webpack_require__(0);\nvar queryable_1 = __webpack_require__(1);\n/**\n * Represents a collection of navigation nodes\n *\n */\nvar NavigationNodes = (function (_super) {\n __extends(NavigationNodes, _super);\n function NavigationNodes() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Gets a navigation node by id\n *\n * @param id The id of the node\n */\n NavigationNodes.prototype.getById = function (id) {\n var node = new NavigationNode(this);\n node.concat(\"(\" + id + \")\");\n return node;\n };\n /**\n * Adds a new node to the collection\n *\n * @param title Display name of the node\n * @param url The url of the node\n * @param visible If true the node is visible, otherwise it is hidden (default: true)\n */\n NavigationNodes.prototype.add = function (title, url, visible) {\n var _this = this;\n if (visible === void 0) { visible = true; }\n var postBody = JSON.stringify({\n IsVisible: visible,\n Title: title,\n Url: url,\n \"__metadata\": { \"type\": \"SP.NavigationNode\" },\n });\n return this.clone(NavigationNodes, null, true).post({ body: postBody }).then(function (data) {\n return {\n data: data,\n node: _this.getById(data.Id),\n };\n });\n };\n /**\n * Moves a node to be after another node in the navigation\n *\n * @param nodeId Id of the node to move\n * @param previousNodeId Id of the node after which we move the node specified by nodeId\n */\n NavigationNodes.prototype.moveAfter = function (nodeId, previousNodeId) {\n var postBody = JSON.stringify({\n nodeId: nodeId,\n previousNodeId: previousNodeId,\n });\n return this.clone(NavigationNodes, \"MoveAfter\", true).post({ body: postBody });\n };\n return NavigationNodes;\n}(queryable_1.QueryableCollection));\nexports.NavigationNodes = NavigationNodes;\nvar NavigationNode = (function (_super) {\n __extends(NavigationNode, _super);\n function NavigationNode() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(NavigationNode.prototype, \"children\", {\n /**\n * Represents the child nodes of this node\n */\n get: function () {\n return new NavigationNodes(this, \"Children\");\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Updates this node based on the supplied properties\n *\n * @param properties The hash of key/value pairs to update\n */\n NavigationNode.prototype.update = function (properties) {\n var _this = this;\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": \"SP.NavigationNode\" },\n }, properties));\n return this.post({\n body: postBody,\n headers: {\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n return {\n data: data,\n node: _this,\n };\n });\n };\n /**\n * Deletes this node and any child nodes\n */\n NavigationNode.prototype.delete = function () {\n return _super.prototype.delete.call(this);\n };\n return NavigationNode;\n}(queryable_1.QueryableInstance));\nexports.NavigationNode = NavigationNode;\n/**\n * Exposes the navigation components\n *\n */\nvar Navigation = (function (_super) {\n __extends(Navigation, _super);\n /**\n * Creates a new instance of the Lists class\n *\n * @param baseUrl The url or Queryable which forms the parent of this fields collection\n */\n function Navigation(baseUrl, path) {\n if (path === void 0) { path = \"navigation\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n Object.defineProperty(Navigation.prototype, \"quicklaunch\", {\n /**\n * Gets the quicklaunch navigation for the current context\n *\n */\n get: function () {\n return new NavigationNodes(this, \"quicklaunch\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Navigation.prototype, \"topNavigationBar\", {\n /**\n * Gets the top bar navigation navigation for the current context\n *\n */\n get: function () {\n return new NavigationNodes(this, \"topnavigationbar\");\n },\n enumerable: true,\n configurable: true\n });\n return Navigation;\n}(queryable_1.Queryable));\nexports.Navigation = Navigation;\n\n\n/***/ }),\n/* 26 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar webs_1 = __webpack_require__(7);\nvar roles_1 = __webpack_require__(17);\nvar types_1 = __webpack_require__(13);\nvar queryable_1 = __webpack_require__(1);\nvar QueryableSecurable = (function (_super) {\n __extends(QueryableSecurable, _super);\n function QueryableSecurable() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(QueryableSecurable.prototype, \"roleAssignments\", {\n /**\n * Gets the set of role assignments for this item\n *\n */\n get: function () {\n return new roles_1.RoleAssignments(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(QueryableSecurable.prototype, \"firstUniqueAncestorSecurableObject\", {\n /**\n * Gets the closest securable up the security hierarchy whose permissions are applied to this list item\n *\n */\n get: function () {\n return new queryable_1.QueryableInstance(this, \"FirstUniqueAncestorSecurableObject\");\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Gets the effective permissions for the user supplied\n *\n * @param loginName The claims username for the user (ex: i:0#.f|membership|user@domain.com)\n */\n QueryableSecurable.prototype.getUserEffectivePermissions = function (loginName) {\n var q = this.clone(queryable_1.Queryable, \"getUserEffectivePermissions(@user)\", true);\n q.query.add(\"@user\", \"'\" + encodeURIComponent(loginName) + \"'\");\n return q.getAs();\n };\n /**\n * Gets the effective permissions for the current user\n */\n QueryableSecurable.prototype.getCurrentUserEffectivePermissions = function () {\n var _this = this;\n var w = webs_1.Web.fromUrl(this.toUrl());\n return w.currentUser.select(\"LoginName\").getAs().then(function (user) {\n return _this.getUserEffectivePermissions(user.LoginName);\n });\n };\n /**\n * Breaks the security inheritance at this level optinally copying permissions and clearing subscopes\n *\n * @param copyRoleAssignments If true the permissions are copied from the current parent scope\n * @param clearSubscopes Optional. true to make all child securable objects inherit role assignments from the current object\n */\n QueryableSecurable.prototype.breakRoleInheritance = function (copyRoleAssignments, clearSubscopes) {\n if (copyRoleAssignments === void 0) { copyRoleAssignments = false; }\n if (clearSubscopes === void 0) { clearSubscopes = false; }\n return this.clone(QueryableSecurable, \"breakroleinheritance(copyroleassignments=\" + copyRoleAssignments + \", clearsubscopes=\" + clearSubscopes + \")\", true).post();\n };\n /**\n * Removes the local role assignments so that it re-inherit role assignments from the parent object.\n *\n */\n QueryableSecurable.prototype.resetRoleInheritance = function () {\n return this.clone(QueryableSecurable, \"resetroleinheritance\", true).post();\n };\n /**\n * Determines if a given user has the appropriate permissions\n *\n * @param loginName The user to check\n * @param permission The permission being checked\n */\n QueryableSecurable.prototype.userHasPermissions = function (loginName, permission) {\n var _this = this;\n return this.getUserEffectivePermissions(loginName).then(function (perms) {\n return _this.hasPermissions(perms, permission);\n });\n };\n /**\n * Determines if the current user has the requested permissions\n *\n * @param permission The permission we wish to check\n */\n QueryableSecurable.prototype.currentUserHasPermissions = function (permission) {\n var _this = this;\n return this.getCurrentUserEffectivePermissions().then(function (perms) {\n return _this.hasPermissions(perms, permission);\n });\n };\n /**\n * Taken from sp.js, checks the supplied permissions against the mask\n *\n * @param value The security principal's permissions on the given object\n * @param perm The permission checked against the value\n */\n /* tslint:disable:no-bitwise */\n QueryableSecurable.prototype.hasPermissions = function (value, perm) {\n if (!perm) {\n return true;\n }\n if (perm === types_1.PermissionKind.FullMask) {\n return (value.High & 32767) === 32767 && value.Low === 65535;\n }\n perm = perm - 1;\n var num = 1;\n if (perm >= 0 && perm < 32) {\n num = num << perm;\n return 0 !== (value.Low & num);\n }\n else if (perm >= 32 && perm < 64) {\n num = num << perm - 32;\n return 0 !== (value.High & num);\n }\n return false;\n };\n return QueryableSecurable;\n}(queryable_1.QueryableInstance));\nexports.QueryableSecurable = QueryableSecurable;\n\n\n/***/ }),\n/* 27 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar queryable_1 = __webpack_require__(1);\nvar util_1 = __webpack_require__(0);\n/**\n * Describes the search API\n *\n */\nvar Search = (function (_super) {\n __extends(Search, _super);\n /**\n * Creates a new instance of the Search class\n *\n * @param baseUrl The url for the search context\n * @param query The SearchQuery object to execute\n */\n function Search(baseUrl, path) {\n if (path === void 0) { path = \"_api/search/postquery\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * .......\n * @returns Promise\n */\n Search.prototype.execute = function (query) {\n var formattedBody;\n formattedBody = query;\n if (formattedBody.SelectProperties) {\n formattedBody.SelectProperties = { results: query.SelectProperties };\n }\n if (formattedBody.RefinementFilters) {\n formattedBody.RefinementFilters = { results: query.RefinementFilters };\n }\n if (formattedBody.SortList) {\n formattedBody.SortList = { results: query.SortList };\n }\n if (formattedBody.HithighlightedProperties) {\n formattedBody.HithighlightedProperties = { results: query.HithighlightedProperties };\n }\n if (formattedBody.ReorderingRules) {\n formattedBody.ReorderingRules = { results: query.ReorderingRules };\n }\n if (formattedBody.Properties) {\n formattedBody.Properties = { results: query.Properties };\n }\n var postBody = JSON.stringify({\n request: util_1.Util.extend({\n \"__metadata\": { \"type\": \"Microsoft.Office.Server.Search.REST.SearchRequest\" },\n }, formattedBody),\n });\n return this.post({ body: postBody }).then(function (data) { return new SearchResults(data); });\n };\n return Search;\n}(queryable_1.QueryableInstance));\nexports.Search = Search;\n/**\n * Describes the SearchResults class, which returns the formatted and raw version of the query response\n */\nvar SearchResults = (function () {\n /**\n * Creates a new instance of the SearchResult class\n *\n */\n function SearchResults(rawResponse) {\n var response = rawResponse.postquery ? rawResponse.postquery : rawResponse;\n this.PrimarySearchResults = this.formatSearchResults(response.PrimaryQueryResult.RelevantResults.Table.Rows);\n this.RawSearchResults = response;\n this.ElapsedTime = response.ElapsedTime;\n this.RowCount = response.PrimaryQueryResult.RelevantResults.RowCount;\n this.TotalRows = response.PrimaryQueryResult.RelevantResults.TotalRows;\n this.TotalRowsIncludingDuplicates = response.PrimaryQueryResult.RelevantResults.TotalRowsIncludingDuplicates;\n }\n /**\n * Formats a search results array\n *\n * @param rawResults The array to process\n */\n SearchResults.prototype.formatSearchResults = function (rawResults) {\n var results = new Array(), tempResults = rawResults.results ? rawResults.results : rawResults;\n for (var _i = 0, tempResults_1 = tempResults; _i < tempResults_1.length; _i++) {\n var i = tempResults_1[_i];\n results.push(new SearchResult(i.Cells));\n }\n return results;\n };\n return SearchResults;\n}());\nexports.SearchResults = SearchResults;\n/**\n * Describes the SearchResult class\n */\nvar SearchResult = (function () {\n /**\n * Creates a new instance of the SearchResult class\n *\n */\n function SearchResult(rawItem) {\n var item = rawItem.results ? rawItem.results : rawItem;\n for (var _i = 0, item_1 = item; _i < item_1.length; _i++) {\n var i = item_1[_i];\n Object.defineProperty(this, i.Key, {\n configurable: false,\n enumerable: false,\n value: i.Value,\n writable: false,\n });\n }\n }\n return SearchResult;\n}());\nexports.SearchResult = SearchResult;\n/**\n * defines the SortDirection enum\n */\nvar SortDirection;\n(function (SortDirection) {\n SortDirection[SortDirection[\"Ascending\"] = 0] = \"Ascending\";\n SortDirection[SortDirection[\"Descending\"] = 1] = \"Descending\";\n SortDirection[SortDirection[\"FQLFormula\"] = 2] = \"FQLFormula\";\n})(SortDirection = exports.SortDirection || (exports.SortDirection = {}));\n/**\n * defines the ReorderingRuleMatchType enum\n */\nvar ReorderingRuleMatchType;\n(function (ReorderingRuleMatchType) {\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"ResultContainsKeyword\"] = 0] = \"ResultContainsKeyword\";\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"TitleContainsKeyword\"] = 1] = \"TitleContainsKeyword\";\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"TitleMatchesKeyword\"] = 2] = \"TitleMatchesKeyword\";\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"UrlStartsWith\"] = 3] = \"UrlStartsWith\";\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"UrlExactlyMatches\"] = 4] = \"UrlExactlyMatches\";\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"ContentTypeIs\"] = 5] = \"ContentTypeIs\";\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"FileExtensionMatches\"] = 6] = \"FileExtensionMatches\";\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"ResultHasTag\"] = 7] = \"ResultHasTag\";\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"ManualCondition\"] = 8] = \"ManualCondition\";\n})(ReorderingRuleMatchType = exports.ReorderingRuleMatchType || (exports.ReorderingRuleMatchType = {}));\n/**\n * Specifies the type value for the property\n */\nvar QueryPropertyValueType;\n(function (QueryPropertyValueType) {\n QueryPropertyValueType[QueryPropertyValueType[\"None\"] = 0] = \"None\";\n QueryPropertyValueType[QueryPropertyValueType[\"StringType\"] = 1] = \"StringType\";\n QueryPropertyValueType[QueryPropertyValueType[\"Int32TYpe\"] = 2] = \"Int32TYpe\";\n QueryPropertyValueType[QueryPropertyValueType[\"BooleanType\"] = 3] = \"BooleanType\";\n QueryPropertyValueType[QueryPropertyValueType[\"StringArrayType\"] = 4] = \"StringArrayType\";\n QueryPropertyValueType[QueryPropertyValueType[\"UnSupportedType\"] = 5] = \"UnSupportedType\";\n})(QueryPropertyValueType = exports.QueryPropertyValueType || (exports.QueryPropertyValueType = {}));\n\n\n/***/ }),\n/* 28 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar queryable_1 = __webpack_require__(1);\nvar SearchSuggest = (function (_super) {\n __extends(SearchSuggest, _super);\n function SearchSuggest(baseUrl, path) {\n if (path === void 0) { path = \"_api/search/suggest\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n SearchSuggest.prototype.execute = function (query) {\n this.mapQueryToQueryString(query);\n return this.get().then(function (response) { return new SearchSuggestResult(response); });\n };\n SearchSuggest.prototype.mapQueryToQueryString = function (query) {\n this.query.add(\"querytext\", \"'\" + query.querytext + \"'\");\n if (query.hasOwnProperty(\"count\")) {\n this.query.add(\"inumberofquerysuggestions\", query.count.toString());\n }\n if (query.hasOwnProperty(\"personalCount\")) {\n this.query.add(\"inumberofresultsuggestions\", query.personalCount.toString());\n }\n if (query.hasOwnProperty(\"preQuery\")) {\n this.query.add(\"fprequerysuggestions\", query.preQuery.toString());\n }\n if (query.hasOwnProperty(\"hitHighlighting\")) {\n this.query.add(\"fhithighlighting\", query.hitHighlighting.toString());\n }\n if (query.hasOwnProperty(\"capitalize\")) {\n this.query.add(\"fcapitalizefirstletters\", query.capitalize.toString());\n }\n if (query.hasOwnProperty(\"culture\")) {\n this.query.add(\"culture\", query.culture.toString());\n }\n if (query.hasOwnProperty(\"stemming\")) {\n this.query.add(\"enablestemming\", query.stemming.toString());\n }\n if (query.hasOwnProperty(\"includePeople\")) {\n this.query.add(\"showpeoplenamesuggestions\", query.includePeople.toString());\n }\n if (query.hasOwnProperty(\"queryRules\")) {\n this.query.add(\"enablequeryrules\", query.queryRules.toString());\n }\n if (query.hasOwnProperty(\"prefixMatch\")) {\n this.query.add(\"fprefixmatchallterms\", query.prefixMatch.toString());\n }\n };\n return SearchSuggest;\n}(queryable_1.QueryableInstance));\nexports.SearchSuggest = SearchSuggest;\nvar SearchSuggestResult = (function () {\n function SearchSuggestResult(json) {\n if (json.hasOwnProperty(\"suggest\")) {\n // verbose\n this.PeopleNames = json.suggest.PeopleNames.results;\n this.PersonalResults = json.suggest.PersonalResults.results;\n this.Queries = json.suggest.Queries.results;\n }\n else {\n this.PeopleNames = json.PeopleNames;\n this.PersonalResults = json.PersonalResults;\n this.Queries = json.Queries;\n }\n }\n return SearchSuggestResult;\n}());\nexports.SearchSuggestResult = SearchSuggestResult;\n\n\n/***/ }),\n/* 29 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar queryable_1 = __webpack_require__(1);\nvar webs_1 = __webpack_require__(7);\nvar usercustomactions_1 = __webpack_require__(19);\nvar odata_1 = __webpack_require__(2);\nvar features_1 = __webpack_require__(23);\n/**\n * Describes a site collection\n *\n */\nvar Site = (function (_super) {\n __extends(Site, _super);\n /**\n * Creates a new instance of the RoleAssignments class\n *\n * @param baseUrl The url or Queryable which forms the parent of this fields collection\n */\n function Site(baseUrl, path) {\n if (path === void 0) { path = \"_api/site\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n Object.defineProperty(Site.prototype, \"rootWeb\", {\n /**\n * Gets the root web of the site collection\n *\n */\n get: function () {\n return new webs_1.Web(this, \"rootweb\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Site.prototype, \"features\", {\n /**\n * Gets the active features for this site\n *\n */\n get: function () {\n return new features_1.Features(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Site.prototype, \"userCustomActions\", {\n /**\n * Get all custom actions on a site collection\n *\n */\n get: function () {\n return new usercustomactions_1.UserCustomActions(this);\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Gets the context information for the site.\n */\n Site.prototype.getContextInfo = function () {\n var q = new Site(this.parentUrl, \"_api/contextinfo\");\n return q.post().then(function (data) {\n if (data.hasOwnProperty(\"GetContextWebInformation\")) {\n var info = data.GetContextWebInformation;\n info.SupportedSchemaVersions = info.SupportedSchemaVersions.results;\n return info;\n }\n else {\n return data;\n }\n });\n };\n /**\n * Gets the document libraries on a site. Static method. (SharePoint Online only)\n *\n * @param absoluteWebUrl The absolute url of the web whose document libraries should be returned\n */\n Site.prototype.getDocumentLibraries = function (absoluteWebUrl) {\n var q = new queryable_1.Queryable(\"\", \"_api/sp.web.getdocumentlibraries(@v)\");\n q.query.add(\"@v\", \"'\" + absoluteWebUrl + \"'\");\n return q.get().then(function (data) {\n if (data.hasOwnProperty(\"GetDocumentLibraries\")) {\n return data.GetDocumentLibraries;\n }\n else {\n return data;\n }\n });\n };\n /**\n * Gets the site URL from a page URL.\n *\n * @param absolutePageUrl The absolute url of the page\n */\n Site.prototype.getWebUrlFromPageUrl = function (absolutePageUrl) {\n var q = new queryable_1.Queryable(\"\", \"_api/sp.web.getweburlfrompageurl(@v)\");\n q.query.add(\"@v\", \"'\" + absolutePageUrl + \"'\");\n return q.get().then(function (data) {\n if (data.hasOwnProperty(\"GetWebUrlFromPageUrl\")) {\n return data.GetWebUrlFromPageUrl;\n }\n else {\n return data;\n }\n });\n };\n /**\n * Creates a new batch for requests within the context of context this site\n *\n */\n Site.prototype.createBatch = function () {\n return new odata_1.ODataBatch(this.parentUrl);\n };\n return Site;\n}(queryable_1.QueryableInstance));\nexports.Site = Site;\n\n\n/***/ }),\n/* 30 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar queryable_1 = __webpack_require__(1);\nvar sitegroups_1 = __webpack_require__(18);\nvar util_1 = __webpack_require__(0);\n/**\n * Describes a collection of all site collection users\n *\n */\nvar SiteUsers = (function (_super) {\n __extends(SiteUsers, _super);\n /**\n * Creates a new instance of the Users class\n *\n * @param baseUrl The url or Queryable which forms the parent of this user collection\n */\n function SiteUsers(baseUrl, path) {\n if (path === void 0) { path = \"siteusers\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * Gets a user from the collection by email\n *\n * @param email The email of the user\n */\n SiteUsers.prototype.getByEmail = function (email) {\n return new SiteUser(this, \"getByEmail('\" + email + \"')\");\n };\n /**\n * Gets a user from the collection by id\n *\n * @param id The id of the user\n */\n SiteUsers.prototype.getById = function (id) {\n return new SiteUser(this, \"getById(\" + id + \")\");\n };\n /**\n * Gets a user from the collection by login name\n *\n * @param loginName The email address of the user\n */\n SiteUsers.prototype.getByLoginName = function (loginName) {\n var su = new SiteUser(this);\n su.concat(\"(@v)\");\n su.query.add(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\n return su;\n };\n /**\n * Removes a user from the collection by id\n *\n * @param id The id of the user\n */\n SiteUsers.prototype.removeById = function (id) {\n return this.clone(SiteUsers, \"removeById(\" + id + \")\", true).post();\n };\n /**\n * Removes a user from the collection by login name\n *\n * @param loginName The login name of the user\n */\n SiteUsers.prototype.removeByLoginName = function (loginName) {\n var o = this.clone(SiteUsers, \"removeByLoginName(@v)\", true);\n o.query.add(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\n return o.post();\n };\n /**\n * Add a user to a group\n *\n * @param loginName The login name of the user to add to the group\n *\n */\n SiteUsers.prototype.add = function (loginName) {\n var _this = this;\n return this.clone(SiteUsers, null, true).post({\n body: JSON.stringify({ \"__metadata\": { \"type\": \"SP.User\" }, LoginName: loginName }),\n }).then(function () { return _this.getByLoginName(loginName); });\n };\n return SiteUsers;\n}(queryable_1.QueryableCollection));\nexports.SiteUsers = SiteUsers;\n/**\n * Describes a single user\n *\n */\nvar SiteUser = (function (_super) {\n __extends(SiteUser, _super);\n function SiteUser() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(SiteUser.prototype, \"groups\", {\n /**\n * Get's the groups for this user.\n *\n */\n get: function () {\n return new sitegroups_1.SiteGroups(this, \"groups\");\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Updates this user instance with the supplied properties\n *\n * @param properties A plain object of property names and values to update for the user\n */\n SiteUser.prototype.update = function (properties) {\n var _this = this;\n var postBody = util_1.Util.extend({ \"__metadata\": { \"type\": \"SP.User\" } }, properties);\n return this.post({\n body: JSON.stringify(postBody),\n headers: {\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n return {\n data: data,\n user: _this,\n };\n });\n };\n /**\n * Delete this user\n *\n */\n SiteUser.prototype.delete = function () {\n return this.post({\n headers: {\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n return SiteUser;\n}(queryable_1.QueryableInstance));\nexports.SiteUser = SiteUser;\n/**\n * Represents the current user\n */\nvar CurrentUser = (function (_super) {\n __extends(CurrentUser, _super);\n function CurrentUser(baseUrl, path) {\n if (path === void 0) { path = \"currentuser\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n return CurrentUser;\n}(queryable_1.QueryableInstance));\nexports.CurrentUser = CurrentUser;\n\n\n/***/ }),\n/* 31 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar logging_1 = __webpack_require__(5);\nfunction deprecated(message) {\n return function (target, propertyKey, descriptor) {\n var method = descriptor.value;\n descriptor.value = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n logging_1.Logger.log({\n data: {\n descriptor: descriptor,\n propertyKey: propertyKey,\n target: target,\n },\n level: logging_1.LogLevel.Warning,\n message: message,\n });\n return method.apply(this, args);\n };\n };\n}\nexports.deprecated = deprecated;\n\n\n/***/ }),\n/* 32 */\n/***/ (function(module, exports) {\n\nvar g;\r\n\r\n// This works in non-strict mode\r\ng = (function() {\r\n\treturn this;\r\n})();\r\n\r\ntry {\r\n\t// This works if eval is allowed (see CSP)\r\n\tg = g || Function(\"return this\")() || (1,eval)(\"this\");\r\n} catch(e) {\r\n\t// This works if the window reference is available\r\n\tif(typeof window === \"object\")\r\n\t\tg = window;\r\n}\r\n\r\n// g can still be undefined, but nothing to do about it...\r\n// We return undefined, instead of nothing here, so it's\r\n// easier to handle this case. if(!global) { ...}\r\n\r\nmodule.exports = g;\r\n\n\n/***/ }),\n/* 33 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar collections_1 = __webpack_require__(6);\n/**\n * Class used to manage the current application settings\n *\n */\nvar Settings = (function () {\n /**\n * Creates a new instance of the settings class\n *\n * @constructor\n */\n function Settings() {\n this._settings = new collections_1.Dictionary();\n }\n /**\n * Adds a new single setting, or overwrites a previous setting with the same key\n *\n * @param {string} key The key used to store this setting\n * @param {string} value The setting value to store\n */\n Settings.prototype.add = function (key, value) {\n this._settings.add(key, value);\n };\n /**\n * Adds a JSON value to the collection as a string, you must use getJSON to rehydrate the object when read\n *\n * @param {string} key The key used to store this setting\n * @param {any} value The setting value to store\n */\n Settings.prototype.addJSON = function (key, value) {\n this._settings.add(key, JSON.stringify(value));\n };\n /**\n * Applies the supplied hash to the setting collection overwriting any existing value, or created new values\n *\n * @param {TypedHash} hash The set of values to add\n */\n Settings.prototype.apply = function (hash) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n try {\n _this._settings.merge(hash);\n resolve();\n }\n catch (e) {\n reject(e);\n }\n });\n };\n /**\n * Loads configuration settings into the collection from the supplied provider and returns a Promise\n *\n * @param {IConfigurationProvider} provider The provider from which we will load the settings\n */\n Settings.prototype.load = function (provider) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n provider.getConfiguration().then(function (value) {\n _this._settings.merge(value);\n resolve();\n }).catch(function (reason) {\n reject(reason);\n });\n });\n };\n /**\n * Gets a value from the configuration\n *\n * @param {string} key The key whose value we want to return. Returns null if the key does not exist\n * @return {string} string value from the configuration\n */\n Settings.prototype.get = function (key) {\n return this._settings.get(key);\n };\n /**\n * Gets a JSON value, rehydrating the stored string to the original object\n *\n * @param {string} key The key whose value we want to return. Returns null if the key does not exist\n * @return {any} object from the configuration\n */\n Settings.prototype.getJSON = function (key) {\n var o = this.get(key);\n if (typeof o === \"undefined\" || o === null) {\n return o;\n }\n return JSON.parse(o);\n };\n return Settings;\n}());\nexports.Settings = Settings;\n\n\n/***/ }),\n/* 34 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar search_1 = __webpack_require__(27);\nvar searchsuggest_1 = __webpack_require__(28);\nvar site_1 = __webpack_require__(29);\nvar webs_1 = __webpack_require__(7);\nvar util_1 = __webpack_require__(0);\nvar userprofiles_1 = __webpack_require__(48);\nvar exceptions_1 = __webpack_require__(3);\n/**\n * Root of the SharePoint REST module\n */\nvar Rest = (function () {\n function Rest() {\n }\n /**\n * Executes a search against this web context\n *\n * @param query The SearchQuery definition\n */\n Rest.prototype.searchSuggest = function (query) {\n var finalQuery;\n if (typeof query === \"string\") {\n finalQuery = { querytext: query };\n }\n else {\n finalQuery = query;\n }\n return new searchsuggest_1.SearchSuggest(\"\").execute(finalQuery);\n };\n /**\n * Executes a search against this web context\n *\n * @param query The SearchQuery definition\n */\n Rest.prototype.search = function (query) {\n var finalQuery;\n if (typeof query === \"string\") {\n finalQuery = { Querytext: query };\n }\n else {\n finalQuery = query;\n }\n return new search_1.Search(\"\").execute(finalQuery);\n };\n Object.defineProperty(Rest.prototype, \"site\", {\n /**\n * Begins a site collection scoped REST request\n *\n */\n get: function () {\n return new site_1.Site(\"\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Rest.prototype, \"web\", {\n /**\n * Begins a web scoped REST request\n *\n */\n get: function () {\n return new webs_1.Web(\"\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Rest.prototype, \"profiles\", {\n /**\n * Access to user profile methods\n *\n */\n get: function () {\n return new userprofiles_1.UserProfileQuery(\"\");\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Creates a new batch object for use with the Queryable.addToBatch method\n *\n */\n Rest.prototype.createBatch = function () {\n return this.web.createBatch();\n };\n /**\n * Begins a cross-domain, host site scoped REST request, for use in add-in webs\n *\n * @param addInWebUrl The absolute url of the add-in web\n * @param hostWebUrl The absolute url of the host web\n */\n Rest.prototype.crossDomainSite = function (addInWebUrl, hostWebUrl) {\n return this._cdImpl(site_1.Site, addInWebUrl, hostWebUrl, \"site\");\n };\n /**\n * Begins a cross-domain, host web scoped REST request, for use in add-in webs\n *\n * @param addInWebUrl The absolute url of the add-in web\n * @param hostWebUrl The absolute url of the host web\n */\n Rest.prototype.crossDomainWeb = function (addInWebUrl, hostWebUrl) {\n return this._cdImpl(webs_1.Web, addInWebUrl, hostWebUrl, \"web\");\n };\n /**\n * Implements the creation of cross domain REST urls\n *\n * @param factory The constructor of the object to create Site | Web\n * @param addInWebUrl The absolute url of the add-in web\n * @param hostWebUrl The absolute url of the host web\n * @param urlPart String part to append to the url \"site\" | \"web\"\n */\n Rest.prototype._cdImpl = function (factory, addInWebUrl, hostWebUrl, urlPart) {\n if (!util_1.Util.isUrlAbsolute(addInWebUrl)) {\n throw new exceptions_1.UrlException(\"The addInWebUrl parameter must be an absolute url.\");\n }\n if (!util_1.Util.isUrlAbsolute(hostWebUrl)) {\n throw new exceptions_1.UrlException(\"The hostWebUrl parameter must be an absolute url.\");\n }\n var url = util_1.Util.combinePaths(addInWebUrl, \"_api/SP.AppContextSite(@target)\");\n var instance = new factory(url, urlPart);\n instance.query.add(\"@target\", \"'\" + encodeURIComponent(hostWebUrl) + \"'\");\n return instance;\n };\n return Rest;\n}());\nexports.Rest = Rest;\n\n\n/***/ }),\n/* 35 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nfunction __export(m) {\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\n}\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__export(__webpack_require__(44));\nvar httpclient_1 = __webpack_require__(15);\nexports.HttpClient = httpclient_1.HttpClient;\nvar sprequestexecutorclient_1 = __webpack_require__(40);\nexports.SPRequestExecutorClient = sprequestexecutorclient_1.SPRequestExecutorClient;\nvar nodefetchclient_1 = __webpack_require__(39);\nexports.NodeFetchClient = nodefetchclient_1.NodeFetchClient;\nvar fetchclient_1 = __webpack_require__(21);\nexports.FetchClient = fetchclient_1.FetchClient;\n__export(__webpack_require__(36));\nvar collections_1 = __webpack_require__(6);\nexports.Dictionary = collections_1.Dictionary;\nvar util_1 = __webpack_require__(0);\nexports.Util = util_1.Util;\n__export(__webpack_require__(5));\n__export(__webpack_require__(3));\n\n\n/***/ }),\n/* 36 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar cachingConfigurationProvider_1 = __webpack_require__(20);\nexports.CachingConfigurationProvider = cachingConfigurationProvider_1.default;\nvar spListConfigurationProvider_1 = __webpack_require__(37);\nexports.SPListConfigurationProvider = spListConfigurationProvider_1.default;\n\n\n/***/ }),\n/* 37 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar cachingConfigurationProvider_1 = __webpack_require__(20);\n/**\n * A configuration provider which loads configuration values from a SharePoint list\n *\n */\nvar SPListConfigurationProvider = (function () {\n /**\n * Creates a new SharePoint list based configuration provider\n * @constructor\n * @param {string} webUrl Url of the SharePoint site, where the configuration list is located\n * @param {string} listTitle Title of the SharePoint list, which contains the configuration settings (optional, default = \"config\")\n */\n function SPListConfigurationProvider(sourceWeb, sourceListTitle) {\n if (sourceListTitle === void 0) { sourceListTitle = \"config\"; }\n this.sourceWeb = sourceWeb;\n this.sourceListTitle = sourceListTitle;\n }\n Object.defineProperty(SPListConfigurationProvider.prototype, \"web\", {\n /**\n * Gets the url of the SharePoint site, where the configuration list is located\n *\n * @return {string} Url address of the site\n */\n get: function () {\n return this.sourceWeb;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SPListConfigurationProvider.prototype, \"listTitle\", {\n /**\n * Gets the title of the SharePoint list, which contains the configuration settings\n *\n * @return {string} List title\n */\n get: function () {\n return this.sourceListTitle;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Loads the configuration values from the SharePoint list\n *\n * @return {Promise>} Promise of loaded configuration values\n */\n SPListConfigurationProvider.prototype.getConfiguration = function () {\n return this.web.lists.getByTitle(this.listTitle).items.select(\"Title\", \"Value\")\n .getAs().then(function (data) {\n return data.reduce(function (configuration, item) {\n return Object.defineProperty(configuration, item.Title, {\n configurable: false,\n enumerable: false,\n value: item.Value,\n writable: false,\n });\n }, {});\n });\n };\n /**\n * Wraps the current provider in a cache enabled provider\n *\n * @return {CachingConfigurationProvider} Caching providers which wraps the current provider\n */\n SPListConfigurationProvider.prototype.asCaching = function () {\n var cacheKey = \"splist_\" + this.web.toUrl() + \"+\" + this.listTitle;\n return new cachingConfigurationProvider_1.default(this, cacheKey);\n };\n return SPListConfigurationProvider;\n}());\nexports.default = SPListConfigurationProvider;\n\n\n/***/ }),\n/* 38 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar collections_1 = __webpack_require__(6);\nvar util_1 = __webpack_require__(0);\nvar odata_1 = __webpack_require__(2);\nvar CachedDigest = (function () {\n function CachedDigest() {\n }\n return CachedDigest;\n}());\nexports.CachedDigest = CachedDigest;\n// allows for the caching of digests across all HttpClient's which each have their own DigestCache wrapper.\nvar digests = new collections_1.Dictionary();\nvar DigestCache = (function () {\n function DigestCache(_httpClient, _digests) {\n if (_digests === void 0) { _digests = digests; }\n this._httpClient = _httpClient;\n this._digests = _digests;\n }\n DigestCache.prototype.getDigest = function (webUrl) {\n var _this = this;\n var cachedDigest = this._digests.get(webUrl);\n if (cachedDigest !== null) {\n var now = new Date();\n if (now < cachedDigest.expiration) {\n return Promise.resolve(cachedDigest.value);\n }\n }\n var url = util_1.Util.combinePaths(webUrl, \"/_api/contextinfo\");\n return this._httpClient.fetchRaw(url, {\n cache: \"no-cache\",\n credentials: \"same-origin\",\n headers: {\n \"Accept\": \"application/json;odata=verbose\",\n \"Content-type\": \"application/json;odata=verbose;charset=utf-8\",\n },\n method: \"POST\",\n }).then(function (response) {\n var parser = new odata_1.ODataDefaultParser();\n return parser.parse(response).then(function (d) { return d.GetContextWebInformation; });\n }).then(function (data) {\n var newCachedDigest = new CachedDigest();\n newCachedDigest.value = data.FormDigestValue;\n var seconds = data.FormDigestTimeoutSeconds;\n var expiration = new Date();\n expiration.setTime(expiration.getTime() + 1000 * seconds);\n newCachedDigest.expiration = expiration;\n _this._digests.add(webUrl, newCachedDigest);\n return newCachedDigest.value;\n });\n };\n DigestCache.prototype.clear = function () {\n this._digests.clear();\n };\n return DigestCache;\n}());\nexports.DigestCache = DigestCache;\n\n\n/***/ }),\n/* 39 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar exceptions_1 = __webpack_require__(3);\n/**\n * This module is substituted for the NodeFetchClient.ts during the packaging process. This helps to reduce the pnp.js file size by\n * not including all of the node dependencies\n */\nvar NodeFetchClient = (function () {\n function NodeFetchClient() {\n }\n /**\n * Always throws an error that NodeFetchClient is not supported for use in the browser\n */\n NodeFetchClient.prototype.fetch = function () {\n throw new exceptions_1.NodeFetchClientUnsupportedException();\n };\n return NodeFetchClient;\n}());\nexports.NodeFetchClient = NodeFetchClient;\n\n\n/***/ }),\n/* 40 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar util_1 = __webpack_require__(0);\nvar exceptions_1 = __webpack_require__(3);\n/**\n * Makes requests using the SP.RequestExecutor library.\n */\nvar SPRequestExecutorClient = (function () {\n function SPRequestExecutorClient() {\n /**\n * Converts a SharePoint REST API response to a fetch API response.\n */\n this.convertToResponse = function (spResponse) {\n var responseHeaders = new Headers();\n for (var h in spResponse.headers) {\n if (spResponse.headers[h]) {\n responseHeaders.append(h, spResponse.headers[h]);\n }\n }\n // issue #256, Cannot have an empty string body when creating a Response with status 204\n var body = spResponse.statusCode === 204 ? null : spResponse.body;\n return new Response(body, {\n headers: responseHeaders,\n status: spResponse.statusCode,\n statusText: spResponse.statusText,\n });\n };\n }\n /**\n * Fetches a URL using the SP.RequestExecutor library.\n */\n SPRequestExecutorClient.prototype.fetch = function (url, options) {\n var _this = this;\n if (typeof SP === \"undefined\" || typeof SP.RequestExecutor === \"undefined\") {\n throw new exceptions_1.SPRequestExecutorUndefinedException();\n }\n var addinWebUrl = url.substring(0, url.indexOf(\"/_api\")), executor = new SP.RequestExecutor(addinWebUrl);\n var headers = {}, iterator, temp;\n if (options.headers && options.headers instanceof Headers) {\n iterator = options.headers.entries();\n temp = iterator.next();\n while (!temp.done) {\n headers[temp.value[0]] = temp.value[1];\n temp = iterator.next();\n }\n }\n else {\n headers = options.headers;\n }\n return new Promise(function (resolve, reject) {\n var requestOptions = {\n error: function (error) {\n reject(_this.convertToResponse(error));\n },\n headers: headers,\n method: options.method,\n success: function (response) {\n resolve(_this.convertToResponse(response));\n },\n url: url,\n };\n if (options.body) {\n requestOptions = util_1.Util.extend(requestOptions, { body: options.body });\n }\n else {\n requestOptions = util_1.Util.extend(requestOptions, { binaryStringRequestBody: true });\n }\n executor.executeAsync(requestOptions);\n });\n };\n return SPRequestExecutorClient;\n}());\nexports.SPRequestExecutorClient = SPRequestExecutorClient;\n\n\n/***/ }),\n/* 41 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nfunction __export(m) {\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\n}\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar util_1 = __webpack_require__(0);\nvar storage_1 = __webpack_require__(14);\nvar configuration_1 = __webpack_require__(33);\nvar logging_1 = __webpack_require__(5);\nvar rest_1 = __webpack_require__(34);\nvar pnplibconfig_1 = __webpack_require__(4);\n/**\n * Root class of the Patterns and Practices namespace, provides an entry point to the library\n */\n/**\n * Utility methods\n */\nexports.util = util_1.Util;\n/**\n * Provides access to the REST interface\n */\nexports.sp = new rest_1.Rest();\n/**\n * Provides access to local and session storage\n */\nexports.storage = new storage_1.PnPClientStorage();\n/**\n * Global configuration instance to which providers can be added\n */\nexports.config = new configuration_1.Settings();\n/**\n * Global logging instance to which subscribers can be registered and messages written\n */\nexports.log = logging_1.Logger;\n/**\n * Allows for the configuration of the library\n */\nexports.setup = pnplibconfig_1.setRuntimeConfig;\n/**\n * Expose a subset of classes from the library for public consumption\n */\n__export(__webpack_require__(35));\n// creating this class instead of directly assigning to default fixes issue #116\nvar Def = {\n /**\n * Global configuration instance to which providers can be added\n */\n config: exports.config,\n /**\n * Global logging instance to which subscribers can be registered and messages written\n */\n log: exports.log,\n /**\n * Provides access to local and session storage\n */\n setup: exports.setup,\n /**\n * Provides access to the REST interface\n */\n sp: exports.sp,\n /**\n * Provides access to local and session storage\n */\n storage: exports.storage,\n /**\n * Utility methods\n */\n util: exports.util,\n};\n/**\n * Enables use of the import pnp from syntax\n */\nexports.default = Def;\n\n\n/***/ }),\n/* 42 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar queryable_1 = __webpack_require__(1);\nvar odata_1 = __webpack_require__(2);\n/**\n * Describes a collection of Item objects\n *\n */\nvar AttachmentFiles = (function (_super) {\n __extends(AttachmentFiles, _super);\n /**\n * Creates a new instance of the AttachmentFiles class\n *\n * @param baseUrl The url or Queryable which forms the parent of this attachments collection\n */\n function AttachmentFiles(baseUrl, path) {\n if (path === void 0) { path = \"AttachmentFiles\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * Gets a Attachment File by filename\n *\n * @param name The name of the file, including extension.\n */\n AttachmentFiles.prototype.getByName = function (name) {\n var f = new AttachmentFile(this);\n f.concat(\"('\" + name + \"')\");\n return f;\n };\n /**\n * Adds a new attachment to the collection. Not supported for batching.\n *\n * @param name The name of the file, including extension.\n * @param content The Base64 file content.\n */\n AttachmentFiles.prototype.add = function (name, content) {\n var _this = this;\n return this.clone(AttachmentFiles, \"add(FileName='\" + name + \"')\").post({\n body: content,\n }).then(function (response) {\n return {\n data: response,\n file: _this.getByName(name),\n };\n });\n };\n /**\n * Adds mjultiple new attachment to the collection. Not supported for batching.\n *\n * @files name The collection of files to add\n */\n AttachmentFiles.prototype.addMultiple = function (files) {\n var _this = this;\n // add the files in series so we don't get update conflicts\n return files.reduce(function (chain, file) { return chain.then(function () { return _this.clone(AttachmentFiles, \"add(FileName='\" + file.name + \"')\").post({\n body: file.content,\n }); }); }, Promise.resolve());\n };\n return AttachmentFiles;\n}(queryable_1.QueryableCollection));\nexports.AttachmentFiles = AttachmentFiles;\n/**\n * Describes a single attachment file instance\n *\n */\nvar AttachmentFile = (function (_super) {\n __extends(AttachmentFile, _super);\n function AttachmentFile() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Gets the contents of the file as text\n *\n */\n AttachmentFile.prototype.getText = function () {\n return this.clone(AttachmentFile, \"$value\").get(new odata_1.TextFileParser());\n };\n /**\n * Gets the contents of the file as a blob, does not work in Node.js\n *\n */\n AttachmentFile.prototype.getBlob = function () {\n return this.clone(AttachmentFile, \"$value\").get(new odata_1.BlobFileParser());\n };\n /**\n * Gets the contents of a file as an ArrayBuffer, works in Node.js\n */\n AttachmentFile.prototype.getBuffer = function () {\n return this.clone(AttachmentFile, \"$value\").get(new odata_1.BufferFileParser());\n };\n /**\n * Gets the contents of a file as an ArrayBuffer, works in Node.js\n */\n AttachmentFile.prototype.getJSON = function () {\n return this.clone(AttachmentFile, \"$value\").get(new odata_1.JSONFileParser());\n };\n /**\n * Sets the content of a file. Not supported for batching\n *\n * @param content The value to set for the file contents\n */\n AttachmentFile.prototype.setContent = function (content) {\n var _this = this;\n return this.clone(AttachmentFile, \"$value\").post({\n body: content,\n headers: {\n \"X-HTTP-Method\": \"PUT\",\n },\n }).then(function (_) { return new AttachmentFile(_this); });\n };\n /**\n * Delete this attachment file\n *\n * @param eTag Value used in the IF-Match header, by default \"*\"\n */\n AttachmentFile.prototype.delete = function (eTag) {\n if (eTag === void 0) { eTag = \"*\"; }\n return this.post({\n headers: {\n \"IF-Match\": eTag,\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n return AttachmentFile;\n}(queryable_1.QueryableInstance));\nexports.AttachmentFile = AttachmentFile;\n\n\n/***/ }),\n/* 43 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar queryable_1 = __webpack_require__(1);\n/**\n * Describes a collection of Field objects\n *\n */\nvar Forms = (function (_super) {\n __extends(Forms, _super);\n /**\n * Creates a new instance of the Fields class\n *\n * @param baseUrl The url or Queryable which forms the parent of this fields collection\n */\n function Forms(baseUrl, path) {\n if (path === void 0) { path = \"forms\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * Gets a form by id\n *\n * @param id The guid id of the item to retrieve\n */\n Forms.prototype.getById = function (id) {\n var i = new Form(this);\n i.concat(\"('\" + id + \"')\");\n return i;\n };\n return Forms;\n}(queryable_1.QueryableCollection));\nexports.Forms = Forms;\n/**\n * Describes a single of Form instance\n *\n */\nvar Form = (function (_super) {\n __extends(Form, _super);\n function Form() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return Form;\n}(queryable_1.QueryableInstance));\nexports.Form = Form;\n\n\n/***/ }),\n/* 44 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nfunction __export(m) {\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\n}\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__export(__webpack_require__(22));\nvar files_1 = __webpack_require__(8);\nexports.CheckinType = files_1.CheckinType;\nexports.WebPartsPersonalizationScope = files_1.WebPartsPersonalizationScope;\nexports.MoveOperations = files_1.MoveOperations;\nexports.TemplateFileType = files_1.TemplateFileType;\nvar folders_1 = __webpack_require__(9);\nexports.Folder = folders_1.Folder;\nexports.Folders = folders_1.Folders;\nvar items_1 = __webpack_require__(10);\nexports.Item = items_1.Item;\nexports.Items = items_1.Items;\nexports.PagedItemCollection = items_1.PagedItemCollection;\nvar navigation_1 = __webpack_require__(25);\nexports.NavigationNodes = navigation_1.NavigationNodes;\nexports.NavigationNode = navigation_1.NavigationNode;\nvar lists_1 = __webpack_require__(11);\nexports.List = lists_1.List;\nexports.Lists = lists_1.Lists;\nvar odata_1 = __webpack_require__(2);\nexports.extractOdataId = odata_1.extractOdataId;\nexports.ODataParserBase = odata_1.ODataParserBase;\nexports.ODataDefaultParser = odata_1.ODataDefaultParser;\nexports.ODataRaw = odata_1.ODataRaw;\nexports.ODataValue = odata_1.ODataValue;\nexports.ODataEntity = odata_1.ODataEntity;\nexports.ODataEntityArray = odata_1.ODataEntityArray;\nexports.TextFileParser = odata_1.TextFileParser;\nexports.BlobFileParser = odata_1.BlobFileParser;\nexports.BufferFileParser = odata_1.BufferFileParser;\nexports.JSONFileParser = odata_1.JSONFileParser;\nvar queryable_1 = __webpack_require__(1);\nexports.Queryable = queryable_1.Queryable;\nexports.QueryableInstance = queryable_1.QueryableInstance;\nexports.QueryableCollection = queryable_1.QueryableCollection;\nvar roles_1 = __webpack_require__(17);\nexports.RoleDefinitionBindings = roles_1.RoleDefinitionBindings;\nvar search_1 = __webpack_require__(27);\nexports.Search = search_1.Search;\nexports.SearchResult = search_1.SearchResult;\nexports.SearchResults = search_1.SearchResults;\nexports.SortDirection = search_1.SortDirection;\nexports.ReorderingRuleMatchType = search_1.ReorderingRuleMatchType;\nexports.QueryPropertyValueType = search_1.QueryPropertyValueType;\nvar searchsuggest_1 = __webpack_require__(28);\nexports.SearchSuggest = searchsuggest_1.SearchSuggest;\nexports.SearchSuggestResult = searchsuggest_1.SearchSuggestResult;\nvar site_1 = __webpack_require__(29);\nexports.Site = site_1.Site;\n__export(__webpack_require__(13));\nvar webs_1 = __webpack_require__(7);\nexports.Web = webs_1.Web;\n\n\n/***/ }),\n/* 45 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar caching_1 = __webpack_require__(22);\nvar httpclient_1 = __webpack_require__(15);\nvar logging_1 = __webpack_require__(5);\nvar util_1 = __webpack_require__(0);\n/**\n * Processes a given context through the request pipeline\n *\n * @param context The request context we are processing\n */\nfunction pipe(context) {\n // this is the beginning of the extensible pipeline in future versions\n var pipeline = [\n PipelineMethods.logStart,\n PipelineMethods.caching,\n PipelineMethods.send,\n PipelineMethods.logEnd,\n ];\n return pipeline.reduce(function (chain, next) { return chain.then(function (c) { return next(c); }); }, Promise.resolve(context))\n .then(function (ctx) { return PipelineMethods.returnResult(ctx); })\n .catch(function (e) {\n logging_1.Logger.log({\n data: e,\n level: logging_1.LogLevel.Error,\n message: \"Error in request pipeline: \" + e.message,\n });\n throw e;\n });\n}\nexports.pipe = pipe;\n/**\n * decorator factory applied to methods in the pipeline to control behavior\n */\nfunction requestPipelineMethod(alwaysRun) {\n if (alwaysRun === void 0) { alwaysRun = false; }\n return function (target, propertyKey, descriptor) {\n var method = descriptor.value;\n descriptor.value = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n // if we have a result already in the pipeline, pass it along and don't call the tagged method\n if (!alwaysRun && args.length > 0 && args[0].hasOwnProperty(\"hasResult\") && args[0].hasResult) {\n logging_1.Logger.write(\"[\" + args[0].requestId + \"] (\" + (new Date()).getTime() + \") Skipping request pipeline method \" + propertyKey + \", existing result in pipeline.\", logging_1.LogLevel.Verbose);\n return Promise.resolve(args[0]);\n }\n // apply the tagged method\n logging_1.Logger.write(\"[\" + args[0].requestId + \"] (\" + (new Date()).getTime() + \") Calling request pipeline method \" + propertyKey + \".\", logging_1.LogLevel.Verbose);\n return method.apply(target, args);\n };\n };\n}\n/**\n * Contains the methods used within the request pipeline\n */\nvar PipelineMethods = (function () {\n function PipelineMethods() {\n }\n /**\n * Logs the start of the request\n */\n PipelineMethods.logStart = function (context) {\n return new Promise(function (resolve) {\n logging_1.Logger.log({\n data: logging_1.Logger.activeLogLevel === logging_1.LogLevel.Info ? {} : context,\n level: logging_1.LogLevel.Info,\n message: \"[\" + context.requestId + \"] (\" + (new Date()).getTime() + \") Beginning \" + context.verb + \" request to \" + context.requestAbsoluteUrl,\n });\n resolve(context);\n });\n };\n /**\n * Handles caching of the request\n */\n PipelineMethods.caching = function (context) {\n return new Promise(function (resolve) {\n // handle caching, if applicable\n if (context.verb === \"GET\" && context.isCached) {\n logging_1.Logger.write(\"[\" + context.requestId + \"] (\" + (new Date()).getTime() + \") Caching is enabled for request, checking cache...\", logging_1.LogLevel.Info);\n var cacheOptions = new caching_1.CachingOptions(context.requestAbsoluteUrl.toLowerCase());\n if (typeof context.cachingOptions !== \"undefined\") {\n cacheOptions = util_1.Util.extend(cacheOptions, context.cachingOptions);\n }\n // we may not have a valid store, i.e. on node\n if (cacheOptions.store !== null) {\n // check if we have the data in cache and if so resolve the promise and return\n var data = cacheOptions.store.get(cacheOptions.key);\n if (data !== null) {\n // ensure we clear any help batch dependency we are resolving from the cache\n logging_1.Logger.log({\n data: logging_1.Logger.activeLogLevel === logging_1.LogLevel.Info ? {} : data,\n level: logging_1.LogLevel.Info,\n message: \"[\" + context.requestId + \"] (\" + (new Date()).getTime() + \") Value returned from cache.\",\n });\n context.batchDependency();\n return PipelineMethods.setResult(context, data).then(function (ctx) { return resolve(ctx); });\n }\n }\n logging_1.Logger.write(\"[\" + context.requestId + \"] (\" + (new Date()).getTime() + \") Value not found in cache.\", logging_1.LogLevel.Info);\n // if we don't then wrap the supplied parser in the caching parser wrapper\n // and send things on their way\n context.parser = new caching_1.CachingParserWrapper(context.parser, cacheOptions);\n }\n return resolve(context);\n });\n };\n /**\n * Sends the request\n */\n PipelineMethods.send = function (context) {\n return new Promise(function (resolve, reject) {\n // send or batch the request\n if (context.isBatched) {\n // we are in a batch, so add to batch, remove dependency, and resolve with the batch's promise\n var p = context.batch.add(context.requestAbsoluteUrl, context.verb, context.options, context.parser);\n // we release the dependency here to ensure the batch does not execute until the request is added to the batch\n context.batchDependency();\n logging_1.Logger.write(\"[\" + context.requestId + \"] (\" + (new Date()).getTime() + \") Batching request.\", logging_1.LogLevel.Info);\n resolve(p.then(function (result) { return PipelineMethods.setResult(context, result); }));\n }\n else {\n logging_1.Logger.write(\"[\" + context.requestId + \"] (\" + (new Date()).getTime() + \") Sending request.\", logging_1.LogLevel.Info);\n // we are not part of a batch, so proceed as normal\n var client = new httpclient_1.HttpClient();\n var opts = util_1.Util.extend(context.options || {}, { method: context.verb });\n client.fetch(context.requestAbsoluteUrl, opts)\n .then(function (response) { return context.parser.parse(response); })\n .then(function (result) { return PipelineMethods.setResult(context, result); })\n .then(function (ctx) { return resolve(ctx); })\n .catch(function (e) { return reject(e); });\n }\n });\n };\n /**\n * Logs the end of the request\n */\n PipelineMethods.logEnd = function (context) {\n return new Promise(function (resolve) {\n logging_1.Logger.log({\n data: logging_1.Logger.activeLogLevel === logging_1.LogLevel.Info ? {} : context,\n level: logging_1.LogLevel.Info,\n message: \"[\" + context.requestId + \"] (\" + (new Date()).getTime() + \") Completing \" + context.verb + \" request to \" + context.requestAbsoluteUrl,\n });\n resolve(context);\n });\n };\n /**\n * At the end of the pipeline resolves the request's result\n */\n PipelineMethods.returnResult = function (context) {\n logging_1.Logger.log({\n data: context.result,\n level: logging_1.LogLevel.Verbose,\n message: \"[\" + context.requestId + \"] (\" + (new Date()).getTime() + \") Returning, see data property for value.\",\n });\n return Promise.resolve(context.result);\n };\n /**\n * Sets the result on the context\n */\n PipelineMethods.setResult = function (context, value) {\n return new Promise(function (resolve) {\n context.result = value;\n context.hasResult = true;\n resolve(context);\n });\n };\n return PipelineMethods;\n}());\n__decorate([\n requestPipelineMethod(true)\n], PipelineMethods, \"logStart\", null);\n__decorate([\n requestPipelineMethod()\n], PipelineMethods, \"caching\", null);\n__decorate([\n requestPipelineMethod()\n], PipelineMethods, \"send\", null);\n__decorate([\n requestPipelineMethod(true)\n], PipelineMethods, \"logEnd\", null);\n__decorate([\n requestPipelineMethod(true)\n], PipelineMethods, \"returnResult\", null);\n\n\n/***/ }),\n/* 46 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar queryable_1 = __webpack_require__(1);\nvar RelatedItemManagerImpl = (function (_super) {\n __extends(RelatedItemManagerImpl, _super);\n function RelatedItemManagerImpl(baseUrl, path) {\n if (path === void 0) { path = \"_api/SP.RelatedItemManager\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n RelatedItemManagerImpl.FromUrl = function (url) {\n if (url === null) {\n return new RelatedItemManagerImpl(\"\");\n }\n var index = url.indexOf(\"_api/\");\n if (index > -1) {\n return new RelatedItemManagerImpl(url.substr(0, index));\n }\n return new RelatedItemManagerImpl(url);\n };\n RelatedItemManagerImpl.prototype.getRelatedItems = function (sourceListName, sourceItemId) {\n var query = this.clone(RelatedItemManagerImpl, null, true);\n query.concat(\".GetRelatedItems\");\n return query.post({\n body: JSON.stringify({\n SourceItemID: sourceItemId,\n SourceListName: sourceListName,\n }),\n });\n };\n RelatedItemManagerImpl.prototype.getPageOneRelatedItems = function (sourceListName, sourceItemId) {\n var query = this.clone(RelatedItemManagerImpl, null, true);\n query.concat(\".GetPageOneRelatedItems\");\n return query.post({\n body: JSON.stringify({\n SourceItemID: sourceItemId,\n SourceListName: sourceListName,\n }),\n });\n };\n RelatedItemManagerImpl.prototype.addSingleLink = function (sourceListName, sourceItemId, sourceWebUrl, targetListName, targetItemID, targetWebUrl, tryAddReverseLink) {\n if (tryAddReverseLink === void 0) { tryAddReverseLink = false; }\n var query = this.clone(RelatedItemManagerImpl, null, true);\n query.concat(\".AddSingleLink\");\n return query.post({\n body: JSON.stringify({\n SourceItemID: sourceItemId,\n SourceListName: sourceListName,\n SourceWebUrl: sourceWebUrl,\n TargetItemID: targetItemID,\n TargetListName: targetListName,\n TargetWebUrl: targetWebUrl,\n TryAddReverseLink: tryAddReverseLink,\n }),\n });\n };\n /**\n * Adds a related item link from an item specified by list name and item id, to an item specified by url\n *\n * @param sourceListName The source list name or list id\n * @param sourceItemId The source item id\n * @param targetItemUrl The target item url\n * @param tryAddReverseLink If set to true try to add the reverse link (will not return error if it fails)\n */\n RelatedItemManagerImpl.prototype.addSingleLinkToUrl = function (sourceListName, sourceItemId, targetItemUrl, tryAddReverseLink) {\n if (tryAddReverseLink === void 0) { tryAddReverseLink = false; }\n var query = this.clone(RelatedItemManagerImpl, null, true);\n query.concat(\".AddSingleLinkToUrl\");\n return query.post({\n body: JSON.stringify({\n SourceItemID: sourceItemId,\n SourceListName: sourceListName,\n TargetItemUrl: targetItemUrl,\n TryAddReverseLink: tryAddReverseLink,\n }),\n });\n };\n /**\n * Adds a related item link from an item specified by url, to an item specified by list name and item id\n *\n * @param sourceItemUrl The source item url\n * @param targetListName The target list name or list id\n * @param targetItemId The target item id\n * @param tryAddReverseLink If set to true try to add the reverse link (will not return error if it fails)\n */\n RelatedItemManagerImpl.prototype.addSingleLinkFromUrl = function (sourceItemUrl, targetListName, targetItemId, tryAddReverseLink) {\n if (tryAddReverseLink === void 0) { tryAddReverseLink = false; }\n var query = this.clone(RelatedItemManagerImpl, null, true);\n query.concat(\".AddSingleLinkFromUrl\");\n return query.post({\n body: JSON.stringify({\n SourceItemUrl: sourceItemUrl,\n TargetItemID: targetItemId,\n TargetListName: targetListName,\n TryAddReverseLink: tryAddReverseLink,\n }),\n });\n };\n RelatedItemManagerImpl.prototype.deleteSingleLink = function (sourceListName, sourceItemId, sourceWebUrl, targetListName, targetItemId, targetWebUrl, tryDeleteReverseLink) {\n if (tryDeleteReverseLink === void 0) { tryDeleteReverseLink = false; }\n var query = this.clone(RelatedItemManagerImpl, null, true);\n query.concat(\".DeleteSingleLink\");\n return query.post({\n body: JSON.stringify({\n SourceItemID: sourceItemId,\n SourceListName: sourceListName,\n SourceWebUrl: sourceWebUrl,\n TargetItemID: targetItemId,\n TargetListName: targetListName,\n TargetWebUrl: targetWebUrl,\n TryDeleteReverseLink: tryDeleteReverseLink,\n }),\n });\n };\n return RelatedItemManagerImpl;\n}(queryable_1.Queryable));\nexports.RelatedItemManagerImpl = RelatedItemManagerImpl;\n\n\n/***/ }),\n/* 47 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar queryable_1 = __webpack_require__(1);\n/**\n * Describes a collection of webhook subscriptions\n *\n */\nvar Subscriptions = (function (_super) {\n __extends(Subscriptions, _super);\n /**\n * Creates a new instance of the Subscriptions class\n *\n * @param baseUrl - The url or Queryable which forms the parent of this webhook subscriptions collection\n */\n function Subscriptions(baseUrl, path) {\n if (path === void 0) { path = \"subscriptions\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * Returns all the webhook subscriptions or the specified webhook subscription\n *\n */\n Subscriptions.prototype.getById = function (subscriptionId) {\n var subscription = new Subscription(this);\n subscription.concat(\"('\" + subscriptionId + \"')\");\n return subscription;\n };\n /**\n * Create a new webhook subscription\n *\n */\n Subscriptions.prototype.add = function (notificationUrl, expirationDate, clientState) {\n var _this = this;\n var postBody = JSON.stringify({\n \"clientState\": clientState || \"pnp-js-core-subscription\",\n \"expirationDateTime\": expirationDate,\n \"notificationUrl\": notificationUrl,\n \"resource\": this.toUrl(),\n });\n return this.post({ body: postBody, headers: { \"Content-Type\": \"application/json\" } }).then(function (result) {\n return { data: result, subscription: _this.getById(result.id) };\n });\n };\n return Subscriptions;\n}(queryable_1.QueryableCollection));\nexports.Subscriptions = Subscriptions;\n/**\n * Describes a single webhook subscription instance\n *\n */\nvar Subscription = (function (_super) {\n __extends(Subscription, _super);\n function Subscription() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Update a webhook subscription\n *\n */\n Subscription.prototype.update = function (expirationDate) {\n var _this = this;\n var postBody = JSON.stringify({\n \"expirationDateTime\": expirationDate,\n });\n return this.patch({ body: postBody, headers: { \"Content-Type\": \"application/json\" } }).then(function (data) {\n return { data: data, subscription: _this };\n });\n };\n /**\n * Remove a webhook subscription\n *\n */\n Subscription.prototype.delete = function () {\n return _super.prototype.delete.call(this);\n };\n return Subscription;\n}(queryable_1.QueryableInstance));\nexports.Subscription = Subscription;\n\n\n/***/ }),\n/* 48 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar queryable_1 = __webpack_require__(1);\nvar files_1 = __webpack_require__(51);\nvar odata_1 = __webpack_require__(2);\nvar UserProfileQuery = (function (_super) {\n __extends(UserProfileQuery, _super);\n function UserProfileQuery(baseUrl, path) {\n if (path === void 0) { path = \"_api/sp.userprofiles.peoplemanager\"; }\n var _this = _super.call(this, baseUrl, path) || this;\n _this.profileLoader = new ProfileLoader(baseUrl);\n return _this;\n }\n Object.defineProperty(UserProfileQuery.prototype, \"editProfileLink\", {\n /**\n * The URL of the edit profile page for the current user.\n */\n get: function () {\n return this.clone(UserProfileQuery, \"EditProfileLink\").getAs(odata_1.ODataValue());\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(UserProfileQuery.prototype, \"isMyPeopleListPublic\", {\n /**\n * A Boolean value that indicates whether the current user's People I'm Following list is public.\n */\n get: function () {\n return this.clone(UserProfileQuery, \"IsMyPeopleListPublic\").getAs(odata_1.ODataValue());\n },\n enumerable: true,\n configurable: true\n });\n /**\n * A Boolean value that indicates whether the current user's People I'm Following list is public.\n *\n * @param loginName The account name of the user\n */\n UserProfileQuery.prototype.amIFollowedBy = function (loginName) {\n var q = this.clone(UserProfileQuery, \"amifollowedby(@v)\", true);\n q.query.add(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\n return q.get();\n };\n /**\n * Checks whether the current user is following the specified user.\n *\n * @param loginName The account name of the user\n */\n UserProfileQuery.prototype.amIFollowing = function (loginName) {\n var q = this.clone(UserProfileQuery, \"amifollowing(@v)\", true);\n q.query.add(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\n return q.get();\n };\n /**\n * Gets tags that the user is following.\n *\n * @param maxCount The maximum number of tags to get.\n */\n UserProfileQuery.prototype.getFollowedTags = function (maxCount) {\n if (maxCount === void 0) { maxCount = 20; }\n return this.clone(UserProfileQuery, \"getfollowedtags(\" + maxCount + \")\", true).get();\n };\n /**\n * Gets the people who are following the specified user.\n *\n * @param loginName The account name of the user.\n */\n UserProfileQuery.prototype.getFollowersFor = function (loginName) {\n var q = this.clone(UserProfileQuery, \"getfollowersfor(@v)\", true);\n q.query.add(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\n return q.get();\n };\n Object.defineProperty(UserProfileQuery.prototype, \"myFollowers\", {\n /**\n * Gets the people who are following the current user.\n *\n */\n get: function () {\n return new queryable_1.QueryableCollection(this, \"getmyfollowers\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(UserProfileQuery.prototype, \"myProperties\", {\n /**\n * Gets user properties for the current user.\n *\n */\n get: function () {\n return new UserProfileQuery(this, \"getmyproperties\");\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Gets the people who the specified user is following.\n *\n * @param loginName The account name of the user.\n */\n UserProfileQuery.prototype.getPeopleFollowedBy = function (loginName) {\n var q = this.clone(UserProfileQuery, \"getpeoplefollowedby(@v)\", true);\n q.query.add(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\n return q.get();\n };\n /**\n * Gets user properties for the specified user.\n *\n * @param loginName The account name of the user.\n */\n UserProfileQuery.prototype.getPropertiesFor = function (loginName) {\n var q = this.clone(UserProfileQuery, \"getpropertiesfor(@v)\", true);\n q.query.add(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\n return q.get();\n };\n Object.defineProperty(UserProfileQuery.prototype, \"trendingTags\", {\n /**\n * Gets the most popular tags.\n *\n */\n get: function () {\n var q = this.clone(UserProfileQuery, null, true);\n q.concat(\".gettrendingtags\");\n return q.get();\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Gets the specified user profile property for the specified user.\n *\n * @param loginName The account name of the user.\n * @param propertyName The case-sensitive name of the property to get.\n */\n UserProfileQuery.prototype.getUserProfilePropertyFor = function (loginName, propertyName) {\n var q = this.clone(UserProfileQuery, \"getuserprofilepropertyfor(accountname=@v, propertyname='\" + propertyName + \"')\", true);\n q.query.add(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\n return q.get();\n };\n /**\n * Removes the specified user from the user's list of suggested people to follow.\n *\n * @param loginName The account name of the user.\n */\n UserProfileQuery.prototype.hideSuggestion = function (loginName) {\n var q = this.clone(UserProfileQuery, \"hidesuggestion(@v)\", true);\n q.query.add(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\n return q.post();\n };\n /**\n * Checks whether the first user is following the second user.\n *\n * @param follower The account name of the user who might be following followee.\n * @param followee The account name of the user who might be followed.\n */\n UserProfileQuery.prototype.isFollowing = function (follower, followee) {\n var q = this.clone(UserProfileQuery, null, true);\n q.concat(\".isfollowing(possiblefolloweraccountname=@v, possiblefolloweeaccountname=@y)\");\n q.query.add(\"@v\", \"'\" + encodeURIComponent(follower) + \"'\");\n q.query.add(\"@y\", \"'\" + encodeURIComponent(followee) + \"'\");\n return q.get();\n };\n /**\n * Uploads and sets the user profile picture. Not supported for batching.\n *\n * @param profilePicSource Blob data representing the user's picture\n */\n UserProfileQuery.prototype.setMyProfilePic = function (profilePicSource) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n files_1.readBlobAsArrayBuffer(profilePicSource).then(function (buffer) {\n var request = new UserProfileQuery(_this, \"setmyprofilepicture\");\n request.post({\n body: String.fromCharCode.apply(null, new Uint16Array(buffer)),\n }).then(function (_) { return resolve(); });\n }).catch(function (e) { return reject(e); });\n });\n };\n /**\n * Provisions one or more users' personal sites. (My Site administrator on SharePoint Online only)\n *\n * @param emails The email addresses of the users to provision sites for\n */\n UserProfileQuery.prototype.createPersonalSiteEnqueueBulk = function () {\n var emails = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n emails[_i] = arguments[_i];\n }\n return this.profileLoader.createPersonalSiteEnqueueBulk(emails);\n };\n Object.defineProperty(UserProfileQuery.prototype, \"ownerUserProfile\", {\n /**\n * Gets the user profile of the site owner.\n *\n */\n get: function () {\n return this.profileLoader.ownerUserProfile;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(UserProfileQuery.prototype, \"userProfile\", {\n /**\n * Gets the user profile that corresponds to the current user.\n */\n get: function () {\n return this.profileLoader.userProfile;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Enqueues creating a personal site for this user, which can be used to share documents, web pages, and other files.\n *\n * @param interactiveRequest true if interactively (web) initiated request, or false if non-interactively (client) initiated request\n */\n UserProfileQuery.prototype.createPersonalSite = function (interactiveRequest) {\n if (interactiveRequest === void 0) { interactiveRequest = false; }\n return this.profileLoader.createPersonalSite(interactiveRequest);\n };\n /**\n * Sets the privacy settings for this profile.\n *\n * @param share true to make all social data public; false to make all social data private.\n */\n UserProfileQuery.prototype.shareAllSocialData = function (share) {\n return this.profileLoader.shareAllSocialData(share);\n };\n return UserProfileQuery;\n}(queryable_1.QueryableInstance));\nexports.UserProfileQuery = UserProfileQuery;\nvar ProfileLoader = (function (_super) {\n __extends(ProfileLoader, _super);\n function ProfileLoader(baseUrl, path) {\n if (path === void 0) { path = \"_api/sp.userprofiles.profileloader.getprofileloader\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * Provisions one or more users' personal sites. (My Site administrator on SharePoint Online only)\n *\n * @param emails The email addresses of the users to provision sites for\n */\n ProfileLoader.prototype.createPersonalSiteEnqueueBulk = function (emails) {\n return this.clone(ProfileLoader, \"createpersonalsiteenqueuebulk\").post({\n body: JSON.stringify({ \"emailIDs\": emails }),\n });\n };\n Object.defineProperty(ProfileLoader.prototype, \"ownerUserProfile\", {\n /**\n * Gets the user profile of the site owner.\n *\n */\n get: function () {\n var q = this.getParent(ProfileLoader, this.parentUrl, \"_api/sp.userprofiles.profileloader.getowneruserprofile\");\n if (this.hasBatch) {\n q = q.inBatch(this.batch);\n }\n return q.postAs();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ProfileLoader.prototype, \"userProfile\", {\n /**\n * Gets the user profile that corresponds to the current user.\n *\n */\n get: function () {\n return this.clone(ProfileLoader, \"getuserprofile\", true).postAs();\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Enqueues creating a personal site for this user, which can be used to share documents, web pages, and other files.\n *\n * @param interactiveRequest true if interactively (web) initiated request, or false if non-interactively (client) initiated request\n */\n ProfileLoader.prototype.createPersonalSite = function (interactiveRequest) {\n if (interactiveRequest === void 0) { interactiveRequest = false; }\n return this.clone(ProfileLoader, \"getuserprofile/createpersonalsiteenque(\" + interactiveRequest + \")\", true).post();\n };\n /**\n * Sets the privacy settings for this profile.\n *\n * @param share true to make all social data public; false to make all social data private.\n */\n ProfileLoader.prototype.shareAllSocialData = function (share) {\n return this.clone(ProfileLoader, \"getuserprofile/shareallsocialdata(\" + share + \")\", true).post();\n };\n return ProfileLoader;\n}(queryable_1.Queryable));\n\n\n/***/ }),\n/* 49 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar queryable_1 = __webpack_require__(1);\nvar util_1 = __webpack_require__(0);\n/**\n * Describes the views available in the current context\n *\n */\nvar Views = (function (_super) {\n __extends(Views, _super);\n /**\n * Creates a new instance of the Views class\n *\n * @param baseUrl The url or Queryable which forms the parent of this fields collection\n */\n function Views(baseUrl, path) {\n if (path === void 0) { path = \"views\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * Gets a view by guid id\n *\n * @param id The GUID id of the view\n */\n Views.prototype.getById = function (id) {\n var v = new View(this);\n v.concat(\"('\" + id + \"')\");\n return v;\n };\n /**\n * Gets a view by title (case-sensitive)\n *\n * @param title The case-sensitive title of the view\n */\n Views.prototype.getByTitle = function (title) {\n return new View(this, \"getByTitle('\" + title + \"')\");\n };\n /**\n * Adds a new view to the collection\n *\n * @param title The new views's title\n * @param personalView True if this is a personal view, otherwise false, default = false\n * @param additionalSettings Will be passed as part of the view creation body\n */\n /*tslint:disable max-line-length */\n Views.prototype.add = function (title, personalView, additionalSettings) {\n var _this = this;\n if (personalView === void 0) { personalView = false; }\n if (additionalSettings === void 0) { additionalSettings = {}; }\n var postBody = JSON.stringify(util_1.Util.extend({\n \"PersonalView\": personalView,\n \"Title\": title,\n \"__metadata\": { \"type\": \"SP.View\" },\n }, additionalSettings));\n return this.clone(Views, null, true).postAs({ body: postBody }).then(function (data) {\n return {\n data: data,\n view: _this.getById(data.Id),\n };\n });\n };\n return Views;\n}(queryable_1.QueryableCollection));\nexports.Views = Views;\n/**\n * Describes a single View instance\n *\n */\nvar View = (function (_super) {\n __extends(View, _super);\n function View() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(View.prototype, \"fields\", {\n get: function () {\n return new ViewFields(this);\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Updates this view intance with the supplied properties\n *\n * @param properties A plain object hash of values to update for the view\n */\n View.prototype.update = function (properties) {\n var _this = this;\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": \"SP.View\" },\n }, properties));\n return this.post({\n body: postBody,\n headers: {\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n return {\n data: data,\n view: _this,\n };\n });\n };\n /**\n * Delete this view\n *\n */\n View.prototype.delete = function () {\n return this.post({\n headers: {\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n /**\n * Returns the list view as HTML.\n *\n */\n View.prototype.renderAsHtml = function () {\n return this.clone(queryable_1.Queryable, \"renderashtml\", true).get();\n };\n return View;\n}(queryable_1.QueryableInstance));\nexports.View = View;\nvar ViewFields = (function (_super) {\n __extends(ViewFields, _super);\n function ViewFields(baseUrl, path) {\n if (path === void 0) { path = \"viewfields\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * Gets a value that specifies the XML schema that represents the collection.\n */\n ViewFields.prototype.getSchemaXml = function () {\n return this.clone(queryable_1.Queryable, \"schemaxml\", true).get();\n };\n /**\n * Adds the field with the specified field internal name or display name to the collection.\n *\n * @param fieldTitleOrInternalName The case-sensitive internal name or display name of the field to add.\n */\n ViewFields.prototype.add = function (fieldTitleOrInternalName) {\n return this.clone(ViewFields, \"addviewfield('\" + fieldTitleOrInternalName + \"')\", true).post();\n };\n /**\n * Moves the field with the specified field internal name to the specified position in the collection.\n *\n * @param fieldInternalName The case-sensitive internal name of the field to move.\n * @param index The zero-based index of the new position for the field.\n */\n ViewFields.prototype.move = function (fieldInternalName, index) {\n return this.clone(ViewFields, \"moveviewfieldto\", true).post({\n body: JSON.stringify({ \"field\": fieldInternalName, \"index\": index }),\n });\n };\n /**\n * Removes all the fields from the collection.\n */\n ViewFields.prototype.removeAll = function () {\n return this.clone(ViewFields, \"removeallviewfields\", true).post();\n };\n /**\n * Removes the field with the specified field internal name from the collection.\n *\n * @param fieldInternalName The case-sensitive internal name of the field to remove from the view.\n */\n ViewFields.prototype.remove = function (fieldInternalName) {\n return this.clone(ViewFields, \"removeviewfield('\" + fieldInternalName + \"')\", true).post();\n };\n return ViewFields;\n}(queryable_1.QueryableCollection));\nexports.ViewFields = ViewFields;\n\n\n/***/ }),\n/* 50 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar queryable_1 = __webpack_require__(1);\nvar LimitedWebPartManager = (function (_super) {\n __extends(LimitedWebPartManager, _super);\n function LimitedWebPartManager() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(LimitedWebPartManager.prototype, \"webparts\", {\n /**\n * Gets the set of web part definitions contained by this web part manager\n *\n */\n get: function () {\n return new WebPartDefinitions(this, \"webparts\");\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Exports a webpart definition\n *\n * @param id the GUID id of the definition to export\n */\n LimitedWebPartManager.prototype.export = function (id) {\n return this.clone(LimitedWebPartManager, \"ExportWebPart\", true).post({\n body: JSON.stringify({ webPartId: id }),\n });\n };\n /**\n * Imports a webpart\n *\n * @param xml webpart definition which must be valid XML in the .dwp or .webpart format\n */\n LimitedWebPartManager.prototype.import = function (xml) {\n return this.clone(LimitedWebPartManager, \"ImportWebPart\", true).post({\n body: JSON.stringify({ webPartXml: xml }),\n });\n };\n return LimitedWebPartManager;\n}(queryable_1.Queryable));\nexports.LimitedWebPartManager = LimitedWebPartManager;\nvar WebPartDefinitions = (function (_super) {\n __extends(WebPartDefinitions, _super);\n function WebPartDefinitions() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Gets a web part definition from the collection by id\n *\n * @param id GUID id of the web part definition to get\n */\n WebPartDefinitions.prototype.getById = function (id) {\n return new WebPartDefinition(this, \"getbyid('\" + id + \"')\");\n };\n return WebPartDefinitions;\n}(queryable_1.QueryableCollection));\nexports.WebPartDefinitions = WebPartDefinitions;\nvar WebPartDefinition = (function (_super) {\n __extends(WebPartDefinition, _super);\n function WebPartDefinition() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(WebPartDefinition.prototype, \"webpart\", {\n /**\n * Gets the webpart information associated with this definition\n */\n get: function () {\n return new WebPart(this);\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Removes a webpart from a page, all settings will be lost\n */\n WebPartDefinition.prototype.delete = function () {\n return this.clone(WebPartDefinition, \"DeleteWebPart\", true).post();\n };\n return WebPartDefinition;\n}(queryable_1.QueryableInstance));\nexports.WebPartDefinition = WebPartDefinition;\nvar WebPart = (function (_super) {\n __extends(WebPart, _super);\n /**\n * Creates a new instance of the WebPart class\n *\n * @param baseUrl The url or Queryable which forms the parent of this fields collection\n * @param path Optional, if supplied will be appended to the supplied baseUrl\n */\n function WebPart(baseUrl, path) {\n if (path === void 0) { path = \"webpart\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n return WebPart;\n}(queryable_1.QueryableInstance));\nexports.WebPart = WebPart;\n\n\n/***/ }),\n/* 51 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Reads a blob as text\n *\n * @param blob The data to read\n */\nfunction readBlobAsText(blob) {\n return readBlobAs(blob, \"string\");\n}\nexports.readBlobAsText = readBlobAsText;\n/**\n * Reads a blob into an array buffer\n *\n * @param blob The data to read\n */\nfunction readBlobAsArrayBuffer(blob) {\n return readBlobAs(blob, \"buffer\");\n}\nexports.readBlobAsArrayBuffer = readBlobAsArrayBuffer;\n/**\n * Generic method to read blob's content\n *\n * @param blob The data to read\n * @param mode The read mode\n */\nfunction readBlobAs(blob, mode) {\n return new Promise(function (resolve, reject) {\n try {\n var reader = new FileReader();\n reader.onload = function (e) {\n resolve(e.target.result);\n };\n switch (mode) {\n case \"string\":\n reader.readAsText(blob);\n break;\n case \"buffer\":\n reader.readAsArrayBuffer(blob);\n break;\n }\n }\n catch (e) {\n reject(e);\n }\n });\n}\n\n\n/***/ })\n/******/ ]);\n});\n\n\n// WEBPACK FOOTER //\n// pnp.min.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// identity function for calling harmony imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/assets/\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 41);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap b98ccbee4ca34fcaf622","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar decorators_1 = require(\"./decorators\");\nvar pnplibconfig_1 = require(\"../configuration/pnplibconfig\");\nvar Util = (function () {\n function Util() {\n }\n /**\n * Gets a callback function which will maintain context across async calls.\n * Allows for the calling pattern getCtxCallback(thisobj, method, methodarg1, methodarg2, ...)\n *\n * @param context The object that will be the 'this' value in the callback\n * @param method The method to which we will apply the context and parameters\n * @param params Optional, additional arguments to supply to the wrapped method when it is invoked\n */\n Util.getCtxCallback = function (context, method) {\n var params = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n params[_i - 2] = arguments[_i];\n }\n return function () {\n method.apply(context, params);\n };\n };\n /**\n * Tests if a url param exists\n *\n * @param name The name of the url paramter to check\n */\n Util.urlParamExists = function (name) {\n name = name.replace(/[\\[]/, \"\\\\[\").replace(/[\\]]/, \"\\\\]\");\n var regex = new RegExp(\"[\\\\?&]\" + name + \"=([^&#]*)\");\n return regex.test(location.search);\n };\n /**\n * Gets a url param value by name\n *\n * @param name The name of the paramter for which we want the value\n */\n Util.getUrlParamByName = function (name) {\n name = name.replace(/[\\[]/, \"\\\\[\").replace(/[\\]]/, \"\\\\]\");\n var regex = new RegExp(\"[\\\\?&]\" + name + \"=([^&#]*)\");\n var results = regex.exec(location.search);\n return results == null ? \"\" : decodeURIComponent(results[1].replace(/\\+/g, \" \"));\n };\n /**\n * Gets a url param by name and attempts to parse a bool value\n *\n * @param name The name of the paramter for which we want the boolean value\n */\n Util.getUrlParamBoolByName = function (name) {\n var p = this.getUrlParamByName(name);\n var isFalse = (p === \"\" || /false|0/i.test(p));\n return !isFalse;\n };\n /**\n * Inserts the string s into the string target as the index specified by index\n *\n * @param target The string into which we will insert s\n * @param index The location in target to insert s (zero based)\n * @param s The string to insert into target at position index\n */\n Util.stringInsert = function (target, index, s) {\n if (index > 0) {\n return target.substring(0, index) + s + target.substring(index, target.length);\n }\n return s + target;\n };\n /**\n * Adds a value to a date\n *\n * @param date The date to which we will add units, done in local time\n * @param interval The name of the interval to add, one of: ['year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second']\n * @param units The amount to add to date of the given interval\n *\n * http://stackoverflow.com/questions/1197928/how-to-add-30-minutes-to-a-javascript-date-object\n */\n Util.dateAdd = function (date, interval, units) {\n var ret = new Date(date.toLocaleString()); // don't change original date\n switch (interval.toLowerCase()) {\n case \"year\":\n ret.setFullYear(ret.getFullYear() + units);\n break;\n case \"quarter\":\n ret.setMonth(ret.getMonth() + 3 * units);\n break;\n case \"month\":\n ret.setMonth(ret.getMonth() + units);\n break;\n case \"week\":\n ret.setDate(ret.getDate() + 7 * units);\n break;\n case \"day\":\n ret.setDate(ret.getDate() + units);\n break;\n case \"hour\":\n ret.setTime(ret.getTime() + units * 3600000);\n break;\n case \"minute\":\n ret.setTime(ret.getTime() + units * 60000);\n break;\n case \"second\":\n ret.setTime(ret.getTime() + units * 1000);\n break;\n default:\n ret = undefined;\n break;\n }\n return ret;\n };\n /**\n * Loads a stylesheet into the current page\n *\n * @param path The url to the stylesheet\n * @param avoidCache If true a value will be appended as a query string to avoid browser caching issues\n */\n Util.loadStylesheet = function (path, avoidCache) {\n if (avoidCache) {\n path += \"?\" + encodeURIComponent((new Date()).getTime().toString());\n }\n var head = document.getElementsByTagName(\"head\");\n if (head.length > 0) {\n var e = document.createElement(\"link\");\n head[0].appendChild(e);\n e.setAttribute(\"type\", \"text/css\");\n e.setAttribute(\"rel\", \"stylesheet\");\n e.setAttribute(\"href\", path);\n }\n };\n /**\n * Combines an arbitrary set of paths ensuring that the slashes are normalized\n *\n * @param paths 0 to n path parts to combine\n */\n Util.combinePaths = function () {\n var paths = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n paths[_i] = arguments[_i];\n }\n return paths\n .filter(function (path) { return typeof path !== \"undefined\" && path !== null; })\n .map(function (path) { return path.replace(/^[\\\\|\\/]/, \"\").replace(/[\\\\|\\/]$/, \"\"); })\n .join(\"/\")\n .replace(/\\\\/g, \"/\");\n };\n /**\n * Gets a random string of chars length\n *\n * @param chars The length of the random string to generate\n */\n Util.getRandomString = function (chars) {\n var text = new Array(chars);\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n for (var i = 0; i < chars; i++) {\n text[i] = possible.charAt(Math.floor(Math.random() * possible.length));\n }\n return text.join(\"\");\n };\n /**\n * Gets a random GUID value\n *\n * http://stackoverflow.com/questions/105034/create-guid-uuid-in-javascript\n */\n /* tslint:disable no-bitwise */\n Util.getGUID = function () {\n var d = new Date().getTime();\n var guid = \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g, function (c) {\n var r = (d + Math.random() * 16) % 16 | 0;\n d = Math.floor(d / 16);\n return (c === \"x\" ? r : (r & 0x3 | 0x8)).toString(16);\n });\n return guid;\n };\n /* tslint:enable */\n /**\n * Determines if a given value is a function\n *\n * @param candidateFunction The thing to test for being a function\n */\n Util.isFunction = function (candidateFunction) {\n return typeof candidateFunction === \"function\";\n };\n /**\n * @returns whether the provided parameter is a JavaScript Array or not.\n */\n Util.isArray = function (array) {\n if (Array.isArray) {\n return Array.isArray(array);\n }\n return array && typeof array.length === \"number\" && array.constructor === Array;\n };\n /**\n * Determines if a string is null or empty or undefined\n *\n * @param s The string to test\n */\n Util.stringIsNullOrEmpty = function (s) {\n return typeof s === \"undefined\" || s === null || s === \"\";\n };\n /**\n * Provides functionality to extend the given object by doing a shallow copy\n *\n * @param target The object to which properties will be copied\n * @param source The source object from which properties will be copied\n * @param noOverwrite If true existing properties on the target are not overwritten from the source\n *\n */\n Util.extend = function (target, source, noOverwrite) {\n if (noOverwrite === void 0) { noOverwrite = false; }\n if (source === null || typeof source === \"undefined\") {\n return target;\n }\n // ensure we don't overwrite things we don't want overwritten\n var check = noOverwrite ? function (o, i) { return !(i in o); } : function () { return true; };\n return Object.getOwnPropertyNames(source)\n .filter(function (v) { return check(target, v); })\n .reduce(function (t, v) {\n t[v] = source[v];\n return t;\n }, target);\n };\n /**\n * Determines if a given url is absolute\n *\n * @param url The url to check to see if it is absolute\n */\n Util.isUrlAbsolute = function (url) {\n return /^https?:\\/\\/|^\\/\\//i.test(url);\n };\n /**\n * Attempts to make the supplied relative url absolute based on the _spPageContextInfo object, if available\n *\n * @param url The relative url to make absolute\n */\n Util.makeUrlAbsolute = function (url) {\n if (Util.isUrlAbsolute(url)) {\n return url;\n }\n if (typeof global._spPageContextInfo !== \"undefined\") {\n if (global._spPageContextInfo.hasOwnProperty(\"webAbsoluteUrl\")) {\n return Util.combinePaths(global._spPageContextInfo.webAbsoluteUrl, url);\n }\n else if (global._spPageContextInfo.hasOwnProperty(\"webServerRelativeUrl\")) {\n return Util.combinePaths(global._spPageContextInfo.webServerRelativeUrl, url);\n }\n }\n else {\n return url;\n }\n };\n /**\n * Ensures that a given url is absolute for the current web based on context\n *\n * @param candidateUrl The url to make absolute\n *\n */\n Util.toAbsoluteUrl = function (candidateUrl) {\n return new Promise(function (resolve) {\n if (Util.isUrlAbsolute(candidateUrl)) {\n // if we are already absolute, then just return the url\n return resolve(candidateUrl);\n }\n if (pnplibconfig_1.RuntimeConfig.baseUrl !== null) {\n // base url specified either with baseUrl of spfxContext config property\n return resolve(Util.combinePaths(pnplibconfig_1.RuntimeConfig.baseUrl, candidateUrl));\n }\n if (typeof global._spPageContextInfo !== \"undefined\") {\n // operating in classic pages\n if (global._spPageContextInfo.hasOwnProperty(\"webAbsoluteUrl\")) {\n return resolve(Util.combinePaths(global._spPageContextInfo.webAbsoluteUrl, candidateUrl));\n }\n else if (global._spPageContextInfo.hasOwnProperty(\"webServerRelativeUrl\")) {\n return resolve(Util.combinePaths(global._spPageContextInfo.webServerRelativeUrl, candidateUrl));\n }\n }\n // does window.location exist and have _layouts in it?\n if (typeof global.location !== \"undefined\") {\n var index = global.location.toString().toLowerCase().indexOf(\"/_layouts/\");\n if (index > 0) {\n // we are likely in the workbench in /_layouts/\n return resolve(Util.combinePaths(global.location.toString().substr(0, index), candidateUrl));\n }\n }\n return resolve(candidateUrl);\n });\n };\n return Util;\n}());\n__decorate([\n decorators_1.deprecated(\"The Util.makeUrlAbsolute method is deprecated and will be removed from future releases. Use Util.toAbsoluteUrl instead\")\n], Util, \"makeUrlAbsolute\", null);\nexports.Util = Util;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/utils/util.js\n// module id = 0\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar util_1 = require(\"../utils/util\");\nvar collections_1 = require(\"../collections/collections\");\nvar odata_1 = require(\"./odata\");\nvar pnplibconfig_1 = require(\"../configuration/pnplibconfig\");\nvar exceptions_1 = require(\"../utils/exceptions\");\nvar queryablerequest_1 = require(\"./queryablerequest\");\nvar logging_1 = require(\"../utils/logging\");\n/**\n * Queryable Base Class\n *\n */\nvar Queryable = (function () {\n /**\n * Creates a new instance of the Queryable class\n *\n * @constructor\n * @param baseUrl A string or Queryable that should form the base part of the url\n *\n */\n function Queryable(baseUrl, path) {\n this._query = new collections_1.Dictionary();\n this._batch = null;\n if (typeof baseUrl === \"string\") {\n // we need to do some extra parsing to get the parent url correct if we are\n // being created from just a string.\n var urlStr = baseUrl;\n if (util_1.Util.isUrlAbsolute(urlStr) || urlStr.lastIndexOf(\"/\") < 0) {\n this._parentUrl = urlStr;\n this._url = util_1.Util.combinePaths(urlStr, path);\n }\n else if (urlStr.lastIndexOf(\"/\") > urlStr.lastIndexOf(\"(\")) {\n // .../items(19)/fields\n var index = urlStr.lastIndexOf(\"/\");\n this._parentUrl = urlStr.slice(0, index);\n path = util_1.Util.combinePaths(urlStr.slice(index), path);\n this._url = util_1.Util.combinePaths(this._parentUrl, path);\n }\n else {\n // .../items(19)\n var index = urlStr.lastIndexOf(\"(\");\n this._parentUrl = urlStr.slice(0, index);\n this._url = util_1.Util.combinePaths(urlStr, path);\n }\n }\n else {\n var q = baseUrl;\n this._parentUrl = q._url;\n var target = q._query.get(\"@target\");\n if (target !== null) {\n this._query.add(\"@target\", target);\n }\n this._url = util_1.Util.combinePaths(this._parentUrl, path);\n }\n }\n /**\n * Directly concatonates the supplied string to the current url, not normalizing \"/\" chars\n *\n * @param pathPart The string to concatonate to the url\n */\n Queryable.prototype.concat = function (pathPart) {\n this._url += pathPart;\n };\n /**\n * Appends the given string and normalizes \"/\" chars\n *\n * @param pathPart The string to append\n */\n Queryable.prototype.append = function (pathPart) {\n this._url = util_1.Util.combinePaths(this._url, pathPart);\n };\n /**\n * Blocks a batch call from occuring, MUST be cleared by calling the returned function\n */\n Queryable.prototype.addBatchDependency = function () {\n if (this.hasBatch) {\n return this._batch.addDependency();\n }\n return function () { return null; };\n };\n Object.defineProperty(Queryable.prototype, \"hasBatch\", {\n /**\n * Indicates if the current query has a batch associated\n *\n */\n get: function () {\n return this._batch !== null;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Queryable.prototype, \"batch\", {\n /**\n * The batch currently associated with this query or null\n *\n */\n get: function () {\n return this.hasBatch ? this._batch : null;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Queryable.prototype, \"parentUrl\", {\n /**\n * Gets the parent url used when creating this instance\n *\n */\n get: function () {\n return this._parentUrl;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Queryable.prototype, \"query\", {\n /**\n * Provides access to the query builder for this url\n *\n */\n get: function () {\n return this._query;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Creates a new instance of the supplied factory and extends this into that new instance\n *\n * @param factory constructor for the new queryable\n */\n Queryable.prototype.as = function (factory) {\n var o = new factory(this._url, null);\n return util_1.Util.extend(o, this, true);\n };\n /**\n * Adds this query to the supplied batch\n *\n * @example\n * ```\n *\n * let b = pnp.sp.createBatch();\n * pnp.sp.web.inBatch(b).get().then(...);\n * b.execute().then(...)\n * ```\n */\n Queryable.prototype.inBatch = function (batch) {\n if (this._batch !== null) {\n throw new exceptions_1.AlreadyInBatchException();\n }\n this._batch = batch;\n return this;\n };\n /**\n * Enables caching for this request\n *\n * @param options Defines the options used when caching this request\n */\n Queryable.prototype.usingCaching = function (options) {\n if (!pnplibconfig_1.RuntimeConfig.globalCacheDisable) {\n this._useCaching = true;\n this._cachingOptions = options;\n }\n return this;\n };\n /**\n * Gets the currentl url, made absolute based on the availability of the _spPageContextInfo object\n *\n */\n Queryable.prototype.toUrl = function () {\n return this._url;\n };\n /**\n * Gets the full url with query information\n *\n */\n Queryable.prototype.toUrlAndQuery = function () {\n var aliasedParams = new collections_1.Dictionary();\n var url = this.toUrl().replace(/'!(@.*?)::(.*?)'/ig, function (match, labelName, value) {\n logging_1.Logger.write(\"Rewriting aliased parameter from match \" + match + \" to label: \" + labelName + \" value: \" + value, logging_1.LogLevel.Verbose);\n aliasedParams.add(labelName, \"'\" + value + \"'\");\n return labelName;\n });\n // inlude our explicitly set query string params\n aliasedParams.merge(this._query);\n if (aliasedParams.count() > 0) {\n url += \"?\" + aliasedParams.getKeys().map(function (key) { return key + \"=\" + aliasedParams.get(key); }).join(\"&\");\n }\n return url;\n };\n /**\n * Gets a parent for this instance as specified\n *\n * @param factory The contructor for the class to create\n */\n Queryable.prototype.getParent = function (factory, baseUrl, path, batch) {\n if (baseUrl === void 0) { baseUrl = this.parentUrl; }\n var parent = new factory(baseUrl, path);\n var target = this.query.get(\"@target\");\n if (target !== null) {\n parent.query.add(\"@target\", target);\n }\n if (typeof batch !== \"undefined\") {\n parent = parent.inBatch(batch);\n }\n return parent;\n };\n /**\n * Clones this queryable into a new queryable instance of T\n * @param factory Constructor used to create the new instance\n * @param additionalPath Any additional path to include in the clone\n * @param includeBatch If true this instance's batch will be added to the cloned instance\n */\n Queryable.prototype.clone = function (factory, additionalPath, includeBatch) {\n if (includeBatch === void 0) { includeBatch = false; }\n var clone = new factory(this, additionalPath);\n var target = this.query.get(\"@target\");\n if (target !== null) {\n clone.query.add(\"@target\", target);\n }\n if (includeBatch && this.hasBatch) {\n clone = clone.inBatch(this.batch);\n }\n return clone;\n };\n /**\n * Executes the currently built request\n *\n * @param parser Allows you to specify a parser to handle the result\n * @param getOptions The options used for this request\n */\n Queryable.prototype.get = function (parser, getOptions) {\n if (parser === void 0) { parser = new odata_1.ODataDefaultParser(); }\n if (getOptions === void 0) { getOptions = {}; }\n return this.toRequestContext(\"GET\", getOptions, parser).then(function (context) { return queryablerequest_1.pipe(context); });\n };\n Queryable.prototype.getAs = function (parser, getOptions) {\n if (parser === void 0) { parser = new odata_1.ODataDefaultParser(); }\n if (getOptions === void 0) { getOptions = {}; }\n return this.toRequestContext(\"GET\", getOptions, parser).then(function (context) { return queryablerequest_1.pipe(context); });\n };\n Queryable.prototype.post = function (postOptions, parser) {\n if (postOptions === void 0) { postOptions = {}; }\n if (parser === void 0) { parser = new odata_1.ODataDefaultParser(); }\n return this.toRequestContext(\"POST\", postOptions, parser).then(function (context) { return queryablerequest_1.pipe(context); });\n };\n Queryable.prototype.postAs = function (postOptions, parser) {\n if (postOptions === void 0) { postOptions = {}; }\n if (parser === void 0) { parser = new odata_1.ODataDefaultParser(); }\n return this.toRequestContext(\"POST\", postOptions, parser).then(function (context) { return queryablerequest_1.pipe(context); });\n };\n Queryable.prototype.patch = function (patchOptions, parser) {\n if (patchOptions === void 0) { patchOptions = {}; }\n if (parser === void 0) { parser = new odata_1.ODataDefaultParser(); }\n return this.toRequestContext(\"PATCH\", patchOptions, parser).then(function (context) { return queryablerequest_1.pipe(context); });\n };\n Queryable.prototype.delete = function (deleteOptions, parser) {\n if (deleteOptions === void 0) { deleteOptions = {}; }\n if (parser === void 0) { parser = new odata_1.ODataDefaultParser(); }\n return this.toRequestContext(\"DELETE\", deleteOptions, parser).then(function (context) { return queryablerequest_1.pipe(context); });\n };\n Queryable.prototype.toRequestContext = function (verb, options, parser) {\n var _this = this;\n if (options === void 0) { options = {}; }\n var dependencyDispose = this.hasBatch ? this.addBatchDependency() : function () { return; };\n return util_1.Util.toAbsoluteUrl(this.toUrlAndQuery()).then(function (url) {\n // build our request context\n var context = {\n batch: _this._batch,\n batchDependency: dependencyDispose,\n cachingOptions: _this._cachingOptions,\n isBatched: _this.hasBatch,\n isCached: _this._useCaching,\n options: options,\n parser: parser,\n requestAbsoluteUrl: url,\n requestId: util_1.Util.getGUID(),\n verb: verb,\n };\n return context;\n });\n };\n return Queryable;\n}());\nexports.Queryable = Queryable;\n/**\n * Represents a REST collection which can be filtered, paged, and selected\n *\n */\nvar QueryableCollection = (function (_super) {\n __extends(QueryableCollection, _super);\n function QueryableCollection() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Filters the returned collection (https://msdn.microsoft.com/en-us/library/office/fp142385.aspx#bk_supported)\n *\n * @param filter The string representing the filter query\n */\n QueryableCollection.prototype.filter = function (filter) {\n this._query.add(\"$filter\", filter);\n return this;\n };\n /**\n * Choose which fields to return\n *\n * @param selects One or more fields to return\n */\n QueryableCollection.prototype.select = function () {\n var selects = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n selects[_i] = arguments[_i];\n }\n if (selects.length > 0) {\n this._query.add(\"$select\", selects.join(\",\"));\n }\n return this;\n };\n /**\n * Expands fields such as lookups to get additional data\n *\n * @param expands The Fields for which to expand the values\n */\n QueryableCollection.prototype.expand = function () {\n var expands = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n expands[_i] = arguments[_i];\n }\n if (expands.length > 0) {\n this._query.add(\"$expand\", expands.join(\",\"));\n }\n return this;\n };\n /**\n * Orders based on the supplied fields ascending\n *\n * @param orderby The name of the field to sort on\n * @param ascending If false DESC is appended, otherwise ASC (default)\n */\n QueryableCollection.prototype.orderBy = function (orderBy, ascending) {\n if (ascending === void 0) { ascending = true; }\n var keys = this._query.getKeys();\n var query = [];\n var asc = ascending ? \" asc\" : \" desc\";\n for (var i = 0; i < keys.length; i++) {\n if (keys[i] === \"$orderby\") {\n query.push(this._query.get(\"$orderby\"));\n break;\n }\n }\n query.push(\"\" + orderBy + asc);\n this._query.add(\"$orderby\", query.join(\",\"));\n return this;\n };\n /**\n * Skips the specified number of items\n *\n * @param skip The number of items to skip\n */\n QueryableCollection.prototype.skip = function (skip) {\n this._query.add(\"$skip\", skip.toString());\n return this;\n };\n /**\n * Limits the query to only return the specified number of items\n *\n * @param top The query row limit\n */\n QueryableCollection.prototype.top = function (top) {\n this._query.add(\"$top\", top.toString());\n return this;\n };\n return QueryableCollection;\n}(Queryable));\nexports.QueryableCollection = QueryableCollection;\n/**\n * Represents an instance that can be selected\n *\n */\nvar QueryableInstance = (function (_super) {\n __extends(QueryableInstance, _super);\n function QueryableInstance() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Choose which fields to return\n *\n * @param selects One or more fields to return\n */\n QueryableInstance.prototype.select = function () {\n var selects = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n selects[_i] = arguments[_i];\n }\n if (selects.length > 0) {\n this._query.add(\"$select\", selects.join(\",\"));\n }\n return this;\n };\n /**\n * Expands fields such as lookups to get additional data\n *\n * @param expands The Fields for which to expand the values\n */\n QueryableInstance.prototype.expand = function () {\n var expands = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n expands[_i] = arguments[_i];\n }\n if (expands.length > 0) {\n this._query.add(\"$expand\", expands.join(\",\"));\n }\n return this;\n };\n return QueryableInstance;\n}(Queryable));\nexports.QueryableInstance = QueryableInstance;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/sharepoint/queryable.js\n// module id = 1\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar util_1 = require(\"../utils/util\");\nvar logging_1 = require(\"../utils/logging\");\nvar httpclient_1 = require(\"../net/httpclient\");\nvar pnplibconfig_1 = require(\"../configuration/pnplibconfig\");\nvar exceptions_1 = require(\"../utils/exceptions\");\nvar exceptions_2 = require(\"../utils/exceptions\");\nfunction extractOdataId(candidate) {\n if (candidate.hasOwnProperty(\"odata.id\")) {\n return candidate[\"odata.id\"];\n }\n else if (candidate.hasOwnProperty(\"__metadata\") && candidate.__metadata.hasOwnProperty(\"id\")) {\n return candidate.__metadata.id;\n }\n else {\n throw new exceptions_1.ODataIdException(candidate);\n }\n}\nexports.extractOdataId = extractOdataId;\nvar ODataParserBase = (function () {\n function ODataParserBase() {\n }\n ODataParserBase.prototype.parse = function (r) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n if (_this.handleError(r, reject)) {\n if ((r.headers.has(\"Content-Length\") && parseFloat(r.headers.get(\"Content-Length\")) === 0) || r.status === 204) {\n resolve({});\n }\n else {\n r.json().then(function (json) { return resolve(_this.parseODataJSON(json)); }).catch(function (e) { return reject(e); });\n }\n }\n });\n };\n ODataParserBase.prototype.handleError = function (r, reject) {\n if (!r.ok) {\n r.json().then(function (json) {\n // include the headers as they contain diagnostic information\n var data = {\n responseBody: json,\n responseHeaders: r.headers,\n };\n reject(new exceptions_2.ProcessHttpClientResponseException(r.status, r.statusText, data));\n }).catch(function (e) {\n // we failed to read the body - possibly it is empty. Let's report the original status that caused\n // the request to fail and log the error with parsing the body if anyone needs it for debugging\n logging_1.Logger.log({\n data: e,\n level: logging_1.LogLevel.Warning,\n message: \"There was an error parsing the error response body. See data for details.\",\n });\n // include the headers as they contain diagnostic information\n var data = {\n responseBody: \"[[body not available]]\",\n responseHeaders: r.headers,\n };\n reject(new exceptions_2.ProcessHttpClientResponseException(r.status, r.statusText, data));\n });\n }\n return r.ok;\n };\n ODataParserBase.prototype.parseODataJSON = function (json) {\n var result = json;\n if (json.hasOwnProperty(\"d\")) {\n if (json.d.hasOwnProperty(\"results\")) {\n result = json.d.results;\n }\n else {\n result = json.d;\n }\n }\n else if (json.hasOwnProperty(\"value\")) {\n result = json.value;\n }\n return result;\n };\n return ODataParserBase;\n}());\nexports.ODataParserBase = ODataParserBase;\nvar ODataDefaultParser = (function (_super) {\n __extends(ODataDefaultParser, _super);\n function ODataDefaultParser() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return ODataDefaultParser;\n}(ODataParserBase));\nexports.ODataDefaultParser = ODataDefaultParser;\nvar ODataRawParserImpl = (function () {\n function ODataRawParserImpl() {\n }\n ODataRawParserImpl.prototype.parse = function (r) {\n return r.json();\n };\n return ODataRawParserImpl;\n}());\nexports.ODataRawParserImpl = ODataRawParserImpl;\nvar ODataValueParserImpl = (function (_super) {\n __extends(ODataValueParserImpl, _super);\n function ODataValueParserImpl() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ODataValueParserImpl.prototype.parse = function (r) {\n return _super.prototype.parse.call(this, r).then(function (d) { return d; });\n };\n return ODataValueParserImpl;\n}(ODataParserBase));\nvar ODataEntityParserImpl = (function (_super) {\n __extends(ODataEntityParserImpl, _super);\n function ODataEntityParserImpl(factory) {\n var _this = _super.call(this) || this;\n _this.factory = factory;\n return _this;\n }\n ODataEntityParserImpl.prototype.parse = function (r) {\n var _this = this;\n return _super.prototype.parse.call(this, r).then(function (d) {\n var o = new _this.factory(getEntityUrl(d), null);\n return util_1.Util.extend(o, d);\n });\n };\n return ODataEntityParserImpl;\n}(ODataParserBase));\nvar ODataEntityArrayParserImpl = (function (_super) {\n __extends(ODataEntityArrayParserImpl, _super);\n function ODataEntityArrayParserImpl(factory) {\n var _this = _super.call(this) || this;\n _this.factory = factory;\n return _this;\n }\n ODataEntityArrayParserImpl.prototype.parse = function (r) {\n var _this = this;\n return _super.prototype.parse.call(this, r).then(function (d) {\n return d.map(function (v) {\n var o = new _this.factory(getEntityUrl(v), null);\n return util_1.Util.extend(o, v);\n });\n });\n };\n return ODataEntityArrayParserImpl;\n}(ODataParserBase));\nfunction getEntityUrl(entity) {\n if (entity.hasOwnProperty(\"odata.editLink\")) {\n // we are dealign with minimal metadata (default)\n return util_1.Util.combinePaths(\"_api\", entity[\"odata.editLink\"]);\n }\n else if (entity.hasOwnProperty(\"__metadata\")) {\n // we are dealing with verbose, which has an absolute uri\n return entity.__metadata.uri;\n }\n else {\n // we are likely dealing with nometadata, so don't error but we won't be able to\n // chain off these objects\n logging_1.Logger.write(\"No uri information found in ODataEntity parsing, chaining will fail for this object.\", logging_1.LogLevel.Warning);\n return \"\";\n }\n}\nexports.getEntityUrl = getEntityUrl;\nexports.ODataRaw = new ODataRawParserImpl();\nfunction ODataValue() {\n return new ODataValueParserImpl();\n}\nexports.ODataValue = ODataValue;\nfunction ODataEntity(factory) {\n return new ODataEntityParserImpl(factory);\n}\nexports.ODataEntity = ODataEntity;\nfunction ODataEntityArray(factory) {\n return new ODataEntityArrayParserImpl(factory);\n}\nexports.ODataEntityArray = ODataEntityArray;\n/**\n * Manages a batch of OData operations\n */\nvar ODataBatch = (function () {\n function ODataBatch(baseUrl, _batchId) {\n if (_batchId === void 0) { _batchId = util_1.Util.getGUID(); }\n this.baseUrl = baseUrl;\n this._batchId = _batchId;\n this._requests = [];\n this._dependencies = [];\n }\n /**\n * Adds a request to a batch (not designed for public use)\n *\n * @param url The full url of the request\n * @param method The http method GET, POST, etc\n * @param options Any options to include in the request\n * @param parser The parser that will hadle the results of the request\n */\n ODataBatch.prototype.add = function (url, method, options, parser) {\n var info = {\n method: method.toUpperCase(),\n options: options,\n parser: parser,\n reject: null,\n resolve: null,\n url: url,\n };\n var p = new Promise(function (resolve, reject) {\n info.resolve = resolve;\n info.reject = reject;\n });\n this._requests.push(info);\n return p;\n };\n /**\n * Adds a dependency insuring that some set of actions will occur before a batch is processed.\n * MUST be cleared using the returned resolve delegate to allow batches to run\n */\n ODataBatch.prototype.addDependency = function () {\n var resolver;\n var promise = new Promise(function (resolve) {\n resolver = resolve;\n });\n this._dependencies.push(promise);\n return resolver;\n };\n /**\n * Execute the current batch and resolve the associated promises\n *\n * @returns A promise which will be resolved once all of the batch's child promises have resolved\n */\n ODataBatch.prototype.execute = function () {\n var _this = this;\n // we need to check the dependencies twice due to how different engines handle things.\n // We can get a second set of promises added after the first set resolve\n return Promise.all(this._dependencies).then(function () { return Promise.all(_this._dependencies); }).then(function () { return _this.executeImpl(); });\n };\n ODataBatch.prototype.executeImpl = function () {\n var _this = this;\n logging_1.Logger.write(\"Executing batch with \" + this._requests.length + \" requests.\", logging_1.LogLevel.Info);\n // if we don't have any requests, don't bother sending anything\n // this could be due to caching further upstream, or just an empty batch\n if (this._requests.length < 1) {\n logging_1.Logger.write(\"Resolving empty batch.\", logging_1.LogLevel.Info);\n return Promise.resolve();\n }\n // creating the client here allows the url to be populated for nodejs client as well as potentially\n // any other hacks needed for other types of clients. Essentially allows the absoluteRequestUrl\n // below to be correct\n var client = new httpclient_1.HttpClient();\n // due to timing we need to get the absolute url here so we can use it for all the individual requests\n // and for sending the entire batch\n return util_1.Util.toAbsoluteUrl(this.baseUrl).then(function (absoluteRequestUrl) {\n // build all the requests, send them, pipe results in order to parsers\n var batchBody = [];\n var currentChangeSetId = \"\";\n _this._requests.map(function (reqInfo) {\n if (reqInfo.method === \"GET\") {\n if (currentChangeSetId.length > 0) {\n // end an existing change set\n batchBody.push(\"--changeset_\" + currentChangeSetId + \"--\\n\\n\");\n currentChangeSetId = \"\";\n }\n batchBody.push(\"--batch_\" + _this._batchId + \"\\n\");\n }\n else {\n if (currentChangeSetId.length < 1) {\n // start new change set\n currentChangeSetId = util_1.Util.getGUID();\n batchBody.push(\"--batch_\" + _this._batchId + \"\\n\");\n batchBody.push(\"Content-Type: multipart/mixed; boundary=\\\"changeset_\" + currentChangeSetId + \"\\\"\\n\\n\");\n }\n batchBody.push(\"--changeset_\" + currentChangeSetId + \"\\n\");\n }\n // common batch part prefix\n batchBody.push(\"Content-Type: application/http\\n\");\n batchBody.push(\"Content-Transfer-Encoding: binary\\n\\n\");\n var headers = {\n \"Accept\": \"application/json;\",\n };\n // this is the url of the individual request within the batch\n var url = util_1.Util.isUrlAbsolute(reqInfo.url) ? reqInfo.url : util_1.Util.combinePaths(absoluteRequestUrl, reqInfo.url);\n logging_1.Logger.write(\"Adding request \" + reqInfo.method + \" \" + url + \" to batch.\", logging_1.LogLevel.Verbose);\n if (reqInfo.method !== \"GET\") {\n var method = reqInfo.method;\n if (reqInfo.hasOwnProperty(\"options\") && reqInfo.options.hasOwnProperty(\"headers\") && typeof reqInfo.options.headers[\"X-HTTP-Method\"] !== \"undefined\") {\n method = reqInfo.options.headers[\"X-HTTP-Method\"];\n delete reqInfo.options.headers[\"X-HTTP-Method\"];\n }\n batchBody.push(method + \" \" + url + \" HTTP/1.1\\n\");\n headers = util_1.Util.extend(headers, { \"Content-Type\": \"application/json;odata=verbose;charset=utf-8\" });\n }\n else {\n batchBody.push(reqInfo.method + \" \" + url + \" HTTP/1.1\\n\");\n }\n if (typeof pnplibconfig_1.RuntimeConfig.headers !== \"undefined\") {\n headers = util_1.Util.extend(headers, pnplibconfig_1.RuntimeConfig.headers);\n }\n if (reqInfo.options && reqInfo.options.headers) {\n headers = util_1.Util.extend(headers, reqInfo.options.headers);\n }\n for (var name_1 in headers) {\n if (headers.hasOwnProperty(name_1)) {\n batchBody.push(name_1 + \": \" + headers[name_1] + \"\\n\");\n }\n }\n batchBody.push(\"\\n\");\n if (reqInfo.options.body) {\n batchBody.push(reqInfo.options.body + \"\\n\\n\");\n }\n });\n if (currentChangeSetId.length > 0) {\n // Close the changeset\n batchBody.push(\"--changeset_\" + currentChangeSetId + \"--\\n\\n\");\n currentChangeSetId = \"\";\n }\n batchBody.push(\"--batch_\" + _this._batchId + \"--\\n\");\n var batchHeaders = {\n \"Content-Type\": \"multipart/mixed; boundary=batch_\" + _this._batchId,\n };\n var batchOptions = {\n \"body\": batchBody.join(\"\"),\n \"headers\": batchHeaders,\n };\n logging_1.Logger.write(\"Sending batch request.\", logging_1.LogLevel.Info);\n return client.post(util_1.Util.combinePaths(absoluteRequestUrl, \"/_api/$batch\"), batchOptions)\n .then(function (r) { return r.text(); })\n .then(_this._parseResponse)\n .then(function (responses) {\n if (responses.length !== _this._requests.length) {\n throw new exceptions_1.BatchParseException(\"Could not properly parse responses to match requests in batch.\");\n }\n logging_1.Logger.write(\"Resolving batched requests.\", logging_1.LogLevel.Info);\n return responses.reduce(function (chain, response, index) {\n var request = _this._requests[index];\n logging_1.Logger.write(\"Resolving request \" + request.method + \" \" + request.url + \".\", logging_1.LogLevel.Verbose);\n return chain.then(function (_) { return request.parser.parse(response).then(request.resolve).catch(request.reject); });\n }, Promise.resolve());\n });\n });\n };\n /**\n * Parses the response from a batch request into an array of Response instances\n *\n * @param body Text body of the response from the batch request\n */\n ODataBatch.prototype._parseResponse = function (body) {\n return new Promise(function (resolve, reject) {\n var responses = [];\n var header = \"--batchresponse_\";\n // Ex. \"HTTP/1.1 500 Internal Server Error\"\n var statusRegExp = new RegExp(\"^HTTP/[0-9.]+ +([0-9]+) +(.*)\", \"i\");\n var lines = body.split(\"\\n\");\n var state = \"batch\";\n var status;\n var statusText;\n for (var i = 0; i < lines.length; ++i) {\n var line = lines[i];\n switch (state) {\n case \"batch\":\n if (line.substr(0, header.length) === header) {\n state = \"batchHeaders\";\n }\n else {\n if (line.trim() !== \"\") {\n throw new exceptions_1.BatchParseException(\"Invalid response, line \" + i);\n }\n }\n break;\n case \"batchHeaders\":\n if (line.trim() === \"\") {\n state = \"status\";\n }\n break;\n case \"status\":\n var parts = statusRegExp.exec(line);\n if (parts.length !== 3) {\n throw new exceptions_1.BatchParseException(\"Invalid status, line \" + i);\n }\n status = parseInt(parts[1], 10);\n statusText = parts[2];\n state = \"statusHeaders\";\n break;\n case \"statusHeaders\":\n if (line.trim() === \"\") {\n state = \"body\";\n }\n break;\n case \"body\":\n responses.push((status === 204) ? new Response() : new Response(line, { status: status, statusText: statusText }));\n state = \"batch\";\n break;\n }\n }\n if (state !== \"status\") {\n reject(new exceptions_1.BatchParseException(\"Unexpected end of input\"));\n }\n resolve(responses);\n });\n };\n return ODataBatch;\n}());\nexports.ODataBatch = ODataBatch;\nvar TextFileParser = (function () {\n function TextFileParser() {\n }\n TextFileParser.prototype.parse = function (r) {\n return r.text();\n };\n return TextFileParser;\n}());\nexports.TextFileParser = TextFileParser;\nvar BlobFileParser = (function () {\n function BlobFileParser() {\n }\n BlobFileParser.prototype.parse = function (r) {\n return r.blob();\n };\n return BlobFileParser;\n}());\nexports.BlobFileParser = BlobFileParser;\nvar JSONFileParser = (function () {\n function JSONFileParser() {\n }\n JSONFileParser.prototype.parse = function (r) {\n return r.json();\n };\n return JSONFileParser;\n}());\nexports.JSONFileParser = JSONFileParser;\nvar BufferFileParser = (function () {\n function BufferFileParser() {\n }\n BufferFileParser.prototype.parse = function (r) {\n if (util_1.Util.isFunction(r.arrayBuffer)) {\n return r.arrayBuffer();\n }\n return r.buffer();\n };\n return BufferFileParser;\n}());\nexports.BufferFileParser = BufferFileParser;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/sharepoint/odata.js\n// module id = 2\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar logging_1 = require(\"../utils/logging\");\nfunction defaultLog(error) {\n logging_1.Logger.log({ data: {}, level: logging_1.LogLevel.Error, message: \"[\" + error.name + \"]::\" + error.message });\n}\n/**\n * Represents an exception with an HttpClient request\n *\n */\nvar ProcessHttpClientResponseException = (function (_super) {\n __extends(ProcessHttpClientResponseException, _super);\n function ProcessHttpClientResponseException(status, statusText, data) {\n var _this = _super.call(this, \"Error making HttpClient request in queryable: [\" + status + \"] \" + statusText) || this;\n _this.status = status;\n _this.statusText = statusText;\n _this.data = data;\n _this.name = \"ProcessHttpClientResponseException\";\n logging_1.Logger.log({ data: _this.data, level: logging_1.LogLevel.Error, message: _this.message });\n return _this;\n }\n return ProcessHttpClientResponseException;\n}(Error));\nexports.ProcessHttpClientResponseException = ProcessHttpClientResponseException;\nvar NoCacheAvailableException = (function (_super) {\n __extends(NoCacheAvailableException, _super);\n function NoCacheAvailableException(msg) {\n if (msg === void 0) { msg = \"Cannot create a caching configuration provider since cache is not available.\"; }\n var _this = _super.call(this, msg) || this;\n _this.name = \"NoCacheAvailableException\";\n defaultLog(_this);\n return _this;\n }\n return NoCacheAvailableException;\n}(Error));\nexports.NoCacheAvailableException = NoCacheAvailableException;\nvar APIUrlException = (function (_super) {\n __extends(APIUrlException, _super);\n function APIUrlException(msg) {\n if (msg === void 0) { msg = \"Unable to determine API url.\"; }\n var _this = _super.call(this, msg) || this;\n _this.name = \"APIUrlException\";\n defaultLog(_this);\n return _this;\n }\n return APIUrlException;\n}(Error));\nexports.APIUrlException = APIUrlException;\nvar AuthUrlException = (function (_super) {\n __extends(AuthUrlException, _super);\n function AuthUrlException(data, msg) {\n if (msg === void 0) { msg = \"Auth URL Endpoint could not be determined from data. Data logged.\"; }\n var _this = _super.call(this, msg) || this;\n _this.name = \"APIUrlException\";\n logging_1.Logger.log({ data: data, level: logging_1.LogLevel.Error, message: _this.message });\n return _this;\n }\n return AuthUrlException;\n}(Error));\nexports.AuthUrlException = AuthUrlException;\nvar NodeFetchClientUnsupportedException = (function (_super) {\n __extends(NodeFetchClientUnsupportedException, _super);\n function NodeFetchClientUnsupportedException(msg) {\n if (msg === void 0) { msg = \"Using NodeFetchClient in the browser is not supported.\"; }\n var _this = _super.call(this, msg) || this;\n _this.name = \"NodeFetchClientUnsupportedException\";\n defaultLog(_this);\n return _this;\n }\n return NodeFetchClientUnsupportedException;\n}(Error));\nexports.NodeFetchClientUnsupportedException = NodeFetchClientUnsupportedException;\nvar SPRequestExecutorUndefinedException = (function (_super) {\n __extends(SPRequestExecutorUndefinedException, _super);\n function SPRequestExecutorUndefinedException() {\n var _this = this;\n var msg = [\n \"SP.RequestExecutor is undefined. \",\n \"Load the SP.RequestExecutor.js library (/_layouts/15/SP.RequestExecutor.js) before loading the PnP JS Core library.\",\n ].join(\" \");\n _this = _super.call(this, msg) || this;\n _this.name = \"SPRequestExecutorUndefinedException\";\n defaultLog(_this);\n return _this;\n }\n return SPRequestExecutorUndefinedException;\n}(Error));\nexports.SPRequestExecutorUndefinedException = SPRequestExecutorUndefinedException;\nvar MaxCommentLengthException = (function (_super) {\n __extends(MaxCommentLengthException, _super);\n function MaxCommentLengthException(msg) {\n if (msg === void 0) { msg = \"The maximum comment length is 1023 characters.\"; }\n var _this = _super.call(this, msg) || this;\n _this.name = \"MaxCommentLengthException\";\n defaultLog(_this);\n return _this;\n }\n return MaxCommentLengthException;\n}(Error));\nexports.MaxCommentLengthException = MaxCommentLengthException;\nvar NotSupportedInBatchException = (function (_super) {\n __extends(NotSupportedInBatchException, _super);\n function NotSupportedInBatchException(operation) {\n if (operation === void 0) { operation = \"This operation\"; }\n var _this = _super.call(this, operation + \" is not supported as part of a batch.\") || this;\n _this.name = \"NotSupportedInBatchException\";\n defaultLog(_this);\n return _this;\n }\n return NotSupportedInBatchException;\n}(Error));\nexports.NotSupportedInBatchException = NotSupportedInBatchException;\nvar ODataIdException = (function (_super) {\n __extends(ODataIdException, _super);\n function ODataIdException(data, msg) {\n if (msg === void 0) { msg = \"Could not extract odata id in object, you may be using nometadata. Object data logged to logger.\"; }\n var _this = _super.call(this, msg) || this;\n _this.name = \"ODataIdException\";\n logging_1.Logger.log({ data: data, level: logging_1.LogLevel.Error, message: _this.message });\n return _this;\n }\n return ODataIdException;\n}(Error));\nexports.ODataIdException = ODataIdException;\nvar BatchParseException = (function (_super) {\n __extends(BatchParseException, _super);\n function BatchParseException(msg) {\n var _this = _super.call(this, msg) || this;\n _this.name = \"BatchParseException\";\n defaultLog(_this);\n return _this;\n }\n return BatchParseException;\n}(Error));\nexports.BatchParseException = BatchParseException;\nvar AlreadyInBatchException = (function (_super) {\n __extends(AlreadyInBatchException, _super);\n function AlreadyInBatchException(msg) {\n if (msg === void 0) { msg = \"This query is already part of a batch.\"; }\n var _this = _super.call(this, msg) || this;\n _this.name = \"AlreadyInBatchException\";\n defaultLog(_this);\n return _this;\n }\n return AlreadyInBatchException;\n}(Error));\nexports.AlreadyInBatchException = AlreadyInBatchException;\nvar FunctionExpectedException = (function (_super) {\n __extends(FunctionExpectedException, _super);\n function FunctionExpectedException(msg) {\n if (msg === void 0) { msg = \"This query is already part of a batch.\"; }\n var _this = _super.call(this, msg) || this;\n _this.name = \"FunctionExpectedException\";\n defaultLog(_this);\n return _this;\n }\n return FunctionExpectedException;\n}(Error));\nexports.FunctionExpectedException = FunctionExpectedException;\nvar UrlException = (function (_super) {\n __extends(UrlException, _super);\n function UrlException(msg) {\n var _this = _super.call(this, msg) || this;\n _this.name = \"UrlException\";\n defaultLog(_this);\n return _this;\n }\n return UrlException;\n}(Error));\nexports.UrlException = UrlException;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/utils/exceptions.js\n// module id = 3\n// module chunks = 0","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar fetchclient_1 = require(\"../net/fetchclient\");\nvar RuntimeConfigImpl = (function () {\n function RuntimeConfigImpl() {\n // these are our default values for the library\n this._headers = null;\n this._defaultCachingStore = \"session\";\n this._defaultCachingTimeoutSeconds = 60;\n this._globalCacheDisable = false;\n this._fetchClientFactory = function () { return new fetchclient_1.FetchClient(); };\n this._baseUrl = null;\n this._spfxContext = null;\n }\n RuntimeConfigImpl.prototype.set = function (config) {\n if (config.hasOwnProperty(\"headers\")) {\n this._headers = config.headers;\n }\n if (config.hasOwnProperty(\"globalCacheDisable\")) {\n this._globalCacheDisable = config.globalCacheDisable;\n }\n if (config.hasOwnProperty(\"defaultCachingStore\")) {\n this._defaultCachingStore = config.defaultCachingStore;\n }\n if (config.hasOwnProperty(\"defaultCachingTimeoutSeconds\")) {\n this._defaultCachingTimeoutSeconds = config.defaultCachingTimeoutSeconds;\n }\n if (config.hasOwnProperty(\"fetchClientFactory\")) {\n this._fetchClientFactory = config.fetchClientFactory;\n }\n if (config.hasOwnProperty(\"baseUrl\")) {\n this._baseUrl = config.baseUrl;\n }\n if (config.hasOwnProperty(\"spFXContext\")) {\n this._spfxContext = config.spfxContext;\n }\n };\n Object.defineProperty(RuntimeConfigImpl.prototype, \"headers\", {\n get: function () {\n return this._headers;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RuntimeConfigImpl.prototype, \"defaultCachingStore\", {\n get: function () {\n return this._defaultCachingStore;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RuntimeConfigImpl.prototype, \"defaultCachingTimeoutSeconds\", {\n get: function () {\n return this._defaultCachingTimeoutSeconds;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RuntimeConfigImpl.prototype, \"globalCacheDisable\", {\n get: function () {\n return this._globalCacheDisable;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RuntimeConfigImpl.prototype, \"fetchClientFactory\", {\n get: function () {\n return this._fetchClientFactory;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RuntimeConfigImpl.prototype, \"baseUrl\", {\n get: function () {\n if (this._baseUrl !== null) {\n return this._baseUrl;\n }\n else if (this._spfxContext !== null) {\n return this._spfxContext.pageContext.web.absoluteUrl;\n }\n return null;\n },\n enumerable: true,\n configurable: true\n });\n return RuntimeConfigImpl;\n}());\nexports.RuntimeConfigImpl = RuntimeConfigImpl;\nvar _runtimeConfig = new RuntimeConfigImpl();\nexports.RuntimeConfig = _runtimeConfig;\nfunction setRuntimeConfig(config) {\n _runtimeConfig.set(config);\n}\nexports.setRuntimeConfig = setRuntimeConfig;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/configuration/pnplibconfig.js\n// module id = 4\n// module chunks = 0","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * A set of logging levels\n *\n */\nvar LogLevel;\n(function (LogLevel) {\n LogLevel[LogLevel[\"Verbose\"] = 0] = \"Verbose\";\n LogLevel[LogLevel[\"Info\"] = 1] = \"Info\";\n LogLevel[LogLevel[\"Warning\"] = 2] = \"Warning\";\n LogLevel[LogLevel[\"Error\"] = 3] = \"Error\";\n LogLevel[LogLevel[\"Off\"] = 99] = \"Off\";\n})(LogLevel = exports.LogLevel || (exports.LogLevel = {}));\n/**\n * Class used to subscribe ILogListener and log messages throughout an application\n *\n */\nvar Logger = (function () {\n function Logger() {\n }\n Object.defineProperty(Logger, \"activeLogLevel\", {\n get: function () {\n return Logger.instance.activeLogLevel;\n },\n set: function (value) {\n Logger.instance.activeLogLevel = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Logger, \"instance\", {\n get: function () {\n if (typeof Logger._instance === \"undefined\" || Logger._instance === null) {\n Logger._instance = new LoggerImpl();\n }\n return Logger._instance;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Adds ILogListener instances to the set of subscribed listeners\n *\n * @param listeners One or more listeners to subscribe to this log\n */\n Logger.subscribe = function () {\n var listeners = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n listeners[_i] = arguments[_i];\n }\n listeners.map(function (listener) { return Logger.instance.subscribe(listener); });\n };\n /**\n * Clears the subscribers collection, returning the collection before modifiction\n */\n Logger.clearSubscribers = function () {\n return Logger.instance.clearSubscribers();\n };\n Object.defineProperty(Logger, \"count\", {\n /**\n * Gets the current subscriber count\n */\n get: function () {\n return Logger.instance.count;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Writes the supplied string to the subscribed listeners\n *\n * @param message The message to write\n * @param level [Optional] if supplied will be used as the level of the entry (Default: LogLevel.Verbose)\n */\n Logger.write = function (message, level) {\n if (level === void 0) { level = LogLevel.Verbose; }\n Logger.instance.log({ level: level, message: message });\n };\n /**\n * Writes the supplied string to the subscribed listeners\n *\n * @param json The json object to stringify and write\n * @param level [Optional] if supplied will be used as the level of the entry (Default: LogLevel.Verbose)\n */\n Logger.writeJSON = function (json, level) {\n if (level === void 0) { level = LogLevel.Verbose; }\n Logger.instance.log({ level: level, message: JSON.stringify(json) });\n };\n /**\n * Logs the supplied entry to the subscribed listeners\n *\n * @param entry The message to log\n */\n Logger.log = function (entry) {\n Logger.instance.log(entry);\n };\n /**\n * Logs performance tracking data for the the execution duration of the supplied function using console.profile\n *\n * @param name The name of this profile boundary\n * @param f The function to execute and track within this performance boundary\n */\n Logger.measure = function (name, f) {\n return Logger.instance.measure(name, f);\n };\n return Logger;\n}());\nexports.Logger = Logger;\nvar LoggerImpl = (function () {\n function LoggerImpl(activeLogLevel, subscribers) {\n if (activeLogLevel === void 0) { activeLogLevel = LogLevel.Warning; }\n if (subscribers === void 0) { subscribers = []; }\n this.activeLogLevel = activeLogLevel;\n this.subscribers = subscribers;\n }\n LoggerImpl.prototype.subscribe = function (listener) {\n this.subscribers.push(listener);\n };\n LoggerImpl.prototype.clearSubscribers = function () {\n var s = this.subscribers.slice(0);\n this.subscribers.length = 0;\n return s;\n };\n Object.defineProperty(LoggerImpl.prototype, \"count\", {\n get: function () {\n return this.subscribers.length;\n },\n enumerable: true,\n configurable: true\n });\n LoggerImpl.prototype.write = function (message, level) {\n if (level === void 0) { level = LogLevel.Verbose; }\n this.log({ level: level, message: message });\n };\n LoggerImpl.prototype.log = function (entry) {\n if (typeof entry === \"undefined\" || entry.level < this.activeLogLevel) {\n return;\n }\n this.subscribers.map(function (subscriber) { return subscriber.log(entry); });\n };\n LoggerImpl.prototype.measure = function (name, f) {\n console.profile(name);\n try {\n return f();\n }\n finally {\n console.profileEnd();\n }\n };\n return LoggerImpl;\n}());\n/**\n * Implementation of ILogListener which logs to the browser console\n *\n */\nvar ConsoleListener = (function () {\n function ConsoleListener() {\n }\n /**\n * Any associated data that a given logging listener may choose to log or ignore\n *\n * @param entry The information to be logged\n */\n ConsoleListener.prototype.log = function (entry) {\n var msg = this.format(entry);\n switch (entry.level) {\n case LogLevel.Verbose:\n case LogLevel.Info:\n console.log(msg);\n break;\n case LogLevel.Warning:\n console.warn(msg);\n break;\n case LogLevel.Error:\n console.error(msg);\n break;\n }\n };\n /**\n * Formats the message\n *\n * @param entry The information to format into a string\n */\n ConsoleListener.prototype.format = function (entry) {\n return \"Message: \" + entry.message + \" Data: \" + JSON.stringify(entry.data);\n };\n return ConsoleListener;\n}());\nexports.ConsoleListener = ConsoleListener;\n/**\n * Implementation of ILogListener which logs to the supplied function\n *\n */\nvar FunctionListener = (function () {\n /**\n * Creates a new instance of the FunctionListener class\n *\n * @constructor\n * @param method The method to which any logging data will be passed\n */\n function FunctionListener(method) {\n this.method = method;\n }\n /**\n * Any associated data that a given logging listener may choose to log or ignore\n *\n * @param entry The information to be logged\n */\n FunctionListener.prototype.log = function (entry) {\n this.method(entry);\n };\n return FunctionListener;\n}());\nexports.FunctionListener = FunctionListener;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/utils/logging.js\n// module id = 5\n// module chunks = 0","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Generic dictionary\n */\nvar Dictionary = (function () {\n /**\n * Creates a new instance of the Dictionary class\n *\n * @constructor\n */\n function Dictionary(keys, values) {\n if (keys === void 0) { keys = []; }\n if (values === void 0) { values = []; }\n this.keys = keys;\n this.values = values;\n }\n /**\n * Gets a value from the collection using the specified key\n *\n * @param key The key whose value we want to return, returns null if the key does not exist\n */\n Dictionary.prototype.get = function (key) {\n var index = this.keys.indexOf(key);\n if (index < 0) {\n return null;\n }\n return this.values[index];\n };\n /**\n * Adds the supplied key and value to the dictionary\n *\n * @param key The key to add\n * @param o The value to add\n */\n Dictionary.prototype.add = function (key, o) {\n var index = this.keys.indexOf(key);\n if (index > -1) {\n this.values[index] = o;\n }\n else {\n this.keys.push(key);\n this.values.push(o);\n }\n };\n /**\n * Merges the supplied typed hash into this dictionary instance. Existing values are updated and new ones are created as appropriate.\n */\n Dictionary.prototype.merge = function (source) {\n var _this = this;\n if (\"getKeys\" in source) {\n var sourceAsDictionary_1 = source;\n sourceAsDictionary_1.getKeys().map(function (key) {\n _this.add(key, sourceAsDictionary_1.get(key));\n });\n }\n else {\n var sourceAsHash = source;\n for (var key in sourceAsHash) {\n if (sourceAsHash.hasOwnProperty(key)) {\n this.add(key, sourceAsHash[key]);\n }\n }\n }\n };\n /**\n * Removes a value from the dictionary\n *\n * @param key The key of the key/value pair to remove. Returns null if the key was not found.\n */\n Dictionary.prototype.remove = function (key) {\n var index = this.keys.indexOf(key);\n if (index < 0) {\n return null;\n }\n var val = this.values[index];\n this.keys.splice(index, 1);\n this.values.splice(index, 1);\n return val;\n };\n /**\n * Returns all the keys currently in the dictionary as an array\n */\n Dictionary.prototype.getKeys = function () {\n return this.keys;\n };\n /**\n * Returns all the values currently in the dictionary as an array\n */\n Dictionary.prototype.getValues = function () {\n return this.values;\n };\n /**\n * Clears the current dictionary\n */\n Dictionary.prototype.clear = function () {\n this.keys = [];\n this.values = [];\n };\n /**\n * Gets a count of the items currently in the dictionary\n */\n Dictionary.prototype.count = function () {\n return this.keys.length;\n };\n return Dictionary;\n}());\nexports.Dictionary = Dictionary;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/collections/collections.js\n// module id = 6\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar queryable_1 = require(\"./queryable\");\nvar lists_1 = require(\"./lists\");\nvar fields_1 = require(\"./fields\");\nvar navigation_1 = require(\"./navigation\");\nvar sitegroups_1 = require(\"./sitegroups\");\nvar contenttypes_1 = require(\"./contenttypes\");\nvar folders_1 = require(\"./folders\");\nvar roles_1 = require(\"./roles\");\nvar files_1 = require(\"./files\");\nvar util_1 = require(\"../utils/util\");\nvar lists_2 = require(\"./lists\");\nvar siteusers_1 = require(\"./siteusers\");\nvar usercustomactions_1 = require(\"./usercustomactions\");\nvar odata_1 = require(\"./odata\");\nvar features_1 = require(\"./features\");\nvar decorators_1 = require(\"../utils/decorators\");\nvar queryableshareable_1 = require(\"./queryableshareable\");\nvar relateditems_1 = require(\"./relateditems\");\nvar Webs = (function (_super) {\n __extends(Webs, _super);\n function Webs(baseUrl, webPath) {\n if (webPath === void 0) { webPath = \"webs\"; }\n return _super.call(this, baseUrl, webPath) || this;\n }\n /**\n * Adds a new web to the collection\n *\n * @param title The new web's title\n * @param url The new web's relative url\n * @param description The web web's description\n * @param template The web's template\n * @param language The language code to use for this web\n * @param inheritPermissions If true permissions will be inherited from the partent web\n * @param additionalSettings Will be passed as part of the web creation body\n */\n Webs.prototype.add = function (title, url, description, template, language, inheritPermissions, additionalSettings) {\n if (description === void 0) { description = \"\"; }\n if (template === void 0) { template = \"STS\"; }\n if (language === void 0) { language = 1033; }\n if (inheritPermissions === void 0) { inheritPermissions = true; }\n if (additionalSettings === void 0) { additionalSettings = {}; }\n var props = util_1.Util.extend({\n Description: description,\n Language: language,\n Title: title,\n Url: url,\n UseSamePermissionsAsParentSite: inheritPermissions,\n WebTemplate: template,\n }, additionalSettings);\n var postBody = JSON.stringify({\n \"parameters\": util_1.Util.extend({\n \"__metadata\": { \"type\": \"SP.WebCreationInformation\" },\n }, props),\n });\n return this.clone(Webs, \"add\", true).post({ body: postBody }).then(function (data) {\n return {\n data: data,\n web: new Web(odata_1.extractOdataId(data).replace(/_api\\/web\\/?/i, \"\")),\n };\n });\n };\n return Webs;\n}(queryable_1.QueryableCollection));\nexports.Webs = Webs;\n/**\n * Describes a web\n *\n */\nvar Web = (function (_super) {\n __extends(Web, _super);\n function Web(baseUrl, path) {\n if (path === void 0) { path = \"_api/web\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * Creates a new web instance from the given url by indexing the location of the /_api/\n * segment. If this is not found the method creates a new web with the entire string as\n * supplied.\n *\n * @param url\n */\n Web.fromUrl = function (url, path) {\n if (url === null) {\n return new Web(\"\");\n }\n var index = url.indexOf(\"_api/\");\n if (index > -1) {\n return new Web(url.substr(0, index), path);\n }\n return new Web(url, path);\n };\n Object.defineProperty(Web.prototype, \"webs\", {\n get: function () {\n return new Webs(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"contentTypes\", {\n /**\n * Get the content types available in this web\n *\n */\n get: function () {\n return new contenttypes_1.ContentTypes(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"lists\", {\n /**\n * Get the lists in this web\n *\n */\n get: function () {\n return new lists_1.Lists(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"fields\", {\n /**\n * Gets the fields in this web\n *\n */\n get: function () {\n return new fields_1.Fields(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"features\", {\n /**\n * Gets the active features for this web\n *\n */\n get: function () {\n return new features_1.Features(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"availablefields\", {\n /**\n * Gets the available fields in this web\n *\n */\n get: function () {\n return new fields_1.Fields(this, \"availablefields\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"navigation\", {\n /**\n * Get the navigation options in this web\n *\n */\n get: function () {\n return new navigation_1.Navigation(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"siteUsers\", {\n /**\n * Gets the site users\n *\n */\n get: function () {\n return new siteusers_1.SiteUsers(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"siteGroups\", {\n /**\n * Gets the site groups\n *\n */\n get: function () {\n return new sitegroups_1.SiteGroups(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"currentUser\", {\n /**\n * Gets the current user\n */\n get: function () {\n return new siteusers_1.CurrentUser(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"folders\", {\n /**\n * Get the folders in this web\n *\n */\n get: function () {\n return new folders_1.Folders(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"userCustomActions\", {\n /**\n * Get all custom actions on a site\n *\n */\n get: function () {\n return new usercustomactions_1.UserCustomActions(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"roleDefinitions\", {\n /**\n * Gets the collection of RoleDefinition resources.\n *\n */\n get: function () {\n return new roles_1.RoleDefinitions(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"relatedItems\", {\n /**\n * Provides an interface to manage related items\n *\n */\n get: function () {\n return relateditems_1.RelatedItemManagerImpl.FromUrl(this.toUrl());\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Creates a new batch for requests within the context of context this web\n *\n */\n Web.prototype.createBatch = function () {\n return new odata_1.ODataBatch(this.parentUrl);\n };\n Object.defineProperty(Web.prototype, \"rootFolder\", {\n /**\n * The root folder of the web\n */\n get: function () {\n return new folders_1.Folder(this, \"rootFolder\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"associatedOwnerGroup\", {\n get: function () {\n return new sitegroups_1.SiteGroup(this, \"associatedownergroup\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"associatedMemberGroup\", {\n get: function () {\n return new sitegroups_1.SiteGroup(this, \"associatedmembergroup\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Web.prototype, \"associatedVisitorGroup\", {\n get: function () {\n return new sitegroups_1.SiteGroup(this, \"associatedvisitorgroup\");\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Get a folder by server relative url\n *\n * @param folderRelativeUrl the server relative path to the folder (including /sites/ if applicable)\n */\n Web.prototype.getFolderByServerRelativeUrl = function (folderRelativeUrl) {\n return new folders_1.Folder(this, \"getFolderByServerRelativeUrl('\" + folderRelativeUrl + \"')\");\n };\n /**\n * Get a file by server relative url\n *\n * @param fileRelativeUrl the server relative path to the file (including /sites/ if applicable)\n */\n Web.prototype.getFileByServerRelativeUrl = function (fileRelativeUrl) {\n return new files_1.File(this, \"getFileByServerRelativeUrl('\" + fileRelativeUrl + \"')\");\n };\n /**\n * Get a list by server relative url (list's root folder)\n *\n * @param listRelativeUrl the server relative path to the list's root folder (including /sites/ if applicable)\n */\n Web.prototype.getList = function (listRelativeUrl) {\n return new lists_2.List(this, \"getList('\" + listRelativeUrl + \"')\");\n };\n /**\n * Updates this web intance with the supplied properties\n *\n * @param properties A plain object hash of values to update for the web\n */\n Web.prototype.update = function (properties) {\n var _this = this;\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": \"SP.Web\" },\n }, properties));\n return this.post({\n body: postBody,\n headers: {\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n return {\n data: data,\n web: _this,\n };\n });\n };\n /**\n * Delete this web\n *\n */\n Web.prototype.delete = function () {\n return _super.prototype.delete.call(this);\n };\n /**\n * Applies the theme specified by the contents of each of the files specified in the arguments to the site.\n *\n * @param colorPaletteUrl Server-relative URL of the color palette file.\n * @param fontSchemeUrl Server-relative URL of the font scheme.\n * @param backgroundImageUrl Server-relative URL of the background image.\n * @param shareGenerated true to store the generated theme files in the root site, or false to store them in this site.\n */\n Web.prototype.applyTheme = function (colorPaletteUrl, fontSchemeUrl, backgroundImageUrl, shareGenerated) {\n var postBody = JSON.stringify({\n backgroundImageUrl: backgroundImageUrl,\n colorPaletteUrl: colorPaletteUrl,\n fontSchemeUrl: fontSchemeUrl,\n shareGenerated: shareGenerated,\n });\n return this.clone(Web, \"applytheme\", true).post({ body: postBody });\n };\n /**\n * Applies the specified site definition or site template to the Web site that has no template applied to it.\n *\n * @param template Name of the site definition or the name of the site template\n */\n Web.prototype.applyWebTemplate = function (template) {\n var q = this.clone(Web, \"applywebtemplate\", true);\n q.concat(\"(@t)\");\n q.query.add(\"@t\", template);\n return q.post();\n };\n /**\n * Returns whether the current user has the given set of permissions.\n *\n * @param perms The high and low permission range.\n */\n Web.prototype.doesUserHavePermissions = function (perms) {\n var q = this.clone(Web, \"doesuserhavepermissions\", true);\n q.concat(\"(@p)\");\n q.query.add(\"@p\", JSON.stringify(perms));\n return q.get();\n };\n /**\n * Checks whether the specified login name belongs to a valid user in the site. If the user doesn't exist, adds the user to the site.\n *\n * @param loginName The login name of the user (ex: i:0#.f|membership|user@domain.onmicrosoft.com)\n */\n Web.prototype.ensureUser = function (loginName) {\n var postBody = JSON.stringify({\n logonName: loginName,\n });\n return this.clone(Web, \"ensureuser\", true).post({ body: postBody }).then(function (data) {\n return {\n data: data,\n user: new siteusers_1.SiteUser(odata_1.extractOdataId(data)),\n };\n });\n };\n /**\n * Returns a collection of site templates available for the site.\n *\n * @param language The LCID of the site templates to get.\n * @param true to include language-neutral site templates; otherwise false\n */\n Web.prototype.availableWebTemplates = function (language, includeCrossLanugage) {\n if (language === void 0) { language = 1033; }\n if (includeCrossLanugage === void 0) { includeCrossLanugage = true; }\n return new queryable_1.QueryableCollection(this, \"getavailablewebtemplates(lcid=\" + language + \", doincludecrosslanguage=\" + includeCrossLanugage + \")\");\n };\n /**\n * Returns the list gallery on the site.\n *\n * @param type The gallery type - WebTemplateCatalog = 111, WebPartCatalog = 113 ListTemplateCatalog = 114,\n * MasterPageCatalog = 116, SolutionCatalog = 121, ThemeCatalog = 123, DesignCatalog = 124, AppDataCatalog = 125\n */\n Web.prototype.getCatalog = function (type) {\n return this.clone(Web, \"getcatalog(\" + type + \")\", true).select(\"Id\").get().then(function (data) {\n return new lists_2.List(odata_1.extractOdataId(data));\n });\n };\n /**\n * Returns the collection of changes from the change log that have occurred within the list, based on the specified query.\n */\n Web.prototype.getChanges = function (query) {\n var postBody = JSON.stringify({ \"query\": util_1.Util.extend({ \"__metadata\": { \"type\": \"SP.ChangeQuery\" } }, query) });\n return this.clone(Web, \"getchanges\", true).post({ body: postBody });\n };\n Object.defineProperty(Web.prototype, \"customListTemplate\", {\n /**\n * Gets the custom list templates for the site.\n *\n */\n get: function () {\n return new queryable_1.QueryableCollection(this, \"getcustomlisttemplates\");\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Returns the user corresponding to the specified member identifier for the current site.\n *\n * @param id The ID of the user.\n */\n Web.prototype.getUserById = function (id) {\n return new siteusers_1.SiteUser(this, \"getUserById(\" + id + \")\");\n };\n /**\n * Returns the name of the image file for the icon that is used to represent the specified file.\n *\n * @param filename The file name. If this parameter is empty, the server returns an empty string.\n * @param size The size of the icon: 16x16 pixels = 0, 32x32 pixels = 1.\n * @param progId The ProgID of the application that was used to create the file, in the form OLEServerName.ObjectName\n */\n Web.prototype.mapToIcon = function (filename, size, progId) {\n if (size === void 0) { size = 0; }\n if (progId === void 0) { progId = \"\"; }\n return this.clone(Web, \"maptoicon(filename='\" + filename + \"', progid='\" + progId + \"', size=\" + size + \")\", true).get();\n };\n return Web;\n}(queryableshareable_1.QueryableShareableWeb));\n__decorate([\n decorators_1.deprecated(\"This method will be removed in future releases. Please use the methods found in queryable securable.\")\n], Web.prototype, \"doesUserHavePermissions\", null);\nexports.Web = Web;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/sharepoint/webs.js\n// module id = 7\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar queryable_1 = require(\"./queryable\");\nvar odata_1 = require(\"./odata\");\nvar util_1 = require(\"../utils/util\");\nvar exceptions_1 = require(\"../utils/exceptions\");\nvar webparts_1 = require(\"./webparts\");\nvar items_1 = require(\"./items\");\nvar queryableshareable_1 = require(\"./queryableshareable\");\nvar odata_2 = require(\"./odata\");\n/**\n * Describes a collection of File objects\n *\n */\nvar Files = (function (_super) {\n __extends(Files, _super);\n /**\n * Creates a new instance of the Files class\n *\n * @param baseUrl The url or Queryable which forms the parent of this fields collection\n */\n function Files(baseUrl, path) {\n if (path === void 0) { path = \"files\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * Gets a File by filename\n *\n * @param name The name of the file, including extension.\n */\n Files.prototype.getByName = function (name) {\n var f = new File(this);\n f.concat(\"('\" + name + \"')\");\n return f;\n };\n /**\n * Uploads a file. Not supported for batching\n *\n * @param url The folder-relative url of the file.\n * @param content The file contents blob.\n * @param shouldOverWrite Should a file with the same name in the same location be overwritten? (default: true)\n * @returns The new File and the raw response.\n */\n Files.prototype.add = function (url, content, shouldOverWrite) {\n var _this = this;\n if (shouldOverWrite === void 0) { shouldOverWrite = true; }\n return new Files(this, \"add(overwrite=\" + shouldOverWrite + \",url='\" + url + \"')\")\n .post({\n body: content,\n }).then(function (response) {\n return {\n data: response,\n file: _this.getByName(url),\n };\n });\n };\n /**\n * Uploads a file. Not supported for batching\n *\n * @param url The folder-relative url of the file.\n * @param content The Blob file content to add\n * @param progress A callback function which can be used to track the progress of the upload\n * @param shouldOverWrite Should a file with the same name in the same location be overwritten? (default: true)\n * @param chunkSize The size of each file slice, in bytes (default: 10485760)\n * @returns The new File and the raw response.\n */\n Files.prototype.addChunked = function (url, content, progress, shouldOverWrite, chunkSize) {\n var _this = this;\n if (shouldOverWrite === void 0) { shouldOverWrite = true; }\n if (chunkSize === void 0) { chunkSize = 10485760; }\n var adder = this.clone(Files, \"add(overwrite=\" + shouldOverWrite + \",url='\" + url + \"')\");\n return adder.post().then(function () { return _this.getByName(url); }).then(function (file) { return file.setContentChunked(content, progress, chunkSize); }).then(function (response) {\n return {\n data: response,\n file: _this.getByName(url),\n };\n });\n };\n /**\n * Adds a ghosted file to an existing list or document library. Not supported for batching.\n *\n * @param fileUrl The server-relative url where you want to save the file.\n * @param templateFileType The type of use to create the file.\n * @returns The template file that was added and the raw response.\n */\n Files.prototype.addTemplateFile = function (fileUrl, templateFileType) {\n var _this = this;\n return this.clone(Files, \"addTemplateFile(urloffile='\" + fileUrl + \"',templatefiletype=\" + templateFileType + \")\")\n .post().then(function (response) {\n return {\n data: response,\n file: _this.getByName(fileUrl),\n };\n });\n };\n return Files;\n}(queryable_1.QueryableCollection));\nexports.Files = Files;\n/**\n * Describes a single File instance\n *\n */\nvar File = (function (_super) {\n __extends(File, _super);\n function File() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(File.prototype, \"listItemAllFields\", {\n /**\n * Gets a value that specifies the list item field values for the list item corresponding to the file.\n *\n */\n get: function () {\n return new queryable_1.QueryableCollection(this, \"listItemAllFields\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(File.prototype, \"versions\", {\n /**\n * Gets a collection of versions\n *\n */\n get: function () {\n return new Versions(this);\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Approves the file submitted for content approval with the specified comment.\n * Only documents in lists that are enabled for content approval can be approved.\n *\n * @param comment The comment for the approval.\n */\n File.prototype.approve = function (comment) {\n return this.clone(File, \"approve(comment='\" + comment + \"')\", true).post();\n };\n /**\n * Stops the chunk upload session without saving the uploaded data. Does not support batching.\n * If the file doesn’t already exist in the library, the partially uploaded file will be deleted.\n * Use this in response to user action (as in a request to cancel an upload) or an error or exception.\n * Use the uploadId value that was passed to the StartUpload method that started the upload session.\n * This method is currently available only on Office 365.\n *\n * @param uploadId The unique identifier of the upload session.\n */\n File.prototype.cancelUpload = function (uploadId) {\n return this.clone(File, \"cancelUpload(uploadId=guid'\" + uploadId + \"')\", false).post();\n };\n /**\n * Checks the file in to a document library based on the check-in type.\n *\n * @param comment A comment for the check-in. Its length must be <= 1023.\n * @param checkinType The check-in type for the file.\n */\n File.prototype.checkin = function (comment, checkinType) {\n if (comment === void 0) { comment = \"\"; }\n if (checkinType === void 0) { checkinType = CheckinType.Major; }\n if (comment.length > 1023) {\n throw new exceptions_1.MaxCommentLengthException();\n }\n return this.clone(File, \"checkin(comment='\" + comment + \"',checkintype=\" + checkinType + \")\", true).post();\n };\n /**\n * Checks out the file from a document library.\n */\n File.prototype.checkout = function () {\n return this.clone(File, \"checkout\", true).post();\n };\n /**\n * Copies the file to the destination url.\n *\n * @param url The absolute url or server relative url of the destination file path to copy to.\n * @param shouldOverWrite Should a file with the same name in the same location be overwritten?\n */\n File.prototype.copyTo = function (url, shouldOverWrite) {\n if (shouldOverWrite === void 0) { shouldOverWrite = true; }\n return this.clone(File, \"copyTo(strnewurl='\" + url + \"',boverwrite=\" + shouldOverWrite + \")\", true).post();\n };\n /**\n * Delete this file.\n *\n * @param eTag Value used in the IF-Match header, by default \"*\"\n */\n File.prototype.delete = function (eTag) {\n if (eTag === void 0) { eTag = \"*\"; }\n return this.clone(File, null, true).post({\n headers: {\n \"IF-Match\": eTag,\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n /**\n * Denies approval for a file that was submitted for content approval.\n * Only documents in lists that are enabled for content approval can be denied.\n *\n * @param comment The comment for the denial.\n */\n File.prototype.deny = function (comment) {\n if (comment === void 0) { comment = \"\"; }\n if (comment.length > 1023) {\n throw new exceptions_1.MaxCommentLengthException();\n }\n return this.clone(File, \"deny(comment='\" + comment + \"')\", true).post();\n };\n /**\n * Specifies the control set used to access, modify, or add Web Parts associated with this Web Part Page and view.\n * An exception is thrown if the file is not an ASPX page.\n *\n * @param scope The WebPartsPersonalizationScope view on the Web Parts page.\n */\n File.prototype.getLimitedWebPartManager = function (scope) {\n if (scope === void 0) { scope = WebPartsPersonalizationScope.Shared; }\n return new webparts_1.LimitedWebPartManager(this, \"getLimitedWebPartManager(scope=\" + scope + \")\");\n };\n /**\n * Moves the file to the specified destination url.\n *\n * @param url The absolute url or server relative url of the destination file path to move to.\n * @param moveOperations The bitwise MoveOperations value for how to move the file.\n */\n File.prototype.moveTo = function (url, moveOperations) {\n if (moveOperations === void 0) { moveOperations = MoveOperations.Overwrite; }\n return this.clone(File, \"moveTo(newurl='\" + url + \"',flags=\" + moveOperations + \")\", true).post();\n };\n /**\n * Submits the file for content approval with the specified comment.\n *\n * @param comment The comment for the published file. Its length must be <= 1023.\n */\n File.prototype.publish = function (comment) {\n if (comment === void 0) { comment = \"\"; }\n if (comment.length > 1023) {\n throw new exceptions_1.MaxCommentLengthException();\n }\n return this.clone(File, \"publish(comment='\" + comment + \"')\", true).post();\n };\n /**\n * Moves the file to the Recycle Bin and returns the identifier of the new Recycle Bin item.\n *\n * @returns The GUID of the recycled file.\n */\n File.prototype.recycle = function () {\n return this.clone(File, \"recycle\", true).post();\n };\n /**\n * Reverts an existing checkout for the file.\n *\n */\n File.prototype.undoCheckout = function () {\n return this.clone(File, \"undoCheckout\", true).post();\n };\n /**\n * Removes the file from content approval or unpublish a major version.\n *\n * @param comment The comment for the unpublish operation. Its length must be <= 1023.\n */\n File.prototype.unpublish = function (comment) {\n if (comment === void 0) { comment = \"\"; }\n if (comment.length > 1023) {\n throw new exceptions_1.MaxCommentLengthException();\n }\n return this.clone(File, \"unpublish(comment='\" + comment + \"')\", true).post();\n };\n /**\n * Gets the contents of the file as text. Not supported in batching.\n *\n */\n File.prototype.getText = function () {\n return this.clone(File, \"$value\").get(new odata_1.TextFileParser(), { headers: { \"binaryStringResponseBody\": \"true\" } });\n };\n /**\n * Gets the contents of the file as a blob, does not work in Node.js. Not supported in batching.\n *\n */\n File.prototype.getBlob = function () {\n return this.clone(File, \"$value\").get(new odata_1.BlobFileParser(), { headers: { \"binaryStringResponseBody\": \"true\" } });\n };\n /**\n * Gets the contents of a file as an ArrayBuffer, works in Node.js. Not supported in batching.\n */\n File.prototype.getBuffer = function () {\n return this.clone(File, \"$value\").get(new odata_1.BufferFileParser(), { headers: { \"binaryStringResponseBody\": \"true\" } });\n };\n /**\n * Gets the contents of a file as an ArrayBuffer, works in Node.js. Not supported in batching.\n */\n File.prototype.getJSON = function () {\n return this.clone(File, \"$value\").get(new odata_1.JSONFileParser(), { headers: { \"binaryStringResponseBody\": \"true\" } });\n };\n /**\n * Sets the content of a file, for large files use setContentChunked. Not supported in batching.\n *\n * @param content The file content\n *\n */\n File.prototype.setContent = function (content) {\n var _this = this;\n return this.clone(File, \"$value\").post({\n body: content,\n headers: {\n \"X-HTTP-Method\": \"PUT\",\n },\n }).then(function (_) { return new File(_this); });\n };\n /**\n * Gets the associated list item for this folder, loading the default properties\n */\n File.prototype.getItem = function () {\n var selects = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n selects[_i] = arguments[_i];\n }\n var q = this.listItemAllFields;\n return q.select.apply(q, selects).get().then(function (d) {\n return util_1.Util.extend(new items_1.Item(odata_2.getEntityUrl(d)), d);\n });\n };\n /**\n * Sets the contents of a file using a chunked upload approach. Not supported in batching.\n *\n * @param file The file to upload\n * @param progress A callback function which can be used to track the progress of the upload\n * @param chunkSize The size of each file slice, in bytes (default: 10485760)\n */\n File.prototype.setContentChunked = function (file, progress, chunkSize) {\n if (chunkSize === void 0) { chunkSize = 10485760; }\n if (typeof progress === \"undefined\") {\n progress = function () { return null; };\n }\n var self = this;\n var fileSize = file.size;\n var blockCount = parseInt((file.size / chunkSize).toString(), 10) + ((file.size % chunkSize === 0) ? 1 : 0);\n var uploadId = util_1.Util.getGUID();\n // start the chain with the first fragment\n progress({ blockNumber: 1, chunkSize: chunkSize, currentPointer: 0, fileSize: fileSize, stage: \"starting\", totalBlocks: blockCount });\n var chain = self.startUpload(uploadId, file.slice(0, chunkSize));\n var _loop_1 = function (i) {\n chain = chain.then(function (pointer) {\n progress({ blockNumber: i, chunkSize: chunkSize, currentPointer: pointer, fileSize: fileSize, stage: \"continue\", totalBlocks: blockCount });\n return self.continueUpload(uploadId, pointer, file.slice(pointer, pointer + chunkSize));\n });\n };\n // skip the first and last blocks\n for (var i = 2; i < blockCount; i++) {\n _loop_1(i);\n }\n return chain.then(function (pointer) {\n progress({ blockNumber: blockCount, chunkSize: chunkSize, currentPointer: pointer, fileSize: fileSize, stage: \"finishing\", totalBlocks: blockCount });\n return self.finishUpload(uploadId, pointer, file.slice(pointer));\n }).then(function (_) {\n return self;\n });\n };\n /**\n * Starts a new chunk upload session and uploads the first fragment.\n * The current file content is not changed when this method completes.\n * The method is idempotent (and therefore does not change the result) as long as you use the same values for uploadId and stream.\n * The upload session ends either when you use the CancelUpload method or when you successfully\n * complete the upload session by passing the rest of the file contents through the ContinueUpload and FinishUpload methods.\n * The StartUpload and ContinueUpload methods return the size of the running total of uploaded data in bytes,\n * so you can pass those return values to subsequent uses of ContinueUpload and FinishUpload.\n * This method is currently available only on Office 365.\n *\n * @param uploadId The unique identifier of the upload session.\n * @param fragment The file contents.\n * @returns The size of the total uploaded data in bytes.\n */\n File.prototype.startUpload = function (uploadId, fragment) {\n return this.clone(File, \"startUpload(uploadId=guid'\" + uploadId + \"')\").postAs({ body: fragment }).then(function (n) { return parseFloat(n); });\n };\n /**\n * Continues the chunk upload session with an additional fragment.\n * The current file content is not changed.\n * Use the uploadId value that was passed to the StartUpload method that started the upload session.\n * This method is currently available only on Office 365.\n *\n * @param uploadId The unique identifier of the upload session.\n * @param fileOffset The size of the offset into the file where the fragment starts.\n * @param fragment The file contents.\n * @returns The size of the total uploaded data in bytes.\n */\n File.prototype.continueUpload = function (uploadId, fileOffset, fragment) {\n return this.clone(File, \"continueUpload(uploadId=guid'\" + uploadId + \"',fileOffset=\" + fileOffset + \")\").postAs({ body: fragment }).then(function (n) { return parseFloat(n); });\n };\n /**\n * Uploads the last file fragment and commits the file. The current file content is changed when this method completes.\n * Use the uploadId value that was passed to the StartUpload method that started the upload session.\n * This method is currently available only on Office 365.\n *\n * @param uploadId The unique identifier of the upload session.\n * @param fileOffset The size of the offset into the file where the fragment starts.\n * @param fragment The file contents.\n * @returns The newly uploaded file.\n */\n File.prototype.finishUpload = function (uploadId, fileOffset, fragment) {\n return this.clone(File, \"finishUpload(uploadId=guid'\" + uploadId + \"',fileOffset=\" + fileOffset + \")\")\n .postAs({ body: fragment }).then(function (response) {\n return {\n data: response,\n file: new File(response.ServerRelativeUrl),\n };\n });\n };\n return File;\n}(queryableshareable_1.QueryableShareableFile));\nexports.File = File;\n/**\n * Describes a collection of Version objects\n *\n */\nvar Versions = (function (_super) {\n __extends(Versions, _super);\n /**\n * Creates a new instance of the File class\n *\n * @param baseUrl The url or Queryable which forms the parent of this fields collection\n */\n function Versions(baseUrl, path) {\n if (path === void 0) { path = \"versions\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * Gets a version by id\n *\n * @param versionId The id of the version to retrieve\n */\n Versions.prototype.getById = function (versionId) {\n var v = new Version(this);\n v.concat(\"(\" + versionId + \")\");\n return v;\n };\n /**\n * Deletes all the file version objects in the collection.\n *\n */\n Versions.prototype.deleteAll = function () {\n return new Versions(this, \"deleteAll\").post();\n };\n /**\n * Deletes the specified version of the file.\n *\n * @param versionId The ID of the file version to delete.\n */\n Versions.prototype.deleteById = function (versionId) {\n return this.clone(Versions, \"deleteById(vid=\" + versionId + \")\", true).post();\n };\n /**\n * Deletes the file version object with the specified version label.\n *\n * @param label The version label of the file version to delete, for example: 1.2\n */\n Versions.prototype.deleteByLabel = function (label) {\n return this.clone(Versions, \"deleteByLabel(versionlabel='\" + label + \"')\", true).post();\n };\n /**\n * Creates a new file version from the file specified by the version label.\n *\n * @param label The version label of the file version to restore, for example: 1.2\n */\n Versions.prototype.restoreByLabel = function (label) {\n return this.clone(Versions, \"restoreByLabel(versionlabel='\" + label + \"')\", true).post();\n };\n return Versions;\n}(queryable_1.QueryableCollection));\nexports.Versions = Versions;\n/**\n * Describes a single Version instance\n *\n */\nvar Version = (function (_super) {\n __extends(Version, _super);\n function Version() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Delete a specific version of a file.\n *\n * @param eTag Value used in the IF-Match header, by default \"*\"\n */\n Version.prototype.delete = function (eTag) {\n if (eTag === void 0) { eTag = \"*\"; }\n return this.post({\n headers: {\n \"IF-Match\": eTag,\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n return Version;\n}(queryable_1.QueryableInstance));\nexports.Version = Version;\nvar CheckinType;\n(function (CheckinType) {\n CheckinType[CheckinType[\"Minor\"] = 0] = \"Minor\";\n CheckinType[CheckinType[\"Major\"] = 1] = \"Major\";\n CheckinType[CheckinType[\"Overwrite\"] = 2] = \"Overwrite\";\n})(CheckinType = exports.CheckinType || (exports.CheckinType = {}));\nvar WebPartsPersonalizationScope;\n(function (WebPartsPersonalizationScope) {\n WebPartsPersonalizationScope[WebPartsPersonalizationScope[\"User\"] = 0] = \"User\";\n WebPartsPersonalizationScope[WebPartsPersonalizationScope[\"Shared\"] = 1] = \"Shared\";\n})(WebPartsPersonalizationScope = exports.WebPartsPersonalizationScope || (exports.WebPartsPersonalizationScope = {}));\nvar MoveOperations;\n(function (MoveOperations) {\n MoveOperations[MoveOperations[\"Overwrite\"] = 1] = \"Overwrite\";\n MoveOperations[MoveOperations[\"AllowBrokenThickets\"] = 8] = \"AllowBrokenThickets\";\n})(MoveOperations = exports.MoveOperations || (exports.MoveOperations = {}));\nvar TemplateFileType;\n(function (TemplateFileType) {\n TemplateFileType[TemplateFileType[\"StandardPage\"] = 0] = \"StandardPage\";\n TemplateFileType[TemplateFileType[\"WikiPage\"] = 1] = \"WikiPage\";\n TemplateFileType[TemplateFileType[\"FormPage\"] = 2] = \"FormPage\";\n})(TemplateFileType = exports.TemplateFileType || (exports.TemplateFileType = {}));\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/sharepoint/files.js\n// module id = 8\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar queryable_1 = require(\"./queryable\");\nvar queryableshareable_1 = require(\"./queryableshareable\");\nvar files_1 = require(\"./files\");\nvar util_1 = require(\"../utils/util\");\nvar odata_1 = require(\"./odata\");\nvar items_1 = require(\"./items\");\n/**\n * Describes a collection of Folder objects\n *\n */\nvar Folders = (function (_super) {\n __extends(Folders, _super);\n /**\n * Creates a new instance of the Folders class\n *\n * @param baseUrl The url or Queryable which forms the parent of this fields collection\n */\n function Folders(baseUrl, path) {\n if (path === void 0) { path = \"folders\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * Gets a folder by folder name\n *\n */\n Folders.prototype.getByName = function (name) {\n var f = new Folder(this);\n f.concat(\"('\" + name + \"')\");\n return f;\n };\n /**\n * Adds a new folder to the current folder (relative) or any folder (absolute)\n *\n * @param url The relative or absolute url where the new folder will be created. Urls starting with a forward slash are absolute.\n * @returns The new Folder and the raw response.\n */\n Folders.prototype.add = function (url) {\n var _this = this;\n return this.clone(Folders, \"add('\" + url + \"')\", true).post().then(function (response) {\n return {\n data: response,\n folder: _this.getByName(url),\n };\n });\n };\n return Folders;\n}(queryable_1.QueryableCollection));\nexports.Folders = Folders;\n/**\n * Describes a single Folder instance\n *\n */\nvar Folder = (function (_super) {\n __extends(Folder, _super);\n function Folder() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(Folder.prototype, \"contentTypeOrder\", {\n /**\n * Specifies the sequence in which content types are displayed.\n *\n */\n get: function () {\n return new queryable_1.QueryableCollection(this, \"contentTypeOrder\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Folder.prototype, \"files\", {\n /**\n * Gets this folder's files\n *\n */\n get: function () {\n return new files_1.Files(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Folder.prototype, \"folders\", {\n /**\n * Gets this folder's sub folders\n *\n */\n get: function () {\n return new Folders(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Folder.prototype, \"listItemAllFields\", {\n /**\n * Gets this folder's list item field values\n *\n */\n get: function () {\n return new queryable_1.QueryableCollection(this, \"listItemAllFields\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Folder.prototype, \"parentFolder\", {\n /**\n * Gets the parent folder, if available\n *\n */\n get: function () {\n return new Folder(this, \"parentFolder\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Folder.prototype, \"properties\", {\n /**\n * Gets this folder's properties\n *\n */\n get: function () {\n return new queryable_1.QueryableInstance(this, \"properties\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Folder.prototype, \"serverRelativeUrl\", {\n /**\n * Gets this folder's server relative url\n *\n */\n get: function () {\n return new queryable_1.Queryable(this, \"serverRelativeUrl\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Folder.prototype, \"uniqueContentTypeOrder\", {\n /**\n * Gets a value that specifies the content type order.\n *\n */\n get: function () {\n return new queryable_1.QueryableCollection(this, \"uniqueContentTypeOrder\");\n },\n enumerable: true,\n configurable: true\n });\n Folder.prototype.update = function (properties) {\n var _this = this;\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": \"SP.Folder\" },\n }, properties));\n return this.post({\n body: postBody,\n headers: {\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n return {\n data: data,\n folder: _this,\n };\n });\n };\n /**\n * Delete this folder\n *\n * @param eTag Value used in the IF-Match header, by default \"*\"\n */\n Folder.prototype.delete = function (eTag) {\n if (eTag === void 0) { eTag = \"*\"; }\n return this.clone(Folder, null, true).post({\n headers: {\n \"IF-Match\": eTag,\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n /**\n * Moves the folder to the Recycle Bin and returns the identifier of the new Recycle Bin item.\n */\n Folder.prototype.recycle = function () {\n return this.clone(Folder, \"recycle\", true).post();\n };\n /**\n * Gets the associated list item for this folder, loading the default properties\n */\n Folder.prototype.getItem = function () {\n var selects = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n selects[_i] = arguments[_i];\n }\n var q = this.listItemAllFields;\n return q.select.apply(q, selects).get().then(function (d) {\n return util_1.Util.extend(new items_1.Item(odata_1.getEntityUrl(d)), d);\n });\n };\n return Folder;\n}(queryableshareable_1.QueryableShareableFolder));\nexports.Folder = Folder;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/sharepoint/folders.js\n// module id = 9\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar queryable_1 = require(\"./queryable\");\nvar queryableshareable_1 = require(\"./queryableshareable\");\nvar folders_1 = require(\"./folders\");\nvar files_1 = require(\"./files\");\nvar contenttypes_1 = require(\"./contenttypes\");\nvar util_1 = require(\"../utils/util\");\nvar odata_1 = require(\"./odata\");\nvar attachmentfiles_1 = require(\"./attachmentfiles\");\nvar lists_1 = require(\"./lists\");\n/**\n * Describes a collection of Item objects\n *\n */\nvar Items = (function (_super) {\n __extends(Items, _super);\n /**\n * Creates a new instance of the Items class\n *\n * @param baseUrl The url or Queryable which forms the parent of this fields collection\n */\n function Items(baseUrl, path) {\n if (path === void 0) { path = \"items\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * Gets an Item by id\n *\n * @param id The integer id of the item to retrieve\n */\n Items.prototype.getById = function (id) {\n var i = new Item(this);\n i.concat(\"(\" + id + \")\");\n return i;\n };\n /**\n * Skips the specified number of items (https://msdn.microsoft.com/en-us/library/office/fp142385.aspx#sectionSection6)\n *\n * @param skip The starting id where the page should start, use with top to specify pages\n */\n Items.prototype.skip = function (skip) {\n this._query.add(\"$skiptoken\", encodeURIComponent(\"Paged=TRUE&p_ID=\" + skip));\n return this;\n };\n /**\n * Gets a collection designed to aid in paging through data\n *\n */\n Items.prototype.getPaged = function () {\n return this.getAs(new PagedItemCollectionParser());\n };\n //\n /**\n * Adds a new item to the collection\n *\n * @param properties The new items's properties\n */\n Items.prototype.add = function (properties, listItemEntityTypeFullName) {\n var _this = this;\n if (properties === void 0) { properties = {}; }\n if (listItemEntityTypeFullName === void 0) { listItemEntityTypeFullName = null; }\n var removeDependency = this.addBatchDependency();\n return this.ensureListItemEntityTypeName(listItemEntityTypeFullName).then(function (listItemEntityType) {\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": listItemEntityType },\n }, properties));\n var promise = _this.clone(Items, null, true).postAs({ body: postBody }).then(function (data) {\n return {\n data: data,\n item: _this.getById(data.Id),\n };\n });\n removeDependency();\n return promise;\n });\n };\n /**\n * Ensures we have the proper list item entity type name, either from the value provided or from the list\n *\n * @param candidatelistItemEntityTypeFullName The potential type name\n */\n Items.prototype.ensureListItemEntityTypeName = function (candidatelistItemEntityTypeFullName) {\n return candidatelistItemEntityTypeFullName ?\n Promise.resolve(candidatelistItemEntityTypeFullName) :\n this.getParent(lists_1.List).getListItemEntityTypeFullName();\n };\n return Items;\n}(queryable_1.QueryableCollection));\nexports.Items = Items;\n/**\n * Descrines a single Item instance\n *\n */\nvar Item = (function (_super) {\n __extends(Item, _super);\n function Item() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(Item.prototype, \"attachmentFiles\", {\n /**\n * Gets the set of attachments for this item\n *\n */\n get: function () {\n return new attachmentfiles_1.AttachmentFiles(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Item.prototype, \"contentType\", {\n /**\n * Gets the content type for this item\n *\n */\n get: function () {\n return new contenttypes_1.ContentType(this, \"ContentType\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Item.prototype, \"effectiveBasePermissions\", {\n /**\n * Gets the effective base permissions for the item\n *\n */\n get: function () {\n return new queryable_1.Queryable(this, \"EffectiveBasePermissions\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Item.prototype, \"effectiveBasePermissionsForUI\", {\n /**\n * Gets the effective base permissions for the item in a UI context\n *\n */\n get: function () {\n return new queryable_1.Queryable(this, \"EffectiveBasePermissionsForUI\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Item.prototype, \"fieldValuesAsHTML\", {\n /**\n * Gets the field values for this list item in their HTML representation\n *\n */\n get: function () {\n return new queryable_1.QueryableInstance(this, \"FieldValuesAsHTML\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Item.prototype, \"fieldValuesAsText\", {\n /**\n * Gets the field values for this list item in their text representation\n *\n */\n get: function () {\n return new queryable_1.QueryableInstance(this, \"FieldValuesAsText\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Item.prototype, \"fieldValuesForEdit\", {\n /**\n * Gets the field values for this list item for use in editing controls\n *\n */\n get: function () {\n return new queryable_1.QueryableInstance(this, \"FieldValuesForEdit\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Item.prototype, \"folder\", {\n /**\n * Gets the folder associated with this list item (if this item represents a folder)\n *\n */\n get: function () {\n return new folders_1.Folder(this, \"folder\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Item.prototype, \"file\", {\n /**\n * Gets the folder associated with this list item (if this item represents a folder)\n *\n */\n get: function () {\n return new files_1.File(this, \"file\");\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Updates this list intance with the supplied properties\n *\n * @param properties A plain object hash of values to update for the list\n * @param eTag Value used in the IF-Match header, by default \"*\"\n */\n Item.prototype.update = function (properties, eTag) {\n var _this = this;\n if (eTag === void 0) { eTag = \"*\"; }\n return new Promise(function (resolve, reject) {\n var removeDependency = _this.addBatchDependency();\n var parentList = _this.getParent(queryable_1.QueryableInstance, _this.parentUrl.substr(0, _this.parentUrl.lastIndexOf(\"/\")));\n parentList.select(\"ListItemEntityTypeFullName\").getAs().then(function (d) {\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": d.ListItemEntityTypeFullName },\n }, properties));\n removeDependency();\n return _this.post({\n body: postBody,\n headers: {\n \"IF-Match\": eTag,\n \"X-HTTP-Method\": \"MERGE\",\n },\n }, new ItemUpdatedParser()).then(function (data) {\n resolve({\n data: data,\n item: _this,\n });\n });\n }).catch(function (e) { return reject(e); });\n });\n };\n /**\n * Delete this item\n *\n * @param eTag Value used in the IF-Match header, by default \"*\"\n */\n Item.prototype.delete = function (eTag) {\n if (eTag === void 0) { eTag = \"*\"; }\n return this.post({\n headers: {\n \"IF-Match\": eTag,\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n /**\n * Moves the list item to the Recycle Bin and returns the identifier of the new Recycle Bin item.\n */\n Item.prototype.recycle = function () {\n return this.clone(Item, \"recycle\", true).post();\n };\n /**\n * Gets a string representation of the full URL to the WOPI frame.\n * If there is no associated WOPI application, or no associated action, an empty string is returned.\n *\n * @param action Display mode: 0: view, 1: edit, 2: mobileView, 3: interactivePreview\n */\n Item.prototype.getWopiFrameUrl = function (action) {\n if (action === void 0) { action = 0; }\n var i = this.clone(Item, \"getWOPIFrameUrl(@action)\", true);\n i._query.add(\"@action\", action);\n return i.post().then(function (data) {\n return data.GetWOPIFrameUrl;\n });\n };\n /**\n * Validates and sets the values of the specified collection of fields for the list item.\n *\n * @param formValues The fields to change and their new values.\n * @param newDocumentUpdate true if the list item is a document being updated after upload; otherwise false.\n */\n Item.prototype.validateUpdateListItem = function (formValues, newDocumentUpdate) {\n if (newDocumentUpdate === void 0) { newDocumentUpdate = false; }\n return this.clone(Item, \"validateupdatelistitem\", true).post({\n body: JSON.stringify({ \"formValues\": formValues, bNewDocumentUpdate: newDocumentUpdate }),\n });\n };\n return Item;\n}(queryableshareable_1.QueryableShareableItem));\nexports.Item = Item;\n/**\n * Provides paging functionality for list items\n */\nvar PagedItemCollection = (function () {\n function PagedItemCollection(nextUrl, results) {\n this.nextUrl = nextUrl;\n this.results = results;\n }\n Object.defineProperty(PagedItemCollection.prototype, \"hasNext\", {\n /**\n * If true there are more results available in the set, otherwise there are not\n */\n get: function () {\n return typeof this.nextUrl === \"string\" && this.nextUrl.length > 0;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Gets the next set of results, or resolves to null if no results are available\n */\n PagedItemCollection.prototype.getNext = function () {\n if (this.hasNext) {\n var items = new Items(this.nextUrl, null);\n return items.getPaged();\n }\n return new Promise(function (r) { return r(null); });\n };\n return PagedItemCollection;\n}());\nexports.PagedItemCollection = PagedItemCollection;\nvar PagedItemCollectionParser = (function (_super) {\n __extends(PagedItemCollectionParser, _super);\n function PagedItemCollectionParser() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n PagedItemCollectionParser.prototype.parse = function (r) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n if (_this.handleError(r, reject)) {\n r.json().then(function (json) {\n var nextUrl = json.hasOwnProperty(\"d\") && json.d.hasOwnProperty(\"__next\") ? json.d.__next : json[\"odata.nextLink\"];\n resolve(new PagedItemCollection(nextUrl, _this.parseODataJSON(json)));\n });\n }\n });\n };\n return PagedItemCollectionParser;\n}(odata_1.ODataParserBase));\nvar ItemUpdatedParser = (function (_super) {\n __extends(ItemUpdatedParser, _super);\n function ItemUpdatedParser() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ItemUpdatedParser.prototype.parse = function (r) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n if (_this.handleError(r, reject)) {\n resolve({\n \"odata.etag\": r.headers.get(\"etag\"),\n });\n }\n });\n };\n return ItemUpdatedParser;\n}(odata_1.ODataParserBase));\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/sharepoint/items.js\n// module id = 10\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar items_1 = require(\"./items\");\nvar views_1 = require(\"./views\");\nvar contenttypes_1 = require(\"./contenttypes\");\nvar fields_1 = require(\"./fields\");\nvar forms_1 = require(\"./forms\");\nvar subscriptions_1 = require(\"./subscriptions\");\nvar queryable_1 = require(\"./queryable\");\nvar queryablesecurable_1 = require(\"./queryablesecurable\");\nvar util_1 = require(\"../utils/util\");\nvar usercustomactions_1 = require(\"./usercustomactions\");\nvar odata_1 = require(\"./odata\");\nvar exceptions_1 = require(\"../utils/exceptions\");\nvar folders_1 = require(\"./folders\");\n/**\n * Describes a collection of List objects\n *\n */\nvar Lists = (function (_super) {\n __extends(Lists, _super);\n /**\n * Creates a new instance of the Lists class\n *\n * @param baseUrl The url or Queryable which forms the parent of this fields collection\n */\n function Lists(baseUrl, path) {\n if (path === void 0) { path = \"lists\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * Gets a list from the collection by title\n *\n * @param title The title of the list\n */\n Lists.prototype.getByTitle = function (title) {\n return new List(this, \"getByTitle('\" + title + \"')\");\n };\n /**\n * Gets a list from the collection by guid id\n *\n * @param id The Id of the list (GUID)\n */\n Lists.prototype.getById = function (id) {\n var list = new List(this);\n list.concat(\"('\" + id + \"')\");\n return list;\n };\n /**\n * Adds a new list to the collection\n *\n * @param title The new list's title\n * @param description The new list's description\n * @param template The list template value\n * @param enableContentTypes If true content types will be allowed and enabled, otherwise they will be disallowed and not enabled\n * @param additionalSettings Will be passed as part of the list creation body\n */\n Lists.prototype.add = function (title, description, template, enableContentTypes, additionalSettings) {\n var _this = this;\n if (description === void 0) { description = \"\"; }\n if (template === void 0) { template = 100; }\n if (enableContentTypes === void 0) { enableContentTypes = false; }\n if (additionalSettings === void 0) { additionalSettings = {}; }\n var addSettings = util_1.Util.extend({\n \"AllowContentTypes\": enableContentTypes,\n \"BaseTemplate\": template,\n \"ContentTypesEnabled\": enableContentTypes,\n \"Description\": description,\n \"Title\": title,\n \"__metadata\": { \"type\": \"SP.List\" },\n }, additionalSettings);\n return this.post({ body: JSON.stringify(addSettings) }).then(function (data) {\n return { data: data, list: _this.getByTitle(addSettings.Title) };\n });\n };\n /**\n * Ensures that the specified list exists in the collection (note: this method not supported for batching)\n *\n * @param title The new list's title\n * @param description The new list's description\n * @param template The list template value\n * @param enableContentTypes If true content types will be allowed and enabled, otherwise they will be disallowed and not enabled\n * @param additionalSettings Will be passed as part of the list creation body or used to update an existing list\n */\n Lists.prototype.ensure = function (title, description, template, enableContentTypes, additionalSettings) {\n var _this = this;\n if (description === void 0) { description = \"\"; }\n if (template === void 0) { template = 100; }\n if (enableContentTypes === void 0) { enableContentTypes = false; }\n if (additionalSettings === void 0) { additionalSettings = {}; }\n if (this.hasBatch) {\n throw new exceptions_1.NotSupportedInBatchException(\"The ensure list method\");\n }\n return new Promise(function (resolve, reject) {\n var addOrUpdateSettings = util_1.Util.extend(additionalSettings, { Title: title, Description: description, ContentTypesEnabled: enableContentTypes }, true);\n var list = _this.getByTitle(addOrUpdateSettings.Title);\n list.get().then(function (_) {\n list.update(addOrUpdateSettings).then(function (d) {\n resolve({ created: false, data: d, list: _this.getByTitle(addOrUpdateSettings.Title) });\n }).catch(function (e) { return reject(e); });\n }).catch(function (_) {\n _this.add(title, description, template, enableContentTypes, addOrUpdateSettings).then(function (r) {\n resolve({ created: true, data: r.data, list: _this.getByTitle(addOrUpdateSettings.Title) });\n }).catch(function (e) { return reject(e); });\n });\n });\n };\n /**\n * Gets a list that is the default asset location for images or other files, which the users upload to their wiki pages.\n */\n Lists.prototype.ensureSiteAssetsLibrary = function () {\n return this.clone(Lists, \"ensuresiteassetslibrary\", true).post().then(function (json) {\n return new List(odata_1.extractOdataId(json));\n });\n };\n /**\n * Gets a list that is the default location for wiki pages.\n */\n Lists.prototype.ensureSitePagesLibrary = function () {\n return this.clone(Lists, \"ensuresitepageslibrary\", true).post().then(function (json) {\n return new List(odata_1.extractOdataId(json));\n });\n };\n return Lists;\n}(queryable_1.QueryableCollection));\nexports.Lists = Lists;\n/**\n * Describes a single List instance\n *\n */\nvar List = (function (_super) {\n __extends(List, _super);\n function List() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(List.prototype, \"contentTypes\", {\n /**\n * Gets the content types in this list\n *\n */\n get: function () {\n return new contenttypes_1.ContentTypes(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"items\", {\n /**\n * Gets the items in this list\n *\n */\n get: function () {\n return new items_1.Items(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"views\", {\n /**\n * Gets the views in this list\n *\n */\n get: function () {\n return new views_1.Views(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"fields\", {\n /**\n * Gets the fields in this list\n *\n */\n get: function () {\n return new fields_1.Fields(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"forms\", {\n /**\n * Gets the forms in this list\n *\n */\n get: function () {\n return new forms_1.Forms(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"defaultView\", {\n /**\n * Gets the default view of this list\n *\n */\n get: function () {\n return new queryable_1.QueryableInstance(this, \"DefaultView\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"userCustomActions\", {\n /**\n * Get all custom actions on a site collection\n *\n */\n get: function () {\n return new usercustomactions_1.UserCustomActions(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"effectiveBasePermissions\", {\n /**\n * Gets the effective base permissions of this list\n *\n */\n get: function () {\n return new queryable_1.Queryable(this, \"EffectiveBasePermissions\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"eventReceivers\", {\n /**\n * Gets the event receivers attached to this list\n *\n */\n get: function () {\n return new queryable_1.QueryableCollection(this, \"EventReceivers\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"relatedFields\", {\n /**\n * Gets the related fields of this list\n *\n */\n get: function () {\n return new queryable_1.Queryable(this, \"getRelatedFields\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"informationRightsManagementSettings\", {\n /**\n * Gets the IRM settings for this list\n *\n */\n get: function () {\n return new queryable_1.Queryable(this, \"InformationRightsManagementSettings\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"subscriptions\", {\n /**\n * Gets the webhook subscriptions of this list\n *\n */\n get: function () {\n return new subscriptions_1.Subscriptions(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(List.prototype, \"rootFolder\", {\n /**\n * The root folder of the list\n */\n get: function () {\n return new folders_1.Folder(this, \"rootFolder\");\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Gets a view by view guid id\n *\n */\n List.prototype.getView = function (viewId) {\n return new views_1.View(this, \"getView('\" + viewId + \"')\");\n };\n /**\n * Updates this list intance with the supplied properties\n *\n * @param properties A plain object hash of values to update for the list\n * @param eTag Value used in the IF-Match header, by default \"*\"\n */\n /* tslint:disable no-string-literal */\n List.prototype.update = function (properties, eTag) {\n var _this = this;\n if (eTag === void 0) { eTag = \"*\"; }\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": \"SP.List\" },\n }, properties));\n return this.post({\n body: postBody,\n headers: {\n \"IF-Match\": eTag,\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n var retList = _this;\n if (properties.hasOwnProperty(\"Title\")) {\n retList = _this.getParent(List, _this.parentUrl, \"getByTitle('\" + properties[\"Title\"] + \"')\");\n }\n return {\n data: data,\n list: retList,\n };\n });\n };\n /* tslint:enable */\n /**\n * Delete this list\n *\n * @param eTag Value used in the IF-Match header, by default \"*\"\n */\n List.prototype.delete = function (eTag) {\n if (eTag === void 0) { eTag = \"*\"; }\n return this.post({\n headers: {\n \"IF-Match\": eTag,\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n /**\n * Returns the collection of changes from the change log that have occurred within the list, based on the specified query.\n */\n List.prototype.getChanges = function (query) {\n return this.clone(List, \"getchanges\", true).post({\n body: JSON.stringify({ \"query\": util_1.Util.extend({ \"__metadata\": { \"type\": \"SP.ChangeQuery\" } }, query) }),\n });\n };\n /**\n * Returns a collection of items from the list based on the specified query.\n *\n * @param CamlQuery The Query schema of Collaborative Application Markup\n * Language (CAML) is used in various ways within the context of Microsoft SharePoint Foundation\n * to define queries against list data.\n * see:\n *\n * https://msdn.microsoft.com/en-us/library/office/ms467521.aspx\n *\n * @param expands A URI with a $expand System Query Option indicates that Entries associated with\n * the Entry or Collection of Entries identified by the Resource Path\n * section of the URI must be represented inline (i.e. eagerly loaded).\n * see:\n *\n * https://msdn.microsoft.com/en-us/library/office/fp142385.aspx\n *\n * http://www.odata.org/documentation/odata-version-2-0/uri-conventions/#ExpandSystemQueryOption\n */\n List.prototype.getItemsByCAMLQuery = function (query) {\n var expands = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n expands[_i - 1] = arguments[_i];\n }\n var q = this.clone(List, \"getitems\", true);\n return q.expand.apply(q, expands).post({\n body: JSON.stringify({ \"query\": util_1.Util.extend({ \"__metadata\": { \"type\": \"SP.CamlQuery\" } }, query) }),\n });\n };\n /**\n * See: https://msdn.microsoft.com/en-us/library/office/dn292554.aspx\n */\n List.prototype.getListItemChangesSinceToken = function (query) {\n return this.clone(List, \"getlistitemchangessincetoken\", true).post({\n body: JSON.stringify({ \"query\": util_1.Util.extend({ \"__metadata\": { \"type\": \"SP.ChangeLogItemQuery\" } }, query) }),\n }, { parse: function (r) { return r.text(); } });\n };\n /**\n * Moves the list to the Recycle Bin and returns the identifier of the new Recycle Bin item.\n */\n List.prototype.recycle = function () {\n return this.clone(List, \"recycle\", true).post().then(function (data) {\n if (data.hasOwnProperty(\"Recycle\")) {\n return data.Recycle;\n }\n else {\n return data;\n }\n });\n };\n /**\n * Renders list data based on the view xml provided\n */\n List.prototype.renderListData = function (viewXml) {\n var q = this.clone(List, \"renderlistdata(@viewXml)\");\n q.query.add(\"@viewXml\", \"'\" + viewXml + \"'\");\n return q.post().then(function (data) {\n // data will be a string, so we parse it again\n data = JSON.parse(data);\n if (data.hasOwnProperty(\"RenderListData\")) {\n return data.RenderListData;\n }\n else {\n return data;\n }\n });\n };\n /**\n * Gets the field values and field schema attributes for a list item.\n */\n List.prototype.renderListFormData = function (itemId, formId, mode) {\n return this.clone(List, \"renderlistformdata(itemid=\" + itemId + \", formid='\" + formId + \"', mode='\" + mode + \"')\", true).post().then(function (data) {\n // data will be a string, so we parse it again\n data = JSON.parse(data);\n if (data.hasOwnProperty(\"ListData\")) {\n return data.ListData;\n }\n else {\n return data;\n }\n });\n };\n /**\n * Reserves a list item ID for idempotent list item creation.\n */\n List.prototype.reserveListItemId = function () {\n return this.clone(List, \"reservelistitemid\", true).post().then(function (data) {\n if (data.hasOwnProperty(\"ReserveListItemId\")) {\n return data.ReserveListItemId;\n }\n else {\n return data;\n }\n });\n };\n /**\n * Returns the ListItemEntityTypeFullName for this list, used when adding/updating list items. Does not support batching.\n *\n */\n List.prototype.getListItemEntityTypeFullName = function () {\n return this.clone(List, null).select(\"ListItemEntityTypeFullName\").getAs().then(function (o) { return o.ListItemEntityTypeFullName; });\n };\n return List;\n}(queryablesecurable_1.QueryableSecurable));\nexports.List = List;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/sharepoint/lists.js\n// module id = 11\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar util_1 = require(\"../utils/util\");\nvar webs_1 = require(\"./webs\");\nvar odata_1 = require(\"./odata\");\nvar queryable_1 = require(\"./queryable\");\nvar queryablesecurable_1 = require(\"./queryablesecurable\");\nvar types_1 = require(\"./types\");\n/**\n * Internal helper class used to augment classes to include sharing functionality\n */\nvar QueryableShareable = (function (_super) {\n __extends(QueryableShareable, _super);\n function QueryableShareable() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Gets a sharing link for the supplied\n *\n * @param kind The kind of link to share\n * @param expiration The optional expiration for this link\n */\n QueryableShareable.prototype.getShareLink = function (kind, expiration) {\n if (expiration === void 0) { expiration = null; }\n // date needs to be an ISO string or null\n var expString = expiration !== null ? expiration.toISOString() : null;\n // clone using the factory and send the request\n return this.clone(QueryableShareable, \"shareLink\", true).postAs({\n body: JSON.stringify({\n request: {\n createLink: true,\n emailData: null,\n settings: {\n expiration: expString,\n linkKind: kind,\n },\n },\n }),\n });\n };\n /**\n * Shares this instance with the supplied users\n *\n * @param loginNames Resolved login names to share\n * @param role The role\n * @param requireSignin True to require the user is authenticated, otherwise false\n * @param propagateAcl True to apply this share to all children\n * @param emailData If supplied an email will be sent with the indicated properties\n */\n QueryableShareable.prototype.shareWith = function (loginNames, role, requireSignin, propagateAcl, emailData) {\n var _this = this;\n if (requireSignin === void 0) { requireSignin = true; }\n if (propagateAcl === void 0) { propagateAcl = false; }\n // handle the multiple input types\n if (!Array.isArray(loginNames)) {\n loginNames = [loginNames];\n }\n var userStr = JSON.stringify(loginNames.map(function (login) { return { Key: login }; }));\n var roleFilter = role === types_1.SharingRole.Edit ? types_1.RoleType.Contributor : types_1.RoleType.Reader;\n // start by looking up the role definition id we need to set the roleValue\n return webs_1.Web.fromUrl(this.toUrl()).roleDefinitions.select(\"Id\").filter(\"RoleTypeKind eq \" + roleFilter).get().then(function (def) {\n if (!Array.isArray(def) || def.length < 1) {\n throw new Error(\"Could not locate a role defintion with RoleTypeKind \" + roleFilter);\n }\n var postBody = {\n includeAnonymousLinkInEmail: requireSignin,\n peoplePickerInput: userStr,\n propagateAcl: propagateAcl,\n roleValue: \"role:\" + def[0].Id,\n useSimplifiedRoles: true,\n };\n if (typeof emailData !== \"undefined\") {\n postBody = util_1.Util.extend(postBody, {\n emailBody: emailData.body,\n emailSubject: typeof emailData.subject !== \"undefined\" ? \"\" : emailData.subject,\n sendEmail: true,\n });\n }\n return _this.clone(QueryableShareable, \"shareObject\", true).postAs({\n body: JSON.stringify(postBody),\n });\n });\n };\n /**\n * Shares an object based on the supplied options\n *\n * @param options The set of options to send to the ShareObject method\n * @param bypass If true any processing is skipped and the options are sent directly to the ShareObject method\n */\n QueryableShareable.prototype.shareObject = function (options, bypass) {\n var _this = this;\n if (bypass === void 0) { bypass = false; }\n if (bypass) {\n // if the bypass flag is set send the supplied parameters directly to the service\n return this.sendShareObjectRequest(options);\n }\n // extend our options with some defaults\n options = util_1.Util.extend(options, {\n group: null,\n includeAnonymousLinkInEmail: false,\n propagateAcl: false,\n useSimplifiedRoles: true,\n }, true);\n return this.getRoleValue(options.role, options.group).then(function (roleValue) {\n // handle the multiple input types\n if (!Array.isArray(options.loginNames)) {\n options.loginNames = [options.loginNames];\n }\n var userStr = JSON.stringify(options.loginNames.map(function (login) { return { Key: login }; }));\n var postBody = {\n peoplePickerInput: userStr,\n roleValue: roleValue,\n url: options.url,\n };\n if (typeof options.emailData !== \"undefined\" && options.emailData !== null) {\n postBody = util_1.Util.extend(postBody, {\n emailBody: options.emailData.body,\n emailSubject: typeof options.emailData.subject !== \"undefined\" ? \"Shared for you.\" : options.emailData.subject,\n sendEmail: true,\n });\n }\n return _this.sendShareObjectRequest(postBody);\n });\n };\n /**\n * Calls the web's UnshareObject method\n *\n * @param url The url of the object to unshare\n */\n QueryableShareable.prototype.unshareObjectWeb = function (url) {\n return this.clone(QueryableShareable, \"unshareObject\", true).postAs({\n body: JSON.stringify({\n url: url,\n }),\n });\n };\n /**\n * Checks Permissions on the list of Users and returns back role the users have on the Item.\n *\n * @param recipients The array of Entities for which Permissions need to be checked.\n */\n QueryableShareable.prototype.checkPermissions = function (recipients) {\n return this.clone(QueryableShareable, \"checkPermissions\", true).postAs({\n body: JSON.stringify({\n recipients: recipients,\n }),\n });\n };\n /**\n * Get Sharing Information.\n *\n * @param request The SharingInformationRequest Object.\n */\n QueryableShareable.prototype.getSharingInformation = function (request) {\n if (request === void 0) { request = null; }\n return this.clone(QueryableShareable, \"getSharingInformation\", true).postAs({\n body: JSON.stringify({\n request: request,\n }),\n });\n };\n /**\n * Gets the sharing settings of an item.\n *\n * @param useSimplifiedRoles Determines whether to use simplified roles.\n */\n QueryableShareable.prototype.getObjectSharingSettings = function (useSimplifiedRoles) {\n if (useSimplifiedRoles === void 0) { useSimplifiedRoles = true; }\n return this.clone(QueryableShareable, \"getObjectSharingSettings\", true).postAs({\n body: JSON.stringify({\n useSimplifiedRoles: useSimplifiedRoles,\n }),\n });\n };\n /**\n * Unshares this object\n */\n QueryableShareable.prototype.unshareObject = function () {\n return this.clone(QueryableShareable, \"unshareObject\", true).postAs();\n };\n /**\n * Deletes a link by type\n *\n * @param kind Deletes a sharing link by the kind of link\n */\n QueryableShareable.prototype.deleteLinkByKind = function (kind) {\n return this.clone(QueryableShareable, \"deleteLinkByKind\", true).post({\n body: JSON.stringify({ linkKind: kind }),\n });\n };\n /**\n * Removes the specified link to the item.\n *\n * @param kind The kind of link to be deleted.\n * @param shareId\n */\n QueryableShareable.prototype.unshareLink = function (kind, shareId) {\n if (shareId === void 0) { shareId = \"00000000-0000-0000-0000-000000000000\"; }\n return this.clone(QueryableShareable, \"unshareLink\", true).post({\n body: JSON.stringify({ linkKind: kind, shareId: shareId }),\n });\n };\n /**\n * Calculates the roleValue string used in the sharing query\n *\n * @param role The Sharing Role\n * @param group The Group type\n */\n QueryableShareable.prototype.getRoleValue = function (role, group) {\n // we will give group precedence, because we had to make a choice\n if (typeof group !== \"undefined\" && group !== null) {\n switch (group) {\n case types_1.RoleType.Contributor:\n return webs_1.Web.fromUrl(this.toUrl()).associatedMemberGroup.select(\"Id\").getAs().then(function (g) { return \"group: \" + g.Id; });\n case types_1.RoleType.Reader:\n case types_1.RoleType.Guest:\n return webs_1.Web.fromUrl(this.toUrl()).associatedVisitorGroup.select(\"Id\").getAs().then(function (g) { return \"group: \" + g.Id; });\n default:\n throw new Error(\"Could not determine role value for supplied value. Contributor, Reader, and Guest are supported\");\n }\n }\n else {\n var roleFilter = role === types_1.SharingRole.Edit ? types_1.RoleType.Contributor : types_1.RoleType.Reader;\n return webs_1.Web.fromUrl(this.toUrl()).roleDefinitions.select(\"Id\").top(1).filter(\"RoleTypeKind eq \" + roleFilter).getAs().then(function (def) {\n if (def.length < 1) {\n throw new Error(\"Could not locate associated role definition for supplied role. Edit and View are supported\");\n }\n return \"role: \" + def[0].Id;\n });\n }\n };\n QueryableShareable.prototype.getShareObjectWeb = function (candidate) {\n return Promise.resolve(webs_1.Web.fromUrl(candidate, \"/_api/SP.Web.ShareObject\"));\n };\n QueryableShareable.prototype.sendShareObjectRequest = function (options) {\n return this.getShareObjectWeb(this.toUrl()).then(function (web) {\n return web.expand(\"UsersWithAccessRequests\", \"GroupsSharedWith\").as(QueryableShareable).post({\n body: JSON.stringify(options),\n });\n });\n };\n return QueryableShareable;\n}(queryable_1.Queryable));\nexports.QueryableShareable = QueryableShareable;\nvar QueryableShareableWeb = (function (_super) {\n __extends(QueryableShareableWeb, _super);\n function QueryableShareableWeb() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Shares this web with the supplied users\n * @param loginNames The resolved login names to share\n * @param role The role to share this web\n * @param emailData Optional email data\n */\n QueryableShareableWeb.prototype.shareWith = function (loginNames, role, emailData) {\n var _this = this;\n if (role === void 0) { role = types_1.SharingRole.View; }\n var dependency = this.addBatchDependency();\n return webs_1.Web.fromUrl(this.toUrl(), \"/_api/web/url\").get().then(function (url) {\n dependency();\n return _this.shareObject(util_1.Util.combinePaths(url, \"/_layouts/15/aclinv.aspx?forSharing=1&mbypass=1\"), loginNames, role, emailData);\n });\n };\n /**\n * Provides direct access to the static web.ShareObject method\n *\n * @param url The url to share\n * @param loginNames Resolved loginnames string[] of a single login name string\n * @param roleValue Role value\n * @param emailData Optional email data\n * @param groupId Optional group id\n * @param propagateAcl\n * @param includeAnonymousLinkInEmail\n * @param useSimplifiedRoles\n */\n QueryableShareableWeb.prototype.shareObject = function (url, loginNames, role, emailData, group, propagateAcl, includeAnonymousLinkInEmail, useSimplifiedRoles) {\n if (propagateAcl === void 0) { propagateAcl = false; }\n if (includeAnonymousLinkInEmail === void 0) { includeAnonymousLinkInEmail = false; }\n if (useSimplifiedRoles === void 0) { useSimplifiedRoles = true; }\n return this.clone(QueryableShareable, null, true).shareObject({\n emailData: emailData,\n group: group,\n includeAnonymousLinkInEmail: includeAnonymousLinkInEmail,\n loginNames: loginNames,\n propagateAcl: propagateAcl,\n role: role,\n url: url,\n useSimplifiedRoles: useSimplifiedRoles,\n });\n };\n /**\n * Supplies a method to pass any set of arguments to ShareObject\n *\n * @param options The set of options to send to ShareObject\n */\n QueryableShareableWeb.prototype.shareObjectRaw = function (options) {\n return this.clone(QueryableShareable, null, true).shareObject(options, true);\n };\n /**\n * Unshares the object\n *\n * @param url The url of the object to stop sharing\n */\n QueryableShareableWeb.prototype.unshareObject = function (url) {\n return this.clone(QueryableShareable, null, true).unshareObjectWeb(url);\n };\n return QueryableShareableWeb;\n}(queryablesecurable_1.QueryableSecurable));\nexports.QueryableShareableWeb = QueryableShareableWeb;\nvar QueryableShareableItem = (function (_super) {\n __extends(QueryableShareableItem, _super);\n function QueryableShareableItem() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Gets a link suitable for sharing for this item\n *\n * @param kind The type of link to share\n * @param expiration The optional expiration date\n */\n QueryableShareableItem.prototype.getShareLink = function (kind, expiration) {\n if (kind === void 0) { kind = types_1.SharingLinkKind.OrganizationView; }\n if (expiration === void 0) { expiration = null; }\n return this.clone(QueryableShareable, null, true).getShareLink(kind, expiration);\n };\n /**\n * Shares this item with one or more users\n *\n * @param loginNames string or string[] of resolved login names to which this item will be shared\n * @param role The role (View | Edit) applied to the share\n * @param emailData Optional, if inlucded an email will be sent. Note subject currently has no effect.\n */\n QueryableShareableItem.prototype.shareWith = function (loginNames, role, requireSignin, emailData) {\n if (role === void 0) { role = types_1.SharingRole.View; }\n if (requireSignin === void 0) { requireSignin = true; }\n return this.clone(QueryableShareable, null, true).shareWith(loginNames, role, requireSignin, false, emailData);\n };\n /**\n * Checks Permissions on the list of Users and returns back role the users have on the Item.\n *\n * @param recipients The array of Entities for which Permissions need to be checked.\n */\n QueryableShareableItem.prototype.checkSharingPermissions = function (recipients) {\n return this.clone(QueryableShareable, null, true).checkPermissions(recipients);\n };\n /**\n * Get Sharing Information.\n *\n * @param request The SharingInformationRequest Object.\n */\n QueryableShareableItem.prototype.getSharingInformation = function (request) {\n if (request === void 0) { request = null; }\n return this.clone(QueryableShareable, null, true).getSharingInformation(request);\n };\n /**\n * Gets the sharing settings of an item.\n *\n * @param useSimplifiedRoles Determines whether to use simplified roles.\n */\n QueryableShareableItem.prototype.getObjectSharingSettings = function (useSimplifiedRoles) {\n if (useSimplifiedRoles === void 0) { useSimplifiedRoles = true; }\n return this.clone(QueryableShareable, null, true).getObjectSharingSettings(useSimplifiedRoles);\n };\n /**\n * Unshare this item\n */\n QueryableShareableItem.prototype.unshare = function () {\n return this.clone(QueryableShareable, null, true).unshareObject();\n };\n /**\n * Deletes a sharing link by kind\n *\n * @param kind Deletes a sharing link by the kind of link\n */\n QueryableShareableItem.prototype.deleteSharingLinkByKind = function (kind) {\n return this.clone(QueryableShareable, null, true).deleteLinkByKind(kind);\n };\n /**\n * Removes the specified link to the item.\n *\n * @param kind The kind of link to be deleted.\n * @param shareId\n */\n QueryableShareableItem.prototype.unshareLink = function (kind, shareId) {\n return this.clone(QueryableShareable, null, true).unshareLink(kind, shareId);\n };\n return QueryableShareableItem;\n}(queryablesecurable_1.QueryableSecurable));\nexports.QueryableShareableItem = QueryableShareableItem;\nvar FileFolderShared = (function (_super) {\n __extends(FileFolderShared, _super);\n function FileFolderShared() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Gets a link suitable for sharing\n *\n * @param kind The kind of link to get\n * @param expiration Optional, an expiration for this link\n */\n FileFolderShared.prototype.getShareLink = function (kind, expiration) {\n if (kind === void 0) { kind = types_1.SharingLinkKind.OrganizationView; }\n if (expiration === void 0) { expiration = null; }\n var dependency = this.addBatchDependency();\n return this.getShareable().then(function (shareable) {\n dependency();\n return shareable.getShareLink(kind, expiration);\n });\n };\n /**\n * Checks Permissions on the list of Users and returns back role the users have on the Item.\n *\n * @param recipients The array of Entities for which Permissions need to be checked.\n */\n FileFolderShared.prototype.checkSharingPermissions = function (recipients) {\n var dependency = this.addBatchDependency();\n return this.getShareable().then(function (shareable) {\n dependency();\n return shareable.checkPermissions(recipients);\n });\n };\n /**\n * Get Sharing Information.\n *\n * @param request The SharingInformationRequest Object.\n */\n FileFolderShared.prototype.getSharingInformation = function (request) {\n if (request === void 0) { request = null; }\n var dependency = this.addBatchDependency();\n return this.getShareable().then(function (shareable) {\n dependency();\n return shareable.getSharingInformation(request);\n });\n };\n /**\n * Gets the sharing settings of an item.\n *\n * @param useSimplifiedRoles Determines whether to use simplified roles.\n */\n FileFolderShared.prototype.getObjectSharingSettings = function (useSimplifiedRoles) {\n if (useSimplifiedRoles === void 0) { useSimplifiedRoles = true; }\n var dependency = this.addBatchDependency();\n return this.getShareable().then(function (shareable) {\n dependency();\n return shareable.getObjectSharingSettings(useSimplifiedRoles);\n });\n };\n /**\n * Unshare this item\n */\n FileFolderShared.prototype.unshare = function () {\n var dependency = this.addBatchDependency();\n return this.getShareable().then(function (shareable) {\n dependency();\n return shareable.unshareObject();\n });\n };\n /**\n * Deletes a sharing link by the kind of link\n *\n * @param kind The kind of link to be deleted.\n */\n FileFolderShared.prototype.deleteSharingLinkByKind = function (kind) {\n var dependency = this.addBatchDependency();\n return this.getShareable().then(function (shareable) {\n dependency();\n return shareable.deleteLinkByKind(kind);\n });\n };\n /**\n * Removes the specified link to the item.\n *\n * @param kind The kind of link to be deleted.\n * @param shareId The share id to delete\n */\n FileFolderShared.prototype.unshareLink = function (kind, shareId) {\n var dependency = this.addBatchDependency();\n return this.getShareable().then(function (shareable) {\n dependency();\n return shareable.unshareLink(kind, shareId);\n });\n };\n /**\n * For files and folders we need to use the associated item end point\n */\n FileFolderShared.prototype.getShareable = function () {\n var _this = this;\n // sharing only works on the item end point, not the file one - so we create a folder instance with the item url internally\n return this.clone(QueryableShareableFile, \"listItemAllFields\", false).select(\"odata.editlink\").get().then(function (d) {\n var shareable = new QueryableShareable(odata_1.getEntityUrl(d));\n // we need to handle batching\n if (_this.hasBatch) {\n shareable = shareable.inBatch(_this.batch);\n }\n return shareable;\n });\n };\n return FileFolderShared;\n}(queryable_1.QueryableInstance));\nexports.FileFolderShared = FileFolderShared;\nvar QueryableShareableFile = (function (_super) {\n __extends(QueryableShareableFile, _super);\n function QueryableShareableFile() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Shares this item with one or more users\n *\n * @param loginNames string or string[] of resolved login names to which this item will be shared\n * @param role The role (View | Edit) applied to the share\n * @param shareEverything Share everything in this folder, even items with unique permissions.\n * @param requireSignin If true the user must signin to view link, otherwise anyone with the link can access the resource\n * @param emailData Optional, if inlucded an email will be sent. Note subject currently has no effect.\n */\n QueryableShareableFile.prototype.shareWith = function (loginNames, role, requireSignin, emailData) {\n if (role === void 0) { role = types_1.SharingRole.View; }\n if (requireSignin === void 0) { requireSignin = true; }\n var dependency = this.addBatchDependency();\n return this.getShareable().then(function (shareable) {\n dependency();\n return shareable.shareWith(loginNames, role, requireSignin, false, emailData);\n });\n };\n return QueryableShareableFile;\n}(FileFolderShared));\nexports.QueryableShareableFile = QueryableShareableFile;\nvar QueryableShareableFolder = (function (_super) {\n __extends(QueryableShareableFolder, _super);\n function QueryableShareableFolder() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Shares this item with one or more users\n *\n * @param loginNames string or string[] of resolved login names to which this item will be shared\n * @param role The role (View | Edit) applied to the share\n * @param shareEverything Share everything in this folder, even items with unique permissions.\n * @param requireSignin If true the user must signin to view link, otherwise anyone with the link can access the resource\n * @param emailData Optional, if inlucded an email will be sent. Note subject currently has no effect.\n */\n QueryableShareableFolder.prototype.shareWith = function (loginNames, role, requireSignin, shareEverything, emailData) {\n if (role === void 0) { role = types_1.SharingRole.View; }\n if (requireSignin === void 0) { requireSignin = true; }\n if (shareEverything === void 0) { shareEverything = false; }\n var dependency = this.addBatchDependency();\n return this.getShareable().then(function (shareable) {\n dependency();\n return shareable.shareWith(loginNames, role, requireSignin, shareEverything, emailData);\n });\n };\n return QueryableShareableFolder;\n}(FileFolderShared));\nexports.QueryableShareableFolder = QueryableShareableFolder;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/sharepoint/queryableshareable.js\n// module id = 12\n// module chunks = 0","// reference: https://msdn.microsoft.com/en-us/library/office/dn600183.aspx\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Determines the display mode of the given control or view\n */\nvar ControlMode;\n(function (ControlMode) {\n ControlMode[ControlMode[\"Display\"] = 1] = \"Display\";\n ControlMode[ControlMode[\"Edit\"] = 2] = \"Edit\";\n ControlMode[ControlMode[\"New\"] = 3] = \"New\";\n})(ControlMode = exports.ControlMode || (exports.ControlMode = {}));\n/**\n * Specifies the type of the field.\n */\nvar FieldTypes;\n(function (FieldTypes) {\n FieldTypes[FieldTypes[\"Invalid\"] = 0] = \"Invalid\";\n FieldTypes[FieldTypes[\"Integer\"] = 1] = \"Integer\";\n FieldTypes[FieldTypes[\"Text\"] = 2] = \"Text\";\n FieldTypes[FieldTypes[\"Note\"] = 3] = \"Note\";\n FieldTypes[FieldTypes[\"DateTime\"] = 4] = \"DateTime\";\n FieldTypes[FieldTypes[\"Counter\"] = 5] = \"Counter\";\n FieldTypes[FieldTypes[\"Choice\"] = 6] = \"Choice\";\n FieldTypes[FieldTypes[\"Lookup\"] = 7] = \"Lookup\";\n FieldTypes[FieldTypes[\"Boolean\"] = 8] = \"Boolean\";\n FieldTypes[FieldTypes[\"Number\"] = 9] = \"Number\";\n FieldTypes[FieldTypes[\"Currency\"] = 10] = \"Currency\";\n FieldTypes[FieldTypes[\"URL\"] = 11] = \"URL\";\n FieldTypes[FieldTypes[\"Computed\"] = 12] = \"Computed\";\n FieldTypes[FieldTypes[\"Threading\"] = 13] = \"Threading\";\n FieldTypes[FieldTypes[\"Guid\"] = 14] = \"Guid\";\n FieldTypes[FieldTypes[\"MultiChoice\"] = 15] = \"MultiChoice\";\n FieldTypes[FieldTypes[\"GridChoice\"] = 16] = \"GridChoice\";\n FieldTypes[FieldTypes[\"Calculated\"] = 17] = \"Calculated\";\n FieldTypes[FieldTypes[\"File\"] = 18] = \"File\";\n FieldTypes[FieldTypes[\"Attachments\"] = 19] = \"Attachments\";\n FieldTypes[FieldTypes[\"User\"] = 20] = \"User\";\n FieldTypes[FieldTypes[\"Recurrence\"] = 21] = \"Recurrence\";\n FieldTypes[FieldTypes[\"CrossProjectLink\"] = 22] = \"CrossProjectLink\";\n FieldTypes[FieldTypes[\"ModStat\"] = 23] = \"ModStat\";\n FieldTypes[FieldTypes[\"Error\"] = 24] = \"Error\";\n FieldTypes[FieldTypes[\"ContentTypeId\"] = 25] = \"ContentTypeId\";\n FieldTypes[FieldTypes[\"PageSeparator\"] = 26] = \"PageSeparator\";\n FieldTypes[FieldTypes[\"ThreadIndex\"] = 27] = \"ThreadIndex\";\n FieldTypes[FieldTypes[\"WorkflowStatus\"] = 28] = \"WorkflowStatus\";\n FieldTypes[FieldTypes[\"AllDayEvent\"] = 29] = \"AllDayEvent\";\n FieldTypes[FieldTypes[\"WorkflowEventType\"] = 30] = \"WorkflowEventType\";\n})(FieldTypes = exports.FieldTypes || (exports.FieldTypes = {}));\nvar DateTimeFieldFormatType;\n(function (DateTimeFieldFormatType) {\n DateTimeFieldFormatType[DateTimeFieldFormatType[\"DateOnly\"] = 0] = \"DateOnly\";\n DateTimeFieldFormatType[DateTimeFieldFormatType[\"DateTime\"] = 1] = \"DateTime\";\n})(DateTimeFieldFormatType = exports.DateTimeFieldFormatType || (exports.DateTimeFieldFormatType = {}));\n/**\n * Specifies the control settings while adding a field.\n */\nvar AddFieldOptions;\n(function (AddFieldOptions) {\n /**\n * Specify that a new field added to the list must also be added to the default content type in the site collection\n */\n AddFieldOptions[AddFieldOptions[\"DefaultValue\"] = 0] = \"DefaultValue\";\n /**\n * Specify that a new field added to the list must also be added to the default content type in the site collection.\n */\n AddFieldOptions[AddFieldOptions[\"AddToDefaultContentType\"] = 1] = \"AddToDefaultContentType\";\n /**\n * Specify that a new field must not be added to any other content type\n */\n AddFieldOptions[AddFieldOptions[\"AddToNoContentType\"] = 2] = \"AddToNoContentType\";\n /**\n * Specify that a new field that is added to the specified list must also be added to all content types in the site collection\n */\n AddFieldOptions[AddFieldOptions[\"AddToAllContentTypes\"] = 4] = \"AddToAllContentTypes\";\n /**\n * Specify adding an internal field name hint for the purpose of avoiding possible database locking or field renaming operations\n */\n AddFieldOptions[AddFieldOptions[\"AddFieldInternalNameHint\"] = 8] = \"AddFieldInternalNameHint\";\n /**\n * Specify that a new field that is added to the specified list must also be added to the default list view\n */\n AddFieldOptions[AddFieldOptions[\"AddFieldToDefaultView\"] = 16] = \"AddFieldToDefaultView\";\n /**\n * Specify to confirm that no other field has the same display name\n */\n AddFieldOptions[AddFieldOptions[\"AddFieldCheckDisplayName\"] = 32] = \"AddFieldCheckDisplayName\";\n})(AddFieldOptions = exports.AddFieldOptions || (exports.AddFieldOptions = {}));\nvar CalendarType;\n(function (CalendarType) {\n CalendarType[CalendarType[\"Gregorian\"] = 1] = \"Gregorian\";\n CalendarType[CalendarType[\"Japan\"] = 3] = \"Japan\";\n CalendarType[CalendarType[\"Taiwan\"] = 4] = \"Taiwan\";\n CalendarType[CalendarType[\"Korea\"] = 5] = \"Korea\";\n CalendarType[CalendarType[\"Hijri\"] = 6] = \"Hijri\";\n CalendarType[CalendarType[\"Thai\"] = 7] = \"Thai\";\n CalendarType[CalendarType[\"Hebrew\"] = 8] = \"Hebrew\";\n CalendarType[CalendarType[\"GregorianMEFrench\"] = 9] = \"GregorianMEFrench\";\n CalendarType[CalendarType[\"GregorianArabic\"] = 10] = \"GregorianArabic\";\n CalendarType[CalendarType[\"GregorianXLITEnglish\"] = 11] = \"GregorianXLITEnglish\";\n CalendarType[CalendarType[\"GregorianXLITFrench\"] = 12] = \"GregorianXLITFrench\";\n CalendarType[CalendarType[\"KoreaJapanLunar\"] = 14] = \"KoreaJapanLunar\";\n CalendarType[CalendarType[\"ChineseLunar\"] = 15] = \"ChineseLunar\";\n CalendarType[CalendarType[\"SakaEra\"] = 16] = \"SakaEra\";\n CalendarType[CalendarType[\"UmAlQura\"] = 23] = \"UmAlQura\";\n})(CalendarType = exports.CalendarType || (exports.CalendarType = {}));\nvar UrlFieldFormatType;\n(function (UrlFieldFormatType) {\n UrlFieldFormatType[UrlFieldFormatType[\"Hyperlink\"] = 0] = \"Hyperlink\";\n UrlFieldFormatType[UrlFieldFormatType[\"Image\"] = 1] = \"Image\";\n})(UrlFieldFormatType = exports.UrlFieldFormatType || (exports.UrlFieldFormatType = {}));\nvar PermissionKind;\n(function (PermissionKind) {\n /**\n * Has no permissions on the Site. Not available through the user interface.\n */\n PermissionKind[PermissionKind[\"EmptyMask\"] = 0] = \"EmptyMask\";\n /**\n * View items in lists, documents in document libraries, and Web discussion comments.\n */\n PermissionKind[PermissionKind[\"ViewListItems\"] = 1] = \"ViewListItems\";\n /**\n * Add items to lists, documents to document libraries, and Web discussion comments.\n */\n PermissionKind[PermissionKind[\"AddListItems\"] = 2] = \"AddListItems\";\n /**\n * Edit items in lists, edit documents in document libraries, edit Web discussion comments\n * in documents, and customize Web Part Pages in document libraries.\n */\n PermissionKind[PermissionKind[\"EditListItems\"] = 3] = \"EditListItems\";\n /**\n * Delete items from a list, documents from a document library, and Web discussion\n * comments in documents.\n */\n PermissionKind[PermissionKind[\"DeleteListItems\"] = 4] = \"DeleteListItems\";\n /**\n * Approve a minor version of a list item or document.\n */\n PermissionKind[PermissionKind[\"ApproveItems\"] = 5] = \"ApproveItems\";\n /**\n * View the source of documents with server-side file handlers.\n */\n PermissionKind[PermissionKind[\"OpenItems\"] = 6] = \"OpenItems\";\n /**\n * View past versions of a list item or document.\n */\n PermissionKind[PermissionKind[\"ViewVersions\"] = 7] = \"ViewVersions\";\n /**\n * Delete past versions of a list item or document.\n */\n PermissionKind[PermissionKind[\"DeleteVersions\"] = 8] = \"DeleteVersions\";\n /**\n * Discard or check in a document which is checked out to another user.\n */\n PermissionKind[PermissionKind[\"CancelCheckout\"] = 9] = \"CancelCheckout\";\n /**\n * Create, change, and delete personal views of lists.\n */\n PermissionKind[PermissionKind[\"ManagePersonalViews\"] = 10] = \"ManagePersonalViews\";\n /**\n * Create and delete lists, add or remove columns in a list, and add or remove public views of a list.\n */\n PermissionKind[PermissionKind[\"ManageLists\"] = 12] = \"ManageLists\";\n /**\n * View forms, views, and application pages, and enumerate lists.\n */\n PermissionKind[PermissionKind[\"ViewFormPages\"] = 13] = \"ViewFormPages\";\n /**\n * Make content of a list or document library retrieveable for anonymous users through SharePoint search.\n * The list permissions in the site do not change.\n */\n PermissionKind[PermissionKind[\"AnonymousSearchAccessList\"] = 14] = \"AnonymousSearchAccessList\";\n /**\n * Allow users to open a Site, list, or folder to access items inside that container.\n */\n PermissionKind[PermissionKind[\"Open\"] = 17] = \"Open\";\n /**\n * View pages in a Site.\n */\n PermissionKind[PermissionKind[\"ViewPages\"] = 18] = \"ViewPages\";\n /**\n * Add, change, or delete HTML pages or Web Part Pages, and edit the Site using\n * a Windows SharePoint Services compatible editor.\n */\n PermissionKind[PermissionKind[\"AddAndCustomizePages\"] = 19] = \"AddAndCustomizePages\";\n /**\n * Apply a theme or borders to the entire Site.\n */\n PermissionKind[PermissionKind[\"ApplyThemeAndBorder\"] = 20] = \"ApplyThemeAndBorder\";\n /**\n * Apply a style sheet (.css file) to the Site.\n */\n PermissionKind[PermissionKind[\"ApplyStyleSheets\"] = 21] = \"ApplyStyleSheets\";\n /**\n * View reports on Site usage.\n */\n PermissionKind[PermissionKind[\"ViewUsageData\"] = 22] = \"ViewUsageData\";\n /**\n * Create a Site using Self-Service Site Creation.\n */\n PermissionKind[PermissionKind[\"CreateSSCSite\"] = 23] = \"CreateSSCSite\";\n /**\n * Create subsites such as team sites, Meeting Workspace sites, and Document Workspace sites.\n */\n PermissionKind[PermissionKind[\"ManageSubwebs\"] = 24] = \"ManageSubwebs\";\n /**\n * Create a group of users that can be used anywhere within the site collection.\n */\n PermissionKind[PermissionKind[\"CreateGroups\"] = 25] = \"CreateGroups\";\n /**\n * Create and change permission levels on the Site and assign permissions to users\n * and groups.\n */\n PermissionKind[PermissionKind[\"ManagePermissions\"] = 26] = \"ManagePermissions\";\n /**\n * Enumerate files and folders in a Site using Microsoft Office SharePoint Designer\n * and WebDAV interfaces.\n */\n PermissionKind[PermissionKind[\"BrowseDirectories\"] = 27] = \"BrowseDirectories\";\n /**\n * View information about users of the Site.\n */\n PermissionKind[PermissionKind[\"BrowseUserInfo\"] = 28] = \"BrowseUserInfo\";\n /**\n * Add or remove personal Web Parts on a Web Part Page.\n */\n PermissionKind[PermissionKind[\"AddDelPrivateWebParts\"] = 29] = \"AddDelPrivateWebParts\";\n /**\n * Update Web Parts to display personalized information.\n */\n PermissionKind[PermissionKind[\"UpdatePersonalWebParts\"] = 30] = \"UpdatePersonalWebParts\";\n /**\n * Grant the ability to perform all administration tasks for the Site as well as\n * manage content, activate, deactivate, or edit properties of Site scoped Features\n * through the object model or through the user interface (UI). When granted on the\n * root Site of a Site Collection, activate, deactivate, or edit properties of\n * site collection scoped Features through the object model. To browse to the Site\n * Collection Features page and activate or deactivate Site Collection scoped Features\n * through the UI, you must be a Site Collection administrator.\n */\n PermissionKind[PermissionKind[\"ManageWeb\"] = 31] = \"ManageWeb\";\n /**\n * Content of lists and document libraries in the Web site will be retrieveable for anonymous users through\n * SharePoint search if the list or document library has AnonymousSearchAccessList set.\n */\n PermissionKind[PermissionKind[\"AnonymousSearchAccessWebLists\"] = 32] = \"AnonymousSearchAccessWebLists\";\n /**\n * Use features that launch client applications. Otherwise, users must work on documents\n * locally and upload changes.\n */\n PermissionKind[PermissionKind[\"UseClientIntegration\"] = 37] = \"UseClientIntegration\";\n /**\n * Use SOAP, WebDAV, or Microsoft Office SharePoint Designer interfaces to access the Site.\n */\n PermissionKind[PermissionKind[\"UseRemoteAPIs\"] = 38] = \"UseRemoteAPIs\";\n /**\n * Manage alerts for all users of the Site.\n */\n PermissionKind[PermissionKind[\"ManageAlerts\"] = 39] = \"ManageAlerts\";\n /**\n * Create e-mail alerts.\n */\n PermissionKind[PermissionKind[\"CreateAlerts\"] = 40] = \"CreateAlerts\";\n /**\n * Allows a user to change his or her user information, such as adding a picture.\n */\n PermissionKind[PermissionKind[\"EditMyUserInfo\"] = 41] = \"EditMyUserInfo\";\n /**\n * Enumerate permissions on Site, list, folder, document, or list item.\n */\n PermissionKind[PermissionKind[\"EnumeratePermissions\"] = 63] = \"EnumeratePermissions\";\n /**\n * Has all permissions on the Site. Not available through the user interface.\n */\n PermissionKind[PermissionKind[\"FullMask\"] = 65] = \"FullMask\";\n})(PermissionKind = exports.PermissionKind || (exports.PermissionKind = {}));\nvar PrincipalType;\n(function (PrincipalType) {\n PrincipalType[PrincipalType[\"None\"] = 0] = \"None\";\n PrincipalType[PrincipalType[\"User\"] = 1] = \"User\";\n PrincipalType[PrincipalType[\"DistributionList\"] = 2] = \"DistributionList\";\n PrincipalType[PrincipalType[\"SecurityGroup\"] = 4] = \"SecurityGroup\";\n PrincipalType[PrincipalType[\"SharePointGroup\"] = 8] = \"SharePointGroup\";\n PrincipalType[PrincipalType[\"All\"] = 15] = \"All\";\n})(PrincipalType = exports.PrincipalType || (exports.PrincipalType = {}));\nvar RoleType;\n(function (RoleType) {\n RoleType[RoleType[\"None\"] = 0] = \"None\";\n RoleType[RoleType[\"Guest\"] = 1] = \"Guest\";\n RoleType[RoleType[\"Reader\"] = 2] = \"Reader\";\n RoleType[RoleType[\"Contributor\"] = 3] = \"Contributor\";\n RoleType[RoleType[\"WebDesigner\"] = 4] = \"WebDesigner\";\n RoleType[RoleType[\"Administrator\"] = 5] = \"Administrator\";\n})(RoleType = exports.RoleType || (exports.RoleType = {}));\nvar PageType;\n(function (PageType) {\n PageType[PageType[\"Invalid\"] = -1] = \"Invalid\";\n PageType[PageType[\"DefaultView\"] = 0] = \"DefaultView\";\n PageType[PageType[\"NormalView\"] = 1] = \"NormalView\";\n PageType[PageType[\"DialogView\"] = 2] = \"DialogView\";\n PageType[PageType[\"View\"] = 3] = \"View\";\n PageType[PageType[\"DisplayForm\"] = 4] = \"DisplayForm\";\n PageType[PageType[\"DisplayFormDialog\"] = 5] = \"DisplayFormDialog\";\n PageType[PageType[\"EditForm\"] = 6] = \"EditForm\";\n PageType[PageType[\"EditFormDialog\"] = 7] = \"EditFormDialog\";\n PageType[PageType[\"NewForm\"] = 8] = \"NewForm\";\n PageType[PageType[\"NewFormDialog\"] = 9] = \"NewFormDialog\";\n PageType[PageType[\"SolutionForm\"] = 10] = \"SolutionForm\";\n PageType[PageType[\"PAGE_MAXITEMS\"] = 11] = \"PAGE_MAXITEMS\";\n})(PageType = exports.PageType || (exports.PageType = {}));\nvar SharingLinkKind;\n(function (SharingLinkKind) {\n /**\n * Uninitialized link\n */\n SharingLinkKind[SharingLinkKind[\"Uninitialized\"] = 0] = \"Uninitialized\";\n /**\n * Direct link to the object being shared\n */\n SharingLinkKind[SharingLinkKind[\"Direct\"] = 1] = \"Direct\";\n /**\n * Organization-shareable link to the object being shared with view permissions\n */\n SharingLinkKind[SharingLinkKind[\"OrganizationView\"] = 2] = \"OrganizationView\";\n /**\n * Organization-shareable link to the object being shared with edit permissions\n */\n SharingLinkKind[SharingLinkKind[\"OrganizationEdit\"] = 3] = \"OrganizationEdit\";\n /**\n * View only anonymous link\n */\n SharingLinkKind[SharingLinkKind[\"AnonymousView\"] = 4] = \"AnonymousView\";\n /**\n * Read/Write anonymous link\n */\n SharingLinkKind[SharingLinkKind[\"AnonymousEdit\"] = 5] = \"AnonymousEdit\";\n /**\n * Flexible sharing Link where properties can change without affecting link URL\n */\n SharingLinkKind[SharingLinkKind[\"Flexible\"] = 6] = \"Flexible\";\n})(SharingLinkKind = exports.SharingLinkKind || (exports.SharingLinkKind = {}));\n;\n/**\n * Indicates the role of the sharing link\n */\nvar SharingRole;\n(function (SharingRole) {\n SharingRole[SharingRole[\"None\"] = 0] = \"None\";\n SharingRole[SharingRole[\"View\"] = 1] = \"View\";\n SharingRole[SharingRole[\"Edit\"] = 2] = \"Edit\";\n SharingRole[SharingRole[\"Owner\"] = 3] = \"Owner\";\n})(SharingRole = exports.SharingRole || (exports.SharingRole = {}));\nvar SharingOperationStatusCode;\n(function (SharingOperationStatusCode) {\n /**\n * The share operation completed without errors.\n */\n SharingOperationStatusCode[SharingOperationStatusCode[\"CompletedSuccessfully\"] = 0] = \"CompletedSuccessfully\";\n /**\n * The share operation completed and generated requests for access.\n */\n SharingOperationStatusCode[SharingOperationStatusCode[\"AccessRequestsQueued\"] = 1] = \"AccessRequestsQueued\";\n /**\n * The share operation failed as there were no resolved users.\n */\n SharingOperationStatusCode[SharingOperationStatusCode[\"NoResolvedUsers\"] = -1] = \"NoResolvedUsers\";\n /**\n * The share operation failed due to insufficient permissions.\n */\n SharingOperationStatusCode[SharingOperationStatusCode[\"AccessDenied\"] = -2] = \"AccessDenied\";\n /**\n * The share operation failed when attempting a cross site share, which is not supported.\n */\n SharingOperationStatusCode[SharingOperationStatusCode[\"CrossSiteRequestNotSupported\"] = -3] = \"CrossSiteRequestNotSupported\";\n /**\n * The sharing operation failed due to an unknown error.\n */\n SharingOperationStatusCode[SharingOperationStatusCode[\"UnknowError\"] = -4] = \"UnknowError\";\n /**\n * The text you typed is too long. Please shorten it.\n */\n SharingOperationStatusCode[SharingOperationStatusCode[\"EmailBodyTooLong\"] = -5] = \"EmailBodyTooLong\";\n /**\n * The maximum number of unique scopes in the list has been exceeded.\n */\n SharingOperationStatusCode[SharingOperationStatusCode[\"ListUniqueScopesExceeded\"] = -6] = \"ListUniqueScopesExceeded\";\n /**\n * The share operation failed because a sharing capability is disabled in the site.\n */\n SharingOperationStatusCode[SharingOperationStatusCode[\"CapabilityDisabled\"] = -7] = \"CapabilityDisabled\";\n /**\n * The specified object for the share operation is not supported.\n */\n SharingOperationStatusCode[SharingOperationStatusCode[\"ObjectNotSupported\"] = -8] = \"ObjectNotSupported\";\n /**\n * A SharePoint group cannot contain another SharePoint group.\n */\n SharingOperationStatusCode[SharingOperationStatusCode[\"NestedGroupsNotSupported\"] = -9] = \"NestedGroupsNotSupported\";\n})(SharingOperationStatusCode = exports.SharingOperationStatusCode || (exports.SharingOperationStatusCode = {}));\nvar SPSharedObjectType;\n(function (SPSharedObjectType) {\n SPSharedObjectType[SPSharedObjectType[\"Unknown\"] = 0] = \"Unknown\";\n SPSharedObjectType[SPSharedObjectType[\"File\"] = 1] = \"File\";\n SPSharedObjectType[SPSharedObjectType[\"Folder\"] = 2] = \"Folder\";\n SPSharedObjectType[SPSharedObjectType[\"Item\"] = 3] = \"Item\";\n SPSharedObjectType[SPSharedObjectType[\"List\"] = 4] = \"List\";\n SPSharedObjectType[SPSharedObjectType[\"Web\"] = 5] = \"Web\";\n SPSharedObjectType[SPSharedObjectType[\"Max\"] = 6] = \"Max\";\n})(SPSharedObjectType = exports.SPSharedObjectType || (exports.SPSharedObjectType = {}));\nvar SharingDomainRestrictionMode;\n(function (SharingDomainRestrictionMode) {\n SharingDomainRestrictionMode[SharingDomainRestrictionMode[\"None\"] = 0] = \"None\";\n SharingDomainRestrictionMode[SharingDomainRestrictionMode[\"AllowList\"] = 1] = \"AllowList\";\n SharingDomainRestrictionMode[SharingDomainRestrictionMode[\"BlockList\"] = 2] = \"BlockList\";\n})(SharingDomainRestrictionMode = exports.SharingDomainRestrictionMode || (exports.SharingDomainRestrictionMode = {}));\n;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/sharepoint/types.js\n// module id = 13\n// module chunks = 0","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar util_1 = require(\"./util\");\nvar collections_1 = require(\"../collections/collections\");\nvar pnplibconfig_1 = require(\"../configuration/pnplibconfig\");\n/**\n * A wrapper class to provide a consistent interface to browser based storage\n *\n */\nvar PnPClientStorageWrapper = (function () {\n /**\n * Creates a new instance of the PnPClientStorageWrapper class\n *\n * @constructor\n */\n function PnPClientStorageWrapper(store, defaultTimeoutMinutes) {\n this.store = store;\n this.defaultTimeoutMinutes = defaultTimeoutMinutes;\n this.defaultTimeoutMinutes = (defaultTimeoutMinutes === void 0) ? -1 : defaultTimeoutMinutes;\n this.enabled = this.test();\n }\n /**\n * Get a value from storage, or null if that value does not exist\n *\n * @param key The key whose value we want to retrieve\n */\n PnPClientStorageWrapper.prototype.get = function (key) {\n if (!this.enabled) {\n return null;\n }\n var o = this.store.getItem(key);\n if (o == null) {\n return null;\n }\n var persistable = JSON.parse(o);\n if (new Date(persistable.expiration) <= new Date()) {\n this.delete(key);\n return null;\n }\n else {\n return persistable.value;\n }\n };\n /**\n * Adds a value to the underlying storage\n *\n * @param key The key to use when storing the provided value\n * @param o The value to store\n * @param expire Optional, if provided the expiration of the item, otherwise the default is used\n */\n PnPClientStorageWrapper.prototype.put = function (key, o, expire) {\n if (this.enabled) {\n this.store.setItem(key, this.createPersistable(o, expire));\n }\n };\n /**\n * Deletes a value from the underlying storage\n *\n * @param key The key of the pair we want to remove from storage\n */\n PnPClientStorageWrapper.prototype.delete = function (key) {\n if (this.enabled) {\n this.store.removeItem(key);\n }\n };\n /**\n * Gets an item from the underlying storage, or adds it if it does not exist using the supplied getter function\n *\n * @param key The key to use when storing the provided value\n * @param getter A function which will upon execution provide the desired value\n * @param expire Optional, if provided the expiration of the item, otherwise the default is used\n */\n PnPClientStorageWrapper.prototype.getOrPut = function (key, getter, expire) {\n var _this = this;\n if (!this.enabled) {\n return getter();\n }\n return new Promise(function (resolve) {\n var o = _this.get(key);\n if (o == null) {\n getter().then(function (d) {\n _this.put(key, d, expire);\n resolve(d);\n });\n }\n else {\n resolve(o);\n }\n });\n };\n /**\n * Used to determine if the wrapped storage is available currently\n */\n PnPClientStorageWrapper.prototype.test = function () {\n var str = \"test\";\n try {\n this.store.setItem(str, str);\n this.store.removeItem(str);\n return true;\n }\n catch (e) {\n return false;\n }\n };\n /**\n * Creates the persistable to store\n */\n PnPClientStorageWrapper.prototype.createPersistable = function (o, expire) {\n if (typeof expire === \"undefined\") {\n // ensure we are by default inline with the global library setting\n var defaultTimeout = pnplibconfig_1.RuntimeConfig.defaultCachingTimeoutSeconds;\n if (this.defaultTimeoutMinutes > 0) {\n defaultTimeout = this.defaultTimeoutMinutes * 60;\n }\n expire = util_1.Util.dateAdd(new Date(), \"second\", defaultTimeout);\n }\n return JSON.stringify({ expiration: expire, value: o });\n };\n return PnPClientStorageWrapper;\n}());\nexports.PnPClientStorageWrapper = PnPClientStorageWrapper;\n/**\n * A thin implementation of in-memory storage for use in nodejs\n */\nvar MemoryStorage = (function () {\n function MemoryStorage(_store) {\n if (_store === void 0) { _store = new collections_1.Dictionary(); }\n this._store = _store;\n }\n Object.defineProperty(MemoryStorage.prototype, \"length\", {\n get: function () {\n return this._store.count();\n },\n enumerable: true,\n configurable: true\n });\n MemoryStorage.prototype.clear = function () {\n this._store.clear();\n };\n MemoryStorage.prototype.getItem = function (key) {\n return this._store.get(key);\n };\n MemoryStorage.prototype.key = function (index) {\n return this._store.getKeys()[index];\n };\n MemoryStorage.prototype.removeItem = function (key) {\n this._store.remove(key);\n };\n MemoryStorage.prototype.setItem = function (key, data) {\n this._store.add(key, data);\n };\n return MemoryStorage;\n}());\n/**\n * A class that will establish wrappers for both local and session storage\n */\nvar PnPClientStorage = (function () {\n /**\n * Creates a new instance of the PnPClientStorage class\n *\n * @constructor\n */\n function PnPClientStorage() {\n this.local = typeof localStorage !== \"undefined\" ? new PnPClientStorageWrapper(localStorage) : new PnPClientStorageWrapper(new MemoryStorage());\n this.session = typeof sessionStorage !== \"undefined\" ? new PnPClientStorageWrapper(sessionStorage) : new PnPClientStorageWrapper(new MemoryStorage());\n }\n return PnPClientStorage;\n}());\nexports.PnPClientStorage = PnPClientStorage;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/utils/storage.js\n// module id = 14\n// module chunks = 0","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar digestcache_1 = require(\"./digestcache\");\nvar util_1 = require(\"../utils/util\");\nvar pnplibconfig_1 = require(\"../configuration/pnplibconfig\");\nvar exceptions_1 = require(\"../utils/exceptions\");\nvar HttpClient = (function () {\n function HttpClient() {\n this._impl = pnplibconfig_1.RuntimeConfig.fetchClientFactory();\n this._digestCache = new digestcache_1.DigestCache(this);\n }\n HttpClient.prototype.fetch = function (url, options) {\n var _this = this;\n if (options === void 0) { options = {}; }\n var opts = util_1.Util.extend(options, { cache: \"no-cache\", credentials: \"same-origin\" }, true);\n var headers = new Headers();\n // first we add the global headers so they can be overwritten by any passed in locally to this call\n this.mergeHeaders(headers, pnplibconfig_1.RuntimeConfig.headers);\n // second we add the local options so we can overwrite the globals\n this.mergeHeaders(headers, options.headers);\n // lastly we apply any default headers we need that may not exist\n if (!headers.has(\"Accept\")) {\n headers.append(\"Accept\", \"application/json\");\n }\n if (!headers.has(\"Content-Type\")) {\n headers.append(\"Content-Type\", \"application/json;odata=verbose;charset=utf-8\");\n }\n if (!headers.has(\"X-ClientService-ClientTag\")) {\n headers.append(\"X-ClientService-ClientTag\", \"PnPCoreJS:2.0.3\");\n }\n opts = util_1.Util.extend(opts, { headers: headers });\n if (opts.method && opts.method.toUpperCase() !== \"GET\") {\n if (!headers.has(\"X-RequestDigest\")) {\n var index = url.indexOf(\"_api/\");\n if (index < 0) {\n throw new exceptions_1.APIUrlException();\n }\n var webUrl = url.substr(0, index);\n return this._digestCache.getDigest(webUrl)\n .then(function (digest) {\n headers.append(\"X-RequestDigest\", digest);\n return _this.fetchRaw(url, opts);\n });\n }\n }\n return this.fetchRaw(url, opts);\n };\n HttpClient.prototype.fetchRaw = function (url, options) {\n var _this = this;\n if (options === void 0) { options = {}; }\n // here we need to normalize the headers\n var rawHeaders = new Headers();\n this.mergeHeaders(rawHeaders, options.headers);\n options = util_1.Util.extend(options, { headers: rawHeaders });\n var retry = function (ctx) {\n _this._impl.fetch(url, options).then(function (response) { return ctx.resolve(response); }).catch(function (response) {\n // grab our current delay\n var delay = ctx.delay;\n // Check if request was throttled - http status code 429\n // Check is request failed due to server unavailable - http status code 503\n if (response.status !== 429 && response.status !== 503) {\n ctx.reject(response);\n }\n // Increment our counters.\n ctx.delay *= 2;\n ctx.attempts++;\n // If we have exceeded the retry count, reject.\n if (ctx.retryCount <= ctx.attempts) {\n ctx.reject(response);\n }\n // Set our retry timeout for {delay} milliseconds.\n setTimeout(util_1.Util.getCtxCallback(_this, retry, ctx), delay);\n });\n };\n return new Promise(function (resolve, reject) {\n var retryContext = {\n attempts: 0,\n delay: 100,\n reject: reject,\n resolve: resolve,\n retryCount: 7,\n };\n retry.call(_this, retryContext);\n });\n };\n HttpClient.prototype.get = function (url, options) {\n if (options === void 0) { options = {}; }\n var opts = util_1.Util.extend(options, { method: \"GET\" });\n return this.fetch(url, opts);\n };\n HttpClient.prototype.post = function (url, options) {\n if (options === void 0) { options = {}; }\n var opts = util_1.Util.extend(options, { method: \"POST\" });\n return this.fetch(url, opts);\n };\n HttpClient.prototype.patch = function (url, options) {\n if (options === void 0) { options = {}; }\n var opts = util_1.Util.extend(options, { method: \"PATCH\" });\n return this.fetch(url, opts);\n };\n HttpClient.prototype.delete = function (url, options) {\n if (options === void 0) { options = {}; }\n var opts = util_1.Util.extend(options, { method: \"DELETE\" });\n return this.fetch(url, opts);\n };\n HttpClient.prototype.mergeHeaders = function (target, source) {\n if (typeof source !== \"undefined\" && source !== null) {\n var temp = new Request(\"\", { headers: source });\n temp.headers.forEach(function (value, name) {\n target.append(name, value);\n });\n }\n };\n return HttpClient;\n}());\nexports.HttpClient = HttpClient;\n;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/net/httpclient.js\n// module id = 15\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar util_1 = require(\"../utils/util\");\nvar queryable_1 = require(\"./queryable\");\n/**\n * Describes a collection of content types\n *\n */\nvar ContentTypes = (function (_super) {\n __extends(ContentTypes, _super);\n /**\n * Creates a new instance of the ContentTypes class\n *\n * @param baseUrl The url or Queryable which forms the parent of this content types collection\n */\n function ContentTypes(baseUrl, path) {\n if (path === void 0) { path = \"contenttypes\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * Gets a ContentType by content type id\n */\n ContentTypes.prototype.getById = function (id) {\n var ct = new ContentType(this);\n ct.concat(\"('\" + id + \"')\");\n return ct;\n };\n /**\n * Adds an existing contenttype to a content type collection\n *\n * @param contentTypeId in the following format, for example: 0x010102\n */\n ContentTypes.prototype.addAvailableContentType = function (contentTypeId) {\n var _this = this;\n var postBody = JSON.stringify({\n \"contentTypeId\": contentTypeId,\n });\n return this.clone(ContentTypes, \"addAvailableContentType\", true).postAs({ body: postBody }).then(function (data) {\n return {\n contentType: _this.getById(data.id),\n data: data,\n };\n });\n };\n /**\n * Adds a new content type to the collection\n *\n * @param id The desired content type id for the new content type (also determines the parent content type)\n * @param name The name of the content type\n * @param description The description of the content type\n * @param group The group in which to add the content type\n * @param additionalSettings Any additional settings to provide when creating the content type\n *\n */\n ContentTypes.prototype.add = function (id, name, description, group, additionalSettings) {\n var _this = this;\n if (description === void 0) { description = \"\"; }\n if (group === void 0) { group = \"Custom Content Types\"; }\n if (additionalSettings === void 0) { additionalSettings = {}; }\n var postBody = JSON.stringify(util_1.Util.extend({\n \"Description\": description,\n \"Group\": group,\n \"Id\": { \"StringValue\": id },\n \"Name\": name,\n \"__metadata\": { \"type\": \"SP.ContentType\" },\n }, additionalSettings));\n return this.post({ body: postBody }).then(function (data) {\n return { contentType: _this.getById(data.id), data: data };\n });\n };\n return ContentTypes;\n}(queryable_1.QueryableCollection));\nexports.ContentTypes = ContentTypes;\n/**\n * Describes a single ContentType instance\n *\n */\nvar ContentType = (function (_super) {\n __extends(ContentType, _super);\n function ContentType() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(ContentType.prototype, \"fieldLinks\", {\n /**\n * Gets the column (also known as field) references in the content type.\n */\n get: function () {\n return new FieldLinks(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ContentType.prototype, \"fields\", {\n /**\n * Gets a value that specifies the collection of fields for the content type.\n */\n get: function () {\n return new queryable_1.QueryableCollection(this, \"fields\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ContentType.prototype, \"parent\", {\n /**\n * Gets the parent content type of the content type.\n */\n get: function () {\n return new ContentType(this, \"parent\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ContentType.prototype, \"workflowAssociations\", {\n /**\n * Gets a value that specifies the collection of workflow associations for the content type.\n */\n get: function () {\n return new queryable_1.QueryableCollection(this, \"workflowAssociations\");\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Delete this content type\n */\n ContentType.prototype.delete = function () {\n return this.post({\n headers: {\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n return ContentType;\n}(queryable_1.QueryableInstance));\nexports.ContentType = ContentType;\n/**\n * Represents a collection of field link instances\n */\nvar FieldLinks = (function (_super) {\n __extends(FieldLinks, _super);\n /**\n * Creates a new instance of the ContentType class\n *\n * @param baseUrl The url or Queryable which forms the parent of this content type instance\n */\n function FieldLinks(baseUrl, path) {\n if (path === void 0) { path = \"fieldlinks\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * Gets a FieldLink by GUID id\n *\n * @param id The GUID id of the field link\n */\n FieldLinks.prototype.getById = function (id) {\n var fl = new FieldLink(this);\n fl.concat(\"(guid'\" + id + \"')\");\n return fl;\n };\n return FieldLinks;\n}(queryable_1.QueryableCollection));\nexports.FieldLinks = FieldLinks;\n/**\n * Represents a field link instance\n */\nvar FieldLink = (function (_super) {\n __extends(FieldLink, _super);\n function FieldLink() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return FieldLink;\n}(queryable_1.QueryableInstance));\nexports.FieldLink = FieldLink;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/sharepoint/contenttypes.js\n// module id = 16\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar queryable_1 = require(\"./queryable\");\nvar sitegroups_1 = require(\"./sitegroups\");\nvar util_1 = require(\"../utils/util\");\n/**\n * Describes a set of role assignments for the current scope\n *\n */\nvar RoleAssignments = (function (_super) {\n __extends(RoleAssignments, _super);\n /**\n * Creates a new instance of the RoleAssignments class\n *\n * @param baseUrl The url or Queryable which forms the parent of this fields collection\n */\n function RoleAssignments(baseUrl, path) {\n if (path === void 0) { path = \"roleassignments\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * Adds a new role assignment with the specified principal and role definitions to the collection.\n *\n * @param principalId The ID of the user or group to assign permissions to\n * @param roleDefId The ID of the role definition that defines the permissions to assign\n *\n */\n RoleAssignments.prototype.add = function (principalId, roleDefId) {\n return this.clone(RoleAssignments, \"addroleassignment(principalid=\" + principalId + \", roledefid=\" + roleDefId + \")\", true).post();\n };\n /**\n * Removes the role assignment with the specified principal and role definition from the collection\n *\n * @param principalId The ID of the user or group in the role assignment.\n * @param roleDefId The ID of the role definition in the role assignment\n *\n */\n RoleAssignments.prototype.remove = function (principalId, roleDefId) {\n return this.clone(RoleAssignments, \"removeroleassignment(principalid=\" + principalId + \", roledefid=\" + roleDefId + \")\", true).post();\n };\n /**\n * Gets the role assignment associated with the specified principal ID from the collection.\n *\n * @param id The id of the role assignment\n */\n RoleAssignments.prototype.getById = function (id) {\n var ra = new RoleAssignment(this);\n ra.concat(\"(\" + id + \")\");\n return ra;\n };\n return RoleAssignments;\n}(queryable_1.QueryableCollection));\nexports.RoleAssignments = RoleAssignments;\nvar RoleAssignment = (function (_super) {\n __extends(RoleAssignment, _super);\n function RoleAssignment() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(RoleAssignment.prototype, \"groups\", {\n get: function () {\n return new sitegroups_1.SiteGroups(this, \"groups\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(RoleAssignment.prototype, \"bindings\", {\n /**\n * Get the role definition bindings for this role assignment\n *\n */\n get: function () {\n return new RoleDefinitionBindings(this);\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Delete this role assignment\n *\n */\n RoleAssignment.prototype.delete = function () {\n return this.post({\n headers: {\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n return RoleAssignment;\n}(queryable_1.QueryableInstance));\nexports.RoleAssignment = RoleAssignment;\nvar RoleDefinitions = (function (_super) {\n __extends(RoleDefinitions, _super);\n /**\n * Creates a new instance of the RoleDefinitions class\n *\n * @param baseUrl The url or Queryable which forms the parent of this fields collection\n * @param path\n *\n */\n function RoleDefinitions(baseUrl, path) {\n if (path === void 0) { path = \"roledefinitions\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * Gets the role definition with the specified ID from the collection.\n *\n * @param id The ID of the role definition.\n *\n */\n RoleDefinitions.prototype.getById = function (id) {\n return new RoleDefinition(this, \"getById(\" + id + \")\");\n };\n /**\n * Gets the role definition with the specified name.\n *\n * @param name The name of the role definition.\n *\n */\n RoleDefinitions.prototype.getByName = function (name) {\n return new RoleDefinition(this, \"getbyname('\" + name + \"')\");\n };\n /**\n * Gets the role definition with the specified type.\n *\n * @param name The name of the role definition.\n *\n */\n RoleDefinitions.prototype.getByType = function (roleTypeKind) {\n return new RoleDefinition(this, \"getbytype(\" + roleTypeKind + \")\");\n };\n /**\n * Create a role definition\n *\n * @param name The new role definition's name\n * @param description The new role definition's description\n * @param order The order in which the role definition appears\n * @param basePermissions The permissions mask for this role definition\n *\n */\n RoleDefinitions.prototype.add = function (name, description, order, basePermissions) {\n var _this = this;\n var postBody = JSON.stringify({\n BasePermissions: util_1.Util.extend({ __metadata: { type: \"SP.BasePermissions\" } }, basePermissions),\n Description: description,\n Name: name,\n Order: order,\n __metadata: { \"type\": \"SP.RoleDefinition\" },\n });\n return this.post({ body: postBody }).then(function (data) {\n return {\n data: data,\n definition: _this.getById(data.Id),\n };\n });\n };\n return RoleDefinitions;\n}(queryable_1.QueryableCollection));\nexports.RoleDefinitions = RoleDefinitions;\nvar RoleDefinition = (function (_super) {\n __extends(RoleDefinition, _super);\n function RoleDefinition() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Updates this web intance with the supplied properties\n *\n * @param properties A plain object hash of values to update for the web\n */\n /* tslint:disable no-string-literal */\n RoleDefinition.prototype.update = function (properties) {\n var _this = this;\n if (typeof properties.hasOwnProperty(\"BasePermissions\") !== \"undefined\") {\n properties[\"BasePermissions\"] = util_1.Util.extend({ __metadata: { type: \"SP.BasePermissions\" } }, properties[\"BasePermissions\"]);\n }\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": \"SP.RoleDefinition\" },\n }, properties));\n return this.post({\n body: postBody,\n headers: {\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n var retDef = _this;\n if (properties.hasOwnProperty(\"Name\")) {\n var parent_1 = _this.getParent(RoleDefinitions, _this.parentUrl, \"\");\n retDef = parent_1.getByName(properties[\"Name\"]);\n }\n return {\n data: data,\n definition: retDef,\n };\n });\n };\n /* tslint:enable */\n /**\n * Delete this role definition\n *\n */\n RoleDefinition.prototype.delete = function () {\n return this.post({\n headers: {\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n return RoleDefinition;\n}(queryable_1.QueryableInstance));\nexports.RoleDefinition = RoleDefinition;\nvar RoleDefinitionBindings = (function (_super) {\n __extends(RoleDefinitionBindings, _super);\n function RoleDefinitionBindings(baseUrl, path) {\n if (path === void 0) { path = \"roledefinitionbindings\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n return RoleDefinitionBindings;\n}(queryable_1.QueryableCollection));\nexports.RoleDefinitionBindings = RoleDefinitionBindings;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/sharepoint/roles.js\n// module id = 17\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar queryable_1 = require(\"./queryable\");\nvar siteusers_1 = require(\"./siteusers\");\nvar util_1 = require(\"../utils/util\");\n/**\n * Principal Type enum\n *\n */\nvar PrincipalType;\n(function (PrincipalType) {\n PrincipalType[PrincipalType[\"None\"] = 0] = \"None\";\n PrincipalType[PrincipalType[\"User\"] = 1] = \"User\";\n PrincipalType[PrincipalType[\"DistributionList\"] = 2] = \"DistributionList\";\n PrincipalType[PrincipalType[\"SecurityGroup\"] = 4] = \"SecurityGroup\";\n PrincipalType[PrincipalType[\"SharePointGroup\"] = 8] = \"SharePointGroup\";\n PrincipalType[PrincipalType[\"All\"] = 15] = \"All\";\n})(PrincipalType = exports.PrincipalType || (exports.PrincipalType = {}));\n/**\n * Describes a collection of site users\n *\n */\nvar SiteGroups = (function (_super) {\n __extends(SiteGroups, _super);\n /**\n * Creates a new instance of the SiteUsers class\n *\n * @param baseUrl The url or Queryable which forms the parent of this user collection\n */\n function SiteGroups(baseUrl, path) {\n if (path === void 0) { path = \"sitegroups\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * Adds a new group to the site collection\n *\n * @param props The properties to be updated\n */\n SiteGroups.prototype.add = function (properties) {\n var _this = this;\n var postBody = JSON.stringify(util_1.Util.extend({ \"__metadata\": { \"type\": \"SP.Group\" } }, properties));\n return this.post({ body: postBody }).then(function (data) {\n return {\n data: data,\n group: _this.getById(data.Id),\n };\n });\n };\n /**\n * Gets a group from the collection by name\n *\n * @param email The name of the group\n */\n SiteGroups.prototype.getByName = function (groupName) {\n return new SiteGroup(this, \"getByName('\" + groupName + \"')\");\n };\n /**\n * Gets a group from the collection by id\n *\n * @param id The id of the group\n */\n SiteGroups.prototype.getById = function (id) {\n var sg = new SiteGroup(this);\n sg.concat(\"(\" + id + \")\");\n return sg;\n };\n /**\n * Removes the group with the specified member ID from the collection.\n *\n * @param id The id of the group to remove\n */\n SiteGroups.prototype.removeById = function (id) {\n return this.clone(SiteGroups, \"removeById('\" + id + \"')\", true).post();\n };\n /**\n * Removes a user from the collection by login name\n *\n * @param loginName The login name of the user\n */\n SiteGroups.prototype.removeByLoginName = function (loginName) {\n return this.clone(SiteGroups, \"removeByLoginName('\" + loginName + \"')\", true).post();\n };\n return SiteGroups;\n}(queryable_1.QueryableCollection));\nexports.SiteGroups = SiteGroups;\n/**\n * Describes a single group\n *\n */\nvar SiteGroup = (function (_super) {\n __extends(SiteGroup, _super);\n function SiteGroup() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(SiteGroup.prototype, \"users\", {\n /**\n * Get's the users for this group\n *\n */\n get: function () {\n return new siteusers_1.SiteUsers(this, \"users\");\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Updates this group instance with the supplied properties\n *\n * @param properties A GroupWriteableProperties object of property names and values to update for the user\n */\n /* tslint:disable no-string-literal */\n SiteGroup.prototype.update = function (properties) {\n var _this = this;\n var postBody = util_1.Util.extend({ \"__metadata\": { \"type\": \"SP.Group\" } }, properties);\n return this.post({\n body: JSON.stringify(postBody),\n headers: {\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n var retGroup = _this;\n if (properties.hasOwnProperty(\"Title\")) {\n retGroup = _this.getParent(SiteGroup, _this.parentUrl, \"getByName('\" + properties[\"Title\"] + \"')\");\n }\n return {\n data: data,\n group: retGroup,\n };\n });\n };\n return SiteGroup;\n}(queryable_1.QueryableInstance));\nexports.SiteGroup = SiteGroup;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/sharepoint/sitegroups.js\n// module id = 18\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar queryable_1 = require(\"./queryable\");\nvar util_1 = require(\"../utils/util\");\nvar UserCustomActions = (function (_super) {\n __extends(UserCustomActions, _super);\n function UserCustomActions(baseUrl, path) {\n if (path === void 0) { path = \"usercustomactions\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * Returns the custom action with the specified identifier.\n *\n * @param id The GUID ID of the user custom action to get.\n */\n UserCustomActions.prototype.getById = function (id) {\n var uca = new UserCustomAction(this);\n uca.concat(\"('\" + id + \"')\");\n return uca;\n };\n /**\n * Create a custom action\n *\n * @param creationInfo The information which defines the new custom action\n *\n */\n UserCustomActions.prototype.add = function (properties) {\n var _this = this;\n var postBody = JSON.stringify(util_1.Util.extend({ __metadata: { \"type\": \"SP.UserCustomAction\" } }, properties));\n return this.post({ body: postBody }).then(function (data) {\n return {\n action: _this.getById(data.Id),\n data: data,\n };\n });\n };\n /**\n * Deletes all custom actions in the collection.\n *\n */\n UserCustomActions.prototype.clear = function () {\n return this.clone(UserCustomActions, \"clear\", true).post();\n };\n return UserCustomActions;\n}(queryable_1.QueryableCollection));\nexports.UserCustomActions = UserCustomActions;\nvar UserCustomAction = (function (_super) {\n __extends(UserCustomAction, _super);\n function UserCustomAction() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n UserCustomAction.prototype.update = function (properties) {\n var _this = this;\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": \"SP.UserCustomAction\" },\n }, properties));\n return this.post({\n body: postBody,\n headers: {\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n return {\n action: _this,\n data: data,\n };\n });\n };\n /**\n * Remove a custom action\n *\n */\n UserCustomAction.prototype.delete = function () {\n return _super.prototype.delete.call(this);\n };\n return UserCustomAction;\n}(queryable_1.QueryableInstance));\nexports.UserCustomAction = UserCustomAction;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/sharepoint/usercustomactions.js\n// module id = 19\n// module chunks = 0","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar storage = require(\"../../utils/storage\");\nvar exceptions_1 = require(\"../../utils/exceptions\");\n/**\n * A caching provider which can wrap other non-caching providers\n *\n */\nvar CachingConfigurationProvider = (function () {\n /**\n * Creates a new caching configuration provider\n * @constructor\n * @param {IConfigurationProvider} wrappedProvider Provider which will be used to fetch the configuration\n * @param {string} cacheKey Key that will be used to store cached items to the cache\n * @param {IPnPClientStore} cacheStore OPTIONAL storage, which will be used to store cached settings.\n */\n function CachingConfigurationProvider(wrappedProvider, cacheKey, cacheStore) {\n this.wrappedProvider = wrappedProvider;\n this.store = (cacheStore) ? cacheStore : this.selectPnPCache();\n this.cacheKey = \"_configcache_\" + cacheKey;\n }\n /**\n * Gets the wrapped configuration providers\n *\n * @return {IConfigurationProvider} Wrapped configuration provider\n */\n CachingConfigurationProvider.prototype.getWrappedProvider = function () {\n return this.wrappedProvider;\n };\n /**\n * Loads the configuration values either from the cache or from the wrapped provider\n *\n * @return {Promise>} Promise of loaded configuration values\n */\n CachingConfigurationProvider.prototype.getConfiguration = function () {\n var _this = this;\n // Cache not available, pass control to the wrapped provider\n if ((!this.store) || (!this.store.enabled)) {\n return this.wrappedProvider.getConfiguration();\n }\n // Value is found in cache, return it directly\n var cachedConfig = this.store.get(this.cacheKey);\n if (cachedConfig) {\n return new Promise(function (resolve) {\n resolve(cachedConfig);\n });\n }\n // Get and cache value from the wrapped provider\n var providerPromise = this.wrappedProvider.getConfiguration();\n providerPromise.then(function (providedConfig) {\n _this.store.put(_this.cacheKey, providedConfig);\n });\n return providerPromise;\n };\n CachingConfigurationProvider.prototype.selectPnPCache = function () {\n var pnpCache = new storage.PnPClientStorage();\n if ((pnpCache.local) && (pnpCache.local.enabled)) {\n return pnpCache.local;\n }\n if ((pnpCache.session) && (pnpCache.session.enabled)) {\n return pnpCache.session;\n }\n throw new exceptions_1.NoCacheAvailableException();\n };\n return CachingConfigurationProvider;\n}());\nexports.default = CachingConfigurationProvider;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/configuration/providers/cachingConfigurationProvider.js\n// module id = 20\n// module chunks = 0","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Makes requests using the fetch API\n */\nvar FetchClient = (function () {\n function FetchClient() {\n }\n FetchClient.prototype.fetch = function (url, options) {\n return global.fetch(url, options);\n };\n return FetchClient;\n}());\nexports.FetchClient = FetchClient;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/net/fetchclient.js\n// module id = 21\n// module chunks = 0","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar storage_1 = require(\"../utils/storage\");\nvar util_1 = require(\"../utils/util\");\nvar pnplibconfig_1 = require(\"../configuration/pnplibconfig\");\nvar CachingOptions = (function () {\n function CachingOptions(key) {\n this.key = key;\n this.expiration = util_1.Util.dateAdd(new Date(), \"second\", pnplibconfig_1.RuntimeConfig.defaultCachingTimeoutSeconds);\n this.storeName = pnplibconfig_1.RuntimeConfig.defaultCachingStore;\n }\n Object.defineProperty(CachingOptions.prototype, \"store\", {\n get: function () {\n if (this.storeName === \"local\") {\n return CachingOptions.storage.local;\n }\n else {\n return CachingOptions.storage.session;\n }\n },\n enumerable: true,\n configurable: true\n });\n return CachingOptions;\n}());\nCachingOptions.storage = new storage_1.PnPClientStorage();\nexports.CachingOptions = CachingOptions;\nvar CachingParserWrapper = (function () {\n function CachingParserWrapper(_parser, _cacheOptions) {\n this._parser = _parser;\n this._cacheOptions = _cacheOptions;\n }\n CachingParserWrapper.prototype.parse = function (response) {\n var _this = this;\n // add this to the cache based on the options\n return this._parser.parse(response).then(function (data) {\n if (_this._cacheOptions.store !== null) {\n _this._cacheOptions.store.put(_this._cacheOptions.key, data, _this._cacheOptions.expiration);\n }\n return data;\n });\n };\n return CachingParserWrapper;\n}());\nexports.CachingParserWrapper = CachingParserWrapper;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/sharepoint/caching.js\n// module id = 22\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar queryable_1 = require(\"./queryable\");\n/**\n * Describes a collection of List objects\n *\n */\nvar Features = (function (_super) {\n __extends(Features, _super);\n /**\n * Creates a new instance of the Lists class\n *\n * @param baseUrl The url or Queryable which forms the parent of this fields collection\n */\n function Features(baseUrl, path) {\n if (path === void 0) { path = \"features\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * Gets a list from the collection by guid id\n *\n * @param id The Id of the feature (GUID)\n */\n Features.prototype.getById = function (id) {\n var feature = new Feature(this);\n feature.concat(\"('\" + id + \"')\");\n return feature;\n };\n /**\n * Adds a new list to the collection\n *\n * @param id The Id of the feature (GUID)\n * @param force If true the feature activation will be forced\n */\n Features.prototype.add = function (id, force) {\n var _this = this;\n if (force === void 0) { force = false; }\n return this.clone(Features, \"add\", true).post({\n body: JSON.stringify({\n featdefScope: 0,\n featureId: id,\n force: force,\n }),\n }).then(function (data) {\n return {\n data: data,\n feature: _this.getById(id),\n };\n });\n };\n /**\n * Removes (deactivates) a feature from the collection\n *\n * @param id The Id of the feature (GUID)\n * @param force If true the feature deactivation will be forced\n */\n Features.prototype.remove = function (id, force) {\n if (force === void 0) { force = false; }\n return this.clone(Features, \"remove\", true).post({\n body: JSON.stringify({\n featureId: id,\n force: force,\n }),\n });\n };\n return Features;\n}(queryable_1.QueryableCollection));\nexports.Features = Features;\nvar Feature = (function (_super) {\n __extends(Feature, _super);\n function Feature() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Removes (deactivates) a feature from the collection\n *\n * @param force If true the feature deactivation will be forced\n */\n Feature.prototype.deactivate = function (force) {\n var _this = this;\n if (force === void 0) { force = false; }\n var removeDependency = this.addBatchDependency();\n var idGet = new Feature(this).select(\"DefinitionId\");\n return idGet.getAs().then(function (feature) {\n var promise = _this.getParent(Features, _this.parentUrl, \"\", _this.batch).remove(feature.DefinitionId, force);\n removeDependency();\n return promise;\n });\n };\n return Feature;\n}(queryable_1.QueryableInstance));\nexports.Feature = Feature;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/sharepoint/features.js\n// module id = 23\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar queryable_1 = require(\"./queryable\");\nvar util_1 = require(\"../utils/util\");\nvar types_1 = require(\"./types\");\n/**\n * Describes a collection of Field objects\n *\n */\nvar Fields = (function (_super) {\n __extends(Fields, _super);\n /**\n * Creates a new instance of the Fields class\n *\n * @param baseUrl The url or Queryable which forms the parent of this fields collection\n */\n function Fields(baseUrl, path) {\n if (path === void 0) { path = \"fields\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * Gets a field from the collection by title\n *\n * @param title The case-sensitive title of the field\n */\n Fields.prototype.getByTitle = function (title) {\n return new Field(this, \"getByTitle('\" + title + \"')\");\n };\n /**\n * Gets a field from the collection by using internal name or title\n *\n * @param name The case-sensitive internal name or title of the field\n */\n Fields.prototype.getByInternalNameOrTitle = function (name) {\n return new Field(this, \"getByInternalNameOrTitle('\" + name + \"')\");\n };\n /**\n * Gets a list from the collection by guid id\n *\n * @param title The Id of the list\n */\n Fields.prototype.getById = function (id) {\n var f = new Field(this);\n f.concat(\"('\" + id + \"')\");\n return f;\n };\n /**\n * Creates a field based on the specified schema\n */\n Fields.prototype.createFieldAsXml = function (xml) {\n var _this = this;\n var info;\n if (typeof xml === \"string\") {\n info = { SchemaXml: xml };\n }\n else {\n info = xml;\n }\n var postBody = JSON.stringify({\n \"parameters\": util_1.Util.extend({\n \"__metadata\": {\n \"type\": \"SP.XmlSchemaFieldCreationInformation\",\n },\n }, info),\n });\n return this.clone(Fields, \"createfieldasxml\", true).postAs({ body: postBody }).then(function (data) {\n return {\n data: data,\n field: _this.getById(data.Id),\n };\n });\n };\n /**\n * Adds a new list to the collection\n *\n * @param title The new field's title\n * @param fieldType The new field's type (ex: SP.FieldText)\n * @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx)\n */\n Fields.prototype.add = function (title, fieldType, properties) {\n var _this = this;\n if (properties === void 0) { properties = {}; }\n var postBody = JSON.stringify(util_1.Util.extend({\n \"Title\": title,\n \"__metadata\": { \"type\": fieldType },\n }, properties));\n return this.clone(Fields, null, true).postAs({ body: postBody }).then(function (data) {\n return {\n data: data,\n field: _this.getById(data.Id),\n };\n });\n };\n /**\n * Adds a new SP.FieldText to the collection\n *\n * @param title The field title\n * @param maxLength The maximum number of characters allowed in the value of the field.\n * @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx)\n */\n Fields.prototype.addText = function (title, maxLength, properties) {\n if (maxLength === void 0) { maxLength = 255; }\n var props = {\n FieldTypeKind: 2,\n MaxLength: maxLength,\n };\n return this.add(title, \"SP.FieldText\", util_1.Util.extend(props, properties));\n };\n /**\n * Adds a new SP.FieldCalculated to the collection\n *\n * @param title The field title.\n * @param formula The formula for the field.\n * @param dateFormat The date and time format that is displayed in the field.\n * @param outputType Specifies the output format for the field. Represents a FieldType value.\n * @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx)\n */\n Fields.prototype.addCalculated = function (title, formula, dateFormat, outputType, properties) {\n if (outputType === void 0) { outputType = types_1.FieldTypes.Text; }\n var props = {\n DateFormat: dateFormat,\n FieldTypeKind: 17,\n Formula: formula,\n OutputType: outputType,\n };\n return this.add(title, \"SP.FieldCalculated\", util_1.Util.extend(props, properties));\n };\n /**\n * Adds a new SP.FieldDateTime to the collection\n *\n * @param title The field title\n * @param displayFormat The format of the date and time that is displayed in the field.\n * @param calendarType Specifies the calendar type of the field.\n * @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx)\n */\n Fields.prototype.addDateTime = function (title, displayFormat, calendarType, friendlyDisplayFormat, properties) {\n if (displayFormat === void 0) { displayFormat = types_1.DateTimeFieldFormatType.DateOnly; }\n if (calendarType === void 0) { calendarType = types_1.CalendarType.Gregorian; }\n if (friendlyDisplayFormat === void 0) { friendlyDisplayFormat = 0; }\n var props = {\n DateTimeCalendarType: calendarType,\n DisplayFormat: displayFormat,\n FieldTypeKind: 4,\n FriendlyDisplayFormat: friendlyDisplayFormat,\n };\n return this.add(title, \"SP.FieldDateTime\", util_1.Util.extend(props, properties));\n };\n /**\n * Adds a new SP.FieldNumber to the collection\n *\n * @param title The field title\n * @param minValue The field's minimum value\n * @param maxValue The field's maximum value\n * @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx)\n */\n Fields.prototype.addNumber = function (title, minValue, maxValue, properties) {\n var props = { FieldTypeKind: 9 };\n if (typeof minValue !== \"undefined\") {\n props = util_1.Util.extend({ MinimumValue: minValue }, props);\n }\n if (typeof maxValue !== \"undefined\") {\n props = util_1.Util.extend({ MaximumValue: maxValue }, props);\n }\n return this.add(title, \"SP.FieldNumber\", util_1.Util.extend(props, properties));\n };\n /**\n * Adds a new SP.FieldCurrency to the collection\n *\n * @param title The field title\n * @param minValue The field's minimum value\n * @param maxValue The field's maximum value\n * @param currencyLocalId Specifies the language code identifier (LCID) used to format the value of the field\n * @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx)\n */\n Fields.prototype.addCurrency = function (title, minValue, maxValue, currencyLocalId, properties) {\n if (currencyLocalId === void 0) { currencyLocalId = 1033; }\n var props = {\n CurrencyLocaleId: currencyLocalId,\n FieldTypeKind: 10,\n };\n if (typeof minValue !== \"undefined\") {\n props = util_1.Util.extend({ MinimumValue: minValue }, props);\n }\n if (typeof maxValue !== \"undefined\") {\n props = util_1.Util.extend({ MaximumValue: maxValue }, props);\n }\n return this.add(title, \"SP.FieldCurrency\", util_1.Util.extend(props, properties));\n };\n /**\n * Adds a new SP.FieldMultiLineText to the collection\n *\n * @param title The field title\n * @param numberOfLines Specifies the number of lines of text to display for the field.\n * @param richText Specifies whether the field supports rich formatting.\n * @param restrictedMode Specifies whether the field supports a subset of rich formatting.\n * @param appendOnly Specifies whether all changes to the value of the field are displayed in list forms.\n * @param allowHyperlink Specifies whether a hyperlink is allowed as a value of the field.\n * @param properties Differ by type of field being created (see: https://msdn.microsoft.com/en-us/library/office/dn600182.aspx)\n *\n */\n Fields.prototype.addMultilineText = function (title, numberOfLines, richText, restrictedMode, appendOnly, allowHyperlink, properties) {\n if (numberOfLines === void 0) { numberOfLines = 6; }\n if (richText === void 0) { richText = true; }\n if (restrictedMode === void 0) { restrictedMode = false; }\n if (appendOnly === void 0) { appendOnly = false; }\n if (allowHyperlink === void 0) { allowHyperlink = true; }\n var props = {\n AllowHyperlink: allowHyperlink,\n AppendOnly: appendOnly,\n FieldTypeKind: 3,\n NumberOfLines: numberOfLines,\n RestrictedMode: restrictedMode,\n RichText: richText,\n };\n return this.add(title, \"SP.FieldMultiLineText\", util_1.Util.extend(props, properties));\n };\n /**\n * Adds a new SP.FieldUrl to the collection\n *\n * @param title The field title\n */\n Fields.prototype.addUrl = function (title, displayFormat, properties) {\n if (displayFormat === void 0) { displayFormat = types_1.UrlFieldFormatType.Hyperlink; }\n var props = {\n DisplayFormat: displayFormat,\n FieldTypeKind: 11,\n };\n return this.add(title, \"SP.FieldUrl\", util_1.Util.extend(props, properties));\n };\n return Fields;\n}(queryable_1.QueryableCollection));\nexports.Fields = Fields;\n/**\n * Describes a single of Field instance\n *\n */\nvar Field = (function (_super) {\n __extends(Field, _super);\n function Field() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Updates this field intance with the supplied properties\n *\n * @param properties A plain object hash of values to update for the list\n * @param fieldType The type value, required to update child field type properties\n */\n Field.prototype.update = function (properties, fieldType) {\n var _this = this;\n if (fieldType === void 0) { fieldType = \"SP.Field\"; }\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": fieldType },\n }, properties));\n return this.post({\n body: postBody,\n headers: {\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n return {\n data: data,\n field: _this,\n };\n });\n };\n /**\n * Delete this fields\n *\n */\n Field.prototype.delete = function () {\n return this.post({\n headers: {\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n /**\n * Sets the value of the ShowInDisplayForm property for this field.\n */\n Field.prototype.setShowInDisplayForm = function (show) {\n return this.clone(Field, \"setshowindisplayform(\" + show + \")\", true).post();\n };\n /**\n * Sets the value of the ShowInEditForm property for this field.\n */\n Field.prototype.setShowInEditForm = function (show) {\n return this.clone(Field, \"setshowineditform(\" + show + \")\", true).post();\n };\n /**\n * Sets the value of the ShowInNewForm property for this field.\n */\n Field.prototype.setShowInNewForm = function (show) {\n return this.clone(Field, \"setshowinnewform(\" + show + \")\", true).post();\n };\n return Field;\n}(queryable_1.QueryableInstance));\nexports.Field = Field;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/sharepoint/fields.js\n// module id = 24\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar util_1 = require(\"../utils/util\");\nvar queryable_1 = require(\"./queryable\");\n/**\n * Represents a collection of navigation nodes\n *\n */\nvar NavigationNodes = (function (_super) {\n __extends(NavigationNodes, _super);\n function NavigationNodes() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Gets a navigation node by id\n *\n * @param id The id of the node\n */\n NavigationNodes.prototype.getById = function (id) {\n var node = new NavigationNode(this);\n node.concat(\"(\" + id + \")\");\n return node;\n };\n /**\n * Adds a new node to the collection\n *\n * @param title Display name of the node\n * @param url The url of the node\n * @param visible If true the node is visible, otherwise it is hidden (default: true)\n */\n NavigationNodes.prototype.add = function (title, url, visible) {\n var _this = this;\n if (visible === void 0) { visible = true; }\n var postBody = JSON.stringify({\n IsVisible: visible,\n Title: title,\n Url: url,\n \"__metadata\": { \"type\": \"SP.NavigationNode\" },\n });\n return this.clone(NavigationNodes, null, true).post({ body: postBody }).then(function (data) {\n return {\n data: data,\n node: _this.getById(data.Id),\n };\n });\n };\n /**\n * Moves a node to be after another node in the navigation\n *\n * @param nodeId Id of the node to move\n * @param previousNodeId Id of the node after which we move the node specified by nodeId\n */\n NavigationNodes.prototype.moveAfter = function (nodeId, previousNodeId) {\n var postBody = JSON.stringify({\n nodeId: nodeId,\n previousNodeId: previousNodeId,\n });\n return this.clone(NavigationNodes, \"MoveAfter\", true).post({ body: postBody });\n };\n return NavigationNodes;\n}(queryable_1.QueryableCollection));\nexports.NavigationNodes = NavigationNodes;\nvar NavigationNode = (function (_super) {\n __extends(NavigationNode, _super);\n function NavigationNode() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(NavigationNode.prototype, \"children\", {\n /**\n * Represents the child nodes of this node\n */\n get: function () {\n return new NavigationNodes(this, \"Children\");\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Updates this node based on the supplied properties\n *\n * @param properties The hash of key/value pairs to update\n */\n NavigationNode.prototype.update = function (properties) {\n var _this = this;\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": \"SP.NavigationNode\" },\n }, properties));\n return this.post({\n body: postBody,\n headers: {\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n return {\n data: data,\n node: _this,\n };\n });\n };\n /**\n * Deletes this node and any child nodes\n */\n NavigationNode.prototype.delete = function () {\n return _super.prototype.delete.call(this);\n };\n return NavigationNode;\n}(queryable_1.QueryableInstance));\nexports.NavigationNode = NavigationNode;\n/**\n * Exposes the navigation components\n *\n */\nvar Navigation = (function (_super) {\n __extends(Navigation, _super);\n /**\n * Creates a new instance of the Lists class\n *\n * @param baseUrl The url or Queryable which forms the parent of this fields collection\n */\n function Navigation(baseUrl, path) {\n if (path === void 0) { path = \"navigation\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n Object.defineProperty(Navigation.prototype, \"quicklaunch\", {\n /**\n * Gets the quicklaunch navigation for the current context\n *\n */\n get: function () {\n return new NavigationNodes(this, \"quicklaunch\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Navigation.prototype, \"topNavigationBar\", {\n /**\n * Gets the top bar navigation navigation for the current context\n *\n */\n get: function () {\n return new NavigationNodes(this, \"topnavigationbar\");\n },\n enumerable: true,\n configurable: true\n });\n return Navigation;\n}(queryable_1.Queryable));\nexports.Navigation = Navigation;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/sharepoint/navigation.js\n// module id = 25\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar webs_1 = require(\"./webs\");\nvar roles_1 = require(\"./roles\");\nvar types_1 = require(\"./types\");\nvar queryable_1 = require(\"./queryable\");\nvar QueryableSecurable = (function (_super) {\n __extends(QueryableSecurable, _super);\n function QueryableSecurable() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(QueryableSecurable.prototype, \"roleAssignments\", {\n /**\n * Gets the set of role assignments for this item\n *\n */\n get: function () {\n return new roles_1.RoleAssignments(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(QueryableSecurable.prototype, \"firstUniqueAncestorSecurableObject\", {\n /**\n * Gets the closest securable up the security hierarchy whose permissions are applied to this list item\n *\n */\n get: function () {\n return new queryable_1.QueryableInstance(this, \"FirstUniqueAncestorSecurableObject\");\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Gets the effective permissions for the user supplied\n *\n * @param loginName The claims username for the user (ex: i:0#.f|membership|user@domain.com)\n */\n QueryableSecurable.prototype.getUserEffectivePermissions = function (loginName) {\n var q = this.clone(queryable_1.Queryable, \"getUserEffectivePermissions(@user)\", true);\n q.query.add(\"@user\", \"'\" + encodeURIComponent(loginName) + \"'\");\n return q.getAs();\n };\n /**\n * Gets the effective permissions for the current user\n */\n QueryableSecurable.prototype.getCurrentUserEffectivePermissions = function () {\n var _this = this;\n var w = webs_1.Web.fromUrl(this.toUrl());\n return w.currentUser.select(\"LoginName\").getAs().then(function (user) {\n return _this.getUserEffectivePermissions(user.LoginName);\n });\n };\n /**\n * Breaks the security inheritance at this level optinally copying permissions and clearing subscopes\n *\n * @param copyRoleAssignments If true the permissions are copied from the current parent scope\n * @param clearSubscopes Optional. true to make all child securable objects inherit role assignments from the current object\n */\n QueryableSecurable.prototype.breakRoleInheritance = function (copyRoleAssignments, clearSubscopes) {\n if (copyRoleAssignments === void 0) { copyRoleAssignments = false; }\n if (clearSubscopes === void 0) { clearSubscopes = false; }\n return this.clone(QueryableSecurable, \"breakroleinheritance(copyroleassignments=\" + copyRoleAssignments + \", clearsubscopes=\" + clearSubscopes + \")\", true).post();\n };\n /**\n * Removes the local role assignments so that it re-inherit role assignments from the parent object.\n *\n */\n QueryableSecurable.prototype.resetRoleInheritance = function () {\n return this.clone(QueryableSecurable, \"resetroleinheritance\", true).post();\n };\n /**\n * Determines if a given user has the appropriate permissions\n *\n * @param loginName The user to check\n * @param permission The permission being checked\n */\n QueryableSecurable.prototype.userHasPermissions = function (loginName, permission) {\n var _this = this;\n return this.getUserEffectivePermissions(loginName).then(function (perms) {\n return _this.hasPermissions(perms, permission);\n });\n };\n /**\n * Determines if the current user has the requested permissions\n *\n * @param permission The permission we wish to check\n */\n QueryableSecurable.prototype.currentUserHasPermissions = function (permission) {\n var _this = this;\n return this.getCurrentUserEffectivePermissions().then(function (perms) {\n return _this.hasPermissions(perms, permission);\n });\n };\n /**\n * Taken from sp.js, checks the supplied permissions against the mask\n *\n * @param value The security principal's permissions on the given object\n * @param perm The permission checked against the value\n */\n /* tslint:disable:no-bitwise */\n QueryableSecurable.prototype.hasPermissions = function (value, perm) {\n if (!perm) {\n return true;\n }\n if (perm === types_1.PermissionKind.FullMask) {\n return (value.High & 32767) === 32767 && value.Low === 65535;\n }\n perm = perm - 1;\n var num = 1;\n if (perm >= 0 && perm < 32) {\n num = num << perm;\n return 0 !== (value.Low & num);\n }\n else if (perm >= 32 && perm < 64) {\n num = num << perm - 32;\n return 0 !== (value.High & num);\n }\n return false;\n };\n return QueryableSecurable;\n}(queryable_1.QueryableInstance));\nexports.QueryableSecurable = QueryableSecurable;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/sharepoint/queryablesecurable.js\n// module id = 26\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar queryable_1 = require(\"./queryable\");\nvar util_1 = require(\"../utils/util\");\n/**\n * Describes the search API\n *\n */\nvar Search = (function (_super) {\n __extends(Search, _super);\n /**\n * Creates a new instance of the Search class\n *\n * @param baseUrl The url for the search context\n * @param query The SearchQuery object to execute\n */\n function Search(baseUrl, path) {\n if (path === void 0) { path = \"_api/search/postquery\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * .......\n * @returns Promise\n */\n Search.prototype.execute = function (query) {\n var formattedBody;\n formattedBody = query;\n if (formattedBody.SelectProperties) {\n formattedBody.SelectProperties = { results: query.SelectProperties };\n }\n if (formattedBody.RefinementFilters) {\n formattedBody.RefinementFilters = { results: query.RefinementFilters };\n }\n if (formattedBody.SortList) {\n formattedBody.SortList = { results: query.SortList };\n }\n if (formattedBody.HithighlightedProperties) {\n formattedBody.HithighlightedProperties = { results: query.HithighlightedProperties };\n }\n if (formattedBody.ReorderingRules) {\n formattedBody.ReorderingRules = { results: query.ReorderingRules };\n }\n if (formattedBody.Properties) {\n formattedBody.Properties = { results: query.Properties };\n }\n var postBody = JSON.stringify({\n request: util_1.Util.extend({\n \"__metadata\": { \"type\": \"Microsoft.Office.Server.Search.REST.SearchRequest\" },\n }, formattedBody),\n });\n return this.post({ body: postBody }).then(function (data) { return new SearchResults(data); });\n };\n return Search;\n}(queryable_1.QueryableInstance));\nexports.Search = Search;\n/**\n * Describes the SearchResults class, which returns the formatted and raw version of the query response\n */\nvar SearchResults = (function () {\n /**\n * Creates a new instance of the SearchResult class\n *\n */\n function SearchResults(rawResponse) {\n var response = rawResponse.postquery ? rawResponse.postquery : rawResponse;\n this.PrimarySearchResults = this.formatSearchResults(response.PrimaryQueryResult.RelevantResults.Table.Rows);\n this.RawSearchResults = response;\n this.ElapsedTime = response.ElapsedTime;\n this.RowCount = response.PrimaryQueryResult.RelevantResults.RowCount;\n this.TotalRows = response.PrimaryQueryResult.RelevantResults.TotalRows;\n this.TotalRowsIncludingDuplicates = response.PrimaryQueryResult.RelevantResults.TotalRowsIncludingDuplicates;\n }\n /**\n * Formats a search results array\n *\n * @param rawResults The array to process\n */\n SearchResults.prototype.formatSearchResults = function (rawResults) {\n var results = new Array(), tempResults = rawResults.results ? rawResults.results : rawResults;\n for (var _i = 0, tempResults_1 = tempResults; _i < tempResults_1.length; _i++) {\n var i = tempResults_1[_i];\n results.push(new SearchResult(i.Cells));\n }\n return results;\n };\n return SearchResults;\n}());\nexports.SearchResults = SearchResults;\n/**\n * Describes the SearchResult class\n */\nvar SearchResult = (function () {\n /**\n * Creates a new instance of the SearchResult class\n *\n */\n function SearchResult(rawItem) {\n var item = rawItem.results ? rawItem.results : rawItem;\n for (var _i = 0, item_1 = item; _i < item_1.length; _i++) {\n var i = item_1[_i];\n Object.defineProperty(this, i.Key, {\n configurable: false,\n enumerable: false,\n value: i.Value,\n writable: false,\n });\n }\n }\n return SearchResult;\n}());\nexports.SearchResult = SearchResult;\n/**\n * defines the SortDirection enum\n */\nvar SortDirection;\n(function (SortDirection) {\n SortDirection[SortDirection[\"Ascending\"] = 0] = \"Ascending\";\n SortDirection[SortDirection[\"Descending\"] = 1] = \"Descending\";\n SortDirection[SortDirection[\"FQLFormula\"] = 2] = \"FQLFormula\";\n})(SortDirection = exports.SortDirection || (exports.SortDirection = {}));\n/**\n * defines the ReorderingRuleMatchType enum\n */\nvar ReorderingRuleMatchType;\n(function (ReorderingRuleMatchType) {\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"ResultContainsKeyword\"] = 0] = \"ResultContainsKeyword\";\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"TitleContainsKeyword\"] = 1] = \"TitleContainsKeyword\";\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"TitleMatchesKeyword\"] = 2] = \"TitleMatchesKeyword\";\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"UrlStartsWith\"] = 3] = \"UrlStartsWith\";\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"UrlExactlyMatches\"] = 4] = \"UrlExactlyMatches\";\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"ContentTypeIs\"] = 5] = \"ContentTypeIs\";\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"FileExtensionMatches\"] = 6] = \"FileExtensionMatches\";\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"ResultHasTag\"] = 7] = \"ResultHasTag\";\n ReorderingRuleMatchType[ReorderingRuleMatchType[\"ManualCondition\"] = 8] = \"ManualCondition\";\n})(ReorderingRuleMatchType = exports.ReorderingRuleMatchType || (exports.ReorderingRuleMatchType = {}));\n/**\n * Specifies the type value for the property\n */\nvar QueryPropertyValueType;\n(function (QueryPropertyValueType) {\n QueryPropertyValueType[QueryPropertyValueType[\"None\"] = 0] = \"None\";\n QueryPropertyValueType[QueryPropertyValueType[\"StringType\"] = 1] = \"StringType\";\n QueryPropertyValueType[QueryPropertyValueType[\"Int32TYpe\"] = 2] = \"Int32TYpe\";\n QueryPropertyValueType[QueryPropertyValueType[\"BooleanType\"] = 3] = \"BooleanType\";\n QueryPropertyValueType[QueryPropertyValueType[\"StringArrayType\"] = 4] = \"StringArrayType\";\n QueryPropertyValueType[QueryPropertyValueType[\"UnSupportedType\"] = 5] = \"UnSupportedType\";\n})(QueryPropertyValueType = exports.QueryPropertyValueType || (exports.QueryPropertyValueType = {}));\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/sharepoint/search.js\n// module id = 27\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar queryable_1 = require(\"./queryable\");\nvar SearchSuggest = (function (_super) {\n __extends(SearchSuggest, _super);\n function SearchSuggest(baseUrl, path) {\n if (path === void 0) { path = \"_api/search/suggest\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n SearchSuggest.prototype.execute = function (query) {\n this.mapQueryToQueryString(query);\n return this.get().then(function (response) { return new SearchSuggestResult(response); });\n };\n SearchSuggest.prototype.mapQueryToQueryString = function (query) {\n this.query.add(\"querytext\", \"'\" + query.querytext + \"'\");\n if (query.hasOwnProperty(\"count\")) {\n this.query.add(\"inumberofquerysuggestions\", query.count.toString());\n }\n if (query.hasOwnProperty(\"personalCount\")) {\n this.query.add(\"inumberofresultsuggestions\", query.personalCount.toString());\n }\n if (query.hasOwnProperty(\"preQuery\")) {\n this.query.add(\"fprequerysuggestions\", query.preQuery.toString());\n }\n if (query.hasOwnProperty(\"hitHighlighting\")) {\n this.query.add(\"fhithighlighting\", query.hitHighlighting.toString());\n }\n if (query.hasOwnProperty(\"capitalize\")) {\n this.query.add(\"fcapitalizefirstletters\", query.capitalize.toString());\n }\n if (query.hasOwnProperty(\"culture\")) {\n this.query.add(\"culture\", query.culture.toString());\n }\n if (query.hasOwnProperty(\"stemming\")) {\n this.query.add(\"enablestemming\", query.stemming.toString());\n }\n if (query.hasOwnProperty(\"includePeople\")) {\n this.query.add(\"showpeoplenamesuggestions\", query.includePeople.toString());\n }\n if (query.hasOwnProperty(\"queryRules\")) {\n this.query.add(\"enablequeryrules\", query.queryRules.toString());\n }\n if (query.hasOwnProperty(\"prefixMatch\")) {\n this.query.add(\"fprefixmatchallterms\", query.prefixMatch.toString());\n }\n };\n return SearchSuggest;\n}(queryable_1.QueryableInstance));\nexports.SearchSuggest = SearchSuggest;\nvar SearchSuggestResult = (function () {\n function SearchSuggestResult(json) {\n if (json.hasOwnProperty(\"suggest\")) {\n // verbose\n this.PeopleNames = json.suggest.PeopleNames.results;\n this.PersonalResults = json.suggest.PersonalResults.results;\n this.Queries = json.suggest.Queries.results;\n }\n else {\n this.PeopleNames = json.PeopleNames;\n this.PersonalResults = json.PersonalResults;\n this.Queries = json.Queries;\n }\n }\n return SearchSuggestResult;\n}());\nexports.SearchSuggestResult = SearchSuggestResult;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/sharepoint/searchsuggest.js\n// module id = 28\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar queryable_1 = require(\"./queryable\");\nvar webs_1 = require(\"./webs\");\nvar usercustomactions_1 = require(\"./usercustomactions\");\nvar odata_1 = require(\"./odata\");\nvar features_1 = require(\"./features\");\n/**\n * Describes a site collection\n *\n */\nvar Site = (function (_super) {\n __extends(Site, _super);\n /**\n * Creates a new instance of the RoleAssignments class\n *\n * @param baseUrl The url or Queryable which forms the parent of this fields collection\n */\n function Site(baseUrl, path) {\n if (path === void 0) { path = \"_api/site\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n Object.defineProperty(Site.prototype, \"rootWeb\", {\n /**\n * Gets the root web of the site collection\n *\n */\n get: function () {\n return new webs_1.Web(this, \"rootweb\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Site.prototype, \"features\", {\n /**\n * Gets the active features for this site\n *\n */\n get: function () {\n return new features_1.Features(this);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Site.prototype, \"userCustomActions\", {\n /**\n * Get all custom actions on a site collection\n *\n */\n get: function () {\n return new usercustomactions_1.UserCustomActions(this);\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Gets the context information for the site.\n */\n Site.prototype.getContextInfo = function () {\n var q = new Site(this.parentUrl, \"_api/contextinfo\");\n return q.post().then(function (data) {\n if (data.hasOwnProperty(\"GetContextWebInformation\")) {\n var info = data.GetContextWebInformation;\n info.SupportedSchemaVersions = info.SupportedSchemaVersions.results;\n return info;\n }\n else {\n return data;\n }\n });\n };\n /**\n * Gets the document libraries on a site. Static method. (SharePoint Online only)\n *\n * @param absoluteWebUrl The absolute url of the web whose document libraries should be returned\n */\n Site.prototype.getDocumentLibraries = function (absoluteWebUrl) {\n var q = new queryable_1.Queryable(\"\", \"_api/sp.web.getdocumentlibraries(@v)\");\n q.query.add(\"@v\", \"'\" + absoluteWebUrl + \"'\");\n return q.get().then(function (data) {\n if (data.hasOwnProperty(\"GetDocumentLibraries\")) {\n return data.GetDocumentLibraries;\n }\n else {\n return data;\n }\n });\n };\n /**\n * Gets the site URL from a page URL.\n *\n * @param absolutePageUrl The absolute url of the page\n */\n Site.prototype.getWebUrlFromPageUrl = function (absolutePageUrl) {\n var q = new queryable_1.Queryable(\"\", \"_api/sp.web.getweburlfrompageurl(@v)\");\n q.query.add(\"@v\", \"'\" + absolutePageUrl + \"'\");\n return q.get().then(function (data) {\n if (data.hasOwnProperty(\"GetWebUrlFromPageUrl\")) {\n return data.GetWebUrlFromPageUrl;\n }\n else {\n return data;\n }\n });\n };\n /**\n * Creates a new batch for requests within the context of context this site\n *\n */\n Site.prototype.createBatch = function () {\n return new odata_1.ODataBatch(this.parentUrl);\n };\n return Site;\n}(queryable_1.QueryableInstance));\nexports.Site = Site;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/sharepoint/site.js\n// module id = 29\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar queryable_1 = require(\"./queryable\");\nvar sitegroups_1 = require(\"./sitegroups\");\nvar util_1 = require(\"../utils/util\");\n/**\n * Describes a collection of all site collection users\n *\n */\nvar SiteUsers = (function (_super) {\n __extends(SiteUsers, _super);\n /**\n * Creates a new instance of the Users class\n *\n * @param baseUrl The url or Queryable which forms the parent of this user collection\n */\n function SiteUsers(baseUrl, path) {\n if (path === void 0) { path = \"siteusers\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * Gets a user from the collection by email\n *\n * @param email The email of the user\n */\n SiteUsers.prototype.getByEmail = function (email) {\n return new SiteUser(this, \"getByEmail('\" + email + \"')\");\n };\n /**\n * Gets a user from the collection by id\n *\n * @param id The id of the user\n */\n SiteUsers.prototype.getById = function (id) {\n return new SiteUser(this, \"getById(\" + id + \")\");\n };\n /**\n * Gets a user from the collection by login name\n *\n * @param loginName The email address of the user\n */\n SiteUsers.prototype.getByLoginName = function (loginName) {\n var su = new SiteUser(this);\n su.concat(\"(@v)\");\n su.query.add(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\n return su;\n };\n /**\n * Removes a user from the collection by id\n *\n * @param id The id of the user\n */\n SiteUsers.prototype.removeById = function (id) {\n return this.clone(SiteUsers, \"removeById(\" + id + \")\", true).post();\n };\n /**\n * Removes a user from the collection by login name\n *\n * @param loginName The login name of the user\n */\n SiteUsers.prototype.removeByLoginName = function (loginName) {\n var o = this.clone(SiteUsers, \"removeByLoginName(@v)\", true);\n o.query.add(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\n return o.post();\n };\n /**\n * Add a user to a group\n *\n * @param loginName The login name of the user to add to the group\n *\n */\n SiteUsers.prototype.add = function (loginName) {\n var _this = this;\n return this.clone(SiteUsers, null, true).post({\n body: JSON.stringify({ \"__metadata\": { \"type\": \"SP.User\" }, LoginName: loginName }),\n }).then(function () { return _this.getByLoginName(loginName); });\n };\n return SiteUsers;\n}(queryable_1.QueryableCollection));\nexports.SiteUsers = SiteUsers;\n/**\n * Describes a single user\n *\n */\nvar SiteUser = (function (_super) {\n __extends(SiteUser, _super);\n function SiteUser() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(SiteUser.prototype, \"groups\", {\n /**\n * Get's the groups for this user.\n *\n */\n get: function () {\n return new sitegroups_1.SiteGroups(this, \"groups\");\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Updates this user instance with the supplied properties\n *\n * @param properties A plain object of property names and values to update for the user\n */\n SiteUser.prototype.update = function (properties) {\n var _this = this;\n var postBody = util_1.Util.extend({ \"__metadata\": { \"type\": \"SP.User\" } }, properties);\n return this.post({\n body: JSON.stringify(postBody),\n headers: {\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n return {\n data: data,\n user: _this,\n };\n });\n };\n /**\n * Delete this user\n *\n */\n SiteUser.prototype.delete = function () {\n return this.post({\n headers: {\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n return SiteUser;\n}(queryable_1.QueryableInstance));\nexports.SiteUser = SiteUser;\n/**\n * Represents the current user\n */\nvar CurrentUser = (function (_super) {\n __extends(CurrentUser, _super);\n function CurrentUser(baseUrl, path) {\n if (path === void 0) { path = \"currentuser\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n return CurrentUser;\n}(queryable_1.QueryableInstance));\nexports.CurrentUser = CurrentUser;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/sharepoint/siteusers.js\n// module id = 30\n// module chunks = 0","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar logging_1 = require(\"./logging\");\nfunction deprecated(message) {\n return function (target, propertyKey, descriptor) {\n var method = descriptor.value;\n descriptor.value = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n logging_1.Logger.log({\n data: {\n descriptor: descriptor,\n propertyKey: propertyKey,\n target: target,\n },\n level: logging_1.LogLevel.Warning,\n message: message,\n });\n return method.apply(this, args);\n };\n };\n}\nexports.deprecated = deprecated;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/utils/decorators.js\n// module id = 31\n// module chunks = 0","var g;\r\n\r\n// This works in non-strict mode\r\ng = (function() {\r\n\treturn this;\r\n})();\r\n\r\ntry {\r\n\t// This works if eval is allowed (see CSP)\r\n\tg = g || Function(\"return this\")() || (1,eval)(\"this\");\r\n} catch(e) {\r\n\t// This works if the window reference is available\r\n\tif(typeof window === \"object\")\r\n\t\tg = window;\r\n}\r\n\r\n// g can still be undefined, but nothing to do about it...\r\n// We return undefined, instead of nothing here, so it's\r\n// easier to handle this case. if(!global) { ...}\r\n\r\nmodule.exports = g;\r\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// (webpack)/buildin/global.js\n// module id = 32\n// module chunks = 0","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar collections_1 = require(\"../collections/collections\");\n/**\n * Class used to manage the current application settings\n *\n */\nvar Settings = (function () {\n /**\n * Creates a new instance of the settings class\n *\n * @constructor\n */\n function Settings() {\n this._settings = new collections_1.Dictionary();\n }\n /**\n * Adds a new single setting, or overwrites a previous setting with the same key\n *\n * @param {string} key The key used to store this setting\n * @param {string} value The setting value to store\n */\n Settings.prototype.add = function (key, value) {\n this._settings.add(key, value);\n };\n /**\n * Adds a JSON value to the collection as a string, you must use getJSON to rehydrate the object when read\n *\n * @param {string} key The key used to store this setting\n * @param {any} value The setting value to store\n */\n Settings.prototype.addJSON = function (key, value) {\n this._settings.add(key, JSON.stringify(value));\n };\n /**\n * Applies the supplied hash to the setting collection overwriting any existing value, or created new values\n *\n * @param {TypedHash} hash The set of values to add\n */\n Settings.prototype.apply = function (hash) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n try {\n _this._settings.merge(hash);\n resolve();\n }\n catch (e) {\n reject(e);\n }\n });\n };\n /**\n * Loads configuration settings into the collection from the supplied provider and returns a Promise\n *\n * @param {IConfigurationProvider} provider The provider from which we will load the settings\n */\n Settings.prototype.load = function (provider) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n provider.getConfiguration().then(function (value) {\n _this._settings.merge(value);\n resolve();\n }).catch(function (reason) {\n reject(reason);\n });\n });\n };\n /**\n * Gets a value from the configuration\n *\n * @param {string} key The key whose value we want to return. Returns null if the key does not exist\n * @return {string} string value from the configuration\n */\n Settings.prototype.get = function (key) {\n return this._settings.get(key);\n };\n /**\n * Gets a JSON value, rehydrating the stored string to the original object\n *\n * @param {string} key The key whose value we want to return. Returns null if the key does not exist\n * @return {any} object from the configuration\n */\n Settings.prototype.getJSON = function (key) {\n var o = this.get(key);\n if (typeof o === \"undefined\" || o === null) {\n return o;\n }\n return JSON.parse(o);\n };\n return Settings;\n}());\nexports.Settings = Settings;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/configuration/configuration.js\n// module id = 33\n// module chunks = 0","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar search_1 = require(\"./search\");\nvar searchsuggest_1 = require(\"./searchsuggest\");\nvar site_1 = require(\"./site\");\nvar webs_1 = require(\"./webs\");\nvar util_1 = require(\"../utils/util\");\nvar userprofiles_1 = require(\"./userprofiles\");\nvar exceptions_1 = require(\"../utils/exceptions\");\n/**\n * Root of the SharePoint REST module\n */\nvar Rest = (function () {\n function Rest() {\n }\n /**\n * Executes a search against this web context\n *\n * @param query The SearchQuery definition\n */\n Rest.prototype.searchSuggest = function (query) {\n var finalQuery;\n if (typeof query === \"string\") {\n finalQuery = { querytext: query };\n }\n else {\n finalQuery = query;\n }\n return new searchsuggest_1.SearchSuggest(\"\").execute(finalQuery);\n };\n /**\n * Executes a search against this web context\n *\n * @param query The SearchQuery definition\n */\n Rest.prototype.search = function (query) {\n var finalQuery;\n if (typeof query === \"string\") {\n finalQuery = { Querytext: query };\n }\n else {\n finalQuery = query;\n }\n return new search_1.Search(\"\").execute(finalQuery);\n };\n Object.defineProperty(Rest.prototype, \"site\", {\n /**\n * Begins a site collection scoped REST request\n *\n */\n get: function () {\n return new site_1.Site(\"\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Rest.prototype, \"web\", {\n /**\n * Begins a web scoped REST request\n *\n */\n get: function () {\n return new webs_1.Web(\"\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Rest.prototype, \"profiles\", {\n /**\n * Access to user profile methods\n *\n */\n get: function () {\n return new userprofiles_1.UserProfileQuery(\"\");\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Creates a new batch object for use with the Queryable.addToBatch method\n *\n */\n Rest.prototype.createBatch = function () {\n return this.web.createBatch();\n };\n /**\n * Begins a cross-domain, host site scoped REST request, for use in add-in webs\n *\n * @param addInWebUrl The absolute url of the add-in web\n * @param hostWebUrl The absolute url of the host web\n */\n Rest.prototype.crossDomainSite = function (addInWebUrl, hostWebUrl) {\n return this._cdImpl(site_1.Site, addInWebUrl, hostWebUrl, \"site\");\n };\n /**\n * Begins a cross-domain, host web scoped REST request, for use in add-in webs\n *\n * @param addInWebUrl The absolute url of the add-in web\n * @param hostWebUrl The absolute url of the host web\n */\n Rest.prototype.crossDomainWeb = function (addInWebUrl, hostWebUrl) {\n return this._cdImpl(webs_1.Web, addInWebUrl, hostWebUrl, \"web\");\n };\n /**\n * Implements the creation of cross domain REST urls\n *\n * @param factory The constructor of the object to create Site | Web\n * @param addInWebUrl The absolute url of the add-in web\n * @param hostWebUrl The absolute url of the host web\n * @param urlPart String part to append to the url \"site\" | \"web\"\n */\n Rest.prototype._cdImpl = function (factory, addInWebUrl, hostWebUrl, urlPart) {\n if (!util_1.Util.isUrlAbsolute(addInWebUrl)) {\n throw new exceptions_1.UrlException(\"The addInWebUrl parameter must be an absolute url.\");\n }\n if (!util_1.Util.isUrlAbsolute(hostWebUrl)) {\n throw new exceptions_1.UrlException(\"The hostWebUrl parameter must be an absolute url.\");\n }\n var url = util_1.Util.combinePaths(addInWebUrl, \"_api/SP.AppContextSite(@target)\");\n var instance = new factory(url, urlPart);\n instance.query.add(\"@target\", \"'\" + encodeURIComponent(hostWebUrl) + \"'\");\n return instance;\n };\n return Rest;\n}());\nexports.Rest = Rest;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/sharepoint/rest.js\n// module id = 34\n// module chunks = 0","\"use strict\";\nfunction __export(m) {\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\n}\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__export(require(\"../sharepoint/index\"));\nvar httpclient_1 = require(\"../net/httpclient\");\nexports.HttpClient = httpclient_1.HttpClient;\nvar sprequestexecutorclient_1 = require(\"../net/sprequestexecutorclient\");\nexports.SPRequestExecutorClient = sprequestexecutorclient_1.SPRequestExecutorClient;\nvar nodefetchclient_1 = require(\"../net/nodefetchclient\");\nexports.NodeFetchClient = nodefetchclient_1.NodeFetchClient;\nvar fetchclient_1 = require(\"../net/fetchclient\");\nexports.FetchClient = fetchclient_1.FetchClient;\n__export(require(\"../configuration/providers/index\"));\nvar collections_1 = require(\"../collections/collections\");\nexports.Dictionary = collections_1.Dictionary;\nvar util_1 = require(\"../utils/util\");\nexports.Util = util_1.Util;\n__export(require(\"../utils/logging\"));\n__export(require(\"../utils/exceptions\"));\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/types/index.js\n// module id = 35\n// module chunks = 0","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar cachingConfigurationProvider_1 = require(\"./cachingConfigurationProvider\");\nexports.CachingConfigurationProvider = cachingConfigurationProvider_1.default;\nvar spListConfigurationProvider_1 = require(\"./spListConfigurationProvider\");\nexports.SPListConfigurationProvider = spListConfigurationProvider_1.default;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/configuration/providers/index.js\n// module id = 36\n// module chunks = 0","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar cachingConfigurationProvider_1 = require(\"./cachingConfigurationProvider\");\n/**\n * A configuration provider which loads configuration values from a SharePoint list\n *\n */\nvar SPListConfigurationProvider = (function () {\n /**\n * Creates a new SharePoint list based configuration provider\n * @constructor\n * @param {string} webUrl Url of the SharePoint site, where the configuration list is located\n * @param {string} listTitle Title of the SharePoint list, which contains the configuration settings (optional, default = \"config\")\n */\n function SPListConfigurationProvider(sourceWeb, sourceListTitle) {\n if (sourceListTitle === void 0) { sourceListTitle = \"config\"; }\n this.sourceWeb = sourceWeb;\n this.sourceListTitle = sourceListTitle;\n }\n Object.defineProperty(SPListConfigurationProvider.prototype, \"web\", {\n /**\n * Gets the url of the SharePoint site, where the configuration list is located\n *\n * @return {string} Url address of the site\n */\n get: function () {\n return this.sourceWeb;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SPListConfigurationProvider.prototype, \"listTitle\", {\n /**\n * Gets the title of the SharePoint list, which contains the configuration settings\n *\n * @return {string} List title\n */\n get: function () {\n return this.sourceListTitle;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Loads the configuration values from the SharePoint list\n *\n * @return {Promise>} Promise of loaded configuration values\n */\n SPListConfigurationProvider.prototype.getConfiguration = function () {\n return this.web.lists.getByTitle(this.listTitle).items.select(\"Title\", \"Value\")\n .getAs().then(function (data) {\n return data.reduce(function (configuration, item) {\n return Object.defineProperty(configuration, item.Title, {\n configurable: false,\n enumerable: false,\n value: item.Value,\n writable: false,\n });\n }, {});\n });\n };\n /**\n * Wraps the current provider in a cache enabled provider\n *\n * @return {CachingConfigurationProvider} Caching providers which wraps the current provider\n */\n SPListConfigurationProvider.prototype.asCaching = function () {\n var cacheKey = \"splist_\" + this.web.toUrl() + \"+\" + this.listTitle;\n return new cachingConfigurationProvider_1.default(this, cacheKey);\n };\n return SPListConfigurationProvider;\n}());\nexports.default = SPListConfigurationProvider;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/configuration/providers/spListConfigurationProvider.js\n// module id = 37\n// module chunks = 0","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar collections_1 = require(\"../collections/collections\");\nvar util_1 = require(\"../utils/util\");\nvar odata_1 = require(\"../sharepoint/odata\");\nvar CachedDigest = (function () {\n function CachedDigest() {\n }\n return CachedDigest;\n}());\nexports.CachedDigest = CachedDigest;\n// allows for the caching of digests across all HttpClient's which each have their own DigestCache wrapper.\nvar digests = new collections_1.Dictionary();\nvar DigestCache = (function () {\n function DigestCache(_httpClient, _digests) {\n if (_digests === void 0) { _digests = digests; }\n this._httpClient = _httpClient;\n this._digests = _digests;\n }\n DigestCache.prototype.getDigest = function (webUrl) {\n var _this = this;\n var cachedDigest = this._digests.get(webUrl);\n if (cachedDigest !== null) {\n var now = new Date();\n if (now < cachedDigest.expiration) {\n return Promise.resolve(cachedDigest.value);\n }\n }\n var url = util_1.Util.combinePaths(webUrl, \"/_api/contextinfo\");\n return this._httpClient.fetchRaw(url, {\n cache: \"no-cache\",\n credentials: \"same-origin\",\n headers: {\n \"Accept\": \"application/json;odata=verbose\",\n \"Content-type\": \"application/json;odata=verbose;charset=utf-8\",\n },\n method: \"POST\",\n }).then(function (response) {\n var parser = new odata_1.ODataDefaultParser();\n return parser.parse(response).then(function (d) { return d.GetContextWebInformation; });\n }).then(function (data) {\n var newCachedDigest = new CachedDigest();\n newCachedDigest.value = data.FormDigestValue;\n var seconds = data.FormDigestTimeoutSeconds;\n var expiration = new Date();\n expiration.setTime(expiration.getTime() + 1000 * seconds);\n newCachedDigest.expiration = expiration;\n _this._digests.add(webUrl, newCachedDigest);\n return newCachedDigest.value;\n });\n };\n DigestCache.prototype.clear = function () {\n this._digests.clear();\n };\n return DigestCache;\n}());\nexports.DigestCache = DigestCache;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/net/digestcache.js\n// module id = 38\n// module chunks = 0","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar exceptions_1 = require(\"../utils/exceptions\");\n/**\n * This module is substituted for the NodeFetchClient.ts during the packaging process. This helps to reduce the pnp.js file size by\n * not including all of the node dependencies\n */\nvar NodeFetchClient = (function () {\n function NodeFetchClient() {\n }\n /**\n * Always throws an error that NodeFetchClient is not supported for use in the browser\n */\n NodeFetchClient.prototype.fetch = function () {\n throw new exceptions_1.NodeFetchClientUnsupportedException();\n };\n return NodeFetchClient;\n}());\nexports.NodeFetchClient = NodeFetchClient;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/net/nodefetchclientbrowser.js\n// module id = 39\n// module chunks = 0","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar util_1 = require(\"../utils/util\");\nvar exceptions_1 = require(\"../utils/exceptions\");\n/**\n * Makes requests using the SP.RequestExecutor library.\n */\nvar SPRequestExecutorClient = (function () {\n function SPRequestExecutorClient() {\n /**\n * Converts a SharePoint REST API response to a fetch API response.\n */\n this.convertToResponse = function (spResponse) {\n var responseHeaders = new Headers();\n for (var h in spResponse.headers) {\n if (spResponse.headers[h]) {\n responseHeaders.append(h, spResponse.headers[h]);\n }\n }\n // issue #256, Cannot have an empty string body when creating a Response with status 204\n var body = spResponse.statusCode === 204 ? null : spResponse.body;\n return new Response(body, {\n headers: responseHeaders,\n status: spResponse.statusCode,\n statusText: spResponse.statusText,\n });\n };\n }\n /**\n * Fetches a URL using the SP.RequestExecutor library.\n */\n SPRequestExecutorClient.prototype.fetch = function (url, options) {\n var _this = this;\n if (typeof SP === \"undefined\" || typeof SP.RequestExecutor === \"undefined\") {\n throw new exceptions_1.SPRequestExecutorUndefinedException();\n }\n var addinWebUrl = url.substring(0, url.indexOf(\"/_api\")), executor = new SP.RequestExecutor(addinWebUrl);\n var headers = {}, iterator, temp;\n if (options.headers && options.headers instanceof Headers) {\n iterator = options.headers.entries();\n temp = iterator.next();\n while (!temp.done) {\n headers[temp.value[0]] = temp.value[1];\n temp = iterator.next();\n }\n }\n else {\n headers = options.headers;\n }\n return new Promise(function (resolve, reject) {\n var requestOptions = {\n error: function (error) {\n reject(_this.convertToResponse(error));\n },\n headers: headers,\n method: options.method,\n success: function (response) {\n resolve(_this.convertToResponse(response));\n },\n url: url,\n };\n if (options.body) {\n requestOptions = util_1.Util.extend(requestOptions, { body: options.body });\n }\n else {\n requestOptions = util_1.Util.extend(requestOptions, { binaryStringRequestBody: true });\n }\n executor.executeAsync(requestOptions);\n });\n };\n return SPRequestExecutorClient;\n}());\nexports.SPRequestExecutorClient = SPRequestExecutorClient;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/net/sprequestexecutorclient.js\n// module id = 40\n// module chunks = 0","\"use strict\";\nfunction __export(m) {\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\n}\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar util_1 = require(\"./utils/util\");\nvar storage_1 = require(\"./utils/storage\");\nvar configuration_1 = require(\"./configuration/configuration\");\nvar logging_1 = require(\"./utils/logging\");\nvar rest_1 = require(\"./sharepoint/rest\");\nvar pnplibconfig_1 = require(\"./configuration/pnplibconfig\");\n/**\n * Root class of the Patterns and Practices namespace, provides an entry point to the library\n */\n/**\n * Utility methods\n */\nexports.util = util_1.Util;\n/**\n * Provides access to the REST interface\n */\nexports.sp = new rest_1.Rest();\n/**\n * Provides access to local and session storage\n */\nexports.storage = new storage_1.PnPClientStorage();\n/**\n * Global configuration instance to which providers can be added\n */\nexports.config = new configuration_1.Settings();\n/**\n * Global logging instance to which subscribers can be registered and messages written\n */\nexports.log = logging_1.Logger;\n/**\n * Allows for the configuration of the library\n */\nexports.setup = pnplibconfig_1.setRuntimeConfig;\n/**\n * Expose a subset of classes from the library for public consumption\n */\n__export(require(\"./types/index\"));\n// creating this class instead of directly assigning to default fixes issue #116\nvar Def = {\n /**\n * Global configuration instance to which providers can be added\n */\n config: exports.config,\n /**\n * Global logging instance to which subscribers can be registered and messages written\n */\n log: exports.log,\n /**\n * Provides access to local and session storage\n */\n setup: exports.setup,\n /**\n * Provides access to the REST interface\n */\n sp: exports.sp,\n /**\n * Provides access to local and session storage\n */\n storage: exports.storage,\n /**\n * Utility methods\n */\n util: exports.util,\n};\n/**\n * Enables use of the import pnp from syntax\n */\nexports.default = Def;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/pnp.js\n// module id = 41\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar queryable_1 = require(\"./queryable\");\nvar odata_1 = require(\"./odata\");\n/**\n * Describes a collection of Item objects\n *\n */\nvar AttachmentFiles = (function (_super) {\n __extends(AttachmentFiles, _super);\n /**\n * Creates a new instance of the AttachmentFiles class\n *\n * @param baseUrl The url or Queryable which forms the parent of this attachments collection\n */\n function AttachmentFiles(baseUrl, path) {\n if (path === void 0) { path = \"AttachmentFiles\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * Gets a Attachment File by filename\n *\n * @param name The name of the file, including extension.\n */\n AttachmentFiles.prototype.getByName = function (name) {\n var f = new AttachmentFile(this);\n f.concat(\"('\" + name + \"')\");\n return f;\n };\n /**\n * Adds a new attachment to the collection. Not supported for batching.\n *\n * @param name The name of the file, including extension.\n * @param content The Base64 file content.\n */\n AttachmentFiles.prototype.add = function (name, content) {\n var _this = this;\n return this.clone(AttachmentFiles, \"add(FileName='\" + name + \"')\").post({\n body: content,\n }).then(function (response) {\n return {\n data: response,\n file: _this.getByName(name),\n };\n });\n };\n /**\n * Adds mjultiple new attachment to the collection. Not supported for batching.\n *\n * @files name The collection of files to add\n */\n AttachmentFiles.prototype.addMultiple = function (files) {\n var _this = this;\n // add the files in series so we don't get update conflicts\n return files.reduce(function (chain, file) { return chain.then(function () { return _this.clone(AttachmentFiles, \"add(FileName='\" + file.name + \"')\").post({\n body: file.content,\n }); }); }, Promise.resolve());\n };\n return AttachmentFiles;\n}(queryable_1.QueryableCollection));\nexports.AttachmentFiles = AttachmentFiles;\n/**\n * Describes a single attachment file instance\n *\n */\nvar AttachmentFile = (function (_super) {\n __extends(AttachmentFile, _super);\n function AttachmentFile() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Gets the contents of the file as text\n *\n */\n AttachmentFile.prototype.getText = function () {\n return this.clone(AttachmentFile, \"$value\").get(new odata_1.TextFileParser());\n };\n /**\n * Gets the contents of the file as a blob, does not work in Node.js\n *\n */\n AttachmentFile.prototype.getBlob = function () {\n return this.clone(AttachmentFile, \"$value\").get(new odata_1.BlobFileParser());\n };\n /**\n * Gets the contents of a file as an ArrayBuffer, works in Node.js\n */\n AttachmentFile.prototype.getBuffer = function () {\n return this.clone(AttachmentFile, \"$value\").get(new odata_1.BufferFileParser());\n };\n /**\n * Gets the contents of a file as an ArrayBuffer, works in Node.js\n */\n AttachmentFile.prototype.getJSON = function () {\n return this.clone(AttachmentFile, \"$value\").get(new odata_1.JSONFileParser());\n };\n /**\n * Sets the content of a file. Not supported for batching\n *\n * @param content The value to set for the file contents\n */\n AttachmentFile.prototype.setContent = function (content) {\n var _this = this;\n return this.clone(AttachmentFile, \"$value\").post({\n body: content,\n headers: {\n \"X-HTTP-Method\": \"PUT\",\n },\n }).then(function (_) { return new AttachmentFile(_this); });\n };\n /**\n * Delete this attachment file\n *\n * @param eTag Value used in the IF-Match header, by default \"*\"\n */\n AttachmentFile.prototype.delete = function (eTag) {\n if (eTag === void 0) { eTag = \"*\"; }\n return this.post({\n headers: {\n \"IF-Match\": eTag,\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n return AttachmentFile;\n}(queryable_1.QueryableInstance));\nexports.AttachmentFile = AttachmentFile;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/sharepoint/attachmentfiles.js\n// module id = 42\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar queryable_1 = require(\"./queryable\");\n/**\n * Describes a collection of Field objects\n *\n */\nvar Forms = (function (_super) {\n __extends(Forms, _super);\n /**\n * Creates a new instance of the Fields class\n *\n * @param baseUrl The url or Queryable which forms the parent of this fields collection\n */\n function Forms(baseUrl, path) {\n if (path === void 0) { path = \"forms\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * Gets a form by id\n *\n * @param id The guid id of the item to retrieve\n */\n Forms.prototype.getById = function (id) {\n var i = new Form(this);\n i.concat(\"('\" + id + \"')\");\n return i;\n };\n return Forms;\n}(queryable_1.QueryableCollection));\nexports.Forms = Forms;\n/**\n * Describes a single of Form instance\n *\n */\nvar Form = (function (_super) {\n __extends(Form, _super);\n function Form() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return Form;\n}(queryable_1.QueryableInstance));\nexports.Form = Form;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/sharepoint/forms.js\n// module id = 43\n// module chunks = 0","\"use strict\";\nfunction __export(m) {\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\n}\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__export(require(\"./caching\"));\nvar files_1 = require(\"./files\");\nexports.CheckinType = files_1.CheckinType;\nexports.WebPartsPersonalizationScope = files_1.WebPartsPersonalizationScope;\nexports.MoveOperations = files_1.MoveOperations;\nexports.TemplateFileType = files_1.TemplateFileType;\nvar folders_1 = require(\"./folders\");\nexports.Folder = folders_1.Folder;\nexports.Folders = folders_1.Folders;\nvar items_1 = require(\"./items\");\nexports.Item = items_1.Item;\nexports.Items = items_1.Items;\nexports.PagedItemCollection = items_1.PagedItemCollection;\nvar navigation_1 = require(\"./navigation\");\nexports.NavigationNodes = navigation_1.NavigationNodes;\nexports.NavigationNode = navigation_1.NavigationNode;\nvar lists_1 = require(\"./lists\");\nexports.List = lists_1.List;\nexports.Lists = lists_1.Lists;\nvar odata_1 = require(\"./odata\");\nexports.extractOdataId = odata_1.extractOdataId;\nexports.ODataParserBase = odata_1.ODataParserBase;\nexports.ODataDefaultParser = odata_1.ODataDefaultParser;\nexports.ODataRaw = odata_1.ODataRaw;\nexports.ODataValue = odata_1.ODataValue;\nexports.ODataEntity = odata_1.ODataEntity;\nexports.ODataEntityArray = odata_1.ODataEntityArray;\nexports.TextFileParser = odata_1.TextFileParser;\nexports.BlobFileParser = odata_1.BlobFileParser;\nexports.BufferFileParser = odata_1.BufferFileParser;\nexports.JSONFileParser = odata_1.JSONFileParser;\nvar queryable_1 = require(\"./queryable\");\nexports.Queryable = queryable_1.Queryable;\nexports.QueryableInstance = queryable_1.QueryableInstance;\nexports.QueryableCollection = queryable_1.QueryableCollection;\nvar roles_1 = require(\"./roles\");\nexports.RoleDefinitionBindings = roles_1.RoleDefinitionBindings;\nvar search_1 = require(\"./search\");\nexports.Search = search_1.Search;\nexports.SearchResult = search_1.SearchResult;\nexports.SearchResults = search_1.SearchResults;\nexports.SortDirection = search_1.SortDirection;\nexports.ReorderingRuleMatchType = search_1.ReorderingRuleMatchType;\nexports.QueryPropertyValueType = search_1.QueryPropertyValueType;\nvar searchsuggest_1 = require(\"./searchsuggest\");\nexports.SearchSuggest = searchsuggest_1.SearchSuggest;\nexports.SearchSuggestResult = searchsuggest_1.SearchSuggestResult;\nvar site_1 = require(\"./site\");\nexports.Site = site_1.Site;\n__export(require(\"./types\"));\nvar webs_1 = require(\"./webs\");\nexports.Web = webs_1.Web;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/sharepoint/index.js\n// module id = 44\n// module chunks = 0","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar caching_1 = require(\"./caching\");\nvar httpclient_1 = require(\"../net/httpclient\");\nvar logging_1 = require(\"../utils/logging\");\nvar util_1 = require(\"../utils/util\");\n/**\n * Processes a given context through the request pipeline\n *\n * @param context The request context we are processing\n */\nfunction pipe(context) {\n // this is the beginning of the extensible pipeline in future versions\n var pipeline = [\n PipelineMethods.logStart,\n PipelineMethods.caching,\n PipelineMethods.send,\n PipelineMethods.logEnd,\n ];\n return pipeline.reduce(function (chain, next) { return chain.then(function (c) { return next(c); }); }, Promise.resolve(context))\n .then(function (ctx) { return PipelineMethods.returnResult(ctx); })\n .catch(function (e) {\n logging_1.Logger.log({\n data: e,\n level: logging_1.LogLevel.Error,\n message: \"Error in request pipeline: \" + e.message,\n });\n throw e;\n });\n}\nexports.pipe = pipe;\n/**\n * decorator factory applied to methods in the pipeline to control behavior\n */\nfunction requestPipelineMethod(alwaysRun) {\n if (alwaysRun === void 0) { alwaysRun = false; }\n return function (target, propertyKey, descriptor) {\n var method = descriptor.value;\n descriptor.value = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n // if we have a result already in the pipeline, pass it along and don't call the tagged method\n if (!alwaysRun && args.length > 0 && args[0].hasOwnProperty(\"hasResult\") && args[0].hasResult) {\n logging_1.Logger.write(\"[\" + args[0].requestId + \"] (\" + (new Date()).getTime() + \") Skipping request pipeline method \" + propertyKey + \", existing result in pipeline.\", logging_1.LogLevel.Verbose);\n return Promise.resolve(args[0]);\n }\n // apply the tagged method\n logging_1.Logger.write(\"[\" + args[0].requestId + \"] (\" + (new Date()).getTime() + \") Calling request pipeline method \" + propertyKey + \".\", logging_1.LogLevel.Verbose);\n return method.apply(target, args);\n };\n };\n}\n/**\n * Contains the methods used within the request pipeline\n */\nvar PipelineMethods = (function () {\n function PipelineMethods() {\n }\n /**\n * Logs the start of the request\n */\n PipelineMethods.logStart = function (context) {\n return new Promise(function (resolve) {\n logging_1.Logger.log({\n data: logging_1.Logger.activeLogLevel === logging_1.LogLevel.Info ? {} : context,\n level: logging_1.LogLevel.Info,\n message: \"[\" + context.requestId + \"] (\" + (new Date()).getTime() + \") Beginning \" + context.verb + \" request to \" + context.requestAbsoluteUrl,\n });\n resolve(context);\n });\n };\n /**\n * Handles caching of the request\n */\n PipelineMethods.caching = function (context) {\n return new Promise(function (resolve) {\n // handle caching, if applicable\n if (context.verb === \"GET\" && context.isCached) {\n logging_1.Logger.write(\"[\" + context.requestId + \"] (\" + (new Date()).getTime() + \") Caching is enabled for request, checking cache...\", logging_1.LogLevel.Info);\n var cacheOptions = new caching_1.CachingOptions(context.requestAbsoluteUrl.toLowerCase());\n if (typeof context.cachingOptions !== \"undefined\") {\n cacheOptions = util_1.Util.extend(cacheOptions, context.cachingOptions);\n }\n // we may not have a valid store, i.e. on node\n if (cacheOptions.store !== null) {\n // check if we have the data in cache and if so resolve the promise and return\n var data = cacheOptions.store.get(cacheOptions.key);\n if (data !== null) {\n // ensure we clear any help batch dependency we are resolving from the cache\n logging_1.Logger.log({\n data: logging_1.Logger.activeLogLevel === logging_1.LogLevel.Info ? {} : data,\n level: logging_1.LogLevel.Info,\n message: \"[\" + context.requestId + \"] (\" + (new Date()).getTime() + \") Value returned from cache.\",\n });\n context.batchDependency();\n return PipelineMethods.setResult(context, data).then(function (ctx) { return resolve(ctx); });\n }\n }\n logging_1.Logger.write(\"[\" + context.requestId + \"] (\" + (new Date()).getTime() + \") Value not found in cache.\", logging_1.LogLevel.Info);\n // if we don't then wrap the supplied parser in the caching parser wrapper\n // and send things on their way\n context.parser = new caching_1.CachingParserWrapper(context.parser, cacheOptions);\n }\n return resolve(context);\n });\n };\n /**\n * Sends the request\n */\n PipelineMethods.send = function (context) {\n return new Promise(function (resolve, reject) {\n // send or batch the request\n if (context.isBatched) {\n // we are in a batch, so add to batch, remove dependency, and resolve with the batch's promise\n var p = context.batch.add(context.requestAbsoluteUrl, context.verb, context.options, context.parser);\n // we release the dependency here to ensure the batch does not execute until the request is added to the batch\n context.batchDependency();\n logging_1.Logger.write(\"[\" + context.requestId + \"] (\" + (new Date()).getTime() + \") Batching request.\", logging_1.LogLevel.Info);\n resolve(p.then(function (result) { return PipelineMethods.setResult(context, result); }));\n }\n else {\n logging_1.Logger.write(\"[\" + context.requestId + \"] (\" + (new Date()).getTime() + \") Sending request.\", logging_1.LogLevel.Info);\n // we are not part of a batch, so proceed as normal\n var client = new httpclient_1.HttpClient();\n var opts = util_1.Util.extend(context.options || {}, { method: context.verb });\n client.fetch(context.requestAbsoluteUrl, opts)\n .then(function (response) { return context.parser.parse(response); })\n .then(function (result) { return PipelineMethods.setResult(context, result); })\n .then(function (ctx) { return resolve(ctx); })\n .catch(function (e) { return reject(e); });\n }\n });\n };\n /**\n * Logs the end of the request\n */\n PipelineMethods.logEnd = function (context) {\n return new Promise(function (resolve) {\n logging_1.Logger.log({\n data: logging_1.Logger.activeLogLevel === logging_1.LogLevel.Info ? {} : context,\n level: logging_1.LogLevel.Info,\n message: \"[\" + context.requestId + \"] (\" + (new Date()).getTime() + \") Completing \" + context.verb + \" request to \" + context.requestAbsoluteUrl,\n });\n resolve(context);\n });\n };\n /**\n * At the end of the pipeline resolves the request's result\n */\n PipelineMethods.returnResult = function (context) {\n logging_1.Logger.log({\n data: context.result,\n level: logging_1.LogLevel.Verbose,\n message: \"[\" + context.requestId + \"] (\" + (new Date()).getTime() + \") Returning, see data property for value.\",\n });\n return Promise.resolve(context.result);\n };\n /**\n * Sets the result on the context\n */\n PipelineMethods.setResult = function (context, value) {\n return new Promise(function (resolve) {\n context.result = value;\n context.hasResult = true;\n resolve(context);\n });\n };\n return PipelineMethods;\n}());\n__decorate([\n requestPipelineMethod(true)\n], PipelineMethods, \"logStart\", null);\n__decorate([\n requestPipelineMethod()\n], PipelineMethods, \"caching\", null);\n__decorate([\n requestPipelineMethod()\n], PipelineMethods, \"send\", null);\n__decorate([\n requestPipelineMethod(true)\n], PipelineMethods, \"logEnd\", null);\n__decorate([\n requestPipelineMethod(true)\n], PipelineMethods, \"returnResult\", null);\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/sharepoint/queryablerequest.js\n// module id = 45\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar queryable_1 = require(\"./queryable\");\nvar RelatedItemManagerImpl = (function (_super) {\n __extends(RelatedItemManagerImpl, _super);\n function RelatedItemManagerImpl(baseUrl, path) {\n if (path === void 0) { path = \"_api/SP.RelatedItemManager\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n RelatedItemManagerImpl.FromUrl = function (url) {\n if (url === null) {\n return new RelatedItemManagerImpl(\"\");\n }\n var index = url.indexOf(\"_api/\");\n if (index > -1) {\n return new RelatedItemManagerImpl(url.substr(0, index));\n }\n return new RelatedItemManagerImpl(url);\n };\n RelatedItemManagerImpl.prototype.getRelatedItems = function (sourceListName, sourceItemId) {\n var query = this.clone(RelatedItemManagerImpl, null, true);\n query.concat(\".GetRelatedItems\");\n return query.post({\n body: JSON.stringify({\n SourceItemID: sourceItemId,\n SourceListName: sourceListName,\n }),\n });\n };\n RelatedItemManagerImpl.prototype.getPageOneRelatedItems = function (sourceListName, sourceItemId) {\n var query = this.clone(RelatedItemManagerImpl, null, true);\n query.concat(\".GetPageOneRelatedItems\");\n return query.post({\n body: JSON.stringify({\n SourceItemID: sourceItemId,\n SourceListName: sourceListName,\n }),\n });\n };\n RelatedItemManagerImpl.prototype.addSingleLink = function (sourceListName, sourceItemId, sourceWebUrl, targetListName, targetItemID, targetWebUrl, tryAddReverseLink) {\n if (tryAddReverseLink === void 0) { tryAddReverseLink = false; }\n var query = this.clone(RelatedItemManagerImpl, null, true);\n query.concat(\".AddSingleLink\");\n return query.post({\n body: JSON.stringify({\n SourceItemID: sourceItemId,\n SourceListName: sourceListName,\n SourceWebUrl: sourceWebUrl,\n TargetItemID: targetItemID,\n TargetListName: targetListName,\n TargetWebUrl: targetWebUrl,\n TryAddReverseLink: tryAddReverseLink,\n }),\n });\n };\n /**\n * Adds a related item link from an item specified by list name and item id, to an item specified by url\n *\n * @param sourceListName The source list name or list id\n * @param sourceItemId The source item id\n * @param targetItemUrl The target item url\n * @param tryAddReverseLink If set to true try to add the reverse link (will not return error if it fails)\n */\n RelatedItemManagerImpl.prototype.addSingleLinkToUrl = function (sourceListName, sourceItemId, targetItemUrl, tryAddReverseLink) {\n if (tryAddReverseLink === void 0) { tryAddReverseLink = false; }\n var query = this.clone(RelatedItemManagerImpl, null, true);\n query.concat(\".AddSingleLinkToUrl\");\n return query.post({\n body: JSON.stringify({\n SourceItemID: sourceItemId,\n SourceListName: sourceListName,\n TargetItemUrl: targetItemUrl,\n TryAddReverseLink: tryAddReverseLink,\n }),\n });\n };\n /**\n * Adds a related item link from an item specified by url, to an item specified by list name and item id\n *\n * @param sourceItemUrl The source item url\n * @param targetListName The target list name or list id\n * @param targetItemId The target item id\n * @param tryAddReverseLink If set to true try to add the reverse link (will not return error if it fails)\n */\n RelatedItemManagerImpl.prototype.addSingleLinkFromUrl = function (sourceItemUrl, targetListName, targetItemId, tryAddReverseLink) {\n if (tryAddReverseLink === void 0) { tryAddReverseLink = false; }\n var query = this.clone(RelatedItemManagerImpl, null, true);\n query.concat(\".AddSingleLinkFromUrl\");\n return query.post({\n body: JSON.stringify({\n SourceItemUrl: sourceItemUrl,\n TargetItemID: targetItemId,\n TargetListName: targetListName,\n TryAddReverseLink: tryAddReverseLink,\n }),\n });\n };\n RelatedItemManagerImpl.prototype.deleteSingleLink = function (sourceListName, sourceItemId, sourceWebUrl, targetListName, targetItemId, targetWebUrl, tryDeleteReverseLink) {\n if (tryDeleteReverseLink === void 0) { tryDeleteReverseLink = false; }\n var query = this.clone(RelatedItemManagerImpl, null, true);\n query.concat(\".DeleteSingleLink\");\n return query.post({\n body: JSON.stringify({\n SourceItemID: sourceItemId,\n SourceListName: sourceListName,\n SourceWebUrl: sourceWebUrl,\n TargetItemID: targetItemId,\n TargetListName: targetListName,\n TargetWebUrl: targetWebUrl,\n TryDeleteReverseLink: tryDeleteReverseLink,\n }),\n });\n };\n return RelatedItemManagerImpl;\n}(queryable_1.Queryable));\nexports.RelatedItemManagerImpl = RelatedItemManagerImpl;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/sharepoint/relateditems.js\n// module id = 46\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar queryable_1 = require(\"./queryable\");\n/**\n * Describes a collection of webhook subscriptions\n *\n */\nvar Subscriptions = (function (_super) {\n __extends(Subscriptions, _super);\n /**\n * Creates a new instance of the Subscriptions class\n *\n * @param baseUrl - The url or Queryable which forms the parent of this webhook subscriptions collection\n */\n function Subscriptions(baseUrl, path) {\n if (path === void 0) { path = \"subscriptions\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * Returns all the webhook subscriptions or the specified webhook subscription\n *\n */\n Subscriptions.prototype.getById = function (subscriptionId) {\n var subscription = new Subscription(this);\n subscription.concat(\"('\" + subscriptionId + \"')\");\n return subscription;\n };\n /**\n * Create a new webhook subscription\n *\n */\n Subscriptions.prototype.add = function (notificationUrl, expirationDate, clientState) {\n var _this = this;\n var postBody = JSON.stringify({\n \"clientState\": clientState || \"pnp-js-core-subscription\",\n \"expirationDateTime\": expirationDate,\n \"notificationUrl\": notificationUrl,\n \"resource\": this.toUrl(),\n });\n return this.post({ body: postBody, headers: { \"Content-Type\": \"application/json\" } }).then(function (result) {\n return { data: result, subscription: _this.getById(result.id) };\n });\n };\n return Subscriptions;\n}(queryable_1.QueryableCollection));\nexports.Subscriptions = Subscriptions;\n/**\n * Describes a single webhook subscription instance\n *\n */\nvar Subscription = (function (_super) {\n __extends(Subscription, _super);\n function Subscription() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Update a webhook subscription\n *\n */\n Subscription.prototype.update = function (expirationDate) {\n var _this = this;\n var postBody = JSON.stringify({\n \"expirationDateTime\": expirationDate,\n });\n return this.patch({ body: postBody, headers: { \"Content-Type\": \"application/json\" } }).then(function (data) {\n return { data: data, subscription: _this };\n });\n };\n /**\n * Remove a webhook subscription\n *\n */\n Subscription.prototype.delete = function () {\n return _super.prototype.delete.call(this);\n };\n return Subscription;\n}(queryable_1.QueryableInstance));\nexports.Subscription = Subscription;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/sharepoint/subscriptions.js\n// module id = 47\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar queryable_1 = require(\"./queryable\");\nvar files_1 = require(\"../utils/files\");\nvar odata_1 = require(\"./odata\");\nvar UserProfileQuery = (function (_super) {\n __extends(UserProfileQuery, _super);\n function UserProfileQuery(baseUrl, path) {\n if (path === void 0) { path = \"_api/sp.userprofiles.peoplemanager\"; }\n var _this = _super.call(this, baseUrl, path) || this;\n _this.profileLoader = new ProfileLoader(baseUrl);\n return _this;\n }\n Object.defineProperty(UserProfileQuery.prototype, \"editProfileLink\", {\n /**\n * The URL of the edit profile page for the current user.\n */\n get: function () {\n return this.clone(UserProfileQuery, \"EditProfileLink\").getAs(odata_1.ODataValue());\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(UserProfileQuery.prototype, \"isMyPeopleListPublic\", {\n /**\n * A Boolean value that indicates whether the current user's People I'm Following list is public.\n */\n get: function () {\n return this.clone(UserProfileQuery, \"IsMyPeopleListPublic\").getAs(odata_1.ODataValue());\n },\n enumerable: true,\n configurable: true\n });\n /**\n * A Boolean value that indicates whether the current user's People I'm Following list is public.\n *\n * @param loginName The account name of the user\n */\n UserProfileQuery.prototype.amIFollowedBy = function (loginName) {\n var q = this.clone(UserProfileQuery, \"amifollowedby(@v)\", true);\n q.query.add(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\n return q.get();\n };\n /**\n * Checks whether the current user is following the specified user.\n *\n * @param loginName The account name of the user\n */\n UserProfileQuery.prototype.amIFollowing = function (loginName) {\n var q = this.clone(UserProfileQuery, \"amifollowing(@v)\", true);\n q.query.add(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\n return q.get();\n };\n /**\n * Gets tags that the user is following.\n *\n * @param maxCount The maximum number of tags to get.\n */\n UserProfileQuery.prototype.getFollowedTags = function (maxCount) {\n if (maxCount === void 0) { maxCount = 20; }\n return this.clone(UserProfileQuery, \"getfollowedtags(\" + maxCount + \")\", true).get();\n };\n /**\n * Gets the people who are following the specified user.\n *\n * @param loginName The account name of the user.\n */\n UserProfileQuery.prototype.getFollowersFor = function (loginName) {\n var q = this.clone(UserProfileQuery, \"getfollowersfor(@v)\", true);\n q.query.add(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\n return q.get();\n };\n Object.defineProperty(UserProfileQuery.prototype, \"myFollowers\", {\n /**\n * Gets the people who are following the current user.\n *\n */\n get: function () {\n return new queryable_1.QueryableCollection(this, \"getmyfollowers\");\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(UserProfileQuery.prototype, \"myProperties\", {\n /**\n * Gets user properties for the current user.\n *\n */\n get: function () {\n return new UserProfileQuery(this, \"getmyproperties\");\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Gets the people who the specified user is following.\n *\n * @param loginName The account name of the user.\n */\n UserProfileQuery.prototype.getPeopleFollowedBy = function (loginName) {\n var q = this.clone(UserProfileQuery, \"getpeoplefollowedby(@v)\", true);\n q.query.add(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\n return q.get();\n };\n /**\n * Gets user properties for the specified user.\n *\n * @param loginName The account name of the user.\n */\n UserProfileQuery.prototype.getPropertiesFor = function (loginName) {\n var q = this.clone(UserProfileQuery, \"getpropertiesfor(@v)\", true);\n q.query.add(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\n return q.get();\n };\n Object.defineProperty(UserProfileQuery.prototype, \"trendingTags\", {\n /**\n * Gets the most popular tags.\n *\n */\n get: function () {\n var q = this.clone(UserProfileQuery, null, true);\n q.concat(\".gettrendingtags\");\n return q.get();\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Gets the specified user profile property for the specified user.\n *\n * @param loginName The account name of the user.\n * @param propertyName The case-sensitive name of the property to get.\n */\n UserProfileQuery.prototype.getUserProfilePropertyFor = function (loginName, propertyName) {\n var q = this.clone(UserProfileQuery, \"getuserprofilepropertyfor(accountname=@v, propertyname='\" + propertyName + \"')\", true);\n q.query.add(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\n return q.get();\n };\n /**\n * Removes the specified user from the user's list of suggested people to follow.\n *\n * @param loginName The account name of the user.\n */\n UserProfileQuery.prototype.hideSuggestion = function (loginName) {\n var q = this.clone(UserProfileQuery, \"hidesuggestion(@v)\", true);\n q.query.add(\"@v\", \"'\" + encodeURIComponent(loginName) + \"'\");\n return q.post();\n };\n /**\n * Checks whether the first user is following the second user.\n *\n * @param follower The account name of the user who might be following followee.\n * @param followee The account name of the user who might be followed.\n */\n UserProfileQuery.prototype.isFollowing = function (follower, followee) {\n var q = this.clone(UserProfileQuery, null, true);\n q.concat(\".isfollowing(possiblefolloweraccountname=@v, possiblefolloweeaccountname=@y)\");\n q.query.add(\"@v\", \"'\" + encodeURIComponent(follower) + \"'\");\n q.query.add(\"@y\", \"'\" + encodeURIComponent(followee) + \"'\");\n return q.get();\n };\n /**\n * Uploads and sets the user profile picture. Not supported for batching.\n *\n * @param profilePicSource Blob data representing the user's picture\n */\n UserProfileQuery.prototype.setMyProfilePic = function (profilePicSource) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n files_1.readBlobAsArrayBuffer(profilePicSource).then(function (buffer) {\n var request = new UserProfileQuery(_this, \"setmyprofilepicture\");\n request.post({\n body: String.fromCharCode.apply(null, new Uint16Array(buffer)),\n }).then(function (_) { return resolve(); });\n }).catch(function (e) { return reject(e); });\n });\n };\n /**\n * Provisions one or more users' personal sites. (My Site administrator on SharePoint Online only)\n *\n * @param emails The email addresses of the users to provision sites for\n */\n UserProfileQuery.prototype.createPersonalSiteEnqueueBulk = function () {\n var emails = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n emails[_i] = arguments[_i];\n }\n return this.profileLoader.createPersonalSiteEnqueueBulk(emails);\n };\n Object.defineProperty(UserProfileQuery.prototype, \"ownerUserProfile\", {\n /**\n * Gets the user profile of the site owner.\n *\n */\n get: function () {\n return this.profileLoader.ownerUserProfile;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(UserProfileQuery.prototype, \"userProfile\", {\n /**\n * Gets the user profile that corresponds to the current user.\n */\n get: function () {\n return this.profileLoader.userProfile;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Enqueues creating a personal site for this user, which can be used to share documents, web pages, and other files.\n *\n * @param interactiveRequest true if interactively (web) initiated request, or false if non-interactively (client) initiated request\n */\n UserProfileQuery.prototype.createPersonalSite = function (interactiveRequest) {\n if (interactiveRequest === void 0) { interactiveRequest = false; }\n return this.profileLoader.createPersonalSite(interactiveRequest);\n };\n /**\n * Sets the privacy settings for this profile.\n *\n * @param share true to make all social data public; false to make all social data private.\n */\n UserProfileQuery.prototype.shareAllSocialData = function (share) {\n return this.profileLoader.shareAllSocialData(share);\n };\n return UserProfileQuery;\n}(queryable_1.QueryableInstance));\nexports.UserProfileQuery = UserProfileQuery;\nvar ProfileLoader = (function (_super) {\n __extends(ProfileLoader, _super);\n function ProfileLoader(baseUrl, path) {\n if (path === void 0) { path = \"_api/sp.userprofiles.profileloader.getprofileloader\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * Provisions one or more users' personal sites. (My Site administrator on SharePoint Online only)\n *\n * @param emails The email addresses of the users to provision sites for\n */\n ProfileLoader.prototype.createPersonalSiteEnqueueBulk = function (emails) {\n return this.clone(ProfileLoader, \"createpersonalsiteenqueuebulk\").post({\n body: JSON.stringify({ \"emailIDs\": emails }),\n });\n };\n Object.defineProperty(ProfileLoader.prototype, \"ownerUserProfile\", {\n /**\n * Gets the user profile of the site owner.\n *\n */\n get: function () {\n var q = this.getParent(ProfileLoader, this.parentUrl, \"_api/sp.userprofiles.profileloader.getowneruserprofile\");\n if (this.hasBatch) {\n q = q.inBatch(this.batch);\n }\n return q.postAs();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ProfileLoader.prototype, \"userProfile\", {\n /**\n * Gets the user profile that corresponds to the current user.\n *\n */\n get: function () {\n return this.clone(ProfileLoader, \"getuserprofile\", true).postAs();\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Enqueues creating a personal site for this user, which can be used to share documents, web pages, and other files.\n *\n * @param interactiveRequest true if interactively (web) initiated request, or false if non-interactively (client) initiated request\n */\n ProfileLoader.prototype.createPersonalSite = function (interactiveRequest) {\n if (interactiveRequest === void 0) { interactiveRequest = false; }\n return this.clone(ProfileLoader, \"getuserprofile/createpersonalsiteenque(\" + interactiveRequest + \")\", true).post();\n };\n /**\n * Sets the privacy settings for this profile.\n *\n * @param share true to make all social data public; false to make all social data private.\n */\n ProfileLoader.prototype.shareAllSocialData = function (share) {\n return this.clone(ProfileLoader, \"getuserprofile/shareallsocialdata(\" + share + \")\", true).post();\n };\n return ProfileLoader;\n}(queryable_1.Queryable));\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/sharepoint/userprofiles.js\n// module id = 48\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar queryable_1 = require(\"./queryable\");\nvar util_1 = require(\"../utils/util\");\n/**\n * Describes the views available in the current context\n *\n */\nvar Views = (function (_super) {\n __extends(Views, _super);\n /**\n * Creates a new instance of the Views class\n *\n * @param baseUrl The url or Queryable which forms the parent of this fields collection\n */\n function Views(baseUrl, path) {\n if (path === void 0) { path = \"views\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * Gets a view by guid id\n *\n * @param id The GUID id of the view\n */\n Views.prototype.getById = function (id) {\n var v = new View(this);\n v.concat(\"('\" + id + \"')\");\n return v;\n };\n /**\n * Gets a view by title (case-sensitive)\n *\n * @param title The case-sensitive title of the view\n */\n Views.prototype.getByTitle = function (title) {\n return new View(this, \"getByTitle('\" + title + \"')\");\n };\n /**\n * Adds a new view to the collection\n *\n * @param title The new views's title\n * @param personalView True if this is a personal view, otherwise false, default = false\n * @param additionalSettings Will be passed as part of the view creation body\n */\n /*tslint:disable max-line-length */\n Views.prototype.add = function (title, personalView, additionalSettings) {\n var _this = this;\n if (personalView === void 0) { personalView = false; }\n if (additionalSettings === void 0) { additionalSettings = {}; }\n var postBody = JSON.stringify(util_1.Util.extend({\n \"PersonalView\": personalView,\n \"Title\": title,\n \"__metadata\": { \"type\": \"SP.View\" },\n }, additionalSettings));\n return this.clone(Views, null, true).postAs({ body: postBody }).then(function (data) {\n return {\n data: data,\n view: _this.getById(data.Id),\n };\n });\n };\n return Views;\n}(queryable_1.QueryableCollection));\nexports.Views = Views;\n/**\n * Describes a single View instance\n *\n */\nvar View = (function (_super) {\n __extends(View, _super);\n function View() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(View.prototype, \"fields\", {\n get: function () {\n return new ViewFields(this);\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Updates this view intance with the supplied properties\n *\n * @param properties A plain object hash of values to update for the view\n */\n View.prototype.update = function (properties) {\n var _this = this;\n var postBody = JSON.stringify(util_1.Util.extend({\n \"__metadata\": { \"type\": \"SP.View\" },\n }, properties));\n return this.post({\n body: postBody,\n headers: {\n \"X-HTTP-Method\": \"MERGE\",\n },\n }).then(function (data) {\n return {\n data: data,\n view: _this,\n };\n });\n };\n /**\n * Delete this view\n *\n */\n View.prototype.delete = function () {\n return this.post({\n headers: {\n \"X-HTTP-Method\": \"DELETE\",\n },\n });\n };\n /**\n * Returns the list view as HTML.\n *\n */\n View.prototype.renderAsHtml = function () {\n return this.clone(queryable_1.Queryable, \"renderashtml\", true).get();\n };\n return View;\n}(queryable_1.QueryableInstance));\nexports.View = View;\nvar ViewFields = (function (_super) {\n __extends(ViewFields, _super);\n function ViewFields(baseUrl, path) {\n if (path === void 0) { path = \"viewfields\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n /**\n * Gets a value that specifies the XML schema that represents the collection.\n */\n ViewFields.prototype.getSchemaXml = function () {\n return this.clone(queryable_1.Queryable, \"schemaxml\", true).get();\n };\n /**\n * Adds the field with the specified field internal name or display name to the collection.\n *\n * @param fieldTitleOrInternalName The case-sensitive internal name or display name of the field to add.\n */\n ViewFields.prototype.add = function (fieldTitleOrInternalName) {\n return this.clone(ViewFields, \"addviewfield('\" + fieldTitleOrInternalName + \"')\", true).post();\n };\n /**\n * Moves the field with the specified field internal name to the specified position in the collection.\n *\n * @param fieldInternalName The case-sensitive internal name of the field to move.\n * @param index The zero-based index of the new position for the field.\n */\n ViewFields.prototype.move = function (fieldInternalName, index) {\n return this.clone(ViewFields, \"moveviewfieldto\", true).post({\n body: JSON.stringify({ \"field\": fieldInternalName, \"index\": index }),\n });\n };\n /**\n * Removes all the fields from the collection.\n */\n ViewFields.prototype.removeAll = function () {\n return this.clone(ViewFields, \"removeallviewfields\", true).post();\n };\n /**\n * Removes the field with the specified field internal name from the collection.\n *\n * @param fieldInternalName The case-sensitive internal name of the field to remove from the view.\n */\n ViewFields.prototype.remove = function (fieldInternalName) {\n return this.clone(ViewFields, \"removeviewfield('\" + fieldInternalName + \"')\", true).post();\n };\n return ViewFields;\n}(queryable_1.QueryableCollection));\nexports.ViewFields = ViewFields;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/sharepoint/views.js\n// module id = 49\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar queryable_1 = require(\"./queryable\");\nvar LimitedWebPartManager = (function (_super) {\n __extends(LimitedWebPartManager, _super);\n function LimitedWebPartManager() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(LimitedWebPartManager.prototype, \"webparts\", {\n /**\n * Gets the set of web part definitions contained by this web part manager\n *\n */\n get: function () {\n return new WebPartDefinitions(this, \"webparts\");\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Exports a webpart definition\n *\n * @param id the GUID id of the definition to export\n */\n LimitedWebPartManager.prototype.export = function (id) {\n return this.clone(LimitedWebPartManager, \"ExportWebPart\", true).post({\n body: JSON.stringify({ webPartId: id }),\n });\n };\n /**\n * Imports a webpart\n *\n * @param xml webpart definition which must be valid XML in the .dwp or .webpart format\n */\n LimitedWebPartManager.prototype.import = function (xml) {\n return this.clone(LimitedWebPartManager, \"ImportWebPart\", true).post({\n body: JSON.stringify({ webPartXml: xml }),\n });\n };\n return LimitedWebPartManager;\n}(queryable_1.Queryable));\nexports.LimitedWebPartManager = LimitedWebPartManager;\nvar WebPartDefinitions = (function (_super) {\n __extends(WebPartDefinitions, _super);\n function WebPartDefinitions() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * Gets a web part definition from the collection by id\n *\n * @param id GUID id of the web part definition to get\n */\n WebPartDefinitions.prototype.getById = function (id) {\n return new WebPartDefinition(this, \"getbyid('\" + id + \"')\");\n };\n return WebPartDefinitions;\n}(queryable_1.QueryableCollection));\nexports.WebPartDefinitions = WebPartDefinitions;\nvar WebPartDefinition = (function (_super) {\n __extends(WebPartDefinition, _super);\n function WebPartDefinition() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(WebPartDefinition.prototype, \"webpart\", {\n /**\n * Gets the webpart information associated with this definition\n */\n get: function () {\n return new WebPart(this);\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Removes a webpart from a page, all settings will be lost\n */\n WebPartDefinition.prototype.delete = function () {\n return this.clone(WebPartDefinition, \"DeleteWebPart\", true).post();\n };\n return WebPartDefinition;\n}(queryable_1.QueryableInstance));\nexports.WebPartDefinition = WebPartDefinition;\nvar WebPart = (function (_super) {\n __extends(WebPart, _super);\n /**\n * Creates a new instance of the WebPart class\n *\n * @param baseUrl The url or Queryable which forms the parent of this fields collection\n * @param path Optional, if supplied will be appended to the supplied baseUrl\n */\n function WebPart(baseUrl, path) {\n if (path === void 0) { path = \"webpart\"; }\n return _super.call(this, baseUrl, path) || this;\n }\n return WebPart;\n}(queryable_1.QueryableInstance));\nexports.WebPart = WebPart;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/sharepoint/webparts.js\n// module id = 50\n// module chunks = 0","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Reads a blob as text\n *\n * @param blob The data to read\n */\nfunction readBlobAsText(blob) {\n return readBlobAs(blob, \"string\");\n}\nexports.readBlobAsText = readBlobAsText;\n/**\n * Reads a blob into an array buffer\n *\n * @param blob The data to read\n */\nfunction readBlobAsArrayBuffer(blob) {\n return readBlobAs(blob, \"buffer\");\n}\nexports.readBlobAsArrayBuffer = readBlobAsArrayBuffer;\n/**\n * Generic method to read blob's content\n *\n * @param blob The data to read\n * @param mode The read mode\n */\nfunction readBlobAs(blob, mode) {\n return new Promise(function (resolve, reject) {\n try {\n var reader = new FileReader();\n reader.onload = function (e) {\n resolve(e.target.result);\n };\n switch (mode) {\n case \"string\":\n reader.readAsText(blob);\n break;\n case \"buffer\":\n reader.readAsArrayBuffer(blob);\n break;\n }\n }\n catch (e) {\n reject(e);\n }\n });\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/utils/files.js\n// module id = 51\n// module chunks = 0"],"sourceRoot":""} \ No newline at end of file