@textrp/briij-js-sdk 43.1.0 → 43.1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@textrp/briij-js-sdk",
3
- "version": "43.1.0",
3
+ "version": "43.1.1",
4
4
  "description": "Briij Client-Server SDK for JavaScript and TypeScript",
5
5
  "engines": {
6
6
  "node": ">=22.0.0"
package/src/client.ts CHANGED
@@ -302,6 +302,13 @@ export interface IKeysUploadResponse {
302
302
  export interface ICreateClientOpts {
303
303
  baseUrl: string;
304
304
 
305
+ /**
306
+ * Optional override for Briij legacy endpoints mounted at the homeserver root
307
+ * (for example `/my-address` and `/my-features/...`).
308
+ * Use this when `baseUrl` points to a local proxy origin.
309
+ */
310
+ legacyApiBaseUrl?: string;
311
+
305
312
  idBaseUrl?: string;
306
313
 
307
314
  /**
@@ -1293,6 +1300,7 @@ export class BriijClient extends TypedEventEmitter<EmittedEvents, ClientEventHan
1293
1300
  public iceCandidatePoolSize = 0; // XXX: Intended private, used in code.
1294
1301
  public idBaseUrl?: string;
1295
1302
  public baseUrl: string;
1303
+ private legacyApiBaseUrl?: string;
1296
1304
  public readonly isVoipWithNoMediaAllowed;
1297
1305
  public disableVoip: boolean;
1298
1306
 
@@ -1375,6 +1383,7 @@ export class BriijClient extends TypedEventEmitter<EmittedEvents, ClientEventHan
1375
1383
  opts.idBaseUrl = utils.ensureNoTrailingSlash(opts.idBaseUrl);
1376
1384
 
1377
1385
  this.baseUrl = opts.baseUrl;
1386
+ this.legacyApiBaseUrl = utils.ensureNoTrailingSlash(opts.legacyApiBaseUrl);
1378
1387
  this.idBaseUrl = opts.idBaseUrl;
1379
1388
  this.identityServer = opts.identityServer;
1380
1389
 
@@ -6226,7 +6235,7 @@ export class BriijClient extends TypedEventEmitter<EmittedEvents, ClientEventHan
6226
6235
  "/my-address",
6227
6236
  undefined,
6228
6237
  { address: matrixUserId },
6229
- { prefix: "" },
6238
+ { prefix: "", baseUrl: this.getLegacyApiBaseUrl() },
6230
6239
  );
6231
6240
  }
6232
6241
 
@@ -6243,7 +6252,18 @@ export class BriijClient extends TypedEventEmitter<EmittedEvents, ClientEventHan
6243
6252
  $walletAddress: walletAddress,
6244
6253
  $network: network,
6245
6254
  });
6246
- return this.http.authedRequest(Method.Get, path, undefined, undefined, { prefix: "" });
6255
+ return this.http.authedRequest(Method.Get, path, undefined, undefined, {
6256
+ prefix: "",
6257
+ baseUrl: this.getLegacyApiBaseUrl(),
6258
+ });
6259
+ }
6260
+
6261
+ private getLegacyApiBaseUrl(): string {
6262
+ return (
6263
+ this.legacyApiBaseUrl ??
6264
+ utils.ensureNoTrailingSlash(this.xrplTrustConfig?.homeserverBaseUrl) ??
6265
+ this.baseUrl
6266
+ );
6247
6267
  }
6248
6268
 
6249
6269
  /**