mezon-js 2.9.56 → 2.9.58

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
@@ -4904,6 +4904,7 @@ export class MezonApi {
4904
4904
  type?:number,
4905
4905
  limit?:number,
4906
4906
  page?:number,
4907
+ channelLabel?:string,
4907
4908
  options: any = {}): Promise<ApiChannelSettingListResponse> {
4908
4909
 
4909
4910
  if (clanId === null || clanId === undefined) {
@@ -4920,6 +4921,7 @@ export class MezonApi {
4920
4921
  queryParams.set("type", type);
4921
4922
  queryParams.set("limit", limit);
4922
4923
  queryParams.set("page", page);
4924
+ queryParams.set("channel_label", channelLabel);
4923
4925
 
4924
4926
  let bodyJson : string = "";
4925
4927
 
package/client.ts CHANGED
@@ -1399,27 +1399,27 @@ export class Client {
1399
1399
  try {
1400
1400
  content = JSON.parse(m.content);
1401
1401
  } catch (e) {
1402
- //console.log("error parse content", e);
1402
+ console.log("error parse content", e);
1403
1403
  }
1404
1404
  try {
1405
1405
  reactions = JSON.parse(m.reactions || "[]");
1406
1406
  } catch (e) {
1407
- //console.log("error parse reactions", e);
1407
+ console.log("error parse reactions", e);
1408
1408
  }
1409
1409
  try {
1410
1410
  mentions = JSON.parse(m.mentions || "[]");
1411
1411
  } catch (e) {
1412
- //console.log("error parse mentions", e);
1412
+ console.log("error parse mentions", e);
1413
1413
  }
1414
1414
  try {
1415
1415
  attachments = JSON.parse(m.attachments || "[]");
1416
1416
  } catch (e) {
1417
- //console.log("error parse attachments", e);
1417
+ console.log("error parse attachments", e);
1418
1418
  }
1419
1419
  try {
1420
1420
  references = JSON.parse(m.references || "[]");
1421
1421
  } catch (e) {
1422
- //console.log("error parse references", e);
1422
+ console.log("error parse references", e);
1423
1423
  }
1424
1424
  result.messages!.push({
1425
1425
  channel_id: m.channel_id,
@@ -3997,7 +3997,8 @@ export class Client {
3997
3997
  status?: number,
3998
3998
  type?: number,
3999
3999
  limit?: number,
4000
- page?: number
4000
+ page?: number,
4001
+ channel_label?: string
4001
4002
  ): Promise<ApiChannelSettingListResponse> {
4002
4003
  if (
4003
4004
  this.autoRefreshSession &&
@@ -4018,7 +4019,8 @@ export class Client {
4018
4019
  status,
4019
4020
  type,
4020
4021
  limit,
4021
- page
4022
+ page,
4023
+ channel_label
4022
4024
  )
4023
4025
  .then((response: any) => {
4024
4026
  return Promise.resolve(response);
package/dist/api.gen.d.ts CHANGED
@@ -1485,7 +1485,7 @@ export declare class MezonApi {
1485
1485
  /** Update fields in a given channel. */
1486
1486
  updateChannelDesc(bearerToken: string, channelId: string, body: {}, options?: any): Promise<any>;
1487
1487
  /** List channel setting */
1488
- listChannelSetting(bearerToken: string, clanId: string, parentId?: string, categoryId?: string, privateChannel?: number, active?: number, status?: number, type?: number, limit?: number, page?: number, options?: any): Promise<ApiChannelSettingListResponse>;
1488
+ listChannelSetting(bearerToken: string, clanId: string, parentId?: string, categoryId?: string, privateChannel?: number, active?: number, status?: number, type?: number, limit?: number, page?: number, channelLabel?: string, options?: any): Promise<ApiChannelSettingListResponse>;
1489
1489
  /** List all users that are part of a channel. */
1490
1490
  listChannelVoiceUsers(bearerToken: string, clanId?: string, channelId?: string, channelType?: number, limit?: number, state?: number, cursor?: string, options?: any): Promise<ApiVoiceChannelUserList>;
1491
1491
  /** List clans */
package/dist/client.d.ts CHANGED
@@ -583,7 +583,7 @@ export declare class Client {
583
583
  /** List Threads. */
584
584
  listThreadDescs(session: Session, channelId: string, limit?: number, state?: number, clanId?: string, threadId?: string): Promise<ApiChannelDescList>;
585
585
  leaveThread(session: Session, channelId: string): Promise<any>;
586
- getChannelSettingInClan(session: Session, clanId: string, parentId?: string, categoryId?: string, privateChannel?: number, active?: number, status?: number, type?: number, limit?: number, page?: number): Promise<ApiChannelSettingListResponse>;
586
+ getChannelSettingInClan(session: Session, clanId: string, parentId?: string, categoryId?: string, privateChannel?: number, active?: number, status?: number, type?: number, limit?: number, page?: number, channel_label?: string): Promise<ApiChannelSettingListResponse>;
587
587
  getChannelCanvasList(session: Session, channelId: string, clanId?: string, limit?: number, page?: number): Promise<any>;
588
588
  getChannelCanvasDetail(session: Session, id: string, clanId?: string, channelId?: string): Promise<any>;
589
589
  editChannelCanvases(session: Session, request: ApiEditChannelCanvasRequest): Promise<any>;
@@ -2694,7 +2694,7 @@ var MezonApi = class {
2694
2694
  ]);
2695
2695
  }
2696
2696
  /** List channel setting */
2697
- listChannelSetting(bearerToken, clanId, parentId, categoryId, privateChannel, active, status, type, limit, page, options = {}) {
2697
+ listChannelSetting(bearerToken, clanId, parentId, categoryId, privateChannel, active, status, type, limit, page, channelLabel, options = {}) {
2698
2698
  if (clanId === null || clanId === void 0) {
2699
2699
  throw new Error("'clanId' is a required parameter but is null or undefined.");
2700
2700
  }
@@ -2708,6 +2708,7 @@ var MezonApi = class {
2708
2708
  queryParams.set("type", type);
2709
2709
  queryParams.set("limit", limit);
2710
2710
  queryParams.set("page", page);
2711
+ queryParams.set("channel_label", channelLabel);
2711
2712
  let bodyJson = "";
2712
2713
  const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
2713
2714
  const fetchOptions = buildFetchOptions("GET", options, bodyJson);
@@ -6292,22 +6293,27 @@ var _DefaultSocket = class _DefaultSocket {
6292
6293
  try {
6293
6294
  content = JSON.parse(message.channel_message.content);
6294
6295
  } catch (e2) {
6296
+ console.log("content is invalid", e2);
6295
6297
  }
6296
6298
  try {
6297
6299
  reactions = JSON.parse(message.channel_message.reactions);
6298
6300
  } catch (e2) {
6301
+ console.log("reactions is invalid", e2);
6299
6302
  }
6300
6303
  try {
6301
6304
  mentions = JSON.parse(message.channel_message.mentions);
6302
6305
  } catch (e2) {
6306
+ console.log("mentions is invalid", e2);
6303
6307
  }
6304
6308
  try {
6305
6309
  attachments = JSON.parse(message.channel_message.attachments);
6306
6310
  } catch (e2) {
6311
+ console.log("attachments is invalid", e2);
6307
6312
  }
6308
6313
  try {
6309
6314
  references = JSON.parse(message.channel_message.references);
6310
6315
  } catch (e2) {
6316
+ console.log("references is invalid", e2);
6311
6317
  }
6312
6318
  var e = {
6313
6319
  id: message.id || message.channel_message.message_id,
@@ -7397,22 +7403,27 @@ var Client = class {
7397
7403
  try {
7398
7404
  content = JSON.parse(m.content);
7399
7405
  } catch (e) {
7406
+ console.log("error parse content", e);
7400
7407
  }
7401
7408
  try {
7402
7409
  reactions = JSON.parse(m.reactions || "[]");
7403
7410
  } catch (e) {
7411
+ console.log("error parse reactions", e);
7404
7412
  }
7405
7413
  try {
7406
7414
  mentions = JSON.parse(m.mentions || "[]");
7407
7415
  } catch (e) {
7416
+ console.log("error parse mentions", e);
7408
7417
  }
7409
7418
  try {
7410
7419
  attachments = JSON.parse(m.attachments || "[]");
7411
7420
  } catch (e) {
7421
+ console.log("error parse attachments", e);
7412
7422
  }
7413
7423
  try {
7414
7424
  references = JSON.parse(m.references || "[]");
7415
7425
  } catch (e) {
7426
+ console.log("error parse references", e);
7416
7427
  }
7417
7428
  result.messages.push({
7418
7429
  channel_id: m.channel_id,
@@ -8928,7 +8939,7 @@ var Client = class {
8928
8939
  });
8929
8940
  });
8930
8941
  }
8931
- getChannelSettingInClan(session, clanId, parentId, categoryId, privateChannel, active, status, type, limit, page) {
8942
+ getChannelSettingInClan(session, clanId, parentId, categoryId, privateChannel, active, status, type, limit, page, channel_label) {
8932
8943
  return __async(this, null, function* () {
8933
8944
  if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
8934
8945
  yield this.sessionRefresh(session);
@@ -8943,7 +8954,8 @@ var Client = class {
8943
8954
  status,
8944
8955
  type,
8945
8956
  limit,
8946
- page
8957
+ page,
8958
+ channel_label
8947
8959
  ).then((response) => {
8948
8960
  return Promise.resolve(response);
8949
8961
  });
@@ -2665,7 +2665,7 @@ var MezonApi = class {
2665
2665
  ]);
2666
2666
  }
2667
2667
  /** List channel setting */
2668
- listChannelSetting(bearerToken, clanId, parentId, categoryId, privateChannel, active, status, type, limit, page, options = {}) {
2668
+ listChannelSetting(bearerToken, clanId, parentId, categoryId, privateChannel, active, status, type, limit, page, channelLabel, options = {}) {
2669
2669
  if (clanId === null || clanId === void 0) {
2670
2670
  throw new Error("'clanId' is a required parameter but is null or undefined.");
2671
2671
  }
@@ -2679,6 +2679,7 @@ var MezonApi = class {
2679
2679
  queryParams.set("type", type);
2680
2680
  queryParams.set("limit", limit);
2681
2681
  queryParams.set("page", page);
2682
+ queryParams.set("channel_label", channelLabel);
2682
2683
  let bodyJson = "";
2683
2684
  const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
2684
2685
  const fetchOptions = buildFetchOptions("GET", options, bodyJson);
@@ -6263,22 +6264,27 @@ var _DefaultSocket = class _DefaultSocket {
6263
6264
  try {
6264
6265
  content = JSON.parse(message.channel_message.content);
6265
6266
  } catch (e2) {
6267
+ console.log("content is invalid", e2);
6266
6268
  }
6267
6269
  try {
6268
6270
  reactions = JSON.parse(message.channel_message.reactions);
6269
6271
  } catch (e2) {
6272
+ console.log("reactions is invalid", e2);
6270
6273
  }
6271
6274
  try {
6272
6275
  mentions = JSON.parse(message.channel_message.mentions);
6273
6276
  } catch (e2) {
6277
+ console.log("mentions is invalid", e2);
6274
6278
  }
6275
6279
  try {
6276
6280
  attachments = JSON.parse(message.channel_message.attachments);
6277
6281
  } catch (e2) {
6282
+ console.log("attachments is invalid", e2);
6278
6283
  }
6279
6284
  try {
6280
6285
  references = JSON.parse(message.channel_message.references);
6281
6286
  } catch (e2) {
6287
+ console.log("references is invalid", e2);
6282
6288
  }
6283
6289
  var e = {
6284
6290
  id: message.id || message.channel_message.message_id,
@@ -7368,22 +7374,27 @@ var Client = class {
7368
7374
  try {
7369
7375
  content = JSON.parse(m.content);
7370
7376
  } catch (e) {
7377
+ console.log("error parse content", e);
7371
7378
  }
7372
7379
  try {
7373
7380
  reactions = JSON.parse(m.reactions || "[]");
7374
7381
  } catch (e) {
7382
+ console.log("error parse reactions", e);
7375
7383
  }
7376
7384
  try {
7377
7385
  mentions = JSON.parse(m.mentions || "[]");
7378
7386
  } catch (e) {
7387
+ console.log("error parse mentions", e);
7379
7388
  }
7380
7389
  try {
7381
7390
  attachments = JSON.parse(m.attachments || "[]");
7382
7391
  } catch (e) {
7392
+ console.log("error parse attachments", e);
7383
7393
  }
7384
7394
  try {
7385
7395
  references = JSON.parse(m.references || "[]");
7386
7396
  } catch (e) {
7397
+ console.log("error parse references", e);
7387
7398
  }
7388
7399
  result.messages.push({
7389
7400
  channel_id: m.channel_id,
@@ -8899,7 +8910,7 @@ var Client = class {
8899
8910
  });
8900
8911
  });
8901
8912
  }
8902
- getChannelSettingInClan(session, clanId, parentId, categoryId, privateChannel, active, status, type, limit, page) {
8913
+ getChannelSettingInClan(session, clanId, parentId, categoryId, privateChannel, active, status, type, limit, page, channel_label) {
8903
8914
  return __async(this, null, function* () {
8904
8915
  if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
8905
8916
  yield this.sessionRefresh(session);
@@ -8914,7 +8925,8 @@ var Client = class {
8914
8925
  status,
8915
8926
  type,
8916
8927
  limit,
8917
- page
8928
+ page,
8929
+ channel_label
8918
8930
  ).then((response) => {
8919
8931
  return Promise.resolve(response);
8920
8932
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mezon-js",
3
3
 
4
- "version": "2.9.56",
4
+ "version": "2.9.58",
5
5
 
6
6
  "scripts": {
7
7
  "build": "npx tsc && npx rollup -c --bundleConfigAsCjs && node build.mjs"
package/socket.ts CHANGED
@@ -1104,27 +1104,27 @@ export class DefaultSocket implements Socket {
1104
1104
  try {
1105
1105
  content = JSON.parse(message.channel_message.content);
1106
1106
  } catch(e) {
1107
- //console.log("content is invalid", e)
1107
+ console.log("content is invalid", e)
1108
1108
  }
1109
1109
  try {
1110
1110
  reactions = JSON.parse(message.channel_message.reactions);
1111
1111
  } catch(e) {
1112
- //console.log("reactions is invalid", e)
1112
+ console.log("reactions is invalid", e)
1113
1113
  }
1114
1114
  try {
1115
1115
  mentions = JSON.parse(message.channel_message.mentions);
1116
1116
  } catch(e) {
1117
- //console.log("mentions is invalid", e)
1117
+ console.log("mentions is invalid", e)
1118
1118
  }
1119
1119
  try {
1120
1120
  attachments = JSON.parse(message.channel_message.attachments);
1121
1121
  } catch(e) {
1122
- //console.log("attachments is invalid", e)
1122
+ console.log("attachments is invalid", e)
1123
1123
  }
1124
1124
  try {
1125
1125
  references = JSON.parse(message.channel_message.references);
1126
1126
  } catch(e) {
1127
- //console.log("references is invalid", e);
1127
+ console.log("references is invalid", e);
1128
1128
  }
1129
1129
  var e: ChannelMessage = {
1130
1130
  id: message.id || message.channel_message.message_id,