@squadbase/vite-server 0.1.9-dev.87dd3f7 → 0.1.9-dev.d3c856d

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.
@@ -201,6 +201,16 @@ var AUTH_TYPES = {
201
201
  USER_PASSWORD: "user-password"
202
202
  };
203
203
 
204
+ // ../connectors/src/lib/normalize-path.ts
205
+ function normalizeRequestPath(path2, basePathSegment) {
206
+ let p = path2.trim();
207
+ if (!p.startsWith("/")) p = "/" + p;
208
+ if (p === basePathSegment || p.startsWith(basePathSegment + "/")) {
209
+ p = p.slice(basePathSegment.length) || "/";
210
+ }
211
+ return p;
212
+ }
213
+
204
214
  // ../connectors/src/connectors/tiktok-ads/tools/list-advertisers.ts
205
215
  import { z } from "zod";
206
216
  var BASE_URL2 = "https://business-api.tiktok.com/open_api/v1.3/";
@@ -375,7 +385,9 @@ var parameters = {
375
385
 
376
386
  // ../connectors/src/connectors/tiktok-ads/tools/request.ts
377
387
  import { z as z2 } from "zod";
378
- var BASE_URL3 = "https://business-api.tiktok.com/open_api/v1.3/";
388
+ var BASE_HOST = "https://business-api.tiktok.com";
389
+ var BASE_PATH_SEGMENT = "/open_api/v1.3";
390
+ var BASE_URL3 = `${BASE_HOST}${BASE_PATH_SEGMENT}`;
379
391
  var REQUEST_TIMEOUT_MS2 = 6e4;
380
392
  var cachedToken2 = null;
381
393
  async function getProxyToken2(config) {
@@ -451,7 +463,8 @@ The advertiser_id is automatically injected if configured.`,
451
463
  );
452
464
  try {
453
465
  const advertiserId = parameters.advertiserId.tryGetValue(connection2) ?? "";
454
- let url = `${BASE_URL3}${path2}`;
466
+ const normalizedPath = normalizeRequestPath(path2, BASE_PATH_SEGMENT);
467
+ let url = `${BASE_URL3}${normalizedPath}`;
455
468
  if (method === "GET") {
456
469
  const params = new URLSearchParams(queryParams ?? {});
457
470
  if (advertiserId && !params.has("advertiser_id")) {