mezon-js 2.8.20 → 2.8.22

Sign up to get free protection for your applications and to get access to all the features.
package/api.gen.ts CHANGED
@@ -499,12 +499,6 @@ export interface ApiChannelUserList {
499
499
  cursor?: string;
500
500
  }
501
501
 
502
- /** */
503
- export interface ApiChannelVoiceList {
504
- //A list of channel.
505
- channelvoice?: Array<ApiDirectChannelVoice>;
506
- }
507
-
508
502
  /** */
509
503
  export interface ApiCheckDuplicateClanNameResponse {
510
504
  //
@@ -781,24 +775,6 @@ export interface ApiDeleteStorageObjectsRequest {
781
775
  object_ids?: Array<ApiDeleteStorageObjectId>;
782
776
  }
783
777
 
784
- /** */
785
- export interface ApiDirectChannelVoice {
786
- //The channel id.
787
- channel_id?: string;
788
- //
789
- channel_label?: string;
790
- //
791
- channel_private?: number;
792
- //
793
- clan_id?: string;
794
- //
795
- clan_name?: string;
796
- //
797
- meeting_code?: string;
798
- //
799
- type?: number;
800
- }
801
-
802
778
  /** Represents an event to be passed through the server to registered event handlers. */
803
779
  export interface ApiEvent {
804
780
  //True if the event came directly from a client call, false otherwise.
@@ -875,6 +851,30 @@ export interface ApiFriendList {
875
851
  friends?: Array<ApiFriend>;
876
852
  }
877
853
 
854
+ /** */
855
+ export interface ApiHashtagDmVoice {
856
+ //The channel id.
857
+ channel_id?: string;
858
+ //
859
+ channel_label?: string;
860
+ //
861
+ channel_private?: number;
862
+ //
863
+ clan_id?: string;
864
+ //
865
+ clan_name?: string;
866
+ //
867
+ meeting_code?: string;
868
+ //
869
+ type?: number;
870
+ }
871
+
872
+ /** */
873
+ export interface ApiHashtagDmVoiceList {
874
+ //A list of channel.
875
+ hashtage_voice?: Array<ApiHashtagDmVoice>;
876
+ }
877
+
878
878
  /** Add link invite users to. */
879
879
  export interface ApiInviteUserRes {
880
880
  //id channel to add link to.
@@ -1111,6 +1111,8 @@ export interface ApiPermission {
1111
1111
  //
1112
1112
  id?: string;
1113
1113
  //
1114
+ scope?: number;
1115
+ //
1114
1116
  slug?: string;
1115
1117
  //
1116
1118
  title?: string;
@@ -1122,6 +1124,28 @@ export interface ApiPermissionList {
1122
1124
  permissions?: Array<ApiPermission>;
1123
1125
  }
1124
1126
 
1127
+ /** */
1128
+ export interface ApiPermissionRoleChannel {
1129
+ //
1130
+ active?: boolean;
1131
+ //
1132
+ permission_id?: string;
1133
+ }
1134
+
1135
+ /** A list of permission role channel. */
1136
+ export interface ApiPermissionRoleChannelList {
1137
+ //A list of permission.
1138
+ permission_role_channel?: Array<ApiPermissionRoleChannel>;
1139
+ }
1140
+
1141
+ /** */
1142
+ export interface ApiPermissionUpdate {
1143
+ //
1144
+ permission_id?: string;
1145
+ //
1146
+ type?: number;
1147
+ }
1148
+
1125
1149
  /** */
1126
1150
  export interface ApiPinMessage {
1127
1151
  //
@@ -1458,6 +1482,16 @@ export interface ApiUpdateCategoryDescRequest {
1458
1482
  category_name?: string;
1459
1483
  }
1460
1484
 
1485
+ /** */
1486
+ export interface ApiUpdateRoleChannelRequest {
1487
+ //
1488
+ channel_id?: string;
1489
+ //The permissions to add.
1490
+ permission_update?: Array<ApiPermissionUpdate>;
1491
+ //The ID of the role to update.
1492
+ role_id?: string;
1493
+ }
1494
+
1461
1495
  /** Fetch a batch of zero or more users from the server. */
1462
1496
  export interface ApiUpdateUsersRequest {
1463
1497
  //The avarar_url of a user.
@@ -3356,41 +3390,6 @@ export class MezonApi {
3356
3390
  ]);
3357
3391
  }
3358
3392
 
3359
- /** List channelvoices */
3360
- directChannelVoiceList(bearerToken: string,
3361
- userId?:Array<string>,
3362
- limit?:number,
3363
- options: any = {}): Promise<ApiChannelVoiceList> {
3364
-
3365
- const urlPath = "/v2/channelvoices";
3366
- const queryParams = new Map<string, any>();
3367
- queryParams.set("user_id", userId);
3368
- queryParams.set("limit", limit);
3369
-
3370
- let bodyJson : string = "";
3371
-
3372
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
3373
- const fetchOptions = buildFetchOptions("GET", options, bodyJson);
3374
- if (bearerToken) {
3375
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
3376
- }
3377
-
3378
- return Promise.race([
3379
- fetch(fullUrl, fetchOptions).then((response) => {
3380
- if (response.status == 204) {
3381
- return response;
3382
- } else if (response.status >= 200 && response.status < 300) {
3383
- return response.json();
3384
- } else {
3385
- throw response;
3386
- }
3387
- }),
3388
- new Promise((_, reject) =>
3389
- setTimeout(reject, this.timeoutMs, "Request timed out.")
3390
- ),
3391
- ]);
3392
- }
3393
-
3394
3393
  /** List clans */
3395
3394
  listClanDescs(bearerToken: string,
3396
3395
  limit?:number,
@@ -3945,42 +3944,6 @@ export class MezonApi {
3945
3944
  ]);
3946
3945
  }
3947
3946
 
3948
- /** Get emoji list by clan id */
3949
- listClanEmojiByClanId(bearerToken: string,
3950
- clanId:string,
3951
- options: any = {}): Promise<ApiClanEmojiList> {
3952
-
3953
- if (clanId === null || clanId === undefined) {
3954
- throw new Error("'clanId' is a required parameter but is null or undefined.");
3955
- }
3956
- const urlPath = "/v2/emoji/{clanId}"
3957
- .replace("{clanId}", encodeURIComponent(String(clanId)));
3958
- const queryParams = new Map<string, any>();
3959
-
3960
- let bodyJson : string = "";
3961
-
3962
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
3963
- const fetchOptions = buildFetchOptions("GET", options, bodyJson);
3964
- if (bearerToken) {
3965
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
3966
- }
3967
-
3968
- return Promise.race([
3969
- fetch(fullUrl, fetchOptions).then((response) => {
3970
- if (response.status == 204) {
3971
- return response;
3972
- } else if (response.status >= 200 && response.status < 300) {
3973
- return response.json();
3974
- } else {
3975
- throw response;
3976
- }
3977
- }),
3978
- new Promise((_, reject) =>
3979
- setTimeout(reject, this.timeoutMs, "Request timed out.")
3980
- ),
3981
- ]);
3982
- }
3983
-
3984
3947
  /** Delete a emoji by ID. */
3985
3948
  deleteByIdClanEmoji(bearerToken: string,
3986
3949
  id:string,
@@ -4568,6 +4531,41 @@ export class MezonApi {
4568
4531
  ]);
4569
4532
  }
4570
4533
 
4534
+ /** List channelvoices */
4535
+ hashtagDMVoiceList(bearerToken: string,
4536
+ userId?:Array<string>,
4537
+ limit?:number,
4538
+ options: any = {}): Promise<ApiHashtagDmVoiceList> {
4539
+
4540
+ const urlPath = "/v2/hashtagdmvoice";
4541
+ const queryParams = new Map<string, any>();
4542
+ queryParams.set("user_id", userId);
4543
+ queryParams.set("limit", limit);
4544
+
4545
+ let bodyJson : string = "";
4546
+
4547
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
4548
+ const fetchOptions = buildFetchOptions("GET", options, bodyJson);
4549
+ if (bearerToken) {
4550
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
4551
+ }
4552
+
4553
+ return Promise.race([
4554
+ fetch(fullUrl, fetchOptions).then((response) => {
4555
+ if (response.status == 204) {
4556
+ return response;
4557
+ } else if (response.status >= 200 && response.status < 300) {
4558
+ return response.json();
4559
+ } else {
4560
+ throw response;
4561
+ }
4562
+ }),
4563
+ new Promise((_, reject) =>
4564
+ setTimeout(reject, this.timeoutMs, "Request timed out.")
4565
+ ),
4566
+ ]);
4567
+ }
4568
+
4571
4569
  /** Add users to a channel. */
4572
4570
  createLinkInviteUser(bearerToken: string,
4573
4571
  body:ApiLinkInviteUserRequest,
@@ -5190,6 +5188,77 @@ export class MezonApi {
5190
5188
  ]);
5191
5189
  }
5192
5190
 
5191
+ /** List permission role channel */
5192
+ getListPermissionRoleChannel(bearerToken: string,
5193
+ roleId?:string,
5194
+ channelId?:string,
5195
+ options: any = {}): Promise<ApiPermissionRoleChannelList> {
5196
+
5197
+ const urlPath = "/v2/permissionrolechannel/get";
5198
+ const queryParams = new Map<string, any>();
5199
+ queryParams.set("role_id", roleId);
5200
+ queryParams.set("channel_id", channelId);
5201
+
5202
+ let bodyJson : string = "";
5203
+
5204
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
5205
+ const fetchOptions = buildFetchOptions("GET", options, bodyJson);
5206
+ if (bearerToken) {
5207
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
5208
+ }
5209
+
5210
+ return Promise.race([
5211
+ fetch(fullUrl, fetchOptions).then((response) => {
5212
+ if (response.status == 204) {
5213
+ return response;
5214
+ } else if (response.status >= 200 && response.status < 300) {
5215
+ return response.json();
5216
+ } else {
5217
+ throw response;
5218
+ }
5219
+ }),
5220
+ new Promise((_, reject) =>
5221
+ setTimeout(reject, this.timeoutMs, "Request timed out.")
5222
+ ),
5223
+ ]);
5224
+ }
5225
+
5226
+ /** set permission role channel. */
5227
+ setRoleChannelPermission(bearerToken: string,
5228
+ body:ApiUpdateRoleChannelRequest,
5229
+ options: any = {}): Promise<any> {
5230
+
5231
+ if (body === null || body === undefined) {
5232
+ throw new Error("'body' is a required parameter but is null or undefined.");
5233
+ }
5234
+ const urlPath = "/v2/permissionrolechannel/set";
5235
+ const queryParams = new Map<string, any>();
5236
+
5237
+ let bodyJson : string = "";
5238
+ bodyJson = JSON.stringify(body || {});
5239
+
5240
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
5241
+ const fetchOptions = buildFetchOptions("POST", options, bodyJson);
5242
+ if (bearerToken) {
5243
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
5244
+ }
5245
+
5246
+ return Promise.race([
5247
+ fetch(fullUrl, fetchOptions).then((response) => {
5248
+ if (response.status == 204) {
5249
+ return response;
5250
+ } else if (response.status >= 200 && response.status < 300) {
5251
+ return response.json();
5252
+ } else {
5253
+ throw response;
5254
+ }
5255
+ }),
5256
+ new Promise((_, reject) =>
5257
+ setTimeout(reject, this.timeoutMs, "Request timed out.")
5258
+ ),
5259
+ ]);
5260
+ }
5261
+
5193
5262
  /** Get permission list */
5194
5263
  getListPermission(bearerToken: string,
5195
5264
  options: any = {}): Promise<ApiPermissionList> {
@@ -5906,42 +5975,6 @@ export class MezonApi {
5906
5975
  ]);
5907
5976
  }
