mezon-js 2.11.21 → 2.11.23

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
@@ -1217,6 +1217,8 @@ export interface ApiCreateRoleRequest {
1217
1217
  role_icon?: string;
1218
1218
  //
1219
1219
  title?: string;
1220
+ //
1221
+ order_role?: number;
1220
1222
  }
1221
1223
 
1222
1224
  /** Delete a channel the user has access to. */
@@ -2095,6 +2097,22 @@ export interface ApiRegistrationEmailRequest {
2095
2097
  vars?: Record<string, string>;
2096
2098
  }
2097
2099
 
2100
+ /** */
2101
+ export interface ApiUpdateRoleOrderRequest {
2102
+ //
2103
+ clan_id?: string;
2104
+ //
2105
+ roles?: Array<ApiRoleOrderUpdate>;
2106
+ }
2107
+
2108
+ /** */
2109
+ export interface ApiRoleOrderUpdate {
2110
+ //
2111
+ order?: number;
2112
+ //
2113
+ role_id?: string;
2114
+ }
2115
+
2098
2116
  /** */
2099
2117
  export interface ApiRole {
2100
2118
  //
@@ -2129,6 +2147,8 @@ export interface ApiRole {
2129
2147
  slug?: string;
2130
2148
  //
2131
2149
  title?: string;
2150
+ //
2151
+ order_role ?: number;
2132
2152
  }
2133
2153
 
2134
2154
  /** A list of role description, usually a result of a list operation. */
@@ -11431,4 +11451,40 @@ export class MezonApi {
11431
11451
  ),
11432
11452
  ]);
11433
11453
  }
11454
+
11455
+ /** */
11456
+ updateRoleOrder(bearerToken: string,
11457
+ body:ApiUpdateRoleOrderRequest,
11458
+ options: any = {}): Promise<any> {
11459
+
11460
+ if (body === null || body === undefined) {
11461
+ throw new Error("'body' is a required parameter but is null or undefined.");
11462
+ }
11463
+ const urlPath = "/v2/role/orders";
11464
+ const queryParams = new Map<string, any>();
11465
+
11466
+ let bodyJson : string = "";
11467
+ bodyJson = JSON.stringify(body || {});
11468
+
11469
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
11470
+ const fetchOptions = buildFetchOptions("PUT", options, bodyJson);
11471
+ if (bearerToken) {
11472
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
11473
+ }
11474
+
11475
+ return Promise.race([
11476
+ fetch(fullUrl, fetchOptions).then((response) => {
11477
+ if (response.status == 204) {
11478
+ return response;
11479
+ } else if (response.status >= 200 && response.status < 300) {
11480
+ return response.json();
11481
+ } else {
11482
+ throw response;
11483
+ }
11484
+ }),
11485
+ new Promise((_, reject) =>
11486
+ setTimeout(reject, this.timeoutMs, "Request timed out.")
11487
+ ),
11488
+ ]);
11489
+ }
11434
11490
  }
package/client.ts CHANGED
@@ -166,6 +166,7 @@ import {
166
166
  ApiCreateHashChannelAppsResponse,
167
167
  MezonapiEmojiRecentList,
168
168
  ApiUserEventRequest,
169
+ ApiUpdateRoleOrderRequest,
169
170
  } from "./api.gen";
170
171
 
171
172
  import { Session } from "./session";
@@ -5137,4 +5138,41 @@ export class Client {
5137
5138
  return response !== undefined;
5138
5139
  });
5139
5140
  }
5141
+
5142
+ async updateRoleOrder(
5143
+ session: Session,
5144
+ request: ApiUpdateRoleOrderRequest
5145
+ ): Promise<any> {
5146
+ if (
5147
+ this.autoRefreshSession &&
5148
+ session.refresh_token &&
5149
+ session.isexpired(Date.now() / 1000)
5150
+ ) {
5151
+ await this.sessionRefresh(session);
5152
+ }
5153
+
5154
+ return this.apiClient
5155
+ .updateRoleOrder(session.token, request)
5156
+ .then((response: any) => {
5157
+ return Promise.resolve(response);
5158
+ });
5159
+ }
5160
+
5161
+ async deleteAccount(
5162
+ session: Session
5163
+ ): Promise<any> {
5164
+ if (
5165
+ this.autoRefreshSession &&
5166
+ session.refresh_token &&
5167
+ session.isexpired(Date.now() / 1000)
5168
+ ) {
5169
+ await this.sessionRefresh(session);
5170
+ }
5171
+
5172
+ return this.apiClient
5173
+ .deleteAccount(session.token)
5174
+ .then((response: ApiMezonOauthClientList) => {
5175
+ return Promise.resolve(response);
5176
+ });
5177
+ }
5140
5178
  }
