UNPKG

dotcms

Version:

This library allows you to interact with DotCMS API's easily from the browser, nodejs and React Native. [Full Documentation](https://dotcms.github.io/core-web/dotcms/)

31 lines 1.02 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DotApiSite = void 0; const tslib_1 = require("tslib"); /** * Get information from {@link https://dotcms.com/docs/latest/multi-site-management | DotCMS Sites} */ class DotApiSite { constructor(httpClient) { this.dotCMSHttpClient = httpClient; } getCurrentSite() { return this.dotCMSHttpClient .request({ url: `/api/v1/site/currentSite` }) .then((response) => tslib_1.__awaiter(this, void 0, void 0, function* () { if (response.status === 200) { const data = yield response.json(); const _a = data.entity, { map } = _a, site = tslib_1.__rest(_a, ["map"]); return site; } throw { message: yield response.text(), statusCode: response.status }; })); } } exports.DotApiSite = DotApiSite; //# sourceMappingURL=DotApiSite.js.map