@verychat/channel-protos 1.0.0 → 1.0.6
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.
- package/channel-services.proto +215 -0
- package/channel-types.proto +109 -0
- package/dist/index.d.ts +51 -0
- package/dist/index.js +9 -0
- package/dist/proto-libs/channel-services.d.ts +210 -0
- package/dist/proto-libs/channel-services.js +57 -0
- package/dist/proto-libs/channel-types.d.ts +97 -0
- package/dist/proto-libs/channel-types.js +25 -0
- package/package.json +15 -10
- package/proto-libs/channel-services.ts +378 -0
- package/proto-libs/channel-types.ts +119 -0
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package channel;
|
|
4
|
+
import "channel-types.proto";
|
|
5
|
+
|
|
6
|
+
message Empty {}
|
|
7
|
+
|
|
8
|
+
message GetChannelRequest {
|
|
9
|
+
int32 userId = 1;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
message GetMyChannelsResponse {
|
|
13
|
+
repeated Channel channels = 1;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
message GetMySubscribedChannelResponse {
|
|
17
|
+
repeated UserChannel userChannels = 1;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
message CreateChannelRequest {
|
|
21
|
+
int32 userId = 1;
|
|
22
|
+
CreateChannelDto dto = 2;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
message CreateChannelResponse {
|
|
26
|
+
string channelId = 1;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
message GetChannelInfoRequest {
|
|
30
|
+
string channelId = 1;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
message GetChannelInfoResponse {
|
|
34
|
+
ChannelInfo channelInfo = 1;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
message ReadMessageRequest {
|
|
38
|
+
string channelId = 1;
|
|
39
|
+
int32 userId = 2;
|
|
40
|
+
int32 lastSeq = 3;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
message GetMessageViewCountRequest {
|
|
44
|
+
string channelId = 1;
|
|
45
|
+
repeated int32 seqs = 2;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
message GetMessageViewCountResponse {
|
|
49
|
+
map<int32, int32> viewCount = 1;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
message CreateMessageRequest {
|
|
53
|
+
string channelId = 1;
|
|
54
|
+
optional string title = 2;
|
|
55
|
+
int32 userId = 3;
|
|
56
|
+
CreateMessageDto dto = 4;
|
|
57
|
+
int32 lastChatSeq = 5;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
message CreateMessageResponse {
|
|
61
|
+
int32 seq = 1;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
message UpdateMessageRequest {
|
|
65
|
+
string channelId = 1;
|
|
66
|
+
int32 userId = 2;
|
|
67
|
+
int32 seq = 3;
|
|
68
|
+
string originMessage = 4;
|
|
69
|
+
string message = 5;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
message DeleteMessageRequest {
|
|
73
|
+
string channelId = 1;
|
|
74
|
+
int32 seq = 2;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
message ReactionMessageRequest {
|
|
78
|
+
string channelId = 1;
|
|
79
|
+
repeated ReactionMessageDto dto = 2;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
message JoinChannelRequest {
|
|
83
|
+
repeated int32 userIds = 1;
|
|
84
|
+
string channelId = 2;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
message LeaveChannelRequest {
|
|
88
|
+
int32 userId = 1;
|
|
89
|
+
string channelId = 2;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
message DestroyChannelRequest {
|
|
93
|
+
string channelId = 1;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
message ChangeChannelOwnerRequest {
|
|
97
|
+
string channelId = 1;
|
|
98
|
+
int32 targetUserId = 2;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
message GetOperatorRequest {
|
|
102
|
+
string channelId = 1;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
message GetOperatorResponse {
|
|
106
|
+
repeated Operator operators = 1;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
message SetOperatorRequest {
|
|
110
|
+
string channelId = 1;
|
|
111
|
+
int32 targetUserId = 2;
|
|
112
|
+
optional bool chatDeleteAuth = 3;
|
|
113
|
+
optional bool chatSlowAuth = 4;
|
|
114
|
+
optional bool infoAuth = 5;
|
|
115
|
+
optional bool pinAuth = 6;
|
|
116
|
+
optional bool postAuth = 7;
|
|
117
|
+
optional bool userBanAuth = 8;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
message RemoveOperatorRequest {
|
|
121
|
+
string channelId = 1;
|
|
122
|
+
int32 targetUserId = 2;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
message RemoveOperatorResponse {
|
|
126
|
+
int32 removeId = 1;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
message GetMessageRequest {
|
|
130
|
+
string channelId = 1;
|
|
131
|
+
int32 seq = 2;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
message GetMessageResponse {
|
|
135
|
+
ChannelMessage message = 1;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
message GetMessagesRequest {
|
|
139
|
+
string channelId = 1;
|
|
140
|
+
int32 lastMessageSeq = 2;
|
|
141
|
+
int32 seq = 3;
|
|
142
|
+
int32 take = 4;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
message GetMessagesResponse {
|
|
146
|
+
repeated ChannelMessage messages = 1;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
message GetMessageReactionsRequest {
|
|
150
|
+
string channelId = 1;
|
|
151
|
+
int32 lastStreamId = 2;
|
|
152
|
+
int32 streamId = 3;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
message GetMessageReactionsResponse {
|
|
156
|
+
repeated MessageReaction historys = 1;
|
|
157
|
+
bool next = 2;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
message HoldMessageRequest {
|
|
161
|
+
string channelId = 1;
|
|
162
|
+
int32 seq = 2;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
message GetMembersRequest {
|
|
166
|
+
string channelId = 1;
|
|
167
|
+
optional int32 cursorUserId = 2;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
message GetMembersResponse {
|
|
171
|
+
repeated int32 members = 1;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
service ChannelService {
|
|
175
|
+
rpc CreateChannel (CreateChannelRequest) returns (CreateChannelResponse);
|
|
176
|
+
rpc GetMyChannels (GetChannelRequest) returns (GetMyChannelsResponse);
|
|
177
|
+
rpc GetMySubscribeChannels (GetChannelRequest) returns (GetMySubscribedChannelResponse);
|
|
178
|
+
|
|
179
|
+
rpc GetChannelInfo (GetChannelInfoRequest) returns (GetChannelInfoResponse);
|
|
180
|
+
|
|
181
|
+
rpc ReadMessage (ReadMessageRequest) returns (Empty);
|
|
182
|
+
rpc GetViewCount (GetMessageViewCountRequest) returns (GetMessageViewCountResponse);
|
|
183
|
+
|
|
184
|
+
rpc CreateMessage (CreateMessageRequest) returns (CreateMessageResponse);
|
|
185
|
+
rpc UpdateMessage (UpdateMessageRequest) returns (Empty);
|
|
186
|
+
rpc DeleteMessage (DeleteMessageRequest) returns (Empty);
|
|
187
|
+
|
|
188
|
+
rpc ReactionMessage (ReactionMessageRequest) returns (Empty);
|
|
189
|
+
|
|
190
|
+
rpc JoinChannel (JoinChannelRequest) returns (Empty);
|
|
191
|
+
rpc LeaveChannel (LeaveChannelRequest) returns (Empty);
|
|
192
|
+
rpc DestroyChannel (DestroyChannelRequest) returns (Empty);
|
|
193
|
+
|
|
194
|
+
rpc ChangeChannelOwner (ChangeChannelOwnerRequest) returns (Empty);
|
|
195
|
+
|
|
196
|
+
rpc GetOperator (GetOperatorRequest) returns (GetOperatorResponse);
|
|
197
|
+
rpc SetOperator (SetOperatorRequest) returns (Empty);
|
|
198
|
+
rpc RemoveOperator (RemoveOperatorRequest) returns (RemoveOperatorResponse);
|
|
199
|
+
|
|
200
|
+
rpc GetMessage (GetMessageRequest) returns (GetMessageResponse);
|
|
201
|
+
rpc GetMessages (GetMessagesRequest) returns (GetMessagesResponse);
|
|
202
|
+
rpc GetMessageReactions (GetMessageReactionsRequest) returns (GetMessageReactionsResponse);
|
|
203
|
+
|
|
204
|
+
rpc HoldMessage (HoldMessageRequest) returns (Empty);
|
|
205
|
+
rpc GetMembers (GetMembersRequest) returns (GetMembersResponse);
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
rpc ChannelChatCreateMessage (CreateMessageRequest) returns (CreateMessageResponse);
|
|
209
|
+
rpc ChannelChatUpdateMessage (UpdateMessageRequest) returns (Empty);
|
|
210
|
+
rpc ChannelChatDeleteMessage (DeleteMessageRequest) returns (Empty);
|
|
211
|
+
rpc ChannelChatReactionMessage (ReactionMessageRequest) returns (Empty);
|
|
212
|
+
rpc ChannelChatGetMessage (GetMessageRequest) returns (GetMessageResponse);
|
|
213
|
+
rpc ChannelChatGetMessages (GetMessagesRequest) returns (GetMessagesResponse);
|
|
214
|
+
rpc ChannelChatGetMessageReactions (GetMessageReactionsRequest) returns (GetMessageReactionsResponse);
|
|
215
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package channel;
|
|
4
|
+
|
|
5
|
+
message LastMessage {
|
|
6
|
+
int32 seq = 1;
|
|
7
|
+
string createdAt = 2;
|
|
8
|
+
string message = 3;
|
|
9
|
+
MessageType type = 4;
|
|
10
|
+
int32 userId = 5;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
message ChannelInfo {
|
|
14
|
+
string channelId = 1;
|
|
15
|
+
ChannelType channelType = 2;
|
|
16
|
+
repeated string channelTag = 3;
|
|
17
|
+
string title = 4;
|
|
18
|
+
optional string description = 5;
|
|
19
|
+
int32 ownerId = 6;
|
|
20
|
+
int32 joinUserCount = 7;
|
|
21
|
+
optional string thumbnailUrl = 8;
|
|
22
|
+
optional int32 holdMessageSeq = 9;
|
|
23
|
+
optional int32 lastMessageSeq = 10;
|
|
24
|
+
optional int32 lastStreamId = 11;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
message Channel {
|
|
28
|
+
string title = 1;
|
|
29
|
+
ChannelType channelType = 2;
|
|
30
|
+
int32 joinUserCount = 3;
|
|
31
|
+
string thumbnailUrl = 4;
|
|
32
|
+
LastMessage lastMessage = 5;
|
|
33
|
+
string channelId = 6;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
message UserChannel {
|
|
37
|
+
string channelId = 1;
|
|
38
|
+
Channel channel = 2;
|
|
39
|
+
int32 lastReadMessageSeq = 3;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
message CreateChannelDto {
|
|
43
|
+
string userChannelId = 1;
|
|
44
|
+
optional string title = 2;
|
|
45
|
+
optional string description = 3;
|
|
46
|
+
ChannelType type = 4;
|
|
47
|
+
optional string password = 5;
|
|
48
|
+
optional string thumbnailUrl = 6;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
message CreateMessageDto {
|
|
52
|
+
MessageType type = 1;
|
|
53
|
+
string message = 2;
|
|
54
|
+
repeated int32 mentions = 3;
|
|
55
|
+
optional int32 reply = 4;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
message ReactionMessageDto {
|
|
59
|
+
int32 userId = 1;
|
|
60
|
+
int32 seq = 2;
|
|
61
|
+
string reactionCode = 3;
|
|
62
|
+
int32 streamId = 4;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
message ChannelMessage {
|
|
66
|
+
int32 userId = 1;
|
|
67
|
+
MessageType type = 2;
|
|
68
|
+
string createdAt = 3;
|
|
69
|
+
string deletedAt = 4;
|
|
70
|
+
int32 seq = 5;
|
|
71
|
+
string message = 6;
|
|
72
|
+
repeated int32 mentions = 7;
|
|
73
|
+
int64 reply = 8;
|
|
74
|
+
repeated Reaction reactions = 9;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
message Reaction {
|
|
78
|
+
int32 userId = 1;
|
|
79
|
+
string reactionCode = 2;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
message MessageReaction {
|
|
83
|
+
int32 streamId = 1;
|
|
84
|
+
int32 userId = 2;
|
|
85
|
+
int32 seq = 3;
|
|
86
|
+
string reactionCode = 4;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
message Operator {
|
|
90
|
+
int32 userId = 1;
|
|
91
|
+
bool chatDeleteAuth = 2;
|
|
92
|
+
bool chatSlowAuth = 3;
|
|
93
|
+
bool infoAuth = 4;
|
|
94
|
+
bool pinAuth = 5;
|
|
95
|
+
bool postAuth = 6;
|
|
96
|
+
bool userBanAuth = 7;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
enum MessageType {
|
|
100
|
+
text = 0;
|
|
101
|
+
image = 1;
|
|
102
|
+
video = 2;
|
|
103
|
+
file = 3;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
enum ChannelType {
|
|
107
|
+
PRIVATE = 0;
|
|
108
|
+
PUBLIC = 1;
|
|
109
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export { Empty } from './proto-libs/channel-services';
|
|
2
|
+
export { GetChannelRequest } from './proto-libs/channel-services';
|
|
3
|
+
export { GetMyChannelsResponse } from './proto-libs/channel-services';
|
|
4
|
+
export { GetMySubscribedChannelResponse } from './proto-libs/channel-services';
|
|
5
|
+
export { CreateChannelRequest } from './proto-libs/channel-services';
|
|
6
|
+
export { CreateChannelResponse } from './proto-libs/channel-services';
|
|
7
|
+
export { GetChannelInfoRequest } from './proto-libs/channel-services';
|
|
8
|
+
export { GetChannelInfoResponse } from './proto-libs/channel-services';
|
|
9
|
+
export { ReadMessageRequest } from './proto-libs/channel-services';
|
|
10
|
+
export { GetMessageViewCountRequest } from './proto-libs/channel-services';
|
|
11
|
+
export { GetMessageViewCountResponse } from './proto-libs/channel-services';
|
|
12
|
+
export { GetMessageViewCountResponse_ViewCountEntry } from './proto-libs/channel-services';
|
|
13
|
+
export { CreateMessageRequest } from './proto-libs/channel-services';
|
|
14
|
+
export { CreateMessageResponse } from './proto-libs/channel-services';
|
|
15
|
+
export { UpdateMessageRequest } from './proto-libs/channel-services';
|
|
16
|
+
export { DeleteMessageRequest } from './proto-libs/channel-services';
|
|
17
|
+
export { ReactionMessageRequest } from './proto-libs/channel-services';
|
|
18
|
+
export { JoinChannelRequest } from './proto-libs/channel-services';
|
|
19
|
+
export { LeaveChannelRequest } from './proto-libs/channel-services';
|
|
20
|
+
export { DestroyChannelRequest } from './proto-libs/channel-services';
|
|
21
|
+
export { ChangeChannelOwnerRequest } from './proto-libs/channel-services';
|
|
22
|
+
export { GetOperatorRequest } from './proto-libs/channel-services';
|
|
23
|
+
export { GetOperatorResponse } from './proto-libs/channel-services';
|
|
24
|
+
export { SetOperatorRequest } from './proto-libs/channel-services';
|
|
25
|
+
export { RemoveOperatorRequest } from './proto-libs/channel-services';
|
|
26
|
+
export { RemoveOperatorResponse } from './proto-libs/channel-services';
|
|
27
|
+
export { GetMessageRequest } from './proto-libs/channel-services';
|
|
28
|
+
export { GetMessageResponse } from './proto-libs/channel-services';
|
|
29
|
+
export { GetMessagesRequest } from './proto-libs/channel-services';
|
|
30
|
+
export { GetMessagesResponse } from './proto-libs/channel-services';
|
|
31
|
+
export { GetMessageReactionsRequest } from './proto-libs/channel-services';
|
|
32
|
+
export { GetMessageReactionsResponse } from './proto-libs/channel-services';
|
|
33
|
+
export { HoldMessageRequest } from './proto-libs/channel-services';
|
|
34
|
+
export { GetMembersRequest } from './proto-libs/channel-services';
|
|
35
|
+
export { GetMembersResponse } from './proto-libs/channel-services';
|
|
36
|
+
export { ChannelServiceClient } from './proto-libs/channel-services';
|
|
37
|
+
export { ChannelServiceController } from './proto-libs/channel-services';
|
|
38
|
+
export { protobufPackage } from './proto-libs/channel-services';
|
|
39
|
+
export { MessageType } from './proto-libs/channel-types';
|
|
40
|
+
export { ChannelType } from './proto-libs/channel-types';
|
|
41
|
+
export { LastMessage } from './proto-libs/channel-types';
|
|
42
|
+
export { ChannelInfo } from './proto-libs/channel-types';
|
|
43
|
+
export { Channel } from './proto-libs/channel-types';
|
|
44
|
+
export { UserChannel } from './proto-libs/channel-types';
|
|
45
|
+
export { CreateChannelDto } from './proto-libs/channel-types';
|
|
46
|
+
export { CreateMessageDto } from './proto-libs/channel-types';
|
|
47
|
+
export { ReactionMessageDto } from './proto-libs/channel-types';
|
|
48
|
+
export { ChannelMessage } from './proto-libs/channel-types';
|
|
49
|
+
export { Reaction } from './proto-libs/channel-types';
|
|
50
|
+
export { MessageReaction } from './proto-libs/channel-types';
|
|
51
|
+
export { Operator } from './proto-libs/channel-types';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ChannelType = exports.MessageType = exports.protobufPackage = void 0;
|
|
4
|
+
var channel_services_1 = require("./proto-libs/channel-services");
|
|
5
|
+
Object.defineProperty(exports, "protobufPackage", { enumerable: true, get: function () { return channel_services_1.protobufPackage; } });
|
|
6
|
+
var channel_types_1 = require("./proto-libs/channel-types");
|
|
7
|
+
Object.defineProperty(exports, "MessageType", { enumerable: true, get: function () { return channel_types_1.MessageType; } });
|
|
8
|
+
var channel_types_2 = require("./proto-libs/channel-types");
|
|
9
|
+
Object.defineProperty(exports, "ChannelType", { enumerable: true, get: function () { return channel_types_2.ChannelType; } });
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import { Metadata } from "@grpc/grpc-js";
|
|
2
|
+
import { Observable } from "rxjs";
|
|
3
|
+
import { Channel, ChannelInfo, ChannelMessage, CreateChannelDto, CreateMessageDto, MessageReaction, Operator, ReactionMessageDto, UserChannel } from "./channel-types";
|
|
4
|
+
export declare const protobufPackage = "channel";
|
|
5
|
+
export interface Empty {
|
|
6
|
+
}
|
|
7
|
+
export interface GetChannelRequest {
|
|
8
|
+
userId: number;
|
|
9
|
+
}
|
|
10
|
+
export interface GetMyChannelsResponse {
|
|
11
|
+
channels: Channel[];
|
|
12
|
+
}
|
|
13
|
+
export interface GetMySubscribedChannelResponse {
|
|
14
|
+
userChannels: UserChannel[];
|
|
15
|
+
}
|
|
16
|
+
export interface CreateChannelRequest {
|
|
17
|
+
userId: number;
|
|
18
|
+
dto: CreateChannelDto | undefined;
|
|
19
|
+
}
|
|
20
|
+
export interface CreateChannelResponse {
|
|
21
|
+
channelId: string;
|
|
22
|
+
}
|
|
23
|
+
export interface GetChannelInfoRequest {
|
|
24
|
+
channelId: string;
|
|
25
|
+
}
|
|
26
|
+
export interface GetChannelInfoResponse {
|
|
27
|
+
channelInfo: ChannelInfo | undefined;
|
|
28
|
+
}
|
|
29
|
+
export interface ReadMessageRequest {
|
|
30
|
+
channelId: string;
|
|
31
|
+
userId: number;
|
|
32
|
+
lastSeq: number;
|
|
33
|
+
}
|
|
34
|
+
export interface GetMessageViewCountRequest {
|
|
35
|
+
channelId: string;
|
|
36
|
+
seqs: number[];
|
|
37
|
+
}
|
|
38
|
+
export interface GetMessageViewCountResponse {
|
|
39
|
+
viewCount: {
|
|
40
|
+
[key: number]: number;
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
export interface GetMessageViewCountResponse_ViewCountEntry {
|
|
44
|
+
key: number;
|
|
45
|
+
value: number;
|
|
46
|
+
}
|
|
47
|
+
export interface CreateMessageRequest {
|
|
48
|
+
channelId: string;
|
|
49
|
+
title?: string | undefined;
|
|
50
|
+
userId: number;
|
|
51
|
+
dto: CreateMessageDto | undefined;
|
|
52
|
+
lastChatSeq: number;
|
|
53
|
+
}
|
|
54
|
+
export interface CreateMessageResponse {
|
|
55
|
+
seq: number;
|
|
56
|
+
}
|
|
57
|
+
export interface UpdateMessageRequest {
|
|
58
|
+
channelId: string;
|
|
59
|
+
userId: number;
|
|
60
|
+
seq: number;
|
|
61
|
+
originMessage: string;
|
|
62
|
+
message: string;
|
|
63
|
+
}
|
|
64
|
+
export interface DeleteMessageRequest {
|
|
65
|
+
channelId: string;
|
|
66
|
+
seq: number;
|
|
67
|
+
}
|
|
68
|
+
export interface ReactionMessageRequest {
|
|
69
|
+
channelId: string;
|
|
70
|
+
dto: ReactionMessageDto[];
|
|
71
|
+
}
|
|
72
|
+
export interface JoinChannelRequest {
|
|
73
|
+
userIds: number[];
|
|
74
|
+
channelId: string;
|
|
75
|
+
}
|
|
76
|
+
export interface LeaveChannelRequest {
|
|
77
|
+
userId: number;
|
|
78
|
+
channelId: string;
|
|
79
|
+
}
|
|
80
|
+
export interface DestroyChannelRequest {
|
|
81
|
+
channelId: string;
|
|
82
|
+
}
|
|
83
|
+
export interface ChangeChannelOwnerRequest {
|
|
84
|
+
channelId: string;
|
|
85
|
+
targetUserId: number;
|
|
86
|
+
}
|
|
87
|
+
export interface GetOperatorRequest {
|
|
88
|
+
channelId: string;
|
|
89
|
+
}
|
|
90
|
+
export interface GetOperatorResponse {
|
|
91
|
+
operators: Operator[];
|
|
92
|
+
}
|
|
93
|
+
export interface SetOperatorRequest {
|
|
94
|
+
channelId: string;
|
|
95
|
+
targetUserId: number;
|
|
96
|
+
chatDeleteAuth?: boolean | undefined;
|
|
97
|
+
chatSlowAuth?: boolean | undefined;
|
|
98
|
+
infoAuth?: boolean | undefined;
|
|
99
|
+
pinAuth?: boolean | undefined;
|
|
100
|
+
postAuth?: boolean | undefined;
|
|
101
|
+
userBanAuth?: boolean | undefined;
|
|
102
|
+
}
|
|
103
|
+
export interface RemoveOperatorRequest {
|
|
104
|
+
channelId: string;
|
|
105
|
+
targetUserId: number;
|
|
106
|
+
}
|
|
107
|
+
export interface RemoveOperatorResponse {
|
|
108
|
+
removeId: number;
|
|
109
|
+
}
|
|
110
|
+
export interface GetMessageRequest {
|
|
111
|
+
channelId: string;
|
|
112
|
+
seq: number;
|
|
113
|
+
}
|
|
114
|
+
export interface GetMessageResponse {
|
|
115
|
+
message: ChannelMessage | undefined;
|
|
116
|
+
}
|
|
117
|
+
export interface GetMessagesRequest {
|
|
118
|
+
channelId: string;
|
|
119
|
+
lastMessageSeq: number;
|
|
120
|
+
seq: number;
|
|
121
|
+
take: number;
|
|
122
|
+
}
|
|
123
|
+
export interface GetMessagesResponse {
|
|
124
|
+
messages: ChannelMessage[];
|
|
125
|
+
}
|
|
126
|
+
export interface GetMessageReactionsRequest {
|
|
127
|
+
channelId: string;
|
|
128
|
+
lastStreamId: number;
|
|
129
|
+
streamId: number;
|
|
130
|
+
}
|
|
131
|
+
export interface GetMessageReactionsResponse {
|
|
132
|
+
historys: MessageReaction[];
|
|
133
|
+
next: boolean;
|
|
134
|
+
}
|
|
135
|
+
export interface HoldMessageRequest {
|
|
136
|
+
channelId: string;
|
|
137
|
+
seq: number;
|
|
138
|
+
}
|
|
139
|
+
export interface GetMembersRequest {
|
|
140
|
+
channelId: string;
|
|
141
|
+
cursorUserId?: number | undefined;
|
|
142
|
+
}
|
|
143
|
+
export interface GetMembersResponse {
|
|
144
|
+
members: number[];
|
|
145
|
+
}
|
|
146
|
+
export declare const CHANNEL_PACKAGE_NAME = "channel";
|
|
147
|
+
export interface ChannelServiceClient {
|
|
148
|
+
createChannel(request: CreateChannelRequest, metadata?: Metadata): Observable<CreateChannelResponse>;
|
|
149
|
+
getMyChannels(request: GetChannelRequest, metadata?: Metadata): Observable<GetMyChannelsResponse>;
|
|
150
|
+
getMySubscribeChannels(request: GetChannelRequest, metadata?: Metadata): Observable<GetMySubscribedChannelResponse>;
|
|
151
|
+
getChannelInfo(request: GetChannelInfoRequest, metadata?: Metadata): Observable<GetChannelInfoResponse>;
|
|
152
|
+
readMessage(request: ReadMessageRequest, metadata?: Metadata): Observable<Empty>;
|
|
153
|
+
getViewCount(request: GetMessageViewCountRequest, metadata?: Metadata): Observable<GetMessageViewCountResponse>;
|
|
154
|
+
createMessage(request: CreateMessageRequest, metadata?: Metadata): Observable<CreateMessageResponse>;
|
|
155
|
+
updateMessage(request: UpdateMessageRequest, metadata?: Metadata): Observable<Empty>;
|
|
156
|
+
deleteMessage(request: DeleteMessageRequest, metadata?: Metadata): Observable<Empty>;
|
|
157
|
+
reactionMessage(request: ReactionMessageRequest, metadata?: Metadata): Observable<Empty>;
|
|
158
|
+
joinChannel(request: JoinChannelRequest, metadata?: Metadata): Observable<Empty>;
|
|
159
|
+
leaveChannel(request: LeaveChannelRequest, metadata?: Metadata): Observable<Empty>;
|
|
160
|
+
destroyChannel(request: DestroyChannelRequest, metadata?: Metadata): Observable<Empty>;
|
|
161
|
+
changeChannelOwner(request: ChangeChannelOwnerRequest, metadata?: Metadata): Observable<Empty>;
|
|
162
|
+
getOperator(request: GetOperatorRequest, metadata?: Metadata): Observable<GetOperatorResponse>;
|
|
163
|
+
setOperator(request: SetOperatorRequest, metadata?: Metadata): Observable<Empty>;
|
|
164
|
+
removeOperator(request: RemoveOperatorRequest, metadata?: Metadata): Observable<RemoveOperatorResponse>;
|
|
165
|
+
getMessage(request: GetMessageRequest, metadata?: Metadata): Observable<GetMessageResponse>;
|
|
166
|
+
getMessages(request: GetMessagesRequest, metadata?: Metadata): Observable<GetMessagesResponse>;
|
|
167
|
+
getMessageReactions(request: GetMessageReactionsRequest, metadata?: Metadata): Observable<GetMessageReactionsResponse>;
|
|
168
|
+
holdMessage(request: HoldMessageRequest, metadata?: Metadata): Observable<Empty>;
|
|
169
|
+
getMembers(request: GetMembersRequest, metadata?: Metadata): Observable<GetMembersResponse>;
|
|
170
|
+
channelChatCreateMessage(request: CreateMessageRequest, metadata?: Metadata): Observable<CreateMessageResponse>;
|
|
171
|
+
channelChatUpdateMessage(request: UpdateMessageRequest, metadata?: Metadata): Observable<Empty>;
|
|
172
|
+
channelChatDeleteMessage(request: DeleteMessageRequest, metadata?: Metadata): Observable<Empty>;
|
|
173
|
+
channelChatReactionMessage(request: ReactionMessageRequest, metadata?: Metadata): Observable<Empty>;
|
|
174
|
+
channelChatGetMessage(request: GetMessageRequest, metadata?: Metadata): Observable<GetMessageResponse>;
|
|
175
|
+
channelChatGetMessages(request: GetMessagesRequest, metadata?: Metadata): Observable<GetMessagesResponse>;
|
|
176
|
+
channelChatGetMessageReactions(request: GetMessageReactionsRequest, metadata?: Metadata): Observable<GetMessageReactionsResponse>;
|
|
177
|
+
}
|
|
178
|
+
export interface ChannelServiceController {
|
|
179
|
+
createChannel(request: CreateChannelRequest, metadata?: Metadata): Observable<CreateChannelResponse>;
|
|
180
|
+
getMyChannels(request: GetChannelRequest, metadata?: Metadata): Observable<GetMyChannelsResponse>;
|
|
181
|
+
getMySubscribeChannels(request: GetChannelRequest, metadata?: Metadata): Observable<GetMySubscribedChannelResponse>;
|
|
182
|
+
getChannelInfo(request: GetChannelInfoRequest, metadata?: Metadata): Observable<GetChannelInfoResponse>;
|
|
183
|
+
readMessage(request: ReadMessageRequest, metadata?: Metadata): Observable<Empty>;
|
|
184
|
+
getViewCount(request: GetMessageViewCountRequest, metadata?: Metadata): Observable<GetMessageViewCountResponse>;
|
|
185
|
+
createMessage(request: CreateMessageRequest, metadata?: Metadata): Observable<CreateMessageResponse>;
|
|
186
|
+
updateMessage(request: UpdateMessageRequest, metadata?: Metadata): Observable<Empty>;
|
|
187
|
+
deleteMessage(request: DeleteMessageRequest, metadata?: Metadata): Observable<Empty>;
|
|
188
|
+
reactionMessage(request: ReactionMessageRequest, metadata?: Metadata): Observable<Empty>;
|
|
189
|
+
joinChannel(request: JoinChannelRequest, metadata?: Metadata): Observable<Empty>;
|
|
190
|
+
leaveChannel(request: LeaveChannelRequest, metadata?: Metadata): Observable<Empty>;
|
|
191
|
+
destroyChannel(request: DestroyChannelRequest, metadata?: Metadata): Observable<Empty>;
|
|
192
|
+
changeChannelOwner(request: ChangeChannelOwnerRequest, metadata?: Metadata): Observable<Empty>;
|
|
193
|
+
getOperator(request: GetOperatorRequest, metadata?: Metadata): Observable<GetOperatorResponse>;
|
|
194
|
+
setOperator(request: SetOperatorRequest, metadata?: Metadata): Observable<Empty>;
|
|
195
|
+
removeOperator(request: RemoveOperatorRequest, metadata?: Metadata): Observable<RemoveOperatorResponse>;
|
|
196
|
+
getMessage(request: GetMessageRequest, metadata?: Metadata): Observable<GetMessageResponse>;
|
|
197
|
+
getMessages(request: GetMessagesRequest, metadata?: Metadata): Observable<GetMessagesResponse>;
|
|
198
|
+
getMessageReactions(request: GetMessageReactionsRequest, metadata?: Metadata): Observable<GetMessageReactionsResponse>;
|
|
199
|
+
holdMessage(request: HoldMessageRequest, metadata?: Metadata): Observable<Empty>;
|
|
200
|
+
getMembers(request: GetMembersRequest, metadata?: Metadata): Observable<GetMembersResponse>;
|
|
201
|
+
channelChatCreateMessage(request: CreateMessageRequest, metadata?: Metadata): Observable<CreateMessageResponse>;
|
|
202
|
+
channelChatUpdateMessage(request: UpdateMessageRequest, metadata?: Metadata): Observable<Empty>;
|
|
203
|
+
channelChatDeleteMessage(request: DeleteMessageRequest, metadata?: Metadata): Observable<Empty>;
|
|
204
|
+
channelChatReactionMessage(request: ReactionMessageRequest, metadata?: Metadata): Observable<Empty>;
|
|
205
|
+
channelChatGetMessage(request: GetMessageRequest, metadata?: Metadata): Observable<GetMessageResponse>;
|
|
206
|
+
channelChatGetMessages(request: GetMessagesRequest, metadata?: Metadata): Observable<GetMessagesResponse>;
|
|
207
|
+
channelChatGetMessageReactions(request: GetMessageReactionsRequest, metadata?: Metadata): Observable<GetMessageReactionsResponse>;
|
|
208
|
+
}
|
|
209
|
+
export declare function ChannelServiceControllerMethods(): (constructor: Function) => void;
|
|
210
|
+
export declare const CHANNEL_SERVICE_NAME = "ChannelService";
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
+
// versions:
|
|
4
|
+
// protoc-gen-ts_proto v2.7.2
|
|
5
|
+
// protoc v3.20.3
|
|
6
|
+
// source: channel-services.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.CHANNEL_SERVICE_NAME = exports.CHANNEL_PACKAGE_NAME = exports.protobufPackage = void 0;
|
|
9
|
+
exports.ChannelServiceControllerMethods = ChannelServiceControllerMethods;
|
|
10
|
+
const microservices_1 = require("@nestjs/microservices");
|
|
11
|
+
exports.protobufPackage = "channel";
|
|
12
|
+
exports.CHANNEL_PACKAGE_NAME = "channel";
|
|
13
|
+
function ChannelServiceControllerMethods() {
|
|
14
|
+
return function (constructor) {
|
|
15
|
+
const grpcMethods = [
|
|
16
|
+
"createChannel",
|
|
17
|
+
"getMyChannels",
|
|
18
|
+
"getMySubscribeChannels",
|
|
19
|
+
"getChannelInfo",
|
|
20
|
+
"readMessage",
|
|
21
|
+
"getViewCount",
|
|
22
|
+
"createMessage",
|
|
23
|
+
"updateMessage",
|
|
24
|
+
"deleteMessage",
|
|
25
|
+
"reactionMessage",
|
|
26
|
+
"joinChannel",
|
|
27
|
+
"leaveChannel",
|
|
28
|
+
"destroyChannel",
|
|
29
|
+
"changeChannelOwner",
|
|
30
|
+
"getOperator",
|
|
31
|
+
"setOperator",
|
|
32
|
+
"removeOperator",
|
|
33
|
+
"getMessage",
|
|
34
|
+
"getMessages",
|
|
35
|
+
"getMessageReactions",
|
|
36
|
+
"holdMessage",
|
|
37
|
+
"getMembers",
|
|
38
|
+
"channelChatCreateMessage",
|
|
39
|
+
"channelChatUpdateMessage",
|
|
40
|
+
"channelChatDeleteMessage",
|
|
41
|
+
"channelChatReactionMessage",
|
|
42
|
+
"channelChatGetMessage",
|
|
43
|
+
"channelChatGetMessages",
|
|
44
|
+
"channelChatGetMessageReactions",
|
|
45
|
+
];
|
|
46
|
+
for (const method of grpcMethods) {
|
|
47
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
48
|
+
(0, microservices_1.GrpcMethod)("ChannelService", method)(constructor.prototype[method], method, descriptor);
|
|
49
|
+
}
|
|
50
|
+
const grpcStreamMethods = [];
|
|
51
|
+
for (const method of grpcStreamMethods) {
|
|
52
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
53
|
+
(0, microservices_1.GrpcStreamMethod)("ChannelService", method)(constructor.prototype[method], method, descriptor);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
exports.CHANNEL_SERVICE_NAME = "ChannelService";
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
export declare const protobufPackage = "channel";
|
|
2
|
+
export declare enum MessageType {
|
|
3
|
+
text = "text",
|
|
4
|
+
image = "image",
|
|
5
|
+
video = "video",
|
|
6
|
+
file = "file",
|
|
7
|
+
UNRECOGNIZED = "UNRECOGNIZED"
|
|
8
|
+
}
|
|
9
|
+
export declare enum ChannelType {
|
|
10
|
+
PRIVATE = "PRIVATE",
|
|
11
|
+
PUBLIC = "PUBLIC",
|
|
12
|
+
UNRECOGNIZED = "UNRECOGNIZED"
|
|
13
|
+
}
|
|
14
|
+
export interface LastMessage {
|
|
15
|
+
seq: number;
|
|
16
|
+
createdAt: string;
|
|
17
|
+
message: string;
|
|
18
|
+
type: MessageType;
|
|
19
|
+
userId: number;
|
|
20
|
+
}
|
|
21
|
+
export interface ChannelInfo {
|
|
22
|
+
channelId: string;
|
|
23
|
+
channelType: ChannelType;
|
|
24
|
+
channelTag: string[];
|
|
25
|
+
title: string;
|
|
26
|
+
description?: string | undefined;
|
|
27
|
+
ownerId: number;
|
|
28
|
+
joinUserCount: number;
|
|
29
|
+
thumbnailUrl?: string | undefined;
|
|
30
|
+
holdMessageSeq?: number | undefined;
|
|
31
|
+
lastMessageSeq?: number | undefined;
|
|
32
|
+
lastStreamId?: number | undefined;
|
|
33
|
+
}
|
|
34
|
+
export interface Channel {
|
|
35
|
+
title: string;
|
|
36
|
+
channelType: ChannelType;
|
|
37
|
+
joinUserCount: number;
|
|
38
|
+
thumbnailUrl: string;
|
|
39
|
+
lastMessage: LastMessage | undefined;
|
|
40
|
+
channelId: string;
|
|
41
|
+
}
|
|
42
|
+
export interface UserChannel {
|
|
43
|
+
channelId: string;
|
|
44
|
+
channel: Channel | undefined;
|
|
45
|
+
lastReadMessageSeq: number;
|
|
46
|
+
}
|
|
47
|
+
export interface CreateChannelDto {
|
|
48
|
+
userChannelId: string;
|
|
49
|
+
title?: string | undefined;
|
|
50
|
+
description?: string | undefined;
|
|
51
|
+
type: ChannelType;
|
|
52
|
+
password?: string | undefined;
|
|
53
|
+
thumbnailUrl?: string | undefined;
|
|
54
|
+
}
|
|
55
|
+
export interface CreateMessageDto {
|
|
56
|
+
type: MessageType;
|
|
57
|
+
message: string;
|
|
58
|
+
mentions: number[];
|
|
59
|
+
reply?: number | undefined;
|
|
60
|
+
}
|
|
61
|
+
export interface ReactionMessageDto {
|
|
62
|
+
userId: number;
|
|
63
|
+
seq: number;
|
|
64
|
+
reactionCode: string;
|
|
65
|
+
streamId: number;
|
|
66
|
+
}
|
|
67
|
+
export interface ChannelMessage {
|
|
68
|
+
userId: number;
|
|
69
|
+
type: MessageType;
|
|
70
|
+
createdAt: string;
|
|
71
|
+
deletedAt: string;
|
|
72
|
+
seq: number;
|
|
73
|
+
message: string;
|
|
74
|
+
mentions: number[];
|
|
75
|
+
reply: number;
|
|
76
|
+
reactions: Reaction[];
|
|
77
|
+
}
|
|
78
|
+
export interface Reaction {
|
|
79
|
+
userId: number;
|
|
80
|
+
reactionCode: string;
|
|
81
|
+
}
|
|
82
|
+
export interface MessageReaction {
|
|
83
|
+
streamId: number;
|
|
84
|
+
userId: number;
|
|
85
|
+
seq: number;
|
|
86
|
+
reactionCode: string;
|
|
87
|
+
}
|
|
88
|
+
export interface Operator {
|
|
89
|
+
userId: number;
|
|
90
|
+
chatDeleteAuth: boolean;
|
|
91
|
+
chatSlowAuth: boolean;
|
|
92
|
+
infoAuth: boolean;
|
|
93
|
+
pinAuth: boolean;
|
|
94
|
+
postAuth: boolean;
|
|
95
|
+
userBanAuth: boolean;
|
|
96
|
+
}
|
|
97
|
+
export declare const CHANNEL_PACKAGE_NAME = "channel";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
+
// versions:
|
|
4
|
+
// protoc-gen-ts_proto v2.7.2
|
|
5
|
+
// protoc v3.20.3
|
|
6
|
+
// source: channel-types.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.CHANNEL_PACKAGE_NAME = exports.ChannelType = exports.MessageType = exports.protobufPackage = void 0;
|
|
9
|
+
/* eslint-disable */
|
|
10
|
+
exports.protobufPackage = "channel";
|
|
11
|
+
var MessageType;
|
|
12
|
+
(function (MessageType) {
|
|
13
|
+
MessageType["text"] = "text";
|
|
14
|
+
MessageType["image"] = "image";
|
|
15
|
+
MessageType["video"] = "video";
|
|
16
|
+
MessageType["file"] = "file";
|
|
17
|
+
MessageType["UNRECOGNIZED"] = "UNRECOGNIZED";
|
|
18
|
+
})(MessageType || (exports.MessageType = MessageType = {}));
|
|
19
|
+
var ChannelType;
|
|
20
|
+
(function (ChannelType) {
|
|
21
|
+
ChannelType["PRIVATE"] = "PRIVATE";
|
|
22
|
+
ChannelType["PUBLIC"] = "PUBLIC";
|
|
23
|
+
ChannelType["UNRECOGNIZED"] = "UNRECOGNIZED";
|
|
24
|
+
})(ChannelType || (exports.ChannelType = ChannelType = {}));
|
|
25
|
+
exports.CHANNEL_PACKAGE_NAME = "channel";
|
package/package.json
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
"name": "@verychat/channel-protos",
|
|
3
|
+
"version": "1.0.6",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist",
|
|
9
|
+
"proto-libs",
|
|
10
|
+
"channel-services.proto",
|
|
11
|
+
"channel-types.proto"
|
|
12
|
+
],
|
|
13
|
+
"license": "ISC",
|
|
14
|
+
"scripts": {
|
|
15
|
+
"build": "tsc"
|
|
16
|
+
}
|
|
12
17
|
}
|
|
@@ -0,0 +1,378 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.7.2
|
|
4
|
+
// protoc v3.20.3
|
|
5
|
+
// source: channel-services.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { Metadata } from "@grpc/grpc-js";
|
|
9
|
+
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
10
|
+
import { Observable } from "rxjs";
|
|
11
|
+
import {
|
|
12
|
+
Channel,
|
|
13
|
+
ChannelInfo,
|
|
14
|
+
ChannelMessage,
|
|
15
|
+
CreateChannelDto,
|
|
16
|
+
CreateMessageDto,
|
|
17
|
+
MessageReaction,
|
|
18
|
+
Operator,
|
|
19
|
+
ReactionMessageDto,
|
|
20
|
+
UserChannel,
|
|
21
|
+
} from "./channel-types";
|
|
22
|
+
|
|
23
|
+
export const protobufPackage = "channel";
|
|
24
|
+
|
|
25
|
+
export interface Empty {
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface GetChannelRequest {
|
|
29
|
+
userId: number;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface GetMyChannelsResponse {
|
|
33
|
+
channels: Channel[];
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface GetMySubscribedChannelResponse {
|
|
37
|
+
userChannels: UserChannel[];
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface CreateChannelRequest {
|
|
41
|
+
userId: number;
|
|
42
|
+
dto: CreateChannelDto | undefined;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface CreateChannelResponse {
|
|
46
|
+
channelId: string;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface GetChannelInfoRequest {
|
|
50
|
+
channelId: string;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface GetChannelInfoResponse {
|
|
54
|
+
channelInfo: ChannelInfo | undefined;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface ReadMessageRequest {
|
|
58
|
+
channelId: string;
|
|
59
|
+
userId: number;
|
|
60
|
+
lastSeq: number;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface GetMessageViewCountRequest {
|
|
64
|
+
channelId: string;
|
|
65
|
+
seqs: number[];
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface GetMessageViewCountResponse {
|
|
69
|
+
viewCount: { [key: number]: number };
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export interface GetMessageViewCountResponse_ViewCountEntry {
|
|
73
|
+
key: number;
|
|
74
|
+
value: number;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface CreateMessageRequest {
|
|
78
|
+
channelId: string;
|
|
79
|
+
title?: string | undefined;
|
|
80
|
+
userId: number;
|
|
81
|
+
dto: CreateMessageDto | undefined;
|
|
82
|
+
lastChatSeq: number;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export interface CreateMessageResponse {
|
|
86
|
+
seq: number;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export interface UpdateMessageRequest {
|
|
90
|
+
channelId: string;
|
|
91
|
+
userId: number;
|
|
92
|
+
seq: number;
|
|
93
|
+
originMessage: string;
|
|
94
|
+
message: string;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export interface DeleteMessageRequest {
|
|
98
|
+
channelId: string;
|
|
99
|
+
seq: number;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export interface ReactionMessageRequest {
|
|
103
|
+
channelId: string;
|
|
104
|
+
dto: ReactionMessageDto[];
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export interface JoinChannelRequest {
|
|
108
|
+
userIds: number[];
|
|
109
|
+
channelId: string;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export interface LeaveChannelRequest {
|
|
113
|
+
userId: number;
|
|
114
|
+
channelId: string;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export interface DestroyChannelRequest {
|
|
118
|
+
channelId: string;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export interface ChangeChannelOwnerRequest {
|
|
122
|
+
channelId: string;
|
|
123
|
+
targetUserId: number;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export interface GetOperatorRequest {
|
|
127
|
+
channelId: string;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export interface GetOperatorResponse {
|
|
131
|
+
operators: Operator[];
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export interface SetOperatorRequest {
|
|
135
|
+
channelId: string;
|
|
136
|
+
targetUserId: number;
|
|
137
|
+
chatDeleteAuth?: boolean | undefined;
|
|
138
|
+
chatSlowAuth?: boolean | undefined;
|
|
139
|
+
infoAuth?: boolean | undefined;
|
|
140
|
+
pinAuth?: boolean | undefined;
|
|
141
|
+
postAuth?: boolean | undefined;
|
|
142
|
+
userBanAuth?: boolean | undefined;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export interface RemoveOperatorRequest {
|
|
146
|
+
channelId: string;
|
|
147
|
+
targetUserId: number;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export interface RemoveOperatorResponse {
|
|
151
|
+
removeId: number;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export interface GetMessageRequest {
|
|
155
|
+
channelId: string;
|
|
156
|
+
seq: number;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export interface GetMessageResponse {
|
|
160
|
+
message: ChannelMessage | undefined;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export interface GetMessagesRequest {
|
|
164
|
+
channelId: string;
|
|
165
|
+
lastMessageSeq: number;
|
|
166
|
+
seq: number;
|
|
167
|
+
take: number;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
export interface GetMessagesResponse {
|
|
171
|
+
messages: ChannelMessage[];
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export interface GetMessageReactionsRequest {
|
|
175
|
+
channelId: string;
|
|
176
|
+
lastStreamId: number;
|
|
177
|
+
streamId: number;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
export interface GetMessageReactionsResponse {
|
|
181
|
+
historys: MessageReaction[];
|
|
182
|
+
next: boolean;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
export interface HoldMessageRequest {
|
|
186
|
+
channelId: string;
|
|
187
|
+
seq: number;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
export interface GetMembersRequest {
|
|
191
|
+
channelId: string;
|
|
192
|
+
cursorUserId?: number | undefined;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
export interface GetMembersResponse {
|
|
196
|
+
members: number[];
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export const CHANNEL_PACKAGE_NAME = "channel";
|
|
200
|
+
|
|
201
|
+
export interface ChannelServiceClient {
|
|
202
|
+
createChannel(request: CreateChannelRequest, metadata?: Metadata): Observable<CreateChannelResponse>;
|
|
203
|
+
|
|
204
|
+
getMyChannels(request: GetChannelRequest, metadata?: Metadata): Observable<GetMyChannelsResponse>;
|
|
205
|
+
|
|
206
|
+
getMySubscribeChannels(request: GetChannelRequest, metadata?: Metadata): Observable<GetMySubscribedChannelResponse>;
|
|
207
|
+
|
|
208
|
+
getChannelInfo(request: GetChannelInfoRequest, metadata?: Metadata): Observable<GetChannelInfoResponse>;
|
|
209
|
+
|
|
210
|
+
readMessage(request: ReadMessageRequest, metadata?: Metadata): Observable<Empty>;
|
|
211
|
+
|
|
212
|
+
getViewCount(request: GetMessageViewCountRequest, metadata?: Metadata): Observable<GetMessageViewCountResponse>;
|
|
213
|
+
|
|
214
|
+
createMessage(request: CreateMessageRequest, metadata?: Metadata): Observable<CreateMessageResponse>;
|
|
215
|
+
|
|
216
|
+
updateMessage(request: UpdateMessageRequest, metadata?: Metadata): Observable<Empty>;
|
|
217
|
+
|
|
218
|
+
deleteMessage(request: DeleteMessageRequest, metadata?: Metadata): Observable<Empty>;
|
|
219
|
+
|
|
220
|
+
reactionMessage(request: ReactionMessageRequest, metadata?: Metadata): Observable<Empty>;
|
|
221
|
+
|
|
222
|
+
joinChannel(request: JoinChannelRequest, metadata?: Metadata): Observable<Empty>;
|
|
223
|
+
|
|
224
|
+
leaveChannel(request: LeaveChannelRequest, metadata?: Metadata): Observable<Empty>;
|
|
225
|
+
|
|
226
|
+
destroyChannel(request: DestroyChannelRequest, metadata?: Metadata): Observable<Empty>;
|
|
227
|
+
|
|
228
|
+
changeChannelOwner(request: ChangeChannelOwnerRequest, metadata?: Metadata): Observable<Empty>;
|
|
229
|
+
|
|
230
|
+
getOperator(request: GetOperatorRequest, metadata?: Metadata): Observable<GetOperatorResponse>;
|
|
231
|
+
|
|
232
|
+
setOperator(request: SetOperatorRequest, metadata?: Metadata): Observable<Empty>;
|
|
233
|
+
|
|
234
|
+
removeOperator(request: RemoveOperatorRequest, metadata?: Metadata): Observable<RemoveOperatorResponse>;
|
|
235
|
+
|
|
236
|
+
getMessage(request: GetMessageRequest, metadata?: Metadata): Observable<GetMessageResponse>;
|
|
237
|
+
|
|
238
|
+
getMessages(request: GetMessagesRequest, metadata?: Metadata): Observable<GetMessagesResponse>;
|
|
239
|
+
|
|
240
|
+
getMessageReactions(
|
|
241
|
+
request: GetMessageReactionsRequest,
|
|
242
|
+
metadata?: Metadata,
|
|
243
|
+
): Observable<GetMessageReactionsResponse>;
|
|
244
|
+
|
|
245
|
+
holdMessage(request: HoldMessageRequest, metadata?: Metadata): Observable<Empty>;
|
|
246
|
+
|
|
247
|
+
getMembers(request: GetMembersRequest, metadata?: Metadata): Observable<GetMembersResponse>;
|
|
248
|
+
|
|
249
|
+
channelChatCreateMessage(request: CreateMessageRequest, metadata?: Metadata): Observable<CreateMessageResponse>;
|
|
250
|
+
|
|
251
|
+
channelChatUpdateMessage(request: UpdateMessageRequest, metadata?: Metadata): Observable<Empty>;
|
|
252
|
+
|
|
253
|
+
channelChatDeleteMessage(request: DeleteMessageRequest, metadata?: Metadata): Observable<Empty>;
|
|
254
|
+
|
|
255
|
+
channelChatReactionMessage(request: ReactionMessageRequest, metadata?: Metadata): Observable<Empty>;
|
|
256
|
+
|
|
257
|
+
channelChatGetMessage(request: GetMessageRequest, metadata?: Metadata): Observable<GetMessageResponse>;
|
|
258
|
+
|
|
259
|
+
channelChatGetMessages(request: GetMessagesRequest, metadata?: Metadata): Observable<GetMessagesResponse>;
|
|
260
|
+
|
|
261
|
+
channelChatGetMessageReactions(
|
|
262
|
+
request: GetMessageReactionsRequest,
|
|
263
|
+
metadata?: Metadata,
|
|
264
|
+
): Observable<GetMessageReactionsResponse>;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
export interface ChannelServiceController {
|
|
268
|
+
createChannel(request: CreateChannelRequest, metadata?: Metadata): Observable<CreateChannelResponse>;
|
|
269
|
+
|
|
270
|
+
getMyChannels(request: GetChannelRequest, metadata?: Metadata): Observable<GetMyChannelsResponse>;
|
|
271
|
+
|
|
272
|
+
getMySubscribeChannels(request: GetChannelRequest, metadata?: Metadata): Observable<GetMySubscribedChannelResponse>;
|
|
273
|
+
|
|
274
|
+
getChannelInfo(request: GetChannelInfoRequest, metadata?: Metadata): Observable<GetChannelInfoResponse>;
|
|
275
|
+
|
|
276
|
+
readMessage(request: ReadMessageRequest, metadata?: Metadata): Observable<Empty>;
|
|
277
|
+
|
|
278
|
+
getViewCount(request: GetMessageViewCountRequest, metadata?: Metadata): Observable<GetMessageViewCountResponse>;
|
|
279
|
+
|
|
280
|
+
createMessage(request: CreateMessageRequest, metadata?: Metadata): Observable<CreateMessageResponse>;
|
|
281
|
+
|
|
282
|
+
updateMessage(request: UpdateMessageRequest, metadata?: Metadata): Observable<Empty>;
|
|
283
|
+
|
|
284
|
+
deleteMessage(request: DeleteMessageRequest, metadata?: Metadata): Observable<Empty>;
|
|
285
|
+
|
|
286
|
+
reactionMessage(request: ReactionMessageRequest, metadata?: Metadata): Observable<Empty>;
|
|
287
|
+
|
|
288
|
+
joinChannel(request: JoinChannelRequest, metadata?: Metadata): Observable<Empty>;
|
|
289
|
+
|
|
290
|
+
leaveChannel(request: LeaveChannelRequest, metadata?: Metadata): Observable<Empty>;
|
|
291
|
+
|
|
292
|
+
destroyChannel(request: DestroyChannelRequest, metadata?: Metadata): Observable<Empty>;
|
|
293
|
+
|
|
294
|
+
changeChannelOwner(request: ChangeChannelOwnerRequest, metadata?: Metadata): Observable<Empty>;
|
|
295
|
+
|
|
296
|
+
getOperator(request: GetOperatorRequest, metadata?: Metadata): Observable<GetOperatorResponse>;
|
|
297
|
+
|
|
298
|
+
setOperator(request: SetOperatorRequest, metadata?: Metadata): Observable<Empty>;
|
|
299
|
+
|
|
300
|
+
removeOperator(request: RemoveOperatorRequest, metadata?: Metadata): Observable<RemoveOperatorResponse>;
|
|
301
|
+
|
|
302
|
+
getMessage(request: GetMessageRequest, metadata?: Metadata): Observable<GetMessageResponse>;
|
|
303
|
+
|
|
304
|
+
getMessages(request: GetMessagesRequest, metadata?: Metadata): Observable<GetMessagesResponse>;
|
|
305
|
+
|
|
306
|
+
getMessageReactions(
|
|
307
|
+
request: GetMessageReactionsRequest,
|
|
308
|
+
metadata?: Metadata,
|
|
309
|
+
): Observable<GetMessageReactionsResponse>;
|
|
310
|
+
|
|
311
|
+
holdMessage(request: HoldMessageRequest, metadata?: Metadata): Observable<Empty>;
|
|
312
|
+
|
|
313
|
+
getMembers(request: GetMembersRequest, metadata?: Metadata): Observable<GetMembersResponse>;
|
|
314
|
+
|
|
315
|
+
channelChatCreateMessage(request: CreateMessageRequest, metadata?: Metadata): Observable<CreateMessageResponse>;
|
|
316
|
+
|
|
317
|
+
channelChatUpdateMessage(request: UpdateMessageRequest, metadata?: Metadata): Observable<Empty>;
|
|
318
|
+
|
|
319
|
+
channelChatDeleteMessage(request: DeleteMessageRequest, metadata?: Metadata): Observable<Empty>;
|
|
320
|
+
|
|
321
|
+
channelChatReactionMessage(request: ReactionMessageRequest, metadata?: Metadata): Observable<Empty>;
|
|
322
|
+
|
|
323
|
+
channelChatGetMessage(request: GetMessageRequest, metadata?: Metadata): Observable<GetMessageResponse>;
|
|
324
|
+
|
|
325
|
+
channelChatGetMessages(request: GetMessagesRequest, metadata?: Metadata): Observable<GetMessagesResponse>;
|
|
326
|
+
|
|
327
|
+
channelChatGetMessageReactions(
|
|
328
|
+
request: GetMessageReactionsRequest,
|
|
329
|
+
metadata?: Metadata,
|
|
330
|
+
): Observable<GetMessageReactionsResponse>;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
export function ChannelServiceControllerMethods() {
|
|
334
|
+
return function (constructor: Function) {
|
|
335
|
+
const grpcMethods: string[] = [
|
|
336
|
+
"createChannel",
|
|
337
|
+
"getMyChannels",
|
|
338
|
+
"getMySubscribeChannels",
|
|
339
|
+
"getChannelInfo",
|
|
340
|
+
"readMessage",
|
|
341
|
+
"getViewCount",
|
|
342
|
+
"createMessage",
|
|
343
|
+
"updateMessage",
|
|
344
|
+
"deleteMessage",
|
|
345
|
+
"reactionMessage",
|
|
346
|
+
"joinChannel",
|
|
347
|
+
"leaveChannel",
|
|
348
|
+
"destroyChannel",
|
|
349
|
+
"changeChannelOwner",
|
|
350
|
+
"getOperator",
|
|
351
|
+
"setOperator",
|
|
352
|
+
"removeOperator",
|
|
353
|
+
"getMessage",
|
|
354
|
+
"getMessages",
|
|
355
|
+
"getMessageReactions",
|
|
356
|
+
"holdMessage",
|
|
357
|
+
"getMembers",
|
|
358
|
+
"channelChatCreateMessage",
|
|
359
|
+
"channelChatUpdateMessage",
|
|
360
|
+
"channelChatDeleteMessage",
|
|
361
|
+
"channelChatReactionMessage",
|
|
362
|
+
"channelChatGetMessage",
|
|
363
|
+
"channelChatGetMessages",
|
|
364
|
+
"channelChatGetMessageReactions",
|
|
365
|
+
];
|
|
366
|
+
for (const method of grpcMethods) {
|
|
367
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
368
|
+
GrpcMethod("ChannelService", method)(constructor.prototype[method], method, descriptor);
|
|
369
|
+
}
|
|
370
|
+
const grpcStreamMethods: string[] = [];
|
|
371
|
+
for (const method of grpcStreamMethods) {
|
|
372
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
373
|
+
GrpcStreamMethod("ChannelService", method)(constructor.prototype[method], method, descriptor);
|
|
374
|
+
}
|
|
375
|
+
};
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
export const CHANNEL_SERVICE_NAME = "ChannelService";
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.7.2
|
|
4
|
+
// protoc v3.20.3
|
|
5
|
+
// source: channel-types.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
|
|
9
|
+
export const protobufPackage = "channel";
|
|
10
|
+
|
|
11
|
+
export enum MessageType {
|
|
12
|
+
text = "text",
|
|
13
|
+
image = "image",
|
|
14
|
+
video = "video",
|
|
15
|
+
file = "file",
|
|
16
|
+
UNRECOGNIZED = "UNRECOGNIZED",
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export enum ChannelType {
|
|
20
|
+
PRIVATE = "PRIVATE",
|
|
21
|
+
PUBLIC = "PUBLIC",
|
|
22
|
+
UNRECOGNIZED = "UNRECOGNIZED",
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface LastMessage {
|
|
26
|
+
seq: number;
|
|
27
|
+
createdAt: string;
|
|
28
|
+
message: string;
|
|
29
|
+
type: MessageType;
|
|
30
|
+
userId: number;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface ChannelInfo {
|
|
34
|
+
channelId: string;
|
|
35
|
+
channelType: ChannelType;
|
|
36
|
+
channelTag: string[];
|
|
37
|
+
title: string;
|
|
38
|
+
description?: string | undefined;
|
|
39
|
+
ownerId: number;
|
|
40
|
+
joinUserCount: number;
|
|
41
|
+
thumbnailUrl?: string | undefined;
|
|
42
|
+
holdMessageSeq?: number | undefined;
|
|
43
|
+
lastMessageSeq?: number | undefined;
|
|
44
|
+
lastStreamId?: number | undefined;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface Channel {
|
|
48
|
+
title: string;
|
|
49
|
+
channelType: ChannelType;
|
|
50
|
+
joinUserCount: number;
|
|
51
|
+
thumbnailUrl: string;
|
|
52
|
+
lastMessage: LastMessage | undefined;
|
|
53
|
+
channelId: string;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface UserChannel {
|
|
57
|
+
channelId: string;
|
|
58
|
+
channel: Channel | undefined;
|
|
59
|
+
lastReadMessageSeq: number;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface CreateChannelDto {
|
|
63
|
+
userChannelId: string;
|
|
64
|
+
title?: string | undefined;
|
|
65
|
+
description?: string | undefined;
|
|
66
|
+
type: ChannelType;
|
|
67
|
+
password?: string | undefined;
|
|
68
|
+
thumbnailUrl?: string | undefined;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface CreateMessageDto {
|
|
72
|
+
type: MessageType;
|
|
73
|
+
message: string;
|
|
74
|
+
mentions: number[];
|
|
75
|
+
reply?: number | undefined;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export interface ReactionMessageDto {
|
|
79
|
+
userId: number;
|
|
80
|
+
seq: number;
|
|
81
|
+
reactionCode: string;
|
|
82
|
+
streamId: number;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export interface ChannelMessage {
|
|
86
|
+
userId: number;
|
|
87
|
+
type: MessageType;
|
|
88
|
+
createdAt: string;
|
|
89
|
+
deletedAt: string;
|
|
90
|
+
seq: number;
|
|
91
|
+
message: string;
|
|
92
|
+
mentions: number[];
|
|
93
|
+
reply: number;
|
|
94
|
+
reactions: Reaction[];
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export interface Reaction {
|
|
98
|
+
userId: number;
|
|
99
|
+
reactionCode: string;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export interface MessageReaction {
|
|
103
|
+
streamId: number;
|
|
104
|
+
userId: number;
|
|
105
|
+
seq: number;
|
|
106
|
+
reactionCode: string;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export interface Operator {
|
|
110
|
+
userId: number;
|
|
111
|
+
chatDeleteAuth: boolean;
|
|
112
|
+
chatSlowAuth: boolean;
|
|
113
|
+
infoAuth: boolean;
|
|
114
|
+
pinAuth: boolean;
|
|
115
|
+
postAuth: boolean;
|
|
116
|
+
userBanAuth: boolean;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export const CHANNEL_PACKAGE_NAME = "channel";
|