mezon-js 2.8.39 → 2.8.41

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
@@ -165,6 +165,8 @@ export interface MezonUpdateRoleBody {
165
165
  //
166
166
  allow_mention?: number;
167
167
  //
168
+ clan_id?: string;
169
+ //
168
170
  color?: string;
169
171
  //
170
172
  description?: string;
@@ -183,7 +185,7 @@ export interface MezonUpdateRoleBody {
183
185
  /** Delete a role the user has access to. */
184
186
  export interface MezonUpdateRoleDeleteBody {
185
187
  //
186
- channel_id?: string;
188
+ clan_id?: string;
187
189
  }
188
190
 
189
191
  /** */
@@ -788,6 +790,8 @@ export interface ApiDeleteEventRequest {
788
790
  export interface ApiDeleteRoleRequest {
789
791
  //
790
792
  channel_id?: string;
793
+ //
794
+ clan_id?: string;
791
795
  //The id of a role.
792
796
  role_id?: string;
793
797
  }
@@ -1167,20 +1171,6 @@ export interface ApiPermissionList {
1167
1171
  permissions?: Array<ApiPermission>;
1168
1172
  }
1169
1173
 
1170
- /** */
1171
- export interface ApiPermissionRoleChannel {
1172
- //
1173
- active?: boolean;
1174
- //
1175
- permission_id?: string;
1176
- }
1177
-
1178
- /** A list of permission role channel. */
1179
- export interface ApiPermissionRoleChannelList {
1180
- //A list of permission.
1181
- permission_role_channel?: Array<ApiPermissionRoleChannel>;
1182
- }
1183
-
1184
1174
  /** */
1185
1175
  export interface ApiPermissionUpdate {
1186
1176
  //
@@ -5302,41 +5292,6 @@ export class MezonApi {
5302
5292
  ]);
5303
5293
  }
5304
5294
 
5305
- /** List permission role channel */
5306
- getListPermissionRoleChannel(bearerToken: string,
5307
- roleId?:string,
5308
- channelId?:string,
5309
- options: any = {}): Promise<ApiPermissionRoleChannelList> {
5310
-
5311
- const urlPath = "/v2/permissionrolechannel/get";
5312
- const queryParams = new Map<string, any>();
5313
- queryParams.set("role_id", roleId);
5314
- queryParams.set("channel_id", channelId);
5315
-
5316
- let bodyJson : string = "";
5317
-
5318
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
5319
- const fetchOptions = buildFetchOptions("GET", options, bodyJson);
5320
- if (bearerToken) {
5321
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
5322
- }
5323
-
5324
- return Promise.race([
5325
- fetch(fullUrl, fetchOptions).then((response) => {
5326
- if (response.status == 204) {
5327
- return response;
5328
- } else if (response.status >= 200 && response.status < 300) {
5329
- return response.json();
5330
- } else {
5331
- throw response;
5332
- }
5333
- }),
5334
- new Promise((_, reject) =>
5335
- setTimeout(reject, this.timeoutMs, "Request timed out.")
5336
- ),
5337
- ]);
5338
- }
5339
-
5340
5295
  /** set permission role channel. */
5341
5296
  setRoleChannelPermission(bearerToken: string,
5342
5297
  body:ApiUpdateRoleChannelRequest,
@@ -5812,7 +5767,7 @@ export class MezonApi {
5812
5767
  /** Update fields in a given role. */
5813
5768
  updateRole(bearerToken: string,
5814
5769
  roleId:string,
5815
- body:{},
5770
+ body:MezonUpdateRoleBody,
5816
5771
  options: any = {}): Promise<any> {
5817
5772
 
5818
5773
  if (roleId === null || roleId === undefined) {
package/client.ts CHANGED
@@ -93,11 +93,11 @@ import {
93
93
  ApiClanStickerAddRequest,
94
94
  MezonUpdateClanStickerByIdBody,
95
95
  MezonChangeChannelCategoryBody,
96
- ApiPermissionRoleChannelList,
97
96
  ApiUpdateRoleChannelRequest,
98
97
  ApiAddAppRequest,
99
98
  ApiAppList,
100
99
  ApiApp,
100
+ MezonUpdateRoleDeleteBody,
101
101
  } from "./api.gen";
102
102
 
103
103
  import { Session } from "./session";
@@ -193,6 +193,8 @@ export interface ChannelMessage {
193
193
  mode?: number;
194
194
  //
195
195
  message_id?: string;
196
+ //
197
+ hideEditted?: boolean;
196
198
  }
197
199
 
198
200
  /** A list of channel messages, usually a result of a list operation. */
@@ -453,6 +455,8 @@ export interface ApiUpdateRoleRequest {
453
455
  remove_user_ids: string[];
454
456
  /** The permissions to remove. */
455
457
  remove_permission_ids: string[];
458
+ //
459
+ clan_id: string
456
460
  }
457
461
 
458
462
  /** A client for Mezon server. */
@@ -1310,7 +1314,7 @@ export class Client {
1310
1314
  }
1311
1315
 
1312
1316
  /** Update action role when delete role */
1313
- async updateRoleDelete(session: Session, roleId:string, request:{}): Promise<boolean> {
1317
+ async updateRoleDelete(session: Session, roleId:string, request:MezonUpdateRoleDeleteBody): Promise<boolean> {
1314
1318
  if (this.autoRefreshSession && session.refresh_token &&
1315
1319
  session.isexpired((Date.now() + this.expiredTimespanMs)/1000)) {
1316
1320
  await this.sessionRefresh(session);
@@ -2212,18 +2216,6 @@ async changeChannelCategory(session: Session, id: string, request: MezonChangeCh
2212
2216
  })
2213
2217
  }
2214
2218
 
2215
- /** */
2216
- async getListPermissionRoleChannel(session: Session, roleId: string, channelId: string): Promise<ApiPermissionRoleChannelList> {
2217
- if (this.autoRefreshSession && session.refresh_token &&
2218
- session.isexpired((Date.now() + this.expiredTimespanMs)/1000)) {
2219
- await this.sessionRefresh(session);
2220
- }
2221
-
2222
- return this.apiClient.getListPermissionRoleChannel(session.token, roleId, channelId).then((response: ApiPermissionRoleChannelList) => {
2223
- return Promise.resolve(response);
2224
- });
2225
- }
2226
-
2227
2219
  /** */
2228
2220
  async setRoleChannelPermission(session: Session, request: ApiUpdateRoleChannelRequest): Promise<boolean> {
2229
2221
  if (this.autoRefreshSession && session.refresh_token &&
package/dist/api.gen.d.ts CHANGED
@@ -94,6 +94,7 @@ export interface MezonUpdateRoleBody {
94
94
  active_permission_ids?: Array<string>;
95
95
  add_user_ids?: Array<string>;
96
96
  allow_mention?: number;
97
+ clan_id?: string;
97
98
  color?: string;
98
99
  description?: string;
99
100
  display_online?: number;
@@ -104,7 +105,7 @@ export interface MezonUpdateRoleBody {
104
105
  }
105
106
  /** Delete a role the user has access to. */
106
107
  export interface MezonUpdateRoleDeleteBody {
107
- channel_id?: string;
108
+ clan_id?: string;
108
109
  }
109
110
  /** */
110
111
  export interface MezonUpdateUserProfileByClanBody {
@@ -452,6 +453,7 @@ export interface ApiDeleteEventRequest {
452
453
  /** Delete a role the user has access to. */
453
454
  export interface ApiDeleteRoleRequest {
454
455
  channel_id?: string;
456
+ clan_id?: string;
455
457
  role_id?: string;
456
458
  }
457
459
  /** Storage objects to delete. */
@@ -678,15 +680,6 @@ export interface ApiPermissionList {
678
680
  permissions?: Array<ApiPermission>;
679
681
  }
680
682
  /** */
681
- export interface ApiPermissionRoleChannel {
682
- active?: boolean;
683
- permission_id?: string;
684
- }
685
- /** A list of permission role channel. */
686
- export interface ApiPermissionRoleChannelList {
687
- permission_role_channel?: Array<ApiPermissionRoleChannel>;
688
- }
689
- /** */
690
683
  export interface ApiPermissionUpdate {
691
684
  permission_id?: string;
692
685
  type?: number;
@@ -1186,8 +1179,6 @@ export declare class MezonApi {
1186
1179
  deleteNotiReactMessage(bearerToken: string, channelId?: string, options?: any): Promise<any>;
1187
1180
  /** */
1188
1181
  setNotificationReactMessage(bearerToken: string, body: ApiNotificationChannel, options?: any): Promise<any>;
1189
- /** List permission role channel */
1190
- getListPermissionRoleChannel(bearerToken: string, roleId?: string, channelId?: string, options?: any): Promise<ApiPermissionRoleChannelList>;
1191
1182
  /** set permission role channel. */
1192
1183
  setRoleChannelPermission(bearerToken: string, body: ApiUpdateRoleChannelRequest, options?: any): Promise<any>;
1193
1184
  /** Get permission list */
@@ -1215,7 +1206,7 @@ export declare class MezonApi {
1215
1206
  /** Delete a role by ID. */
1216
1207
  deleteRole(bearerToken: string, roleId: string, channelId?: string, options?: any): Promise<any>;
1217
1208
  /** Update fields in a given role. */
1218
- updateRole(bearerToken: string, roleId: string, body: {}, options?: any): Promise<any>;
1209
+ updateRole(bearerToken: string, roleId: string, body: MezonUpdateRoleBody, options?: any): Promise<any>;
1219
1210
  /** List role permissions */
1220
1211
  listRolePermissions(bearerToken: string, roleId: string, options?: any): Promise<ApiPermissionList>;
1221
1212
  /** List role permissions */