ts-mailcow-api
    Preparing search index...

    Class RequestFactoryInternal

    Factory method patterns for creating Axios Requests.

    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

    Methods

    • GET Request Factory

      Type Parameters

      • T

      Parameters

      • route: string

        The route to which to send the request.

      Returns Promise<T>

    post

    • post<T, P extends object>(route: string, payload: P): Promise<T>

      POST Request Factory

      Type Parameters

      • T
      • P extends object

      Parameters

      • route: string

        The route to which to send the request.

      • payload: P

        The payload to send with the request.

      Returns Promise<T>

    • Executes a request and applies Mailcow-specific error handling: a 2XX response with type: 'danger' or type: 'error' is converted into a MailcowException, and an axios error whose response body looks like a Mailcow error is unwrapped into a MailcowException as well.

      Type Parameters

      • T

      Parameters

      Returns Promise<T>