mezon-js 2.12.26 → 2.12.28

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.gen.ts CHANGED
@@ -984,6 +984,8 @@ export interface ApiClanEmojiCreateRequest {
984
984
  shortname?: string;
985
985
  //
986
986
  source?: string;
987
+ //
988
+ is_for_sale?: boolean;
987
989
  }
988
990
 
989
991
  /** Get clan profile. */
@@ -1036,6 +1038,8 @@ export interface ApiClanStickerAddRequest {
1036
1038
  source?: string;
1037
1039
  //
1038
1040
  media_type?: number;
1041
+ //
1042
+ is_for_sale?: boolean;
1039
1043
  }
1040
1044
 
1041
1045
  /** A list of users belonging to a clan, along with their role. */
@@ -2672,6 +2676,48 @@ export interface ApiUserActivity {
2672
2676
  user_id?: string;
2673
2677
  }
2674
2678
 
2679
+ /** */
2680
+ export interface ApiQuickMenuAccess {
2681
+ //
2682
+ action_msg?: string;
2683
+ //
2684
+ background?: string;
2685
+ //
2686
+ bot_id?: string;
2687
+ //
2688
+ channel_id?: string;
2689
+ //
2690
+ clan_id?:string;
2691
+ //
2692
+ id?: string;
2693
+ //
2694
+ menu_name?: string;
2695
+ }
2696
+
2697
+ /** */
2698
+ export interface ApiQuickMenuAccessList {
2699
+ //
2700
+ list_menus?: Array<ApiQuickMenuAccess>;
2701
+ }
2702
+
2703
+ /** */
2704
+ export interface ApiQuickMenuAccessRequest {
2705
+ //
2706
+ action_msg?: string;
2707
+ //
2708
+ background?: string;
2709
+ //
2710
+ bot_id?: string;
2711
+ //
2712
+ channel_id?: string;
2713
+ //
2714
+ clan_id?: string;
2715
+ //
2716
+ id?: string;
2717
+ //
2718
+ menu_name?: string;
2719
+ }
2720
+
2675
2721
  /** */
2676
2722
  export interface ApiUserPermissionInChannelListResponse {
2677
2723
  //
@@ -2800,12 +2846,6 @@ export interface ApiWebhookListResponse {
2800
2846
  webhooks?: Array<ApiWebhook>;
2801
2847
  }
2802
2848
 
2803
- /** */
2804
- export interface ApiWithdrawTokenRequest {
2805
- //
2806
- amount?: number;
2807
- }
2808
-
2809
2849
  /** A collection of zero or more notifications. */
2810
2850
  export interface MezonapiEmojiRecentList {
2811
2851
  //Collection of emojiRecents.
@@ -3049,6 +3089,13 @@ export interface ApiGenerateMeetTokenResponse {
3049
3089
  token?: string;
3050
3090
  }
3051
3091
 
3092
+ /** */
3093
+ export interface ApiUnlockItemRequest {
3094
+ //
3095
+ item_id?: string;
3096
+ //
3097
+ item_type?: number;
3098
+ }
3052
3099
 
3053
3100
  /** */
3054
3101
  export interface ApiMezonOauthClient {
@@ -9741,45 +9788,6 @@ export class MezonApi {
9741
9788
  ]);
9742
9789
  }
9743
9790
 
9744
- /** WithdrawToken */
9745
- withdrawToken(
9746
- bearerToken: string,
9747
- body: ApiWithdrawTokenRequest,
9748
- options: any = {}
9749
- ): Promise<any> {
9750
- if (body === null || body === undefined) {
9751
- throw new Error(
9752
- "'body' is a required parameter but is null or undefined."
9753
- );
9754
- }
9755
- const urlPath = "/v2/withdrawtoken";
9756
- const queryParams = new Map<string, any>();
9757
-
9758
- let bodyJson: string = "";
9759
- bodyJson = JSON.stringify(body || {});
9760
-
9761
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
9762
- const fetchOptions = buildFetchOptions("POST", options, bodyJson);
9763
- if (bearerToken) {
9764
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
9765
- }
9766
-
9767
- return Promise.race([
9768
- fetch(fullUrl, fetchOptions).then((response) => {
9769
- if (response.status == 204) {
9770
- return response;
9771
- } else if (response.status >= 200 && response.status < 300) {
9772
- return response.json();
9773
- } else {
9774
- throw response;
9775
- }
9776
- }),
9777
- new Promise((_, reject) =>
9778
- setTimeout(reject, this.timeoutMs, "Request timed out.")
9779
- ),
9780
- ]);
9781
- }
9782
-
9783
9791
  /** */
9784
9792
  getChannelCanvasDetail(
9785
9793
  bearerToken: string,
@@ -10832,4 +10840,186 @@ export class MezonApi {
10832
10840
  ),
10833
10841
  ]);
10834
10842
  }