package/dist/api.gen.d.ts CHANGED
@@ -692,6 +692,7 @@ export interface ApiCreateRoleRequest {
692
692
  max_permission_id: string;
693
693
  role_icon?: string;
694
694
  title?: string;
695
+ order_role?: number;
695
696
  }
696
697
  /** Delete a channel the user has access to. */
697
698
  export interface ApiDeleteChannelDescRequest {
@@ -1205,6 +1206,16 @@ export interface ApiRegistrationEmailRequest {
1205
1206
  vars?: Record<string, string>;
1206
1207
  }
1207
1208
  /** */
1209
+ export interface ApiUpdateRoleOrderRequest {
1210
+ clan_id?: string;
1211
+ roles?: Array<ApiRoleOrderUpdate>;
1212
+ }
1213
+ /** */
1214
+ export interface ApiRoleOrderUpdate {
1215
+ order?: number;
1216
+ role_id?: string;
1217
+ }
1218
+ /** */
1208
1219
  export interface ApiRole {
1209
1220
  active?: number;
1210
1221
  allow_mention?: number;
@@ -1222,6 +1233,7 @@ export interface ApiRole {
1222
1233
  role_user_list?: ApiRoleUserList;
1223
1234
  slug?: string;
1224
1235
  title?: string;
1236
+ order_role?: number;
1225
1237
  }
1226
1238
  /** A list of role description, usually a result of a list operation. */
1227
1239
  export interface ApiRoleList {
@@ -2207,4 +2219,6 @@ export declare class MezonApi {
2207
2219
  addUserEvent(bearerToken: string, body: ApiUserEventRequest, options?: any): Promise<any>;
2208
2220
  /** Delete user event */
2209
2221
  deleteUserEvent(bearerToken: string, clanId?: string, eventId?: string, options?: any): Promise<any>;
2222
+ /** */
2223
+ updateRoleOrder(bearerToken: string, body: ApiUpdateRoleOrderRequest, options?: any): Promise<any>;
2210
2224
  }
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, ApiAccountDevice, ApiAccountEmail, ApiAccountFacebook, ApiAccountFacebookInstantGame, ApiAccountGoogle, ApiAccountGameCenter, ApiAccountSteam, ApiChannelDescList, ApiChannelDescription, ApiCreateChannelDescRequest, ApiDeleteRoleRequest, ApiClanDescList, ApiCreateClanDescRequest, ApiClanDesc, ApiCategoryDesc, ApiCategoryDescList, ApiPermissionList, ApiRoleUserList, ApiRole, ApiCreateRoleRequest, ApiAddRoleChannelDescRequest, ApiCreateCategoryDescRequest, ApiUpdateCategoryDescRequest, ApiEvent, ApiNotificationList, ApiUpdateAccountRequest, ApiSession, ApiAccountApple, ApiLinkSteamRequest, ApiClanDescProfile, ApiClanProfile, ApiChannelUserList, ApiClanUserList, ApiLinkInviteUserRequest, ApiLinkInviteUser, ApiInviteUserRes, ApiUploadAttachmentRequest, ApiUploadAttachment, ApiMessageReaction, ApiMessageMention, ApiMessageAttachment, ApiMessageRef, ApiChannelMessageHeader, ApiVoiceChannelUserList, ApiChannelAttachmentList, ApiCreateEventRequest, ApiEventManagement, ApiEventList, ApiDeleteEventRequest, ApiSetDefaultNotificationRequest, ApiSetNotificationRequest, ApiSetMuteNotificationRequest, 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, ApiWithdrawTokenRequest, 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, MezonapiEmojiRecentList, ApiUserEventRequest } from "./api.gen";
16
+ import { ApiAccount, ApiAccountMezon, ApiAccountDevice, ApiAccountEmail, ApiAccountFacebook, ApiAccountFacebookInstantGame, ApiAccountGoogle, ApiAccountGameCenter, ApiAccountSteam, ApiChannelDescList, ApiChannelDescription, ApiCreateChannelDescRequest, ApiDeleteRoleRequest, ApiClanDescList, ApiCreateClanDescRequest, ApiClanDesc, ApiCategoryDesc, ApiCategoryDescList, ApiPermissionList, ApiRoleUserList, ApiRole, ApiCreateRoleRequest, ApiAddRoleChannelDescRequest, ApiCreateCategoryDescRequest, ApiUpdateCategoryDescRequest, ApiEvent, ApiNotificationList, ApiUpdateAccountRequest, ApiSession, ApiAccountApple, ApiLinkSteamRequest, ApiClanDescProfile, ApiClanProfile, ApiChannelUserList, ApiClanUserList, ApiLinkInviteUserRequest, ApiLinkInviteUser, ApiInviteUserRes, ApiUploadAttachmentRequest, ApiUploadAttachment, ApiMessageReaction, ApiMessageMention, ApiMessageAttachment, ApiMessageRef, ApiChannelMessageHeader, ApiVoiceChannelUserList, ApiChannelAttachmentList, ApiCreateEventRequest, ApiEventManagement, ApiEventList, ApiDeleteEventRequest, ApiSetDefaultNotificationRequest, ApiSetNotificationRequest, ApiSetMuteNotificationRequest, 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, ApiWithdrawTokenRequest, 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, MezonapiEmojiRecentList, ApiUserEventRequest, ApiUpdateRoleOrderRequest } from "./api.gen";
17
17
  import { Session } from "./session";
18
18
  import { Socket } from "./socket";
19
19
  import { WebSocketAdapter } from "./web_socket_adapter";
@@ -653,4 +653,6 @@ export declare class Client {
653
653
  addUserEvent(session: Session, request: ApiUserEventRequest): Promise<any>;
654
654
  /** Delete user event */
655
655
  deleteUserEvent(session: Session, clanId?: string, eventId?: string): Promise<any>;
656
+ updateRoleOrder(session: Session, request: ApiUpdateRoleOrderRequest): Promise<any>;
657
+ deleteAccount(session: Session): Promise<any>;
656
658
  }
@@ -7224,6 +7224,35 @@ var MezonApi = class {
7224
7224
  )
7225
7225
  ]);
