mezon-sdk 2.8.11 → 2.8.13

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.
Files changed (61) hide show
  1. package/dist/cjs/api/api.d.ts +263 -67
  2. package/dist/cjs/api/api.js +528 -84
  3. package/dist/cjs/api/api.js.map +1 -1
  4. package/dist/cjs/api.d.ts +7 -0
  5. package/dist/cjs/api.js +26 -0
  6. package/dist/cjs/api.js.map +1 -1
  7. package/dist/cjs/index.d.ts +2 -0
  8. package/dist/cjs/index.js +2 -0
  9. package/dist/cjs/index.js.map +1 -1
  10. package/dist/cjs/interfaces/client.d.ts +34 -3
  11. package/dist/cjs/interfaces/client.js +1 -0
  12. package/dist/cjs/interfaces/client.js.map +1 -1
  13. package/dist/cjs/mezon-client/client/MezonClient.js +1 -1
  14. package/dist/cjs/mezon-client/client/MezonClient.js.map +1 -1
  15. package/dist/cjs/mezon-client/structures/ButtonBuilder.d.ts +6 -0
  16. package/dist/cjs/mezon-client/structures/ButtonBuilder.js +22 -0
  17. package/dist/cjs/mezon-client/structures/ButtonBuilder.js.map +1 -0
  18. package/dist/cjs/mezon-client/structures/InteractiveMessage.d.ts +16 -0
  19. package/dist/cjs/mezon-client/structures/InteractiveMessage.js +120 -0
  20. package/dist/cjs/mezon-client/structures/InteractiveMessage.js.map +1 -0
  21. package/dist/cjs/mezon-client/structures/TextChannel.d.ts +2 -0
  22. package/dist/cjs/mezon-client/structures/TextChannel.js +27 -2
  23. package/dist/cjs/mezon-client/structures/TextChannel.js.map +1 -1
  24. package/dist/cjs/mezon-client/utils/helper.d.ts +1 -0
  25. package/dist/cjs/mezon-client/utils/helper.js +29 -0
  26. package/dist/cjs/mezon-client/utils/helper.js.map +1 -0
  27. package/dist/cjs/rtapi/realtime.d.ts +898 -635
  28. package/dist/cjs/rtapi/realtime.js +278 -5
  29. package/dist/cjs/rtapi/realtime.js.map +1 -1
  30. package/dist/esm/api/api.d.ts +263 -67
  31. package/dist/esm/api/api.js +518 -78
  32. package/dist/esm/api/api.js.map +1 -1
  33. package/dist/esm/api.d.ts +7 -0
  34. package/dist/esm/api.js +26 -0
  35. package/dist/esm/api.js.map +1 -1
  36. package/dist/esm/index.d.ts +2 -0
  37. package/dist/esm/index.js +2 -0
  38. package/dist/esm/index.js.map +1 -1
  39. package/dist/esm/interfaces/client.d.ts +34 -3
  40. package/dist/esm/interfaces/client.js +1 -0
  41. package/dist/esm/interfaces/client.js.map +1 -1
  42. package/dist/esm/mezon-client/client/MezonClient.js +1 -1
  43. package/dist/esm/mezon-client/client/MezonClient.js.map +1 -1
  44. package/dist/esm/mezon-client/structures/ButtonBuilder.d.ts +6 -0
  45. package/dist/esm/mezon-client/structures/ButtonBuilder.js +16 -0
  46. package/dist/esm/mezon-client/structures/ButtonBuilder.js.map +1 -0
  47. package/dist/esm/mezon-client/structures/InteractiveMessage.d.ts +16 -0
  48. package/dist/esm/mezon-client/structures/InteractiveMessage.js +116 -0
  49. package/dist/esm/mezon-client/structures/InteractiveMessage.js.map +1 -0
  50. package/dist/esm/mezon-client/structures/TextChannel.d.ts +2 -0
  51. package/dist/esm/mezon-client/structures/TextChannel.js +27 -1
  52. package/dist/esm/mezon-client/structures/TextChannel.js.map +1 -1
  53. package/dist/esm/mezon-client/utils/helper.d.ts +1 -0
  54. package/dist/esm/mezon-client/utils/helper.js +25 -0
  55. package/dist/esm/mezon-client/utils/helper.js.map +1 -0
  56. package/dist/esm/rtapi/realtime.d.ts +898 -635
  57. package/dist/esm/rtapi/realtime.js +270 -0
  58. package/dist/esm/rtapi/realtime.js.map +1 -1
  59. package/dist/tsconfig.esm.tsbuildinfo +1 -1
  60. package/dist/tsconfig.tsbuildinfo +1 -1
  61. package/package.json +1 -1
