mezon-js-protobuf 1.8.76 → 1.8.78

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mezon-js-protobuf",
3
- "version": "1.8.76",
3
+ "version": "1.8.78",
4
4
  "description": "Websocket adapter adding protocol buffer support to the Mezon Javascript client.",
5
5
  "main": "dist/mezon-js-protobuf.cjs.js",
6
6
  "module": "dist/mezon-js-protobuf.esm.mjs",
package/rtapi/realtime.ts CHANGED
@@ -38,6 +38,8 @@ import {
38
38
  ListChannelDetailRequest,
39
39
  ListChannelMessagesRequest,
40
40
  ListChannelUsersRequest,
41
+ ListClanBadgeCountRequest,
42
+ ListClanBadgeCountResponse,
41
43
  ListClanDescRequest,
42
44
  ListClanUnreadMsgIndicatorRequest,
43
45
  ListClanUnreadMsgIndicatorResponse,
@@ -1743,6 +1745,8 @@ export interface ListDataSocket {
1743
1745
  stream_user_list: StreamingChannelUserList | undefined;
1744
1746
  list_unread_msg_indicator_req: ListClanUnreadMsgIndicatorRequest | undefined;
1745
1747
  unread_msg_indicator: ListClanUnreadMsgIndicatorResponse | undefined;
1748
+ list_clan_badge_count_req: ListClanBadgeCountRequest | undefined;
1749
+ clan_badge_count: ListClanBadgeCountResponse | undefined;
1746
1750
  }
1747
1751
 
1748
1752
  export interface MeetParticipantEvent {
@@ -1773,7 +1777,7 @@ export interface FcmDataPayload {
1773
1777
  command_type: number;
1774
1778
  receiver_id: string;
1775
1779
  title: string;
1776
- body: string;
1780
+ body: Uint8Array;
1777
1781
  user_role_ids: string[];
1778
1782
  user_sent_ids: string[];
1779
1783
  priority: number;
@@ -14673,6 +14677,8 @@ function createBaseListDataSocket(): ListDataSocket {
14673
14677
  stream_user_list: undefined,
14674
14678
  list_unread_msg_indicator_req: undefined,
14675
14679
  unread_msg_indicator: undefined,
14680
+ list_clan_badge_count_req: undefined,
14681
+ clan_badge_count: undefined,
14676
14682
  };
14677
14683
  }
14678
14684
 
@@ -14878,6 +14884,12 @@ export const ListDataSocket = {
14878
14884
  if (message.unread_msg_indicator !== undefined) {
14879
14885
  ListClanUnreadMsgIndicatorResponse.encode(message.unread_msg_indicator, writer.uint32(530).fork()).ldelim();
14880
14886
  }
14887
+ if (message.list_clan_badge_count_req !== undefined) {
14888
+ ListClanBadgeCountRequest.encode(message.list_clan_badge_count_req, writer.uint32(538).fork()).ldelim();
14889
+ }
14890
+ if (message.clan_badge_count !== undefined) {
14891
+ ListClanBadgeCountResponse.encode(message.clan_badge_count, writer.uint32(546).fork()).ldelim();
14892
+ }
14881
14893
  return writer;
14882
14894
  },
14883
14895
 
@@ -15353,6 +15365,20 @@ export const ListDataSocket = {
15353
15365
 
15354
15366
  message.unread_msg_indicator = ListClanUnreadMsgIndicatorResponse.decode(reader, reader.uint32());
15355
15367
  continue;
15368
+ case 67:
15369
+ if (tag !== 538) {
15370
+ break;
15371
+ }
15372
+
15373
+ message.list_clan_badge_count_req = ListClanBadgeCountRequest.decode(reader, reader.uint32());
15374
+ continue;
15375
+ case 68:
15376
+ if (tag !== 546) {
15377
+ break;
15378
+ }
15379
+
15380
+ message.clan_badge_count = ListClanBadgeCountResponse.decode(reader, reader.uint32());
15381
+ continue;
15356
15382
  }
15357
15383
  if ((tag & 7) === 4 || tag === 0) {
15358
15384
  break;
@@ -15518,6 +15544,12 @@ export const ListDataSocket = {
15518
15544
  unread_msg_indicator: isSet(object.unread_msg_indicator)
15519
15545
  ? ListClanUnreadMsgIndicatorResponse.fromJSON(object.unread_msg_indicator)
15520
15546
  : undefined,
15547
+ list_clan_badge_count_req: isSet(object.list_clan_badge_count_req)
15548
+ ? ListClanBadgeCountRequest.fromJSON(object.list_clan_badge_count_req)
15549
+ : undefined,
15550
+ clan_badge_count: isSet(object.clan_badge_count)
15551
+ ? ListClanBadgeCountResponse.fromJSON(object.clan_badge_count)
15552
+ : undefined,
15521
15553
  };
15522
15554
  },
15523
15555
 
@@ -15725,6 +15757,12 @@ export const ListDataSocket = {
15725
15757
  if (message.unread_msg_indicator !== undefined) {
15726
15758
  obj.unread_msg_indicator = ListClanUnreadMsgIndicatorResponse.toJSON(message.unread_msg_indicator);
15727
15759
  }
15760
+ if (message.list_clan_badge_count_req !== undefined) {
15761
+ obj.list_clan_badge_count_req = ListClanBadgeCountRequest.toJSON(message.list_clan_badge_count_req);
15762
+ }
15763
+ if (message.clan_badge_count !== undefined) {
15764
+ obj.clan_badge_count = ListClanBadgeCountResponse.toJSON(message.clan_badge_count);
15765
+ }
15728
15766
  return obj;
15729
15767
  },
15730
15768
 
@@ -15942,6 +15980,13 @@ export const ListDataSocket = {
15942
15980
  message.unread_msg_indicator = (object.unread_msg_indicator !== undefined && object.unread_msg_indicator !== null)
15943
15981
  ? ListClanUnreadMsgIndicatorResponse.fromPartial(object.unread_msg_indicator)
15944
15982
  : undefined;
15983
+ message.list_clan_badge_count_req =
15984
+ (object.list_clan_badge_count_req !== undefined && object.list_clan_badge_count_req !== null)
15985
+ ? ListClanBadgeCountRequest.fromPartial(object.list_clan_badge_count_req)
15986
+ : undefined;
15987
+ message.clan_badge_count = (object.clan_badge_count !== undefined && object.clan_badge_count !== null)
15988
+ ? ListClanBadgeCountResponse.fromPartial(object.clan_badge_count)
15989
+ : undefined;
15945
15990
  return message;
15946
15991
  },
15947
15992
  };
@@ -16307,7 +16352,7 @@ function createBaseFcmDataPayload(): FcmDataPayload {
16307
16352
  command_type: 0,
16308
16353
  receiver_id: "",
16309
16354
  title: "",
16310
- body: "",
16355
+ body: new Uint8Array(0),
16311
16356
  user_role_ids: [],
16312
16357
  user_sent_ids: [],
16313
16358
  priority: 0,
@@ -16332,8 +16377,8 @@ export const FcmDataPayload = {
16332
16377
  if (message.title !== "") {
16333
16378
  writer.uint32(26).string(message.title);
16334
16379
  }
16335
- if (message.body !== "") {
16336
- writer.uint32(34).string(message.body);
16380
+ if (message.body.length !== 0) {
16381
+ writer.uint32(34).bytes(message.body);
16337
16382
  }
16338
16383
  for (const v of message.user_role_ids) {
16339
16384
  writer.uint32(42).string(v!);
@@ -16401,7 +16446,7 @@ export const FcmDataPayload = {
16401
16446
  break;
16402
16447
  }
16403
16448
 
16404
- message.body = reader.string();
16449
+ message.body = reader.bytes();
16405
16450
  continue;
16406
16451
  case 5:
16407
16452
  if (tag !== 42) {
@@ -16487,7 +16532,7 @@ export const FcmDataPayload = {
16487
16532
  command_type: isSet(object.command_type) ? globalThis.Number(object.command_type) : 0,
16488
16533
  receiver_id: isSet(object.receiver_id) ? globalThis.String(object.receiver_id) : "",
16489
16534
  title: isSet(object.title) ? globalThis.String(object.title) : "",
16490
- body: isSet(object.body) ? globalThis.String(object.body) : "",
16535
+ body: isSet(object.body) ? bytesFromBase64(object.body) : new Uint8Array(0),
16491
16536
  user_role_ids: globalThis.Array.isArray(object?.user_role_ids)
16492
16537
  ? object.user_role_ids.map((e: any) => globalThis.String(e))
16493
16538
  : [],
@@ -16522,8 +16567,8 @@ export const FcmDataPayload = {
16522
16567
  if (message.title !== "") {
16523
16568
  obj.title = message.title;
16524
16569
  }
16525
- if (message.body !== "") {
16526
- obj.body = message.body;
16570
+ if (message.body.length !== 0) {
16571
+ obj.body = base64FromBytes(message.body);
16527
16572
  }
16528
16573
  if (message.user_role_ids?.length) {
16529
16574
  obj.user_role_ids = message.user_role_ids;
@@ -16566,7 +16611,7 @@ export const FcmDataPayload = {
16566
16611
  message.command_type = object.command_type ?? 0;
16567
16612
  message.receiver_id = object.receiver_id ?? "";
16568
16613
  message.title = object.title ?? "";
16569
- message.body = object.body ?? "";
16614
+ message.body = object.body ?? new Uint8Array(0);
16570
16615
  message.user_role_ids = object.user_role_ids?.map((e) => e) || [];
16571
16616
  message.user_sent_ids = object.user_sent_ids?.map((e) => e) || [];
16572
16617
  message.priority = object.priority ?? 0;
package/utils.ts CHANGED
@@ -5,7 +5,7 @@ export function decodeMentions(data: any) {
5
5
  const uintBuffer: Uint8Array = new Uint8Array(buffer);
6
6
  const mentions = tsproto.MessageMentionList.decode(uintBuffer);
7
7
 
8
- return mentions
8
+ return mentions;
9
9
  }
10
10
 
11
11
  export function decodeAttachments(data: any) {
@@ -13,7 +13,7 @@ export function decodeAttachments(data: any) {
13
13
  const uintBuffer: Uint8Array = new Uint8Array(buffer);
14
14
  const attachments = tsproto.MessageAttachmentList.decode(uintBuffer);
15
15
 
16
- return attachments
16
+ return attachments;
17
17
  }
18
18
 
19
19
  export function decodeRefs(data: any) {
@@ -21,7 +21,14 @@ export function decodeRefs(data: any) {
21
21
  const uintBuffer: Uint8Array = new Uint8Array(buffer);
22
22
  const refs = tsproto.MessageRefList.decode(uintBuffer);
23
23
 
24
- return refs
24
+ return refs;
25
+ }
26
+
27
+ export function decodeReactions(data: any) {
28
+ const buffer: ArrayBuffer = data;
29
+ const uintBuffer: Uint8Array = new Uint8Array(buffer);
30
+ const noti = tsproto.MessageReactionList.decode(uintBuffer);
31
+ return noti;
25
32
  }
26
33
 
27
34
  export function decodeNotificationFcm(data: any) {
@@ -29,5 +36,5 @@ export function decodeNotificationFcm(data: any) {
29
36
  const uintBuffer: Uint8Array = new Uint8Array(buffer);
30
37
  const noti = tsproto.DirectFcmProto.decode(uintBuffer);
31
38
 
32
- return noti
39
+ return noti;
33
40
  }