1 | import { hOP } from "@pnp/core";
|
2 | import { spPost } from "../operations.js";
|
3 | import { SPQueryable, _SPQueryable } from "../spqueryable.js";
|
4 | import { extractWebUrl } from "../utils/extract-web-url.js";
|
5 | _SPQueryable.prototype.getContextInfo = async function (path = this.parentUrl) {
|
6 | const data = await spPost(SPQueryable([this, extractWebUrl(path)], "_api/contextinfo"));
|
7 | if (hOP(data, "GetContextWebInformation")) {
|
8 | const info = data.GetContextWebInformation;
|
9 | info.SupportedSchemaVersions = info.SupportedSchemaVersions.results;
|
10 | return info;
|
11 | }
|
12 | else {
|
13 | return data;
|
14 | }
|
15 | };
|
16 |
|
\ | No newline at end of file |