-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpost.proto
More file actions
105 lines (89 loc) · 2.57 KB
/
Copy pathpost.proto
File metadata and controls
105 lines (89 loc) · 2.57 KB
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
syntax = "proto3";
package fyreplace.protos;
option csharp_namespace = "Fyreplace.Protos";
option java_generate_equals_and_hash = true;
option java_multiple_files = true;
option java_package = "app.fyreplace.protos";
option objc_class_prefix = "FP";
option swift_prefix = "FP";
import "google/protobuf/empty.proto";
import "google/protobuf/timestamp.proto";
import "protos/id.proto";
import "protos/image.proto";
import "protos/pagination.proto";
import "protos/user.proto";
message ChapterLocation {
bytes post_id = 1;
uint32 position = 2;
}
message ChapterRelocation {
bytes post_id = 1;
uint32 from_position = 2;
uint32 to_position = 3;
}
message Chapter {
string text = 1;
bool is_title = 2;
Image image = 3;
}
message ChapterTextUpdate {
ChapterLocation location = 1;
string text = 2;
bool is_title = 3;
}
message ChapterImageUpdate {
oneof update {
ChapterLocation location = 10;
ImageChunk chunk = 11;
}
}
message Post {
bytes id = 1;
Profile author = 2;
bool is_anonymous = 3;
bool is_subscribed = 4;
google.protobuf.Timestamp date_created = 5;
bool is_preview = 6;
repeated Chapter chapters = 7;
uint32 chapter_count = 8;
uint32 comments_read = 9;
uint32 vote_count = 10;
uint32 comment_count = 11;
}
message Posts {
repeated Post posts = 1;
Cursor previous = 2;
Cursor next = 3;
}
message Publication {
bytes id = 1;
bool anonymous = 2;
}
message Subscription {
bytes id = 1;
bool subscribed = 2;
}
message Vote {
bytes post_id = 1;
bool spread = 2;
}
service PostService {
rpc ListFeed (stream Vote) returns (stream Post);
rpc ListArchive (stream Page) returns (stream Posts);
rpc ListOwnPosts (stream Page) returns (stream Posts);
rpc ListDrafts (stream Page) returns (stream Posts);
rpc Retrieve (Id) returns (Post);
rpc Create (google.protobuf.Empty) returns (Id);
rpc Publish (Publication) returns (google.protobuf.Empty);
rpc Delete (Id) returns (google.protobuf.Empty);
rpc UpdateSubscription (Subscription) returns (google.protobuf.Empty);
rpc Report (Id) returns (google.protobuf.Empty);
rpc Absolve (Id) returns (google.protobuf.Empty);
}
service ChapterService {
rpc Create (ChapterLocation) returns (google.protobuf.Empty);
rpc Move (ChapterRelocation) returns (google.protobuf.Empty);
rpc UpdateText (ChapterTextUpdate) returns (google.protobuf.Empty);
rpc UpdateImage (stream ChapterImageUpdate) returns (Image);
rpc Delete (ChapterLocation) returns (google.protobuf.Empty);
}