5908
5977
 
5909
- /** List stickers by clan ID */
5910
- listClanStickersByClanId(bearerToken: string,
5911
- clanId:string,
5912
- options: any = {}): Promise<ApiClanStickerListByClanIdResponse> {
5913
-
5914
- if (clanId === null || clanId === undefined) {
5915
- throw new Error("'clanId' is a required parameter but is null or undefined.");
5916
- }
5917
- const urlPath = "/v2/sticker/{clanId}"
5918
- .replace("{clanId}", encodeURIComponent(String(clanId)));
5919
- const queryParams = new Map<string, any>();
5920
-
5921
- let bodyJson : string = "";
5922
-
5923
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
5924
- const fetchOptions = buildFetchOptions("GET", options, bodyJson);
5925
- if (bearerToken) {
5926
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
5927
- }
5928
-
5929
- return Promise.race([
5930
- fetch(fullUrl, fetchOptions).then((response) => {
5931
- if (response.status == 204) {
5932
- return response;
5933
- } else if (response.status >= 200 && response.status < 300) {
5934
- return response.json();
5935
- } else {
5936
- throw response;
5937
- }
5938
- }),
5939
- new Promise((_, reject) =>
5940
- setTimeout(reject, this.timeoutMs, "Request timed out.")
5941
- ),
5942
- ]);
5943
- }
5944
-
5945
5978
  /** Delete a sticker by ID */
5946
5979
  deleteClanStickerById(bearerToken: string,
5947
5980
  id:string,
package/client.ts CHANGED
@@ -92,9 +92,7 @@ import {
92
92
  ApiPinMessagesList,
93
93
  ApiDeleteChannelDescRequest,
94
94
  ApiChangeChannelPrivateRequest,
95
- ApiClanEmojiList,
96
95
  ApiClanEmojiCreateRequest,
97
- ApiChannelVoiceList,
98
96
  MezonUpdateClanEmojiByIdBody,
99
97
  ApiWebhookCreateRequest,
100
98
  ApiWebhookListResponse,
@@ -102,9 +100,11 @@ import {
102
100
  ApiWebhookGenerateResponse,
103
101
  ApiCheckDuplicateClanNameResponse,
104
102
  ApiClanStickerAddRequest,
105
- ApiClanStickerListByClanIdResponse,
106
103
  MezonUpdateClanStickerByIdBody,
107
104
  MezonChangeChannelCategoryBody,
105
+ ApiHashtagDmVoiceList,
106
+ ApiPermissionRoleChannelList,
107
+ ApiUpdateRoleChannelRequest,
108
108
  } from "./api.gen";
109
109
 
110
110
  import { Session } from "./session";
@@ -2245,7 +2245,7 @@ async createPinMessage(session: Session, request: ApiPinMessageRequest): Promise
2245
2245
  });
2246
2246
  }
2247
2247
 
2248
- async getPinMessagesList(session: Session, channelId: string): Promise<ApiPinMessagesList> {
2248
+ async pinMessagesList(session: Session, channelId: string): Promise<ApiPinMessagesList> {
2249
2249
  if (this.autoRefreshSession && session.refresh_token &&
2250
2250
  session.isexpired((Date.now() + this.expiredTimespanMs)/1000)) {
2251
2251
  await this.sessionRefresh(session);
@@ -2256,13 +2256,13 @@ async getPinMessagesList(session: Session, channelId: string): Promise<ApiPinMes
2256
2256
  });
2257
2257
  }
2258
2258
 
