{"version":3,"file":"sp-clientsvc.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, jsS, hOP } 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 && hOP(parsed[0], \"ErrorInfo\") && parsed[0].ErrorInfo !== null) {\n throw new Error(jsS(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, combine, extend, getGUID, mergeHeaders, mergeOptions, objectDefinedNotNull, hOP } 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 = combine(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 = combine(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()}?${Array.from(this.query).map((v: [string, string]) => v[0] + \"=\" + v[1]).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 (!hOP(options, \"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: (d: DataType) => FactoryType): 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(factory(d), 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":["method"],"mappings":";;;;;;IAII,OAAO,uDAAuD,CAAC;CAClE;AAED;IACI,OAAO,gEAAgE,CAAC;CAC3E;AAED,iBAAwB,mBAA6B,IAAI,EAAE,wBAAyC,IAAI;;;;;;;IAUpG,MAAM,OAAO,GAAG,EAAE,CAAC;IACnB,OAAO,CAAC,IAAI,CAAC,gDAAgD,CAAC,CAAC;IAC/D,IAAI,gBAAgB,KAAK,IAAI,IAAI,gBAAgB,CAAC,MAAM,GAAG,CAAC,EAAE;QAC1D,OAAO,CAAC,IAAI,CAAC,qCAAqC,CAAC,CAAC;QACpD,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;QAC/B,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;KAC7B;SAAM;QACH,OAAO,CAAC,IAAI,CAAC,sCAAsC,CAAC,CAAC;Q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