mezon-js 2.13.33 → 2.13.35
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 -3
- package/client.ts +6 -6
- package/dist/api.gen.d.ts +7 -2
- package/dist/client.d.ts +2 -2
- package/dist/mezon-js.cjs.js +31 -3
- package/dist/mezon-js.esm.mjs +31 -3
- package/package.json +1 -1
package/api.gen.ts
CHANGED
|
@@ -30,12 +30,10 @@ export interface ChannelUserListChannelUser {
|
|
|
30
30
|
export interface ApiBannedUser {
|
|
31
31
|
//
|
|
32
32
|
ban_time?: number;
|
|
33
|
-
//
|
|
34
|
-
banned_avatar?: string;
|
|
35
33
|
//The banned user.
|
|
36
34
|
banned_id?: string;
|
|
37
35
|
//
|
|
38
|
-
|
|
36
|
+
banner_id?: string;
|
|
39
37
|
//
|
|
40
38
|
channel_id?: string;
|
|
41
39
|
//
|
|
@@ -2289,6 +2287,12 @@ export interface ApiRole {
|
|
|
2289
2287
|
order_role?: number;
|
|
2290
2288
|
}
|
|
2291
2289
|
|
|
2290
|
+
/** */
|
|
2291
|
+
export interface ApiIsBannedResponse {
|
|
2292
|
+
//
|
|
2293
|
+
is_banned?: boolean;
|
|
2294
|
+
}
|
|
2295
|
+
|
|
2292
2296
|
/** A list of role description, usually a result of a list operation. */
|
|
2293
2297
|
export interface ApiRoleList {
|
|
2294
2298
|
max_level_permission?: number;
|
|
@@ -11700,4 +11704,41 @@ export class MezonApi {
|
|
|
11700
11704
|
),
|
|
11701
11705
|
]);
|
|
11702
11706
|
}
|
|
11707
|
+
|
|
11708
|
+
/** Ban a set of users from a channel. */
|
|
11709
|
+
isBanned(bearerToken: string,
|
|
11710
|
+
channelId:string,
|
|
11711
|
+
options: any = {}): Promise<ApiIsBannedResponse> {
|
|
11712
|
+
|
|
11713
|
+
if (channelId === null || channelId === undefined) {
|
|
11714
|
+
throw new Error("'channelId' is a required parameter but is null or undefined.");
|
|
11715
|
+
}
|
|
11716
|
+
const urlPath = "/v2/channel/{channelId}/isban"
|
|
11717
|
+
.replace("{channelId}", encodeURIComponent(String(channelId)));
|
|
11718
|
+
const queryParams = new Map<string, any>();
|
|
11719
|
+
|
|
11720
|
+
let bodyJson : string = "";
|
|
11721
|
+
|
|
11722
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
11723
|
+
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
|
11724
|
+
if (bearerToken) {
|
|
11725
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
|
11726
|
+
}
|
|
11727
|
+
|
|
11728
|
+
return Promise.race([
|
|
11729
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
|
11730
|
+
if (response.status == 204) {
|
|
11731
|
+
return response;
|
|
11732
|
+
} else if (response.status >= 200 && response.status < 300) {
|
|
11733
|
+
return response.json();
|
|
11734
|
+
} else {
|
|
11735
|
+
throw response;
|
|
11736
|
+
}
|
|
11737
|
+
}),
|
|
11738
|
+
new Promise((_, reject) =>
|
|
11739
|
+
setTimeout(reject, this.timeoutMs, "Request timed out.")
|
|
11740
|
+
),
|
|
11741
|
+
]);
|
|
11742
|
+
}
|
|
11703
11743
|
}
|
|
11744
|
+
|
package/client.ts
CHANGED
|
@@ -171,7 +171,6 @@ import {
|
|
|
171
171
|
ApiIsFollowerRequest,
|
|
172
172
|
ApiTransferOwnershipRequest,
|
|
173
173
|
ApiMeetParticipantRequest,
|
|
174
|
-
ApiStoreWalletKeyRequest,
|
|
175
174
|
ApiLinkAccountConfirmRequest,
|
|
176
175
|
ApiLinkAccountMezon,
|
|
177
176
|
ApiUser,
|
|
@@ -180,6 +179,7 @@ import {
|
|
|
180
179
|
ApiAddFriendsResponse,
|
|
181
180
|
ApiUpdateUsernameRequest,
|
|
182
181
|
ApiBannedUserList,
|
|
182
|
+
ApiIsBannedResponse,
|
|
183
183
|
} from "./api.gen";
|
|
184
184
|
|
|
185
185
|
import { Session } from "./session";
|
|
@@ -4964,8 +4964,8 @@ export class Client {
|
|
|
4964
4964
|
});
|
|
4965
4965
|
}
|
|
4966
4966
|
|
|
4967
|
-
async
|
|
4968
|
-
|
|
4967
|
+
async isBanned(session: Session,
|
|
4968
|
+
channelId: string): Promise<ApiIsBannedResponse> {
|
|
4969
4969
|
if (
|
|
4970
4970
|
this.autoRefreshSession &&
|
|
4971
4971
|
session.refresh_token &&
|
|
@@ -4975,9 +4975,9 @@ export class Client {
|
|
|
4975
4975
|
}
|
|
4976
4976
|
|
|
4977
4977
|
return this.apiClient
|
|
4978
|
-
.
|
|
4979
|
-
.then((response:
|
|
4980
|
-
return response
|
|
4978
|
+
.isBanned(session.token, channelId)
|
|
4979
|
+
.then((response: ApiIsBannedResponse) => {
|
|
4980
|
+
return Promise.resolve(response);
|
|
4981
4981
|
});
|
|
4982
4982
|
}
|
|
4983
4983
|
|
package/dist/api.gen.d.ts
CHANGED
|
@@ -13,9 +13,8 @@ export interface ChannelUserListChannelUser {
|
|
|
13
13
|
/** */
|
|
14
14
|
export interface ApiBannedUser {
|
|
15
15
|
ban_time?: number;
|
|
16
|
-
banned_avatar?: string;
|
|
17
16
|
banned_id?: string;
|
|
18
|
-
|
|
17
|
+
banner_id?: string;
|
|
19
18
|
channel_id?: string;
|
|
20
19
|
reason?: string;
|
|
21
20
|
}
|
|
@@ -1308,6 +1307,10 @@ export interface ApiRole {
|
|
|
1308
1307
|
title?: string;
|
|
1309
1308
|
order_role?: number;
|
|
1310
1309
|
}
|
|
1310
|
+
/** */
|
|
1311
|
+
export interface ApiIsBannedResponse {
|
|
1312
|
+
is_banned?: boolean;
|
|
1313
|
+
}
|
|
1311
1314
|
/** A list of role description, usually a result of a list operation. */
|
|
1312
1315
|
export interface ApiRoleList {
|
|
1313
1316
|
max_level_permission?: number;
|
|
@@ -2396,4 +2399,6 @@ export declare class MezonApi {
|
|
|
2396
2399
|
transferOwnership(bearerToken: string, body: ApiTransferOwnershipRequest, options?: any): Promise<any>;
|
|
2397
2400
|
/** Update username */
|
|
2398
2401
|
updateUsername(bearerToken: string, body: ApiUpdateUsernameRequest, options?: any): Promise<ApiSession>;
|
|
2402
|
+
/** Ban a set of users from a channel. */
|
|
2403
|
+
isBanned(bearerToken: string, channelId: string, options?: any): Promise<ApiIsBannedResponse>;
|
|
2399
2404
|
}
|
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,
|
|
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, ApiLinkAccountConfirmRequest, ApiLinkAccountMezon, ApiUser, ApiFriend, ApiListClanUnreadMsgIndicatorResponse, ApiAddFriendsResponse, ApiUpdateUsernameRequest, ApiBannedUserList, ApiIsBannedResponse } from "./api.gen";
|
|
17
17
|
import { Session } from "./session";
|
|
18
18
|
import { Socket } from "./socket";
|
|
19
19
|
import { WebSocketAdapter } from "./web_socket_adapter";
|
|
@@ -532,5 +532,5 @@ export declare class Client {
|
|
|
532
532
|
listForSaleItems(session: Session, page?: number): Promise<ApiForSaleItemList>;
|
|
533
533
|
isFollower(session: Session, req: ApiIsFollowerRequest): Promise<ApiIsFollowerResponse>;
|
|
534
534
|
transferOwnership(session: Session, req: ApiTransferOwnershipRequest): Promise<any>;
|
|
535
|
-
|
|
535
|
+
isBanned(session: Session, channelId: string): Promise<ApiIsBannedResponse>;
|
|
536
536
|
}
|
package/dist/mezon-js.cjs.js
CHANGED
|
@@ -7174,6 +7174,34 @@ var MezonApi = class {
|
|
|
7174
7174
|
)
|
|
7175
7175
|
]);
|
|
7176
7176
|
}
|
|
7177
|
+
/** Ban a set of users from a channel. */
|
|
7178
|
+
isBanned(bearerToken, channelId, options = {}) {
|
|
7179
|
+
if (channelId === null || channelId === void 0) {
|
|
7180
|
+
throw new Error("'channelId' is a required parameter but is null or undefined.");
|
|
7181
|
+
}
|
|
7182
|
+
const urlPath = "/v2/channel/{channelId}/isban".replace("{channelId}", encodeURIComponent(String(channelId)));
|
|
7183
|
+
const queryParams = /* @__PURE__ */ new Map();
|
|
7184
|
+
let bodyJson = "";
|
|
7185
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
7186
|
+
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
|
7187
|
+
if (bearerToken) {
|
|
7188
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
|
7189
|
+
}
|
|
7190
|
+
return Promise.race([
|
|
7191
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
|
7192
|
+
if (response.status == 204) {
|
|
7193
|
+
return response;
|
|
7194
|
+
} else if (response.status >= 200 && response.status < 300) {
|
|
7195
|
+
return response.json();
|
|
7196
|
+
} else {
|
|
7197
|
+
throw response;
|
|
7198
|
+
}
|
|
7199
|
+
}),
|
|
7200
|
+
new Promise(
|
|
7201
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
|
7202
|
+
)
|
|
7203
|
+
]);
|
|
7204
|
+
}
|
|
7177
7205
|
};
|
|
7178
7206
|
|
|
7179
7207
|
// session.ts
|
|
@@ -11140,13 +11168,13 @@ var Client = class {
|
|
|
11140
11168
|
});
|
|
11141
11169
|
});
|
|
11142
11170
|
}
|
|
11143
|
-
|
|
11171
|
+
isBanned(session, channelId) {
|
|
11144
11172
|
return __async(this, null, function* () {
|
|
11145
11173
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
|
|
11146
11174
|
yield this.sessionRefresh(session);
|
|
11147
11175
|
}
|
|
11148
|
-
return this.apiClient.
|
|
11149
|
-
return response
|
|
11176
|
+
return this.apiClient.isBanned(session.token, channelId).then((response) => {
|
|
11177
|
+
return Promise.resolve(response);
|
|
11150
11178
|
});
|
|
11151
11179
|
});
|
|
11152
11180
|
}
|
package/dist/mezon-js.esm.mjs
CHANGED
|
@@ -7140,6 +7140,34 @@ var MezonApi = class {
|
|
|
7140
7140
|
)
|
|
7141
7141
|
]);
|
|
7142
7142
|
}
|
|
7143
|
+
/** Ban a set of users from a channel. */
|
|
7144
|
+
isBanned(bearerToken, channelId, options = {}) {
|
|
7145
|
+
if (channelId === null || channelId === void 0) {
|
|
7146
|
+
throw new Error("'channelId' is a required parameter but is null or undefined.");
|
|
7147
|
+
}
|
|
7148
|
+
const urlPath = "/v2/channel/{channelId}/isban".replace("{channelId}", encodeURIComponent(String(channelId)));
|
|
7149
|
+
const queryParams = /* @__PURE__ */ new Map();
|
|
7150
|
+
let bodyJson = "";
|
|
7151
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
7152
|
+
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
|
7153
|
+
if (bearerToken) {
|
|
7154
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
|
7155
|
+
}
|
|
7156
|
+
return Promise.race([
|
|
7157
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
|
7158
|
+
if (response.status == 204) {
|
|
7159
|
+
return response;
|
|
7160
|
+
} else if (response.status >= 200 && response.status < 300) {
|
|
7161
|
+
return response.json();
|
|
7162
|
+
} else {
|
|
7163
|
+
throw response;
|
|
7164
|
+
}
|
|
7165
|
+
}),
|
|
7166
|
+
new Promise(
|
|
7167
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
|
7168
|
+
)
|
|
7169
|
+
]);
|
|
7170
|
+
}
|
|
7143
7171
|
};
|
|
7144
7172
|
|
|
7145
7173
|
// session.ts
|
|
@@ -11106,13 +11134,13 @@ var Client = class {
|
|
|
11106
11134
|
});
|
|
11107
11135
|
});
|
|
11108
11136
|
}
|
|
11109
|
-
|
|
11137
|
+
isBanned(session, channelId) {
|
|
11110
11138
|
return __async(this, null, function* () {
|
|
11111
11139
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
|
|
11112
11140
|
yield this.sessionRefresh(session);
|
|
11113
11141
|
}
|
|
11114
|
-
return this.apiClient.
|
|
11115
|
-
return response
|
|
11142
|
+
return this.apiClient.isBanned(session.token, channelId).then((response) => {
|
|
11143
|
+
return Promise.resolve(response);
|
|
11116
11144
|
});
|
|
11117
11145
|
});
|
|
11118
11146
|
}
|