@pnp/sp
Version:
pnp - provides a fluent api for working with SharePoint REST
18 lines • 822 B
JavaScript
import { addProp } from "@pnp/queryable";
import { _Web, Web } from "../webs/types.js";
import { Lists, List } from "./types.js";
import { odataUrlFrom } from "../utils/odata-url-from.js";
import { SPCollection } from "../spqueryable.js";
import { encodePath } from "../utils/encode-path-str.js";
addProp(_Web, "lists", Lists);
addProp(_Web, "siteUserInfoList", List);
addProp(_Web, "defaultDocumentLibrary", List);
addProp(_Web, "customListTemplates", SPCollection, "getcustomlisttemplates");
_Web.prototype.getList = function (listRelativeUrl) {
return List(this, `getList('${encodePath(listRelativeUrl)}')`);
};
_Web.prototype.getCatalog = async function (type) {
const data = await Web(this, `getcatalog(${type})`).select("Id")();
return List([this, odataUrlFrom(data)]);
};
//# sourceMappingURL=web.js.map