@squadbase/vite-server 0.1.10-dev.5aa0720 → 0.1.10-dev.9dac57b

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/cli/index.js CHANGED
@@ -62169,7 +62169,7 @@ __export(lib_exports, {
62169
62169
  FetchError: () => FetchError,
62170
62170
  Headers: () => Headers2,
62171
62171
  Request: () => Request2,
62172
- Response: () => Response,
62172
+ Response: () => Response2,
62173
62173
  default: () => lib_default
62174
62174
  });
62175
62175
  import Stream from "stream";
@@ -62695,7 +62695,7 @@ function fetch2(url, opts) {
62695
62695
  };
62696
62696
  const codings = headers.get("Content-Encoding");
62697
62697
  if (!request2.compress || request2.method === "HEAD" || codings === null || res.statusCode === 204 || res.statusCode === 304) {
62698
- response = new Response(body, response_options);
62698
+ response = new Response2(body, response_options);
62699
62699
  resolve(response);
62700
62700
  return;
62701
62701
  }
@@ -62705,7 +62705,7 @@ function fetch2(url, opts) {
62705
62705
  };
62706
62706
  if (codings == "gzip" || codings == "x-gzip") {
62707
62707
  body = body.pipe(zlib.createGunzip(zlibOptions));
62708
- response = new Response(body, response_options);
62708
+ response = new Response2(body, response_options);
62709
62709
  resolve(response);
62710
62710
  return;
62711
62711
  }
@@ -62717,12 +62717,12 @@ function fetch2(url, opts) {
62717
62717
  } else {
62718
62718
  body = body.pipe(zlib.createInflateRaw());
62719
62719
  }
62720
- response = new Response(body, response_options);
62720
+ response = new Response2(body, response_options);
62721
62721
  resolve(response);
62722
62722
  });
62723
62723
  raw.on("end", function() {
62724
62724
  if (!response) {
62725
- response = new Response(body, response_options);
62725
+ response = new Response2(body, response_options);
62726
62726
  resolve(response);
62727
62727
  }
62728
62728
  });
@@ -62730,11 +62730,11 @@ function fetch2(url, opts) {
62730
62730
  }
62731
62731
  if (codings == "br" && typeof zlib.createBrotliDecompress === "function") {
62732
62732
  body = body.pipe(zlib.createBrotliDecompress());
62733
- response = new Response(body, response_options);
62733
+ response = new Response2(body, response_options);
62734
62734
  resolve(response);
62735
62735
  return;
62736
62736
  }
62737
- response = new Response(body, response_options);
62737
+ response = new Response2(body, response_options);
62738
62738
  resolve(response);
62739
62739
  });
62740
62740
  writeToStream(req, request2);
@@ -62767,7 +62767,7 @@ function destroyStream(stream, err) {
62767
62767
  stream.end();
62768
62768
  }
62769
62769
  }
