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

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

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
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, SH>(routeNameGenerator: NameGenerator? = null)

Binds HTTP calls to kotlin functions

Link copied to clipboard
expect open class KVServiceManager<out T : Any>(serviceClass: KClass<T>) : KVServiceMgr<T>

Multiplatform service manager.

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
typealias RequestHandler = suspend <Error class: unknown class><Unit, <Error class: unknown class>>.(Unit) -> Unit
Link copied to clipboard

HTTP response body types.

Link copied to clipboard
class ResultSerializer<T>(tSerializer: <Error class: unknown class><T>)

A custom serializer for the Result class.

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
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.

Link copied to clipboard
Link copied to clipboard
typealias WebsocketHandler = suspend <Error class: unknown class>.() -> Unit

Properties

Link copied to clipboard
const val HTTP_UNAUTHORIZED: Int = 401

HTTP status unauthorized (401).

Link copied to clipboard
val <Error class: unknown class>.injector: <Error class: unknown class>
Link copied to clipboard
val injectorKey: <Error class: unknown class>

Functions

Link copied to clipboard
fun <T : Any> <Error class: unknown class>.applyRoutes(serviceManager: KVServiceManager<T>, serializersModules: List<<Error class: unknown class>>? = null)

A function to generate routes based on definitions from the service manager.

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

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

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

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

Link copied to clipboard
fun getServiceManagers(vararg kclass: KClass<*>): List<KVServiceManager<*>>

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: <Error class: unknown class><String>, serializerOut: <Error class: unknown class><OBJECTS_OUT>, service: T, function: suspend T.(<Error class: unknown class><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: <Error class: unknown class><RAW_OUT>, rawOutFromText: (String) -> RAW_OUT, serializerOut: <Error class: unknown class><OBJECTS_OUT>, service: T, function: suspend T.(<Error class: unknown class><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: <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 <Error class: unknown class>.initStaticResources()

Initialize default static resources for Ktor server.

Link copied to clipboard
fun kotlinxObjectDeSerializer(serializersModules: List<<Error class: unknown class>>? = null): ObjectDeSerializer
Link copied to clipboard
fun <Error class: unknown class>.kvisionInit(vararg modules: Module): <Error class: unknown class>
fun <Error class: unknown class>.kvisionInit(initStaticResources: Boolean, vararg modules: Module): <Error class: unknown class>
fun <Error class: unknown class>.kvisionInit(initStaticResources: Boolean, json: <Error class: unknown class>, vararg modules: Module): <Error class: unknown class>

Initialization function for Ktor server.

fun <Error class: unknown class>.kvisionInit(json: <Error class: unknown class>, vararg modules: Module): <Error class: unknown class>

Initialization function for Ktor server with custom JsonSerializer.

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