jr-common-micro 1.1.61 → 1.1.63

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.
@@ -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,44 @@ export interface ChatMessageDto {
55
55
  reactions: ChatReactionCountDto[];
56
56
  edited_at: string;
57
57
  poll: ChatPollDto | undefined;
58
+ media: ChatMediaDto | undefined;
59
+ link_preview: ChatLinkPreviewDto | undefined;
60
+ }
61
+ export interface ChatLinkPreviewDto {
62
+ url: string;
63
+ site_name: string;
64
+ title: string;
65
+ description: string;
66
+ image_public_id: string;
67
+ image_width: number;
68
+ image_height: number;
69
+ }
70
+ export interface ChatMediaDto {
71
+ public_id: string;
72
+ kind: string;
73
+ width: number;
74
+ height: number;
75
+ }
76
+ export interface ChatMediaUploadRequest {
77
+ group_slug: string;
78
+ kind: string;
79
+ data: Buffer;
80
+ mimetype: string;
81
+ }
82
+ export interface ChatMediaUploadResponse {
83
+ status: ResponseStatus | undefined;
84
+ media_id: string;
85
+ width: number;
86
+ height: number;
87
+ }
88
+ export interface ChatMediaGetRequest {
89
+ public_id: string;
90
+ }
91
+ export interface ChatMediaGetResponse {
92
+ status: ResponseStatus | undefined;
93
+ data: Buffer;
94
+ mimetype: string;
95
+ kind: string;
58
96
  }
