mezon-js-protobuf 1.8.79 → 1.8.80

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.79",
3
+ "version": "1.8.80",
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
@@ -1163,9 +1163,7 @@ export interface ChannelCreatedEvent {
1163
1163
  /** channel private */
1164
1164
  channel_private: number;
1165
1165
  /** channel type */
1166
- channel_type:
1167
- | number
1168
- | undefined;
1166
+ channel_type: number;
1169
1167
  /** status */
1170
1168
  status: number;
1171
1169
  /** app id */
@@ -9351,7 +9349,7 @@ function createBaseChannelCreatedEvent(): ChannelCreatedEvent {
9351
9349
  channel_id: "",
9352
9350
  channel_label: "",
9353
9351
  channel_private: 0,
9354
- channel_type: undefined,
9352
+ channel_type: 0,
9355
9353
  status: 0,
9356
9354
  app_id: "",
9357
9355
  clan_name: "",
@@ -9382,8 +9380,8 @@ export const ChannelCreatedEvent = {
9382
9380
  if (message.channel_private !== 0) {
9383
9381
  writer.uint32(56).int32(message.channel_private);
9384
9382
  }
9385
- if (message.channel_type !== undefined) {
9386
- Int32Value.encode({ value: message.channel_type! }, writer.uint32(66).fork()).ldelim();
9383
+ if (message.channel_type !== 0) {
9384
+ writer.uint32(64).int32(message.channel_type);
9387
9385
  }
9388
9386
  if (message.status !== 0) {
9389
9387
  writer.uint32(72).int32(message.status);
@@ -9457,11 +9455,11 @@ export const ChannelCreatedEvent = {
9457
9455
  message.channel_private = reader.int32();
9458
9456
  continue;
9459
9457
  case 8:
9460
- if (tag !== 66) {
9458
+ if (tag !== 64) {
9461
9459
  break;
9462
9460
  }
9463
9461
 
9464
- message.channel_type = Int32Value.decode(reader, reader.uint32()).value;
9462
+ message.channel_type = reader.int32();
9465
9463
  continue;
9466
9464
  case 9:
9467
9465
  if (tag !== 72) {
@@ -9509,7 +9507,7 @@ export const ChannelCreatedEvent = {
9509
9507
  channel_id: isSet(object.channel_id) ? globalThis.String(object.channel_id) : "",
9510
9508
  channel_label: isSet(object.channel_label) ? globalThis.String(object.channel_label) : "",
9511
9509
  channel_private: isSet(object.channel_private) ? globalThis.Number(object.channel_private) : 0,
9512
- channel_type: isSet(object.channel_type) ? Number(object.channel_type) : undefined,
9510
+ channel_type: isSet(object.channel_type) ? globalThis.Number(object.channel_type) : 0,
9513
9511
  status: isSet(object.status) ? globalThis.Number(object.status) : 0,
9514
9512
  app_id: isSet(object.app_id) ? globalThis.String(object.app_id) : "",
9515
9513
  clan_name: isSet(object.clan_name) ? globalThis.String(object.clan_name) : "",
@@ -9540,8 +9538,8 @@ export const ChannelCreatedEvent = {
9540
9538
  if (message.channel_private !== 0) {
9541
9539
  obj.channel_private = Math.round(message.channel_private);
9542
9540
  }
9543
- if (message.channel_type !== undefined) {
9544
- obj.channel_type = message.channel_type;
9541
+ if (message.channel_type !== 0) {
9542
+ obj.channel_type = Math.round(message.channel_type);
9545
9543
  }
9546
9544
  if (message.status !== 0) {
9547
9545
  obj.status = Math.round(message.status);
@@ -9570,7 +9568,7 @@ export const ChannelCreatedEvent = {
9570
9568
  message.channel_id = object.channel_id ?? "";
9571
9569
  message.channel_label = object.channel_label ?? "";
9572
9570
  message.channel_private = object.channel_private ?? 0;
9573
- message.channel_type = object.channel_type ?? undefined;
9571
+ message.channel_type = object.channel_type ?? 0;
9574
9572
  message.status = object.status ?? 0;
9575
9573
  message.app_id = object.app_id ?? "";
9576
9574
  message.clan_name = object.clan_name ?? "";
package/utils.ts CHANGED
@@ -27,22 +27,22 @@ export function decodeRefs(data: any) {
27
27
  export function decodeReactions(data: any) {
28
28
  const buffer: ArrayBuffer = data;
29
29
  const uintBuffer: Uint8Array = new Uint8Array(buffer);
30
- const noti = tsproto.MessageReactionList.decode(uintBuffer);
31
- return noti;
30
+ const reactions = tsproto.MessageReactionList.decode(uintBuffer);
31
+ return reactions;
32
32
  }
33
33
 
34
- export function decodeChannelMessageHeader(data: any) {
34
+ export function decodeNotificationFcm(data: any) {
35
35
  const buffer: ArrayBuffer = data;
36
36
  const uintBuffer: Uint8Array = new Uint8Array(buffer);
37
- const noti = tsproto.ChannelMessageHeader.decode(uintBuffer);
37
+ const noti = tsproto.Notification.decode(uintBuffer);
38
38
 
39
39
  return noti;
40
40
  }
41
41
 
42
- export function decodeNotificationFcm(data: any) {
43
- const buffer: ArrayBuffer = data;
44
- const uintBuffer: Uint8Array = new Uint8Array(buffer);
45
- const noti = tsproto.DirectFcmProto.decode(uintBuffer);
42
+ export function decodeNotificationContent(data: any) {
43
+ const uint8Array = new Uint8Array(data);
44
+ const decoder = new TextDecoder("utf-8");
45
+ const notiContent = decoder.decode(uint8Array);
46
46
 
47
- return noti;
47
+ return notiContent;
48
48
  }