mezon-js-protobuf 1.8.76 → 1.8.77

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
@@ -922,7 +922,7 @@ export interface Notification {
922
922
  /** Subject of the notification. */
923
923
  subject: string;
924
924
  /** Content of the notification in JSON. */
925
- content: string;
925
+ content: Uint8Array;
926
926
  /** Category code for this notification. */
927
927
  code: number;
928
928
  /** ID of the sender, if a user. Otherwise 'null'. */
@@ -3825,6 +3825,14 @@ export interface MessageRefList {
3825
3825
  refs: MessageRef[];
3826
3826
  }
3827
3827
 
3828
+ export interface ListClanBadgeCountRequest {
3829
+ clan_id: string;
3830
+ }
3831
+
3832
+ export interface ListClanBadgeCountResponse {
3833
+ badge_count: number;
3834
+ }
3835
+
3828
3836
  function createBaseAccount(): Account {
3829
3837
  return {
3830
3838
  user: undefined,
@@ -9681,7 +9689,7 @@ function createBaseNotification(): Notification {
9681
9689
  return {
9682
9690
  id: "",
9683
9691
  subject: "",
9684
- content: "",
9692
+ content: new Uint8Array(0),
9685
9693
  code: 0,
9686
9694
  sender_id: "",
9687
9695
  create_time: undefined,
@@ -9704,8 +9712,8 @@ export const Notification = {
9704
9712
  if (message.subject !== "") {
9705
9713
  writer.uint32(18).string(message.subject);
9706
9714
  }
9707
- if (message.content !== "") {
9708
- writer.uint32(26).string(message.content);
9715
+ if (message.content.length !== 0) {
9716
+ writer.uint32(26).bytes(message.content);
9709
9717
  }
9710
9718
  if (message.code !== 0) {
9711
9719
  writer.uint32(32).int32(message.code);
@@ -9769,7 +9777,7 @@ export const Notification = {
9769
9777
  break;
9770
9778
  }
9771
9779
 
9772
- message.content = reader.string();
9780
+ message.content = reader.bytes();
9773
9781
  continue;
9774
9782
  case 4:
9775
9783
  if (tag !== 32) {
@@ -9861,7 +9869,7 @@ export const Notification = {
9861
9869
  return {
9862
9870
  id: isSet(object.id) ? globalThis.String(object.id) : "",
9863
9871
  subject: isSet(object.subject) ? globalThis.String(object.subject) : "",
9864
- content: isSet(object.content) ? globalThis.String(object.content) : "",
9872
+ content: isSet(object.content) ? bytesFromBase64(object.content) : new Uint8Array(0),
9865
9873
  code: isSet(object.code) ? globalThis.Number(object.code) : 0,
9866
9874
  sender_id: isSet(object.sender_id) ? globalThis.String(object.sender_id) : "",
9867
9875
  create_time: isSet(object.create_time) ? fromJsonTimestamp(object.create_time) : undefined,
@@ -9884,8 +9892,8 @@ export const Notification = {
9884
9892
  if (message.subject !== "") {
9885
9893
  obj.subject = message.subject;
9886
9894
  }
9887
- if (message.content !== "") {
9888
- obj.content = message.content;
9895
+ if (message.content.length !== 0) {
9896
+ obj.content = base64FromBytes(message.content);
9889
9897
  }
9890
9898
  if (message.code !== 0) {
9891
9899
  obj.code = Math.round(message.code);
@@ -9930,7 +9938,7 @@ export const Notification = {
9930
9938
  const message = createBaseNotification();
9931
9939
  message.id = object.id ?? "";
9932
9940
  message.subject = object.subject ?? "";
9933
- message.content = object.content ?? "";
9941
+ message.content = object.content ?? new Uint8Array(0);
9934
9942
  message.code = object.code ?? 0;
9935
9943
  message.sender_id = object.sender_id ?? "";
9936
9944
  message.create_time = object.create_time ?? undefined;
@@ -39649,6 +39657,120 @@ export const MessageRefList = {
39649
39657
  },
39650
39658
  };
39651
39659
 
39660
+ function createBaseListClanBadgeCountRequest(): ListClanBadgeCountRequest {
39661
+ return { clan_id: "" };
39662
+ }
39663
+
39664
+ export const ListClanBadgeCountRequest = {
39665
+ encode(message: ListClanBadgeCountRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
39666
+ if (message.clan_id !== "") {
39667
+ writer.uint32(10).string(message.clan_id);
39668
+ }
39669
+ return writer;
39670
+ },
39671
+
39672
+ decode(input: _m0.Reader | Uint8Array, length?: number): ListClanBadgeCountRequest {
39673
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
39674
+ let end = length === undefined ? reader.len : reader.pos + length;
39675
+ const message = createBaseListClanBadgeCountRequest();
39676
+ while (reader.pos < end) {
39677
+ const tag = reader.uint32();
39678
+ switch (tag >>> 3) {
39679
+ case 1:
39680
+ if (tag !== 10) {
39681
+ break;
39682
+ }
39683
+
39684
+ message.clan_id = reader.string();
39685
+ continue;
39686
+ }
39687
+ if ((tag & 7) === 4 || tag === 0) {
39688
+ break;
39689
+ }
39690
+ reader.skipType(tag & 7);
39691
+ }
39692
+ return message;
39693
+ },
39694
+
39695
+ fromJSON(object: any): ListClanBadgeCountRequest {
39696
+ return { clan_id: isSet(object.clan_id) ? globalThis.String(object.clan_id) : "" };
39697
+ },
39698
+
39699
+ toJSON(message: ListClanBadgeCountRequest): unknown {
39700
+ const obj: any = {};
39701
+ if (message.clan_id !== "") {
39702
+ obj.clan_id = message.clan_id;
39703
+ }
39704
+ return obj;
39705
+ },
39706
+
39707
+ create<I extends Exact<DeepPartial<ListClanBadgeCountRequest>, I>>(base?: I): ListClanBadgeCountRequest {
39708
+ return ListClanBadgeCountRequest.fromPartial(base ?? ({} as any));
39709
+ },
39710
+ fromPartial<I extends Exact<DeepPartial<ListClanBadgeCountRequest>, I>>(object: I): ListClanBadgeCountRequest {
39711
+ const message = createBaseListClanBadgeCountRequest();
39712
+ message.clan_id = object.clan_id ?? "";
39713
+ return message;
39714
+ },
39715
+ };
39716
+
39717
+ function createBaseListClanBadgeCountResponse(): ListClanBadgeCountResponse {
39718
+ return { badge_count: 0 };
39719
+ }
39720
+
39721
+ export const ListClanBadgeCountResponse = {
39722
+ encode(message: ListClanBadgeCountResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
39723
+ if (message.badge_count !== 0) {
39724
+ writer.uint32(8).int32(message.badge_count);
39725
+ }
39726
+ return writer;
39727
+ },
39728
+
39729
+ decode(input: _m0.Reader | Uint8Array, length?: number): ListClanBadgeCountResponse {
39730
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
39731
+ let end = length === undefined ? reader.len : reader.pos + length;
39732
+ const message = createBaseListClanBadgeCountResponse();
39733
+ while (reader.pos < end) {
39734
+ const tag = reader.uint32();
39735
+ switch (tag >>> 3) {
39736
+ case 1:
39737
+ if (tag !== 8) {
39738
+ break;
39739
+ }
39740
+
39741
+ message.badge_count = reader.int32();
39742
+ continue;
39743
+ }
39744
+ if ((tag & 7) === 4 || tag === 0) {
39745
+ break;
39746
+ }
39747
+ reader.skipType(tag & 7);
39748
+ }
39749
+ return message;
39750
+ },
39751
+
39752
+ fromJSON(object: any): ListClanBadgeCountResponse {
39753
+ return { badge_count: isSet(object.badge_count) ? globalThis.Number(object.badge_count) : 0 };
39754
+ },
39755
+
39756
+ toJSON(message: ListClanBadgeCountResponse): unknown {
39757
+ const obj: any = {};
39758
+ if (message.badge_count !== 0) {
39759
+ obj.badge_count = Math.round(message.badge_count);
39760
+ }
39761
+ return obj;
39762
+ },
39763
+
39764
+ create<I extends Exact<DeepPartial<ListClanBadgeCountResponse>, I>>(base?: I): ListClanBadgeCountResponse {
39765
+ return ListClanBadgeCountResponse.fromPartial(base ?? ({} as any));
39766
+ },
39767
+ fromPartial<I extends Exact<DeepPartial<ListClanBadgeCountResponse>, I>>(object: I): ListClanBadgeCountResponse {
39768
+ const message = createBaseListClanBadgeCountResponse();
39769
+ message.badge_count = object.badge_count ?? 0;
39770
+ return message;
39771
+ },
39772
+ };
39773
+
39652
39774
  function bytesFromBase64(b64: string): Uint8Array {
39653
39775
  if ((globalThis as any).Buffer) {
39654
39776
  return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
@@ -667,7 +667,7 @@ export interface Notification {
667
667
  /** Subject of the notification. */
668
668
  subject: string;
669
669
  /** Content of the notification in JSON. */
670
- content: string;
670
+ content: Uint8Array;
671
671
  /** Category code for this notification. */
672
672
  code: number;
673
673
  /** ID of the sender, if a user. Otherwise 'null'. */
@@ -3156,6 +3156,12 @@ export interface MessageAttachmentList {
3156
3156
  export interface MessageRefList {
3157
3157
  refs: MessageRef[];
3158
3158
  }
3159
+ export interface ListClanBadgeCountRequest {
3160
+ clan_id: string;
3161
+ }
3162
+ export interface ListClanBadgeCountResponse {
3163
+ badge_count: number;
3164
+ }
3159
3165
  export declare const Account: {
3160
3166
  encode(message: Account, writer?: _m0.Writer): _m0.Writer;
3161
3167
  decode(input: _m0.Reader | Uint8Array, length?: number): Account;
@@ -6706,7 +6712,7 @@ export declare const Notification: {
6706
6712
  create<I extends {
6707
6713
  id?: string | undefined;
6708
6714
  subject?: string | undefined;
6709
- content?: string | undefined;
6715
+ content?: Uint8Array | undefined;
6710
6716
  code?: number | undefined;
6711
6717
  sender_id?: string | undefined;
6712
6718
  create_time?: Date | undefined;
@@ -6771,7 +6777,7 @@ export declare const Notification: {
6771
6777
  } & {
6772
6778
  id?: string | undefined;
6773
6779
  subject?: string | undefined;
6774
- content?: string | undefined;
6780
+ content?: Uint8Array | undefined;
6775
6781
  code?: number | undefined;
6776
6782
  sender_id?: string | undefined;
6777
6783
  create_time?: Date | undefined;
@@ -6905,7 +6911,7 @@ export declare const Notification: {
6905
6911
  fromPartial<I_1 extends {
6906
6912
  id?: string | undefined;
6907
6913
  subject?: string | undefined;
6908
- content?: string | undefined;
6914
+ content?: Uint8Array | undefined;
6909
6915
  code?: number | undefined;
6910
6916
  sender_id?: string | undefined;
6911
6917
  create_time?: Date | undefined;
@@ -6970,7 +6976,7 @@ export declare const Notification: {
6970
6976
  } & {
6971
6977
  id?: string | undefined;
6972
6978
  subject?: string | undefined;
6973
- content?: string | undefined;
6979
+ content?: Uint8Array | undefined;
6974
6980
  code?: number | undefined;
6975
6981
  sender_id?: string | undefined;
6976
6982
  create_time?: Date | undefined;
@@ -7191,7 +7197,7 @@ export declare const NotificationList: {
7191
7197
  notifications?: {
7192
7198
  id?: string | undefined;
7193
7199
  subject?: string | undefined;
7194
- content?: string | undefined;
7200
+ content?: Uint8Array | undefined;
7195
7201
  code?: number | undefined;
7196
7202
  sender_id?: string | undefined;
7197
7203
  create_time?: Date | undefined;
@@ -7259,7 +7265,7 @@ export declare const NotificationList: {
7259
7265
  notifications?: ({
7260
7266
  id?: string | undefined;
7261
7267
  subject?: string | undefined;
7262
- content?: string | undefined;
7268
+ content?: Uint8Array | undefined;
7263
7269
  code?: number | undefined;
7264
7270
  sender_id?: string | undefined;
7265
7271
  create_time?: Date | undefined;
@@ -7324,7 +7330,7 @@ export declare const NotificationList: {
7324
7330
  }[] & ({
7325
7331
  id?: string | undefined;
7326
7332
  subject?: string | undefined;
7327
- content?: string | undefined;
7333
+ content?: Uint8Array | undefined;
7328
7334
  code?: number | undefined;
7329
7335
  sender_id?: string | undefined;
7330
7336
  create_time?: Date | undefined;
@@ -7389,7 +7395,7 @@ export declare const NotificationList: {
7389
7395
  } & {
7390
7396
  id?: string | undefined;
7391
7397
  subject?: string | undefined;
7392
- content?: string | undefined;
7398
+ content?: Uint8Array | undefined;
7393
7399
  code?: number | undefined;
7394
7400
  sender_id?: string | undefined;
7395
7401
  create_time?: Date | undefined;
@@ -7522,7 +7528,7 @@ export declare const NotificationList: {
7522
7528
  } & { [K_8 in Exclude<keyof I["notifications"][number], keyof Notification>]: never; })[] & { [K_9 in Exclude<keyof I["notifications"], keyof {
7523
7529
  id?: string | undefined;
7524
7530
  subject?: string | undefined;
7525
- content?: string | undefined;
7531
+ content?: Uint8Array | undefined;
7526
7532
  code?: number | undefined;
7527
7533
  sender_id?: string | undefined;
7528
7534
  create_time?: Date | undefined;
@@ -7591,7 +7597,7 @@ export declare const NotificationList: {
7591
7597
  notifications?: {
7592
7598
  id?: string | undefined;
7593
7599
  subject?: string | undefined;
7594
- content?: string | undefined;
7600
+ content?: Uint8Array | undefined;
7595
7601
  code?: number | undefined;
7596
7602
  sender_id?: string | undefined;
7597
7603
  create_time?: Date | undefined;
@@ -7659,7 +7665,7 @@ export declare const NotificationList: {
7659
7665
  notifications?: ({
7660
7666
  id?: string | undefined;
7661
7667
  subject?: string | undefined;
7662
- content?: string | undefined;
7668
+ content?: Uint8Array | undefined;
7663
7669
  code?: number | undefined;
7664
7670
  sender_id?: string | undefined;
7665
7671
  create_time?: Date | undefined;
@@ -7724,7 +7730,7 @@ export declare const NotificationList: {
7724
7730
  }[] & ({
7725
7731
  id?: string | undefined;
7726
7732
  subject?: string | undefined;
7727
- content?: string | undefined;
7733
+ content?: Uint8Array | undefined;
7728
7734
  code?: number | undefined;
7729
7735
  sender_id?: string | undefined;
7730
7736
  create_time?: Date | undefined;
@@ -7789,7 +7795,7 @@ export declare const NotificationList: {
7789
7795
  } & {
7790
7796
  id?: string | undefined;
7791
7797
  subject?: string | undefined;
7792
- content?: string | undefined;
7798
+ content?: Uint8Array | undefined;
7793
7799
  code?: number | undefined;
7794
7800
  sender_id?: string | undefined;
7795
7801
  create_time?: Date | undefined;
@@ -7922,7 +7928,7 @@ export declare const NotificationList: {
7922
7928
  } & { [K_19 in Exclude<keyof I_1["notifications"][number], keyof Notification>]: never; })[] & { [K_20 in Exclude<keyof I_1["notifications"], keyof {
7923
7929
  id?: string | undefined;
7924
7930
  subject?: string | undefined;
7925
- content?: string | undefined;
7931
+ content?: Uint8Array | undefined;
7926
7932
  code?: number | undefined;
7927
7933
  sender_id?: string | undefined;
7928
7934
  create_time?: Date | undefined;
@@ -24940,6 +24946,38 @@ export declare const MessageRefList: {
24940
24946
  }[]>]: never; }) | undefined;
24941
24947
  } & { [K_5 in Exclude<keyof I_1, "refs">]: never; }>(object: I_1): MessageRefList;
24942
24948
  };
24949
+ export declare const ListClanBadgeCountRequest: {
24950
+ encode(message: ListClanBadgeCountRequest, writer?: _m0.Writer): _m0.Writer;
24951
+ decode(input: _m0.Reader | Uint8Array, length?: number): ListClanBadgeCountRequest;
24952
+ fromJSON(object: any): ListClanBadgeCountRequest;
24953
+ toJSON(message: ListClanBadgeCountRequest): unknown;
24954
+ create<I extends {
24955
+ clan_id?: string | undefined;
24956
+ } & {
24957
+ clan_id?: string | undefined;
24958
+ } & { [K in Exclude<keyof I, "clan_id">]: never; }>(base?: I | undefined): ListClanBadgeCountRequest;
24959
+ fromPartial<I_1 extends {
24960
+ clan_id?: string | undefined;
24961
+ } & {
24962
+ clan_id?: string | undefined;
24963
+ } & { [K_1 in Exclude<keyof I_1, "clan_id">]: never; }>(object: I_1): ListClanBadgeCountRequest;
24964
+ };
24965
+ export declare const ListClanBadgeCountResponse: {
24966
+ encode(message: ListClanBadgeCountResponse, writer?: _m0.Writer): _m0.Writer;
24967
+ decode(input: _m0.Reader | Uint8Array, length?: number): ListClanBadgeCountResponse;
24968
+ fromJSON(object: any): ListClanBadgeCountResponse;
24969
+ toJSON(message: ListClanBadgeCountResponse): unknown;
24970
+ create<I extends {
24971
+ badge_count?: number | undefined;
24972
+ } & {
24973
+ badge_count?: number | undefined;
24974
+ } & { [K in Exclude<keyof I, "badge_count">]: never; }>(base?: I | undefined): ListClanBadgeCountResponse;
24975
+ fromPartial<I_1 extends {
24976
+ badge_count?: number | undefined;
24977
+ } & {
24978
+ badge_count?: number | undefined;
24979
+ } & { [K_1 in Exclude<keyof I_1, "badge_count">]: never; }>(object: I_1): ListClanBadgeCountResponse;
24980
+ };
24943
24981
  type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
24944
24982
  export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
24945
24983
  [K in keyof T]?: DeepPartial<T[K]>;