-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathmodels.proto
1398 lines (1210 loc) · 38.9 KB
/
models.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
syntax = "proto3";
package anytype.model;
option go_package = "pkg/lib/pb/model";
import "google/protobuf/struct.proto";
message SmartBlockSnapshotBase {
repeated Block blocks = 1;
google.protobuf.Struct details = 2;
google.protobuf.Struct fileKeys = 3 [deprecated=true];
repeated Relation extraRelations = 4 [deprecated=true];
repeated string objectTypes = 5;
google.protobuf.Struct collections = 6;
repeated string removedCollectionKeys = 8;
repeated RelationLink relationLinks = 7;
string key = 9; // only used for pb backup purposes, ignored in other cases
int64 originalCreatedTimestamp = 10; // ignored in import/export in favor of createdDate relation. Used to store original user-side object creation timestamp
FileInfo fileInfo = 11;
}
enum SmartBlockType {
AccountOld = 0; // deprecated
Page = 0x10;
ProfilePage = 0x11;
Home = 0x20;
Archive = 0x30;
Widget = 0x70;
File = 0x100;
Template = 0x120;
BundledTemplate = 0x121;
BundledRelation = 0x200; // DEPRECATED
SubObject = 0x201;
BundledObjectType = 0x202; // DEPRECATED
AnytypeProfile = 0x203;
Date = 0x204;
Workspace = 0x206;
STRelation = 0x209;
STType = 0x210;
STRelationOption = 0x211;
SpaceView = 0x212;
Identity = 0x214;
Participant = 0x216;
MissingObject = 0x207;
FileObject = 0x215;
NotificationObject = 0x217;
DevicesObject = 0x218;
ChatObject = 0x219; // Container for any-store based chats
ChatDerivedObject = 0x220; // Any-store based object for chat
AccountObject = 0x221; // Container for account data in tech space
}
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;
Restrictions restrictions = 3;
repeated string childrenIds = 4;
string backgroundColor = 5;
Align align = 6;
VerticalAlign verticalAlign = 7;
oneof content {
Content.Smartblock smartblock = 11;
Content.Text text = 14;
Content.File file = 15;
Content.Layout layout = 16;
Content.Div div = 17;
Content.Bookmark bookmark = 18;
Content.Icon icon = 19;
Content.Link link = 20;
Content.Dataview dataview = 21;
Content.Relation relation = 22;
Content.FeaturedRelations featuredRelations = 23;
Content.Latex latex = 24;
Content.TableOfContents tableOfContents = 25;
Content.Table table = 26;
Content.TableColumn tableColumn = 27;
Content.TableRow tableRow = 28;
Content.Widget widget = 29;
Content.Chat chat = 30;
}
message Restrictions {
bool read = 1;
bool edit = 2;
bool remove = 3;
bool drag = 4;
bool dropOn = 5;
}
enum Position {
None = 0;
// above target block
Top = 1;
// under target block
Bottom = 2;
// to left of target block
Left = 3;
// to right of target block
Right = 4;
// inside target block, as last block
Inner = 5;
// replace target block
Replace = 6;
// inside target block, as first block
InnerFirst = 7;
}
enum Align {
AlignLeft = 0;
AlignCenter = 1;
AlignRight = 2;
AlignJustify = 3;
}
enum VerticalAlign {
VerticalAlignTop = 0;
VerticalAlignMiddle = 1;
VerticalAlignBottom = 2;
}
message Content {
/*
* Layout have no visual representation, but affects on blocks, that it contains.
* Row/Column layout blocks creates only automatically, after some of a D&D operations, for example
*/
message Layout {
Style style = 1;
enum Style {
Row = 0;
Column = 1;
Div = 2;
Header = 3;
TableRows = 4;
TableColumns = 5;
}
}
/*
* Link: block to link some content from an external sources.
*/
message Link {
string targetBlockId = 1; // id of the target block
Style style = 2; // deprecated
google.protobuf.Struct fields = 3;
IconSize iconSize = 4;
CardStyle cardStyle = 5;
Description description = 6;
repeated string relations = 7;
enum IconSize {
SizeNone = 0;
SizeSmall = 1;
SizeMedium = 2;
}
enum Style {
Page = 0;
Dataview = 1;
Dashboard = 2;
Archive = 3;
// ...
}
enum Description {
None = 0;
Added = 1;
Content = 2;
}
enum CardStyle {
Text = 0;
Card = 1;
Inline = 2;
}
}
/*
* Divider: block, that contains only one horizontal thin line
*/
message Div {
Style style = 1;
enum Style {
Line = 0;
Dots = 1;
}
}
/*
* Bookmark is to keep a web-link and to preview a content.
*/
message Bookmark {
string url = 1;
// Deprecated. Get this data from the target object.
string title = 2;
// Deprecated. Get this data from the target object.
string description = 3;
// Deprecated. Get this data from the target object.
string imageHash = 4;
// Deprecated. Get this data from the target object.
string faviconHash = 5;
LinkPreview.Type type = 6;
string targetObjectId = 7;
State state = 8;
enum State {
Empty = 0;
Fetching = 1;
Done = 2;
Error = 3;
}
}
message Icon {
string name = 1;
}
message FeaturedRelations {
}
message Text {
string text = 1;
Style style = 2;
Marks marks = 3; // list of marks to apply to the text
bool checked = 4;
string color = 5;
string iconEmoji = 6; // used with style Callout
string iconImage = 7; // in case both image and emoji are set, image should has a priority in the UI
message Marks {
repeated Mark marks = 1;
}
message Mark {
Range range = 1; // range of symbols to apply this mark. From(symbol) To(symbol)
Type type = 2;
string param = 3; // link, color, etc
enum Type {
Strikethrough = 0;
Keyboard = 1;
Italic = 2;
Bold = 3;
Underscored = 4;
Link = 5;
TextColor = 6;
BackgroundColor = 7;
Mention = 8;
Emoji = 9;
Object = 10;
}
}
enum Style {
Paragraph = 0;
Header1 = 1;
Header2 = 2;
Header3 = 3;
Header4 = 4; // deprecated
Quote = 5;
Code = 6;
Title = 7; // currently only one block of this style can exists on a page
Checkbox = 8;
Marked = 9;
Numbered = 10;
Toggle = 11;
Description = 12; // currently only one block of this style can exists on a page
Callout = 13;
}
}
message File {
string hash = 1;
string name = 2;
Type type = 3;
string mime = 4;
int64 size = 5;
int64 addedAt = 6;
string targetObjectId = 9;
State state = 7;
Style style = 8;
enum Type {
None = 0;
File = 1;
Image = 2;
Video = 3;
Audio = 4;
PDF = 5;
}
enum Style {
Auto = 0; // all types expect File and None has Embed style by default
Link = 1;
Embed = 2;
}
enum State {
Empty = 0; // There is no file and preview, it's an empty block, that waits files.
Uploading = 1; // There is still no file/preview, but file already uploading
Done = 2; // File and preview downloaded
Error = 3; // Error while uploading
}
}
message Smartblock {
}
message Dataview {
repeated string source = 1;
repeated View views = 2;
string activeView = 3; // do not generate changes for this field
// deprecated
repeated model.Relation relations = 4;
repeated GroupOrder groupOrders = 12;
repeated ObjectOrder objectOrders = 13;
repeated anytype.model.RelationLink relationLinks = 5;
string TargetObjectId = 6;
bool isCollection = 14;
message View {
string id = 1;
Type type = 2;
string name = 3;
repeated Sort sorts = 4;
repeated Filter filters = 5;
repeated Relation relations = 6; // relations fields/columns options, also used to provide the order
string coverRelationKey = 7; // Relation used for cover in gallery
bool hideIcon = 8; // Hide icon near name
Size cardSize = 9; // Gallery card size
bool coverFit = 10; // Image fits container
string groupRelationKey = 11; // Group view by this relationKey
bool groupBackgroundColors = 12; // Enable backgrounds in groups
int32 pageLimit = 13; // Limit of objects shown in widget
string defaultTemplateId = 14; // Default template that is chosen for new object created within the view
string defaultObjectTypeId = 15; // Default object type that is chosen for new object created within the view
enum Type {
Table = 0;
List = 1;
Gallery = 2;
Kanban = 3;
Calendar = 4;
Graph = 5;
}
enum Size {
Small = 0;
Medium = 1;
Large = 2;
}
}
message Relation {
string key = 1;
bool isVisible = 2;
int32 width = 3; // the displayed column % calculated based on other visible relations
// bool isReadOnly = 4; // deprecated
bool dateIncludeTime = 5;
TimeFormat timeFormat = 6;
DateFormat dateFormat = 7;
FormulaType formula = 8;
Block.Align align = 9;
enum DateFormat {
MonthAbbrBeforeDay = 0; // Jul 30, 2020
MonthAbbrAfterDay = 1; // 30 Jul 2020
Short = 2; // 30/07/2020
ShortUS = 3; // 07/30/2020
ISO = 4; // 2020-07-30
}
enum TimeFormat {
Format12 = 0;
Format24 = 1;
}
enum FormulaType {
None = 0;
Count = 1;
CountValue = 2;
CountDistinct = 3;
CountEmpty = 4;
CountNotEmpty = 5;
PercentEmpty = 6;
PercentNotEmpty = 7;
MathSum = 8;
MathAverage = 9;
MathMedian = 10;
MathMin = 11;
MathMax = 12;
Range = 13;
}
}
message Sort {
string RelationKey = 1;
Type type = 2;
repeated google.protobuf.Value customOrder = 3;
RelationFormat format = 4;
bool includeTime = 5;
string id = 6;
EmptyType emptyPlacement = 7;
bool noCollate = 8;
enum Type {
Asc = 0;
Desc = 1;
Custom = 2;
}
enum EmptyType {
NotSpecified = 0;
Start = 1;
End = 2;
}
}
message Filter {
string id = 9;
Operator operator = 1; // looks not applicable?
string RelationKey = 2;
string relationProperty = 5;
Condition condition = 3;
google.protobuf.Value value = 4;
QuickOption quickOption = 6;
RelationFormat format = 7;
bool includeTime = 8;
repeated Filter nestedFilters = 10;
enum Operator {
No = 0;
Or = 1;
And = 2;
}
enum Condition {
None = 0;
Equal = 1;
NotEqual = 2;
Greater = 3;
Less = 4;
GreaterOrEqual = 5;
LessOrEqual = 6;
Like = 7;
NotLike = 8;
In = 9; // "at least one value(from the provided list) is IN"
NotIn = 10; // "none of provided values are IN"
Empty = 11;
NotEmpty = 12;
AllIn = 13;
NotAllIn = 14;
ExactIn = 15;
NotExactIn = 16;
Exists = 17;
}
enum QuickOption {
ExactDate = 0;
Yesterday = 1;
Today = 2;
Tomorrow = 3;
LastWeek = 4;
CurrentWeek = 5;
NextWeek = 6;
LastMonth = 7;
CurrentMonth = 8;
NextMonth = 9;
NumberOfDaysAgo = 10;
NumberOfDaysNow = 11;
}
}
message GroupOrder {
string viewId = 1;
repeated ViewGroup viewGroups = 2;
}
message ViewGroup {
string groupId = 1;
int32 index = 2;
bool hidden = 3;
string backgroundColor = 4;
}
message ObjectOrder {
string viewId = 1;
string groupId = 2;
repeated string objectIds = 3;
}
message Group {
string id = 1;
oneof Value {
Status status = 2;
Tag tag = 3;
Checkbox checkbox = 4;
Date date = 5;
}
}
message Status {
string id = 1;
}
message Tag {
repeated string ids = 1;
}
message Checkbox {
bool checked = 1;
}
message Date {
}
}
message Relation {
string key = 1;
}
message Latex {
string text = 1;
Processor processor = 2;
enum Processor {
Latex = 0;
Mermaid = 1;
Chart = 2;
Youtube = 3;
Vimeo = 4;
Soundcloud = 5;
GoogleMaps = 6;
Miro = 7;
Figma = 8;
Twitter = 9;
OpenStreetMap = 10;
Reddit = 11;
Facebook = 12;
Instagram = 13;
Telegram = 14;
GithubGist = 15;
Codepen = 16;
Bilibili = 17;
Excalidraw = 18;
Kroki = 19;
Graphviz = 20;
Sketchfab = 21;
Image = 22;
}
}
message TableOfContents {
}
message Table {}
message TableColumn {}
message TableRow {
bool isHeader = 1;
}
message Widget {
Layout layout = 1;
int32 limit = 2;
string viewId = 3;
enum Layout {
Link = 0;
Tree = 1;
List = 2;
CompactList = 3;
View = 4;
}
}
message Chat {
}
}
}
/*
* Used to decode block meta only, without the content itself
*/
message BlockMetaOnly {
string id = 1;
google.protobuf.Struct fields = 2;
}
/*
* General purpose structure, uses in Mark.
*/
message Range {
int32 from = 1;
int32 to = 2;
}
/**
* Contains basic information about a user account
*/
message Account {
string id = 1; // User's thread id
Config config = 4;
Status status = 5;
Info info = 6;
message Config {
bool enableDataview = 1;
bool enableDebug = 2;
bool enablePrereleaseChannel = 3;
bool enableSpaces = 4;
google.protobuf.Struct extra = 100;
}
message Status {
StatusType statusType = 1;
int64 deletionDate = 2;
}
enum StatusType {
Active = 0;
PendingDeletion = 1;
StartedDeletion = 2;
Deleted = 3;
}
message Info {
string homeObjectId = 2; // home dashboard block id
string archiveObjectId = 3; // archive block id
string profileObjectId = 4; // profile block id
string marketplaceWorkspaceId = 11; // marketplace workspace id
string workspaceObjectId = 15; // workspace object id. used for space-level chat
string deviceId = 8;
string accountSpaceId = 9; // the first created private space. It's filled only when account is created
string widgetsId = 10;
string spaceViewId = 13;
string techSpaceId = 14;
string gatewayUrl = 101; // gateway url for fetching static files
string localStoragePath = 103; // path to local storage
string timeZone = 104; // time zone from config
string analyticsId = 105;
string networkId = 106; // network id to which anytype is connected
}
}
message LinkPreview {
string url = 1;
string title = 2;
string description = 3;
string imageUrl = 4;
string faviconUrl = 5;
Type type = 6;
enum Type {
Unknown = 0;
Page = 1;
Image = 2;
Text = 3;
}
}
message Restrictions {
repeated ObjectRestriction object = 1;
repeated DataviewRestrictions dataview = 2;
enum ObjectRestriction {
None = 0;
// restricts delete
Delete = 1;
// restricts work with relations
Relations = 2;
// restricts work with blocks
Blocks = 3;
// restricts work with details
Details = 4;
// restricts type changing
TypeChange = 5;
// restricts layout changing
LayoutChange = 6;
// restricts template creation from this object
Template = 7;
// restricts duplicate object
Duplicate = 8;
// can be set only for types. Restricts creating objects of this type
CreateObjectOfThisType = 9;
// object is not allowed to publish
Publish = 10;
}
message DataviewRestrictions {
string blockId = 1;
repeated DataviewRestriction restrictions = 2;
}
enum DataviewRestriction {
DVNone = 0;
DVRelation = 1;
DVCreateObject = 2;
DVViews = 3;
}
}
message Object {
message ChangePayload {
SmartBlockType smartBlockType = 1;
string key = 2;
bytes data = 3;
}
}
message SpaceObjectHeader {
string spaceID = 1;
}
message ObjectType {
string url = 1; // leave empty in case you want to create the new one
string name = 2; // name of objectType (can be localized for bundled types)
repeated RelationLink relationLinks = 3; // cannot contain more than one Relation with the same RelationType
Layout layout = 4;
string iconEmoji = 5; // emoji symbol
string description = 6;
bool hidden = 7;
bool readonly = 10;
repeated SmartBlockType types = 8;
bool isArchived = 9; // sets locally to hide object type from set and some other places
bool installedByDefault = 11;
string key = 12; // name of objectType (can be localized for bundled types)
int64 revision = 13; // revision of system objectType. Used to check if we should change type content or not
bool restrictObjectCreation = 14; // restricts creating objects of this type for users
enum Layout {
basic = 0;
profile = 1;
todo = 2;
set = 3;
objectType = 4;
relation = 5;
file = 6;
dashboard = 7;
image = 8;
note = 9;
space = 10;
bookmark = 11;
relationOptionsList = 12;
relationOption = 13;
collection = 14;
audio = 15;
video = 16;
date = 17;
spaceView = 18;
participant = 19;
pdf = 20;
chat = 21; // deprecated
chatDerived = 22;
tag = 23;
}
}
message Layout {
ObjectType.Layout id = 1;
string name = 2;
repeated Relation requiredRelations = 3; // relations required for this object type
}
message RelationWithValue {
Relation relation = 1;
google.protobuf.Value value = 2;
}
// Relation describe the human-interpreted relation type. It may be something like "Date of creation, format=date" or "Assignee, format=objectId, objectType=person"
message Relation {
string id = 100;
// Key under which the value is stored in the map. Must be unique for the object type.
// It usually auto-generated bsonid, but also may be something human-readable in case of prebuilt types.
string key = 1;
RelationFormat format = 2; // format of the underlying data
string name = 3; // name to show (can be localized for bundled types)
google.protobuf.Value defaultValue = 4;
DataSource dataSource = 5; // where the data is stored
bool hidden = 6; // internal, not displayed to user (e.g. coverX, coverY)
bool readOnly = 7; // value not editable by user tobe renamed to readonlyValue
bool readOnlyRelation = 15; // relation metadata, eg name and format is not editable by user
bool multi = 8; // allow multiple values (stored in pb list)
repeated string objectTypes = 9; // URL of object type, empty to allow link to any object
// index 10, 11 was used in internal-only builds. Can be reused, but may break some test accounts
repeated Option selectDict = 12; // default dictionary with unique values to choose for select/multiSelect format
int32 maxCount = 13; // max number of values can be set for this relation. 0 means no limit. 1 means the value can be stored in non-repeated field
string description = 14;
// on-store fields, injected only locally
Scope scope = 20; // deprecated, to be removed
string creator = 21; // creator profile id
int64 revision = 22; // revision of system relation. Used to check if we should change relation content or not
message Option {
string id = 1; // id generated automatically if omitted
string text = 2;
string color = 3; // stored
// 4 is reserved for old relation format
string relationKey = 5; // stored
}
enum Scope {
object = 0; // stored within the object
type = 1; // stored within the object type
setOfTheSameType = 2; // aggregated from the dataview of sets of the same object type
objectsOfTheSameType = 3; // aggregated from the dataview of sets of the same object type
library = 4; // aggregated from relations library
}
enum DataSource {
details = 0; // default, stored inside the object's details
derived = 1; // stored locally, e.g. in badger or generated on the fly
account = 2; // stored in the account DB. means existing only for specific anytype account
local = 3; // stored locally
}
}
// RelationFormat describes how the underlying data is stored in the google.protobuf.Value and how it should be validated/sanitized
enum RelationFormat {
longtext = 0; // string
shorttext = 1; // string, usually short enough. May be truncated in the future
number = 2; // double
status = 3; // string or list of string(len==1)
tag = 11; // list of string (choose multiple from a list)
date = 4; // float64(pb.Value doesn't have int64) or the string
file = 5; // relation can has objects of specific types: file, image, audio, video
checkbox = 6; // boolean
url = 7; // string with sanity check
email = 8; // string with sanity check
phone = 9; // string with sanity check
emoji = 10; // one emoji, can contains multiple utf-8 symbols
object = 100; // relation can has objectType to specify objectType
relations = 101; // base64-encoded relation pb model
}
enum ObjectOrigin {
none = 0;
clipboard = 1;
dragAndDrop = 2;
import = 3;
webclipper = 4;
sharingExtension = 5;
usecase = 6;
builtin = 7;
bookmark = 8;
}
message RelationLink {
string key = 1;
RelationFormat format = 2;
}
message Relations {
repeated Relation relations = 1;
}
message RelationOptions {
repeated Relation.Option options = 1;
}
message InternalFlag {
Value value = 1;
// Use such a weird construction due to the issue with imported repeated enum type
// Look https://github.com/golang/protobuf/issues/1135 for more information.
enum Value {
editorDeleteEmpty = 0;
editorSelectType = 1;
editorSelectTemplate = 2;
collectionDontIndexLinks = 3;
}
}
/*
* Works with a smart blocks: Page, Dashboard
* Dashboard opened, click on a page, Rpc.Block.open, Block.ShowFullscreen(PageBlock)
*/
message ObjectView {
string rootId = 1; // Root block id
repeated Block blocks = 2; // dependent simple blocks (descendants)
repeated DetailsSet details = 3; // details for the current and dependent objects
SmartBlockType type = 4;
message DetailsSet {
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;
}
message RelationWithValuePerObject {
string objectId = 1;
repeated RelationWithValue relations = 2;
}
repeated Relation relations = 7; // DEPRECATED, use relationLinks instead
repeated RelationLink relationLinks = 10;
Restrictions restrictions = 8; // object restrictions
HistorySize history = 9;
message HistorySize {
int32 undo = 1;
int32 redo = 2;
}
repeated BlockParticipant blockParticipants = 11;
message BlockParticipant {
string blockId = 1;
string participantId = 2;
}
}
enum SpaceStatus {
// Unknown means the space is not loaded yet
Unknown = 0;
// Loading - the space in progress of loading
Loading = 1;
// Ok - the space loaded and available
Ok = 2;
// Missing - the space is missing
Missing = 3;
// Error - the space loading ended with an error
Error = 4;
// RemoteWaitingDeletion - network status is "waiting deletion"
RemoteWaitingDeletion = 5;
// RemoteDeleted - the space is deleted in the current network
RemoteDeleted = 6;
// SpaceDeleted - the space should be deleted in the network
SpaceDeleted = 7;
// SpaceActive - the space is active in the network
SpaceActive = 8;
// SpaceJoining - the account is joining the space
SpaceJoining = 9;
// SpaceRemoving - the account is removing from space or the space is removed from network
SpaceRemoving = 10;
}
message ParticipantPermissionChange {
string identity = 1;
ParticipantPermissions perms = 2;
}
enum ParticipantPermissions {
Reader = 0;
Writer = 1;
Owner = 2;
NoPermissions = 3;
}
enum ParticipantStatus {
Joining = 0;
Active = 1;
Removed = 2;
Declined = 3;
Removing = 4;