From 4fd95189ce1d649b2c4e5278370f8082da8b02e3 Mon Sep 17 00:00:00 2001 From: Fred Boniface Date: Sat, 21 Feb 2026 00:18:44 +0000 Subject: [PATCH] Fic declatation of baseUrl to ensure it includes /api/v3 whether provided or not. --- src/lib/base.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/lib/base.ts b/src/lib/base.ts index 98b61c3..a7c0902 100644 --- a/src/lib/base.ts +++ b/src/lib/base.ts @@ -8,10 +8,17 @@ export interface ApiResult { } export class BaseClient { + protected readonly baseUrl: string; + constructor( - protected readonly baseUrl: string, + baseUrl: string, protected readonly apiKey?: string - ) {} + ) { + const root = baseUrl.replace(/\/$/, ''); + this.baseUrl = root.endsWith('/api/v3') + ? root + : `${root}/api/v3`; + } /** * Handles the Envelope logic