jr-common-micro 1.1.49 → 1.1.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,207 @@
1
+ syntax = "proto3";
2
+
3
+ package micro.v1.chat;
4
+
5
+ import "micro/v1/general.proto";
6
+
7
+ // ===== Groups =====
8
+
9
+ message ChatGroupDto {
10
+ string id = 1;
11
+ string name = 2;
12
+ string slug = 3;
13
+ string description = 4;
14
+ string icon = 5;
15
+ // public | private
16
+ string type = 6;
17
+ bool is_vip_only = 7;
18
+ int32 slow_mode_seconds = 8;
19
+ uint32 member_count = 9;
20
+ uint32 online_count = 10;
21
+ // Viewer relation: none | pending | member
22
+ string membership = 11;
23
+ uint32 unread_count = 12;
24
+ string last_message_preview = 13;
25
+ string last_message_at = 14;
26
+ }
27
+
28
+ message ChatGroupListResponse {
29
+ ResponseStatus status = 1;
30
+ repeated ChatGroupDto data = 2;
31
+ }
32
+
33
+ message GroupBySlugRequest { string slug = 1; }
34
+
35
+ message JoinGroupResponse {
36
+ ResponseStatus status = 1;
37
+ // member | pending
38
+ string membership = 2;
39
+ }
40
+
41
+ message ChatGroupSingleResponse {
42
+ ResponseStatus status = 1;
43
+ ChatGroupDto data = 2;
44
+ }
45
+
46
+ // ===== Messages =====
47
+
48
+ message ChatMessageDto {
49
+ string id = 1;
50
+ string group_id = 2;
51
+ string user_id = 3;
52
+ string username = 4;
53
+ string role = 5;
54
+ string avatar_id = 6;
55
+ // text | image | system
56
+ string type = 7;
57
+ string content = 8;
58
+ string reply_to_id = 9;
59
+ ChatReplyPreviewDto reply_to = 10;
60
+ string image_url = 11;
61
+ bool is_pinned = 12;
62
+ string created_at = 13;
63
+ bool is_deleted = 14;
64
+ }
65
+
66
+ message ChatReplyPreviewDto {
67
+ string id = 1;
68
+ string username = 2;
69
+ string content = 3;
70
+ }
71
+
72
+ message MessageHistoryRequest {
73
+ string group_slug = 1;
74
+ // Return messages with id < cursor (0 or empty = newest page).
75
+ string cursor = 2;
76
+ int32 limit = 3;
77
+ }
78
+
79
+ message MessageHistoryResponse {
80
+ ResponseStatus status = 1;
81
+ repeated ChatMessageDto data = 2;
82
+ // Cursor for the next (older) page; empty = no more.
83
+ string next_cursor = 3;
84
+ }
85
+
86
+ message PinnedMessagesRequest { string group_slug = 1; }
87
+
88
+ message PinnedMessagesResponse {
89
+ ResponseStatus status = 1;
90
+ repeated ChatMessageDto data = 2;
91
+ }
92
+
93
+ // ===== Report / Block =====
94
+
95
+ message ReportMessageRequest {
96
+ string message_id = 1;
97
+ string reason = 2;
98
+ }
99
+
100
+ message BlockUserRequest { string username = 1; }
101
+
102
+ message BlockedUsersResponse {
103
+ ResponseStatus status = 1;
104
+ repeated string usernames = 2;
105
+ repeated string user_ids = 3;
106
+ }
107
+
108
+ // ===== Moderation (admin/moderator) =====
109
+
110
+ message GroupUpsertRequest {
111
+ // Empty id = create.
112
+ string id = 1;
113
+ string name = 2;
114
+ string description = 3;
115
+ string icon = 4;
116
+ string type = 5;
117
+ bool is_vip_only = 6;
118
+ int32 slow_mode_seconds = 7;
119
+ int32 sort_order = 8;
120
+ bool is_active = 9;
121
+ }
122
+
123
+ message SanctionRequest {
124
+ string username = 1;
125
+ // Empty = global sanction.
126
+ string group_slug = 2;
127
+ // ban | mute
128
+ string type = 3;
129
+ int32 duration_minutes = 4;
130
+ string reason = 5;
131
+ }
132
+
133
+ message RevokeSanctionRequest { string sanction_id = 1; }
134
+
135
+ message DeleteMessageRequest { string message_id = 1; }
136
+
137
+ message PinMessageRequest {
138
+ string message_id = 1;
139
+ bool pinned = 2;
140
+ }
141
+
142
+ message MemberActionRequest {
143
+ string group_slug = 1;
144
+ string username = 2;
145
+ // approve | reject | make_moderator | remove_moderator
146
+ string action = 3;
147
+ }
148
+
149
+ message PendingMembersRequest { string group_slug = 1; }
150
+
151
+ message ChatMemberDto {
152
+ string user_id = 1;
153
+ string username = 2;
154
+ string avatar_id = 3;
155
+ string role = 4;
156
+ string status = 5;
157
+ string joined_at = 6;
158
+ }
159
+
160
+ message ChatMemberListResponse {
161
+ ResponseStatus status = 1;
162
+ PaginationMetaResult pagination = 2;
163
+ repeated ChatMemberDto data = 3;
164
+ }
165
+
166
+ message SanctionDto {
167
+ string id = 1;
168
+ string user_id = 2;
169
+ string username = 3;
170
+ string group_slug = 4;
171
+ string type = 5;
172
+ string reason = 6;
173
+ string expires_at = 7;
174
+ string created_by = 8;
175
+ string created_at = 9;
176
+ }
177
+
178
+ message SanctionListResponse {
179
+ ResponseStatus status = 1;
180
+ PaginationMetaResult pagination = 2;
181
+ repeated SanctionDto data = 3;
182
+ }
183
+
184
+ message ReportDto {
185
+ string id = 1;
186
+ string group_id = 2;
187
+ string message_id = 3;
188
+ string reporter_id = 4;
189
+ string reported_user_id = 5;
190
+ string reported_username = 6;
191
+ string content_snapshot = 7;
192
+ string reason = 8;
193
+ string status = 9;
194
+ string created_at = 10;
195
+ }
196
+
197
+ message ReportListResponse {
198
+ ResponseStatus status = 1;
199
+ PaginationMetaResult pagination = 2;
200
+ repeated ReportDto data = 3;
201
+ }
202
+
203
+ message ReviewReportRequest {
204
+ string report_id = 1;
205
+ // reviewed | dismissed
206
+ string status = 2;
207
+ }
@@ -0,0 +1,38 @@
1
+ syntax = "proto3";
2
+
3
+ package micro.v1.chat;
4
+
5
+ import "micro/v1/general.proto";
6
+ import "micro/v1/chat/chat_messages.proto";
7
+
8
+ service PChatService {
9
+ rpc ListGroups(EmptyRequest) returns(stream ChatGroupListResponse) {}
10
+ rpc GetGroup(GroupBySlugRequest) returns(stream ChatGroupSingleResponse) {}
11
+ rpc JoinGroup(GroupBySlugRequest) returns(stream JoinGroupResponse) {}
12
+ rpc LeaveGroup(GroupBySlugRequest) returns(stream EmptyResponse) {}
13
+
14
+ rpc MessageHistory(MessageHistoryRequest) returns(stream MessageHistoryResponse) {}
15
+ rpc PinnedMessages(PinnedMessagesRequest) returns(stream PinnedMessagesResponse) {}
16
+
17
+ rpc ReportMessage(ReportMessageRequest) returns(stream EmptyResponse) {}
18
+ rpc BlockUser(BlockUserRequest) returns(stream EmptyResponse) {}
19
+ rpc UnblockUser(BlockUserRequest) returns(stream EmptyResponse) {}
20
+ rpc BlockedUsers(EmptyRequest) returns(stream BlockedUsersResponse) {}
21
+ }
22
+
23
+ service PChatModerationService {
24
+ rpc UpsertGroup(GroupUpsertRequest) returns(stream ChatGroupSingleResponse) {}
25
+
26
+ rpc ApplySanction(SanctionRequest) returns(stream EmptyResponse) {}
27
+ rpc RevokeSanction(RevokeSanctionRequest) returns(stream EmptyResponse) {}
28
+ rpc ListSanctions(PaginateRequest) returns(stream SanctionListResponse) {}
29
+
30
+ rpc DeleteMessage(DeleteMessageRequest) returns(stream EmptyResponse) {}
31
+ rpc PinMessage(PinMessageRequest) returns(stream EmptyResponse) {}
32
+
33
+ rpc PendingMembers(PendingMembersRequest) returns(stream ChatMemberListResponse) {}
34
+ rpc MemberAction(MemberActionRequest) returns(stream EmptyResponse) {}
35
+
36
+ rpc ListReports(PaginateRequest) returns(stream ReportListResponse) {}
37
+ rpc ReviewReport(ReviewReportRequest) returns(stream EmptyResponse) {}
38
+ }
@@ -71,8 +71,13 @@ message ProfileListItemDto {
71
71
  string username = 2;
72
72
  string avatar_id = 3;
73
73
  string role = 4;
74
+ // active | passive (e-mail verification state)
75
+ string status = 5;
74
76
  }
75
77
 
78
+ // Internal service-to-service lookup (not exposed over HTTP).
79
+ message ProfilesByIdsRequest { repeated string user_ids = 1; }
80
+
76
81
  message ProfileListResponse {
77
82
  ResponseStatus status = 1;
78
83
  PaginationMetaResult pagination = 2;
@@ -70,6 +70,7 @@ service PProfileService {
70
70
  rpc Like(LikeRequest) returns(stream ProfileSingleResponse) {}
71
71
  rpc Unlike(LikeRequest) returns(stream ProfileSingleResponse) {}
72
72
  rpc Followers(PaginateRequest) returns(stream ProfileListResponse) {}
73
+ rpc ProfilesByIds(ProfilesByIdsRequest) returns(stream ProfileListResponse) {}
73
74
  rpc Following(PaginateRequest) returns(stream ProfileListResponse) {}
74
75
  }
75
76