ts-mailcow-api
Version:
TypeScript wrapper for the mailcow API.
39 lines • 1.48 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.routingEndpoints = routingEndpoints;
const ROUTING_ENDPOINTS = {
CREATE_RELAYHOST: 'add/relayhost',
CREATE_TRANSPORT_MAP: 'add/transport',
DELETE_RELAYHOST: 'delete/relayhost',
DELETE_TRANSPORT_MAP: 'delete/transport',
GET_RELAYHOST: 'get/relayhost/',
GET_TRANSPORT_MAP: 'get/transport/',
};
/**
* Binder function between the MailcowClient class and the RoutingEndpoints.
* @param bind - The MailcowClient instance to bind.
* @internal
*/
function routingEndpoints(bind) {
return {
createRelayhost(payload) {
return bind.requestFactory.post(ROUTING_ENDPOINTS.CREATE_RELAYHOST, payload);
},
createTransportMap(payload) {
return bind.requestFactory.post(ROUTING_ENDPOINTS.CREATE_TRANSPORT_MAP, payload);
},
deleteRelayhost(payload) {
return bind.requestFactory.post(ROUTING_ENDPOINTS.DELETE_RELAYHOST, payload.items);
},
deleteTransportMap(payload) {
return bind.requestFactory.post(ROUTING_ENDPOINTS.DELETE_TRANSPORT_MAP, payload.items);
},
getRelayhost(id) {
return bind.requestFactory.get(`${ROUTING_ENDPOINTS.GET_RELAYHOST}${id}`);
},
getTransportMap(id) {
return bind.requestFactory.get(`${ROUTING_ENDPOINTS.GET_TRANSPORT_MAP}${id}`);
},
};
}
//# sourceMappingURL=routing-endpoints.js.map