mezon-js 2.13.55 → 2.13.57

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 CHANGED
@@ -2441,6 +2441,14 @@ export interface ApiSearchMessageResponse {
2441
2441
  total?: number;
2442
2442
  }
2443
2443
 
2444
+ /** */
2445
+ export interface ApiConfigAllowAnonymousRequest {
2446
+ //
2447
+ allow?: boolean;
2448
+ //
2449
+ clan_id?: string;
2450
+ }
2451
+
2444
2452
  /** A user's session used to authenticate messages. */
2445
2453
  export interface ApiSession {
2446
2454
  //True if the corresponding account was just created, false otherwise.
@@ -11754,5 +11762,42 @@ export class MezonApi {
11754
11762
  ),
11755
11763
  ]);
11756
11764
  }
11765
+
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
+
11757
11802
  }
11758
11803
 
package/client.ts CHANGED
@@ -180,6 +180,7 @@ import {
180
180
  ApiUpdateUsernameRequest,
181
181
  ApiBannedUserList,
182
182
  ApiIsBannedResponse,
183
+ ApiConfigAllowAnonymousRequest,
183
184
  } from "./api.gen";
184
185
 
185
186
  import { Session } from "./session";
@@ -4986,4 +4987,22 @@ export class Client {
4986
4987
  });
4987
4988
  }
4988
4989
 
4990
+ async configAllowAnonymous(
4991
+ session: Session,
4992
+ req: ApiConfigAllowAnonymousRequest,
4993
+ ): Promise<any> {
4994
+ if (
4995
+ this.autoRefreshSession &&
4996
+ session.refresh_token &&
4997
+ session.isexpired(Date.now() / 1000)
4998
+ ) {
4999
+ await this.sessionRefresh(session);
5000
+ }
5001
+
5002
+ return this.apiClient
5003
+ .configAllowAnonymous(session.token, req)
5004
+ .then((response: any) => {
5005
+ return response !== undefined;
5006
+ });
5007
+ }
4989
5008
  }
package/dist/api.gen.d.ts CHANGED
@@ -1393,6 +1393,11 @@ export interface ApiSearchMessageResponse {
1393
1393
  messages?: Array<ApiSearchMessageDocument>;
1394
1394
  total?: number;
1395
1395
  }
1396
+ /** */
1397
+ export interface ApiConfigAllowAnonymousRequest {
1398
+ allow?: boolean;
1399
+ clan_id?: string;
1400
+ }
1396
1401
  /** A user's session used to authenticate messages. */
1397
1402
  export interface ApiSession {
1398
1403
  created?: boolean;
@@ -2404,4 +2409,6 @@ export declare class MezonApi {
2404
2409
  updateUsername(bearerToken: string, body: ApiUpdateUsernameRequest, options?: any): Promise<ApiSession>;
2405
2410
  /** Ban a set of users from a channel. */
2406
2411
  isBanned(bearerToken: string, channelId: string, options?: any): Promise<ApiIsBannedResponse>;
2412
+ /** */
2413
+ configAllowAnonymous(bearerToken: string, body: ApiConfigAllowAnonymousRequest, options?: any): Promise<any>;
2407
2414
  }
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 } 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, 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, ApiConfigAllowAnonymousRequest } from "./api.gen";
17
17
  import { Session } from "./session";
18
18
  import { Socket } from "./socket";
19
19
  import { WebSocketAdapter } from "./web_socket_adapter";
@@ -533,4 +533,5 @@ 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>;
536
537
  }
@@ -7203,6 +7203,35 @@ var MezonApi = class {
7203
7203
  )
7204
7204
  ]);
7205
7205
  }
7206
+ /** */
7207
+ configAllowAnonymous(bearerToken, body, options = {}) {
7208
+ if (body === null || body === void 0) {
7209
+ throw new Error("'body' is a required parameter but is null or undefined.");
7210
+ }
7211
+ const urlPath = "/v2/anonymous/config";
7212
+ const queryParams = /* @__PURE__ */ new Map();
7213
+ let bodyJson = "";
7214
+ bodyJson = JSON.stringify(body || {});
7215
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
7216
+ const fetchOptions = buildFetchOptions("POST", options, bodyJson);
7217
+ if (bearerToken) {
7218
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
7219
+ }
7220
+ return Promise.race([
7221
+ fetch(fullUrl, fetchOptions).then((response) => {
7222
+ if (response.status == 204) {
7223
+ return response;
7224
+ } else if (response.status >= 200 && response.status < 300) {
7225
+ return response.json();
7226
+ } else {
7227
+ throw response;
7228
+ }
7229
+ }),
7230
+ new Promise(
7231
+ (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
7232
+ )
7233
+ ]);
7234
+ }
7206
7235
  };
7207
7236
 
7208
7237
  // session.ts
