jr-common-micro 1.1.61 → 1.1.62
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/dist/common/factory/grpc_options_factory.js +4 -0
- package/dist/proto/micro/v1/chat/chat_messages_nest.d.ts +28 -0
- package/dist/proto/micro/v1/chat/chat_messages_pb.d.ts +68 -0
- package/dist/proto/micro/v1/chat/chat_messages_pb.js +152 -1
- package/dist/proto/micro/v1/chat/services_connect.d.ts +13 -1
- package/dist/proto/micro/v1/chat/services_connect.js +12 -0
- package/dist/proto/micro/v1/chat/services_nest.d.ts +5 -1
- package/dist/proto/micro/v1/chat/services_nest.js +2 -0
- package/package.json +1 -1
- package/proto/micro/v1/chat/chat_messages.proto +37 -0
- package/proto/micro/v1/chat/services.proto +4 -0
|
@@ -16,6 +16,8 @@ const grpcClientFactory = (provide, grpcPackage, hostKey, portKey) => {
|
|
|
16
16
|
channelOptions: {
|
|
17
17
|
'grpc.min_reconnect_backoff_ms': 1000,
|
|
18
18
|
'grpc.max_reconnect_backoff_ms': 10000,
|
|
19
|
+
'grpc.max_receive_message_length': 32 * 1024 * 1024,
|
|
20
|
+
'grpc.max_send_message_length': 32 * 1024 * 1024,
|
|
19
21
|
},
|
|
20
22
|
keepalive: {
|
|
21
23
|
keepaliveTimeMs: 1e3 * 60 * 2,
|
|
@@ -48,6 +50,8 @@ const grpcServerOptions = (grpcPackage, grpcHost, grpcPort) => {
|
|
|
48
50
|
options: {
|
|
49
51
|
url: grpcHost + ':' + grpcPort,
|
|
50
52
|
package: grpcPackage,
|
|
53
|
+
maxReceiveMessageLength: 32 * 1024 * 1024,
|
|
54
|
+
maxSendMessageLength: 32 * 1024 * 1024,
|
|
51
55
|
protoPath: (0, walk_sync_1.walkSync)((0, path_1.join)(process.cwd(), 'node_modules/jr-common-micro/proto'), { includeBasePath: true, globs: ['**/*.proto'] }),
|
|
52
56
|
loader: {
|
|
53
57
|
keepCase: true,
|
|
@@ -55,6 +55,34 @@ export interface ChatMessageDto {
|
|
|
55
55
|
reactions: ChatReactionCountDto[];
|
|
56
56
|
edited_at: string;
|
|
57
57
|
poll: ChatPollDto | undefined;
|
|
58
|
+
media: ChatMediaDto | undefined;
|
|
59
|
+
}
|
|
60
|
+
export interface ChatMediaDto {
|
|
61
|
+
public_id: string;
|
|
62
|
+
kind: string;
|
|
63
|
+
width: number;
|
|
64
|
+
height: number;
|
|
65
|
+
}
|
|
66
|
+
export interface ChatMediaUploadRequest {
|
|
67
|
+
group_slug: string;
|
|
68
|
+
kind: string;
|
|
69
|
+
data: Buffer;
|
|
70
|
+
mimetype: string;
|
|
71
|
+
}
|
|
72
|
+
export interface ChatMediaUploadResponse {
|
|
73
|
+
status: ResponseStatus | undefined;
|
|
74
|
+
media_id: string;
|
|
75
|
+
width: number;
|
|
76
|
+
height: number;
|
|
77
|
+
}
|
|
78
|
+
export interface ChatMediaGetRequest {
|
|
79
|
+
public_id: string;
|
|
80
|
+
}
|
|
81
|
+
export interface ChatMediaGetResponse {
|
|
82
|
+
status: ResponseStatus | undefined;
|
|
83
|
+
data: Buffer;
|
|
84
|
+
mimetype: string;
|
|
85
|
+
kind: string;
|
|
58
86
|
}
|
|
59
87
|
export interface ChatPollOptionDto {
|
|
60
88
|
id: string;
|
|
@@ -96,6 +96,7 @@ export declare class ChatMessageDto extends Message<ChatMessageDto> {
|
|
|
96
96
|
reactions: ChatReactionCountDto[];
|
|
97
97
|
editedAt: string;
|
|
98
98
|
poll?: ChatPollDto;
|
|
99
|
+
media?: ChatMediaDto;
|
|
99
100
|
constructor(data?: PartialMessage<ChatMessageDto>);
|
|
100
101
|
static readonly runtime: typeof proto3;
|
|
101
102
|
static readonly typeName = "micro.v1.chat.ChatMessageDto";
|
|
@@ -105,6 +106,73 @@ export declare class ChatMessageDto extends Message<ChatMessageDto> {
|
|
|
105
106
|
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): ChatMessageDto;
|
|
106
107
|
static equals(a: ChatMessageDto | PlainMessage<ChatMessageDto> | undefined, b: ChatMessageDto | PlainMessage<ChatMessageDto> | undefined): boolean;
|
|
107
108
|
}
|
|
109
|
+
export declare class ChatMediaDto extends Message<ChatMediaDto> {
|
|
110
|
+
publicId: string;
|
|
111
|
+
kind: string;
|
|
112
|
+
width: number;
|
|
113
|
+
height: number;
|
|
114
|
+
constructor(data?: PartialMessage<ChatMediaDto>);
|
|
115
|
+
static readonly runtime: typeof proto3;
|
|
116
|
+
static readonly typeName = "micro.v1.chat.ChatMediaDto";
|
|
117
|
+
static readonly fields: FieldList;
|
|
118
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): ChatMediaDto;
|
|
119
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): ChatMediaDto;
|
|
120
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): ChatMediaDto;
|
|
121
|
+
static equals(a: ChatMediaDto | PlainMessage<ChatMediaDto> | undefined, b: ChatMediaDto | PlainMessage<ChatMediaDto> | undefined): boolean;
|
|
122
|
+
}
|
|
123
|
+
export declare class ChatMediaUploadRequest extends Message<ChatMediaUploadRequest> {
|
|
124
|
+
groupSlug: string;
|
|
125
|
+
kind: string;
|
|
126
|
+
data: Uint8Array<ArrayBuffer>;
|
|
127
|
+
mimetype: string;
|
|
128
|
+
constructor(data?: PartialMessage<ChatMediaUploadRequest>);
|
|
129
|
+
static readonly runtime: typeof proto3;
|
|
130
|
+
static readonly typeName = "micro.v1.chat.ChatMediaUploadRequest";
|
|
131
|
+
static readonly fields: FieldList;
|
|
132
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): ChatMediaUploadRequest;
|
|
133
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): ChatMediaUploadRequest;
|
|
134
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): ChatMediaUploadRequest;
|
|
135
|
+
static equals(a: ChatMediaUploadRequest | PlainMessage<ChatMediaUploadRequest> | undefined, b: ChatMediaUploadRequest | PlainMessage<ChatMediaUploadRequest> | undefined): boolean;
|
|
136
|
+
}
|
|
137
|
+
export declare class ChatMediaUploadResponse extends Message<ChatMediaUploadResponse> {
|
|
138
|
+
status?: ResponseStatus;
|
|
139
|
+
mediaId: string;
|
|
140
|
+
width: number;
|
|
141
|
+
height: number;
|
|
142
|
+
constructor(data?: PartialMessage<ChatMediaUploadResponse>);
|
|
143
|
+
static readonly runtime: typeof proto3;
|
|
144
|
+
static readonly typeName = "micro.v1.chat.ChatMediaUploadResponse";
|
|
145
|
+
static readonly fields: FieldList;
|
|
146
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): ChatMediaUploadResponse;
|
|
147
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): ChatMediaUploadResponse;
|
|
148
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): ChatMediaUploadResponse;
|
|
149
|
+
static equals(a: ChatMediaUploadResponse | PlainMessage<ChatMediaUploadResponse> | undefined, b: ChatMediaUploadResponse | PlainMessage<ChatMediaUploadResponse> | undefined): boolean;
|
|
150
|
+
}
|
|
151
|
+
export declare class ChatMediaGetRequest extends Message<ChatMediaGetRequest> {
|
|
152
|
+
publicId: string;
|
|
153
|
+
constructor(data?: PartialMessage<ChatMediaGetRequest>);
|
|
154
|
+
static readonly runtime: typeof proto3;
|
|
155
|
+
static readonly typeName = "micro.v1.chat.ChatMediaGetRequest";
|
|
156
|
+
static readonly fields: FieldList;
|
|
157
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): ChatMediaGetRequest;
|
|
158
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): ChatMediaGetRequest;
|
|
159
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): ChatMediaGetRequest;
|
|
160
|
+
static equals(a: ChatMediaGetRequest | PlainMessage<ChatMediaGetRequest> | undefined, b: ChatMediaGetRequest | PlainMessage<ChatMediaGetRequest> | undefined): boolean;
|
|
161
|
+
}
|
|
162
|
+
export declare class ChatMediaGetResponse extends Message<ChatMediaGetResponse> {
|
|
163
|
+
status?: ResponseStatus;
|
|
164
|
+
data: Uint8Array<ArrayBuffer>;
|
|
165
|
+
mimetype: string;
|
|
166
|
+
kind: string;
|
|
167
|
+
constructor(data?: PartialMessage<ChatMediaGetResponse>);
|
|
168
|
+
static readonly runtime: typeof proto3;
|
|
169
|
+
static readonly typeName = "micro.v1.chat.ChatMediaGetResponse";
|
|
170
|
+
static readonly fields: FieldList;
|
|
171
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): ChatMediaGetResponse;
|
|
172
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): ChatMediaGetResponse;
|
|
173
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): ChatMediaGetResponse;
|
|
174
|
+
static equals(a: ChatMediaGetResponse | PlainMessage<ChatMediaGetResponse> | undefined, b: ChatMediaGetResponse | PlainMessage<ChatMediaGetResponse> | undefined): boolean;
|
|
175
|
+
}
|
|
108
176
|
export declare class ChatPollOptionDto extends Message<ChatPollOptionDto> {
|
|
109
177
|
id: string;
|
|
110
178
|
text: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ReviewReportRequest = exports.ReportListResponse = exports.ReportDto = exports.SanctionListResponse = exports.SanctionDto = exports.ChatMemberListResponse = exports.ChatUserAdminListResponse = exports.ChatUserAdminDto = exports.GroupPhotoResponse = exports.GroupPhotoSetRequest = exports.ChatMemberDto = exports.PendingMembersRequest = exports.MemberActionRequest = exports.PinMessageRequest = exports.DeleteMessageRequest = exports.RevokeSanctionRequest = exports.SanctionRequest = exports.GroupUpsertRequest = exports.BlockedUsersResponse = exports.BlockUserRequest = exports.ReportMessageRequest = exports.PinnedMessagesResponse = exports.PinnedMessagesRequest = exports.MessageHistoryResponse = exports.MessageHistoryRequest = exports.ChatReplyPreviewDto = exports.ChatReactionCountDto = exports.ChatPollDto = exports.ChatPollOptionDto = exports.ChatMessageDto = exports.ChatGroupSingleResponse = exports.JoinGroupResponse = exports.GroupBySlugRequest = exports.ChatGroupListResponse = exports.ChatGroupDto = void 0;
|
|
3
|
+
exports.ReviewReportRequest = exports.ReportListResponse = exports.ReportDto = exports.SanctionListResponse = exports.SanctionDto = exports.ChatMemberListResponse = exports.ChatUserAdminListResponse = exports.ChatUserAdminDto = exports.GroupPhotoResponse = exports.GroupPhotoSetRequest = exports.ChatMemberDto = exports.PendingMembersRequest = exports.MemberActionRequest = exports.PinMessageRequest = exports.DeleteMessageRequest = exports.RevokeSanctionRequest = exports.SanctionRequest = exports.GroupUpsertRequest = exports.BlockedUsersResponse = exports.BlockUserRequest = exports.ReportMessageRequest = exports.PinnedMessagesResponse = exports.PinnedMessagesRequest = exports.MessageHistoryResponse = exports.MessageHistoryRequest = exports.ChatReplyPreviewDto = exports.ChatReactionCountDto = exports.ChatPollDto = exports.ChatPollOptionDto = exports.ChatMediaGetResponse = exports.ChatMediaGetRequest = exports.ChatMediaUploadResponse = exports.ChatMediaUploadRequest = exports.ChatMediaDto = exports.ChatMessageDto = exports.ChatGroupSingleResponse = exports.JoinGroupResponse = exports.GroupBySlugRequest = exports.ChatGroupListResponse = exports.ChatGroupDto = void 0;
|
|
4
4
|
const protobuf_1 = require("@bufbuild/protobuf");
|
|
5
5
|
const general_pb_js_1 = require("../general_pb.js");
|
|
6
6
|
class ChatGroupDto extends protobuf_1.Message {
|
|
@@ -190,6 +190,7 @@ class ChatMessageDto extends protobuf_1.Message {
|
|
|
190
190
|
reactions = [];
|
|
191
191
|
editedAt = "";
|
|
192
192
|
poll;
|
|
193
|
+
media;
|
|
193
194
|
constructor(data) {
|
|
194
195
|
super();
|
|
195
196
|
protobuf_1.proto3.util.initPartial(data, this);
|
|
@@ -214,6 +215,7 @@ class ChatMessageDto extends protobuf_1.Message {
|
|
|
214
215
|
{ no: 15, name: "reactions", kind: "message", T: ChatReactionCountDto, repeated: true },
|
|
215
216
|
{ no: 16, name: "edited_at", kind: "scalar", T: 9 },
|
|
216
217
|
{ no: 17, name: "poll", kind: "message", T: ChatPollDto },
|
|
218
|
+
{ no: 18, name: "media", kind: "message", T: ChatMediaDto },
|
|
217
219
|
]);
|
|
218
220
|
static fromBinary(bytes, options) {
|
|
219
221
|
return new ChatMessageDto().fromBinary(bytes, options);
|
|
@@ -229,6 +231,155 @@ class ChatMessageDto extends protobuf_1.Message {
|
|
|
229
231
|
}
|
|
230
232
|
}
|
|
231
233
|
exports.ChatMessageDto = ChatMessageDto;
|
|
234
|
+
class ChatMediaDto extends protobuf_1.Message {
|
|
235
|
+
publicId = "";
|
|
236
|
+
kind = "";
|
|
237
|
+
width = 0;
|
|
238
|
+
height = 0;
|
|
239
|
+
constructor(data) {
|
|
240
|
+
super();
|
|
241
|
+
protobuf_1.proto3.util.initPartial(data, this);
|
|
242
|
+
}
|
|
243
|
+
static runtime = protobuf_1.proto3;
|
|
244
|
+
static typeName = "micro.v1.chat.ChatMediaDto";
|
|
245
|
+
static fields = protobuf_1.proto3.util.newFieldList(() => [
|
|
246
|
+
{ no: 1, name: "public_id", kind: "scalar", T: 9 },
|
|
247
|
+
{ no: 2, name: "kind", kind: "scalar", T: 9 },
|
|
248
|
+
{ no: 3, name: "width", kind: "scalar", T: 13 },
|
|
249
|
+
{ no: 4, name: "height", kind: "scalar", T: 13 },
|
|
250
|
+
]);
|
|
251
|
+
static fromBinary(bytes, options) {
|
|
252
|
+
return new ChatMediaDto().fromBinary(bytes, options);
|
|
253
|
+
}
|
|
254
|
+
static fromJson(jsonValue, options) {
|
|
255
|
+
return new ChatMediaDto().fromJson(jsonValue, options);
|
|
256
|
+
}
|
|
257
|
+
static fromJsonString(jsonString, options) {
|
|
258
|
+
return new ChatMediaDto().fromJsonString(jsonString, options);
|
|
259
|
+
}
|
|
260
|
+
static equals(a, b) {
|
|
261
|
+
return protobuf_1.proto3.util.equals(ChatMediaDto, a, b);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
exports.ChatMediaDto = ChatMediaDto;
|
|
265
|
+
class ChatMediaUploadRequest extends protobuf_1.Message {
|
|
266
|
+
groupSlug = "";
|
|
267
|
+
kind = "";
|
|
268
|
+
data = new Uint8Array(0);
|
|
269
|
+
mimetype = "";
|
|
270
|
+
constructor(data) {
|
|
271
|
+
super();
|
|
272
|
+
protobuf_1.proto3.util.initPartial(data, this);
|
|
273
|
+
}
|
|
274
|
+
static runtime = protobuf_1.proto3;
|
|
275
|
+
static typeName = "micro.v1.chat.ChatMediaUploadRequest";
|
|
276
|
+
static fields = protobuf_1.proto3.util.newFieldList(() => [
|
|
277
|
+
{ no: 1, name: "group_slug", kind: "scalar", T: 9 },
|
|
278
|
+
{ no: 2, name: "kind", kind: "scalar", T: 9 },
|
|
279
|
+
{ no: 3, name: "data", kind: "scalar", T: 12 },
|
|
280
|
+
{ no: 4, name: "mimetype", kind: "scalar", T: 9 },
|
|
281
|
+
]);
|
|
282
|
+
static fromBinary(bytes, options) {
|
|
283
|
+
return new ChatMediaUploadRequest().fromBinary(bytes, options);
|
|
284
|
+
}
|
|
285
|
+
static fromJson(jsonValue, options) {
|
|
286
|
+
return new ChatMediaUploadRequest().fromJson(jsonValue, options);
|
|
287
|
+
}
|
|
288
|
+
static fromJsonString(jsonString, options) {
|
|
289
|
+
return new ChatMediaUploadRequest().fromJsonString(jsonString, options);
|
|
290
|
+
}
|
|
291
|
+
static equals(a, b) {
|
|
292
|
+
return protobuf_1.proto3.util.equals(ChatMediaUploadRequest, a, b);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
exports.ChatMediaUploadRequest = ChatMediaUploadRequest;
|
|
296
|
+
class ChatMediaUploadResponse extends protobuf_1.Message {
|
|
297
|
+
status;
|
|
298
|
+
mediaId = "";
|
|
299
|
+
width = 0;
|
|
300
|
+
height = 0;
|
|
301
|
+
constructor(data) {
|
|
302
|
+
super();
|
|
303
|
+
protobuf_1.proto3.util.initPartial(data, this);
|
|
304
|
+
}
|
|
305
|
+
static runtime = protobuf_1.proto3;
|
|
306
|
+
static typeName = "micro.v1.chat.ChatMediaUploadResponse";
|
|
307
|
+
static fields = protobuf_1.proto3.util.newFieldList(() => [
|
|
308
|
+
{ no: 1, name: "status", kind: "message", T: general_pb_js_1.ResponseStatus },
|
|
309
|
+
{ no: 2, name: "media_id", kind: "scalar", T: 9 },
|
|
310
|
+
{ no: 3, name: "width", kind: "scalar", T: 13 },
|
|
311
|
+
{ no: 4, name: "height", kind: "scalar", T: 13 },
|
|
312
|
+
]);
|
|
313
|
+
static fromBinary(bytes, options) {
|
|
314
|
+
return new ChatMediaUploadResponse().fromBinary(bytes, options);
|
|
315
|
+
}
|
|
316
|
+
static fromJson(jsonValue, options) {
|
|
317
|
+
return new ChatMediaUploadResponse().fromJson(jsonValue, options);
|
|
318
|
+
}
|
|
319
|
+
static fromJsonString(jsonString, options) {
|
|
320
|
+
return new ChatMediaUploadResponse().fromJsonString(jsonString, options);
|
|
321
|
+
}
|
|
322
|
+
static equals(a, b) {
|
|
323
|
+
return protobuf_1.proto3.util.equals(ChatMediaUploadResponse, a, b);
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
exports.ChatMediaUploadResponse = ChatMediaUploadResponse;
|
|
327
|
+
class ChatMediaGetRequest extends protobuf_1.Message {
|
|
328
|
+
publicId = "";
|
|
329
|
+
constructor(data) {
|
|
330
|
+
super();
|
|
331
|
+
protobuf_1.proto3.util.initPartial(data, this);
|
|
332
|
+
}
|
|
333
|
+
static runtime = protobuf_1.proto3;
|
|
334
|
+
static typeName = "micro.v1.chat.ChatMediaGetRequest";
|
|
335
|
+
static fields = protobuf_1.proto3.util.newFieldList(() => [
|
|
336
|
+
{ no: 1, name: "public_id", kind: "scalar", T: 9 },
|
|
337
|
+
]);
|
|
338
|
+
static fromBinary(bytes, options) {
|
|
339
|
+
return new ChatMediaGetRequest().fromBinary(bytes, options);
|
|
340
|
+
}
|
|
341
|
+
static fromJson(jsonValue, options) {
|
|
342
|
+
return new ChatMediaGetRequest().fromJson(jsonValue, options);
|
|
343
|
+
}
|
|
344
|
+
static fromJsonString(jsonString, options) {
|
|
345
|
+
return new ChatMediaGetRequest().fromJsonString(jsonString, options);
|
|
346
|
+
}
|
|
347
|
+
static equals(a, b) {
|
|
348
|
+
return protobuf_1.proto3.util.equals(ChatMediaGetRequest, a, b);
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
exports.ChatMediaGetRequest = ChatMediaGetRequest;
|
|
352
|
+
class ChatMediaGetResponse extends protobuf_1.Message {
|
|
353
|
+
status;
|
|
354
|
+
data = new Uint8Array(0);
|
|
355
|
+
mimetype = "";
|
|
356
|
+
kind = "";
|
|
357
|
+
constructor(data) {
|
|
358
|
+
super();
|
|
359
|
+
protobuf_1.proto3.util.initPartial(data, this);
|
|
360
|
+
}
|
|
361
|
+
static runtime = protobuf_1.proto3;
|
|
362
|
+
static typeName = "micro.v1.chat.ChatMediaGetResponse";
|
|
363
|
+
static fields = protobuf_1.proto3.util.newFieldList(() => [
|
|
364
|
+
{ no: 1, name: "status", kind: "message", T: general_pb_js_1.ResponseStatus },
|
|
365
|
+
{ no: 2, name: "data", kind: "scalar", T: 12 },
|
|
366
|
+
{ no: 3, name: "mimetype", kind: "scalar", T: 9 },
|
|
367
|
+
{ no: 4, name: "kind", kind: "scalar", T: 9 },
|
|
368
|
+
]);
|
|
369
|
+
static fromBinary(bytes, options) {
|
|
370
|
+
return new ChatMediaGetResponse().fromBinary(bytes, options);
|
|
371
|
+
}
|
|
372
|
+
static fromJson(jsonValue, options) {
|
|
373
|
+
return new ChatMediaGetResponse().fromJson(jsonValue, options);
|
|
374
|
+
}
|
|
375
|
+
static fromJsonString(jsonString, options) {
|
|
376
|
+
return new ChatMediaGetResponse().fromJsonString(jsonString, options);
|
|
377
|
+
}
|
|
378
|
+
static equals(a, b) {
|
|
379
|
+
return protobuf_1.proto3.util.equals(ChatMediaGetResponse, a, b);
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
exports.ChatMediaGetResponse = ChatMediaGetResponse;
|
|
232
383
|
class ChatPollOptionDto extends protobuf_1.Message {
|
|
233
384
|
id = "";
|
|
234
385
|
text = "";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ByIdRequest, EmptyRequest, EmptyResponse, PaginateRequest } from "../general_pb.js";
|
|
2
|
-
import { BlockedUsersResponse, BlockUserRequest, ChatGroupListResponse, ChatGroupSingleResponse, ChatMemberListResponse, ChatUserAdminListResponse, DeleteMessageRequest, GroupBySlugRequest, GroupPhotoResponse, GroupPhotoSetRequest, GroupUpsertRequest, JoinGroupResponse, MemberActionRequest, MessageHistoryRequest, MessageHistoryResponse, PendingMembersRequest, PinMessageRequest, PinnedMessagesRequest, PinnedMessagesResponse, ReportListResponse, ReportMessageRequest, ReviewReportRequest, RevokeSanctionRequest, SanctionListResponse, SanctionRequest } from "./chat_messages_pb.js";
|
|
2
|
+
import { BlockedUsersResponse, BlockUserRequest, ChatGroupListResponse, ChatGroupSingleResponse, ChatMediaGetRequest, ChatMediaGetResponse, ChatMediaUploadRequest, ChatMediaUploadResponse, ChatMemberListResponse, ChatUserAdminListResponse, DeleteMessageRequest, GroupBySlugRequest, GroupPhotoResponse, GroupPhotoSetRequest, GroupUpsertRequest, JoinGroupResponse, MemberActionRequest, MessageHistoryRequest, MessageHistoryResponse, PendingMembersRequest, PinMessageRequest, PinnedMessagesRequest, PinnedMessagesResponse, ReportListResponse, ReportMessageRequest, ReviewReportRequest, RevokeSanctionRequest, SanctionListResponse, SanctionRequest } from "./chat_messages_pb.js";
|
|
3
3
|
import { MethodKind } from "@bufbuild/protobuf";
|
|
4
4
|
export declare const PChatService: {
|
|
5
5
|
readonly typeName: "micro.v1.chat.PChatService";
|
|
@@ -52,6 +52,18 @@ export declare const PChatService: {
|
|
|
52
52
|
readonly O: typeof GroupPhotoResponse;
|
|
53
53
|
readonly kind: MethodKind.ServerStreaming;
|
|
54
54
|
};
|
|
55
|
+
readonly uploadChatMedia: {
|
|
56
|
+
readonly name: "UploadChatMedia";
|
|
57
|
+
readonly I: typeof ChatMediaUploadRequest;
|
|
58
|
+
readonly O: typeof ChatMediaUploadResponse;
|
|
59
|
+
readonly kind: MethodKind.ServerStreaming;
|
|
60
|
+
};
|
|
61
|
+
readonly getChatMedia: {
|
|
62
|
+
readonly name: "GetChatMedia";
|
|
63
|
+
readonly I: typeof ChatMediaGetRequest;
|
|
64
|
+
readonly O: typeof ChatMediaGetResponse;
|
|
65
|
+
readonly kind: MethodKind.ServerStreaming;
|
|
66
|
+
};
|
|
55
67
|
readonly reportMessage: {
|
|
56
68
|
readonly name: "ReportMessage";
|
|
57
69
|
readonly I: typeof ReportMessageRequest;
|
|
@@ -55,6 +55,18 @@ exports.PChatService = {
|
|
|
55
55
|
O: chat_messages_pb_js_1.GroupPhotoResponse,
|
|
56
56
|
kind: protobuf_1.MethodKind.ServerStreaming,
|
|
57
57
|
},
|
|
58
|
+
uploadChatMedia: {
|
|
59
|
+
name: "UploadChatMedia",
|
|
60
|
+
I: chat_messages_pb_js_1.ChatMediaUploadRequest,
|
|
61
|
+
O: chat_messages_pb_js_1.ChatMediaUploadResponse,
|
|
62
|
+
kind: protobuf_1.MethodKind.ServerStreaming,
|
|
63
|
+
},
|
|
64
|
+
getChatMedia: {
|
|
65
|
+
name: "GetChatMedia",
|
|
66
|
+
I: chat_messages_pb_js_1.ChatMediaGetRequest,
|
|
67
|
+
O: chat_messages_pb_js_1.ChatMediaGetResponse,
|
|
68
|
+
kind: protobuf_1.MethodKind.ServerStreaming,
|
|
69
|
+
},
|
|
58
70
|
reportMessage: {
|
|
59
71
|
name: "ReportMessage",
|
|
60
72
|
I: chat_messages_pb_js_1.ReportMessageRequest,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Metadata } from "@grpc/grpc-js";
|
|
2
2
|
import { Observable } from "rxjs";
|
|
3
3
|
import { ByIdRequest, EmptyRequest, EmptyResponse, PaginateRequest } from "../general_nest";
|
|
4
|
-
import { BlockedUsersResponse, BlockUserRequest, ChatGroupListResponse, ChatGroupSingleResponse, ChatMemberListResponse, ChatUserAdminListResponse, DeleteMessageRequest, GroupBySlugRequest, GroupPhotoResponse, GroupPhotoSetRequest, GroupUpsertRequest, JoinGroupResponse, MemberActionRequest, MessageHistoryRequest, MessageHistoryResponse, PendingMembersRequest, PinMessageRequest, PinnedMessagesRequest, PinnedMessagesResponse, ReportListResponse, ReportMessageRequest, ReviewReportRequest, RevokeSanctionRequest, SanctionListResponse, SanctionRequest } from "./chat_messages_nest";
|
|
4
|
+
import { BlockedUsersResponse, BlockUserRequest, ChatGroupListResponse, ChatGroupSingleResponse, ChatMediaGetRequest, ChatMediaGetResponse, ChatMediaUploadRequest, ChatMediaUploadResponse, ChatMemberListResponse, ChatUserAdminListResponse, DeleteMessageRequest, GroupBySlugRequest, GroupPhotoResponse, GroupPhotoSetRequest, GroupUpsertRequest, JoinGroupResponse, MemberActionRequest, MessageHistoryRequest, MessageHistoryResponse, PendingMembersRequest, PinMessageRequest, PinnedMessagesRequest, PinnedMessagesResponse, ReportListResponse, ReportMessageRequest, ReviewReportRequest, RevokeSanctionRequest, SanctionListResponse, SanctionRequest } from "./chat_messages_nest";
|
|
5
5
|
export declare const protobufPackage = "micro.v1.chat";
|
|
6
6
|
export declare const MICRO_V1_CHAT_PACKAGE_NAME = "micro.v1.chat";
|
|
7
7
|
export interface PChatServiceClient {
|
|
@@ -13,6 +13,8 @@ export interface PChatServiceClient {
|
|
|
13
13
|
pinnedMessages(request: PinnedMessagesRequest, metadata?: Metadata): Observable<PinnedMessagesResponse>;
|
|
14
14
|
listMembers(request: GroupBySlugRequest, metadata?: Metadata): Observable<ChatMemberListResponse>;
|
|
15
15
|
getGroupPhoto(request: ByIdRequest, metadata?: Metadata): Observable<GroupPhotoResponse>;
|
|
16
|
+
uploadChatMedia(request: ChatMediaUploadRequest, metadata?: Metadata): Observable<ChatMediaUploadResponse>;
|
|
17
|
+
getChatMedia(request: ChatMediaGetRequest, metadata?: Metadata): Observable<ChatMediaGetResponse>;
|
|
16
18
|
reportMessage(request: ReportMessageRequest, metadata?: Metadata): Observable<EmptyResponse>;
|
|
17
19
|
blockUser(request: BlockUserRequest, metadata?: Metadata): Observable<EmptyResponse>;
|
|
18
20
|
unblockUser(request: BlockUserRequest, metadata?: Metadata): Observable<EmptyResponse>;
|
|
@@ -27,6 +29,8 @@ export interface PChatServiceController {
|
|
|
27
29
|
pinnedMessages(request: PinnedMessagesRequest, metadata?: Metadata): Observable<PinnedMessagesResponse>;
|
|
28
30
|
listMembers(request: GroupBySlugRequest, metadata?: Metadata): Observable<ChatMemberListResponse>;
|
|
29
31
|
getGroupPhoto(request: ByIdRequest, metadata?: Metadata): Observable<GroupPhotoResponse>;
|
|
32
|
+
uploadChatMedia(request: ChatMediaUploadRequest, metadata?: Metadata): Observable<ChatMediaUploadResponse>;
|
|
33
|
+
getChatMedia(request: ChatMediaGetRequest, metadata?: Metadata): Observable<ChatMediaGetResponse>;
|
|
30
34
|
reportMessage(request: ReportMessageRequest, metadata?: Metadata): Observable<EmptyResponse>;
|
|
31
35
|
blockUser(request: BlockUserRequest, metadata?: Metadata): Observable<EmptyResponse>;
|
|
32
36
|
unblockUser(request: BlockUserRequest, metadata?: Metadata): Observable<EmptyResponse>;
|
package/package.json
CHANGED
|
@@ -77,6 +77,43 @@ message ChatMessageDto {
|
|
|
77
77
|
string edited_at = 16;
|
|
78
78
|
// Present only on type='poll' messages.
|
|
79
79
|
ChatPollDto poll = 17;
|
|
80
|
+
// Attached photo/video; bytes are served separately by public_id.
|
|
81
|
+
ChatMediaDto media = 18;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// Media descriptor riding a message; the payload itself never travels with
|
|
85
|
+
// the message (fan-out stays light), it is fetched via GetChatMedia.
|
|
86
|
+
message ChatMediaDto {
|
|
87
|
+
string public_id = 1;
|
|
88
|
+
// image | video
|
|
89
|
+
string kind = 2;
|
|
90
|
+
uint32 width = 3;
|
|
91
|
+
uint32 height = 4;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
message ChatMediaUploadRequest {
|
|
95
|
+
string group_slug = 1;
|
|
96
|
+
string kind = 2;
|
|
97
|
+
bytes data = 3;
|
|
98
|
+
string mimetype = 4;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
message ChatMediaUploadResponse {
|
|
102
|
+
ResponseStatus status = 1;
|
|
103
|
+
string media_id = 2;
|
|
104
|
+
uint32 width = 3;
|
|
105
|
+
uint32 height = 4;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
message ChatMediaGetRequest {
|
|
109
|
+
string public_id = 1;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
message ChatMediaGetResponse {
|
|
113
|
+
ResponseStatus status = 1;
|
|
114
|
+
bytes data = 2;
|
|
115
|
+
string mimetype = 3;
|
|
116
|
+
string kind = 4;
|
|
80
117
|
}
|
|
81
118
|
|
|
82
119
|
// In-chat poll (rides a type='poll' message; dies with it via FK cascade).
|
|
@@ -15,6 +15,10 @@ service PChatService {
|
|
|
15
15
|
rpc PinnedMessages(PinnedMessagesRequest) returns(stream PinnedMessagesResponse) {}
|
|
16
16
|
rpc ListMembers(GroupBySlugRequest) returns(stream ChatMemberListResponse) {}
|
|
17
17
|
rpc GetGroupPhoto(ByIdRequest) returns(stream GroupPhotoResponse) {}
|
|
18
|
+
// Authed upload (staging row); the send then references media_id.
|
|
19
|
+
rpc UploadChatMedia(ChatMediaUploadRequest) returns(stream ChatMediaUploadResponse) {}
|
|
20
|
+
// Public serve by unguessable public_id (capability URL).
|
|
21
|
+
rpc GetChatMedia(ChatMediaGetRequest) returns(stream ChatMediaGetResponse) {}
|
|
18
22
|
|
|
19
23
|
rpc ReportMessage(ReportMessageRequest) returns(stream EmptyResponse) {}
|
|
20
24
|
rpc BlockUser(BlockUserRequest) returns(stream EmptyResponse) {}
|