mezon-js 2.12.5 → 2.12.7
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 +74 -1
- package/client.ts +15 -1
- package/dist/api.gen.d.ts +22 -1
- package/dist/client.d.ts +4 -2
- package/dist/mezon-js.cjs.js +39 -4
- package/dist/mezon-js.esm.mjs +39 -4
- package/package.json +1 -1
package/api.gen.ts
CHANGED
@@ -3156,6 +3156,40 @@ export interface ApiUserEventRequest {
|
|
3156
3156
|
event_id?: string;
|
3157
3157
|
}
|
3158
3158
|
|
3159
|
+
/** */
|
3160
|
+
export interface ApiClanDiscover {
|
3161
|
+
//
|
3162
|
+
about?: string;
|
3163
|
+
//
|
3164
|
+
banner?: string;
|
3165
|
+
//
|
3166
|
+
clan_id?: string;
|
3167
|
+
//
|
3168
|
+
clan_logo?: string;
|
3169
|
+
//
|
3170
|
+
clan_name?: string;
|
3171
|
+
//
|
3172
|
+
description?: string;
|
3173
|
+
//
|
3174
|
+
invite_id?: string;
|
3175
|
+
//
|
3176
|
+
online_members?: number;
|
3177
|
+
//
|
3178
|
+
total_members?: number;
|
3179
|
+
//
|
3180
|
+
verified?: boolean;
|
3181
|
+
}
|
3182
|
+
|
3183
|
+
/** */
|
3184
|
+
export interface ApiListClanDiscover {
|
3185
|
+
//
|
3186
|
+
clan_discover?: Array<ApiClanDiscover>;
|
3187
|
+
//
|
3188
|
+
page?: number;
|
3189
|
+
//
|
3190
|
+
page_count?: number;
|
3191
|
+
}
|
3192
|
+
|
3159
3193
|
export class MezonApi {
|
3160
3194
|
basePath: string;
|
3161
3195
|
constructor(
|
@@ -3340,6 +3374,7 @@ export class MezonApi {
|
|
3340
3374
|
/** */
|
3341
3375
|
confirmLogin(
|
3342
3376
|
bearerToken: string,
|
3377
|
+
basePath: string,
|
3343
3378
|
body: ApiConfirmLoginRequest,
|
3344
3379
|
options: any = {}
|
3345
3380
|
): Promise<any> {
|
@@ -3354,7 +3389,7 @@ export class MezonApi {
|
|
3354
3389
|
let bodyJson: string = "";
|
3355
3390
|
bodyJson = JSON.stringify(body || {});
|
3356
3391
|
|
3357
|
-
const fullUrl = this.buildFullUrl(
|
3392
|
+
const fullUrl = this.buildFullUrl(basePath, urlPath, queryParams);
|
3358
3393
|
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
3359
3394
|
if (bearerToken) {
|
3360
3395
|
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
@@ -10742,4 +10777,42 @@ export class MezonApi {
|
|
10742
10777
|
),
|
10743
10778
|
]);
|
10744
10779
|
}
|
10780
|
+
|
10781
|
+
/** Discover mezon clan. */
|
10782
|
+
clanDiscover(basicAuthUsername: string,
|
10783
|
+
basicAuthPassword: string,
|
10784
|
+
basePath: string,
|
10785
|
+
page: number,
|
10786
|
+
options: any = {}): Promise<ApiListClanDiscover> {
|
10787
|
+
|
10788
|
+
if (page === null || page === undefined) {
|
10789
|
+
throw new Error("'page' is a required parameter but is null or undefined.");
|
10790
|
+
}
|
10791
|
+
const urlPath = "/v2/clan/discover";
|
10792
|
+
const queryParams = new Map<string, any>();
|
10793
|
+
|
10794
|
+
let bodyJson : string = "";
|
10795
|
+
bodyJson = JSON.stringify(page || {});
|
10796
|
+
|
10797
|
+
const fullUrl = this.buildFullUrl(basePath, urlPath, queryParams);
|
10798
|
+
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
10799
|
+
if (basicAuthUsername) {
|
10800
|
+
fetchOptions.headers["Authorization"] = "Basic " + encode(basicAuthUsername + ":" + basicAuthPassword);
|
10801
|
+
}
|
10802
|
+
|
10803
|
+
return Promise.race([
|
10804
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
10805
|
+
if (response.status == 204) {
|
10806
|
+
return response;
|
10807
|
+
} else if (response.status >= 200 && response.status < 300) {
|
10808
|
+
return response.json();
|
10809
|
+
} else {
|
10810
|
+
throw response;
|
10811
|
+
}
|
10812
|
+
}),
|
10813
|
+
new Promise((_, reject) =>
|
10814
|
+
setTimeout(reject, this.timeoutMs, "Request timed out.")
|
10815
|
+
),
|
10816
|
+
]);
|
10817
|
+
}
|
10745
10818
|
}
|
package/client.ts
CHANGED
@@ -163,6 +163,7 @@ import {
|
|
163
163
|
ApiGenerateMeetTokenExternalResponse,
|
164
164
|
ApiUpdateClanOrderRequest,
|
165
165
|
ApiMessage2InboxRequest,
|
166
|
+
ApiListClanDiscover,
|
166
167
|
} from "./api.gen";
|
167
168
|
|
168
169
|
import { Session } from "./session";
|
@@ -3953,6 +3954,7 @@ export class Client {
|
|
3953
3954
|
|
3954
3955
|
async confirmLogin(
|
3955
3956
|
session: Session,
|
3957
|
+
basePath: string,
|
3956
3958
|
body: ApiConfirmLoginRequest
|
3957
3959
|
): Promise<any> {
|
3958
3960
|
if (
|
@@ -3964,7 +3966,7 @@ export class Client {
|
|
3964
3966
|
}
|
3965
3967
|
|
3966
3968
|
return this.apiClient
|
3967
|
-
.confirmLogin(session.token, body)
|
3969
|
+
.confirmLogin(session.token, basePath, body)
|
3968
3970
|
.then((response: any) => {
|
3969
3971
|
return response;
|
3970
3972
|
});
|
@@ -4735,4 +4737,16 @@ export class Client {
|
|
4735
4737
|
return response !== undefined;
|
4736
4738
|
});
|
4737
4739
|
}
|
4740
|
+
|
4741
|
+
/** list clan discover. */
|
4742
|
+
listClanDiscover(
|
4743
|
+
basePath: string,
|
4744
|
+
page: number
|
4745
|
+
): Promise<ApiListClanDiscover> {
|
4746
|
+
return this.apiClient
|
4747
|
+
.clanDiscover(this.serverkey, "", basePath, page)
|
4748
|
+
.then((response: ApiListClanDiscover) => {
|
4749
|
+
return Promise.resolve(response);
|
4750
|
+
});
|
4751
|
+
}
|
4738
4752
|
}
|
package/dist/api.gen.d.ts
CHANGED
@@ -1807,6 +1807,25 @@ export interface ApiUserEventRequest {
|
|
1807
1807
|
clan_id?: string;
|
1808
1808
|
event_id?: string;
|
1809
1809
|
}
|
1810
|
+
/** */
|
1811
|
+
export interface ApiClanDiscover {
|
1812
|
+
about?: string;
|
1813
|
+
banner?: string;
|
1814
|
+
clan_id?: string;
|
1815
|
+
clan_logo?: string;
|
1816
|
+
clan_name?: string;
|
1817
|
+
description?: string;
|
1818
|
+
invite_id?: string;
|
1819
|
+
online_members?: number;
|
1820
|
+
total_members?: number;
|
1821
|
+
verified?: boolean;
|
1822
|
+
}
|
1823
|
+
/** */
|
1824
|
+
export interface ApiListClanDiscover {
|
1825
|
+
clan_discover?: Array<ApiClanDiscover>;
|
1826
|
+
page?: number;
|
1827
|
+
page_count?: number;
|
1828
|
+
}
|
1810
1829
|
export declare class MezonApi {
|
1811
1830
|
readonly serverKey: string;
|
1812
1831
|
readonly timeoutMs: number;
|
@@ -1824,7 +1843,7 @@ export declare class MezonApi {
|
|
1824
1843
|
/** */
|
1825
1844
|
checkLoginRequest(basicAuthUsername: string, basicAuthPassword: string, body: ApiConfirmLoginRequest, options?: any): Promise<ApiSession>;
|
1826
1845
|
/** */
|
1827
|
-
confirmLogin(bearerToken: string, body: ApiConfirmLoginRequest, options?: any): Promise<any>;
|
1846
|
+
confirmLogin(bearerToken: string, basePath: string, body: ApiConfirmLoginRequest, options?: any): Promise<any>;
|
1828
1847
|
/** */
|
1829
1848
|
createQRLogin(basicAuthUsername: string, basicAuthPassword: string, body: ApiLoginRequest, options?: any): Promise<ApiLoginIDResponse>;
|
1830
1849
|
/** Authenticate a user with an email+password against the server. */
|
@@ -2194,4 +2213,6 @@ export declare class MezonApi {
|
|
2194
2213
|
listChannelDetail(bearerToken: string, channelId: string, options?: any): Promise<ApiChannelDescription>;
|
2195
2214
|
/** */
|
2196
2215
|
updateClanOrder(bearerToken: string, body: ApiUpdateClanOrderRequest, options?: any): Promise<any>;
|
2216
|
+
/** Discover mezon clan. */
|
2217
|
+
clanDiscover(basicAuthUsername: string, basicAuthPassword: string, basePath: string, page: number, options?: any): Promise<ApiListClanDiscover>;
|
2197
2218
|
}
|
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 } 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, 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 } from "./api.gen";
|
17
17
|
import { Session } from "./session";
|
18
18
|
import { Socket } from "./socket";
|
19
19
|
import { WebSocketAdapter } from "./web_socket_adapter";
|
@@ -576,7 +576,7 @@ export declare class Client {
|
|
576
576
|
createActiviy(session: Session, request: ApiCreateActivityRequest): Promise<ApiUserActivity>;
|
577
577
|
createQRLogin(requet: ApiLoginRequest): Promise<ApiLoginIDResponse>;
|
578
578
|
checkLoginRequest(requet: ApiConfirmLoginRequest): Promise<Session | null>;
|
579
|
-
confirmLogin(session: Session, body: ApiConfirmLoginRequest): Promise<any>;
|
579
|
+
confirmLogin(session: Session, basePath: string, body: ApiConfirmLoginRequest): Promise<any>;
|
580
580
|
getChanEncryptionMethod(session: Session, channelId: string): Promise<ApiChanEncryptionMethod>;
|
581
581
|
setChanEncryptionMethod(session: Session, channelId: string, method: string): Promise<any>;
|
582
582
|
getPubKeys(session: Session, userIds: Array<string>): Promise<ApiGetPubKeysResponse>;
|
@@ -621,4 +621,6 @@ export declare class Client {
|
|
621
621
|
generateMeetTokenExternal(token: string, displayName?: string, isGuest?: boolean): Promise<ApiGenerateMeetTokenExternalResponse>;
|
622
622
|
/** Update clan order to view. */
|
623
623
|
updateClanOrder(session: Session, request: ApiUpdateClanOrderRequest): Promise<boolean>;
|
624
|
+
/** list clan discover. */
|
625
|
+
listClanDiscover(basePath: string, page: number): Promise<ApiListClanDiscover>;
|
624
626
|
}
|
package/dist/mezon-js.cjs.js
CHANGED
@@ -874,7 +874,7 @@ var MezonApi = class {
|
|
874
874
|
]);
|
875
875
|
}
|
876
876
|
/** */
|
877
|
-
confirmLogin(bearerToken, body, options = {}) {
|
877
|
+
confirmLogin(bearerToken, basePath, body, options = {}) {
|
878
878
|
if (body === null || body === void 0) {
|
879
879
|
throw new Error(
|
880
880
|
"'body' is a required parameter but is null or undefined."
|
@@ -884,7 +884,7 @@ var MezonApi = class {
|
|
884
884
|
const queryParams = /* @__PURE__ */ new Map();
|
885
885
|
let bodyJson = "";
|
886
886
|
bodyJson = JSON.stringify(body || {});
|
887
|
-
const fullUrl = this.buildFullUrl(
|
887
|
+
const fullUrl = this.buildFullUrl(basePath, urlPath, queryParams);
|
888
888
|
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
889
889
|
if (bearerToken) {
|
890
890
|
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
@@ -6660,6 +6660,35 @@ var MezonApi = class {
|
|
6660
6660
|
)
|
6661
6661
|
]);
|
6662
6662
|
}
|
6663
|
+
/** Discover mezon clan. */
|
6664
|
+
clanDiscover(basicAuthUsername, basicAuthPassword, basePath, page, options = {}) {
|
6665
|
+
if (page === null || page === void 0) {
|
6666
|
+
throw new Error("'page' is a required parameter but is null or undefined.");
|
6667
|
+
}
|
6668
|
+
const urlPath = "/v2/clan/discover";
|
6669
|
+
const queryParams = /* @__PURE__ */ new Map();
|
6670
|
+
let bodyJson = "";
|
6671
|
+
bodyJson = JSON.stringify(page || {});
|
6672
|
+
const fullUrl = this.buildFullUrl(basePath, urlPath, queryParams);
|
6673
|
+
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
6674
|
+
if (basicAuthUsername) {
|
6675
|
+
fetchOptions.headers["Authorization"] = "Basic " + encode(basicAuthUsername + ":" + basicAuthPassword);
|
6676
|
+
}
|
6677
|
+
return Promise.race([
|
6678
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
6679
|
+
if (response.status == 204) {
|
6680
|
+
return response;
|
6681
|
+
} else if (response.status >= 200 && response.status < 300) {
|
6682
|
+
return response.json();
|
6683
|
+
} else {
|
6684
|
+
throw response;
|
6685
|
+
}
|
6686
|
+
}),
|
6687
|
+
new Promise(
|
6688
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
6689
|
+
)
|
6690
|
+
]);
|
6691
|
+
}
|
6663
6692
|
};
|
6664
6693
|
|
6665
6694
|
// session.ts
|
@@ -9881,12 +9910,12 @@ var Client = class {
|
|
9881
9910
|
);
|
9882
9911
|
});
|
9883
9912
|
}
|
9884
|
-
confirmLogin(session, body) {
|
9913
|
+
confirmLogin(session, basePath, body) {
|
9885
9914
|
return __async(this, null, function* () {
|
9886
9915
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
|
9887
9916
|
yield this.sessionRefresh(session);
|
9888
9917
|
}
|
9889
|
-
return this.apiClient.confirmLogin(session.token, body).then((response) => {
|
9918
|
+
return this.apiClient.confirmLogin(session.token, basePath, body).then((response) => {
|
9890
9919
|
return response;
|
9891
9920
|
});
|
9892
9921
|
});
|
@@ -10302,4 +10331,10 @@ var Client = class {
|
|
10302
10331
|
});
|
10303
10332
|
});
|
10304
10333
|
}
|
10334
|
+
/** list clan discover. */
|
10335
|
+
listClanDiscover(basePath, page) {
|
10336
|
+
return this.apiClient.clanDiscover(this.serverkey, "", basePath, page).then((response) => {
|
10337
|
+
return Promise.resolve(response);
|
10338
|
+
});
|
10339
|
+
}
|
10305
10340
|
};
|
package/dist/mezon-js.esm.mjs
CHANGED
@@ -840,7 +840,7 @@ var MezonApi = class {
|
|
840
840
|
]);
|
841
841
|
}
|
842
842
|
/** */
|
843
|
-
confirmLogin(bearerToken, body, options = {}) {
|
843
|
+
confirmLogin(bearerToken, basePath, body, options = {}) {
|
844
844
|
if (body === null || body === void 0) {
|
845
845
|
throw new Error(
|
846
846
|
"'body' is a required parameter but is null or undefined."
|
@@ -850,7 +850,7 @@ var MezonApi = class {
|
|
850
850
|
const queryParams = /* @__PURE__ */ new Map();
|
851
851
|
let bodyJson = "";
|
852
852
|
bodyJson = JSON.stringify(body || {});
|
853
|
-
const fullUrl = this.buildFullUrl(
|
853
|
+
const fullUrl = this.buildFullUrl(basePath, urlPath, queryParams);
|
854
854
|
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
855
855
|
if (bearerToken) {
|
856
856
|
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
@@ -6626,6 +6626,35 @@ var MezonApi = class {
|
|
6626
6626
|
)
|
6627
6627
|
]);
|
6628
6628
|
}
|
6629
|
+
/** Discover mezon clan. */
|
6630
|
+
clanDiscover(basicAuthUsername, basicAuthPassword, basePath, page, options = {}) {
|
6631
|
+
if (page === null || page === void 0) {
|
6632
|
+
throw new Error("'page' is a required parameter but is null or undefined.");
|
6633
|
+
}
|
6634
|
+
const urlPath = "/v2/clan/discover";
|
6635
|
+
const queryParams = /* @__PURE__ */ new Map();
|
6636
|
+
let bodyJson = "";
|
6637
|
+
bodyJson = JSON.stringify(page || {});
|
6638
|
+
const fullUrl = this.buildFullUrl(basePath, urlPath, queryParams);
|
6639
|
+
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
6640
|
+
if (basicAuthUsername) {
|
6641
|
+
fetchOptions.headers["Authorization"] = "Basic " + encode(basicAuthUsername + ":" + basicAuthPassword);
|
6642
|
+
}
|
6643
|
+
return Promise.race([
|
6644
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
6645
|
+
if (response.status == 204) {
|
6646
|
+
return response;
|
6647
|
+
} else if (response.status >= 200 && response.status < 300) {
|
6648
|
+
return response.json();
|
6649
|
+
} else {
|
6650
|
+
throw response;
|
6651
|
+
}
|
6652
|
+
}),
|
6653
|
+
new Promise(
|
6654
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
6655
|
+
)
|
6656
|
+
]);
|
6657
|
+
}
|
6629
6658
|
};
|
6630
6659
|
|
6631
6660
|
// session.ts
|
@@ -9847,12 +9876,12 @@ var Client = class {
|
|
9847
9876
|
);
|
9848
9877
|
});
|
9849
9878
|
}
|
9850
|
-
confirmLogin(session, body) {
|
9879
|
+
confirmLogin(session, basePath, body) {
|
9851
9880
|
return __async(this, null, function* () {
|
9852
9881
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
|
9853
9882
|
yield this.sessionRefresh(session);
|
9854
9883
|
}
|
9855
|
-
return this.apiClient.confirmLogin(session.token, body).then((response) => {
|
9884
|
+
return this.apiClient.confirmLogin(session.token, basePath, body).then((response) => {
|
9856
9885
|
return response;
|
9857
9886
|
});
|
9858
9887
|
});
|
@@ -10268,6 +10297,12 @@ var Client = class {
|
|
10268
10297
|
});
|
10269
10298
|
});
|
10270
10299
|
}
|
10300
|
+
/** list clan discover. */
|
10301
|
+
listClanDiscover(basePath, page) {
|
10302
|
+
return this.apiClient.clanDiscover(this.serverkey, "", basePath, page).then((response) => {
|
10303
|
+
return Promise.resolve(response);
|
10304
|
+
});
|
10305
|
+
}
|
10271
10306
|
};
|
10272
10307
|
export {
|
10273
10308
|
ChannelStreamMode,
|