7226
7226
  }
7227
+ /** */
7228
+ updateRoleOrder(bearerToken, body, options = {}) {
7229
+ if (body === null || body === void 0) {
7230
+ throw new Error("'body' is a required parameter but is null or undefined.");
7231
+ }
7232
+ const urlPath = "/v2/role/orders";
7233
+ const queryParams = /* @__PURE__ */ new Map();
7234
+ let bodyJson = "";
7235
+ bodyJson = JSON.stringify(body || {});
7236
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
7237
+ const fetchOptions = buildFetchOptions("PUT", options, bodyJson);
7238
+ if (bearerToken) {
7239
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
7240
+ }
7241
+ return Promise.race([
7242
+ fetch(fullUrl, fetchOptions).then((response) => {
7243
+ if (response.status == 204) {
7244
+ return response;
7245
+ } else if (response.status >= 200 && response.status < 300) {
7246
+ return response.json();
7247
+ } else {
7248
+ throw response;
7249
+ }
7250
+ }),
7251
+ new Promise(
7252
+ (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
7253
+ )
7254
+ ]);
7255
+ }
7227
7256
  };
7228
7257
 
7229
7258
  // session.ts
@@ -7471,6 +7500,8 @@ var _DefaultSocket = class _DefaultSocket {
7471
7500
  this.onstickerdeleted(message.sticker_delete_event);
7472
7501
  } else if (message.channel_updated_event) {
7473
7502
  this.onchannelupdated(message.channel_updated_event);
7503
+ } else if (message.delete_account_event) {
7504
+ this.ondeleteaccount(message.delete_account_event);
7474
7505
  } else if (message.clan_profile_updated_event) {
7475
7506
  this.onclanprofileupdated(message.clan_profile_updated_event);
7476
7507
  } else if (message.clan_updated_event) {
@@ -7855,6 +7886,11 @@ var _DefaultSocket = class _DefaultSocket {
7855
7886
  console.log(channelUpdated);
7856
7887
  }
7857
7888
  }
