@squadbase/vite-server 0.1.9-dev.b193824 → 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.
@@ -215,6 +215,16 @@ var AUTH_TYPES = {
215
215
  USER_PASSWORD: "user-password"
216
216
  };
217
217
 
218
+ // ../connectors/src/lib/normalize-path.ts
219
+ function normalizeRequestPath(path2, basePathSegment) {
220
+ let p = path2.trim();
221
+ if (!p.startsWith("/")) p = "/" + p;
222
+ if (p === basePathSegment || p.startsWith(basePathSegment + "/")) {
223
+ p = p.slice(basePathSegment.length) || "/";
224
+ }
225
+ return p;
226
+ }
227
+
218
228
  // ../connectors/src/connectors/google-slides/setup.ts
219
229
  var googleSlidesOnboarding = new ConnectorOnboarding({
220
230
  dataOverviewInstructions: {
@@ -230,7 +240,9 @@ var parameters = {};
230
240
 
231
241
  // ../connectors/src/connectors/google-slides/tools/request.ts
232
242
  import { z } from "zod";
233
- var SLIDES_BASE_URL2 = "https://slides.googleapis.com/v1/presentations";
243
+ var SLIDES_BASE_HOST = "https://slides.googleapis.com";
244
+ var SLIDES_BASE_PATH_SEGMENT = "/v1/presentations";
245
+ var SLIDES_BASE_URL2 = `${SLIDES_BASE_HOST}${SLIDES_BASE_PATH_SEGMENT}`;
234
246
  var REQUEST_TIMEOUT_MS = 6e4;
235
247
  var cachedToken = null;
236
248
  async function getProxyToken(config) {
@@ -305,7 +317,11 @@ Authentication is handled automatically via OAuth proxy.`,
305
317
  `[connector-request] google-slides/${connection2.name}: ${method} ${path2}`
306
318
  );
307
319
  try {
308
- let url = `${SLIDES_BASE_URL2}${path2 === "" || path2.startsWith("/") ? "" : "/"}${path2}`;
320
+ const normalizedPath = normalizeRequestPath(
321
+ path2,
322
+ SLIDES_BASE_PATH_SEGMENT
323
+ );
324
+ let url = `${SLIDES_BASE_URL2}${normalizedPath === "/" ? "" : normalizedPath}`;
309
325
  if (queryParams) {
310
326
  const searchParams = new URLSearchParams(queryParams);
311
327
  url += `?${searchParams.toString()}`;
@@ -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")) {