mezon-js 2.12.4 → 2.12.5

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
@@ -561,15 +561,21 @@ export class Client {
561
561
 
562
562
  /** thre refreshTokenPromise */
563
563
  private refreshTokenPromise: Promise<Session> | null = null;
564
+ host: string;
565
+ port: string;
566
+ useSSL: boolean;
564
567
 
565
568
  constructor(
566
569
  readonly serverkey = DEFAULT_SERVER_KEY,
567
- readonly host = DEFAULT_HOST,
568
- readonly port = DEFAULT_PORT,
569
- readonly useSSL = false,
570
+ host = DEFAULT_HOST,
571
+ port = DEFAULT_PORT,
572
+ useSSL = false,
570
573
  readonly timeout = DEFAULT_TIMEOUT_MS,
571
574
  readonly autoRefreshSession = true
572
575
  ) {
576
+ this.host = host;
577
+ this.port = port;
578
+ this.useSSL = useSSL;
573
579
  const scheme = useSSL ? "https://" : "http://";
574
580
  const basePath = `${scheme}${host}:${port}`;
575
581
 
@@ -640,7 +646,13 @@ export class Client {
640
646
  }
641
647
 
642
648
  /** set base path */
643
- setBasePath(basePath: string) {
649
+ setBasePath(host: string, port: string, useSSL: boolean) {
650
+ this.host = host;
651
+ this.port = port;
652
+ this.useSSL = useSSL;
653
+
654
+ const scheme = useSSL ? "https://" : "http://";
655
+ const basePath = `${scheme}${host}:${port}`;
644
656
  return this.apiClient
645
657
  .setBasePath(basePath);
646
658
  }
package/dist/client.d.ts CHANGED
@@ -342,22 +342,22 @@ export interface ApiUpdateRoleRequest {
342
342
  /** A client for Mezon server. */
343
343
  export declare class Client {
344
344
  readonly serverkey: string;
345
- readonly host: string;
346
- readonly port: string;
347
- readonly useSSL: boolean;
348
345
  readonly timeout: number;
349
346
  readonly autoRefreshSession: boolean;
350
347
  /** The low level API client for Mezon server. */
351
348
  private readonly apiClient;
352
349
  /** thre refreshTokenPromise */
353
350
  private refreshTokenPromise;
351
+ host: string;
352
+ port: string;
353
+ useSSL: boolean;
354
354
  constructor(serverkey?: string, host?: string, port?: string, useSSL?: boolean, timeout?: number, autoRefreshSession?: boolean);
355
355
  /** Authenticate a user with a custom id against the server. */
356
356
  authenticateMezon(token: string, create?: boolean, username?: string, isRemember?: boolean, vars?: Record<string, string>, options?: any): Promise<Session>;
357
357
  /** Authenticate a user with an email+password against the server. */
358
358
  authenticateEmail(email: string, password: string, username?: string, vars?: Record<string, string>): Promise<Session>;
359
359
  /** set base path */
360
- setBasePath(basePath: string): void;
360
+ setBasePath(host: string, port: string, useSSL: boolean): void;
361
361
  /** Add users to a channel, or accept their join requests. */
362
362
  addChannelUsers(session: Session, channelId: string, ids?: Array<string>): Promise<boolean>;
363
363
  /** Add friends by ID or username to a user's account. */
@@ -7853,13 +7853,13 @@ var WebrtcSignalingType = /* @__PURE__ */ ((WebrtcSignalingType2) => {
7853
7853
  var Client = class {
7854
7854
  constructor(serverkey = DEFAULT_SERVER_KEY, host = DEFAULT_HOST, port = DEFAULT_PORT, useSSL = false, timeout = DEFAULT_TIMEOUT_MS, autoRefreshSession = true) {
7855
7855
  this.serverkey = serverkey;
7856
- this.host = host;
7857
- this.port = port;
7858
- this.useSSL = useSSL;
7859
7856
  this.timeout = timeout;
7860
7857
  this.autoRefreshSession = autoRefreshSession;
7861
7858
  /** thre refreshTokenPromise */
7862
7859
  this.refreshTokenPromise = null;
7860
+ this.host = host;
7861
+ this.port = port;
7862
+ this.useSSL = useSSL;
7863
7863
  const scheme = useSSL ? "https://" : "http://";
7864
7864
  const basePath = `${scheme}${host}:${port}`;
7865
7865
  this.apiClient = new MezonApi(serverkey, timeout, basePath);
@@ -7909,7 +7909,12 @@ var Client = class {
7909
7909
  });
7910
7910
  }
7911
7911
  /** set base path */
7912
- setBasePath(basePath) {
7912
+ setBasePath(host, port, useSSL) {
7913
+ this.host = host;
7914
+ this.port = port;
7915
+ this.useSSL = useSSL;
7916
+ const scheme = useSSL ? "https://" : "http://";
7917
+ const basePath = `${scheme}${host}:${port}`;
7913
7918
  return this.apiClient.setBasePath(basePath);
7914
7919
  }
7915
7920
  /** Add users to a channel, or accept their join requests. */
@@ -7819,13 +7819,13 @@ var WebrtcSignalingType = /* @__PURE__ */ ((WebrtcSignalingType2) => {
7819
7819
  var Client = class {
7820
7820
  constructor(serverkey = DEFAULT_SERVER_KEY, host = DEFAULT_HOST, port = DEFAULT_PORT, useSSL = false, timeout = DEFAULT_TIMEOUT_MS, autoRefreshSession = true) {
7821
7821
  this.serverkey = serverkey;
7822
- this.host = host;
7823
- this.port = port;
7824
- this.useSSL = useSSL;
7825
7822
  this.timeout = timeout;
7826
7823
  this.autoRefreshSession = autoRefreshSession;
7827
7824
  /** thre refreshTokenPromise */
7828
7825
  this.refreshTokenPromise = null;
7826
+ this.host = host;
7827
+ this.port = port;
7828
+ this.useSSL = useSSL;
7829
7829
  const scheme = useSSL ? "https://" : "http://";
7830
7830
  const basePath = `${scheme}${host}:${port}`;
7831
7831
  this.apiClient = new MezonApi(serverkey, timeout, basePath);
@@ -7875,7 +7875,12 @@ var Client = class {
7875
7875
  });
7876
7876
  }
7877
7877
  /** set base path */
7878
- setBasePath(basePath) {
7878
+ setBasePath(host, port, useSSL) {
7879
+ this.host = host;
7880
+ this.port = port;
7881
+ this.useSSL = useSSL;
7882
+ const scheme = useSSL ? "https://" : "http://";
7883
+ const basePath = `${scheme}${host}:${port}`;
7879
7884
  return this.apiClient.setBasePath(basePath);
7880
7885
  }
7881
7886
  /** Add users to a channel, or accept their join requests. */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mezon-js",
3
3
 
4
- "version": "2.12.4",
4
+ "version": "2.12.5",
5
5
 
6
6
  "scripts": {
7
7
  "build": "npx tsc && npx rollup -c --bundleConfigAsCjs && node build.mjs"