mezon-js 2.13.54 → 2.13.56

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
@@ -646,6 +646,10 @@ export interface ApiChannelAppResponse {
646
646
  id?: string;
647
647
  //
648
648
  app_url?: string;
649
+ //
650
+ app_name?: string;
651
+ //
652
+ app_logo?: string;
649
653
  }
650
654
 
651
655
  /** */
@@ -2437,6 +2441,14 @@ export interface ApiSearchMessageResponse {
2437
2441
  total?: number;
2438
2442
  }
2439
2443
 
2444
+ /** */
2445
+ export interface ApiConfigAllowAnonymousRequest {
2446
+ //
2447
+ allow?: boolean;
2448
+ //
2449
+ clan_id?: string;
2450
+ }
2451
+
2440
2452
  /** A user's session used to authenticate messages. */
2441
2453
  export interface ApiSession {
2442
2454
  //True if the corresponding account was just created, false otherwise.
@@ -11750,5 +11762,42 @@ export class MezonApi {
11750
11762
  ),
11751
11763
  ]);
11752
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
+
11753
11802
  }
11754
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
@@ -373,6 +373,8 @@ export interface ApiChannelAppResponse {
373
373
  clan_id?: string;
374
374
  id?: string;
375
375
  app_url?: string;
376
+ app_name?: string;
377
+ app_logo?: string;
376
378
  }
377
379
  /** */
378
380
  export interface ApiChannelAttachment {
@@ -1391,6 +1393,11 @@ export interface ApiSearchMessageResponse {
1391
1393
  messages?: Array<ApiSearchMessageDocument>;
1392
1394
  total?: number;
1393
1395
  }
1396
+ /** */
1397
+ export interface ApiConfigAllowAnonymousRequest {
1398
+ allow?: boolean;
1399
+ clan_id?: string;
1400
+ }
1394
1401
  /** A user's session used to authenticate messages. */
1395
1402
  export interface ApiSession {
1396
1403
  created?: boolean;
@@ -2402,4 +2409,6 @@ export declare class MezonApi {
2402
2409
  updateUsername(bearerToken: string, body: ApiUpdateUsernameRequest, options?: any): Promise<ApiSession>;
2403
2410
  /** Ban a set of users from a channel. */
2404
2411
  isBanned(bearerToken: string, channelId: string, options?: any): Promise<ApiIsBannedResponse>;
2412
+ /** */
2413
+ configAllowAnonymous(bearerToken: string, body: ApiConfigAllowAnonymousRequest, options?: any): Promise<any>;
2405
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
@@ -491,6 +491,10 @@ export interface MeetParticipantEvent {
491
491
  clan_id: string;
492
492
  action: number;
493
493
  }
494
+ export interface AllowAnonymousEvent {
495
+ clan_id: string;
496
+ allow: boolean;
497
+ }
494
498
  /** Stream identifier */
495
499
  export interface StreamId {
496
500
  /** The type of stream (e.g. chat). */
@@ -1041,6 +1045,7 @@ export interface Socket {
1041
1045
  onroleassign: (role_assign_event: RoleAssignedEvent) => void;
1042
1046
  ondeleteaccount: (delete_account_event: DeleteAccountEvent) => void;
1043
1047
  onmeetparticipantevent: (event: MeetParticipantEvent) => void;
1048
+ onallowanonymousevent: (event: AllowAnonymousEvent) => void;
1044
1049
  onstreamingchannelstarted: (streaming_started_event: StreamingStartedEvent) => void;
1045
1050
  onstreamingchannelended: (streaming_ended_event: StreamingEndedEvent) => void;
1046
1051
  onstreamingchanneljoined: (streaming_joined_event: StreamingJoinedEvent) => void;
@@ -1156,6 +1161,7 @@ export declare class DefaultSocket implements Socket {
1156
1161
  ontransferownership(event: TransferOwnershipEvent): void;
1157
1162
  onbanneduser(event: BannedUserEvent): void;
1158
1163
  onmeetparticipantevent(event: MeetParticipantEvent): void;
1164
+ onallowanonymousevent(event: AllowAnonymousEvent): void;
1159
1165
  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
1166
  followUsers(userIds: string[]): Promise<Status>;
1161
1167
  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.54",
3
+ "version": "2.13.56",
4
4
  "scripts": {
5
5
  "build": "npx tsc && npx rollup -c --bundleConfigAsCjs && node build.mjs"
6
6
  },
package/socket.ts CHANGED
@@ -790,6 +790,11 @@ export interface MeetParticipantEvent {
790
790
  action: number;
791
791
  }
792
792
 
793
+ export interface AllowAnonymousEvent {
794
+ clan_id: string;
795
+ allow: boolean;
796
+ }
797
+
793
798
  /** Stream identifier */
794
799
  export interface StreamId {
795
800
  /** The type of stream (e.g. chat). */
@@ -1797,6 +1802,8 @@ export interface Socket {
1797
1802
 
1798
1803
  onmeetparticipantevent: (event: MeetParticipantEvent) => void;
1799
1804
 
1805
+ onallowanonymousevent: (event: AllowAnonymousEvent) => void;
1806
+
1800
1807
  onstreamingchannelstarted: (
1801
1808
  streaming_started_event: StreamingStartedEvent
1802
1809
  ) => void;
@@ -2093,6 +2100,8 @@ export class DefaultSocket implements Socket {
2093
2100
  this.ontransferownership(<TransferOwnershipEvent>message.transfer_ownership_event);
2094
2101
  } else if (message.ban_user_event) {
2095
2102
  this.onbanneduser(<BannedUserEvent>message.ban_user_event);
2103
+ } else if (message.allow_anonymous_event) {
2104
+ this.onallowanonymousevent(<AllowAnonymousEvent>message.allow_anonymous_event);
2096
2105
  } else {
2097
2106
  if (this.verbose && window && window.console) {
2098
2107
  console.log("Unrecognized message received: %o", message);
@@ -2568,6 +2577,12 @@ export class DefaultSocket implements Socket {
2568
2577
  }
2569
2578
  }
2570
2579
 
2580
+ onallowanonymousevent(event: AllowAnonymousEvent) {
2581
+ if (this.verbose && window && window.console) {
2582
+ console.log(event);
2583
+ }
2584
+ }
2585
+
2571
2586
  send(
2572
2587
  message:
2573
2588
  | ChannelJoin