mezon-js 2.13.19 → 2.13.21

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/client.ts CHANGED
@@ -1445,9 +1445,8 @@ export class Client {
1445
1445
  timezone: gu.user!.timezone,
1446
1446
  update_time: gu.user!.update_time,
1447
1447
  username: gu.user!.username,
1448
- user_status: gu.user!.user_status
1449
- ? safeJSONParse(gu.user!.user_status!)
1450
- : undefined,
1448
+ user_status: gu.user!.user_status,
1449
+ status: gu.user!.status
1451
1450
  },
1452
1451
  role_id: gu!.role_id,
1453
1452
  clan_nick: gu!.clan_nick,
@@ -1458,6 +1457,28 @@ export class Client {
1458
1457
  });
1459
1458
  }
1460
1459
 
1460
+ async listChannelDetail(
1461
+ session: Session,
1462
+ channelId: string
1463
+ ): Promise<ApiChannelDescription> {
1464
+ if (
1465
+ this.autoRefreshSession &&
1466
+ session.refresh_token &&
1467
+ session.isexpired(Date.now() / 1000)
1468
+ ) {
1469
+ await this.sessionRefresh(session);
1470
+ }
1471
+
1472
+ return this.apiClient
1473
+ .listChannelDetail(
1474
+ session.token,
1475
+ channelId
1476
+ )
1477
+ .then((response: ApiChannelDescription) => {
1478
+ return Promise.resolve(response);
1479
+ });
1480
+ }
1481
+
1461
1482
  /** List channels. */
1462
1483
  async listChannelDescs(
1463
1484
  session: Session,
package/dist/client.d.ts CHANGED
@@ -312,6 +312,7 @@ export declare class Client {
312
312
  listChannelAttachments(session: Session, clanId: string, channelId: string, fileType: string, state?: number, limit?: number, before?: number, after?: number): Promise<ApiChannelAttachmentList>;
313
313
  /** List a channel's users. */
314
314
  listClanUsers(session: Session, clanId: string): Promise<ApiClanUserList>;
315
+ listChannelDetail(session: Session, channelId: string): Promise<ApiChannelDescription>;
315
316
  /** List channels. */
316
317
  listChannelDescs(session: Session, limit?: number, state?: number, cursor?: string, clanId?: string, channelType?: number, isMobile?: boolean): Promise<ApiChannelDescList>;
317
318
  /** List clans */
@@ -9014,7 +9014,8 @@ var Client = class {
9014
9014
  timezone: gu.user.timezone,
9015
9015
  update_time: gu.user.update_time,
9016
9016
  username: gu.user.username,
9017
- user_status: gu.user.user_status ? safeJSONParse(gu.user.user_status) : void 0
9017
+ user_status: gu.user.user_status,
9018
+ status: gu.user.status
9018
9019
  },
9019
9020
  role_id: gu.role_id,
9020
9021
  clan_nick: gu.clan_nick,
@@ -9025,6 +9026,19 @@ var Client = class {
9025
9026
  });
9026
9027
  });
9027
9028
  }
9029
+ listChannelDetail(session, channelId) {
9030
+ return __async(this, null, function* () {
9031
+ if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
9032
+ yield this.sessionRefresh(session);
9033
+ }
9034
+ return this.apiClient.listChannelDetail(
9035
+ session.token,
9036
+ channelId
9037
+ ).then((response) => {
9038
+ return Promise.resolve(response);
9039
+ });
9040
+ });
9041
+ }
9028
9042
  /** List channels. */
9029
9043
  listChannelDescs(session, limit, state, cursor, clanId, channelType, isMobile) {
9030
9044
  return __async(this, null, function* () {
@@ -8980,7 +8980,8 @@ var Client = class {
8980
8980
  timezone: gu.user.timezone,
8981
8981
  update_time: gu.user.update_time,
8982
8982
  username: gu.user.username,
8983
- user_status: gu.user.user_status ? safeJSONParse(gu.user.user_status) : void 0
8983
+ user_status: gu.user.user_status,
8984
+ status: gu.user.status
8984
8985
  },
8985
8986
  role_id: gu.role_id,
8986
8987
  clan_nick: gu.clan_nick,
@@ -8991,6 +8992,19 @@ var Client = class {
8991
8992
  });
8992
8993
  });
8993
8994
  }
8995
+ listChannelDetail(session, channelId) {
8996
+ return __async(this, null, function* () {
8997
+ if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
8998
+ yield this.sessionRefresh(session);
8999
+ }
9000
+ return this.apiClient.listChannelDetail(
9001
+ session.token,
9002
+ channelId
9003
+ ).then((response) => {
9004
+ return Promise.resolve(response);
9005
+ });
9006
+ });
9007
+ }
8994
9008
  /** List channels. */
8995
9009
  listChannelDescs(session, limit, state, cursor, clanId, channelType, isMobile) {
8996
9010
  return __async(this, null, function* () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mezon-js",
3
- "version": "2.13.19",
3
+ "version": "2.13.21",
4
4
  "scripts": {
5
5
  "build": "npx tsc && npx rollup -c --bundleConfigAsCjs && node build.mjs"
6
6
  },