10843
+
10844
+ /** */
10845
+ deleteQuickMenuAccess(bearerToken: string,
10846
+ id?:string,
10847
+ menuName?:string,
10848
+ background?:string,
10849
+ actionMsg?:string,
10850
+ options: any = {}): Promise<any> {
10851
+
10852
+ const urlPath = "/v2/quickmenuaccess";
10853
+ const queryParams = new Map<string, any>();
10854
+ queryParams.set("id", id);
10855
+ queryParams.set("menu_name", menuName);
10856
+ queryParams.set("background", background);
10857
+ queryParams.set("action_msg", actionMsg);
10858
+
10859
+ let bodyJson : string = "";
10860
+
10861
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
10862
+ const fetchOptions = buildFetchOptions("DELETE", options, bodyJson);
10863
+ if (bearerToken) {
10864
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
10865
+ }
10866
+
10867
+ return Promise.race([
10868
+ fetch(fullUrl, fetchOptions).then((response) => {
10869
+ if (response.status == 204) {
10870
+ return response;
10871
+ } else if (response.status >= 200 && response.status < 300) {
10872
+ return response.json();
10873
+ } else {
10874
+ throw response;
10875
+ }
10876
+ }),
10877
+ new Promise((_, reject) =>
10878
+ setTimeout(reject, this.timeoutMs, "Request timed out.")
10879
+ ),
10880
+ ]);
10881
+ }
10882
+
10883
+ /** */
10884
+ listQuickMenuAccess(bearerToken: string,
10885
+ botId?:string,
10886
+ channelId?:string,
10887
+ options: any = {}): Promise<ApiQuickMenuAccessList> {
10888
+
10889
+ const urlPath = "/v2/quickmenuaccess";
10890
+ const queryParams = new Map<string, any>();
10891
+ queryParams.set("bot_id", botId);
10892
+ queryParams.set("channel_id", channelId);
10893
+
10894
+ let bodyJson : string = "";
10895
+
10896
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
10897
+ const fetchOptions = buildFetchOptions("GET", options, bodyJson);
10898
+ if (bearerToken) {
10899
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
10900
+ }
10901
+
10902
+ return Promise.race([
10903
+ fetch(fullUrl, fetchOptions).then((response) => {
10904
+ if (response.status == 204) {
10905
+ return response;
10906
+ } else if (response.status >= 200 && response.status < 300) {
10907
+ return response.json();
10908
+ } else {
10909
+ throw response;
10910
+ }
10911
+ }),
10912
+ new Promise((_, reject) =>
10913
+ setTimeout(reject, this.timeoutMs, "Request timed out.")
10914
+ ),
10915
+ ]);
10916
+ }
10917
+
10918
+ /** */
10919
+ addQuickMenuAccess(bearerToken: string,
10920
+ body:ApiQuickMenuAccessRequest,
10921
+ options: any = {}): Promise<any> {
10922
+
10923
+ if (body === null || body === undefined) {
10924
+ throw new Error("'body' is a required parameter but is null or undefined.");
10925
+ }
10926
+ const urlPath = "/v2/quickmenuaccess";
10927
+ const queryParams = new Map<string, any>();
10928
+
10929
+ let bodyJson : string = "";
10930
+ bodyJson = JSON.stringify(body || {});
10931
+
10932
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
10933
+ const fetchOptions = buildFetchOptions("POST", options, bodyJson);
10934
+ if (bearerToken) {
10935
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
10936
+ }
10937
+
10938
+ return Promise.race([
10939
+ fetch(fullUrl, fetchOptions).then((response) => {
10940
+ if (response.status == 204) {
10941
+ return response;
10942
+ } else if (response.status >= 200 && response.status < 300) {
10943
+ return response.json();
10944
+ } else {
10945
+ throw response;
10946
+ }
10947
+ }),
10948
+ new Promise((_, reject) =>
10949
+ setTimeout(reject, this.timeoutMs, "Request timed out.")
10950
+ ),
10951
+ ]);
10952
+ }
10953
+
10954
+ /** */
10955
+ updateQuickMenuAccess(bearerToken: string,
10956
+ body:ApiQuickMenuAccessRequest,
10957
+ options: any = {}): Promise<any> {
10958
+
10959
+ if (body === null || body === undefined) {
10960
+ throw new Error("'body' is a required parameter but is null or undefined.");
10961
+ }
10962
+ const urlPath = "/v2/quickmenuaccess";
10963
+ const queryParams = new Map<string, any>();
10964
+
10965
+ let bodyJson : string = "";
10966
+ bodyJson = JSON.stringify(body || {});
10967
+
10968
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
10969
+ const fetchOptions = buildFetchOptions("PUT", options, bodyJson);
10970
+ if (bearerToken) {
10971
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
10972
+ }
10973
+
10974
+ return Promise.race([
10975
+ fetch(fullUrl, fetchOptions).then((response) => {
10976
+ if (response.status == 204) {
10977
+ return response;
10978
+ } else if (response.status >= 200 && response.status < 300) {
10979
+ return response.json();
10980
+ } else {
10981
+ throw response;
10982
+ }
10983
+ }),
10984
+ new Promise((_, reject) =>
10985
+ setTimeout(reject, this.timeoutMs, "Request timed out.")
10986
+ ),
10987
+ ]);
10988
+ }
10989
+
10990
+ /** UnlockItem */
10991
+ unlockItem(bearerToken: string,
10992
+ body:ApiUnlockItemRequest,
10993
+ options: any = {}): Promise<any> {
10994
+
10995
+ if (body === null || body === undefined) {
10996
+ throw new Error("'body' is a required parameter but is null or undefined.");
10997
+ }
10998
+ const urlPath = "/v2/unlockitem";
10999
+ const queryParams = new Map<string, any>();
11000
+
11001
+ let bodyJson : string = "";
11002
+ bodyJson = JSON.stringify(body || {});
11003
+
11004
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
11005
+ const fetchOptions = buildFetchOptions("POST", options, bodyJson);
11006
+ if (bearerToken) {
11007
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
11008
+ }
11009
+
11010
+ return Promise.race([
11011
+ fetch(fullUrl, fetchOptions).then((response) => {
11012
+ if (response.status == 204) {
11013
+ return response;
11014
+ } else if (response.status >= 200 && response.status < 300) {
11015
+ return response.json();
11016
+ } else {
11017
+ throw response;
11018
+ }
11019
+ }),
11020
+ new Promise((_, reject) =>
11021
+ setTimeout(reject, this.timeoutMs, "Request timed out.")
11022
+ ),
11023
+ ]);
11024
+ }
10835
11025
  }
package/client.ts CHANGED
@@ -130,7 +130,6 @@ import {
130
130
  MezonapiListAuditLog,
131
131
  ApiTokenSentEvent,
132
132
  MezonDeleteWebhookByIdBody,
133
- ApiWithdrawTokenRequest,
134
133
  ApiListOnboardingResponse,
135
134
  ApiCreateOnboardingRequest,
136
135
  MezonUpdateOnboardingBody,
@@ -165,6 +164,9 @@ import {
165
164
  ApiMessage2InboxRequest,
166
165
  ApiListClanDiscover,
167
166
  ApiClanDiscoverRequest,
167
+ ApiQuickMenuAccessList,
168
+ ApiQuickMenuAccessRequest,
169
+ ApiUnlockItemRequest,
168
170
  } from "./api.gen";
169
171
 
170
172
  import { Session } from "./session";
@@ -3151,7 +3153,7 @@ export class Client {
3151
3153
  });
3152
3154
  }
3153
3155
 
