mezon-js 2.13.30 → 2.13.32

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
  }
@@ -5787,10 +5787,14 @@ export class MezonApi {
5787
5787
 
5788
5788
  /** List banned user */
5789
5789
  listBannedUsers(bearerToken: string,
5790
- options: any = {}): Promise<ApibannedUserList> {
5790
+ clanId?:string,
5791
+ channelId?:string,
5792
+ options: any = {}): Promise<ApiBannedUserList> {
5791
5793
 
5792
5794
  const urlPath = "/v2/banned";
5793
5795
  const queryParams = new Map<string, any>();
5796
+ queryParams.set("clan_id", clanId);
5797
+ queryParams.set("channel_id", channelId);
5794
5798
 
5795
5799
  let bodyJson : string = "";
5796
5800
 
@@ -7439,7 +7443,7 @@ export class MezonApi {
7439
7443
  "'body' is a required parameter but is null or undefined."
7440
7444
  );
7441
7445
  }
7442
- const urlPath = "/v2/mutecategory/set";
7446
+ const urlPath = "/v2/mutenotificationcategory/set";
7443
7447
  const queryParams = new Map<string, any>();
7444
7448
 
7445
7449
  let bodyJson: string = "";
@@ -7478,7 +7482,7 @@ export class MezonApi {
7478
7482
  "'body' is a required parameter but is null or undefined."
7479
7483
  );
7480
7484
  }
7481
- const urlPath = "/v2/mutechannel/set";
7485
+ const urlPath = "/v2/mutenotificationchannel/set";
7482
7486
  const queryParams = new Map<string, any>();
7483
7487
 
7484
7488
  let bodyJson: string = "";
@@ -11376,44 +11380,44 @@ export class MezonApi {
11376
11380
  }
11377
11381
 
11378
11382
  /** */
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
- ]);
11383
+ deleteQuickMenuAccess(bearerToken: string,
11384
+ id?:string,
11385
+ botId?:string,
11386
+ menuName?:string,
11387
+ background?:string,
11388
+ actionMsg?:string,
11389
+ options: any = {}): Promise<any> {
11390
+
11391
+ const urlPath = "/v2/quickmenuaccess";
11392
+ const queryParams = new Map<string, any>();
11393
+ queryParams.set("id", id);
11394
+ queryParams.set("bot_id", botId);
11395
+ queryParams.set("menu_name", menuName);
11396
+ queryParams.set("background", background);
11397
+ queryParams.set("action_msg", actionMsg);
11398
+
11399
+ let bodyJson : string = "";
11400
+
11401
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
11402
+ const fetchOptions = buildFetchOptions("DELETE", options, bodyJson);
11403
+ if (bearerToken) {
11404
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
11405
+ }
11406
+
11407
+ return Promise.race([
11408
+ fetch(fullUrl, fetchOptions).then((response) => {
11409
+ if (response.status == 204) {
11410
+ return response;
11411
+ } else if (response.status >= 200 && response.status < 300) {
11412
+ return response.json();
11413
+ } else {
11414
+ throw response;
11415
+ }
11416
+ }),
11417
+ new Promise((_, reject) =>
11418
+ setTimeout(reject, this.timeoutMs, "Request timed out.")
11419
+ ),
11420
+ ]);
11417
11421
  }
11418
11422
 
11419
11423
  /** */
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. */
@@ -2096,7 +2096,7 @@ export declare class MezonApi {
2096
2096
  /** Kick a set of users from a clan. */
2097
2097
  removeClanUsers(bearerToken: string, clanId: string, userIds?: Array<string>, options?: any): Promise<any>;
2098
2098
  /** List banned user */
2099
- listBannedUsers(bearerToken: string, options?: any): Promise<ApibannedUserList>;
2099
+ listBannedUsers(bearerToken: string, clanId?: string, channelId?: string, options?: any): Promise<ApiBannedUserList>;
2100
2100
  /** Ban a set of users from a channel. */
2101
2101
  unbanClanUsers(bearerToken: string, clanId: string, channelId?: string, userIds?: Array<string>, banTime?: number, options?: any): Promise<any>;
2102
2102
  /** 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);
@@ -3838,7 +3840,7 @@ var MezonApi = class {
3838
3840
  "'body' is a required parameter but is null or undefined."
3839
3841
  );
3840
3842
  }
3841
- const urlPath = "/v2/mutecategory/set";
3843
+ const urlPath = "/v2/mutenotificationcategory/set";
3842
3844
  const queryParams = /* @__PURE__ */ new Map();
3843
3845
  let bodyJson = "";
3844
3846
  bodyJson = JSON.stringify(body || {});
@@ -3869,7 +3871,7 @@ var MezonApi = class {
3869
3871
  "'body' is a required parameter but is null or undefined."
3870
3872
  );
3871
3873
  }
3872
- const urlPath = "/v2/mutechannel/set";
3874
+ const urlPath = "/v2/mutenotificationchannel/set";
3873
3875
  const queryParams = /* @__PURE__ */ new Map();
3874
3876
  let bodyJson = "";
3875
3877
  bodyJson = JSON.stringify(body || {});
@@ -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);
@@ -3804,7 +3806,7 @@ var MezonApi = class {
3804
3806
  "'body' is a required parameter but is null or undefined."
3805
3807
  );
3806
3808
  }
3807
- const urlPath = "/v2/mutecategory/set";
3809
+ const urlPath = "/v2/mutenotificationcategory/set";
3808
3810
  const queryParams = /* @__PURE__ */ new Map();
3809
3811
  let bodyJson = "";
3810
3812
  bodyJson = JSON.stringify(body || {});
@@ -3835,7 +3837,7 @@ var MezonApi = class {
3835
3837
  "'body' is a required parameter but is null or undefined."
3836
3838
  );
3837
3839
  }
3838
- const urlPath = "/v2/mutechannel/set";
3840
+ const urlPath = "/v2/mutenotificationchannel/set";
3839
3841
  const queryParams = /* @__PURE__ */ new Map();
3840
3842
  let bodyJson = "";
3841
3843
  bodyJson = JSON.stringify(body || {});
@@ -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.30",
3
+ "version": "2.13.32",
4
4
  "scripts": {
5
5
  "build": "npx tsc && npx rollup -c --bundleConfigAsCjs && node build.mjs"
6
6
  },