mezon-js 2.12.26 → 2.12.27
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 +224 -45
- package/client.ts +101 -23
- package/dist/api.gen.d.ts +36 -6
- package/dist/client.d.ts +8 -4
- package/dist/mezon-js.cjs.js +197 -44
- package/dist/mezon-js.esm.mjs +197 -44
- package/package.json +1 -1
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,39 @@ export interface ApiUserActivity {
|
|
2672
2676
|
user_id?: string;
|
2673
2677
|
}
|
2674
2678
|
|
2679
|
+
|
2680
|
+
/** */
|
2681
|
+
export interface ApiQuickMenuAccess {
|
2682
|
+
//
|
2683
|
+
action_msg?: string;
|
2684
|
+
//
|
2685
|
+
background?: string;
|
2686
|
+
//
|
2687
|
+
bot_id?: string;
|
2688
|
+
//
|
2689
|
+
id?: string;
|
2690
|
+
//
|
2691
|
+
menu_name?: string;
|
2692
|
+
}
|
2693
|
+
|
2694
|
+
/** */
|
2695
|
+
export interface ApiQuickMenuAccessList {
|
2696
|
+
//
|
2697
|
+
list_menus?: Array<ApiQuickMenuAccess>;
|
2698
|
+
}
|
2699
|
+
|
2700
|
+
/** */
|
2701
|
+
export interface ApiQuickMenuAccessRequest {
|
2702
|
+
//
|
2703
|
+
action_msg?: string;
|
2704
|
+
//
|
2705
|
+
background?: string;
|
2706
|
+
//
|
2707
|
+
id?: string;
|
2708
|
+
//
|
2709
|
+
menu_name?: string;
|
2710
|
+
}
|
2711
|
+
|
2675
2712
|
/** */
|
2676
2713
|
export interface ApiUserPermissionInChannelListResponse {
|
2677
2714
|
//
|
@@ -2800,12 +2837,6 @@ export interface ApiWebhookListResponse {
|
|
2800
2837
|
webhooks?: Array<ApiWebhook>;
|
2801
2838
|
}
|
2802
2839
|
|
2803
|
-
/** */
|
2804
|
-
export interface ApiWithdrawTokenRequest {
|
2805
|
-
//
|
2806
|
-
amount?: number;
|
2807
|
-
}
|
2808
|
-
|
2809
2840
|
/** A collection of zero or more notifications. */
|
2810
2841
|
export interface MezonapiEmojiRecentList {
|
2811
2842
|
//Collection of emojiRecents.
|
@@ -3049,6 +3080,13 @@ export interface ApiGenerateMeetTokenResponse {
|
|
3049
3080
|
token?: string;
|
3050
3081
|
}
|
3051
3082
|
|
3083
|
+
/** */
|
3084
|
+
export interface ApiUnlockItemRequest {
|
3085
|
+
//
|
3086
|
+
item_id?: string;
|
3087
|
+
//
|
3088
|
+
item_type?: number;
|
3089
|
+
}
|
3052
3090
|
|
3053
3091
|
/** */
|
3054
3092
|
export interface ApiMezonOauthClient {
|
@@ -9741,45 +9779,6 @@ export class MezonApi {
|
|
9741
9779
|
]);
|
9742
9780
|
}
|
9743
9781
|
|
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
9782
|
/** */
|
9784
9783
|
getChannelCanvasDetail(
|
9785
9784
|
bearerToken: string,
|
@@ -10832,4 +10831,184 @@ export class MezonApi {
|
|
10832
10831
|
),
|
10833
10832
|
]);
|
10834
10833
|
}
|
10834
|
+
|
10835
|
+
/** */
|
10836
|
+
deleteQuickMenuAccess(bearerToken: string,
|
10837
|
+
id?:string,
|
10838
|
+
menuName?:string,
|
10839
|
+
background?:string,
|
10840
|
+
actionMsg?:string,
|
10841
|
+
options: any = {}): Promise<any> {
|
10842
|
+
|
10843
|
+
const urlPath = "/v2/quickmenuaccess";
|
10844
|
+
const queryParams = new Map<string, any>();
|
10845
|
+
queryParams.set("id", id);
|
10846
|
+
queryParams.set("menu_name", menuName);
|
10847
|
+
queryParams.set("background", background);
|
10848
|
+
queryParams.set("action_msg", actionMsg);
|
10849
|
+
|
10850
|
+
let bodyJson : string = "";
|
10851
|
+
|
10852
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
10853
|
+
const fetchOptions = buildFetchOptions("DELETE", options, bodyJson);
|
10854
|
+
if (bearerToken) {
|
10855
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
10856
|
+
}
|
10857
|
+
|
10858
|
+
return Promise.race([
|
10859
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
10860
|
+
if (response.status == 204) {
|
10861
|
+
return response;
|
10862
|
+
} else if (response.status >= 200 && response.status < 300) {
|
10863
|
+
return response.json();
|
10864
|
+
} else {
|
10865
|
+
throw response;
|
10866
|
+
}
|
10867
|
+
}),
|
10868
|
+
new Promise((_, reject) =>
|
10869
|
+
setTimeout(reject, this.timeoutMs, "Request timed out.")
|
10870
|
+
),
|
10871
|
+
]);
|
10872
|
+
}
|
10873
|
+
|
10874
|
+
/** */
|
10875
|
+
listQuickMenuAccess(bearerToken: string,
|
10876
|
+
botId?:string,
|
10877
|
+
options: any = {}): Promise<ApiQuickMenuAccessList> {
|
10878
|
+
|
10879
|
+
const urlPath = "/v2/quickmenuaccess";
|
10880
|
+
const queryParams = new Map<string, any>();
|
10881
|
+
queryParams.set("bot_id", botId);
|
10882
|
+
|
10883
|
+
let bodyJson : string = "";
|
10884
|
+
|
10885
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
10886
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
10887
|
+
if (bearerToken) {
|
10888
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
10889
|
+
}
|
10890
|
+
|
10891
|
+
return Promise.race([
|
10892
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
10893
|
+
if (response.status == 204) {
|
10894
|
+
return response;
|
10895
|
+
} else if (response.status >= 200 && response.status < 300) {
|
10896
|
+
return response.json();
|
10897
|
+
} else {
|
10898
|
+
throw response;
|
10899
|
+
}
|
10900
|
+
}),
|
10901
|
+
new Promise((_, reject) =>
|
10902
|
+
setTimeout(reject, this.timeoutMs, "Request timed out.")
|
10903
|
+
),
|
10904
|
+
]);
|
10905
|
+
}
|
10906
|
+
|
10907
|
+
/** */
|
10908
|
+
addQuickMenuAccess(bearerToken: string,
|
10909
|
+
body:ApiQuickMenuAccessRequest,
|
10910
|
+
options: any = {}): Promise<any> {
|
10911
|
+
|
10912
|
+
if (body === null || body === undefined) {
|
10913
|
+
throw new Error("'body' is a required parameter but is null or undefined.");
|
10914
|
+
}
|
10915
|
+
const urlPath = "/v2/quickmenuaccess";
|
10916
|
+
const queryParams = new Map<string, any>();
|
10917
|
+
|
10918
|
+
let bodyJson : string = "";
|
10919
|
+
bodyJson = JSON.stringify(body || {});
|
10920
|
+
|
10921
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
10922
|
+
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
10923
|
+
if (bearerToken) {
|
10924
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
10925
|
+
}
|
10926
|
+
|
10927
|
+
return Promise.race([
|
10928
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
10929
|
+
if (response.status == 204) {
|
10930
|
+
return response;
|
10931
|
+
} else if (response.status >= 200 && response.status < 300) {
|
10932
|
+
return response.json();
|
10933
|
+
} else {
|
10934
|
+
throw response;
|
10935
|
+
}
|
10936
|
+
}),
|
10937
|
+
new Promise((_, reject) =>
|
10938
|
+
setTimeout(reject, this.timeoutMs, "Request timed out.")
|
10939
|
+
),
|
10940
|
+
]);
|
10941
|
+
}
|
10942
|
+
|
10943
|
+
/** */
|
10944
|
+
updateQuickMenuAccess(bearerToken: string,
|
10945
|
+
body:ApiQuickMenuAccessRequest,
|
10946
|
+
options: any = {}): Promise<any> {
|
10947
|
+
|
10948
|
+
if (body === null || body === undefined) {
|
10949
|
+
throw new Error("'body' is a required parameter but is null or undefined.");
|
10950
|
+
}
|
10951
|
+
const urlPath = "/v2/quickmenuaccess";
|
10952
|
+
const queryParams = new Map<string, any>();
|
10953
|
+
|
10954
|
+
let bodyJson : string = "";
|
10955
|
+
bodyJson = JSON.stringify(body || {});
|
10956
|
+
|
10957
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
10958
|
+
const fetchOptions = buildFetchOptions("PUT", options, bodyJson);
|
10959
|
+
if (bearerToken) {
|
10960
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
10961
|
+
}
|
10962
|
+
|
10963
|
+
return Promise.race([
|
10964
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
10965
|
+
if (response.status == 204) {
|
10966
|
+
return response;
|
10967
|
+
} else if (response.status >= 200 && response.status < 300) {
|
10968
|
+
return response.json();
|
10969
|
+
} else {
|
10970
|
+
throw response;
|
10971
|
+
}
|
10972
|
+
}),
|
10973
|
+
new Promise((_, reject) =>
|
10974
|
+
setTimeout(reject, this.timeoutMs, "Request timed out.")
|
10975
|
+
),
|
10976
|
+
]);
|
10977
|
+
}
|
10978
|
+
|
10979
|
+
/** UnlockItem */
|
10980
|
+
unlockItem(bearerToken: string,
|
10981
|
+
body:ApiUnlockItemRequest,
|
10982
|
+
options: any = {}): Promise<any> {
|
10983
|
+
|
10984
|
+
if (body === null || body === undefined) {
|
10985
|
+
throw new Error("'body' is a required parameter but is null or undefined.");
|
10986
|
+
}
|
10987
|
+
const urlPath = "/v2/unlockitem";
|
10988
|
+
const queryParams = new Map<string, any>();
|
10989
|
+
|
10990
|
+
let bodyJson : string = "";
|
10991
|
+
bodyJson = JSON.stringify(body || {});
|
10992
|
+
|
10993
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
10994
|
+
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
10995
|
+
if (bearerToken) {
|
10996
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
10997
|
+
}
|
10998
|
+
|
10999
|
+
return Promise.race([
|
11000
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
11001
|
+
if (response.status == 204) {
|
11002
|
+
return response;
|
11003
|
+
} else if (response.status >= 200 && response.status < 300) {
|
11004
|
+
return response.json();
|
11005
|
+
} else {
|
11006
|
+
throw response;
|
11007
|
+
}
|
11008
|
+
}),
|
11009
|
+
new Promise((_, reject) =>
|
11010
|
+
setTimeout(reject, this.timeoutMs, "Request timed out.")
|
11011
|
+
),
|
11012
|
+
]);
|
11013
|
+
}
|
10835
11014
|
}
|
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:
|
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:
|
3182
|
-
return
|
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,96 @@ export class Client {
|
|
4760
4746
|
return Promise.resolve(response);
|
4761
4747
|
});
|
4762
4748
|
}
|
4749
|
+
|
4750
|
+
async listQuickMenuAccess(
|
4751
|
+
session: Session,
|
4752
|
+
botId: string
|
4753
|
+
): Promise<ApiQuickMenuAccessList> {
|
4754
|
+
if (
|
4755
|
+
this.autoRefreshSession &&
|
4756
|
+
session.refresh_token &&
|
4757
|
+
session.isexpired(Date.now() / 1000)
|
4758
|
+
) {
|
4759
|
+
await this.sessionRefresh(session);
|
4760
|
+
}
|
4761
|
+
|
4762
|
+
return this.apiClient
|
4763
|
+
.listQuickMenuAccess(session.token, botId)
|
4764
|
+
.then((response: ApiQuickMenuAccessList) => {
|
4765
|
+
return Promise.resolve(response);
|
4766
|
+
});
|
4767
|
+
}
|
4768
|
+
|
4769
|
+
async deleteQuickMenuAccess(
|
4770
|
+
session: Session,
|
4771
|
+
id: string
|
4772
|
+
): Promise<any> {
|
4773
|
+
if (
|
4774
|
+
this.autoRefreshSession &&
|
4775
|
+
session.refresh_token &&
|
4776
|
+
session.isexpired(Date.now() / 1000)
|
4777
|
+
) {
|
4778
|
+
await this.sessionRefresh(session);
|
4779
|
+
}
|
4780
|
+
|
4781
|
+
return this.apiClient
|
4782
|
+
.deleteQuickMenuAccess(session.token, id)
|
4783
|
+
.then((response: any) => {
|
4784
|
+
return response !== undefined;
|
4785
|
+
});
|
4786
|
+
}
|
4787
|
+
|
4788
|
+
async addQuickMenuAccess(
|
4789
|
+
session: Session,
|
4790
|
+
request: ApiQuickMenuAccessRequest
|
4791
|
+
): Promise<any> {
|
4792
|
+
if (
|
4793
|
+
this.autoRefreshSession &&
|
4794
|
+
session.refresh_token &&
|
4795
|
+
session.isexpired(Date.now() / 1000)
|
4796
|
+
) {
|
4797
|
+
await this.sessionRefresh(session);
|
4798
|
+
}
|
4799
|
+
|
4800
|
+
return this.apiClient
|
4801
|
+
.addQuickMenuAccess(session.token, request)
|
4802
|
+
.then((response: any) => {
|
4803
|
+
return response !== undefined;
|
4804
|
+
});
|
4805
|
+
}
|
4806
|
+
|
4807
|
+
async updateQuickMenuAccess(
|
4808
|
+
session: Session,
|
4809
|
+
request: ApiQuickMenuAccessRequest
|
4810
|
+
): Promise<any> {
|
4811
|
+
if (
|
4812
|
+
this.autoRefreshSession &&
|
4813
|
+
session.refresh_token &&
|
4814
|
+
session.isexpired(Date.now() / 1000)
|
4815
|
+
) {
|
4816
|
+
await this.sessionRefresh(session);
|
4817
|
+
}
|
4818
|
+
|
4819
|
+
return this.apiClient
|
4820
|
+
.updateQuickMenuAccess(session.token, request)
|
4821
|
+
.then((response: any) => {
|
4822
|
+
return response !== undefined;
|
4823
|
+
});
|
4824
|
+
}
|
4825
|
+
|
4826
|
+
async unlockItem(session: Session, request: ApiUnlockItemRequest): Promise<any> {
|
4827
|
+
if (
|
4828
|
+
this.autoRefreshSession &&
|
4829
|
+
session.refresh_token &&
|
4830
|
+
session.isexpired(Date.now() / 1000)
|
4831
|
+
) {
|
4832
|
+
await this.sessionRefresh(session);
|
4833
|
+
}
|
4834
|
+
|
4835
|
+
return this.apiClient
|
4836
|
+
.unlockItem(session.token, request)
|
4837
|
+
.then((response: any) => {
|
4838
|
+
return response !== undefined
|
4839
|
+
});
|
4840
|
+
}
|
4763
4841
|
}
|
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,25 @@ 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
|
+
id?: string;
|
1539
|
+
menu_name?: string;
|
1540
|
+
}
|
1541
|
+
/** */
|
1542
|
+
export interface ApiQuickMenuAccessList {
|
1543
|
+
list_menus?: Array<ApiQuickMenuAccess>;
|
1544
|
+
}
|
1545
|
+
/** */
|
1546
|
+
export interface ApiQuickMenuAccessRequest {
|
1547
|
+
action_msg?: string;
|
1548
|
+
background?: string;
|
1549
|
+
id?: string;
|
1550
|
+
menu_name?: string;
|
1551
|
+
}
|
1552
|
+
/** */
|
1532
1553
|
export interface ApiUserPermissionInChannelListResponse {
|
1533
1554
|
channel_id?: string;
|
1534
1555
|
clan_id?: string;
|
@@ -1604,10 +1625,6 @@ export interface ApiWebhookGenerateResponse {
|
|
1604
1625
|
export interface ApiWebhookListResponse {
|
1605
1626
|
webhooks?: Array<ApiWebhook>;
|
1606
1627
|
}
|
1607
|
-
/** */
|
1608
|
-
export interface ApiWithdrawTokenRequest {
|
1609
|
-
amount?: number;
|
1610
|
-
}
|
1611
1628
|
/** A collection of zero or more notifications. */
|
1612
1629
|
export interface MezonapiEmojiRecentList {
|
1613
1630
|
emoji_recents?: Array<ApiEmojiRecent>;
|
@@ -1752,6 +1769,11 @@ export interface ApiGenerateMeetTokenResponse {
|
|
1752
1769
|
token?: string;
|
1753
1770
|
}
|
1754
1771
|
/** */
|
1772
|
+
export interface ApiUnlockItemRequest {
|
1773
|
+
item_id?: string;
|
1774
|
+
item_type?: number;
|
1775
|
+
}
|
1776
|
+
/** */
|
1755
1777
|
export interface ApiMezonOauthClient {
|
1756
1778
|
access_token_strategy?: string;
|
1757
1779
|
allowed_cors_origins?: Array<string>;
|
@@ -2167,8 +2189,6 @@ export declare class MezonApi {
|
|
2167
2189
|
buildFullUrl(basePath: string, fragment: string, queryParams: Map<string, any>): string;
|
2168
2190
|
/** Channel canvas editor */
|
2169
2191
|
editChannelCanvases(bearerToken: string, body: ApiEditChannelCanvasRequest, options?: any): Promise<ApiEditChannelCanvasResponse>;
|
2170
|
-
/** WithdrawToken */
|
2171
|
-
withdrawToken(bearerToken: string, body: ApiWithdrawTokenRequest, options?: any): Promise<any>;
|
2172
2192
|
/** */
|
2173
2193
|
getChannelCanvasDetail(bearerToken: string, id: string, clanId?: string, channelId?: string, options?: any): Promise<ApiChannelCanvasDetailResponse>;
|
2174
2194
|
/** */
|
@@ -2223,4 +2243,14 @@ export declare class MezonApi {
|
|
2223
2243
|
updateClanOrder(bearerToken: string, body: ApiUpdateClanOrderRequest, options?: any): Promise<any>;
|
2224
2244
|
/** Discover mezon clan. */
|
2225
2245
|
clanDiscover(basicAuthUsername: string, basicAuthPassword: string, basePath: string, body: ApiClanDiscoverRequest, options?: any): Promise<ApiListClanDiscover>;
|
2246
|
+
/** */
|
2247
|
+
deleteQuickMenuAccess(bearerToken: string, id?: string, menuName?: string, background?: string, actionMsg?: string, options?: any): Promise<any>;
|
2248
|
+
/** */
|
2249
|
+
listQuickMenuAccess(bearerToken: string, botId?: string, options?: any): Promise<ApiQuickMenuAccessList>;
|
2250
|
+
/** */
|
2251
|
+
addQuickMenuAccess(bearerToken: string, body: ApiQuickMenuAccessRequest, options?: any): Promise<any>;
|
2252
|
+
/** */
|
2253
|
+
updateQuickMenuAccess(bearerToken: string, body: ApiQuickMenuAccessRequest, options?: any): Promise<any>;
|
2254
|
+
/** UnlockItem */
|
2255
|
+
unlockItem(bearerToken: string, body: ApiUnlockItemRequest, options?: any): Promise<any>;
|
2226
2256
|
}
|
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,
|
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<
|
542
|
-
sendToken(session: Session, request: ApiTokenSentEvent): Promise<
|
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): 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
|
}
|
package/dist/mezon-js.cjs.js
CHANGED
@@ -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,148 @@ 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, options = {}) {
|
6693
|
+
const urlPath = "/v2/quickmenuaccess";
|
6694
|
+
const queryParams = /* @__PURE__ */ new Map();
|
6695
|
+
queryParams.set("bot_id", botId);
|
6696
|
+
let bodyJson = "";
|
6697
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
6698
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
6699
|
+
if (bearerToken) {
|
6700
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
6701
|
+
}
|
6702
|
+
return Promise.race([
|
6703
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
6704
|
+
if (response.status == 204) {
|
6705
|
+
return response;
|
6706
|
+
} else if (response.status >= 200 && response.status < 300) {
|
6707
|
+
return response.json();
|
6708
|
+
} else {
|
6709
|
+
throw response;
|
6710
|
+
}
|
6711
|
+
}),
|
6712
|
+
new Promise(
|
6713
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
6714
|
+
)
|
6715
|
+
]);
|
6716
|
+
}
|
6717
|
+
/** */
|
6718
|
+
addQuickMenuAccess(bearerToken, body, options = {}) {
|
6719
|
+
if (body === null || body === void 0) {
|
6720
|
+
throw new Error("'body' is a required parameter but is null or undefined.");
|
6721
|
+
}
|
6722
|
+
const urlPath = "/v2/quickmenuaccess";
|
6723
|
+
const queryParams = /* @__PURE__ */ new Map();
|
6724
|
+
let bodyJson = "";
|
6725
|
+
bodyJson = JSON.stringify(body || {});
|
6726
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
6727
|
+
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
6728
|
+
if (bearerToken) {
|
6729
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
6730
|
+
}
|
6731
|
+
return Promise.race([
|
6732
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
6733
|
+
if (response.status == 204) {
|
6734
|
+
return response;
|
6735
|
+
} else if (response.status >= 200 && response.status < 300) {
|
6736
|
+
return response.json();
|
6737
|
+
} else {
|
6738
|
+
throw response;
|
6739
|
+
}
|
6740
|
+
}),
|
6741
|
+
new Promise(
|
6742
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
6743
|
+
)
|
6744
|
+
]);
|
6745
|
+
}
|
6746
|
+
/** */
|
6747
|
+
updateQuickMenuAccess(bearerToken, body, options = {}) {
|
6748
|
+
if (body === null || body === void 0) {
|
6749
|
+
throw new Error("'body' is a required parameter but is null or undefined.");
|
6750
|
+
}
|
6751
|
+
const urlPath = "/v2/quickmenuaccess";
|
6752
|
+
const queryParams = /* @__PURE__ */ new Map();
|
6753
|
+
let bodyJson = "";
|
6754
|
+
bodyJson = JSON.stringify(body || {});
|
6755
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
6756
|
+
const fetchOptions = buildFetchOptions("PUT", options, bodyJson);
|
6757
|
+
if (bearerToken) {
|
6758
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
6759
|
+
}
|
6760
|
+
return Promise.race([
|
6761
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
6762
|
+
if (response.status == 204) {
|
6763
|
+
return response;
|
6764
|
+
} else if (response.status >= 200 && response.status < 300) {
|
6765
|
+
return response.json();
|
6766
|
+
} else {
|
6767
|
+
throw response;
|
6768
|
+
}
|
6769
|
+
}),
|
6770
|
+
new Promise(
|
6771
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
6772
|
+
)
|
6773
|
+
]);
|
6774
|
+
}
|
6775
|
+
/** UnlockItem */
|
6776
|
+
unlockItem(bearerToken, body, options = {}) {
|
6777
|
+
if (body === null || body === void 0) {
|
6778
|
+
throw new Error("'body' is a required parameter but is null or undefined.");
|
6779
|
+
}
|
6780
|
+
const urlPath = "/v2/unlockitem";
|
6781
|
+
const queryParams = /* @__PURE__ */ new Map();
|
6782
|
+
let bodyJson = "";
|
6783
|
+
bodyJson = JSON.stringify(body || {});
|
6784
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
6785
|
+
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
6786
|
+
if (bearerToken) {
|
6787
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
6788
|
+
}
|
6789
|
+
return Promise.race([
|
6790
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
6791
|
+
if (response.status == 204) {
|
6792
|
+
return response;
|
6793
|
+
} else if (response.status >= 200 && response.status < 300) {
|
6794
|
+
return response.json();
|
6795
|
+
} else {
|
6796
|
+
throw response;
|
6797
|
+
}
|
6798
|
+
}),
|
6799
|
+
new Promise(
|
6800
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
6801
|
+
)
|
6802
|
+
]);
|
6803
|
+
}
|
6693
6804
|
};
|
6694
6805
|
|
6695
6806
|
// session.ts
|
@@ -9501,17 +9612,7 @@ var Client = class {
|
|
9501
9612
|
yield this.sessionRefresh(session);
|
9502
9613
|
}
|
9503
9614
|
return this.apiClient.sendToken(session.token, request).then((response) => {
|
9504
|
-
return
|
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);
|
9615
|
+
return response !== void 0;
|
9515
9616
|
});
|
9516
9617
|
});
|
9517
9618
|
}
|
@@ -10388,8 +10489,60 @@ var Client = class {
|
|
10388
10489
|
}
|
10389
10490
|
/** list clan discover. */
|
10390
10491
|
listClanDiscover(basePath, request) {
|
10391
|
-
return
|
10392
|
-
return
|
10492
|
+
return __async(this, null, function* () {
|
10493
|
+
return this.apiClient.clanDiscover(this.serverkey, "", basePath, request).then((response) => {
|
10494
|
+
return Promise.resolve(response);
|
10495
|
+
});
|
10496
|
+
});
|
10497
|
+
}
|
10498
|
+
listQuickMenuAccess(session, botId) {
|
10499
|
+
return __async(this, null, function* () {
|
10500
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
|
10501
|
+
yield this.sessionRefresh(session);
|
10502
|
+
}
|
10503
|
+
return this.apiClient.listQuickMenuAccess(session.token, botId).then((response) => {
|
10504
|
+
return Promise.resolve(response);
|
10505
|
+
});
|
10506
|
+
});
|
10507
|
+
}
|
10508
|
+
deleteQuickMenuAccess(session, id) {
|
10509
|
+
return __async(this, null, function* () {
|
10510
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
|
10511
|
+
yield this.sessionRefresh(session);
|
10512
|
+
}
|
10513
|
+
return this.apiClient.deleteQuickMenuAccess(session.token, id).then((response) => {
|
10514
|
+
return response !== void 0;
|
10515
|
+
});
|
10516
|
+
});
|
10517
|
+
}
|
10518
|
+
addQuickMenuAccess(session, request) {
|
10519
|
+
return __async(this, null, function* () {
|
10520
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
|
10521
|
+
yield this.sessionRefresh(session);
|
10522
|
+
}
|
10523
|
+
return this.apiClient.addQuickMenuAccess(session.token, request).then((response) => {
|
10524
|
+
return response !== void 0;
|
10525
|
+
});
|
10526
|
+
});
|
10527
|
+
}
|
10528
|
+
updateQuickMenuAccess(session, request) {
|
10529
|
+
return __async(this, null, function* () {
|
10530
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
|
10531
|
+
yield this.sessionRefresh(session);
|
10532
|
+
}
|
10533
|
+
return this.apiClient.updateQuickMenuAccess(session.token, request).then((response) => {
|
10534
|
+
return response !== void 0;
|
10535
|
+
});
|
10536
|
+
});
|
10537
|
+
}
|
10538
|
+
unlockItem(session, request) {
|
10539
|
+
return __async(this, null, function* () {
|
10540
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
|
10541
|
+
yield this.sessionRefresh(session);
|
10542
|
+
}
|
10543
|
+
return this.apiClient.unlockItem(session.token, request).then((response) => {
|
10544
|
+
return response !== void 0;
|
10545
|
+
});
|
10393
10546
|
});
|
10394
10547
|
}
|
10395
10548
|
};
|
package/dist/mezon-js.esm.mjs
CHANGED
@@ -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,148 @@ 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, options = {}) {
|
6659
|
+
const urlPath = "/v2/quickmenuaccess";
|
6660
|
+
const queryParams = /* @__PURE__ */ new Map();
|
6661
|
+
queryParams.set("bot_id", botId);
|
6662
|
+
let bodyJson = "";
|
6663
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
6664
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
6665
|
+
if (bearerToken) {
|
6666
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
6667
|
+
}
|
6668
|
+
return Promise.race([
|
6669
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
6670
|
+
if (response.status == 204) {
|
6671
|
+
return response;
|
6672
|
+
} else if (response.status >= 200 && response.status < 300) {
|
6673
|
+
return response.json();
|
6674
|
+
} else {
|
6675
|
+
throw response;
|
6676
|
+
}
|
6677
|
+
}),
|
6678
|
+
new Promise(
|
6679
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
6680
|
+
)
|
6681
|
+
]);
|
6682
|
+
}
|
6683
|
+
/** */
|
6684
|
+
addQuickMenuAccess(bearerToken, body, options = {}) {
|
6685
|
+
if (body === null || body === void 0) {
|
6686
|
+
throw new Error("'body' is a required parameter but is null or undefined.");
|
6687
|
+
}
|
6688
|
+
const urlPath = "/v2/quickmenuaccess";
|
6689
|
+
const queryParams = /* @__PURE__ */ new Map();
|
6690
|
+
let bodyJson = "";
|
6691
|
+
bodyJson = JSON.stringify(body || {});
|
6692
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
6693
|
+
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
6694
|
+
if (bearerToken) {
|
6695
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
6696
|
+
}
|
6697
|
+
return Promise.race([
|
6698
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
6699
|
+
if (response.status == 204) {
|
6700
|
+
return response;
|
6701
|
+
} else if (response.status >= 200 && response.status < 300) {
|
6702
|
+
return response.json();
|
6703
|
+
} else {
|
6704
|
+
throw response;
|
6705
|
+
}
|
6706
|
+
}),
|
6707
|
+
new Promise(
|
6708
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
6709
|
+
)
|
6710
|
+
]);
|
6711
|
+
}
|
6712
|
+
/** */
|
6713
|
+
updateQuickMenuAccess(bearerToken, body, options = {}) {
|
6714
|
+
if (body === null || body === void 0) {
|
6715
|
+
throw new Error("'body' is a required parameter but is null or undefined.");
|
6716
|
+
}
|
6717
|
+
const urlPath = "/v2/quickmenuaccess";
|
6718
|
+
const queryParams = /* @__PURE__ */ new Map();
|
6719
|
+
let bodyJson = "";
|
6720
|
+
bodyJson = JSON.stringify(body || {});
|
6721
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
6722
|
+
const fetchOptions = buildFetchOptions("PUT", options, bodyJson);
|
6723
|
+
if (bearerToken) {
|
6724
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
6725
|
+
}
|
6726
|
+
return Promise.race([
|
6727
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
6728
|
+
if (response.status == 204) {
|
6729
|
+
return response;
|
6730
|
+
} else if (response.status >= 200 && response.status < 300) {
|
6731
|
+
return response.json();
|
6732
|
+
} else {
|
6733
|
+
throw response;
|
6734
|
+
}
|
6735
|
+
}),
|
6736
|
+
new Promise(
|
6737
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
6738
|
+
)
|
6739
|
+
]);
|
6740
|
+
}
|
6741
|
+
/** UnlockItem */
|
6742
|
+
unlockItem(bearerToken, body, options = {}) {
|
6743
|
+
if (body === null || body === void 0) {
|
6744
|
+
throw new Error("'body' is a required parameter but is null or undefined.");
|
6745
|
+
}
|
6746
|
+
const urlPath = "/v2/unlockitem";
|
6747
|
+
const queryParams = /* @__PURE__ */ new Map();
|
6748
|
+
let bodyJson = "";
|
6749
|
+
bodyJson = JSON.stringify(body || {});
|
6750
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
6751
|
+
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
6752
|
+
if (bearerToken) {
|
6753
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
6754
|
+
}
|
6755
|
+
return Promise.race([
|
6756
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
6757
|
+
if (response.status == 204) {
|
6758
|
+
return response;
|
6759
|
+
} else if (response.status >= 200 && response.status < 300) {
|
6760
|
+
return response.json();
|
6761
|
+
} else {
|
6762
|
+
throw response;
|
6763
|
+
}
|
6764
|
+
}),
|
6765
|
+
new Promise(
|
6766
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
6767
|
+
)
|
6768
|
+
]);
|
6769
|
+
}
|
6659
6770
|
};
|
6660
6771
|
|
6661
6772
|
// session.ts
|
@@ -9467,17 +9578,7 @@ var Client = class {
|
|
9467
9578
|
yield this.sessionRefresh(session);
|
9468
9579
|
}
|
9469
9580
|
return this.apiClient.sendToken(session.token, request).then((response) => {
|
9470
|
-
return
|
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);
|
9581
|
+
return response !== void 0;
|
9481
9582
|
});
|
9482
9583
|
});
|
9483
9584
|
}
|
@@ -10354,8 +10455,60 @@ var Client = class {
|
|
10354
10455
|
}
|
10355
10456
|
/** list clan discover. */
|
10356
10457
|
listClanDiscover(basePath, request) {
|
10357
|
-
return
|
10358
|
-
return
|
10458
|
+
return __async(this, null, function* () {
|
10459
|
+
return this.apiClient.clanDiscover(this.serverkey, "", basePath, request).then((response) => {
|
10460
|
+
return Promise.resolve(response);
|
10461
|
+
});
|
10462
|
+
});
|
10463
|
+
}
|
10464
|
+
listQuickMenuAccess(session, botId) {
|
10465
|
+
return __async(this, null, function* () {
|
10466
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
|
10467
|
+
yield this.sessionRefresh(session);
|
10468
|
+
}
|
10469
|
+
return this.apiClient.listQuickMenuAccess(session.token, botId).then((response) => {
|
10470
|
+
return Promise.resolve(response);
|
10471
|
+
});
|
10472
|
+
});
|
10473
|
+
}
|
10474
|
+
deleteQuickMenuAccess(session, id) {
|
10475
|
+
return __async(this, null, function* () {
|
10476
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
|
10477
|
+
yield this.sessionRefresh(session);
|
10478
|
+
}
|
10479
|
+
return this.apiClient.deleteQuickMenuAccess(session.token, id).then((response) => {
|
10480
|
+
return response !== void 0;
|
10481
|
+
});
|
10482
|
+
});
|
10483
|
+
}
|
10484
|
+
addQuickMenuAccess(session, request) {
|
10485
|
+
return __async(this, null, function* () {
|
10486
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
|
10487
|
+
yield this.sessionRefresh(session);
|
10488
|
+
}
|
10489
|
+
return this.apiClient.addQuickMenuAccess(session.token, request).then((response) => {
|
10490
|
+
return response !== void 0;
|
10491
|
+
});
|
10492
|
+
});
|
10493
|
+
}
|
10494
|
+
updateQuickMenuAccess(session, request) {
|
10495
|
+
return __async(this, null, function* () {
|
10496
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
|
10497
|
+
yield this.sessionRefresh(session);
|
10498
|
+
}
|
10499
|
+
return this.apiClient.updateQuickMenuAccess(session.token, request).then((response) => {
|
10500
|
+
return response !== void 0;
|
10501
|
+
});
|
10502
|
+
});
|
10503
|
+
}
|
10504
|
+
unlockItem(session, request) {
|
10505
|
+
return __async(this, null, function* () {
|
10506
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
|
10507
|
+
yield this.sessionRefresh(session);
|
10508
|
+
}
|
10509
|
+
return this.apiClient.unlockItem(session.token, request).then((response) => {
|
10510
|
+
return response !== void 0;
|
10511
|
+
});
|
10359
10512
|
});
|
10360
10513
|
}
|
10361
10514
|
};
|