@pnp/sp
Version:
pnp - provides a fluent api for working with SharePoint REST
30 lines • 941 B
JavaScript
import { __decorate } from "tslib";
import { _SPCollection, spInvokableFactory, _SPInstance, } from "../spqueryable.js";
import { defaultPath } from "../decorators.js";
import { Site } from "../sites/types.js";
let _HubSites = class _HubSites extends _SPCollection {
/**
* Gets a Hub Site from the collection by id
*
* @param id The Id of the Hub Site
*/
getById(id) {
return HubSite(this, `GetById?hubSiteId='${id}'`);
}
};
_HubSites = __decorate([
defaultPath("_api/hubsites")
], _HubSites);
export { _HubSites };
export const HubSites = spInvokableFactory(_HubSites);
export class _HubSite extends _SPInstance {
/**
* Gets the ISite instance associated with this hubsite
*/
async getSite() {
const d = await this.select("SiteUrl")();
return Site([this, d.SiteUrl]);
}
}
export const HubSite = spInvokableFactory(_HubSite);
//# sourceMappingURL=types.js.map