mezon-js 2.13.31 → 2.13.33

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
@@ -43,7 +43,7 @@ export interface ApiBannedUser {
43
43
  }
44
44
 
45
45
  /** */
46
- export interface ApibannedUserList {
46
+ export interface ApiBannedUserList {
47
47
  //
48
48
  banned_users?: Array<ApiBannedUser>;
49
49
  }
@@ -2291,12 +2291,7 @@ export interface ApiRole {
2291
2291
 
2292
2292
  /** A list of role description, usually a result of a list operation. */
2293
2293
  export interface ApiRoleList {
2294
- //Cacheable cursor to list newer role description. Durable and designed to be stored, unlike next/prev cursors.
2295
- cacheable_cursor?: string;
2296
- //The cursor to send when retrieving the next page, if any.
2297
- next_cursor?: string;
2298
- //The cursor to send when retrieving the previous page, if any.
2299
- prev_cursor?: string;
2294
+ max_level_permission?: number;
2300
2295
  //A list of role.
2301
2296
  roles?: Array<ApiRole>;
2302
2297
  }
@@ -5787,10 +5782,14 @@ export class MezonApi {
5787
5782
 
5788
5783
  /** List banned user */
5789
5784
  listBannedUsers(bearerToken: string,
5790
- options: any = {}): Promise<ApibannedUserList> {
5785
+ clanId?:string,
5786
+ channelId?:string,
5787
+ options: any = {}): Promise<ApiBannedUserList> {
5791
5788
 
5792
5789
  const urlPath = "/v2/banned";
5793
5790
  const queryParams = new Map<string, any>();
5791
+ queryParams.set("clan_id", clanId);
5792
+ queryParams.set("channel_id", channelId);
5794
5793
 
5795
5794
  let bodyJson : string = "";
5796
5795
 
@@ -11376,44 +11375,44 @@ export class MezonApi {
11376
11375
  }
11377
11376
 
11378
11377
  /** */
11379
- deleteQuickMenuAccess(bearerToken: string,
11380
- id?:string,
11381
- botId?:string,
11382
- menuName?:string,
11383
- background?:string,
11384
- actionMsg?:string,
11385
- options: any = {}): Promise<any> {
11386
-
11387
- const urlPath = "/v2/quickmenuaccess";
11388
- const queryParams = new Map<string, any>();
11389
- queryParams.set("id", id);
11390
- queryParams.set("bot_id", botId);
11391
- queryParams.set("menu_name", menuName);
11392
- queryParams.set("background", background);
11393
- queryParams.set("action_msg", actionMsg);
11394
-
11395
- let bodyJson : string = "";
11396
-
11397
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
11398
- const fetchOptions = buildFetchOptions("DELETE", options, bodyJson);
11399
- if (bearerToken) {
11400
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
11401
- }
11402
-
11403
- return Promise.race([
11404
- fetch(fullUrl, fetchOptions).then((response) => {
11405
- if (response.status == 204) {
11406
- return response;
11407
- } else if (response.status >= 200 && response.status < 300) {
11408
- return response.json();
11409
- } else {
11410
- throw response;
11411
- }
11412
- }),
11413
- new Promise((_, reject) =>
11414
- setTimeout(reject, this.timeoutMs, "Request timed out.")
11415
- ),
11416
- ]);
11378
+ deleteQuickMenuAccess(bearerToken: string,
11379
+ id?:string,
11380
+ botId?:string,
11381
+ menuName?:string,
11382
+ background?:string,
11383
+ actionMsg?:string,
11384
+ options: any = {}): Promise<any> {
11385
+
11386
+ const urlPath = "/v2/quickmenuaccess";
11387
+ const queryParams = new Map<string, any>();
11388
+ queryParams.set("id", id);
11389
+ queryParams.set("bot_id", botId);
11390
+ queryParams.set("menu_name", menuName);
11391
+ queryParams.set("background", background);
11392
+ queryParams.set("action_msg", actionMsg);
11393
+
11394
+ let bodyJson : string = "";
11395
+
11396
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
11397
+ const fetchOptions = buildFetchOptions("DELETE", options, bodyJson);
11398
+ if (bearerToken) {
11399
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
11400
+ }
11401
+
11402
+ return Promise.race([
11403
+ fetch(fullUrl, fetchOptions).then((response) => {
11404
+ if (response.status == 204) {
11405
+ return response;
11406
+ } else if (response.status >= 200 && response.status < 300) {
11407
+ return response.json();
11408
+ } else {
11409
+ throw response;
11410
+ }
11411
+ }),
11412
+ new Promise((_, reject) =>
11413
+ setTimeout(reject, this.timeoutMs, "Request timed out.")
11414
+ ),
11415
+ ]);
11417
11416
  }
11418
11417
 
11419
11418
  /** */
package/client.ts CHANGED
@@ -179,7 +179,7 @@ import {
179
179
  ApiListClanUnreadMsgIndicatorResponse,
180
180
  ApiAddFriendsResponse,
181
181
  ApiUpdateUsernameRequest,
182
- ApibannedUserList,
182
+ ApiBannedUserList,
183
183
  } from "./api.gen";
184
184
 
185
185
  import { Session } from "./session";
@@ -1130,8 +1130,10 @@ export class Client {
1130
1130
  }
1131
1131
 
1132
1132
  async listBannedUsers(
1133
- session: Session
1134
- ): Promise<ApibannedUserList> {
1133
+ session: Session,
1134
+ clanId?:string,
1135
+ channelId?:string,
1136
+ ): Promise<ApiBannedUserList> {
1135
1137
  if (
1136
1138
  this.autoRefreshSession &&
1137
1139
  session.refresh_token &&
@@ -1142,9 +1144,11 @@ export class Client {
1142
1144
 
1143
1145
  return this.apiClient
1144
1146
  .listBannedUsers(
1145
- session.token
1147
+ session.token,
1148
+ clanId,
1149
+ channelId,
1146
1150
  )
1147
- .then((response: ApibannedUserList) => {
1151
+ .then((response: ApiBannedUserList) => {
1148
1152
  return Promise.resolve(response);
1149
1153
  });
1150
1154
  }
package/dist/api.gen.d.ts CHANGED
@@ -20,7 +20,7 @@ export interface ApiBannedUser {
20
20
  reason?: string;
21
21
  }
22
22
  /** */
23
- export interface ApibannedUserList {
23
+ export interface ApiBannedUserList {
24
24
  banned_users?: Array<ApiBannedUser>;
25
25
  }
26
26
  /** A single user-role pair. */
@@ -1310,9 +1310,7 @@ export interface ApiRole {
1310
1310
  }
1311
1311
  /** A list of role description, usually a result of a list operation. */
1312
1312
  export interface ApiRoleList {
1313
- cacheable_cursor?: string;
1314
- next_cursor?: string;
1315
- prev_cursor?: string;
1313
+ max_level_permission?: number;
1316
1314
  roles?: Array<ApiRole>;
1317
1315
  }
1318
1316
  /** */
@@ -2096,7 +2094,7 @@ export declare class MezonApi {
2096
2094
  /** Kick a set of users from a clan. */
2097
2095
  removeClanUsers(bearerToken: string, clanId: string, userIds?: Array<string>, options?: any): Promise<any>;
2098
2096
  /** List banned user */
2099
- listBannedUsers(bearerToken: string, options?: any): Promise<ApibannedUserList>;
2097
+ listBannedUsers(bearerToken: string, clanId?: string, channelId?: string, options?: any): Promise<ApiBannedUserList>;
2100
2098
  /** Ban a set of users from a channel. */
2101
2099
  unbanClanUsers(bearerToken: string, clanId: string, channelId?: string, userIds?: Array<string>, banTime?: number, options?: any): Promise<any>;
2102
2100
  /** Ban a set of users from a channel. */
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, ApiStoreWalletKeyRequest, ApiLinkAccountConfirmRequest, ApiLinkAccountMezon, ApiUser, ApiFriend, ApiListClanUnreadMsgIndicatorResponse, ApiAddFriendsResponse, ApiUpdateUsernameRequest, ApibannedUserList } 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, ApiStoreWalletKeyRequest, ApiLinkAccountConfirmRequest, ApiLinkAccountMezon, ApiUser, ApiFriend, ApiListClanUnreadMsgIndicatorResponse, ApiAddFriendsResponse, ApiUpdateUsernameRequest, ApiBannedUserList } from "./api.gen";
17
17
  import { Session } from "./session";
18
18
  import { Socket } from "./socket";
19
19
  import { WebSocketAdapter } from "./web_socket_adapter";
@@ -300,7 +300,7 @@ export declare class Client {
300
300
  getAccount(session: Session): Promise<ApiAccount>;
301
301
  /** Kick a set of users from a clan. */
302
302
  removeClanUsers(session: Session, clanId: string, ids?: Array<string>): Promise<boolean>;
303
- listBannedUsers(session: Session): Promise<ApibannedUserList>;
303
+ listBannedUsers(session: Session, clanId?: string, channelId?: string): Promise<ApiBannedUserList>;
304
304
  /** Ban a set of users from a clan. */
305
305
  unbanClanUsers(session: Session, clanId: string, channelId?: string, userIds?: Array<string>): Promise<boolean>;
306
306
  /** Ban a set of users from a clan. */
@@ -2550,9 +2550,11 @@ var MezonApi = class {
2550
2550
  ]);
2551
2551
  }
2552
2552
  /** List banned user */
2553
- listBannedUsers(bearerToken, options = {}) {
2553
+ listBannedUsers(bearerToken, clanId, channelId, options = {}) {
2554
2554
  const urlPath = "/v2/banned";
2555
2555
  const queryParams = /* @__PURE__ */ new Map();
2556
+ queryParams.set("clan_id", clanId);
2557
+ queryParams.set("channel_id", channelId);
2556
2558
  let bodyJson = "";
2557
2559
  const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
2558
2560
  const fetchOptions = buildFetchOptions("GET", options, bodyJson);
@@ -8903,13 +8905,15 @@ var Client = class {
8903
8905
  });
8904
8906
  });
8905
8907
  }
8906
- listBannedUsers(session) {
8908
+ listBannedUsers(session, clanId, channelId) {
8907
8909
  return __async(this, null, function* () {
8908
8910
  if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
8909
8911
  yield this.sessionRefresh(session);
8910
8912
  }
8911
8913
  return this.apiClient.listBannedUsers(
8912
- session.token
8914
+ session.token,
8915
+ clanId,
8916
+ channelId
8913
8917
  ).then((response) => {
8914
8918
  return Promise.resolve(response);
8915
8919
  });
@@ -2516,9 +2516,11 @@ var MezonApi = class {
2516
2516
  ]);
2517
2517
  }
2518
2518
  /** List banned user */
2519
- listBannedUsers(bearerToken, options = {}) {
2519
+ listBannedUsers(bearerToken, clanId, channelId, options = {}) {
2520
2520
  const urlPath = "/v2/banned";
2521
2521
  const queryParams = /* @__PURE__ */ new Map();
2522
+ queryParams.set("clan_id", clanId);
2523
+ queryParams.set("channel_id", channelId);
2522
2524
  let bodyJson = "";
2523
2525
  const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
2524
2526
  const fetchOptions = buildFetchOptions("GET", options, bodyJson);
@@ -8869,13 +8871,15 @@ var Client = class {
8869
8871
  });
8870
8872
  });
8871
8873
  }
8872
- listBannedUsers(session) {
8874
+ listBannedUsers(session, clanId, channelId) {
8873
8875
  return __async(this, null, function* () {
8874
8876
  if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
8875
8877
  yield this.sessionRefresh(session);
8876
8878
  }
8877
8879
  return this.apiClient.listBannedUsers(
8878
- session.token
8880
+ session.token,
8881
+ clanId,
8882
+ channelId
8879
8883
  ).then((response) => {
8880
8884
  return Promise.resolve(response);
8881
8885
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mezon-js",
3
- "version": "2.13.31",
3
+ "version": "2.13.33",
4
4
  "scripts": {
5
5
  "build": "npx tsc && npx rollup -c --bundleConfigAsCjs && node build.mjs"
6
6
  },