UNPKG

941 BJavaScriptView Raw
1import { __decorate } from "tslib";
2import { _SPCollection, spInvokableFactory, _SPInstance, } from "../spqueryable.js";
3import { defaultPath } from "../decorators.js";
4import { Site } from "../sites/types.js";
5let _HubSites = class _HubSites extends _SPCollection {
6 /**
7 * Gets a Hub Site from the collection by id
8 *
9 * @param id The Id of the Hub Site
10 */
11 getById(id) {
12 return HubSite(this, `GetById?hubSiteId='${id}'`);
13 }
14};
15_HubSites = __decorate([
16 defaultPath("_api/hubsites")
17], _HubSites);
18export { _HubSites };
19export const HubSites = spInvokableFactory(_HubSites);
20export class _HubSite extends _SPInstance {
21 /**
22 * Gets the ISite instance associated with this hubsite
23 */
24 async getSite() {
25 const d = await this.select("SiteUrl")();
26 return Site([this, d.SiteUrl]);
27 }
28}
29export const HubSite = spInvokableFactory(_HubSite);
30//# sourceMappingURL=types.js.map
\No newline at end of file