Package-level declarations

Types

Link copied to clipboard

A base implementation of the ErrorResponseInterceptor interface used for intercepting HTTP responses. This will only return NetworkResponse.Error, never null. And will attempt to map whatever response body to a GenericAPIErrorResponse object, the "default" error type when dealing with Wire API.

Link copied to clipboard
Link copied to clipboard
internal fun interface ErrorResponseInterceptor<out ResponseType : Any>
Link copied to clipboard
Link copied to clipboard

An interceptor responsible for handling federation-related error responses in an HTTP call.

Link copied to clipboard
internal data class HttpResponseData(val headers: Map<String, String?>, val status: <Error class: unknown class>, val body: String, json: <Error class: unknown class>)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
class MockWebSocketSession(val coroutineContext: <Error class: unknown class> = EmptyCoroutineContext)
Link copied to clipboard
sealed class NetworkResponse<out T : Any>
Link copied to clipboard

Checks whether the HTTP response has a status code of 401 (Unauthorized). If the response status code matches HttpStatusCode.Unauthorized, it maps the response to a NetworkResponse.Error containing an KaliumException.Unauthorized exception with the HTTP status code as its error code.

Properties

Link copied to clipboard
val sensitiveJsonKeys: <Error class: unknown class>

Functions

Link copied to clipboard
fun deleteSensitiveItemsFromJson(text: String): String
Link copied to clipboard
internal inline fun <T : Any, R : Any> NetworkResponse<T>.flatMap(fn: (NetworkResponse.Success<T>) -> NetworkResponse<R>): NetworkResponse<R>
Link copied to clipboard
internal suspend fun handleUnsuccessfulResponse(result: <Error class: unknown class>): NetworkResponse.Error
Link copied to clipboard
fun <Error class: unknown class><out <Error class: unknown class>>.installWireDefaultRequest(serverConfigDTO: <Error class: unknown class>)
Link copied to clipboard
fun <T : Any> NetworkResponse<T>.isSuccessful(): Boolean
Link copied to clipboard
inline fun <T : Any, U : Any> NetworkResponse<T>.mapSuccess(mapping: (T) -> U): NetworkResponse<U>

If the request is successful, perform mapping and create a new Success with its result

Link copied to clipboard
fun obfuscatedJsonElement(element: <Error class: unknown class>): <Error class: unknown class>
Link copied to clipboard
fun obfuscatedJsonMessage(text: String): String
Link copied to clipboard
fun obfuscatePath(url: <Error class: unknown class>): String
Link copied to clipboard
internal inline fun <T : Any> NetworkResponse<T>.onFailure(fn: (NetworkResponse.Error) -> Unit): NetworkResponse<T>
Link copied to clipboard
internal inline fun <T : Any> NetworkResponse<T>.onSuccess(fn: (NetworkResponse.Success<T>) -> Unit): NetworkResponse<T>
Link copied to clipboard
internal fun <Error class: unknown class>.setUrl(baseUrl: <Error class: unknown class>, vararg path: String)
internal fun <Error class: unknown class>.setUrl(baseUrl: String, vararg path: String)
Link copied to clipboard
internal fun <Error class: unknown class>.setWSSUrl(baseUrl: <Error class: unknown class>, vararg path: String)
Link copied to clipboard
internal fun String.splitSetCookieHeader(): List<String>
Link copied to clipboard
internal inline suspend fun <BodyType : Any> wrapKaliumResponse(crossinline unsuccessfulResponseOverride: (HttpResponseData) -> NetworkResponse<BodyType>? = { null }, performRequest: () -> <Error class: unknown class>): NetworkResponse<BodyType>

Wraps a producer of HttpResponse and attempts to parse the server response based on the BodyType.

Link copied to clipboard
internal inline suspend fun <ResponseType : Any> wrapRequest(customErrorInterceptor: ErrorResponseInterceptor<ResponseType>? = null, json: <Error class: unknown class> = KtxSerializer.json, performRequest: () -> <Error class: unknown class>): NetworkResponse<ResponseType>

internal inline suspend fun <ResponseType : Any> wrapRequest(customErrorInterceptor: ErrorResponseInterceptor<ResponseType>? = null, successHandler: suspend (<Error class: unknown class>) -> NetworkResponse<ResponseType>, json: <Error class: unknown class> = KtxSerializer.json, performRequest: () -> <Error class: unknown class>): NetworkResponse<ResponseType>

Handles an HTTP response with an error status, transforming it into a corresponding NetworkResponse.