mezon-js-protobuf 1.8.5 → 1.8.7
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 +59 -40
- package/dist/mezon-js-protobuf/api/api.d.ts +36 -20
- package/dist/mezon-js-protobuf/rtapi/realtime.d.ts +286 -162
- package/dist/mezon-js-protobuf.cjs.js +195 -2
- package/dist/mezon-js-protobuf.esm.mjs +195 -2
- package/package.json +1 -1
- package/rtapi/realtime.ts +243 -1
package/rtapi/realtime.ts
CHANGED
|
@@ -345,7 +345,15 @@ export interface Envelope {
|
|
|
345
345
|
| EphemeralMessageSend
|
|
346
346
|
| undefined;
|
|
347
347
|
/** block friend */
|
|
348
|
-
block_friend?:
|
|
348
|
+
block_friend?:
|
|
349
|
+
| BlockFriend
|
|
350
|
+
| undefined;
|
|
351
|
+
/** voice reaction message */
|
|
352
|
+
voice_reaction_send?:
|
|
353
|
+
| VoiceReactionSend
|
|
354
|
+
| undefined;
|
|
355
|
+
/** Mark As Read */
|
|
356
|
+
mark_as_read?: MarkAsRead | undefined;
|
|
349
357
|
}
|
|
350
358
|
|
|
351
359
|
export interface FollowEvent {
|
|
@@ -569,6 +577,24 @@ export interface EphemeralMessageSend {
|
|
|
569
577
|
receiver_id: string;
|
|
570
578
|
}
|
|
571
579
|
|
|
580
|
+
export interface VoiceReactionSend {
|
|
581
|
+
/** list emoji */
|
|
582
|
+
emojis: string[];
|
|
583
|
+
/** channel_id */
|
|
584
|
+
channel_id: string;
|
|
585
|
+
/** sender id */
|
|
586
|
+
sender_id: string;
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
export interface MarkAsRead {
|
|
590
|
+
/** channel id */
|
|
591
|
+
channel_id: string;
|
|
592
|
+
/** category_id */
|
|
593
|
+
category_id: string;
|
|
594
|
+
/** clan id */
|
|
595
|
+
clan_id: string;
|
|
596
|
+
}
|
|
597
|
+
|
|
572
598
|
/** Send a message to a realtime channel. */
|
|
573
599
|
export interface ChannelMessageSend {
|
|
574
600
|
/** The clan that channel belong to. */
|
|
@@ -1544,6 +1570,8 @@ function createBaseEnvelope(): Envelope {
|
|
|
1544
1570
|
delete_account_event: undefined,
|
|
1545
1571
|
ephemeral_message_send: undefined,
|
|
1546
1572
|
block_friend: undefined,
|
|
1573
|
+
voice_reaction_send: undefined,
|
|
1574
|
+
mark_as_read: undefined,
|
|
1547
1575
|
};
|
|
1548
1576
|
}
|
|
1549
1577
|
|
|
@@ -1790,6 +1818,12 @@ export const Envelope = {
|
|
|
1790
1818
|
if (message.block_friend !== undefined) {
|
|
1791
1819
|
BlockFriend.encode(message.block_friend, writer.uint32(642).fork()).ldelim();
|
|
1792
1820
|
}
|
|
1821
|
+
if (message.voice_reaction_send !== undefined) {
|
|
1822
|
+
VoiceReactionSend.encode(message.voice_reaction_send, writer.uint32(650).fork()).ldelim();
|
|
1823
|
+
}
|
|
1824
|
+
if (message.mark_as_read !== undefined) {
|
|
1825
|
+
MarkAsRead.encode(message.mark_as_read, writer.uint32(658).fork()).ldelim();
|
|
1826
|
+
}
|
|
1793
1827
|
return writer;
|
|
1794
1828
|
},
|
|
1795
1829
|
|
|
@@ -2360,6 +2394,20 @@ export const Envelope = {
|
|
|
2360
2394
|
|
|
2361
2395
|
message.block_friend = BlockFriend.decode(reader, reader.uint32());
|
|
2362
2396
|
continue;
|
|
2397
|
+
case 81:
|
|
2398
|
+
if (tag !== 650) {
|
|
2399
|
+
break;
|
|
2400
|
+
}
|
|
2401
|
+
|
|
2402
|
+
message.voice_reaction_send = VoiceReactionSend.decode(reader, reader.uint32());
|
|
2403
|
+
continue;
|
|
2404
|
+
case 82:
|
|
2405
|
+
if (tag !== 658) {
|
|
2406
|
+
break;
|
|
2407
|
+
}
|
|
2408
|
+
|
|
2409
|
+
message.mark_as_read = MarkAsRead.decode(reader, reader.uint32());
|
|
2410
|
+
continue;
|
|
2363
2411
|
}
|
|
2364
2412
|
if ((tag & 7) === 4 || tag === 0) {
|
|
2365
2413
|
break;
|
|
@@ -2555,6 +2603,10 @@ export const Envelope = {
|
|
|
2555
2603
|
? EphemeralMessageSend.fromJSON(object.ephemeral_message_send)
|
|
2556
2604
|
: undefined,
|
|
2557
2605
|
block_friend: isSet(object.block_friend) ? BlockFriend.fromJSON(object.block_friend) : undefined,
|
|
2606
|
+
voice_reaction_send: isSet(object.voice_reaction_send)
|
|
2607
|
+
? VoiceReactionSend.fromJSON(object.voice_reaction_send)
|
|
2608
|
+
: undefined,
|
|
2609
|
+
mark_as_read: isSet(object.mark_as_read) ? MarkAsRead.fromJSON(object.mark_as_read) : undefined,
|
|
2558
2610
|
};
|
|
2559
2611
|
},
|
|
2560
2612
|
|
|
@@ -2802,6 +2854,12 @@ export const Envelope = {
|
|
|
2802
2854
|
if (message.block_friend !== undefined) {
|
|
2803
2855
|
obj.block_friend = BlockFriend.toJSON(message.block_friend);
|
|
2804
2856
|
}
|
|
2857
|
+
if (message.voice_reaction_send !== undefined) {
|
|
2858
|
+
obj.voice_reaction_send = VoiceReactionSend.toJSON(message.voice_reaction_send);
|
|
2859
|
+
}
|
|
2860
|
+
if (message.mark_as_read !== undefined) {
|
|
2861
|
+
obj.mark_as_read = MarkAsRead.toJSON(message.mark_as_read);
|
|
2862
|
+
}
|
|
2805
2863
|
return obj;
|
|
2806
2864
|
},
|
|
2807
2865
|
|
|
@@ -3067,6 +3125,12 @@ export const Envelope = {
|
|
|
3067
3125
|
message.block_friend = (object.block_friend !== undefined && object.block_friend !== null)
|
|
3068
3126
|
? BlockFriend.fromPartial(object.block_friend)
|
|
3069
3127
|
: undefined;
|
|
3128
|
+
message.voice_reaction_send = (object.voice_reaction_send !== undefined && object.voice_reaction_send !== null)
|
|
3129
|
+
? VoiceReactionSend.fromPartial(object.voice_reaction_send)
|
|
3130
|
+
: undefined;
|
|
3131
|
+
message.mark_as_read = (object.mark_as_read !== undefined && object.mark_as_read !== null)
|
|
3132
|
+
? MarkAsRead.fromPartial(object.mark_as_read)
|
|
3133
|
+
: undefined;
|
|
3070
3134
|
return message;
|
|
3071
3135
|
},
|
|
3072
3136
|
};
|
|
@@ -5100,6 +5164,184 @@ export const EphemeralMessageSend = {
|
|
|
5100
5164
|
},
|
|
5101
5165
|
};
|
|
5102
5166
|
|
|
5167
|
+
function createBaseVoiceReactionSend(): VoiceReactionSend {
|
|
5168
|
+
return { emojis: [], channel_id: "", sender_id: "" };
|
|
5169
|
+
}
|
|
5170
|
+
|
|
5171
|
+
export const VoiceReactionSend = {
|
|
5172
|
+
encode(message: VoiceReactionSend, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
5173
|
+
for (const v of message.emojis) {
|
|
5174
|
+
writer.uint32(10).string(v!);
|
|
5175
|
+
}
|
|
5176
|
+
if (message.channel_id !== "") {
|
|
5177
|
+
writer.uint32(18).string(message.channel_id);
|
|
5178
|
+
}
|
|
5179
|
+
if (message.sender_id !== "") {
|
|
5180
|
+
writer.uint32(26).string(message.sender_id);
|
|
5181
|
+
}
|
|
5182
|
+
return writer;
|
|
5183
|
+
},
|
|
5184
|
+
|
|
5185
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): VoiceReactionSend {
|
|
5186
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
5187
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
5188
|
+
const message = createBaseVoiceReactionSend();
|
|
5189
|
+
while (reader.pos < end) {
|
|
5190
|
+
const tag = reader.uint32();
|
|
5191
|
+
switch (tag >>> 3) {
|
|
5192
|
+
case 1:
|
|
5193
|
+
if (tag !== 10) {
|
|
5194
|
+
break;
|
|
5195
|
+
}
|
|
5196
|
+
|
|
5197
|
+
message.emojis.push(reader.string());
|
|
5198
|
+
continue;
|
|
5199
|
+
case 2:
|
|
5200
|
+
if (tag !== 18) {
|
|
5201
|
+
break;
|
|
5202
|
+
}
|
|
5203
|
+
|
|
5204
|
+
message.channel_id = reader.string();
|
|
5205
|
+
continue;
|
|
5206
|
+
case 3:
|
|
5207
|
+
if (tag !== 26) {
|
|
5208
|
+
break;
|
|
5209
|
+
}
|
|
5210
|
+
|
|
5211
|
+
message.sender_id = reader.string();
|
|
5212
|
+
continue;
|
|
5213
|
+
}
|
|
5214
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
5215
|
+
break;
|
|
5216
|
+
}
|
|
5217
|
+
reader.skipType(tag & 7);
|
|
5218
|
+
}
|
|
5219
|
+
return message;
|
|
5220
|
+
},
|
|
5221
|
+
|
|
5222
|
+
fromJSON(object: any): VoiceReactionSend {
|
|
5223
|
+
return {
|
|
5224
|
+
emojis: globalThis.Array.isArray(object?.emojis) ? object.emojis.map((e: any) => globalThis.String(e)) : [],
|
|
5225
|
+
channel_id: isSet(object.channel_id) ? globalThis.String(object.channel_id) : "",
|
|
5226
|
+
sender_id: isSet(object.sender_id) ? globalThis.String(object.sender_id) : "",
|
|
5227
|
+
};
|
|
5228
|
+
},
|
|
5229
|
+
|
|
5230
|
+
toJSON(message: VoiceReactionSend): unknown {
|
|
5231
|
+
const obj: any = {};
|
|
5232
|
+
if (message.emojis?.length) {
|
|
5233
|
+
obj.emojis = message.emojis;
|
|
5234
|
+
}
|
|
5235
|
+
if (message.channel_id !== "") {
|
|
5236
|
+
obj.channel_id = message.channel_id;
|
|
5237
|
+
}
|
|
5238
|
+
if (message.sender_id !== "") {
|
|
5239
|
+
obj.sender_id = message.sender_id;
|
|
5240
|
+
}
|
|
5241
|
+
return obj;
|
|
5242
|
+
},
|
|
5243
|
+
|
|
5244
|
+
create<I extends Exact<DeepPartial<VoiceReactionSend>, I>>(base?: I): VoiceReactionSend {
|
|
5245
|
+
return VoiceReactionSend.fromPartial(base ?? ({} as any));
|
|
5246
|
+
},
|
|
5247
|
+
fromPartial<I extends Exact<DeepPartial<VoiceReactionSend>, I>>(object: I): VoiceReactionSend {
|
|
5248
|
+
const message = createBaseVoiceReactionSend();
|
|
5249
|
+
message.emojis = object.emojis?.map((e) => e) || [];
|
|
5250
|
+
message.channel_id = object.channel_id ?? "";
|
|
5251
|
+
message.sender_id = object.sender_id ?? "";
|
|
5252
|
+
return message;
|
|
5253
|
+
},
|
|
5254
|
+
};
|
|
5255
|
+
|
|
5256
|
+
function createBaseMarkAsRead(): MarkAsRead {
|
|
5257
|
+
return { channel_id: "", category_id: "", clan_id: "" };
|
|
5258
|
+
}
|
|
5259
|
+
|
|
5260
|
+
export const MarkAsRead = {
|
|
5261
|
+
encode(message: MarkAsRead, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
5262
|
+
if (message.channel_id !== "") {
|
|
5263
|
+
writer.uint32(10).string(message.channel_id);
|
|
5264
|
+
}
|
|
5265
|
+
if (message.category_id !== "") {
|
|
5266
|
+
writer.uint32(18).string(message.category_id);
|
|
5267
|
+
}
|
|
5268
|
+
if (message.clan_id !== "") {
|
|
5269
|
+
writer.uint32(26).string(message.clan_id);
|
|
5270
|
+
}
|
|
5271
|
+
return writer;
|
|
5272
|
+
},
|
|
5273
|
+
|
|
5274
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): MarkAsRead {
|
|
5275
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
5276
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
5277
|
+
const message = createBaseMarkAsRead();
|
|
5278
|
+
while (reader.pos < end) {
|
|
5279
|
+
const tag = reader.uint32();
|
|
5280
|
+
switch (tag >>> 3) {
|
|
5281
|
+
case 1:
|
|
5282
|
+
if (tag !== 10) {
|
|
5283
|
+
break;
|
|
5284
|
+
}
|
|
5285
|
+
|
|
5286
|
+
message.channel_id = reader.string();
|
|
5287
|
+
continue;
|
|
5288
|
+
case 2:
|
|
5289
|
+
if (tag !== 18) {
|
|
5290
|
+
break;
|
|
5291
|
+
}
|
|
5292
|
+
|
|
5293
|
+
message.category_id = reader.string();
|
|
5294
|
+
continue;
|
|
5295
|
+
case 3:
|
|
5296
|
+
if (tag !== 26) {
|
|
5297
|
+
break;
|
|
5298
|
+
}
|
|
5299
|
+
|
|
5300
|
+
message.clan_id = reader.string();
|
|
5301
|
+
continue;
|
|
5302
|
+
}
|
|
5303
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
5304
|
+
break;
|
|
5305
|
+
}
|
|
5306
|
+
reader.skipType(tag & 7);
|
|
5307
|
+
}
|
|
5308
|
+
return message;
|
|
5309
|
+
},
|
|
5310
|
+
|
|
5311
|
+
fromJSON(object: any): MarkAsRead {
|
|
5312
|
+
return {
|
|
5313
|
+
channel_id: isSet(object.channel_id) ? globalThis.String(object.channel_id) : "",
|
|
5314
|
+
category_id: isSet(object.category_id) ? globalThis.String(object.category_id) : "",
|
|
5315
|
+
clan_id: isSet(object.clan_id) ? globalThis.String(object.clan_id) : "",
|
|
5316
|
+
};
|
|
5317
|
+
},
|
|
5318
|
+
|
|
5319
|
+
toJSON(message: MarkAsRead): unknown {
|
|
5320
|
+
const obj: any = {};
|
|
5321
|
+
if (message.channel_id !== "") {
|
|
5322
|
+
obj.channel_id = message.channel_id;
|
|
5323
|
+
}
|
|
5324
|
+
if (message.category_id !== "") {
|
|
5325
|
+
obj.category_id = message.category_id;
|
|
5326
|
+
}
|
|
5327
|
+
if (message.clan_id !== "") {
|
|
5328
|
+
obj.clan_id = message.clan_id;
|
|
5329
|
+
}
|
|
5330
|
+
return obj;
|
|
5331
|
+
},
|
|
5332
|
+
|
|
5333
|
+
create<I extends Exact<DeepPartial<MarkAsRead>, I>>(base?: I): MarkAsRead {
|
|
5334
|
+
return MarkAsRead.fromPartial(base ?? ({} as any));
|
|
5335
|
+
},
|
|
5336
|
+
fromPartial<I extends Exact<DeepPartial<MarkAsRead>, I>>(object: I): MarkAsRead {
|
|
5337
|
+
const message = createBaseMarkAsRead();
|
|
5338
|
+
message.channel_id = object.channel_id ?? "";
|
|
5339
|
+
message.category_id = object.category_id ?? "";
|
|
5340
|
+
message.clan_id = object.clan_id ?? "";
|
|
5341
|
+
return message;
|
|
5342
|
+
},
|
|
5343
|
+
};
|
|
5344
|
+
|
|
5103
5345
|
function createBaseChannelMessageSend(): ChannelMessageSend {
|
|
5104
5346
|
return {
|
|
5105
5347
|
clan_id: "",
|