59
97
  export interface ChatPollOptionDto {
60
98
  id: string;
@@ -96,6 +96,8 @@ export declare class ChatMessageDto extends Message<ChatMessageDto> {
96
96
  reactions: ChatReactionCountDto[];
97
97
  editedAt: string;
98
98
  poll?: ChatPollDto;
99
+ media?: ChatMediaDto;
100
+ linkPreview?: ChatLinkPreviewDto;
99
101
  constructor(data?: PartialMessage<ChatMessageDto>);
100
102
  static readonly runtime: typeof proto3;
101
103
  static readonly typeName = "micro.v1.chat.ChatMessageDto";
@@ -105,6 +107,90 @@ export declare class ChatMessageDto extends Message<ChatMessageDto> {
105
107
  static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): ChatMessageDto;
106
108
  static equals(a: ChatMessageDto | PlainMessage<ChatMessageDto> | undefined, b: ChatMessageDto | PlainMessage<ChatMessageDto> | undefined): boolean;
107
109
  }
110
+ export declare class ChatLinkPreviewDto extends Message<ChatLinkPreviewDto> {
111
+ url: string;
112
+ siteName: string;
113
+ title: string;
114
+ description: string;
115
+ imagePublicId: string;
116
+ imageWidth: number;
117
+ imageHeight: number;
118
+ constructor(data?: PartialMessage<ChatLinkPreviewDto>);
119
+ static readonly runtime: typeof proto3;
120
+ static readonly typeName = "micro.v1.chat.ChatLinkPreviewDto";
121
+ static readonly fields: FieldList;
122
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): ChatLinkPreviewDto;
123
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): ChatLinkPreviewDto;
124
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): ChatLinkPreviewDto;
125
+ static equals(a: ChatLinkPreviewDto | PlainMessage<ChatLinkPreviewDto> | undefined, b: ChatLinkPreviewDto | PlainMessage<ChatLinkPreviewDto> | undefined): boolean;
126
+ }
127
+ export declare class ChatMediaDto extends Message<ChatMediaDto> {
128
+ publicId: string;
129
+ kind: string;
130
+ width: number;
131
+ height: number;
132
+ constructor(data?: PartialMessage<ChatMediaDto>);
133
+ static readonly runtime: typeof proto3;
134
+ static readonly typeName = "micro.v1.chat.ChatMediaDto";
135
+ static readonly fields: FieldList;
136
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): ChatMediaDto;
137
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): ChatMediaDto;
138
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): ChatMediaDto;
139
+ static equals(a: ChatMediaDto | PlainMessage<ChatMediaDto> | undefined, b: ChatMediaDto | PlainMessage<ChatMediaDto> | undefined): boolean;
140
+ }
141
+ export declare class ChatMediaUploadRequest extends Message<ChatMediaUploadRequest> {
142
+ groupSlug: string;
143
+ kind: string;
144
+ data: Uint8Array<ArrayBuffer>;
145
+ mimetype: string;
146
+ constructor(data?: PartialMessage<ChatMediaUploadRequest>);
147
+ static readonly runtime: typeof proto3;
148
+ static readonly typeName = "micro.v1.chat.ChatMediaUploadRequest";
149
+ static readonly fields: FieldList;
150
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): ChatMediaUploadRequest;
151
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): ChatMediaUploadRequest;
152
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): ChatMediaUploadRequest;
153
+ static equals(a: ChatMediaUploadRequest | PlainMessage<ChatMediaUploadRequest> | undefined, b: ChatMediaUploadRequest | PlainMessage<ChatMediaUploadRequest> | undefined): boolean;
154
+ }
155
+ export declare class ChatMediaUploadResponse extends Message<ChatMediaUploadResponse> {
156
+ status?: ResponseStatus;
157
+ mediaId: string;
158
+ width: number;
159
+ height: number;
160
+ constructor(data?: PartialMessage<ChatMediaUploadResponse>);
161
+ static readonly runtime: typeof proto3;
162
+ static readonly typeName = "micro.v1.chat.ChatMediaUploadResponse";
163
+ static readonly fields: FieldList;
164
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): ChatMediaUploadResponse;
165
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): ChatMediaUploadResponse;
166
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): ChatMediaUploadResponse;
167
+ static equals(a: ChatMediaUploadResponse | PlainMessage<ChatMediaUploadResponse> | undefined, b: ChatMediaUploadResponse | PlainMessage<ChatMediaUploadResponse> | undefined): boolean;
168
+ }
169
+ export declare class ChatMediaGetRequest extends Message<ChatMediaGetRequest> {
170
+ publicId: string;
171
+ constructor(data?: PartialMessage<ChatMediaGetRequest>);
172
+ static readonly runtime: typeof proto3;
173
+ static readonly typeName = "micro.v1.chat.ChatMediaGetRequest";
174
+ static readonly fields: FieldList;
175
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): ChatMediaGetRequest;
176
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): ChatMediaGetRequest;
177
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): ChatMediaGetRequest;
178
+ static equals(a: ChatMediaGetRequest | PlainMessage<ChatMediaGetRequest> | undefined, b: ChatMediaGetRequest | PlainMessage<ChatMediaGetRequest> | undefined): boolean;
179
+ }
180
+ export declare class ChatMediaGetResponse extends Message<ChatMediaGetResponse> {
181
+ status?: ResponseStatus;
182
+ data: Uint8Array<ArrayBuffer>;
183
+ mimetype: string;
184
+ kind: string;
185
+ constructor(data?: PartialMessage<ChatMediaGetResponse>);
186
+ static readonly runtime: typeof proto3;
187
+ static readonly typeName = "micro.v1.chat.ChatMediaGetResponse";
188
+ static readonly fields: FieldList;
189
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): ChatMediaGetResponse;
190
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): ChatMediaGetResponse;
191
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): ChatMediaGetResponse;
192
+ static equals(a: ChatMediaGetResponse | PlainMessage<ChatMediaGetResponse> | undefined, b: ChatMediaGetResponse | PlainMessage<ChatMediaGetResponse> | undefined): boolean;
193
+ }
108
194
  export declare class ChatPollOptionDto extends Message<ChatPollOptionDto> {
109
195
  id: string;
110
196
  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.ChatLinkPreviewDto = 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,8 @@ class ChatMessageDto extends protobuf_1.Message {
190
190
  reactions = [];
191
191
  editedAt = "";
192
192
  poll;
193
+ media;
194
+ linkPreview;
193
195
  constructor(data) {
194
196
  super();
195
197
  protobuf_1.proto3.util.initPartial(data, this);
@@ -214,6 +216,8 @@ class ChatMessageDto extends protobuf_1.Message {
214
216
  { no: 15, name: "reactions", kind: "message", T: ChatReactionCountDto, repeated: true },
215
217
  { no: 16, name: "edited_at", kind: "scalar", T: 9 },
216
218
  { no: 17, name: "poll", kind: "message", T: ChatPollDto },
219
+ { no: 18, name: "media", kind: "message", T: ChatMediaDto },
220
+ { no: 19, name: "link_preview", kind: "message", T: ChatLinkPreviewDto },
217
221
  ]);
218
222
  static fromBinary(bytes, options) {
219
223
  return new ChatMessageDto().fromBinary(bytes, options);
@@ -229,6 +233,192 @@ class ChatMessageDto extends protobuf_1.Message {
229
233
  }
230
234
  }
231
235
  exports.ChatMessageDto = ChatMessageDto;
236
+ class ChatLinkPreviewDto extends protobuf_1.Message {
237
+ url = "";
238
+ siteName = "";
239
+ title = "";
240
+ description = "";
241
+ imagePublicId = "";
242
+ imageWidth = 0;
243
+ imageHeight = 0;
244
+ constructor(data) {
245
+ super();
246
+ protobuf_1.proto3.util.initPartial(data, this);
247
+ }
248
+ static runtime = protobuf_1.proto3;
249
+ static typeName = "micro.v1.chat.ChatLinkPreviewDto";
250
+ static fields = protobuf_1.proto3.util.newFieldList(() => [
251
+ { no: 1, name: "url", kind: "scalar", T: 9 },
252
+ { no: 2, name: "site_name", kind: "scalar", T: 9 },
253
+ { no: 3, name: "title", kind: "scalar", T: 9 },
254
+ { no: 4, name: "description", kind: "scalar", T: 9 },
255
+ { no: 5, name: "image_public_id", kind: "scalar", T: 9 },
256
+ { no: 6, name: "image_width", kind: "scalar", T: 13 },
257
+ { no: 7, name: "image_height", kind: "scalar", T: 13 },
258
+ ]);
259
+ static fromBinary(bytes, options) {
260
+ return new ChatLinkPreviewDto().fromBinary(bytes, options);
261
+ }
262
+ static fromJson(jsonValue, options) {
263
+ return new ChatLinkPreviewDto().fromJson(jsonValue, options);
264
+ }
265
+ static fromJsonString(jsonString, options) {
266
+ return new ChatLinkPreviewDto().fromJsonString(jsonString, options);
267
+ }
268
+ static equals(a, b) {
269
+ return protobuf_1.proto3.util.equals(ChatLinkPreviewDto, a, b);
270
+ }
271
+ }
272
+ exports.ChatLinkPreviewDto = ChatLinkPreviewDto;
273
+ class ChatMediaDto extends protobuf_1.Message {
274
+ publicId = "";
275
+ kind = "";
276
+ width = 0;
277
+ height = 0;
278
+ constructor(data) {
279
+ super();
280
+ protobuf_1.proto3.util.initPartial(data, this);
281
+ }
282
+ static runtime = protobuf_1.proto3;
283
+ static typeName = "micro.v1.chat.ChatMediaDto";
284
+ static fields = protobuf_1.proto3.util.newFieldList(() => [
285
+ { no: 1, name: "public_id", kind: "scalar", T: 9 },
286
+ { no: 2, name: "kind", kind: "scalar", T: 9 },
287
+ { no: 3, name: "width", kind: "scalar", T: 13 },
288
+ { no: 4, name: "height", kind: "scalar", T: 13 },
289
+ ]);
290
+ static fromBinary(bytes, options) {
291
+ return new ChatMediaDto().fromBinary(bytes, options);
292
+ }
293
+ static fromJson(jsonValue, options) {
294
+ return new ChatMediaDto().fromJson(jsonValue, options);
295
+ }
296
+ static fromJsonString(jsonString, options) {
297
+ return new ChatMediaDto().fromJsonString(jsonString, options);
298
+ }
299
+ static equals(a, b) {
300
+ return protobuf_1.proto3.util.equals(ChatMediaDto, a, b);
301
+ }
302
+ }
303
+ exports.ChatMediaDto = ChatMediaDto;
304
+ class ChatMediaUploadRequest extends protobuf_1.Message {
305
+ groupSlug = "";
306
+ kind = "";
307
+ data = new Uint8Array(0);
308
+ mimetype = "";
309
+ constructor(data) {
310
+ super();
311
+ protobuf_1.proto3.util.initPartial(data, this);
312
+ }
313
+ static runtime = protobuf_1.proto3;
314
+ static typeName = "micro.v1.chat.ChatMediaUploadRequest";
315
+ static fields = protobuf_1.proto3.util.newFieldList(() => [
316
+ { no: 1, name: "group_slug", kind: "scalar", T: 9 },
317
+ { no: 2, name: "kind", kind: "scalar", T: 9 },
318
+ { no: 3, name: "data", kind: "scalar", T: 12 },
319
+ { no: 4, name: "mimetype", kind: "scalar", T: 9 },
320
+ ]);
321
+ static fromBinary(bytes, options) {
322
+ return new ChatMediaUploadRequest().fromBinary(bytes, options);
323
+ }
324
+ static fromJson(jsonValue, options) {
325
+ return new ChatMediaUploadRequest().fromJson(jsonValue, options);
326
+ }
327
+ static fromJsonString(jsonString, options) {
328
+ return new ChatMediaUploadRequest().fromJsonString(jsonString, options);
329
+ }
330
+ static equals(a, b) {
331
+ return protobuf_1.proto3.util.equals(ChatMediaUploadRequest, a, b);
332
+ }
333
+ }
334
+ exports.ChatMediaUploadRequest = ChatMediaUploadRequest;
335
+ class ChatMediaUploadResponse extends protobuf_1.Message {
336
+ status;
337
+ mediaId = "";
338
+ width = 0;
339
+ height = 0;
340
+ constructor(data) {
341
+ super();
342
+ protobuf_1.proto3.util.initPartial(data, this);
343
+ }
344
+ static runtime = protobuf_1.proto3;
345
+ static typeName = "micro.v1.chat.ChatMediaUploadResponse";
346
+ static fields = protobuf_1.proto3.util.newFieldList(() => [
347
+ { no: 1, name: "status", kind: "message", T: general_pb_js_1.ResponseStatus },
348
+ { no: 2, name: "media_id", kind: "scalar", T: 9 },
349
+ { no: 3, name: "width", kind: "scalar", T: 13 },
350
+ { no: 4, name: "height", kind: "scalar", T: 13 },
351
+ ]);
352
+ static fromBinary(bytes, options) {
353
+ return new ChatMediaUploadResponse().fromBinary(bytes, options);
354
+ }
355
+ static fromJson(jsonValue, options) {
356
+ return new ChatMediaUploadResponse().fromJson(jsonValue, options);
357
+ }
358
+ static fromJsonString(jsonString, options) {
359
+ return new ChatMediaUploadResponse().fromJsonString(jsonString, options);
360
+ }
361
+ static equals(a, b) {
362
+ return protobuf_1.proto3.util.equals(ChatMediaUploadResponse, a, b);
363
+ }
364
+ }
365
+ exports.ChatMediaUploadResponse = ChatMediaUploadResponse;
366
+ class ChatMediaGetRequest extends protobuf_1.Message {
367
+ publicId = "";
368
+ constructor(data) {
369
+ super();
370
+ protobuf_1.proto3.util.initPartial(data, this);
371
+ }
372
+ static runtime = protobuf_1.proto3;
373
+ static typeName = "micro.v1.chat.ChatMediaGetRequest";
374
+ static fields = protobuf_1.proto3.util.newFieldList(() => [
375
+ { no: 1, name: "public_id", kind: "scalar", T: 9 },
376
+ ]);
377
+ static fromBinary(bytes, options) {
378
+ return new ChatMediaGetRequest().fromBinary(bytes, options);
379
+ }
380
+ static fromJson(jsonValue, options) {
381
+ return new ChatMediaGetRequest().fromJson(jsonValue, options);
382
+ }
383
+ static fromJsonString(jsonString, options) {
384
+ return new ChatMediaGetRequest().fromJsonString(jsonString, options);
385
+ }
386
+ static equals(a, b) {
387
+ return protobuf_1.proto3.util.equals(ChatMediaGetRequest, a, b);
388
+ }
389
+ }
390
+ exports.ChatMediaGetRequest = ChatMediaGetRequest;
391
+ class ChatMediaGetResponse extends protobuf_1.Message {
392
+ status;
393
+ data = new Uint8Array(0);
394
+ mimetype = "";
395
+ kind = "";
396
+ constructor(data) {
397
+ super();
398
+ protobuf_1.proto3.util.initPartial(data, this);
399
+ }
400
+ static runtime = protobuf_1.proto3;
401
+ static typeName = "micro.v1.chat.ChatMediaGetResponse";
402
+ static fields = protobuf_1.proto3.util.newFieldList(() => [
403
+ { no: 1, name: "status", kind: "message", T: general_pb_js_1.ResponseStatus },
404
+ { no: 2, name: "data", kind: "scalar", T: 12 },
405
+ { no: 3, name: "mimetype", kind: "scalar", T: 9 },
406
+ { no: 4, name: "kind", kind: "scalar", T: 9 },
407
+ ]);
408
+ static fromBinary(bytes, options) {
409
+ return new ChatMediaGetResponse().fromBinary(bytes, options);
410
+ }
411
+ static fromJson(jsonValue, options) {
412
+ return new ChatMediaGetResponse().fromJson(jsonValue, options);
413
+ }
414
+ static fromJsonString(jsonString, options) {
415
+ return new ChatMediaGetResponse().fromJsonString(jsonString, options);
416
+ }
417
+ static equals(a, b) {
418
+ return protobuf_1.proto3.util.equals(ChatMediaGetResponse, a, b);
419
+ }
420
+ }
421
+ exports.ChatMediaGetResponse = ChatMediaGetResponse;
232
422
  class ChatPollOptionDto extends protobuf_1.Message {
233
423
  id = "";
234
424
  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>;
@@ -17,6 +17,8 @@ function PChatServiceControllerMethods() {
17
17
  "pinnedMessages",
18
18
  "listMembers",
19
19
  "getGroupPhoto",
20
+ "uploadChatMedia",
21
+ "getChatMedia",
20
22
  "reportMessage",
21
23
  "blockUser",
22
24
  "unblockUser",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jr-common-micro",
3
- "version": "1.1.61",
3
+ "version": "1.1.63",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -77,6 +77,57 @@ 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
+ // OpenGraph preview of the first link (staff messages only). Arrives
83
+ // asynchronously after the send; history carries it inline.
84
+ ChatLinkPreviewDto link_preview = 19;
85
+ }
86
+
87
+ message ChatLinkPreviewDto {
88
+ string url = 1;
89
+ string site_name = 2;
90
+ string title = 3;
91
+ string description = 4;
92
+ // Thumbnail rides the chat media store (kind='link'); empty = no image.
93
+ string image_public_id = 5;
94
+ uint32 image_width = 6;
95
+ uint32 image_height = 7;
96
+ }
97
+
98
+ // Media descriptor riding a message; the payload itself never travels with
99
+ // the message (fan-out stays light), it is fetched via GetChatMedia.
100
+ message ChatMediaDto {
101
+ string public_id = 1;
102
+ // image | video
103
+ string kind = 2;
104
+ uint32 width = 3;
105
+ uint32 height = 4;
106
+ }
107
+
108
+ message ChatMediaUploadRequest {
109
+ string group_slug = 1;
110
+ string kind = 2;
111
+ bytes data = 3;
112
+ string mimetype = 4;
113
+ }
114
+
115
+ message ChatMediaUploadResponse {
116
+ ResponseStatus status = 1;
117
+ string media_id = 2;
118
+ uint32 width = 3;
119
+ uint32 height = 4;
120
+ }
121
+
122
+ message ChatMediaGetRequest {
123
+ string public_id = 1;
124
+ }
125
+
126
+ message ChatMediaGetResponse {
127
+ ResponseStatus status = 1;
128
+ bytes data = 2;
129
+ string mimetype = 3;
130
+ string kind = 4;
80
131
  }
81
132
 
82
133
  // 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) {}