mezon-js-protobuf 1.5.68 → 1.5.70

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
@@ -1587,8 +1587,6 @@ export interface CreateClanDescRequest {
1587
1587
  /** Update Clan information */
1588
1588
  export interface UpdateClanDescRequest {
1589
1589
  clan_id: string;
1590
- /** Clan creator */
1591
- creator_id: string;
1592
1590
  /** Clan name */
1593
1591
  clan_name: string;
1594
1592
  /** Clan logo */
@@ -2319,6 +2317,8 @@ export interface UpdateRoleChannelRequest {
2319
2317
  max_permission_id: string;
2320
2318
  /** The channel_id */
2321
2319
  channel_id: string;
2320
+ /** The ID of the role to update. */
2321
+ user_id: string;
2322
2322
  }
2323
2323
 
2324
2324
  export interface PermissionUpdate {
@@ -13557,7 +13557,7 @@ export const CreateClanDescRequest = {
13557
13557
  };
13558
13558
 
13559
13559
  function createBaseUpdateClanDescRequest(): UpdateClanDescRequest {
13560
- return { clan_id: "", creator_id: "", clan_name: "", logo: "", banner: "", status: 0 };
13560
+ return { clan_id: "", clan_name: "", logo: "", banner: "", status: 0 };
13561
13561
  }
13562
13562
 
13563
13563
  export const UpdateClanDescRequest = {
@@ -13565,20 +13565,17 @@ export const UpdateClanDescRequest = {
13565
13565
  if (message.clan_id !== "") {
13566
13566
  writer.uint32(10).string(message.clan_id);
13567
13567
  }
13568
- if (message.creator_id !== "") {
13569
- writer.uint32(18).string(message.creator_id);
13570
- }
13571
13568
  if (message.clan_name !== "") {
13572
- writer.uint32(26).string(message.clan_name);
13569
+ writer.uint32(18).string(message.clan_name);
13573
13570
  }
13574
13571
  if (message.logo !== "") {
13575
- writer.uint32(34).string(message.logo);
13572
+ writer.uint32(26).string(message.logo);
13576
13573
  }
13577
13574
  if (message.banner !== "") {
13578
- writer.uint32(42).string(message.banner);
13575
+ writer.uint32(34).string(message.banner);
13579
13576
  }
13580
13577
  if (message.status !== 0) {
13581
- writer.uint32(48).int32(message.status);
13578
+ writer.uint32(40).int32(message.status);
13582
13579
  }
13583
13580
  return writer;
13584
13581
  },
@@ -13602,31 +13599,24 @@ export const UpdateClanDescRequest = {
13602
13599
  break;
13603
13600
  }
13604
13601
 
13605
- message.creator_id = reader.string();
13602
+ message.clan_name = reader.string();
13606
13603
  continue;
13607
13604
  case 3:
13608
13605
  if (tag !== 26) {
13609
13606
  break;
13610
13607
  }
13611
13608
 
13612
- message.clan_name = reader.string();
13609
+ message.logo = reader.string();
13613
13610
  continue;
13614
13611
  case 4:
13615
13612
  if (tag !== 34) {
13616
13613
  break;
13617
13614
  }
13618
13615
 
13619
- message.logo = reader.string();
13620
- continue;
13621
- case 5:
13622
- if (tag !== 42) {
13623
- break;
13624
- }
13625
-
13626
13616
  message.banner = reader.string();
13627
13617
  continue;
13628
- case 6:
13629
- if (tag !== 48) {
13618
+ case 5:
13619
+ if (tag !== 40) {
13630
13620
  break;
13631
13621
  }
13632
13622
 
@@ -13644,7 +13634,6 @@ export const UpdateClanDescRequest = {
13644
13634
  fromJSON(object: any): UpdateClanDescRequest {
13645
13635
  return {
13646
13636
  clan_id: isSet(object.clan_id) ? globalThis.String(object.clan_id) : "",
13647
- creator_id: isSet(object.creator_id) ? globalThis.String(object.creator_id) : "",
13648
13637
  clan_name: isSet(object.clan_name) ? globalThis.String(object.clan_name) : "",
13649
13638
  logo: isSet(object.logo) ? globalThis.String(object.logo) : "",
13650
13639
  banner: isSet(object.banner) ? globalThis.String(object.banner) : "",
@@ -13657,9 +13646,6 @@ export const UpdateClanDescRequest = {
13657
13646
  if (message.clan_id !== "") {
13658
13647
  obj.clan_id = message.clan_id;
13659
13648
  }
13660
- if (message.creator_id !== "") {
13661
- obj.creator_id = message.creator_id;
13662
- }
13663
13649
  if (message.clan_name !== "") {
13664
13650
  obj.clan_name = message.clan_name;
13665
13651
  }
@@ -13681,7 +13667,6 @@ export const UpdateClanDescRequest = {
13681
13667
  fromPartial<I extends Exact<DeepPartial<UpdateClanDescRequest>, I>>(object: I): UpdateClanDescRequest {
13682
13668
  const message = createBaseUpdateClanDescRequest();
13683
13669
  message.clan_id = object.clan_id ?? "";
13684
- message.creator_id = object.creator_id ?? "";
13685
13670
  message.clan_name = object.clan_name ?? "";
13686
13671
  message.logo = object.logo ?? "";
13687
13672
  message.banner = object.banner ?? "";
@@ -20640,7 +20625,7 @@ export const UpdateRoleRequest = {
20640
20625
  };
20641
20626
 
20642
20627
  function createBaseUpdateRoleChannelRequest(): UpdateRoleChannelRequest {
20643
- return { role_id: "", permission_update: [], max_permission_id: "", channel_id: "" };
20628
+ return { role_id: "", permission_update: [], max_permission_id: "", channel_id: "", user_id: "" };
20644
20629
  }
20645
20630
 
20646
20631
  export const UpdateRoleChannelRequest = {
@@ -20657,6 +20642,9 @@ export const UpdateRoleChannelRequest = {
20657
20642
  if (message.channel_id !== "") {
20658
20643
  writer.uint32(34).string(message.channel_id);
20659
20644
  }
20645
+ if (message.user_id !== "") {
20646
+ writer.uint32(42).string(message.user_id);
20647
+ }
20660
20648
  return writer;
20661
20649
  },
20662
20650
 
@@ -20695,6 +20683,13 @@ export const UpdateRoleChannelRequest = {
20695
20683
 
20696
20684
  message.channel_id = reader.string();
20697
20685
  continue;
20686
+ case 5:
20687
+ if (tag !== 42) {
20688
+ break;
20689
+ }
20690
+
20691
+ message.user_id = reader.string();
20692
+ continue;
20698
20693
  }
20699
20694
  if ((tag & 7) === 4 || tag === 0) {
20700
20695
  break;
@@ -20712,6 +20707,7 @@ export const UpdateRoleChannelRequest = {
20712
20707
  : [],
20713
20708
  max_permission_id: isSet(object.max_permission_id) ? globalThis.String(object.max_permission_id) : "",
20714
20709
  channel_id: isSet(object.channel_id) ? globalThis.String(object.channel_id) : "",
20710
+ user_id: isSet(object.user_id) ? globalThis.String(object.user_id) : "",
20715
20711
  };
20716
20712
  },
20717
20713
 
@@ -20729,6 +20725,9 @@ export const UpdateRoleChannelRequest = {
20729
20725
  if (message.channel_id !== "") {
20730
20726
  obj.channel_id = message.channel_id;
20731
20727
  }
20728
+ if (message.user_id !== "") {
20729
+ obj.user_id = message.user_id;
20730
+ }
20732
20731
  return obj;
20733
20732
  },
20734
20733
 
@@ -20741,6 +20740,7 @@ export const UpdateRoleChannelRequest = {
20741
20740
  message.permission_update = object.permission_update?.map((e) => PermissionUpdate.fromPartial(e)) || [];
20742
20741
  message.max_permission_id = object.max_permission_id ?? "";
20743
20742
  message.channel_id = object.channel_id ?? "";
20743
+ message.user_id = object.user_id ?? "";
20744
20744
  return message;
20745
20745
  },
20746
20746
  };
@@ -35,7 +35,7 @@ export interface WebSocketAdapter {
35
35
  onOpen: SocketOpenHandler | null;
36
36
  isOpen(): boolean;
37
37
  close(): void;
38
- connect(scheme: string, host: string, port: string, createStatus: boolean, token: string): void;
38
+ connect(scheme: string, host: string, port: string, createStatus: boolean, token: string, signal?: AbortSignal): void;
39
39
  send(message: any): void;
40
40
  }
41
41
  /**
@@ -77,7 +77,7 @@ export declare class WebSocketAdapterText implements WebSocketAdapter {
77
77
  get onOpen(): SocketOpenHandler | null;
78
78
  set onOpen(value: SocketOpenHandler | null);
79
79
  isOpen(): boolean;
80
- connect(scheme: string, host: string, port: string, createStatus: boolean, token: string): void;
80
+ connect(scheme: string, host: string, port: string, createStatus: boolean, token: string, signal?: AbortSignal): void;
81
81
  close(): void;
82
82
  send(msg: any): void;
83
83
  }
@@ -1153,8 +1153,6 @@ export interface CreateClanDescRequest {
1153
1153
  /** Update Clan information */
1154
1154
  export interface UpdateClanDescRequest {
1155
1155
  clan_id: string;
1156
- /** Clan creator */
1157
- creator_id: string;
1158
1156
  /** Clan name */
1159
1157
  clan_name: string;
1160
1158
  /** Clan logo */
@@ -1789,6 +1787,8 @@ export interface UpdateRoleChannelRequest {
1789
1787
  max_permission_id: string;
1790
1788
  /** The channel_id */
1791
1789
  channel_id: string;
1790
+ /** The ID of the role to update. */
1791
+ user_id: string;
1792
1792
  }
1793
1793
  export interface PermissionUpdate {
1794
1794
  /** permission_id */
@@ -8342,14 +8342,12 @@ export declare const UpdateClanDescRequest: {
8342
8342
  toJSON(message: UpdateClanDescRequest): unknown;
8343
8343
  create<I extends {
8344
8344
  clan_id?: string | undefined;
8345
- creator_id?: string | undefined;
8346
8345
  clan_name?: string | undefined;
8347
8346
  logo?: string | undefined;
8348
8347
  banner?: string | undefined;
8349
8348
  status?: number | undefined;
8350
8349
  } & {
8351
8350
  clan_id?: string | undefined;
8352
- creator_id?: string | undefined;
8353
8351
  clan_name?: string | undefined;
8354
8352
  logo?: string | undefined;
8355
8353
  banner?: string | undefined;
@@ -8357,14 +8355,12 @@ export declare const UpdateClanDescRequest: {
8357
8355
  } & { [K in Exclude<keyof I, keyof UpdateClanDescRequest>]: never; }>(base?: I | undefined): UpdateClanDescRequest;
8358
8356
  fromPartial<I_1 extends {
8359
8357
  clan_id?: string | undefined;
8360
- creator_id?: string | undefined;
8361
8358
  clan_name?: string | undefined;
8362
8359
  logo?: string | undefined;
8363
8360
  banner?: string | undefined;
8364
8361
  status?: number | undefined;
8365
8362
  } & {
8366
8363
  clan_id?: string | undefined;
8367
- creator_id?: string | undefined;
8368
8364
  clan_name?: string | undefined;
8369
8365
  logo?: string | undefined;
8370
8366
  banner?: string | undefined;
@@ -12207,6 +12203,7 @@ export declare const UpdateRoleChannelRequest: {
12207
12203
  }[] | undefined;
12208
12204
  max_permission_id?: string | undefined;
12209
12205
  channel_id?: string | undefined;
12206
+ user_id?: string | undefined;
12210
12207
  } & {
12211
12208
  role_id?: string | undefined;
12212
12209
  permission_update?: ({
@@ -12228,6 +12225,7 @@ export declare const UpdateRoleChannelRequest: {
12228
12225
  }[]>]: never; }) | undefined;
12229
12226
  max_permission_id?: string | undefined;
12230
12227
  channel_id?: string | undefined;
12228
+ user_id?: string | undefined;
12231
12229
  } & { [K_2 in Exclude<keyof I, keyof UpdateRoleChannelRequest>]: never; }>(base?: I | undefined): UpdateRoleChannelRequest;
12232
12230
  fromPartial<I_1 extends {
12233
12231
  role_id?: string | undefined;
@@ -12238,6 +12236,7 @@ export declare const UpdateRoleChannelRequest: {
12238
12236
  }[] | undefined;
12239
12237
  max_permission_id?: string | undefined;
12240
12238
  channel_id?: string | undefined;
12239
+ user_id?: string | undefined;
12241
12240
  } & {
12242
12241
  role_id?: string | undefined;
12243
12242
  permission_update?: ({
@@ -12259,6 +12258,7 @@ export declare const UpdateRoleChannelRequest: {
12259
12258
  }[]>]: never; }) | undefined;
12260
12259
  max_permission_id?: string | undefined;
12261
12260
  channel_id?: string | undefined;
12261
+ user_id?: string | undefined;
12262
12262
  } & { [K_5 in Exclude<keyof I_1, keyof UpdateRoleChannelRequest>]: never; }>(object: I_1): UpdateRoleChannelRequest;
12263
12263
  };
12264
12264
  export declare const PermissionUpdate: {
@@ -166,6 +166,8 @@ export interface PermissionRoleChannelListEvent {
166
166
  channel_id: string;
167
167
  /** A list of permission. */
168
168
  permission_role_channel: PermissionRoleChannel[];
169
+ /** */
170
+ user_id: string;
169
171
  }
170
172
  /** A list of permission user in channel. */
171
173
  export interface UserPermissionInChannelListEvent {
@@ -1555,6 +1557,7 @@ export declare const Envelope: {
1555
1557
  permission_id?: string | undefined;
1556
1558
  active?: boolean | undefined;
1557
1559
  }[] | undefined;
1560
+ user_id?: string | undefined;
1558
1561
  } | undefined;
1559
1562
  notification_channel_category_setting_event?: {
1560
1563
  clan_id?: string | undefined;
@@ -3391,6 +3394,7 @@ export declare const Envelope: {
3391
3394
  permission_id?: string | undefined;
3392
3395
  active?: boolean | undefined;
3393
3396
  }[] | undefined;
3397
+ user_id?: string | undefined;
3394
3398
  } & {
3395
3399
  role_id?: string | undefined;
3396
3400
  channel_id?: string | undefined;
@@ -3407,6 +3411,7 @@ export declare const Envelope: {
3407
3411
  permission_id?: string | undefined;
3408
3412
  active?: boolean | undefined;
3409
3413
  }[]>]: never; }) | undefined;
3414
+ user_id?: string | undefined;
3410
3415
  } & { [K_107 in Exclude<keyof I["permission_role_channel_list_event"], keyof PermissionRoleChannelListEvent>]: never; }) | undefined;
3411
3416
  notification_channel_category_setting_event?: ({
3412
3417
  clan_id?: string | undefined;
@@ -4902,6 +4907,7 @@ export declare const Envelope: {
4902
4907
  permission_id?: string | undefined;
4903
4908
  active?: boolean | undefined;
4904
4909
  }[] | undefined;
4910
+ user_id?: string | undefined;
4905
4911
  } | undefined;
4906
4912
  notification_channel_category_setting_event?: {
4907
4913
  clan_id?: string | undefined;
@@ -6738,6 +6744,7 @@ export declare const Envelope: {
6738
6744
  permission_id?: string | undefined;
6739
6745
  active?: boolean | undefined;
6740
6746
  }[] | undefined;
6747
+ user_id?: string | undefined;
6741
6748
  } & {
6742
6749
  role_id?: string | undefined;
6743
6750
  channel_id?: string | undefined;
@@ -6754,6 +6761,7 @@ export declare const Envelope: {
6754
6761
  permission_id?: string | undefined;
6755
6762
  active?: boolean | undefined;
6756
6763
  }[]>]: never; }) | undefined;
6764
+ user_id?: string | undefined;
6757
6765
  } & { [K_266 in Exclude<keyof I_1["permission_role_channel_list_event"], keyof PermissionRoleChannelListEvent>]: never; }) | undefined;
6758
6766
  notification_channel_category_setting_event?: ({
6759
6767
  clan_id?: string | undefined;
@@ -8063,6 +8071,7 @@ export declare const PermissionRoleChannelListEvent: {
8063
8071
  permission_id?: string | undefined;
8064
8072
  active?: boolean | undefined;
8065
8073
  }[] | undefined;
8074
+ user_id?: string | undefined;
8066
8075
  } & {
8067
8076
  role_id?: string | undefined;
8068
8077
  channel_id?: string | undefined;
@@ -8079,6 +8088,7 @@ export declare const PermissionRoleChannelListEvent: {
8079
8088
  permission_id?: string | undefined;
8080
8089
  active?: boolean | undefined;
8081
8090
  }[]>]: never; }) | undefined;
8091
+ user_id?: string | undefined;
8082
8092
  } & { [K_2 in Exclude<keyof I, keyof PermissionRoleChannelListEvent>]: never; }>(base?: I | undefined): PermissionRoleChannelListEvent;
8083
8093
  fromPartial<I_1 extends {
8084
8094
  role_id?: string | undefined;
@@ -8087,6 +8097,7 @@ export declare const PermissionRoleChannelListEvent: {
8087
8097
  permission_id?: string | undefined;
8088
8098
  active?: boolean | undefined;
8089
8099
  }[] | undefined;
8100
+ user_id?: string | undefined;
8090
8101
  } & {
8091
8102
  role_id?: string | undefined;
8092
8103
  channel_id?: string | undefined;
@@ -8103,6 +8114,7 @@ export declare const PermissionRoleChannelListEvent: {
8103
8114
  permission_id?: string | undefined;
8104
8115
  active?: boolean | undefined;
8105
8116
  }[]>]: never; }) | undefined;
8117
+ user_id?: string | undefined;
8106
8118
  } & { [K_5 in Exclude<keyof I_1, keyof PermissionRoleChannelListEvent>]: never; }>(object: I_1): PermissionRoleChannelListEvent;
8107
8119
  };
