@redseat/api 0.1.1 → 0.1.3

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/dist/client.d.ts CHANGED
@@ -5,11 +5,13 @@ export interface ClientOptions {
5
5
  server: IServer;
6
6
  getIdToken: () => Promise<string>;
7
7
  refreshThreshold?: number;
8
- timeout: number;
8
+ timeout?: number;
9
+ redseatUrl?: string;
9
10
  }
10
11
  export declare class RedseatClient {
11
12
  private readonly axios;
12
13
  private readonly server;
14
+ private readonly redseatUrl?;
13
15
  private readonly getIdToken;
14
16
  private readonly refreshThreshold;
15
17
  private baseUrl;
package/dist/client.js CHANGED
@@ -3,6 +3,7 @@ import { fetchServerToken } from './auth.js';
3
3
  export class RedseatClient {
4
4
  constructor(options) {
5
5
  this.server = options.server;
6
+ this.redseatUrl = options.redseatUrl;
6
7
  this.getIdToken = options.getIdToken;
7
8
  this.refreshThreshold = options.refreshThreshold ?? 5 * 60 * 1000; // 5 minutes default
8
9
  // Initialize with regular URL, will be updated after local detection
@@ -102,7 +103,7 @@ export class RedseatClient {
102
103
  const idToken = await this.getIdToken();
103
104
  // Use fetchServerToken which uses the global axios instance
104
105
  // The token endpoint is on the frontend server, not the backend server
105
- const newToken = await fetchServerToken(this.serverId, idToken);
106
+ const newToken = await fetchServerToken(this.serverId, idToken, this.redseatUrl);
106
107
  this.tokenData = newToken;
107
108
  return newToken;
108
109
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redseat/api",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "TypeScript API client library for interacting with Redseat servers",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",