2259
- async directChannelVoiceList(session: Session, userId:Array<string>, limit?: number): Promise<ApiChannelVoiceList> {
2259
+ async hashtagDmVoiceList(session: Session, userId:Array<string>, limit?: number): Promise<ApiHashtagDmVoiceList> {
2260
2260
  if (this.autoRefreshSession && session.refresh_token &&
2261
2261
  session.isexpired((Date.now() + this.expiredTimespanMs)/1000)) {
2262
2262
  await this.sessionRefresh(session);
2263
2263
  }
2264
2264
 
2265
- return this.apiClient.directChannelVoiceList(session.token, userId, limit).then((response: ApiChannelVoiceList) => {
2265
+ return this.apiClient.hashtagDMVoiceList(session.token, userId, limit).then((response: ApiHashtagDmVoiceList) => {
2266
2266
  return Promise.resolve(response);
2267
2267
  });
2268
2268
  }
@@ -2280,18 +2280,6 @@ async deletePinMessage(session: Session, message_id: string): Promise<boolean> {
2280
2280
  });
2281
2281
  }
2282
2282
 
2283
- /** List clan emoji. */
2284
- async listClanEmoji(session: Session, clan_id: string): Promise<ApiClanEmojiList> {
2285
- if (this.autoRefreshSession && session.refresh_token &&
2286
- session.isexpired((Date.now() + this.expiredTimespanMs)/1000)) {
2287
- await this.sessionRefresh(session);
2288
- }
2289
-
2290
- return this.apiClient.listClanEmojiByClanId(session.token, clan_id).then((response: ApiClanEmojiList) => {
2291
- return Promise.resolve(response);
2292
- });
2293
- }
2294
-
2295
2283
  /** create clan emoji */
2296
2284
  async createClanEmoji(session: Session, request: ApiClanEmojiCreateRequest) {
2297
2285
  if (this.autoRefreshSession && session.refresh_token &&
@@ -2400,18 +2388,6 @@ async addClanSticker(session: Session, request: ApiClanStickerAddRequest) {
2400
2388
  })
2401
2389
  }
2402
2390
 
2403
- //**List stickers by clan ID */
2404
- async listClanStickersByClanId(session: Session, id: string): Promise<ApiClanStickerListByClanIdResponse> {
2405
- if (this.autoRefreshSession && session.refresh_token &&
2406
- session.isexpired((Date.now() + this.expiredTimespanMs)/1000)) {
2407
- await this.sessionRefresh(session);
2408
- }
2409
-
2410
- return this.apiClient.listClanStickersByClanId(session.token, id).then((response: any) => {
2411
- return Promise.resolve(response);
2412
- })
2413
- }
2414
-
2415
2391
  //**Delete a sticker by ID*/
2416
2392
  async deleteClanStickerById(session: Session, id: string, clan_id: string) {
2417
2393
  if (this.autoRefreshSession && session.refresh_token &&
@@ -2448,4 +2424,28 @@ async changeChannelCategory(session: Session, id: string, request: MezonChangeCh
2448
2424
  })
2449
2425
  }
2450
2426
 
2427
+ /** */
2428
+ async getListPermissionRoleChannel(session: Session, roleId: string, channelId: string): Promise<ApiPermissionRoleChannelList> {
2429
+ if (this.autoRefreshSession && session.refresh_token &&
2430
+ session.isexpired((Date.now() + this.expiredTimespanMs)/1000)) {
2431
+ await this.sessionRefresh(session);
2432
+ }
2433
+
2434
+ return this.apiClient.getListPermissionRoleChannel(session.token, roleId, channelId).then((response: ApiPermissionRoleChannelList) => {
2435
+ return Promise.resolve(response);
2436
+ });
2437
+ }
2438
+
2439
+ /** */
2440
+ async setRoleChannelPermission(session: Session, request: ApiUpdateRoleChannelRequest): Promise<boolean> {
2441
+ if (this.autoRefreshSession && session.refresh_token &&
2442
+ session.isexpired((Date.now() + this.expiredTimespanMs)/1000)) {
2443
+ await this.sessionRefresh(session);
2444
+ }
2445
+
2446
+ return this.apiClient.setRoleChannelPermission(session.token, request).then((response: any) => {
2447
+ return response !== undefined;
2448
+ });
2449
+ }
2450
+
2451
2451
  };
package/dist/api.gen.d.ts CHANGED
@@ -283,10 +283,6 @@ export interface ApiChannelUserList {
283
283
  cursor?: string;
284
284
  }
285
285
  /** */
286
- export interface ApiChannelVoiceList {
287
- channelvoice?: Array<ApiDirectChannelVoice>;
288
- }
289
- /** */
290
286
  export interface ApiCheckDuplicateClanNameResponse {
291
287
  is_duplicate?: boolean;
292
288
  }
