@squadbase/vite-server 0.1.9-dev.f236b23 → 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/index.js CHANGED
@@ -909,17 +909,17 @@ var require_nacl_fast = __commonJS({
909
909
  }
910
910
  var sigma = new Uint8Array([101, 120, 112, 97, 110, 100, 32, 51, 50, 45, 98, 121, 116, 101, 32, 107]);
911
911
  function crypto_stream_salsa20_xor(c6, cpos, m4, mpos, b6, n2, k6) {
912
- var z96 = new Uint8Array(16), x = new Uint8Array(64);
912
+ var z98 = new Uint8Array(16), x = new Uint8Array(64);
913
913
  var u, i6;
914
- for (i6 = 0; i6 < 16; i6++) z96[i6] = 0;
915
- for (i6 = 0; i6 < 8; i6++) z96[i6] = n2[i6];
914
+ for (i6 = 0; i6 < 16; i6++) z98[i6] = 0;
915
+ for (i6 = 0; i6 < 8; i6++) z98[i6] = n2[i6];
916
916
  while (b6 >= 64) {
917
- crypto_core_salsa20(x, z96, k6, sigma);
917
+ crypto_core_salsa20(x, z98, k6, sigma);
918
918
  for (i6 = 0; i6 < 64; i6++) c6[cpos + i6] = m4[mpos + i6] ^ x[i6];
919
919
  u = 1;
920
920
  for (i6 = 8; i6 < 16; i6++) {
921
- u = u + (z96[i6] & 255) | 0;
922
- z96[i6] = u & 255;
921
+ u = u + (z98[i6] & 255) | 0;
922
+ z98[i6] = u & 255;
923
923
  u >>>= 8;
924
924
  }
925
925
  b6 -= 64;
@@ -927,30 +927,30 @@ var require_nacl_fast = __commonJS({
927
927
  mpos += 64;
928
928
  }
929
929
  if (b6 > 0) {
930
- crypto_core_salsa20(x, z96, k6, sigma);
930
+ crypto_core_salsa20(x, z98, k6, sigma);
931
931
  for (i6 = 0; i6 < b6; i6++) c6[cpos + i6] = m4[mpos + i6] ^ x[i6];
932
932
  }
933
933
  return 0;
934
934
  }
935
935
  function crypto_stream_salsa20(c6, cpos, b6, n2, k6) {
936
- var z96 = new Uint8Array(16), x = new Uint8Array(64);
936
+ var z98 = new Uint8Array(16), x = new Uint8Array(64);
937
937
  var u, i6;
938
- for (i6 = 0; i6 < 16; i6++) z96[i6] = 0;
939
- for (i6 = 0; i6 < 8; i6++) z96[i6] = n2[i6];
938
+ for (i6 = 0; i6 < 16; i6++) z98[i6] = 0;
939
+ for (i6 = 0; i6 < 8; i6++) z98[i6] = n2[i6];
940
940
  while (b6 >= 64) {
941
- crypto_core_salsa20(x, z96, k6, sigma);
941
+ crypto_core_salsa20(x, z98, k6, sigma);
942
942
  for (i6 = 0; i6 < 64; i6++) c6[cpos + i6] = x[i6];
943
943
  u = 1;
944
944
  for (i6 = 8; i6 < 16; i6++) {
945
- u = u + (z96[i6] & 255) | 0;
946
- z96[i6] = u & 255;
945
+ u = u + (z98[i6] & 255) | 0;
946
+ z98[i6] = u & 255;
947
947
  u >>>= 8;
948
948
  }
949
949
  b6 -= 64;
950
950
  cpos += 64;
951
951
  }
952
952
  if (b6 > 0) {
953
- crypto_core_salsa20(x, z96, k6, sigma);
953
+ crypto_core_salsa20(x, z98, k6, sigma);
954
954
  for (i6 = 0; i6 < b6; i6++) c6[cpos + i6] = x[i6];
955
955
  }
956
956
  return 0;
@@ -1830,12 +1830,12 @@ var require_nacl_fast = __commonJS({
1830
1830
  for (a6 = 0; a6 < 16; a6++) o2[a6] = c6[a6];
1831
1831
  }
1832
1832
  function crypto_scalarmult(q2, n2, p2) {
1833
- var z96 = new Uint8Array(32);
1833
+ var z98 = new Uint8Array(32);
1834
1834
  var x = new Float64Array(80), r6, i6;
1835
1835
  var a6 = gf(), b6 = gf(), c6 = gf(), d6 = gf(), e6 = gf(), f6 = gf();
1836
- for (i6 = 0; i6 < 31; i6++) z96[i6] = n2[i6];
1837
- z96[31] = n2[31] & 127 | 64;
1838
- z96[0] &= 248;
1836
+ for (i6 = 0; i6 < 31; i6++) z98[i6] = n2[i6];
1837
+ z98[31] = n2[31] & 127 | 64;
1838
+ z98[0] &= 248;
1839
1839
  unpack25519(x, p2);
1840
1840
  for (i6 = 0; i6 < 16; i6++) {
1841
1841
  b6[i6] = x[i6];
@@ -1843,7 +1843,7 @@ var require_nacl_fast = __commonJS({
1843
1843
  }
1844
1844
  a6[0] = d6[0] = 1;
1845
1845
  for (i6 = 254; i6 >= 0; --i6) {
1846
- r6 = z96[i6 >>> 3] >>> (i6 & 7) & 1;
1846
+ r6 = z98[i6 >>> 3] >>> (i6 & 7) & 1;
1847
1847
  sel25519(a6, b6, r6);
1848
1848
  sel25519(c6, d6, r6);
1849
1849
  A(e6, a6, c6);
@@ -4860,8 +4860,8 @@ var require_poly1305 = __commonJS({
4860
4860
  });
4861
4861
  var u = {}, w;
4862
4862
  for (w in b6) b6.hasOwnProperty(w) && (u[w] = b6[w]);
4863
- var x = "object" === typeof window, y = "function" === typeof importScripts, z96 = "object" === typeof process && "object" === typeof process.versions && "string" === typeof process.versions.node, B = "", C, D, E, F, G;
4864
- if (z96) B = y ? __require("path").dirname(B) + "/" : __dirname + "/", C = function(a6, c6) {
4863
+ var x = "object" === typeof window, y = "function" === typeof importScripts, z98 = "object" === typeof process && "object" === typeof process.versions && "string" === typeof process.versions.node, B = "", C, D, E, F, G;
4864
+ if (z98) B = y ? __require("path").dirname(B) + "/" : __dirname + "/", C = function(a6, c6) {
4865
4865
  var d6 = H(a6);
4866
4866
  if (d6) return c6 ? d6 : d6.toString();
4867
4867
  F || (F = __require("fs"));
@@ -5117,7 +5117,7 @@ var require_poly1305 = __commonJS({
5117
5117
  function H(a6) {
5118
5118
  if (a6.startsWith(V)) {
5119
5119
  a6 = a6.slice(V.length);
5120
- if ("boolean" === typeof z96 && z96) {
5120
+ if ("boolean" === typeof z98 && z98) {
5121
5121
  var c6 = Buffer.from(a6, "base64");
5122
5122
  c6 = new Uint8Array(c6.buffer, c6.byteOffset, c6.byteLength);
5123
5123
  } else try {
@@ -39040,14 +39040,14 @@ var init_NormalizedSchema = __esm({
39040
39040
  throw new Error("@smithy/core/schema - cannot iterate non-struct schema.");
39041
39041
  }
39042
39042
  const struct = this.getSchema();
39043
- const z96 = struct[4].length;
39043
+ const z98 = struct[4].length;
39044
39044
  let it = struct[anno.it];
39045
- if (it && z96 === it.length) {
39045
+ if (it && z98 === it.length) {
39046
39046
  yield* it;
39047
39047
  return;
39048
39048
  }
39049
- it = Array(z96);
39050
- for (let i6 = 0; i6 < z96; ++i6) {
39049
+ it = Array(z98);
39050
+ for (let i6 = 0; i6 < z98; ++i6) {
39051
39051
  const k6 = struct[4][i6];
39052
39052
  const v = member([struct[5][i6], 0], k6);
39053
39053
  yield it[i6] = [k6, v];
@@ -39728,12 +39728,12 @@ var init_split_header = __esm({
39728
39728
  "../../node_modules/@smithy/core/dist-es/submodules/serde/split-header.js"() {
39729
39729
  "use strict";
39730
39730
  splitHeader = (value) => {
39731
- const z96 = value.length;
39731
+ const z98 = value.length;
39732
39732
  const values = [];
39733
39733
  let withinQuotes = false;
39734
39734
  let prevChar = void 0;
39735
39735
  let anchor = 0;
39736
- for (let i6 = 0; i6 < z96; ++i6) {
39736
+ for (let i6 = 0; i6 < z98; ++i6) {
39737
39737
  const char = value[i6];
39738
39738
  switch (char) {
39739
39739
  case `"`:
@@ -39754,12 +39754,12 @@ var init_split_header = __esm({
39754
39754
  values.push(value.slice(anchor));
39755
39755
  return values.map((v) => {
39756
39756
  v = v.trim();
39757
- const z97 = v.length;
39758
- if (z97 < 2) {
39757
+ const z99 = v.length;
39758
+ if (z99 < 2) {
39759
39759
  return v;
39760
39760
  }
39761
- if (v[0] === `"` && v[z97 - 1] === `"`) {
39762
- v = v.slice(1, z97 - 1);
39761
+ if (v[0] === `"` && v[z99 - 1] === `"`) {
39762
+ v = v.slice(1, z99 - 1);
39763
39763
  }
39764
39764
  return v.replace(/\\"/g, '"');
39765
39765
  });
@@ -41196,11 +41196,11 @@ var init_EndpointCache = __esm({
41196
41196
  }
41197
41197
  hash(endpointParams) {
41198
41198
  let buffer = "";
41199
- const { parameters: parameters79 } = this;
41200
- if (parameters79.length === 0) {
41199
+ const { parameters: parameters80 } = this;
41200
+ if (parameters80.length === 0) {
41201
41201
  return false;
41202
41202
  }
41203
- for (const param of parameters79) {
41203
+ for (const param of parameters80) {
41204
41204
  const val = String(endpointParams[param] ?? "");
41205
41205
  if (val.includes("|;")) {
41206
41206
  return false;
@@ -47672,8 +47672,8 @@ var init_ProtocolLib = __esm({
47672
47672
  constructor(queryCompat = false) {
47673
47673
  this.queryCompat = queryCompat;
47674
47674
  }
47675
- resolveRestContentType(defaultContentType, inputSchema95) {
47676
- const members = inputSchema95.getMemberSchemas();
47675
+ resolveRestContentType(defaultContentType, inputSchema97) {
47676
+ const members = inputSchema97.getMemberSchemas();
47677
47677
  const httpPayloadMember = Object.values(members).find((m4) => {
47678
47678
  return !!m4.getMergedTraits().httpPayload;
47679
47679
  });
@@ -47688,7 +47688,7 @@ var init_ProtocolLib = __esm({
47688
47688
  } else {
47689
47689
  return defaultContentType;
47690
47690
  }
47691
- } else if (!inputSchema95.isUnitSchema()) {
47691
+ } else if (!inputSchema97.isUnitSchema()) {
47692
47692
  const hasBody = Object.values(members).find((m4) => {
47693
47693
  const { httpQuery, httpQueryParams, httpHeader, httpLabel, httpPrefixHeaders } = m4.getMergedTraits();
47694
47694
  const noPrefixHeaders = httpPrefixHeaders === void 0;
@@ -48541,9 +48541,9 @@ var init_AwsRestJsonProtocol = __esm({
48541
48541
  }
48542
48542
  async serializeRequest(operationSchema, input, context) {
48543
48543
  const request2 = await super.serializeRequest(operationSchema, input, context);
48544
- const inputSchema95 = NormalizedSchema.of(operationSchema.input);
48544
+ const inputSchema97 = NormalizedSchema.of(operationSchema.input);
48545
48545
  if (!request2.headers["content-type"]) {
48546
- const contentType = this.mixin.resolveRestContentType(this.getDefaultContentType(), inputSchema95);
48546
+ const contentType = this.mixin.resolveRestContentType(this.getDefaultContentType(), inputSchema97);
48547
48547
  if (contentType) {
48548
48548
  request2.headers["content-type"] = contentType;
48549
48549
  }
@@ -48555,8 +48555,8 @@ var init_AwsRestJsonProtocol = __esm({
48555
48555
  }
48556
48556
  async deserializeResponse(operationSchema, context, response) {
48557
48557
  const output = await super.deserializeResponse(operationSchema, context, response);
48558
- const outputSchema95 = NormalizedSchema.of(operationSchema.output);
48559
- for (const [name, member2] of outputSchema95.structIterator()) {
48558
+ const outputSchema97 = NormalizedSchema.of(operationSchema.output);
48559
+ for (const [name, member2] of outputSchema97.structIterator()) {
48560
48560
  if (member2.getMemberTraits().httpPayload && !(name in output)) {
48561
48561
  output[name] = null;
48562
48562
  }
@@ -54374,22 +54374,22 @@ var init_loadCognitoIdentity = __esm({
54374
54374
  });
54375
54375
 
54376
54376
  // ../../node_modules/@aws-sdk/credential-provider-cognito-identity/dist-es/fromCognitoIdentity.js
54377
- function fromCognitoIdentity(parameters79) {
54377
+ function fromCognitoIdentity(parameters80) {
54378
54378
  return async (awsIdentityProperties) => {
54379
- parameters79.logger?.debug("@aws-sdk/credential-provider-cognito-identity - fromCognitoIdentity");
54379
+ parameters80.logger?.debug("@aws-sdk/credential-provider-cognito-identity - fromCognitoIdentity");
54380
54380
  const { GetCredentialsForIdentityCommand: GetCredentialsForIdentityCommand2, CognitoIdentityClient: CognitoIdentityClient2 } = await Promise.resolve().then(() => (init_loadCognitoIdentity(), loadCognitoIdentity_exports));
54381
- const fromConfigs = (property) => parameters79.clientConfig?.[property] ?? parameters79.parentClientConfig?.[property] ?? awsIdentityProperties?.callerClientConfig?.[property];
54382
- const { Credentials: { AccessKeyId = throwOnMissingAccessKeyId(parameters79.logger), Expiration, SecretKey = throwOnMissingSecretKey(parameters79.logger), SessionToken } = throwOnMissingCredentials(parameters79.logger) } = await (parameters79.client ?? new CognitoIdentityClient2(Object.assign({}, parameters79.clientConfig ?? {}, {
54381
+ const fromConfigs = (property) => parameters80.clientConfig?.[property] ?? parameters80.parentClientConfig?.[property] ?? awsIdentityProperties?.callerClientConfig?.[property];
54382
+ const { Credentials: { AccessKeyId = throwOnMissingAccessKeyId(parameters80.logger), Expiration, SecretKey = throwOnMissingSecretKey(parameters80.logger), SessionToken } = throwOnMissingCredentials(parameters80.logger) } = await (parameters80.client ?? new CognitoIdentityClient2(Object.assign({}, parameters80.clientConfig ?? {}, {
54383
54383
  region: fromConfigs("region"),
54384
54384
  profile: fromConfigs("profile"),
54385
54385
  userAgentAppId: fromConfigs("userAgentAppId")
54386
54386
  }))).send(new GetCredentialsForIdentityCommand2({
54387
- CustomRoleArn: parameters79.customRoleArn,
54388
- IdentityId: parameters79.identityId,
54389
- Logins: parameters79.logins ? await resolveLogins(parameters79.logins) : void 0
54387
+ CustomRoleArn: parameters80.customRoleArn,
54388
+ IdentityId: parameters80.identityId,
54389
+ Logins: parameters80.logins ? await resolveLogins(parameters80.logins) : void 0
54390
54390
  }));
54391
54391
  return {
54392
- identityId: parameters79.identityId,
54392
+ identityId: parameters80.identityId,
54393
54393
  accessKeyId: AccessKeyId,
54394
54394
  secretAccessKey: SecretKey,
54395
54395
  sessionToken: SessionToken,
@@ -67146,11 +67146,11 @@ var require_bignumber = __commonJS({
67146
67146
  return n2 > 0 || n2 === i6 ? i6 : i6 - 1;
67147
67147
  }
67148
67148
  function coeffToString(a6) {
67149
- var s, z96, i6 = 1, j6 = a6.length, r6 = a6[0] + "";
67149
+ var s, z98, i6 = 1, j6 = a6.length, r6 = a6[0] + "";
67150
67150
  for (; i6 < j6; ) {
67151
67151
  s = a6[i6++] + "";
67152
- z96 = LOG_BASE - s.length;
67153
- for (; z96--; s = "0" + s) ;
67152
+ z98 = LOG_BASE - s.length;
67153
+ for (; z98--; s = "0" + s) ;
67154
67154
  r6 += s;
67155
67155
  }
67156
67156
  for (j6 = r6.length; r6.charCodeAt(--j6) === 48; ) ;
@@ -67183,15 +67183,15 @@ var require_bignumber = __commonJS({
67183
67183
  function toExponential(str, e6) {
67184
67184
  return (str.length > 1 ? str.charAt(0) + "." + str.slice(1) : str) + (e6 < 0 ? "e" : "e+") + e6;
67185
67185
  }
67186
- function toFixedPoint(str, e6, z96) {
67186
+ function toFixedPoint(str, e6, z98) {
67187
67187
  var len, zs;
67188
67188
  if (e6 < 0) {
67189
- for (zs = z96 + "."; ++e6; zs += z96) ;
67189
+ for (zs = z98 + "."; ++e6; zs += z98) ;
67190
67190
  str = zs + str;
67191
67191
  } else {
67192
67192
  len = str.length;
67193
67193
  if (++e6 > len) {
67194
- for (zs = z96, e6 -= len; --e6; zs += z96) ;
67194
+ for (zs = z98, e6 -= len; --e6; zs += z98) ;
67195
67195
  str += zs;
67196
67196
  } else if (e6 < len) {
67197
67197
  str = str.slice(0, e6) + "." + str.slice(e6);
@@ -89643,6 +89643,12 @@ var NOOP_TUNNEL = (connectionUrl) => ({
89643
89643
  close: async () => {
89644
89644
  }
89645
89645
  });
89646
+ var NOOP_TUNNEL_HOSTPORT = (host, port) => ({
89647
+ host,
89648
+ port,
89649
+ close: async () => {
89650
+ }
89651
+ });
89646
89652
  function connectionParamsToRecord(connection2) {
89647
89653
  const out = {};
89648
89654
  for (const p2 of connection2.parameters) {
@@ -89650,9 +89656,9 @@ function connectionParamsToRecord(connection2) {
89650
89656
  }
89651
89657
  return out;
89652
89658
  }
89653
- async function maybeOpenSshTunnel(params, connectionUrl, defaultDbPort) {
89659
+ async function maybeOpenSshTunnelHostPort(params, dbHost, dbPort) {
89654
89660
  const sshHost = params[sshTunnelParameters.sshHost.slug];
89655
- if (!sshHost) return NOOP_TUNNEL(connectionUrl);
89661
+ if (!sshHost) return NOOP_TUNNEL_HOSTPORT(dbHost, dbPort);
89656
89662
  const sshUsername = params[sshTunnelParameters.sshUsername.slug];
89657
89663
  const sshPrivateKeyBase64 = params[sshTunnelParameters.sshPrivateKeyBase64.slug];
89658
89664
  if (!sshUsername || !sshPrivateKeyBase64) {
@@ -89662,9 +89668,6 @@ async function maybeOpenSshTunnel(params, connectionUrl, defaultDbPort) {
89662
89668
  }
89663
89669
  const sshPort = Number(params[sshTunnelParameters.sshPort.slug] || "22") || 22;
89664
89670
  const sshPassphrase = params[sshTunnelParameters.sshPassphrase.slug];
89665
- const url = new URL(connectionUrl);
89666
- const dbHost = url.hostname;
89667
- const dbPort = url.port ? Number(url.port) : defaultDbPort;
89668
89671
  const [{ Client: Client2 }, net] = await Promise.all([
89669
89672
  Promise.resolve().then(() => __toESM(require_lib3(), 1)),
89670
89673
  import("net")
@@ -89707,16 +89710,29 @@ async function maybeOpenSshTunnel(params, connectionUrl, defaultDbPort) {
89707
89710
  sshClient.end();
89708
89711
  throw new Error("Failed to allocate local port for SSH tunnel.");
89709
89712
  }
89710
- url.hostname = "127.0.0.1";
89711
- url.port = String(address.port);
89712
89713
  return {
89713
- connectionUrl: url.toString(),
89714
+ host: "127.0.0.1",
89715
+ port: address.port,
89714
89716
  close: async () => {
89715
89717
  await new Promise((resolve) => server.close(() => resolve()));
89716
89718
  sshClient.end();
89717
89719
  }
89718
89720
  };
89719
89721
  }
89722
+ async function maybeOpenSshTunnel(params, connectionUrl, defaultDbPort) {
89723
+ const sshHost = params[sshTunnelParameters.sshHost.slug];
89724
+ if (!sshHost) return NOOP_TUNNEL(connectionUrl);
89725
+ const url = new URL(connectionUrl);
89726
+ const dbHost = url.hostname;
89727
+ const dbPort = url.port ? Number(url.port) : defaultDbPort;
89728
+ const tunnel = await maybeOpenSshTunnelHostPort(params, dbHost, dbPort);
89729
+ url.hostname = tunnel.host;
89730
+ url.port = String(tunnel.port);
89731
+ return {
89732
+ connectionUrl: url.toString(),
89733
+ close: tunnel.close
89734
+ };
89735
+ }
89720
89736
 
89721
89737
  // ../connectors/src/connectors/postgresql/setup.ts
89722
89738
  var postgresqlOnboarding = new ConnectorOnboarding({
@@ -91858,9 +91874,16 @@ A Filter is an Expression. Leaves are \`Dimensions\`, \`Tags\`, or \`CostCategor
91858
91874
 
91859
91875
  ### Business Logic
91860
91876
 
91861
- The business logic type for this connector is "typescript". The connector exposes resolved AWS credentials via \`connection(connectionId)\`; pass them to \`@aws-sdk/client-cost-explorer\` directly inside the handler. Do NOT read AWS credentials from environment variables.
91877
+ The business logic type for this connector is "typescript". The connector exposes resolved AWS credentials via \`connection(connectionId)\` (already typed as \`{ accessKeyId, secretAccessKey, region }\` \u2014 do NOT add an \`as\` cast). Pass them to \`@aws-sdk/client-cost-explorer\` directly inside the handler. Do NOT read AWS credentials from environment variables.
91862
91878
 
91863
- #### Example
91879
+ #### Server logic slug naming
91880
+
91881
+ When creating a server logic for this connector, the \`slug\` (file name) MUST be lowercase kebab-case or snake_case \u2014 only \`[a-z0-9-_]\` is allowed. camelCase and uppercase will fail validation.
91882
+
91883
+ - OK: \`monthly-cost-trend\`, \`cost_by_service\`, \`top10-services\`
91884
+ - NG: \`monthlyCostTrend\`, \`MonthlyCostTrend\`, \`monthly cost trend\`
91885
+
91886
+ #### Example (slug: \`monthly-cost-trend\`)
91864
91887
 
91865
91888
  \`\`\`ts
91866
91889
  import type { Context } from "hono";
@@ -91936,9 +91959,16 @@ Filter \u306F Expression \u3067\u3059\u3002\u30EA\u30FC\u30D5\u306F \`Dimensions
91936
91959
 
91937
91960
  ### Business Logic
91938
91961
 
91939
- \u3053\u306E\u30B3\u30CD\u30AF\u30BF\u306E\u30D3\u30B8\u30CD\u30B9\u30ED\u30B8\u30C3\u30AF\u30BF\u30A4\u30D7\u306F "typescript" \u3067\u3059\u3002\`connection(connectionId)\` \u3067\u89E3\u6C7A\u6E08\u307F\u306E AWS \u8A8D\u8A3C\u60C5\u5831\u3092\u53D6\u5F97\u3057\u3001\`@aws-sdk/client-cost-explorer\` \u306B\u76F4\u63A5\u6E21\u3057\u3066\u30CF\u30F3\u30C9\u30E9\u5185\u3067\u5229\u7528\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u74B0\u5883\u5909\u6570\u304B\u3089 AWS \u8A8D\u8A3C\u60C5\u5831\u3092\u8AAD\u307F\u53D6\u3089\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3002
91962
+ \u3053\u306E\u30B3\u30CD\u30AF\u30BF\u306E\u30D3\u30B8\u30CD\u30B9\u30ED\u30B8\u30C3\u30AF\u30BF\u30A4\u30D7\u306F "typescript" \u3067\u3059\u3002\`connection(connectionId)\` \u3067\u89E3\u6C7A\u6E08\u307F\u306E AWS \u8A8D\u8A3C\u60C5\u5831\uFF08\`{ accessKeyId, secretAccessKey, region }\` \u3068\u3057\u3066\u578B\u4ED8\u3051\u6E08\u307F \u2014 \`as\` \u30AD\u30E3\u30B9\u30C8\u306F\u4E0D\u8981\uFF09\u3092\u53D6\u5F97\u3057\u3001\`@aws-sdk/client-cost-explorer\` \u306B\u76F4\u63A5\u6E21\u3057\u3066\u30CF\u30F3\u30C9\u30E9\u5185\u3067\u5229\u7528\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u74B0\u5883\u5909\u6570\u304B\u3089 AWS \u8A8D\u8A3C\u60C5\u5831\u3092\u8AAD\u307F\u53D6\u3089\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3002
91940
91963
 
91941
- #### Example
91964
+ #### \u30B5\u30FC\u30D0\u30FC\u30ED\u30B8\u30C3\u30AF\u306E slug \u547D\u540D\u898F\u5247
91965
+
91966
+ \u3053\u306E\u30B3\u30CD\u30AF\u30BF\u7528\u306E\u30B5\u30FC\u30D0\u30FC\u30ED\u30B8\u30C3\u30AF\u3092\u4F5C\u6210\u3059\u308B\u969B\u3001\`slug\`\uFF08\u30D5\u30A1\u30A4\u30EB\u540D\uFF09\u306F **\u5C0F\u6587\u5B57\u306E kebab-case \u307E\u305F\u306F snake_case** \u306B\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u8A31\u5BB9\u6587\u5B57\u306F \`[a-z0-9-_]\` \u306E\u307F\uFF09\u3002camelCase \u3084\u5927\u6587\u5B57\u3092\u542B\u3080\u3068\u30D0\u30EA\u30C7\u30FC\u30B7\u30E7\u30F3\u30A8\u30E9\u30FC\u306B\u306A\u308A\u307E\u3059\u3002
91967
+
91968
+ - OK: \`monthly-cost-trend\`\u3001\`cost_by_service\`\u3001\`top10-services\`
91969
+ - NG: \`monthlyCostTrend\`\u3001\`MonthlyCostTrend\`\u3001\`monthly cost trend\`
91970
+
91971
+ #### Example\uFF08slug: \`monthly-cost-trend\`\uFF09
91942
91972
 
91943
91973
  \`\`\`ts
91944
91974
  import type { Context } from "hono";
@@ -92845,33 +92875,41 @@ export default async function handler(c: Context) {
92845
92875
  tools: tools11
92846
92876
  });
92847
92877
 
92848
- // ../connectors/src/connectors/google-ads/tools/list-customers.ts
92849
- import { z as z18 } from "zod";
92850
-
92851
- // ../connectors/src/connectors/google-ads/parameters.ts
92852
- var parameters12 = {
92853
- customerId: new ParameterDefinition({
92854
- slug: "customer-id",
92855
- name: "Google Ads Customer ID",
92856
- 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.",
92857
- envVarBaseKey: "GOOGLE_ADS_CUSTOMER_ID",
92858
- type: "text",
92859
- secret: false,
92860
- required: false
92861
- }),
92862
- developerToken: new ParameterDefinition({
92863
- slug: "developer-token",
92864
- name: "Google Ads Developer Token",
92865
- description: "The developer token for accessing the Google Ads API. Required for all API requests.",
92866
- envVarBaseKey: "GOOGLE_ADS_DEVELOPER_TOKEN",
92867
- type: "text",
92868
- secret: true,
92869
- required: true
92870
- })
92878
+ // ../connectors/src/connectors/google-ads/constants.ts
92879
+ var VERSION_FALLBACK_ORDER = ["v22", "v23", "v24"];
92880
+ var cachedWorkingVersion = VERSION_FALLBACK_ORDER[0];
92881
+ var looksSunset = (contentType) => {
92882
+ return contentType != null && contentType.toLowerCase().includes("text/html");
92871
92883
  };
92884
+ async function fetchGoogleAdsWithVersionFallback(attempt) {
92885
+ const order = [
92886
+ cachedWorkingVersion,
92887
+ ...VERSION_FALLBACK_ORDER.filter((v) => v !== cachedWorkingVersion)
92888
+ ];
92889
+ let lastResponse = null;
92890
+ for (let i6 = 0; i6 < order.length; i6++) {
92891
+ const version2 = order[i6];
92892
+ const baseUrl = `https://googleads.googleapis.com/${version2}/`;
92893
+ const response = await attempt(baseUrl);
92894
+ const contentType = response.headers.get("content-type");
92895
+ if (looksSunset(contentType) && i6 < order.length - 1) {
92896
+ console.warn(
92897
+ `[google-ads] version ${version2} returned a sunset/HTML response (status ${response.status}); retrying with newer version`
92898
+ );
92899
+ lastResponse = response;
92900
+ continue;
92901
+ }
92902
+ cachedWorkingVersion = version2;
92903
+ return response;
92904
+ }
92905
+ return lastResponse ?? new Response(null, {
92906
+ status: 502,
92907
+ statusText: "All Google Ads API versions returned sunset responses"
92908
+ });
92909
+ }
92872
92910
 
92873
92911
  // ../connectors/src/connectors/google-ads/tools/list-customers.ts
92874
- var BASE_URL2 = "https://googleads.googleapis.com/v18/";
92912
+ import { z as z18 } from "zod";
92875
92913
  var REQUEST_TIMEOUT_MS8 = 6e4;
92876
92914
  var cachedToken4 = null;
92877
92915
  async function getProxyToken4(config) {
@@ -92942,27 +92980,25 @@ var listCustomersTool = new ConnectorTool({
92942
92980
  `[connector-request] google-ads/${connection2.name}: listCustomers`
92943
92981
  );
92944
92982
  try {
92945
- const developerToken = parameters12.developerToken.getValue(connection2);
92946
92983
  const token = await getProxyToken4(config.oauthProxy);
92947
92984
  const proxyUrl = `https://${config.oauthProxy.sandboxId}.${config.oauthProxy.previewBaseDomain}/_sqcore/connections/${connectionId}/request`;
92948
92985
  const controller = new AbortController();
92949
92986
  const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS8);
92950
92987
  try {
92951
- const response = await fetch(proxyUrl, {
92952
- method: "POST",
92953
- headers: {
92954
- "Content-Type": "application/json",
92955
- Authorization: `Bearer ${token}`
92956
- },
92957
- body: JSON.stringify({
92958
- url: `${BASE_URL2}customers:listAccessibleCustomers`,
92959
- method: "GET",
92988
+ const response = await fetchGoogleAdsWithVersionFallback(
92989
+ (baseUrl) => fetch(proxyUrl, {
92990
+ method: "POST",
92960
92991
  headers: {
92961
- "developer-token": developerToken
92962
- }
92963
- }),
92964
- signal: controller.signal
92965
- });
92992
+ "Content-Type": "application/json",
92993
+ Authorization: `Bearer ${token}`
92994
+ },
92995
+ body: JSON.stringify({
92996
+ url: `${baseUrl}customers:listAccessibleCustomers`,
92997
+ method: "GET"
92998
+ }),
92999
+ signal: controller.signal
93000
+ })
93001
+ );
92966
93002
  const data = await response.json();
92967
93003
  if (!response.ok) {
92968
93004
  const errorMessage = typeof data?.error === "string" ? data.error : typeof data?.message === "string" ? data.message : `HTTP ${response.status} ${response.statusText}`;
@@ -92974,26 +93010,27 @@ var listCustomersTool = new ConnectorTool({
92974
93010
  const customers = [];
92975
93011
  for (const cid of customerIds) {
92976
93012
  try {
92977
- const detailResponse = await fetch(proxyUrl, {
92978
- method: "POST",
92979
- headers: {
92980
- "Content-Type": "application/json",
92981
- Authorization: `Bearer ${token}`
92982
- },
92983
- body: JSON.stringify({
92984
- url: `${BASE_URL2}customers/${cid}/googleAds:searchStream`,
93013
+ const detailResponse = await fetchGoogleAdsWithVersionFallback(
93014
+ (baseUrl) => fetch(proxyUrl, {
92985
93015
  method: "POST",
92986
93016
  headers: {
92987
93017
  "Content-Type": "application/json",
92988
- "developer-token": developerToken,
92989
- "login-customer-id": cid
93018
+ Authorization: `Bearer ${token}`
92990
93019
  },
92991
93020
  body: JSON.stringify({
92992
- query: "SELECT customer.id, customer.descriptive_name FROM customer LIMIT 1"
92993
- })
92994
- }),
92995
- signal: controller.signal
92996
- });
93021
+ url: `${baseUrl}customers/${cid}/googleAds:searchStream`,
93022
+ method: "POST",
93023
+ headers: {
93024
+ "Content-Type": "application/json",
93025
+ "login-customer-id": cid
93026
+ },
93027
+ body: JSON.stringify({
93028
+ query: "SELECT customer.id, customer.descriptive_name FROM customer LIMIT 1"
93029
+ })
93030
+ }),
93031
+ signal: controller.signal
93032
+ })
93033
+ );
92997
93034
  if (detailResponse.ok) {
92998
93035
  const detailData = await detailResponse.json();
92999
93036
  const customer = detailData?.[0]?.results?.[0]?.customer;
@@ -93031,30 +93068,24 @@ var googleAdsOnboarding = new ConnectorOnboarding({
93031
93068
  connectionSetupInstructions: {
93032
93069
  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
93033
93070
 
93034
- 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
93071
+ 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
93035
93072
  2. \`updateConnectionParameters\` \u3092\u547C\u3073\u51FA\u3059:
93036
- - \`parameterSlug\`: \`"developer-token"\`
93037
- - \`value\`: \u30E6\u30FC\u30B6\u30FC\u304C\u63D0\u4F9B\u3057\u305F Developer Token
93038
- 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
93039
- 4. \`updateConnectionParameters\` \u3092\u547C\u3073\u51FA\u3059:
93040
93073
  - \`parameterSlug\`: \`"customer-id"\`
93041
93074
  - \`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
93042
- 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
93075
+ - \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
93076
+ 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
93043
93077
 
93044
93078
  #### \u5236\u7D04
93045
93079
  - **\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
93046
93080
  - \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`,
93047
93081
  en: `Follow these steps to set up the Google Ads (OAuth) connection.
93048
93082
 
93049
- 1. Ask the user to provide their Google Ads API Developer Token (available in Google Ads UI > Tools & Settings > API Center)
93083
+ 1. Call \`${listCustomersToolName}\` to get the list of Google Ads customer accounts accessible with the OAuth credentials
93050
93084
  2. Call \`updateConnectionParameters\`:
93051
- - \`parameterSlug\`: \`"developer-token"\`
93052
- - \`value\`: The Developer Token provided by the user
93053
- 3. Call \`${listCustomersToolName}\` to get the list of Google Ads customer accounts accessible with the OAuth credentials
93054
- 4. Call \`updateConnectionParameters\`:
93055
93085
  - \`parameterSlug\`: \`"customer-id"\`
93056
93086
  - \`options\`: The customer list. Each option's \`label\` should be \`Account Name (id: customerId)\`, \`value\` should be the customer ID
93057
- 5. The \`label\` of the user's selected customer will arrive as a message. Proceed to the next step
93087
+ - If **0 customers** are returned, abort setup and inform the user that no accessible accounts are available
93088
+ 3. The \`label\` of the user's selected customer will arrive as a message. Proceed to the next step
93058
93089
 
93059
93090
  #### Constraints
93060
93091
  - **Do NOT fetch report data during setup**. Only the metadata requests specified in the steps above are allowed
@@ -93068,9 +93099,21 @@ var googleAdsOnboarding = new ConnectorOnboarding({
93068
93099
  }
93069
93100
  });
93070
93101
 
93102
+ // ../connectors/src/connectors/google-ads/parameters.ts
93103
+ var parameters12 = {
93104
+ customerId: new ParameterDefinition({
93105
+ slug: "customer-id",
93106
+ name: "Google Ads Customer ID",
93107
+ 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.",
93108
+ envVarBaseKey: "GOOGLE_ADS_CUSTOMER_ID",
93109
+ type: "text",
93110
+ secret: false,
93111
+ required: false
93112
+ })
93113
+ };
93114
+
93071
93115
  // ../connectors/src/connectors/google-ads/tools/request.ts
93072
93116
  import { z as z19 } from "zod";
93073
- var BASE_URL3 = "https://googleads.googleapis.com/v18/";
93074
93117
  var REQUEST_TIMEOUT_MS9 = 6e4;
93075
93118
  var cachedToken5 = null;
93076
93119
  async function getProxyToken5(config) {
@@ -93110,7 +93153,7 @@ var inputSchema19 = z19.object({
93110
93153
  connectionId: z19.string().describe("ID of the Google Ads OAuth connection to use"),
93111
93154
  method: z19.enum(["GET", "POST"]).describe("HTTP method"),
93112
93155
  path: z19.string().describe(
93113
- "API path appended to https://googleads.googleapis.com/v18/ (e.g., 'customers/{customerId}/googleAds:searchStream'). {customerId} is automatically replaced."
93156
+ "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."
93114
93157
  ),
93115
93158
  body: z19.record(z19.string(), z19.unknown()).optional().describe("POST request body (JSON)")
93116
93159
  });
@@ -93127,7 +93170,7 @@ var outputSchema19 = z19.discriminatedUnion("success", [
93127
93170
  ]);
93128
93171
  var requestTool2 = new ConnectorTool({
93129
93172
  name: "request",
93130
- description: `Send authenticated requests to the Google Ads API v18.
93173
+ description: `Send authenticated requests to the Google Ads API.
93131
93174
  Authentication is handled automatically via OAuth proxy.
93132
93175
  {customerId} in the path is automatically replaced with the connection's customer ID (hyphens removed).`,
93133
93176
  inputSchema: inputSchema19,
@@ -93147,31 +93190,30 @@ Authentication is handled automatically via OAuth proxy.
93147
93190
  const rawCustomerId = parameters12.customerId.tryGetValue(connection2);
93148
93191
  const customerId = rawCustomerId?.replace(/-/g, "") ?? "";
93149
93192
  const resolvedPath = customerId ? path5.replace(/\{customerId\}/g, customerId) : path5;
93150
- const url = `${BASE_URL3}${resolvedPath}`;
93151
93193
  const token = await getProxyToken5(config.oauthProxy);
93152
93194
  const proxyUrl = `https://${config.oauthProxy.sandboxId}.${config.oauthProxy.previewBaseDomain}/_sqcore/connections/${connectionId}/request`;
93153
93195
  const controller = new AbortController();
93154
93196
  const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS9);
93155
93197
  try {
93156
- const developerToken = parameters12.developerToken.getValue(connection2);
93157
- const response = await fetch(proxyUrl, {
93158
- method: "POST",
93159
- headers: {
93160
- "Content-Type": "application/json",
93161
- Authorization: `Bearer ${token}`
93162
- },
93163
- body: JSON.stringify({
93164
- url,
93165
- method,
93198
+ const response = await fetchGoogleAdsWithVersionFallback(
93199
+ (baseUrl) => fetch(proxyUrl, {
93200
+ method: "POST",
93166
93201
  headers: {
93167
93202
  "Content-Type": "application/json",
93168
- "developer-token": developerToken,
93169
- ...customerId ? { "login-customer-id": customerId } : {}
93203
+ Authorization: `Bearer ${token}`
93170
93204
  },
93171
- ...method === "POST" && body ? { body: JSON.stringify(body) } : {}
93172
- }),
93173
- signal: controller.signal
93174
- });
93205
+ body: JSON.stringify({
93206
+ url: `${baseUrl}${resolvedPath}`,
93207
+ method,
93208
+ headers: {
93209
+ "Content-Type": "application/json",
93210
+ ...customerId ? { "login-customer-id": customerId } : {}
93211
+ },
93212
+ ...method === "POST" && body ? { body: JSON.stringify(body) } : {}
93213
+ }),
93214
+ signal: controller.signal
93215
+ })
93216
+ );
93175
93217
  const data = await response.json();
93176
93218
  if (!response.ok) {
93177
93219
  const dataObj = data;
@@ -93346,26 +93388,22 @@ const customerIds = await ads.listAccessibleCustomers();
93346
93388
  if (!customerId) {
93347
93389
  return { success: true };
93348
93390
  }
93349
- const developerToken = params[parameters12.developerToken.slug];
93350
- if (!developerToken) {
93351
- return {
93352
- success: false,
93353
- error: "Developer token is required"
93354
- };
93355
- }
93356
- const url = `https://googleads.googleapis.com/v18/customers/${customerId}/googleAds:searchStream`;
93357
93391
  try {
93358
- const res = await proxyFetch(url, {
93359
- method: "POST",
93360
- headers: {
93361
- "Content-Type": "application/json",
93362
- "developer-token": developerToken,
93363
- "login-customer-id": customerId
93364
- },
93365
- body: JSON.stringify({
93366
- query: "SELECT customer.id FROM customer LIMIT 1"
93367
- })
93368
- });
93392
+ const res = await fetchGoogleAdsWithVersionFallback(
93393
+ (baseUrl) => proxyFetch(
93394
+ `${baseUrl}customers/${customerId}/googleAds:searchStream`,
93395
+ {
93396
+ method: "POST",
93397
+ headers: {
93398
+ "Content-Type": "application/json",
93399
+ "login-customer-id": customerId
93400
+ },
93401
+ body: JSON.stringify({
93402
+ query: "SELECT customer.id FROM customer LIMIT 1"
93403
+ })
93404
+ }
93405
+ )
93406
+ );
93369
93407
  if (!res.ok) {
93370
93408
  const errorText = await res.text().catch(() => res.statusText);
93371
93409
  return {
@@ -93417,7 +93455,7 @@ var parameters13 = {
93417
93455
 
93418
93456
  // ../connectors/src/connectors/google-analytics/tools/request.ts
93419
93457
  import { z as z20 } from "zod";
93420
- var BASE_URL4 = "https://analyticsdata.googleapis.com/v1beta/";
93458
+ var BASE_URL2 = "https://analyticsdata.googleapis.com/v1beta/";
93421
93459
  var REQUEST_TIMEOUT_MS10 = 6e4;
93422
93460
  var inputSchema20 = z20.object({
93423
93461
  toolUseIntent: z20.string().optional().describe("Brief description of what you intend to accomplish with this tool call"),
@@ -93466,7 +93504,7 @@ Authentication is handled automatically using a service account.
93466
93504
  return { success: false, error: "Failed to obtain access token" };
93467
93505
  }
93468
93506
  const resolvedPath = path5.replace(/\{propertyId\}/g, propertyId);
93469
- const url = `${BASE_URL4}${resolvedPath}`;
93507
+ const url = `${BASE_URL2}${resolvedPath}`;
93470
93508
  const controller = new AbortController();
93471
93509
  const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS10);
93472
93510
  try {
@@ -93946,7 +93984,7 @@ var parameters14 = {
93946
93984
 
93947
93985
  // ../connectors/src/connectors/google-analytics-oauth/tools/request.ts
93948
93986
  import { z as z23 } from "zod";
93949
- var BASE_URL5 = "https://analyticsdata.googleapis.com/v1beta/";
93987
+ var BASE_URL3 = "https://analyticsdata.googleapis.com/v1beta/";
93950
93988
  var REQUEST_TIMEOUT_MS13 = 6e4;
93951
93989
  var cachedToken8 = null;
93952
93990
  async function getProxyToken8(config) {
@@ -94022,7 +94060,7 @@ Authentication is handled automatically via OAuth proxy.
94022
94060
  try {
94023
94061
  const propertyId = parameters14.propertyId.tryGetValue(connection2);
94024
94062
  const resolvedPath = propertyId ? path5.replace(/\{propertyId\}/g, propertyId) : path5;
94025
- const url = `${BASE_URL5}${resolvedPath}`;
94063
+ const url = `${BASE_URL3}${resolvedPath}`;
94026
94064
  const token = await getProxyToken8(config.oauthProxy);
94027
94065
  const proxyUrl = `https://${config.oauthProxy.sandboxId}.${config.oauthProxy.previewBaseDomain}/_sqcore/connections/${connectionId}/request`;
94028
94066
  const controller = new AbortController();
@@ -94290,7 +94328,7 @@ var parameters15 = {
94290
94328
  // ../connectors/src/connectors/google-calendar/tools/request.ts
94291
94329
  var BASE_HOST = "https://www.googleapis.com";
94292
94330
  var BASE_PATH_SEGMENT = "/calendar/v3";
94293
- var BASE_URL6 = `${BASE_HOST}${BASE_PATH_SEGMENT}`;
94331
+ var BASE_URL4 = `${BASE_HOST}${BASE_PATH_SEGMENT}`;
94294
94332
  var REQUEST_TIMEOUT_MS14 = 6e4;
94295
94333
  function decodeServiceAccount(keyJsonBase64) {
94296
94334
  const decoded = Buffer.from(keyJsonBase64, "base64").toString("utf-8");
@@ -94370,7 +94408,7 @@ var requestTool5 = new ConnectorTool({
94370
94408
  };
94371
94409
  }
94372
94410
  const normalizedPath = normalizeRequestPath(path5, BASE_PATH_SEGMENT);
94373
- let url = `${BASE_URL6}${normalizedPath}`;
94411
+ let url = `${BASE_URL4}${normalizedPath}`;
94374
94412
  if (queryParams) {
94375
94413
  const searchParams = new URLSearchParams(queryParams);
94376
94414
  url += `?${searchParams.toString()}`;
@@ -94422,7 +94460,7 @@ var requestTool5 = new ConnectorTool({
94422
94460
  import { z as z25 } from "zod";
94423
94461
  var BASE_HOST2 = "https://www.googleapis.com";
94424
94462
  var BASE_PATH_SEGMENT2 = "/calendar/v3";
94425
- var BASE_URL7 = `${BASE_HOST2}${BASE_PATH_SEGMENT2}`;
94463
+ var BASE_URL5 = `${BASE_HOST2}${BASE_PATH_SEGMENT2}`;
94426
94464
  var REQUEST_TIMEOUT_MS15 = 6e4;
94427
94465
  function decodeServiceAccount2(keyJsonBase64) {
94428
94466
  const decoded = Buffer.from(keyJsonBase64, "base64").toString("utf-8");
@@ -94508,7 +94546,7 @@ var requestWithDelegationTool = new ConnectorTool({
94508
94546
  };
94509
94547
  }
94510
94548
  const normalizedPath = normalizeRequestPath(path5, BASE_PATH_SEGMENT2);
94511
- let url = `${BASE_URL7}${normalizedPath}`;
94549
+ let url = `${BASE_URL5}${normalizedPath}`;
94512
94550
  if (queryParams) {
94513
94551
  const searchParams = new URLSearchParams(queryParams);
94514
94552
  url += `?${searchParams.toString()}`;
@@ -94988,7 +95026,7 @@ export default async function handler(c: Context) {
94988
95026
 
94989
95027
  // ../connectors/src/connectors/google-calendar-oauth/tools/list-calendars.ts
94990
95028
  import { z as z26 } from "zod";
94991
- var BASE_URL8 = "https://www.googleapis.com/calendar/v3";
95029
+ var BASE_URL6 = "https://www.googleapis.com/calendar/v3";
94992
95030
  var REQUEST_TIMEOUT_MS16 = 6e4;
94993
95031
  var cachedToken9 = null;
94994
95032
  async function getProxyToken9(config) {
@@ -95061,7 +95099,7 @@ var listCalendarsTool = new ConnectorTool({
95061
95099
  `[connector-request] google-calendar-oauth/${connection2.name}: listCalendars`
95062
95100
  );
95063
95101
  try {
95064
- const url = `${BASE_URL8}/users/me/calendarList`;
95102
+ const url = `${BASE_URL6}/users/me/calendarList`;
95065
95103
  const token = await getProxyToken9(config.oauthProxy);
95066
95104
  const proxyUrl = `https://${config.oauthProxy.sandboxId}.${config.oauthProxy.previewBaseDomain}/_sqcore/connections/${connectionId}/request`;
95067
95105
  const controller = new AbortController();
@@ -95158,7 +95196,7 @@ var parameters16 = {
95158
95196
  import { z as z27 } from "zod";
95159
95197
  var BASE_HOST3 = "https://www.googleapis.com";
95160
95198
  var BASE_PATH_SEGMENT3 = "/calendar/v3";
95161
- var BASE_URL9 = `${BASE_HOST3}${BASE_PATH_SEGMENT3}`;
95199
+ var BASE_URL7 = `${BASE_HOST3}${BASE_PATH_SEGMENT3}`;
95162
95200
  var REQUEST_TIMEOUT_MS17 = 6e4;
95163
95201
  var cachedToken10 = null;
95164
95202
  async function getProxyToken10(config) {
@@ -95239,7 +95277,7 @@ Authentication is handled automatically via OAuth proxy.
95239
95277
  resolvedPath,
95240
95278
  BASE_PATH_SEGMENT3
95241
95279
  );
95242
- let url = `${BASE_URL9}${normalizedPath}`;
95280
+ let url = `${BASE_URL7}${normalizedPath}`;
95243
95281
  if (queryParams) {
95244
95282
  const searchParams = new URLSearchParams(queryParams);
95245
95283
  url += `?${searchParams.toString()}`;
@@ -95777,7 +95815,7 @@ var parameters18 = {};
95777
95815
  import { z as z29 } from "zod";
95778
95816
  var BASE_HOST4 = "https://www.googleapis.com";
95779
95817
  var BASE_PATH_SEGMENT4 = "/drive/v3";
95780
- var BASE_URL10 = `${BASE_HOST4}${BASE_PATH_SEGMENT4}`;
95818
+ var BASE_URL8 = `${BASE_HOST4}${BASE_PATH_SEGMENT4}`;
95781
95819
  var REQUEST_TIMEOUT_MS19 = 6e4;
95782
95820
  var cachedToken12 = null;
95783
95821
  async function getProxyToken12(config) {
@@ -95853,7 +95891,7 @@ Authentication is handled automatically via OAuth proxy.`,
95853
95891
  );
95854
95892
  try {
95855
95893
  const normalizedPath = normalizeRequestPath(path5, BASE_PATH_SEGMENT4);
95856
- let url = `${BASE_URL10}${normalizedPath}`;
95894
+ let url = `${BASE_URL8}${normalizedPath}`;
95857
95895
  if (queryParams) {
95858
95896
  const searchParams = new URLSearchParams(queryParams);
95859
95897
  url += `?${searchParams.toString()}`;
@@ -96894,7 +96932,7 @@ await slides.batchUpdate(presentationId, [
96894
96932
 
96895
96933
  // ../connectors/src/connectors/hubspot-oauth/tools/request.ts
96896
96934
  import { z as z32 } from "zod";
96897
- var BASE_URL11 = "https://api.hubapi.com";
96935
+ var BASE_URL9 = "https://api.hubapi.com";
96898
96936
  var REQUEST_TIMEOUT_MS22 = 6e4;
96899
96937
  var cachedToken15 = null;
96900
96938
  async function getProxyToken15(config) {
@@ -96968,7 +97006,7 @@ Authentication is handled automatically via OAuth proxy.`,
96968
97006
  `[connector-request] hubspot-oauth/${connection2.name}: ${method} ${path5}`
96969
97007
  );
96970
97008
  try {
96971
- let url = `${BASE_URL11}${path5.startsWith("/") ? "" : "/"}${path5}`;
97009
+ let url = `${BASE_URL9}${path5.startsWith("/") ? "" : "/"}${path5}`;
96972
97010
  if (queryParams) {
96973
97011
  const searchParams = new URLSearchParams(queryParams);
96974
97012
  url += `?${searchParams.toString()}`;
@@ -97184,7 +97222,7 @@ const data = await res.json();
97184
97222
 
97185
97223
  // ../connectors/src/connectors/stripe-oauth/tools/request.ts
97186
97224
  import { z as z33 } from "zod";
97187
- var BASE_URL12 = "https://api.stripe.com";
97225
+ var BASE_URL10 = "https://api.stripe.com";
97188
97226
  var REQUEST_TIMEOUT_MS23 = 6e4;
97189
97227
  var cachedToken16 = null;
97190
97228
  async function getProxyToken16(config) {
@@ -97258,7 +97296,7 @@ Authentication is handled automatically via OAuth proxy.`,
97258
97296
  `[connector-request] stripe-oauth/${connection2.name}: ${method} ${path5}`
97259
97297
  );
97260
97298
  try {
97261
- let url = `${BASE_URL12}${path5.startsWith("/") ? "" : "/"}${path5}`;
97299
+ let url = `${BASE_URL10}${path5.startsWith("/") ? "" : "/"}${path5}`;
97262
97300
  if (queryParams) {
97263
97301
  const searchParams = new URLSearchParams(queryParams);
97264
97302
  url += `?${searchParams.toString()}`;
@@ -97496,7 +97534,7 @@ var parameters23 = {
97496
97534
  };
97497
97535
 
97498
97536
  // ../connectors/src/connectors/stripe-api-key/tools/request.ts
97499
- var BASE_URL13 = "https://api.stripe.com";
97537
+ var BASE_URL11 = "https://api.stripe.com";
97500
97538
  var REQUEST_TIMEOUT_MS24 = 6e4;
97501
97539
  var inputSchema34 = z34.object({
97502
97540
  toolUseIntent: z34.string().optional().describe(
@@ -97545,7 +97583,7 @@ Use this tool for all Stripe API interactions: querying charges, customers, invo
97545
97583
  );
97546
97584
  try {
97547
97585
  const apiKey = parameters23.apiKey.getValue(connection2);
97548
- let url = `${BASE_URL13}${path5.startsWith("/") ? "" : "/"}${path5}`;
97586
+ let url = `${BASE_URL11}${path5.startsWith("/") ? "" : "/"}${path5}`;
97549
97587
  if (queryParams) {
97550
97588
  const searchParams = new URLSearchParams(queryParams);
97551
97589
  url += `?${searchParams.toString()}`;
@@ -97787,7 +97825,7 @@ var parameters24 = {
97787
97825
  };
97788
97826
 
97789
97827
  // ../connectors/src/connectors/airtable-oauth/tools/request.ts
97790
- var BASE_URL14 = "https://api.airtable.com/v0";
97828
+ var BASE_URL12 = "https://api.airtable.com/v0";
97791
97829
  var REQUEST_TIMEOUT_MS25 = 6e4;
97792
97830
  var cachedToken17 = null;
97793
97831
  async function getProxyToken17(config) {
@@ -97864,7 +97902,7 @@ Authentication is handled automatically via OAuth proxy.
97864
97902
  try {
97865
97903
  const baseId = parameters24.baseId.tryGetValue(connection2);
97866
97904
  const resolvedPath = baseId ? path5.replace(/\{baseId\}/g, baseId) : path5;
97867
- let url = `${BASE_URL14}${resolvedPath.startsWith("/") ? "" : "/"}${resolvedPath}`;
97905
+ let url = `${BASE_URL12}${resolvedPath.startsWith("/") ? "" : "/"}${resolvedPath}`;
97868
97906
  if (queryParams) {
97869
97907
  const searchParams = new URLSearchParams(queryParams);
97870
97908
  url += `?${searchParams.toString()}`;
@@ -98717,7 +98755,7 @@ var parameters27 = {
98717
98755
 
98718
98756
  // ../connectors/src/connectors/wix-store/tools/request.ts
98719
98757
  import { z as z38 } from "zod";
98720
- var BASE_URL15 = "https://www.wixapis.com/";
98758
+ var BASE_URL13 = "https://www.wixapis.com/";
98721
98759
  var REQUEST_TIMEOUT_MS28 = 6e4;
98722
98760
  var inputSchema38 = z38.object({
98723
98761
  toolUseIntent: z38.string().optional().describe("Brief description of what you intend to accomplish with this tool call"),
@@ -98752,7 +98790,7 @@ Authentication is handled automatically using the API Key and Site ID.`,
98752
98790
  try {
98753
98791
  const apiKey = parameters27.apiKey.getValue(connection2);
98754
98792
  const siteId = parameters27.siteId.getValue(connection2);
98755
- const url = `${BASE_URL15}${path5}`;
98793
+ const url = `${BASE_URL13}${path5}`;
98756
98794
  const controller = new AbortController();
98757
98795
  const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS28);
98758
98796
  try {
@@ -100032,7 +100070,7 @@ var parameters34 = {
100032
100070
 
100033
100071
  // ../connectors/src/connectors/attio/tools/request.ts
100034
100072
  import { z as z42 } from "zod";
100035
- var BASE_URL16 = "https://api.attio.com/v2";
100073
+ var BASE_URL14 = "https://api.attio.com/v2";
100036
100074
  var REQUEST_TIMEOUT_MS31 = 6e4;
100037
100075
  var inputSchema42 = z42.object({
100038
100076
  toolUseIntent: z42.string().optional().describe(
@@ -100079,7 +100117,7 @@ Record queries use POST /objects/{object}/records/query with a JSON body contain
100079
100117
  );
100080
100118
  try {
100081
100119
  const apiKey = parameters34.apiKey.getValue(connection2);
100082
- const url = `${BASE_URL16}${path5}`;
100120
+ const url = `${BASE_URL14}${path5}`;
100083
100121
  const controller = new AbortController();
100084
100122
  const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS31);
100085
100123
  try {
@@ -101047,7 +101085,7 @@ var parameters37 = {
101047
101085
 
101048
101086
  // ../connectors/src/connectors/hubspot/tools/request.ts
101049
101087
  import { z as z45 } from "zod";
101050
- var BASE_URL17 = "https://api.hubapi.com";
101088
+ var BASE_URL15 = "https://api.hubapi.com";
101051
101089
  var REQUEST_TIMEOUT_MS34 = 6e4;
101052
101090
  var inputSchema45 = z45.object({
101053
101091
  toolUseIntent: z45.string().optional().describe(
@@ -101094,7 +101132,7 @@ Use the search endpoint (POST /crm/v3/objects/{objectType}/search) for complex q
101094
101132
  );
101095
101133
  try {
101096
101134
  const apiKey = parameters37.apiKey.getValue(connection2);
101097
- const url = `${BASE_URL17}${path5.startsWith("/") ? "" : "/"}${path5}`;
101135
+ const url = `${BASE_URL15}${path5.startsWith("/") ? "" : "/"}${path5}`;
101098
101136
  const controller = new AbortController();
101099
101137
  const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS34);
101100
101138
  try {
@@ -101580,7 +101618,7 @@ var parameters39 = {
101580
101618
 
101581
101619
  // ../connectors/src/connectors/linear/tools/request.ts
101582
101620
  import { z as z47 } from "zod";
101583
- var BASE_URL18 = "https://api.linear.app/graphql";
101621
+ var BASE_URL16 = "https://api.linear.app/graphql";
101584
101622
  var REQUEST_TIMEOUT_MS36 = 6e4;
101585
101623
  var inputSchema47 = z47.object({
101586
101624
  toolUseIntent: z47.string().optional().describe(
@@ -101630,7 +101668,7 @@ Archived resources are hidden by default; pass includeArchived: true in query ar
101630
101668
  try {
101631
101669
  const body = { query };
101632
101670
  if (variables) body.variables = variables;
101633
- const response = await fetch(BASE_URL18, {
101671
+ const response = await fetch(BASE_URL16, {
101634
101672
  method: "POST",
101635
101673
  headers: {
101636
101674
  Authorization: apiKey,
@@ -101838,7 +101876,7 @@ var parameters40 = {
101838
101876
  import { z as z48 } from "zod";
101839
101877
  var BASE_HOST5 = "https://app.asana.com";
101840
101878
  var BASE_PATH_SEGMENT5 = "/api/1.0";
101841
- var BASE_URL19 = `${BASE_HOST5}${BASE_PATH_SEGMENT5}`;
101879
+ var BASE_URL17 = `${BASE_HOST5}${BASE_PATH_SEGMENT5}`;
101842
101880
  var REQUEST_TIMEOUT_MS37 = 6e4;
101843
101881
  var inputSchema48 = z48.object({
101844
101882
  toolUseIntent: z48.string().optional().describe(
@@ -101903,7 +101941,7 @@ Pagination: Use limit (1-100) and offset query parameters. The response includes
101903
101941
  try {
101904
101942
  const token = parameters40.personalAccessToken.getValue(connection2);
101905
101943
  const normalizedPath = normalizeRequestPath(path5, BASE_PATH_SEGMENT5);
101906
- const url = `${BASE_URL19}${normalizedPath}`;
101944
+ const url = `${BASE_URL17}${normalizedPath}`;
101907
101945
  const controller = new AbortController();
101908
101946
  const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS37);
101909
101947
  try {
@@ -102776,7 +102814,7 @@ var parameters43 = {
102776
102814
 
102777
102815
  // ../connectors/src/connectors/notion/tools/request.ts
102778
102816
  import { z as z53 } from "zod";
102779
- var BASE_URL20 = "https://api.notion.com/v1";
102817
+ var BASE_URL18 = "https://api.notion.com/v1";
102780
102818
  var NOTION_VERSION = "2022-06-28";
102781
102819
  var REQUEST_TIMEOUT_MS38 = 6e4;
102782
102820
  var inputSchema53 = z53.object({
@@ -102824,7 +102862,7 @@ Pagination uses cursor-based start_cursor and page_size (max 100).`,
102824
102862
  );
102825
102863
  try {
102826
102864
  const apiKey = parameters43.apiKey.getValue(connection2);
102827
- const url = `${BASE_URL20}${path5.startsWith("/") ? "" : "/"}${path5}`;
102865
+ const url = `${BASE_URL18}${path5.startsWith("/") ? "" : "/"}${path5}`;
102828
102866
  const controller = new AbortController();
102829
102867
  const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS38);
102830
102868
  try {
@@ -103013,7 +103051,7 @@ export default async function handler(c: Context) {
103013
103051
 
103014
103052
  // ../connectors/src/connectors/notion-oauth/tools/request.ts
103015
103053
  import { z as z54 } from "zod";
103016
- var BASE_URL21 = "https://api.notion.com/v1";
103054
+ var BASE_URL19 = "https://api.notion.com/v1";
103017
103055
  var NOTION_VERSION2 = "2022-06-28";
103018
103056
  var REQUEST_TIMEOUT_MS39 = 6e4;
103019
103057
  var cachedToken19 = null;
@@ -103089,7 +103127,7 @@ Pagination uses cursor-based start_cursor and page_size (max 100).`,
103089
103127
  `[connector-request] notion-oauth/${connection2.name}: ${method} ${path5}`
103090
103128
  );
103091
103129
  try {
103092
- const url = `${BASE_URL21}${path5.startsWith("/") ? "" : "/"}${path5}`;
103130
+ const url = `${BASE_URL19}${path5.startsWith("/") ? "" : "/"}${path5}`;
103093
103131
  const token = await getProxyToken19(config.oauthProxy);
103094
103132
  const proxyUrl = `https://${config.oauthProxy.sandboxId}.${config.oauthProxy.previewBaseDomain}/_sqcore/connections/${connectionId}/request`;
103095
103133
  const controller = new AbortController();
@@ -103338,7 +103376,7 @@ var parameters45 = {
103338
103376
  };
103339
103377
 
103340
103378
  // ../connectors/src/connectors/meta-ads/tools/list-ad-accounts.ts
103341
- var BASE_URL22 = "https://graph.facebook.com/v21.0/";
103379
+ var BASE_URL20 = "https://graph.facebook.com/v21.0/";
103342
103380
  var REQUEST_TIMEOUT_MS40 = 6e4;
103343
103381
  var inputSchema55 = z55.object({
103344
103382
  toolUseIntent: z55.string().optional().describe(
@@ -103379,7 +103417,7 @@ var listAdAccountsTool = new ConnectorTool({
103379
103417
  );
103380
103418
  try {
103381
103419
  const accessToken = parameters45.accessToken.getValue(connection2);
103382
- const url = `${BASE_URL22}me/adaccounts?fields=account_id,name,account_status&access_token=${encodeURIComponent(accessToken)}`;
103420
+ const url = `${BASE_URL20}me/adaccounts?fields=account_id,name,account_status&access_token=${encodeURIComponent(accessToken)}`;
103383
103421
  const controller = new AbortController();
103384
103422
  const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS40);
103385
103423
  try {
@@ -103448,7 +103486,7 @@ var metaAdsOnboarding = new ConnectorOnboarding({
103448
103486
 
103449
103487
  // ../connectors/src/connectors/meta-ads/tools/request.ts
103450
103488
  import { z as z56 } from "zod";
103451
- var BASE_URL23 = "https://graph.facebook.com/v21.0/";
103489
+ var BASE_URL21 = "https://graph.facebook.com/v21.0/";
103452
103490
  var REQUEST_TIMEOUT_MS41 = 6e4;
103453
103491
  var inputSchema56 = z56.object({
103454
103492
  toolUseIntent: z56.string().optional().describe(
@@ -103495,7 +103533,7 @@ Authentication is handled via the configured access token.
103495
103533
  const accessToken = parameters45.accessToken.getValue(connection2);
103496
103534
  const adAccountId = parameters45.adAccountId.tryGetValue(connection2) ?? "";
103497
103535
  const resolvedPath = adAccountId ? path5.replace(/\{adAccountId\}/g, adAccountId) : path5;
103498
- let url = `${BASE_URL23}${resolvedPath}`;
103536
+ let url = `${BASE_URL21}${resolvedPath}`;
103499
103537
  const params = new URLSearchParams(queryParams ?? {});
103500
103538
  params.set("access_token", accessToken);
103501
103539
  const separator = url.includes("?") ? "&" : "?";
@@ -103701,7 +103739,7 @@ const accounts = await meta.listAdAccounts();
103701
103739
 
103702
103740
  // ../connectors/src/connectors/meta-ads-oauth/tools/list-ad-accounts.ts
103703
103741
  import { z as z57 } from "zod";
103704
- var BASE_URL24 = "https://graph.facebook.com/v21.0/";
103742
+ var BASE_URL22 = "https://graph.facebook.com/v21.0/";
103705
103743
  var REQUEST_TIMEOUT_MS42 = 6e4;
103706
103744
  var cachedToken20 = null;
103707
103745
  async function getProxyToken20(config) {
@@ -103784,7 +103822,7 @@ var listAdAccountsTool2 = new ConnectorTool({
103784
103822
  Authorization: `Bearer ${token}`
103785
103823
  },
103786
103824
  body: JSON.stringify({
103787
- url: `${BASE_URL24}me/adaccounts?fields=account_id,name,account_status`,
103825
+ url: `${BASE_URL22}me/adaccounts?fields=account_id,name,account_status`,
103788
103826
  method: "GET"
103789
103827
  }),
103790
103828
  signal: controller.signal
@@ -103863,7 +103901,7 @@ var parameters46 = {
103863
103901
 
103864
103902
  // ../connectors/src/connectors/meta-ads-oauth/tools/request.ts
103865
103903
  import { z as z58 } from "zod";
103866
- var BASE_URL25 = "https://graph.facebook.com/v21.0/";
103904
+ var BASE_URL23 = "https://graph.facebook.com/v21.0/";
103867
103905
  var REQUEST_TIMEOUT_MS43 = 6e4;
103868
103906
  var cachedToken21 = null;
103869
103907
  async function getProxyToken21(config) {
@@ -103940,7 +103978,7 @@ Authentication is handled automatically via OAuth proxy.
103940
103978
  try {
103941
103979
  const adAccountId = parameters46.adAccountId.tryGetValue(connection2) ?? "";
103942
103980
  const resolvedPath = adAccountId ? path5.replace(/\{adAccountId\}/g, adAccountId) : path5;
103943
- let url = `${BASE_URL25}${resolvedPath}`;
103981
+ let url = `${BASE_URL23}${resolvedPath}`;
103944
103982
  if (queryParams && Object.keys(queryParams).length > 0) {
103945
103983
  const params = new URLSearchParams(queryParams);
103946
103984
  const separator = url.includes("?") ? "&" : "?";
@@ -104146,7 +104184,7 @@ const data = await res.json();
104146
104184
 
104147
104185
  // ../connectors/src/connectors/tiktok-ads/tools/list-advertisers.ts
104148
104186
  import { z as z59 } from "zod";
104149
- var BASE_URL26 = "https://business-api.tiktok.com/open_api/v1.3/";
104187
+ var BASE_URL24 = "https://business-api.tiktok.com/open_api/v1.3/";
104150
104188
  var REQUEST_TIMEOUT_MS44 = 6e4;
104151
104189
  var cachedToken22 = null;
104152
104190
  async function getProxyToken22(config) {
@@ -104229,7 +104267,7 @@ var listAdvertisersTool = new ConnectorTool({
104229
104267
  Authorization: `Bearer ${token}`
104230
104268
  },
104231
104269
  body: JSON.stringify({
104232
- url: `${BASE_URL26}oauth2/advertiser/get/`,
104270
+ url: `${BASE_URL24}oauth2/advertiser/get/`,
104233
104271
  method: "GET"
104234
104272
  }),
104235
104273
  signal: controller.signal
@@ -104320,7 +104358,7 @@ var parameters47 = {
104320
104358
  import { z as z60 } from "zod";
104321
104359
  var BASE_HOST6 = "https://business-api.tiktok.com";
104322
104360
  var BASE_PATH_SEGMENT6 = "/open_api/v1.3";
104323
- var BASE_URL27 = `${BASE_HOST6}${BASE_PATH_SEGMENT6}`;
104361
+ var BASE_URL25 = `${BASE_HOST6}${BASE_PATH_SEGMENT6}`;
104324
104362
  var REQUEST_TIMEOUT_MS45 = 6e4;
104325
104363
  var cachedToken23 = null;
104326
104364
  async function getProxyToken23(config) {
@@ -104397,7 +104435,7 @@ The advertiser_id is automatically injected if configured.`,
104397
104435
  try {
104398
104436
  const advertiserId = parameters47.advertiserId.tryGetValue(connection2) ?? "";
104399
104437
  const normalizedPath = normalizeRequestPath(path5, BASE_PATH_SEGMENT6);
104400
- let url = `${BASE_URL27}${normalizedPath}`;
104438
+ let url = `${BASE_URL25}${normalizedPath}`;
104401
104439
  if (method === "GET") {
104402
104440
  const params = new URLSearchParams(queryParams ?? {});
104403
104441
  if (advertiserId && !params.has("advertiser_id")) {
@@ -105613,7 +105651,7 @@ var parameters51 = {
105613
105651
  // ../connectors/src/connectors/gmail/tools/request-with-delegation.ts
105614
105652
  var BASE_HOST7 = "https://gmail.googleapis.com";
105615
105653
  var BASE_PATH_SEGMENT7 = "/gmail/v1/users";
105616
- var BASE_URL28 = `${BASE_HOST7}${BASE_PATH_SEGMENT7}`;
105654
+ var BASE_URL26 = `${BASE_HOST7}${BASE_PATH_SEGMENT7}`;
105617
105655
  var REQUEST_TIMEOUT_MS49 = 6e4;
105618
105656
  function decodeServiceAccount3(keyJsonBase64) {
105619
105657
  const decoded = Buffer.from(keyJsonBase64, "base64").toString("utf-8");
@@ -105699,7 +105737,7 @@ var requestWithDelegationTool2 = new ConnectorTool({
105699
105737
  };
105700
105738
  }
105701
105739
  const normalizedPath = normalizeRequestPath(path5, BASE_PATH_SEGMENT7);
105702
- let url = `${BASE_URL28}${normalizedPath}`;
105740
+ let url = `${BASE_URL26}${normalizedPath}`;
105703
105741
  if (queryParams) {
105704
105742
  const searchParams = new URLSearchParams(queryParams);
105705
105743
  url += `?${searchParams.toString()}`;
@@ -106020,7 +106058,7 @@ for (const msg of messages.messages ?? []) {
106020
106058
  import { z as z65 } from "zod";
106021
106059
  var BASE_HOST8 = "https://gmail.googleapis.com";
106022
106060
  var BASE_PATH_SEGMENT8 = "/gmail/v1/users";
106023
- var BASE_URL29 = `${BASE_HOST8}${BASE_PATH_SEGMENT8}`;
106061
+ var BASE_URL27 = `${BASE_HOST8}${BASE_PATH_SEGMENT8}`;
106024
106062
  var REQUEST_TIMEOUT_MS50 = 6e4;
106025
106063
  var cachedToken25 = null;
106026
106064
  async function getProxyToken25(config) {
@@ -106097,7 +106135,7 @@ All paths are relative to https://gmail.googleapis.com/gmail/v1/users. Use '/me'
106097
106135
  );
106098
106136
  try {
106099
106137
  const normalizedPath = normalizeRequestPath(path5, BASE_PATH_SEGMENT8);
106100
- let url = `${BASE_URL29}${normalizedPath}`;
106138
+ let url = `${BASE_URL27}${normalizedPath}`;
106101
106139
  if (queryParams) {
106102
106140
  const searchParams = new URLSearchParams(queryParams);
106103
106141
  url += `?${searchParams.toString()}`;
@@ -106409,7 +106447,7 @@ var parameters53 = {
106409
106447
  // ../connectors/src/connectors/google-audit-log/tools/request-with-delegation.ts
106410
106448
  var BASE_HOST9 = "https://admin.googleapis.com";
106411
106449
  var BASE_PATH_SEGMENT9 = "/admin/reports/v1";
106412
- var BASE_URL30 = `${BASE_HOST9}${BASE_PATH_SEGMENT9}`;
106450
+ var BASE_URL28 = `${BASE_HOST9}${BASE_PATH_SEGMENT9}`;
106413
106451
  var REQUEST_TIMEOUT_MS51 = 6e4;
106414
106452
  function decodeServiceAccount4(keyJsonBase64) {
106415
106453
  const decoded = Buffer.from(keyJsonBase64, "base64").toString("utf-8");
@@ -106496,7 +106534,7 @@ var requestWithDelegationTool3 = new ConnectorTool({
106496
106534
  };
106497
106535
  }
106498
106536
  const normalizedPath = normalizeRequestPath(path5, BASE_PATH_SEGMENT9);
106499
- let url = `${BASE_URL30}${normalizedPath}`;
106537
+ let url = `${BASE_URL28}${normalizedPath}`;
106500
106538
  if (queryParams) {
106501
106539
  const searchParams = new URLSearchParams(queryParams);
106502
106540
  url += `?${searchParams.toString()}`;
@@ -106806,7 +106844,7 @@ export default async function handler(c: Context) {
106806
106844
 
106807
106845
  // ../connectors/src/connectors/linkedin-ads/tools/list-ad-accounts.ts
106808
106846
  import { z as z67 } from "zod";
106809
- var BASE_URL31 = "https://api.linkedin.com/rest/";
106847
+ var BASE_URL29 = "https://api.linkedin.com/rest/";
106810
106848
  var LINKEDIN_VERSION = "202603";
106811
106849
  var REQUEST_TIMEOUT_MS52 = 6e4;
106812
106850
  var cachedToken26 = null;
@@ -106890,7 +106928,7 @@ var listAdAccountsTool3 = new ConnectorTool({
106890
106928
  Authorization: `Bearer ${token}`
106891
106929
  },
106892
106930
  body: JSON.stringify({
106893
- url: `${BASE_URL31}adAccounts?q=search&search=(status:(values:List(ACTIVE)))&pageSize=100`,
106931
+ url: `${BASE_URL29}adAccounts?q=search&search=(status:(values:List(ACTIVE)))&pageSize=100`,
106894
106932
  method: "GET",
106895
106933
  headers: {
106896
106934
  "LinkedIn-Version": LINKEDIN_VERSION,
@@ -106973,7 +107011,7 @@ var parameters54 = {
106973
107011
 
106974
107012
  // ../connectors/src/connectors/linkedin-ads/tools/request.ts
106975
107013
  import { z as z68 } from "zod";
106976
- var BASE_URL32 = "https://api.linkedin.com/rest/";
107014
+ var BASE_URL30 = "https://api.linkedin.com/rest/";
106977
107015
  var LINKEDIN_VERSION2 = "202603";
106978
107016
  var REQUEST_TIMEOUT_MS53 = 6e4;
106979
107017
  var cachedToken27 = null;
@@ -107052,7 +107090,7 @@ Required headers (LinkedIn-Version, X-Restli-Protocol-Version) are set automatic
107052
107090
  try {
107053
107091
  const adAccountId = parameters54.adAccountId.tryGetValue(connection2) ?? "";
107054
107092
  const resolvedPath = adAccountId ? path5.replace(/\{adAccountId\}/g, adAccountId) : path5;
107055
- let url = `${BASE_URL32}${resolvedPath}`;
107093
+ let url = `${BASE_URL30}${resolvedPath}`;
107056
107094
  if (queryParams && Object.keys(queryParams).length > 0) {
107057
107095
  const params = new URLSearchParams(queryParams);
107058
107096
  const separator = url.includes("?") ? "&" : "?";
@@ -108008,7 +108046,7 @@ var parameters57 = {
108008
108046
 
108009
108047
  // ../connectors/src/connectors/intercom/tools/request.ts
108010
108048
  import { z as z71 } from "zod";
108011
- var BASE_URL33 = "https://api.intercom.io";
108049
+ var BASE_URL31 = "https://api.intercom.io";
108012
108050
  var API_VERSION = "2.11";
108013
108051
  var REQUEST_TIMEOUT_MS56 = 6e4;
108014
108052
  var inputSchema71 = z71.object({
@@ -108058,7 +108096,7 @@ The Intercom-Version header is set to 2.11 automatically.`,
108058
108096
  );
108059
108097
  try {
108060
108098
  const accessToken = parameters57.accessToken.getValue(connection2);
108061
- const url = `${BASE_URL33}${path5.startsWith("/") ? "" : "/"}${path5}`;
108099
+ const url = `${BASE_URL31}${path5.startsWith("/") ? "" : "/"}${path5}`;
108062
108100
  const controller = new AbortController();
108063
108101
  const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS56);
108064
108102
  try {
@@ -108301,7 +108339,7 @@ export default async function handler(c: Context) {
108301
108339
 
108302
108340
  // ../connectors/src/connectors/intercom-oauth/tools/request.ts
108303
108341
  import { z as z72 } from "zod";
108304
- var BASE_URL34 = "https://api.intercom.io";
108342
+ var BASE_URL32 = "https://api.intercom.io";
108305
108343
  var REQUEST_TIMEOUT_MS57 = 6e4;
108306
108344
  var cachedToken29 = null;
108307
108345
  async function getProxyToken29(config) {
@@ -108378,7 +108416,7 @@ Search endpoints (contacts/search, conversations/search) use POST with a query o
108378
108416
  `[connector-request] intercom-oauth/${connection2.name}: ${method} ${path5}`
108379
108417
  );
108380
108418
  try {
108381
- let url = `${BASE_URL34}${path5.startsWith("/") ? "" : "/"}${path5}`;
108419
+ let url = `${BASE_URL32}${path5.startsWith("/") ? "" : "/"}${path5}`;
108382
108420
  if (queryParams) {
108383
108421
  const searchParams = new URLSearchParams(queryParams);
108384
108422
  const separator = url.includes("?") ? "&" : "?";
@@ -109491,7 +109529,7 @@ var parameters62 = {
109491
109529
 
109492
109530
  // ../connectors/src/connectors/gamma/tools/request.ts
109493
109531
  import { z as z76 } from "zod";
109494
- var BASE_URL35 = "https://public-api.gamma.app/v1.0";
109532
+ var BASE_URL33 = "https://public-api.gamma.app/v1.0";
109495
109533
  var REQUEST_TIMEOUT_MS61 = 6e4;
109496
109534
  var inputSchema76 = z76.object({
109497
109535
  toolUseIntent: z76.string().optional().describe(
@@ -109536,7 +109574,7 @@ For creating presentations/documents, prefer the gamma_generate tool instead.`,
109536
109574
  );
109537
109575
  try {
109538
109576
  const apiKey = parameters62.apiKey.getValue(connection2);
109539
- const url = `${BASE_URL35}${path5}`;
109577
+ const url = `${BASE_URL33}${path5}`;
109540
109578
  const controller = new AbortController();
109541
109579
  const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS61);
109542
109580
  try {
@@ -109568,7 +109606,7 @@ For creating presentations/documents, prefer the gamma_generate tool instead.`,
109568
109606
 
109569
109607
  // ../connectors/src/connectors/gamma/tools/generate.ts
109570
109608
  import { z as z77 } from "zod";
109571
- var BASE_URL36 = "https://public-api.gamma.app/v1.0";
109609
+ var BASE_URL34 = "https://public-api.gamma.app/v1.0";
109572
109610
  var POLL_INTERVAL_MS3 = 5e3;
109573
109611
  var MAX_POLL_DURATION_MS = 3e5;
109574
109612
  var inputSchema77 = z77.object({
@@ -109685,7 +109723,7 @@ Gamma does NOT support image uploads. To visualize data, embed raw numbers direc
109685
109723
  if (textAmount) textOptions.amount = textAmount;
109686
109724
  if (Object.keys(textOptions).length > 0) body.textOptions = textOptions;
109687
109725
  if (imageSource) body.imageOptions = { source: imageSource };
109688
- const createRes = await fetch(`${BASE_URL36}/generations`, {
109726
+ const createRes = await fetch(`${BASE_URL34}/generations`, {
109689
109727
  method: "POST",
109690
109728
  headers,
109691
109729
  body: JSON.stringify(body)
@@ -109705,7 +109743,7 @@ Gamma does NOT support image uploads. To visualize data, embed raw numbers direc
109705
109743
  const deadline = Date.now() + MAX_POLL_DURATION_MS;
109706
109744
  while (Date.now() < deadline) {
109707
109745
  await new Promise((resolve) => setTimeout(resolve, POLL_INTERVAL_MS3));
109708
- const pollRes = await fetch(`${BASE_URL36}/generations/${generationId}`, {
109746
+ const pollRes = await fetch(`${BASE_URL34}/generations/${generationId}`, {
109709
109747
  method: "GET",
109710
109748
  headers
109711
109749
  });
@@ -109943,7 +109981,7 @@ var parameters63 = {
109943
109981
 
109944
109982
  // ../connectors/src/connectors/sentry/tools/request.ts
109945
109983
  import { z as z78 } from "zod";
109946
- var BASE_URL37 = "https://sentry.io/api/0";
109984
+ var BASE_URL35 = "https://sentry.io/api/0";
109947
109985
  var REQUEST_TIMEOUT_MS62 = 6e4;
109948
109986
  var inputSchema78 = z78.object({
109949
109987
  toolUseIntent: z78.string().optional().describe(
@@ -109993,7 +110031,7 @@ Authentication is handled automatically via Bearer token.
109993
110031
  /\{organizationSlug\}/g,
109994
110032
  organizationSlug
109995
110033
  );
109996
- const url = `${BASE_URL37}${resolvedPath.startsWith("/") ? "" : "/"}${resolvedPath}`;
110034
+ const url = `${BASE_URL35}${resolvedPath.startsWith("/") ? "" : "/"}${resolvedPath}`;
109997
110035
  const controller = new AbortController();
109998
110036
  const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS62);
109999
110037
  try {
@@ -111006,7 +111044,7 @@ var parameters66 = {
111006
111044
 
111007
111045
  // ../connectors/src/connectors/monday/tools/request.ts
111008
111046
  import { z as z81 } from "zod";
111009
- var BASE_URL38 = "https://api.monday.com/v2";
111047
+ var BASE_URL36 = "https://api.monday.com/v2";
111010
111048
  var REQUEST_TIMEOUT_MS65 = 6e4;
111011
111049
  var inputSchema81 = z81.object({
111012
111050
  toolUseIntent: z81.string().optional().describe(
@@ -111064,7 +111102,7 @@ Items are paginated with a cursor-based \`items_page(limit, cursor)\` field on a
111064
111102
  "Content-Type": "application/json"
111065
111103
  };
111066
111104
  if (apiVersion) headers["API-Version"] = apiVersion;
111067
- const response = await fetch(BASE_URL38, {
111105
+ const response = await fetch(BASE_URL36, {
111068
111106
  method: "POST",
111069
111107
  headers,
111070
111108
  body: JSON.stringify(body),
@@ -111377,17 +111415,27 @@ async function importMssql() {
111377
111415
  }
111378
111416
  async function runMssqlQuery(parsed, sql, options = {}) {
111379
111417
  const sqlMod = await importMssql();
111380
- const config = toMssqlConfig(parsed, {
111381
- encrypt: options.forceEncrypt
111382
- });
111383
- const pool = new sqlMod.ConnectionPool(config);
111384
- await pool.connect();
111418
+ const tunnel = options.tunnelParams ? await maybeOpenSshTunnelHostPort(
111419
+ options.tunnelParams,
111420
+ parsed.server,
111421
+ parsed.port
111422
+ ) : null;
111385
111423
  try {
111386
- const result = await pool.request().query(sql);
111387
- const recordset = result.recordset ?? [];
111388
- return { rows: recordset };
111424
+ const tunneled = tunnel ? { ...parsed, server: tunnel.host, port: tunnel.port } : parsed;
111425
+ const config = toMssqlConfig(tunneled, {
111426
+ encrypt: options.forceEncrypt
111427
+ });
111428
+ const pool = new sqlMod.ConnectionPool(config);
111429
+ await pool.connect();
111430
+ try {
111431
+ const result = await pool.request().query(sql);
111432
+ const recordset = result.recordset ?? [];
111433
+ return { rows: recordset };
111434
+ } finally {
111435
+ await pool.close();
111436
+ }
111389
111437
  } finally {
111390
- await pool.close();
111438
+ await tunnel?.close();
111391
111439
  }
111392
111440
  }
111393
111441
  async function checkMssqlConnection(url, credentials, options = {}) {
@@ -111475,35 +111523,69 @@ function parseOracleJdbcUrl(jdbcUrl, options = {}) {
111475
111523
  function redactOracleUrl(jdbcUrl) {
111476
111524
  return jdbcUrl.replace(/(:\/\/)([^@/]+)@/, "$1***@").replace(/(thin:)([^@]+)@/i, "$1***@");
111477
111525
  }
111526
+ function parseOracleConnectStringHostPort(connectString) {
111527
+ const m4 = /^([^:/]+):(\d+)(.*)$/.exec(connectString);
111528
+ if (!m4) return null;
111529
+ return { host: m4[1], port: Number(m4[2]), trailing: m4[3] };
111530
+ }
111531
+ function rewriteOracleConnectStringHostPort(connectString, host, port) {
111532
+ const parts = parseOracleConnectStringHostPort(connectString);
111533
+ if (!parts) return connectString;
111534
+ return `${host}:${port}${parts.trailing}`;
111535
+ }
111478
111536
 
111479
111537
  // ../connectors/src/lib/oracle-runner.ts
111480
111538
  async function importOracleDb() {
111481
111539
  const mod = await import("oracledb");
111482
111540
  return mod.default ?? mod;
111483
111541
  }
111484
- async function runOracleQuery(parsed, sql) {
111542
+ async function runOracleQuery(parsed, sql, options = {}) {
111485
111543
  const oracledb = await importOracleDb();
111486
- const connection2 = await oracledb.getConnection({
111487
- user: parsed.user,
111488
- password: parsed.password,
111489
- connectString: parsed.connectString
111490
- });
111544
+ let tunnel = null;
111545
+ if (options.tunnelParams) {
111546
+ const hostPort = parseOracleConnectStringHostPort(parsed.connectString);
111547
+ if (hostPort) {
111548
+ tunnel = await maybeOpenSshTunnelHostPort(
111549
+ options.tunnelParams,
111550
+ hostPort.host,
111551
+ hostPort.port
111552
+ );
111553
+ }
111554
+ }
111491
111555
  try {
111492
- const result = await connection2.execute(sql, [], {
111493
- outFormat: oracledb.OUT_FORMAT_OBJECT,
111494
- // Bound by the connector's own row cap, but keep the driver from
111495
- // streaming arbitrarily large result sets.
111496
- maxRows: 5e3
111556
+ const connectString = tunnel ? rewriteOracleConnectStringHostPort(
111557
+ parsed.connectString,
111558
+ tunnel.host,
111559
+ tunnel.port
111560
+ ) : parsed.connectString;
111561
+ const connection2 = await oracledb.getConnection({
111562
+ user: parsed.user,
111563
+ password: parsed.password,
111564
+ connectString
111497
111565
  });
111498
- return { rows: result.rows ?? [] };
111499
- } finally {
111500
111566
  try {
111501
- await connection2.close();
111502
- } catch {
111567
+ const result = await connection2.execute(
111568
+ sql,
111569
+ [],
111570
+ {
111571
+ outFormat: oracledb.OUT_FORMAT_OBJECT,
111572
+ // Bound by the connector's own row cap, but keep the driver from
111573
+ // streaming arbitrarily large result sets.
111574
+ maxRows: 5e3
111575
+ }
111576
+ );
111577
+ return { rows: result.rows ?? [] };
111578
+ } finally {
111579
+ try {
111580
+ await connection2.close();
111581
+ } catch {
111582
+ }
111503
111583
  }
111584
+ } finally {
111585
+ await tunnel?.close();
111504
111586
  }
111505
111587
  }
111506
- async function checkOracleConnection(url, credentials) {
111588
+ async function checkOracleConnection(url, credentials, options = {}) {
111507
111589
  let parsed;
111508
111590
  try {
111509
111591
  parsed = parseOracleJdbcUrl(url, credentials);
@@ -111514,7 +111596,7 @@ async function checkOracleConnection(url, credentials) {
111514
111596
  };
111515
111597
  }
111516
111598
  try {
111517
- await runOracleQuery(parsed, "SELECT 1 FROM DUAL");
111599
+ await runOracleQuery(parsed, "SELECT 1 FROM DUAL", options);
111518
111600
  return { success: true };
111519
111601
  } catch (err) {
111520
111602
  let msg = err instanceof Error ? err.message : String(err);
@@ -111724,12 +111806,13 @@ Always bound results: LIMIT for PG/MySQL/Redshift, TOP for SQL Server, FETCH FIR
111724
111806
  };
111725
111807
  }
111726
111808
  try {
111809
+ const tunnelParams = connectionParamsToRecord(connection2);
111727
111810
  if (parsed.driver === "sqlserver") {
111728
111811
  const mssqlParsed = parseSqlServerJdbcUrl(parsed.originalUrl, {
111729
111812
  username,
111730
111813
  password
111731
111814
  });
111732
- const result = await runMssqlQuery(mssqlParsed, sql);
111815
+ const result = await runMssqlQuery(mssqlParsed, sql, { tunnelParams });
111733
111816
  const rows = result.rows;
111734
111817
  return {
111735
111818
  success: true,
@@ -111744,7 +111827,9 @@ Always bound results: LIMIT for PG/MySQL/Redshift, TOP for SQL Server, FETCH FIR
111744
111827
  password
111745
111828
  });
111746
111829
  const cleanSql = sql.replace(/;\s*$/, "");
111747
- const result = await runOracleQuery(oracleParsed, cleanSql);
111830
+ const result = await runOracleQuery(oracleParsed, cleanSql, {
111831
+ tunnelParams
111832
+ });
111748
111833
  const rows = result.rows;
111749
111834
  return {
111750
111835
  success: true,
@@ -111756,7 +111841,7 @@ Always bound results: LIMIT for PG/MySQL/Redshift, TOP for SQL Server, FETCH FIR
111756
111841
  let tunnel;
111757
111842
  try {
111758
111843
  tunnel = await maybeOpenSshTunnel(
111759
- connectionParamsToRecord(connection2),
111844
+ tunnelParams,
111760
111845
  parsed.nativeUrl,
111761
111846
  parsed.defaultPort
111762
111847
  );
@@ -111930,10 +112015,18 @@ JDBC URL \u306E\u30D7\u30EC\u30D5\u30A3\u30C3\u30AF\u30B9\u306B\u3088\u308A\u65B
111930
112015
  };
111931
112016
  }
111932
112017
  if (parsed.driver === "sqlserver") {
111933
- return checkMssqlConnection(parsed.originalUrl, { username, password });
112018
+ return checkMssqlConnection(
112019
+ parsed.originalUrl,
112020
+ { username, password },
112021
+ { tunnelParams: params }
112022
+ );
111934
112023
  }
111935
112024
  if (parsed.driver === "oracle") {
111936
- return checkOracleConnection(parsed.originalUrl, { username, password });
112025
+ return checkOracleConnection(
112026
+ parsed.originalUrl,
112027
+ { username, password },
112028
+ { tunnelParams: params }
112029
+ );
111937
112030
  }
111938
112031
  const tunnel = await maybeOpenSshTunnel(
111939
112032
  params,
@@ -111990,10 +112083,12 @@ JDBC URL \u306E\u30D7\u30EC\u30D5\u30A3\u30C3\u30AF\u30B9\u306B\u3088\u308A\u65B
111990
112083
  });
111991
112084
  const sample = unwrapSampleLimit(sql);
111992
112085
  if (sample) {
111993
- const result = await runMssqlQuery(mssqlParsed, sample.inner);
112086
+ const result = await runMssqlQuery(mssqlParsed, sample.inner, {
112087
+ tunnelParams: params
112088
+ });
111994
112089
  return { rows: result.rows.slice(0, sample.limit) };
111995
112090
  }
111996
- return runMssqlQuery(mssqlParsed, sql);
112091
+ return runMssqlQuery(mssqlParsed, sql, { tunnelParams: params });
111997
112092
  }
111998
112093
  if (parsed.driver === "oracle") {
111999
112094
  const oracleParsed = parseOracleJdbcUrl(parsed.originalUrl, {
@@ -112003,11 +112098,13 @@ JDBC URL \u306E\u30D7\u30EC\u30D5\u30A3\u30C3\u30AF\u30B9\u306B\u3088\u308A\u65B
112003
112098
  const sample = unwrapSampleLimit(sql);
112004
112099
  if (sample) {
112005
112100
  const inner = sample.inner.replace(/;\s*$/, "");
112006
- const result = await runOracleQuery(oracleParsed, inner);
112101
+ const result = await runOracleQuery(oracleParsed, inner, {
112102
+ tunnelParams: params
112103
+ });
112007
112104
  return { rows: result.rows.slice(0, sample.limit) };
112008
112105
  }
112009
112106
  const cleanSql = sql.replace(/;\s*$/, "");
112010
- return runOracleQuery(oracleParsed, cleanSql);
112107
+ return runOracleQuery(oracleParsed, cleanSql, { tunnelParams: params });
112011
112108
  }
112012
112109
  const tunnel = await maybeOpenSshTunnel(
112013
112110
  params,
@@ -112071,7 +112168,7 @@ var parameters68 = {
112071
112168
  };
112072
112169
 
112073
112170
  // ../connectors/src/connectors/semrush/tools/request.ts
112074
- var BASE_URL39 = "https://api.semrush.com";
112171
+ var BASE_URL37 = "https://api.semrush.com";
112075
112172
  var REQUEST_TIMEOUT_MS66 = 6e4;
112076
112173
  var inputSchema83 = z83.object({
112077
112174
  toolUseIntent: z83.string().optional().describe(
@@ -112151,7 +112248,7 @@ Errors from the Standard API are returned as a plain text body starting with "ER
112151
112248
  }
112152
112249
  }
112153
112250
  const url = new URL(
112154
- isAbsolute ? path5 : `${BASE_URL39}${path5.startsWith("/") ? "" : "/"}${path5}`
112251
+ isAbsolute ? path5 : `${BASE_URL37}${path5.startsWith("/") ? "" : "/"}${path5}`
112155
112252
  );
112156
112253
  if (queryParams) {
112157
112254
  for (const [k6, v] of Object.entries(queryParams)) {
@@ -112239,16 +112336,18 @@ var semrushOnboarding = new ConnectorOnboarding({
112239
112336
  - Write only 1 sentence between tool calls, then immediately call the next tool. Skip unnecessary explanations and proceed efficiently`
112240
112337
  },
112241
112338
  dataOverviewInstructions: {
112242
- en: `1. Call ${requestToolName12} with path "/" and queryParams \`{ "type": "domain_overview", "domain": "<example.com>", "database": "us" }\` to inspect the domain overview report (CSV)
112339
+ en: `1. Call ${requestToolName12} with path "/" and queryParams \`{ "type": "domain_ranks", "domain": "<example.com>", "database": "us" }\` to inspect the domain summary report (single-row CSV: rank, organic/paid keywords, traffic, cost)
112243
112340
  2. Call ${requestToolName12} with path "/" and queryParams \`{ "type": "domain_organic", "domain": "<example.com>", "database": "us", "display_limit": "5" }\` to sample organic keywords
112244
112341
  3. Call ${requestToolName12} with path "/" and queryParams \`{ "type": "phrase_this", "phrase": "<keyword>", "database": "us" }\` to inspect a keyword overview
112245
- 4. Explore other report types (backlinks_overview, domain_adwords, phrase_related) and the Trends API ("/analytics/v1/...") with responseFormat="json" as needed
112246
- 5. Remember: the Standard Analytics API returns semicolon-separated CSV with the first row as the header`,
112247
- ja: `1. ${requestToolName12} \u3067 path "/" \u3068 queryParams \`{ "type": "domain_overview", "domain": "<example.com>", "database": "us" }\` \u3092\u547C\u3073\u51FA\u3057\u3001\u30C9\u30E1\u30A4\u30F3\u30AA\u30FC\u30D0\u30FC\u30D3\u30E5\u30FC\uFF08CSV\uFF09\u3092\u78BA\u8A8D
112342
+ 4. Optionally call ${requestToolName12} with path "/analytics/v1/" and queryParams \`{ "type": "backlinks_overview", "target": "<example.com>", "target_type": "root_domain" }\` to inspect a backlinks summary (returns semicolon-separated CSV \u2014 keep \`responseFormat="text"\`)
112343
+ 5. Always pass an explicit small \`display_limit\` (e.g. \`"5"\`) \u2014 never rely on the default 10000, which can trip \`ERROR 132\` even when units remain
112344
+ 6. Remember: the Standard Analytics API and the \`/analytics/v1/?type=backlinks_*\` Backlinks endpoints both return semicolon-separated CSV with the first row as the header`,
112345
+ ja: `1. ${requestToolName12} \u3067 path "/" \u3068 queryParams \`{ "type": "domain_ranks", "domain": "<example.com>", "database": "us" }\` \u3092\u547C\u3073\u51FA\u3057\u3001\u30C9\u30E1\u30A4\u30F3\u30B5\u30DE\u30EA\u30FC\u30EC\u30DD\u30FC\u30C8\uFF08rank\u30FB\u30AA\u30FC\u30AC\u30CB\u30C3\u30AF/\u6709\u6599\u30AD\u30FC\u30EF\u30FC\u30C9\u30FB\u30C8\u30E9\u30D5\u30A3\u30C3\u30AF\u30FB\u30B3\u30B9\u30C8\u7B49\u306E1\u884CCSV\uFF09\u3092\u78BA\u8A8D
112248
112346
  2. ${requestToolName12} \u3067 path "/" \u3068 queryParams \`{ "type": "domain_organic", "domain": "<example.com>", "database": "us", "display_limit": "5" }\` \u3092\u547C\u3073\u51FA\u3057\u3001\u30AA\u30FC\u30AC\u30CB\u30C3\u30AF\u30AD\u30FC\u30EF\u30FC\u30C9\u3092\u30B5\u30F3\u30D7\u30EA\u30F3\u30B0
112249
112347
  3. ${requestToolName12} \u3067 path "/" \u3068 queryParams \`{ "type": "phrase_this", "phrase": "<keyword>", "database": "us" }\` \u3092\u547C\u3073\u51FA\u3057\u3001\u30AD\u30FC\u30EF\u30FC\u30C9\u6982\u8981\u3092\u78BA\u8A8D
112250
- 4. \u5FC5\u8981\u306B\u5FDC\u3058\u3066\u4ED6\u306E\u30EC\u30DD\u30FC\u30C8\u30BF\u30A4\u30D7\uFF08backlinks_overview\u3001domain_adwords\u3001phrase_related\uFF09\u3084 Trends API ("/analytics/v1/...", responseFormat="json") \u3092\u63A2\u7D22
112251
- 5. \u6CE8\u610F: Standard Analytics API \u306F\u30BB\u30DF\u30B3\u30ED\u30F3\u533A\u5207\u308ACSV\u3092\u8FD4\u3057\u30011\u884C\u76EE\u304C\u30D8\u30C3\u30C0\u30FC`
112348
+ 4. \u5FC5\u8981\u306B\u5FDC\u3058\u3066 ${requestToolName12} \u3067 path "/analytics/v1/" \u3068 queryParams \`{ "type": "backlinks_overview", "target": "<example.com>", "target_type": "root_domain" }\` \u3092\u547C\u3073\u51FA\u3057\u3066\u30D0\u30C3\u30AF\u30EA\u30F3\u30AF\u30B5\u30DE\u30EA\u30FC\u3092\u78BA\u8A8D\uFF08\u30BB\u30DF\u30B3\u30ED\u30F3\u533A\u5207\u308ACSV\u3092\u8FD4\u3059\u305F\u3081 \`responseFormat="text"\` \u306E\u307E\u307E\uFF09
112349
+ 5. \`display_limit\` \u306F\u5FC5\u305A\u660E\u793A\u7684\u306B\u5C0F\u3055\u3044\u5024\uFF08\u4F8B: \`"5"\`\uFF09\u3092\u6307\u5B9A\u3059\u308B\u3053\u3068\u3002\u30C7\u30D5\u30A9\u30EB\u30C810000\u306E\u307E\u307E\u3060\u3068\u30E6\u30CB\u30C3\u30C8\u6B8B\u91CF\u304C\u3042\u3063\u3066\u3082 \`ERROR 132\` \u3067\u62D2\u5426\u3055\u308C\u308B\u3053\u3068\u304C\u3042\u308B
112350
+ 6. \u6CE8\u610F: Standard Analytics API \u304A\u3088\u3073 \`/analytics/v1/?type=backlinks_*\` \u306E\u30D0\u30C3\u30AF\u30EA\u30F3\u30AF\u7CFB\u30A8\u30F3\u30C9\u30DD\u30A4\u30F3\u30C8\u306F\u3069\u3061\u3089\u3082\u30BB\u30DF\u30B3\u30ED\u30F3\u533A\u5207\u308ACSV\uFF081\u884C\u76EE\u304C\u30D8\u30C3\u30C0\u30FC\uFF09\u3092\u8FD4\u3059`
112252
112351
  }
112253
112352
  });
112254
112353
 
@@ -112275,10 +112374,19 @@ The business logic type for this connector is "typescript". Write handler code u
112275
112374
 
112276
112375
  SDK methods (client created via \`connection(connectionId)\`):
112277
112376
  - \`client.request(path, init?)\` \u2014 low-level authenticated fetch. Pass \`init.query\` to set query parameters; \`key\` is injected automatically
112278
- - \`client.report(type, query?)\` \u2014 call a Standard Analytics report and parse the CSV into \`{ columns, rows, raw }\`
112377
+ - \`client.checkUnits()\` \u2014 return the current API unit balance as a number. **FREE \u2014 does not consume units.** Use as a pre-flight before \`report()\`
112378
+ - \`client.report(type, query?)\` \u2014 call a Standard Analytics report and parse the CSV into \`{ columns: string[], rows: Record<string, string>[], raw: string }\`. Throws \`API UNITS BALANCE IS ZERO\` when the account is out of units
112279
112379
  - \`client.trends(path, query?)\` \u2014 call a Trends API endpoint (\`/analytics/v1/...\`) and return parsed JSON
112280
112380
  - \`client.projects(path, init?)\` \u2014 call a Projects API endpoint (\`/management/v1/...\`) and return parsed JSON
112281
112381
 
112382
+ \u{1F6A8} **MANDATORY pre-flight before creating any server logic that calls \`report()\`.** Before authoring a TypeScript handler that invokes \`client.report(...)\` (Standard Analytics \u2014 \`domain_ranks\`, \`domain_organic\`, \`phrase_this\`, etc.), you MUST first call the \`semrush-api-key_request\` tool with \`path: "https://www.semrush.com/users/countapiunits.html"\`, no \`queryParams\`, \`responseFormat: "text"\` to confirm the unit balance is greater than 0. If the balance is 0, **stop, do not create the server logic**, and report the issue to the user (the account owner needs to top up API units in the Semrush console). \`testFetchServerLogic\` will execute the handler and consume units; creating handlers when the balance is 0 produces \`ERROR 132 :: API UNITS BALANCE IS ZERO\` failures across every server logic.
112383
+
112384
+ \u{1F6A8} **Always set a small \`display_limit\` explicitly \u2014 never rely on the default.** Semrush computes "required units = display_limit \xD7 per-row cost" up front, and rejects the request with \`ERROR 132 :: API UNITS BALANCE IS ZERO\` when the *estimated* cost exceeds the remaining balance, **even when the actual balance is non-zero** (e.g. balance \u2248 40,950 still fails for \`display_limit=10000\` on costly reports). Default to \`display_limit: "1000"\` (or smaller \u2014 \`"100"\` is plenty for most dashboards), and only increase it when the user explicitly asks for a larger sample AND \`checkUnits()\` confirms enough headroom. If you truly need all rows, paginate with \`display_offset\` in chunks of 1000 instead of bumping \`display_limit\`. Treat \`ERROR 132\` as "request too large for the current balance" first, and only as "balance is literally zero" after re-checking units.
112385
+
112386
+ \u{1F6AB} **Do NOT use the Trends API (\`client.trends\`) or Projects API (\`client.projects\`) unless the user explicitly requests them.** These APIs require separate paid subscriptions (Trends and Projects/Management) that not every Semrush account has. Calls without the corresponding subscription fail with an authorization error. Default to the Standard Analytics API (\`client.report\`) for all SEO/keyword/backlink/competitor analysis. Only reach for \`trends()\` / \`projects()\` when the user explicitly mentions Trends data (traffic analytics, market explorer, etc.) or Projects (site audit, position tracking, etc.) \u2014 and confirm the user has the subscription before building the server logic.
112387
+
112388
+ \u26A0\uFE0F **Important: \`report()\` row shape.** \`rows\` is \`Record<string, string>[]\` \u2014 each row is an object keyed by the CSV column NAME (matching \`columns\`), NOT a positional array. Access fields with \`row["Url"]\`, \`row["Keyword"]\`, \`row["Search Volume"]\` (column names may contain spaces). Do NOT use \`columns.indexOf("Url")\` and then \`row[index]\` \u2014 that returns \`undefined\` and silently produces empty results when combined with \`?? ""\` or \`Number(...) || 0\`. All values are strings; convert numeric columns with \`Number(row["Position"])\`.
112389
+
112282
112390
  \`\`\`ts
112283
112391
  import type { Context } from "hono";
112284
112392
  import { connection } from "@squadbase/vite-server/connectors/semrush";
@@ -112291,9 +112399,25 @@ export default async function handler(c: Context) {
112291
112399
  database?: string;
112292
112400
  }>();
112293
112401
 
112294
- const overview = await semrush.report("domain_overview", { domain, database });
112402
+ const result = await semrush.report("domain_organic", {
112403
+ domain,
112404
+ database,
112405
+ display_limit: "100",
112406
+ });
112407
+
112408
+ // \u2705 Correct: access by column name
112409
+ const rows = result.rows.map((row) => ({
112410
+ keyword: row["Keyword"],
112411
+ position: Number(row["Position"]) || 0,
112412
+ searchVolume: Number(row["Search Volume"]) || 0,
112413
+ url: row["Url"] ?? "",
112414
+ }));
112415
+
112416
+ // \u274C Wrong: do NOT do this \u2014 row[index] is undefined because rows are objects, not arrays
112417
+ // const urlIdx = result.columns.indexOf("Url");
112418
+ // const url = (row as unknown as string[])[urlIdx];
112295
112419
 
112296
- return c.json({ columns: overview.columns, rows: overview.rows });
112420
+ return c.json({ columns: result.columns, rows });
112297
112421
  }
112298
112422
  \`\`\`
112299
112423
 
@@ -112305,8 +112429,8 @@ export default async function handler(c: Context) {
112305
112429
 
112306
112430
  Authentication: API key passed as the \`key\` query parameter on every request (handled automatically).
112307
112431
 
112308
- #### Common Standard Analytics report types
112309
- - \`domain_overview\` \u2014 domain summary (organic/paid traffic, keywords, backlinks)
112432
+ #### Common Standard Analytics report types (path \`/\`, returns CSV)
112433
+ - \`domain_ranks\` \u2014 single-row domain summary (rank, organic/paid keywords, traffic, cost). **There is no \`domain_overview\` type \u2014 use \`domain_ranks\`.**
112310
112434
  - \`domain_organic\` \u2014 organic keywords for a domain
112311
112435
  - \`domain_adwords\` \u2014 paid keywords for a domain
112312
112436
  - \`domain_organic_organic\` / \`domain_adwords_adwords\` \u2014 organic / paid competitors
@@ -112315,10 +112439,13 @@ Authentication: API key passed as the \`key\` query parameter on every request (
112315
112439
  - \`phrase_fullsearch\` \u2014 full-text keyword research
112316
112440
  - \`phrase_questions\` \u2014 question keywords
112317
112441
  - \`phrase_kdi\` \u2014 keyword difficulty index
112442
+ - \`url_organic\` / \`url_adwords\` \u2014 keywords ranking for a specific URL
112443
+
112444
+ #### Backlinks API report types (path \`/analytics/v1/\`, also returns **CSV** \u2014 not JSON)
112445
+ Backlinks endpoints live under \`/analytics/v1/?type=backlinks_*\` and require \`target\` + \`target_type\` (\`root_domain\` | \`domain\` | \`url\`) instead of \`domain\`/\`database\`. They return semicolon-separated CSV, so use \`responseFormat="text"\` from the request tool, and from the SDK use \`client.request("/analytics/v1/", { query: { type: "backlinks_overview", target, target_type: "root_domain" } })\` and parse the CSV yourself \u2014 \`client.trends()\` will throw because it JSON-parses the body.
112318
112446
  - \`backlinks_overview\` \u2014 backlinks summary
112319
112447
  - \`backlinks\` \u2014 list of backlinks
112320
112448
  - \`backlinks_refdomains\` \u2014 referring domains
112321
- - \`url_organic\` / \`url_adwords\` \u2014 keywords ranking for a specific URL
112322
112449
 
112323
112450
  To check remaining API units (free, does NOT consume units), call the request tool with an absolute URL: \`path: "https://www.semrush.com/users/countapiunits.html"\`, no query params, \`responseFormat: "text"\`. The response body is just a number.
112324
112451
 
@@ -112326,7 +112453,7 @@ To check remaining API units (free, does NOT consume units), call the request to
112326
112453
  - \`type\` \u2014 report type (required for the Standard API)
112327
112454
  - \`domain\` / \`phrase\` / \`url\` \u2014 entity to query
112328
112455
  - \`database\` \u2014 regional database (e.g. \`us\`, \`uk\`, \`de\`, \`fr\`, \`jp\`, \`br\`); required for most reports
112329
- - \`display_limit\` \u2014 page size (default 10000, max 100000 depending on report)
112456
+ - \`display_limit\` \u2014 page size (default 10000, max 100000 depending on report). **Do NOT use the default \u2014 always pass an explicit small value like \`"1000"\`.** Large limits make Semrush pre-charge required units and reject with \`ERROR 132\` even when the balance is non-zero.
112330
112457
  - \`display_offset\` \u2014 pagination offset
112331
112458
  - \`display_date\` \u2014 historical date in \`YYYYMM15\` format (always day 15)
112332
112459
  - \`export_columns\` \u2014 comma-separated columns to return (e.g. \`Ph,Po,Nq,Cp\`)
@@ -112337,6 +112464,7 @@ To check remaining API units (free, does NOT consume units), call the request to
112337
112464
  - Each Standard Analytics report consumes API units; check the unit balance via \`https://www.semrush.com/users/countapiunits.html?key=...\` (free) first if you suspect a quota issue
112338
112465
  - The CSV separator is \`;\` (semicolon), NOT \`,\`. Some cells may contain commas inside them.
112339
112466
  - An HTTP 200 response with a body starting with \`ERROR\` indicates an API error (auth, parameters, or quota)
112467
+ - \`ERROR 132 :: API UNITS BALANCE IS ZERO\` does NOT only mean the balance is literally 0. Semrush also returns it when \`display_limit \xD7 per-row cost\` exceeds the remaining balance. Re-check the balance with \`countapiunits.html\` and lower \`display_limit\` (e.g. to \`1000\` or \`100\`) before assuming the account is empty.
112340
112468
  - The Trends API requires a separate Trends subscription; calls without it will fail with an authorization error
112341
112469
  - Date strings in historical endpoints must be the 15th of the month (\`YYYYMM15\`)`,
112342
112470
  ja: `### \u30C4\u30FC\u30EB
@@ -112349,10 +112477,19 @@ To check remaining API units (free, does NOT consume units), call the request to
112349
112477
 
112350
112478
  SDK\u30E1\u30BD\u30C3\u30C9 (\`connection(connectionId)\` \u3067\u4F5C\u6210\u3057\u305F\u30AF\u30E9\u30A4\u30A2\u30F3\u30C8):
112351
112479
  - \`client.request(path, init?)\` \u2014 \u8A8D\u8A3C\u4ED8\u304D\u306E\u4F4E\u30EC\u30D9\u30EBfetch\u3002\`init.query\` \u3067\u30AF\u30A8\u30EA\u30D1\u30E9\u30E1\u30FC\u30BF\u3092\u6307\u5B9A\u3002\`key\` \u306F\u81EA\u52D5\u4ED8\u4E0E
112352
- - \`client.report(type, query?)\` \u2014 Standard Analytics \u306E\u30EC\u30DD\u30FC\u30C8\u3092\u547C\u3073\u51FA\u3057\u3001CSV\u3092 \`{ columns, rows, raw }\` \u306B\u30D1\u30FC\u30B9
112480
+ - \`client.checkUnits()\` \u2014 \u73FE\u5728\u306E API \u30E6\u30CB\u30C3\u30C8\u6B8B\u91CF\u3092\u6570\u5024\u3067\u8FD4\u3059\u3002**\u7121\u6599\u3067\u3001\u30E6\u30CB\u30C3\u30C8\u3092\u6D88\u8CBB\u3057\u306A\u3044\u3002** \`report()\` \u5B9F\u884C\u524D\u306E\u30D7\u30EA\u30D5\u30E9\u30A4\u30C8\u306B\u4F7F\u3046
112481
+ - \`client.report(type, query?)\` \u2014 Standard Analytics \u306E\u30EC\u30DD\u30FC\u30C8\u3092\u547C\u3073\u51FA\u3057\u3001CSV\u3092 \`{ columns: string[], rows: Record<string, string>[], raw: string }\` \u306B\u30D1\u30FC\u30B9\u3002\u6B8B\u91CF\u30BC\u30ED\u306E\u5834\u5408\u306F \`API UNITS BALANCE IS ZERO\` \u3092\u542B\u3080\u30A8\u30E9\u30FC\u3092 throw
112353
112482
  - \`client.trends(path, query?)\` \u2014 Trends API \u30A8\u30F3\u30C9\u30DD\u30A4\u30F3\u30C8\uFF08\`/analytics/v1/...\`\uFF09\u3092\u547C\u3073\u51FA\u3057 JSON \u3092\u8FD4\u3059
112354
112483
  - \`client.projects(path, init?)\` \u2014 Projects API \u30A8\u30F3\u30C9\u30DD\u30A4\u30F3\u30C8\uFF08\`/management/v1/...\`\uFF09\u3092\u547C\u3073\u51FA\u3057 JSON \u3092\u8FD4\u3059
112355
112484
 
112485
+ \u{1F6A8} **\`report()\` \u3092\u547C\u3076\u30B5\u30FC\u30D0\u30FC\u30ED\u30B8\u30C3\u30AF\u3092\u4F5C\u6210\u3059\u308B\u524D\u306E\u5FC5\u9808\u30D7\u30EA\u30D5\u30E9\u30A4\u30C8\u3002** Standard Analytics\uFF08\`domain_ranks\`\u3001\`domain_organic\`\u3001\`phrase_this\` \u306A\u3069\uFF09\u306E \`client.report(...)\` \u3092\u542B\u3080 TypeScript \u30CF\u30F3\u30C9\u30E9\u3092\u4F5C\u6210\u3059\u308B\u524D\u306B\u3001\u5FC5\u305A \`semrush-api-key_request\` \u30C4\u30FC\u30EB\u3092 \`path: "https://www.semrush.com/users/countapiunits.html"\`\u3001\`queryParams\` \u7121\u3057\u3001\`responseFormat: "text"\` \u3067\u547C\u3073\u51FA\u3057\u3066\u30E6\u30CB\u30C3\u30C8\u6B8B\u91CF\u304C 0 \u3088\u308A\u5927\u304D\u3044\u3053\u3068\u3092\u78BA\u8A8D\u3059\u308B\u3053\u3068\u3002\u6B8B\u91CF\u304C 0 \u306E\u5834\u5408\u306F **\u30B5\u30FC\u30D0\u30FC\u30ED\u30B8\u30C3\u30AF\u3092\u4F5C\u6210\u305B\u305A\u306B\u505C\u6B62\u3057\u3001\u30E6\u30FC\u30B6\u30FC\u306B\u5831\u544A**\u3059\u308B\uFF08Semrush \u306E\u7BA1\u7406\u30B3\u30F3\u30BD\u30FC\u30EB\u304B\u3089 API \u30E6\u30CB\u30C3\u30C8\u3092\u88DC\u5145\u3059\u308B\u5FC5\u8981\u304C\u3042\u308B\uFF09\u3002\`testFetchServerLogic\` \u306F\u30CF\u30F3\u30C9\u30E9\u3092\u5B9F\u884C\u3057\u3066\u30E6\u30CB\u30C3\u30C8\u3092\u6D88\u8CBB\u3059\u308B\u305F\u3081\u3001\u6B8B\u91CF 0 \u306E\u307E\u307E\u4F5C\u6210\u3059\u308B\u3068\u5168\u30B5\u30FC\u30D0\u30FC\u30ED\u30B8\u30C3\u30AF\u304C \`ERROR 132 :: API UNITS BALANCE IS ZERO\` \u3067\u5931\u6557\u3059\u308B\u3002
112486
+
112487
+ \u{1F6A8} **\`display_limit\` \u306F\u5FC5\u305A\u660E\u793A\u7684\u306B\u5C0F\u3055\u3044\u5024\u3092\u6307\u5B9A\u3057\u3001\u30C7\u30D5\u30A9\u30EB\u30C8\u306B\u983C\u3089\u306A\u3044\u3053\u3068\u3002** Semrush \u306F\u4E8B\u524D\u306B\u300C\u5FC5\u8981\u30E6\u30CB\u30C3\u30C8 = display_limit \xD7 \u884C\u3042\u305F\u308A\u5358\u4FA1\u300D\u3092\u8A08\u7B97\u3057\u3001\u305D\u306E**\u898B\u7A4D\u984D**\u304C\u6B8B\u91CF\u3092\u8D85\u3048\u308B\u3068\u30EA\u30AF\u30A8\u30B9\u30C8\u3092 \`ERROR 132 :: API UNITS BALANCE IS ZERO\` \u3067\u62D2\u5426\u3059\u308B\u3002**\u5B9F\u6B8B\u91CF\u304C\u30BC\u30ED\u3067\u306A\u304F\u3066\u3082**\u8D77\u3053\u308B\uFF08\u4F8B\uFF1A\u6B8B\u91CF\u7D04 40,950 \u3067\u3082\u3001\u30B3\u30B9\u30C8\u306E\u9AD8\u3044\u30EC\u30DD\u30FC\u30C8\u3067 \`display_limit=10000\` \u3060\u3068\u5931\u6557\u3059\u308B\uFF09\u3002\u539F\u5247\u3068\u3057\u3066 \`display_limit: "1000"\`\uFF08\u30C0\u30C3\u30B7\u30E5\u30DC\u30FC\u30C9\u7528\u9014\u306A\u3089 \`"100"\` \u3067\u3082\u5341\u5206\uFF09\u3092\u6307\u5B9A\u3057\u3001\u30E6\u30FC\u30B6\u30FC\u304C\u660E\u793A\u7684\u306B\u5927\u304D\u306A\u30B5\u30F3\u30D7\u30EB\u3092\u8981\u6C42\u3057\u3001\u304B\u3064 \`checkUnits()\` \u3067\u6B8B\u91CF\u306B\u5341\u5206\u306A\u4F59\u88D5\u304C\u3042\u308B\u3053\u3068\u3092\u78BA\u8A8D\u3067\u304D\u305F\u5834\u5408\u306E\u307F\u5897\u3084\u3059\u3002\u5168\u884C\u304C\u5FC5\u8981\u306A\u5834\u5408\u306F \`display_limit\` \u3092\u4E0A\u3052\u308B\u306E\u3067\u306F\u306A\u304F\u3001\`display_offset\` \u3067 1000 \u4EF6\u523B\u307F\u306E\u30DA\u30FC\u30B8\u30CD\u30FC\u30B7\u30E7\u30F3\u3092\u5B9F\u88C5\u3059\u308B\u3053\u3068\u3002\`ERROR 132\` \u306F\u300C\u6B8B\u91CF\u304C\u6587\u5B57\u901A\u308A\u30BC\u30ED\u300D\u3088\u308A\u5148\u306B\u300C\u73FE\u5728\u306E\u6B8B\u91CF\u306B\u5BFE\u3057\u3066\u30EA\u30AF\u30A8\u30B9\u30C8\u304C\u5927\u304D\u3059\u304E\u308B\u300D\u3092\u7591\u3044\u3001\u30E6\u30CB\u30C3\u30C8\u3092\u518D\u78BA\u8A8D\u3057\u3066\u304B\u3089\u5224\u65AD\u3059\u308B\u3053\u3068\u3002
112488
+
112489
+ \u{1F6AB} **Trends API\uFF08\`client.trends\`\uFF09\u3068 Projects API\uFF08\`client.projects\`\uFF09\u306F\u3001\u30E6\u30FC\u30B6\u30FC\u304B\u3089\u660E\u793A\u7684\u306B\u6307\u793A\u3055\u308C\u306A\u3044\u9650\u308A\u4F7F\u7528\u3057\u306A\u3044\u3053\u3068\u3002** \u3053\u308C\u3089\u306E API \u306F\u5225\u9014\u6709\u6599\u30B5\u30D6\u30B9\u30AF\u30EA\u30D7\u30B7\u30E7\u30F3\uFF08Trends / Projects\uFF08Management\uFF09\uFF09\u304C\u5FC5\u8981\u3067\u3001\u3059\u3079\u3066\u306E Semrush \u30A2\u30AB\u30A6\u30F3\u30C8\u304C\u5951\u7D04\u3057\u3066\u3044\u308B\u308F\u3051\u3067\u306F\u306A\u3044\u3002\u30B5\u30D6\u30B9\u30AF\u30EA\u30D7\u30B7\u30E7\u30F3\u304C\u306A\u3044\u72B6\u614B\u3067\u547C\u3073\u51FA\u3059\u3068\u8A8D\u53EF\u30A8\u30E9\u30FC\u3067\u5931\u6557\u3059\u308B\u3002SEO\u30FB\u30AD\u30FC\u30EF\u30FC\u30C9\u30FB\u88AB\u30EA\u30F3\u30AF\u30FB\u7AF6\u5408\u5206\u6790\u306F\u539F\u5247 Standard Analytics API\uFF08\`client.report\`\uFF09\u3067\u884C\u3046\u3002\`trends()\` / \`projects()\` \u3092\u4F7F\u3046\u306E\u306F\u3001\u30E6\u30FC\u30B6\u30FC\u304C Trends \u30C7\u30FC\u30BF\uFF08\u30C8\u30E9\u30D5\u30A3\u30C3\u30AF\u30A2\u30CA\u30EA\u30C6\u30A3\u30AF\u30B9\u3001\u30DE\u30FC\u30B1\u30C3\u30C8\u30A8\u30AF\u30B9\u30D7\u30ED\u30FC\u30E9\u30FC\u7B49\uFF09\u307E\u305F\u306F Projects \u6A5F\u80FD\uFF08\u30B5\u30A4\u30C8\u76E3\u67FB\u3001\u30DD\u30B8\u30B7\u30E7\u30F3\u30C8\u30E9\u30C3\u30AD\u30F3\u30B0\u7B49\uFF09\u3092**\u660E\u793A\u7684\u306B\u6C42\u3081\u305F\u5834\u5408\u306E\u307F**\u3067\u3001\u305D\u306E\u969B\u3082\u30B5\u30D6\u30B9\u30AF\u30EA\u30D7\u30B7\u30E7\u30F3\u306E\u6709\u7121\u3092\u30E6\u30FC\u30B6\u30FC\u306B\u78BA\u8A8D\u3057\u3066\u304B\u3089\u30B5\u30FC\u30D0\u30FC\u30ED\u30B8\u30C3\u30AF\u3092\u4F5C\u6210\u3059\u308B\u3053\u3068\u3002
112490
+
112491
+ \u26A0\uFE0F **\u91CD\u8981: \`report()\` \u306E\u884C\uFF08row\uFF09\u306E\u5F62\u72B6\u306B\u3064\u3044\u3066\u3002** \`rows\` \u306F \`Record<string, string>[]\` \u3067\u3059 \u2014 \u5404\u884C\u306F CSV \u306E\u30AB\u30E9\u30E0\u300C\u540D\u300D\uFF08\`columns\` \u3068\u4E00\u81F4\uFF09\u3092\u30AD\u30FC\u3068\u3057\u305F\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u3067\u3042\u308A\u3001\u4F4D\u7F6E\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u306E\u914D\u5217\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002\u30D5\u30A3\u30FC\u30EB\u30C9\u3078\u306E\u30A2\u30AF\u30BB\u30B9\u306F\u5FC5\u305A \`row["Url"]\`\u3001\`row["Keyword"]\`\u3001\`row["Search Volume"]\`\uFF08\u30AB\u30E9\u30E0\u540D\u306B\u30B9\u30DA\u30FC\u30B9\u3092\u542B\u3080\u3053\u3068\u3042\u308A\uFF09\u306E\u3088\u3046\u306B\u30AB\u30E9\u30E0\u540D\u3067\u884C\u3063\u3066\u304F\u3060\u3055\u3044\u3002\`columns.indexOf("Url")\` \u3067\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u3092\u53D6\u5F97\u3057\u3066\u304B\u3089 \`row[index]\` \u3067\u30A2\u30AF\u30BB\u30B9\u3057\u3066\u306F\u3044\u3051\u307E\u305B\u3093 \u2014 \u305D\u308C\u306F \`undefined\` \u3092\u8FD4\u3057\u3001\`?? ""\` \u3084 \`Number(...) || 0\` \u3068\u7D44\u307F\u5408\u308F\u3055\u308B\u3053\u3068\u3067\u7D50\u679C\u304C\u7A7A\u306B\u306A\u308B\u7121\u97F3\u306E\u5931\u6557\u3092\u751F\u307F\u307E\u3059\u3002\u5168\u3066\u306E\u5024\u306F\u6587\u5B57\u5217\u306A\u306E\u3067\u3001\u6570\u5024\u30AB\u30E9\u30E0\u306F \`Number(row["Position"])\` \u3067\u660E\u793A\u5909\u63DB\u3057\u3066\u304F\u3060\u3055\u3044\u3002
112492
+
112356
112493
  \`\`\`ts
112357
112494
  import type { Context } from "hono";
112358
112495
  import { connection } from "@squadbase/vite-server/connectors/semrush";
@@ -112365,9 +112502,25 @@ export default async function handler(c: Context) {
112365
112502
  database?: string;
112366
112503
  }>();
112367
112504
 
112368
- const overview = await semrush.report("domain_overview", { domain, database });
112505
+ const result = await semrush.report("domain_organic", {
112506
+ domain,
112507
+ database,
112508
+ display_limit: "100",
112509
+ });
112369
112510
 
112370
- return c.json({ columns: overview.columns, rows: overview.rows });
112511
+ // \u2705 \u6B63: \u30AB\u30E9\u30E0\u540D\u3067\u30A2\u30AF\u30BB\u30B9\u3059\u308B
112512
+ const rows = result.rows.map((row) => ({
112513
+ keyword: row["Keyword"],
112514
+ position: Number(row["Position"]) || 0,
112515
+ searchVolume: Number(row["Search Volume"]) || 0,
112516
+ url: row["Url"] ?? "",
112517
+ }));
112518
+
112519
+ // \u274C \u8AA4: \u884C\u306F\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u3067\u3042\u308A\u914D\u5217\u3067\u306F\u306A\u3044\u305F\u3081 row[index] \u306F undefined \u306B\u306A\u308B
112520
+ // const urlIdx = result.columns.indexOf("Url");
112521
+ // const url = (row as unknown as string[])[urlIdx];
112522
+
112523
+ return c.json({ columns: result.columns, rows });
112371
112524
  }
112372
112525
  \`\`\`
112373
112526
 
@@ -112379,8 +112532,8 @@ export default async function handler(c: Context) {
112379
112532
 
112380
112533
  \u8A8D\u8A3C: API\u30AD\u30FC\u3092\u3059\u3079\u3066\u306E\u30EA\u30AF\u30A8\u30B9\u30C8\u306B \`key\` \u30AF\u30A8\u30EA\u30D1\u30E9\u30E1\u30FC\u30BF\u3068\u3057\u3066\u4ED8\u4E0E\uFF08\u81EA\u52D5\uFF09\u3002
112381
112534
 
112382
- #### \u4E3B\u8981\u306A Standard Analytics \u30EC\u30DD\u30FC\u30C8\u30BF\u30A4\u30D7
112383
- - \`domain_overview\` \u2014 \u30C9\u30E1\u30A4\u30F3\u306E\u30B5\u30DE\u30EA\u30FC\uFF08\u30AA\u30FC\u30AC\u30CB\u30C3\u30AF/\u6709\u6599\u30C8\u30E9\u30D5\u30A3\u30C3\u30AF\u3001\u30AD\u30FC\u30EF\u30FC\u30C9\u3001\u30D0\u30C3\u30AF\u30EA\u30F3\u30AF\uFF09
112535
+ #### \u4E3B\u8981\u306A Standard Analytics \u30EC\u30DD\u30FC\u30C8\u30BF\u30A4\u30D7\uFF08path \`/\`\u3001CSV\u3092\u8FD4\u3059\uFF09
112536
+ - \`domain_ranks\` \u2014 \u30C9\u30E1\u30A4\u30F3\u306E\u30B5\u30DE\u30EA\u30FC\uFF08rank\u3001\u30AA\u30FC\u30AC\u30CB\u30C3\u30AF/\u6709\u6599\u30AD\u30FC\u30EF\u30FC\u30C9\u6570\u3001\u30C8\u30E9\u30D5\u30A3\u30C3\u30AF\u3001\u30B3\u30B9\u30C8\u306E1\u884CCSV\uFF09\u3002**\`domain_overview\` \u3068\u3044\u3046\u30BF\u30A4\u30D7\u306F\u5B58\u5728\u3057\u306A\u3044\u3002\`domain_ranks\` \u3092\u4F7F\u3046\u3053\u3068\u3002**
112384
112537
  - \`domain_organic\` \u2014 \u30C9\u30E1\u30A4\u30F3\u306E\u30AA\u30FC\u30AC\u30CB\u30C3\u30AF\u30AD\u30FC\u30EF\u30FC\u30C9
112385
112538
  - \`domain_adwords\` \u2014 \u30C9\u30E1\u30A4\u30F3\u306E\u6709\u6599\u30AD\u30FC\u30EF\u30FC\u30C9
112386
112539
  - \`domain_organic_organic\` / \`domain_adwords_adwords\` \u2014 \u30AA\u30FC\u30AC\u30CB\u30C3\u30AF\uFF0F\u6709\u6599\u306E\u7AF6\u5408
@@ -112389,10 +112542,13 @@ export default async function handler(c: Context) {
112389
112542
  - \`phrase_fullsearch\` \u2014 \u30D5\u30EB\u30C6\u30AD\u30B9\u30C8\u30AD\u30FC\u30EF\u30FC\u30C9\u30EA\u30B5\u30FC\u30C1
112390
112543
  - \`phrase_questions\` \u2014 \u8CEA\u554F\u5F62\u5F0F\u30AD\u30FC\u30EF\u30FC\u30C9
112391
112544
  - \`phrase_kdi\` \u2014 \u30AD\u30FC\u30EF\u30FC\u30C9\u96E3\u6613\u5EA6\uFF08KDI\uFF09
112545
+ - \`url_organic\` / \`url_adwords\` \u2014 \u7279\u5B9AURL\u3067\u30E9\u30F3\u30AF\u30A4\u30F3\u3057\u3066\u3044\u308B\u30AD\u30FC\u30EF\u30FC\u30C9
112546
+
112547
+ #### Backlinks API \u30EC\u30DD\u30FC\u30C8\u30BF\u30A4\u30D7\uFF08path \`/analytics/v1/\`\u3001\u3053\u3061\u3089\u3082 **CSV** \u3092\u8FD4\u3059\u3002JSON \u3067\u306F\u306A\u3044\uFF09
112548
+ Backlinks \u7CFB\u30A8\u30F3\u30C9\u30DD\u30A4\u30F3\u30C8\u306F \`/analytics/v1/?type=backlinks_*\` \u914D\u4E0B\u306B\u3042\u308A\u3001\`domain\`/\`database\` \u3067\u306F\u306A\u304F \`target\` + \`target_type\`\uFF08\`root_domain\` | \`domain\` | \`url\`\uFF09\u3092\u8981\u6C42\u3059\u308B\u3002\u30EC\u30B9\u30DD\u30F3\u30B9\u306F\u30BB\u30DF\u30B3\u30ED\u30F3\u533A\u5207\u308ACSV\u306A\u306E\u3067\u3001request \u30C4\u30FC\u30EB\u3067\u306F \`responseFormat="text"\` \u3092\u4F7F\u3044\u3001SDK \u3067\u306F \`client.request("/analytics/v1/", { query: { type: "backlinks_overview", target, target_type: "root_domain" } })\` \u3092\u547C\u3093\u3067 CSV \u3092\u81EA\u524D\u3067\u30D1\u30FC\u30B9\u3059\u308B\u3053\u3068\u3002\`client.trends()\` \u306F JSON.parse \u3059\u308B\u305F\u3081 backlinks \u7CFB\u3067\u4F7F\u3046\u3068 throw \u3059\u308B\u3002
112392
112549
  - \`backlinks_overview\` \u2014 \u30D0\u30C3\u30AF\u30EA\u30F3\u30AF\u6982\u8981
112393
112550
  - \`backlinks\` \u2014 \u30D0\u30C3\u30AF\u30EA\u30F3\u30AF\u4E00\u89A7
112394
112551
  - \`backlinks_refdomains\` \u2014 \u53C2\u7167\u30C9\u30E1\u30A4\u30F3
112395
- - \`url_organic\` / \`url_adwords\` \u2014 \u7279\u5B9AURL\u3067\u30E9\u30F3\u30AF\u30A4\u30F3\u3057\u3066\u3044\u308B\u30AD\u30FC\u30EF\u30FC\u30C9
112396
112552
 
112397
112553
  API \u30E6\u30CB\u30C3\u30C8\u6B8B\u91CF\u306E\u78BA\u8A8D\uFF08\u7121\u6599\u3001\u30E6\u30CB\u30C3\u30C8\u3092\u6D88\u8CBB\u3057\u306A\u3044\uFF09\u306F request \u30C4\u30FC\u30EB\u306B\u7D76\u5BFEURL\u3092\u6E21\u3059: \`path: "https://www.semrush.com/users/countapiunits.html"\`\u3001queryParams \u306A\u3057\u3001\`responseFormat: "text"\`\u3002\u30EC\u30B9\u30DD\u30F3\u30B9\u672C\u6587\u306F\u6570\u5024\u306E\u307F\u3002
112398
112554
 
@@ -112400,7 +112556,7 @@ API \u30E6\u30CB\u30C3\u30C8\u6B8B\u91CF\u306E\u78BA\u8A8D\uFF08\u7121\u6599\u30
112400
112556
  - \`type\` \u2014 \u30EC\u30DD\u30FC\u30C8\u7A2E\u5225\uFF08Standard API \u3067\u306F\u5FC5\u9808\uFF09
112401
112557
  - \`domain\` / \`phrase\` / \`url\` \u2014 \u30AF\u30A8\u30EA\u5BFE\u8C61\u306E\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3
112402
112558
  - \`database\` \u2014 \u5730\u57DF\u5225\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\uFF08\`us\`, \`uk\`, \`de\`, \`fr\`, \`jp\`, \`br\` \u306A\u3069\uFF09\u3002\u591A\u304F\u306E\u30EC\u30DD\u30FC\u30C8\u3067\u5FC5\u9808
112403
- - \`display_limit\` \u2014 \u30DA\u30FC\u30B8\u30B5\u30A4\u30BA\uFF08\u30C7\u30D5\u30A9\u30EB\u30C810000\u3001\u30EC\u30DD\u30FC\u30C8\u306B\u3088\u3063\u3066\u306F\u6700\u5927100000\uFF09
112559
+ - \`display_limit\` \u2014 \u30DA\u30FC\u30B8\u30B5\u30A4\u30BA\uFF08\u30C7\u30D5\u30A9\u30EB\u30C810000\u3001\u30EC\u30DD\u30FC\u30C8\u306B\u3088\u3063\u3066\u306F\u6700\u5927100000\uFF09\u3002**\u30C7\u30D5\u30A9\u30EB\u30C8\u3092\u4F7F\u308F\u305A\u3001\u5FC5\u305A \`"1000"\` \u7A0B\u5EA6\u306E\u5C0F\u3055\u3044\u5024\u3092\u660E\u793A\u7684\u306B\u6307\u5B9A\u3059\u308B\u3053\u3068\u3002** \u5927\u304D\u3044\u5024\u3060\u3068 Semrush \u304C\u5FC5\u8981\u30E6\u30CB\u30C3\u30C8\u3092\u4E8B\u524D\u8A08\u7B97\u3057\u3001\u6B8B\u91CF\u304C\u3042\u3063\u3066\u3082 \`ERROR 132\` \u3067\u62D2\u5426\u3059\u308B\u3002
112404
112560
  - \`display_offset\` \u2014 \u30DA\u30FC\u30B8\u30CD\u30FC\u30B7\u30E7\u30F3\u30AA\u30D5\u30BB\u30C3\u30C8
112405
112561
  - \`display_date\` \u2014 \u5C65\u6B74\u306E\u65E5\u4ED8\u3002\`YYYYMM15\` \u5F62\u5F0F\uFF08\u5FC5\u305A\u6708\u306E15\u65E5\uFF09
112406
112562
  - \`export_columns\` \u2014 \u8FD4\u5374\u30AB\u30E9\u30E0\u3092\u30AB\u30F3\u30DE\u533A\u5207\u308A\u3067\u6307\u5B9A\uFF08\u4F8B: \`Ph,Po,Nq,Cp\`\uFF09
@@ -112411,6 +112567,7 @@ API \u30E6\u30CB\u30C3\u30C8\u6B8B\u91CF\u306E\u78BA\u8A8D\uFF08\u7121\u6599\u30
112411
112567
  - Standard Analytics \u306E\u5404\u30EC\u30DD\u30FC\u30C8\u306F API \u30E6\u30CB\u30C3\u30C8\u3092\u6D88\u8CBB\u3059\u308B\u3002\u30AF\u30A9\u30FC\u30BF\u304C\u7591\u308F\u3057\u3044\u5834\u5408\u306F \`https://www.semrush.com/users/countapiunits.html?key=...\` \u3067\u6B8B\u91CF\u3092\u5148\u306B\u78BA\u8A8D\u3059\u308B\uFF08\u7121\u6599\uFF09
112412
112568
  - CSV \u306E\u30BB\u30D1\u30EC\u30FC\u30BF\u306F \`;\`\uFF08\u30BB\u30DF\u30B3\u30ED\u30F3\uFF09\u3067\u3042\u308A \`,\` \u3067\u306F\u306A\u3044\u3002\u30BB\u30EB\u5185\u306B\u30AB\u30F3\u30DE\u304C\u542B\u307E\u308C\u308B\u3053\u3068\u304C\u3042\u308B
112413
112569
  - HTTP 200 \u3067\u3082\u672C\u6587\u304C \`ERROR\` \u3067\u59CB\u307E\u308B\u5834\u5408\u306F API\u30A8\u30E9\u30FC\uFF08\u8A8D\u8A3C\u3001\u30D1\u30E9\u30E1\u30FC\u30BF\u3001\u30AF\u30A9\u30FC\u30BF\uFF09
112570
+ - \`ERROR 132 :: API UNITS BALANCE IS ZERO\` \u306F\u300C\u6B8B\u91CF\u304C\u6587\u5B57\u901A\u308A 0\u300D\u3060\u3051\u3092\u610F\u5473\u3059\u308B\u308F\u3051\u3067\u306F\u306A\u3044\u3002Semrush \u306F \`display_limit \xD7 \u884C\u3042\u305F\u308A\u5358\u4FA1\` \u304C\u6B8B\u91CF\u3092\u8D85\u3048\u308B\u5834\u5408\u3082\u540C\u3058\u30A8\u30E9\u30FC\u3092\u8FD4\u3059\u3002\`countapiunits.html\` \u3067\u6B8B\u91CF\u3092\u518D\u78BA\u8A8D\u3057\u3001\`display_limit\` \u3092 \`1000\` \u3084 \`100\` \u307E\u3067\u4E0B\u3052\u3066\u304B\u3089\u300C\u6B8B\u91CF\u5207\u308C\u300D\u3068\u5224\u65AD\u3059\u308B\u3053\u3068\u3002
112414
112571
  - Trends API \u306F\u5225\u9014 Trends \u30B5\u30D6\u30B9\u30AF\u30EA\u30D7\u30B7\u30E7\u30F3\u304C\u5FC5\u8981\u3002\u672A\u5951\u7D04\u3060\u3068\u8A8D\u53EF\u30A8\u30E9\u30FC\u306B\u306A\u308B
112415
112572
  - \u5C65\u6B74\u30A8\u30F3\u30C9\u30DD\u30A4\u30F3\u30C8\u306E\u65E5\u4ED8\u306F\u5FC5\u305A\u6708\u306E15\u65E5\uFF08\`YYYYMM15\`\uFF09`
112416
112573
  },
@@ -112449,7 +112606,7 @@ API \u30E6\u30CB\u30C3\u30C8\u6B8B\u91CF\u306E\u78BA\u8A8D\uFF08\u7121\u6599\u30
112449
112606
 
112450
112607
  // ../connectors/src/connectors/google-search-console-oauth/tools/list-sites.ts
112451
112608
  import { z as z84 } from "zod";
112452
- var BASE_URL40 = "https://searchconsole.googleapis.com/webmasters/v3";
112609
+ var BASE_URL38 = "https://searchconsole.googleapis.com/webmasters/v3";
112453
112610
  var REQUEST_TIMEOUT_MS67 = 6e4;
112454
112611
  var cachedToken30 = null;
112455
112612
  async function getProxyToken30(config) {
@@ -112520,7 +112677,7 @@ var listSitesTool = new ConnectorTool({
112520
112677
  `[connector-request] google-search-console-oauth/${connection2.name}: listSites`
112521
112678
  );
112522
112679
  try {
112523
- const url = `${BASE_URL40}/sites`;
112680
+ const url = `${BASE_URL38}/sites`;
112524
112681
  const token = await getProxyToken30(config.oauthProxy);
112525
112682
  const proxyUrl = `https://${config.oauthProxy.sandboxId}.${config.oauthProxy.previewBaseDomain}/_sqcore/connections/${connectionId}/request`;
112526
112683
  const controller = new AbortController();
@@ -112619,7 +112776,7 @@ var parameters69 = {
112619
112776
  import { z as z85 } from "zod";
112620
112777
  var BASE_HOST10 = "https://searchconsole.googleapis.com";
112621
112778
  var BASE_PATH_SEGMENT10 = "/webmasters/v3";
112622
- var BASE_URL41 = `${BASE_HOST10}${BASE_PATH_SEGMENT10}`;
112779
+ var BASE_URL39 = `${BASE_HOST10}${BASE_PATH_SEGMENT10}`;
112623
112780
  var REQUEST_TIMEOUT_MS68 = 6e4;
112624
112781
  var cachedToken31 = null;
112625
112782
  async function getProxyToken31(config) {
@@ -112704,7 +112861,7 @@ For URL Inspection API requests, use the absolute path '/v1/urlInspection/index:
112704
112861
  resolvedPath,
112705
112862
  BASE_PATH_SEGMENT10
112706
112863
  );
112707
- let url = `${BASE_URL41}${normalizedPath}`;
112864
+ let url = `${BASE_URL39}${normalizedPath}`;
112708
112865
  if (queryParams) {
112709
112866
  const searchParams = new URLSearchParams(queryParams);
112710
112867
  url += `?${searchParams.toString()}`;
@@ -113194,7 +113351,7 @@ var parameters71 = {
113194
113351
  import { z as z87 } from "zod";
113195
113352
  var BASE_HOST11 = "https://api.clickup.com";
113196
113353
  var BASE_PATH_SEGMENT11 = "/api/v2";
113197
- var BASE_URL42 = `${BASE_HOST11}${BASE_PATH_SEGMENT11}`;
113354
+ var BASE_URL40 = `${BASE_HOST11}${BASE_PATH_SEGMENT11}`;
113198
113355
  var REQUEST_TIMEOUT_MS69 = 6e4;
113199
113356
  var inputSchema87 = z87.object({
113200
113357
  toolUseIntent: z87.string().optional().describe(
@@ -113267,7 +113424,7 @@ Pagination: ClickUp uses zero-indexed \`page\` query parameter on list endpoints
113267
113424
  try {
113268
113425
  const token = parameters71.apiToken.getValue(connection2);
113269
113426
  const normalizedPath = normalizeRequestPath(path5, BASE_PATH_SEGMENT11);
113270
- const url = `${BASE_URL42}${normalizedPath}`;
113427
+ const url = `${BASE_URL40}${normalizedPath}`;
113271
113428
  const controller = new AbortController();
113272
113429
  const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS69);
113273
113430
  try {
@@ -113530,7 +113687,8 @@ var parameters72 = {
113530
113687
  type: "text",
113531
113688
  secret: true,
113532
113689
  required: false
113533
- })
113690
+ }),
113691
+ ...sshTunnelParameters
113534
113692
  };
113535
113693
 
113536
113694
  // ../connectors/src/connectors/sqlserver/tools/execute-query.ts
@@ -113589,7 +113747,9 @@ Avoid loading large amounts of data; always include \`TOP\` in queries.`,
113589
113747
  };
113590
113748
  }
113591
113749
  try {
113592
- const { rows } = await runMssqlQuery(parsed, sql);
113750
+ const { rows } = await runMssqlQuery(parsed, sql, {
113751
+ tunnelParams: connectionParamsToRecord(connection2)
113752
+ });
113593
113753
  const truncated = rows.length > MAX_ROWS14;
113594
113754
  return {
113595
113755
  success: true,
@@ -113660,7 +113820,8 @@ The business logic type for this connector is "sql".
113660
113820
  {
113661
113821
  username: params[parameters72.username.slug],
113662
113822
  password: params[parameters72.password.slug]
113663
- }
113823
+ },
113824
+ { tunnelParams: params }
113664
113825
  );
113665
113826
  },
113666
113827
  async query(params, sql, _namedParams) {
@@ -113670,10 +113831,12 @@ The business logic type for this connector is "sql".
113670
113831
  });
113671
113832
  const sample = unwrapSampleLimit(sql);
113672
113833
  if (sample) {
113673
- const result = await runMssqlQuery(parsed, sample.inner);
113834
+ const result = await runMssqlQuery(parsed, sample.inner, {
113835
+ tunnelParams: params
113836
+ });
113674
113837
  return { rows: result.rows.slice(0, sample.limit) };
113675
113838
  }
113676
- return runMssqlQuery(parsed, sql);
113839
+ return runMssqlQuery(parsed, sql, { tunnelParams: params });
113677
113840
  }
113678
113841
  });
113679
113842
 
@@ -113719,7 +113882,8 @@ var parameters73 = {
113719
113882
  type: "text",
113720
113883
  secret: true,
113721
113884
  required: false
113722
- })
113885
+ }),
113886
+ ...sshTunnelParameters
113723
113887
  };
113724
113888
 
113725
113889
  // ../connectors/src/connectors/azure-sql/tools/execute-query.ts
@@ -113778,7 +113942,10 @@ Avoid loading large amounts of data; always include \`TOP\` in queries.`,
113778
113942
  };
113779
113943
  }
113780
113944
  try {
113781
- const { rows } = await runMssqlQuery(parsed, sql, { forceEncrypt: true });
113945
+ const { rows } = await runMssqlQuery(parsed, sql, {
113946
+ forceEncrypt: true,
113947
+ tunnelParams: connectionParamsToRecord(connection2)
113948
+ });
113782
113949
  const truncated = rows.length > MAX_ROWS15;
113783
113950
  return {
113784
113951
  success: true,
@@ -113803,7 +113970,7 @@ var azureSqlConnector = new ConnectorPlugin({
113803
113970
  description: "Connect to Azure SQL Database (managed) using a JDBC-style URL. Encryption is enforced automatically.",
113804
113971
  iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/5TL0yBbxoLlk6jFZuiHl8w/55040f52d57bf0b77a2215c985c5a772/azure-sql-icon.png",
113805
113972
  parameters: parameters73,
113806
- releaseFlag: { dev1: true, dev2: false, prod: false },
113973
+ releaseFlag: { dev1: true, dev2: true, prod: true },
113807
113974
  categories: ["database"],
113808
113975
  onboarding: azureSqlOnboarding,
113809
113976
  systemPrompt: {
@@ -113850,7 +114017,7 @@ The business logic type for this connector is "sql".
113850
114017
  username: params[parameters73.username.slug],
113851
114018
  password: params[parameters73.password.slug]
113852
114019
  },
113853
- { forceEncrypt: true }
114020
+ { forceEncrypt: true, tunnelParams: params }
113854
114021
  );
113855
114022
  },
113856
114023
  async query(params, sql, _namedParams) {
@@ -113861,11 +114028,353 @@ The business logic type for this connector is "sql".
113861
114028
  const sample = unwrapSampleLimit(sql);
113862
114029
  if (sample) {
113863
114030
  const result = await runMssqlQuery(parsed, sample.inner, {
113864
- forceEncrypt: true
114031
+ forceEncrypt: true,
114032
+ tunnelParams: params
113865
114033
  });
113866
114034
  return { rows: result.rows.slice(0, sample.limit) };
113867
114035
  }
113868
- return runMssqlQuery(parsed, sql, { forceEncrypt: true });
114036
+ return runMssqlQuery(parsed, sql, {
114037
+ forceEncrypt: true,
114038
+ tunnelParams: params
114039
+ });
114040
+ }
114041
+ });
114042
+
114043
+ // ../connectors/src/connectors/cosmosdb/setup.ts
114044
+ var cosmosdbOnboarding = new ConnectorOnboarding({
114045
+ dataOverviewInstructions: {
114046
+ en: `1. Use cosmosdb_listContainers to list all containers in the configured database
114047
+ 2. For key containers, sample documents with cosmosdb_query: container="users", sql="SELECT TOP 5 * FROM c"
114048
+ 3. Examine the document structure to understand the schema (Cosmos DB containers are schema-flexible \u2014 items in the same container may have different fields)
114049
+ 4. Use cosmosdb_query with GROUP BY to analyse data distribution if needed: \`SELECT c.status, COUNT(1) AS n FROM c GROUP BY c.status\``,
114050
+ ja: `1. cosmosdb_listContainers \u3067\u5BFE\u8C61\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u5185\u306E\u30B3\u30F3\u30C6\u30CA\u4E00\u89A7\u3092\u53D6\u5F97
114051
+ 2. \u4E3B\u8981\u30B3\u30F3\u30C6\u30CA\u306B\u3064\u3044\u3066 cosmosdb_query \u3067\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3092\u30B5\u30F3\u30D7\u30EA\u30F3\u30B0: container="users", sql="SELECT TOP 5 * FROM c"
114052
+ 3. \u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u69CB\u9020\u3092\u78BA\u8A8D\u3057\u3066\u30B9\u30AD\u30FC\u30DE\u3092\u628A\u63E1\uFF08Cosmos DB \u306E\u30B3\u30F3\u30C6\u30CA\u306F\u30B9\u30AD\u30FC\u30DE\u304C\u67D4\u8EDF\u306A\u305F\u3081\u3001\u540C\u3058\u30B3\u30F3\u30C6\u30CA\u5185\u3067\u3082\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u306E\u30D5\u30A3\u30FC\u30EB\u30C9\u304C\u7570\u306A\u308B\u5834\u5408\u304C\u3042\u308A\u307E\u3059\uFF09
114053
+ 4. \u5FC5\u8981\u306B\u5FDC\u3058\u3066 cosmosdb_query \u306E GROUP BY \u3067\u30C7\u30FC\u30BF\u5206\u5E03\u3092\u78BA\u8A8D: \`SELECT c.status, COUNT(1) AS n FROM c GROUP BY c.status\``
114054
+ }
114055
+ });
114056
+
114057
+ // ../connectors/src/connectors/cosmosdb/parameters.ts
114058
+ var parameters74 = {
114059
+ endpoint: new ParameterDefinition({
114060
+ slug: "endpoint",
114061
+ name: "Cosmos DB Endpoint",
114062
+ description: "Cosmos DB account endpoint URL (e.g. `https://<account>.documents.azure.com:443/`). Found in the Azure Portal under the account's *Keys* blade.",
114063
+ envVarBaseKey: "COSMOSDB_ENDPOINT",
114064
+ type: "text",
114065
+ secret: false,
114066
+ required: true
114067
+ }),
114068
+ key: new ParameterDefinition({
114069
+ slug: "key",
114070
+ name: "Account Key",
114071
+ description: "Cosmos DB account key (primary or secondary master key). Use a read-only key when only querying data.",
114072
+ envVarBaseKey: "COSMOSDB_KEY",
114073
+ type: "text",
114074
+ secret: true,
114075
+ required: true
114076
+ }),
114077
+ database: new ParameterDefinition({
114078
+ slug: "database",
114079
+ name: "Database",
114080
+ description: "The Cosmos DB database (a.k.a. database account namespace) to connect to.",
114081
+ envVarBaseKey: "COSMOSDB_DATABASE",
114082
+ type: "text",
114083
+ secret: false,
114084
+ required: true
114085
+ })
114086
+ };
114087
+
114088
+ // ../connectors/src/connectors/cosmosdb/tools/list-containers.ts
114089
+ import { z as z90 } from "zod";
114090
+ var inputSchema90 = z90.object({
114091
+ toolUseIntent: z90.string().optional().describe(
114092
+ "Brief description of what you intend to accomplish with this tool call"
114093
+ ),
114094
+ connectionId: z90.string().describe("ID of the Cosmos DB connection to use")
114095
+ });
114096
+ var outputSchema90 = z90.discriminatedUnion("success", [
114097
+ z90.object({
114098
+ success: z90.literal(true),
114099
+ containers: z90.array(
114100
+ z90.object({
114101
+ id: z90.string(),
114102
+ partitionKey: z90.array(z90.string()).optional()
114103
+ })
114104
+ )
114105
+ }),
114106
+ z90.object({
114107
+ success: z90.literal(false),
114108
+ error: z90.string()
114109
+ })
114110
+ ]);
114111
+ var listContainersTool = new ConnectorTool({
114112
+ name: "listContainers",
114113
+ description: `List all containers in the configured Cosmos DB database.
114114
+ Use this as the first step to explore the data structure. Returns container ids and their partition key paths.
114115
+ After listing containers, use the query tool to sample items and understand each container's schema.`,
114116
+ inputSchema: inputSchema90,
114117
+ outputSchema: outputSchema90,
114118
+ async execute({ connectionId }, connections) {
114119
+ const connection2 = connections.find((c6) => c6.id === connectionId);
114120
+ if (!connection2) {
114121
+ return {
114122
+ success: false,
114123
+ error: `Connection ${connectionId} not found`
114124
+ };
114125
+ }
114126
+ console.log(
114127
+ `[connector-query] cosmosdb/${connection2.name}: listContainers`
114128
+ );
114129
+ let key;
114130
+ try {
114131
+ const { CosmosClient } = await import("@azure/cosmos");
114132
+ const endpoint = parameters74.endpoint.getValue(connection2);
114133
+ key = parameters74.key.getValue(connection2);
114134
+ const database = parameters74.database.getValue(connection2);
114135
+ const client = new CosmosClient({ endpoint, key });
114136
+ const db = client.database(database);
114137
+ const { resources } = await db.containers.readAll().fetchAll();
114138
+ return {
114139
+ success: true,
114140
+ containers: resources.map((c6) => ({
114141
+ id: c6.id,
114142
+ partitionKey: extractPartitionKeyPaths(c6.partitionKey)
114143
+ }))
114144
+ };
114145
+ } catch (err) {
114146
+ let msg = err instanceof Error ? err.message : String(err);
114147
+ if (key) msg = msg.replaceAll(key, "***");
114148
+ return { success: false, error: msg };
114149
+ }
114150
+ }
114151
+ });
114152
+ function extractPartitionKeyPaths(partitionKey) {
114153
+ if (!partitionKey || typeof partitionKey !== "object") return void 0;
114154
+ const paths = partitionKey.paths;
114155
+ if (!Array.isArray(paths)) return void 0;
114156
+ return paths.filter((p2) => typeof p2 === "string");
114157
+ }
114158
+
114159
+ // ../connectors/src/connectors/cosmosdb/tools/query.ts
114160
+ import { z as z91 } from "zod";
114161
+ var MAX_DOCUMENTS3 = 500;
114162
+ var inputSchema91 = z91.object({
114163
+ toolUseIntent: z91.string().optional().describe(
114164
+ "Brief description of what you intend to accomplish with this tool call"
114165
+ ),
114166
+ connectionId: z91.string().describe("ID of the Cosmos DB connection to use"),
114167
+ container: z91.string().describe("Id of the container (a.k.a. collection) to query"),
114168
+ sql: z91.string().describe(
114169
+ "Cosmos DB SQL query (Core / NoSQL API). Reference items via the alias `c` (e.g. `SELECT TOP 100 c.id, c.name FROM c WHERE c.status = 'active'`). Use `TOP n` rather than `LIMIT n` \u2014 Cosmos DB does not understand `LIMIT`."
114170
+ ),
114171
+ partitionKey: z91.string().optional().describe(
114172
+ `Optional partition key value to scope the query to a single partition. Pass as a JSON-encoded scalar (e.g. '"abc"' or '123'). Omit for cross-partition queries.`
114173
+ )
114174
+ });
114175
+ var outputSchema91 = z91.discriminatedUnion("success", [
114176
+ z91.object({
114177
+ success: z91.literal(true),
114178
+ documentCount: z91.number(),
114179
+ truncated: z91.boolean(),
114180
+ requestCharge: z91.number().optional(),
114181
+ documents: z91.array(z91.unknown())
114182
+ }),
114183
+ z91.object({
114184
+ success: z91.literal(false),
114185
+ error: z91.string()
114186
+ })
114187
+ ]);
114188
+ var queryTool = new ConnectorTool({
114189
+ name: "query",
114190
+ description: `Execute a Cosmos DB SQL (Core / NoSQL API) query against a container. Returns up to ${MAX_DOCUMENTS3} items.
114191
+ Use for: schema exploration, data sampling, aggregations, and analytical queries.
114192
+ Cosmos DB SQL targets a single container; reference items via the alias \`c\` (e.g. \`SELECT c.id FROM c WHERE c.userId = 'abc'\`).
114193
+ Use \`TOP n\` (not \`LIMIT n\`) to bound the result. Cross-partition queries are enabled by default \u2014 pass \`partitionKey\` to restrict to a single partition.`,
114194
+ inputSchema: inputSchema91,
114195
+ outputSchema: outputSchema91,
114196
+ async execute({ connectionId, container, sql, partitionKey }, connections) {
114197
+ const connection2 = connections.find((c6) => c6.id === connectionId);
114198
+ if (!connection2) {
114199
+ return {
114200
+ success: false,
114201
+ error: `Connection ${connectionId} not found`
114202
+ };
114203
+ }
114204
+ console.log(
114205
+ `[connector-query] cosmosdb/${connection2.name} (${container}): ${sql}`
114206
+ );
114207
+ let key;
114208
+ try {
114209
+ const cosmos = await import("@azure/cosmos");
114210
+ const { CosmosClient } = cosmos;
114211
+ const endpoint = parameters74.endpoint.getValue(connection2);
114212
+ key = parameters74.key.getValue(connection2);
114213
+ const database = parameters74.database.getValue(connection2);
114214
+ const client = new CosmosClient({ endpoint, key });
114215
+ const cont = client.database(database).container(container);
114216
+ const queryOptions = {
114217
+ // Bound by the connector's own row cap, but keep the SDK from
114218
+ // streaming arbitrarily large continuations.
114219
+ maxItemCount: MAX_DOCUMENTS3 + 1
114220
+ };
114221
+ if (partitionKey != null && partitionKey !== "") {
114222
+ try {
114223
+ queryOptions.partitionKey = JSON.parse(partitionKey);
114224
+ } catch {
114225
+ return {
114226
+ success: false,
114227
+ error: `Invalid partitionKey: must be a JSON-encoded scalar (e.g. '"abc"' or '123'). Got: ${partitionKey}`
114228
+ };
114229
+ }
114230
+ }
114231
+ const iterator = cont.items.query(sql, queryOptions);
114232
+ const { resources, requestCharge } = await iterator.fetchNext();
114233
+ const documents = resources ?? [];
114234
+ const truncated = documents.length > MAX_DOCUMENTS3;
114235
+ return {
114236
+ success: true,
114237
+ documentCount: Math.min(documents.length, MAX_DOCUMENTS3),
114238
+ truncated,
114239
+ requestCharge,
114240
+ documents: documents.slice(0, MAX_DOCUMENTS3)
114241
+ };
114242
+ } catch (err) {
114243
+ let msg = err instanceof Error ? err.message : String(err);
114244
+ if (key) msg = msg.replaceAll(key, "***");
114245
+ return { success: false, error: msg };
114246
+ }
114247
+ }
114248
+ });
114249
+
114250
+ // ../connectors/src/connectors/cosmosdb/index.ts
114251
+ var tools74 = {
114252
+ listContainers: listContainersTool,
114253
+ query: queryTool
114254
+ };
114255
+ var cosmosdbConnector = new ConnectorPlugin({
114256
+ slug: "cosmosdb",
114257
+ authType: AUTH_TYPES.USER_PASSWORD,
114258
+ name: "Azure Cosmos DB",
114259
+ description: "Connect to Azure Cosmos DB (Core / NoSQL API) for document-oriented data storage and SQL-style querying.",
114260
+ iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/5p9B2Db0V2d8mK2jgBWtZu/dad72db8f41b16c50de2bcef03f9d415/cosmosdb-icon.png",
114261
+ parameters: parameters74,
114262
+ releaseFlag: { dev1: true, dev2: true, prod: true },
114263
+ categories: ["database"],
114264
+ onboarding: cosmosdbOnboarding,
114265
+ systemPrompt: {
114266
+ en: `### Tools
114267
+
114268
+ - \`cosmosdb_listContainers\`: Lists all containers in the configured database, with their partition key paths. Use this first to explore available data.
114269
+ - \`cosmosdb_query\`: Executes a Cosmos DB SQL (Core / NoSQL API) query against a single container and returns items. Use for schema exploration, data sampling, and analytical queries. Pass \`partitionKey\` to scope the query to a single partition (cross-partition queries are enabled by default).
114270
+
114271
+ ### Business Logic
114272
+
114273
+ The business logic type for this connector is "typescript". Write handler code using the connector SDK shown below. Do NOT access credentials directly from environment variables.
114274
+
114275
+ \u26A0\uFE0F **The client returned by \`connection(connectionId)\` is NOT the raw \`@azure/cosmos\` \`CosmosClient\`.** It is a thin wrapper exposing only two methods:
114276
+ - \`client.query<T>(container, sql, options?) => Promise<T[]>\` \u2014 runs a Cosmos SQL query against the named container and returns the **already-unwrapped** items array (no \`{ resources }\` wrapper). \`options\` accepts \`{ maxItemCount?: number; partitionKey?: unknown }\`.
114277
+ - \`client.listContainers() => Promise<{ id: string; partitionKey?: string[] }[]>\` \u2014 lists containers in the configured database.
114278
+
114279
+ There is **no** \`client.databases\`, \`client.database(...)\`, \`client.container(...)\`, or \`client.items\`. Do NOT attempt to use the \`@azure/cosmos\` \`CosmosClient\` API directly through this client \u2014 those calls will fail with \`Cannot read properties of undefined\`.
114280
+
114281
+ \`\`\`ts
114282
+ import type { Context } from "hono";
114283
+ import { connection } from "@squadbase/vite-server/connectors/cosmosdb";
114284
+
114285
+ const cosmos = connection("<connectionId>");
114286
+
114287
+ export default async function handler(_c: Context) {
114288
+ // \`query\` returns the items array directly \u2014 no \`.resources\` to unwrap.
114289
+ const rows = await cosmos.query<{ prod: string; orderCount: number }>(
114290
+ "<containerName>",
114291
+ "SELECT c.prod, COUNT(1) AS orderCount FROM c GROUP BY c.prod",
114292
+ // Optional: scope to a single partition to save RUs.
114293
+ // { partitionKey: "<partitionKeyValue>" },
114294
+ );
114295
+
114296
+ rows.sort((a, b) => Number(b.orderCount) - Number(a.orderCount));
114297
+
114298
+ return new Response(JSON.stringify(rows), {
114299
+ headers: { "Content-Type": "application/json" },
114300
+ });
114301
+ }
114302
+ \`\`\`
114303
+
114304
+ ### Cosmos DB SQL Reference
114305
+ - Cosmos DB stores schema-flexible JSON items in **containers** organised under a **database**. Items are partitioned by a per-container partition key path.
114306
+ - Queries always target a single container and reference items via the alias \`c\` (e.g. \`SELECT c.id, c.name FROM c WHERE c.status = 'active'\`).
114307
+ - Row limiting: use \`TOP n\` (e.g. \`SELECT TOP 100 * FROM c\`). \`LIMIT\` is **not** supported. \`OFFSET m LIMIT n\` is supported on newer accounts but \`TOP\` is the safe default.
114308
+ - System fields are prefixed with an underscore (\`c.id\`, \`c._ts\` for the modification timestamp, \`c._etag\`).
114309
+ - Aggregates: \`COUNT(1)\`, \`SUM\`, \`AVG\`, \`MIN\`, \`MAX\`, with \`GROUP BY\` (e.g. \`SELECT c.country, COUNT(1) AS n FROM c GROUP BY c.country\`).
114310
+ - Joins: only **intra-document** joins via \`JOIN\` over arrays inside the same item; there is no cross-container/cross-document join.
114311
+ - Always bound results with \`TOP n\` and prefer scoped queries with a \`partitionKey\` value when possible \u2014 cross-partition queries cost more RUs.`,
114312
+ ja: `### \u30C4\u30FC\u30EB
114313
+
114314
+ - \`cosmosdb_listContainers\`: \u8A2D\u5B9A\u3055\u308C\u305F\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u5185\u306E\u30B3\u30F3\u30C6\u30CA\u4E00\u89A7\uFF08\u30D1\u30FC\u30C6\u30A3\u30B7\u30E7\u30F3\u30AD\u30FC\u306E\u30D1\u30B9\u4ED8\u304D\uFF09\u3092\u53D6\u5F97\u3057\u307E\u3059\u3002\u30C7\u30FC\u30BF\u63A2\u7D22\u306E\u6700\u521D\u306E\u30B9\u30C6\u30C3\u30D7\u3068\u3057\u3066\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044\u3002
114315
+ - \`cosmosdb_query\`: \u5358\u4E00\u306E\u30B3\u30F3\u30C6\u30CA\u306B\u5BFE\u3057\u3066 Cosmos DB SQL\uFF08Core / NoSQL API\uFF09\u30AF\u30A8\u30EA\u3092\u5B9F\u884C\u3057\u3001\u30A2\u30A4\u30C6\u30E0\u3092\u8FD4\u3057\u307E\u3059\u3002\u30B9\u30AD\u30FC\u30DE\u63A2\u7D22\u3001\u30C7\u30FC\u30BF\u306E\u30B5\u30F3\u30D7\u30EA\u30F3\u30B0\u3001\u5206\u6790\u30AF\u30A8\u30EA\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002\`partitionKey\` \u3092\u6E21\u3059\u3068\u5358\u4E00\u30D1\u30FC\u30C6\u30A3\u30B7\u30E7\u30F3\u306B\u30B9\u30B3\u30FC\u30D7\u3067\u304D\u3001\u672A\u6307\u5B9A\u3060\u3068\u30AF\u30ED\u30B9\u30D1\u30FC\u30C6\u30A3\u30B7\u30E7\u30F3\u30AF\u30A8\u30EA\u306B\u306A\u308A\u307E\u3059\u3002
114316
+
114317
+ ### Business Logic
114318
+
114319
+ \u3053\u306E\u30B3\u30CD\u30AF\u30BF\u306E\u30D3\u30B8\u30CD\u30B9\u30ED\u30B8\u30C3\u30AF\u30BF\u30A4\u30D7\u306F "typescript" \u3067\u3059\u3002\u4EE5\u4E0B\u306B\u793A\u3059\u30B3\u30CD\u30AF\u30BFSDK\u3092\u4F7F\u7528\u3057\u3066\u30CF\u30F3\u30C9\u30E9\u30B3\u30FC\u30C9\u3092\u8A18\u8FF0\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u74B0\u5883\u5909\u6570\u304B\u3089\u76F4\u63A5\u8A8D\u8A3C\u60C5\u5831\u306B\u30A2\u30AF\u30BB\u30B9\u3057\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3002
114320
+
114321
+ \u26A0\uFE0F **\`connection(connectionId)\` \u304C\u8FD4\u3059\u30AF\u30E9\u30A4\u30A2\u30F3\u30C8\u306F \`@azure/cosmos\` \u306E \`CosmosClient\` \u305D\u306E\u3082\u306E\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002** \u4EE5\u4E0B\u306E2\u30E1\u30BD\u30C3\u30C9\u306E\u307F\u3092\u516C\u958B\u3059\u308B\u8584\u3044\u30E9\u30C3\u30D1\u30FC\u3067\u3059\uFF1A
114322
+ - \`client.query<T>(container, sql, options?) => Promise<T[]>\` \u2014 \u6307\u5B9A\u30B3\u30F3\u30C6\u30CA\u306B\u5BFE\u3057\u3066 Cosmos SQL \u3092\u5B9F\u884C\u3057\u3001**\u3059\u3067\u306B\u5C55\u958B\u6E08\u307F\u306E\u30A2\u30A4\u30C6\u30E0\u914D\u5217**\u3092\u8FD4\u3059\uFF08\`{ resources }\` \u3067\u30E9\u30C3\u30D7\u3055\u308C\u3066\u3044\u306A\u3044\uFF09\u3002\`options\` \u306F \`{ maxItemCount?: number; partitionKey?: unknown }\`\u3002
114323
+ - \`client.listContainers() => Promise<{ id: string; partitionKey?: string[] }[]>\` \u2014 \u8A2D\u5B9A\u3055\u308C\u305F\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u5185\u306E\u30B3\u30F3\u30C6\u30CA\u4E00\u89A7\u3092\u8FD4\u3059\u3002
114324
+
114325
+ \`client.databases\`\u3001\`client.database(...)\`\u3001\`client.container(...)\`\u3001\`client.items\` \u306F **\u5B58\u5728\u3057\u306A\u3044**\u3002\`@azure/cosmos\` \u306E \`CosmosClient\` API \u3092\u3053\u306E\u30AF\u30E9\u30A4\u30A2\u30F3\u30C8\u8D8A\u3057\u306B\u76F4\u63A5\u4F7F\u304A\u3046\u3068\u3057\u306A\u3044\u3053\u3068 \u2014 \`Cannot read properties of undefined\` \u3067\u5931\u6557\u3059\u308B\u3002
114326
+
114327
+ \`\`\`ts
114328
+ import type { Context } from "hono";
114329
+ import { connection } from "@squadbase/vite-server/connectors/cosmosdb";
114330
+
114331
+ const cosmos = connection("<connectionId>");
114332
+
114333
+ export default async function handler(_c: Context) {
114334
+ // \`query\` \u306F items \u914D\u5217\u3092\u305D\u306E\u307E\u307E\u8FD4\u3059 \u2014 \`.resources\` \u306E\u5C55\u958B\u306F\u4E0D\u8981\u3002
114335
+ const rows = await cosmos.query<{ prod: string; orderCount: number }>(
114336
+ "<containerName>",
114337
+ "SELECT c.prod, COUNT(1) AS orderCount FROM c GROUP BY c.prod",
114338
+ // \u4EFB\u610F: \u5358\u4E00\u30D1\u30FC\u30C6\u30A3\u30B7\u30E7\u30F3\u306B\u30B9\u30B3\u30FC\u30D7\u3057\u3066 RU \u3092\u7BC0\u7D04\u3002
114339
+ // { partitionKey: "<partitionKeyValue>" },
114340
+ );
114341
+
114342
+ rows.sort((a, b) => Number(b.orderCount) - Number(a.orderCount));
114343
+
114344
+ return new Response(JSON.stringify(rows), {
114345
+ headers: { "Content-Type": "application/json" },
114346
+ });
114347
+ }
114348
+ \`\`\`
114349
+
114350
+ ### Cosmos DB SQL \u30EA\u30D5\u30A1\u30EC\u30F3\u30B9
114351
+ - Cosmos DB \u306F\u30B9\u30AD\u30FC\u30DE\u67D4\u8EDF\u306A JSON \u30A2\u30A4\u30C6\u30E0\u3092 **\u30B3\u30F3\u30C6\u30CA** \u306B\u683C\u7D0D\u3057\u3001\u30B3\u30F3\u30C6\u30CA\u306F\u30B3\u30F3\u30C6\u30CA\u3054\u3068\u306E\u30D1\u30FC\u30C6\u30A3\u30B7\u30E7\u30F3\u30AD\u30FC\u30D1\u30B9\u3067\u30D1\u30FC\u30C6\u30A3\u30B7\u30E7\u30F3\u5206\u5272\u3055\u308C\u307E\u3059\u3002\u30B3\u30F3\u30C6\u30CA\u306F **\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9** \u306B\u307E\u3068\u3081\u3089\u308C\u307E\u3059\u3002
114352
+ - \u30AF\u30A8\u30EA\u306F\u5E38\u306B\u5358\u4E00\u30B3\u30F3\u30C6\u30CA\u3092\u5BFE\u8C61\u3068\u3057\u3001\u30A2\u30A4\u30C6\u30E0\u306F\u5225\u540D \`c\` \u3067\u53C2\u7167\u3057\u307E\u3059\uFF08\u4F8B: \`SELECT c.id, c.name FROM c WHERE c.status = 'active'\`\uFF09\u3002
114353
+ - \u884C\u6570\u5236\u9650: \`TOP n\` \u3092\u4F7F\u7528\u3057\u307E\u3059\uFF08\u4F8B: \`SELECT TOP 100 * FROM c\`\uFF09\u3002\`LIMIT\` \u306F **\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093**\u3002\u65B0\u3057\u3044\u30A2\u30AB\u30A6\u30F3\u30C8\u3067\u306F \`OFFSET m LIMIT n\` \u304C\u4F7F\u3048\u307E\u3059\u304C\u3001\u5B89\u5168\u5074\u306E\u65E2\u5B9A\u306F \`TOP\` \u3067\u3059\u3002
114354
+ - \u30B7\u30B9\u30C6\u30E0\u30D5\u30A3\u30FC\u30EB\u30C9\u306F\u30A2\u30F3\u30C0\u30FC\u30B9\u30B3\u30A2\u59CB\u307E\u308A\uFF08\`c.id\`\u3001\u5909\u66F4\u6642\u523B\u306E \`c._ts\`\u3001\`c._etag\`\uFF09\u3002
114355
+ - \u96C6\u7D04: \`COUNT(1)\`\u3001\`SUM\`\u3001\`AVG\`\u3001\`MIN\`\u3001\`MAX\` \u3092 \`GROUP BY\` \u3068\u7D44\u307F\u5408\u308F\u305B\u307E\u3059\uFF08\u4F8B: \`SELECT c.country, COUNT(1) AS n FROM c GROUP BY c.country\`\uFF09\u3002
114356
+ - \u7D50\u5408: \u540C\u4E00\u30A2\u30A4\u30C6\u30E0\u5185\u306E\u914D\u5217\u306B\u5BFE\u3059\u308B **\u30A4\u30F3\u30C8\u30E9\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8** \`JOIN\` \u306E\u307F\u3067\u3001\u30B3\u30F3\u30C6\u30CA\u9593\uFF0F\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u9593\u306E\u7D50\u5408\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u307E\u305B\u3093\u3002
114357
+ - \u7D50\u679C\u4EF6\u6570\u306F\u5FC5\u305A \`TOP n\` \u3067\u5236\u9650\u3057\u3001\u53EF\u80FD\u3067\u3042\u308C\u3070 \`partitionKey\` \u3067\u5358\u4E00\u30D1\u30FC\u30C6\u30A3\u30B7\u30E7\u30F3\u306B\u30B9\u30B3\u30FC\u30D7\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u30AF\u30ED\u30B9\u30D1\u30FC\u30C6\u30A3\u30B7\u30E7\u30F3\u30AF\u30A8\u30EA\u306F RU \u3092\u591A\u304F\u6D88\u8CBB\u3057\u307E\u3059\uFF09\u3002`
114358
+ },
114359
+ tools: tools74,
114360
+ async checkConnection(params, _config) {
114361
+ try {
114362
+ const { CosmosClient } = await import("@azure/cosmos");
114363
+ const client = new CosmosClient({
114364
+ endpoint: params[parameters74.endpoint.slug],
114365
+ key: params[parameters74.key.slug]
114366
+ });
114367
+ const database = params[parameters74.database.slug];
114368
+ await client.database(database).read();
114369
+ return { success: true };
114370
+ } catch (error2) {
114371
+ const msg = error2 instanceof Error ? error2.message : String(error2);
114372
+ const key = params[parameters74.key.slug];
114373
+ return {
114374
+ success: false,
114375
+ error: key ? msg.replaceAll(key, "***") : msg
114376
+ };
114377
+ }
113869
114378
  }
113870
114379
  });
113871
114380
 
@@ -113886,7 +114395,7 @@ var oracleOnboarding = new ConnectorOnboarding({
113886
114395
  });
113887
114396
 
113888
114397
  // ../connectors/src/connectors/oracle/parameters.ts
113889
- var parameters74 = {
114398
+ var parameters75 = {
113890
114399
  jdbcUrl: new ParameterDefinition({
113891
114400
  slug: "jdbc-url",
113892
114401
  name: "Oracle JDBC URL",
@@ -113913,31 +114422,32 @@ var parameters74 = {
113913
114422
  type: "text",
113914
114423
  secret: true,
113915
114424
  required: false
113916
- })
114425
+ }),
114426
+ ...sshTunnelParameters
113917
114427
  };
113918
114428
 
113919
114429
  // ../connectors/src/connectors/oracle/tools/execute-query.ts
113920
- import { z as z90 } from "zod";
114430
+ import { z as z92 } from "zod";
113921
114431
  var MAX_ROWS16 = 500;
113922
- var inputSchema90 = z90.object({
113923
- toolUseIntent: z90.string().optional().describe(
114432
+ var inputSchema92 = z92.object({
114433
+ toolUseIntent: z92.string().optional().describe(
113924
114434
  "Brief description of what you intend to accomplish with this tool call"
113925
114435
  ),
113926
- connectionId: z90.string().describe("ID of the Oracle connection to use"),
113927
- sql: z90.string().describe(
114436
+ connectionId: z92.string().describe("ID of the Oracle connection to use"),
114437
+ sql: z92.string().describe(
113928
114438
  "PL/SQL-compatible query. Oracle has no `LIMIT`; use `FETCH FIRST n ROWS ONLY` or filter on `ROWNUM`. Don't end the statement with a semicolon \u2014 the driver rejects trailing terminators."
113929
114439
  )
113930
114440
  });
113931
- var outputSchema90 = z90.discriminatedUnion("success", [
113932
- z90.object({
113933
- success: z90.literal(true),
113934
- rowCount: z90.number(),
113935
- truncated: z90.boolean(),
113936
- rows: z90.array(z90.record(z90.string(), z90.unknown()))
114441
+ var outputSchema92 = z92.discriminatedUnion("success", [
114442
+ z92.object({
114443
+ success: z92.literal(true),
114444
+ rowCount: z92.number(),
114445
+ truncated: z92.boolean(),
114446
+ rows: z92.array(z92.record(z92.string(), z92.unknown()))
113937
114447
  }),
113938
- z90.object({
113939
- success: z90.literal(false),
113940
- error: z90.string()
114448
+ z92.object({
114449
+ success: z92.literal(false),
114450
+ error: z92.string()
113941
114451
  })
113942
114452
  ]);
113943
114453
  var executeQueryTool16 = new ConnectorTool({
@@ -113947,8 +114457,8 @@ Use for: schema exploration via \`USER_TABLES\` / \`USER_TAB_COLUMNS\` / \`ALL_T
113947
114457
  Oracle uses \`FETCH FIRST n ROWS ONLY\` (12c+) or \`ROWNUM\` for row limiting \u2014 there is no \`LIMIT\` keyword.
113948
114458
  Unquoted identifiers are stored upper-case (\`SELECT * FROM employees\` resolves to \`EMPLOYEES\`).
113949
114459
  Do NOT terminate statements with a semicolon; the driver rejects trailing terminators.`,
113950
- inputSchema: inputSchema90,
113951
- outputSchema: outputSchema90,
114460
+ inputSchema: inputSchema92,
114461
+ outputSchema: outputSchema92,
113952
114462
  async execute({ connectionId, sql }, connections) {
113953
114463
  const connection2 = connections.find((c6) => c6.id === connectionId);
113954
114464
  if (!connection2) {
@@ -113957,9 +114467,9 @@ Do NOT terminate statements with a semicolon; the driver rejects trailing termin
113957
114467
  error: `Connection ${connectionId} not found`
113958
114468
  };
113959
114469
  }
113960
- const jdbcUrl = parameters74.jdbcUrl.getValue(connection2);
113961
- const username = parameters74.username.tryGetValue(connection2);
113962
- const password = parameters74.password.tryGetValue(connection2);
114470
+ const jdbcUrl = parameters75.jdbcUrl.getValue(connection2);
114471
+ const username = parameters75.username.tryGetValue(connection2);
114472
+ const password = parameters75.password.tryGetValue(connection2);
113963
114473
  console.log(
113964
114474
  `[connector-query] oracle/${connection2.name} (${redactOracleUrl(jdbcUrl)}): ${sql}`
113965
114475
  );
@@ -113974,7 +114484,9 @@ Do NOT terminate statements with a semicolon; the driver rejects trailing termin
113974
114484
  }
113975
114485
  try {
113976
114486
  const cleanSql = sql.replace(/;\s*$/, "");
113977
- const { rows } = await runOracleQuery(parsed, cleanSql);
114487
+ const { rows } = await runOracleQuery(parsed, cleanSql, {
114488
+ tunnelParams: connectionParamsToRecord(connection2)
114489
+ });
113978
114490
  const truncated = rows.length > MAX_ROWS16;
113979
114491
  return {
113980
114492
  success: true,
@@ -113991,14 +114503,14 @@ Do NOT terminate statements with a semicolon; the driver rejects trailing termin
113991
114503
  });
113992
114504
 
113993
114505
  // ../connectors/src/connectors/oracle/index.ts
113994
- var tools74 = { executeQuery: executeQueryTool16 };
114506
+ var tools75 = { executeQuery: executeQueryTool16 };
113995
114507
  var oracleConnector = new ConnectorPlugin({
113996
114508
  slug: "oracle",
113997
114509
  authType: AUTH_TYPES.USER_PASSWORD,
113998
114510
  name: "Oracle Database",
113999
114511
  description: "Connect to Oracle Database using a JDBC-style URL via the pure-JS Thin driver (no Oracle Instant Client required).",
114000
114512
  iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/3iGEdzvGHncU5bYqFOROiV/9e7bdda7230d7ca6b34e7f6a862de876/oracle-icon.webp",
114001
- parameters: parameters74,
114513
+ parameters: parameters75,
114002
114514
  releaseFlag: { dev1: true, dev2: false, prod: false },
114003
114515
  categories: ["database"],
114004
114516
  onboarding: oracleOnboarding,
@@ -114042,26 +114554,32 @@ The business logic type for this connector is "sql".
114042
114554
  - \u30B9\u30C6\u30FC\u30C8\u30E1\u30F3\u30C8\u672B\u5C3E\u306B\u30BB\u30DF\u30B3\u30ED\u30F3\u3092\u4ED8\u3051\u306A\u3044\u3067\u304F\u3060\u3055\u3044\uFF08thin \u30C9\u30E9\u30A4\u30D0\u304C\u62D2\u5426\u3057\u307E\u3059\uFF09\u3002
114043
114555
  - \u884C\u6570\u5236\u9650\u306E\u4E92\u63DB\u6027: \u30D7\u30E9\u30C3\u30C8\u30D5\u30A9\u30FC\u30E0\u306E server-logic \u30B9\u30AD\u30FC\u30DE\u63A8\u8AD6\u306F\u3001\u30AF\u30A8\u30EA\u3092 \`SELECT * FROM (<inner>) AS _sq LIMIT N\` \u306E\u5F62\u3067\u30E9\u30C3\u30D7\u3057\u3066\u304F\u308B\u3053\u3068\u304C\u3042\u308A\u307E\u3059\u3002Oracle \u306B\u306F \`LIMIT\` \u30AD\u30FC\u30EF\u30FC\u30C9\u304C\u5B58\u5728\u3057\u306A\u3044\u305F\u3081\u3001\u30B3\u30CD\u30AF\u30BF\u306F \`query()\` \u5185\u3067\u3053\u306E\u30E9\u30C3\u30D1\u3092\u691C\u51FA\u3057\u3001\`<inner>\` \u3092\u305D\u306E\u307E\u307E\u5B9F\u884C\u3057\u3066 JS \u5074\u3067\u5148\u982D N \u884C\u306B\u5207\u308A\u8A70\u3081\u307E\u3059\u3002\u5229\u7528\u8005\u5074\u3067\u5BFE\u51E6\u3059\u308B\u5FC5\u8981\u306F\u3042\u308A\u307E\u305B\u3093\u304C\u3001\u81EA\u5206\u3067\u66F8\u304F SQL \u3067\u306F \`LIMIT\` \u3092\u4F7F\u308F\u305A \`FETCH FIRST N ROWS ONLY\` / \`OFFSET m ROWS FETCH NEXT N ROWS ONLY\` / \`ROWNUM\` \u3092\u4F7F\u3063\u3066\u304F\u3060\u3055\u3044\u3002`
114044
114556
  },
114045
- tools: tools74,
114557
+ tools: tools75,
114046
114558
  async checkConnection(params, _config) {
114047
- return checkOracleConnection(params[parameters74.jdbcUrl.slug], {
114048
- username: params[parameters74.username.slug],
114049
- password: params[parameters74.password.slug]
114050
- });
114559
+ return checkOracleConnection(
114560
+ params[parameters75.jdbcUrl.slug],
114561
+ {
114562
+ username: params[parameters75.username.slug],
114563
+ password: params[parameters75.password.slug]
114564
+ },
114565
+ { tunnelParams: params }
114566
+ );
114051
114567
  },
114052
114568
  async query(params, sql, _namedParams) {
114053
- const parsed = parseOracleJdbcUrl(params[parameters74.jdbcUrl.slug], {
114054
- username: params[parameters74.username.slug],
114055
- password: params[parameters74.password.slug]
114569
+ const parsed = parseOracleJdbcUrl(params[parameters75.jdbcUrl.slug], {
114570
+ username: params[parameters75.username.slug],
114571
+ password: params[parameters75.password.slug]
114056
114572
  });
114057
114573
  const sample = unwrapSampleLimit(sql);
114058
114574
  if (sample) {
114059
114575
  const inner = sample.inner.replace(/;\s*$/, "");
114060
- const result = await runOracleQuery(parsed, inner);
114576
+ const result = await runOracleQuery(parsed, inner, {
114577
+ tunnelParams: params
114578
+ });
114061
114579
  return { rows: result.rows.slice(0, sample.limit) };
114062
114580
  }
114063
114581
  const cleanSql = sql.replace(/;\s*$/, "");
114064
- return runOracleQuery(parsed, cleanSql);
114582
+ return runOracleQuery(parsed, cleanSql, { tunnelParams: params });
114065
114583
  }
114066
114584
  });
114067
114585
 
@@ -114082,7 +114600,7 @@ var freshserviceOnboarding = new ConnectorOnboarding({
114082
114600
  });
114083
114601
 
114084
114602
  // ../connectors/src/connectors/freshservice/parameters.ts
114085
- var parameters75 = {
114603
+ var parameters76 = {
114086
114604
  domain: new ParameterDefinition({
114087
114605
  slug: "domain",
114088
114606
  name: "Freshservice Domain",
@@ -114104,7 +114622,7 @@ var parameters75 = {
114104
114622
  };
114105
114623
 
114106
114624
  // ../connectors/src/connectors/freshservice/tools/request.ts
114107
- import { z as z91 } from "zod";
114625
+ import { z as z93 } from "zod";
114108
114626
  var BASE_PATH_SEGMENT12 = "/api/v2";
114109
114627
  var REQUEST_TIMEOUT_MS70 = 6e4;
114110
114628
  function buildBaseUrl(domain) {
@@ -114115,33 +114633,33 @@ function buildBaseUrl(domain) {
114115
114633
  function basicAuthHeader(apiKey) {
114116
114634
  return `Basic ${Buffer.from(`${apiKey}:X`).toString("base64")}`;
114117
114635
  }
114118
- var inputSchema91 = z91.object({
114119
- toolUseIntent: z91.string().optional().describe(
114636
+ var inputSchema93 = z93.object({
114637
+ toolUseIntent: z93.string().optional().describe(
114120
114638
  "Brief description of what you intend to accomplish with this tool call"
114121
114639
  ),
114122
- connectionId: z91.string().describe("ID of the Freshservice connection to use"),
114123
- method: z91.enum(["GET", "POST", "PUT", "DELETE"]).describe(
114640
+ connectionId: z93.string().describe("ID of the Freshservice connection to use"),
114641
+ method: z93.enum(["GET", "POST", "PUT", "DELETE"]).describe(
114124
114642
  "HTTP method. GET for reading resources, POST for creating, PUT for updating, DELETE for removing."
114125
114643
  ),
114126
- path: z91.string().describe(
114644
+ path: z93.string().describe(
114127
114645
  "API path (e.g., '/tickets', '/tickets/123', '/agents'). Append query parameters such as '?per_page=100&page=1' for pagination."
114128
114646
  ),
114129
- body: z91.record(z91.string(), z91.unknown()).optional().describe(
114647
+ body: z93.record(z93.string(), z93.unknown()).optional().describe(
114130
114648
  'Request body (JSON) for POST/PUT requests. Example: { "subject": "...", "description": "...", "email": "...", "priority": 2, "status": 2, "source": 2 }.'
114131
114649
  )
114132
114650
  });
114133
- var outputSchema91 = z91.discriminatedUnion("success", [
114134
- z91.object({
114135
- success: z91.literal(true),
114136
- status: z91.number(),
114137
- data: z91.union([
114138
- z91.record(z91.string(), z91.unknown()),
114139
- z91.array(z91.unknown())
114651
+ var outputSchema93 = z93.discriminatedUnion("success", [
114652
+ z93.object({
114653
+ success: z93.literal(true),
114654
+ status: z93.number(),
114655
+ data: z93.union([
114656
+ z93.record(z93.string(), z93.unknown()),
114657
+ z93.array(z93.unknown())
114140
114658
  ])
114141
114659
  }),
114142
- z91.object({
114143
- success: z91.literal(false),
114144
- error: z91.string()
114660
+ z93.object({
114661
+ success: z93.literal(false),
114662
+ error: z93.string()
114145
114663
  })
114146
114664
  ]);
114147
114665
  var requestTool52 = new ConnectorTool({
@@ -114172,8 +114690,8 @@ Field codes:
114172
114690
  - ticket priority: 1 Low, 2 Medium, 3 High, 4 Urgent
114173
114691
  - ticket status: 2 Open, 3 Pending, 4 Resolved, 5 Closed
114174
114692
  - ticket source: 1 Email, 2 Portal, 3 Phone, 4 Chat, 5 Feedback widget, 7 Yammer, 8 AwsCloudwatch, 9 Pagerduty, 10 Walkup, 11 Slack`,
114175
- inputSchema: inputSchema91,
114176
- outputSchema: outputSchema91,
114693
+ inputSchema: inputSchema93,
114694
+ outputSchema: outputSchema93,
114177
114695
  async execute({ connectionId, method, path: path5, body }, connections) {
114178
114696
  const connection2 = connections.find((c6) => c6.id === connectionId);
114179
114697
  if (!connection2) {
@@ -114186,8 +114704,8 @@ Field codes:
114186
114704
  `[connector-request] freshservice/${connection2.name}: ${method} ${path5}`
114187
114705
  );
114188
114706
  try {
114189
- const apiKey = parameters75.apiKey.getValue(connection2);
114190
- const domain = parameters75.domain.getValue(connection2);
114707
+ const apiKey = parameters76.apiKey.getValue(connection2);
114708
+ const domain = parameters76.domain.getValue(connection2);
114191
114709
  const baseUrl = buildBaseUrl(domain);
114192
114710
  const normalizedPath = normalizeRequestPath(path5, BASE_PATH_SEGMENT12);
114193
114711
  const url = `${baseUrl}${normalizedPath}`;
@@ -114226,14 +114744,14 @@ Field codes:
114226
114744
  });
114227
114745
 
114228
114746
  // ../connectors/src/connectors/freshservice/index.ts
114229
- var tools75 = { request: requestTool52 };
114747
+ var tools76 = { request: requestTool52 };
114230
114748
  var freshserviceConnector = new ConnectorPlugin({
114231
114749
  slug: "freshservice",
114232
114750
  authType: AUTH_TYPES.API_KEY,
114233
114751
  name: "Freshservice",
114234
114752
  description: "Connect to Freshservice (ITSM) for ticket, agent, asset, and ITIL workflow data via API key.",
114235
114753
  iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/6Tj64HZOoIrGgQYDayBosY/3f45b29d3479726b5d245ac38d5a7036/freshservice-icon.svg",
114236
- parameters: parameters75,
114754
+ parameters: parameters76,
114237
114755
  releaseFlag: { dev1: true, dev2: true, prod: true },
114238
114756
  categories: ["productivity"],
114239
114757
  onboarding: freshserviceOnboarding,
@@ -114391,7 +114909,7 @@ export default async function handler(c: Context) {
114391
114909
  - \`status\`: 2=Open, 3=Pending, 4=Resolved, 5=Closed
114392
114910
  - \`source\`: 1=Email, 2=Portal, 3=Phone, 4=Chat, 5=Feedback widget, 7=Yammer, 8=AwsCloudwatch, 9=Pagerduty, 10=Walkup, 11=Slack`
114393
114911
  },
114394
- tools: tools75
114912
+ tools: tools76
114395
114913
  });
114396
114914
 
114397
114915
  // ../connectors/src/connectors/freshdesk/setup.ts
@@ -114411,7 +114929,7 @@ var freshdeskOnboarding = new ConnectorOnboarding({
114411
114929
  });
114412
114930
 
114413
114931
  // ../connectors/src/connectors/freshdesk/parameters.ts
114414
- var parameters76 = {
114932
+ var parameters77 = {
114415
114933
  domain: new ParameterDefinition({
114416
114934
  slug: "domain",
114417
114935
  name: "Freshdesk Domain",
@@ -114433,7 +114951,7 @@ var parameters76 = {
114433
114951
  };
114434
114952
 
114435
114953
  // ../connectors/src/connectors/freshdesk/tools/request.ts
114436
- import { z as z92 } from "zod";
114954
+ import { z as z94 } from "zod";
114437
114955
  var BASE_PATH_SEGMENT13 = "/api/v2";
114438
114956
  var REQUEST_TIMEOUT_MS71 = 6e4;
114439
114957
  function buildBaseUrl2(domain) {
@@ -114444,33 +114962,33 @@ function buildBaseUrl2(domain) {
114444
114962
  function basicAuthHeader2(apiKey) {
114445
114963
  return `Basic ${Buffer.from(`${apiKey}:X`).toString("base64")}`;
114446
114964
  }
114447
- var inputSchema92 = z92.object({
114448
- toolUseIntent: z92.string().optional().describe(
114965
+ var inputSchema94 = z94.object({
114966
+ toolUseIntent: z94.string().optional().describe(
114449
114967
  "Brief description of what you intend to accomplish with this tool call"
114450
114968
  ),
114451
- connectionId: z92.string().describe("ID of the Freshdesk connection to use"),
114452
- method: z92.enum(["GET", "POST", "PUT", "DELETE"]).describe(
114969
+ connectionId: z94.string().describe("ID of the Freshdesk connection to use"),
114970
+ method: z94.enum(["GET", "POST", "PUT", "DELETE"]).describe(
114453
114971
  "HTTP method. GET for reading resources, POST for creating, PUT for updating, DELETE for removing."
114454
114972
  ),
114455
- path: z92.string().describe(
114973
+ path: z94.string().describe(
114456
114974
  "API path (e.g., '/tickets', '/tickets/123', '/contacts'). Append query parameters such as '?per_page=100&page=1&order_by=created_at&order_type=desc'."
114457
114975
  ),
114458
- body: z92.record(z92.string(), z92.unknown()).optional().describe(
114976
+ body: z94.record(z94.string(), z94.unknown()).optional().describe(
114459
114977
  'Request body (JSON) for POST/PUT requests. Example creating a ticket: { "subject": "...", "description": "...", "email": "...", "priority": 2, "status": 2, "source": 1 }.'
114460
114978
  )
114461
114979
  });
114462
- var outputSchema92 = z92.discriminatedUnion("success", [
114463
- z92.object({
114464
- success: z92.literal(true),
114465
- status: z92.number(),
114466
- data: z92.union([
114467
- z92.record(z92.string(), z92.unknown()),
114468
- z92.array(z92.unknown())
114980
+ var outputSchema94 = z94.discriminatedUnion("success", [
114981
+ z94.object({
114982
+ success: z94.literal(true),
114983
+ status: z94.number(),
114984
+ data: z94.union([
114985
+ z94.record(z94.string(), z94.unknown()),
114986
+ z94.array(z94.unknown())
114469
114987
  ])
114470
114988
  }),
114471
- z92.object({
114472
- success: z92.literal(false),
114473
- error: z92.string()
114989
+ z94.object({
114990
+ success: z94.literal(false),
114991
+ error: z94.string()
114474
114992
  })
114475
114993
  ]);
114476
114994
  var requestTool53 = new ConnectorTool({
@@ -114501,8 +115019,8 @@ Field codes (tickets):
114501
115019
  - priority: 1 Low, 2 Medium, 3 High, 4 Urgent
114502
115020
  - status: 2 Open, 3 Pending, 4 Resolved, 5 Closed
114503
115021
  - source: 1 Email, 2 Portal, 3 Phone, 7 Chat, 9 Feedback widget, 10 Outbound email`,
114504
- inputSchema: inputSchema92,
114505
- outputSchema: outputSchema92,
115022
+ inputSchema: inputSchema94,
115023
+ outputSchema: outputSchema94,
114506
115024
  async execute({ connectionId, method, path: path5, body }, connections) {
114507
115025
  const connection2 = connections.find((c6) => c6.id === connectionId);
114508
115026
  if (!connection2) {
@@ -114515,8 +115033,8 @@ Field codes (tickets):
114515
115033
  `[connector-request] freshdesk/${connection2.name}: ${method} ${path5}`
114516
115034
  );
114517
115035
  try {
114518
- const apiKey = parameters76.apiKey.getValue(connection2);
114519
- const domain = parameters76.domain.getValue(connection2);
115036
+ const apiKey = parameters77.apiKey.getValue(connection2);
115037
+ const domain = parameters77.domain.getValue(connection2);
114520
115038
  const baseUrl = buildBaseUrl2(domain);
114521
115039
  const normalizedPath = normalizeRequestPath(path5, BASE_PATH_SEGMENT13);
114522
115040
  const url = `${baseUrl}${normalizedPath}`;
@@ -114555,14 +115073,14 @@ Field codes (tickets):
114555
115073
  });
114556
115074
 
114557
115075
  // ../connectors/src/connectors/freshdesk/index.ts
114558
- var tools76 = { request: requestTool53 };
115076
+ var tools77 = { request: requestTool53 };
114559
115077
  var freshdeskConnector = new ConnectorPlugin({
114560
115078
  slug: "freshdesk",
114561
115079
  authType: AUTH_TYPES.API_KEY,
114562
115080
  name: "Freshdesk",
114563
115081
  description: "Connect to Freshdesk for customer support ticket, contact, and company data via API key.",
114564
115082
  iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/1PSjIfQJgTYmiWriNTx4uE/26905f4120713bda0afd0b23d02a154e/freshdesk-icon.png",
114565
- parameters: parameters76,
115083
+ parameters: parameters77,
114566
115084
  releaseFlag: { dev1: true, dev2: true, prod: true },
114567
115085
  categories: ["crm"],
114568
115086
  onboarding: freshdeskOnboarding,
@@ -114722,7 +115240,7 @@ export default async function handler(c: Context) {
114722
115240
  - \`status\`: 2=Open, 3=Pending, 4=Resolved, 5=Closed
114723
115241
  - \`source\`: 1=Email, 2=Portal, 3=Phone, 7=Chat, 9=Feedback widget, 10=Outbound email`
114724
115242
  },
114725
- tools: tools76
115243
+ tools: tools77
114726
115244
  });
114727
115245
 
114728
115246
  // ../connectors/src/connectors/freshsales/setup.ts
@@ -114742,7 +115260,7 @@ var freshsalesOnboarding = new ConnectorOnboarding({
114742
115260
  });
114743
115261
 
114744
115262
  // ../connectors/src/connectors/freshsales/parameters.ts
114745
- var parameters77 = {
115263
+ var parameters78 = {
114746
115264
  bundleAlias: new ParameterDefinition({
114747
115265
  slug: "bundle-alias",
114748
115266
  name: "Freshsales Bundle Alias",
@@ -114764,7 +115282,7 @@ var parameters77 = {
114764
115282
  };
114765
115283
 
114766
115284
  // ../connectors/src/connectors/freshsales/tools/request.ts
114767
- import { z as z93 } from "zod";
115285
+ import { z as z95 } from "zod";
114768
115286
  var BASE_PATH_SEGMENT14 = "/crm/sales/api";
114769
115287
  var REQUEST_TIMEOUT_MS72 = 6e4;
114770
115288
  function buildBaseUrl3(bundleAlias) {
@@ -114772,33 +115290,33 @@ function buildBaseUrl3(bundleAlias) {
114772
115290
  const subdomain = trimmed.split(".")[0];
114773
115291
  return `https://${subdomain}.myfreshworks.com${BASE_PATH_SEGMENT14}`;
114774
115292
  }
114775
- var inputSchema93 = z93.object({
114776
- toolUseIntent: z93.string().optional().describe(
115293
+ var inputSchema95 = z95.object({
115294
+ toolUseIntent: z95.string().optional().describe(
114777
115295
  "Brief description of what you intend to accomplish with this tool call"
114778
115296
  ),
114779
- connectionId: z93.string().describe("ID of the Freshsales connection to use"),
114780
- method: z93.enum(["GET", "POST", "PUT", "DELETE"]).describe(
115297
+ connectionId: z95.string().describe("ID of the Freshsales connection to use"),
115298
+ method: z95.enum(["GET", "POST", "PUT", "DELETE"]).describe(
114781
115299
  "HTTP method. GET for reading resources (including /lookup), POST for creating, PUT for updating, DELETE for removing."
114782
115300
  ),
114783
- path: z93.string().describe(
115301
+ path: z95.string().describe(
114784
115302
  "API path (e.g., '/contacts', '/contacts/filters', '/contacts/view/{view_id}', '/deals/{id}', '/lookup'). Append query parameters such as '?page=1&per_page=100'."
114785
115303
  ),
114786
- body: z93.record(z93.string(), z93.unknown()).optional().describe(
115304
+ body: z95.record(z95.string(), z95.unknown()).optional().describe(
114787
115305
  'Request body (JSON). For creating a contact: { "contact": { "first_name": "...", "last_name": "...", "email": "..." } }. For lookup: { "q": "john@example.com", "f": "email", "entities": "contact" }.'
114788
115306
  )
114789
115307
  });
114790
- var outputSchema93 = z93.discriminatedUnion("success", [
114791
- z93.object({
114792
- success: z93.literal(true),
114793
- status: z93.number(),
114794
- data: z93.union([
114795
- z93.record(z93.string(), z93.unknown()),
114796
- z93.array(z93.unknown())
115308
+ var outputSchema95 = z95.discriminatedUnion("success", [
115309
+ z95.object({
115310
+ success: z95.literal(true),
115311
+ status: z95.number(),
115312
+ data: z95.union([
115313
+ z95.record(z95.string(), z95.unknown()),
115314
+ z95.array(z95.unknown())
114797
115315
  ])
114798
115316
  }),
114799
- z93.object({
114800
- success: z93.literal(false),
114801
- error: z93.string()
115317
+ z95.object({
115318
+ success: z95.literal(false),
115319
+ error: z95.string()
114802
115320
  })
114803
115321
  ]);
114804
115322
  var requestTool54 = new ConnectorTool({
@@ -114831,8 +115349,8 @@ Common endpoints:
114831
115349
  Pagination: 1-indexed \`page\` + \`per_page\` (default 25, max 100). View endpoints return \`{ contacts/sales_accounts/deals: [...], meta: { total_pages, total } }\`.
114832
115350
 
114833
115351
  Includes: most GET endpoints accept \`?include=\` with a comma-separated list (\`owner\`, \`creator\`, \`deals\`, \`contacts\`, etc.) to inline related records.`,
114834
- inputSchema: inputSchema93,
114835
- outputSchema: outputSchema93,
115352
+ inputSchema: inputSchema95,
115353
+ outputSchema: outputSchema95,
114836
115354
  async execute({ connectionId, method, path: path5, body }, connections) {
114837
115355
  const connection2 = connections.find((c6) => c6.id === connectionId);
114838
115356
  if (!connection2) {
@@ -114845,8 +115363,8 @@ Includes: most GET endpoints accept \`?include=\` with a comma-separated list (\
114845
115363
  `[connector-request] freshsales/${connection2.name}: ${method} ${path5}`
114846
115364
  );
114847
115365
  try {
114848
- const apiKey = parameters77.apiKey.getValue(connection2);
114849
- const bundle = parameters77.bundleAlias.getValue(connection2);
115366
+ const apiKey = parameters78.apiKey.getValue(connection2);
115367
+ const bundle = parameters78.bundleAlias.getValue(connection2);
114850
115368
  const baseUrl = buildBaseUrl3(bundle);
114851
115369
  const normalizedPath = normalizeRequestPath(path5, BASE_PATH_SEGMENT14);
114852
115370
  const url = `${baseUrl}${normalizedPath}`;
@@ -114884,14 +115402,14 @@ Includes: most GET endpoints accept \`?include=\` with a comma-separated list (\
114884
115402
  });
114885
115403
 
114886
115404
  // ../connectors/src/connectors/freshsales/index.ts
114887
- var tools77 = { request: requestTool54 };
115405
+ var tools78 = { request: requestTool54 };
114888
115406
  var freshsalesConnector = new ConnectorPlugin({
114889
115407
  slug: "freshsales",
114890
115408
  authType: AUTH_TYPES.API_KEY,
114891
115409
  name: "Freshsales",
114892
115410
  description: "Connect to Freshsales / Freshworks CRM for contact, account, and deal data via API key.",
114893
115411
  iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/4UDOrFPM6wOFekbMVljjgl/4acc6060c3a1ff703980e6f4e76a3cd4/629b6c6f7c5cd817694c321f.png",
114894
- parameters: parameters77,
115412
+ parameters: parameters78,
114895
115413
  releaseFlag: { dev1: true, dev2: true, prod: true },
114896
115414
  categories: ["crm"],
114897
115415
  onboarding: freshsalesOnboarding,
@@ -115063,7 +115581,7 @@ export default async function handler(c: Context) {
115063
115581
  - GET \`/selector/lifecycle_stages\` \u2014 \u30E9\u30A4\u30D5\u30B5\u30A4\u30AF\u30EB\u30B9\u30C6\u30FC\u30B8
115064
115582
  - GET \`/selector/territories\` / \`/selector/business_types\` / \`/selector/industry_types\` / \`/selector/contact_statuses\` / \`/selector/sales_activity_types\``
115065
115583
  },
115066
- tools: tools77
115584
+ tools: tools78
115067
115585
  });
115068
115586
 
115069
115587
  // ../connectors/src/connectors/github/setup.ts
@@ -115089,7 +115607,7 @@ var githubOnboarding = new ConnectorOnboarding({
115089
115607
  });
115090
115608
 
115091
115609
  // ../connectors/src/connectors/github/parameters.ts
115092
- var parameters78 = {
115610
+ var parameters79 = {
115093
115611
  personalAccessToken: new ParameterDefinition({
115094
115612
  slug: "personal-access-token",
115095
115613
  name: "GitHub Personal Access Token",
@@ -115112,42 +115630,42 @@ var parameters78 = {
115112
115630
  var DEFAULT_BASE_URL = "https://api.github.com";
115113
115631
 
115114
115632
  // ../connectors/src/connectors/github/tools/request.ts
115115
- import { z as z94 } from "zod";
115633
+ import { z as z96 } from "zod";
115116
115634
  var REQUEST_TIMEOUT_MS73 = 6e4;
115117
115635
  function resolveBaseUrl(connectionBaseUrl) {
115118
115636
  const trimmed = connectionBaseUrl?.trim();
115119
115637
  return trimmed && trimmed.replace(/\/+$/, "") || DEFAULT_BASE_URL;
115120
115638
  }
115121
- var inputSchema94 = z94.object({
115122
- toolUseIntent: z94.string().optional().describe(
115639
+ var inputSchema96 = z96.object({
115640
+ toolUseIntent: z96.string().optional().describe(
115123
115641
  "Brief description of what you intend to accomplish with this tool call"
115124
115642
  ),
115125
- connectionId: z94.string().describe("ID of the GitHub connection to use"),
115126
- method: z94.enum(["GET", "POST", "PUT", "PATCH", "DELETE"]).describe(
115643
+ connectionId: z96.string().describe("ID of the GitHub connection to use"),
115644
+ method: z96.enum(["GET", "POST", "PUT", "PATCH", "DELETE"]).describe(
115127
115645
  "HTTP method. GET for reading, POST for creating, PATCH for partial updates, PUT for replacement (e.g. starring), DELETE for removal."
115128
115646
  ),
115129
- path: z94.string().describe(
115647
+ path: z96.string().describe(
115130
115648
  "API path (e.g., '/user', '/repos/{owner}/{repo}/issues', '/search/repositories?q=topic:react'). Append query parameters such as '?state=open&per_page=100&page=1'."
115131
115649
  ),
115132
- body: z94.union([
115133
- z94.record(z94.string(), z94.unknown()),
115134
- z94.array(z94.unknown())
115650
+ body: z96.union([
115651
+ z96.record(z96.string(), z96.unknown()),
115652
+ z96.array(z96.unknown())
115135
115653
  ]).optional().describe(
115136
115654
  'Request body (JSON). Example creating an issue: { "title": "...", "body": "...", "labels": ["bug"] }.'
115137
115655
  )
115138
115656
  });
115139
- var outputSchema94 = z94.discriminatedUnion("success", [
115140
- z94.object({
115141
- success: z94.literal(true),
115142
- status: z94.number(),
115143
- data: z94.union([
115144
- z94.record(z94.string(), z94.unknown()),
115145
- z94.array(z94.unknown())
115657
+ var outputSchema96 = z96.discriminatedUnion("success", [
115658
+ z96.object({
115659
+ success: z96.literal(true),
115660
+ status: z96.number(),
115661
+ data: z96.union([
115662
+ z96.record(z96.string(), z96.unknown()),
115663
+ z96.array(z96.unknown())
115146
115664
  ])
115147
115665
  }),
115148
- z94.object({
115149
- success: z94.literal(false),
115150
- error: z94.string()
115666
+ z96.object({
115667
+ success: z96.literal(false),
115668
+ error: z96.string()
115151
115669
  })
115152
115670
  ]);
115153
115671
  var requestTool55 = new ConnectorTool({
@@ -115185,8 +115703,8 @@ Common endpoints:
115185
115703
  Pagination: 1-indexed \`page\` + \`per_page\` (max 100). The \`Link\` response header exposes \`rel="next"\`/\`rel="last"\` URLs.
115186
115704
 
115187
115705
  Rate limits: 5,000 req/hr on REST endpoints, 30 req/min on /search/*. Inspect \`X-RateLimit-Remaining\` to throttle.`,
115188
- inputSchema: inputSchema94,
115189
- outputSchema: outputSchema94,
115706
+ inputSchema: inputSchema96,
115707
+ outputSchema: outputSchema96,
115190
115708
  async execute({ connectionId, method, path: path5, body }, connections) {
115191
115709
  const connection2 = connections.find((c6) => c6.id === connectionId);
115192
115710
  if (!connection2) {
@@ -115199,8 +115717,8 @@ Rate limits: 5,000 req/hr on REST endpoints, 30 req/min on /search/*. Inspect \`
115199
115717
  `[connector-request] github/${connection2.name}: ${method} ${path5}`
115200
115718
  );
115201
115719
  try {
115202
- const token = parameters78.personalAccessToken.getValue(connection2);
115203
- const baseUrl = resolveBaseUrl(parameters78.baseUrl.tryGetValue(connection2));
115720
+ const token = parameters79.personalAccessToken.getValue(connection2);
115721
+ const baseUrl = resolveBaseUrl(parameters79.baseUrl.tryGetValue(connection2));
115204
115722
  const trimmedPath = path5.trim().replace(/^\/+/, "/");
115205
115723
  const url = `${baseUrl}${trimmedPath.startsWith("/") ? "" : "/"}${trimmedPath}`;
115206
115724
  const controller = new AbortController();
@@ -115240,14 +115758,14 @@ Rate limits: 5,000 req/hr on REST endpoints, 30 req/min on /search/*. Inspect \`
115240
115758
  });
115241
115759
 
115242
115760
  // ../connectors/src/connectors/github/index.ts
115243
- var tools78 = { request: requestTool55 };
115761
+ var tools79 = { request: requestTool55 };
115244
115762
  var githubConnector = new ConnectorPlugin({
115245
115763
  slug: "github",
115246
115764
  authType: AUTH_TYPES.PAT,
115247
115765
  name: "GitHub",
115248
115766
  description: "Connect to GitHub for repository, issue, pull request, commit, and search data via Personal Access Token (Classic or fine-grained).",
115249
115767
  iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/2flOAufkhDrLKuOQqEVS3/1f9dcf145680ef77aef149709263e2d4/github-icon.svg",
115250
- parameters: parameters78,
115768
+ parameters: parameters79,
115251
115769
  releaseFlag: { dev1: true, dev2: true, prod: true },
115252
115770
  categories: ["productivity"],
115253
115771
  onboarding: githubOnboarding,
@@ -115467,7 +115985,7 @@ export default async function handler(c: Context) {
115467
115985
  **\u30AF\u30A9\u30FC\u30BF**
115468
115986
  - GET \`/rate_limit\` \u2014 REST / GraphQL / search \u306E\u6B8B\u30EC\u30FC\u30C8\u78BA\u8A8D`
115469
115987
  },
115470
- tools: tools78
115988
+ tools: tools79
115471
115989
  });
115472
115990
 
115473
115991
  // ../connectors/src/connectors/registry.ts
@@ -115545,6 +116063,7 @@ var plugins = {
115545
116063
  clickup: clickupConnector,
115546
116064
  sqlserver: sqlserverConnector,
115547
116065
  azureSql: azureSqlConnector,
116066
+ cosmosdb: cosmosdbConnector,
115548
116067
  oracle: oracleConnector,
115549
116068
  freshservice: freshserviceConnector,
115550
116069
  freshdesk: freshdeskConnector,
@@ -116022,62 +116541,62 @@ function createDbtClient(entry, slug) {
116022
116541
  var { getQuery, loadConnections, reloadEnvFile, watchConnectionsFile } = createConnectorRegistry();
116023
116542
 
116024
116543
  // src/types/server-logic.ts
116025
- import { z as z95 } from "zod";
116026
- var parameterMetaSchema = z95.object({
116027
- name: z95.string(),
116028
- type: z95.enum(["string", "number", "boolean"]),
116029
- description: z95.string(),
116030
- required: z95.boolean().optional(),
116031
- default: z95.union([z95.string(), z95.number(), z95.boolean()]).optional()
116032
- });
116033
- var serverLogicCacheConfigSchema = z95.object({
116034
- ttl: z95.number(),
116035
- staleWhileRevalidate: z95.boolean().optional()
116036
- });
116037
- var serverLogicSchemaObjectSchema = z95.lazy(
116038
- () => z95.object({
116039
- type: z95.enum(["string", "number", "integer", "boolean", "object", "array", "null"]).optional(),
116040
- format: z95.string().optional(),
116041
- description: z95.string().optional(),
116042
- nullable: z95.boolean().optional(),
116043
- enum: z95.array(z95.union([z95.string(), z95.number(), z95.boolean(), z95.null()])).optional(),
116544
+ import { z as z97 } from "zod";
116545
+ var parameterMetaSchema = z97.object({
116546
+ name: z97.string(),
116547
+ type: z97.enum(["string", "number", "boolean"]),
116548
+ description: z97.string(),
116549
+ required: z97.boolean().optional(),
116550
+ default: z97.union([z97.string(), z97.number(), z97.boolean()]).optional()
116551
+ });
116552
+ var serverLogicCacheConfigSchema = z97.object({
116553
+ ttl: z97.number(),
116554
+ staleWhileRevalidate: z97.boolean().optional()
116555
+ });
116556
+ var serverLogicSchemaObjectSchema = z97.lazy(
116557
+ () => z97.object({
116558
+ type: z97.enum(["string", "number", "integer", "boolean", "object", "array", "null"]).optional(),
116559
+ format: z97.string().optional(),
116560
+ description: z97.string().optional(),
116561
+ nullable: z97.boolean().optional(),
116562
+ enum: z97.array(z97.union([z97.string(), z97.number(), z97.boolean(), z97.null()])).optional(),
116044
116563
  items: serverLogicSchemaObjectSchema.optional(),
116045
- properties: z95.record(z95.string(), serverLogicSchemaObjectSchema).optional(),
116046
- required: z95.array(z95.string()).optional(),
116047
- additionalProperties: z95.union([z95.boolean(), serverLogicSchemaObjectSchema]).optional(),
116048
- minimum: z95.number().optional(),
116049
- maximum: z95.number().optional(),
116050
- minLength: z95.number().optional(),
116051
- maxLength: z95.number().optional(),
116052
- pattern: z95.string().optional()
116564
+ properties: z97.record(z97.string(), serverLogicSchemaObjectSchema).optional(),
116565
+ required: z97.array(z97.string()).optional(),
116566
+ additionalProperties: z97.union([z97.boolean(), serverLogicSchemaObjectSchema]).optional(),
116567
+ minimum: z97.number().optional(),
116568
+ maximum: z97.number().optional(),
116569
+ minLength: z97.number().optional(),
116570
+ maxLength: z97.number().optional(),
116571
+ pattern: z97.string().optional()
116053
116572
  })
116054
116573
  );
116055
- var serverLogicMediaTypeSchema = z95.object({
116574
+ var serverLogicMediaTypeSchema = z97.object({
116056
116575
  schema: serverLogicSchemaObjectSchema.optional(),
116057
- example: z95.unknown().optional()
116576
+ example: z97.unknown().optional()
116058
116577
  });
116059
- var serverLogicResponseSchema = z95.object({
116060
- description: z95.string().optional(),
116061
- content: z95.record(z95.string(), serverLogicMediaTypeSchema).optional()
116578
+ var serverLogicResponseSchema = z97.object({
116579
+ description: z97.string().optional(),
116580
+ content: z97.record(z97.string(), serverLogicMediaTypeSchema).optional()
116062
116581
  });
116063
116582
  var jsonBaseFields = {
116064
- description: z95.string(),
116065
- parameters: z95.array(parameterMetaSchema).optional(),
116583
+ description: z97.string(),
116584
+ parameters: z97.array(parameterMetaSchema).optional(),
116066
116585
  response: serverLogicResponseSchema.optional(),
116067
116586
  cache: serverLogicCacheConfigSchema.optional()
116068
116587
  };
116069
- var jsonSqlServerLogicSchema = z95.object({
116588
+ var jsonSqlServerLogicSchema = z97.object({
116070
116589
  ...jsonBaseFields,
116071
- type: z95.literal("sql").optional(),
116072
- query: z95.string(),
116073
- connectionId: z95.string()
116590
+ type: z97.literal("sql").optional(),
116591
+ query: z97.string(),
116592
+ connectionId: z97.string()
116074
116593
  });
116075
- var jsonTypeScriptServerLogicSchema = z95.object({
116594
+ var jsonTypeScriptServerLogicSchema = z97.object({
116076
116595
  ...jsonBaseFields,
116077
- type: z95.literal("typescript"),
116078
- handlerPath: z95.string()
116596
+ type: z97.literal("typescript"),
116597
+ handlerPath: z97.string()
116079
116598
  });
116080
- var anyJsonServerLogicSchema = z95.union([
116599
+ var anyJsonServerLogicSchema = z97.union([
116081
116600
  jsonTypeScriptServerLogicSchema,
116082
116601
  jsonSqlServerLogicSchema
116083
116602
  ]);