ts-mailcow-api
Version:
TypeScript wrapper for the mailcow API.
34 lines (33 loc) • 1.19 kB
TypeScript
import { Alias, AliasDeleteRequest, AliasPostRequest, AliasEditRequest, MailcowResponse } from '../types';
import MailcowClient from '../index';
/**
* Interface for all Alias endpoints.
*/
export interface AliasEndpoints {
/**
* Endpoint for getting mailbox aliases in the system.
* @param id - The id of the alias you want to get. Use 'all' to retrieve all aliases in the system.
*/
get(id?: number | 'all'): Promise<Alias[]>;
/**
* Endpoint for creating mailbox aliases.
* @param payload - The creation payload.
*/
create(payload: AliasPostRequest): Promise<MailcowResponse>;
/**
* Endpoint for editing a mailbox alias.
* @param payload - The edit payload.
*/
edit(payload: AliasEditRequest): Promise<MailcowResponse>;
/**
* Endpoint for deleting a mailbox alias.
* @param payload - The deletion payload.
*/
delete(payload: AliasDeleteRequest): Promise<MailcowResponse>;
}
/**
* Binder function between the MailcowClient class and the AliasEndpoints.
* @param bind - The MailcowClient to bind.
* @internal
*/
export declare function aliasEndpoints(bind: MailcowClient): AliasEndpoints;