this repo has no description
1syntax = "proto3";
2
3package vyletdatabase;
4option go_package = "./;vyletdatabase";
5
6import "buf/validate/validate.proto";
7
8import "google/protobuf/timestamp.proto";
9
10service PostService {
11 rpc CreatePost(CreatePostRequest) returns (CreatePostResponse);
12 rpc DeletePost(DeletePostRequest) returns (DeletePostResponse);
13
14 rpc GetPosts(GetPostsRequest) returns (GetPostsResponse);
15 rpc GetPostsByActor(GetPostsByActorRequest) returns (GetPostsByActorResponse);
16 rpc GetPostInteractionCounts(GetPostInteractionCountsRequest) returns (GetPostInteractionCountsResponse);
17 rpc GetPostsInteractionCounts(GetPostsInteractionCountsRequest) returns (GetPostsInteractionCountsResponse);
18}
19
20message Image {
21 string cid = 1 [
22 (buf.validate.field).required = true
23 ];
24 optional string alt = 2;
25 optional int64 width = 3;
26 optional int64 height = 4;
27 int64 size = 5;
28 string mime = 6;
29}
30
31message Post {
32 string uri = 1 [
33 (buf.validate.field).required = true
34 ];
35 string cid = 2 [
36 (buf.validate.field).required = true
37 ];
38 string author_did = 3 [
39 (buf.validate.field).required = true
40 ];
41 repeated Image images = 4;
42 optional string caption = 5;
43 optional bytes facets = 6;
44 google.protobuf.Timestamp created_at = 7;
45 google.protobuf.Timestamp indexed_at = 8;
46}
47
48message CreatePostRequest {
49 Post post = 1;
50}
51
52message CreatePostResponse {
53 optional string error = 1;
54}
55
56message DeletePostRequest {
57 string uri = 1 [
58 (buf.validate.field).required = true
59 ];
60}
61
62message DeletePostResponse {
63 optional string error = 1;
64}
65
66message GetPostsRequest {
67 repeated string uris = 1 [
68 (buf.validate.field).required = true
69 ];
70}
71
72message GetPostsResponse {
73 optional string error = 1;
74 map<string, Post> posts = 2;
75}
76
77message GetPostsByActorRequest {
78 string did = 1 [
79 (buf.validate.field).required = true
80 ];
81 int64 limit = 2 [
82 (buf.validate.field).required = true
83 ];
84 optional string cursor = 3;
85}
86
87message GetPostsByActorResponse {
88 optional string error = 1;
89 map<string, Post> posts = 2;
90 optional string cursor = 3;
91}
92
93message GetPostInteractionCountsRequest {
94 string uri = 1 [
95 (buf.validate.field).required = true
96 ];
97}
98
99message PostInteractionCounts {
100 int64 likes = 1 [
101 (buf.validate.field).required = true
102 ];
103 int64 replies = 2 [
104 (buf.validate.field).required = true
105 ];
106}
107
108message GetPostInteractionCountsResponse {
109 optional string error = 1;
110 optional PostInteractionCounts counts = 2;
111}
112
113message GetPostsInteractionCountsRequest {
114 repeated string uris = 1 [
115 (buf.validate.field).required = true
116 ];
117}
118
119message GetPostsInteractionCountsResponse {
120 optional string error = 1;
121 map<string, PostInteractionCounts> counts = 2;
122}