1 | import { addProp } from "@pnp/queryable";
|
2 | import { _Web, Web } from "../webs/types.js";
|
3 | import { Lists, List } from "./types.js";
|
4 | import { odataUrlFrom } from "../utils/odata-url-from.js";
|
5 | import { SPCollection } from "../spqueryable.js";
|
6 | import { escapeQueryStrValue } from "../utils/escape-query-str.js";
|
7 | addProp(_Web, "lists", Lists);
|
8 | addProp(_Web, "siteUserInfoList", List);
|
9 | addProp(_Web, "defaultDocumentLibrary", List);
|
10 | addProp(_Web, "customListTemplates", SPCollection, "getcustomlisttemplates");
|
11 | _Web.prototype.getList = function (listRelativeUrl) {
|
12 | return List(this, `getList('${escapeQueryStrValue(listRelativeUrl)}')`);
|
13 | };
|
14 | _Web.prototype.getCatalog = async function (type) {
|
15 | const data = await Web(this, `getcatalog(${type})`).select("Id")();
|
16 | return List([this, odataUrlFrom(data)]);
|
17 | };
|
18 |
|
\ | No newline at end of file |