From 200dfa292e5432d8279fb6d2111480f4f44f0e95 Mon Sep 17 00:00:00 2001 From: Konstantin Ivanov <54908981+konstantiniiv@users.noreply.github.com> Date: Wed, 29 May 2024 13:49:58 +0200 Subject: [PATCH] DROID-2541 Protocol | Enhancement | MW v0.34.0-rc5 (#1242) --- gradle/libs.versions.toml | 2 +- protocol/src/main/proto/commands.proto | 36 +++++++++++++++++++++++- protocol/src/main/proto/localstore.proto | 1 + protocol/src/main/proto/models.proto | 16 +++++++++++ 4 files changed, 53 insertions(+), 2 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 447086fd04..c9f2749e84 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,5 +1,5 @@ [versions] -middlewareVersion = "v0.34.0-rc3" +middlewareVersion = "v0.34.0-rc5" kotlinVersion = '1.9.22' androidxCoreVersion = "1.13.0" diff --git a/protocol/src/main/proto/commands.proto b/protocol/src/main/proto/commands.proto index f68ff73387..d702fbd15e 100644 --- a/protocol/src/main/proto/commands.proto +++ b/protocol/src/main/proto/commands.proto @@ -1736,6 +1736,8 @@ message Rpc { } } + + // deprecated in favor of SearchWithMeta message Search { message Request { repeated anytype.model.Block.Content.Dataview.Filter filters = 1; @@ -1752,11 +1754,40 @@ message Rpc { message Response { Error error = 1; repeated google.protobuf.Struct records = 2; - message Error { Code code = 1; string description = 2; + enum Code { + NULL = 0; + UNKNOWN_ERROR = 1; + BAD_INPUT = 2; + // ... + } + } + } + } + message SearchWithMeta { + message Request { + repeated anytype.model.Block.Content.Dataview.Filter filters = 1; + repeated anytype.model.Block.Content.Dataview.Sort sorts = 2; + string fullText = 3; + int32 offset = 4; + int32 limit = 5; + // additional filter by objectTypes + repeated string objectTypeFilter = 6; // DEPRECATED, GO-1926 + // needed keys in details for return, when empty - will return all + repeated string keys = 7; + bool returnMeta = 8; // add ResultMeta to each result + bool returnMetaRelationDetails = 9; // add relation option details to meta + bool returnHTMLHighlightsInsteadOfRanges = 10; + } + message Response { + Error error = 1; + repeated model.Search.Result results = 2; + message Error { + Code code = 1; + string description = 2; enum Code { NULL = 0; UNKNOWN_ERROR = 1; @@ -3735,6 +3766,7 @@ message Rpc { string blockId = 2; string filePath = 3; string url = 4; + bytes bytes = 5; } message Response { @@ -6846,6 +6878,8 @@ message Rpc { PAYMENT_NODE_ERROR = 4; CACHE_ERROR = 5; INVALID_RECEIPT = 6; + PURCHASE_REGISTRATION_ERROR = 7; + SUBSCRIPTION_RENEW_ERROR = 8; } } } diff --git a/protocol/src/main/proto/localstore.proto b/protocol/src/main/proto/localstore.proto index 7bbfa013a9..853119bee1 100644 --- a/protocol/src/main/proto/localstore.proto +++ b/protocol/src/main/proto/localstore.proto @@ -61,4 +61,5 @@ message ObjectStoreChecksums { int32 filestoreKeysForceReindexCounter = 10; bool areOldFilesRemoved = 12; bool areDeletedObjectsReindexed = 13; + int32 linksErase = 14; } diff --git a/protocol/src/main/proto/models.proto b/protocol/src/main/proto/models.proto index d6941a3fd7..627faf21e1 100644 --- a/protocol/src/main/proto/models.proto +++ b/protocol/src/main/proto/models.proto @@ -52,6 +52,22 @@ enum SmartBlockType { NotificationObject = 0x217; } +message Search { + message Result { + string objectId = 1; + google.protobuf.Struct details = 2; // + repeated Meta meta = 3; // meta information about the search result + } + + message Meta { + string highlight = 1; // truncated text with highlights + repeated Range highlightRanges = 2; // ranges of the highlight in the text (using utf-16 runes) + string blockId = 3; // block id where the highlight has been found + string relationKey = 4; // relation key of the block where the highlight has been found + google.protobuf.Struct relationDetails = 5; // contains details for dependent object. E.g. relation option or type. todo: rename to dependantDetails + } +} + message Block { string id = 1; google.protobuf.Struct fields = 2;