mezon-js 2.9.6 → 2.9.7

Sign up to get free protection for your applications and to get access to all the features.
package/client.ts CHANGED
@@ -127,7 +127,7 @@ export enum ChannelType {
127
127
  CHANNEL_TYPE_VOICE = 4,
128
128
  CHANNEL_TYPE_FORUM = 5,
129
129
  CHANNEL_TYPE_STREAMING = 6,
130
- CHANNEL_TYPE_THREAD = 7,
130
+ CHANNEL_TYPE_APP = 7,
131
131
  CHANNEL_TYPE_ANNOUNCEMENT = 8,
132
132
  }
133
133
  export enum ChannelStreamMode {
@@ -1065,7 +1065,7 @@ export class Client {
1065
1065
  async deleteCategoryDesc(
1066
1066
  session: Session,
1067
1067
  categoryId: string,
1068
- clanId: string,
1068
+ clanId: string
1069
1069
  ): Promise<boolean> {
1070
1070
  if (
1071
1071
  this.autoRefreshSession &&
@@ -3541,7 +3541,10 @@ export class Client {
3541
3541
  });
3542
3542
  }
3543
3543
 
3544
- async registerStreamingChannel(session: Session, request: ApiRegisterStreamingChannelRequest) {
3544
+ async registerStreamingChannel(
3545
+ session: Session,
3546
+ request: ApiRegisterStreamingChannelRequest
3547
+ ) {
3545
3548
  if (
3546
3549
  this.autoRefreshSession &&
3547
3550
  session.refresh_token &&
@@ -3557,43 +3560,40 @@ export class Client {
3557
3560
  });
3558
3561
  }
3559
3562
 
3560
- /** List a channel's users. */
3561
- async listChannelApps(
3562
- session: Session,
3563
- clanId: string,
3564
- ): Promise<ApiListChannelAppsResponse> {
3565
- if (
3566
- this.autoRefreshSession &&
3567
- session.refresh_token &&
3568
- session.isexpired((Date.now() + this.expiredTimespanMs) / 1000)
3569
- ) {
3570
- await this.sessionRefresh(session);
3571
- }
3572
-
3573
- return this.apiClient
3574
- .listChannelApps(
3575
- session.token,
3576
- clanId,
3577
- )
3578
- .then((response: ApiListChannelAppsResponse) => {
3579
- var result: ApiListChannelAppsResponse = {
3580
- channel_apps: [],
3581
- };
3582
-
3583
- if (response.channel_apps == null) {
3584
- return Promise.resolve(result);
3585
- }
3586
-
3587
- response.channel_apps!.forEach((gu) => {
3588
- result.channel_apps!.push({
3589
- id: gu.id,
3590
- channel_id: gu.channel_id,
3591
- app_id: gu.app_id,
3592
- clan_id: gu.clan_id,
3593
- url: gu.url,
3594
- });
3595
- });
3563
+ /** List a channel's users. */
3564
+ async listChannelApps(
3565
+ session: Session,
3566
+ clanId: string
3567
+ ): Promise<ApiListChannelAppsResponse> {
3568
+ if (
3569
+ this.autoRefreshSession &&
3570
+ session.refresh_token &&
3571
+ session.isexpired((Date.now() + this.expiredTimespanMs) / 1000)
3572
+ ) {
3573
+ await this.sessionRefresh(session);
3574
+ }
3575
+
3576
+ return this.apiClient
3577
+ .listChannelApps(session.token, clanId)
3578
+ .then((response: ApiListChannelAppsResponse) => {
3579
+ var result: ApiListChannelAppsResponse = {
3580
+ channel_apps: [],
3581
+ };
3582
+
3583
+ if (response.channel_apps == null) {
3596
3584
  return Promise.resolve(result);
3585
+ }
3586
+
3587
+ response.channel_apps!.forEach((gu) => {
3588
+ result.channel_apps!.push({
3589
+ id: gu.id,
3590
+ channel_id: gu.channel_id,
3591
+ app_id: gu.app_id,
3592
+ clan_id: gu.clan_id,
3593
+ url: gu.url,
3594
+ });
3597
3595
  });
3598
- }
3596
+ return Promise.resolve(result);
3597
+ });
3598
+ }
3599
3599
  }
package/dist/client.d.ts CHANGED
@@ -24,7 +24,7 @@ export declare enum ChannelType {
24
24
  CHANNEL_TYPE_VOICE = 4,
25
25
  CHANNEL_TYPE_FORUM = 5,
26
26
  CHANNEL_TYPE_STREAMING = 6,
27
- CHANNEL_TYPE_THREAD = 7,
27
+ CHANNEL_TYPE_APP = 7,
28
28
  CHANNEL_TYPE_ANNOUNCEMENT = 8
29
29
  }
30
30
  export declare enum ChannelStreamMode {
@@ -5663,7 +5663,7 @@ var ChannelType = /* @__PURE__ */ ((ChannelType2) => {
5663
5663
  ChannelType2[ChannelType2["CHANNEL_TYPE_VOICE"] = 4] = "CHANNEL_TYPE_VOICE";
5664
5664
  ChannelType2[ChannelType2["CHANNEL_TYPE_FORUM"] = 5] = "CHANNEL_TYPE_FORUM";
5665
5665
  ChannelType2[ChannelType2["CHANNEL_TYPE_STREAMING"] = 6] = "CHANNEL_TYPE_STREAMING";
5666
- ChannelType2[ChannelType2["CHANNEL_TYPE_THREAD"] = 7] = "CHANNEL_TYPE_THREAD";
5666
+ ChannelType2[ChannelType2["CHANNEL_TYPE_APP"] = 7] = "CHANNEL_TYPE_APP";
5667
5667
  ChannelType2[ChannelType2["CHANNEL_TYPE_ANNOUNCEMENT"] = 8] = "CHANNEL_TYPE_ANNOUNCEMENT";
5668
5668
  return ChannelType2;
5669
5669
  })(ChannelType || {});
@@ -7536,10 +7536,7 @@ var Client = class {
7536
7536
  if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
7537
7537
  yield this.sessionRefresh(session);
7538
7538
  }
7539
- return this.apiClient.listChannelApps(
7540
- session.token,
7541
- clanId
7542
- ).then((response) => {
7539
+ return this.apiClient.listChannelApps(session.token, clanId).then((response) => {
7543
7540
  var result = {
7544
7541
  channel_apps: []
7545
7542
  };
@@ -5634,7 +5634,7 @@ var ChannelType = /* @__PURE__ */ ((ChannelType2) => {
5634
5634
  ChannelType2[ChannelType2["CHANNEL_TYPE_VOICE"] = 4] = "CHANNEL_TYPE_VOICE";
5635
5635
  ChannelType2[ChannelType2["CHANNEL_TYPE_FORUM"] = 5] = "CHANNEL_TYPE_FORUM";
5636
5636
  ChannelType2[ChannelType2["CHANNEL_TYPE_STREAMING"] = 6] = "CHANNEL_TYPE_STREAMING";
5637
- ChannelType2[ChannelType2["CHANNEL_TYPE_THREAD"] = 7] = "CHANNEL_TYPE_THREAD";
5637
+ ChannelType2[ChannelType2["CHANNEL_TYPE_APP"] = 7] = "CHANNEL_TYPE_APP";
5638
5638
  ChannelType2[ChannelType2["CHANNEL_TYPE_ANNOUNCEMENT"] = 8] = "CHANNEL_TYPE_ANNOUNCEMENT";
5639
5639
  return ChannelType2;
5640
5640
  })(ChannelType || {});
@@ -7507,10 +7507,7 @@ var Client = class {
7507
7507
  if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
7508
7508
  yield this.sessionRefresh(session);
7509
7509
  }
7510
- return this.apiClient.listChannelApps(
7511
- session.token,
7512
- clanId
7513
- ).then((response) => {
7510
+ return this.apiClient.listChannelApps(session.token, clanId).then((response) => {
7514
7511
  var result = {
7515
7512
  channel_apps: []
7516
7513
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mezon-js",
3
3
 
4
- "version": "2.9.6",
4
+ "version": "2.9.7",
5
5
 
6
6
  "scripts": {
7
7
  "build": "npx tsc && npx rollup -c --bundleConfigAsCjs && node build.mjs"