@@ -447,16 +443,6 @@ export interface ApiDeleteStorageObjectId {
447
443
  export interface ApiDeleteStorageObjectsRequest {
448
444
  object_ids?: Array<ApiDeleteStorageObjectId>;
449
445
  }
450
- /** */
451
- export interface ApiDirectChannelVoice {
452
- channel_id?: string;
453
- channel_label?: string;
454
- channel_private?: number;
455
- clan_id?: string;
456
- clan_name?: string;
457
- meeting_code?: string;
458
- type?: number;
459
- }
460
446
  /** Represents an event to be passed through the server to registered event handlers. */
461
447
  export interface ApiEvent {
462
448
  external?: boolean;
@@ -501,6 +487,20 @@ export interface ApiFriendList {
501
487
  cursor?: string;
502
488
  friends?: Array<ApiFriend>;
503
489
  }
490
+ /** */
491
+ export interface ApiHashtagDmVoice {
492
+ channel_id?: string;
493
+ channel_label?: string;
494
+ channel_private?: number;
495
+ clan_id?: string;
496
+ clan_name?: string;
497
+ meeting_code?: string;
498
+ type?: number;
499
+ }
500
+ /** */
501
+ export interface ApiHashtagDmVoiceList {
502
+ hashtage_voice?: Array<ApiHashtagDmVoice>;
503
+ }
504
504
  /** Add link invite users to. */
505
505
  export interface ApiInviteUserRes {
506
506
  channel_id?: string;
@@ -636,6 +636,7 @@ export interface ApiPermission {
636
636
  active?: number;
637
637
  description?: string;
638
638
  id?: string;
639
+ scope?: number;
639
640
  slug?: string;
640
641
  title?: string;
641
642
  }
@@ -644,6 +645,20 @@ export interface ApiPermissionList {
644
645
  permissions?: Array<ApiPermission>;
645
646
  }
646
647
  /** */
648
+ export interface ApiPermissionRoleChannel {
649
+ active?: boolean;
650
+ permission_id?: string;
651
+ }
652
+ /** A list of permission role channel. */
653
+ export interface ApiPermissionRoleChannelList {
654
+ permission_role_channel?: Array<ApiPermissionRoleChannel>;
655
+ }
656
+ /** */
657
+ export interface ApiPermissionUpdate {
658
+ permission_id?: string;
659
+ type?: number;
660
+ }
661
+ /** */
647
662
  export interface ApiPinMessage {
648
663
  avatar?: string;
649
664
  channel_id?: string;
@@ -838,6 +853,12 @@ export interface ApiUpdateCategoryDescRequest {
838
853
  category_id?: string;
839
854
  category_name?: string;
840
855
  }
856
+ /** */
857
+ export interface ApiUpdateRoleChannelRequest {
858
+ channel_id?: string;
859
+ permission_update?: Array<ApiPermissionUpdate>;
860
+ role_id?: string;
861
+ }
841
862
  /** Fetch a batch of zero or more users from the server. */
842
863
  export interface ApiUpdateUsersRequest {
843
864
  avatar_url?: string;
@@ -1041,8 +1062,6 @@ export declare class MezonApi {
1041
1062
  updateChannelDesc(bearerToken: string, channelId: string, body: {}, options?: any): Promise<any>;
1042
1063
  /** List all users that are part of a channel. */
1043
1064
  listChannelVoiceUsers(bearerToken: string, clanId?: string, channelId?: string, channelType?: number, limit?: number, state?: number, cursor?: string, options?: any): Promise<ApiVoiceChannelUserList>;
1044
- /** List channelvoices */
1045
- directChannelVoiceList(bearerToken: string, userId?: Array<string>, limit?: number, options?: any): Promise<ApiChannelVoiceList>;
1046
1065
  /** List clans */
1047
1066
  listClanDescs(bearerToken: string, limit?: number, state?: number, cursor?: string, options?: any): Promise<ApiClanDescList>;
1048
1067
  /** Create a clan */
@@ -1073,8 +1092,6 @@ export declare class MezonApi {
1073
1092
  openDirectMess(bearerToken: string, body: ApiDeleteChannelDescRequest, options?: any): Promise<any>;
1074
1093
  /** Post clan Emoji /v2/emoji/create */
1075
1094
  createClanEmoji(bearerToken: string, body: ApiClanEmojiCreateRequest, options?: any): Promise<any>;
1076
- /** Get emoji list by clan id */
1077
- listClanEmojiByClanId(bearerToken: string, clanId: string, options?: any): Promise<ApiClanEmojiList>;
1078
1095
  /** Delete a emoji by ID. */
1079
1096
  deleteByIdClanEmoji(bearerToken: string, id: string, clanId?: string, options?: any): Promise<any>;
1080
1097
  /** Update ClanEmoj By id */
@@ -1107,6 +1124,8 @@ export declare class MezonApi {
1107
1124
  importSteamFriends(bearerToken: string, account: ApiAccountSteam, reset?: boolean, options?: any): Promise<any>;
1108
1125
  /** */
1109
1126
  getUserProfileOnClan(bearerToken: string, clanId: string, options?: any): Promise<ApiClanProfile>;
1127
+ /** List channelvoices */
1128
+ hashtagDMVoiceList(bearerToken: string, userId?: Array<string>, limit?: number, options?: any): Promise<ApiHashtagDmVoiceList>;
1110
1129
  /** Add users to a channel. */
1111
1130
  createLinkInviteUser(bearerToken: string, body: ApiLinkInviteUserRequest, options?: any): Promise<ApiLinkInviteUser>;
1112
1131
  /** Add users to a channel. */
@@ -1143,6 +1162,10 @@ export declare class MezonApi {
1143
1162
  getNotificationReactMessage(bearerToken: string, channelId?: string, options?: any): Promise<ApiNotifiReactMessage>;
1144
1163
  /** */
1145
1164
  setNotificationReactMessage(bearerToken: string, body: ApiNotificationChannel, options?: any): Promise<any>;
1165
+ /** List permission role channel */
1166
+ getListPermissionRoleChannel(bearerToken: string, roleId?: string, channelId?: string, options?: any): Promise<ApiPermissionRoleChannelList>;
1167
+ /** set permission role channel. */
1168
+ setRoleChannelPermission(bearerToken: string, body: ApiUpdateRoleChannelRequest, options?: any): Promise<any>;
1146
1169
  /** Get permission list */
1147
1170
  getListPermission(bearerToken: string, options?: any): Promise<ApiPermissionList>;
1148
1171
  /** */
@@ -1181,8 +1204,6 @@ export declare class MezonApi {
1181
1204
  sessionLogout(bearerToken: string, body: ApiSessionLogoutRequest, options?: any): Promise<any>;
1182
1205
  /** Add a new sticker */
1183
1206
  addClanSticker(bearerToken: string, body: ApiClanStickerAddRequest, options?: any): Promise<any>;
1184
- /** List stickers by clan ID */
1185
- listClanStickersByClanId(bearerToken: string, clanId: string, options?: any): Promise<ApiClanStickerListByClanIdResponse>;
1186
1207
  /** Delete a sticker by ID */
1187
1208
  deleteClanStickerById(bearerToken: string, id: string, clanId?: string, options?: any): Promise<any>;
1188
1209
  /** Update a sticker by ID */
package/dist/client.d.ts CHANGED
@@ -13,7 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { ApiAccount, ApiAccountCustom, ApiAccountDevice, ApiAccountEmail, ApiAccountFacebook, ApiAccountFacebookInstantGame, ApiAccountGoogle, ApiAccountGameCenter, ApiAccountSteam, ApiChannelDescList, ApiChannelDescription, ApiCreateChannelDescRequest, ApiDeleteRoleRequest, ApiClanDescList, ApiCreateClanDescRequest, ApiClanDesc, ApiCategoryDesc, ApiCategoryDescList, ApiRoleList, ApiPermissionList, ApiRoleUserList, ApiRole, ApiCreateRoleRequest, ApiAddRoleChannelDescRequest, ApiCreateCategoryDescRequest, ApiUpdateCategoryDescRequest, ApiDeleteStorageObjectsRequest, ApiEvent, ApiReadStorageObjectsRequest, ApiStorageObjectAcks, ApiUpdateAccountRequest, ApiAccountApple, ApiLinkSteamRequest, ApiClanDescProfile, ApiClanProfile, ApiChannelUserList, ApiClanUserList, ApiLinkInviteUserRequest, ApiUpdateEventRequest, ApiLinkInviteUser, ApiInviteUserRes, ApiUploadAttachmentRequest, ApiUploadAttachment, ApiMessageReaction, ApiMessageMention, ApiMessageAttachment, ApiMessageRef, ApiChannelMessageHeader, ApiVoiceChannelUserList, ApiChannelAttachmentList, ApiCreateEventRequest, ApiEventManagement, ApiEventList, ApiDeleteEventRequest, ApiNotificationChannelCategoySettingsList, ApiNotificationSetting, ApiSetDefaultNotificationRequest, ApiNotificationUserChannel, ApiSetNotificationRequest, ApiNotifiReactMessage, ApiSetMuteNotificationRequest, ApiSearchMessageRequest, ApiSearchMessageResponse, ApiPinMessageRequest, ApiPinMessagesList, ApiDeleteChannelDescRequest, ApiChangeChannelPrivateRequest, ApiClanEmojiList, ApiClanEmojiCreateRequest, ApiChannelVoiceList, MezonUpdateClanEmojiByIdBody, ApiWebhookCreateRequest, ApiWebhookListResponse, MezonUpdateWebhookByIdBody, ApiWebhookGenerateResponse, ApiCheckDuplicateClanNameResponse, ApiClanStickerAddRequest, ApiClanStickerListByClanIdResponse, MezonUpdateClanStickerByIdBody, MezonChangeChannelCategoryBody } from "./api.gen";
16
+ import { ApiAccount, ApiAccountCustom, ApiAccountDevice, ApiAccountEmail, ApiAccountFacebook, ApiAccountFacebookInstantGame, ApiAccountGoogle, ApiAccountGameCenter, ApiAccountSteam, ApiChannelDescList, ApiChannelDescription, ApiCreateChannelDescRequest, ApiDeleteRoleRequest, ApiClanDescList, ApiCreateClanDescRequest, ApiClanDesc, ApiCategoryDesc, ApiCategoryDescList, ApiRoleList, ApiPermissionList, ApiRoleUserList, ApiRole, ApiCreateRoleRequest, ApiAddRoleChannelDescRequest, ApiCreateCategoryDescRequest, ApiUpdateCategoryDescRequest, ApiDeleteStorageObjectsRequest, ApiEvent, ApiReadStorageObjectsRequest, ApiStorageObjectAcks, ApiUpdateAccountRequest, ApiAccountApple, ApiLinkSteamRequest, ApiClanDescProfile, ApiClanProfile, ApiChannelUserList, ApiClanUserList, ApiLinkInviteUserRequest, ApiUpdateEventRequest, ApiLinkInviteUser, ApiInviteUserRes, ApiUploadAttachmentRequest, ApiUploadAttachment, ApiMessageReaction, ApiMessageMention, ApiMessageAttachment, ApiMessageRef, ApiChannelMessageHeader, ApiVoiceChannelUserList, ApiChannelAttachmentList, ApiCreateEventRequest, ApiEventManagement, ApiEventList, ApiDeleteEventRequest, ApiNotificationChannelCategoySettingsList, ApiNotificationSetting, ApiSetDefaultNotificationRequest, ApiNotificationUserChannel, ApiSetNotificationRequest, ApiNotifiReactMessage, ApiSetMuteNotificationRequest, ApiSearchMessageRequest, ApiSearchMessageResponse, ApiPinMessageRequest, ApiPinMessagesList, ApiDeleteChannelDescRequest, ApiChangeChannelPrivateRequest, ApiClanEmojiCreateRequest, MezonUpdateClanEmojiByIdBody, ApiWebhookCreateRequest, ApiWebhookListResponse, MezonUpdateWebhookByIdBody, ApiWebhookGenerateResponse, ApiCheckDuplicateClanNameResponse, ApiClanStickerAddRequest, MezonUpdateClanStickerByIdBody, MezonChangeChannelCategoryBody, ApiHashtagDmVoiceList, ApiPermissionRoleChannelList, ApiUpdateRoleChannelRequest } from "./api.gen";
17
17
  import { Session } from "./session";
18
18
  import { Socket } from "./socket";
19
19
  import { WebSocketAdapter } from "./web_socket_adapter";
@@ -581,11 +581,9 @@ export declare class Client {
581
581
  searchMessage(session: Session, request: ApiSearchMessageRequest): Promise<ApiSearchMessageResponse>;
582
582
  /** */
583
583
  createPinMessage(session: Session, request: ApiPinMessageRequest): Promise<boolean>;
584
- getPinMessagesList(session: Session, channelId: string): Promise<ApiPinMessagesList>;
585
- directChannelVoiceList(session: Session, userId: Array<string>, limit?: number): Promise<ApiChannelVoiceList>;
584
+ pinMessagesList(session: Session, channelId: string): Promise<ApiPinMessagesList>;
585
+ hashtagDmVoiceList(session: Session, userId: Array<string>, limit?: number): Promise<ApiHashtagDmVoiceList>;
586
586
  deletePinMessage(session: Session, message_id: string): Promise<boolean>;
587
- /** List clan emoji. */
588
- listClanEmoji(session: Session, clan_id: string): Promise<ApiClanEmojiList>;
589
587
  /** create clan emoji */
590
588
  createClanEmoji(session: Session, request: ApiClanEmojiCreateRequest): Promise<boolean>;
591
589
  updateClanEmojiById(session: Session, id: string, request: MezonUpdateClanEmojiByIdBody): Promise<boolean>;
@@ -596,8 +594,11 @@ export declare class Client {
596
594
  deleteWebhookById(session: Session, id: string): Promise<boolean>;
597
595
  checkDuplicateClanName(session: Session, clan_name: string): Promise<ApiCheckDuplicateClanNameResponse>;
598
596
  addClanSticker(session: Session, request: ApiClanStickerAddRequest): Promise<boolean>;
599
- listClanStickersByClanId(session: Session, id: string): Promise<ApiClanStickerListByClanIdResponse>;
600
597
  deleteClanStickerById(session: Session, id: string, clan_id: string): Promise<boolean>;
601
598
  updateClanStickerById(session: Session, id: string, request: MezonUpdateClanStickerByIdBody): Promise<boolean>;
602
599
  changeChannelCategory(session: Session, id: string, request: MezonChangeChannelCategoryBody): Promise<boolean>;
600
+ /** */
601
+ getListPermissionRoleChannel(session: Session, roleId: string, channelId: string): Promise<ApiPermissionRoleChannelList>;
602
+ /** */
603
+ setRoleChannelPermission(session: Session, request: ApiUpdateRoleChannelRequest): Promise<boolean>;
603
604
  }
@@ -1983,33 +1983,6 @@ var MezonApi = class {
1983
1983
  )
1984
1984
  ]);
1985
1985
  }
1986
- /** List channelvoices */
1987
- directChannelVoiceList(bearerToken, userId, limit, options = {}) {
1988
- const urlPath = "/v2/channelvoices";
1989
- const queryParams = /* @__PURE__ */ new Map();
1990
- queryParams.set("user_id", userId);
1991
- queryParams.set("limit", limit);
1992
- let bodyJson = "";
1993
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
1994
- const fetchOptions = buildFetchOptions("GET", options, bodyJson);
1995
- if (bearerToken) {
1996
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
1997
- }
1998
- return Promise.race([
1999
- fetch(fullUrl, fetchOptions).then((response) => {
2000
- if (response.status == 204) {
2001
- return response;
2002
- } else if (response.status >= 200 && response.status < 300) {
2003
- return response.json();
2004
- } else {
2005
- throw response;
2006
- }
2007
- }),
2008
- new Promise(
2009
- (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
2010
- )
2011
- ]);
2012
- }
2013
1986
  /** List clans */
2014
1987
  listClanDescs(bearerToken, limit, state, cursor, options = {}) {
2015
1988
  const urlPath = "/v2/clandesc";
@@ -2444,34 +2417,6 @@ var MezonApi = class {
2444
2417
  )
2445
2418
  ]);
2446
2419
  }
2447
- /** Get emoji list by clan id */
2448
- listClanEmojiByClanId(bearerToken, clanId, options = {}) {
2449
- if (clanId === null || clanId === void 0) {
2450
- throw new Error("'clanId' is a required parameter but is null or undefined.");
2451
- }
2452
- const urlPath = "/v2/emoji/{clanId}".replace("{clanId}", encodeURIComponent(String(clanId)));
2453
- const queryParams = /* @__PURE__ */ new Map();
2454
- let bodyJson = "";
2455
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
2456
- const fetchOptions = buildFetchOptions("GET", options, bodyJson);
2457
- if (bearerToken) {
2458
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
2459
- }
2460
- return Promise.race([
2461
- fetch(fullUrl, fetchOptions).then((response) => {
2462
- if (response.status == 204) {
2463
- return response;
2464
- } else if (response.status >= 200 && response.status < 300) {
2465
- return response.json();
2466
- } else {
2467
- throw response;
2468
- }
2469
- }),
2470
- new Promise(
2471
- (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
2472
- )
2473
- ]);
2474
- }
2475
2420
  /** Delete a emoji by ID. */
2476
2421
  deleteByIdClanEmoji(bearerToken, id, clanId, options = {}) {
2477
2422
  if (id === null || id === void 0) {
@@ -2932,6 +2877,33 @@ var MezonApi = class {
2932
2877
  )
2933
2878
  ]);
2934
2879
  }
2880
+ /** List channelvoices */
2881
+ hashtagDMVoiceList(bearerToken, userId, limit, options = {}) {
2882
+ const urlPath = "/v2/hashtagdmvoice";
2883
+ const queryParams = /* @__PURE__ */ new Map();
2884
+ queryParams.set("user_id", userId);
2885
+ queryParams.set("limit", limit);
2886
+ let bodyJson = "";
2887
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
2888
+ const fetchOptions = buildFetchOptions("GET", options, bodyJson);
2889
+ if (bearerToken) {
2890
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
2891
+ }
2892
+ return Promise.race([
2893
+ fetch(fullUrl, fetchOptions).then((response) => {
2894
+ if (response.status == 204) {
2895
+ return response;
2896
+ } else if (response.status >= 200 && response.status < 300) {
2897
+ return response.json();
2898
+ } else {
2899
+ throw response;
2900
+ }
2901
+ }),
2902
+ new Promise(
2903
+ (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
2904
+ )
2905
+ ]);
2906
+ }
2935
2907
  /** Add users to a channel. */
2936
2908
  createLinkInviteUser(bearerToken, body, options = {}) {
2937
2909
  if (body === null || body === void 0) {
@@ -3424,6 +3396,62 @@ var MezonApi = class {
3424
3396
  )
3425
3397
  ]);
3426
3398
  }
3399
+ /** List permission role channel */
3400
+ getListPermissionRoleChannel(bearerToken, roleId, channelId, options = {}) {
3401
+ const urlPath = "/v2/permissionrolechannel/get";
3402
+ const queryParams = /* @__PURE__ */ new Map();
3403
+ queryParams.set("role_id", roleId);
3404
+ queryParams.set("channel_id", channelId);
3405
+ let bodyJson = "";
3406
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
3407
+ const fetchOptions = buildFetchOptions("GET", options, bodyJson);
3408
+ if (bearerToken) {
3409
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
3410
+ }
3411
+ return Promise.race([
3412
+ fetch(fullUrl, fetchOptions).then((response) => {
3413
+ if (response.status == 204) {
3414
+ return response;
3415
+ } else if (response.status >= 200 && response.status < 300) {
3416
+ return response.json();
3417
+ } else {
3418
+ throw response;
3419
+ }
3420
+ }),
3421
+ new Promise(
3422
+ (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
3423
+ )
3424
+ ]);
3425
+ }
3426
+ /** set permission role channel. */
3427
+ setRoleChannelPermission(bearerToken, body, options = {}) {
3428
+ if (body === null || body === void 0) {
3429
+ throw new Error("'body' is a required parameter but is null or undefined.");
3430
+ }
3431
+ const urlPath = "/v2/permissionrolechannel/set";
3432
+ const queryParams = /* @__PURE__ */ new Map();
3433
+ let bodyJson = "";
3434
+ bodyJson = JSON.stringify(body || {});
3435
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
3436
+ const fetchOptions = buildFetchOptions("POST", options, bodyJson);
3437
+ if (bearerToken) {
3438
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
3439
+ }
3440
+ return Promise.race([
3441
+ fetch(fullUrl, fetchOptions).then((response) => {
3442
+ if (response.status == 204) {
3443
+ return response;
3444
+ } else if (response.status >= 200 && response.status < 300) {
3445
+ return response.json();
3446
+ } else {
3447
+ throw response;
3448
+ }
3449
+ }),
3450
+ new Promise(
3451
+ (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
3452
+ )
3453
+ ]);
3454
+ }
3427
3455
  /** Get permission list */
3428
3456
  getListPermission(bearerToken, options = {}) {
3429
3457
  const urlPath = "/v2/permissions";
@@ -3984,34 +4012,6 @@ var MezonApi = class {
3984
4012
  )
3985
4013
  ]);
3986
4014
  }
3987
- /** List stickers by clan ID */
3988
- listClanStickersByClanId(bearerToken, clanId, options = {}) {
3989
- if (clanId === null || clanId === void 0) {
3990
- throw new Error("'clanId' is a required parameter but is null or undefined.");
3991
- }
3992
- const urlPath = "/v2/sticker/{clanId}".replace("{clanId}", encodeURIComponent(String(clanId)));
3993
- const queryParams = /* @__PURE__ */ new Map();
3994
- let bodyJson = "";
3995
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
3996
- const fetchOptions = buildFetchOptions("GET", options, bodyJson);
3997
- if (bearerToken) {
3998
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
3999
- }
4000
- return Promise.race([
4001
- fetch(fullUrl, fetchOptions).then((response) => {
4002
- if (response.status == 204) {
4003
- return response;
4004
- } else if (response.status >= 200 && response.status < 300) {
4005
- return response.json();
4006
- } else {
4007
- throw response;
4008
- }
4009
- }),
4010
- new Promise(
4011
- (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
4012
- )
4013
- ]);
4014
- }
4015
4015
  /** Delete a sticker by ID */
4016
4016
  deleteClanStickerById(bearerToken, id, clanId, options = {}) {
4017
4017
  if (id === null || id === void 0) {
@@ -5156,6 +5156,18 @@ var _DefaultSocket = class _DefaultSocket {
5156
5156
  return response.clan_name_existed_event;
5157
5157
  });
5158
5158
  }
5159
+ listClanEmojiByClanId(clan_id) {
5160
+ return __async(this, null, function* () {
5161
+ const response = yield this.send({ emojis_by_clan_id_request_event: { clan_id } });
5162
+ return response.clan_emoji_list_event;
5163
+ });
5164
+ }
5165
+ listClanStickersByClanId(clan_id) {
5166
+ return __async(this, null, function* () {
5167
+ const response = yield this.send({ clan_sticker_list_request_event: { clan_id } });
5168
+ return response.clan_sticker_list_response_event;
5169
+ });
5170
+ }
5159
5171
  pingPong() {
5160
5172
  return __async(this, null, function* () {
5161
5173
  if (!this.adapter.isOpen()) {
@@ -6774,7 +6786,7 @@ var Client = class {
6774
6786
  });
6775
6787
  });
6776
6788
  }
6777
- getPinMessagesList(session, channelId) {
6789
+ pinMessagesList(session, channelId) {
6778
6790
  return __async(this, null, function* () {
6779
6791
  if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
6780
6792
  yield this.sessionRefresh(session);
@@ -6784,12 +6796,12 @@ var Client = class {
6784
6796
  });
6785
6797
  });
6786
6798
  }
6787
- directChannelVoiceList(session, userId, limit) {
6799
+ hashtagDmVoiceList(session, userId, limit) {
6788
6800
  return __async(this, null, function* () {
6789
6801
  if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
6790
6802
  yield this.sessionRefresh(session);
6791
6803
  }
6792
- return this.apiClient.directChannelVoiceList(session.token, userId, limit).then((response) => {
6804
+ return this.apiClient.hashtagDMVoiceList(session.token, userId, limit).then((response) => {
6793
6805
  return Promise.resolve(response);
6794
6806
  });
6795
6807
  });
@@ -6805,17 +6817,6 @@ var Client = class {
6805
6817
  });
6806
6818
  });
6807
6819
  }
6808
- /** List clan emoji. */
6809
- listClanEmoji(session, clan_id) {
6810
- return __async(this, null, function* () {
6811
- if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
6812
- yield this.sessionRefresh(session);
6813
- }
6814
- return this.apiClient.listClanEmojiByClanId(session.token, clan_id).then((response) => {
6815
- return Promise.resolve(response);
6816
- });
6817
- });
6818
- }
6819
6820
  /** create clan emoji */
6820
6821
  createClanEmoji(session, request) {
6821
6822
  return __async(this, null, function* () {
@@ -6915,17 +6916,6 @@ var Client = class {
6915
6916
  });
6916
6917
  });
6917
6918
  }
6918
- //**List stickers by clan ID */
6919
- listClanStickersByClanId(session, id) {
6920
- return __async(this, null, function* () {
6921
- if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
6922
- yield this.sessionRefresh(session);
6923
- }
6924
- return this.apiClient.listClanStickersByClanId(session.token, id).then((response) => {
6925
- return Promise.resolve(response);
6926
- });
6927
- });
6928
- }
6929
6919
  //**Delete a sticker by ID*/
6930
6920
  deleteClanStickerById(session, id, clan_id) {
6931
6921
  return __async(this, null, function* () {
@@ -6959,4 +6949,26 @@ var Client = class {
6959
6949
  });
6960
6950
  });
6961
6951
  }
6952
+ /** */
6953
+ getListPermissionRoleChannel(session, roleId, channelId) {
6954
+ return __async(this, null, function* () {
6955
+ if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
6956
+ yield this.sessionRefresh(session);
6957
+ }
6958
+ return this.apiClient.getListPermissionRoleChannel(session.token, roleId, channelId).then((response) => {
6959
+ return Promise.resolve(response);
6960
+ });
6961
+ });
6962
+ }
6963
+ /** */
6964
+ setRoleChannelPermission(session, request) {
6965
+ return __async(this, null, function* () {
6966
+ if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
6967
+ yield this.sessionRefresh(session);
6968
+ }
6969
+ return this.apiClient.setRoleChannelPermission(session.token, request).then((response) => {
6970
+ return response !== void 0;
6971
+ });
6972
+ });
6973
+ }
6962
6974
  };
