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/api/api.ts +28 -32
- package/dist/mezon-js-protobuf/api/api.d.ts +41 -509
- package/dist/mezon-js-protobuf/rtapi/realtime.d.ts +1 -1
- package/dist/mezon-js-protobuf/utils.d.ts +2 -2
- package/dist/mezon-js-protobuf.cjs.js +19 -254
- package/dist/mezon-js-protobuf.esm.mjs +19 -254
- package/package.json +1 -1
- package/rtapi/realtime.ts +10 -12
- package/utils.ts +9 -9
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mezon-js-protobuf",
|
|
3
|
-
"version": "1.8.
|
|
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:
|
|
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 !==
|
|
9386
|
-
|
|
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 !==
|
|
9458
|
+
if (tag !== 64) {
|
|
9461
9459
|
break;
|
|
9462
9460
|
}
|
|
9463
9461
|
|
|
9464
|
-
message.channel_type =
|
|
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) :
|
|
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 !==
|
|
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 ??
|
|
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
|
|
31
|
-
return
|
|
30
|
+
const reactions = tsproto.MessageReactionList.decode(uintBuffer);
|
|
31
|
+
return reactions;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
export function
|
|
34
|
+
export function decodeNotificationFcm(data: any) {
|
|
35
35
|
const buffer: ArrayBuffer = data;
|
|
36
36
|
const uintBuffer: Uint8Array = new Uint8Array(buffer);
|
|
37
|
-
const noti = tsproto.
|
|
37
|
+
const noti = tsproto.Notification.decode(uintBuffer);
|
|
38
38
|
|
|
39
39
|
return noti;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
export function
|
|
43
|
-
const
|
|
44
|
-
const
|
|
45
|
-
const
|
|
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
|
|
47
|
+
return notiContent;
|
|
48
48
|
}
|