mezon-js 2.13.74 → 2.13.76

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 CHANGED
@@ -293,9 +293,7 @@ export interface ChannelMessage {
293
293
  /** The unique ID of this message. */
294
294
  message_id: string;
295
295
  /** The code representing a message type or category. */
296
- code:
297
- | number
298
- | undefined;
296
+ code: number;
299
297
  /** Message sender, usually a user ID. */
300
298
  sender_id: string;
301
299
  /** The username of the message sender, if any. */
@@ -1516,7 +1514,7 @@ export interface ChannelMessageHeader {
1516
1514
  }
1517
1515
 
1518
1516
  /** Channel description record */
1519
- export interface ChannelDescription {
1517
+ export interface ChannelDescriptionOld {
1520
1518
  /** The clan of this channel */
1521
1519
  clan_id: string;
1522
1520
  /** The parent channel this message belongs to. */
@@ -1587,6 +1585,76 @@ export interface ChannelDescription {
1587
1585
  member_count: number;
1588
1586
  }
1589
1587
 
1588
+ /** Channel description record */
1589
+ export interface ChannelDescription {
1590
+ /** The clan of this channel */
1591
+ clan_id: string;
1592
+ /** The parent channel this message belongs to. */
1593
+ parent_id: string;
1594
+ /** The channel this message belongs to. */
1595
+ channel_id: string;
1596
+ /** The category of channel */
1597
+ category_id: string;
1598
+ /** The category name */
1599
+ category_name: string;
1600
+ /** The channel type. */
1601
+ type: number;
1602
+ /** creator ID. */
1603
+ creator_id: string;
1604
+ /** The channel lable */
1605
+ channel_label: string;
1606
+ /** The channel private */
1607
+ channel_private: number;
1608
+ /** DM avatars */
1609
+ avatars: string[];
1610
+ /** List DM user ids */
1611
+ user_ids: string[];
1612
+ /** last message id */
1613
+ last_sent_message:
1614
+ | ChannelMessageHeader
1615
+ | undefined;
1616
+ /** last seen message id */
1617
+ last_seen_message:
1618
+ | ChannelMessageHeader
1619
+ | undefined;
1620
+ /** DM status */
1621
+ onlines: boolean[];
1622
+ /** meeting code */
1623
+ meeting_code: string;
1624
+ /** count message unread */
1625
+ count_mess_unread: number;
1626
+ /** active channel */
1627
+ active: number;
1628
+ /** last pin message */
1629
+ last_pin_message: string;
1630
+ /** List DM usernames */
1631
+ usernames: string[];
1632
+ /** creator name */
1633
+ creator_name: string;
1634
+ /** create time ms */
1635
+ create_time_seconds: number;
1636
+ /** update time ms */
1637
+ update_time_seconds: number;
1638
+ /** List DM diplay names */
1639
+ display_names: string[];
1640
+ /** channel avatar */
1641
+ channel_avatar: string;
1642
+ /** clan_name */
1643
+ clan_name: string;
1644
+ /** app id */
1645
+ app_id: string;
1646
+ /** channel all message */
1647
+ is_mute: boolean;
1648
+ /** age restricted */
1649
+ age_restricted: number;
1650
+ /** channel description topic */
1651
+ topic: string;
1652
+ /** e2ee */
1653
+ e2ee: number;
1654
+ /** channel member count */
1655
+ member_count: number;
1656
+ }
1657
+
1590
1658
  /** A list of channel description, usually a result of a list operation. */
1591
1659
  export interface ChannelDescList {
1592
1660
  /** A list of channel. */
@@ -4963,7 +5031,7 @@ function createBaseChannelMessage(): ChannelMessage {
4963
5031
  clan_id: "",
4964
5032
  channel_id: "",
4965
5033
  message_id: "",
4966
- code: undefined,
5034
+ code: 0,
4967
5035
  sender_id: "",
4968
5036
  username: "",
4969
5037
  avatar: "",
@@ -5001,8 +5069,8 @@ export const ChannelMessage = {
5001
5069
  if (message.message_id !== "") {
5002
5070
  writer.uint32(26).string(message.message_id);
5003
5071
  }
5004
- if (message.code !== undefined) {
5005
- Int32Value.encode({ value: message.code! }, writer.uint32(34).fork()).ldelim();
5072
+ if (message.code !== 0) {
5073
+ writer.uint32(32).int32(message.code);
5006
5074
  }
5007
5075
  if (message.sender_id !== "") {
5008
5076
  writer.uint32(42).string(message.sender_id);
@@ -5105,11 +5173,11 @@ export const ChannelMessage = {
5105
5173
  message.message_id = reader.string();
5106
5174
  continue;
5107
5175
  case 4:
5108
- if (tag !== 34) {
5176
+ if (tag !== 32) {
5109
5177
  break;
5110
5178
  }
5111
5179
 
5112
- message.code = Int32Value.decode(reader, reader.uint32()).value;
5180
+ message.code = reader.int32();
5113
5181
  continue;
5114
5182
  case 5:
5115
5183
  if (tag !== 42) {
@@ -5286,7 +5354,7 @@ export const ChannelMessage = {
5286
5354
  clan_id: isSet(object.clan_id) ? globalThis.String(object.clan_id) : "",
5287
5355
  channel_id: isSet(object.channel_id) ? globalThis.String(object.channel_id) : "",
5288
5356
  message_id: isSet(object.message_id) ? globalThis.String(object.message_id) : "",
5289
- code: isSet(object.code) ? Number(object.code) : undefined,
5357
+ code: isSet(object.code) ? globalThis.Number(object.code) : 0,
5290
5358
  sender_id: isSet(object.sender_id) ? globalThis.String(object.sender_id) : "",
5291
5359
  username: isSet(object.username) ? globalThis.String(object.username) : "",
5292
5360
  avatar: isSet(object.avatar) ? globalThis.String(object.avatar) : "",
@@ -5324,8 +5392,8 @@ export const ChannelMessage = {
5324
5392
  if (message.message_id !== "") {
5325
5393
  obj.message_id = message.message_id;
5326
5394
  }
5327
- if (message.code !== undefined) {
5328
- obj.code = message.code;
5395
+ if (message.code !== 0) {
5396
+ obj.code = Math.round(message.code);
5329
5397
  }
5330
5398
  if (message.sender_id !== "") {
5331
5399
  obj.sender_id = message.sender_id;
@@ -5407,7 +5475,7 @@ export const ChannelMessage = {
5407
5475
  message.clan_id = object.clan_id ?? "";
5408
5476
  message.channel_id = object.channel_id ?? "";
5409
5477
  message.message_id = object.message_id ?? "";
5410
- message.code = object.code ?? undefined;
5478
+ message.code = object.code ?? 0;
5411
5479
  message.sender_id = object.sender_id ?? "";
5412
5480
  message.username = object.username ?? "";
5413
5481
  message.avatar = object.avatar ?? "";
@@ -14632,7 +14700,7 @@ export const ChannelMessageHeader = {
14632
14700
  },
14633
14701
  };
14634
14702
 
14635
- function createBaseChannelDescription(): ChannelDescription {
14703
+ function createBaseChannelDescriptionOld(): ChannelDescriptionOld {
14636
14704
  return {
14637
14705
  clan_id: "",
14638
14706
  parent_id: "",
@@ -14668,8 +14736,8 @@ function createBaseChannelDescription(): ChannelDescription {
14668
14736
  };
14669
14737
  }
14670
14738
 
14671
- export const ChannelDescription = {
14672
- encode(message: ChannelDescription, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
14739
+ export const ChannelDescriptionOld = {
14740
+ encode(message: ChannelDescriptionOld, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
14673
14741
  if (message.clan_id !== "") {
14674
14742
  writer.uint32(10).string(message.clan_id);
14675
14743
  }
@@ -14768,10 +14836,10 @@ export const ChannelDescription = {
14768
14836
  return writer;
14769
14837
  },
14770
14838
 
14771
- decode(input: _m0.Reader | Uint8Array, length?: number): ChannelDescription {
14839
+ decode(input: _m0.Reader | Uint8Array, length?: number): ChannelDescriptionOld {
14772
14840
  const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
14773
14841
  let end = length === undefined ? reader.len : reader.pos + length;
14774
- const message = createBaseChannelDescription();
14842
+ const message = createBaseChannelDescriptionOld();
14775
14843
  while (reader.pos < end) {
14776
14844
  const tag = reader.uint32();
14777
14845
  switch (tag >>> 3) {
@@ -15011,7 +15079,7 @@ export const ChannelDescription = {
15011
15079
  return message;
15012
15080
  },
15013
15081
 
15014
- fromJSON(object: any): ChannelDescription {
15082
+ fromJSON(object: any): ChannelDescriptionOld {
15015
15083
  return {
15016
15084
  clan_id: isSet(object.clan_id) ? globalThis.String(object.clan_id) : "",
15017
15085
  parent_id: isSet(object.parent_id) ? globalThis.String(object.parent_id) : "",
@@ -15055,7 +15123,7 @@ export const ChannelDescription = {
15055
15123
  };
15056
15124
  },
15057
15125
 
15058
- toJSON(message: ChannelDescription): unknown {
15126
+ toJSON(message: ChannelDescriptionOld): unknown {
15059
15127
  const obj: any = {};
15060
15128
  if (message.clan_id !== "") {
15061
15129
  obj.clan_id = message.clan_id;
@@ -15153,11 +15221,11 @@ export const ChannelDescription = {
15153
15221
  return obj;
15154
15222
  },
15155
15223
 
15156
- create<I extends Exact<DeepPartial<ChannelDescription>, I>>(base?: I): ChannelDescription {
15157
- return ChannelDescription.fromPartial(base ?? ({} as any));
15224
+ create<I extends Exact<DeepPartial<ChannelDescriptionOld>, I>>(base?: I): ChannelDescriptionOld {
15225
+ return ChannelDescriptionOld.fromPartial(base ?? ({} as any));
15158
15226
  },
15159
- fromPartial<I extends Exact<DeepPartial<ChannelDescription>, I>>(object: I): ChannelDescription {
15160
- const message = createBaseChannelDescription();
15227
+ fromPartial<I extends Exact<DeepPartial<ChannelDescriptionOld>, I>>(object: I): ChannelDescriptionOld {
15228
+ const message = createBaseChannelDescriptionOld();
15161
15229
  message.clan_id = object.clan_id ?? "";
15162
15230
  message.parent_id = object.parent_id ?? "";
15163
15231
  message.channel_id = object.channel_id ?? "";
@@ -15197,6 +15265,571 @@ export const ChannelDescription = {
15197
15265
  },
15198
15266
  };
15199
15267
 
15268
+ function createBaseChannelDescription(): ChannelDescription {
15269
+ return {
15270
+ clan_id: "",
15271
+ parent_id: "",
15272
+ channel_id: "",
15273
+ category_id: "",
15274
+ category_name: "",
15275
+ type: 0,
15276
+ creator_id: "",
15277
+ channel_label: "",
15278
+ channel_private: 0,
15279
+ avatars: [],
15280
+ user_ids: [],
15281
+ last_sent_message: undefined,
15282
+ last_seen_message: undefined,
15283
+ onlines: [],
15284
+ meeting_code: "",
15285
+ count_mess_unread: 0,
15286
+ active: 0,
15287
+ last_pin_message: "",
15288
+ usernames: [],
15289
+ creator_name: "",
15290
+ create_time_seconds: 0,
15291
+ update_time_seconds: 0,
15292
+ display_names: [],
15293
+ channel_avatar: "",
15294
+ clan_name: "",
15295
+ app_id: "",
15296
+ is_mute: false,
15297
+ age_restricted: 0,
15298
+ topic: "",
15299
+ e2ee: 0,
15300
+ member_count: 0,
15301
+ };
15302
+ }
15303
+
15304
+ export const ChannelDescription = {
15305
+ encode(message: ChannelDescription, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
15306
+ if (message.clan_id !== "") {
15307
+ writer.uint32(10).string(message.clan_id);
15308
+ }
15309
+ if (message.parent_id !== "") {
15310
+ writer.uint32(18).string(message.parent_id);
15311
+ }
15312
+ if (message.channel_id !== "") {
15313
+ writer.uint32(26).string(message.channel_id);
15314
+ }
15315
+ if (message.category_id !== "") {
15316
+ writer.uint32(34).string(message.category_id);
15317
+ }
15318
+ if (message.category_name !== "") {
15319
+ writer.uint32(42).string(message.category_name);
15320
+ }
15321
+ if (message.type !== 0) {
15322
+ writer.uint32(48).int32(message.type);
15323
+ }
15324
+ if (message.creator_id !== "") {
15325
+ writer.uint32(58).string(message.creator_id);
15326
+ }
15327
+ if (message.channel_label !== "") {
15328
+ writer.uint32(66).string(message.channel_label);
15329
+ }
15330
+ if (message.channel_private !== 0) {
15331
+ writer.uint32(72).int32(message.channel_private);
15332
+ }
15333
+ for (const v of message.avatars) {
15334
+ writer.uint32(82).string(v!);
15335
+ }
15336
+ for (const v of message.user_ids) {
15337
+ writer.uint32(90).string(v!);
15338
+ }
15339
+ if (message.last_sent_message !== undefined) {
15340
+ ChannelMessageHeader.encode(message.last_sent_message, writer.uint32(98).fork()).ldelim();
15341
+ }
15342
+ if (message.last_seen_message !== undefined) {
15343
+ ChannelMessageHeader.encode(message.last_seen_message, writer.uint32(106).fork()).ldelim();
15344
+ }
15345
+ writer.uint32(114).fork();
15346
+ for (const v of message.onlines) {
15347
+ writer.bool(v);
15348
+ }
15349
+ writer.ldelim();
15350
+ if (message.meeting_code !== "") {
15351
+ writer.uint32(122).string(message.meeting_code);
15352
+ }
15353
+ if (message.count_mess_unread !== 0) {
15354
+ writer.uint32(128).int32(message.count_mess_unread);
15355
+ }
15356
+ if (message.active !== 0) {
15357
+ writer.uint32(136).int32(message.active);
15358
+ }
15359
+ if (message.last_pin_message !== "") {
15360
+ writer.uint32(146).string(message.last_pin_message);
15361
+ }
15362
+ for (const v of message.usernames) {
15363
+ writer.uint32(154).string(v!);
15364
+ }
15365
+ if (message.creator_name !== "") {
15366
+ writer.uint32(162).string(message.creator_name);
15367
+ }
15368
+ if (message.create_time_seconds !== 0) {
15369
+ writer.uint32(168).uint32(message.create_time_seconds);
15370
+ }
15371
+ if (message.update_time_seconds !== 0) {
15372
+ writer.uint32(176).uint32(message.update_time_seconds);
15373
+ }
15374
+ for (const v of message.display_names) {
15375
+ writer.uint32(186).string(v!);
15376
+ }
15377
+ if (message.channel_avatar !== "") {
15378
+ writer.uint32(194).string(message.channel_avatar);
15379
+ }
15380
+ if (message.clan_name !== "") {
15381
+ writer.uint32(202).string(message.clan_name);
15382
+ }
15383
+ if (message.app_id !== "") {
15384
+ writer.uint32(210).string(message.app_id);
15385
+ }
15386
+ if (message.is_mute !== false) {
15387
+ writer.uint32(216).bool(message.is_mute);
15388
+ }
15389
+ if (message.age_restricted !== 0) {
15390
+ writer.uint32(224).int32(message.age_restricted);
15391
+ }
15392
+ if (message.topic !== "") {
15393
+ writer.uint32(234).string(message.topic);
15394
+ }
15395
+ if (message.e2ee !== 0) {
15396
+ writer.uint32(240).int32(message.e2ee);
15397
+ }
15398
+ if (message.member_count !== 0) {
15399
+ writer.uint32(248).int32(message.member_count);
15400
+ }
15401
+ return writer;
15402
+ },
15403
+
15404
+ decode(input: _m0.Reader | Uint8Array, length?: number): ChannelDescription {
15405
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
15406
+ let end = length === undefined ? reader.len : reader.pos + length;
15407
+ const message = createBaseChannelDescription();
15408
+ while (reader.pos < end) {
15409
+ const tag = reader.uint32();
15410
+ switch (tag >>> 3) {
15411
+ case 1:
15412
+ if (tag !== 10) {
15413
+ break;
15414
+ }
15415
+
15416
+ message.clan_id = reader.string();
15417
+ continue;
15418
+ case 2:
15419
+ if (tag !== 18) {
15420
+ break;
15421
+ }
15422
+
15423
+ message.parent_id = reader.string();
15424
+ continue;
15425
+ case 3:
15426
+ if (tag !== 26) {
15427
+ break;
15428
+ }
15429
+
15430
+ message.channel_id = reader.string();
15431
+ continue;
15432
+ case 4:
15433
+ if (tag !== 34) {
15434
+ break;
15435
+ }
15436
+
15437
+ message.category_id = reader.string();
15438
+ continue;
15439
+ case 5:
15440
+ if (tag !== 42) {
15441
+ break;
15442
+ }
15443
+
15444
+ message.category_name = reader.string();
15445
+ continue;
15446
+ case 6:
15447
+ if (tag !== 48) {
15448
+ break;
15449
+ }
15450
+
15451
+ message.type = reader.int32();
15452
+ continue;
15453
+ case 7:
15454
+ if (tag !== 58) {
15455
+ break;
15456
+ }
15457
+
15458
+ message.creator_id = reader.string();
15459
+ continue;
15460
+ case 8:
15461
+ if (tag !== 66) {
15462
+ break;
15463
+ }
15464
+
15465
+ message.channel_label = reader.string();
15466
+ continue;
15467
+ case 9:
15468
+ if (tag !== 72) {
15469
+ break;
15470
+ }
15471
+
15472
+ message.channel_private = reader.int32();
15473
+ continue;
15474
+ case 10:
15475
+ if (tag !== 82) {
15476
+ break;
15477
+ }
15478
+
15479
+ message.avatars.push(reader.string());
15480
+ continue;
15481
+ case 11:
15482
+ if (tag !== 90) {
15483
+ break;
15484
+ }
15485
+
15486
+ message.user_ids.push(reader.string());
15487
+ continue;
15488
+ case 12:
15489
+ if (tag !== 98) {
15490
+ break;
15491
+ }
15492
+
15493
+ message.last_sent_message = ChannelMessageHeader.decode(reader, reader.uint32());
15494
+ continue;
15495
+ case 13:
15496
+ if (tag !== 106) {
15497
+ break;
15498
+ }
15499
+
15500
+ message.last_seen_message = ChannelMessageHeader.decode(reader, reader.uint32());
15501
+ continue;
15502
+ case 14:
15503
+ if (tag === 112) {
15504
+ message.onlines.push(reader.bool());
15505
+
15506
+ continue;
15507
+ }
15508
+
15509
+ if (tag === 114) {
15510
+ const end2 = reader.uint32() + reader.pos;
15511
+ while (reader.pos < end2) {
15512
+ message.onlines.push(reader.bool());
15513
+ }
15514
+
15515
+ continue;
15516
+ }
15517
+
15518
+ break;
15519
+ case 15:
15520
+ if (tag !== 122) {
15521
+ break;
15522
+ }
15523
+
15524
+ message.meeting_code = reader.string();
15525
+ continue;
15526
+ case 16:
15527
+ if (tag !== 128) {
15528
+ break;
15529
+ }
15530
+
15531
+ message.count_mess_unread = reader.int32();
15532
+ continue;
15533
+ case 17:
15534
+ if (tag !== 136) {
15535
+ break;
15536
+ }
15537
+
15538
+ message.active = reader.int32();
15539
+ continue;
15540
+ case 18:
15541
+ if (tag !== 146) {
15542
+ break;
15543
+ }
15544
+
15545
+ message.last_pin_message = reader.string();
15546
+ continue;
15547
+ case 19:
15548
+ if (tag !== 154) {
15549
+ break;
15550
+ }
15551
+
15552
+ message.usernames.push(reader.string());
15553
+ continue;
15554
+ case 20:
15555
+ if (tag !== 162) {
15556
+ break;
15557
+ }
15558
+
15559
+ message.creator_name = reader.string();
15560
+ continue;
15561
+ case 21:
15562
+ if (tag !== 168) {
15563
+ break;
15564
+ }
15565
+
15566
+ message.create_time_seconds = reader.uint32();
15567
+ continue;
15568
+ case 22:
15569
+ if (tag !== 176) {
15570
+ break;
15571
+ }
15572
+
15573
+ message.update_time_seconds = reader.uint32();
15574
+ continue;
15575
+ case 23:
15576
+ if (tag !== 186) {
15577
+ break;
15578
+ }
15579
+
15580
+ message.display_names.push(reader.string());
15581
+ continue;
15582
+ case 24:
15583
+ if (tag !== 194) {
15584
+ break;
15585
+ }
15586
+
15587
+ message.channel_avatar = reader.string();
15588
+ continue;
15589
+ case 25:
15590
+ if (tag !== 202) {
15591
+ break;
15592
+ }
15593
+
15594
+ message.clan_name = reader.string();
15595
+ continue;
15596
+ case 26:
15597
+ if (tag !== 210) {
15598
+ break;
15599
+ }
15600
+
15601
+ message.app_id = reader.string();
15602
+ continue;
15603
+ case 27:
15604
+ if (tag !== 216) {
15605
+ break;
15606
+ }
15607
+
15608
+ message.is_mute = reader.bool();
15609
+ continue;
15610
+ case 28:
15611
+ if (tag !== 224) {
15612
+ break;
15613
+ }
15614
+
15615
+ message.age_restricted = reader.int32();
15616
+ continue;
15617
+ case 29:
15618
+ if (tag !== 234) {
15619
+ break;
15620
+ }
15621
+
15622
+ message.topic = reader.string();
15623
+ continue;
15624
+ case 30:
15625
+ if (tag !== 240) {
15626
+ break;
15627
+ }
15628
+
15629
+ message.e2ee = reader.int32();
15630
+ continue;
15631
+ case 31:
15632
+ if (tag !== 248) {
15633
+ break;
15634
+ }
15635
+
15636
+ message.member_count = reader.int32();
15637
+ continue;
15638
+ }
15639
+ if ((tag & 7) === 4 || tag === 0) {
15640
+ break;
15641
+ }
15642
+ reader.skipType(tag & 7);
15643
+ }
15644
+ return message;
15645
+ },
15646
+
15647
+ fromJSON(object: any): ChannelDescription {
15648
+ return {
15649
+ clan_id: isSet(object.clan_id) ? globalThis.String(object.clan_id) : "",
15650
+ parent_id: isSet(object.parent_id) ? globalThis.String(object.parent_id) : "",
15651
+ channel_id: isSet(object.channel_id) ? globalThis.String(object.channel_id) : "",
15652
+ category_id: isSet(object.category_id) ? globalThis.String(object.category_id) : "",
15653
+ category_name: isSet(object.category_name) ? globalThis.String(object.category_name) : "",
15654
+ type: isSet(object.type) ? globalThis.Number(object.type) : 0,
15655
+ creator_id: isSet(object.creator_id) ? globalThis.String(object.creator_id) : "",
15656
+ channel_label: isSet(object.channel_label) ? globalThis.String(object.channel_label) : "",
15657
+ channel_private: isSet(object.channel_private) ? globalThis.Number(object.channel_private) : 0,
15658
+ avatars: globalThis.Array.isArray(object?.avatars) ? object.avatars.map((e: any) => globalThis.String(e)) : [],
15659
+ user_ids: globalThis.Array.isArray(object?.user_ids) ? object.user_ids.map((e: any) => globalThis.String(e)) : [],
15660
+ last_sent_message: isSet(object.last_sent_message)
15661
+ ? ChannelMessageHeader.fromJSON(object.last_sent_message)
15662
+ : undefined,
15663
+ last_seen_message: isSet(object.last_seen_message)
15664
+ ? ChannelMessageHeader.fromJSON(object.last_seen_message)
15665
+ : undefined,
15666
+ onlines: globalThis.Array.isArray(object?.onlines) ? object.onlines.map((e: any) => globalThis.Boolean(e)) : [],
15667
+ meeting_code: isSet(object.meeting_code) ? globalThis.String(object.meeting_code) : "",
15668
+ count_mess_unread: isSet(object.count_mess_unread) ? globalThis.Number(object.count_mess_unread) : 0,
15669
+ active: isSet(object.active) ? globalThis.Number(object.active) : 0,
15670
+ last_pin_message: isSet(object.last_pin_message) ? globalThis.String(object.last_pin_message) : "",
15671
+ usernames: globalThis.Array.isArray(object?.usernames)
15672
+ ? object.usernames.map((e: any) => globalThis.String(e))
15673
+ : [],
15674
+ creator_name: isSet(object.creator_name) ? globalThis.String(object.creator_name) : "",
15675
+ create_time_seconds: isSet(object.create_time_seconds) ? globalThis.Number(object.create_time_seconds) : 0,
15676
+ update_time_seconds: isSet(object.update_time_seconds) ? globalThis.Number(object.update_time_seconds) : 0,
15677
+ display_names: globalThis.Array.isArray(object?.display_names)
15678
+ ? object.display_names.map((e: any) => globalThis.String(e))
15679
+ : [],
15680
+ channel_avatar: isSet(object.channel_avatar) ? globalThis.String(object.channel_avatar) : "",
15681
+ clan_name: isSet(object.clan_name) ? globalThis.String(object.clan_name) : "",
15682
+ app_id: isSet(object.app_id) ? globalThis.String(object.app_id) : "",
15683
+ is_mute: isSet(object.is_mute) ? globalThis.Boolean(object.is_mute) : false,
15684
+ age_restricted: isSet(object.age_restricted) ? globalThis.Number(object.age_restricted) : 0,
15685
+ topic: isSet(object.topic) ? globalThis.String(object.topic) : "",
15686
+ e2ee: isSet(object.e2ee) ? globalThis.Number(object.e2ee) : 0,
15687
+ member_count: isSet(object.member_count) ? globalThis.Number(object.member_count) : 0,
15688
+ };
15689
+ },
15690
+
15691
+ toJSON(message: ChannelDescription): unknown {
15692
+ const obj: any = {};
15693
+ if (message.clan_id !== "") {
15694
+ obj.clan_id = message.clan_id;
15695
+ }
15696
+ if (message.parent_id !== "") {
15697
+ obj.parent_id = message.parent_id;
15698
+ }
15699
+ if (message.channel_id !== "") {
15700
+ obj.channel_id = message.channel_id;
15701
+ }
15702
+ if (message.category_id !== "") {
15703
+ obj.category_id = message.category_id;
15704
+ }
15705
+ if (message.category_name !== "") {
15706
+ obj.category_name = message.category_name;
15707
+ }
15708
+ if (message.type !== 0) {
15709
+ obj.type = Math.round(message.type);
15710
+ }
15711
+ if (message.creator_id !== "") {
15712
+ obj.creator_id = message.creator_id;
15713
+ }
15714
+ if (message.channel_label !== "") {
15715
+ obj.channel_label = message.channel_label;
15716
+ }
15717
+ if (message.channel_private !== 0) {
15718
+ obj.channel_private = Math.round(message.channel_private);
15719
+ }
15720
+ if (message.avatars?.length) {
15721
+ obj.avatars = message.avatars;
15722
+ }
15723
+ if (message.user_ids?.length) {
15724
+ obj.user_ids = message.user_ids;
15725
+ }
15726
+ if (message.last_sent_message !== undefined) {
15727
+ obj.last_sent_message = ChannelMessageHeader.toJSON(message.last_sent_message);
15728
+ }
15729
+ if (message.last_seen_message !== undefined) {
15730
+ obj.last_seen_message = ChannelMessageHeader.toJSON(message.last_seen_message);
15731
+ }
15732
+ if (message.onlines?.length) {
15733
+ obj.onlines = message.onlines;
15734
+ }
15735
+ if (message.meeting_code !== "") {
15736
+ obj.meeting_code = message.meeting_code;
15737
+ }
15738
+ if (message.count_mess_unread !== 0) {
15739
+ obj.count_mess_unread = Math.round(message.count_mess_unread);
15740
+ }
15741
+ if (message.active !== 0) {
15742
+ obj.active = Math.round(message.active);
15743
+ }
15744
+ if (message.last_pin_message !== "") {
15745
+ obj.last_pin_message = message.last_pin_message;
15746
+ }
15747
+ if (message.usernames?.length) {
15748
+ obj.usernames = message.usernames;
15749
+ }
15750
+ if (message.creator_name !== "") {
15751
+ obj.creator_name = message.creator_name;
15752
+ }
15753
+ if (message.create_time_seconds !== 0) {
15754
+ obj.create_time_seconds = Math.round(message.create_time_seconds);
15755
+ }
15756
+ if (message.update_time_seconds !== 0) {
15757
+ obj.update_time_seconds = Math.round(message.update_time_seconds);
15758
+ }
15759
+ if (message.display_names?.length) {
15760
+ obj.display_names = message.display_names;
15761
+ }
15762
+ if (message.channel_avatar !== "") {
15763
+ obj.channel_avatar = message.channel_avatar;
15764
+ }
15765
+ if (message.clan_name !== "") {
15766
+ obj.clan_name = message.clan_name;
15767
+ }
15768
+ if (message.app_id !== "") {
15769
+ obj.app_id = message.app_id;
15770
+ }
15771
+ if (message.is_mute !== false) {
15772
+ obj.is_mute = message.is_mute;
15773
+ }
15774
+ if (message.age_restricted !== 0) {
15775
+ obj.age_restricted = Math.round(message.age_restricted);
15776
+ }
15777
+ if (message.topic !== "") {
15778
+ obj.topic = message.topic;
15779
+ }
15780
+ if (message.e2ee !== 0) {
15781
+ obj.e2ee = Math.round(message.e2ee);
15782
+ }
15783
+ if (message.member_count !== 0) {
15784
+ obj.member_count = Math.round(message.member_count);
15785
+ }
15786
+ return obj;
15787
+ },
15788
+
15789
+ create<I extends Exact<DeepPartial<ChannelDescription>, I>>(base?: I): ChannelDescription {
15790
+ return ChannelDescription.fromPartial(base ?? ({} as any));
15791
+ },
15792
+ fromPartial<I extends Exact<DeepPartial<ChannelDescription>, I>>(object: I): ChannelDescription {
15793
+ const message = createBaseChannelDescription();
15794
+ message.clan_id = object.clan_id ?? "";
15795
+ message.parent_id = object.parent_id ?? "";
15796
+ message.channel_id = object.channel_id ?? "";
15797
+ message.category_id = object.category_id ?? "";
15798
+ message.category_name = object.category_name ?? "";
15799
+ message.type = object.type ?? 0;
15800
+ message.creator_id = object.creator_id ?? "";
15801
+ message.channel_label = object.channel_label ?? "";
15802
+ message.channel_private = object.channel_private ?? 0;
15803
+ message.avatars = object.avatars?.map((e) => e) || [];
15804
+ message.user_ids = object.user_ids?.map((e) => e) || [];
15805
+ message.last_sent_message = (object.last_sent_message !== undefined && object.last_sent_message !== null)
15806
+ ? ChannelMessageHeader.fromPartial(object.last_sent_message)
15807
+ : undefined;
15808
+ message.last_seen_message = (object.last_seen_message !== undefined && object.last_seen_message !== null)
15809
+ ? ChannelMessageHeader.fromPartial(object.last_seen_message)
15810
+ : undefined;
15811
+ message.onlines = object.onlines?.map((e) => e) || [];
15812
+ message.meeting_code = object.meeting_code ?? "";
15813
+ message.count_mess_unread = object.count_mess_unread ?? 0;
15814
+ message.active = object.active ?? 0;
15815
+ message.last_pin_message = object.last_pin_message ?? "";
15816
+ message.usernames = object.usernames?.map((e) => e) || [];
15817
+ message.creator_name = object.creator_name ?? "";
15818
+ message.create_time_seconds = object.create_time_seconds ?? 0;
15819
+ message.update_time_seconds = object.update_time_seconds ?? 0;
15820
+ message.display_names = object.display_names?.map((e) => e) || [];
15821
+ message.channel_avatar = object.channel_avatar ?? "";
15822
+ message.clan_name = object.clan_name ?? "";
15823
+ message.app_id = object.app_id ?? "";
15824
+ message.is_mute = object.is_mute ?? false;
15825
+ message.age_restricted = object.age_restricted ?? 0;
15826
+ message.topic = object.topic ?? "";
15827
+ message.e2ee = object.e2ee ?? 0;
15828
+ message.member_count = object.member_count ?? 0;
15829
+ return message;
15830
+ },
15831
+ };
15832
+
15200
15833
  function createBaseChannelDescList(): ChannelDescList {
15201
15834
  return { channeldesc: [], page: 0 };
15202
15835
  }