mezon-js 2.12.27 → 2.12.29
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 +69 -2
- package/client.ts +22 -2
- package/dist/api.gen.d.ts +21 -1
- package/dist/client.d.ts +3 -2
- package/dist/mezon-js.cjs.js +43 -3
- package/dist/mezon-js.esm.mjs +43 -3
- package/package.json +1 -1
package/api.gen.ts
CHANGED
@@ -2676,7 +2676,6 @@ export interface ApiUserActivity {
|
|
2676
2676
|
user_id?: string;
|
2677
2677
|
}
|
2678
2678
|
|
2679
|
-
|
2680
2679
|
/** */
|
2681
2680
|
export interface ApiQuickMenuAccess {
|
2682
2681
|
//
|
@@ -2686,6 +2685,10 @@ export interface ApiQuickMenuAccess {
|
|
2686
2685
|
//
|
2687
2686
|
bot_id?: string;
|
2688
2687
|
//
|
2688
|
+
channel_id?: string;
|
2689
|
+
//
|
2690
|
+
clan_id?:string;
|
2691
|
+
//
|
2689
2692
|
id?: string;
|
2690
2693
|
//
|
2691
2694
|
menu_name?: string;
|
@@ -2704,6 +2707,12 @@ export interface ApiQuickMenuAccessRequest {
|
|
2704
2707
|
//
|
2705
2708
|
background?: string;
|
2706
2709
|
//
|
2710
|
+
bot_id?: string;
|
2711
|
+
//
|
2712
|
+
channel_id?: string;
|
2713
|
+
//
|
2714
|
+
clan_id?: string;
|
2715
|
+
//
|
2707
2716
|
id?: string;
|
2708
2717
|
//
|
2709
2718
|
menu_name?: string;
|
@@ -3224,6 +3233,26 @@ export interface ApiClanDiscover {
|
|
3224
3233
|
verified?: boolean;
|
3225
3234
|
}
|
3226
3235
|
|
3236
|
+
/** */
|
3237
|
+
export interface ApiListForSaleItemsRequest {
|
3238
|
+
//
|
3239
|
+
page?: number;
|
3240
|
+
}
|
3241
|
+
|
3242
|
+
/** */
|
3243
|
+
export interface ApiForSaleItem {
|
3244
|
+
//
|
3245
|
+
preview_url?: string;
|
3246
|
+
//
|
3247
|
+
type?: number;
|
3248
|
+
}
|
3249
|
+
|
3250
|
+
/** */
|
3251
|
+
export interface ApiForSaleItemList {
|
3252
|
+
//
|
3253
|
+
for_sale_items?: Array<ApiForSaleItem>;
|
3254
|
+
}
|
3255
|
+
|
3227
3256
|
/** */
|
3228
3257
|
export interface ApiListClanDiscover {
|
3229
3258
|
//
|
@@ -10874,11 +10903,13 @@ export class MezonApi {
|
|
10874
10903
|
/** */
|
10875
10904
|
listQuickMenuAccess(bearerToken: string,
|
10876
10905
|
botId?:string,
|
10906
|
+
channelId?:string,
|
10877
10907
|
options: any = {}): Promise<ApiQuickMenuAccessList> {
|
10878
10908
|
|
10879
10909
|
const urlPath = "/v2/quickmenuaccess";
|
10880
10910
|
const queryParams = new Map<string, any>();
|
10881
10911
|
queryParams.set("bot_id", botId);
|
10912
|
+
queryParams.set("channel_id", channelId);
|
10882
10913
|
|
10883
10914
|
let bodyJson : string = "";
|
10884
10915
|
|
@@ -10902,7 +10933,7 @@ export class MezonApi {
|
|
10902
10933
|
setTimeout(reject, this.timeoutMs, "Request timed out.")
|
10903
10934
|
),
|
10904
10935
|
]);
|
10905
|
-
}
|
10936
|
+
}
|
10906
10937
|
|
10907
10938
|
/** */
|
10908
10939
|
addQuickMenuAccess(bearerToken: string,
|
@@ -11011,4 +11042,40 @@ export class MezonApi {
|
|
11011
11042
|
),
|
11012
11043
|
]);
|
11013
11044
|
}
|
11045
|
+
|
11046
|
+
/** UnlockItem */
|
11047
|
+
listForSaleItems(bearerToken: string,
|
11048
|
+
body:ApiListForSaleItemsRequest,
|
11049
|
+
options: any = {}): Promise<ApiForSaleItemList> {
|
11050
|
+
|
11051
|
+
if (body === null || body === undefined) {
|
11052
|
+
throw new Error("'body' is a required parameter but is null or undefined.");
|
11053
|
+
}
|
11054
|
+
const urlPath = "/v2/forsale";
|
11055
|
+
const queryParams = new Map<string, any>();
|
11056
|
+
|
11057
|
+
let bodyJson : string = "";
|
11058
|
+
bodyJson = JSON.stringify(body || {});
|
11059
|
+
|
11060
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
11061
|
+
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
11062
|
+
if (bearerToken) {
|
11063
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
11064
|
+
}
|
11065
|
+
|
11066
|
+
return Promise.race([
|
11067
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
11068
|
+
if (response.status == 204) {
|
11069
|
+
return response;
|
11070
|
+
} else if (response.status >= 200 && response.status < 300) {
|
11071
|
+
return response.json();
|
11072
|
+
} else {
|
11073
|
+
throw response;
|
11074
|
+
}
|
11075
|
+
}),
|
11076
|
+
new Promise((_, reject) =>
|
11077
|
+
setTimeout(reject, this.timeoutMs, "Request timed out.")
|
11078
|
+
),
|
11079
|
+
]);
|
11080
|
+
}
|
11014
11081
|
}
|
package/client.ts
CHANGED
@@ -167,6 +167,8 @@ import {
|
|
167
167
|
ApiQuickMenuAccessList,
|
168
168
|
ApiQuickMenuAccessRequest,
|
169
169
|
ApiUnlockItemRequest,
|
170
|
+
ApiListForSaleItemsRequest,
|
171
|
+
ApiForSaleItemList,
|
170
172
|
} from "./api.gen";
|
171
173
|
|
172
174
|
import { Session } from "./session";
|
@@ -4749,7 +4751,8 @@ export class Client {
|
|
4749
4751
|
|
4750
4752
|
async listQuickMenuAccess(
|
4751
4753
|
session: Session,
|
4752
|
-
botId: string
|
4754
|
+
botId: string,
|
4755
|
+
channelId: string
|
4753
4756
|
): Promise<ApiQuickMenuAccessList> {
|
4754
4757
|
if (
|
4755
4758
|
this.autoRefreshSession &&
|
@@ -4760,7 +4763,7 @@ export class Client {
|
|
4760
4763
|
}
|
4761
4764
|
|
4762
4765
|
return this.apiClient
|
4763
|
-
.listQuickMenuAccess(session.token, botId)
|
4766
|
+
.listQuickMenuAccess(session.token, botId, channelId)
|
4764
4767
|
.then((response: ApiQuickMenuAccessList) => {
|
4765
4768
|
return Promise.resolve(response);
|
4766
4769
|
});
|
@@ -4838,4 +4841,21 @@ export class Client {
|
|
4838
4841
|
return response !== undefined
|
4839
4842
|
});
|
4840
4843
|
}
|
4844
|
+
|
4845
|
+
async listForSaleItems(session: Session,
|
4846
|
+
request: ApiListForSaleItemsRequest): Promise<ApiForSaleItemList> {
|
4847
|
+
if (
|
4848
|
+
this.autoRefreshSession &&
|
4849
|
+
session.refresh_token &&
|
4850
|
+
session.isexpired(Date.now() / 1000)
|
4851
|
+
) {
|
4852
|
+
await this.sessionRefresh(session);
|
4853
|
+
}
|
4854
|
+
|
4855
|
+
return this.apiClient
|
4856
|
+
.listForSaleItems(session.token, request)
|
4857
|
+
.then((response: ApiForSaleItemList) => {
|
4858
|
+
return Promise.resolve(response);
|
4859
|
+
});
|
4860
|
+
}
|
4841
4861
|
}
|
package/dist/api.gen.d.ts
CHANGED
@@ -1535,6 +1535,8 @@ export interface ApiQuickMenuAccess {
|
|
1535
1535
|
action_msg?: string;
|
1536
1536
|
background?: string;
|
1537
1537
|
bot_id?: string;
|
1538
|
+
channel_id?: string;
|
1539
|
+
clan_id?: string;
|
1538
1540
|
id?: string;
|
1539
1541
|
menu_name?: string;
|
1540
1542
|
}
|
@@ -1546,6 +1548,9 @@ export interface ApiQuickMenuAccessList {
|
|
1546
1548
|
export interface ApiQuickMenuAccessRequest {
|
1547
1549
|
action_msg?: string;
|
1548
1550
|
background?: string;
|
1551
|
+
bot_id?: string;
|
1552
|
+
channel_id?: string;
|
1553
|
+
clan_id?: string;
|
1549
1554
|
id?: string;
|
1550
1555
|
menu_name?: string;
|
1551
1556
|
}
|
@@ -1846,6 +1851,19 @@ export interface ApiClanDiscover {
|
|
1846
1851
|
verified?: boolean;
|
1847
1852
|
}
|
1848
1853
|
/** */
|
1854
|
+
export interface ApiListForSaleItemsRequest {
|
1855
|
+
page?: number;
|
1856
|
+
}
|
1857
|
+
/** */
|
1858
|
+
export interface ApiForSaleItem {
|
1859
|
+
preview_url?: string;
|
1860
|
+
type?: number;
|
1861
|
+
}
|
1862
|
+
/** */
|
1863
|
+
export interface ApiForSaleItemList {
|
1864
|
+
for_sale_items?: Array<ApiForSaleItem>;
|
1865
|
+
}
|
1866
|
+
/** */
|
1849
1867
|
export interface ApiListClanDiscover {
|
1850
1868
|
clan_discover?: Array<ApiClanDiscover>;
|
1851
1869
|
page?: number;
|
@@ -2246,11 +2264,13 @@ export declare class MezonApi {
|
|
2246
2264
|
/** */
|
2247
2265
|
deleteQuickMenuAccess(bearerToken: string, id?: string, menuName?: string, background?: string, actionMsg?: string, options?: any): Promise<any>;
|
2248
2266
|
/** */
|
2249
|
-
listQuickMenuAccess(bearerToken: string, botId?: string, options?: any): Promise<ApiQuickMenuAccessList>;
|
2267
|
+
listQuickMenuAccess(bearerToken: string, botId?: string, channelId?: string, options?: any): Promise<ApiQuickMenuAccessList>;
|
2250
2268
|
/** */
|
2251
2269
|
addQuickMenuAccess(bearerToken: string, body: ApiQuickMenuAccessRequest, options?: any): Promise<any>;
|
2252
2270
|
/** */
|
2253
2271
|
updateQuickMenuAccess(bearerToken: string, body: ApiQuickMenuAccessRequest, options?: any): Promise<any>;
|
2254
2272
|
/** UnlockItem */
|
2255
2273
|
unlockItem(bearerToken: string, body: ApiUnlockItemRequest, options?: any): Promise<any>;
|
2274
|
+
/** UnlockItem */
|
2275
|
+
listForSaleItems(bearerToken: string, body: ApiListForSaleItemsRequest, options?: any): Promise<ApiForSaleItemList>;
|
2256
2276
|
}
|
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, 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";
|
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, ApiListForSaleItemsRequest, ApiForSaleItemList } from "./api.gen";
|
17
17
|
import { Session } from "./session";
|
18
18
|
import { Socket } from "./socket";
|
19
19
|
import { WebSocketAdapter } from "./web_socket_adapter";
|
@@ -625,9 +625,10 @@ export declare class Client {
|
|
625
625
|
updateClanOrder(session: Session, request: ApiUpdateClanOrderRequest): Promise<boolean>;
|
626
626
|
/** list clan discover. */
|
627
627
|
listClanDiscover(basePath: string, request: ApiClanDiscoverRequest): Promise<ApiListClanDiscover>;
|
628
|
-
listQuickMenuAccess(session: Session, botId: string): Promise<ApiQuickMenuAccessList>;
|
628
|
+
listQuickMenuAccess(session: Session, botId: string, channelId: string): Promise<ApiQuickMenuAccessList>;
|
629
629
|
deleteQuickMenuAccess(session: Session, id: string): Promise<any>;
|
630
630
|
addQuickMenuAccess(session: Session, request: ApiQuickMenuAccessRequest): Promise<any>;
|
631
631
|
updateQuickMenuAccess(session: Session, request: ApiQuickMenuAccessRequest): Promise<any>;
|
632
632
|
unlockItem(session: Session, request: ApiUnlockItemRequest): Promise<any>;
|
633
|
+
listForSaleItems(session: Session, request: ApiListForSaleItemsRequest): Promise<ApiForSaleItemList>;
|
633
634
|
}
|
package/dist/mezon-js.cjs.js
CHANGED
@@ -6689,10 +6689,11 @@ var MezonApi = class {
|
|
6689
6689
|
]);
|
6690
6690
|
}
|
6691
6691
|
/** */
|
6692
|
-
listQuickMenuAccess(bearerToken, botId, options = {}) {
|
6692
|
+
listQuickMenuAccess(bearerToken, botId, channelId, options = {}) {
|
6693
6693
|
const urlPath = "/v2/quickmenuaccess";
|
6694
6694
|
const queryParams = /* @__PURE__ */ new Map();
|
6695
6695
|
queryParams.set("bot_id", botId);
|
6696
|
+
queryParams.set("channel_id", channelId);
|
6696
6697
|
let bodyJson = "";
|
6697
6698
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
6698
6699
|
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
@@ -6801,6 +6802,35 @@ var MezonApi = class {
|
|
6801
6802
|
)
|
6802
6803
|
]);
|
6803
6804
|
}
|
6805
|
+
/** UnlockItem */
|
6806
|
+
listForSaleItems(bearerToken, body, options = {}) {
|
6807
|
+
if (body === null || body === void 0) {
|
6808
|
+
throw new Error("'body' is a required parameter but is null or undefined.");
|
6809
|
+
}
|
6810
|
+
const urlPath = "/v2/forsale";
|
6811
|
+
const queryParams = /* @__PURE__ */ new Map();
|
6812
|
+
let bodyJson = "";
|
6813
|
+
bodyJson = JSON.stringify(body || {});
|
6814
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
6815
|
+
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
6816
|
+
if (bearerToken) {
|
6817
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
6818
|
+
}
|
6819
|
+
return Promise.race([
|
6820
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
6821
|
+
if (response.status == 204) {
|
6822
|
+
return response;
|
6823
|
+
} else if (response.status >= 200 && response.status < 300) {
|
6824
|
+
return response.json();
|
6825
|
+
} else {
|
6826
|
+
throw response;
|
6827
|
+
}
|
6828
|
+
}),
|
6829
|
+
new Promise(
|
6830
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
6831
|
+
)
|
6832
|
+
]);
|
6833
|
+
}
|
6804
6834
|
};
|
6805
6835
|
|
6806
6836
|
// session.ts
|
@@ -10495,12 +10525,12 @@ var Client = class {
|
|
10495
10525
|
});
|
10496
10526
|
});
|
10497
10527
|
}
|
10498
|
-
listQuickMenuAccess(session, botId) {
|
10528
|
+
listQuickMenuAccess(session, botId, channelId) {
|
10499
10529
|
return __async(this, null, function* () {
|
10500
10530
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
|
10501
10531
|
yield this.sessionRefresh(session);
|
10502
10532
|
}
|
10503
|
-
return this.apiClient.listQuickMenuAccess(session.token, botId).then((response) => {
|
10533
|
+
return this.apiClient.listQuickMenuAccess(session.token, botId, channelId).then((response) => {
|
10504
10534
|
return Promise.resolve(response);
|
10505
10535
|
});
|
10506
10536
|
});
|
@@ -10545,4 +10575,14 @@ var Client = class {
|
|
10545
10575
|
});
|
10546
10576
|
});
|
10547
10577
|
}
|
10578
|
+
listForSaleItems(session, request) {
|
10579
|
+
return __async(this, null, function* () {
|
10580
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
|
10581
|
+
yield this.sessionRefresh(session);
|
10582
|
+
}
|
10583
|
+
return this.apiClient.listForSaleItems(session.token, request).then((response) => {
|
10584
|
+
return Promise.resolve(response);
|
10585
|
+
});
|
10586
|
+
});
|
10587
|
+
}
|
10548
10588
|
};
|
package/dist/mezon-js.esm.mjs
CHANGED
@@ -6655,10 +6655,11 @@ var MezonApi = class {
|
|
6655
6655
|
]);
|
6656
6656
|
}
|
6657
6657
|
/** */
|
6658
|
-
listQuickMenuAccess(bearerToken, botId, options = {}) {
|
6658
|
+
listQuickMenuAccess(bearerToken, botId, channelId, options = {}) {
|
6659
6659
|
const urlPath = "/v2/quickmenuaccess";
|
6660
6660
|
const queryParams = /* @__PURE__ */ new Map();
|
6661
6661
|
queryParams.set("bot_id", botId);
|
6662
|
+
queryParams.set("channel_id", channelId);
|
6662
6663
|
let bodyJson = "";
|
6663
6664
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
6664
6665
|
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
@@ -6767,6 +6768,35 @@ var MezonApi = class {
|
|
6767
6768
|
)
|
6768
6769
|
]);
|
6769
6770
|
}
|
6771
|
+
/** UnlockItem */
|
6772
|
+
listForSaleItems(bearerToken, body, options = {}) {
|
6773
|
+
if (body === null || body === void 0) {
|
6774
|
+
throw new Error("'body' is a required parameter but is null or undefined.");
|
6775
|
+
}
|
6776
|
+
const urlPath = "/v2/forsale";
|
6777
|
+
const queryParams = /* @__PURE__ */ new Map();
|
6778
|
+
let bodyJson = "";
|
6779
|
+
bodyJson = JSON.stringify(body || {});
|
6780
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
6781
|
+
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
6782
|
+
if (bearerToken) {
|
6783
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
6784
|
+
}
|
6785
|
+
return Promise.race([
|
6786
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
6787
|
+
if (response.status == 204) {
|
6788
|
+
return response;
|
6789
|
+
} else if (response.status >= 200 && response.status < 300) {
|
6790
|
+
return response.json();
|
6791
|
+
} else {
|
6792
|
+
throw response;
|
6793
|
+
}
|
6794
|
+
}),
|
6795
|
+
new Promise(
|
6796
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
6797
|
+
)
|
6798
|
+
]);
|
6799
|
+
}
|
6770
6800
|
};
|
6771
6801
|
|
6772
6802
|
// session.ts
|
@@ -10461,12 +10491,12 @@ var Client = class {
|
|
10461
10491
|
});
|
10462
10492
|
});
|
10463
10493
|
}
|
10464
|
-
listQuickMenuAccess(session, botId) {
|
10494
|
+
listQuickMenuAccess(session, botId, channelId) {
|
10465
10495
|
return __async(this, null, function* () {
|
10466
10496
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
|
10467
10497
|
yield this.sessionRefresh(session);
|
10468
10498
|
}
|
10469
|
-
return this.apiClient.listQuickMenuAccess(session.token, botId).then((response) => {
|
10499
|
+
return this.apiClient.listQuickMenuAccess(session.token, botId, channelId).then((response) => {
|
10470
10500
|
return Promise.resolve(response);
|
10471
10501
|
});
|
10472
10502
|
});
|
@@ -10511,6 +10541,16 @@ var Client = class {
|
|
10511
10541
|
});
|
10512
10542
|
});
|
10513
10543
|
}
|
10544
|
+
listForSaleItems(session, request) {
|
10545
|
+
return __async(this, null, function* () {
|
10546
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
|
10547
|
+
yield this.sessionRefresh(session);
|
10548
|
+
}
|
10549
|
+
return this.apiClient.listForSaleItems(session.token, request).then((response) => {
|
10550
|
+
return Promise.resolve(response);
|
10551
|
+
});
|
10552
|
+
});
|
10553
|
+
}
|
10514
10554
|
};
|
10515
10555
|
export {
|
10516
10556
|
ChannelStreamMode,
|