ts-mailcow-api
Version:
TypeScript wrapper for the mailcow API.
50 lines (49 loc) • 2.31 kB
TypeScript
import { CreateRelayhostRequest, CreateTransportMapRequest, DeleteRoutingRequest, MailcowResponse, Relayhost, TransportMap } from '../types';
import MailcowClient from '../index';
/**
* Interface for all Routing endpoints related to Mailcow.
*/
export interface RoutingEndpoints {
/**
* Creates a new Sender-Dependent Transport (Relayhost).
* @param payload - Object containing details for the relayhost.
* @returns A promise that resolves to a response indicating success or failure.
*/
createRelayhost(payload: CreateRelayhostRequest): Promise<MailcowResponse>;
/**
* Creates a new Transport Map.
* @param payload - Object containing details for the transport map.
* @returns A promise that resolves to a response indicating success or failure.
*/
createTransportMap(payload: CreateTransportMapRequest): Promise<MailcowResponse>;
/**
* Deletes specified Sender-Dependent Transports.
* @param payload - Object containing list of relayhost IDs to delete.
* @returns A promise that resolves to a response indicating success or failure.
*/
deleteRelayhost(payload: DeleteRoutingRequest): Promise<MailcowResponse>;
/**
* Deletes specified Transport Maps.
* @param payload - Object containing list of transport map IDs to delete.
* @returns A promise that resolves to a response indicating success or failure.
*/
deleteTransportMap(payload: DeleteRoutingRequest): Promise<MailcowResponse>;
/**
* Retrieves Sender-Dependent Transports by ID or all entries.
* @param id - The relayhost ID or 'all' to retrieve all relayhosts.
* @returns A promise that resolves to an array of `Relayhost` objects.
*/
getRelayhost(id: string): Promise<Relayhost[]>;
/**
* Retrieves Transport Maps by ID or all entries.
* @param id - The transport map ID or 'all' to retrieve all transport maps.
* @returns A promise that resolves to an array of `TransportMap` objects.
*/
getTransportMap(id: string): Promise<TransportMap[]>;
}
/**
* Binder function between the MailcowClient class and the RoutingEndpoints.
* @param bind - The MailcowClient instance to bind.
* @internal
*/
export declare function routingEndpoints(bind: MailcowClient): RoutingEndpoints;