mezon-js-protobuf 1.8.79 → 1.8.81
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 +162 -68
- package/dist/mezon-js-protobuf/api/api.d.ts +93 -541
- package/dist/mezon-js-protobuf/rtapi/realtime.d.ts +118 -118
- package/dist/mezon-js-protobuf/utils.d.ts +2 -2
- package/dist/mezon-js-protobuf.cjs.js +35 -270
- package/dist/mezon-js-protobuf.esm.mjs +35 -270
- package/package.json +1 -1
- package/rtapi/realtime.ts +19 -21
- package/utils.ts +9 -9
|
@@ -2846,7 +2846,7 @@ var ChannelMessage = {
|
|
|
2846
2846
|
}
|
|
2847
2847
|
};
|
|
2848
2848
|
function createBaseMessageMention() {
|
|
2849
|
-
return { id: "", user_id: "", username: "", role_id: "", rolename: "",
|
|
2849
|
+
return { id: "", user_id: "", username: "", role_id: "", rolename: "", create_time_seconds: 0, s: 0, e: 0 };
|
|
2850
2850
|
}
|
|
2851
2851
|
var MessageMention = {
|
|
2852
2852
|
encode(message, writer = import_minimal3.default.Writer.create()) {
|
|
@@ -2865,8 +2865,8 @@ var MessageMention = {
|
|
|
2865
2865
|
if (message.rolename !== "") {
|
|
2866
2866
|
writer.uint32(42).string(message.rolename);
|
|
2867
2867
|
}
|
|
2868
|
-
if (message.
|
|
2869
|
-
writer.uint32(48).uint32(message.
|
|
2868
|
+
if (message.create_time_seconds !== 0) {
|
|
2869
|
+
writer.uint32(48).uint32(message.create_time_seconds);
|
|
2870
2870
|
}
|
|
2871
2871
|
if (message.s !== 0) {
|
|
2872
2872
|
writer.uint32(56).int32(message.s);
|
|
@@ -2917,7 +2917,7 @@ var MessageMention = {
|
|
|
2917
2917
|
if (tag !== 48) {
|
|
2918
2918
|
break;
|
|
2919
2919
|
}
|
|
2920
|
-
message.
|
|
2920
|
+
message.create_time_seconds = reader.uint32();
|
|
2921
2921
|
continue;
|
|
2922
2922
|
case 7:
|
|
2923
2923
|
if (tag !== 56) {
|
|
@@ -2946,7 +2946,7 @@ var MessageMention = {
|
|
|
2946
2946
|
username: isSet2(object.username) ? globalThis.String(object.username) : "",
|
|
2947
2947
|
role_id: isSet2(object.role_id) ? globalThis.String(object.role_id) : "",
|
|
2948
2948
|
rolename: isSet2(object.rolename) ? globalThis.String(object.rolename) : "",
|
|
2949
|
-
|
|
2949
|
+
create_time_seconds: isSet2(object.create_time_seconds) ? globalThis.Number(object.create_time_seconds) : 0,
|
|
2950
2950
|
s: isSet2(object.s) ? globalThis.Number(object.s) : 0,
|
|
2951
2951
|
e: isSet2(object.e) ? globalThis.Number(object.e) : 0
|
|
2952
2952
|
};
|
|
@@ -2968,8 +2968,8 @@ var MessageMention = {
|
|
|
2968
2968
|
if (message.rolename !== "") {
|
|
2969
2969
|
obj.rolename = message.rolename;
|
|
2970
2970
|
}
|
|
2971
|
-
if (message.
|
|
2972
|
-
obj.
|
|
2971
|
+
if (message.create_time_seconds !== 0) {
|
|
2972
|
+
obj.create_time_seconds = Math.round(message.create_time_seconds);
|
|
2973
2973
|
}
|
|
2974
2974
|
if (message.s !== 0) {
|
|
2975
2975
|
obj.s = Math.round(message.s);
|
|
@@ -2990,7 +2990,7 @@ var MessageMention = {
|
|
|
2990
2990
|
message.username = (_c = object.username) != null ? _c : "";
|
|
2991
2991
|
message.role_id = (_d = object.role_id) != null ? _d : "";
|
|
2992
2992
|
message.rolename = (_e = object.rolename) != null ? _e : "";
|
|
2993
|
-
message.
|
|
2993
|
+
message.create_time_seconds = (_f = object.create_time_seconds) != null ? _f : 0;
|
|
2994
2994
|
message.s = (_g = object.s) != null ? _g : 0;
|
|
2995
2995
|
message.e = (_h = object.e) != null ? _h : 0;
|
|
2996
2996
|
return message;
|
|
@@ -14143,241 +14143,6 @@ var SearchThreadRequest = {
|
|
|
14143
14143
|
return message;
|
|
14144
14144
|
}
|
|
14145
14145
|
};
|
|
14146
|
-
function createBaseDirectFcmProto() {
|
|
14147
|
-
return {
|
|
14148
|
-
title: "",
|
|
14149
|
-
link: "",
|
|
14150
|
-
content: "",
|
|
14151
|
-
channel_id: "",
|
|
14152
|
-
sender_id: "",
|
|
14153
|
-
avatar: "",
|
|
14154
|
-
clan_id: "",
|
|
14155
|
-
attachments: new Uint8Array(0),
|
|
14156
|
-
display_name: "",
|
|
14157
|
-
create_time_seconds: 0,
|
|
14158
|
-
update_time_seconds: 0,
|
|
14159
|
-
username: "",
|
|
14160
|
-
mentions: new Uint8Array(0)
|
|
14161
|
-
};
|
|
14162
|
-
}
|
|
14163
|
-
var DirectFcmProto = {
|
|
14164
|
-
encode(message, writer = import_minimal3.default.Writer.create()) {
|
|
14165
|
-
if (message.title !== "") {
|
|
14166
|
-
writer.uint32(10).string(message.title);
|
|
14167
|
-
}
|
|
14168
|
-
if (message.link !== "") {
|
|
14169
|
-
writer.uint32(18).string(message.link);
|
|
14170
|
-
}
|
|
14171
|
-
if (message.content !== "") {
|
|
14172
|
-
writer.uint32(26).string(message.content);
|
|
14173
|
-
}
|
|
14174
|
-
if (message.channel_id !== "") {
|
|
14175
|
-
writer.uint32(34).string(message.channel_id);
|
|
14176
|
-
}
|
|
14177
|
-
if (message.sender_id !== "") {
|
|
14178
|
-
writer.uint32(42).string(message.sender_id);
|
|
14179
|
-
}
|
|
14180
|
-
if (message.avatar !== "") {
|
|
14181
|
-
writer.uint32(50).string(message.avatar);
|
|
14182
|
-
}
|
|
14183
|
-
if (message.clan_id !== "") {
|
|
14184
|
-
writer.uint32(58).string(message.clan_id);
|
|
14185
|
-
}
|
|
14186
|
-
if (message.attachments.length !== 0) {
|
|
14187
|
-
writer.uint32(66).bytes(message.attachments);
|
|
14188
|
-
}
|
|
14189
|
-
if (message.display_name !== "") {
|
|
14190
|
-
writer.uint32(74).string(message.display_name);
|
|
14191
|
-
}
|
|
14192
|
-
if (message.create_time_seconds !== 0) {
|
|
14193
|
-
writer.uint32(80).int32(message.create_time_seconds);
|
|
14194
|
-
}
|
|
14195
|
-
if (message.update_time_seconds !== 0) {
|
|
14196
|
-
writer.uint32(88).int32(message.update_time_seconds);
|
|
14197
|
-
}
|
|
14198
|
-
if (message.username !== "") {
|
|
14199
|
-
writer.uint32(98).string(message.username);
|
|
14200
|
-
}
|
|
14201
|
-
if (message.mentions.length !== 0) {
|
|
14202
|
-
writer.uint32(106).bytes(message.mentions);
|
|
14203
|
-
}
|
|
14204
|
-
return writer;
|
|
14205
|
-
},
|
|
14206
|
-
decode(input, length) {
|
|
14207
|
-
const reader = input instanceof import_minimal3.default.Reader ? input : import_minimal3.default.Reader.create(input);
|
|
14208
|
-
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
14209
|
-
const message = createBaseDirectFcmProto();
|
|
14210
|
-
while (reader.pos < end) {
|
|
14211
|
-
const tag = reader.uint32();
|
|
14212
|
-
switch (tag >>> 3) {
|
|
14213
|
-
case 1:
|
|
14214
|
-
if (tag !== 10) {
|
|
14215
|
-
break;
|
|
14216
|
-
}
|
|
14217
|
-
message.title = reader.string();
|
|
14218
|
-
continue;
|
|
14219
|
-
case 2:
|
|
14220
|
-
if (tag !== 18) {
|
|
14221
|
-
break;
|
|
14222
|
-
}
|
|
14223
|
-
message.link = reader.string();
|
|
14224
|
-
continue;
|
|
14225
|
-
case 3:
|
|
14226
|
-
if (tag !== 26) {
|
|
14227
|
-
break;
|
|
14228
|
-
}
|
|
14229
|
-
message.content = reader.string();
|
|
14230
|
-
continue;
|
|
14231
|
-
case 4:
|
|
14232
|
-
if (tag !== 34) {
|
|
14233
|
-
break;
|
|
14234
|
-
}
|
|
14235
|
-
message.channel_id = reader.string();
|
|
14236
|
-
continue;
|
|
14237
|
-
case 5:
|
|
14238
|
-
if (tag !== 42) {
|
|
14239
|
-
break;
|
|
14240
|
-
}
|
|
14241
|
-
message.sender_id = reader.string();
|
|
14242
|
-
continue;
|
|
14243
|
-
case 6:
|
|
14244
|
-
if (tag !== 50) {
|
|
14245
|
-
break;
|
|
14246
|
-
}
|
|
14247
|
-
message.avatar = reader.string();
|
|
14248
|
-
continue;
|
|
14249
|
-
case 7:
|
|
14250
|
-
if (tag !== 58) {
|
|
14251
|
-
break;
|
|
14252
|
-
}
|
|
14253
|
-
message.clan_id = reader.string();
|
|
14254
|
-
continue;
|
|
14255
|
-
case 8:
|
|
14256
|
-
if (tag !== 66) {
|
|
14257
|
-
break;
|
|
14258
|
-
}
|
|
14259
|
-
message.attachments = reader.bytes();
|
|
14260
|
-
continue;
|
|
14261
|
-
case 9:
|
|
14262
|
-
if (tag !== 74) {
|
|
14263
|
-
break;
|
|
14264
|
-
}
|
|
14265
|
-
message.display_name = reader.string();
|
|
14266
|
-
continue;
|
|
14267
|
-
case 10:
|
|
14268
|
-
if (tag !== 80) {
|
|
14269
|
-
break;
|
|
14270
|
-
}
|
|
14271
|
-
message.create_time_seconds = reader.int32();
|
|
14272
|
-
continue;
|
|
14273
|
-
case 11:
|
|
14274
|
-
if (tag !== 88) {
|
|
14275
|
-
break;
|
|
14276
|
-
}
|
|
14277
|
-
message.update_time_seconds = reader.int32();
|
|
14278
|
-
continue;
|
|
14279
|
-
case 12:
|
|
14280
|
-
if (tag !== 98) {
|
|
14281
|
-
break;
|
|
14282
|
-
}
|
|
14283
|
-
message.username = reader.string();
|
|
14284
|
-
continue;
|
|
14285
|
-
case 13:
|
|
14286
|
-
if (tag !== 106) {
|
|
14287
|
-
break;
|
|
14288
|
-
}
|
|
14289
|
-
message.mentions = reader.bytes();
|
|
14290
|
-
continue;
|
|
14291
|
-
}
|
|
14292
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
14293
|
-
break;
|
|
14294
|
-
}
|
|
14295
|
-
reader.skipType(tag & 7);
|
|
14296
|
-
}
|
|
14297
|
-
return message;
|
|
14298
|
-
},
|
|
14299
|
-
fromJSON(object) {
|
|
14300
|
-
return {
|
|
14301
|
-
title: isSet2(object.title) ? globalThis.String(object.title) : "",
|
|
14302
|
-
link: isSet2(object.link) ? globalThis.String(object.link) : "",
|
|
14303
|
-
content: isSet2(object.content) ? globalThis.String(object.content) : "",
|
|
14304
|
-
channel_id: isSet2(object.channel_id) ? globalThis.String(object.channel_id) : "",
|
|
14305
|
-
sender_id: isSet2(object.sender_id) ? globalThis.String(object.sender_id) : "",
|
|
14306
|
-
avatar: isSet2(object.avatar) ? globalThis.String(object.avatar) : "",
|
|
14307
|
-
clan_id: isSet2(object.clan_id) ? globalThis.String(object.clan_id) : "",
|
|
14308
|
-
attachments: isSet2(object.attachments) ? bytesFromBase64(object.attachments) : new Uint8Array(0),
|
|
14309
|
-
display_name: isSet2(object.display_name) ? globalThis.String(object.display_name) : "",
|
|
14310
|
-
create_time_seconds: isSet2(object.create_time_seconds) ? globalThis.Number(object.create_time_seconds) : 0,
|
|
14311
|
-
update_time_seconds: isSet2(object.update_time_seconds) ? globalThis.Number(object.update_time_seconds) : 0,
|
|
14312
|
-
username: isSet2(object.username) ? globalThis.String(object.username) : "",
|
|
14313
|
-
mentions: isSet2(object.mentions) ? bytesFromBase64(object.mentions) : new Uint8Array(0)
|
|
14314
|
-
};
|
|
14315
|
-
},
|
|
14316
|
-
toJSON(message) {
|
|
14317
|
-
const obj = {};
|
|
14318
|
-
if (message.title !== "") {
|
|
14319
|
-
obj.title = message.title;
|
|
14320
|
-
}
|
|
14321
|
-
if (message.link !== "") {
|
|
14322
|
-
obj.link = message.link;
|
|
14323
|
-
}
|
|
14324
|
-
if (message.content !== "") {
|
|
14325
|
-
obj.content = message.content;
|
|
14326
|
-
}
|
|
14327
|
-
if (message.channel_id !== "") {
|
|
14328
|
-
obj.channel_id = message.channel_id;
|
|
14329
|
-
}
|
|
14330
|
-
if (message.sender_id !== "") {
|
|
14331
|
-
obj.sender_id = message.sender_id;
|
|
14332
|
-
}
|
|
14333
|
-
if (message.avatar !== "") {
|
|
14334
|
-
obj.avatar = message.avatar;
|
|
14335
|
-
}
|
|
14336
|
-
if (message.clan_id !== "") {
|
|
14337
|
-
obj.clan_id = message.clan_id;
|
|
14338
|
-
}
|
|
14339
|
-
if (message.attachments.length !== 0) {
|
|
14340
|
-
obj.attachments = base64FromBytes(message.attachments);
|
|
14341
|
-
}
|
|
14342
|
-
if (message.display_name !== "") {
|
|
14343
|
-
obj.display_name = message.display_name;
|
|
14344
|
-
}
|
|
14345
|
-
if (message.create_time_seconds !== 0) {
|
|
14346
|
-
obj.create_time_seconds = Math.round(message.create_time_seconds);
|
|
14347
|
-
}
|
|
14348
|
-
if (message.update_time_seconds !== 0) {
|
|
14349
|
-
obj.update_time_seconds = Math.round(message.update_time_seconds);
|
|
14350
|
-
}
|
|
14351
|
-
if (message.username !== "") {
|
|
14352
|
-
obj.username = message.username;
|
|
14353
|
-
}
|
|
14354
|
-
if (message.mentions.length !== 0) {
|
|
14355
|
-
obj.mentions = base64FromBytes(message.mentions);
|
|
14356
|
-
}
|
|
14357
|
-
return obj;
|
|
14358
|
-
},
|
|
14359
|
-
create(base) {
|
|
14360
|
-
return DirectFcmProto.fromPartial(base != null ? base : {});
|
|
14361
|
-
},
|
|
14362
|
-
fromPartial(object) {
|
|
14363
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
14364
|
-
const message = createBaseDirectFcmProto();
|
|
14365
|
-
message.title = (_a = object.title) != null ? _a : "";
|
|
14366
|
-
message.link = (_b = object.link) != null ? _b : "";
|
|
14367
|
-
message.content = (_c = object.content) != null ? _c : "";
|
|
14368
|
-
message.channel_id = (_d = object.channel_id) != null ? _d : "";
|
|
14369
|
-
message.sender_id = (_e = object.sender_id) != null ? _e : "";
|
|
14370
|
-
message.avatar = (_f = object.avatar) != null ? _f : "";
|
|
14371
|
-
message.clan_id = (_g = object.clan_id) != null ? _g : "";
|
|
14372
|
-
message.attachments = (_h = object.attachments) != null ? _h : new Uint8Array(0);
|
|
14373
|
-
message.display_name = (_i = object.display_name) != null ? _i : "";
|
|
14374
|
-
message.create_time_seconds = (_j = object.create_time_seconds) != null ? _j : 0;
|
|
14375
|
-
message.update_time_seconds = (_k = object.update_time_seconds) != null ? _k : 0;
|
|
14376
|
-
message.username = (_l = object.username) != null ? _l : "";
|
|
14377
|
-
message.mentions = (_m = object.mentions) != null ? _m : new Uint8Array(0);
|
|
14378
|
-
return message;
|
|
14379
|
-
}
|
|
14380
|
-
};
|
|
14381
14146
|
function createBaseMessageMentionList() {
|
|
14382
14147
|
return { mentions: [] };
|
|
14383
14148
|
}
|
|
@@ -20713,7 +20478,7 @@ function createBaseChannelCreatedEvent() {
|
|
|
20713
20478
|
channel_id: "",
|
|
20714
20479
|
channel_label: "",
|
|
20715
20480
|
channel_private: 0,
|
|
20716
|
-
channel_type:
|
|
20481
|
+
channel_type: 0,
|
|
20717
20482
|
status: 0,
|
|
20718
20483
|
app_id: "",
|
|
20719
20484
|
clan_name: "",
|
|
@@ -20743,8 +20508,8 @@ var ChannelCreatedEvent = {
|
|
|
20743
20508
|
if (message.channel_private !== 0) {
|
|
20744
20509
|
writer.uint32(56).int32(message.channel_private);
|
|
20745
20510
|
}
|
|
20746
|
-
if (message.channel_type !==
|
|
20747
|
-
|
|
20511
|
+
if (message.channel_type !== 0) {
|
|
20512
|
+
writer.uint32(64).int32(message.channel_type);
|
|
20748
20513
|
}
|
|
20749
20514
|
if (message.status !== 0) {
|
|
20750
20515
|
writer.uint32(72).int32(message.status);
|
|
@@ -20810,10 +20575,10 @@ var ChannelCreatedEvent = {
|
|
|
20810
20575
|
message.channel_private = reader.int32();
|
|
20811
20576
|
continue;
|
|
20812
20577
|
case 8:
|
|
20813
|
-
if (tag !==
|
|
20578
|
+
if (tag !== 64) {
|
|
20814
20579
|
break;
|
|
20815
20580
|
}
|
|
20816
|
-
message.channel_type =
|
|
20581
|
+
message.channel_type = reader.int32();
|
|
20817
20582
|
continue;
|
|
20818
20583
|
case 9:
|
|
20819
20584
|
if (tag !== 72) {
|
|
@@ -20856,7 +20621,7 @@ var ChannelCreatedEvent = {
|
|
|
20856
20621
|
channel_id: isSet3(object.channel_id) ? globalThis.String(object.channel_id) : "",
|
|
20857
20622
|
channel_label: isSet3(object.channel_label) ? globalThis.String(object.channel_label) : "",
|
|
20858
20623
|
channel_private: isSet3(object.channel_private) ? globalThis.Number(object.channel_private) : 0,
|
|
20859
|
-
channel_type: isSet3(object.channel_type) ? Number(object.channel_type) :
|
|
20624
|
+
channel_type: isSet3(object.channel_type) ? globalThis.Number(object.channel_type) : 0,
|
|
20860
20625
|
status: isSet3(object.status) ? globalThis.Number(object.status) : 0,
|
|
20861
20626
|
app_id: isSet3(object.app_id) ? globalThis.String(object.app_id) : "",
|
|
20862
20627
|
clan_name: isSet3(object.clan_name) ? globalThis.String(object.clan_name) : "",
|
|
@@ -20886,8 +20651,8 @@ var ChannelCreatedEvent = {
|
|
|
20886
20651
|
if (message.channel_private !== 0) {
|
|
20887
20652
|
obj.channel_private = Math.round(message.channel_private);
|
|
20888
20653
|
}
|
|
20889
|
-
if (message.channel_type !==
|
|
20890
|
-
obj.channel_type = message.channel_type;
|
|
20654
|
+
if (message.channel_type !== 0) {
|
|
20655
|
+
obj.channel_type = Math.round(message.channel_type);
|
|
20891
20656
|
}
|
|
20892
20657
|
if (message.status !== 0) {
|
|
20893
20658
|
obj.status = Math.round(message.status);
|
|
@@ -20916,7 +20681,7 @@ var ChannelCreatedEvent = {
|
|
|
20916
20681
|
message.channel_id = (_e = object.channel_id) != null ? _e : "";
|
|
20917
20682
|
message.channel_label = (_f = object.channel_label) != null ? _f : "";
|
|
20918
20683
|
message.channel_private = (_g = object.channel_private) != null ? _g : 0;
|
|
20919
|
-
message.channel_type = (_h = object.channel_type) != null ? _h :
|
|
20684
|
+
message.channel_type = (_h = object.channel_type) != null ? _h : 0;
|
|
20920
20685
|
message.status = (_i = object.status) != null ? _i : 0;
|
|
20921
20686
|
message.app_id = (_j = object.app_id) != null ? _j : "";
|
|
20922
20687
|
message.clan_name = (_k = object.clan_name) != null ? _k : "";
|
|
@@ -22634,7 +22399,7 @@ function createBaseUserChannelAdded() {
|
|
|
22634
22399
|
status: "",
|
|
22635
22400
|
clan_id: "",
|
|
22636
22401
|
caller: void 0,
|
|
22637
|
-
|
|
22402
|
+
create_time_seconds: 0,
|
|
22638
22403
|
active: 0
|
|
22639
22404
|
};
|
|
22640
22405
|
}
|
|
@@ -22655,8 +22420,8 @@ var UserChannelAdded = {
|
|
|
22655
22420
|
if (message.caller !== void 0) {
|
|
22656
22421
|
UserProfileRedis.encode(message.caller, writer.uint32(42).fork()).ldelim();
|
|
22657
22422
|
}
|
|
22658
|
-
if (message.
|
|
22659
|
-
writer.uint32(48).uint32(message.
|
|
22423
|
+
if (message.create_time_seconds !== 0) {
|
|
22424
|
+
writer.uint32(48).uint32(message.create_time_seconds);
|
|
22660
22425
|
}
|
|
22661
22426
|
if (message.active !== 0) {
|
|
22662
22427
|
writer.uint32(56).int32(message.active);
|
|
@@ -22704,7 +22469,7 @@ var UserChannelAdded = {
|
|
|
22704
22469
|
if (tag !== 48) {
|
|
22705
22470
|
break;
|
|
22706
22471
|
}
|
|
22707
|
-
message.
|
|
22472
|
+
message.create_time_seconds = reader.uint32();
|
|
22708
22473
|
continue;
|
|
22709
22474
|
case 7:
|
|
22710
22475
|
if (tag !== 56) {
|
|
@@ -22727,7 +22492,7 @@ var UserChannelAdded = {
|
|
|
22727
22492
|
status: isSet3(object.status) ? globalThis.String(object.status) : "",
|
|
22728
22493
|
clan_id: isSet3(object.clan_id) ? globalThis.String(object.clan_id) : "",
|
|
22729
22494
|
caller: isSet3(object.caller) ? UserProfileRedis.fromJSON(object.caller) : void 0,
|
|
22730
|
-
|
|
22495
|
+
create_time_seconds: isSet3(object.create_time_seconds) ? globalThis.Number(object.create_time_seconds) : 0,
|
|
22731
22496
|
active: isSet3(object.active) ? globalThis.Number(object.active) : 0
|
|
22732
22497
|
};
|
|
22733
22498
|
},
|
|
@@ -22749,8 +22514,8 @@ var UserChannelAdded = {
|
|
|
22749
22514
|
if (message.caller !== void 0) {
|
|
22750
22515
|
obj.caller = UserProfileRedis.toJSON(message.caller);
|
|
22751
22516
|
}
|
|
22752
|
-
if (message.
|
|
22753
|
-
obj.
|
|
22517
|
+
if (message.create_time_seconds !== 0) {
|
|
22518
|
+
obj.create_time_seconds = Math.round(message.create_time_seconds);
|
|
22754
22519
|
}
|
|
22755
22520
|
if (message.active !== 0) {
|
|
22756
22521
|
obj.active = Math.round(message.active);
|
|
@@ -22768,7 +22533,7 @@ var UserChannelAdded = {
|
|
|
22768
22533
|
message.status = (_b = object.status) != null ? _b : "";
|
|
22769
22534
|
message.clan_id = (_c = object.clan_id) != null ? _c : "";
|
|
22770
22535
|
message.caller = object.caller !== void 0 && object.caller !== null ? UserProfileRedis.fromPartial(object.caller) : void 0;
|
|
22771
|
-
message.
|
|
22536
|
+
message.create_time_seconds = (_d = object.create_time_seconds) != null ? _d : 0;
|
|
22772
22537
|
message.active = (_e = object.active) != null ? _e : 0;
|
|
22773
22538
|
return message;
|
|
22774
22539
|
}
|
|
@@ -26842,26 +26607,26 @@ function decodeRefs(data) {
|
|
|
26842
26607
|
function decodeReactions(data) {
|
|
26843
26608
|
const buffer = data;
|
|
26844
26609
|
const uintBuffer = new Uint8Array(buffer);
|
|
26845
|
-
const
|
|
26846
|
-
return
|
|
26847
|
-
}
|
|
26848
|
-
function decodeChannelMessageHeader(data) {
|
|
26849
|
-
const buffer = data;
|
|
26850
|
-
const uintBuffer = new Uint8Array(buffer);
|
|
26851
|
-
const noti = ChannelMessageHeader.decode(uintBuffer);
|
|
26852
|
-
return noti;
|
|
26610
|
+
const reactions = MessageReactionList.decode(uintBuffer);
|
|
26611
|
+
return reactions;
|
|
26853
26612
|
}
|
|
26854
26613
|
function decodeNotificationFcm(data) {
|
|
26855
26614
|
const buffer = data;
|
|
26856
26615
|
const uintBuffer = new Uint8Array(buffer);
|
|
26857
|
-
const noti =
|
|
26616
|
+
const noti = Notification.decode(uintBuffer);
|
|
26858
26617
|
return noti;
|
|
26859
26618
|
}
|
|
26619
|
+
function decodeNotificationContent(data) {
|
|
26620
|
+
const uint8Array = new Uint8Array(data);
|
|
26621
|
+
const decoder = new TextDecoder("utf-8");
|
|
26622
|
+
const notiContent = decoder.decode(uint8Array);
|
|
26623
|
+
return notiContent;
|
|
26624
|
+
}
|
|
26860
26625
|
export {
|
|
26861
26626
|
WebSocketAdapterPb,
|
|
26862
26627
|
decodeAttachments,
|
|
26863
|
-
decodeChannelMessageHeader,
|
|
26864
26628
|
decodeMentions,
|
|
26629
|
+
decodeNotificationContent,
|
|
26865
26630
|
decodeNotificationFcm,
|
|
26866
26631
|
decodeReactions,
|
|
26867
26632
|
decodeRefs
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mezon-js-protobuf",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.81",
|
|
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 */
|
|
@@ -1400,7 +1398,7 @@ export interface UserChannelAdded {
|
|
|
1400
1398
|
| UserProfileRedis
|
|
1401
1399
|
| undefined;
|
|
1402
1400
|
/** */
|
|
1403
|
-
|
|
1401
|
+
create_time_seconds: number;
|
|
1404
1402
|
/** */
|
|
1405
1403
|
active: number;
|
|
1406
1404
|
}
|
|
@@ -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 ?? "";
|
|
@@ -11451,7 +11449,7 @@ function createBaseUserChannelAdded(): UserChannelAdded {
|
|
|
11451
11449
|
status: "",
|
|
11452
11450
|
clan_id: "",
|
|
11453
11451
|
caller: undefined,
|
|
11454
|
-
|
|
11452
|
+
create_time_seconds: 0,
|
|
11455
11453
|
active: 0,
|
|
11456
11454
|
};
|
|
11457
11455
|
}
|
|
@@ -11473,8 +11471,8 @@ export const UserChannelAdded = {
|
|
|
11473
11471
|
if (message.caller !== undefined) {
|
|
11474
11472
|
UserProfileRedis.encode(message.caller, writer.uint32(42).fork()).ldelim();
|
|
11475
11473
|
}
|
|
11476
|
-
if (message.
|
|
11477
|
-
writer.uint32(48).uint32(message.
|
|
11474
|
+
if (message.create_time_seconds !== 0) {
|
|
11475
|
+
writer.uint32(48).uint32(message.create_time_seconds);
|
|
11478
11476
|
}
|
|
11479
11477
|
if (message.active !== 0) {
|
|
11480
11478
|
writer.uint32(56).int32(message.active);
|
|
@@ -11529,7 +11527,7 @@ export const UserChannelAdded = {
|
|
|
11529
11527
|
break;
|
|
11530
11528
|
}
|
|
11531
11529
|
|
|
11532
|
-
message.
|
|
11530
|
+
message.create_time_seconds = reader.uint32();
|
|
11533
11531
|
continue;
|
|
11534
11532
|
case 7:
|
|
11535
11533
|
if (tag !== 56) {
|
|
@@ -11554,7 +11552,7 @@ export const UserChannelAdded = {
|
|
|
11554
11552
|
status: isSet(object.status) ? globalThis.String(object.status) : "",
|
|
11555
11553
|
clan_id: isSet(object.clan_id) ? globalThis.String(object.clan_id) : "",
|
|
11556
11554
|
caller: isSet(object.caller) ? UserProfileRedis.fromJSON(object.caller) : undefined,
|
|
11557
|
-
|
|
11555
|
+
create_time_seconds: isSet(object.create_time_seconds) ? globalThis.Number(object.create_time_seconds) : 0,
|
|
11558
11556
|
active: isSet(object.active) ? globalThis.Number(object.active) : 0,
|
|
11559
11557
|
};
|
|
11560
11558
|
},
|
|
@@ -11576,8 +11574,8 @@ export const UserChannelAdded = {
|
|
|
11576
11574
|
if (message.caller !== undefined) {
|
|
11577
11575
|
obj.caller = UserProfileRedis.toJSON(message.caller);
|
|
11578
11576
|
}
|
|
11579
|
-
if (message.
|
|
11580
|
-
obj.
|
|
11577
|
+
if (message.create_time_seconds !== 0) {
|
|
11578
|
+
obj.create_time_seconds = Math.round(message.create_time_seconds);
|
|
11581
11579
|
}
|
|
11582
11580
|
if (message.active !== 0) {
|
|
11583
11581
|
obj.active = Math.round(message.active);
|
|
@@ -11599,7 +11597,7 @@ export const UserChannelAdded = {
|
|
|
11599
11597
|
message.caller = (object.caller !== undefined && object.caller !== null)
|
|
11600
11598
|
? UserProfileRedis.fromPartial(object.caller)
|
|
11601
11599
|
: undefined;
|
|
11602
|
-
message.
|
|
11600
|
+
message.create_time_seconds = object.create_time_seconds ?? 0;
|
|
11603
11601
|
message.active = object.active ?? 0;
|
|
11604
11602
|
return message;
|
|
11605
11603
|
},
|
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
|
}
|