@@ -171,6 +171,8 @@ function createBaseEnvelope() {
171
171
  mark_as_read: undefined,
172
172
  list_data_socket: undefined,
173
173
  quick_menu_event: undefined,
174
+ un_block_friend: undefined,
175
+ meet_participant_event: undefined,
174
176
  };
175
177
  }
176
178
  export const Envelope = {
@@ -428,6 +430,12 @@ export const Envelope = {
428
430
  if (message.quick_menu_event !== undefined) {
429
431
  QuickMenuDataEvent.encode(message.quick_menu_event, writer.uint32(674).fork()).ldelim();
430
432
  }
433
+ if (message.un_block_friend !== undefined) {
434
+ UnblockFriend.encode(message.un_block_friend, writer.uint32(682).fork()).ldelim();
435
+ }
436
+ if (message.meet_participant_event !== undefined) {
437
+ MeetParticipantEvent.encode(message.meet_participant_event, writer.uint32(690).fork()).ldelim();
438
+ }
431
439
  return writer;
432
440
  },
433
441
  decode(input, length) {
@@ -941,6 +949,18 @@ export const Envelope = {
941
949
  }
942
950
  message.quick_menu_event = QuickMenuDataEvent.decode(reader, reader.uint32());
943
951
  continue;
952
+ case 85:
953
+ if (tag !== 682) {
954
+ break;
955
+ }
956
+ message.un_block_friend = UnblockFriend.decode(reader, reader.uint32());
957
+ continue;
958
+ case 86:
959
+ if (tag !== 690) {
960
+ break;
961
+ }
962
+ message.meet_participant_event = MeetParticipantEvent.decode(reader, reader.uint32());
963
+ continue;
944
964
  }
945
965
  if ((tag & 7) === 4 || tag === 0) {
946
966
  break;
@@ -1143,6 +1163,10 @@ export const Envelope = {
1143
1163
  quick_menu_event: isSet(object.quick_menu_event)
1144
1164
  ? QuickMenuDataEvent.fromJSON(object.quick_menu_event)
1145
1165
  : undefined,
1166
+ un_block_friend: isSet(object.un_block_friend) ? UnblockFriend.fromJSON(object.un_block_friend) : undefined,
1167
+ meet_participant_event: isSet(object.meet_participant_event)
1168
+ ? MeetParticipantEvent.fromJSON(object.meet_participant_event)
1169
+ : undefined,
1146
1170
  };
1147
1171
  },
1148
1172
  toJSON(message) {
@@ -1399,6 +1423,12 @@ export const Envelope = {
1399
1423
  if (message.quick_menu_event !== undefined) {
1400
1424
  obj.quick_menu_event = QuickMenuDataEvent.toJSON(message.quick_menu_event);
1401
1425
  }
1426
+ if (message.un_block_friend !== undefined) {
1427
+ obj.un_block_friend = UnblockFriend.toJSON(message.un_block_friend);
1428
+ }
1429
+ if (message.meet_participant_event !== undefined) {
1430
+ obj.meet_participant_event = MeetParticipantEvent.toJSON(message.meet_participant_event);
1431
+ }
1402
1432
  return obj;
1403
1433
  },
1404
1434
  create(base) {
@@ -1675,6 +1705,13 @@ export const Envelope = {
1675
1705
  message.quick_menu_event = (object.quick_menu_event !== undefined && object.quick_menu_event !== null)
1676
1706
  ? QuickMenuDataEvent.fromPartial(object.quick_menu_event)
1677
1707
  : undefined;
1708
+ message.un_block_friend = (object.un_block_friend !== undefined && object.un_block_friend !== null)
1709
+ ? UnblockFriend.fromPartial(object.un_block_friend)
1710
+ : undefined;
1711
+ message.meet_participant_event =
1712
+ (object.meet_participant_event !== undefined && object.meet_participant_event !== null)
1713
+ ? MeetParticipantEvent.fromPartial(object.meet_participant_event)
1714
+ : undefined;
1678
1715
  return message;
1679
1716
  },
1680
1717
  };
@@ -4018,6 +4055,7 @@ function createBaseChannelMessageUpdate() {
4018
4055
  hide_editted: false,
4019
4056
  topic_id: "",
4020
4057
  is_update_msg_topic: false,
4058
+ old_mentions: "",
4021
4059
  };
4022
4060
  }
4023
4061
  export const ChannelMessageUpdate = {
@@ -4055,6 +4093,9 @@ export const ChannelMessageUpdate = {
4055
4093
  if (message.is_update_msg_topic !== false) {
4056
4094
  writer.uint32(88).bool(message.is_update_msg_topic);
4057
4095
  }
4096
+ if (message.old_mentions !== "") {
4097
+ writer.uint32(98).string(message.old_mentions);
4098
+ }
4058
4099
  return writer;
4059
4100
  },
4060
4101
  decode(input, length) {
@@ -4130,6 +4171,12 @@ export const ChannelMessageUpdate = {
4130
4171
  }
4131
4172
  message.is_update_msg_topic = reader.bool();
4132
4173
  continue;
4174
+ case 12:
4175
+ if (tag !== 98) {
4176
+ break;
4177
+ }
4178
+ message.old_mentions = reader.string();
4179
+ continue;
4133
4180
  }
4134
4181
  if ((tag & 7) === 4 || tag === 0) {
4135
4182
  break;
@@ -4155,6 +4202,7 @@ export const ChannelMessageUpdate = {
4155
4202
  hide_editted: isSet(object.hide_editted) ? globalThis.Boolean(object.hide_editted) : false,
4156
4203
  topic_id: isSet(object.topic_id) ? globalThis.String(object.topic_id) : "",
4157
4204
  is_update_msg_topic: isSet(object.is_update_msg_topic) ? globalThis.Boolean(object.is_update_msg_topic) : false,
4205
+ old_mentions: isSet(object.old_mentions) ? globalThis.String(object.old_mentions) : "",
4158
4206
  };
4159
4207
  },
4160
4208
  toJSON(message) {
@@ -4192,6 +4240,9 @@ export const ChannelMessageUpdate = {
4192
4240
  if (message.is_update_msg_topic !== false) {
4193
4241
  obj.is_update_msg_topic = message.is_update_msg_topic;
4194
4242
  }
4243
+ if (message.old_mentions !== "") {
4244
+ obj.old_mentions = message.old_mentions;
4245
+ }
4195
4246
  return obj;
4196
4247
  },
4197
4248
  create(base) {
@@ -4210,6 +4261,7 @@ export const ChannelMessageUpdate = {
4210
4261
  message.hide_editted = object.hide_editted ?? false;
4211
4262
  message.topic_id = object.topic_id ?? "";
4212
4263
  message.is_update_msg_topic = object.is_update_msg_topic ?? false;
4264
+ message.old_mentions = object.old_mentions ?? "";
4213
4265
  return message;
4214
4266
  },
4215
4267
  };
@@ -4222,6 +4274,8 @@ function createBaseChannelMessageRemove() {
4222
4274
  is_public: false,
4223
4275
  has_attachment: false,
4224
4276
  topic_id: "",
4277
+ mentions: "",
4278
+ references: "",
4225
4279
  };
4226
4280
  }
4227
4281
  export const ChannelMessageRemove = {
@@ -4247,6 +4301,12 @@ export const ChannelMessageRemove = {
4247
4301
  if (message.topic_id !== "") {
4248
4302
  writer.uint32(58).string(message.topic_id);
4249
4303
  }
4304
+ if (message.mentions !== "") {
4305
+ writer.uint32(66).string(message.mentions);
4306
+ }
4307
+ if (message.references !== "") {
4308
+ writer.uint32(74).string(message.references);
4309
+ }
4250
4310
  return writer;
4251
4311
  },
4252
4312
  decode(input, length) {
@@ -4298,6 +4358,18 @@ export const ChannelMessageRemove = {
4298
4358
  }
4299
4359
  message.topic_id = reader.string();
4300
4360
  continue;
4361
+ case 8:
4362
+ if (tag !== 66) {
4363
+ break;
4364
+ }
4365
+ message.mentions = reader.string();
4366
+ continue;
4367
+ case 9:
4368
+ if (tag !== 74) {
4369
+ break;
4370
+ }
4371
+ message.references = reader.string();
4372
+ continue;
4301
4373
  }
4302
4374
  if ((tag & 7) === 4 || tag === 0) {
4303
4375
  break;
@@ -4315,6 +4387,8 @@ export const ChannelMessageRemove = {
4315
4387
  is_public: isSet(object.is_public) ? globalThis.Boolean(object.is_public) : false,
4316
4388
  has_attachment: isSet(object.has_attachment) ? globalThis.Boolean(object.has_attachment) : false,
4317
4389
  topic_id: isSet(object.topic_id) ? globalThis.String(object.topic_id) : "",
4390
+ mentions: isSet(object.mentions) ? globalThis.String(object.mentions) : "",
4391
+ references: isSet(object.references) ? globalThis.String(object.references) : "",
4318
4392
  };
4319
4393
  },
4320
4394
  toJSON(message) {
@@ -4340,6 +4414,12 @@ export const ChannelMessageRemove = {
4340
4414
  if (message.topic_id !== "") {
4341
4415
  obj.topic_id = message.topic_id;
4342
4416
  }
4417
+ if (message.mentions !== "") {
4418
+ obj.mentions = message.mentions;
4419
+ }
4420
+ if (message.references !== "") {
4421
+ obj.references = message.references;
4422
+ }
4343
4423
  return obj;
4344
4424
  },
4345
4425
  create(base) {
@@ -4354,6 +4434,8 @@ export const ChannelMessageRemove = {
4354
4434
  message.is_public = object.is_public ?? false;
4355
4435
  message.has_attachment = object.has_attachment ?? false;
4356
4436
  message.topic_id = object.topic_id ?? "";
4437
+ message.mentions = object.mentions ?? "";
4438
+ message.references = object.references ?? "";
4357
4439
  return message;
4358
4440
  },
4359
4441
  };
@@ -4798,6 +4880,56 @@ export const BlockFriend = {
4798
4880
  return message;
4799
4881
  },
4800
4882
  };
4883
+ function createBaseUnblockFriend() {
4884
+ return { user_id: "" };
4885
+ }
4886
+ export const UnblockFriend = {
4887
+ encode(message, writer = _m0.Writer.create()) {
4888
+ if (message.user_id !== "") {
4889
+ writer.uint32(10).string(message.user_id);
4890
+ }
4891
+ return writer;
4892
+ },
4893
+ decode(input, length) {
4894
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
4895
+ let end = length === undefined ? reader.len : reader.pos + length;
4896
+ const message = createBaseUnblockFriend();
4897
+ while (reader.pos < end) {
4898
+ const tag = reader.uint32();
4899
+ switch (tag >>> 3) {
4900
+ case 1:
4901
+ if (tag !== 10) {
4902
+ break;
4903
+ }
4904
+ message.user_id = reader.string();
4905
+ continue;
4906
+ }
4907
+ if ((tag & 7) === 4 || tag === 0) {
4908
+ break;
4909
+ }
4910
+ reader.skipType(tag & 7);
4911
+ }
4912
+ return message;
4913
+ },
4914
+ fromJSON(object) {
4915
+ return { user_id: isSet(object.user_id) ? globalThis.String(object.user_id) : "" };
4916
+ },
4917
+ toJSON(message) {
4918
+ const obj = {};
4919
+ if (message.user_id !== "") {
4920
+ obj.user_id = message.user_id;
4921
+ }
4922
+ return obj;
4923
+ },
4924
+ create(base) {
4925
+ return UnblockFriend.fromPartial(base ?? {});
4926
+ },
4927
+ fromPartial(object) {
4928
+ const message = createBaseUnblockFriend();
4929
+ message.user_id = object.user_id ?? "";
4930
+ return message;
4931
+ },
4932
+ };
4801
4933
  function createBasePing() {
4802
4934
  return {};
4803
4935
  }
@@ -7352,6 +7484,8 @@ function createBaseChannelUpdatedEvent() {
7352
7484
  age_restricted: 0,
7353
7485
  active: 0,
7354
7486
  count_mess_unread: 0,
7487
+ user_ids: [],
7488
+ role_ids: [],
7355
7489
  };
7356
7490
  }
7357
7491
  export const ChannelUpdatedEvent = {
@@ -7407,6 +7541,12 @@ export const ChannelUpdatedEvent = {
7407
7541
  if (message.count_mess_unread !== 0) {
7408
7542
  writer.uint32(136).int32(message.count_mess_unread);
7409
7543
  }
7544
+ for (const v of message.user_ids) {
7545
+ writer.uint32(146).string(v);
7546
+ }
7547
+ for (const v of message.role_ids) {
7548
+ writer.uint32(154).string(v);
7549
+ }
7410
7550
  return writer;
7411
7551
  },
7412
7552
  decode(input, length) {
@@ -7518,6 +7658,18 @@ export const ChannelUpdatedEvent = {
7518
7658
  }
7519
7659
  message.count_mess_unread = reader.int32();
7520
7660
  continue;
7661
+ case 18:
7662
+ if (tag !== 146) {
7663
+ break;
7664
+ }
7665
+ message.user_ids.push(reader.string());
7666
+ continue;
7667
+ case 19:
7668
+ if (tag !== 154) {
7669
+ break;
7670
+ }
7671
+ message.role_ids.push(reader.string());
7672
+ continue;
7521
7673
  }
7522
7674
  if ((tag & 7) === 4 || tag === 0) {
7523
7675
  break;
@@ -7545,6 +7697,8 @@ export const ChannelUpdatedEvent = {
7545
7697
  age_restricted: isSet(object.age_restricted) ? globalThis.Number(object.age_restricted) : 0,
7546
7698
  active: isSet(object.active) ? globalThis.Number(object.active) : 0,
7547
7699
  count_mess_unread: isSet(object.count_mess_unread) ? globalThis.Number(object.count_mess_unread) : 0,
7700
+ user_ids: globalThis.Array.isArray(object?.user_ids) ? object.user_ids.map((e) => globalThis.String(e)) : [],
7701
+ role_ids: globalThis.Array.isArray(object?.role_ids) ? object.role_ids.map((e) => globalThis.String(e)) : [],
7548
7702
  };
7549
7703
  },
7550
7704
  toJSON(message) {
@@ -7600,6 +7754,12 @@ export const ChannelUpdatedEvent = {
7600
7754
  if (message.count_mess_unread !== 0) {
7601
7755
  obj.count_mess_unread = Math.round(message.count_mess_unread);
7602
7756
  }
7757
+ if (message.user_ids?.length) {
7758
+ obj.user_ids = message.user_ids;
7759
+ }
7760
+ if (message.role_ids?.length) {
7761
+ obj.role_ids = message.role_ids;
7762
+ }
7603
7763
  return obj;
7604
7764
  },
7605
7765
  create(base) {
@@ -7624,6 +7784,8 @@ export const ChannelUpdatedEvent = {
7624
7784
  message.age_restricted = object.age_restricted ?? 0;
7625
7785
  message.active = object.active ?? 0;
7626
7786
  message.count_mess_unread = object.count_mess_unread ?? 0;
7787
+ message.user_ids = object.user_ids?.map((e) => e) || [];
7788
+ message.role_ids = object.role_ids?.map((e) => e) || [];
7627
7789
  return message;
7628
7790
  },
7629
7791
  };
@@ -12253,6 +12415,114 @@ export const ListDataSocket = {
12253
12415
  return message;
12254
12416
  },
12255
12417
  };
12418
+ function createBaseMeetParticipantEvent() {
12419
+ return { username: "", room_name: "", channel_id: "", clan_id: "", action: 0 };
12420
+ }
12421
+ export const MeetParticipantEvent = {
12422
+ encode(message, writer = _m0.Writer.create()) {
12423
+ if (message.username !== "") {
12424
+ writer.uint32(10).string(message.username);
12425
+ }
12426
+ if (message.room_name !== "") {
12427
+ writer.uint32(18).string(message.room_name);
12428
+ }
12429
+ if (message.channel_id !== "") {
12430
+ writer.uint32(26).string(message.channel_id);
12431
+ }
12432
+ if (message.clan_id !== "") {
12433
+ writer.uint32(34).string(message.clan_id);
12434
+ }
12435
+ if (message.action !== 0) {
12436
+ writer.uint32(40).int32(message.action);
12437
+ }
12438
+ return writer;
12439
+ },
12440
+ decode(input, length) {
12441
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
12442
+ let end = length === undefined ? reader.len : reader.pos + length;
12443
+ const message = createBaseMeetParticipantEvent();
12444
+ while (reader.pos < end) {
12445
+ const tag = reader.uint32();
12446
+ switch (tag >>> 3) {
12447
+ case 1:
12448
+ if (tag !== 10) {
12449
+ break;
12450
+ }
12451
+ message.username = reader.string();
12452
+ continue;
12453
+ case 2:
12454
+ if (tag !== 18) {
12455
+ break;
12456
+ }
12457
+ message.room_name = reader.string();
12458
+ continue;
12459
+ case 3:
12460
+ if (tag !== 26) {
12461
+ break;
12462
+ }
12463
+ message.channel_id = reader.string();
12464
+ continue;
12465
+ case 4:
12466
+ if (tag !== 34) {
12467
+ break;
12468
+ }
12469
+ message.clan_id = reader.string();
12470
+ continue;
12471
+ case 5:
12472
+ if (tag !== 40) {
12473
+ break;
12474
+ }
12475
+ message.action = reader.int32();
12476
+ continue;
12477
+ }
12478
+ if ((tag & 7) === 4 || tag === 0) {
12479
+ break;
12480
+ }
12481
+ reader.skipType(tag & 7);
12482
+ }
12483
+ return message;
12484
+ },
12485
+ fromJSON(object) {
12486
+ return {
12487
+ username: isSet(object.username) ? globalThis.String(object.username) : "",
12488
+ room_name: isSet(object.room_name) ? globalThis.String(object.room_name) : "",
12489
+ channel_id: isSet(object.channel_id) ? globalThis.String(object.channel_id) : "",
12490
+ clan_id: isSet(object.clan_id) ? globalThis.String(object.clan_id) : "",
12491
+ action: isSet(object.action) ? globalThis.Number(object.action) : 0,
12492
+ };
12493
+ },
12494
+ toJSON(message) {
12495
+ const obj = {};
12496
+ if (message.username !== "") {
12497
+ obj.username = message.username;
12498
+ }
12499
+ if (message.room_name !== "") {
12500
+ obj.room_name = message.room_name;
12501
+ }
12502
+ if (message.channel_id !== "") {
12503
+ obj.channel_id = message.channel_id;
12504
+ }
12505
+ if (message.clan_id !== "") {
12506
+ obj.clan_id = message.clan_id;
12507
+ }
12508
+ if (message.action !== 0) {
12509
+ obj.action = Math.round(message.action);
12510
+ }
12511
+ return obj;
12512
+ },
12513
+ create(base) {
12514
+ return MeetParticipantEvent.fromPartial(base ?? {});
12515
+ },
12516
+ fromPartial(object) {
12517
+ const message = createBaseMeetParticipantEvent();
12518
+ message.username = object.username ?? "";
12519
+ message.room_name = object.room_name ?? "";
12520
+ message.channel_id = object.channel_id ?? "";
12521
+ message.clan_id = object.clan_id ?? "";
12522
+ message.action = object.action ?? 0;
12523
+ return message;
12524
+ },
12525
+ };
12256
12526
  function toTimestamp(date) {
12257
12527
  const seconds = Math.trunc(date.getTime() / 1_000);
12258
12528
  const nanos = (date.getTime() % 1_000) * 1_000_000;