mezon-js 2.9.6 → 2.9.8

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