1
0
Fork 0
mirror of https://github.com/anyproto/anytype-kotlin.git synced 2025-06-08 05:47:05 +09:00

MW | 0.17.23 (#2026)

This commit is contained in:
Evgenii Kozlov 2021-12-31 16:33:05 +03:00 committed by GitHub
parent ac3f68e6cb
commit 0004e4c546
Signed by: github
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 179 additions and 4 deletions

View file

@ -87,7 +87,7 @@ ext {
// Anytype
middleware_version = 'v0.17.21'
middleware_version = 'v0.17.23'
mainApplication = [
kotlin: "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version",

View file

@ -19,8 +19,10 @@ class EventHandler(
init {
scope.launch {
setEventHandlerMobile { bytes ->
scope.launch {
handle(bytes)
if (bytes != null) {
scope.launch {
handle(bytes)
}
}
}
}

View file

@ -3330,7 +3330,6 @@ message Rpc {
repeated string objectTypeFilter = 6; // deprecated, to be removed
// needed keys in details for return, when empty - will return all
repeated string keys = 7;
bool ignoreWorkspace = 8;
}
message Response {
@ -3405,6 +3404,117 @@ message Rpc {
}
}
message SearchSubscribe {
message Request {
// (optional) subscription identifier
// client can provide some string or middleware will generate it automatically
// if subId is already registered on middleware, the new query will replace previous subscription
string subId = 1;
// filters
repeated anytype.model.Block.Content.Dataview.Filter filters = 2;
// sorts
repeated anytype.model.Block.Content.Dataview.Sort sorts = 3;
// fulltext query (optional)
string fullText = 4;
// results limit
int32 limit = 5;
// initial offset; middleware will find afterId
int32 offset = 6;
// (required) needed keys in details for return, for object fields mw will return (and subscribe) objects as dependent
repeated string keys = 7;
// (optional) pagination: middleware will return results after given id
string afterId = 8;
// (optional) pagination: middleware will return results before given id
string beforeId = 9;
repeated string source = 10;
string ignoreWorkspace = 12;
}
message Response {
Error error = 1;
repeated google.protobuf.Struct records = 2;
repeated google.protobuf.Struct dependencies = 3;
string subId = 4;
Event.Object.Subscription.Counters counters = 5;
message Error {
Code code = 1;
string description = 2;
enum Code {
NULL = 0;
UNKNOWN_ERROR = 1;
BAD_INPUT = 2;
// ...
}
}
}
}
message IdsSubscribe {
message Request {
// (optional) subscription identifier
// client can provide some string or middleware will generate it automatically
// if subId is already registered on middleware, the new query will replace previous subscription
string subId = 1;
// ids for subscribe
repeated string ids = 2;
// sorts
// (required) needed keys in details for return, for object fields mw will return (and subscribe) objects as dependent
repeated string keys = 3;
string ignoreWorkspace = 11;
}
message Response {
Error error = 1;
repeated google.protobuf.Struct records = 2;
repeated google.protobuf.Struct dependencies = 3;
string subId = 4;
message Error {
Code code = 1;
string description = 2;
enum Code {
NULL = 0;
UNKNOWN_ERROR = 1;
BAD_INPUT = 2;
// ...
}
}
}
}
message SearchUnsubscribe {
message Request {
repeated string subIds = 1;
}
message Response {
Error error = 1;
message Error {
Code code = 1;
string description = 2;
enum Code {
NULL = 0;
UNKNOWN_ERROR = 1;
BAD_INPUT = 2;
}
}
}
}
message SetLayout {
message Request {
string contextId = 1;
@ -3822,6 +3932,31 @@ message Rpc {
}
}
message ObjectDuplicate {
message Request {
// id of template block for cloning
string contextId = 1;
}
message Response {
Error error = 1;
// created template id
string id = 2;
message Error {
Code code = 1;
string description = 2;
enum Code {
NULL = 0;
UNKNOWN_ERROR = 1;
BAD_INPUT = 2;
// ...
}
}
}
}
message ApplyTemplate {
message Request {
string contextId = 1;

View file

@ -30,6 +30,11 @@ message Event {
Object.Remove objectRemove = 54;
Object.Show objectShow = 30;
Object.Subscription.Add subscriptionAdd = 60;
Object.Subscription.Remove subscriptionRemove = 61;
Object.Subscription.Position subscriptionPosition = 62;
Object.Subscription.Counters subscriptionCounters = 63;
Block.Add blockAdd = 2;
Block.Delete blockDelete = 3;
Block.FilesUpload filesUpload = 4;
@ -108,21 +113,54 @@ message Event {
}
string id = 1; // context objectId
repeated KeyValue details = 2; // slice of changed key-values
repeated string subIds = 3;
}
// Overwrite current state
message Set {
string id = 1; // context objectId
google.protobuf.Struct details = 2; // can not be a partial state. Should replace client details state
repeated string subIds = 3;
}
// Unset existing detail keys
message Unset {
string id = 1; // context objectId
repeated string keys = 2;
repeated string subIds = 3;
}
}
message Subscription {
// Adds new document to subscriptions
message Add {
string id = 1; // object id
string afterId = 2; // id of previous doc in order, empty means first
}
// Removes document from subscription
message Remove {
string id = 1; // object id
}
// Indicates new position of document
message Position {
string id = 1; // object id
string afterId = 2; // id of previous doc in order, empty means first
}
message Counters {
// total available records
int64 total = 1;
// how many records available after
int64 nextCount = 2;
// how many records available before
int64 prevCount = 3;
}
}
message Relations {
message Set {
string id = 1; // context objectId