mirror of
https://github.com/anyproto/anytype-kotlin.git
synced 2025-06-08 05:47:05 +09:00
Protocol | Basic API for search with subscriptions (#2049)
This commit is contained in:
parent
6255993aec
commit
ae3ab1c776
11 changed files with 246 additions and 5 deletions
|
@ -420,6 +420,30 @@ class BlockDataRepository(
|
|||
limit = limit
|
||||
)
|
||||
|
||||
override suspend fun searchObjectsWithSubscription(
|
||||
subscription: Id,
|
||||
sorts: List<DVSort>,
|
||||
filters: List<DVFilter>,
|
||||
fulltext: String,
|
||||
offset: Int,
|
||||
limit: Int,
|
||||
beforeId: Id?,
|
||||
afterId: Id?
|
||||
): List<Map<String, Any?>> = factory.remote.searchObjectsWithSubscription(
|
||||
subscription = subscription,
|
||||
sorts = sorts,
|
||||
filters = filters,
|
||||
fulltext = fulltext,
|
||||
offset = offset,
|
||||
limit = limit,
|
||||
afterId = afterId,
|
||||
beforeId = beforeId
|
||||
)
|
||||
|
||||
override suspend fun cancelObjectSearchSubscription(
|
||||
subscriptions: List<Id>
|
||||
) = factory.remote.cancelObjectSearchSubscription(subscriptions)
|
||||
|
||||
override suspend fun relationListAvailable(ctx: Id) = factory.remote.relationListAvailable(ctx)
|
||||
|
||||
override suspend fun addRelationToObject(
|
||||
|
|
|
@ -143,6 +143,19 @@ interface BlockDataStore {
|
|||
limit: Int
|
||||
): List<Map<String, Any?>>
|
||||
|
||||
suspend fun searchObjectsWithSubscription(
|
||||
subscription: Id,
|
||||
sorts: List<DVSort>,
|
||||
filters: List<DVFilter>,
|
||||
fulltext: String,
|
||||
offset: Int,
|
||||
limit: Int,
|
||||
beforeId: Id?,
|
||||
afterId: Id?,
|
||||
): List<Map<String, Any?>>
|
||||
|
||||
suspend fun cancelObjectSearchSubscription(subscriptions: List<Id>)
|
||||
|
||||
suspend fun relationListAvailable(ctx: Id): List<Relation>
|
||||
suspend fun addRelationToObject(ctx: Id, relation: Id) : Payload
|
||||
suspend fun deleteRelationFromObject(ctx: Id, relation: Id): Payload
|
||||
|
|
|
@ -149,6 +149,19 @@ interface BlockRemote {
|
|||
limit: Int
|
||||
): List<Map<String, Any?>>
|
||||
|
||||
suspend fun searchObjectsWithSubscription(
|
||||
subscription: Id,
|
||||
sorts: List<DVSort>,
|
||||
filters: List<DVFilter>,
|
||||
fulltext: String,
|
||||
offset: Int,
|
||||
limit: Int,
|
||||
beforeId: Id?,
|
||||
afterId: Id?,
|
||||
): List<Map<String, Any?>>
|
||||
|
||||
suspend fun cancelObjectSearchSubscription(subscriptions: List<Id>)
|
||||
|
||||
suspend fun relationListAvailable(ctx: Id): List<Relation>
|
||||
suspend fun addRelationToObject(ctx: Id, relation: Id) : Payload
|
||||
suspend fun deleteRelationFromObject(ctx: Id, relation: Id): Payload
|
||||
|
|
|
@ -334,6 +334,30 @@ class BlockRemoteDataStore(private val remote: BlockRemote) : BlockDataStore {
|
|||
limit = limit
|
||||
)
|
||||
|
||||
override suspend fun searchObjectsWithSubscription(
|
||||
subscription: Id,
|
||||
sorts: List<DVSort>,
|
||||
filters: List<DVFilter>,
|
||||
fulltext: String,
|
||||
offset: Int,
|
||||
limit: Int,
|
||||
beforeId: Id?,
|
||||
afterId: Id?
|
||||
): List<Map<String, Any?>> = remote.searchObjectsWithSubscription(
|
||||
subscription = subscription,
|
||||
sorts = sorts,
|
||||
filters = filters,
|
||||
fulltext = fulltext,
|
||||
offset = offset,
|
||||
limit = limit,
|
||||
afterId = afterId,
|
||||
beforeId = beforeId
|
||||
)
|
||||
|
||||
override suspend fun cancelObjectSearchSubscription(
|
||||
subscriptions: List<Id>
|
||||
) = remote.cancelObjectSearchSubscription(subscriptions)
|
||||
|
||||
override suspend fun relationListAvailable(ctx: Id): List<Relation> =
|
||||
remote.relationListAvailable(ctx)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue