Package io.kvision.remote

Types

CallAgent
Link copied to clipboard
js
open class CallAgent
An agent responsible for remote calls.
Credentials
Link copied to clipboard
js
data class Credentials(username: String?, password: String?)
Username and password credentials.
HttpMethod
Link copied to clipboard
common
enum HttpMethod : Enum<HttpMethod>
IllegalParameterCountException
Link copied to clipboard
class IllegalParameterCountException(actualParameterCount: Int, expectedParamterCount: Int) : RuntimeException
JSON
Link copied to clipboard
js
object JSON
JSON utility functions
JsonRpcRequest
Link copied to clipboard
common
data class JsonRpcRequest(id: Int, method: String, params: List<String?>, jsonrpc: String)
JsonRpcResponse
Link copied to clipboard
common
data class JsonRpcResponse(id: Int?, result: String?, error: String?, exceptionType: String?, jsonrpc: String)
KVRemoteAgent
Link copied to clipboard
js
open class KVRemoteAgent<T : Any>(serviceManager: KVServiceMgr<T>, beforeSend: (JQueryXHR, JQueryAjaxSettings) -> Boolean?) : RemoteAgent
Client side agent for JSON-RPC remote calls.
KVServiceBinder
Link copied to clipboard
abstract class KVServiceBinder<T, RH, WH>(deSerializer: ObjectDeSerializer, routeNameGenerator: NameGenerator?)
Binds HTTP calls to kotlin functions
KVServiceMgr
Link copied to clipboard
common
interface KVServiceMgr<T : Any>
Base interface for multiplatform service manager.
LoginService
Link copied to clipboard
js
class LoginService(loginEndpoint: String)
Form login dispatcher.
NameGenerator
Link copied to clipboard
typealias NameGenerator = () -> String
NotEnumTypeException
Link copied to clipboard
js
class NotEnumTypeException : Exception
NotStandardTypeException
Link copied to clipboard
js
class NotStandardTypeException(type: String) : Exception
Object
Link copied to clipboard
js
external class Object
JavaScript Object type
ObjectDeSerializer
Link copied to clipboard
interface ObjectDeSerializer
RemoteAgent
Link copied to clipboard
js
open class RemoteAgent
Interface for client side agent for JSON-RPC remote calls.
RemoteData
Link copied to clipboard
common
data class RemoteData<T>(data: List<T>, last_page: Int)
RemoteFilter
Link copied to clipboard
common
data class RemoteFilter(field: String, type: String, value: String?)
RemoteOption
Link copied to clipboard
common
data class RemoteOption(value: String?, text: String?, className: String?, subtext: String?, icon: String?, content: String?, disabled: Boolean, divider: Boolean)
RemoteSorter
Link copied to clipboard
common
data class RemoteSorter(field: String, dir: String)
RouteMapEntry
Link copied to clipboard
data class RouteMapEntry<T>(method: HttpMethod, path: String, handler: T)
RouteMapRegistry
Link copied to clipboard
interface RouteMapRegistry<T>
Stores a mapping from an HTTP-method+path to a handler
SecurityException
Link copied to clipboard
js
class SecurityException(message: String) : Exception
A security exception.
SecurityMgr
Link copied to clipboard
js
abstract class SecurityMgr
Form login dispatcher.
ServiceException
Link copied to clipboard
common
class ServiceException(message: String) : Exception
Socket
Link copied to clipboard
js
class Socket
A websocket client implementation.
SocketClosedException
Link copied to clipboard
js
class SocketClosedException(reason: String) : Throwable
Websocket closed exception class.

Functions

createNameGenerator
Link copied to clipboard
fun createNameGenerator(prefix: String): NameGenerator
createRouteMapRegistry
Link copied to clipboard
fun <T> createRouteMapRegistry(): RouteMapRegistry<T>
Create a default implementation of @see RouteMapRegistry
deserialize
Link copied to clipboard
inline fun <T> ObjectDeSerializer.deserialize(str: String?): T
getWebSocketUrl
Link copied to clipboard
js
fun getWebSocketUrl(url: String): String
Creates a websocket URL from current window.location and given path.
handleWebsocketConnection
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.
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.
kotlinxObjectDeSerializer
Link copied to clipboard
fun kotlinxObjectDeSerializer(): ObjectDeSerializer
obj
Link copied to clipboard
js
fun obj(init: dynamic.() -> Unit): dynamic
Helper function for creating JavaScript objects.
requireParameterCountEqualTo
Link copied to clipboard
fun requireParameterCountEqualTo(actualParameterCount: Int, expectedParamterCount: Int)
fun requireParameterCountEqualTo(params: Collection<*>, expectedParameterCount: Int)
serializeNonNull
Link copied to clipboard
inline fun <T> ObjectDeSerializer.serializeNonNull(obj: T): String
serializeNullable
Link copied to clipboard
inline fun <T> ObjectDeSerializer.serializeNullable(obj: T?): String?

Properties

HTTP_UNAUTHORIZED
Link copied to clipboard
js
const val HTTP_UNAUTHORIZED: Int = 401
HTTP status unauthorized (401).
kvSerializersModule
Link copied to clipboard
val kvSerializersModule: SerializersModule