UNPKG

@pnp/cli-microsoft365

Version:

Manage Microsoft 365 and SharePoint Framework projects on any platform

22 lines 778 B
import request from '../request.js'; export const spp = { /** * Asserts whether the specified site is a content center * @param siteUrl The URL of the site to check * @throws error when site is not a content center. */ async assertSiteIsContentCenter(siteUrl) { const requestOptions = { url: `${siteUrl}/_api/web?$select=WebTemplateConfiguration`, headers: { accept: 'application/json;odata=nometadata' }, responseType: 'json' }; const response = await request.get(requestOptions); if (response.WebTemplateConfiguration !== 'CONTENTCTR#0') { throw Error(`${siteUrl} is not a content site.`); } } }; //# sourceMappingURL=spp.js.map