@@ -7657,6 +7686,8 @@ var _DefaultSocket = class _DefaultSocket {
7657
7686
  this.ontransferownership(message.transfer_ownership_event);
7658
7687
  } else if (message.ban_user_event) {
7659
7688
  this.onbanneduser(message.ban_user_event);
7689
+ } else if (message.allow_anonymous_event) {
7690
+ this.onallowanonymousevent(message.allow_anonymous_event);
7660
7691
  } else {
7661
7692
  if (this.verbose && window && window.console) {
7662
7693
  console.log("Unrecognized message received: %o", message);
@@ -8054,6 +8085,11 @@ var _DefaultSocket = class _DefaultSocket {
8054
8085
  console.log(event);
8055
8086
  }
8056
8087
  }
8088
+ onallowanonymousevent(event) {
8089
+ if (this.verbose && window && window.console) {
8090
+ console.log(event);
8091
+ }
8092
+ }
8057
8093
  send(message, sendTimeout = _DefaultSocket.DefaultSendTimeoutMs) {
8058
8094
  const untypedMessage = message;
8059
8095
  return new Promise((resolve, reject) => {
@@ -11198,4 +11234,14 @@ var Client = class {
11198
11234
  });
11199
11235
  });
11200
11236
  }
11237
+ configAllowAnonymous(session, req) {
11238
+ return __async(this, null, function* () {
11239
+ if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
11240
+ yield this.sessionRefresh(session);
11241
+ }
11242
+ return this.apiClient.configAllowAnonymous(session.token, req).then((response) => {
11243
+ return response !== void 0;
11244
+ });
11245
+ });
11246
+ }
11201
11247
  };
@@ -7169,6 +7169,35 @@ var MezonApi = class {
7169
7169
  )
7170
7170
  ]);
7171
7171
  }
7172
+ /** */
7173
+ configAllowAnonymous(bearerToken, body, options = {}) {
7174
+ if (body === null || body === void 0) {
7175
+ throw new Error("'body' is a required parameter but is null or undefined.");
7176
+ }
7177
+ const urlPath = "/v2/anonymous/config";
7178
+ const queryParams = /* @__PURE__ */ new Map();
7179
+ let bodyJson = "";
7180
+ bodyJson = JSON.stringify(body || {});
7181
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
7182
+ const fetchOptions = buildFetchOptions("POST", options, bodyJson);
7183
+ if (bearerToken) {
7184
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
7185
+ }
7186
+ return Promise.race([
7187
+ fetch(fullUrl, fetchOptions).then((response) => {
7188
+ if (response.status == 204) {
7189
+ return response;
7190
+ } else if (response.status >= 200 && response.status < 300) {
7191
+ return response.json();
7192
+ } else {
7193
+ throw response;
7194
+ }
7195
+ }),
7196
+ new Promise(
7197
+ (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
7198
+ )
7199
+ ]);
7200
+ }
7172
7201
  };
7173
7202
 
7174
7203
  // session.ts
@@ -7623,6 +7652,8 @@ var _DefaultSocket = class _DefaultSocket {
7623
7652
  this.ontransferownership(message.transfer_ownership_event);
7624
7653
  } else if (message.ban_user_event) {
7625
7654
  this.onbanneduser(message.ban_user_event);
7655
+ } else if (message.allow_anonymous_event) {
7656
+ this.onallowanonymousevent(message.allow_anonymous_event);
7626
7657
  } else {
7627
7658
  if (this.verbose && window && window.console) {
7628
7659
  console.log("Unrecognized message received: %o", message);
@@ -8020,6 +8051,11 @@ var _DefaultSocket = class _DefaultSocket {
8020
8051
  console.log(event);
8021
8052
  }
8022
8053
  }
8054
+ onallowanonymousevent(event) {
8055
+ if (this.verbose && window && window.console) {
8056
+ console.log(event);
8057
+ }
8058
+ }
8023
8059
  send(message, sendTimeout = _DefaultSocket.DefaultSendTimeoutMs) {
8024
8060
  const untypedMessage = message;
8025
8061
  return new Promise((resolve, reject) => {
@@ -11164,6 +11200,16 @@ var Client = class {
11164
11200
  });
11165
11201
  });
11166
11202
  }
11203
+ configAllowAnonymous(session, req) {
11204
+ return __async(this, null, function* () {
11205
+ if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
11206
+ yield this.sessionRefresh(session);
11207
+ }
11208
+ return this.apiClient.configAllowAnonymous(session.token, req).then((response) => {
11209
+ return response !== void 0;
11210
+ });
11211
+ });
11212
+ }
11167
11213
  };
