mezon-js 2.9.4 → 2.9.5

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
@@ -5637,41 +5637,6 @@ export class MezonApi {
5637
5637
  ]);
5638
5638
  }
5639
5639
 
5640
- /** */
5641
- getPermissionOfUserInTheClan(bearerToken: string,
5642
- clanId:string,
5643
- options: any = {}): Promise<ApiPermissionList> {
5644
-
5645
- if (clanId === null || clanId === undefined) {
5646
- throw new Error("'clanId' is a required parameter but is null or undefined.");
5647
- }
5648
- const urlPath = "/v2/permissionuserinclan/{clanId}"
5649
- .replace("{clanId}", encodeURIComponent(String(clanId)));
5650
- const queryParams = new Map<string, any>();
5651
-
5652
- let bodyJson : string = "";
5653
-
5654
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
5655
- const fetchOptions = buildFetchOptions("GET", options, bodyJson);
5656
- if (bearerToken) {
5657
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
5658
- }
5659
-
5660
- return Promise.race([
5661
- fetch(fullUrl, fetchOptions).then((response) => {
5662
- if (response.status == 204) {
5663
- return response;
5664
- } else if (response.status >= 200 && response.status < 300) {
5665
- return response.json();
5666
- } else {
5667
- throw response;
5668
- }
5669
- }),
5670
- new Promise((_, reject) =>
5671
- setTimeout(reject, this.timeoutMs, "Request timed out.")
5672
- ),
5673
- ]);
5674
- }
5675
5640
 
5676
5641
  /** */
5677
5642
  deletePinMessage(bearerToken: string,
@@ -6121,6 +6086,44 @@ export class MezonApi {
6121
6086
  ]);
6122
6087
  }
6123
6088
 
6089
+ /** */
6090
+ getRoleOfUserInTheClan(bearerToken: string,
6091
+ clanId:string,
6092
+ channelId?:string,
6093
+ options: any = {}): Promise<ApiRoleList> {
6094
+
6095
+ if (clanId === null || clanId === undefined) {
6096
+ throw new Error("'clanId' is a required parameter but is null or undefined.");
6097
+ }
6098
+ const urlPath = "/v2/roleuserinclan/{clanId}"
6099
+ .replace("{clanId}", encodeURIComponent(String(clanId)));
6100
+ const queryParams = new Map<string, any>();
6101
+ queryParams.set("channel_id", channelId);
6102
+
6103
+ let bodyJson : string = "";
6104
+
6105
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
6106
+ const fetchOptions = buildFetchOptions("GET", options, bodyJson);
6107
+ if (bearerToken) {
6108
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
6109
+ }
6110
+
6111
+ return Promise.race([
6112
+ fetch(fullUrl, fetchOptions).then((response) => {
6113
+ if (response.status == 204) {
6114
+ return response;
6115
+ } else if (response.status >= 200 && response.status < 300) {
6116
+ return response.json();
6117
+ } else {
6118
+ throw response;
6119
+ }
6120
+ }),
6121
+ new Promise((_, reject) =>
6122
+ setTimeout(reject, this.timeoutMs, "Request timed out.")
6123
+ ),
6124
+ ]);
6125
+ }
6126
+
6124
6127
  /** Execute a Lua function on the server. */