62770
- var import_whatwg_url, Readable6, BUFFER, TYPE, Blob2, convert, INTERNALS, PassThrough, invalidTokenRegex, invalidHeaderCharRegex, MAP, Headers2, INTERNAL, HeadersIteratorPrototype, INTERNALS$1, STATUS_CODES, Response, INTERNALS$2, URL2, parse_url, format_url, streamDestructionSupported, Request2, URL$1, PassThrough$1, isDomainOrSubdomain, isSameProtocol, lib_default;
62770
+ var import_whatwg_url, Readable6, BUFFER, TYPE, Blob2, convert, INTERNALS, PassThrough, invalidTokenRegex, invalidHeaderCharRegex, MAP, Headers2, INTERNAL, HeadersIteratorPrototype, INTERNALS$1, STATUS_CODES, Response2, INTERNALS$2, URL2, parse_url, format_url, streamDestructionSupported, Request2, URL$1, PassThrough$1, isDomainOrSubdomain, isSameProtocol, lib_default;
62771
62771
  var init_lib2 = __esm({
62772
62772
  "../../node_modules/node-fetch/lib/index.mjs"() {
62773
62773
  "use strict";
@@ -63210,7 +63210,7 @@ var init_lib2 = __esm({
63210
63210
  });
63211
63211
  INTERNALS$1 = /* @__PURE__ */ Symbol("Response internals");
63212
63212
  STATUS_CODES = http.STATUS_CODES;
63213
- Response = class _Response {
63213
+ Response2 = class _Response {
63214
63214
  constructor() {
63215
63215
  let body = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null;
63216
63216
  let opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
@@ -63268,8 +63268,8 @@ var init_lib2 = __esm({
63268
63268
  });
63269
63269
  }
63270
63270
  };
63271
- Body.mixIn(Response.prototype);
63272
- Object.defineProperties(Response.prototype, {
63271
+ Body.mixIn(Response2.prototype);
63272
+ Object.defineProperties(Response2.prototype, {
63273
63273
  url: { enumerable: true },
63274
63274
  status: { enumerable: true },
63275
63275
  ok: { enumerable: true },
@@ -63278,7 +63278,7 @@ var init_lib2 = __esm({
63278
63278
  headers: { enumerable: true },
63279
63279
  clone: { enumerable: true }
63280
63280
  });
63281
- Object.defineProperty(Response.prototype, Symbol.toStringTag, {
63281
+ Object.defineProperty(Response2.prototype, Symbol.toStringTag, {
63282
63282
  value: "Response",
63283
63283
  writable: false,
63284
63284
  enumerable: false,
@@ -92940,33 +92940,41 @@ export default async function handler(c: Context) {
92940
92940
  tools: tools11
92941
92941
  });
92942
92942
 
92943
- // ../connectors/src/connectors/google-ads/tools/list-customers.ts
92944
- import { z as z18 } from "zod";
92945
-
92946
- // ../connectors/src/connectors/google-ads/parameters.ts
92947
- var parameters12 = {
92948
- customerId: new ParameterDefinition({
92949
- slug: "customer-id",
92950
- name: "Google Ads Customer ID",
92951
- description: "The Google Ads customer ID (e.g., 123-456-7890 or 1234567890). Can be found in the top-right corner of your Google Ads account.",
92952
- envVarBaseKey: "GOOGLE_ADS_CUSTOMER_ID",
92953
- type: "text",
92954
- secret: false,
92955
- required: false
92956
- }),
92957
- developerToken: new ParameterDefinition({
92958
- slug: "developer-token",
92959
- name: "Google Ads Developer Token",
92960
- description: "The developer token for accessing the Google Ads API. Required for all API requests.",
92961
- envVarBaseKey: "GOOGLE_ADS_DEVELOPER_TOKEN",
92962
- type: "text",
92963
- secret: true,
92964
- required: true
92965
- })
92943
+ // ../connectors/src/connectors/google-ads/constants.ts
92944
+ var VERSION_FALLBACK_ORDER = ["v22", "v23", "v24"];
92945
+ var cachedWorkingVersion = VERSION_FALLBACK_ORDER[0];
92946
+ var looksSunset = (contentType) => {
92947
+ return contentType != null && contentType.toLowerCase().includes("text/html");
92966
92948
  };
92949
+ async function fetchGoogleAdsWithVersionFallback(attempt) {
92950
+ const order = [
92951
+ cachedWorkingVersion,
92952
+ ...VERSION_FALLBACK_ORDER.filter((v) => v !== cachedWorkingVersion)
92953
+ ];
92954
+ let lastResponse = null;
92955
+ for (let i6 = 0; i6 < order.length; i6++) {
92956
+ const version2 = order[i6];
92957
+ const baseUrl = `https://googleads.googleapis.com/${version2}/`;
92958
+ const response = await attempt(baseUrl);
92959
+ const contentType = response.headers.get("content-type");
92960
+ if (looksSunset(contentType) && i6 < order.length - 1) {
92961
+ console.warn(
92962
+ `[google-ads] version ${version2} returned a sunset/HTML response (status ${response.status}); retrying with newer version`
92963
+ );
92964
+ lastResponse = response;
92965
+ continue;
92966
+ }
92967
+ cachedWorkingVersion = version2;
92968
+ return response;
92969
+ }
92970
+ return lastResponse ?? new Response(null, {
92971
+ status: 502,
92972
+ statusText: "All Google Ads API versions returned sunset responses"
92973
+ });
92974
+ }
92967
92975
 
92968
92976
  // ../connectors/src/connectors/google-ads/tools/list-customers.ts
92969
- var BASE_URL2 = "https://googleads.googleapis.com/v18/";
92977
+ import { z as z18 } from "zod";
92970
92978
  var REQUEST_TIMEOUT_MS8 = 6e4;
92971
92979
  var cachedToken4 = null;
92972
92980
  async function getProxyToken4(config) {
@@ -93037,27 +93045,25 @@ var listCustomersTool = new ConnectorTool({
93037
93045
  `[connector-request] google-ads/${connection.name}: listCustomers`
93038
93046
  );
93039
93047
  try {
93040
- const developerToken = parameters12.developerToken.getValue(connection);
93041
93048
  const token = await getProxyToken4(config.oauthProxy);
93042
93049
  const proxyUrl = `https://${config.oauthProxy.sandboxId}.${config.oauthProxy.previewBaseDomain}/_sqcore/connections/${connectionId}/request`;
93043
93050
  const controller = new AbortController();
93044
93051
  const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS8);
93045
93052
  try {
93046
- const response = await fetch(proxyUrl, {
93047
- method: "POST",
93048
- headers: {
93049
- "Content-Type": "application/json",
93050
- Authorization: `Bearer ${token}`
93051
- },
93052
- body: JSON.stringify({
93053
- url: `${BASE_URL2}customers:listAccessibleCustomers`,
93054
- method: "GET",
93053
+ const response = await fetchGoogleAdsWithVersionFallback(
93054
+ (baseUrl) => fetch(proxyUrl, {
93055
+ method: "POST",
93055
93056
  headers: {
93056
- "developer-token": developerToken
93057
- }
93058
- }),
93059
- signal: controller.signal
93060
- });
93057
+ "Content-Type": "application/json",
93058
+ Authorization: `Bearer ${token}`
93059
+ },
93060
+ body: JSON.stringify({
93061
+ url: `${baseUrl}customers:listAccessibleCustomers`,
93062
+ method: "GET"
93063
+ }),
93064
+ signal: controller.signal
93065
+ })
93066
+ );
93061
93067
  const data = await response.json();
93062
93068
  if (!response.ok) {
93063
93069
  const errorMessage = typeof data?.error === "string" ? data.error : typeof data?.message === "string" ? data.message : `HTTP ${response.status} ${response.statusText}`;
@@ -93069,26 +93075,27 @@ var listCustomersTool = new ConnectorTool({
93069
93075
  const customers = [];
93070
93076
  for (const cid of customerIds) {
93071
93077
  try {
93072
- const detailResponse = await fetch(proxyUrl, {
93073
- method: "POST",
93074
- headers: {
93075
- "Content-Type": "application/json",
93076
- Authorization: `Bearer ${token}`
93077
- },
93078
- body: JSON.stringify({
93079
- url: `${BASE_URL2}customers/${cid}/googleAds:searchStream`,
93078
+ const detailResponse = await fetchGoogleAdsWithVersionFallback(
93079
+ (baseUrl) => fetch(proxyUrl, {
93080
93080
  method: "POST",
93081
93081
  headers: {
93082
93082
  "Content-Type": "application/json",
93083
- "developer-token": developerToken,
93084
- "login-customer-id": cid
93083
+ Authorization: `Bearer ${token}`
93085
93084
  },
93086
93085
  body: JSON.stringify({
93087
- query: "SELECT customer.id, customer.descriptive_name FROM customer LIMIT 1"
93088
- })
93089
- }),
93090
- signal: controller.signal
93091
- });
93086
+ url: `${baseUrl}customers/${cid}/googleAds:searchStream`,
93087
+ method: "POST",
93088
+ headers: {
93089
+ "Content-Type": "application/json",
93090
+ "login-customer-id": cid
93091
+ },
93092
+ body: JSON.stringify({
93093
+ query: "SELECT customer.id, customer.descriptive_name FROM customer LIMIT 1"
93094
+ })
93095
+ }),
93096
+ signal: controller.signal
93097
+ })
93098
+ );
93092
93099
  if (detailResponse.ok) {
93093
93100
  const detailData = await detailResponse.json();
93094
93101
  const customer = detailData?.[0]?.results?.[0]?.customer;
@@ -93126,30 +93133,24 @@ var googleAdsOnboarding = new ConnectorOnboarding({
93126
93133
  connectionSetupInstructions: {
93127
93134
  ja: `\u4EE5\u4E0B\u306E\u624B\u9806\u3067Google Ads (OAuth) \u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\u306E\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u3092\u884C\u3063\u3066\u304F\u3060\u3055\u3044\u3002
93128
93135
 
93129
- 1. \u30E6\u30FC\u30B6\u30FC\u306B\u300CGoogle Ads API \u306E Developer Token \u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\uFF08Google Ads \u7BA1\u7406\u753B\u9762 > \u30C4\u30FC\u30EB\u3068\u8A2D\u5B9A > API \u30BB\u30F3\u30BF\u30FC\u3067\u53D6\u5F97\u3067\u304D\u307E\u3059\uFF09\u300D\u3068\u4F1D\u3048\u308B
93136
+ 1. \`${listCustomersToolName}\` \u3092\u547C\u3073\u51FA\u3057\u3066\u3001OAuth\u3067\u30A2\u30AF\u30BB\u30B9\u53EF\u80FD\u306AGoogle Ads\u30AB\u30B9\u30BF\u30DE\u30FC\u30A2\u30AB\u30A6\u30F3\u30C8\u4E00\u89A7\u3092\u53D6\u5F97\u3059\u308B
93130
93137
  2. \`updateConnectionParameters\` \u3092\u547C\u3073\u51FA\u3059:
93131
- - \`parameterSlug\`: \`"developer-token"\`
93132
- - \`value\`: \u30E6\u30FC\u30B6\u30FC\u304C\u63D0\u4F9B\u3057\u305F Developer Token
93133
- 3. \`${listCustomersToolName}\` \u3092\u547C\u3073\u51FA\u3057\u3066\u3001OAuth\u3067\u30A2\u30AF\u30BB\u30B9\u53EF\u80FD\u306AGoogle Ads\u30AB\u30B9\u30BF\u30DE\u30FC\u30A2\u30AB\u30A6\u30F3\u30C8\u4E00\u89A7\u3092\u53D6\u5F97\u3059\u308B
93134
- 4. \`updateConnectionParameters\` \u3092\u547C\u3073\u51FA\u3059:
93135
93138
  - \`parameterSlug\`: \`"customer-id"\`
93136
93139
  - \`options\`: \u30AB\u30B9\u30BF\u30DE\u30FC\u4E00\u89A7\u3002\u5404 option \u306E \`label\` \u306F \`\u30A2\u30AB\u30A6\u30F3\u30C8\u540D (id: \u30AB\u30B9\u30BF\u30DE\u30FCID)\` \u306E\u5F62\u5F0F\u3001\`value\` \u306F\u30AB\u30B9\u30BF\u30DE\u30FCID
93137
- 5. \u30E6\u30FC\u30B6\u30FC\u304C\u9078\u629E\u3057\u305F\u30AB\u30B9\u30BF\u30DE\u30FC\u306E \`label\` \u304C\u30E1\u30C3\u30BB\u30FC\u30B8\u3068\u3057\u3066\u5C4A\u304F\u306E\u3067\u3001\u6B21\u306E\u30B9\u30C6\u30C3\u30D7\u306B\u9032\u3080
93140
+ - \u30AB\u30B9\u30BF\u30DE\u30FC\u304C **0\u4EF6** \u306E\u5834\u5408\u306F\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u3092\u4E2D\u65AD\u3057\u3001\u30E6\u30FC\u30B6\u30FC\u306B\u30A2\u30AF\u30BB\u30B9\u53EF\u80FD\u306A\u30A2\u30AB\u30A6\u30F3\u30C8\u304C\u306A\u3044\u65E8\u3092\u4F1D\u3048\u308B
93141
+ 3. \u30E6\u30FC\u30B6\u30FC\u304C\u9078\u629E\u3057\u305F\u30AB\u30B9\u30BF\u30DE\u30FC\u306E \`label\` \u304C\u30E1\u30C3\u30BB\u30FC\u30B8\u3068\u3057\u3066\u5C4A\u304F\u306E\u3067\u3001\u6B21\u306E\u30B9\u30C6\u30C3\u30D7\u306B\u9032\u3080
93138
93142
 
93139
93143
  #### \u5236\u7D04
93140
93144
  - **\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u4E2D\u306B\u30EC\u30DD\u30FC\u30C8\u30C7\u30FC\u30BF\u3092\u53D6\u5F97\u3057\u306A\u3044\u3053\u3068**\u3002\u5B9F\u884C\u3057\u3066\u3088\u3044\u306E\u306F\u4E0A\u8A18\u624B\u9806\u3067\u6307\u5B9A\u3055\u308C\u305F\u30E1\u30BF\u30C7\u30FC\u30BF\u53D6\u5F97\u306E\u307F
93141
93145
  - \u30C4\u30FC\u30EB\u9593\u306F1\u6587\u3060\u3051\u66F8\u3044\u3066\u5373\u6B21\u306E\u30C4\u30FC\u30EB\u547C\u3073\u51FA\u3057\u3002\u4E0D\u8981\u306A\u8AAC\u660E\u306F\u7701\u7565\u3057\u3001\u52B9\u7387\u7684\u306B\u9032\u3081\u308B`,
93142
93146
  en: `Follow these steps to set up the Google Ads (OAuth) connection.
93143
93147
 
93144
- 1. Ask the user to provide their Google Ads API Developer Token (available in Google Ads UI > Tools & Settings > API Center)
93148
+ 1. Call \`${listCustomersToolName}\` to get the list of Google Ads customer accounts accessible with the OAuth credentials
93145
93149
  2. Call \`updateConnectionParameters\`:
93146
- - \`parameterSlug\`: \`"developer-token"\`
93147
- - \`value\`: The Developer Token provided by the user
93148
- 3. Call \`${listCustomersToolName}\` to get the list of Google Ads customer accounts accessible with the OAuth credentials
93149
- 4. Call \`updateConnectionParameters\`:
93150
93150
  - \`parameterSlug\`: \`"customer-id"\`
93151
93151
  - \`options\`: The customer list. Each option's \`label\` should be \`Account Name (id: customerId)\`, \`value\` should be the customer ID
93152
- 5. The \`label\` of the user's selected customer will arrive as a message. Proceed to the next step
93152
+ - If **0 customers** are returned, abort setup and inform the user that no accessible accounts are available
93153
+ 3. The \`label\` of the user's selected customer will arrive as a message. Proceed to the next step
93153
93154
 
93154
93155
  #### Constraints
93155
93156
  - **Do NOT fetch report data during setup**. Only the metadata requests specified in the steps above are allowed
@@ -93163,9 +93164,21 @@ var googleAdsOnboarding = new ConnectorOnboarding({
93163
93164
  }
93164
93165
  });
93165
93166
 
93167
+ // ../connectors/src/connectors/google-ads/parameters.ts
93168
+ var parameters12 = {
93169
+ customerId: new ParameterDefinition({
93170
+ slug: "customer-id",
93171
+ name: "Google Ads Customer ID",
93172
+ description: "The Google Ads customer ID (e.g., 123-456-7890 or 1234567890). Can be found in the top-right corner of your Google Ads account.",
93173
+ envVarBaseKey: "GOOGLE_ADS_CUSTOMER_ID",
93174
+ type: "text",
93175
+ secret: false,
93176
+ required: false
93177
+ })
93178
+ };
93179
+
93166
93180
  // ../connectors/src/connectors/google-ads/tools/request.ts
93167
93181
  import { z as z19 } from "zod";
93168
- var BASE_URL3 = "https://googleads.googleapis.com/v18/";
93169
93182
  var REQUEST_TIMEOUT_MS9 = 6e4;
93170
93183
  var cachedToken5 = null;
93171
93184
  async function getProxyToken5(config) {
@@ -93205,7 +93218,7 @@ var inputSchema19 = z19.object({
93205
93218
  connectionId: z19.string().describe("ID of the Google Ads OAuth connection to use"),
93206
93219
  method: z19.enum(["GET", "POST"]).describe("HTTP method"),
93207
93220
  path: z19.string().describe(
93208
- "API path appended to https://googleads.googleapis.com/v18/ (e.g., 'customers/{customerId}/googleAds:searchStream'). {customerId} is automatically replaced."
93221
+ "API path appended to https://googleads.googleapis.com/<version>/ (e.g., 'customers/{customerId}/googleAds:searchStream'). The API version is auto-managed and {customerId} is automatically replaced."
93209
93222
  ),
93210
93223
  body: z19.record(z19.string(), z19.unknown()).optional().describe("POST request body (JSON)")
93211
93224
  });
@@ -93222,7 +93235,7 @@ var outputSchema19 = z19.discriminatedUnion("success", [
93222
93235
  ]);
93223
93236
  var requestTool2 = new ConnectorTool({
93224
93237
  name: "request",
93225
- description: `Send authenticated requests to the Google Ads API v18.
93238
+ description: `Send authenticated requests to the Google Ads API.
93226
93239
  Authentication is handled automatically via OAuth proxy.
93227
93240
  {customerId} in the path is automatically replaced with the connection's customer ID (hyphens removed).`,
93228
93241
  inputSchema: inputSchema19,
@@ -93242,31 +93255,30 @@ Authentication is handled automatically via OAuth proxy.
93242
93255
  const rawCustomerId = parameters12.customerId.tryGetValue(connection);
93243
93256
  const customerId = rawCustomerId?.replace(/-/g, "") ?? "";
93244
93257
  const resolvedPath = customerId ? path5.replace(/\{customerId\}/g, customerId) : path5;
93245
- const url = `${BASE_URL3}${resolvedPath}`;
93246
93258
  const token = await getProxyToken5(config.oauthProxy);
93247
93259
  const proxyUrl = `https://${config.oauthProxy.sandboxId}.${config.oauthProxy.previewBaseDomain}/_sqcore/connections/${connectionId}/request`;
93248
93260
  const controller = new AbortController();
93249
93261
  const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS9);
93250
93262
  try {
93251
- const developerToken = parameters12.developerToken.getValue(connection);
93252
- const response = await fetch(proxyUrl, {
93253
- method: "POST",
93254
- headers: {
93255
- "Content-Type": "application/json",
93256
- Authorization: `Bearer ${token}`
93257
- },
93258
- body: JSON.stringify({
93259
- url,
93260
- method,
93263
+ const response = await fetchGoogleAdsWithVersionFallback(
93264
+ (baseUrl) => fetch(proxyUrl, {
93265
+ method: "POST",
93261
93266
  headers: {
93262
93267
  "Content-Type": "application/json",
93263
- "developer-token": developerToken,
93264
- ...customerId ? { "login-customer-id": customerId } : {}
93268
+ Authorization: `Bearer ${token}`
93265
93269
  },
93266
- ...method === "POST" && body ? { body: JSON.stringify(body) } : {}
93267
- }),
93268
- signal: controller.signal
93269
- });
93270
+ body: JSON.stringify({
93271
+ url: `${baseUrl}${resolvedPath}`,
93272
+ method,
93273
+ headers: {
93274
+ "Content-Type": "application/json",
93275
+ ...customerId ? { "login-customer-id": customerId } : {}
93276
+ },
93277
+ ...method === "POST" && body ? { body: JSON.stringify(body) } : {}
93278
+ }),
93279
+ signal: controller.signal
93280
+ })
93281
+ );
93270
93282
  const data = await response.json();
93271
93283
  if (!response.ok) {
93272
93284
  const dataObj = data;
@@ -93441,26 +93453,22 @@ const customerIds = await ads.listAccessibleCustomers();
93441
93453
  if (!customerId) {
93442
93454
  return { success: true };
93443
93455
  }
93444
- const developerToken = params[parameters12.developerToken.slug];
93445
- if (!developerToken) {
93446
- return {
93447
- success: false,
93448
- error: "Developer token is required"
93449
- };
93450
- }
93451
- const url = `https://googleads.googleapis.com/v18/customers/${customerId}/googleAds:searchStream`;
93452
93456
  try {
93453
- const res = await proxyFetch(url, {
93454
- method: "POST",
93455
- headers: {
93456
- "Content-Type": "application/json",
93457
- "developer-token": developerToken,
93458
- "login-customer-id": customerId
93459
- },
93460
- body: JSON.stringify({
93461
- query: "SELECT customer.id FROM customer LIMIT 1"
93462
- })
93463
- });
93457
+ const res = await fetchGoogleAdsWithVersionFallback(
93458
+ (baseUrl) => proxyFetch(
93459
+ `${baseUrl}customers/${customerId}/googleAds:searchStream`,
93460
+ {
93461
+ method: "POST",
93462
+ headers: {
93463
+ "Content-Type": "application/json",
93464
+ "login-customer-id": customerId
93465
+ },
93466
+ body: JSON.stringify({
93467
+ query: "SELECT customer.id FROM customer LIMIT 1"
93468
+ })
93469
+ }
93470
+ )
93471
+ );
93464
93472
  if (!res.ok) {
93465
93473
  const errorText = await res.text().catch(() => res.statusText);
93466
93474
  return {
@@ -93512,7 +93520,7 @@ var parameters13 = {
93512
93520
 
93513
93521
  // ../connectors/src/connectors/google-analytics/tools/request.ts
93514
93522
  import { z as z20 } from "zod";
93515
- var BASE_URL4 = "https://analyticsdata.googleapis.com/v1beta/";
93523
+ var BASE_URL2 = "https://analyticsdata.googleapis.com/v1beta/";
93516
93524
  var REQUEST_TIMEOUT_MS10 = 6e4;
93517
93525
  var inputSchema20 = z20.object({
93518
93526
  toolUseIntent: z20.string().optional().describe("Brief description of what you intend to accomplish with this tool call"),
@@ -93561,7 +93569,7 @@ Authentication is handled automatically using a service account.
93561
93569
  return { success: false, error: "Failed to obtain access token" };
93562
93570
  }
93563
93571
  const resolvedPath = path5.replace(/\{propertyId\}/g, propertyId);
93564
- const url = `${BASE_URL4}${resolvedPath}`;
93572
+ const url = `${BASE_URL2}${resolvedPath}`;
93565
93573
  const controller = new AbortController();
93566
93574
  const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS10);
93567
93575
  try {
@@ -94041,7 +94049,7 @@ var parameters14 = {
94041
94049
 
94042
94050
  // ../connectors/src/connectors/google-analytics-oauth/tools/request.ts
94043
94051
  import { z as z23 } from "zod";
94044
- var BASE_URL5 = "https://analyticsdata.googleapis.com/v1beta/";
94052
+ var BASE_URL3 = "https://analyticsdata.googleapis.com/v1beta/";
94045
94053
  var REQUEST_TIMEOUT_MS13 = 6e4;
94046
94054
  var cachedToken8 = null;
94047
94055
  async function getProxyToken8(config) {
@@ -94117,7 +94125,7 @@ Authentication is handled automatically via OAuth proxy.
94117
94125
  try {
94118
94126
  const propertyId = parameters14.propertyId.tryGetValue(connection);
94119
94127
  const resolvedPath = propertyId ? path5.replace(/\{propertyId\}/g, propertyId) : path5;
94120
- const url = `${BASE_URL5}${resolvedPath}`;
94128
+ const url = `${BASE_URL3}${resolvedPath}`;
94121
94129
  const token = await getProxyToken8(config.oauthProxy);
94122
94130
  const proxyUrl = `https://${config.oauthProxy.sandboxId}.${config.oauthProxy.previewBaseDomain}/_sqcore/connections/${connectionId}/request`;
94123
94131
  const controller = new AbortController();
@@ -94385,7 +94393,7 @@ var parameters15 = {
94385
94393
  // ../connectors/src/connectors/google-calendar/tools/request.ts
94386
94394
  var BASE_HOST = "https://www.googleapis.com";
94387
94395
  var BASE_PATH_SEGMENT = "/calendar/v3";
94388
- var BASE_URL6 = `${BASE_HOST}${BASE_PATH_SEGMENT}`;
94396
+ var BASE_URL4 = `${BASE_HOST}${BASE_PATH_SEGMENT}`;
94389
94397
  var REQUEST_TIMEOUT_MS14 = 6e4;
94390
94398
  function decodeServiceAccount(keyJsonBase64) {
94391
94399
  const decoded = Buffer.from(keyJsonBase64, "base64").toString("utf-8");
@@ -94465,7 +94473,7 @@ var requestTool5 = new ConnectorTool({
94465
94473
  };
94466
94474
  }
94467
94475
  const normalizedPath = normalizeRequestPath(path5, BASE_PATH_SEGMENT);
94468
- let url = `${BASE_URL6}${normalizedPath}`;
94476
+ let url = `${BASE_URL4}${normalizedPath}`;
94469
94477
  if (queryParams) {
94470
94478
  const searchParams = new URLSearchParams(queryParams);
94471
94479
  url += `?${searchParams.toString()}`;
@@ -94517,7 +94525,7 @@ var requestTool5 = new ConnectorTool({
94517
94525
  import { z as z25 } from "zod";
94518
94526
  var BASE_HOST2 = "https://www.googleapis.com";
94519
94527
  var BASE_PATH_SEGMENT2 = "/calendar/v3";
94520
- var BASE_URL7 = `${BASE_HOST2}${BASE_PATH_SEGMENT2}`;
94528
+ var BASE_URL5 = `${BASE_HOST2}${BASE_PATH_SEGMENT2}`;
94521
94529
  var REQUEST_TIMEOUT_MS15 = 6e4;
94522
94530
  function decodeServiceAccount2(keyJsonBase64) {
94523
94531
  const decoded = Buffer.from(keyJsonBase64, "base64").toString("utf-8");
@@ -94603,7 +94611,7 @@ var requestWithDelegationTool = new ConnectorTool({
94603
94611
  };
94604
94612
  }
94605
94613
  const normalizedPath = normalizeRequestPath(path5, BASE_PATH_SEGMENT2);
94606
- let url = `${BASE_URL7}${normalizedPath}`;
94614
+ let url = `${BASE_URL5}${normalizedPath}`;
94607
94615
  if (queryParams) {
94608
94616
  const searchParams = new URLSearchParams(queryParams);
94609
94617
  url += `?${searchParams.toString()}`;
@@ -95083,7 +95091,7 @@ export default async function handler(c: Context) {
95083
95091
 
95084
95092
  // ../connectors/src/connectors/google-calendar-oauth/tools/list-calendars.ts
95085
95093
  import { z as z26 } from "zod";
95086
- var BASE_URL8 = "https://www.googleapis.com/calendar/v3";
95094
+ var BASE_URL6 = "https://www.googleapis.com/calendar/v3";
95087
95095
  var REQUEST_TIMEOUT_MS16 = 6e4;
95088
95096
  var cachedToken9 = null;
95089
95097
  async function getProxyToken9(config) {
@@ -95156,7 +95164,7 @@ var listCalendarsTool = new ConnectorTool({
95156
95164
  `[connector-request] google-calendar-oauth/${connection.name}: listCalendars`
95157
95165
  );
95158
95166
  try {
95159
- const url = `${BASE_URL8}/users/me/calendarList`;
95167
+ const url = `${BASE_URL6}/users/me/calendarList`;
95160
95168
  const token = await getProxyToken9(config.oauthProxy);
95161
95169
  const proxyUrl = `https://${config.oauthProxy.sandboxId}.${config.oauthProxy.previewBaseDomain}/_sqcore/connections/${connectionId}/request`;
95162
95170
  const controller = new AbortController();
@@ -95253,7 +95261,7 @@ var parameters16 = {
95253
95261
  import { z as z27 } from "zod";
95254
95262
  var BASE_HOST3 = "https://www.googleapis.com";
95255
95263
  var BASE_PATH_SEGMENT3 = "/calendar/v3";
95256
- var BASE_URL9 = `${BASE_HOST3}${BASE_PATH_SEGMENT3}`;
95264
+ var BASE_URL7 = `${BASE_HOST3}${BASE_PATH_SEGMENT3}`;
95257
95265
  var REQUEST_TIMEOUT_MS17 = 6e4;
95258
95266
  var cachedToken10 = null;
95259
95267
  async function getProxyToken10(config) {
@@ -95334,7 +95342,7 @@ Authentication is handled automatically via OAuth proxy.
95334
95342
  resolvedPath,
95335
95343
  BASE_PATH_SEGMENT3
95336
95344
  );
95337
- let url = `${BASE_URL9}${normalizedPath}`;
95345
+ let url = `${BASE_URL7}${normalizedPath}`;
95338
95346
  if (queryParams) {
95339
95347
  const searchParams = new URLSearchParams(queryParams);
95340
95348
  url += `?${searchParams.toString()}`;
@@ -95872,7 +95880,7 @@ var parameters18 = {};
95872
95880
  import { z as z29 } from "zod";
95873
95881
  var BASE_HOST4 = "https://www.googleapis.com";
95874
95882
  var BASE_PATH_SEGMENT4 = "/drive/v3";
95875
- var BASE_URL10 = `${BASE_HOST4}${BASE_PATH_SEGMENT4}`;
95883
+ var BASE_URL8 = `${BASE_HOST4}${BASE_PATH_SEGMENT4}`;
95876
95884
  var REQUEST_TIMEOUT_MS19 = 6e4;
95877
95885
  var cachedToken12 = null;
95878
95886
  async function getProxyToken12(config) {
@@ -95948,7 +95956,7 @@ Authentication is handled automatically via OAuth proxy.`,
95948
95956
  );
95949
95957
  try {
95950
95958
  const normalizedPath = normalizeRequestPath(path5, BASE_PATH_SEGMENT4);
95951
- let url = `${BASE_URL10}${normalizedPath}`;
95959
+ let url = `${BASE_URL8}${normalizedPath}`;
95952
95960
  if (queryParams) {
95953
95961
  const searchParams = new URLSearchParams(queryParams);
95954
95962
  url += `?${searchParams.toString()}`;
@@ -96989,7 +96997,7 @@ await slides.batchUpdate(presentationId, [
96989
96997
 
96990
96998
  // ../connectors/src/connectors/hubspot-oauth/tools/request.ts
96991
96999
  import { z as z32 } from "zod";
96992
- var BASE_URL11 = "https://api.hubapi.com";
97000
+ var BASE_URL9 = "https://api.hubapi.com";
96993
97001
  var REQUEST_TIMEOUT_MS22 = 6e4;
96994
97002
  var cachedToken15 = null;
96995
97003
  async function getProxyToken15(config) {
@@ -97063,7 +97071,7 @@ Authentication is handled automatically via OAuth proxy.`,
97063
97071
  `[connector-request] hubspot-oauth/${connection.name}: ${method} ${path5}`
97064
97072
  );
97065
97073
  try {
97066
- let url = `${BASE_URL11}${path5.startsWith("/") ? "" : "/"}${path5}`;
97074
+ let url = `${BASE_URL9}${path5.startsWith("/") ? "" : "/"}${path5}`;
97067
97075
  if (queryParams) {
97068
97076
  const searchParams = new URLSearchParams(queryParams);
97069
97077
  url += `?${searchParams.toString()}`;
@@ -97279,7 +97287,7 @@ const data = await res.json();
97279
97287
 
97280
97288
  // ../connectors/src/connectors/stripe-oauth/tools/request.ts
97281
97289
  import { z as z33 } from "zod";
97282
- var BASE_URL12 = "https://api.stripe.com";
97290
+ var BASE_URL10 = "https://api.stripe.com";
97283
97291
  var REQUEST_TIMEOUT_MS23 = 6e4;
97284
97292
  var cachedToken16 = null;
97285
97293
  async function getProxyToken16(config) {
@@ -97353,7 +97361,7 @@ Authentication is handled automatically via OAuth proxy.`,
97353
97361
  `[connector-request] stripe-oauth/${connection.name}: ${method} ${path5}`
97354
97362
  );
97355
97363
  try {
97356
- let url = `${BASE_URL12}${path5.startsWith("/") ? "" : "/"}${path5}`;
97364
+ let url = `${BASE_URL10}${path5.startsWith("/") ? "" : "/"}${path5}`;
97357
97365
  if (queryParams) {
97358
97366
  const searchParams = new URLSearchParams(queryParams);
97359
97367
  url += `?${searchParams.toString()}`;
@@ -97591,7 +97599,7 @@ var parameters23 = {
97591
97599
  };
97592
97600
 
97593
97601
  // ../connectors/src/connectors/stripe-api-key/tools/request.ts
97594
- var BASE_URL13 = "https://api.stripe.com";
97602
+ var BASE_URL11 = "https://api.stripe.com";
97595
97603
  var REQUEST_TIMEOUT_MS24 = 6e4;
97596
97604
  var inputSchema34 = z34.object({
97597
97605
  toolUseIntent: z34.string().optional().describe(
@@ -97640,7 +97648,7 @@ Use this tool for all Stripe API interactions: querying charges, customers, invo
97640
97648
  );
97641
97649
  try {
97642
97650
  const apiKey = parameters23.apiKey.getValue(connection);
97643
- let url = `${BASE_URL13}${path5.startsWith("/") ? "" : "/"}${path5}`;
97651
+ let url = `${BASE_URL11}${path5.startsWith("/") ? "" : "/"}${path5}`;
97644
97652
  if (queryParams) {
97645
97653
  const searchParams = new URLSearchParams(queryParams);
97646
97654
  url += `?${searchParams.toString()}`;
@@ -97882,7 +97890,7 @@ var parameters24 = {
97882
97890
  };
97883
97891
 
97884
97892
  // ../connectors/src/connectors/airtable-oauth/tools/request.ts
97885
- var BASE_URL14 = "https://api.airtable.com/v0";
97893
+ var BASE_URL12 = "https://api.airtable.com/v0";
97886
97894
  var REQUEST_TIMEOUT_MS25 = 6e4;
97887
97895
  var cachedToken17 = null;
97888
97896
  async function getProxyToken17(config) {
@@ -97959,7 +97967,7 @@ Authentication is handled automatically via OAuth proxy.
97959
97967
  try {
97960
97968
  const baseId = parameters24.baseId.tryGetValue(connection);
97961
97969
  const resolvedPath = baseId ? path5.replace(/\{baseId\}/g, baseId) : path5;
97962
- let url = `${BASE_URL14}${resolvedPath.startsWith("/") ? "" : "/"}${resolvedPath}`;
97970
+ let url = `${BASE_URL12}${resolvedPath.startsWith("/") ? "" : "/"}${resolvedPath}`;
97963
97971
  if (queryParams) {
97964
97972
  const searchParams = new URLSearchParams(queryParams);
97965
97973
  url += `?${searchParams.toString()}`;
@@ -98812,7 +98820,7 @@ var parameters27 = {
98812
98820
 
98813
98821
  // ../connectors/src/connectors/wix-store/tools/request.ts
98814
98822
  import { z as z38 } from "zod";
98815
- var BASE_URL15 = "https://www.wixapis.com/";
98823
+ var BASE_URL13 = "https://www.wixapis.com/";
98816
98824
  var REQUEST_TIMEOUT_MS28 = 6e4;
98817
98825
  var inputSchema38 = z38.object({
98818
98826
  toolUseIntent: z38.string().optional().describe("Brief description of what you intend to accomplish with this tool call"),
@@ -98847,7 +98855,7 @@ Authentication is handled automatically using the API Key and Site ID.`,
98847
98855
  try {
98848
98856
  const apiKey = parameters27.apiKey.getValue(connection);
98849
98857
  const siteId = parameters27.siteId.getValue(connection);
98850
- const url = `${BASE_URL15}${path5}`;
98858
+ const url = `${BASE_URL13}${path5}`;
98851
98859
  const controller = new AbortController();
98852
98860
  const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS28);
98853
98861
  try {
@@ -100127,7 +100135,7 @@ var parameters34 = {
100127
100135
 
100128
100136
  // ../connectors/src/connectors/attio/tools/request.ts
100129
100137
  import { z as z42 } from "zod";
100130
- var BASE_URL16 = "https://api.attio.com/v2";
100138
+ var BASE_URL14 = "https://api.attio.com/v2";
100131
100139
  var REQUEST_TIMEOUT_MS31 = 6e4;
100132
100140
  var inputSchema42 = z42.object({
100133
100141
  toolUseIntent: z42.string().optional().describe(
@@ -100174,7 +100182,7 @@ Record queries use POST /objects/{object}/records/query with a JSON body contain
100174
100182
  );
100175
100183
  try {
100176
100184
  const apiKey = parameters34.apiKey.getValue(connection);
100177
- const url = `${BASE_URL16}${path5}`;
100185
+ const url = `${BASE_URL14}${path5}`;
100178
100186
  const controller = new AbortController();
100179
100187
  const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS31);
100180
100188
  try {
@@ -101142,7 +101150,7 @@ var parameters37 = {
101142
101150
 
101143
101151
  // ../connectors/src/connectors/hubspot/tools/request.ts
101144
101152
  import { z as z45 } from "zod";
101145
- var BASE_URL17 = "https://api.hubapi.com";
101153
+ var BASE_URL15 = "https://api.hubapi.com";
101146
101154
  var REQUEST_TIMEOUT_MS34 = 6e4;
101147
101155
  var inputSchema45 = z45.object({
101148
101156
  toolUseIntent: z45.string().optional().describe(
@@ -101189,7 +101197,7 @@ Use the search endpoint (POST /crm/v3/objects/{objectType}/search) for complex q
101189
101197
  );
101190
101198
  try {
101191
101199
  const apiKey = parameters37.apiKey.getValue(connection);
101192
- const url = `${BASE_URL17}${path5.startsWith("/") ? "" : "/"}${path5}`;
101200
+ const url = `${BASE_URL15}${path5.startsWith("/") ? "" : "/"}${path5}`;
101193
101201
  const controller = new AbortController();
101194
101202
  const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS34);
101195
101203
  try {
@@ -101675,7 +101683,7 @@ var parameters39 = {
101675
101683
 
101676
101684
  // ../connectors/src/connectors/linear/tools/request.ts
101677
101685
  import { z as z47 } from "zod";
101678
- var BASE_URL18 = "https://api.linear.app/graphql";
101686
+ var BASE_URL16 = "https://api.linear.app/graphql";
101679
101687
  var REQUEST_TIMEOUT_MS36 = 6e4;
101680
101688
  var inputSchema47 = z47.object({
101681
101689
  toolUseIntent: z47.string().optional().describe(
@@ -101725,7 +101733,7 @@ Archived resources are hidden by default; pass includeArchived: true in query ar
101725
101733
  try {
101726
101734
  const body = { query };
101727
101735
  if (variables) body.variables = variables;
101728
- const response = await fetch(BASE_URL18, {
101736
+ const response = await fetch(BASE_URL16, {
101729
101737
  method: "POST",
101730
101738
  headers: {
101731
101739
  Authorization: apiKey,
@@ -101933,7 +101941,7 @@ var parameters40 = {
101933
101941
  import { z as z48 } from "zod";
101934
101942
  var BASE_HOST5 = "https://app.asana.com";
101935
101943
  var BASE_PATH_SEGMENT5 = "/api/1.0";
101936
- var BASE_URL19 = `${BASE_HOST5}${BASE_PATH_SEGMENT5}`;
101944
+ var BASE_URL17 = `${BASE_HOST5}${BASE_PATH_SEGMENT5}`;
101937
101945
  var REQUEST_TIMEOUT_MS37 = 6e4;
101938
101946
  var inputSchema48 = z48.object({
101939
101947
  toolUseIntent: z48.string().optional().describe(
@@ -101998,7 +102006,7 @@ Pagination: Use limit (1-100) and offset query parameters. The response includes
101998
102006
  try {
101999
102007
  const token = parameters40.personalAccessToken.getValue(connection);
102000
102008
  const normalizedPath = normalizeRequestPath(path5, BASE_PATH_SEGMENT5);
102001
- const url = `${BASE_URL19}${normalizedPath}`;
102009
+ const url = `${BASE_URL17}${normalizedPath}`;
102002
102010
  const controller = new AbortController();
102003
102011
  const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS37);
102004
102012
  try {
@@ -102871,7 +102879,7 @@ var parameters43 = {
102871
102879
 
102872
102880
  // ../connectors/src/connectors/notion/tools/request.ts
102873
102881
  import { z as z53 } from "zod";
102874
- var BASE_URL20 = "https://api.notion.com/v1";
102882
+ var BASE_URL18 = "https://api.notion.com/v1";
102875
102883
  var NOTION_VERSION = "2022-06-28";
102876
102884
  var REQUEST_TIMEOUT_MS38 = 6e4;
102877
102885
  var inputSchema53 = z53.object({
@@ -102919,7 +102927,7 @@ Pagination uses cursor-based start_cursor and page_size (max 100).`,
102919
102927
  );
102920
102928
  try {
102921
102929
  const apiKey = parameters43.apiKey.getValue(connection);
102922
- const url = `${BASE_URL20}${path5.startsWith("/") ? "" : "/"}${path5}`;
102930
+ const url = `${BASE_URL18}${path5.startsWith("/") ? "" : "/"}${path5}`;
102923
102931
  const controller = new AbortController();
102924
102932
  const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS38);
102925
102933
  try {
@@ -103108,7 +103116,7 @@ export default async function handler(c: Context) {
103108
103116
 
103109
103117
  // ../connectors/src/connectors/notion-oauth/tools/request.ts
103110
103118
  import { z as z54 } from "zod";
103111
- var BASE_URL21 = "https://api.notion.com/v1";
103119
+ var BASE_URL19 = "https://api.notion.com/v1";
103112
103120
  var NOTION_VERSION2 = "2022-06-28";
103113
103121
  var REQUEST_TIMEOUT_MS39 = 6e4;
103114
103122
  var cachedToken19 = null;
@@ -103184,7 +103192,7 @@ Pagination uses cursor-based start_cursor and page_size (max 100).`,
103184
103192
  `[connector-request] notion-oauth/${connection.name}: ${method} ${path5}`
103185
103193
  );
103186
103194
  try {
103187
- const url = `${BASE_URL21}${path5.startsWith("/") ? "" : "/"}${path5}`;
103195
+ const url = `${BASE_URL19}${path5.startsWith("/") ? "" : "/"}${path5}`;
103188
103196
  const token = await getProxyToken19(config.oauthProxy);
103189
103197
  const proxyUrl = `https://${config.oauthProxy.sandboxId}.${config.oauthProxy.previewBaseDomain}/_sqcore/connections/${connectionId}/request`;
103190
103198
  const controller = new AbortController();
@@ -103433,7 +103441,7 @@ var parameters45 = {
103433
103441
  };
103434
103442
 
103435
103443
  // ../connectors/src/connectors/meta-ads/tools/list-ad-accounts.ts
103436
- var BASE_URL22 = "https://graph.facebook.com/v21.0/";
103444
+ var BASE_URL20 = "https://graph.facebook.com/v21.0/";
103437
103445
  var REQUEST_TIMEOUT_MS40 = 6e4;
103438
103446
  var inputSchema55 = z55.object({
103439
103447
  toolUseIntent: z55.string().optional().describe(
@@ -103474,7 +103482,7 @@ var listAdAccountsTool = new ConnectorTool({
103474
103482
  );
103475
103483
  try {
103476
103484
  const accessToken = parameters45.accessToken.getValue(connection);
103477
- const url = `${BASE_URL22}me/adaccounts?fields=account_id,name,account_status&access_token=${encodeURIComponent(accessToken)}`;
103485
+ const url = `${BASE_URL20}me/adaccounts?fields=account_id,name,account_status&access_token=${encodeURIComponent(accessToken)}`;
103478
103486
  const controller = new AbortController();
103479
103487
  const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS40);
103480
103488
  try {
@@ -103543,7 +103551,7 @@ var metaAdsOnboarding = new ConnectorOnboarding({
103543
103551
 
103544
103552
  // ../connectors/src/connectors/meta-ads/tools/request.ts
103545
103553
  import { z as z56 } from "zod";
103546
- var BASE_URL23 = "https://graph.facebook.com/v21.0/";
103554
+ var BASE_URL21 = "https://graph.facebook.com/v21.0/";
103547
103555
  var REQUEST_TIMEOUT_MS41 = 6e4;
103548
103556
  var inputSchema56 = z56.object({
103549
103557
  toolUseIntent: z56.string().optional().describe(
@@ -103590,7 +103598,7 @@ Authentication is handled via the configured access token.
103590
103598
  const accessToken = parameters45.accessToken.getValue(connection);
103591
103599
  const adAccountId = parameters45.adAccountId.tryGetValue(connection) ?? "";
103592
103600
  const resolvedPath = adAccountId ? path5.replace(/\{adAccountId\}/g, adAccountId) : path5;
103593
- let url = `${BASE_URL23}${resolvedPath}`;
103601
+ let url = `${BASE_URL21}${resolvedPath}`;
103594
103602
  const params = new URLSearchParams(queryParams ?? {});
103595
103603
  params.set("access_token", accessToken);
103596
103604
  const separator = url.includes("?") ? "&" : "?";
@@ -103796,7 +103804,7 @@ const accounts = await meta.listAdAccounts();
103796
103804
 
103797
103805
  // ../connectors/src/connectors/meta-ads-oauth/tools/list-ad-accounts.ts
103798
103806
  import { z as z57 } from "zod";
103799
- var BASE_URL24 = "https://graph.facebook.com/v21.0/";
103807
+ var BASE_URL22 = "https://graph.facebook.com/v21.0/";
103800
103808
  var REQUEST_TIMEOUT_MS42 = 6e4;
103801
103809
  var cachedToken20 = null;
103802
103810
  async function getProxyToken20(config) {
@@ -103879,7 +103887,7 @@ var listAdAccountsTool2 = new ConnectorTool({
103879
103887
  Authorization: `Bearer ${token}`
103880
103888
  },
103881
103889
  body: JSON.stringify({
103882
- url: `${BASE_URL24}me/adaccounts?fields=account_id,name,account_status`,
103890
+ url: `${BASE_URL22}me/adaccounts?fields=account_id,name,account_status`,
103883
103891
  method: "GET"
103884
103892
  }),
103885
103893
  signal: controller.signal
@@ -103958,7 +103966,7 @@ var parameters46 = {
103958
103966
 
103959
103967
  // ../connectors/src/connectors/meta-ads-oauth/tools/request.ts
103960
103968
  import { z as z58 } from "zod";
103961
- var BASE_URL25 = "https://graph.facebook.com/v21.0/";
103969
+ var BASE_URL23 = "https://graph.facebook.com/v21.0/";
103962
103970
  var REQUEST_TIMEOUT_MS43 = 6e4;
103963
103971
  var cachedToken21 = null;
103964
103972
  async function getProxyToken21(config) {
@@ -104035,7 +104043,7 @@ Authentication is handled automatically via OAuth proxy.
104035
104043
  try {
104036
104044
  const adAccountId = parameters46.adAccountId.tryGetValue(connection) ?? "";
104037
104045
  const resolvedPath = adAccountId ? path5.replace(/\{adAccountId\}/g, adAccountId) : path5;
104038
- let url = `${BASE_URL25}${resolvedPath}`;
104046
+ let url = `${BASE_URL23}${resolvedPath}`;
104039
104047
  if (queryParams && Object.keys(queryParams).length > 0) {
104040
104048
  const params = new URLSearchParams(queryParams);
104041
104049
  const separator = url.includes("?") ? "&" : "?";
@@ -104241,7 +104249,7 @@ const data = await res.json();
104241
104249
 
104242
104250
  // ../connectors/src/connectors/tiktok-ads/tools/list-advertisers.ts
104243
104251
  import { z as z59 } from "zod";
104244
- var BASE_URL26 = "https://business-api.tiktok.com/open_api/v1.3/";
104252
+ var BASE_URL24 = "https://business-api.tiktok.com/open_api/v1.3/";
104245
104253
  var REQUEST_TIMEOUT_MS44 = 6e4;
104246
104254
  var cachedToken22 = null;
104247
104255
  async function getProxyToken22(config) {
@@ -104324,7 +104332,7 @@ var listAdvertisersTool = new ConnectorTool({
104324
104332
  Authorization: `Bearer ${token}`
104325
104333
  },
104326
104334
  body: JSON.stringify({
104327
- url: `${BASE_URL26}oauth2/advertiser/get/`,
104335
+ url: `${BASE_URL24}oauth2/advertiser/get/`,
104328
104336
  method: "GET"
104329
104337
  }),
104330
104338
  signal: controller.signal
@@ -104415,7 +104423,7 @@ var parameters47 = {
104415
104423
  import { z as z60 } from "zod";
104416
104424
  var BASE_HOST6 = "https://business-api.tiktok.com";
104417
104425
  var BASE_PATH_SEGMENT6 = "/open_api/v1.3";
104418
- var BASE_URL27 = `${BASE_HOST6}${BASE_PATH_SEGMENT6}`;
104426
+ var BASE_URL25 = `${BASE_HOST6}${BASE_PATH_SEGMENT6}`;
104419
104427
  var REQUEST_TIMEOUT_MS45 = 6e4;
104420
104428
  var cachedToken23 = null;
104421
104429
  async function getProxyToken23(config) {
@@ -104492,7 +104500,7 @@ The advertiser_id is automatically injected if configured.`,
104492
104500
  try {
104493
104501
  const advertiserId = parameters47.advertiserId.tryGetValue(connection) ?? "";
104494
104502
  const normalizedPath = normalizeRequestPath(path5, BASE_PATH_SEGMENT6);
104495
- let url = `${BASE_URL27}${normalizedPath}`;
104503
+ let url = `${BASE_URL25}${normalizedPath}`;
104496
104504
  if (method === "GET") {
104497
104505
  const params = new URLSearchParams(queryParams ?? {});
104498
104506
  if (advertiserId && !params.has("advertiser_id")) {
@@ -105708,7 +105716,7 @@ var parameters51 = {
105708
105716
  // ../connectors/src/connectors/gmail/tools/request-with-delegation.ts
105709
105717
  var BASE_HOST7 = "https://gmail.googleapis.com";
105710
105718
  var BASE_PATH_SEGMENT7 = "/gmail/v1/users";
105711
- var BASE_URL28 = `${BASE_HOST7}${BASE_PATH_SEGMENT7}`;
105719
+ var BASE_URL26 = `${BASE_HOST7}${BASE_PATH_SEGMENT7}`;
105712
105720
  var REQUEST_TIMEOUT_MS49 = 6e4;
105713
105721
  function decodeServiceAccount3(keyJsonBase64) {
105714
105722
  const decoded = Buffer.from(keyJsonBase64, "base64").toString("utf-8");
@@ -105794,7 +105802,7 @@ var requestWithDelegationTool2 = new ConnectorTool({
105794
105802
  };
105795
105803
  }
105796
105804
  const normalizedPath = normalizeRequestPath(path5, BASE_PATH_SEGMENT7);
105797
- let url = `${BASE_URL28}${normalizedPath}`;
105805
+ let url = `${BASE_URL26}${normalizedPath}`;
105798
105806
  if (queryParams) {
105799
105807
  const searchParams = new URLSearchParams(queryParams);
105800
105808
  url += `?${searchParams.toString()}`;
@@ -106115,7 +106123,7 @@ for (const msg of messages.messages ?? []) {
106115
106123
  import { z as z65 } from "zod";
106116
106124
  var BASE_HOST8 = "https://gmail.googleapis.com";
106117
106125
  var BASE_PATH_SEGMENT8 = "/gmail/v1/users";
106118
- var BASE_URL29 = `${BASE_HOST8}${BASE_PATH_SEGMENT8}`;
106126
+ var BASE_URL27 = `${BASE_HOST8}${BASE_PATH_SEGMENT8}`;
106119
106127
  var REQUEST_TIMEOUT_MS50 = 6e4;
106120
106128
  var cachedToken25 = null;
106121
106129
  async function getProxyToken25(config) {
@@ -106192,7 +106200,7 @@ All paths are relative to https://gmail.googleapis.com/gmail/v1/users. Use '/me'
106192
106200
  );
106193
106201
  try {
106194
106202
  const normalizedPath = normalizeRequestPath(path5, BASE_PATH_SEGMENT8);
106195
- let url = `${BASE_URL29}${normalizedPath}`;
106203
+ let url = `${BASE_URL27}${normalizedPath}`;
106196
106204
  if (queryParams) {
106197
106205
  const searchParams = new URLSearchParams(queryParams);
106198
106206
  url += `?${searchParams.toString()}`;
@@ -106504,7 +106512,7 @@ var parameters53 = {
106504
106512
  // ../connectors/src/connectors/google-audit-log/tools/request-with-delegation.ts
106505
106513
  var BASE_HOST9 = "https://admin.googleapis.com";
106506
106514
  var BASE_PATH_SEGMENT9 = "/admin/reports/v1";
106507
- var BASE_URL30 = `${BASE_HOST9}${BASE_PATH_SEGMENT9}`;
106515
+ var BASE_URL28 = `${BASE_HOST9}${BASE_PATH_SEGMENT9}`;
106508
106516
  var REQUEST_TIMEOUT_MS51 = 6e4;
106509
106517
  function decodeServiceAccount4(keyJsonBase64) {
106510
106518
  const decoded = Buffer.from(keyJsonBase64, "base64").toString("utf-8");
@@ -106591,7 +106599,7 @@ var requestWithDelegationTool3 = new ConnectorTool({
106591
106599
  };
106592
106600
  }
106593
106601
  const normalizedPath = normalizeRequestPath(path5, BASE_PATH_SEGMENT9);
106594
- let url = `${BASE_URL30}${normalizedPath}`;
106602
+ let url = `${BASE_URL28}${normalizedPath}`;
106595
106603
  if (queryParams) {
106596
106604
  const searchParams = new URLSearchParams(queryParams);
106597
106605
  url += `?${searchParams.toString()}`;
@@ -106901,7 +106909,7 @@ export default async function handler(c: Context) {
106901
106909
 
106902
106910
  // ../connectors/src/connectors/linkedin-ads/tools/list-ad-accounts.ts
106903
106911
  import { z as z67 } from "zod";
106904
- var BASE_URL31 = "https://api.linkedin.com/rest/";
106912
+ var BASE_URL29 = "https://api.linkedin.com/rest/";
106905
106913
  var LINKEDIN_VERSION = "202603";
106906
106914
  var REQUEST_TIMEOUT_MS52 = 6e4;
106907
106915
  var cachedToken26 = null;
@@ -106985,7 +106993,7 @@ var listAdAccountsTool3 = new ConnectorTool({
106985
106993
  Authorization: `Bearer ${token}`
106986
106994
  },
106987
106995
  body: JSON.stringify({
106988
- url: `${BASE_URL31}adAccounts?q=search&search=(status:(values:List(ACTIVE)))&pageSize=100`,
106996
+ url: `${BASE_URL29}adAccounts?q=search&search=(status:(values:List(ACTIVE)))&pageSize=100`,
106989
106997
  method: "GET",
106990
106998
  headers: {
106991
106999
  "LinkedIn-Version": LINKEDIN_VERSION,
@@ -107068,7 +107076,7 @@ var parameters54 = {
107068
107076
 
107069
107077
  // ../connectors/src/connectors/linkedin-ads/tools/request.ts
107070
107078
  import { z as z68 } from "zod";
107071
- var BASE_URL32 = "https://api.linkedin.com/rest/";
107079
+ var BASE_URL30 = "https://api.linkedin.com/rest/";
107072
107080
  var LINKEDIN_VERSION2 = "202603";
107073
107081
  var REQUEST_TIMEOUT_MS53 = 6e4;
107074
107082
  var cachedToken27 = null;
@@ -107147,7 +107155,7 @@ Required headers (LinkedIn-Version, X-Restli-Protocol-Version) are set automatic
107147
107155
  try {
107148
107156
  const adAccountId = parameters54.adAccountId.tryGetValue(connection) ?? "";
107149
107157
  const resolvedPath = adAccountId ? path5.replace(/\{adAccountId\}/g, adAccountId) : path5;
107150
- let url = `${BASE_URL32}${resolvedPath}`;
107158
+ let url = `${BASE_URL30}${resolvedPath}`;
107151
107159
  if (queryParams && Object.keys(queryParams).length > 0) {
107152
107160
  const params = new URLSearchParams(queryParams);
107153
107161
  const separator = url.includes("?") ? "&" : "?";
@@ -108103,7 +108111,7 @@ var parameters57 = {
108103
108111
 
108104
108112
  // ../connectors/src/connectors/intercom/tools/request.ts
108105
108113
  import { z as z71 } from "zod";
108106
- var BASE_URL33 = "https://api.intercom.io";
108114
+ var BASE_URL31 = "https://api.intercom.io";
108107
108115
  var API_VERSION = "2.11";
108108
108116
  var REQUEST_TIMEOUT_MS56 = 6e4;
108109
108117
  var inputSchema71 = z71.object({
@@ -108153,7 +108161,7 @@ The Intercom-Version header is set to 2.11 automatically.`,
108153
108161
  );
108154
108162
  try {
108155
108163
  const accessToken = parameters57.accessToken.getValue(connection);
108156
- const url = `${BASE_URL33}${path5.startsWith("/") ? "" : "/"}${path5}`;
108164
+ const url = `${BASE_URL31}${path5.startsWith("/") ? "" : "/"}${path5}`;
108157
108165
  const controller = new AbortController();
108158
108166
  const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS56);
108159
108167
  try {
@@ -108396,7 +108404,7 @@ export default async function handler(c: Context) {
108396
108404
 
108397
108405
  // ../connectors/src/connectors/intercom-oauth/tools/request.ts
108398
108406
  import { z as z72 } from "zod";
108399
- var BASE_URL34 = "https://api.intercom.io";
108407
+ var BASE_URL32 = "https://api.intercom.io";
108400
108408
  var REQUEST_TIMEOUT_MS57 = 6e4;
108401
108409
  var cachedToken29 = null;
108402
108410
  async function getProxyToken29(config) {
@@ -108473,7 +108481,7 @@ Search endpoints (contacts/search, conversations/search) use POST with a query o
108473
108481
  `[connector-request] intercom-oauth/${connection.name}: ${method} ${path5}`
108474
108482
  );
108475
108483
  try {
108476
- let url = `${BASE_URL34}${path5.startsWith("/") ? "" : "/"}${path5}`;
108484
+ let url = `${BASE_URL32}${path5.startsWith("/") ? "" : "/"}${path5}`;
108477
108485
  if (queryParams) {
108478
108486
  const searchParams = new URLSearchParams(queryParams);
108479
108487
  const separator = url.includes("?") ? "&" : "?";
@@ -109586,7 +109594,7 @@ var parameters62 = {
109586
109594
 
109587
109595
  // ../connectors/src/connectors/gamma/tools/request.ts
109588
109596
  import { z as z76 } from "zod";
109589
- var BASE_URL35 = "https://public-api.gamma.app/v1.0";
109597
+ var BASE_URL33 = "https://public-api.gamma.app/v1.0";
109590
109598
  var REQUEST_TIMEOUT_MS61 = 6e4;
109591
109599
  var inputSchema76 = z76.object({
109592
109600
  toolUseIntent: z76.string().optional().describe(
@@ -109631,7 +109639,7 @@ For creating presentations/documents, prefer the gamma_generate tool instead.`,
109631
109639
  );
109632
109640
  try {
109633
109641
  const apiKey = parameters62.apiKey.getValue(connection);
109634
- const url = `${BASE_URL35}${path5}`;
109642
+ const url = `${BASE_URL33}${path5}`;
109635
109643
  const controller = new AbortController();
109636
109644
  const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS61);
109637
109645
  try {
@@ -109663,7 +109671,7 @@ For creating presentations/documents, prefer the gamma_generate tool instead.`,
109663
109671
 
109664
109672
  // ../connectors/src/connectors/gamma/tools/generate.ts
109665
109673
  import { z as z77 } from "zod";
109666
- var BASE_URL36 = "https://public-api.gamma.app/v1.0";
109674
+ var BASE_URL34 = "https://public-api.gamma.app/v1.0";
109667
109675
  var POLL_INTERVAL_MS3 = 5e3;
109668
109676
  var MAX_POLL_DURATION_MS = 3e5;
109669
109677
  var inputSchema77 = z77.object({
@@ -109780,7 +109788,7 @@ Gamma does NOT support image uploads. To visualize data, embed raw numbers direc
109780
109788
  if (textAmount) textOptions.amount = textAmount;
109781
109789
  if (Object.keys(textOptions).length > 0) body.textOptions = textOptions;
109782
109790
  if (imageSource) body.imageOptions = { source: imageSource };
109783
- const createRes = await fetch(`${BASE_URL36}/generations`, {
109791
+ const createRes = await fetch(`${BASE_URL34}/generations`, {
109784
109792
  method: "POST",
109785
109793
  headers,
109786
109794
  body: JSON.stringify(body)
@@ -109800,7 +109808,7 @@ Gamma does NOT support image uploads. To visualize data, embed raw numbers direc
109800
109808
  const deadline = Date.now() + MAX_POLL_DURATION_MS;
109801
109809
  while (Date.now() < deadline) {
109802
109810
  await new Promise((resolve) => setTimeout(resolve, POLL_INTERVAL_MS3));
109803
- const pollRes = await fetch(`${BASE_URL36}/generations/${generationId}`, {
109811
+ const pollRes = await fetch(`${BASE_URL34}/generations/${generationId}`, {
109804
109812
  method: "GET",
109805
109813
  headers
109806
109814
  });
@@ -110038,7 +110046,7 @@ var parameters63 = {
110038
110046
 
110039
110047
  // ../connectors/src/connectors/sentry/tools/request.ts
110040
110048
  import { z as z78 } from "zod";
110041
- var BASE_URL37 = "https://sentry.io/api/0";
110049
+ var BASE_URL35 = "https://sentry.io/api/0";
110042
110050
  var REQUEST_TIMEOUT_MS62 = 6e4;
110043
110051
  var inputSchema78 = z78.object({
110044
110052
  toolUseIntent: z78.string().optional().describe(
@@ -110088,7 +110096,7 @@ Authentication is handled automatically via Bearer token.
110088
110096
  /\{organizationSlug\}/g,
110089
110097
  organizationSlug
110090
110098
  );
110091
- const url = `${BASE_URL37}${resolvedPath.startsWith("/") ? "" : "/"}${resolvedPath}`;
110099
+ const url = `${BASE_URL35}${resolvedPath.startsWith("/") ? "" : "/"}${resolvedPath}`;
110092
110100
  const controller = new AbortController();
110093
110101
  const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS62);
110094
110102
  try {
@@ -111101,7 +111109,7 @@ var parameters66 = {
111101
111109
 
111102
111110
  // ../connectors/src/connectors/monday/tools/request.ts
111103
111111
  import { z as z81 } from "zod";
111104
- var BASE_URL38 = "https://api.monday.com/v2";
111112
+ var BASE_URL36 = "https://api.monday.com/v2";
111105
111113
  var REQUEST_TIMEOUT_MS65 = 6e4;
111106
111114
  var inputSchema81 = z81.object({
111107
111115
  toolUseIntent: z81.string().optional().describe(
@@ -111159,7 +111167,7 @@ Items are paginated with a cursor-based \`items_page(limit, cursor)\` field on a
111159
111167
  "Content-Type": "application/json"
111160
111168
  };
111161
111169
  if (apiVersion) headers["API-Version"] = apiVersion;
111162
- const response = await fetch(BASE_URL38, {
111170
+ const response = await fetch(BASE_URL36, {
111163
111171
  method: "POST",
111164
111172
  headers,
111165
111173
  body: JSON.stringify(body),
@@ -112225,7 +112233,7 @@ var parameters68 = {
112225
112233
  };
112226
112234
 
112227
112235
  // ../connectors/src/connectors/semrush/tools/request.ts
112228
- var BASE_URL39 = "https://api.semrush.com";
112236
+ var BASE_URL37 = "https://api.semrush.com";
112229
112237
  var REQUEST_TIMEOUT_MS66 = 6e4;
112230
112238
  var inputSchema83 = z83.object({
112231
112239
  toolUseIntent: z83.string().optional().describe(
@@ -112305,7 +112313,7 @@ Errors from the Standard API are returned as a plain text body starting with "ER
112305
112313
  }
112306
112314
  }
112307
112315
  const url = new URL(
112308
- isAbsolute ? path5 : `${BASE_URL39}${path5.startsWith("/") ? "" : "/"}${path5}`
112316
+ isAbsolute ? path5 : `${BASE_URL37}${path5.startsWith("/") ? "" : "/"}${path5}`
112309
112317
  );
112310
112318
  if (queryParams) {
112311
112319
  for (const [k6, v] of Object.entries(queryParams)) {
@@ -112663,7 +112671,7 @@ API \u30E6\u30CB\u30C3\u30C8\u6B8B\u91CF\u306E\u78BA\u8A8D\uFF08\u7121\u6599\u30
112663
112671
 
112664
112672
  // ../connectors/src/connectors/google-search-console-oauth/tools/list-sites.ts
112665
112673
  import { z as z84 } from "zod";
112666
- var BASE_URL40 = "https://searchconsole.googleapis.com/webmasters/v3";
112674
+ var BASE_URL38 = "https://searchconsole.googleapis.com/webmasters/v3";
112667
112675
  var REQUEST_TIMEOUT_MS67 = 6e4;
112668
112676
  var cachedToken30 = null;
112669
112677
  async function getProxyToken30(config) {
@@ -112734,7 +112742,7 @@ var listSitesTool = new ConnectorTool({
112734
112742
  `[connector-request] google-search-console-oauth/${connection.name}: listSites`
112735
112743
  );
112736
112744
  try {
112737
- const url = `${BASE_URL40}/sites`;
112745
+ const url = `${BASE_URL38}/sites`;
112738
112746
  const token = await getProxyToken30(config.oauthProxy);
112739
112747
  const proxyUrl = `https://${config.oauthProxy.sandboxId}.${config.oauthProxy.previewBaseDomain}/_sqcore/connections/${connectionId}/request`;
112740
112748
  const controller = new AbortController();
@@ -112833,7 +112841,7 @@ var parameters69 = {
112833
112841
  import { z as z85 } from "zod";
112834
112842
  var BASE_HOST10 = "https://searchconsole.googleapis.com";
112835
112843
  var BASE_PATH_SEGMENT10 = "/webmasters/v3";
112836
- var BASE_URL41 = `${BASE_HOST10}${BASE_PATH_SEGMENT10}`;
112844
+ var BASE_URL39 = `${BASE_HOST10}${BASE_PATH_SEGMENT10}`;
112837
112845
  var REQUEST_TIMEOUT_MS68 = 6e4;
112838
112846
  var cachedToken31 = null;
112839
112847
  async function getProxyToken31(config) {
@@ -112918,7 +112926,7 @@ For URL Inspection API requests, use the absolute path '/v1/urlInspection/index:
112918
112926
  resolvedPath,
112919
112927
  BASE_PATH_SEGMENT10
112920
112928
  );
112921
- let url = `${BASE_URL41}${normalizedPath}`;
112929
+ let url = `${BASE_URL39}${normalizedPath}`;
112922
112930
  if (queryParams) {
112923
112931
  const searchParams = new URLSearchParams(queryParams);
112924
112932
  url += `?${searchParams.toString()}`;
@@ -113408,7 +113416,7 @@ var parameters71 = {
113408
113416
  import { z as z87 } from "zod";
113409
113417
  var BASE_HOST11 = "https://api.clickup.com";
113410
113418
  var BASE_PATH_SEGMENT11 = "/api/v2";
113411
- var BASE_URL42 = `${BASE_HOST11}${BASE_PATH_SEGMENT11}`;
113419
+ var BASE_URL40 = `${BASE_HOST11}${BASE_PATH_SEGMENT11}`;
113412
113420
  var REQUEST_TIMEOUT_MS69 = 6e4;
113413
113421
  var inputSchema87 = z87.object({
113414
113422
  toolUseIntent: z87.string().optional().describe(
@@ -113481,7 +113489,7 @@ Pagination: ClickUp uses zero-indexed \`page\` query parameter on list endpoints
113481
113489
  try {
113482
113490
  const token = parameters71.apiToken.getValue(connection);
113483
113491
  const normalizedPath = normalizeRequestPath(path5, BASE_PATH_SEGMENT11);
113484
- const url = `${BASE_URL42}${normalizedPath}`;
113492
+ const url = `${BASE_URL40}${normalizedPath}`;
113485
113493
  const controller = new AbortController();
113486
113494
  const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS69);
113487
113495
  try {