mirror of
https://github.com/anyproto/anytype-heart.git
synced 2025-06-07 21:37:04 +09:00

* GO-2450 Add Payments commands * GO-2450 Payment methods: remove IDs from requests * GO-2450 Use GetAccountEthAddress() * GO-2450 Use any-sync instead of pp repo * GO-2450 Add RequestedAnyName field * GO-2450 Basic nameservice methods * GO-2450 New methods for subscriptions/nameservice * GO-2450 Refactor: protos for payments * GO-2450 Downgrade go to 1.20 * GO-2450 Fix build * GO-2450 Refactoring: renames * GO-2450 GetPortalURL implemented; Test tiers * GO-2450 Update any-sync * GO-2450 Fix: bootstrap * GO-2450 Fix pp encryption: peer key -> sign key * GO-2450 Bug fix: Ethereum wallet address * GO-2450 Update tier names * GO-2450 Email verification methods * GO-2450 Return email if was verified before * GO-2450 Update any-sync * GO-2450 Update any-sync * GO-2395 WiP: cache for PP node * GO-2395: cache for PP node * GO-2395 Change logics: return 0 tier when no response from the pp * GO-2395 fix: cache logics * GO-2450 Use any-sync from feature-payments branch for now * GO-2395 any-sync update * GO-2395 Fixes after review * GO-2395 Refactoring after review * GO-2395 Review fixes * GO-2395 Build fix * GO-2450 Refactoring: payments interface; tier -> int32 * GO-2450 Add FinalizeSubscription method * GO-2450 Cache fix * GO-2450 GetSubscriptionStatus: add NoCache * GO-2734 Add global name to cache WIP * GO-2450 go mod tidy * GO-2450 Update any-sync * GO-2450 Linter fix * GO-2450 PaymentsTiersGet * GO-2450 Refactoring: PaymentsGetTiers * GO-2450 NS: implement NameServiceResolveAnyId * GO-2734 Use AnyId to retrieve Global name * GO-2734 Add GlobalName to identity * GO-2734 Implement DetailsSettable in participant * GO-2734 Get GlobalName from NN only on app start * GO-2450 Upgrade any-sync to v0.3.33: TODOs in the required methods * GO-2734 Fix tests WIP * GO-2734 Use batch method * GO-2734 Fix unittest * GO-3061 Refactoring: payments - huge renames * GO-3061 Add EventMembershipUpdate * GO-2734 Fix tests 2 * GO-2734 Fixes upon pr comments * GO-2450 Fix panic with nil cache.data * GO-2450 Fixes after merge * GO-2734 Fix unittests WIP * GO-2734 Move mock expectations to newFixture * GO-2734 Add return statement in mock * GO-2734 Add check if name was found * GO-2450 Add IsNameValid method * GO-2450 Fix tests: cache * GO-2734 Resolve names directly from NS * GO-2450 Cache logics fix * GO-2450 refactoring: cache logics simplified * GO-2450 refactoring: IsNameValid - code -> error * GO-2734 Set globalName in new spaces * GO-3128 IsNameValid, GetAllTiers rebuilt * GO-2734 Rename forceUpdate flag * GO-2734 Save globalName even if is not found * GO-3128 IsNameValid, GetAllTiers rebuilt * GO-3128 Fix string len * GO-2734 Rename UpdateIdentities --------- Co-authored-by: kirillston <stonozhenko@anytype.io> Co-authored-by: Kirill Stonozhenko <40611691+KirillSto@users.noreply.github.com>
1097 lines
32 KiB
Protocol Buffer
1097 lines
32 KiB
Protocol Buffer
syntax = "proto3";
|
||
package anytype;
|
||
option go_package = "pb";
|
||
|
||
import "pkg/lib/pb/model/protos/models.proto";
|
||
import "google/protobuf/struct.proto";
|
||
|
||
/*
|
||
* Event – type of message, that could be sent from a middleware to the corresponding front-end.
|
||
*/
|
||
message Event {
|
||
repeated Message messages = 1;
|
||
string contextId = 2;
|
||
anytype.model.Account initiator = 3;
|
||
string traceId = 4;
|
||
|
||
message Message {
|
||
oneof value {
|
||
Account.Show accountShow = 1;
|
||
Account.Details accountDetails = 201;
|
||
Account.Config.Update accountConfigUpdate = 202;
|
||
Account.Update accountUpdate = 203;
|
||
Account.LinkChallenge accountLinkChallenge = 204;
|
||
|
||
Object.Details.Set objectDetailsSet = 16;
|
||
Object.Details.Amend objectDetailsAmend = 50;
|
||
Object.Details.Unset objectDetailsUnset = 51;
|
||
Object.Relations.Amend objectRelationsAmend = 52;
|
||
Object.Relations.Remove objectRelationsRemove = 53;
|
||
|
||
Object.Remove objectRemove = 54;
|
||
|
||
Object.Restrictions.Set objectRestrictionsSet = 55;
|
||
|
||
Object.Subscription.Add subscriptionAdd = 60;
|
||
Object.Subscription.Remove subscriptionRemove = 61;
|
||
Object.Subscription.Position subscriptionPosition = 62;
|
||
Object.Subscription.Counters subscriptionCounters = 63;
|
||
Object.Subscription.Groups subscriptionGroups = 64;
|
||
|
||
Block.Add blockAdd = 2;
|
||
Block.Delete blockDelete = 3;
|
||
Block.FilesUpload filesUpload = 4;
|
||
Block.MarksInfo marksInfo = 5;
|
||
|
||
Block.Set.Fields blockSetFields = 6;
|
||
Block.Set.ChildrenIds blockSetChildrenIds = 7;
|
||
Block.Set.Restrictions blockSetRestrictions = 8;
|
||
Block.Set.BackgroundColor blockSetBackgroundColor = 9;
|
||
|
||
Block.Set.Text blockSetText = 10;
|
||
Block.Set.File blockSetFile = 11;
|
||
Block.Set.Link blockSetLink = 13;
|
||
Block.Set.Bookmark blockSetBookmark = 14;
|
||
Block.Set.Align blockSetAlign = 15;
|
||
Block.Set.Div blockSetDiv = 17;
|
||
Block.Set.Relation blockSetRelation = 21;
|
||
Block.Set.Latex blockSetLatex = 25;
|
||
Block.Set.VerticalAlign blockSetVerticalAlign = 36;
|
||
Block.Set.TableRow blockSetTableRow = 37;
|
||
Block.Set.Widget blockSetWidget = 40;
|
||
|
||
Block.Dataview.ViewSet blockDataviewViewSet = 19;
|
||
Block.Dataview.ViewDelete blockDataviewViewDelete = 20;
|
||
Block.Dataview.ViewOrder blockDataviewViewOrder = 29;
|
||
Block.Dataview.SourceSet blockDataviewSourceSet = 35; // deprecated, source is no longer used
|
||
Block.Dataview.GroupOrderUpdate blockDataViewGroupOrderUpdate = 38;
|
||
Block.Dataview.ObjectOrderUpdate blockDataViewObjectOrderUpdate = 39;
|
||
Block.Dataview.RelationDelete blockDataviewRelationDelete = 124;
|
||
Block.Dataview.RelationSet blockDataviewRelationSet = 123;
|
||
Block.Dataview.ViewUpdate blockDataviewViewUpdate = 125;
|
||
Block.Dataview.TargetObjectIdSet blockDataviewTargetObjectIdSet = 126;
|
||
Block.Dataview.IsCollectionSet blockDataviewIsCollectionSet = 127;
|
||
|
||
// deprecated
|
||
Block.Dataview.OldRelationDelete blockDataviewOldRelationDelete = 24;
|
||
// deprecated
|
||
Block.Dataview.OldRelationSet blockDataviewOldRelationSet = 23;
|
||
|
||
|
||
|
||
User.Block.Join userBlockJoin = 31;
|
||
User.Block.Left userBlockLeft = 32;
|
||
User.Block.SelectRange userBlockSelectRange = 33;
|
||
User.Block.TextRange userBlockTextRange = 34;
|
||
|
||
Ping ping = 100;
|
||
|
||
Process.New processNew = 101;
|
||
Process.Update processUpdate = 102;
|
||
Process.Done processDone = 103;
|
||
|
||
Status.Thread threadStatus = 110;
|
||
|
||
File.LimitReached fileLimitReached = 111;
|
||
File.SpaceUsage fileSpaceUsage = 112;
|
||
File.LocalUsage fileLocalUsage = 113;
|
||
|
||
Notification.Send notificationSend = 114;
|
||
Notification.Update notificationUpdate = 115;
|
||
|
||
Payload.Broadcast payloadBroadcast = 116;
|
||
|
||
Membership.Update membershipUpdate = 117;
|
||
}
|
||
}
|
||
|
||
message Account {
|
||
/**
|
||
* Message, that will be sent to the front on each account found after an AccountRecoverRequest
|
||
*/
|
||
message Show {
|
||
int32 index = 1; // Number of an account in an all found accounts list
|
||
anytype.model.Account account = 2; // An Account, that has been found for the mnemonic
|
||
}
|
||
|
||
message Details {
|
||
string profileId = 1;
|
||
google.protobuf.Struct details = 2;
|
||
}
|
||
|
||
message Config {
|
||
message Update {
|
||
anytype.model.Account.Config config = 1;
|
||
anytype.model.Account.Status status = 2;
|
||
}
|
||
}
|
||
|
||
message Update {
|
||
anytype.model.Account.Config config = 1;
|
||
anytype.model.Account.Status status = 2;
|
||
}
|
||
|
||
message LinkChallenge {
|
||
message ClientInfo {
|
||
string processName = 1;
|
||
string processPath = 2;
|
||
bool signatureVerified = 3;
|
||
}
|
||
string challenge = 1;
|
||
ClientInfo clientInfo = 2;
|
||
}
|
||
}
|
||
|
||
message Object {
|
||
message Details {
|
||
// Amend (i.e. add a new key-value pair or update an existing key-value pair) existing state
|
||
message Amend {
|
||
message KeyValue {
|
||
string key = 1;
|
||
google.protobuf.Value value = 2; // should not be null
|
||
}
|
||
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
|
||
string subId = 3; // subscription id
|
||
}
|
||
|
||
// Removes document from subscription
|
||
message Remove {
|
||
string id = 1; // object id
|
||
string subId = 2; // subscription 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
|
||
string subId = 3; // subscription id
|
||
}
|
||
|
||
message Counters {
|
||
// total available records
|
||
int64 total = 1;
|
||
// how many records available after
|
||
int64 nextCount = 2;
|
||
// how many records available before
|
||
int64 prevCount = 3;
|
||
|
||
string subId = 4; // subscription id
|
||
}
|
||
|
||
message Groups {
|
||
string subId = 1;
|
||
anytype.model.Block.Content.Dataview.Group group = 2;
|
||
bool remove = 3;
|
||
}
|
||
}
|
||
|
||
message Relations {
|
||
|
||
message Amend {
|
||
string id = 1; // context objectId
|
||
repeated anytype.model.RelationLink relationLinks = 2;
|
||
}
|
||
|
||
message Remove {
|
||
string id = 1; // context objectId
|
||
repeated string relationKeys = 2;
|
||
}
|
||
}
|
||
|
||
|
||
message Remove {
|
||
// notifies that objects were removed
|
||
repeated string ids = 1;
|
||
}
|
||
|
||
message Restrictions {
|
||
message Set {
|
||
string id = 1;
|
||
anytype.model.Restrictions restrictions = 2;
|
||
}
|
||
}
|
||
}
|
||
message Block {
|
||
/*
|
||
* Event to show internal blocks on a client.
|
||
* Example Scenarios
|
||
* A. Block Creation
|
||
* 1. Block A have been created on a client C1
|
||
* 2. Client C2 receives Event.Block.Add(Block A), Event.Block.Update(Page.children)
|
||
* B. Partial block load
|
||
* 1. Client C1 opens Page1, that contains, for example, 133 blocks.
|
||
* 2. M -> F: ShowFullScreen(Root, blocks1-50)
|
||
* 3. M -> F: Block.Add(blocks51-100)
|
||
* 3. M -> F: Block.Add(blocks101-133)
|
||
*/
|
||
message Add {
|
||
repeated anytype.model.Block blocks = 1; // id -> block
|
||
}
|
||
|
||
/**
|
||
* Middleware to front end event message, that will be sent on one of this scenarios:
|
||
* Precondition: user A opened a block
|
||
* 1. User A drops a set of files/pictures/videos
|
||
* 2. User A creates a MediaBlock and drops a single media, that corresponds to its type.
|
||
*/
|
||
message FilesUpload {
|
||
string blockId = 1; // if empty => create new blocks
|
||
repeated string filePath = 2; // filepaths to the files
|
||
}
|
||
|
||
/*
|
||
*
|
||
*/
|
||
message Delete {
|
||
repeated string blockIds = 1;
|
||
}
|
||
|
||
message MarksInfo {
|
||
repeated anytype.model.Block.Content.Text.Mark.Type marksInRange = 1;
|
||
}
|
||
|
||
message Set {
|
||
|
||
message Relation {
|
||
string id = 1;
|
||
Key key = 2;
|
||
message Key {
|
||
string value = 1;
|
||
}
|
||
}
|
||
|
||
message Fields {
|
||
string id = 1;
|
||
google.protobuf.Struct fields = 2;
|
||
}
|
||
|
||
message ChildrenIds {
|
||
string id = 1;
|
||
repeated string childrenIds = 2;
|
||
}
|
||
|
||
message Restrictions {
|
||
string id = 1;
|
||
anytype.model.Block.Restrictions restrictions = 2;
|
||
}
|
||
|
||
message BackgroundColor {
|
||
string id = 1;
|
||
string backgroundColor = 2;
|
||
}
|
||
|
||
message Align {
|
||
string id = 1;
|
||
anytype.model.Block.Align align = 2;
|
||
}
|
||
|
||
message VerticalAlign {
|
||
string id = 1;
|
||
anytype.model.Block.VerticalAlign verticalAlign = 2;
|
||
}
|
||
|
||
|
||
message Text {
|
||
string id = 1;
|
||
Text text = 2;
|
||
Style style = 3;
|
||
Marks marks = 4;
|
||
Checked checked = 5;
|
||
Color color = 6;
|
||
IconEmoji iconEmoji = 7;
|
||
IconImage iconImage = 8;
|
||
|
||
message Text {
|
||
string value = 1;
|
||
}
|
||
|
||
message Style {
|
||
anytype.model.Block.Content.Text.Style value = 1;
|
||
}
|
||
|
||
message Marks {
|
||
anytype.model.Block.Content.Text.Marks value = 1;
|
||
}
|
||
|
||
message Checked {
|
||
bool value = 1;
|
||
}
|
||
|
||
message Color {
|
||
string value = 1;
|
||
}
|
||
|
||
message IconEmoji {
|
||
string value = 1;
|
||
}
|
||
|
||
message IconImage {
|
||
string value = 1;
|
||
}
|
||
}
|
||
message Latex {
|
||
string id = 1;
|
||
Text text = 2;
|
||
message Text {
|
||
string value = 1;
|
||
}
|
||
Processor processor = 3;
|
||
message Processor {
|
||
anytype.model.Block.Content.Latex.Processor value = 1;
|
||
}
|
||
}
|
||
|
||
message Div {
|
||
string id = 1;
|
||
Style style = 2;
|
||
|
||
message Style {
|
||
anytype.model.Block.Content.Div.Style value = 1;
|
||
}
|
||
}
|
||
|
||
|
||
message File {
|
||
string id = 1;
|
||
Type type = 2;
|
||
State state = 3;
|
||
Mime mime = 4;
|
||
Hash hash = 5;
|
||
Name name = 6;
|
||
Size size = 7;
|
||
Style style = 8;
|
||
TargetObjectId targetObjectId = 9;
|
||
|
||
message Name {
|
||
string value = 1;
|
||
}
|
||
|
||
message Width {
|
||
int32 value = 1;
|
||
}
|
||
|
||
message State {
|
||
anytype.model.Block.Content.File.State value = 1;
|
||
}
|
||
|
||
message Type {
|
||
anytype.model.Block.Content.File.Type value = 1;
|
||
}
|
||
|
||
message Style {
|
||
anytype.model.Block.Content.File.Style value = 1;
|
||
}
|
||
|
||
message Hash {
|
||
string value = 1;
|
||
}
|
||
|
||
message Mime {
|
||
string value = 1;
|
||
}
|
||
|
||
message Size {
|
||
int64 value = 1;
|
||
}
|
||
|
||
message TargetObjectId {
|
||
string value = 1;
|
||
}
|
||
}
|
||
|
||
|
||
message Link {
|
||
string id = 1;
|
||
TargetBlockId targetBlockId = 2;
|
||
Style style = 3;
|
||
Fields fields = 4;
|
||
IconSize iconSize = 5;
|
||
CardStyle cardStyle = 6;
|
||
Description description = 7;
|
||
Relations relations = 8;
|
||
|
||
message TargetBlockId {
|
||
string value = 1;
|
||
}
|
||
|
||
message Style {
|
||
anytype.model.Block.Content.Link.Style value = 1;
|
||
}
|
||
|
||
message Fields {
|
||
google.protobuf.Struct value = 1;
|
||
}
|
||
|
||
message IconSize {
|
||
anytype.model.Block.Content.Link.IconSize value = 1;
|
||
}
|
||
|
||
message CardStyle {
|
||
anytype.model.Block.Content.Link.CardStyle value = 1;
|
||
}
|
||
|
||
message Description {
|
||
anytype.model.Block.Content.Link.Description value = 1;
|
||
}
|
||
|
||
message Relations {
|
||
repeated string value = 1;
|
||
}
|
||
}
|
||
|
||
message Bookmark {
|
||
string id = 1;
|
||
Url url = 2;
|
||
Title title = 3;
|
||
Description description = 4;
|
||
ImageHash imageHash = 5;
|
||
FaviconHash faviconHash = 6;
|
||
Type type = 7;
|
||
TargetObjectId targetObjectId = 8;
|
||
State state = 9;
|
||
|
||
message Url {
|
||
string value = 1;
|
||
}
|
||
|
||
message Title {
|
||
string value = 1;
|
||
}
|
||
|
||
message Description {
|
||
string value = 1;
|
||
}
|
||
|
||
message ImageHash {
|
||
string value = 1;
|
||
}
|
||
|
||
message FaviconHash {
|
||
string value = 1;
|
||
}
|
||
|
||
message Type {
|
||
anytype.model.LinkPreview.Type value = 1;
|
||
}
|
||
|
||
message TargetObjectId {
|
||
string value = 1;
|
||
}
|
||
|
||
message State {
|
||
anytype.model.Block.Content.Bookmark.State value = 1;
|
||
}
|
||
}
|
||
|
||
message TableRow {
|
||
string id = 1;
|
||
IsHeader isHeader = 2;
|
||
|
||
message IsHeader {
|
||
bool value = 1;
|
||
}
|
||
}
|
||
|
||
message Widget {
|
||
string id = 1;
|
||
Layout layout = 2;
|
||
Limit limit = 3;
|
||
ViewId viewId = 4;
|
||
|
||
message Layout {
|
||
anytype.model.Block.Content.Widget.Layout value = 1;
|
||
}
|
||
|
||
message Limit {
|
||
int32 value = 1;
|
||
}
|
||
|
||
message ViewId {
|
||
string value = 1;
|
||
}
|
||
}
|
||
}
|
||
|
||
message Fill {
|
||
|
||
message Details {
|
||
string id = 1;
|
||
google.protobuf.Struct details = 2;
|
||
}
|
||
|
||
message DatabaseRecords {
|
||
string id = 1;
|
||
repeated google.protobuf.Struct records = 2;
|
||
}
|
||
|
||
message Fields {
|
||
string id = 1;
|
||
google.protobuf.Struct fields = 2;
|
||
}
|
||
|
||
message ChildrenIds {
|
||
string id = 1;
|
||
repeated string childrenIds = 2;
|
||
}
|
||
|
||
message Restrictions {
|
||
string id = 1;
|
||
anytype.model.Block.Restrictions restrictions = 2;
|
||
}
|
||
|
||
message BackgroundColor {
|
||
string id = 1;
|
||
string backgroundColor = 2;
|
||
}
|
||
|
||
message Align {
|
||
string id = 1;
|
||
anytype.model.Block.Align align = 2;
|
||
}
|
||
|
||
|
||
message Text {
|
||
string id = 1;
|
||
Text text = 2;
|
||
Style style = 3;
|
||
Marks marks = 4;
|
||
Checked checked = 5;
|
||
Color color = 6;
|
||
|
||
message Text {
|
||
string value = 1;
|
||
}
|
||
|
||
message Style {
|
||
anytype.model.Block.Content.Text.Style value = 1;
|
||
}
|
||
|
||
message Marks {
|
||
anytype.model.Block.Content.Text.Marks value = 1;
|
||
}
|
||
|
||
message Checked {
|
||
bool value = 1;
|
||
}
|
||
|
||
message Color {
|
||
string value = 1;
|
||
}
|
||
|
||
}
|
||
|
||
message Div {
|
||
string id = 1;
|
||
Style style = 2;
|
||
|
||
message Style {
|
||
anytype.model.Block.Content.Div.Style value = 1;
|
||
}
|
||
}
|
||
|
||
|
||
message File {
|
||
string id = 1;
|
||
Type type = 2;
|
||
State state = 3;
|
||
Mime mime = 4;
|
||
Hash hash = 5;
|
||
Name name = 6;
|
||
Size size = 7;
|
||
Style style = 8;
|
||
|
||
message Name {
|
||
string value = 1;
|
||
}
|
||
|
||
message Width {
|
||
int32 value = 1;
|
||
}
|
||
|
||
message State {
|
||
anytype.model.Block.Content.File.State value = 1;
|
||
}
|
||
|
||
message Type {
|
||
anytype.model.Block.Content.File.Type value = 1;
|
||
}
|
||
|
||
message Style {
|
||
anytype.model.Block.Content.File.Style value = 1;
|
||
}
|
||
|
||
message Hash {
|
||
string value = 1;
|
||
}
|
||
|
||
message Mime {
|
||
string value = 1;
|
||
}
|
||
|
||
message Size {
|
||
int64 value = 1;
|
||
}
|
||
|
||
}
|
||
|
||
|
||
message Link {
|
||
string id = 1;
|
||
TargetBlockId targetBlockId = 2;
|
||
Style style = 3;
|
||
Fields fields = 4;
|
||
|
||
message TargetBlockId {
|
||
string value = 1;
|
||
}
|
||
|
||
message Style {
|
||
anytype.model.Block.Content.Link.Style value = 1;
|
||
}
|
||
|
||
message Fields {
|
||
google.protobuf.Struct value = 1;
|
||
}
|
||
|
||
}
|
||
|
||
message Bookmark {
|
||
string id = 1;
|
||
Url url = 2;
|
||
Title title = 3;
|
||
Description description = 4;
|
||
ImageHash imageHash = 5;
|
||
FaviconHash faviconHash = 6;
|
||
Type type = 7;
|
||
TargetObjectId targetObjectId = 8;
|
||
|
||
|
||
message Url {
|
||
string value = 1;
|
||
}
|
||
|
||
message Title {
|
||
string value = 1;
|
||
}
|
||
|
||
message Description {
|
||
string value = 1;
|
||
}
|
||
|
||
message ImageHash {
|
||
string value = 1;
|
||
}
|
||
|
||
message FaviconHash {
|
||
string value = 1;
|
||
}
|
||
|
||
message Type {
|
||
anytype.model.LinkPreview.Type value = 1;
|
||
}
|
||
|
||
message TargetObjectId {
|
||
string value = 1;
|
||
}
|
||
}
|
||
}
|
||
|
||
message Dataview {
|
||
// sent when the view have been changed or added
|
||
message ViewSet {
|
||
string id = 1; // dataview block's id
|
||
string viewId = 2; // view id, client should double check this to make sure client doesn't switch the active view in the middle
|
||
anytype.model.Block.Content.Dataview.View view = 3;
|
||
}
|
||
|
||
message ViewUpdate {
|
||
string id = 1;
|
||
string viewId = 2;
|
||
repeated Filter filter = 3;
|
||
repeated Relation relation = 4;
|
||
repeated Sort sort = 5;
|
||
Fields fields = 6;
|
||
|
||
message Fields {
|
||
anytype.model.Block.Content.Dataview.View.Type type = 1;
|
||
string name = 2;
|
||
string coverRelationKey = 3; // Relation used for cover in gallery
|
||
bool hideIcon = 4; // Hide icon near name
|
||
anytype.model.Block.Content.Dataview.View.Size cardSize = 5; // Gallery card size
|
||
bool coverFit = 6; // Image fits container
|
||
string groupRelationKey = 7; // Group view by this relationKey
|
||
bool groupBackgroundColors = 8; // Enable backgrounds in groups
|
||
int32 pageLimit = 9; // Limit of objects shown in widget
|
||
string defaultTemplateId = 10; // Id of template object set default for the view
|
||
string defaultObjectTypeId = 15; // Default object type that is chosen for new object created within the view
|
||
}
|
||
|
||
message Filter {
|
||
oneof operation {
|
||
Add add = 1;
|
||
Remove remove = 2;
|
||
Update update = 3;
|
||
Move move = 4;
|
||
}
|
||
|
||
message Add {
|
||
string afterId = 1;
|
||
repeated anytype.model.Block.Content.Dataview.Filter items = 2;
|
||
}
|
||
message Remove {
|
||
repeated string ids = 1;
|
||
}
|
||
message Update {
|
||
string id = 1;
|
||
anytype.model.Block.Content.Dataview.Filter item = 2;
|
||
}
|
||
message Move {
|
||
string afterId = 1;
|
||
repeated string ids = 2;
|
||
}
|
||
}
|
||
|
||
message Relation {
|
||
oneof operation {
|
||
Add add = 1;
|
||
Remove remove = 2;
|
||
Update update = 3;
|
||
Move move = 4;
|
||
}
|
||
|
||
message Add {
|
||
string afterId = 1;
|
||
repeated anytype.model.Block.Content.Dataview.Relation items = 2;
|
||
}
|
||
message Remove {
|
||
repeated string ids = 1;
|
||
}
|
||
message Update {
|
||
string id = 1;
|
||
anytype.model.Block.Content.Dataview.Relation item = 2;
|
||
}
|
||
message Move {
|
||
string afterId = 1;
|
||
repeated string ids = 2;
|
||
}
|
||
}
|
||
|
||
message Sort {
|
||
oneof operation {
|
||
Add add = 1;
|
||
Remove remove = 2;
|
||
Update update = 3;
|
||
Move move = 4;
|
||
}
|
||
|
||
message Add {
|
||
string afterId = 1;
|
||
repeated anytype.model.Block.Content.Dataview.Sort items = 2;
|
||
}
|
||
message Remove {
|
||
repeated string ids = 1;
|
||
}
|
||
message Update {
|
||
string id = 1;
|
||
anytype.model.Block.Content.Dataview.Sort item = 2;
|
||
}
|
||
message Move {
|
||
string afterId = 1;
|
||
repeated string ids = 2;
|
||
}
|
||
}
|
||
}
|
||
|
||
message ViewDelete {
|
||
string id = 1; // dataview block's id
|
||
string viewId = 2; // view id to remove
|
||
}
|
||
|
||
|
||
message ViewOrder {
|
||
string id = 1; // dataview block's id
|
||
repeated string viewIds = 2; // view ids in new order
|
||
}
|
||
|
||
message SourceSet {
|
||
string id = 1; // dataview block's id
|
||
repeated string source = 2;
|
||
}
|
||
|
||
message OldRelationDelete {
|
||
string id = 1; // dataview block's id
|
||
string relationKey = 2; // relation key to remove
|
||
}
|
||
|
||
// sent when the dataview relation has been changed or added
|
||
message OldRelationSet {
|
||
string id = 1; // dataview block's id
|
||
string relationKey = 2; // relation key to update
|
||
anytype.model.Relation relation = 3;
|
||
}
|
||
|
||
message RelationDelete {
|
||
string id = 1; // dataview block's id
|
||
repeated string relationKeys = 2; // relation key to remove
|
||
}
|
||
|
||
// sent when the dataview relation has been changed or added
|
||
message RelationSet {
|
||
string id = 1; // dataview block's id
|
||
repeated anytype.model.RelationLink relationLinks = 2; // relation id to update
|
||
}
|
||
|
||
message GroupOrderUpdate {
|
||
string id = 1; // dataview block's id
|
||
anytype.model.Block.Content.Dataview.GroupOrder groupOrder = 2;
|
||
}
|
||
|
||
message ObjectOrderUpdate {
|
||
string id = 1; // dataview block's id
|
||
string viewId = 2;
|
||
string groupId = 3;
|
||
repeated SliceChange sliceChanges = 4;
|
||
}
|
||
|
||
message SliceChange {
|
||
SliceOperation op = 1;
|
||
repeated string ids = 2;
|
||
string afterId = 3;
|
||
}
|
||
|
||
enum SliceOperation {
|
||
SliceOperationNone = 0; // not used
|
||
SliceOperationAdd = 1;
|
||
SliceOperationMove = 2;
|
||
SliceOperationRemove = 3;
|
||
SliceOperationReplace = 4;
|
||
}
|
||
|
||
message TargetObjectIdSet {
|
||
string id = 1; // dataview block's id
|
||
string targetObjectId = 2;
|
||
}
|
||
|
||
message IsCollectionSet {
|
||
string id = 1; // dataview block's id
|
||
bool value = 2;
|
||
}
|
||
}
|
||
}
|
||
|
||
message User {
|
||
message Block {
|
||
|
||
/**
|
||
* Middleware to front end event message, that will be sent in this scenario:
|
||
* Precondition: user A opened a block
|
||
* 1. User B opens the same block
|
||
* 2. User A receives a message about p.1
|
||
*/
|
||
message Join {
|
||
Account account = 1; // Account of the user, that opened a block
|
||
}
|
||
|
||
/**
|
||
* Middleware to front end event message, that will be sent in this scenario:
|
||
* Precondition: user A and user B opened the same block
|
||
* 1. User B closes the block
|
||
* 2. User A receives a message about p.1
|
||
*/
|
||
message Left {
|
||
Account account = 1; // Account of the user, that left the block
|
||
}
|
||
|
||
/**
|
||
* Middleware to front end event message, that will be sent in this scenario:
|
||
* Precondition: user A and user B opened the same block
|
||
* 1. User B sets cursor or selects a text region into a text block
|
||
* 2. User A receives a message about p.1
|
||
*/
|
||
message TextRange {
|
||
Account account = 1; // Account of the user, that selected a text
|
||
string blockId = 2; // Id of the text block, that have a selection
|
||
anytype.model.Range range = 3; // Range of the selection
|
||
}
|
||
|
||
/**
|
||
* Middleware to front end event message, that will be sent in this scenario:
|
||
* Precondition: user A and user B opened the same block
|
||
* 1. User B selects some inner blocks
|
||
* 2. User A receives a message about p.1
|
||
*/
|
||
message SelectRange {
|
||
Account account = 1; // Account of the user, that selected blocks
|
||
repeated string blockIdsArray = 2; // Ids of selected blocks.
|
||
}
|
||
}
|
||
}
|
||
|
||
message Ping {
|
||
int32 index = 1;
|
||
}
|
||
|
||
message Process {
|
||
message New {
|
||
Model.Process process = 1;
|
||
}
|
||
message Update {
|
||
Model.Process process = 1;
|
||
}
|
||
message Done {
|
||
Model.Process process = 1;
|
||
}
|
||
}
|
||
|
||
message Status {
|
||
message Thread {
|
||
Summary summary = 1;
|
||
Cafe cafe = 2;
|
||
repeated Account accounts = 3;
|
||
|
||
message Summary {
|
||
SyncStatus status = 1;
|
||
}
|
||
|
||
message Cafe {
|
||
SyncStatus status = 1;
|
||
int64 lastPulled = 2;
|
||
bool lastPushSucceed = 3;
|
||
PinStatus files = 4;
|
||
|
||
message PinStatus {
|
||
int32 pinning = 1;
|
||
int32 pinned = 2;
|
||
int32 failed = 3;
|
||
int64 updated = 4;
|
||
}
|
||
}
|
||
|
||
message Account {
|
||
string id = 1;
|
||
string name = 2;
|
||
string imageHash = 3;
|
||
bool online = 4;
|
||
int64 lastPulled = 5;
|
||
int64 lastEdited = 6;
|
||
repeated Device devices = 7;
|
||
}
|
||
|
||
message Device {
|
||
string name = 1;
|
||
bool online = 2;
|
||
int64 lastPulled = 3;
|
||
int64 lastEdited = 4;
|
||
}
|
||
|
||
enum SyncStatus {
|
||
Unknown = 0;
|
||
Offline = 1;
|
||
Syncing = 2;
|
||
Synced = 3;
|
||
Failed = 4;
|
||
IncompatibleVersion = 5;
|
||
}
|
||
}
|
||
}
|
||
|
||
message File {
|
||
message LimitReached {
|
||
string spaceId = 1;
|
||
string fileId = 2;
|
||
}
|
||
|
||
message SpaceUsage {
|
||
uint64 bytesUsage = 1;
|
||
string spaceId = 2;
|
||
}
|
||
|
||
message LocalUsage {
|
||
uint64 localBytesUsage = 1;
|
||
}
|
||
}
|
||
|
||
message Membership {
|
||
message Update {
|
||
anytype.model.Membership data = 1;
|
||
}
|
||
}
|
||
|
||
message Notification {
|
||
message Send {
|
||
anytype.model.Notification notification = 1;
|
||
}
|
||
message Update {
|
||
anytype.model.Notification notification = 1;
|
||
}
|
||
}
|
||
|
||
message Payload {
|
||
message Broadcast {
|
||
string payload = 1;
|
||
}
|
||
}
|
||
}
|
||
|
||
message ResponseEvent {
|
||
repeated Event.Message messages = 1;
|
||
string contextId = 2;
|
||
string traceId = 4;
|
||
}
|
||
|
||
message Model {
|
||
message Process {
|
||
string id = 1;
|
||
Type type = 2;
|
||
State state = 3;
|
||
Progress progress = 4;
|
||
|
||
enum Type {
|
||
DropFiles = 0;
|
||
Import = 1;
|
||
Export = 2;
|
||
SaveFile = 3;
|
||
RecoverAccount = 4;
|
||
Migration = 5;
|
||
}
|
||
|
||
enum State {
|
||
None = 0;
|
||
Running = 1;
|
||
Done = 2;
|
||
Canceled = 3;
|
||
Error = 4;
|
||
}
|
||
|
||
message Progress {
|
||
int64 total = 1;
|
||
int64 done = 2;
|
||
string message = 3;
|
||
}
|
||
}
|
||
}
|