mezon-js 2.13.62 → 2.13.63
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 +2 -44
- package/client.ts +0 -20
- package/dist/api.gen.d.ts +1 -7
- package/dist/client.d.ts +1 -2
- package/dist/mezon-js.cjs.js +0 -39
- package/dist/mezon-js.esm.mjs +0 -39
- package/package.json +1 -1
package/api.gen.ts
CHANGED
|
@@ -206,6 +206,8 @@ export interface MezonUpdateClanDescBody {
|
|
|
206
206
|
about?: string;
|
|
207
207
|
// short url for community
|
|
208
208
|
short_url?: string;
|
|
209
|
+
// prevent anonymous
|
|
210
|
+
prevent_anonymous?: boolean;
|
|
209
211
|
}
|
|
210
212
|
|
|
211
213
|
/** */
|
|
@@ -2441,14 +2443,6 @@ export interface ApiSearchMessageResponse {
|
|
|
2441
2443
|
total?: number;
|
|
2442
2444
|
}
|
|
2443
2445
|
|
|
2444
|
-
/** */
|
|
2445
|
-
export interface ApiConfigAllowAnonymousRequest {
|
|
2446
|
-
//
|
|
2447
|
-
allow?: boolean;
|
|
2448
|
-
//
|
|
2449
|
-
clan_id?: string;
|
|
2450
|
-
}
|
|
2451
|
-
|
|
2452
2446
|
/** A user's session used to authenticate messages. */
|
|
2453
2447
|
export interface ApiSession {
|
|
2454
2448
|
//True if the corresponding account was just created, false otherwise.
|
|
@@ -11763,41 +11757,5 @@ export class MezonApi {
|
|
|
11763
11757
|
]);
|
|
11764
11758
|
}
|
|
11765
11759
|
|
|
11766
|
-
/** */
|
|
11767
|
-
configAllowAnonymous(bearerToken: string,
|
|
11768
|
-
body:ApiConfigAllowAnonymousRequest,
|
|
11769
|
-
options: any = {}): Promise<any> {
|
|
11770
|
-
|
|
11771
|
-
if (body === null || body === undefined) {
|
|
11772
|
-
throw new Error("'body' is a required parameter but is null or undefined.");
|
|
11773
|
-
}
|
|
11774
|
-
const urlPath = "/v2/anonymous/config";
|
|
11775
|
-
const queryParams = new Map<string, any>();
|
|
11776
|
-
|
|
11777
|
-
let bodyJson : string = "";
|
|
11778
|
-
bodyJson = JSON.stringify(body || {});
|
|
11779
|
-
|
|
11780
|
-
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
11781
|
-
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
|
11782
|
-
if (bearerToken) {
|
|
11783
|
-
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
|
11784
|
-
}
|
|
11785
|
-
|
|
11786
|
-
return Promise.race([
|
|
11787
|
-
fetch(fullUrl, fetchOptions).then((response) => {
|
|
11788
|
-
if (response.status == 204) {
|
|
11789
|
-
return response;
|
|
11790
|
-
} else if (response.status >= 200 && response.status < 300) {
|
|
11791
|
-
return response.json();
|
|
11792
|
-
} else {
|
|
11793
|
-
throw response;
|
|
11794
|
-
}
|
|
11795
|
-
}),
|
|
11796
|
-
new Promise((_, reject) =>
|
|
11797
|
-
setTimeout(reject, this.timeoutMs, "Request timed out.")
|
|
11798
|
-
),
|
|
11799
|
-
]);
|
|
11800
|
-
}
|
|
11801
|
-
|
|
11802
11760
|
}
|
|
11803
11761
|
|
package/client.ts
CHANGED
|
@@ -180,7 +180,6 @@ import {
|
|
|
180
180
|
ApiUpdateUsernameRequest,
|
|
181
181
|
ApiBannedUserList,
|
|
182
182
|
ApiIsBannedResponse,
|
|
183
|
-
ApiConfigAllowAnonymousRequest,
|
|
184
183
|
} from "./api.gen";
|
|
185
184
|
|
|
186
185
|
import { Session } from "./session";
|
|
@@ -4988,23 +4987,4 @@ export class Client {
|
|
|
4988
4987
|
return Promise.resolve(response);
|
|
4989
4988
|
});
|
|
4990
4989
|
}
|
|
4991
|
-
|
|
4992
|
-
async configAllowAnonymous(
|
|
4993
|
-
session: Session,
|
|
4994
|
-
req: ApiConfigAllowAnonymousRequest,
|
|
4995
|
-
): Promise<any> {
|
|
4996
|
-
if (
|
|
4997
|
-
this.autoRefreshSession &&
|
|
4998
|
-
session.refresh_token &&
|
|
4999
|
-
session.isexpired(Date.now() / 1000)
|
|
5000
|
-
) {
|
|
5001
|
-
await this.sessionRefresh(session);
|
|
5002
|
-
}
|
|
5003
|
-
|
|
5004
|
-
return this.apiClient
|
|
5005
|
-
.configAllowAnonymous(session.token, req)
|
|
5006
|
-
.then((response: any) => {
|
|
5007
|
-
return response !== undefined;
|
|
5008
|
-
});
|
|
5009
|
-
}
|
|
5010
4990
|
}
|
package/dist/api.gen.d.ts
CHANGED
|
@@ -118,6 +118,7 @@ export interface MezonUpdateClanDescBody {
|
|
|
118
118
|
description?: string;
|
|
119
119
|
about?: string;
|
|
120
120
|
short_url?: string;
|
|
121
|
+
prevent_anonymous?: boolean;
|
|
121
122
|
}
|
|
122
123
|
/** */
|
|
123
124
|
export interface MezonUpdateClanDescProfileBody {
|
|
@@ -1393,11 +1394,6 @@ export interface ApiSearchMessageResponse {
|
|
|
1393
1394
|
messages?: Array<ApiSearchMessageDocument>;
|
|
1394
1395
|
total?: number;
|
|
1395
1396
|
}
|
|
1396
|
-
/** */
|
|
1397
|
-
export interface ApiConfigAllowAnonymousRequest {
|
|
1398
|
-
allow?: boolean;
|
|
1399
|
-
clan_id?: string;
|
|
1400
|
-
}
|
|
1401
1397
|
/** A user's session used to authenticate messages. */
|
|
1402
1398
|
export interface ApiSession {
|
|
1403
1399
|
created?: boolean;
|
|
@@ -2409,6 +2405,4 @@ export declare class MezonApi {
|
|
|
2409
2405
|
updateUsername(bearerToken: string, body: ApiUpdateUsernameRequest, options?: any): Promise<ApiSession>;
|
|
2410
2406
|
/** Ban a set of users from a channel. */
|
|
2411
2407
|
isBanned(bearerToken: string, channelId: string, options?: any): Promise<ApiIsBannedResponse>;
|
|
2412
|
-
/** */
|
|
2413
|
-
configAllowAnonymous(bearerToken: string, body: ApiConfigAllowAnonymousRequest, options?: any): Promise<any>;
|
|
2414
2408
|
}
|
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, ApiLinkAccountConfirmRequest, ApiLinkAccountMezon, ApiUser, ApiFriend, ApiListClanUnreadMsgIndicatorResponse, ApiAddFriendsResponse, ApiUpdateUsernameRequest, ApiBannedUserList, ApiIsBannedResponse
|
|
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";
|
|
@@ -533,5 +533,4 @@ export declare class Client {
|
|
|
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
|
-
configAllowAnonymous(session: Session, req: ApiConfigAllowAnonymousRequest): Promise<any>;
|
|
537
536
|
}
|
package/dist/mezon-js.cjs.js
CHANGED
|
@@ -7208,35 +7208,6 @@ var MezonApi = class {
|
|
|
7208
7208
|
)
|
|
7209
7209
|
]);
|
|
7210
7210
|
}
|
|
7211
|
-
/** */
|
|
7212
|
-
configAllowAnonymous(bearerToken, body, options = {}) {
|
|
7213
|
-
if (body === null || body === void 0) {
|
|
7214
|
-
throw new Error("'body' is a required parameter but is null or undefined.");
|
|
7215
|
-
}
|
|
7216
|
-
const urlPath = "/v2/anonymous/config";
|
|
7217
|
-
const queryParams = /* @__PURE__ */ new Map();
|
|
7218
|
-
let bodyJson = "";
|
|
7219
|
-
bodyJson = JSON.stringify(body || {});
|
|
7220
|
-
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
7221
|
-
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
|
7222
|
-
if (bearerToken) {
|
|
7223
|
-
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
|
7224
|
-
}
|
|
7225
|
-
return Promise.race([
|
|
7226
|
-
fetch(fullUrl, fetchOptions).then((response) => {
|
|
7227
|
-
if (response.status == 204) {
|
|
7228
|
-
return response;
|
|
7229
|
-
} else if (response.status >= 200 && response.status < 300) {
|
|
7230
|
-
return response.json();
|
|
7231
|
-
} else {
|
|
7232
|
-
throw response;
|
|
7233
|
-
}
|
|
7234
|
-
}),
|
|
7235
|
-
new Promise(
|
|
7236
|
-
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
|
7237
|
-
)
|
|
7238
|
-
]);
|
|
7239
|
-
}
|
|
7240
7211
|
};
|
|
7241
7212
|
|
|
7242
7213
|
// session.ts
|
|
@@ -11307,14 +11278,4 @@ var Client = class {
|
|
|
11307
11278
|
});
|
|
11308
11279
|
});
|
|
11309
11280
|
}
|
|
11310
|
-
configAllowAnonymous(session, req) {
|
|
11311
|
-
return __async(this, null, function* () {
|
|
11312
|
-
if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
|
|
11313
|
-
yield this.sessionRefresh(session);
|
|
11314
|
-
}
|
|
11315
|
-
return this.apiClient.configAllowAnonymous(session.token, req).then((response) => {
|
|
11316
|
-
return response !== void 0;
|
|
11317
|
-
});
|
|
11318
|
-
});
|
|
11319
|
-
}
|
|
11320
11281
|
};
|
package/dist/mezon-js.esm.mjs
CHANGED
|
@@ -7173,35 +7173,6 @@ var MezonApi = class {
|
|
|
7173
7173
|
)
|
|
7174
7174
|
]);
|
|
7175
7175
|
}
|
|
7176
|
-
/** */
|
|
7177
|
-
configAllowAnonymous(bearerToken, body, options = {}) {
|
|
7178
|
-
if (body === null || body === void 0) {
|
|
7179
|
-
throw new Error("'body' is a required parameter but is null or undefined.");
|
|
7180
|
-
}
|
|
7181
|
-
const urlPath = "/v2/anonymous/config";
|
|
7182
|
-
const queryParams = /* @__PURE__ */ new Map();
|
|
7183
|
-
let bodyJson = "";
|
|
7184
|
-
bodyJson = JSON.stringify(body || {});
|
|
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
|
-
}
|
|
7205
7176
|
};
|
|
7206
7177
|
|
|
7207
7178
|
// session.ts
|
|
@@ -11272,16 +11243,6 @@ var Client = class {
|
|
|
11272
11243
|
});
|
|
11273
11244
|
});
|
|
11274
11245
|
}
|
|
11275
|
-
configAllowAnonymous(session, req) {
|
|
11276
|
-
return __async(this, null, function* () {
|
|
11277
|
-
if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
|
|
11278
|
-
yield this.sessionRefresh(session);
|
|
11279
|
-
}
|
|
11280
|
-
return this.apiClient.configAllowAnonymous(session.token, req).then((response) => {
|
|
11281
|
-
return response !== void 0;
|
|
11282
|
-
});
|
|
11283
|
-
});
|
|
11284
|
-
}
|
|
11285
11246
|
};
|
|
11286
11247
|
export {
|
|
11287
11248
|
ChannelStreamMode,
|