@@ -1954,33 +1954,6 @@ var MezonApi = class {
1954
1954
  )
1955
1955
  ]);
1956
1956
  }
1957
- /** List channelvoices */
1958
- directChannelVoiceList(bearerToken, userId, limit, options = {}) {
1959
- const urlPath = "/v2/channelvoices";
1960
- const queryParams = /* @__PURE__ */ new Map();
1961
- queryParams.set("user_id", userId);
1962
- queryParams.set("limit", limit);
1963
- let bodyJson = "";
1964
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
1965
- const fetchOptions = buildFetchOptions("GET", options, bodyJson);
1966
- if (bearerToken) {
1967
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
1968
- }
1969
- return Promise.race([
1970
- fetch(fullUrl, fetchOptions).then((response) => {
1971
- if (response.status == 204) {
1972
- return response;
1973
- } else if (response.status >= 200 && response.status < 300) {
1974
- return response.json();
1975
- } else {
1976
- throw response;
1977
- }
1978
- }),
1979
- new Promise(
1980
- (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
1981
- )
1982
- ]);
1983
- }
1984
1957
  /** List clans */
1985
1958
  listClanDescs(bearerToken, limit, state, cursor, options = {}) {
1986
1959
  const urlPath = "/v2/clandesc";
@@ -2415,34 +2388,6 @@ var MezonApi = class {
2415
2388
  )
2416
2389
  ]);
