mezon-js 2.12.98 → 2.13.1

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
@@ -744,8 +744,6 @@ export interface ApiChannelDescription {
744
744
  category_id?: string;
745
745
  //
746
746
  category_name?: string;
747
- //
748
- channel_avatar?: Array<string>;
749
747
  //The channel this message belongs to.
750
748
  channel_id?: string;
751
749
  //
@@ -777,31 +775,27 @@ export interface ApiChannelDescription {
777
775
  //
778
776
  meeting_code?: string;
779
777
  //
780
- meeting_uri?: string;
778
+ channel_avatar?: string;
781
779
  //The parent channel this message belongs to.
782
780
  parent_id?: string;
783
- //
784
- is_online?: Array<boolean>;
785
- //
786
- topic?: string;
787
781
  //The channel type.
788
782
  type?: number;
789
783
  //
790
784
  update_time_seconds?: number;
791
785
  //
792
- user_id?: Array<string>;
793
- //
794
- usernames?: Array<string>;
786
+ app_id?: string;
795
787
  //
796
- status?: number;
788
+ topic?: string;
797
789
  //
798
- metadata?: Array<string>;
790
+ user_ids?: Array<string>;
799
791
  //
800
- about_me?: Array<string>;
792
+ usernames?: Array<string>;
801
793
  //
802
794
  display_names?: Array<string>;
803
795
  //
804
- app_id?: string;
796
+ onlines?: Array<boolean>;
797
+ // DM status
798
+ avatars?: Array<string>;
805
799
  }
806
800
 
807
801
  /** A message sent on a channel. */
@@ -3916,7 +3910,7 @@ export class MezonApi {
3916
3910
  }
3917
3911
 
3918
3912
  /** */
3919
- confirmEmailOTP(
3913
+ confirmAuthenticateOTP(
3920
3914
  basicAuthUsername: string,
3921
3915
  basicAuthPassword: string,
3922
3916
  body:ApiLinkAccountConfirmRequest,
package/client.ts CHANGED
@@ -576,7 +576,7 @@ export class Client {
576
576
  * This is a placeholder method that subclasses or instances can override
577
577
  * to perform actions before or after the refresh logic.
578
578
  */
579
- onRefreshToken(session: ApiSession): void {
579
+ onRefreshSession(session: ApiSession): void {
580
580
  console.log(`Token refresh occurred. Token: ${session.token}`);
581
581
  }
582
582
 
@@ -665,7 +665,7 @@ export class Client {
665
665
  request: ApiLinkAccountConfirmRequest,
666
666
  ): Promise<Session> {
667
667
  return this.apiClient
668
- .confirmEmailOTP(this.serverkey, "", request)
668
+ .confirmAuthenticateOTP(this.serverkey, "", request)
669
669
  .then((apiSession: ApiSession) => {
670
670
  return new Session(
671
671
  apiSession.token || "",
@@ -2095,7 +2095,7 @@ export class Client {
2095
2095
  }
2096
2096
  );
2097
2097
  session.update(apiSession.token!, apiSession.refresh_token!, apiSession.is_remember || false);
2098
- this.onRefreshToken(apiSession);
2098
+ this.onRefreshSession(apiSession);
2099
2099
  resolve(session);
2100
2100
  } catch (error) {
2101
2101
  console.error("Session refresh failed:", error);
package/dist/api.gen.d.ts CHANGED
@@ -429,7 +429,6 @@ export interface ApiChannelDescription {
429
429
  age_restricted?: number;
430
430
  category_id?: string;
431
431
  category_name?: string;
432
- channel_avatar?: Array<string>;
433
432
  channel_id?: string;
434
433
  channel_label?: string;
435
434
  channel_private?: number;
@@ -445,19 +444,17 @@ export interface ApiChannelDescription {
445
444
  last_seen_message?: ApiChannelMessageHeader;
446
445
  last_sent_message?: ApiChannelMessageHeader;
447
446
  meeting_code?: string;
448
- meeting_uri?: string;
447
+ channel_avatar?: string;
449
448
  parent_id?: string;
450
- is_online?: Array<boolean>;
451
- topic?: string;
452
449
  type?: number;
453
450
  update_time_seconds?: number;
454
- user_id?: Array<string>;
451
+ app_id?: string;
452
+ topic?: string;
453
+ user_ids?: Array<string>;
455
454
  usernames?: Array<string>;
456
- status?: number;
457
- metadata?: Array<string>;
458
- about_me?: Array<string>;
459
455
  display_names?: Array<string>;
460
- app_id?: string;
456
+ onlines?: Array<boolean>;
457
+ avatars?: Array<string>;
461
458
  }
462
459
  /** A message sent on a channel. */
463
460
  export interface ApiChannelMessage {
@@ -1974,7 +1971,7 @@ export declare class MezonApi {
1974
1971
  /** */
1975
1972
  confirmLinkMezonOTP(bearerToken: string, body: ApiLinkAccountConfirmRequest, options?: any): Promise<ApiSession>;
1976
1973
  /** */
1977
- confirmEmailOTP(basicAuthUsername: string, basicAuthPassword: string, body: ApiLinkAccountConfirmRequest, options?: any): Promise<ApiSession>;
1974
+ confirmAuthenticateOTP(basicAuthUsername: string, basicAuthPassword: string, body: ApiLinkAccountConfirmRequest, options?: any): Promise<ApiSession>;
1978
1975
  /** Authenticate a user with an email+password against the server. */
1979
1976
  registrationEmail(bearerToken: string, body: ApiRegistrationEmailRequest, options?: any): Promise<ApiSession>;
1980
1977
  /** Refresh a user's session using a refresh token retrieved from a previous authentication request. */
package/dist/client.d.ts CHANGED
@@ -335,7 +335,7 @@ export declare class Client {
335
335
  * This is a placeholder method that subclasses or instances can override
336
336
  * to perform actions before or after the refresh logic.
337
337
  */
338
- onRefreshToken(session: ApiSession): void;
338
+ onRefreshSession(session: ApiSession): void;
339
339
  /** check session isexpired */
340
340
  isexpired(session: Session): boolean;
341
341
  /** Authenticate a user with a custom id against the server. */
@@ -1143,7 +1143,7 @@ var MezonApi = class {
1143
1143
  ]);
1144
1144
  }
1145
1145
  /** */
1146
- confirmEmailOTP(basicAuthUsername, basicAuthPassword, body, options = {}) {
1146
+ confirmAuthenticateOTP(basicAuthUsername, basicAuthPassword, body, options = {}) {
1147
1147
  if (body === null || body === void 0) {
1148
1148
  throw new Error("'body' is a required parameter but is null or undefined.");
1149
1149
  }
@@ -8338,7 +8338,7 @@ var Client = class {
8338
8338
  * This is a placeholder method that subclasses or instances can override
8339
8339
  * to perform actions before or after the refresh logic.
8340
8340
  */
8341
- onRefreshToken(session) {
8341
+ onRefreshSession(session) {
8342
8342
  console.log(`Token refresh occurred. Token: ${session.token}`);
8343
8343
  }
8344
8344
  /** check session isexpired */
@@ -8397,7 +8397,7 @@ var Client = class {
8397
8397
  }
8398
8398
  confirmEmailOTP(request) {
8399
8399
  return __async(this, null, function* () {
8400
- return this.apiClient.confirmEmailOTP(this.serverkey, "", request).then((apiSession) => {
8400
+ return this.apiClient.confirmAuthenticateOTP(this.serverkey, "", request).then((apiSession) => {
8401
8401
  return new Session(
8402
8402
  apiSession.token || "",
8403
8403
  apiSession.refresh_token || "",
@@ -9297,7 +9297,7 @@ var Client = class {
9297
9297
  }
9298
9298
  );
9299
9299
  session.update(apiSession.token, apiSession.refresh_token, apiSession.is_remember || false);
9300
- this.onRefreshToken(apiSession);
9300
+ this.onRefreshSession(apiSession);
9301
9301
  resolve(session);
9302
9302
  } catch (error) {
9303
9303
  console.error("Session refresh failed:", error);
@@ -1109,7 +1109,7 @@ var MezonApi = class {
1109
1109
  ]);
1110
1110
  }
1111
1111
  /** */
1112
- confirmEmailOTP(basicAuthUsername, basicAuthPassword, body, options = {}) {
1112
+ confirmAuthenticateOTP(basicAuthUsername, basicAuthPassword, body, options = {}) {
1113
1113
  if (body === null || body === void 0) {
1114
1114
  throw new Error("'body' is a required parameter but is null or undefined.");
1115
1115
  }
@@ -8304,7 +8304,7 @@ var Client = class {
8304
8304
  * This is a placeholder method that subclasses or instances can override
8305
8305
  * to perform actions before or after the refresh logic.
8306
8306
  */
8307
- onRefreshToken(session) {
8307
+ onRefreshSession(session) {
8308
8308
  console.log(`Token refresh occurred. Token: ${session.token}`);
8309
8309
  }
8310
8310
  /** check session isexpired */
@@ -8363,7 +8363,7 @@ var Client = class {
8363
8363
  }
8364
8364
  confirmEmailOTP(request) {
8365
8365
  return __async(this, null, function* () {
8366
- return this.apiClient.confirmEmailOTP(this.serverkey, "", request).then((apiSession) => {
8366
+ return this.apiClient.confirmAuthenticateOTP(this.serverkey, "", request).then((apiSession) => {
8367
8367
  return new Session(
8368
8368
  apiSession.token || "",
8369
8369
  apiSession.refresh_token || "",
@@ -9263,7 +9263,7 @@ var Client = class {
9263
9263
  }
9264
9264
  );
9265
9265
  session.update(apiSession.token, apiSession.refresh_token, apiSession.is_remember || false);
9266
- this.onRefreshToken(apiSession);
9266
+ this.onRefreshSession(apiSession);
9267
9267
  resolve(session);
9268
9268
  } catch (error) {
9269
9269
  console.error("Session refresh failed:", error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mezon-js",
3
- "version": "2.12.98",
3
+ "version": "2.13.1",
4
4
  "scripts": {
5
5
  "build": "npx tsc && npx rollup -c --bundleConfigAsCjs && node build.mjs"
6
6
  },