Package-level declarations

A set of components for creating multiplatform automatic JSON-RPC connectivity with a backend server.

A set of components for creating multiplatform automatic JSON-RPC connectivity with a backend server.

A set of components for creating multiplatform automatic JSON-RPC connectivity with a backend server.

Types

Link copied to clipboard
@Serializable
abstract class AbstractServiceException : Exception
Link copied to clipboard
open class CallAgent

An agent responsible for remote calls.

Link copied to clipboard

An exception thrown when the server returns a non-json response for a json-rpc call.

Link copied to clipboard
@Serializable
data class Credentials(val username: String? = null, val password: String? = null)

Username and password credentials.

Link copied to clipboard
Link copied to clipboard
class IllegalParameterCountException(val actualParameterCount: Int, val expectedParamterCount: Int) : RuntimeException
Link copied to clipboard
@Serializable
data class JsonRpcRequest(val id: Int, val method: String, val params: List<String?>, val jsonrpc: String = "2.0")
Link copied to clipboard
@Serializable
data class JsonRpcResponse(val id: Int? = null, val result: String? = null, val error: String? = null, val exceptionType: String? = null, val exceptionJson: String? = null, val jsonrpc: String = "2.0")
Link copied to clipboard
open class KVRemoteAgent<T : Any>(val serviceManager: KVServiceMgr<T>, serializersModules: List<SerializersModule>? = null, val requestFilter: suspend RequestInit.() -> Unit? = null)

Client side agent for JSON-RPC remote calls.

Link copied to clipboard
abstract class KVServiceBinder<out T, RH, WH, SH>(routeNameGenerator: NameGenerator? = null)

Binds HTTP calls to kotlin functions

Link copied to clipboard
open class KVServiceManagerJs<out T : Any> : KVServiceMgr<T>
Link copied to clipboard
interface KVServiceMgr<out T : Any>

Base interface for fullstack service manager.

Link copied to clipboard
class LoginService(val loginEndpoint: String)

Form login dispatcher.

Link copied to clipboard
typealias NameGenerator = () -> String
Link copied to clipboard
external class Object

JavaScript Object type

Link copied to clipboard
Link copied to clipboard
@Serializable
data class RemoteData<T>(val data: List<T> = listOf(), val last_page: Int = 0, val last_row: Int? = null)
Link copied to clipboard
@Serializable
data class RemoteFilter(val field: String, val type: String, val value: String?)
Link copied to clipboard
@Serializable
data class RemoteOption(val value: String? = null, val text: String? = null, val className: String? = null, val subtext: String? = null, val icon: String? = null, val content: String? = null, val disabled: Boolean = false, val divider: Boolean = false)
Link copied to clipboard
expect object RemoteSerialization

JSON utility functions

actual object RemoteSerialization

JSON utility functions

actual object RemoteSerialization

JSON utility functions

Link copied to clipboard
@Serializable
data class RemoteSorter(val field: String, val dir: String)
Link copied to clipboard

HTTP response body types.

Link copied to clipboard
class ResultSerializer<T>(tSerializer: KSerializer<T>) : KSerializer<Result<T>>

A custom serializer for the Result class.

Link copied to clipboard
data class RouteMapEntry<T>(val method: HttpMethod, val path: String, val handler: T)
Link copied to clipboard
interface RouteMapRegistry<T>

Stores a mapping from an HTTP-method+path to a handler

Link copied to clipboard

A security exception.

Link copied to clipboard
abstract class SecurityMgr

Form login dispatcher.

Link copied to clipboard
Link copied to clipboard
@Serializable
data class SimpleRemoteOption(val value: String, val text: String? = null)
Link copied to clipboard
class Socket

A websocket client implementation.

Link copied to clipboard

Websocket closed exception class.

Properties

Link copied to clipboard
const val HTTP_UNAUTHORIZED: Int = 401

HTTP status unauthorized (401).

Functions

Link copied to clipboard
Link copied to clipboard

Create a default implementation of @see RouteMapRegistry

Link copied to clipboard
inline fun <T> ObjectDeSerializer.deserialize(str: String?): T
Link copied to clipboard
external fun encodeURIComponent(uri: String): String

JavaScript encodeURIComponent function

Link copied to clipboard
inline fun <T : Any> getService(serializersModules: List<SerializersModule>? = null, noinline requestFilter: suspend RequestInit.() -> Unit? = null): T

This will make IntelliJ think that this function exists. The real implementation will be generated by the KVision Gradle Plugin.

Link copied to clipboard

Creates a websocket URL from current window.location and given path.

Link copied to clipboard
suspend fun <T, OBJECTS_OUT> handleSseConnection(deSerializer: ObjectDeSerializer, rawOut: SendChannel<String>, serializerOut: KSerializer<OBJECTS_OUT>, service: T, function: suspend T.(SendChannel<OBJECTS_OUT>) -> Unit)

Convenience function for cases were the raw channel works with strings. See the overloaded method for details.

suspend fun <T, RAW_OUT, OBJECTS_OUT> handleSseConnection(deSerializer: ObjectDeSerializer, rawOut: SendChannel<RAW_OUT>, rawOutFromText: (String) -> RAW_OUT, serializerOut: KSerializer<OBJECTS_OUT>, service: T, function: suspend T.(SendChannel<OBJECTS_OUT>) -> Unit)

function receives a SendChannel, from which objects are read, serialized and sent to the client in the form of JSON-RPC calls.

Link copied to clipboard
suspend fun <T, OBJECTS_IN, OBJECTS_OUT> handleWebsocketConnection(deSerializer: ObjectDeSerializer, rawIn: ReceiveChannel<String>, rawOut: SendChannel<String>, serializerIn: KSerializer<OBJECTS_IN>, serializerOut: KSerializer<OBJECTS_OUT>, service: T, function: suspend T.(ReceiveChannel<OBJECTS_IN>, SendChannel<OBJECTS_OUT>) -> Unit)

Convenience function for cases were the raw channels work with strings. See the overloaded method for details.

suspend fun <T, RAW_IN, RAW_OUT, OBJECTS_IN, OBJECTS_OUT> handleWebsocketConnection(deSerializer: ObjectDeSerializer, rawIn: ReceiveChannel<RAW_IN>, rawInToText: (RAW_IN) -> String?, rawOut: SendChannel<RAW_OUT>, rawOutFromText: (String) -> RAW_OUT, serializerIn: KSerializer<OBJECTS_IN>, serializerOut: KSerializer<OBJECTS_OUT>, service: T, function: suspend T.(ReceiveChannel<OBJECTS_IN>, SendChannel<OBJECTS_OUT>) -> Unit)

Reads JSON-RPC calls from rawIn, deserializes them and forwards them in form of a channel to function. Additionally function also receives a SendChannel, from which objects are read, serialized and sent to the client in the form of JSON-RPC calls.

Link copied to clipboard
fun kotlinxObjectDeSerializer(serializersModules: List<SerializersModule>? = null): ObjectDeSerializer
Link copied to clipboard
fun obj(init: dynamic.() -> Unit): dynamic

Helper function for creating JavaScript objects.

Link copied to clipboard
fun requireParameterCountEqualTo(actualParameterCount: Int, expectedParamterCount: Int)
fun requireParameterCountEqualTo(params: Collection<*>, expectedParameterCount: Int)
Link copied to clipboard
Link copied to clipboard