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
Link copied to clipboard
open class CallAgent

An agent responsible for remote calls.

Link copied to clipboard
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
typealias JSON = RemoteSerialization
Link copied to clipboard
data class JsonRpcRequest(val id: Int, val method: String, val params: List<String?>, val jsonrpc: String = "2.0")
Link copied to clipboard
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: <Error class: unknown class><T>, serializersModules: List<<Error class: unknown class>>? = null, val requestFilter: suspend <Error class: unknown class>.() -> Unit? = null)

Client side agent for JSON-RPC remote calls.

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

Binds HTTP calls to kotlin functions

Link copied to clipboard
open class KVServiceManagerJs<out T : Any>
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
data class RemoteData<T>(val data: List<T> = listOf(), val last_page: Int = 0, val last_row: Int? = null)
Link copied to clipboard
data class RemoteFilter(val field: String, val type: String, val value: String?)
Link copied to clipboard
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

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

HTTP response body types.

Link copied to clipboard
data class RouteMapEntry<T>(val method: <Error class: unknown class>, 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
class SecurityException(message: String)

A security exception.

Link copied to clipboard
abstract class SecurityMgr

Form login dispatcher.

Link copied to clipboard
typealias Serialization = RemoteSerialization
Link copied to clipboard
class ServiceException(message: String)
Link copied to clipboard
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.

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
inline fun <T : Any> getService(serializersModules: List<<Error class: unknown class>>? = null, noinline requestFilter: suspend <Error class: unknown class>.() -> 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_IN, OBJECTS_OUT> handleWebsocketConnection(deSerializer: ObjectDeSerializer, rawIn: <Error class: unknown class><String>, rawOut: <Error class: unknown class><String>, serializerIn: <Error class: unknown class><OBJECTS_IN>, serializerOut: <Error class: unknown class><OBJECTS_OUT>, service: T, function: suspend T.(<Error class: unknown class><OBJECTS_IN>, <Error class: unknown class><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: <Error class: unknown class><RAW_IN>, rawInToText: (RAW_IN) -> String?, rawOut: <Error class: unknown class><RAW_OUT>, rawOutFromText: (String) -> RAW_OUT, serializerIn: <Error class: unknown class><OBJECTS_IN>, serializerOut: <Error class: unknown class><OBJECTS_OUT>, service: T, function: suspend T.(<Error class: unknown class><OBJECTS_IN>, <Error class: unknown class><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<<Error class: unknown class>>? = 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

Properties

Link copied to clipboard
const val HTTP_UNAUTHORIZED: Int = 401

HTTP status unauthorized (401).