11168
11214
  export {
11169
11215
  ChannelStreamMode,
package/dist/socket.d.ts CHANGED
@@ -106,6 +106,7 @@ export interface BannedUserEvent {
106
106
  banner_id: string;
107
107
  channel_id: string;
108
108
  clan_id: string;
109
+ ban_time: number;
109
110
  }
110
111
  export interface UserProfileRedis {
111
112
  /** User IDs to follow. */
@@ -491,6 +492,10 @@ export interface MeetParticipantEvent {
491
492
  clan_id: string;
492
493
  action: number;
493
494
  }
495
+ export interface AllowAnonymousEvent {
496
+ clan_id: string;
497
+ allow: boolean;
498
+ }
494
499
  /** Stream identifier */
495
500
  export interface StreamId {
496
501
  /** The type of stream (e.g. chat). */
@@ -1041,6 +1046,7 @@ export interface Socket {
1041
1046
  onroleassign: (role_assign_event: RoleAssignedEvent) => void;
1042
1047
  ondeleteaccount: (delete_account_event: DeleteAccountEvent) => void;
1043
1048
  onmeetparticipantevent: (event: MeetParticipantEvent) => void;
1049
+ onallowanonymousevent: (event: AllowAnonymousEvent) => void;
1044
1050
  onstreamingchannelstarted: (streaming_started_event: StreamingStartedEvent) => void;
1045
1051
  onstreamingchannelended: (streaming_ended_event: StreamingEndedEvent) => void;
1046
1052
  onstreamingchanneljoined: (streaming_joined_event: StreamingJoinedEvent) => void;
@@ -1156,6 +1162,7 @@ export declare class DefaultSocket implements Socket {
1156
1162
  ontransferownership(event: TransferOwnershipEvent): void;
1157
1163
  onbanneduser(event: BannedUserEvent): void;
1158
1164
  onmeetparticipantevent(event: MeetParticipantEvent): void;
1165
+ onallowanonymousevent(event: AllowAnonymousEvent): void;
1159
1166
  send(message: ChannelJoin | ChannelLeave | ChannelMessageSend | ChannelMessageUpdate | CustomStatusEvent | ChannelMessageRemove | MessageTypingEvent | LastSeenMessageEvent | Rpc | StatusFollow | StatusUnfollow | StatusUpdate | Ping | WebrtcSignalingFwd | IncomingCallPush | MessageButtonClicked | DropdownBoxSelected | ChannelAppEvent | EphemeralMessageSend | VoiceReactionSend | ListDataSocket | QuickMenuEvent, sendTimeout?: number): Promise<any>;
1160
1167
  followUsers(userIds: string[]): Promise<Status>;
1161
1168
  joinClanChat(clan_id: string): Promise<ClanJoin>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mezon-js",
3
- "version": "2.13.55",
3
+ "version": "2.13.57",
4
4
  "scripts": {
5
5
  "build": "npx tsc && npx rollup -c --bundleConfigAsCjs && node build.mjs"
6
6
  },
package/socket.ts CHANGED
@@ -184,6 +184,7 @@ export interface BannedUserEvent {
184
184
  banner_id: string;
185
185
  channel_id: string;
186
186
  clan_id: string;
187
+ ban_time: number
187
188
  }
188
189
 
189
190
  export interface UserProfileRedis {
@@ -790,6 +791,11 @@ export interface MeetParticipantEvent {
790
791
  action: number;
791
792
  }
792
793
 
794
+ export interface AllowAnonymousEvent {
795
+ clan_id: string;
796
+ allow: boolean;
797
+ }
798
+
793
799
  /** Stream identifier */
794
800
  export interface StreamId {
795
801
  /** The type of stream (e.g. chat). */
@@ -1797,6 +1803,8 @@ export interface Socket {
1797
1803
 
1798
1804
  onmeetparticipantevent: (event: MeetParticipantEvent) => void;
1799
1805
 
1806
+ onallowanonymousevent: (event: AllowAnonymousEvent) => void;
1807
+
1800
1808
  onstreamingchannelstarted: (
1801
1809
  streaming_started_event: StreamingStartedEvent
1802
1810
  ) => void;
@@ -2093,6 +2101,8 @@ export class DefaultSocket implements Socket {
2093
2101
  this.ontransferownership(<TransferOwnershipEvent>message.transfer_ownership_event);
2094
2102
  } else if (message.ban_user_event) {
2095
2103
  this.onbanneduser(<BannedUserEvent>message.ban_user_event);
2104
+ } else if (message.allow_anonymous_event) {
2105
+ this.onallowanonymousevent(<AllowAnonymousEvent>message.allow_anonymous_event);
2096
2106
  } else {
2097
2107
  if (this.verbose && window && window.console) {
2098
2108
  console.log("Unrecognized message received: %o", message);
@@ -2568,6 +2578,12 @@ export class DefaultSocket implements Socket {
2568
2578
  }
2569
2579
  }
2570
2580
 
2581
+ onallowanonymousevent(event: AllowAnonymousEvent) {
2582
+ if (this.verbose && window && window.console) {
2583
+ console.log(event);
2584
+ }
2585
+ }
2586
+
2571
2587
  send(
2572
2588
  message:
2573
2589
  | ChannelJoin