Magek Framework
    Preparing search index...

    Interface ProviderAPIHandling

    interface ProviderAPIHandling {
        requestSucceeded(
            body?: unknown,
            headers?: Record<string, string | number | readonly string[]>,
        ): Promise<unknown>;
        requestFailed(error: Error): Promise<unknown>;
        healthRequestResult(body: unknown, isHealthy: boolean): Promise<unknown>;
    }
    Index

    Methods

    • Handles a successful API request by returning the response body.

      Parameters

      • Optionalbody: unknown

        The response body of the API request.

      • Optionalheaders: Record<string, string | number | readonly string[]>

        The headers of the API request.

      Returns Promise<unknown>

      A promise that resolves with the response body.

    • Handles a failed API request by returning an error.

      Parameters

      • error: Error

        The error that occurred during the API request.

      Returns Promise<unknown>

      A promise that resolves with the error.

    • Handles a health check response with appropriate status code.

      Parameters

      • body: unknown

        The health check results

      • isHealthy: boolean

        Whether all the components are UP

      Returns Promise<unknown>

      A promise that resolves with the response