UNPKG

676 BJavaScriptView Raw
1import { addProp, body } from "@pnp/queryable";
2import { _Web, Web } from "../webs/types.js";
3import { SiteUsers, SiteUser } from "./types.js";
4import { odataUrlFrom } from "../utils/odata-url-from.js";
5import { spPost } from "../operations.js";
6addProp(_Web, "siteUsers", SiteUsers);
7addProp(_Web, "currentUser", SiteUser);
8_Web.prototype.ensureUser = async function (logonName) {
9 const data = await spPost(Web(this, "ensureuser"), body({ logonName }));
10 return {
11 data,
12 user: SiteUser([this, odataUrlFrom(data)]),
13 };
14};
15_Web.prototype.getUserById = function (id) {
16 return SiteUser(this, `getUserById(${id})`);
17};
18//# sourceMappingURL=web.js.map
\No newline at end of file