6125
6128
  rpcFunc2(bearerToken: string,basicAuthUsername: string,
6126
6129
  basicAuthPassword: string,
package/client.ts CHANGED
@@ -106,6 +106,7 @@ import {
106
106
  ApiStreamingChannelUserList,
107
107
  ApiRegisterStreamingChannelRequest,
108
108
  ApiRegisterStreamingChannelResponse,
109
+ ApiRoleList,
109
110
  } from "./api.gen";
110
111
 
111
112
  import { Session } from "./session";
@@ -2700,10 +2701,10 @@ export class Client {
2700
2701
  }
2701
2702
 
2702
2703
  /** Get permission of user in the clan */
2703
- async getPermissionOfUserInTheClan(
2704
+ async GetRoleOfUserInTheClan(
2704
2705
  session: Session,
2705
2706
  clanId: string
2706
- ): Promise<ApiPermissionList> {
2707
+ ): Promise<ApiRoleList> {
2707
2708
  if (
2708
2709
  this.autoRefreshSession &&
2709
2710
  session.refresh_token &&
@@ -2713,8 +2714,8 @@ export class Client {
2713
2714
  }
2714
2715
 
2715
2716
  return this.apiClient
2716
- .getPermissionOfUserInTheClan(session.token, clanId)
2717
- .then((response: ApiPermissionList) => {
2717
+ .getRoleOfUserInTheClan(session.token, clanId)
2718
+ .then((response: ApiRoleList) => {
2718
2719
  return Promise.resolve(response);
2719
2720
  });
2720
2721
  }
package/dist/api.gen.d.ts CHANGED
@@ -1258,8 +1258,6 @@ export declare class MezonApi {
1258
1258
  /** Get permission list */
1259
1259
  getListPermission(bearerToken: string, options?: any): Promise<ApiPermissionList>;
1260
1260
  /** */
1261
- getPermissionOfUserInTheClan(bearerToken: string, clanId: string, options?: any): Promise<ApiPermissionList>;
1262
- /** */
1263
1261
  deletePinMessage(bearerToken: string, messageId?: string, options?: any): Promise<any>;
1264
1262
  /** */
1265
1263
  getPinMessagesList(bearerToken: string, channelId?: string, options?: any): Promise<ApiPinMessagesList>;
@@ -1283,6 +1281,8 @@ export declare class MezonApi {
1283
1281
  listRolePermissions(bearerToken: string, roleId: string, options?: any): Promise<ApiPermissionList>;
1284
1282
  /** List role permissions */
1285
1283
  listRoleUsers(bearerToken: string, roleId: string, limit?: number, cursor?: string, options?: any): Promise<ApiRoleUserList>;
1284
+ /** */
1285
+ getRoleOfUserInTheClan(bearerToken: string, clanId: string, channelId?: string, options?: any): Promise<ApiRoleList>;
1286
1286
  /** Execute a Lua function on the server. */
1287
1287
  rpcFunc2(bearerToken: string, basicAuthUsername: string, basicAuthPassword: string, id: string, payload?: string, httpKey?: string, options?: any): Promise<ApiRpc>;
1288
1288
  /** Execute a Lua function on the server. */
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, ApiAccountCustom, ApiAccountDevice, ApiAccountEmail, ApiAccountFacebook, ApiAccountFacebookInstantGame, ApiAccountGoogle, ApiAccountGameCenter, ApiAccountSteam, ApiChannelDescList, ApiChannelDescription, ApiCreateChannelDescRequest, ApiDeleteRoleRequest, ApiClanDescList, ApiCreateClanDescRequest, ApiClanDesc, ApiCategoryDesc, ApiCategoryDescList, ApiPermissionList, ApiRoleUserList, ApiRole, ApiCreateRoleRequest, ApiAddRoleChannelDescRequest, ApiCreateCategoryDescRequest, ApiUpdateCategoryDescRequest, ApiEvent, ApiUpdateAccountRequest, ApiAccountApple, ApiLinkSteamRequest, ApiClanDescProfile, ApiClanProfile, ApiChannelUserList, ApiClanUserList, ApiLinkInviteUserRequest, ApiUpdateEventRequest, 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 } from "./api.gen";
16
+ import { ApiAccount, ApiAccountCustom, ApiAccountDevice, ApiAccountEmail, ApiAccountFacebook, ApiAccountFacebookInstantGame, ApiAccountGoogle, ApiAccountGameCenter, ApiAccountSteam, ApiChannelDescList, ApiChannelDescription, ApiCreateChannelDescRequest, ApiDeleteRoleRequest, ApiClanDescList, ApiCreateClanDescRequest, ApiClanDesc, ApiCategoryDesc, ApiCategoryDescList, ApiPermissionList, ApiRoleUserList, ApiRole, ApiCreateRoleRequest, ApiAddRoleChannelDescRequest, ApiCreateCategoryDescRequest, ApiUpdateCategoryDescRequest, ApiEvent, ApiUpdateAccountRequest, ApiAccountApple, ApiLinkSteamRequest, ApiClanDescProfile, ApiClanProfile, ApiChannelUserList, ApiClanUserList, ApiLinkInviteUserRequest, ApiUpdateEventRequest, 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 } from "./api.gen";
17
17
  import { Session } from "./session";
18
18
  import { Socket } from "./socket";
19
19
  import { WebSocketAdapter } from "./web_socket_adapter";
@@ -500,7 +500,7 @@ export declare class Client {
500
500
  /** Get link invite user */
501
501
  getLinkInvite(session: Session, inviteId: string): Promise<ApiInviteUserRes>;
502
502
  /** Get permission of user in the clan */
503
- getPermissionOfUserInTheClan(session: Session, clanId: string): Promise<ApiPermissionList>;
503
+ GetRoleOfUserInTheClan(session: Session, clanId: string): Promise<ApiRoleList>;
504
504
  /** invite user */
505
505
  inviteUser(session: Session, inviteId: string): Promise<ApiInviteUserRes>;
506
506
  /** Set default notification clan*/
@@ -3681,34 +3681,6 @@ var MezonApi = class {
3681
3681
  ]);
3682
3682
  }
3683
3683
  /** */
3684
- getPermissionOfUserInTheClan(bearerToken, clanId, options = {}) {
3685
- if (clanId === null || clanId === void 0) {
3686
- throw new Error("'clanId' is a required parameter but is null or undefined.");
3687
- }
3688
- const urlPath = "/v2/permissionuserinclan/{clanId}".replace("{clanId}", encodeURIComponent(String(clanId)));
3689
- const queryParams = /* @__PURE__ */ new Map();
3690
- let bodyJson = "";
3691
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
3692
- const fetchOptions = buildFetchOptions("GET", options, bodyJson);
3693
- if (bearerToken) {
3694
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
3695
- }
3696
- return Promise.race([
3697
- fetch(fullUrl, fetchOptions).then((response) => {
3698
- if (response.status == 204) {
3699
- return response;
3700
- } else if (response.status >= 200 && response.status < 300) {
3701
- return response.json();
3702
- } else {
3703
- throw response;
3704
- }
3705
- }),
3706
- new Promise(
3707
- (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
3708
- )
3709
- ]);
3710
- }
3711
- /** */
3712
3684
  deletePinMessage(bearerToken, messageId, options = {}) {
3713
3685
  const urlPath = "/v2/pinmessage/delete";
3714
3686
  const queryParams = /* @__PURE__ */ new Map();
@@ -4060,6 +4032,35 @@ var MezonApi = class {
4060
4032
  )
4061
4033
  ]);
4062
4034
  }
4035
+ /** */
4036
+ getRoleOfUserInTheClan(bearerToken, clanId, channelId, options = {}) {
4037
+ if (clanId === null || clanId === void 0) {
4038
+ throw new Error("'clanId' is a required parameter but is null or undefined.");
4039
+ }
4040
+ const urlPath = "/v2/roleuserinclan/{clanId}".replace("{clanId}", encodeURIComponent(String(clanId)));
4041
+ const queryParams = /* @__PURE__ */ new Map();
4042
+ queryParams.set("channel_id", channelId);
4043
+ let bodyJson = "";
4044
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
4045
+ const fetchOptions = buildFetchOptions("GET", options, bodyJson);
4046
+ if (bearerToken) {
4047
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
4048
+ }
4049
+ return Promise.race([
4050
+ fetch(fullUrl, fetchOptions).then((response) => {
4051
+ if (response.status == 204) {
4052
+ return response;
4053
+ } else if (response.status >= 200 && response.status < 300) {
4054
+ return response.json();
4055
+ } else {
4056
+ throw response;
4057
+ }
4058
+ }),
4059
+ new Promise(
4060
+ (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
4061
+ )
4062
+ ]);
4063
+ }
4063
4064
  /** Execute a Lua function on the server. */
4064
4065
  rpcFunc2(bearerToken, basicAuthUsername, basicAuthPassword, id, payload, httpKey, options = {}) {
4065
4066
  if (id === null || id === void 0) {
@@ -7015,12 +7016,12 @@ var Client = class {
7015
7016
  });
7016
7017
  }
7017
7018
  /** Get permission of user in the clan */
7018
- getPermissionOfUserInTheClan(session, clanId) {
7019
+ GetRoleOfUserInTheClan(session, clanId) {
7019
7020
  return __async(this, null, function* () {
7020
7021
  if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
7021
7022
  yield this.sessionRefresh(session);
7022
7023
  }
7023
- return this.apiClient.getPermissionOfUserInTheClan(session.token, clanId).then((response) => {
7024
+ return this.apiClient.getRoleOfUserInTheClan(session.token, clanId).then((response) => {
7024
7025
  return Promise.resolve(response);
7025
7026
  });
7026
7027
  });
@@ -3652,34 +3652,6 @@ var MezonApi = class {
3652
3652
  ]);
3653
3653
  }
3654
3654
  /** */
3655
- getPermissionOfUserInTheClan(bearerToken, clanId, options = {}) {
3656
- if (clanId === null || clanId === void 0) {
3657
- throw new Error("'clanId' is a required parameter but is null or undefined.");
3658
- }
3659
- const urlPath = "/v2/permissionuserinclan/{clanId}".replace("{clanId}", encodeURIComponent(String(clanId)));
3660
- const queryParams = /* @__PURE__ */ new Map();
3661
- let bodyJson = "";
3662
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
3663
- const fetchOptions = buildFetchOptions("GET", options, bodyJson);
3664
- if (bearerToken) {
3665
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
3666
- }
3667
- return Promise.race([
3668
- fetch(fullUrl, fetchOptions).then((response) => {
3669
- if (response.status == 204) {
3670
- return response;
3671
- } else if (response.status >= 200 && response.status < 300) {
3672
- return response.json();
3673
- } else {
3674
- throw response;
3675
- }
3676
- }),
3677
- new Promise(
3678
- (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
3679
- )
3680
- ]);
3681
- }
3682
- /** */
3683
3655
  deletePinMessage(bearerToken, messageId, options = {}) {
3684
3656
  const urlPath = "/v2/pinmessage/delete";
3685
3657
  const queryParams = /* @__PURE__ */ new Map();
@@ -4031,6 +4003,35 @@ var MezonApi = class {
4031
4003
  )
4032
4004
  ]);
4033
4005
  }
4006
+ /** */
4007
+ getRoleOfUserInTheClan(bearerToken, clanId, channelId, options = {}) {
4008
+ if (clanId === null || clanId === void 0) {
4009
+ throw new Error("'clanId' is a required parameter but is null or undefined.");
4010
+ }
4011
+ const urlPath = "/v2/roleuserinclan/{clanId}".replace("{clanId}", encodeURIComponent(String(clanId)));
4012
+ const queryParams = /* @__PURE__ */ new Map();
4013
+ queryParams.set("channel_id", channelId);
4014
+ let bodyJson = "";
4015
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
4016
+ const fetchOptions = buildFetchOptions("GET", options, bodyJson);
4017
+ if (bearerToken) {
4018
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
4019
+ }
4020
+ return Promise.race([
4021
+ fetch(fullUrl, fetchOptions).then((response) => {
4022
+ if (response.status == 204) {
4023
+ return response;
4024
+ } else if (response.status >= 200 && response.status < 300) {
4025
+ return response.json();
4026
+ } else {
4027
+ throw response;
4028
+ }
4029
+ }),
4030
+ new Promise(
4031
+ (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
4032
+ )
4033
+ ]);
4034
+ }
4034
4035
  /** Execute a Lua function on the server. */
4035
4036
  rpcFunc2(bearerToken, basicAuthUsername, basicAuthPassword, id, payload, httpKey, options = {}) {
4036
4037
  if (id === null || id === void 0) {
@@ -6986,12 +6987,12 @@ var Client = class {
6986
6987
  });
6987
6988
  }
6988
6989
  /** Get permission of user in the clan */
6989
- getPermissionOfUserInTheClan(session, clanId) {
6990
+ GetRoleOfUserInTheClan(session, clanId) {
6990
6991
  return __async(this, null, function* () {
6991
6992
  if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
6992
6993
  yield this.sessionRefresh(session);
6993
6994
  }
6994
- return this.apiClient.getPermissionOfUserInTheClan(session.token, clanId).then((response) => {
6995
+ return this.apiClient.getRoleOfUserInTheClan(session.token, clanId).then((response) => {
6995
6996
  return Promise.resolve(response);
6996
6997
  });
6997
6998
  });
package/dist/socket.d.ts CHANGED
@@ -560,6 +560,7 @@ export interface NotificationChannelCategorySetting {
560
560
  channel_category_label: string;
561
561
  notification_setting_type: number;
562
562
  channel_category_title: string;
563
+ action: number;
563
564
  }
564
565
  export interface NotificationChannelCategorySettingEvent {
565
566
  clan_id?: string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mezon-js",
3
3
 
4
- "version": "2.9.4",
4
+ "version": "2.9.5",
5
5
 
6
6
  "scripts": {
7
7
  "build": "npx tsc && npx rollup -c --bundleConfigAsCjs && node build.mjs"
package/socket.ts CHANGED
@@ -842,6 +842,8 @@ export interface NotificationChannelCategorySetting {
842
842
  notification_setting_type :number;
843
843
  //
844
844
  channel_category_title : string;
845
+ //
846
+ action: number
845
847
  }
846
848
 
847
849
  export interface NotificationChannelCategorySettingEvent {