2417
2390
  }
2418
- /** Get emoji list by clan id */
2419
- listClanEmojiByClanId(bearerToken, clanId, options = {}) {
2420
- if (clanId === null || clanId === void 0) {
2421
- throw new Error("'clanId' is a required parameter but is null or undefined.");
2422
- }
2423
- const urlPath = "/v2/emoji/{clanId}".replace("{clanId}", encodeURIComponent(String(clanId)));
2424
- const queryParams = /* @__PURE__ */ new Map();
2425
- let bodyJson = "";
2426
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
2427
- const fetchOptions = buildFetchOptions("GET", options, bodyJson);
2428
- if (bearerToken) {
2429
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
2430
- }
2431
- return Promise.race([
2432
- fetch(fullUrl, fetchOptions).then((response) => {
2433
- if (response.status == 204) {
2434
- return response;
2435
- } else if (response.status >= 200 && response.status < 300) {
2436
- return response.json();
2437
- } else {
2438
- throw response;
2439
- }
2440
- }),
2441
- new Promise(
2442
- (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
2443
- )
2444
- ]);
2445
- }
2446
2391
  /** Delete a emoji by ID. */
2447
2392
  deleteByIdClanEmoji(bearerToken, id, clanId, options = {}) {
2448
2393
  if (id === null || id === void 0) {
@@ -2903,6 +2848,33 @@ var MezonApi = class {
2903
2848
  )
2904
2849
  ]);
2905
2850
  }