7889
+ ondeleteaccount(deleteAccountEvent) {
7890
+ if (this.verbose && window && window.console) {
7891
+ console.log(deleteAccountEvent);
7892
+ }
7893
+ }
7858
7894
  onclanprofileupdated(clanprofile) {
7859
7895
  if (this.verbose && window && window.console) {
7860
7896
  console.log(clanprofile);
@@ -11133,4 +11169,24 @@ var Client = class {
11133
11169
  });
11134
11170
  });
11135
11171
  }
11172
+ updateRoleOrder(session, request) {
11173
+ return __async(this, null, function* () {
11174
+ if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
11175
+ yield this.sessionRefresh(session);
11176
+ }
11177
+ return this.apiClient.updateRoleOrder(session.token, request).then((response) => {
11178
+ return Promise.resolve(response);
11179
+ });
11180
+ });
11181
+ }
11182
+ deleteAccount(session) {
11183
+ return __async(this, null, function* () {
11184
+ if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
11185
+ yield this.sessionRefresh(session);
11186
+ }
11187
+ return this.apiClient.deleteAccount(session.token).then((response) => {
11188
+ return Promise.resolve(response);
11189
+ });
11190
+ });
11191
+ }
11136
11192
  };
@@ -7190,6 +7190,35 @@ var MezonApi = class {
7190
7190
  )
7191
7191
  ]);
7192
7192
  }
7193
+ /** */
7194
+ updateRoleOrder(bearerToken, body, options = {}) {
7195
+ if (body === null || body === void 0) {
7196
+ throw new Error("'body' is a required parameter but is null or undefined.");
7197
+ }
7198
+ const urlPath = "/v2/role/orders";
7199
+ const queryParams = /* @__PURE__ */ new Map();
7200
+ let bodyJson = "";
7201
+ bodyJson = JSON.stringify(body || {});
7202
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
7203
+ const fetchOptions = buildFetchOptions("PUT", options, bodyJson);
7204
+ if (bearerToken) {
7205
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
7206
+ }
7207
+ return Promise.race([
7208
+ fetch(fullUrl, fetchOptions).then((response) => {
7209
+ if (response.status == 204) {
7210
+ return response;
7211
+ } else if (response.status >= 200 && response.status < 300) {
7212
+ return response.json();
7213
+ } else {
7214
+ throw response;
7215
+ }
7216
+ }),
7217
+ new Promise(
7218
+ (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
7219
+ )
7220
+ ]);
7221
+ }
7193
7222
  };
7194
7223
 
7195
7224
  // session.ts
@@ -7437,6 +7466,8 @@ var _DefaultSocket = class _DefaultSocket {
7437
7466
  this.onstickerdeleted(message.sticker_delete_event);
7438
7467
  } else if (message.channel_updated_event) {
7439
7468
  this.onchannelupdated(message.channel_updated_event);
7469
+ } else if (message.delete_account_event) {
7470
+ this.ondeleteaccount(message.delete_account_event);
7440
7471
  } else if (message.clan_profile_updated_event) {
7441
7472
  this.onclanprofileupdated(message.clan_profile_updated_event);
7442
7473
  } else if (message.clan_updated_event) {
@@ -7821,6 +7852,11 @@ var _DefaultSocket = class _DefaultSocket {
7821
7852
  console.log(channelUpdated);
7822
7853
  }
7823
7854
  }
7855
+ ondeleteaccount(deleteAccountEvent) {
7856
+ if (this.verbose && window && window.console) {
7857
+ console.log(deleteAccountEvent);
7858
+ }
7859
+ }
7824
7860
  onclanprofileupdated(clanprofile) {
7825
7861
  if (this.verbose && window && window.console) {
7826
7862
  console.log(clanprofile);
@@ -11099,6 +11135,26 @@ var Client = class {
11099
11135
  });
11100
11136
  });
11101
11137
  }
11138
+ updateRoleOrder(session, request) {
11139
+ return __async(this, null, function* () {
11140
+ if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
11141
+ yield this.sessionRefresh(session);
11142
+ }
11143
+ return this.apiClient.updateRoleOrder(session.token, request).then((response) => {
11144
+ return Promise.resolve(response);
11145
+ });
11146
+ });
11147
+ }
11148
+ deleteAccount(session) {
11149
+ return __async(this, null, function* () {
11150
+ if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
11151
+ yield this.sessionRefresh(session);
11152
+ }
11153
+ return this.apiClient.deleteAccount(session.token).then((response) => {
11154
+ return Promise.resolve(response);
11155
+ });
11156
+ });
11157
+ }
11102
11158
  };