8108
8120
  export declare const UserPermissionInChannelListEvent: {
@@ -30,6 +30,6 @@ export declare class WebSocketAdapterPb implements WebSocketAdapter {
30
30
  set onOpen(value: SocketOpenHandler | null);
31
31
  isOpen(): boolean;
32
32
  close(): void;
33
- connect(scheme: string, host: string, port: string, createStatus: boolean, token: string): void;
33
+ connect(scheme: string, host: string, port: string, createStatus: boolean, token: string, signal?: AbortSignal): void;
34
34
  send(msg: any): void;
35
35
  }
@@ -6943,7 +6943,7 @@ var AddClanUserEvent = {
6943
6943
  }
6944
6944
  };
6945
6945
  function createBasePermissionRoleChannelListEvent() {
6946
- return { role_id: "", channel_id: "", permission_role_channel: [] };
6946
+ return { role_id: "", channel_id: "", permission_role_channel: [], user_id: "" };
6947
6947
  }
6948
6948
  var PermissionRoleChannelListEvent = {
6949
6949
  encode(message, writer = import_minimal5.default.Writer.create()) {
@@ -6956,6 +6956,9 @@ var PermissionRoleChannelListEvent = {
6956
6956
  for (const v of message.permission_role_channel) {
6957
6957
  PermissionRoleChannel.encode(v, writer.uint32(26).fork()).ldelim();
6958
6958
  }
6959
+ if (message.user_id !== "") {
6960
+ writer.uint32(34).string(message.user_id);
6961
+ }
6959
6962
  return writer;
6960
6963
  },
6961
6964
  decode(input, length) {
@@ -6983,6 +6986,12 @@ var PermissionRoleChannelListEvent = {
6983
6986
  }
6984
6987
  message.permission_role_channel.push(PermissionRoleChannel.decode(reader, reader.uint32()));
6985
6988
  continue;
6989
+ case 4:
6990
+ if (tag !== 34) {
6991
+ break;
6992
+ }
6993
+ message.user_id = reader.string();
6994
+ continue;
6986
6995
  }
6987
6996
  if ((tag & 7) === 4 || tag === 0) {
6988
6997
  break;
@@ -6995,7 +7004,8 @@ var PermissionRoleChannelListEvent = {
6995
7004
  return {
6996
7005
  role_id: isSet4(object.role_id) ? globalThis.String(object.role_id) : "",
6997
7006
  channel_id: isSet4(object.channel_id) ? globalThis.String(object.channel_id) : "",
6998
- permission_role_channel: globalThis.Array.isArray(object == null ? void 0 : object.permission_role_channel) ? object.permission_role_channel.map((e) => PermissionRoleChannel.fromJSON(e)) : []
7007
+ permission_role_channel: globalThis.Array.isArray(object == null ? void 0 : object.permission_role_channel) ? object.permission_role_channel.map((e) => PermissionRoleChannel.fromJSON(e)) : [],
7008
+ user_id: isSet4(object.user_id) ? globalThis.String(object.user_id) : ""
6999
7009
  };
7000
7010
  },
7001
7011
  toJSON(message) {
@@ -7010,17 +7020,21 @@ var PermissionRoleChannelListEvent = {
7010
7020
  if ((_a = message.permission_role_channel) == null ? void 0 : _a.length) {
7011
7021
  obj.permission_role_channel = message.permission_role_channel.map((e) => PermissionRoleChannel.toJSON(e));
7012
7022
  }
7023
+ if (message.user_id !== "") {
7024
+ obj.user_id = message.user_id;
7025
+ }
7013
7026
  return obj;
7014
7027
  },
7015
7028
  create(base) {
7016
7029
  return PermissionRoleChannelListEvent.fromPartial(base != null ? base : {});
7017
7030
  },
7018
7031
  fromPartial(object) {
7019
- var _a, _b, _c;
7032
+ var _a, _b, _c, _d;
7020
7033
  const message = createBasePermissionRoleChannelListEvent();
7021
7034
  message.role_id = (_a = object.role_id) != null ? _a : "";
7022
7035
  message.channel_id = (_b = object.channel_id) != null ? _b : "";
7023
7036
  message.permission_role_channel = ((_c = object.permission_role_channel) == null ? void 0 : _c.map((e) => PermissionRoleChannel.fromPartial(e))) || [];
7037
+ message.user_id = (_d = object.user_id) != null ? _d : "";
7024
7038
  return message;
7025
7039
  }
7026
7040
  };
@@ -14659,10 +14673,16 @@ var WebSocketAdapterPb = class {
14659
14673
  return ((_a = this._socket) == null ? void 0 : _a.readyState) == WebSocket.OPEN;
14660
14674
  }
14661
14675
  close() {
14662
- this._socket.close();
14676
+ var _a;
14677
+ (_a = this._socket) == null ? void 0 : _a.close();
14663
14678
  this._socket = void 0;
14664
14679
  }
14665
- connect(scheme, host, port, createStatus, token) {
14680
+ connect(scheme, host, port, createStatus, token, signal) {
14681
+ if (signal) {
14682
+ signal.addEventListener("abort", () => {
14683
+ this.close();
14684
+ });
14685
+ }
14666
14686
  const url = `${scheme}${host}:${port}/ws?lang=en&status=${encodeURIComponent(createStatus.toString())}&token=${encodeURIComponent(token)}&format=protobuf`;
14667
14687
  this._socket = new WebSocket(url);
14668
14688
  this._socket.binaryType = "arraybuffer";
@@ -6930,7 +6930,7 @@ var AddClanUserEvent = {
6930
6930
  }
6931
6931
  };
6932
6932
  function createBasePermissionRoleChannelListEvent() {
6933
- return { role_id: "", channel_id: "", permission_role_channel: [] };
6933
+ return { role_id: "", channel_id: "", permission_role_channel: [], user_id: "" };
6934
6934
  }
6935
6935
  var PermissionRoleChannelListEvent = {
6936
6936
  encode(message, writer = import_minimal5.default.Writer.create()) {
@@ -6943,6 +6943,9 @@ var PermissionRoleChannelListEvent = {
6943
6943
  for (const v of message.permission_role_channel) {
6944
6944
  PermissionRoleChannel.encode(v, writer.uint32(26).fork()).ldelim();
6945
6945
  }
6946
+ if (message.user_id !== "") {
6947
+ writer.uint32(34).string(message.user_id);
6948
+ }
6946
6949
  return writer;
6947
6950
  },
6948
6951
  decode(input, length) {
@@ -6970,6 +6973,12 @@ var PermissionRoleChannelListEvent = {
6970
6973
  }
6971
6974
  message.permission_role_channel.push(PermissionRoleChannel.decode(reader, reader.uint32()));
6972
6975
  continue;
6976
+ case 4:
6977
+ if (tag !== 34) {
6978
+ break;
6979
+ }
6980
+ message.user_id = reader.string();
6981
+ continue;
6973
6982
  }
6974
6983
  if ((tag & 7) === 4 || tag === 0) {
6975
6984
  break;
@@ -6982,7 +6991,8 @@ var PermissionRoleChannelListEvent = {
6982
6991
  return {
6983
6992
  role_id: isSet4(object.role_id) ? globalThis.String(object.role_id) : "",
6984
6993
  channel_id: isSet4(object.channel_id) ? globalThis.String(object.channel_id) : "",
6985
- permission_role_channel: globalThis.Array.isArray(object == null ? void 0 : object.permission_role_channel) ? object.permission_role_channel.map((e) => PermissionRoleChannel.fromJSON(e)) : []
6994
+ permission_role_channel: globalThis.Array.isArray(object == null ? void 0 : object.permission_role_channel) ? object.permission_role_channel.map((e) => PermissionRoleChannel.fromJSON(e)) : [],
6995
+ user_id: isSet4(object.user_id) ? globalThis.String(object.user_id) : ""
6986
6996
  };
6987
6997
  },
6988
6998
  toJSON(message) {
@@ -6997,17 +7007,21 @@ var PermissionRoleChannelListEvent = {
6997
7007
  if ((_a = message.permission_role_channel) == null ? void 0 : _a.length) {
6998
7008
  obj.permission_role_channel = message.permission_role_channel.map((e) => PermissionRoleChannel.toJSON(e));
6999
7009
  }
7010
+ if (message.user_id !== "") {
7011
+ obj.user_id = message.user_id;
7012
+ }
7000
7013
  return obj;
7001
7014
  },
7002
7015
  create(base) {
7003
7016
  return PermissionRoleChannelListEvent.fromPartial(base != null ? base : {});
7004
7017
  },
7005
7018
  fromPartial(object) {
7006
- var _a, _b, _c;
7019
+ var _a, _b, _c, _d;
7007
7020
  const message = createBasePermissionRoleChannelListEvent();
7008
7021
  message.role_id = (_a = object.role_id) != null ? _a : "";
7009
7022
  message.channel_id = (_b = object.channel_id) != null ? _b : "";
7010
7023
  message.permission_role_channel = ((_c = object.permission_role_channel) == null ? void 0 : _c.map((e) => PermissionRoleChannel.fromPartial(e))) || [];
7024
+ message.user_id = (_d = object.user_id) != null ? _d : "";
7011
7025
  return message;
7012
7026
  }
7013
7027
  };
@@ -14646,10 +14660,16 @@ var WebSocketAdapterPb = class {
14646
14660
  return ((_a = this._socket) == null ? void 0 : _a.readyState) == WebSocket.OPEN;
14647
14661
  }
14648
14662
  close() {
14649
- this._socket.close();
14663
+ var _a;
14664
+ (_a = this._socket) == null ? void 0 : _a.close();
14650
14665
  this._socket = void 0;
14651
14666
  }
14652
- connect(scheme, host, port, createStatus, token) {
14667
+ connect(scheme, host, port, createStatus, token, signal) {
14668
+ if (signal) {
14669
+ signal.addEventListener("abort", () => {
14670
+ this.close();
14671
+ });
14672
+ }
14653
14673
  const url = `${scheme}${host}:${port}/ws?lang=en&status=${encodeURIComponent(createStatus.toString())}&token=${encodeURIComponent(token)}&format=protobuf`;
14654
14674
  this._socket = new WebSocket(url);
14655
14675
  this._socket.binaryType = "arraybuffer";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mezon-js-protobuf",
3
- "version": "1.5.68",
3
+ "version": "1.5.70",
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",
package/rtapi/realtime.ts CHANGED
@@ -333,6 +333,8 @@ export interface PermissionRoleChannelListEvent {
333
333
  channel_id: string;
334
334
  /** A list of permission. */
335
335
  permission_role_channel: PermissionRoleChannel[];
336
+ /** */
337
+ user_id: string;
336
338
  }
337
339
 
338
340
  /** A list of permission user in channel. */
@@ -3002,7 +3004,7 @@ export const AddClanUserEvent = {
3002
3004
  };
3003
3005
 
3004
3006
  function createBasePermissionRoleChannelListEvent(): PermissionRoleChannelListEvent {
3005
- return { role_id: "", channel_id: "", permission_role_channel: [] };
3007
+ return { role_id: "", channel_id: "", permission_role_channel: [], user_id: "" };
3006
3008
  }
3007
3009
 
3008
3010
  export const PermissionRoleChannelListEvent = {
@@ -3016,6 +3018,9 @@ export const PermissionRoleChannelListEvent = {
3016
3018
  for (const v of message.permission_role_channel) {
3017
3019
  PermissionRoleChannel.encode(v!, writer.uint32(26).fork()).ldelim();
3018
3020
  }
3021
+ if (message.user_id !== "") {
3022
+ writer.uint32(34).string(message.user_id);
3023
+ }
3019
3024
  return writer;
3020
3025
  },
3021
3026
 
@@ -3047,6 +3052,13 @@ export const PermissionRoleChannelListEvent = {
3047
3052
 
3048
3053
  message.permission_role_channel.push(PermissionRoleChannel.decode(reader, reader.uint32()));
3049
3054
  continue;
3055
+ case 4:
3056
+ if (tag !== 34) {
3057
+ break;
3058
+ }
3059
+
3060
+ message.user_id = reader.string();
3061
+ continue;
3050
3062
  }
3051
3063
  if ((tag & 7) === 4 || tag === 0) {
3052
3064
  break;
@@ -3063,6 +3075,7 @@ export const PermissionRoleChannelListEvent = {
3063
3075
  permission_role_channel: globalThis.Array.isArray(object?.permission_role_channel)
3064
3076
  ? object.permission_role_channel.map((e: any) => PermissionRoleChannel.fromJSON(e))
3065
3077
  : [],
3078
+ user_id: isSet(object.user_id) ? globalThis.String(object.user_id) : "",
3066
3079
  };
3067
3080
  },
3068
3081
 
@@ -3077,6 +3090,9 @@ export const PermissionRoleChannelListEvent = {
3077
3090
  if (message.permission_role_channel?.length) {
3078
3091
  obj.permission_role_channel = message.permission_role_channel.map((e) => PermissionRoleChannel.toJSON(e));
3079
3092
  }
3093
+ if (message.user_id !== "") {
3094
+ obj.user_id = message.user_id;
3095
+ }
3080
3096
  return obj;
3081
3097
  },
3082
3098
 
@@ -3091,6 +3107,7 @@ export const PermissionRoleChannelListEvent = {
3091
3107
  message.channel_id = object.channel_id ?? "";
3092
3108
  message.permission_role_channel =
3093
3109
  object.permission_role_channel?.map((e) => PermissionRoleChannel.fromPartial(e)) || [];
3110
+ message.user_id = object.user_id ?? "";
3094
3111
  return message;
3095
3112
  },
3096
3113
  };
@@ -83,11 +83,16 @@ export class WebSocketAdapterPb implements WebSocketAdapter {
83
83
  }
84
84
 
85
85
  close() {
86
- this._socket!.close();
86
+ this._socket?.close();
87
87
  this._socket = undefined;
88
88
  }
89
89
 
90
- connect(scheme: string, host: string, port: string, createStatus: boolean, token: string): void {
90
+ connect(scheme: string, host: string, port: string, createStatus: boolean, token: string, signal?: AbortSignal): void {
91
+ if (signal) {
92
+ signal.addEventListener('abort', () => {
93
+ this.close();
94
+ });
95
+ }
91
96
  const url = `${scheme}${host}:${port}/ws?lang=en&status=${encodeURIComponent(createStatus.toString())}&token=${encodeURIComponent(token)}&format=protobuf`;
92
97
  this._socket = new WebSocket(url);
93
98
  this._socket.binaryType = "arraybuffer";