2851
+ /** List channelvoices */
2852
+ hashtagDMVoiceList(bearerToken, userId, limit, options = {}) {
2853
+ const urlPath = "/v2/hashtagdmvoice";
2854
+ const queryParams = /* @__PURE__ */ new Map();
2855
+ queryParams.set("user_id", userId);
2856
+ queryParams.set("limit", limit);
2857
+ let bodyJson = "";
2858
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
2859
+ const fetchOptions = buildFetchOptions("GET", options, bodyJson);
2860
+ if (bearerToken) {
2861
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
2862
+ }
2863
+ return Promise.race([
2864
+ fetch(fullUrl, fetchOptions).then((response) => {
2865
+ if (response.status == 204) {
2866
+ return response;
2867
+ } else if (response.status >= 200 && response.status < 300) {
2868
+ return response.json();
2869
+ } else {
2870
+ throw response;
2871
+ }
2872
+ }),
2873
+ new Promise(
2874
+ (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
2875
+ )
2876
+ ]);
2877
+ }
2906
2878
  /** Add users to a channel. */
2907
2879
  createLinkInviteUser(bearerToken, body, options = {}) {
2908
2880
  if (body === null || body === void 0) {
@@ -3395,6 +3367,62 @@ var MezonApi = class {
3395
3367
  )
3396
3368
  ]);
3397
3369
  }
3370
+ /** List permission role channel */
3371
+ getListPermissionRoleChannel(bearerToken, roleId, channelId, options = {}) {
3372
+ const urlPath = "/v2/permissionrolechannel/get";
3373
+ const queryParams = /* @__PURE__ */ new Map();
3374
+ queryParams.set("role_id", roleId);
3375
+ queryParams.set("channel_id", channelId);
3376
+ let bodyJson = "";
3377
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
3378
+ const fetchOptions = buildFetchOptions("GET", options, bodyJson);
3379
+ if (bearerToken) {
3380
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
3381
+ }
3382
+ return Promise.race([
3383
+ fetch(fullUrl, fetchOptions).then((response) => {
3384
+ if (response.status == 204) {
3385
+ return response;
3386
+ } else if (response.status >= 200 && response.status < 300) {
3387
+ return response.json();
3388
+ } else {
3389
+ throw response;
3390
+ }
3391
+ }),
3392
+ new Promise(
3393
+ (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
3394
+ )
3395
+ ]);
3396
+ }
3397
+ /** set permission role channel. */
3398
+ setRoleChannelPermission(bearerToken, body, options = {}) {
3399
+ if (body === null || body === void 0) {
3400
+ throw new Error("'body' is a required parameter but is null or undefined.");
3401
+ }
3402
+ const urlPath = "/v2/permissionrolechannel/set";
3403
+ const queryParams = /* @__PURE__ */ new Map();
3404
+ let bodyJson = "";
3405
+ bodyJson = JSON.stringify(body || {});
3406
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
3407
+ const fetchOptions = buildFetchOptions("POST", options, bodyJson);
3408
+ if (bearerToken) {
3409
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
3410
+ }
3411
+ return Promise.race([
3412
+ fetch(fullUrl, fetchOptions).then((response) => {
3413
+ if (response.status == 204) {
3414
+ return response;
3415
+ } else if (response.status >= 200 && response.status < 300) {
3416
+ return response.json();
3417
+ } else {
3418
+ throw response;
3419
+ }
3420
+ }),
3421
+ new Promise(
3422
+ (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
3423
+ )
3424
+ ]);
3425
+ }
3398
3426
  /** Get permission list */
3399
3427
  getListPermission(bearerToken, options = {}) {
3400
3428
  const urlPath = "/v2/permissions";
@@ -3955,34 +3983,6 @@ var MezonApi = class {
3955
3983
  )
3956
3984
  ]);
3957
3985
  }
3958
- /** List stickers by clan ID */
3959
- listClanStickersByClanId(bearerToken, clanId, options = {}) {
3960
- if (clanId === null || clanId === void 0) {
3961
- throw new Error("'clanId' is a required parameter but is null or undefined.");
3962
- }
3963
- const urlPath = "/v2/sticker/{clanId}".replace("{clanId}", encodeURIComponent(String(clanId)));
3964
- const queryParams = /* @__PURE__ */ new Map();
3965
- let bodyJson = "";
3966
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
3967
- const fetchOptions = buildFetchOptions("GET", options, bodyJson);
3968
- if (bearerToken) {
3969
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
3970
- }
3971
- return Promise.race([
3972
- fetch(fullUrl, fetchOptions).then((response) => {
3973
- if (response.status == 204) {
3974
- return response;
3975
- } else if (response.status >= 200 && response.status < 300) {
3976
- return response.json();
3977
- } else {
3978
- throw response;
3979
- }
3980
- }),
3981
- new Promise(
3982
- (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
3983
- )
3984
- ]);
3985
- }
3986
3986
  /** Delete a sticker by ID */
3987
3987
  deleteClanStickerById(bearerToken, id, clanId, options = {}) {
3988
3988
  if (id === null || id === void 0) {
@@ -5127,6 +5127,18 @@ var _DefaultSocket = class _DefaultSocket {
5127
5127
  return response.clan_name_existed_event;
5128
5128
  });
5129
5129
  }
5130
+ listClanEmojiByClanId(clan_id) {
5131
+ return __async(this, null, function* () {
5132
+ const response = yield this.send({ emojis_by_clan_id_request_event: { clan_id } });
5133
+ return response.clan_emoji_list_event;
5134
+ });
5135
+ }
5136
+ listClanStickersByClanId(clan_id) {
5137
+ return __async(this, null, function* () {
5138
+ const response = yield this.send({ clan_sticker_list_request_event: { clan_id } });
5139
+ return response.clan_sticker_list_response_event;
5140
+ });
5141
+ }
5130
5142
  pingPong() {
5131
5143
  return __async(this, null, function* () {
5132
5144
  if (!this.adapter.isOpen()) {
@@ -6745,7 +6757,7 @@ var Client = class {
6745
6757
  });
6746
6758
  });
6747
6759
  }
6748
- getPinMessagesList(session, channelId) {
6760
+ pinMessagesList(session, channelId) {
6749
6761
  return __async(this, null, function* () {
6750
6762
  if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
6751
6763
  yield this.sessionRefresh(session);
@@ -6755,12 +6767,12 @@ var Client = class {
6755
6767
  });
6756
6768
  });
6757
6769
  }
6758
- directChannelVoiceList(session, userId, limit) {
6770
+ hashtagDmVoiceList(session, userId, limit) {
6759
6771
  return __async(this, null, function* () {
6760
6772
  if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
6761
6773
  yield this.sessionRefresh(session);
6762
6774
  }
6763
- return this.apiClient.directChannelVoiceList(session.token, userId, limit).then((response) => {
6775
+ return this.apiClient.hashtagDMVoiceList(session.token, userId, limit).then((response) => {
6764
6776
  return Promise.resolve(response);
6765
6777
  });
6766
6778
  });
@@ -6776,17 +6788,6 @@ var Client = class {
6776
6788
  });
6777
6789
  });
6778
6790
  }
