mezon-js 2.12.57 → 2.12.59
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 +50 -0
- package/client.ts +19 -0
- package/dist/api.gen.d.ts +11 -0
- package/dist/client.d.ts +2 -1
- package/dist/mezon-js.cjs.js +39 -0
- package/dist/mezon-js.esm.mjs +39 -0
- package/package.json +1 -1
package/api.gen.ts
CHANGED
@@ -3303,6 +3303,20 @@ export interface ApiClanDiscoverRequest {
|
|
3303
3303
|
page_number?: number;
|
3304
3304
|
}
|
3305
3305
|
|
3306
|
+
/** */
|
3307
|
+
export interface ApiIsFollowerRequest {
|
3308
|
+
//
|
3309
|
+
username?: string;
|
3310
|
+
}
|
3311
|
+
|
3312
|
+
/** */
|
3313
|
+
export interface ApiIsFollowerResponse {
|
3314
|
+
//
|
3315
|
+
is_follower?: boolean;
|
3316
|
+
//
|
3317
|
+
username?: string;
|
3318
|
+
}
|
3319
|
+
|
3306
3320
|
export class MezonApi {
|
3307
3321
|
basePath: string;
|
3308
3322
|
constructor(
|
@@ -11118,4 +11132,40 @@ export class MezonApi {
|
|
11118
11132
|
]);
|
11119
11133
|
}
|
11120
11134
|
|
11135
|
+
/** */
|
11136
|
+
isFollower(bearerToken: string,
|
11137
|
+
body:ApiIsFollowerRequest,
|
11138
|
+
options: any = {}): Promise<ApiIsFollowerResponse> {
|
11139
|
+
|
11140
|
+
if (body === null || body === undefined) {
|
11141
|
+
throw new Error("'body' is a required parameter but is null or undefined.");
|
11142
|
+
}
|
11143
|
+
const urlPath = "/v2/follower";
|
11144
|
+
const queryParams = new Map<string, any>();
|
11145
|
+
|
11146
|
+
let bodyJson : string = "";
|
11147
|
+
bodyJson = JSON.stringify(body || {});
|
11148
|
+
|
11149
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
11150
|
+
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
11151
|
+
if (bearerToken) {
|
11152
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
11153
|
+
}
|
11154
|
+
|
11155
|
+
return Promise.race([
|
11156
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
11157
|
+
if (response.status == 204) {
|
11158
|
+
return response;
|
11159
|
+
} else if (response.status >= 200 && response.status < 300) {
|
11160
|
+
return response.json();
|
11161
|
+
} else {
|
11162
|
+
throw response;
|
11163
|
+
}
|
11164
|
+
}),
|
11165
|
+
new Promise((_, reject) =>
|
11166
|
+
setTimeout(reject, this.timeoutMs, "Request timed out.")
|
11167
|
+
),
|
11168
|
+
]);
|
11169
|
+
}
|
11170
|
+
|
11121
11171
|
}
|
package/client.ts
CHANGED
@@ -169,6 +169,8 @@ import {
|
|
169
169
|
ApiUnlockedItemRequest,
|
170
170
|
ApiForSaleItemList,
|
171
171
|
ApiUnlockedItemResponse,
|
172
|
+
ApiIsFollowerResponse,
|
173
|
+
ApiIsFollowerRequest,
|
172
174
|
} from "./api.gen";
|
173
175
|
|
174
176
|
import { Session } from "./session";
|
@@ -4851,4 +4853,21 @@ export class Client {
|
|
4851
4853
|
});
|
4852
4854
|
}
|
4853
4855
|
|
4856
|
+
async isFollower(session: Session,
|
4857
|
+
req: ApiIsFollowerRequest): Promise<ApiIsFollowerResponse> {
|
4858
|
+
if (
|
4859
|
+
this.autoRefreshSession &&
|
4860
|
+
session.refresh_token &&
|
4861
|
+
session.isexpired(Date.now() / 1000)
|
4862
|
+
) {
|
4863
|
+
await this.sessionRefresh(session);
|
4864
|
+
}
|
4865
|
+
|
4866
|
+
return this.apiClient
|
4867
|
+
.isFollower(session.token, req)
|
4868
|
+
.then((response: ApiIsFollowerResponse) => {
|
4869
|
+
return Promise.resolve(response);
|
4870
|
+
});
|
4871
|
+
}
|
4872
|
+
|
4854
4873
|
}
|
package/dist/api.gen.d.ts
CHANGED
@@ -1891,6 +1891,15 @@ export interface ApiClanDiscoverRequest {
|
|
1891
1891
|
item_per_page?: number;
|
1892
1892
|
page_number?: number;
|
1893
1893
|
}
|
1894
|
+
/** */
|
1895
|
+
export interface ApiIsFollowerRequest {
|
1896
|
+
username?: string;
|
1897
|
+
}
|
1898
|
+
/** */
|
1899
|
+
export interface ApiIsFollowerResponse {
|
1900
|
+
is_follower?: boolean;
|
1901
|
+
username?: string;
|
1902
|
+
}
|
1894
1903
|
export declare class MezonApi {
|
1895
1904
|
readonly serverKey: string;
|
1896
1905
|
readonly timeoutMs: number;
|
@@ -2290,4 +2299,6 @@ export declare class MezonApi {
|
|
2290
2299
|
unlockItem(bearerToken: string, body: ApiUnlockedItemRequest, options?: any): Promise<ApiUnlockedItemResponse>;
|
2291
2300
|
/** For sale items */
|
2292
2301
|
listForSaleItems(bearerToken: string, page?: number, options?: any): Promise<ApiForSaleItemList>;
|
2302
|
+
/** */
|
2303
|
+
isFollower(bearerToken: string, body: ApiIsFollowerRequest, options?: any): Promise<ApiIsFollowerResponse>;
|
2293
2304
|
}
|
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, ApiEmojiRecentList, ApiUserEventRequest, ApiUpdateRoleOrderRequest, ApiGenerateMezonMeetResponse, ApiGenerateMeetTokenExternalResponse, ApiUpdateClanOrderRequest, ApiMessage2InboxRequest, ApiListClanDiscover, ApiClanDiscoverRequest, ApiQuickMenuAccessList, ApiQuickMenuAccessRequest, ApiUnlockedItemRequest, ApiForSaleItemList, ApiUnlockedItemResponse } 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, ApiEmojiRecentList, ApiUserEventRequest, ApiUpdateRoleOrderRequest, ApiGenerateMezonMeetResponse, ApiGenerateMeetTokenExternalResponse, ApiUpdateClanOrderRequest, ApiMessage2InboxRequest, ApiListClanDiscover, ApiClanDiscoverRequest, ApiQuickMenuAccessList, ApiQuickMenuAccessRequest, ApiUnlockedItemRequest, ApiForSaleItemList, ApiUnlockedItemResponse, ApiIsFollowerResponse, ApiIsFollowerRequest } from "./api.gen";
|
17
17
|
import { Session } from "./session";
|
18
18
|
import { Socket } from "./socket";
|
19
19
|
import { WebSocketAdapter } from "./web_socket_adapter";
|
@@ -619,4 +619,5 @@ export declare class Client {
|
|
619
619
|
updateQuickMenuAccess(session: Session, request: ApiQuickMenuAccessRequest): Promise<any>;
|
620
620
|
unlockItem(session: Session, request: ApiUnlockedItemRequest): Promise<ApiUnlockedItemResponse>;
|
621
621
|
listForSaleItems(session: Session, page?: number): Promise<ApiForSaleItemList>;
|
622
|
+
isFollower(session: Session, req: ApiIsFollowerRequest): Promise<ApiIsFollowerResponse>;
|
622
623
|
}
|
package/dist/mezon-js.cjs.js
CHANGED
@@ -6832,6 +6832,35 @@ var MezonApi = class {
|
|
6832
6832
|
)
|
6833
6833
|
]);
|
6834
6834
|
}
|
6835
|
+
/** */
|
6836
|
+
isFollower(bearerToken, body, options = {}) {
|
6837
|
+
if (body === null || body === void 0) {
|
6838
|
+
throw new Error("'body' is a required parameter but is null or undefined.");
|
6839
|
+
}
|
6840
|
+
const urlPath = "/v2/follower";
|
6841
|
+
const queryParams = /* @__PURE__ */ new Map();
|
6842
|
+
let bodyJson = "";
|
6843
|
+
bodyJson = JSON.stringify(body || {});
|
6844
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
6845
|
+
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
6846
|
+
if (bearerToken) {
|
6847
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
6848
|
+
}
|
6849
|
+
return Promise.race([
|
6850
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
6851
|
+
if (response.status == 204) {
|
6852
|
+
return response;
|
6853
|
+
} else if (response.status >= 200 && response.status < 300) {
|
6854
|
+
return response.json();
|
6855
|
+
} else {
|
6856
|
+
throw response;
|
6857
|
+
}
|
6858
|
+
}),
|
6859
|
+
new Promise(
|
6860
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
6861
|
+
)
|
6862
|
+
]);
|
6863
|
+
}
|
6835
6864
|
};
|
6836
6865
|
|
6837
6866
|
// session.ts
|
@@ -10641,4 +10670,14 @@ var Client = class {
|
|
10641
10670
|
});
|
10642
10671
|
});
|
10643
10672
|
}
|
10673
|
+
isFollower(session, req) {
|
10674
|
+
return __async(this, null, function* () {
|
10675
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
|
10676
|
+
yield this.sessionRefresh(session);
|
10677
|
+
}
|
10678
|
+
return this.apiClient.isFollower(session.token, req).then((response) => {
|
10679
|
+
return Promise.resolve(response);
|
10680
|
+
});
|
10681
|
+
});
|
10682
|
+
}
|
10644
10683
|
};
|
package/dist/mezon-js.esm.mjs
CHANGED
@@ -6798,6 +6798,35 @@ var MezonApi = class {
|
|
6798
6798
|
)
|
6799
6799
|
]);
|
6800
6800
|
}
|
6801
|
+
/** */
|
6802
|
+
isFollower(bearerToken, body, options = {}) {
|
6803
|
+
if (body === null || body === void 0) {
|
6804
|
+
throw new Error("'body' is a required parameter but is null or undefined.");
|
6805
|
+
}
|
6806
|
+
const urlPath = "/v2/follower";
|
6807
|
+
const queryParams = /* @__PURE__ */ new Map();
|
6808
|
+
let bodyJson = "";
|
6809
|
+
bodyJson = JSON.stringify(body || {});
|
6810
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
6811
|
+
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
6812
|
+
if (bearerToken) {
|
6813
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
6814
|
+
}
|
6815
|
+
return Promise.race([
|
6816
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
6817
|
+
if (response.status == 204) {
|
6818
|
+
return response;
|
6819
|
+
} else if (response.status >= 200 && response.status < 300) {
|
6820
|
+
return response.json();
|
6821
|
+
} else {
|
6822
|
+
throw response;
|
6823
|
+
}
|
6824
|
+
}),
|
6825
|
+
new Promise(
|
6826
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
6827
|
+
)
|
6828
|
+
]);
|
6829
|
+
}
|
6801
6830
|
};
|
6802
6831
|
|
6803
6832
|
// session.ts
|
@@ -10607,6 +10636,16 @@ var Client = class {
|
|
10607
10636
|
});
|
10608
10637
|
});
|
10609
10638
|
}
|
10639
|
+
isFollower(session, req) {
|
10640
|
+
return __async(this, null, function* () {
|
10641
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
|
10642
|
+
yield this.sessionRefresh(session);
|
10643
|
+
}
|
10644
|
+
return this.apiClient.isFollower(session.token, req).then((response) => {
|
10645
|
+
return Promise.resolve(response);
|
10646
|
+
});
|
10647
|
+
});
|
10648
|
+
}
|
10610
10649
|
};
|
10611
10650
|
export {
|
10612
10651
|
ChannelStreamMode,
|