@pnp/sp
Version:
pnp - provides a fluent api for working with SharePoint REST
16 lines • 653 B
JavaScript
import { hOP } from "@pnp/core";
import { spPost } from "../operations.js";
import { SPQueryable, _SPQueryable } from "../spqueryable.js";
import { extractWebUrl } from "../utils/extract-web-url.js";
_SPQueryable.prototype.getContextInfo = async function (path = this.parentUrl) {
const data = await spPost(SPQueryable([this, extractWebUrl(path)], "_api/contextinfo"));
if (hOP(data, "GetContextWebInformation")) {
const info = data.GetContextWebInformation;
info.SupportedSchemaVersions = info.SupportedSchemaVersions.results;
return info;
}
else {
return data;
}
};
//# sourceMappingURL=index.js.map