{"version":3,"file":"sp-clientsvc.es5.umd.js","sources":["../../../../packages/sp-clientsvc/src/opactionbuilders.ts","../../../../packages/sp-clientsvc/src/opbuilders.ts","../../../../packages/sp-clientsvc/src/utils.ts","../../../../packages/sp-clientsvc/src/objectpath.ts","../../../../packages/sp-clientsvc/src/parsers.ts","../../../../packages/sp-clientsvc/src/clintsvcqueryable.ts","../../../../packages/sp-clientsvc/src/batch.ts"],"sourcesContent":["import { PropertyType } from \"./types\";\nimport { IMethodParamsBuilder } from \"./opbuilders\";\n\nexport function objectPath(): string {\n return ``;\n}\n\nexport function identityQuery(): string {\n return ``;\n}\n\nexport function opQuery(selectProperties: string[] = null, childSelectProperties: string[] | null = null): string {\n\n // this is fairly opaque behavior, but is the simplest way to convey the required information.\n // if selectProperties.length === 0 or null then select all\n // else select indicated properties\n\n // if childSelectProperties === null do not include that block\n // if childSelectProperties.length === 0 then select all\n // else select indicated properties\n\n const builder = [];\n builder.push(``);\n if (selectProperties === null || selectProperties.length < 1) {\n builder.push(``);\n builder.push(``);\n builder.push(``);\n } else {\n builder.push(``);\n builder.push(``);\n [].push.apply(builder, selectProperties.map(p => ``));\n builder.push(``);\n builder.push(``);\n }\n\n if (childSelectProperties !== null) {\n if (childSelectProperties.length < 1) {\n builder.push(``);\n builder.push(``);\n builder.push(``);\n } else {\n builder.push(``);\n builder.push(``);\n [].push.apply(builder, childSelectProperties.map(p => ``));\n builder.push(``);\n builder.push(``);\n }\n }\n\n builder.push(``);\n\n return builder.join(\"\");\n}\n\nexport function setProperty(name: string, type: PropertyType, value: string): string {\n const builder = [];\n builder.push(``);\n builder.push(`${value}`);\n builder.push(``);\n return builder.join(\"\");\n}\n\nexport function methodAction(name: string, params: IMethodParamsBuilder | null): string {\n\n const builder = [];\n builder.push(``);\n\n if (params !== null) {\n const arrParams = params.toArray();\n if (arrParams.length < 1) {\n builder.push(``);\n } else {\n builder.push(``);\n [].push.apply(builder, arrParams.map(p => `${p.value}`));\n builder.push(``);\n }\n }\n\n builder.push(\"\");\n\n return builder.join(\"\");\n}\n\nexport function objectProperties(o: any): string[] {\n\n return Object.getOwnPropertyNames(o).map((name) => {\n\n const value = o[name];\n if (typeof value === \"boolean\") {\n return setProperty(name, \"Boolean\", `${value}`);\n } else if (typeof value === \"number\") {\n return setProperty(name, \"Number\", `${value}`);\n } else if (typeof value === \"string\") {\n return setProperty(name, \"String\", `${value}`);\n }\n\n return \"\";\n }, []);\n}\n","import { ObjectPath, IObjectPath } from \"./objectpath\";\nimport { PropertyType } from \"./types\";\n\nexport function property(name: string, ...actions: string[]): IObjectPath {\n return new ObjectPath(``, actions);\n}\n\nexport function staticMethod(name: string, typeId: string, ...actions: string[]): IObjectPath {\n return new ObjectPath(``, actions);\n}\n\nexport function staticProperty(name: string, typeId: string, ...actions: string[]): IObjectPath {\n return new ObjectPath(``, actions);\n}\n\nexport function objConstructor(typeId: string, ...actions: string[]): IObjectPath {\n return new ObjectPath(``, actions);\n}\n\nexport interface IMethodParamsBuilder {\n string(value: string): this;\n number(value: number): this;\n boolean(value: boolean): this;\n objectPath(inputIndex: number): this;\n toArray(): { type: PropertyType, value: string }[];\n}\n\n/**\n * Used to build parameters when calling methods\n */\nexport class MethodParams implements IMethodParamsBuilder {\n\n constructor(private _p: { type: PropertyType, value: string }[] = []) { }\n\n public static build(initValues: { type: PropertyType, value: string }[] = []): IMethodParamsBuilder {\n const params = new MethodParams();\n [].push.apply(params._p, initValues);\n return params;\n }\n\n public string(value: string): this {\n return this.a(\"String\", value);\n }\n\n public number(value: number): this {\n return this.a(\"Number\", value.toString());\n }\n\n public boolean(value: boolean): this {\n return this.a(\"Boolean\", value.toString());\n }\n\n public objectPath(inputIndex: number): this {\n return this.a(\"ObjectPath\", inputIndex.toString());\n }\n\n public toArray(): { type: PropertyType, value: string }[] {\n return this._p;\n }\n\n private a(type: PropertyType, value: string): this {\n this._p.push({ type, value });\n return this;\n }\n}\n\nexport function method(name: string, params: IMethodParamsBuilder, ...actions: string[]): IObjectPath {\n const builder = [];\n builder.push(``);\n\n if (params !== null) {\n const arrParams = params.toArray();\n if (arrParams.length < 1) {\n builder.push(``);\n } else {\n builder.push(``);\n [].push.apply(builder, arrParams.map(p => {\n\n if (p.type === \"ObjectPath\") {\n return ``;\n }\n\n return `${p.value}`;\n }));\n builder.push(``);\n }\n }\n\n builder.push(\"\");\n\n return new ObjectPath(builder.join(\"\"), actions);\n}\n","import { IObjectPath } from \"./objectpath\";\n\n/**\n * Transforms an array of object paths into a request xml body. Does not do placeholder substitutions.\n * \n * @param objectPaths The object paths for which we want to generate a body\n */\nexport function writeObjectPathBody(objectPaths: IObjectPath[]): string {\n\n const actions: string[] = [];\n const paths: string[] = [];\n\n objectPaths.forEach(op => {\n paths.push(op.path);\n actions.push(...op.actions);\n });\n\n // create our xml payload\n return [\n ``,\n \"\",\n actions.join(\"\"),\n \"\",\n \"\",\n paths.join(\"\"),\n \"\",\n \"\",\n ].join(\"\");\n}\n","import { TypedHash, extend, objectDefinedNotNull } from \"@pnp/common\";\nimport { objectPath } from \"./opactionbuilders\";\nimport { property, staticProperty } from \"./opbuilders\";\nimport { writeObjectPathBody } from \"./utils\";\n\n/**\n * Defines the properties and method of an ObjectPath\n */\nexport interface IObjectPath {\n /**\n * The ObjectPath xml node\n */\n path: string;\n /**\n * Collection of xml action nodes\n */\n actions: string[];\n /**\n * The id of this object path, used for processing, not set directly\n */\n id: number | undefined;\n}\n\n/**\n * Represents an ObjectPath used when querying ProcessQuery\n */\nexport class ObjectPath implements IObjectPath {\n constructor(public path: string, public actions: string[] = [], public id = -1, public replaceAfter: IObjectPath[] = []) { }\n}\n\n/**\n * Replaces all found instance of the $$ID$$ placeholder in the supplied xml string\n * \n * @param id New value to be insterted\n * @param xml The existing xml fragment in which the replace should occur\n */\nexport function opSetId(id: string, xml: string): string {\n return xml.replace(/\\$\\$ID\\$\\$/g, id);\n}\n\n/**\n * Replaces all found instance of the $$PATH_ID$$ placeholder in the supplied xml string\n * \n * @param id New value to be insterted\n * @param xml The existing xml fragment in which the replace should occur\n */\nexport function opSetPathId(id: string, xml: string): string {\n return xml.replace(/\\$\\$PATH_ID\\$\\$/g, id);\n}\n\n/**\n * Replaces all found instance of the $$PARENT_ID$$ placeholder in the supplied xml string\n * \n * @param id New value to be insterted\n * @param xml The existing xml fragment in which the replace should occur\n */\nexport function opSetParentId(id: string, xml: string): string {\n return xml.replace(/\\$\\$PARENT_ID\\$\\$/g, id);\n}\n\n/**\n * Replaces all found instance of the $$OP_PARAM_ID$$ placeholder in the supplied xml string\n * \n * @param map A mapping where [index] = replaced_object_path_id\n * @param xml The existing xml fragment in which the replace should occur\n * @param indexMapper Used when creating batches, not meant for direct use external to this library\n */\nexport function opSetPathParamId(map: number[], xml: string, indexMapper: (n: number) => number = (n) => n): string {\n\n // this approach works because input params must come before the things that need them\n // meaning the right id will always be in the map\n const matches = /\\$\\$OP_PARAM_ID_(\\d+)\\$\\$/ig.exec(xml);\n if (matches !== null) {\n for (let i = 1; i < matches.length; i++) {\n const index = parseInt(matches[i], 10);\n const regex = new RegExp(`\\\\$\\\\$OP_PARAM_ID_${index}\\\\$\\\\$`, \"ig\");\n xml = xml.replace(regex, map[indexMapper(index)].toString());\n }\n }\n\n return xml;\n}\n\n/**\n * Represents a collection of IObjectPaths\n */\nexport class ObjectPathQueue {\n\n private _xml: string | null;\n private _contextIndex = -1;\n private _siteIndex = -1;\n private _webIndex = -1;\n\n constructor(protected _paths: IObjectPath[] = [], protected _relationships: TypedHash = {}) { }\n\n /**\n * Adds an object path to the queue\n * \n * @param op The action to add\n * @returns The index of the added object path\n */\n public add(op: IObjectPath): number {\n\n this.dirty();\n this._paths.push(op);\n return this.lastIndex;\n }\n\n public addChildRelationship(parentIndex: number, childIndex: number) {\n if (objectDefinedNotNull(this._relationships[`_${parentIndex}`])) {\n this._relationships[`_${parentIndex}`].push(childIndex);\n } else {\n this._relationships[`_${parentIndex}`] = [childIndex];\n }\n }\n\n public getChildRelationship(parentIndex: number): number[] {\n if (objectDefinedNotNull(this._relationships[`_${parentIndex}`])) {\n return this._relationships[`_${parentIndex}`];\n } else {\n return [];\n }\n }\n\n public getChildRelationships(): TypedHash {\n return this._relationships;\n }\n\n /**\n * Appends an action to the supplied IObjectPath, replacing placeholders\n * \n * @param op IObjectPath to which the action will be appended\n * @param action The action to append\n */\n public appendAction(op: IObjectPath, action: string): this {\n\n this.dirty();\n op.actions.push(action);\n return this;\n }\n\n /**\n * Appends an action to the last IObjectPath in the collection\n * \n * @param action \n */\n public appendActionToLast(action: string): this {\n this.dirty();\n return this.appendAction(this.last, action);\n }\n\n /**\n * Creates a copy of this ObjectPathQueue\n */\n public clone(): ObjectPathQueue {\n const clone = new ObjectPathQueue(this.toArray(), extend({}, this._relationships));\n clone._contextIndex = this._contextIndex;\n clone._siteIndex = this._siteIndex;\n clone._webIndex = this._webIndex;\n return clone;\n }\n\n /**\n * Gets a copy of this instance's paths\n */\n public toArray(): IObjectPath[] {\n return this._paths.slice(0);\n }\n\n /**\n * The last IObjectPath instance added to this collection\n */\n public get last(): IObjectPath {\n\n if (this._paths.length < 1) {\n return null;\n }\n\n return this._paths[this.lastIndex];\n }\n\n /**\n * Index of the last IObjectPath added to the queue\n */\n public get lastIndex(): number {\n return this._paths.length - 1;\n }\n\n /**\n * Gets the index of the current site in the queue\n */\n public get siteIndex(): number {\n\n if (this._siteIndex < 0) {\n\n // this needs to be here in case we create it\n const contextIndex = this.contextIndex;\n\n this._siteIndex = this.add(property(\"Site\",\n // actions\n objectPath()));\n\n this.addChildRelationship(contextIndex, this._siteIndex);\n }\n\n return this._siteIndex;\n }\n\n /**\n * Gets the index of the current web in the queue\n */\n public get webIndex(): number {\n\n if (this._webIndex < 0) {\n\n // this needs to be here in case we create it\n const contextIndex = this.contextIndex;\n\n this._webIndex = this.add(property(\"Web\",\n // actions\n objectPath()));\n\n this.addChildRelationship(contextIndex, this._webIndex);\n }\n\n return this._webIndex;\n }\n\n /**\n * Gets the index of the Current context in the queue, can be used to establish parent -> child rels\n */\n public get contextIndex(): number {\n if (this._contextIndex < 0) {\n this._contextIndex = this.add(staticProperty(\"Current\", \"{3747adcd-a3c3-41b9-bfab-4a64dd2f1e0a}\",\n // actions\n objectPath()));\n }\n\n return this._contextIndex;\n }\n\n /**\n * Generates a ~unique hash code for this ObjectPathQueue\n * \n * From: https://stackoverflow.com/questions/6122571/simple-non-secure-hash-function-for-javascript\n */\n // tslint:disable:no-bitwise\n public hash(): number {\n const s = this.toBody();\n let hash = 0;\n if (s.length === 0) {\n return hash;\n }\n\n for (let i = 0; i < s.length; i++) {\n const chr = s.charCodeAt(i);\n hash = ((hash << 5) - hash) + chr;\n hash |= 0; // Convert to 32bit integer\n }\n return hash;\n\n }\n // tslint:enable:no-bitwise\n\n public toBody(): string {\n\n if (objectDefinedNotNull(this._xml)) {\n return this._xml;\n }\n\n // create our xml payload\n this._xml = writeObjectPathBody(this.toIndexedTree());\n\n return this._xml;\n }\n\n /**\n * Conducts the string replacements for id, parent id, and path id\n * \n * @returns The tree with all string replacements made\n */\n public toIndexedTree(): IObjectPath[] {\n\n let builderIndex = -1;\n let lastOpId = -1;\n const idIndexMap: number[] = [];\n\n return this.toArray().map((op, index, arr) => {\n\n const opId = ++builderIndex;\n\n // track the array index => opId relationship\n idIndexMap.push(opId);\n\n // do path replacements\n op.path = opSetPathParamId(idIndexMap, opSetId(opId.toString(), op.path));\n\n if (lastOpId >= 0) {\n // if we have a parent do the replace\n op.path = opSetParentId(lastOpId.toString(), op.path);\n }\n\n // rewrite actions with placeholders replaced\n op.actions = op.actions.map(a => {\n const actionId = ++builderIndex;\n return opSetId(actionId.toString(), opSetPathId(opId.toString(), a));\n });\n\n // handle any specific child relationships\n this.getChildRelationship(index).forEach(childIndex => {\n // set the parent id for our non-immediate children, thus removing the token so it isn't overwritten\n arr[childIndex].path = opSetParentId(opId.toString(), arr[childIndex].path);\n });\n\n // and remember our last object path id for the parent replace above\n lastOpId = opId;\n\n return op;\n });\n }\n\n /**\n * Dirties this queue clearing any cached data\n */\n protected dirty(): void {\n this._xml = null;\n }\n}\n","import { getAttrValueFromString } from \"@pnp/common\";\nimport { IObjectPath } from \"./objectpath\";\n\n/**\n * Used within the request pipeline to parse ProcessQuery results\n */\nexport class ProcessQueryParser {\n\n constructor(protected op: IObjectPath) { }\n\n /**\n * Parses the response checking for errors\n * \n * @param r Response object\n */\n public parse(r: Response): Promise {\n\n return r.text().then(t => {\n\n if (!r.ok) {\n throw new Error(t);\n }\n\n try {\n return JSON.parse(t);\n } catch (e) {\n // special case in ProcessQuery where we got an error back, but it is not in json format\n throw new Error(t);\n }\n\n }).then((parsed: any[]) => {\n\n // here we need to check for an error body\n if (parsed.length > 0 && parsed[0].hasOwnProperty(\"ErrorInfo\") && parsed[0].ErrorInfo !== null) {\n throw new Error(JSON.stringify(parsed[0].ErrorInfo));\n }\n\n return this.findResult(parsed);\n });\n }\n\n public findResult(json: any): Promise {\n\n for (let i = 0; i < this.op.actions.length; i++) {\n\n const a = this.op.actions[i];\n\n // let's see if the result is null based on the ObjectPath action, if it exists\n // \n if (/^(json, parseInt(getAttrValueFromString(a, \"Id\"), 10));\n if (!result || (result && result.IsNull)) {\n return Promise.resolve(null);\n }\n }\n\n // let's see if we have a query result\n // \n if (/^(parsed: any[], id: number): R {\n\n for (let i = 0; i < parsed.length; i++) {\n\n if (parsed[i] === id) {\n return parsed[i + 1];\n }\n }\n\n return null;\n }\n}\n","import { FetchOptions, combinePaths, extend, getGUID, mergeHeaders, mergeOptions, objectDefinedNotNull } from \"@pnp/common\";\nimport { AlreadyInBatchException, CachingOptions, ICachingOptions, ODataParser, Queryable, RequestContext } from \"@pnp/odata\";\nimport { SPHttpClient, toAbsoluteUrl } from \"@pnp/sp\";\nimport { IObjectPathBatch } from \"./batch\";\nimport { ObjectPathQueue } from \"./objectpath\";\nimport { methodAction, objectPath, objectProperties, opQuery } from \"./opactionbuilders\";\nimport { IMethodParamsBuilder, method, property } from \"./opbuilders\";\nimport { ProcessQueryParser } from \"./parsers\";\n\n\nexport interface IClientSvcQueryable {\n select(...selects: string[]): this;\n usingCaching(options?: ICachingOptions): this;\n inBatch(batch: IObjectPathBatch): this;\n}\n\nexport interface ClientSvcQueryableConstructor {\n new(baseUrl: string | ClientSvcQueryable, objectPaths?: ObjectPathQueue): T;\n}\n\nconst ProcessQueryPath = \"_vti_bin/client.svc/ProcessQuery\";\n\nexport class ClientSvcQueryable extends Queryable implements IClientSvcQueryable {\n\n /**\n * Collection of select fields\n */\n protected _selects: string[];\n\n /**\n * Tracks the batch of which this query may be part\n */\n protected _batch: IObjectPathBatch;\n\n constructor(parent: ClientSvcQueryable | string = \"\", protected _objectPaths: ObjectPathQueue | null = null) {\n super();\n\n this._selects = [];\n\n if (typeof parent === \"string\") {\n\n // we assume the parent here is an absolute url to a web\n this._parentUrl = parent;\n this._url = combinePaths(parent.replace(ProcessQueryPath, \"\"), ProcessQueryPath);\n if (!objectDefinedNotNull(this._objectPaths)) {\n this._objectPaths = new ObjectPathQueue();\n }\n\n } else {\n this._parentUrl = parent._parentUrl;\n this._url = combinePaths(parent._parentUrl, ProcessQueryPath);\n if (!objectDefinedNotNull(_objectPaths)) {\n this._objectPaths = parent._objectPaths.clone();\n }\n this.configureFrom(parent);\n }\n }\n\n /**\n * Choose which fields to return\n *\n * @param selects One or more fields to return\n */\n public select(...selects: string[]): this {\n [].push.apply(this._selects, selects);\n return this;\n }\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 public inBatch(batch: IObjectPathBatch): this {\n\n if (this.batch !== null) {\n throw new AlreadyInBatchException();\n }\n\n this._batch = batch;\n\n return this;\n }\n\n /**\n * Gets the full url with query information\n *\n */\n public toUrlAndQuery(): string {\n return super.toUrl() + `?${this._query.getKeys().map(key => `${key}=${this._query.get(key)}`).join(\"&\")}`;\n }\n\n protected getSelects(): string[] {\n return objectDefinedNotNull(this._selects) ? this._selects : [];\n }\n\n /**\n * Gets a child object based on this instance's paths and the supplied paramters\n * \n * @param factory Instance factory of the child type\n * @param methodName Name of the method used to load the child\n * @param params Parameters required by the method to load the child\n */\n protected getChild(factory: ClientSvcQueryableConstructor, methodName: string, params: IMethodParamsBuilder | null): T {\n\n const objectPaths = this._objectPaths.clone();\n\n objectPaths.add(method(methodName, params,\n // actions\n objectPath()));\n\n return new factory(this, objectPaths);\n }\n\n /**\n * Gets a property of the current instance\n * \n * @param factory Instance factory of the child type\n * @param propertyName Name of the property to load\n */\n protected getChildProperty(factory: ClientSvcQueryableConstructor, propertyName: string): T {\n\n const objectPaths = this._objectPaths.clone();\n\n objectPaths.add(property(propertyName));\n\n return new factory(this, objectPaths);\n }\n\n /**\n * Sends a request\n * \n * @param op \n * @param options \n * @param parser \n */\n protected send(objectPaths: ObjectPathQueue, options: FetchOptions = {}, parser: ODataParser = null): Promise {\n\n if (!objectDefinedNotNull(parser)) {\n // we assume here that we want to return for this index path\n parser = new ProcessQueryParser(objectPaths.last);\n }\n\n if (this.hasBatch) {\n\n // this is using the options variable to pass some extra information downstream to the batch\n options = extend(options, {\n clientsvc_ObjectPaths: objectPaths.clone(),\n });\n\n } else {\n\n if (!Object.hasOwnProperty(\"body\")) {\n options = extend(options, {\n body: objectPaths.toBody(),\n });\n }\n }\n\n return super.postCore(options, parser);\n }\n\n /**\n * Sends the request, merging the result data with a new instance of factory\n */\n protected sendGet(factory: ClientSvcQueryableConstructor): Promise<(DataType & FactoryType)> {\n\n const ops = this._objectPaths.clone().appendActionToLast(opQuery(this.getSelects()));\n\n return this.send(ops).then(r => extend(new factory(this), r));\n }\n\n /**\n * Sends the request, merging the result data array with a new instances of factory\n */\n protected sendGetCollection(factory: ClientSvcQueryableConstructor): Promise<(DataType & FactoryType)[]> {\n\n const ops = this._objectPaths.clone().appendActionToLast(opQuery([], this.getSelects()));\n\n return this.send(ops).then(r => r.map(d => extend(new factory(this), d)));\n }\n\n /**\n * Invokes the specified method on the server and returns the result\n * \n * @param methodName Name of the method to invoke\n * @param params Method parameters\n * @param actions Any additional actions to execute in addition to the method invocation (set property for example)\n */\n protected invokeMethod(methodName: string, params: IMethodParamsBuilder | null = null, ...actions: string[]): Promise {\n return this.invokeMethodImpl(methodName, params, actions, opQuery([], null));\n }\n\n /**\n * Invokes the specified non-query method on the server\n * \n * @param methodName Name of the method to invoke\n * @param params Method parameters\n * @param actions Any additional actions to execute in addition to the method invocation (set property for example)\n */\n protected invokeNonQuery(methodName: string, params: IMethodParamsBuilder | null = null, ...actions: string[]): Promise {\n // by definition we are not returning anything from these calls so we should not be caching the results\n this._useCaching = false;\n return this.invokeMethodImpl(methodName, params, actions, null, true);\n }\n\n /**\n * Invokes the specified method on the server and returns the resulting collection\n * \n * @param methodName Name of the method to invoke\n * @param params Method parameters\n * @param actions Any additional actions to execute in addition to the method invocation (set property for example)\n */\n protected invokeMethodCollection(methodName: string, params: IMethodParamsBuilder | null = null, ...actions: string[]): Promise {\n return this.invokeMethodImpl(methodName, params, actions, opQuery([], []));\n }\n\n /**\n * Updates this instance, returning a copy merged with the updated data after the update\n * \n * @param properties Plain object of the properties and values to update\n * @param factory Factory method use to create a new instance of FactoryType\n */\n protected invokeUpdate(properties: any, factory: ClientSvcQueryableConstructor): Promise {\n\n const ops = this._objectPaths.clone();\n // append setting all the properties to this instance\n objectProperties(properties).map(a => ops.appendActionToLast(a));\n ops.appendActionToLast(opQuery([], null));\n return this.send(ops).then(r => extend(new factory(this), r));\n }\n\n /**\n * Converts the current instance to a request context\n *\n * @param verb The request verb\n * @param options The set of supplied request options\n * @param parser The supplied ODataParser instance\n * @param pipeline Optional request processing pipeline\n */\n protected toRequestContext(\n verb: string,\n options: FetchOptions,\n parser: ODataParser,\n pipeline: Array<(c: RequestContext) => Promise>>): Promise> {\n\n return toAbsoluteUrl(this.toUrlAndQuery()).then(url => {\n\n mergeOptions(options, this._options);\n\n const headers = new Headers();\n\n mergeHeaders(headers, options.headers);\n\n mergeHeaders(headers, {\n \"accept\": \"*/*\",\n \"content-type\": \"text/xml\",\n });\n\n options = extend(options, { headers });\n\n // we need to do some special cache handling to ensure we have a good key\n if (this._useCaching) {\n\n // because all the requests use the same url they would collide in the cache we use a special key\n const cacheKey = `PnPjs.ProcessQueryClient(${this._objectPaths.hash()})`;\n\n if (objectDefinedNotNull(this._cachingOptions)) {\n // if our key ends in the ProcessQuery url we overwrite it\n if (/\\/client\\.svc\\/ProcessQuery\\?$/i.test(this._cachingOptions.key)) {\n this._cachingOptions.key = cacheKey;\n }\n } else {\n this._cachingOptions = new CachingOptions(cacheKey);\n }\n }\n\n const dependencyDispose = this.hasBatch ? this.addBatchDependency() : () => { return; };\n\n // build our request context\n const context: RequestContext = {\n batch: this.batch,\n batchDependency: dependencyDispose,\n cachingOptions: this._cachingOptions,\n clientFactory: () => new SPHttpClient(),\n isBatched: this.hasBatch,\n isCached: this._useCaching,\n options: options,\n parser: parser,\n pipeline: pipeline,\n requestAbsoluteUrl: url,\n requestId: getGUID(),\n verb: verb,\n };\n\n return context;\n });\n }\n\n /**\n * Blocks a batch call from occuring, MUST be cleared by calling the returned function\n */\n protected addBatchDependency(): () => void {\n if (this._batch !== null) {\n return this._batch.addDependency();\n }\n\n return () => null;\n }\n\n /**\n * Indicates if the current query has a batch associated\n *\n */\n protected get hasBatch(): boolean {\n return objectDefinedNotNull(this._batch);\n }\n\n /**\n * The batch currently associated with this query or null\n *\n */\n protected get batch(): IObjectPathBatch {\n return this.hasBatch ? this._batch : null;\n }\n\n /**\n * Executes the actual invoke method call\n * \n * @param methodName Name of the method to invoke\n * @param params Method parameters\n * @param queryAction Specifies the query action to take\n */\n private invokeMethodImpl(methodName: string, params: IMethodParamsBuilder | null, actions: string[], queryAction: string, isAction = false): Promise {\n\n const ops = this._objectPaths.clone();\n\n if (isAction) {\n ops.appendActionToLast(methodAction(methodName, params));\n } else {\n ops.add(method(methodName, params, ...[objectPath(), ...actions, queryAction]));\n }\n\n return this.send(ops);\n }\n}\n","import { LogLevel, Logger } from \"@pnp/logging\";\nimport { CachingParserWrapper, ODataBatch, ODataBatchRequestInfo } from \"@pnp/odata\";\nimport { ClientSvcQueryable } from \"./clintsvcqueryable\";\nimport { ObjectPath, ObjectPathQueue, opSetId, opSetParentId, opSetPathId, opSetPathParamId } from \"./objectpath\";\nimport { objectPath } from \"./opactionbuilders\";\nimport { staticMethod } from \"./opbuilders\";\nimport { ProcessQueryParser } from \"./parsers\";\nimport { writeObjectPathBody } from \"./utils\";\n\nexport interface IObjectPathBatch extends ODataBatch {\n\n}\n\n/**\n * Implements ODataBatch for use with the ObjectPath framework\n */\nexport class ObjectPathBatch extends ODataBatch implements IObjectPathBatch {\n\n constructor(protected parentUrl: string, _batchId?: string) {\n super(_batchId);\n }\n\n protected executeImpl(): Promise {\n\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 Logger.write(`Resolving empty batch.`, LogLevel.Info);\n return Promise.resolve();\n }\n\n const executor = new BatchExecutor(this.parentUrl, this.batchId);\n executor.appendRequests(this.requests);\n return executor.execute();\n }\n}\n\nclass BatchExecutor extends ClientSvcQueryable {\n\n private _builderIndex: number;\n private _requests: ODataBatchRequestInfo[];\n\n constructor(parentUrl: string, public batchId: string) {\n super(parentUrl);\n\n this._requests = [];\n this._builderIndex = 1;\n\n // we add our session object path and hard code in the IDs so we can reference it\n const method = staticMethod(\"GetTaxonomySession\", \"{981cbc68-9edc-4f8d-872f-71146fcbb84f}\");\n method.path = opSetId(\"0\", method.path);\n method.actions.push(opSetId(\"1\", opSetPathId(\"0\", objectPath())));\n\n this._objectPaths.add(method);\n }\n\n public appendRequests(requests: ODataBatchRequestInfo[]): void {\n\n requests.forEach(request => {\n\n // grab the special property we added to options when we created the batch info\n const pathQueue: ObjectPathQueue = (request.options).clientsvc_ObjectPaths;\n\n let paths = pathQueue.toArray();\n\n // getChildRelationships\n if (paths.length < 0) {\n return;\n }\n\n let indexMappingFunction = (n: number) => n;\n\n if (/GetTaxonomySession/i.test(paths[0].path)) {\n\n // drop the first thing as it is a get session object path, which we add once for the entire batch\n paths = paths.slice(1);\n\n // replace the next item's parent id with 0, which will be the id of the session call at the root of this request\n paths[0].path = opSetParentId(\"0\", paths[0].path);\n\n indexMappingFunction = (n: number) => n - 1;\n }\n\n let lastOpId = -1;\n const idIndexMap: number[] = [];\n\n paths.map((op, index, arr) => {\n\n // rewrite the path string\n const opId = ++this._builderIndex;\n\n // track the array index => opId relationship\n idIndexMap.push(opId);\n\n let path = opSetPathParamId(idIndexMap, opSetId(opId.toString(), op.path), indexMappingFunction);\n if (lastOpId >= 0) {\n path = opSetParentId(lastOpId.toString(), path);\n }\n\n // rewrite actions with placeholders replaced\n const opActions = op.actions.map(a => {\n const actionId = ++this._builderIndex;\n return opSetId(actionId.toString(), opSetPathId(opId.toString(), a));\n });\n\n // handle any specific child relationships\n // the childIndex is reduced by 1 because we are removing the Session Path\n pathQueue.getChildRelationship(index + 1).map(i => i - 1).forEach(childIndex => {\n // set the parent id for our non-immediate children\n arr[childIndex].path = opSetParentId(opId.toString(), arr[childIndex].path);\n });\n\n // and remember our last object path id for the parent replace above\n lastOpId = opId;\n\n // return our now substituted path and actions as a new object path instance\n return new ObjectPath(path, opActions);\n\n }).forEach(op => this._objectPaths.add(op));\n\n // get this once\n const obPaths = this._objectPaths.toArray();\n\n // create a new parser to handle finding the result based on the path\n const parser = new ProcessQueryParser(obPaths[obPaths.length - 1]);\n\n if (request.parser instanceof CachingParserWrapper) {\n // handle special case of caching\n request.parser = new ProcessQueryCachingParserWrapper(parser, request.parser);\n } else {\n request.parser = parser;\n }\n\n // add the request to our batch requests\n this._requests.push(request);\n\n // remove the temp property\n delete (request.options).clientsvc_ObjectPaths;\n });\n }\n\n public execute(): Promise {\n\n Logger.write(`[${this.batchId}] (${(new Date()).getTime()}) Executing batch with ${this._requests.length} requests.`, LogLevel.Info);\n\n // create our request body from all the merged object paths\n const options = {\n body: writeObjectPathBody(this._objectPaths.toArray()),\n };\n\n Logger.write(`[${this.batchId}] (${(new Date()).getTime()}) Sending batch request.`, LogLevel.Info);\n\n // send the batch\n return super.postCore(options, new BatchParser()).then((rawResponse: any) => {\n\n Logger.write(`[${this.batchId}] (${(new Date()).getTime()}) Resolving batched requests.`, LogLevel.Info);\n\n return this._requests.reduce((chain, request) => {\n\n Logger.write(`[${request.id}] (${(new Date()).getTime()}) Resolving request in batch ${this.batchId}.`, LogLevel.Info);\n\n return chain.then(_ => (request.parser).findResult(rawResponse).then(request.resolve).catch(request.reject));\n\n }, Promise.resolve());\n });\n }\n}\n\n/**\n * Used to return the raw results from parsing the batch\n */\nclass BatchParser extends ProcessQueryParser {\n\n constructor() {\n super(null);\n }\n\n public findResult(json: any): Promise {\n // we leave it to the individual request parsers to find their results in the raw json body\n return json;\n }\n}\n\n/**\n * Handles processing batched results that are also cached\n */\nclass ProcessQueryCachingParserWrapper extends CachingParserWrapper {\n\n constructor(parser: ProcessQueryParser, wrapper: CachingParserWrapper) {\n super(parser, wrapper.cacheOptions);\n }\n\n public findResult(json: any): Promise {\n return (this.parser).findResult(json).then((d: any) => this.cacheData(d));\n }\n}\n"],"names":["objectDefinedNotNull","extend","getAttrValueFromString","tslib_1.__extends","combinePaths","AlreadyInBatchException","toAbsoluteUrl","mergeOptions","mergeHeaders","CachingOptions","SPHttpClient","getGUID","Queryable","Logger","ODataBatch","method","CachingParserWrapper"],"mappings":";;;;;;;QAII,OAAO,2DAAuD,CAAC;IACnE,CAAC;AAED;QACI,OAAO,oEAAgE,CAAC;IAC5E,CAAC;AAED,qBAAwB,gBAAiC,EAAE,qBAA6C;;;;QAAhF,iCAAA,EAAA,uBAAiC;QAAE,sCAAA,EAAA,4BAA6C;;;;QAUpG,IAAM,OAAO,GAAG,EAAE,CAAC;QACnB,OAAO,CAAC,IAAI,CAAC,oDAAgD,CAAC,CAAC;QAC/D,IAAI,gBAAgB,KAAK,IAAI,IAAI,gBAAgB,CAAC,MAAM,GAAG,CAAC,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