diff --git a/CHANGELOG.md b/CHANGELOG.md index a4a6ae03ac1..a00799ecb03 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,12 +20,14 @@ Inited :) * `Set` * `Repos` * `Common` + * Interfaces related to `OneToManyKeyValueRepo` were renamed with convenience to `Read`/`Write` modifier before name + * All subclasses were renamed * Extensions `doForAll` and `getAll` were added for all current types of repos: * `ReadStandardCRUDRepo` - * `StandardReadKeyValueRepo` - * `OneToManyReadKeyValueRepo` - * `StandardReadKeyValueRepo` methods `values` and `keys` now have default value for `reversed` parameter `false` - * New `Flow`'s in `OneToManyWriteKeyValueRepo`: + * `ReadStandardKeyValueRepo` + * `ReadOneToManyKeyValueRepo` + * `ReadStandardKeyValueRepo` methods `values` and `keys` now have default value for `reversed` parameter `false` + * New `Flow`'s in `WriteOneToManyKeyValueRepo`: * `onNewValue` * `onValueRemoved` * `onDataCleared` diff --git a/repos/common/src/commonMain/kotlin/dev/inmo/micro_utils/repos/OneToManyKeyValueRepo.kt b/repos/common/src/commonMain/kotlin/dev/inmo/micro_utils/repos/OneToManyKeyValueRepo.kt index 71d34a5b5ef..4c6b71e6b9b 100644 --- a/repos/common/src/commonMain/kotlin/dev/inmo/micro_utils/repos/OneToManyKeyValueRepo.kt +++ b/repos/common/src/commonMain/kotlin/dev/inmo/micro_utils/repos/OneToManyKeyValueRepo.kt @@ -4,7 +4,7 @@ import dev.inmo.micro_utils.pagination.Pagination import dev.inmo.micro_utils.pagination.PaginationResult import kotlinx.coroutines.flow.Flow -interface OneToManyReadKeyValueRepo : Repo { +interface ReadOneToManyKeyValueRepo : Repo { suspend fun get(k: Key, pagination: Pagination, reversed: Boolean = false): PaginationResult suspend fun keys(pagination: Pagination, reversed: Boolean = false): PaginationResult suspend fun contains(k: Key): Boolean @@ -12,8 +12,10 @@ interface OneToManyReadKeyValueRepo : Repo { suspend fun count(k: Key): Long suspend fun count(): Long } +@Deprecated("Renamed", ReplaceWith("ReadOneToManyKeyValueRepo", "dev.inmo.micro_utils.repos.ReadOneToManyKeyValueRepo")) +typealias OneToManyReadKeyValueRepo = ReadOneToManyKeyValueRepo -interface OneToManyWriteKeyValueRepo : Repo { +interface WriteOneToManyKeyValueRepo : Repo { val onNewValue: Flow> val onValueRemoved: Flow> val onDataCleared: Flow @@ -22,5 +24,7 @@ interface OneToManyWriteKeyValueRepo : Repo { suspend fun remove(k: Key, v: Value) suspend fun clear(k: Key) } +@Deprecated("Renamed", ReplaceWith("WriteOneToManyKeyValueRepo", "dev.inmo.micro_utils.repos.WriteOneToManyKeyValueRepo")) +typealias OneToManyWriteKeyValueRepo = WriteOneToManyKeyValueRepo -interface OneToManyKeyValueRepo : OneToManyReadKeyValueRepo, OneToManyWriteKeyValueRepo \ No newline at end of file +interface OneToManyKeyValueRepo : ReadOneToManyKeyValueRepo, WriteOneToManyKeyValueRepo \ No newline at end of file diff --git a/repos/common/src/commonMain/kotlin/dev/inmo/micro_utils/repos/pagination/OneToManyPaginationExtensions.kt b/repos/common/src/commonMain/kotlin/dev/inmo/micro_utils/repos/pagination/OneToManyPaginationExtensions.kt index 313721d170b..0c3de2def3c 100644 --- a/repos/common/src/commonMain/kotlin/dev/inmo/micro_utils/repos/pagination/OneToManyPaginationExtensions.kt +++ b/repos/common/src/commonMain/kotlin/dev/inmo/micro_utils/repos/pagination/OneToManyPaginationExtensions.kt @@ -3,7 +3,7 @@ package dev.inmo.micro_utils.repos.pagination import dev.inmo.micro_utils.pagination.* import dev.inmo.micro_utils.repos.* -suspend inline fun > REPO.doForAll( +suspend inline fun > REPO.doForAll( @Suppress("REDUNDANT_INLINE_SUSPEND_FUNCTION_TYPE") methodCaller: suspend REPO.(Pagination) -> PaginationResult, block: (List>>) -> Unit @@ -25,11 +25,11 @@ suspend inline fun > RE } } -suspend inline fun > REPO.doForAll( +suspend inline fun > REPO.doForAll( block: (List>>) -> Unit ) = doForAll({ keys(it, false) }, block) -suspend inline fun > REPO.getAll( +suspend inline fun > REPO.getAll( @Suppress("REDUNDANT_INLINE_SUSPEND_FUNCTION_TYPE") methodCaller: suspend REPO.(Pagination) -> PaginationResult ): List>> { diff --git a/repos/exposed/src/jvmMain/kotlin/dev/inmo/micro_utils/repos/exposed/onetomany/AbstractOneToManyExposedKeyValueRepo.kt b/repos/exposed/src/jvmMain/kotlin/dev/inmo/micro_utils/repos/exposed/onetomany/AbstractExposedOneToManyKeyValueRepo.kt similarity index 66% rename from repos/exposed/src/jvmMain/kotlin/dev/inmo/micro_utils/repos/exposed/onetomany/AbstractOneToManyExposedKeyValueRepo.kt rename to repos/exposed/src/jvmMain/kotlin/dev/inmo/micro_utils/repos/exposed/onetomany/AbstractExposedOneToManyKeyValueRepo.kt index 8553c12e611..f0f5e45aa1e 100644 --- a/repos/exposed/src/jvmMain/kotlin/dev/inmo/micro_utils/repos/exposed/onetomany/AbstractOneToManyExposedKeyValueRepo.kt +++ b/repos/exposed/src/jvmMain/kotlin/dev/inmo/micro_utils/repos/exposed/onetomany/AbstractExposedOneToManyKeyValueRepo.kt @@ -4,11 +4,11 @@ import dev.inmo.micro_utils.repos.OneToManyKeyValueRepo import org.jetbrains.exposed.sql.* import org.jetbrains.exposed.sql.transactions.transaction -abstract class AbstractOneToManyExposedKeyValueRepo( +abstract class AbstractExposedOneToManyKeyValueRepo( keyColumnAllocator: ColumnAllocator, valueColumnAllocator: ColumnAllocator, database: Database -) : OneToManyKeyValueRepo, AbstractOneToManyExposedReadKeyValueRepo( +) : OneToManyKeyValueRepo, AbstractExposedReadOneToManyKeyValueRepo( keyColumnAllocator, valueColumnAllocator, database @@ -30,3 +30,6 @@ abstract class AbstractOneToManyExposedKeyValueRepo( transaction(database) { deleteWhere { keyColumn.eq(k) } } } } + +@Deprecated("Renamed", ReplaceWith("AbstractExposedOneToManyKeyValueRepo", "dev.inmo.micro_utils.repos.exposed.onetomany.AbstractExposedOneToManyKeyValueRepo")) +typealias AbstractOneToManyExposedKeyValueRepo = AbstractExposedOneToManyKeyValueRepo diff --git a/repos/exposed/src/jvmMain/kotlin/dev/inmo/micro_utils/repos/exposed/onetomany/AbstractOneToManyExposedReadKeyValueRepo.kt b/repos/exposed/src/jvmMain/kotlin/dev/inmo/micro_utils/repos/exposed/onetomany/AbstractExposedReadOneToManyKeyValueRepo.kt similarity index 77% rename from repos/exposed/src/jvmMain/kotlin/dev/inmo/micro_utils/repos/exposed/onetomany/AbstractOneToManyExposedReadKeyValueRepo.kt rename to repos/exposed/src/jvmMain/kotlin/dev/inmo/micro_utils/repos/exposed/onetomany/AbstractExposedReadOneToManyKeyValueRepo.kt index 72ccc7ae84f..445ad25a04f 100644 --- a/repos/exposed/src/jvmMain/kotlin/dev/inmo/micro_utils/repos/exposed/onetomany/AbstractOneToManyExposedReadKeyValueRepo.kt +++ b/repos/exposed/src/jvmMain/kotlin/dev/inmo/micro_utils/repos/exposed/onetomany/AbstractExposedReadOneToManyKeyValueRepo.kt @@ -1,17 +1,17 @@ package dev.inmo.micro_utils.repos.exposed.onetomany import dev.inmo.micro_utils.pagination.* -import dev.inmo.micro_utils.repos.OneToManyReadKeyValueRepo +import dev.inmo.micro_utils.repos.ReadOneToManyKeyValueRepo import org.jetbrains.exposed.sql.* import org.jetbrains.exposed.sql.transactions.transaction typealias ColumnAllocator = Table.() -> Column -abstract class AbstractOneToManyExposedReadKeyValueRepo( +abstract class AbstractExposedReadOneToManyKeyValueRepo( keyColumnAllocator: ColumnAllocator, valueColumnAllocator: ColumnAllocator, protected val database: Database -) : OneToManyReadKeyValueRepo, Table() { +) : ReadOneToManyKeyValueRepo, Table() { protected val keyColumn: Column = keyColumnAllocator() protected val valueColumn: Column = valueColumnAllocator() @@ -45,3 +45,6 @@ abstract class AbstractOneToManyExposedReadKeyValueRepo( select { keyColumn.eq(k).and(valueColumn.eq(v)) }.limit(1).any() } } + +@Deprecated("Renamed", ReplaceWith("AbstractExposedReadOneToManyKeyValueRepo", "dev.inmo.micro_utils.repos.exposed.onetomany.AbstractExposedReadOneToManyKeyValueRepo")) +typealias AbstractOneToManyExposedReadKeyValueRepo = AbstractExposedReadOneToManyKeyValueRepo diff --git a/repos/inmemory/src/commonMain/kotlin/dev/inmo/micro_utils/repos/MapOneToManyKeyValueRepo.kt b/repos/inmemory/src/commonMain/kotlin/dev/inmo/micro_utils/repos/MapOneToManyKeyValueRepo.kt index 2b182615901..266f98c3baa 100644 --- a/repos/inmemory/src/commonMain/kotlin/dev/inmo/micro_utils/repos/MapOneToManyKeyValueRepo.kt +++ b/repos/inmemory/src/commonMain/kotlin/dev/inmo/micro_utils/repos/MapOneToManyKeyValueRepo.kt @@ -5,9 +5,9 @@ import dev.inmo.micro_utils.pagination.* import dev.inmo.micro_utils.pagination.utils.paginate import kotlinx.coroutines.flow.Flow -class ReadOneToManyKeyValueRepo( +class MapReadOneToManyKeyValueRepo( private val map: Map> = emptyMap() -) : OneToManyReadKeyValueRepo { +) : ReadOneToManyKeyValueRepo { override suspend fun get(k: Key, pagination: Pagination, reversed: Boolean): PaginationResult { val list = map[k] ?: return emptyPaginationResult() @@ -44,9 +44,9 @@ class ReadOneToManyKeyValueRepo( override suspend fun count(): Long = map.size.toLong() } -class WriteOneToManyKeyValueRepo( +class MapWriteOneToManyKeyValueRepo( private val map: MutableMap> = mutableMapOf() -) : OneToManyWriteKeyValueRepo { +) : WriteOneToManyKeyValueRepo { private val _onNewValue: BroadcastFlow> = BroadcastFlow() override val onNewValue: Flow> get() = _onNewValue @@ -74,8 +74,8 @@ class WriteOneToManyKeyValueRepo( class MapOneToManyKeyValueRepo( private val map: MutableMap> = mutableMapOf() ) : OneToManyKeyValueRepo, - OneToManyReadKeyValueRepo by ReadOneToManyKeyValueRepo(map), - OneToManyWriteKeyValueRepo by WriteOneToManyKeyValueRepo(map) + ReadOneToManyKeyValueRepo by MapReadOneToManyKeyValueRepo(map), + WriteOneToManyKeyValueRepo by MapWriteOneToManyKeyValueRepo(map) fun MutableMap>.asOneToManyKeyValueRepo(): OneToManyKeyValueRepo = MapOneToManyKeyValueRepo( map { (k, v) -> k to v.toMutableList() }.toMap().toMutableMap() diff --git a/repos/ktor/client/src/commonMain/kotlin/dev/inmo/micro_utils/repos/ktor/client/one_to_many/KtorOneToManyKeyValueRepo.kt b/repos/ktor/client/src/commonMain/kotlin/dev/inmo/micro_utils/repos/ktor/client/one_to_many/KtorOneToManyKeyValueRepo.kt index d6107824816..8dc20ae25ad 100644 --- a/repos/ktor/client/src/commonMain/kotlin/dev/inmo/micro_utils/repos/ktor/client/one_to_many/KtorOneToManyKeyValueRepo.kt +++ b/repos/ktor/client/src/commonMain/kotlin/dev/inmo/micro_utils/repos/ktor/client/one_to_many/KtorOneToManyKeyValueRepo.kt @@ -1,8 +1,8 @@ package dev.inmo.micro_utils.repos.ktor.client.one_to_many import dev.inmo.micro_utils.repos.OneToManyKeyValueRepo -import dev.inmo.micro_utils.repos.OneToManyReadKeyValueRepo -import dev.inmo.micro_utils.repos.OneToManyWriteKeyValueRepo +import dev.inmo.micro_utils.repos.ReadOneToManyKeyValueRepo +import dev.inmo.micro_utils.repos.WriteOneToManyKeyValueRepo import io.ktor.client.HttpClient import kotlinx.serialization.KSerializer @@ -13,13 +13,13 @@ class KtorOneToManyKeyValueRepo( keySerializer: KSerializer, valueSerializer: KSerializer, ) : OneToManyKeyValueRepo, - OneToManyReadKeyValueRepo by KtorOneToManyReadKeyValueRepo ( + ReadOneToManyKeyValueRepo by KtorReadOneToManyKeyValueRepo ( "$baseUrl/$baseSubpart", client, keySerializer, valueSerializer, ), - OneToManyWriteKeyValueRepo by KtorOneToManyWriteKeyValueRepo ( + WriteOneToManyKeyValueRepo by KtorWriteOneToManyKeyValueRepo ( "$baseUrl/$baseSubpart", client, keySerializer, diff --git a/repos/ktor/client/src/commonMain/kotlin/dev/inmo/micro_utils/repos/ktor/client/one_to_many/KtorOneToManyReadKeyValueRepo.kt b/repos/ktor/client/src/commonMain/kotlin/dev/inmo/micro_utils/repos/ktor/client/one_to_many/KtorReadOneToManyKeyValueRepo.kt similarity index 95% rename from repos/ktor/client/src/commonMain/kotlin/dev/inmo/micro_utils/repos/ktor/client/one_to_many/KtorOneToManyReadKeyValueRepo.kt rename to repos/ktor/client/src/commonMain/kotlin/dev/inmo/micro_utils/repos/ktor/client/one_to_many/KtorReadOneToManyKeyValueRepo.kt index 0df6f253bf8..5dd4e23c9b8 100644 --- a/repos/ktor/client/src/commonMain/kotlin/dev/inmo/micro_utils/repos/ktor/client/one_to_many/KtorOneToManyReadKeyValueRepo.kt +++ b/repos/ktor/client/src/commonMain/kotlin/dev/inmo/micro_utils/repos/ktor/client/one_to_many/KtorReadOneToManyKeyValueRepo.kt @@ -6,18 +6,18 @@ import dev.inmo.micro_utils.ktor.common.buildStandardUrl import dev.inmo.micro_utils.pagination.Pagination import dev.inmo.micro_utils.pagination.PaginationResult import dev.inmo.micro_utils.pagination.asUrlQueryParts -import dev.inmo.micro_utils.repos.OneToManyReadKeyValueRepo +import dev.inmo.micro_utils.repos.ReadOneToManyKeyValueRepo import dev.inmo.micro_utils.repos.ktor.common.one_to_many.* import io.ktor.client.HttpClient import kotlinx.serialization.KSerializer import kotlinx.serialization.builtins.serializer -class KtorOneToManyReadKeyValueRepo ( +class KtorReadOneToManyKeyValueRepo ( private val baseUrl: String, private val client: HttpClient = HttpClient(), private val keySerializer: KSerializer, private val valueSerializer: KSerializer, -) : OneToManyReadKeyValueRepo { +) : ReadOneToManyKeyValueRepo { private val paginationValueResultSerializer = PaginationResult.serializer(valueSerializer) private val paginationKeyResultSerializer = PaginationResult.serializer(keySerializer) diff --git a/repos/ktor/client/src/commonMain/kotlin/dev/inmo/micro_utils/repos/ktor/client/one_to_many/KtorOneToManyWriteKeyValueRepo.kt b/repos/ktor/client/src/commonMain/kotlin/dev/inmo/micro_utils/repos/ktor/client/one_to_many/KtorWriteOneToManyKeyValueRepo.kt similarity index 56% rename from repos/ktor/client/src/commonMain/kotlin/dev/inmo/micro_utils/repos/ktor/client/one_to_many/KtorOneToManyWriteKeyValueRepo.kt rename to repos/ktor/client/src/commonMain/kotlin/dev/inmo/micro_utils/repos/ktor/client/one_to_many/KtorWriteOneToManyKeyValueRepo.kt index d714855ae25..3022463da8a 100644 --- a/repos/ktor/client/src/commonMain/kotlin/dev/inmo/micro_utils/repos/ktor/client/one_to_many/KtorOneToManyWriteKeyValueRepo.kt +++ b/repos/ktor/client/src/commonMain/kotlin/dev/inmo/micro_utils/repos/ktor/client/one_to_many/KtorWriteOneToManyKeyValueRepo.kt @@ -1,22 +1,36 @@ package dev.inmo.micro_utils.repos.ktor.client.one_to_many -import dev.inmo.micro_utils.ktor.client.BodyPair -import dev.inmo.micro_utils.ktor.client.unipost +import dev.inmo.micro_utils.coroutines.broadcastStateFlow +import dev.inmo.micro_utils.ktor.client.* import dev.inmo.micro_utils.ktor.common.buildStandardUrl -import dev.inmo.micro_utils.repos.OneToManyWriteKeyValueRepo +import dev.inmo.micro_utils.repos.WriteOneToManyKeyValueRepo import dev.inmo.micro_utils.repos.ktor.common.one_to_many.* import io.ktor.client.HttpClient +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.flow.Flow import kotlinx.serialization.KSerializer import kotlinx.serialization.builtins.PairSerializer import kotlinx.serialization.builtins.serializer -class KtorOneToManyWriteKeyValueRepo ( +class KtorWriteOneToManyKeyValueRepo ( private val baseUrl: String, private val client: HttpClient = HttpClient(), private val keySerializer: KSerializer, - private val valueSerializer: KSerializer, -) : OneToManyWriteKeyValueRepo { + private val valueSerializer: KSerializer +) : WriteOneToManyKeyValueRepo { private val keyValueSerializer = PairSerializer(keySerializer, valueSerializer) + override val onNewValue: Flow> = client.createStandardWebsocketFlow( + buildStandardUrl(baseUrl, onNewValueRoute), + deserializer = keyValueSerializer + ) + override val onValueRemoved: Flow> = client.createStandardWebsocketFlow( + buildStandardUrl(baseUrl, onValueRemovedRoute), + deserializer = keyValueSerializer + ) + override val onDataCleared: Flow = client.createStandardWebsocketFlow( + buildStandardUrl(baseUrl, onDataClearedRoute), + deserializer = keySerializer + ) override suspend fun add(k: Key, v: Value) = client.unipost( buildStandardUrl( diff --git a/repos/ktor/common/src/commonMain/kotlin/dev/inmo/micro_utils/repos/ktor/common/one_to_many/OneToManyRoutes.kt b/repos/ktor/common/src/commonMain/kotlin/dev/inmo/micro_utils/repos/ktor/common/one_to_many/OneToManyRoutes.kt index ed56f7ced53..637edd9bda1 100644 --- a/repos/ktor/common/src/commonMain/kotlin/dev/inmo/micro_utils/repos/ktor/common/one_to_many/OneToManyRoutes.kt +++ b/repos/ktor/common/src/commonMain/kotlin/dev/inmo/micro_utils/repos/ktor/common/one_to_many/OneToManyRoutes.kt @@ -7,6 +7,10 @@ const val containsByKeyValueRoute = "containsByKeyValue" const val countByKeyRoute = "countByKey" const val countRoute = "count" +const val onNewValueRoute = "onNewValue" +const val onValueRemovedRoute = "onValueRemoved" +const val onDataClearedRoute = "onDataCleared" + const val addRoute = "add" const val removeRoute = "remove" const val clearRoute = "clear" \ No newline at end of file diff --git a/repos/ktor/server/src/jvmMain/kotlin/dev/inmo/micro_utils/repos/ktor/server/one_to_many/ConfigureOneToManyReadKeyValueRepoRoutes.kt b/repos/ktor/server/src/jvmMain/kotlin/dev/inmo/micro_utils/repos/ktor/server/one_to_many/ConfigureOneToManyReadKeyValueRepoRoutes.kt index 0ef8beaeca0..07976b2e78e 100644 --- a/repos/ktor/server/src/jvmMain/kotlin/dev/inmo/micro_utils/repos/ktor/server/one_to_many/ConfigureOneToManyReadKeyValueRepoRoutes.kt +++ b/repos/ktor/server/src/jvmMain/kotlin/dev/inmo/micro_utils/repos/ktor/server/one_to_many/ConfigureOneToManyReadKeyValueRepoRoutes.kt @@ -5,7 +5,7 @@ import dev.inmo.micro_utils.ktor.server.decodeUrlQueryValueOrSendError import dev.inmo.micro_utils.ktor.server.unianswer import dev.inmo.micro_utils.pagination.PaginationResult import dev.inmo.micro_utils.pagination.extractPagination -import dev.inmo.micro_utils.repos.OneToManyReadKeyValueRepo +import dev.inmo.micro_utils.repos.ReadOneToManyKeyValueRepo import dev.inmo.micro_utils.repos.ktor.common.one_to_many.* import io.ktor.application.call import io.ktor.routing.Route @@ -14,7 +14,7 @@ import kotlinx.serialization.KSerializer import kotlinx.serialization.builtins.serializer fun Route.configureOneToManyReadKeyValueRepoRoutes( - originalRepo: OneToManyReadKeyValueRepo, + originalRepo: ReadOneToManyKeyValueRepo, keySerializer: KSerializer, valueSealizer: KSerializer, ) { diff --git a/repos/ktor/server/src/jvmMain/kotlin/dev/inmo/micro_utils/repos/ktor/server/one_to_many/ConfigureOneToManyWriteKeyValueRepoRoutes.kt b/repos/ktor/server/src/jvmMain/kotlin/dev/inmo/micro_utils/repos/ktor/server/one_to_many/ConfigureOneToManyWriteKeyValueRepoRoutes.kt index f39e0ee3b48..788ea78a16a 100644 --- a/repos/ktor/server/src/jvmMain/kotlin/dev/inmo/micro_utils/repos/ktor/server/one_to_many/ConfigureOneToManyWriteKeyValueRepoRoutes.kt +++ b/repos/ktor/server/src/jvmMain/kotlin/dev/inmo/micro_utils/repos/ktor/server/one_to_many/ConfigureOneToManyWriteKeyValueRepoRoutes.kt @@ -1,8 +1,7 @@ package dev.inmo.micro_utils.repos.ktor.server.one_to_many -import dev.inmo.micro_utils.ktor.server.unianswer -import dev.inmo.micro_utils.ktor.server.uniload -import dev.inmo.micro_utils.repos.OneToManyWriteKeyValueRepo +import dev.inmo.micro_utils.ktor.server.* +import dev.inmo.micro_utils.repos.WriteOneToManyKeyValueRepo import dev.inmo.micro_utils.repos.ktor.common.one_to_many.* import io.ktor.application.call import io.ktor.routing.Route @@ -12,12 +11,28 @@ import kotlinx.serialization.builtins.PairSerializer import kotlinx.serialization.builtins.serializer fun Route.configureOneToManyWriteKeyValueRepoRoutes( - originalRepo: OneToManyWriteKeyValueRepo, + originalRepo: WriteOneToManyKeyValueRepo, keySerializer: KSerializer, valueSealizer: KSerializer, ) { val keyValueSerializer = PairSerializer(keySerializer, valueSealizer) + includeWebsocketHandling( + onNewValueRoute, + originalRepo.onNewValue, + keyValueSerializer + ) + includeWebsocketHandling( + onValueRemovedRoute, + originalRepo.onValueRemoved, + keyValueSerializer + ) + includeWebsocketHandling( + onDataClearedRoute, + originalRepo.onDataCleared, + keySerializer + ) + post(addRoute) { val obj = call.uniload( keyValueSerializer