mezon-js-protobuf 1.5.16 → 1.5.18

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
@@ -2447,6 +2447,7 @@ export interface ClanEmojiUpdateRequest {
2447
2447
  source: string;
2448
2448
  shortname: string;
2449
2449
  category: string;
2450
+ clan_id: string;
2450
2451
  }
2451
2452
 
2452
2453
  export interface Webhook {
@@ -2539,6 +2540,8 @@ export interface ChangeChannelCategoryRequest {
2539
2540
 
2540
2541
  /** App information. */
2541
2542
  export interface App {
2543
+ /** app id */
2544
+ id: string;
2542
2545
  /** appname */
2543
2546
  appname: string;
2544
2547
  /** creator_id */
@@ -2623,6 +2626,51 @@ export interface AppId {
2623
2626
  id: string;
2624
2627
  }
2625
2628
 
2629
+ /** The identifier for an app. */
2630
+ export interface AppClan {
2631
+ /** The unique identifier of the app. */
2632
+ app_id: string;
2633
+ clan_id: string;
2634
+ }
2635
+
2636
+ /** Authenticate against the server with a device ID. */
2637
+ export interface AuthenticateRequest {
2638
+ /** The App account details. */
2639
+ account: AccountApp | undefined;
2640
+ }
2641
+
2642
+ /** Send a app token to the server. Used with authenticate/link/unlink. */
2643
+ export interface AccountApp {
2644
+ /** The app id */
2645
+ appid: string;
2646
+ /** the app name */
2647
+ appname: string;
2648
+ /** The account token when create apps to access their profile API. */
2649
+ token: string;
2650
+ /** Extra information that will be bundled in the session token. */
2651
+ vars: { [key: string]: string };
2652
+ }
2653
+
2654
+ export interface AccountApp_VarsEntry {
2655
+ key: string;
2656
+ value: string;
2657
+ }
2658
+
2659
+ /** Delete channel messages by timestamp or/and ids. */
2660
+ export interface DeleteChannelMessagesRequest {
2661
+ /** Timestamp before which messages will be deleted. */
2662
+ before:
2663
+ | Date
2664
+ | undefined;
2665
+ /** IDs of the messages to delete. */
2666
+ ids: string[];
2667
+ }
2668
+
2669
+ export interface DeleteChannelMessagesResponse {
2670
+ /** Total number of messages deleted. */
2671
+ total: number;
2672
+ }
2673
+
2626
2674
  function createBaseAccount(): Account {
2627
2675
  return {
2628
2676
  user: undefined,
@@ -17639,7 +17687,7 @@ export const ClanEmojiDeleteRequest = {
17639
17687
  };
17640
17688
 
17641
17689
  function createBaseClanEmojiUpdateRequest(): ClanEmojiUpdateRequest {
17642
- return { id: "", source: "", shortname: "", category: "" };
17690
+ return { id: "", source: "", shortname: "", category: "", clan_id: "" };
17643
17691
  }
17644
17692
 
17645
17693
  export const ClanEmojiUpdateRequest = {
@@ -17656,6 +17704,9 @@ export const ClanEmojiUpdateRequest = {
17656
17704
  if (message.category !== "") {
17657
17705
  writer.uint32(34).string(message.category);
17658
17706
  }
17707
+ if (message.clan_id !== "") {
17708
+ writer.uint32(42).string(message.clan_id);
17709
+ }
17659
17710
  return writer;
17660
17711
  },
17661
17712
 
@@ -17678,6 +17729,9 @@ export const ClanEmojiUpdateRequest = {
17678
17729
  case 4:
17679
17730
  message.category = reader.string();
17680
17731
  break;
17732
+ case 5:
17733
+ message.clan_id = reader.string();
17734
+ break;
17681
17735
  default:
17682
17736
  reader.skipType(tag & 7);
17683
17737
  break;
@@ -17692,6 +17746,7 @@ export const ClanEmojiUpdateRequest = {
17692
17746
  source: isSet(object.source) ? String(object.source) : "",
17693
17747
  shortname: isSet(object.shortname) ? String(object.shortname) : "",
17694
17748
  category: isSet(object.category) ? String(object.category) : "",
17749
+ clan_id: isSet(object.clan_id) ? String(object.clan_id) : "",
17695
17750
  };
17696
17751
  },
17697
17752
 
@@ -17701,6 +17756,7 @@ export const ClanEmojiUpdateRequest = {
17701
17756
  message.source !== undefined && (obj.source = message.source);
17702
17757
  message.shortname !== undefined && (obj.shortname = message.shortname);
17703
17758
  message.category !== undefined && (obj.category = message.category);
17759
+ message.clan_id !== undefined && (obj.clan_id = message.clan_id);
17704
17760
  return obj;
17705
17761
  },
17706
17762
 
@@ -17714,6 +17770,7 @@ export const ClanEmojiUpdateRequest = {
17714
17770
  message.source = object.source ?? "";
17715
17771
  message.shortname = object.shortname ?? "";
17716
17772
  message.category = object.category ?? "";
17773
+ message.clan_id = object.clan_id ?? "";
17717
17774
  return message;
17718
17775
  },
17719
17776
  };
@@ -18756,31 +18813,43 @@ export const ChangeChannelCategoryRequest = {
18756
18813
  };
18757
18814
 
18758
18815
  function createBaseApp(): App {
18759
- return { appname: "", creator_id: "", applogo: "", is_shadow: false, disable_time: undefined, token: "", role: 0 };
18816
+ return {
18817
+ id: "",
18818
+ appname: "",
18819
+ creator_id: "",
18820
+ applogo: "",
18821
+ is_shadow: false,
18822
+ disable_time: undefined,
18823
+ token: "",
18824
+ role: 0,
18825
+ };
18760
18826
  }
18761
18827
 
18762
18828
  export const App = {
18763
18829
  encode(message: App, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
18830
+ if (message.id !== "") {
18831
+ writer.uint32(10).string(message.id);
18832
+ }
18764
18833
  if (message.appname !== "") {
18765
- writer.uint32(10).string(message.appname);
18834
+ writer.uint32(18).string(message.appname);
18766
18835
  }
18767
18836
  if (message.creator_id !== "") {
18768
- writer.uint32(18).string(message.creator_id);
18837
+ writer.uint32(26).string(message.creator_id);
18769
18838
  }
18770
18839
  if (message.applogo !== "") {
18771
- writer.uint32(26).string(message.applogo);
18840
+ writer.uint32(34).string(message.applogo);
18772
18841
  }
18773
18842
  if (message.is_shadow === true) {
18774
- writer.uint32(32).bool(message.is_shadow);
18843
+ writer.uint32(40).bool(message.is_shadow);
18775
18844
  }
18776
18845
  if (message.disable_time !== undefined) {
18777
- Timestamp.encode(toTimestamp(message.disable_time), writer.uint32(42).fork()).ldelim();
18846
+ Timestamp.encode(toTimestamp(message.disable_time), writer.uint32(50).fork()).ldelim();
18778
18847
  }
18779
18848
  if (message.token !== "") {
18780
- writer.uint32(50).string(message.token);
18849
+ writer.uint32(58).string(message.token);
18781
18850
  }
18782
18851
  if (message.role !== 0) {
18783
- writer.uint32(56).int32(message.role);
18852
+ writer.uint32(64).int32(message.role);
18784
18853
  }
18785
18854
  return writer;
18786
18855
  },
@@ -18793,24 +18862,27 @@ export const App = {
18793
18862
  const tag = reader.uint32();
18794
18863
  switch (tag >>> 3) {
18795
18864
  case 1:
18796
- message.appname = reader.string();
18865
+ message.id = reader.string();
18797
18866
  break;
18798
18867
  case 2:
18799
- message.creator_id = reader.string();
18868
+ message.appname = reader.string();
18800
18869
  break;
18801
18870
  case 3:
18802
- message.applogo = reader.string();
18871
+ message.creator_id = reader.string();
18803
18872
  break;
18804
18873
  case 4:
18805
- message.is_shadow = reader.bool();
18874
+ message.applogo = reader.string();
18806
18875
  break;
18807
18876
  case 5:
18808
- message.disable_time = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
18877
+ message.is_shadow = reader.bool();
18809
18878
  break;
18810
18879
  case 6:
18811
- message.token = reader.string();
18880
+ message.disable_time = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
18812
18881
  break;
18813
18882
  case 7:
18883
+ message.token = reader.string();
18884
+ break;
18885
+ case 8:
18814
18886
  message.role = reader.int32();
18815
18887
  break;
18816
18888
  default:
@@ -18823,6 +18895,7 @@ export const App = {
18823
18895
 
18824
18896
  fromJSON(object: any): App {
18825
18897
  return {
18898
+ id: isSet(object.id) ? String(object.id) : "",
18826
18899
  appname: isSet(object.appname) ? String(object.appname) : "",
18827
18900
  creator_id: isSet(object.creator_id) ? String(object.creator_id) : "",
18828
18901
  applogo: isSet(object.applogo) ? String(object.applogo) : "",
@@ -18835,6 +18908,7 @@ export const App = {
18835
18908
 
18836
18909
  toJSON(message: App): unknown {
18837
18910
  const obj: any = {};
18911
+ message.id !== undefined && (obj.id = message.id);
18838
18912
  message.appname !== undefined && (obj.appname = message.appname);
18839
18913
  message.creator_id !== undefined && (obj.creator_id = message.creator_id);
18840
18914
  message.applogo !== undefined && (obj.applogo = message.applogo);
@@ -18851,6 +18925,7 @@ export const App = {
18851
18925
 
18852
18926
  fromPartial<I extends Exact<DeepPartial<App>, I>>(object: I): App {
18853
18927
  const message = createBaseApp();
18928
+ message.id = object.id ?? "";
18854
18929
  message.appname = object.appname ?? "";
18855
18930
  message.creator_id = object.creator_id ?? "";
18856
18931
  message.applogo = object.applogo ?? "";
@@ -19290,6 +19365,397 @@ export const AppId = {
19290
19365
  },
19291
19366
  };
19292
19367
 
19368
+ function createBaseAppClan(): AppClan {
19369
+ return { app_id: "", clan_id: "" };
19370
+ }
19371
+
19372
+ export const AppClan = {
19373
+ encode(message: AppClan, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
19374
+ if (message.app_id !== "") {
19375
+ writer.uint32(10).string(message.app_id);
19376
+ }
19377
+ if (message.clan_id !== "") {
19378
+ writer.uint32(18).string(message.clan_id);
19379
+ }
19380
+ return writer;
19381
+ },
19382
+
19383
+ decode(input: _m0.Reader | Uint8Array, length?: number): AppClan {
19384
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
19385
+ let end = length === undefined ? reader.len : reader.pos + length;
19386
+ const message = createBaseAppClan();
19387
+ while (reader.pos < end) {
19388
+ const tag = reader.uint32();
19389
+ switch (tag >>> 3) {
19390
+ case 1:
19391
+ message.app_id = reader.string();
19392
+ break;
19393
+ case 2:
19394
+ message.clan_id = reader.string();
19395
+ break;
19396
+ default:
19397
+ reader.skipType(tag & 7);
19398
+ break;
19399
+ }
19400
+ }
19401
+ return message;
19402
+ },
19403
+
19404
+ fromJSON(object: any): AppClan {
19405
+ return {
19406
+ app_id: isSet(object.app_id) ? String(object.app_id) : "",
19407
+ clan_id: isSet(object.clan_id) ? String(object.clan_id) : "",
19408
+ };
19409
+ },
19410
+
19411
+ toJSON(message: AppClan): unknown {
19412
+ const obj: any = {};
19413
+ message.app_id !== undefined && (obj.app_id = message.app_id);
19414
+ message.clan_id !== undefined && (obj.clan_id = message.clan_id);
19415
+ return obj;
19416
+ },
19417
+
19418
+ create<I extends Exact<DeepPartial<AppClan>, I>>(base?: I): AppClan {
19419
+ return AppClan.fromPartial(base ?? {});
19420
+ },
19421
+
19422
+ fromPartial<I extends Exact<DeepPartial<AppClan>, I>>(object: I): AppClan {
19423
+ const message = createBaseAppClan();
19424
+ message.app_id = object.app_id ?? "";
19425
+ message.clan_id = object.clan_id ?? "";
19426
+ return message;
19427
+ },
19428
+ };
19429
+
19430
+ function createBaseAuthenticateRequest(): AuthenticateRequest {
19431
+ return { account: undefined };
19432
+ }
19433
+
19434
+ export const AuthenticateRequest = {
19435
+ encode(message: AuthenticateRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
19436
+ if (message.account !== undefined) {
19437
+ AccountApp.encode(message.account, writer.uint32(10).fork()).ldelim();
19438
+ }
19439
+ return writer;
19440
+ },
19441
+
19442
+ decode(input: _m0.Reader | Uint8Array, length?: number): AuthenticateRequest {
19443
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
19444
+ let end = length === undefined ? reader.len : reader.pos + length;
19445
+ const message = createBaseAuthenticateRequest();
19446
+ while (reader.pos < end) {
19447
+ const tag = reader.uint32();
19448
+ switch (tag >>> 3) {
19449
+ case 1:
19450
+ message.account = AccountApp.decode(reader, reader.uint32());
19451
+ break;
19452
+ default:
19453
+ reader.skipType(tag & 7);
19454
+ break;
19455
+ }
19456
+ }
19457
+ return message;
19458
+ },
19459
+
19460
+ fromJSON(object: any): AuthenticateRequest {
19461
+ return { account: isSet(object.account) ? AccountApp.fromJSON(object.account) : undefined };
19462
+ },
19463
+
19464
+ toJSON(message: AuthenticateRequest): unknown {
19465
+ const obj: any = {};
19466
+ message.account !== undefined && (obj.account = message.account ? AccountApp.toJSON(message.account) : undefined);
19467
+ return obj;
19468
+ },
19469
+
19470
+ create<I extends Exact<DeepPartial<AuthenticateRequest>, I>>(base?: I): AuthenticateRequest {
19471
+ return AuthenticateRequest.fromPartial(base ?? {});
19472
+ },
19473
+
19474
+ fromPartial<I extends Exact<DeepPartial<AuthenticateRequest>, I>>(object: I): AuthenticateRequest {
19475
+ const message = createBaseAuthenticateRequest();
19476
+ message.account = (object.account !== undefined && object.account !== null)
19477
+ ? AccountApp.fromPartial(object.account)
19478
+ : undefined;
19479
+ return message;
19480
+ },
19481
+ };
19482
+
19483
+ function createBaseAccountApp(): AccountApp {
19484
+ return { appid: "", appname: "", token: "", vars: {} };
19485
+ }
19486
+
19487
+ export const AccountApp = {
19488
+ encode(message: AccountApp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
19489
+ if (message.appid !== "") {
19490
+ writer.uint32(10).string(message.appid);
19491
+ }
19492
+ if (message.appname !== "") {
19493
+ writer.uint32(18).string(message.appname);
19494
+ }
19495
+ if (message.token !== "") {
19496
+ writer.uint32(26).string(message.token);
19497
+ }
19498
+ Object.entries(message.vars).forEach(([key, value]) => {
19499
+ AccountApp_VarsEntry.encode({ key: key as any, value }, writer.uint32(34).fork()).ldelim();
19500
+ });
19501
+ return writer;
19502
+ },
19503
+
19504
+ decode(input: _m0.Reader | Uint8Array, length?: number): AccountApp {
19505
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
19506
+ let end = length === undefined ? reader.len : reader.pos + length;
19507
+ const message = createBaseAccountApp();
19508
+ while (reader.pos < end) {
19509
+ const tag = reader.uint32();
19510
+ switch (tag >>> 3) {
19511
+ case 1:
19512
+ message.appid = reader.string();
19513
+ break;
19514
+ case 2:
19515
+ message.appname = reader.string();
19516
+ break;
19517
+ case 3:
19518
+ message.token = reader.string();
19519
+ break;
19520
+ case 4:
19521
+ const entry4 = AccountApp_VarsEntry.decode(reader, reader.uint32());
19522
+ if (entry4.value !== undefined) {
19523
+ message.vars[entry4.key] = entry4.value;
19524
+ }
19525
+ break;
19526
+ default:
19527
+ reader.skipType(tag & 7);
19528
+ break;
19529
+ }
19530
+ }
19531
+ return message;
19532
+ },
19533
+
19534
+ fromJSON(object: any): AccountApp {
19535
+ return {
19536
+ appid: isSet(object.appid) ? String(object.appid) : "",
19537
+ appname: isSet(object.appname) ? String(object.appname) : "",
19538
+ token: isSet(object.token) ? String(object.token) : "",
19539
+ vars: isObject(object.vars)
19540
+ ? Object.entries(object.vars).reduce<{ [key: string]: string }>((acc, [key, value]) => {
19541
+ acc[key] = String(value);
19542
+ return acc;
19543
+ }, {})
19544
+ : {},
19545
+ };
19546
+ },
19547
+
19548
+ toJSON(message: AccountApp): unknown {
19549
+ const obj: any = {};
19550
+ message.appid !== undefined && (obj.appid = message.appid);
19551
+ message.appname !== undefined && (obj.appname = message.appname);
19552
+ message.token !== undefined && (obj.token = message.token);
19553
+ obj.vars = {};
19554
+ if (message.vars) {
19555
+ Object.entries(message.vars).forEach(([k, v]) => {
19556
+ obj.vars[k] = v;
19557
+ });
19558
+ }
19559
+ return obj;
19560
+ },
19561
+
19562
+ create<I extends Exact<DeepPartial<AccountApp>, I>>(base?: I): AccountApp {
19563
+ return AccountApp.fromPartial(base ?? {});
19564
+ },
19565
+
19566
+ fromPartial<I extends Exact<DeepPartial<AccountApp>, I>>(object: I): AccountApp {
19567
+ const message = createBaseAccountApp();
19568
+ message.appid = object.appid ?? "";
19569
+ message.appname = object.appname ?? "";
19570
+ message.token = object.token ?? "";
19571
+ message.vars = Object.entries(object.vars ?? {}).reduce<{ [key: string]: string }>((acc, [key, value]) => {
19572
+ if (value !== undefined) {
19573
+ acc[key] = String(value);
19574
+ }
19575
+ return acc;
19576
+ }, {});
19577
+ return message;
19578
+ },
19579
+ };
19580
+
19581
+ function createBaseAccountApp_VarsEntry(): AccountApp_VarsEntry {
19582
+ return { key: "", value: "" };
19583
+ }
19584
+
19585
+ export const AccountApp_VarsEntry = {
19586
+ encode(message: AccountApp_VarsEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
19587
+ if (message.key !== "") {
19588
+ writer.uint32(10).string(message.key);
19589
+ }
19590
+ if (message.value !== "") {
19591
+ writer.uint32(18).string(message.value);
19592
+ }
19593
+ return writer;
19594
+ },
19595
+
19596
+ decode(input: _m0.Reader | Uint8Array, length?: number): AccountApp_VarsEntry {
19597
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
19598
+ let end = length === undefined ? reader.len : reader.pos + length;
19599
+ const message = createBaseAccountApp_VarsEntry();
19600
+ while (reader.pos < end) {
19601
+ const tag = reader.uint32();
19602
+ switch (tag >>> 3) {
19603
+ case 1:
19604
+ message.key = reader.string();
19605
+ break;
19606
+ case 2:
19607
+ message.value = reader.string();
19608
+ break;
19609
+ default:
19610
+ reader.skipType(tag & 7);
19611
+ break;
19612
+ }
19613
+ }
19614
+ return message;
19615
+ },
19616
+
19617
+ fromJSON(object: any): AccountApp_VarsEntry {
19618
+ return { key: isSet(object.key) ? String(object.key) : "", value: isSet(object.value) ? String(object.value) : "" };
19619
+ },
19620
+
19621
+ toJSON(message: AccountApp_VarsEntry): unknown {
19622
+ const obj: any = {};
19623
+ message.key !== undefined && (obj.key = message.key);
19624
+ message.value !== undefined && (obj.value = message.value);
19625
+ return obj;
19626
+ },
19627
+
19628
+ create<I extends Exact<DeepPartial<AccountApp_VarsEntry>, I>>(base?: I): AccountApp_VarsEntry {
19629
+ return AccountApp_VarsEntry.fromPartial(base ?? {});
19630
+ },
19631
+
19632
+ fromPartial<I extends Exact<DeepPartial<AccountApp_VarsEntry>, I>>(object: I): AccountApp_VarsEntry {
19633
+ const message = createBaseAccountApp_VarsEntry();
19634
+ message.key = object.key ?? "";
19635
+ message.value = object.value ?? "";
19636
+ return message;
19637
+ },
19638
+ };
19639
+
19640
+ function createBaseDeleteChannelMessagesRequest(): DeleteChannelMessagesRequest {
19641
+ return { before: undefined, ids: [] };
19642
+ }
19643
+
19644
+ export const DeleteChannelMessagesRequest = {
19645
+ encode(message: DeleteChannelMessagesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
19646
+ if (message.before !== undefined) {
19647
+ Timestamp.encode(toTimestamp(message.before), writer.uint32(10).fork()).ldelim();
19648
+ }
19649
+ for (const v of message.ids) {
19650
+ writer.uint32(18).string(v!);
19651
+ }
19652
+ return writer;
19653
+ },
19654
+
19655
+ decode(input: _m0.Reader | Uint8Array, length?: number): DeleteChannelMessagesRequest {
19656
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
19657
+ let end = length === undefined ? reader.len : reader.pos + length;
19658
+ const message = createBaseDeleteChannelMessagesRequest();
19659
+ while (reader.pos < end) {
19660
+ const tag = reader.uint32();
19661
+ switch (tag >>> 3) {
19662
+ case 1:
19663
+ message.before = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
19664
+ break;
19665
+ case 2:
19666
+ message.ids.push(reader.string());
19667
+ break;
19668
+ default:
19669
+ reader.skipType(tag & 7);
19670
+ break;
19671
+ }
19672
+ }
19673
+ return message;
19674
+ },
19675
+
19676
+ fromJSON(object: any): DeleteChannelMessagesRequest {
19677
+ return {
19678
+ before: isSet(object.before) ? fromJsonTimestamp(object.before) : undefined,
19679
+ ids: Array.isArray(object?.ids) ? object.ids.map((e: any) => String(e)) : [],
19680
+ };
19681
+ },
19682
+
19683
+ toJSON(message: DeleteChannelMessagesRequest): unknown {
19684
+ const obj: any = {};
19685
+ message.before !== undefined && (obj.before = message.before.toISOString());
19686
+ if (message.ids) {
19687
+ obj.ids = message.ids.map((e) => e);
19688
+ } else {
19689
+ obj.ids = [];
19690
+ }
19691
+ return obj;
19692
+ },
19693
+
19694
+ create<I extends Exact<DeepPartial<DeleteChannelMessagesRequest>, I>>(base?: I): DeleteChannelMessagesRequest {
19695
+ return DeleteChannelMessagesRequest.fromPartial(base ?? {});
19696
+ },
19697
+
19698
+ fromPartial<I extends Exact<DeepPartial<DeleteChannelMessagesRequest>, I>>(object: I): DeleteChannelMessagesRequest {
19699
+ const message = createBaseDeleteChannelMessagesRequest();
19700
+ message.before = object.before ?? undefined;
19701
+ message.ids = object.ids?.map((e) => e) || [];
19702
+ return message;
19703
+ },
19704
+ };
19705
+
19706
+ function createBaseDeleteChannelMessagesResponse(): DeleteChannelMessagesResponse {
19707
+ return { total: 0 };
19708
+ }
19709
+
19710
+ export const DeleteChannelMessagesResponse = {
19711
+ encode(message: DeleteChannelMessagesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
19712
+ if (message.total !== 0) {
19713
+ writer.uint32(8).int64(message.total);
19714
+ }
19715
+ return writer;
19716
+ },
19717
+
19718
+ decode(input: _m0.Reader | Uint8Array, length?: number): DeleteChannelMessagesResponse {
19719
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
19720
+ let end = length === undefined ? reader.len : reader.pos + length;
19721
+ const message = createBaseDeleteChannelMessagesResponse();
19722
+ while (reader.pos < end) {
19723
+ const tag = reader.uint32();
19724
+ switch (tag >>> 3) {
19725
+ case 1:
19726
+ message.total = longToNumber(reader.int64() as Long);
19727
+ break;
19728
+ default:
19729
+ reader.skipType(tag & 7);
19730
+ break;
19731
+ }
19732
+ }
19733
+ return message;
19734
+ },
19735
+
19736
+ fromJSON(object: any): DeleteChannelMessagesResponse {
19737
+ return { total: isSet(object.total) ? Number(object.total) : 0 };
19738
+ },
19739
+
19740
+ toJSON(message: DeleteChannelMessagesResponse): unknown {
19741
+ const obj: any = {};
19742
+ message.total !== undefined && (obj.total = Math.round(message.total));
19743
+ return obj;
19744
+ },
19745
+
19746
+ create<I extends Exact<DeepPartial<DeleteChannelMessagesResponse>, I>>(base?: I): DeleteChannelMessagesResponse {
19747
+ return DeleteChannelMessagesResponse.fromPartial(base ?? {});
19748
+ },
19749
+
19750
+ fromPartial<I extends Exact<DeepPartial<DeleteChannelMessagesResponse>, I>>(
19751
+ object: I,
19752
+ ): DeleteChannelMessagesResponse {
19753
+ const message = createBaseDeleteChannelMessagesResponse();
19754
+ message.total = object.total ?? 0;
19755
+ return message;
19756
+ },
19757
+ };
19758
+
19293
19759
  declare var self: any | undefined;
19294
19760
  declare var window: any | undefined;
19295
19761
  declare var global: any | undefined;
@@ -1895,6 +1895,7 @@ export interface ClanEmojiUpdateRequest {
1895
1895
  source: string;
1896
1896
  shortname: string;
1897
1897
  category: string;
1898
+ clan_id: string;
1898
1899
  }
1899
1900
  export interface Webhook {
1900
1901
  id: string;
@@ -1971,6 +1972,8 @@ export interface ChangeChannelCategoryRequest {
1971
1972
  }
1972
1973
  /** App information. */
1973
1974
  export interface App {
1975
+ /** app id */
1976
+ id: string;
1974
1977
  /** appname */
1975
1978
  appname: string;
1976
1979
  /** creator_id */
@@ -2040,6 +2043,45 @@ export interface AppId {
2040
2043
  /** The unique identifier of the app. */
2041
2044
  id: string;
2042
2045
  }
2046
+ /** The identifier for an app. */
2047
+ export interface AppClan {
2048
+ /** The unique identifier of the app. */
2049
+ app_id: string;
2050
+ clan_id: string;
2051
+ }
2052
+ /** Authenticate against the server with a device ID. */
2053
+ export interface AuthenticateRequest {
2054
+ /** The App account details. */
2055
+ account: AccountApp | undefined;
2056
+ }
2057
+ /** Send a app token to the server. Used with authenticate/link/unlink. */
2058
+ export interface AccountApp {
2059
+ /** The app id */
2060
+ appid: string;
2061
+ /** the app name */
2062
+ appname: string;
2063
+ /** The account token when create apps to access their profile API. */
2064
+ token: string;
2065
+ /** Extra information that will be bundled in the session token. */
2066
+ vars: {
2067
+ [key: string]: string;
2068
+ };
2069
+ }
2070
+ export interface AccountApp_VarsEntry {
2071
+ key: string;
2072
+ value: string;
2073
+ }
2074
+ /** Delete channel messages by timestamp or/and ids. */
2075
+ export interface DeleteChannelMessagesRequest {
2076
+ /** Timestamp before which messages will be deleted. */
2077
+ before: Date | undefined;
2078
+ /** IDs of the messages to delete. */
2079
+ ids: string[];
2080
+ }
2081
+ export interface DeleteChannelMessagesResponse {
2082
+ /** Total number of messages deleted. */
2083
+ total: number;
2084
+ }
2043
2085
  export declare const Account: {
2044
2086
  encode(message: Account, writer?: _m0.Writer): _m0.Writer;
2045
2087
  decode(input: _m0.Reader | Uint8Array, length?: number): Account;
@@ -12830,22 +12872,26 @@ export declare const ClanEmojiUpdateRequest: {
12830
12872
  source?: string | undefined;
12831
12873
  shortname?: string | undefined;
12832
12874
  category?: string | undefined;
12875
+ clan_id?: string | undefined;
12833
12876
  } & {
12834
12877
  id?: string | undefined;
12835
12878
  source?: string | undefined;
12836
12879
  shortname?: string | undefined;
12837
12880
  category?: string | undefined;
12881
+ clan_id?: string | undefined;
12838
12882
  } & { [K in Exclude<keyof I, keyof ClanEmojiUpdateRequest>]: never; }>(base?: I | undefined): ClanEmojiUpdateRequest;
12839
12883
  fromPartial<I_1 extends {
12840
12884
  id?: string | undefined;
12841
12885
  source?: string | undefined;
12842
12886
  shortname?: string | undefined;
12843
12887
  category?: string | undefined;
12888
+ clan_id?: string | undefined;
12844
12889
  } & {
12845
12890
  id?: string | undefined;
12846
12891
  source?: string | undefined;
12847
12892
  shortname?: string | undefined;
12848
12893
  category?: string | undefined;
12894
+ clan_id?: string | undefined;
12849
12895
  } & { [K_1 in Exclude<keyof I_1, keyof ClanEmojiUpdateRequest>]: never; }>(object: I_1): ClanEmojiUpdateRequest;
12850
12896
  };
12851
12897
  export declare const Webhook: {
@@ -13298,6 +13344,7 @@ export declare const App: {
13298
13344
  fromJSON(object: any): App;
13299
13345
  toJSON(message: App): unknown;
13300
13346
  create<I extends {
13347
+ id?: string | undefined;
13301
13348
  appname?: string | undefined;
13302
13349
  creator_id?: string | undefined;
13303
13350
  applogo?: string | undefined;
@@ -13306,6 +13353,7 @@ export declare const App: {
13306
13353
  token?: string | undefined;
13307
13354
  role?: number | undefined;
13308
13355
  } & {
13356
+ id?: string | undefined;
13309
13357
  appname?: string | undefined;
13310
13358
  creator_id?: string | undefined;
13311
13359
  applogo?: string | undefined;
@@ -13315,6 +13363,7 @@ export declare const App: {
13315
13363
  role?: number | undefined;
13316
13364
  } & { [K in Exclude<keyof I, keyof App>]: never; }>(base?: I | undefined): App;
13317
13365
  fromPartial<I_1 extends {
13366
+ id?: string | undefined;
13318
13367
  appname?: string | undefined;
13319
13368
  creator_id?: string | undefined;
13320
13369
  applogo?: string | undefined;
@@ -13323,6 +13372,7 @@ export declare const App: {
13323
13372
  token?: string | undefined;
13324
13373
  role?: number | undefined;
13325
13374
  } & {
13375
+ id?: string | undefined;
13326
13376
  appname?: string | undefined;
13327
13377
  creator_id?: string | undefined;
13328
13378
  applogo?: string | undefined;
@@ -13359,6 +13409,7 @@ export declare const AppList: {
13359
13409
  toJSON(message: AppList): unknown;
13360
13410
  create<I extends {
13361
13411
  apps?: {
13412
+ id?: string | undefined;
13362
13413
  appname?: string | undefined;
13363
13414
  creator_id?: string | undefined;
13364
13415
  applogo?: string | undefined;
@@ -13371,6 +13422,7 @@ export declare const AppList: {
13371
13422
  next_cursor?: string | undefined;
13372
13423
  } & {
13373
13424
  apps?: ({
13425
+ id?: string | undefined;
13374
13426
  appname?: string | undefined;
13375
13427
  creator_id?: string | undefined;
13376
13428
  applogo?: string | undefined;
@@ -13379,6 +13431,7 @@ export declare const AppList: {
13379
13431
  token?: string | undefined;
13380
13432
  role?: number | undefined;
13381
13433
  }[] & ({
13434
+ id?: string | undefined;
13382
13435
  appname?: string | undefined;
13383
13436
  creator_id?: string | undefined;
13384
13437
  applogo?: string | undefined;
@@ -13387,6 +13440,7 @@ export declare const AppList: {
13387
13440
  token?: string | undefined;
13388
13441
  role?: number | undefined;
13389
13442
  } & {
13443
+ id?: string | undefined;
13390
13444
  appname?: string | undefined;
13391
13445
  creator_id?: string | undefined;
13392
13446
  applogo?: string | undefined;
@@ -13395,6 +13449,7 @@ export declare const AppList: {
13395
13449
  token?: string | undefined;
13396
13450
  role?: number | undefined;
13397
13451
  } & { [K in Exclude<keyof I["apps"][number], keyof App>]: never; })[] & { [K_1 in Exclude<keyof I["apps"], keyof {
13452
+ id?: string | undefined;
13398
13453
  appname?: string | undefined;
13399
13454
  creator_id?: string | undefined;
13400
13455
  applogo?: string | undefined;
@@ -13408,6 +13463,7 @@ export declare const AppList: {
13408
13463
  } & { [K_2 in Exclude<keyof I, keyof AppList>]: never; }>(base?: I | undefined): AppList;
13409
13464
  fromPartial<I_1 extends {
13410
13465
  apps?: {
13466
+ id?: string | undefined;
13411
13467
  appname?: string | undefined;
13412
13468
  creator_id?: string | undefined;
13413
13469
  applogo?: string | undefined;
@@ -13420,6 +13476,7 @@ export declare const AppList: {
13420
13476
  next_cursor?: string | undefined;
13421
13477
  } & {
13422
13478
  apps?: ({
13479
+ id?: string | undefined;
13423
13480
  appname?: string | undefined;
13424
13481
  creator_id?: string | undefined;
13425
13482
  applogo?: string | undefined;
@@ -13428,6 +13485,7 @@ export declare const AppList: {
13428
13485
  token?: string | undefined;
13429
13486
  role?: number | undefined;
13430
13487
  }[] & ({
13488
+ id?: string | undefined;
13431
13489
  appname?: string | undefined;
13432
13490
  creator_id?: string | undefined;
13433
13491
  applogo?: string | undefined;
@@ -13436,6 +13494,7 @@ export declare const AppList: {
13436
13494
  token?: string | undefined;
13437
13495
  role?: number | undefined;
13438
13496
  } & {
13497
+ id?: string | undefined;
13439
13498
  appname?: string | undefined;
13440
13499
  creator_id?: string | undefined;
13441
13500
  applogo?: string | undefined;
@@ -13444,6 +13503,7 @@ export declare const AppList: {
13444
13503
  token?: string | undefined;
13445
13504
  role?: number | undefined;
13446
13505
  } & { [K_3 in Exclude<keyof I_1["apps"][number], keyof App>]: never; })[] & { [K_4 in Exclude<keyof I_1["apps"], keyof {
13506
+ id?: string | undefined;
13447
13507
  appname?: string | undefined;
13448
13508
  creator_id?: string | undefined;
13449
13509
  applogo?: string | undefined;
@@ -13556,6 +13616,184 @@ export declare const AppId: {
13556
13616
  id?: string | undefined;
13557
13617
  } & { [K_1 in Exclude<keyof I_1, "id">]: never; }>(object: I_1): AppId;
13558
13618
  };
13619
+ export declare const AppClan: {
13620
+ encode(message: AppClan, writer?: _m0.Writer): _m0.Writer;
13621
+ decode(input: _m0.Reader | Uint8Array, length?: number): AppClan;
13622
+ fromJSON(object: any): AppClan;
13623
+ toJSON(message: AppClan): unknown;
13624
+ create<I extends {
13625
+ app_id?: string | undefined;
13626
+ clan_id?: string | undefined;
13627
+ } & {
13628
+ app_id?: string | undefined;
13629
+ clan_id?: string | undefined;
13630
+ } & { [K in Exclude<keyof I, keyof AppClan>]: never; }>(base?: I | undefined): AppClan;
13631
+ fromPartial<I_1 extends {
13632
+ app_id?: string | undefined;
13633
+ clan_id?: string | undefined;
13634
+ } & {
13635
+ app_id?: string | undefined;
13636
+ clan_id?: string | undefined;
13637
+ } & { [K_1 in Exclude<keyof I_1, keyof AppClan>]: never; }>(object: I_1): AppClan;
13638
+ };
13639
+ export declare const AuthenticateRequest: {
13640
+ encode(message: AuthenticateRequest, writer?: _m0.Writer): _m0.Writer;
13641
+ decode(input: _m0.Reader | Uint8Array, length?: number): AuthenticateRequest;
13642
+ fromJSON(object: any): AuthenticateRequest;
13643
+ toJSON(message: AuthenticateRequest): unknown;
13644
+ create<I extends {
13645
+ account?: {
13646
+ appid?: string | undefined;
13647
+ appname?: string | undefined;
13648
+ token?: string | undefined;
13649
+ vars?: {
13650
+ [x: string]: string | undefined;
13651
+ } | undefined;
13652
+ } | undefined;
13653
+ } & {
13654
+ account?: ({
13655
+ appid?: string | undefined;
13656
+ appname?: string | undefined;
13657
+ token?: string | undefined;
13658
+ vars?: {
13659
+ [x: string]: string | undefined;
13660
+ } | undefined;
13661
+ } & {
13662
+ appid?: string | undefined;
13663
+ appname?: string | undefined;
13664
+ token?: string | undefined;
13665
+ vars?: ({
13666
+ [x: string]: string | undefined;
13667
+ } & {
13668
+ [x: string]: string | undefined;
13669
+ } & { [K in Exclude<keyof I["account"]["vars"], string | number>]: never; }) | undefined;
13670
+ } & { [K_1 in Exclude<keyof I["account"], keyof AccountApp>]: never; }) | undefined;
13671
+ } & { [K_2 in Exclude<keyof I, "account">]: never; }>(base?: I | undefined): AuthenticateRequest;
13672
+ fromPartial<I_1 extends {
13673
+ account?: {
13674
+ appid?: string | undefined;
13675
+ appname?: string | undefined;
13676
+ token?: string | undefined;
13677
+ vars?: {
13678
+ [x: string]: string | undefined;
13679
+ } | undefined;
13680
+ } | undefined;
13681
+ } & {
13682
+ account?: ({
13683
+ appid?: string | undefined;
13684
+ appname?: string | undefined;
13685
+ token?: string | undefined;
13686
+ vars?: {
13687
+ [x: string]: string | undefined;
13688
+ } | undefined;
13689
+ } & {
13690
+ appid?: string | undefined;
13691
+ appname?: string | undefined;
13692
+ token?: string | undefined;
13693
+ vars?: ({
13694
+ [x: string]: string | undefined;
13695
+ } & {
13696
+ [x: string]: string | undefined;
13697
+ } & { [K_3 in Exclude<keyof I_1["account"]["vars"], string | number>]: never; }) | undefined;
13698
+ } & { [K_4 in Exclude<keyof I_1["account"], keyof AccountApp>]: never; }) | undefined;
13699
+ } & { [K_5 in Exclude<keyof I_1, "account">]: never; }>(object: I_1): AuthenticateRequest;
13700
+ };
13701
+ export declare const AccountApp: {
13702
+ encode(message: AccountApp, writer?: _m0.Writer): _m0.Writer;
13703
+ decode(input: _m0.Reader | Uint8Array, length?: number): AccountApp;
13704
+ fromJSON(object: any): AccountApp;
13705
+ toJSON(message: AccountApp): unknown;
13706
+ create<I extends {
13707
+ appid?: string | undefined;
13708
+ appname?: string | undefined;
13709
+ token?: string | undefined;
13710
+ vars?: {
13711
+ [x: string]: string | undefined;
13712
+ } | undefined;
13713
+ } & {
13714
+ appid?: string | undefined;
13715
+ appname?: string | undefined;
13716
+ token?: string | undefined;
13717
+ vars?: ({
13718
+ [x: string]: string | undefined;
13719
+ } & {
13720
+ [x: string]: string | undefined;
13721
+ } & { [K in Exclude<keyof I["vars"], string | number>]: never; }) | undefined;
13722
+ } & { [K_1 in Exclude<keyof I, keyof AccountApp>]: never; }>(base?: I | undefined): AccountApp;
13723
+ fromPartial<I_1 extends {
13724
+ appid?: string | undefined;
13725
+ appname?: string | undefined;
13726
+ token?: string | undefined;
13727
+ vars?: {
13728
+ [x: string]: string | undefined;
13729
+ } | undefined;
13730
+ } & {
13731
+ appid?: string | undefined;
13732
+ appname?: string | undefined;
13733
+ token?: string | undefined;
13734
+ vars?: ({
13735
+ [x: string]: string | undefined;
13736
+ } & {
13737
+ [x: string]: string | undefined;
13738
+ } & { [K_2 in Exclude<keyof I_1["vars"], string | number>]: never; }) | undefined;
13739
+ } & { [K_3 in Exclude<keyof I_1, keyof AccountApp>]: never; }>(object: I_1): AccountApp;
13740
+ };
13741
+ export declare const AccountApp_VarsEntry: {
13742
+ encode(message: AccountApp_VarsEntry, writer?: _m0.Writer): _m0.Writer;
13743
+ decode(input: _m0.Reader | Uint8Array, length?: number): AccountApp_VarsEntry;
13744
+ fromJSON(object: any): AccountApp_VarsEntry;
13745
+ toJSON(message: AccountApp_VarsEntry): unknown;
13746
+ create<I extends {
13747
+ key?: string | undefined;
13748
+ value?: string | undefined;
13749
+ } & {
13750
+ key?: string | undefined;
13751
+ value?: string | undefined;
13752
+ } & { [K in Exclude<keyof I, keyof AccountApp_VarsEntry>]: never; }>(base?: I | undefined): AccountApp_VarsEntry;
13753
+ fromPartial<I_1 extends {
13754
+ key?: string | undefined;
13755
+ value?: string | undefined;
13756
+ } & {
13757
+ key?: string | undefined;
13758
+ value?: string | undefined;
13759
+ } & { [K_1 in Exclude<keyof I_1, keyof AccountApp_VarsEntry>]: never; }>(object: I_1): AccountApp_VarsEntry;
13760
+ };
13761
+ export declare const DeleteChannelMessagesRequest: {
13762
+ encode(message: DeleteChannelMessagesRequest, writer?: _m0.Writer): _m0.Writer;
13763
+ decode(input: _m0.Reader | Uint8Array, length?: number): DeleteChannelMessagesRequest;
13764
+ fromJSON(object: any): DeleteChannelMessagesRequest;
13765
+ toJSON(message: DeleteChannelMessagesRequest): unknown;
13766
+ create<I extends {
13767
+ before?: Date | undefined;
13768
+ ids?: string[] | undefined;
13769
+ } & {
13770
+ before?: Date | undefined;
13771
+ ids?: (string[] & string[] & { [K in Exclude<keyof I["ids"], keyof string[]>]: never; }) | undefined;
13772
+ } & { [K_1 in Exclude<keyof I, keyof DeleteChannelMessagesRequest>]: never; }>(base?: I | undefined): DeleteChannelMessagesRequest;
13773
+ fromPartial<I_1 extends {
13774
+ before?: Date | undefined;
13775
+ ids?: string[] | undefined;
13776
+ } & {
13777
+ before?: Date | undefined;
13778
+ ids?: (string[] & string[] & { [K_2 in Exclude<keyof I_1["ids"], keyof string[]>]: never; }) | undefined;
13779
+ } & { [K_3 in Exclude<keyof I_1, keyof DeleteChannelMessagesRequest>]: never; }>(object: I_1): DeleteChannelMessagesRequest;
13780
+ };
13781
+ export declare const DeleteChannelMessagesResponse: {
13782
+ encode(message: DeleteChannelMessagesResponse, writer?: _m0.Writer): _m0.Writer;
13783
+ decode(input: _m0.Reader | Uint8Array, length?: number): DeleteChannelMessagesResponse;
13784
+ fromJSON(object: any): DeleteChannelMessagesResponse;
13785
+ toJSON(message: DeleteChannelMessagesResponse): unknown;
13786
+ create<I extends {
13787
+ total?: number | undefined;
13788
+ } & {
13789
+ total?: number | undefined;
13790
+ } & { [K in Exclude<keyof I, "total">]: never; }>(base?: I | undefined): DeleteChannelMessagesResponse;
13791
+ fromPartial<I_1 extends {
13792
+ total?: number | undefined;
13793
+ } & {
13794
+ total?: number | undefined;
13795
+ } & { [K_1 in Exclude<keyof I_1, "total">]: never; }>(object: I_1): DeleteChannelMessagesResponse;
13796
+ };
13559
13797
  type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
13560
13798
  export type DeepPartial<T> = T extends Builtin ? T : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
13561
13799
  [K in keyof T]?: DeepPartial<T[K]>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mezon-js-protobuf",
3
- "version": "1.5.16",
3
+ "version": "1.5.18",
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",