mezon-js-protobuf 1.8.72 → 1.8.74
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 +236 -69
- package/dist/mezon-js-protobuf/api/api.d.ts +170 -10
- package/dist/mezon-js-protobuf/rtapi/realtime.d.ts +371 -323
- package/dist/mezon-js-protobuf.cjs.js +130 -47
- package/dist/mezon-js-protobuf.esm.mjs +130 -47
- package/package.json +1 -1
- package/rtapi/realtime.ts +127 -25
package/rtapi/realtime.ts
CHANGED
|
@@ -452,7 +452,16 @@ export interface Envelope {
|
|
|
452
452
|
| ActiveArchivedThread
|
|
453
453
|
| undefined;
|
|
454
454
|
/** Config Allow Anonymous */
|
|
455
|
-
allow_anonymous_event?:
|
|
455
|
+
allow_anonymous_event?:
|
|
456
|
+
| AllowAnonymousEvent
|
|
457
|
+
| undefined;
|
|
458
|
+
/** Message sending to another server for update localcache */
|
|
459
|
+
update_localcache_event?: UpdateLocalCacheEvent | undefined;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
export interface UpdateLocalCacheEvent {
|
|
463
|
+
user_ids: string[];
|
|
464
|
+
channel_ids: string[];
|
|
456
465
|
}
|
|
457
466
|
|
|
458
467
|
export interface FollowEvent {
|
|
@@ -657,9 +666,7 @@ export interface ChannelMessageAck {
|
|
|
657
666
|
/** The unique ID assigned to the message. */
|
|
658
667
|
message_id: string;
|
|
659
668
|
/** The code representing a message type or category. */
|
|
660
|
-
code:
|
|
661
|
-
| number
|
|
662
|
-
| undefined;
|
|
669
|
+
code: number;
|
|
663
670
|
/** Username of the message sender. */
|
|
664
671
|
username: string;
|
|
665
672
|
/** The UNIX time (for gRPC clients) or ISO string (for REST clients) when the message was created. */
|
|
@@ -1264,9 +1271,7 @@ export interface ChannelUpdatedEvent {
|
|
|
1264
1271
|
/** channel label */
|
|
1265
1272
|
channel_label: string;
|
|
1266
1273
|
/** channel type */
|
|
1267
|
-
channel_type:
|
|
1268
|
-
| number
|
|
1269
|
-
| undefined;
|
|
1274
|
+
channel_type: number;
|
|
1270
1275
|
/** status */
|
|
1271
1276
|
status: number;
|
|
1272
1277
|
/** meeting code */
|
|
@@ -1874,6 +1879,7 @@ function createBaseEnvelope(): Envelope {
|
|
|
1874
1879
|
ban_user_event: undefined,
|
|
1875
1880
|
active_archived_thread: undefined,
|
|
1876
1881
|
allow_anonymous_event: undefined,
|
|
1882
|
+
update_localcache_event: undefined,
|
|
1877
1883
|
};
|
|
1878
1884
|
}
|
|
1879
1885
|
|
|
@@ -2153,6 +2159,9 @@ export const Envelope = {
|
|
|
2153
2159
|
if (message.allow_anonymous_event !== undefined) {
|
|
2154
2160
|
AllowAnonymousEvent.encode(message.allow_anonymous_event, writer.uint32(730).fork()).ldelim();
|
|
2155
2161
|
}
|
|
2162
|
+
if (message.update_localcache_event !== undefined) {
|
|
2163
|
+
UpdateLocalCacheEvent.encode(message.update_localcache_event, writer.uint32(738).fork()).ldelim();
|
|
2164
|
+
}
|
|
2156
2165
|
return writer;
|
|
2157
2166
|
},
|
|
2158
2167
|
|
|
@@ -2800,6 +2809,13 @@ export const Envelope = {
|
|
|
2800
2809
|
|
|
2801
2810
|
message.allow_anonymous_event = AllowAnonymousEvent.decode(reader, reader.uint32());
|
|
2802
2811
|
continue;
|
|
2812
|
+
case 92:
|
|
2813
|
+
if (tag !== 738) {
|
|
2814
|
+
break;
|
|
2815
|
+
}
|
|
2816
|
+
|
|
2817
|
+
message.update_localcache_event = UpdateLocalCacheEvent.decode(reader, reader.uint32());
|
|
2818
|
+
continue;
|
|
2803
2819
|
}
|
|
2804
2820
|
if ((tag & 7) === 4 || tag === 0) {
|
|
2805
2821
|
break;
|
|
@@ -3018,6 +3034,9 @@ export const Envelope = {
|
|
|
3018
3034
|
allow_anonymous_event: isSet(object.allow_anonymous_event)
|
|
3019
3035
|
? AllowAnonymousEvent.fromJSON(object.allow_anonymous_event)
|
|
3020
3036
|
: undefined,
|
|
3037
|
+
update_localcache_event: isSet(object.update_localcache_event)
|
|
3038
|
+
? UpdateLocalCacheEvent.fromJSON(object.update_localcache_event)
|
|
3039
|
+
: undefined,
|
|
3021
3040
|
};
|
|
3022
3041
|
},
|
|
3023
3042
|
|
|
@@ -3298,6 +3317,9 @@ export const Envelope = {
|
|
|
3298
3317
|
if (message.allow_anonymous_event !== undefined) {
|
|
3299
3318
|
obj.allow_anonymous_event = AllowAnonymousEvent.toJSON(message.allow_anonymous_event);
|
|
3300
3319
|
}
|
|
3320
|
+
if (message.update_localcache_event !== undefined) {
|
|
3321
|
+
obj.update_localcache_event = UpdateLocalCacheEvent.toJSON(message.update_localcache_event);
|
|
3322
|
+
}
|
|
3301
3323
|
return obj;
|
|
3302
3324
|
},
|
|
3303
3325
|
|
|
@@ -3600,6 +3622,86 @@ export const Envelope = {
|
|
|
3600
3622
|
(object.allow_anonymous_event !== undefined && object.allow_anonymous_event !== null)
|
|
3601
3623
|
? AllowAnonymousEvent.fromPartial(object.allow_anonymous_event)
|
|
3602
3624
|
: undefined;
|
|
3625
|
+
message.update_localcache_event =
|
|
3626
|
+
(object.update_localcache_event !== undefined && object.update_localcache_event !== null)
|
|
3627
|
+
? UpdateLocalCacheEvent.fromPartial(object.update_localcache_event)
|
|
3628
|
+
: undefined;
|
|
3629
|
+
return message;
|
|
3630
|
+
},
|
|
3631
|
+
};
|
|
3632
|
+
|
|
3633
|
+
function createBaseUpdateLocalCacheEvent(): UpdateLocalCacheEvent {
|
|
3634
|
+
return { user_ids: [], channel_ids: [] };
|
|
3635
|
+
}
|
|
3636
|
+
|
|
3637
|
+
export const UpdateLocalCacheEvent = {
|
|
3638
|
+
encode(message: UpdateLocalCacheEvent, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
3639
|
+
for (const v of message.user_ids) {
|
|
3640
|
+
writer.uint32(10).string(v!);
|
|
3641
|
+
}
|
|
3642
|
+
for (const v of message.channel_ids) {
|
|
3643
|
+
writer.uint32(18).string(v!);
|
|
3644
|
+
}
|
|
3645
|
+
return writer;
|
|
3646
|
+
},
|
|
3647
|
+
|
|
3648
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): UpdateLocalCacheEvent {
|
|
3649
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
3650
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
3651
|
+
const message = createBaseUpdateLocalCacheEvent();
|
|
3652
|
+
while (reader.pos < end) {
|
|
3653
|
+
const tag = reader.uint32();
|
|
3654
|
+
switch (tag >>> 3) {
|
|
3655
|
+
case 1:
|
|
3656
|
+
if (tag !== 10) {
|
|
3657
|
+
break;
|
|
3658
|
+
}
|
|
3659
|
+
|
|
3660
|
+
message.user_ids.push(reader.string());
|
|
3661
|
+
continue;
|
|
3662
|
+
case 2:
|
|
3663
|
+
if (tag !== 18) {
|
|
3664
|
+
break;
|
|
3665
|
+
}
|
|
3666
|
+
|
|
3667
|
+
message.channel_ids.push(reader.string());
|
|
3668
|
+
continue;
|
|
3669
|
+
}
|
|
3670
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
3671
|
+
break;
|
|
3672
|
+
}
|
|
3673
|
+
reader.skipType(tag & 7);
|
|
3674
|
+
}
|
|
3675
|
+
return message;
|
|
3676
|
+
},
|
|
3677
|
+
|
|
3678
|
+
fromJSON(object: any): UpdateLocalCacheEvent {
|
|
3679
|
+
return {
|
|
3680
|
+
user_ids: globalThis.Array.isArray(object?.user_ids) ? object.user_ids.map((e: any) => globalThis.String(e)) : [],
|
|
3681
|
+
channel_ids: globalThis.Array.isArray(object?.channel_ids)
|
|
3682
|
+
? object.channel_ids.map((e: any) => globalThis.String(e))
|
|
3683
|
+
: [],
|
|
3684
|
+
};
|
|
3685
|
+
},
|
|
3686
|
+
|
|
3687
|
+
toJSON(message: UpdateLocalCacheEvent): unknown {
|
|
3688
|
+
const obj: any = {};
|
|
3689
|
+
if (message.user_ids?.length) {
|
|
3690
|
+
obj.user_ids = message.user_ids;
|
|
3691
|
+
}
|
|
3692
|
+
if (message.channel_ids?.length) {
|
|
3693
|
+
obj.channel_ids = message.channel_ids;
|
|
3694
|
+
}
|
|
3695
|
+
return obj;
|
|
3696
|
+
},
|
|
3697
|
+
|
|
3698
|
+
create<I extends Exact<DeepPartial<UpdateLocalCacheEvent>, I>>(base?: I): UpdateLocalCacheEvent {
|
|
3699
|
+
return UpdateLocalCacheEvent.fromPartial(base ?? ({} as any));
|
|
3700
|
+
},
|
|
3701
|
+
fromPartial<I extends Exact<DeepPartial<UpdateLocalCacheEvent>, I>>(object: I): UpdateLocalCacheEvent {
|
|
3702
|
+
const message = createBaseUpdateLocalCacheEvent();
|
|
3703
|
+
message.user_ids = object.user_ids?.map((e) => e) || [];
|
|
3704
|
+
message.channel_ids = object.channel_ids?.map((e) => e) || [];
|
|
3603
3705
|
return message;
|
|
3604
3706
|
},
|
|
3605
3707
|
};
|
|
@@ -5506,7 +5608,7 @@ function createBaseChannelMessageAck(): ChannelMessageAck {
|
|
|
5506
5608
|
return {
|
|
5507
5609
|
channel_id: "",
|
|
5508
5610
|
message_id: "",
|
|
5509
|
-
code:
|
|
5611
|
+
code: 0,
|
|
5510
5612
|
username: "",
|
|
5511
5613
|
create_time: undefined,
|
|
5512
5614
|
update_time: undefined,
|
|
@@ -5524,8 +5626,8 @@ export const ChannelMessageAck = {
|
|
|
5524
5626
|
if (message.message_id !== "") {
|
|
5525
5627
|
writer.uint32(18).string(message.message_id);
|
|
5526
5628
|
}
|
|
5527
|
-
if (message.code !==
|
|
5528
|
-
|
|
5629
|
+
if (message.code !== 0) {
|
|
5630
|
+
writer.uint32(24).int32(message.code);
|
|
5529
5631
|
}
|
|
5530
5632
|
if (message.username !== "") {
|
|
5531
5633
|
writer.uint32(34).string(message.username);
|
|
@@ -5570,11 +5672,11 @@ export const ChannelMessageAck = {
|
|
|
5570
5672
|
message.message_id = reader.string();
|
|
5571
5673
|
continue;
|
|
5572
5674
|
case 3:
|
|
5573
|
-
if (tag !==
|
|
5675
|
+
if (tag !== 24) {
|
|
5574
5676
|
break;
|
|
5575
5677
|
}
|
|
5576
5678
|
|
|
5577
|
-
message.code =
|
|
5679
|
+
message.code = reader.int32();
|
|
5578
5680
|
continue;
|
|
5579
5681
|
case 4:
|
|
5580
5682
|
if (tag !== 34) {
|
|
@@ -5631,7 +5733,7 @@ export const ChannelMessageAck = {
|
|
|
5631
5733
|
return {
|
|
5632
5734
|
channel_id: isSet(object.channel_id) ? globalThis.String(object.channel_id) : "",
|
|
5633
5735
|
message_id: isSet(object.message_id) ? globalThis.String(object.message_id) : "",
|
|
5634
|
-
code: isSet(object.code) ? Number(object.code) :
|
|
5736
|
+
code: isSet(object.code) ? globalThis.Number(object.code) : 0,
|
|
5635
5737
|
username: isSet(object.username) ? globalThis.String(object.username) : "",
|
|
5636
5738
|
create_time: isSet(object.create_time) ? fromJsonTimestamp(object.create_time) : undefined,
|
|
5637
5739
|
update_time: isSet(object.update_time) ? fromJsonTimestamp(object.update_time) : undefined,
|
|
@@ -5649,8 +5751,8 @@ export const ChannelMessageAck = {
|
|
|
5649
5751
|
if (message.message_id !== "") {
|
|
5650
5752
|
obj.message_id = message.message_id;
|
|
5651
5753
|
}
|
|
5652
|
-
if (message.code !==
|
|
5653
|
-
obj.code = message.code;
|
|
5754
|
+
if (message.code !== 0) {
|
|
5755
|
+
obj.code = Math.round(message.code);
|
|
5654
5756
|
}
|
|
5655
5757
|
if (message.username !== "") {
|
|
5656
5758
|
obj.username = message.username;
|
|
@@ -5680,7 +5782,7 @@ export const ChannelMessageAck = {
|
|
|
5680
5782
|
const message = createBaseChannelMessageAck();
|
|
5681
5783
|
message.channel_id = object.channel_id ?? "";
|
|
5682
5784
|
message.message_id = object.message_id ?? "";
|
|
5683
|
-
message.code = object.code ??
|
|
5785
|
+
message.code = object.code ?? 0;
|
|
5684
5786
|
message.username = object.username ?? "";
|
|
5685
5787
|
message.create_time = object.create_time ?? undefined;
|
|
5686
5788
|
message.update_time = object.update_time ?? undefined;
|
|
@@ -10299,7 +10401,7 @@ function createBaseChannelUpdatedEvent(): ChannelUpdatedEvent {
|
|
|
10299
10401
|
parent_id: "",
|
|
10300
10402
|
channel_id: "",
|
|
10301
10403
|
channel_label: "",
|
|
10302
|
-
channel_type:
|
|
10404
|
+
channel_type: 0,
|
|
10303
10405
|
status: 0,
|
|
10304
10406
|
meeting_code: "",
|
|
10305
10407
|
is_error: false,
|
|
@@ -10336,8 +10438,8 @@ export const ChannelUpdatedEvent = {
|
|
|
10336
10438
|
if (message.channel_label !== "") {
|
|
10337
10439
|
writer.uint32(50).string(message.channel_label);
|
|
10338
10440
|
}
|
|
10339
|
-
if (message.channel_type !==
|
|
10340
|
-
|
|
10441
|
+
if (message.channel_type !== 0) {
|
|
10442
|
+
writer.uint32(56).int32(message.channel_type);
|
|
10341
10443
|
}
|
|
10342
10444
|
if (message.status !== 0) {
|
|
10343
10445
|
writer.uint32(64).int32(message.status);
|
|
@@ -10431,11 +10533,11 @@ export const ChannelUpdatedEvent = {
|
|
|
10431
10533
|
message.channel_label = reader.string();
|
|
10432
10534
|
continue;
|
|
10433
10535
|
case 7:
|
|
10434
|
-
if (tag !==
|
|
10536
|
+
if (tag !== 56) {
|
|
10435
10537
|
break;
|
|
10436
10538
|
}
|
|
10437
10539
|
|
|
10438
|
-
message.channel_type =
|
|
10540
|
+
message.channel_type = reader.int32();
|
|
10439
10541
|
continue;
|
|
10440
10542
|
case 8:
|
|
10441
10543
|
if (tag !== 64) {
|
|
@@ -10545,7 +10647,7 @@ export const ChannelUpdatedEvent = {
|
|
|
10545
10647
|
parent_id: isSet(object.parent_id) ? globalThis.String(object.parent_id) : "",
|
|
10546
10648
|
channel_id: isSet(object.channel_id) ? globalThis.String(object.channel_id) : "",
|
|
10547
10649
|
channel_label: isSet(object.channel_label) ? globalThis.String(object.channel_label) : "",
|
|
10548
|
-
channel_type: isSet(object.channel_type) ? Number(object.channel_type) :
|
|
10650
|
+
channel_type: isSet(object.channel_type) ? globalThis.Number(object.channel_type) : 0,
|
|
10549
10651
|
status: isSet(object.status) ? globalThis.Number(object.status) : 0,
|
|
10550
10652
|
meeting_code: isSet(object.meeting_code) ? globalThis.String(object.meeting_code) : "",
|
|
10551
10653
|
is_error: isSet(object.is_error) ? globalThis.Boolean(object.is_error) : false,
|
|
@@ -10582,8 +10684,8 @@ export const ChannelUpdatedEvent = {
|
|
|
10582
10684
|
if (message.channel_label !== "") {
|
|
10583
10685
|
obj.channel_label = message.channel_label;
|
|
10584
10686
|
}
|
|
10585
|
-
if (message.channel_type !==
|
|
10586
|
-
obj.channel_type = message.channel_type;
|
|
10687
|
+
if (message.channel_type !== 0) {
|
|
10688
|
+
obj.channel_type = Math.round(message.channel_type);
|
|
10587
10689
|
}
|
|
10588
10690
|
if (message.status !== 0) {
|
|
10589
10691
|
obj.status = Math.round(message.status);
|
|
@@ -10638,7 +10740,7 @@ export const ChannelUpdatedEvent = {
|
|
|
10638
10740
|
message.parent_id = object.parent_id ?? "";
|
|
10639
10741
|
message.channel_id = object.channel_id ?? "";
|
|
10640
10742
|
message.channel_label = object.channel_label ?? "";
|
|
10641
|
-
message.channel_type = object.channel_type ??
|
|
10743
|
+
message.channel_type = object.channel_type ?? 0;
|
|
10642
10744
|
message.status = object.status ?? 0;
|
|
10643
10745
|
message.meeting_code = object.meeting_code ?? "";
|
|
10644
10746
|
message.is_error = object.is_error ?? false;
|