3154
- async givecoffee(session: Session, request: ApiGiveCoffeeEvent) {
3156
+ async givecoffee(session: Session, request: ApiGiveCoffeeEvent): Promise<any> {
3155
3157
  if (
3156
3158
  this.autoRefreshSession &&
3157
3159
  session.refresh_token &&
@@ -3162,12 +3164,12 @@ export class Client {
3162
3164
 
3163
3165
  return this.apiClient
3164
3166
  .giveMeACoffee(session.token, request)
3165
- .then((response: ApiAppList) => {
3167
+ .then((response: any) => {
3166
3168
  return response !== undefined;
3167
3169
  });
3168
3170
  }
3169
3171
 
3170
- async sendToken(session: Session, request: ApiTokenSentEvent) {
3172
+ async sendToken(session: Session, request: ApiTokenSentEvent): Promise<any> {
3171
3173
  if (
3172
3174
  this.autoRefreshSession &&
3173
3175
  session.refresh_token &&
@@ -3178,24 +3180,8 @@ export class Client {
3178
3180
 
3179
3181
  return this.apiClient
3180
3182
  .sendToken(session.token, request)
3181
- .then((response: ApiTokenSentEvent) => {
3182
- return Promise.resolve(response);
3183
- });
3184
- }
3185
-
3186
- async withdrawToken(session: Session, request: ApiWithdrawTokenRequest) {
3187
- if (
3188
- this.autoRefreshSession &&
3189
- session.refresh_token &&
3190
- session.isexpired(Date.now() / 1000)
3191
- ) {
3192
- await this.sessionRefresh(session);
3193
- }
3194
-
3195
- return this.apiClient
3196
- .withdrawToken(session.token, request)
3197
- .then((response: ApiTokenSentEvent) => {
3198
- return Promise.resolve(response);
3183
+ .then((response: any) => {
3184
+ return response !== undefined
3199
3185
  });
3200
3186
  }
3201
3187
 
@@ -4750,7 +4736,7 @@ export class Client {
4750
4736
  }
4751
4737
 
4752
4738
  /** list clan discover. */
4753
- listClanDiscover(
4739
+ async listClanDiscover(
4754
4740
  basePath: string,
4755
4741
  request: ApiClanDiscoverRequest
4756
4742
  ): Promise<ApiListClanDiscover> {
@@ -4760,4 +4746,97 @@ export class Client {
4760
4746
  return Promise.resolve(response);
4761
4747
  });
4762
4748
  }
4749
+
4750
+ async listQuickMenuAccess(
4751
+ session: Session,
4752
+ botId: string,
4753
+ channelId: string
4754
+ ): Promise<ApiQuickMenuAccessList> {
4755
+ if (
4756
+ this.autoRefreshSession &&
4757
+ session.refresh_token &&
4758
+ session.isexpired(Date.now() / 1000)
4759
+ ) {
4760
+ await this.sessionRefresh(session);
4761
+ }
4762
+
4763
+ return this.apiClient
4764
+ .listQuickMenuAccess(session.token, botId, channelId)
4765
+ .then((response: ApiQuickMenuAccessList) => {
4766
+ return Promise.resolve(response);
4767
+ });
4768
+ }
4769
+
4770
+ async deleteQuickMenuAccess(
4771
+ session: Session,
4772
+ id: string
4773
+ ): Promise<any> {
4774
+ if (
4775
+ this.autoRefreshSession &&
4776
+ session.refresh_token &&
4777
+ session.isexpired(Date.now() / 1000)
4778
+ ) {
4779
+ await this.sessionRefresh(session);
4780
+ }
4781
+
4782
+ return this.apiClient
4783
+ .deleteQuickMenuAccess(session.token, id)
4784
+ .then((response: any) => {
4785
+ return response !== undefined;
4786
+ });
4787
+ }
4788
+
4789
+ async addQuickMenuAccess(
4790
+ session: Session,
4791
+ request: ApiQuickMenuAccessRequest
4792
+ ): Promise<any> {
4793
+ if (
4794
+ this.autoRefreshSession &&
4795
+ session.refresh_token &&
4796
+ session.isexpired(Date.now() / 1000)
4797
+ ) {
4798
+ await this.sessionRefresh(session);
4799
+ }
4800
+
4801
+ return this.apiClient
4802
+ .addQuickMenuAccess(session.token, request)
4803
+ .then((response: any) => {
4804
+ return response !== undefined;
4805
+ });
4806
+ }
4807
+
4808
+ async updateQuickMenuAccess(
4809
+ session: Session,
4810
+ request: ApiQuickMenuAccessRequest
4811
+ ): Promise<any> {
4812
+ if (
4813
+ this.autoRefreshSession &&
4814
+ session.refresh_token &&
4815
+ session.isexpired(Date.now() / 1000)
4816
+ ) {
4817
+ await this.sessionRefresh(session);
4818
+ }
4819
+
4820
+ return this.apiClient
4821
+ .updateQuickMenuAccess(session.token, request)
4822
+ .then((response: any) => {
4823
+ return response !== undefined;
4824
+ });
4825
+ }
4826
+
4827
+ async unlockItem(session: Session, request: ApiUnlockItemRequest): Promise<any> {
4828
+ if (
4829
+ this.autoRefreshSession &&
4830
+ session.refresh_token &&
4831
+ session.isexpired(Date.now() / 1000)
4832
+ ) {
4833
+ await this.sessionRefresh(session);
4834
+ }
4835
+
4836
+ return this.apiClient
4837
+ .unlockItem(session.token, request)
4838
+ .then((response: any) => {
4839
+ return response !== undefined
4840
+ });
4841
+ }
4763
4842
  }
package/dist/api.gen.d.ts CHANGED
@@ -558,6 +558,7 @@ export interface ApiClanEmojiCreateRequest {
558
558
  id?: string;
559
559
  shortname?: string;
560
560
  source?: string;
561
+ is_for_sale?: boolean;
561
562
  }
562
563
  /** Get clan profile. */
563
564
  export interface ApiClanProfile {
@@ -587,6 +588,7 @@ export interface ApiClanStickerAddRequest {
587
588
  shortname?: string;
588
589
  source?: string;
589
590
  media_type?: number;
591
+ is_for_sale?: boolean;
590
592
  }
591
593
  /** A list of users belonging to a clan, along with their role. */
592
594
  export interface ApiClanUserList {
@@ -1529,6 +1531,30 @@ export interface ApiUserActivity {
1529
1531
  user_id?: string;
1530
1532
  }
1531
1533
  /** */
1534
+ export interface ApiQuickMenuAccess {
1535
+ action_msg?: string;
1536
+ background?: string;
1537
+ bot_id?: string;
1538
+ channel_id?: string;
1539
+ clan_id?: string;
1540
+ id?: string;
1541
+ menu_name?: string;
1542
+ }
1543
+ /** */
1544
+ export interface ApiQuickMenuAccessList {
1545
+ list_menus?: Array<ApiQuickMenuAccess>;
1546
+ }
1547
+ /** */
1548
+ export interface ApiQuickMenuAccessRequest {
1549
+ action_msg?: string;
1550
+ background?: string;
1551
+ bot_id?: string;
1552
+ channel_id?: string;
1553
+ clan_id?: string;
1554
+ id?: string;
1555
+ menu_name?: string;
1556
+ }
1557
+ /** */
1532
1558
  export interface ApiUserPermissionInChannelListResponse {
1533
1559
  channel_id?: string;
1534
1560
  clan_id?: string;
@@ -1604,10 +1630,6 @@ export interface ApiWebhookGenerateResponse {
1604
1630
  export interface ApiWebhookListResponse {
1605
1631
  webhooks?: Array<ApiWebhook>;
1606
1632
  }
1607
- /** */
1608
- export interface ApiWithdrawTokenRequest {
1609
- amount?: number;
1610
- }
1611
1633
  /** A collection of zero or more notifications. */
1612
1634
  export interface MezonapiEmojiRecentList {
1613
1635
  emoji_recents?: Array<ApiEmojiRecent>;
@@ -1752,6 +1774,11 @@ export interface ApiGenerateMeetTokenResponse {
1752
1774
  token?: string;
1753
1775
  }
1754
1776
  /** */
1777
+ export interface ApiUnlockItemRequest {
1778
+ item_id?: string;
1779
+ item_type?: number;
1780
+ }
1781
+ /** */
1755
1782
  export interface ApiMezonOauthClient {
1756
1783
  access_token_strategy?: string;
1757
1784
  allowed_cors_origins?: Array<string>;
@@ -2167,8 +2194,6 @@ export declare class MezonApi {
2167
2194
  buildFullUrl(basePath: string, fragment: string, queryParams: Map<string, any>): string;
2168
2195
  /** Channel canvas editor */
2169
2196
  editChannelCanvases(bearerToken: string, body: ApiEditChannelCanvasRequest, options?: any): Promise<ApiEditChannelCanvasResponse>;
2170
- /** WithdrawToken */
2171
- withdrawToken(bearerToken: string, body: ApiWithdrawTokenRequest, options?: any): Promise<any>;
2172
2197
  /** */
2173
2198
  getChannelCanvasDetail(bearerToken: string, id: string, clanId?: string, channelId?: string, options?: any): Promise<ApiChannelCanvasDetailResponse>;
2174
2199
  /** */
@@ -2223,4 +2248,14 @@ export declare class MezonApi {
2223
2248
  updateClanOrder(bearerToken: string, body: ApiUpdateClanOrderRequest, options?: any): Promise<any>;
2224
2249
  /** Discover mezon clan. */
2225
2250
  clanDiscover(basicAuthUsername: string, basicAuthPassword: string, basePath: string, body: ApiClanDiscoverRequest, options?: any): Promise<ApiListClanDiscover>;
2251
+ /** */
2252
+ deleteQuickMenuAccess(bearerToken: string, id?: string, menuName?: string, background?: string, actionMsg?: string, options?: any): Promise<any>;
2253
+ /** */
2254
+ listQuickMenuAccess(bearerToken: string, botId?: string, channelId?: string, options?: any): Promise<ApiQuickMenuAccessList>;
2255
+ /** */
2256
+ addQuickMenuAccess(bearerToken: string, body: ApiQuickMenuAccessRequest, options?: any): Promise<any>;
2257
+ /** */
2258
+ updateQuickMenuAccess(bearerToken: string, body: ApiQuickMenuAccessRequest, options?: any): Promise<any>;
2259
+ /** UnlockItem */
2260
+ unlockItem(bearerToken: string, body: ApiUnlockItemRequest, options?: any): Promise<any>;
2226
2261
  }
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, ApiAccountMezon, ApiAccountEmail, ApiChannelDescList, ApiChannelDescription, ApiCreateChannelDescRequest, ApiDeleteRoleRequest, ApiClanDescList, ApiCreateClanDescRequest, ApiClanDesc, ApiCategoryDesc, ApiCategoryDescList, ApiPermissionList, ApiRoleUserList, ApiRole, ApiCreateRoleRequest, ApiAddRoleChannelDescRequest, ApiCreateCategoryDescRequest, ApiUpdateCategoryDescRequest, ApiEvent, ApiNotificationList, ApiUpdateAccountRequest, ApiSession, ApiClanDescProfile, ApiClanProfile, ApiChannelUserList, ApiClanUserList, ApiLinkInviteUserRequest, ApiLinkInviteUser, ApiInviteUserRes, ApiUploadAttachmentRequest, ApiUploadAttachment, ApiMessageReaction, ApiMessageMention, ApiMessageAttachment, ApiMessageRef, ApiChannelMessageHeader, ApiVoiceChannelUserList, ApiChannelAttachmentList, ApiCreateEventRequest, ApiEventManagement, ApiEventList, ApiDeleteEventRequest, ApiSetDefaultNotificationRequest, ApiSetNotificationRequest, ApiSetMuteNotificationRequest, ApiSearchMessageRequest, ApiSearchMessageResponse, ApiPinMessageRequest, ApiPinMessagesList, ApiDeleteChannelDescRequest, ApiChangeChannelPrivateRequest, ApiClanEmojiCreateRequest, MezonUpdateClanEmojiByIdBody, ApiWebhookCreateRequest, ApiWebhookListResponse, MezonUpdateWebhookByIdBody, ApiWebhookGenerateResponse, ApiCheckDuplicateClanNameResponse, ApiClanStickerAddRequest, MezonUpdateClanStickerByIdBody, MezonChangeChannelCategoryBody, ApiUpdateRoleChannelRequest, ApiAddAppRequest, ApiAppList, ApiApp, MezonUpdateAppBody, ApiSystemMessagesList, ApiSystemMessage, ApiSystemMessageRequest, MezonUpdateSystemMessageBody, ApiUpdateCategoryOrderRequest, ApiGiveCoffeeEvent, ApiListStreamingChannelsResponse, ApiStreamingChannelUserList, ApiRegisterStreamingChannelRequest, ApiRoleList, ApiListChannelAppsResponse, ApiNotificationChannelCategorySettingList, ApiNotificationUserChannel, ApiNotificationSetting, ApiNotifiReactMessage, ApiHashtagDmList, ApiEmojiListedResponse, ApiStickerListedResponse, ApiAllUsersAddChannelResponse, ApiRoleListEventResponse, ApiAllUserClans, ApiUserPermissionInChannelListResponse, ApiPermissionRoleChannelListEventResponse, ApiMarkAsReadRequest, ApiChannelCanvasListResponse, ApiEditChannelCanvasRequest, ApiChannelSettingListResponse, ApiAddFavoriteChannelResponse, ApiRegistFcmDeviceTokenResponse, ApiListUserActivity, ApiCreateActivityRequest, ApiLoginIDResponse, ApiLoginRequest, ApiConfirmLoginRequest, ApiUserActivity, ApiChanEncryptionMethod, ApiGetPubKeysResponse, ApiPubKey, ApiGetKeyServerResp, MezonapiListAuditLog, ApiTokenSentEvent, MezonDeleteWebhookByIdBody, ApiWithdrawTokenRequest, ApiListOnboardingResponse, ApiCreateOnboardingRequest, MezonUpdateOnboardingBody, ApiOnboardingItem, ApiGenerateClanWebhookRequest, ApiGenerateClanWebhookResponse, ApiListClanWebhookResponse, MezonUpdateClanWebhookByIdBody, MezonUpdateClanDescBody, ApiUserStatusUpdate, ApiUserStatus, ApiListOnboardingStepResponse, MezonUpdateOnboardingStepByClanIdBody, ApiWalletLedgerList, ApiSdTopicList, ApiSdTopicRequest, ApiSdTopic, MezonUpdateEventBody, ApiTransactionDetail, MezonapiCreateRoomChannelApps, ApiGenerateMeetTokenRequest, ApiGenerateMeetTokenResponse, ApiMezonOauthClientList, ApiMezonOauthClient, ApiCreateHashChannelAppsResponse, MezonapiEmojiRecentList, ApiUserEventRequest, ApiUpdateRoleOrderRequest, ApiGenerateMezonMeetResponse, ApiGenerateMeetTokenExternalResponse, ApiUpdateClanOrderRequest, ApiMessage2InboxRequest, ApiListClanDiscover, ApiClanDiscoverRequest } from "./api.gen";
16
+ import { ApiAccount, ApiAccountMezon, ApiAccountEmail, ApiChannelDescList, ApiChannelDescription, ApiCreateChannelDescRequest, ApiDeleteRoleRequest, ApiClanDescList, ApiCreateClanDescRequest, ApiClanDesc, ApiCategoryDesc, ApiCategoryDescList, ApiPermissionList, ApiRoleUserList, ApiRole, ApiCreateRoleRequest, ApiAddRoleChannelDescRequest, ApiCreateCategoryDescRequest, ApiUpdateCategoryDescRequest, ApiEvent, ApiNotificationList, ApiUpdateAccountRequest, ApiSession, ApiClanDescProfile, ApiClanProfile, ApiChannelUserList, ApiClanUserList, ApiLinkInviteUserRequest, ApiLinkInviteUser, ApiInviteUserRes, ApiUploadAttachmentRequest, ApiUploadAttachment, ApiMessageReaction, ApiMessageMention, ApiMessageAttachment, ApiMessageRef, ApiChannelMessageHeader, ApiVoiceChannelUserList, ApiChannelAttachmentList, ApiCreateEventRequest, ApiEventManagement, ApiEventList, ApiDeleteEventRequest, ApiSetDefaultNotificationRequest, ApiSetNotificationRequest, ApiSetMuteNotificationRequest, ApiSearchMessageRequest, ApiSearchMessageResponse, ApiPinMessageRequest, ApiPinMessagesList, ApiDeleteChannelDescRequest, ApiChangeChannelPrivateRequest, ApiClanEmojiCreateRequest, MezonUpdateClanEmojiByIdBody, ApiWebhookCreateRequest, ApiWebhookListResponse, MezonUpdateWebhookByIdBody, ApiWebhookGenerateResponse, ApiCheckDuplicateClanNameResponse, ApiClanStickerAddRequest, MezonUpdateClanStickerByIdBody, MezonChangeChannelCategoryBody, ApiUpdateRoleChannelRequest, ApiAddAppRequest, ApiAppList, ApiApp, MezonUpdateAppBody, ApiSystemMessagesList, ApiSystemMessage, ApiSystemMessageRequest, MezonUpdateSystemMessageBody, ApiUpdateCategoryOrderRequest, ApiGiveCoffeeEvent, ApiListStreamingChannelsResponse, ApiStreamingChannelUserList, ApiRegisterStreamingChannelRequest, ApiRoleList, ApiListChannelAppsResponse, ApiNotificationChannelCategorySettingList, ApiNotificationUserChannel, ApiNotificationSetting, ApiNotifiReactMessage, ApiHashtagDmList, ApiEmojiListedResponse, ApiStickerListedResponse, ApiAllUsersAddChannelResponse, ApiRoleListEventResponse, ApiAllUserClans, ApiUserPermissionInChannelListResponse, ApiPermissionRoleChannelListEventResponse, ApiMarkAsReadRequest, ApiChannelCanvasListResponse, ApiEditChannelCanvasRequest, ApiChannelSettingListResponse, ApiAddFavoriteChannelResponse, ApiRegistFcmDeviceTokenResponse, ApiListUserActivity, ApiCreateActivityRequest, ApiLoginIDResponse, ApiLoginRequest, ApiConfirmLoginRequest, ApiUserActivity, ApiChanEncryptionMethod, ApiGetPubKeysResponse, ApiPubKey, ApiGetKeyServerResp, MezonapiListAuditLog, ApiTokenSentEvent, MezonDeleteWebhookByIdBody, ApiListOnboardingResponse, ApiCreateOnboardingRequest, MezonUpdateOnboardingBody, ApiOnboardingItem, ApiGenerateClanWebhookRequest, ApiGenerateClanWebhookResponse, ApiListClanWebhookResponse, MezonUpdateClanWebhookByIdBody, MezonUpdateClanDescBody, ApiUserStatusUpdate, ApiUserStatus, ApiListOnboardingStepResponse, MezonUpdateOnboardingStepByClanIdBody, ApiWalletLedgerList, ApiSdTopicList, ApiSdTopicRequest, ApiSdTopic, MezonUpdateEventBody, ApiTransactionDetail, MezonapiCreateRoomChannelApps, ApiGenerateMeetTokenRequest, ApiGenerateMeetTokenResponse, ApiMezonOauthClientList, ApiMezonOauthClient, ApiCreateHashChannelAppsResponse, MezonapiEmojiRecentList, ApiUserEventRequest, ApiUpdateRoleOrderRequest, ApiGenerateMezonMeetResponse, ApiGenerateMeetTokenExternalResponse, ApiUpdateClanOrderRequest, ApiMessage2InboxRequest, ApiListClanDiscover, ApiClanDiscoverRequest, ApiQuickMenuAccessList, ApiQuickMenuAccessRequest, ApiUnlockItemRequest } from "./api.gen";
17
17
  import { Session } from "./session";
18
18
  import { Socket } from "./socket";
19
19
  import { WebSocketAdapter } from "./web_socket_adapter";
@@ -538,9 +538,8 @@ export declare class Client {
538
538
  deleteSystemMessage(session: Session, clanId: string): Promise<any>;
539
539
  updateCategoryOrder(session: Session, request: ApiUpdateCategoryOrderRequest): Promise<any>;
540
540
  deleteCategoryOrder(session: Session, clanId: string): Promise<any>;
541
- givecoffee(session: Session, request: ApiGiveCoffeeEvent): Promise<boolean>;
542
- sendToken(session: Session, request: ApiTokenSentEvent): Promise<ApiTokenSentEvent>;
543
- withdrawToken(session: Session, request: ApiWithdrawTokenRequest): Promise<ApiTokenSentEvent>;
541
+ givecoffee(session: Session, request: ApiGiveCoffeeEvent): Promise<any>;
542
+ sendToken(session: Session, request: ApiTokenSentEvent): Promise<any>;
544
543
  listStreamingChannels(session: Session, clanId: string): Promise<ApiListStreamingChannelsResponse>;
545
544
  /** List a channel's users. */
546
545
  listStreamingChannelUsers(session: Session, clanId: string, channelId: string, channelType: number, state?: number, limit?: number, cursor?: string): Promise<ApiStreamingChannelUserList>;
@@ -626,4 +625,9 @@ export declare class Client {
626
625
  updateClanOrder(session: Session, request: ApiUpdateClanOrderRequest): Promise<boolean>;
627
626
  /** list clan discover. */
628
627
  listClanDiscover(basePath: string, request: ApiClanDiscoverRequest): Promise<ApiListClanDiscover>;
628
+ listQuickMenuAccess(session: Session, botId: string, channelId: string): Promise<ApiQuickMenuAccessList>;
629
+ deleteQuickMenuAccess(session: Session, id: string): Promise<any>;
630
+ addQuickMenuAccess(session: Session, request: ApiQuickMenuAccessRequest): Promise<any>;
631
+ updateQuickMenuAccess(session: Session, request: ApiQuickMenuAccessRequest): Promise<any>;
632
+ unlockItem(session: Session, request: ApiUnlockItemRequest): Promise<any>;
629
633
  }
@@ -5838,37 +5838,6 @@ var MezonApi = class {
5838
5838
  )
5839
5839
  ]);
5840
5840
  }
5841
- /** WithdrawToken */
5842
- withdrawToken(bearerToken, body, options = {}) {
5843
- if (body === null || body === void 0) {
5844
- throw new Error(
5845
- "'body' is a required parameter but is null or undefined."
5846
- );
5847
- }
5848
- const urlPath = "/v2/withdrawtoken";
5849
- const queryParams = /* @__PURE__ */ new Map();
5850
- let bodyJson = "";
5851
- bodyJson = JSON.stringify(body || {});
5852
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
5853
- const fetchOptions = buildFetchOptions("POST", options, bodyJson);
5854
- if (bearerToken) {
5855
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
5856
- }
5857
- return Promise.race([
5858
- fetch(fullUrl, fetchOptions).then((response) => {
5859
- if (response.status == 204) {
5860
- return response;
5861
- } else if (response.status >= 200 && response.status < 300) {
5862
- return response.json();
5863
- } else {
5864
- throw response;
5865
- }
5866
- }),
5867
- new Promise(
5868
- (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
5869
- )
5870
- ]);
5871
- }
5872
5841
  /** */
5873
5842
  getChannelCanvasDetail(bearerToken, id, clanId, channelId, options = {}) {
5874
5843
  if (id === null || id === void 0) {
@@ -6690,6 +6659,149 @@ var MezonApi = class {
6690
6659
  )
6691
6660
  ]);
6692
6661
  }
6662
+ /** */
6663
+ deleteQuickMenuAccess(bearerToken, id, menuName, background, actionMsg, options = {}) {
6664
+ const urlPath = "/v2/quickmenuaccess";
6665
+ const queryParams = /* @__PURE__ */ new Map();
6666
+ queryParams.set("id", id);
6667
+ queryParams.set("menu_name", menuName);
6668
+ queryParams.set("background", background);
6669
+ queryParams.set("action_msg", actionMsg);
6670
+ let bodyJson = "";
6671
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
6672
+ const fetchOptions = buildFetchOptions("DELETE", options, bodyJson);
6673
+ if (bearerToken) {
6674
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
6675
+ }
6676
+ return Promise.race([
6677
+ fetch(fullUrl, fetchOptions).then((response) => {
6678
+ if (response.status == 204) {
6679
+ return response;
6680
+ } else if (response.status >= 200 && response.status < 300) {
6681
+ return response.json();
6682
+ } else {
6683
+ throw response;
6684
+ }
6685
+ }),
6686
+ new Promise(
6687
+ (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
6688
+ )
6689
+ ]);
6690
+ }
6691
+ /** */
6692
+ listQuickMenuAccess(bearerToken, botId, channelId, options = {}) {
6693
+ const urlPath = "/v2/quickmenuaccess";
6694
+ const queryParams = /* @__PURE__ */ new Map();
6695
+ queryParams.set("bot_id", botId);
6696
+ queryParams.set("channel_id", channelId);
6697
+ let bodyJson = "";
6698
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
6699
+ const fetchOptions = buildFetchOptions("GET", options, bodyJson);
6700
+ if (bearerToken) {
6701
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
6702
+ }
6703
+ return Promise.race([
6704
+ fetch(fullUrl, fetchOptions).then((response) => {
6705
+ if (response.status == 204) {
6706
+ return response;
6707
+ } else if (response.status >= 200 && response.status < 300) {
6708
+ return response.json();
6709
+ } else {
6710
+ throw response;
6711
+ }
6712
+ }),
6713
+ new Promise(
6714
+ (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
6715
+ )
6716
+ ]);
6717
+ }
6718
+ /** */
6719
+ addQuickMenuAccess(bearerToken, body, options = {}) {
6720
+ if (body === null || body === void 0) {
6721
+ throw new Error("'body' is a required parameter but is null or undefined.");
6722
+ }
6723
+ const urlPath = "/v2/quickmenuaccess";
6724
+ const queryParams = /* @__PURE__ */ new Map();
6725
+ let bodyJson = "";
6726
+ bodyJson = JSON.stringify(body || {});
6727
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
6728
+ const fetchOptions = buildFetchOptions("POST", options, bodyJson);
6729
+ if (bearerToken) {
6730
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
6731
+ }
6732
+ return Promise.race([
6733
+ fetch(fullUrl, fetchOptions).then((response) => {
6734
+ if (response.status == 204) {
6735
+ return response;
6736
+ } else if (response.status >= 200 && response.status < 300) {
6737
+ return response.json();
6738
+ } else {
6739
+ throw response;
6740
+ }
6741
+ }),
6742
+ new Promise(
6743
+ (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
6744
+ )
6745
+ ]);
6746
+ }
6747
+ /** */
6748
+ updateQuickMenuAccess(bearerToken, body, options = {}) {
6749
+ if (body === null || body === void 0) {
6750
+ throw new Error("'body' is a required parameter but is null or undefined.");
6751
+ }
6752
+ const urlPath = "/v2/quickmenuaccess";
6753
+ const queryParams = /* @__PURE__ */ new Map();
6754
+ let bodyJson = "";
6755
+ bodyJson = JSON.stringify(body || {});
6756
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
6757
+ const fetchOptions = buildFetchOptions("PUT", options, bodyJson);
6758
+ if (bearerToken) {
6759
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
6760
+ }
6761
+ return Promise.race([
6762
+ fetch(fullUrl, fetchOptions).then((response) => {
6763
+ if (response.status == 204) {
6764
+ return response;
6765
+ } else if (response.status >= 200 && response.status < 300) {
6766
+ return response.json();
6767
+ } else {
6768
+ throw response;
6769
+ }
6770
+ }),
6771
+ new Promise(
6772
+ (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
6773
+ )
6774
+ ]);
6775
+ }
6776
+ /** UnlockItem */
6777
+ unlockItem(bearerToken, body, options = {}) {
6778
+ if (body === null || body === void 0) {
6779
+ throw new Error("'body' is a required parameter but is null or undefined.");
6780
+ }
6781
+ const urlPath = "/v2/unlockitem";
6782
+ const queryParams = /* @__PURE__ */ new Map();
6783
+ let bodyJson = "";
6784
+ bodyJson = JSON.stringify(body || {});
6785
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
6786
+ const fetchOptions = buildFetchOptions("POST", options, bodyJson);
6787
+ if (bearerToken) {
6788
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
6789
+ }
6790
+ return Promise.race([
6791
+ fetch(fullUrl, fetchOptions).then((response) => {
6792
+ if (response.status == 204) {
6793
+ return response;
6794
+ } else if (response.status >= 200 && response.status < 300) {
6795
+ return response.json();
6796
+ } else {
6797
+ throw response;
6798
+ }
6799
+ }),
6800
+ new Promise(
6801
+ (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
6802
+ )
6803
+ ]);
6804
+ }
6693
6805
  };
6694
6806
 
6695
6807
  // session.ts
@@ -9501,17 +9613,7 @@ var Client = class {
9501
9613
  yield this.sessionRefresh(session);
9502
9614
  }
9503
9615
  return this.apiClient.sendToken(session.token, request).then((response) => {
9504
- return Promise.resolve(response);
9505
- });
9506
- });
9507
- }
9508
- withdrawToken(session, request) {
9509
- return __async(this, null, function* () {
9510
- if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
9511
- yield this.sessionRefresh(session);
9512
- }
9513
- return this.apiClient.withdrawToken(session.token, request).then((response) => {
9514
- return Promise.resolve(response);
9616
+ return response !== void 0;
9515
9617
  });
9516
9618
  });
9517
9619
  }
@@ -10388,8 +10490,60 @@ var Client = class {
10388
10490
  }
10389
10491
  /** list clan discover. */
10390
10492
  listClanDiscover(basePath, request) {
10391
- return this.apiClient.clanDiscover(this.serverkey, "", basePath, request).then((response) => {
10392
- return Promise.resolve(response);
10493
+ return __async(this, null, function* () {
10494
+ return this.apiClient.clanDiscover(this.serverkey, "", basePath, request).then((response) => {
10495
+ return Promise.resolve(response);
10496
+ });
10497
+ });
10498
+ }
10499
+ listQuickMenuAccess(session, botId, channelId) {
10500
+ return __async(this, null, function* () {
10501
+ if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
10502
+ yield this.sessionRefresh(session);
10503
+ }
10504
+ return this.apiClient.listQuickMenuAccess(session.token, botId, channelId).then((response) => {
10505
+ return Promise.resolve(response);
10506
+ });
10507
+ });
10508
+ }
10509
+ deleteQuickMenuAccess(session, id) {
10510
+ return __async(this, null, function* () {
10511
+ if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
10512
+ yield this.sessionRefresh(session);
10513
+ }
10514
+ return this.apiClient.deleteQuickMenuAccess(session.token, id).then((response) => {
10515
+ return response !== void 0;
10516
+ });
10517
+ });
10518
+ }
10519
+ addQuickMenuAccess(session, request) {
10520
+ return __async(this, null, function* () {
10521
+ if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
10522
+ yield this.sessionRefresh(session);
10523
+ }
10524
+ return this.apiClient.addQuickMenuAccess(session.token, request).then((response) => {
10525
+ return response !== void 0;
10526
+ });
10527
+ });
10528
+ }
10529
+ updateQuickMenuAccess(session, request) {
10530
+ return __async(this, null, function* () {
10531
+ if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
10532
+ yield this.sessionRefresh(session);
10533
+ }
10534
+ return this.apiClient.updateQuickMenuAccess(session.token, request).then((response) => {
10535
+ return response !== void 0;
10536
+ });
10537
+ });
10538
+ }
10539
+ unlockItem(session, request) {
10540
+ return __async(this, null, function* () {
10541
+ if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
10542
+ yield this.sessionRefresh(session);
10543
+ }
10544
+ return this.apiClient.unlockItem(session.token, request).then((response) => {
10545
+ return response !== void 0;
10546
+ });
10393
10547
  });
10394
10548
  }
10395
10549
  };
@@ -5804,37 +5804,6 @@ var MezonApi = class {
5804
5804
  )
5805
5805
  ]);
5806
5806
  }
5807
- /** WithdrawToken */
5808
- withdrawToken(bearerToken, body, options = {}) {
5809
- if (body === null || body === void 0) {
5810
- throw new Error(
5811
- "'body' is a required parameter but is null or undefined."
5812
- );
5813
- }
5814
- const urlPath = "/v2/withdrawtoken";
5815
- const queryParams = /* @__PURE__ */ new Map();
5816
- let bodyJson = "";
5817
- bodyJson = JSON.stringify(body || {});
5818
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
5819
- const fetchOptions = buildFetchOptions("POST", options, bodyJson);
5820
- if (bearerToken) {
5821
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
5822
- }
5823
- return Promise.race([
5824
- fetch(fullUrl, fetchOptions).then((response) => {
5825
- if (response.status == 204) {
5826
- return response;
5827
- } else if (response.status >= 200 && response.status < 300) {
5828
- return response.json();
5829
- } else {
5830
- throw response;
5831
- }
5832
- }),
5833
- new Promise(
5834
- (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
5835
- )
5836
- ]);
5837
- }
5838
5807
  /** */
5839
5808
  getChannelCanvasDetail(bearerToken, id, clanId, channelId, options = {}) {
5840
5809
  if (id === null || id === void 0) {
@@ -6656,6 +6625,149 @@ var MezonApi = class {
6656
6625
  )
6657
6626
  ]);
6658
6627
  }
6628
+ /** */
6629
+ deleteQuickMenuAccess(bearerToken, id, menuName, background, actionMsg, options = {}) {
6630
+ const urlPath = "/v2/quickmenuaccess";
6631
+ const queryParams = /* @__PURE__ */ new Map();
6632
+ queryParams.set("id", id);
6633
+ queryParams.set("menu_name", menuName);
6634
+ queryParams.set("background", background);
6635
+ queryParams.set("action_msg", actionMsg);
6636
+ let bodyJson = "";
6637
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
6638
+ const fetchOptions = buildFetchOptions("DELETE", options, bodyJson);
6639
+ if (bearerToken) {
6640
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
6641
+ }
6642
+ return Promise.race([
6643
+ fetch(fullUrl, fetchOptions).then((response) => {
6644
+ if (response.status == 204) {
6645
+ return response;
6646
+ } else if (response.status >= 200 && response.status < 300) {
6647
+ return response.json();
6648
+ } else {
6649
+ throw response;
6650
+ }
6651
+ }),
6652
+ new Promise(
6653
+ (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
6654
+ )
6655
+ ]);
6656
+ }
6657
+ /** */
6658
+ listQuickMenuAccess(bearerToken, botId, channelId, options = {}) {
6659
+ const urlPath = "/v2/quickmenuaccess";
6660
+ const queryParams = /* @__PURE__ */ new Map();
6661
+ queryParams.set("bot_id", botId);
6662
+ queryParams.set("channel_id", channelId);
6663
+ let bodyJson = "";
6664
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
6665
+ const fetchOptions = buildFetchOptions("GET", options, bodyJson);
6666
+ if (bearerToken) {
6667
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
6668
+ }
6669
+ return Promise.race([
6670
+ fetch(fullUrl, fetchOptions).then((response) => {
6671
+ if (response.status == 204) {
6672
+ return response;
6673
+ } else if (response.status >= 200 && response.status < 300) {
6674
+ return response.json();
6675
+ } else {
6676
+ throw response;
6677
+ }
6678
+ }),
6679
+ new Promise(
6680
+ (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
6681
+ )
6682
+ ]);
6683
+ }
6684
+ /** */
6685
+ addQuickMenuAccess(bearerToken, body, options = {}) {
6686
+ if (body === null || body === void 0) {
6687
+ throw new Error("'body' is a required parameter but is null or undefined.");
6688
+ }
6689
+ const urlPath = "/v2/quickmenuaccess";
6690
+ const queryParams = /* @__PURE__ */ new Map();
6691
+ let bodyJson = "";
6692
+ bodyJson = JSON.stringify(body || {});
6693
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
6694
+ const fetchOptions = buildFetchOptions("POST", options, bodyJson);
6695
+ if (bearerToken) {
6696
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
6697
+ }
6698
+ return Promise.race([
6699
+ fetch(fullUrl, fetchOptions).then((response) => {
6700
+ if (response.status == 204) {
6701
+ return response;
6702
+ } else if (response.status >= 200 && response.status < 300) {
6703
+ return response.json();
6704
+ } else {
6705
+ throw response;
6706
+ }
6707
+ }),
6708
+ new Promise(
6709
+ (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
6710
+ )
6711
+ ]);
6712
+ }
6713
+ /** */
6714
+ updateQuickMenuAccess(bearerToken, body, options = {}) {
6715
+ if (body === null || body === void 0) {
6716
+ throw new Error("'body' is a required parameter but is null or undefined.");
6717
+ }
6718
+ const urlPath = "/v2/quickmenuaccess";
6719
+ const queryParams = /* @__PURE__ */ new Map();
6720
+ let bodyJson = "";
6721
+ bodyJson = JSON.stringify(body || {});
6722
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
6723
+ const fetchOptions = buildFetchOptions("PUT", options, bodyJson);
6724
+ if (bearerToken) {
6725
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
6726
+ }
6727
+ return Promise.race([
6728
+ fetch(fullUrl, fetchOptions).then((response) => {
6729
+ if (response.status == 204) {
6730
+ return response;
6731
+ } else if (response.status >= 200 && response.status < 300) {
6732
+ return response.json();
6733
+ } else {
6734
+ throw response;
6735
+ }
6736
+ }),
6737
+ new Promise(
6738
+ (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
6739
+ )
6740
+ ]);
6741
+ }
6742
+ /** UnlockItem */
6743
+ unlockItem(bearerToken, body, options = {}) {
6744
+ if (body === null || body === void 0) {
6745
+ throw new Error("'body' is a required parameter but is null or undefined.");
6746
+ }
6747
+ const urlPath = "/v2/unlockitem";
6748
+ const queryParams = /* @__PURE__ */ new Map();
6749
+ let bodyJson = "";
6750
+ bodyJson = JSON.stringify(body || {});
6751
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
6752
+ const fetchOptions = buildFetchOptions("POST", options, bodyJson);
6753
+ if (bearerToken) {
6754
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
6755
+ }
6756
+ return Promise.race([
6757
+ fetch(fullUrl, fetchOptions).then((response) => {
6758
+ if (response.status == 204) {
6759
+ return response;
6760
+ } else if (response.status >= 200 && response.status < 300) {
6761
+ return response.json();
6762
+ } else {
6763
+ throw response;
6764
+ }
6765
+ }),
6766
+ new Promise(
6767
+ (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
6768
+ )
6769
+ ]);
6770
+ }
6659
6771
  };
6660
6772
 
6661
6773
  // session.ts
@@ -9467,17 +9579,7 @@ var Client = class {
9467
9579
  yield this.sessionRefresh(session);
9468
9580
  }
9469
9581
  return this.apiClient.sendToken(session.token, request).then((response) => {
9470
- return Promise.resolve(response);
9471
- });
9472
- });
9473
- }
9474
- withdrawToken(session, request) {
9475
- return __async(this, null, function* () {
9476
- if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
9477
- yield this.sessionRefresh(session);
9478
- }
9479
- return this.apiClient.withdrawToken(session.token, request).then((response) => {
9480
- return Promise.resolve(response);
9582
+ return response !== void 0;
9481
9583
  });
9482
9584
  });
9483
9585
  }
@@ -10354,8 +10456,60 @@ var Client = class {
10354
10456
  }
10355
10457
  /** list clan discover. */
10356
10458
  listClanDiscover(basePath, request) {
10357
- return this.apiClient.clanDiscover(this.serverkey, "", basePath, request).then((response) => {
10358
- return Promise.resolve(response);
10459
+ return __async(this, null, function* () {
10460
+ return this.apiClient.clanDiscover(this.serverkey, "", basePath, request).then((response) => {
10461
+ return Promise.resolve(response);
10462
+ });
10463
+ });
10464
+ }
10465
+ listQuickMenuAccess(session, botId, channelId) {
10466
+ return __async(this, null, function* () {
10467
+ if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
10468
+ yield this.sessionRefresh(session);
10469
+ }
10470
+ return this.apiClient.listQuickMenuAccess(session.token, botId, channelId).then((response) => {
10471
+ return Promise.resolve(response);
10472
+ });
10473
+ });
10474
+ }
10475
+ deleteQuickMenuAccess(session, id) {
10476
+ return __async(this, null, function* () {
10477
+ if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
10478
+ yield this.sessionRefresh(session);
10479
+ }
10480
+ return this.apiClient.deleteQuickMenuAccess(session.token, id).then((response) => {
10481
+ return response !== void 0;
10482
+ });
10483
+ });
10484
+ }
10485
+ addQuickMenuAccess(session, request) {
10486
+ return __async(this, null, function* () {
10487
+ if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
10488
+ yield this.sessionRefresh(session);
10489
+ }
10490
+ return this.apiClient.addQuickMenuAccess(session.token, request).then((response) => {
10491
+ return response !== void 0;
10492
+ });
10493
+ });
10494
+ }
10495
+ updateQuickMenuAccess(session, request) {
10496
+ return __async(this, null, function* () {
10497
+ if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
10498
+ yield this.sessionRefresh(session);
10499
+ }
10500
+ return this.apiClient.updateQuickMenuAccess(session.token, request).then((response) => {
10501
+ return response !== void 0;
10502
+ });
10503
+ });
10504
+ }
10505
+ unlockItem(session, request) {
10506
+ return __async(this, null, function* () {
10507
+ if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
10508
+ yield this.sessionRefresh(session);
10509
+ }
10510
+ return this.apiClient.unlockItem(session.token, request).then((response) => {
10511
+ return response !== void 0;
10512
+ });
10359
10513
  });
10360
10514
  }
10361
10515
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mezon-js",
3
3
 
4
- "version": "2.12.26",
4
+ "version": "2.12.28",
5
5
 
6
6
  "scripts": {
7
7
  "build": "npx tsc && npx rollup -c --bundleConfigAsCjs && node build.mjs"