ts-mailcow-api
Version:
TypeScript wrapper for the mailcow API.
32 lines • 1.24 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ratelimitsEndpoints = ratelimitsEndpoints;
const request_factory_1 = require("../request-factory");
const RATELIMITS_ENDPOINTS = {
EDIT_DOMAIN: 'edit/rl-domain/',
EDIT_MAILBOX: 'edit/rl-mbox/',
GET_DOMAIN: 'get/rl-domain/',
GET_MAILBOX: 'get/rl-mbox/',
};
/**
* Binder function between the MailcowClient class and the RatelimitsEndpoints.
* @param bind - The MailcowClient instance to bind.
* @internal
*/
function ratelimitsEndpoints(bind) {
return {
editDomain(payload) {
return bind.requestFactory.post(RATELIMITS_ENDPOINTS.EDIT_DOMAIN, payload);
},
editMailbox(payload) {
return bind.requestFactory.post(RATELIMITS_ENDPOINTS.EDIT_MAILBOX, payload);
},
getDomain(domain = 'all') {
return (0, request_factory_1.wrapPromiseToArray)(bind.requestFactory.get(`${RATELIMITS_ENDPOINTS.GET_DOMAIN}${domain}`));
},
getMailbox(mailbox = 'all') {
return (0, request_factory_1.wrapPromiseToArray)(bind.requestFactory.get(`${RATELIMITS_ENDPOINTS.GET_MAILBOX}${mailbox}`));
},
};
}
//# sourceMappingURL=ratelimit-endpoints.js.map