11103
11159
  export {
11104
11160
  ChannelStreamMode,
package/dist/socket.d.ts CHANGED
@@ -338,6 +338,9 @@ export interface ChannelUpdatedEvent {
338
338
  is_active_thread: boolean;
339
339
  active: number;
340
340
  }
341
+ export interface DeleteAccountEvent {
342
+ user_id: string;
343
+ }
341
344
  export interface ChannelCreatedEvent {
342
345
  clan_id: string;
343
346
  category_id: string;
@@ -859,6 +862,7 @@ export interface Socket {
859
862
  oneventnotiuserchannel: (noti_user_channel: ApiNotificationUserChannel) => void;
860
863
  oneventwebhook: (webhook_event: ApiWebhook) => void;
861
864
  onroleassign: (role_assign_event: RoleAssignedEvent) => void;
865
+ ondeleteaccount: (deleteAccountEvent: DeleteAccountEvent) => void;
862
866
  onstreamingchannelstarted: (streaming_started_event: StreamingStartedEvent) => void;
863
867
  onstreamingchannelended: (streaming_ended_event: StreamingEndedEvent) => void;
864
868
  onstreamingchanneljoined: (streaming_joined_event: StreamingJoinedEvent) => void;
@@ -933,6 +937,7 @@ export declare class DefaultSocket implements Socket {
933
937
  onstickerdeleted(stickerDeleted: StickerDeleteEvent): void;
934
938
  onstickerupdated(stickerUpdated: StickerUpdateEvent): void;
935
939
  onchannelupdated(channelUpdated: ChannelUpdatedEvent): void;
940
+ ondeleteaccount(deleteAccountEvent: DeleteAccountEvent): void;
936
941
  onclanprofileupdated(clanprofile: ClanProfileUpdatedEvent): void;
937
942
  onclanupdated(clan: ClanUpdatedEvent): void;
938
943
  onlastseenupdated(event: LastSeenMessageEvent): void;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mezon-js",
3
3
 
4
- "version": "2.11.21",
4
+ "version": "2.11.23",
5
5
 
6
6
  "scripts": {
7
7
  "build": "npx tsc && npx rollup -c --bundleConfigAsCjs && node build.mjs"
package/socket.ts CHANGED
@@ -500,6 +500,11 @@ export interface ChannelUpdatedEvent {
500
500
  active: number;
501
501
  }
502
502
 
503
+ export interface DeleteAccountEvent {
504
+ // user id
505
+ user_id: string;
506
+ }
507
+
503
508
  export interface ChannelCreatedEvent {
504
509
  // clan id
505
510
  clan_id: string;
@@ -1403,6 +1408,8 @@ export interface Socket {
1403
1408
 
1404
1409
  onroleassign: (role_assign_event: RoleAssignedEvent) => void;
1405
1410
 
1411
+ ondeleteaccount: (deleteAccountEvent: DeleteAccountEvent) => void;
1412
+
1406
1413
  onstreamingchannelstarted: (
1407
1414
  streaming_started_event: StreamingStartedEvent
1408
1415
  ) => void;
@@ -1554,6 +1561,8 @@ export class DefaultSocket implements Socket {
1554
1561
  this.onstickerdeleted(message.sticker_delete_event);
1555
1562
  } else if (message.channel_updated_event) {
1556
1563
  this.onchannelupdated(message.channel_updated_event);
1564
+ } else if (message.delete_account_event) {
1565
+ this.ondeleteaccount(message.delete_account_event);
1557
1566
  } else if (message.clan_profile_updated_event) {
1558
1567
  this.onclanprofileupdated(message.clan_profile_updated_event);
1559
1568
  } else if (message.clan_updated_event) {
@@ -1978,6 +1987,12 @@ export class DefaultSocket implements Socket {
1978
1987
  }
1979
1988
  }
1980
1989
 
1990
+ ondeleteaccount(deleteAccountEvent: DeleteAccountEvent) {
1991
+ if (this.verbose && window && window.console) {
1992
+ console.log(deleteAccountEvent);
1993
+ }
1994
+ }
1995
+
1981
1996
  onclanprofileupdated(clanprofile: ClanProfileUpdatedEvent) {
1982
1997
  if (this.verbose && window && window.console) {
1983
1998
  console.log(clanprofile);