mezon-js 2.13.31 → 2.13.32
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 +44 -40
- package/client.ts +9 -5
- package/dist/api.gen.d.ts +2 -2
- package/dist/client.d.ts +2 -2
- package/dist/mezon-js.cjs.js +7 -3
- package/dist/mezon-js.esm.mjs +7 -3
- package/package.json +1 -1
package/api.gen.ts
CHANGED
|
@@ -43,7 +43,7 @@ export interface ApiBannedUser {
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
/** */
|
|
46
|
-
export interface
|
|
46
|
+
export interface ApiBannedUserList {
|
|
47
47
|
//
|
|
48
48
|
banned_users?: Array<ApiBannedUser>;
|
|
49
49
|
}
|
|
@@ -5787,10 +5787,14 @@ export class MezonApi {
|
|
|
5787
5787
|
|
|
5788
5788
|
/** List banned user */
|
|
5789
5789
|
listBannedUsers(bearerToken: string,
|
|
5790
|
-
|
|
5790
|
+
clanId?:string,
|
|
5791
|
+
channelId?:string,
|
|
5792
|
+
options: any = {}): Promise<ApiBannedUserList> {
|
|
5791
5793
|
|
|
5792
5794
|
const urlPath = "/v2/banned";
|
|
5793
5795
|
const queryParams = new Map<string, any>();
|
|
5796
|
+
queryParams.set("clan_id", clanId);
|
|
5797
|
+
queryParams.set("channel_id", channelId);
|
|
5794
5798
|
|
|
5795
5799
|
let bodyJson : string = "";
|
|
5796
5800
|
|
|
@@ -11376,44 +11380,44 @@ export class MezonApi {
|
|
|
11376
11380
|
}
|
|
11377
11381
|
|
|
11378
11382
|
/** */
|
|
11379
|
-
|
|
11380
|
-
|
|
11381
|
-
|
|
11382
|
-
|
|
11383
|
-
|
|
11384
|
-
|
|
11385
|
-
|
|
11386
|
-
|
|
11387
|
-
|
|
11388
|
-
|
|
11389
|
-
|
|
11390
|
-
|
|
11391
|
-
|
|
11392
|
-
|
|
11393
|
-
|
|
11394
|
-
|
|
11395
|
-
|
|
11396
|
-
|
|
11397
|
-
|
|
11398
|
-
|
|
11399
|
-
|
|
11400
|
-
|
|
11401
|
-
|
|
11402
|
-
|
|
11403
|
-
|
|
11404
|
-
|
|
11405
|
-
|
|
11406
|
-
|
|
11407
|
-
|
|
11408
|
-
|
|
11409
|
-
|
|
11410
|
-
|
|
11411
|
-
|
|
11412
|
-
|
|
11413
|
-
|
|
11414
|
-
|
|
11415
|
-
|
|
11416
|
-
|
|
11383
|
+
deleteQuickMenuAccess(bearerToken: string,
|
|
11384
|
+
id?:string,
|
|
11385
|
+
botId?:string,
|
|
11386
|
+
menuName?:string,
|
|
11387
|
+
background?:string,
|
|
11388
|
+
actionMsg?:string,
|
|
11389
|
+
options: any = {}): Promise<any> {
|
|
11390
|
+
|
|
11391
|
+
const urlPath = "/v2/quickmenuaccess";
|
|
11392
|
+
const queryParams = new Map<string, any>();
|
|
11393
|
+
queryParams.set("id", id);
|
|
11394
|
+
queryParams.set("bot_id", botId);
|
|
11395
|
+
queryParams.set("menu_name", menuName);
|
|
11396
|
+
queryParams.set("background", background);
|
|
11397
|
+
queryParams.set("action_msg", actionMsg);
|
|
11398
|
+
|
|
11399
|
+
let bodyJson : string = "";
|
|
11400
|
+
|
|
11401
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
11402
|
+
const fetchOptions = buildFetchOptions("DELETE", options, bodyJson);
|
|
11403
|
+
if (bearerToken) {
|
|
11404
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
|
11405
|
+
}
|
|
11406
|
+
|
|
11407
|
+
return Promise.race([
|
|
11408
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
|
11409
|
+
if (response.status == 204) {
|
|
11410
|
+
return response;
|
|
11411
|
+
} else if (response.status >= 200 && response.status < 300) {
|
|
11412
|
+
return response.json();
|
|
11413
|
+
} else {
|
|
11414
|
+
throw response;
|
|
11415
|
+
}
|
|
11416
|
+
}),
|
|
11417
|
+
new Promise((_, reject) =>
|
|
11418
|
+
setTimeout(reject, this.timeoutMs, "Request timed out.")
|
|
11419
|
+
),
|
|
11420
|
+
]);
|
|
11417
11421
|
}
|
|
11418
11422
|
|
|
11419
11423
|
/** */
|
package/client.ts
CHANGED
|
@@ -179,7 +179,7 @@ import {
|
|
|
179
179
|
ApiListClanUnreadMsgIndicatorResponse,
|
|
180
180
|
ApiAddFriendsResponse,
|
|
181
181
|
ApiUpdateUsernameRequest,
|
|
182
|
-
|
|
182
|
+
ApiBannedUserList,
|
|
183
183
|
} from "./api.gen";
|
|
184
184
|
|
|
185
185
|
import { Session } from "./session";
|
|
@@ -1130,8 +1130,10 @@ export class Client {
|
|
|
1130
1130
|
}
|
|
1131
1131
|
|
|
1132
1132
|
async listBannedUsers(
|
|
1133
|
-
session: Session
|
|
1134
|
-
|
|
1133
|
+
session: Session,
|
|
1134
|
+
clanId?:string,
|
|
1135
|
+
channelId?:string,
|
|
1136
|
+
): Promise<ApiBannedUserList> {
|
|
1135
1137
|
if (
|
|
1136
1138
|
this.autoRefreshSession &&
|
|
1137
1139
|
session.refresh_token &&
|
|
@@ -1142,9 +1144,11 @@ export class Client {
|
|
|
1142
1144
|
|
|
1143
1145
|
return this.apiClient
|
|
1144
1146
|
.listBannedUsers(
|
|
1145
|
-
session.token
|
|
1147
|
+
session.token,
|
|
1148
|
+
clanId,
|
|
1149
|
+
channelId,
|
|
1146
1150
|
)
|
|
1147
|
-
.then((response:
|
|
1151
|
+
.then((response: ApiBannedUserList) => {
|
|
1148
1152
|
return Promise.resolve(response);
|
|
1149
1153
|
});
|
|
1150
1154
|
}
|
package/dist/api.gen.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export interface ApiBannedUser {
|
|
|
20
20
|
reason?: string;
|
|
21
21
|
}
|
|
22
22
|
/** */
|
|
23
|
-
export interface
|
|
23
|
+
export interface ApiBannedUserList {
|
|
24
24
|
banned_users?: Array<ApiBannedUser>;
|
|
25
25
|
}
|
|
26
26
|
/** A single user-role pair. */
|
|
@@ -2096,7 +2096,7 @@ export declare class MezonApi {
|
|
|
2096
2096
|
/** Kick a set of users from a clan. */
|
|
2097
2097
|
removeClanUsers(bearerToken: string, clanId: string, userIds?: Array<string>, options?: any): Promise<any>;
|
|
2098
2098
|
/** List banned user */
|
|
2099
|
-
listBannedUsers(bearerToken: string, options?: any): Promise<
|
|
2099
|
+
listBannedUsers(bearerToken: string, clanId?: string, channelId?: string, options?: any): Promise<ApiBannedUserList>;
|
|
2100
2100
|
/** Ban a set of users from a channel. */
|
|
2101
2101
|
unbanClanUsers(bearerToken: string, clanId: string, channelId?: string, userIds?: Array<string>, banTime?: number, options?: any): Promise<any>;
|
|
2102
2102
|
/** Ban a set of users from a channel. */
|
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, ApiClanProfile, ApiChannelUserList, ApiClanUserList, ApiLinkInviteUserRequest, ApiLinkInviteUser, ApiInviteUserRes, ApiUploadAttachmentRequest, ApiUploadAttachment, ApiMessageReaction, ApiMessageMention, ApiMessageAttachment, ApiMessageRef, ApiChannelMessageHeader, ApiVoiceChannelUserList, ApiChannelAttachmentList, ApiCreateEventRequest, ApiEventManagement, ApiEventList, ApiDeleteEventRequest, ApiSetDefaultNotificationRequest, ApiSetNotificationRequest, ApiSetMuteRequest, 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, ApiTransferOwnershipRequest, ApiMeetParticipantRequest, ApiStoreWalletKeyRequest, ApiLinkAccountConfirmRequest, ApiLinkAccountMezon, ApiUser, ApiFriend, ApiListClanUnreadMsgIndicatorResponse, ApiAddFriendsResponse, ApiUpdateUsernameRequest,
|
|
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, ApiClanProfile, ApiChannelUserList, ApiClanUserList, ApiLinkInviteUserRequest, ApiLinkInviteUser, ApiInviteUserRes, ApiUploadAttachmentRequest, ApiUploadAttachment, ApiMessageReaction, ApiMessageMention, ApiMessageAttachment, ApiMessageRef, ApiChannelMessageHeader, ApiVoiceChannelUserList, ApiChannelAttachmentList, ApiCreateEventRequest, ApiEventManagement, ApiEventList, ApiDeleteEventRequest, ApiSetDefaultNotificationRequest, ApiSetNotificationRequest, ApiSetMuteRequest, 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, ApiTransferOwnershipRequest, ApiMeetParticipantRequest, ApiStoreWalletKeyRequest, ApiLinkAccountConfirmRequest, ApiLinkAccountMezon, ApiUser, ApiFriend, ApiListClanUnreadMsgIndicatorResponse, ApiAddFriendsResponse, ApiUpdateUsernameRequest, ApiBannedUserList } from "./api.gen";
|
|
17
17
|
import { Session } from "./session";
|
|
18
18
|
import { Socket } from "./socket";
|
|
19
19
|
import { WebSocketAdapter } from "./web_socket_adapter";
|
|
@@ -300,7 +300,7 @@ export declare class Client {
|
|
|
300
300
|
getAccount(session: Session): Promise<ApiAccount>;
|
|
301
301
|
/** Kick a set of users from a clan. */
|
|
302
302
|
removeClanUsers(session: Session, clanId: string, ids?: Array<string>): Promise<boolean>;
|
|
303
|
-
listBannedUsers(session: Session): Promise<
|
|
303
|
+
listBannedUsers(session: Session, clanId?: string, channelId?: string): Promise<ApiBannedUserList>;
|
|
304
304
|
/** Ban a set of users from a clan. */
|
|
305
305
|
unbanClanUsers(session: Session, clanId: string, channelId?: string, userIds?: Array<string>): Promise<boolean>;
|
|
306
306
|
/** Ban a set of users from a clan. */
|
package/dist/mezon-js.cjs.js
CHANGED
|
@@ -2550,9 +2550,11 @@ var MezonApi = class {
|
|
|
2550
2550
|
]);
|
|
2551
2551
|
}
|
|
2552
2552
|
/** List banned user */
|
|
2553
|
-
listBannedUsers(bearerToken, options = {}) {
|
|
2553
|
+
listBannedUsers(bearerToken, clanId, channelId, options = {}) {
|
|
2554
2554
|
const urlPath = "/v2/banned";
|
|
2555
2555
|
const queryParams = /* @__PURE__ */ new Map();
|
|
2556
|
+
queryParams.set("clan_id", clanId);
|
|
2557
|
+
queryParams.set("channel_id", channelId);
|
|
2556
2558
|
let bodyJson = "";
|
|
2557
2559
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
2558
2560
|
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
|
@@ -8903,13 +8905,15 @@ var Client = class {
|
|
|
8903
8905
|
});
|
|
8904
8906
|
});
|
|
8905
8907
|
}
|
|
8906
|
-
listBannedUsers(session) {
|
|
8908
|
+
listBannedUsers(session, clanId, channelId) {
|
|
8907
8909
|
return __async(this, null, function* () {
|
|
8908
8910
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
|
|
8909
8911
|
yield this.sessionRefresh(session);
|
|
8910
8912
|
}
|
|
8911
8913
|
return this.apiClient.listBannedUsers(
|
|
8912
|
-
session.token
|
|
8914
|
+
session.token,
|
|
8915
|
+
clanId,
|
|
8916
|
+
channelId
|
|
8913
8917
|
).then((response) => {
|
|
8914
8918
|
return Promise.resolve(response);
|
|
8915
8919
|
});
|
package/dist/mezon-js.esm.mjs
CHANGED
|
@@ -2516,9 +2516,11 @@ var MezonApi = class {
|
|
|
2516
2516
|
]);
|
|
2517
2517
|
}
|
|
2518
2518
|
/** List banned user */
|
|
2519
|
-
listBannedUsers(bearerToken, options = {}) {
|
|
2519
|
+
listBannedUsers(bearerToken, clanId, channelId, options = {}) {
|
|
2520
2520
|
const urlPath = "/v2/banned";
|
|
2521
2521
|
const queryParams = /* @__PURE__ */ new Map();
|
|
2522
|
+
queryParams.set("clan_id", clanId);
|
|
2523
|
+
queryParams.set("channel_id", channelId);
|
|
2522
2524
|
let bodyJson = "";
|
|
2523
2525
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
2524
2526
|
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
|
@@ -8869,13 +8871,15 @@ var Client = class {
|
|
|
8869
8871
|
});
|
|
8870
8872
|
});
|
|
8871
8873
|
}
|
|
8872
|
-
listBannedUsers(session) {
|
|
8874
|
+
listBannedUsers(session, clanId, channelId) {
|
|
8873
8875
|
return __async(this, null, function* () {
|
|
8874
8876
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
|
|
8875
8877
|
yield this.sessionRefresh(session);
|
|
8876
8878
|
}
|
|
8877
8879
|
return this.apiClient.listBannedUsers(
|
|
8878
|
-
session.token
|
|
8880
|
+
session.token,
|
|
8881
|
+
clanId,
|
|
8882
|
+
channelId
|
|
8879
8883
|
).then((response) => {
|
|
8880
8884
|
return Promise.resolve(response);
|
|
8881
8885
|
});
|