@magicbell/core
Version:
Official MagicBell API wrapper
24 lines • 650 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const ajax_js_1 = require("../../lib/ajax.js");
/**
* Class to interact with the config API endpoint.
*
* @example
* const repo = new ConfigRepository();
* const config = await repo.get();
*/
class ConfigRepository {
remotePathOrUrl;
constructor(remotePathOrUrl = '/config') {
this.remotePathOrUrl = remotePathOrUrl;
}
/**
* Get the configuration from the API server.
*/
get() {
return (0, ajax_js_1.fetchAPI)(this.remotePathOrUrl);
}
}
exports.default = ConfigRepository;
//# sourceMappingURL=ConfigRepository.js.map