6779
- /** List clan emoji. */
6780
- listClanEmoji(session, clan_id) {
6781
- return __async(this, null, function* () {
6782
- if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
6783
- yield this.sessionRefresh(session);
6784
- }
6785
- return this.apiClient.listClanEmojiByClanId(session.token, clan_id).then((response) => {
6786
- return Promise.resolve(response);
6787
- });
6788
- });
6789
- }
6790
6791
  /** create clan emoji */
6791
6792
  createClanEmoji(session, request) {
6792
6793
  return __async(this, null, function* () {
@@ -6886,17 +6887,6 @@ var Client = class {
6886
6887
  });
6887
6888
  });
6888
6889
  }
6889
- //**List stickers by clan ID */
6890
- listClanStickersByClanId(session, id) {
6891
- return __async(this, null, function* () {
6892
- if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
6893
- yield this.sessionRefresh(session);
6894
- }
6895
- return this.apiClient.listClanStickersByClanId(session.token, id).then((response) => {
6896
- return Promise.resolve(response);
6897
- });
6898
- });
6899
- }
6900
6890
  //**Delete a sticker by ID*/
6901
6891
  deleteClanStickerById(session, id, clan_id) {
6902
6892
  return __async(this, null, function* () {
@@ -6930,6 +6920,28 @@ var Client = class {
6930
6920
  });
6931
6921
  });
6932
6922
  }
6923
+ /** */
6924
+ getListPermissionRoleChannel(session, roleId, channelId) {
6925
+ return __async(this, null, function* () {
6926
+ if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
6927
+ yield this.sessionRefresh(session);
6928
+ }
6929
+ return this.apiClient.getListPermissionRoleChannel(session.token, roleId, channelId).then((response) => {
6930
+ return Promise.resolve(response);
6931
+ });
6932
+ });
6933
+ }
6934
+ /** */
6935
+ setRoleChannelPermission(session, request) {
6936
+ return __async(this, null, function* () {
6937
+ if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
6938
+ yield this.sessionRefresh(session);
6939
+ }
6940
+ return this.apiClient.setRoleChannelPermission(session.token, request).then((response) => {
6941
+ return response !== void 0;
6942
+ });
6943
+ });
6944
+ }
6933
6945
  };
6934
6946
  export {
6935
6947
  ChannelStreamMode,
package/dist/socket.d.ts CHANGED
@@ -13,7 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { ApiMessageAttachment, ApiMessageMention, ApiMessageReaction, ApiMessageRef, ApiRpc } from "./api.gen";
16
+ import { ApiClanEmojiList, ApiClanStickerListByClanIdResponse, ApiMessageAttachment, ApiMessageMention, ApiMessageReaction, ApiMessageRef, ApiRpc } from "./api.gen";
17
17
  import { Session } from "./session";
18
18
  import { Notification } from "./client";
19
19
  import { WebSocketAdapter } from "./web_socket_adapter";
@@ -533,6 +533,8 @@ export interface Socket {
533
533
  setHeartbeatTimeoutMs(ms: number): void;
534
534
  getHeartbeatTimeoutMs(): number;
535
535
  checkDuplicateClanName(clan_name: string): Promise<ClanNameExistedEvent>;
536
+ listClanEmojiByClanId(clan_id: string): Promise<ApiClanEmojiList>;
537
+ listClanStickersByClanId(clan_id: string): Promise<ApiClanStickerListByClanIdResponse>;
536
538
  }
537
539
  /** Reports an error received from a socket message. */
538
540
  export interface SocketError {
@@ -609,6 +611,8 @@ export declare class DefaultSocket implements Socket {
609
611
  writeVoiceLeaved(id: string, clanId: string, voiceChannelId: string, voiceUserId: string): Promise<VoiceLeavedEvent>;
610
612
  writeCustomStatus(clan_id: string, status: string): Promise<CustomStatusEvent>;
611
613
  checkDuplicateClanName(clan_name: string): Promise<ClanNameExistedEvent>;
614
+ listClanEmojiByClanId(clan_id: string): Promise<ApiClanEmojiList>;
615
+ listClanStickersByClanId(clan_id: string): Promise<ApiClanStickerListByClanIdResponse>;
612
616
  private pingPong;
613
617
  }
614
618
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mezon-js",
3
- "version": "2.8.20",
3
+ "version": "2.8.22",
4
4
  "scripts": {
5
5
  "build": "npx tsc && npx rollup -c --bundleConfigAsCjs && node build.mjs"
6
6
  },
package/socket.ts CHANGED
@@ -14,7 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import {ApiMessageAttachment, ApiMessageMention, ApiMessageReaction, ApiMessageRef, ApiNotification, ApiRpc} from "./api.gen";
17
+ import {ApiClanEmojiList, ApiClanStickerListByClanIdResponse, ApiMessageAttachment, ApiMessageMention, ApiMessageReaction, ApiMessageRef, ApiNotification, ApiRpc} from "./api.gen";
18
18
  import {Session} from "./session";
19
19
  import {Notification} from "./client";
20
20
  import {WebSocketAdapter, WebSocketAdapterText} from "./web_socket_adapter"
@@ -773,8 +773,11 @@ export interface Socket {
773
773
  /* Get the heartbeat timeout used by the socket to detect if it has lost connectivity to the server. */
774
774
  getHeartbeatTimeoutMs() : number;
775
775
 
776
- checkDuplicateClanName(clan_name: string): Promise<ClanNameExistedEvent>
776
+ checkDuplicateClanName(clan_name: string): Promise<ClanNameExistedEvent>;
777
777
 
778
+ listClanEmojiByClanId(clan_id: string): Promise<ApiClanEmojiList>;
779
+
780
+ listClanStickersByClanId(clan_id: string): Promise<ApiClanStickerListByClanIdResponse>;
778
781
  }
779
782
 
780
783
  /** Reports an error received from a socket message. */
@@ -1313,6 +1316,16 @@ export class DefaultSocket implements Socket {
1313
1316
  return response.clan_name_existed_event
1314
1317
  }
1315
1318
 
1319
+ async listClanEmojiByClanId(clan_id: string): Promise<ApiClanEmojiList>{
1320
+ const response = await this.send({emojis_by_clan_id_request_event: {clan_id: clan_id}});
1321
+ return response.clan_emoji_list_event
1322
+ }
1323
+
1324
+ async listClanStickersByClanId(clan_id: string): Promise<ApiClanStickerListByClanIdResponse>{
1325
+ const response = await this.send({clan_sticker_list_request_event: {clan_id: clan_id}});
1326
+ return response.clan_sticker_list_response_event
1327
+ }
1328
+
1316
1329
  private async pingPong() : Promise<void> {
1317
1330
  if (!this.adapter.isOpen()) {
1318
1331
  return;