ApiClientOptions<T>: T & {
    shouldRetryOnError?: ((error: ApiError, attemptNumber: number) => Promise<boolean> | boolean);
    handleValidationError?(error: Error): void;
    logDeprecationWarning?(params: {
        method: CommonHttpClientFetchRequest["method"];
        operationName: string;
        path: string;
    }): void;
}

Type Parameters

Type declaration

  • OptionalshouldRetryOnError?: ((error: ApiError, attemptNumber: number) => Promise<boolean> | boolean)

    Determine whether to retry the request on error.

      • (error, attemptNumber): Promise<boolean> | boolean
      • Parameters

        Returns Promise<boolean> | boolean

  • handleValidationError?:function
    • Custom validation error handler.

      Parameters

      • error: Error

      Returns void

  • logDeprecationWarning?:function
    • Custom deprecation warning logger.

      Parameters

      • params: {
            method: CommonHttpClientFetchRequest["method"];
            operationName: string;
            path: string;
        }
        • method: CommonHttpClientFetchRequest["method"]
        • operationName: string

          Either operation method name in case if it's not part of the service, or service name and operation method name separated by a dot.

          Examples: users.getUserById, getSystemConfig

        • path: string

      Returns void