@squadbase/vite-server 0.1.6 → 0.1.7-dev.0

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.
@@ -47,7 +47,7 @@ var parameters = {
47
47
  url: new ParameterDefinition({
48
48
  slug: "url",
49
49
  name: "InfluxDB URL",
50
- description: "The base URL of your InfluxDB instance (e.g., 'https://us-east-1-1.aws.cloud2.influxdata.com' for InfluxDB Cloud). Do not include a trailing slash.",
50
+ description: "The base URL of your InfluxDB instance. Do not include a trailing slash. Works with both InfluxDB 2 (e.g., InfluxDB Cloud on '*.cloud2.influxdata.com', OSS 2.x) and InfluxDB 3 (Cloud Serverless, Enterprise, OSS 3.x).",
51
51
  envVarBaseKey: "INFLUXDB_URL",
52
52
  type: "text",
53
53
  secret: false,
@@ -74,7 +74,7 @@ var parameters = {
74
74
  org: new ParameterDefinition({
75
75
  slug: "org",
76
76
  name: "Organization",
77
- description: "The InfluxDB organization name. Required for InfluxDB 2.x Flux queries and writes; optional for InfluxDB 3.",
77
+ description: "The InfluxDB organization name. Required for InfluxDB 2 Flux queries and writes (including InfluxDB Cloud on '*.cloud2.influxdata.com'). Optional for InfluxDB 3 when only using SQL.",
78
78
  envVarBaseKey: "INFLUXDB_ORG",
79
79
  type: "text",
80
80
  secret: false,
@@ -110,12 +110,21 @@ function createClient(params) {
110
110
  return headers;
111
111
  }
112
112
  async function assertOk(res, label) {
113
- if (!res.ok) {
114
- const body = await res.text().catch(() => "(unreadable body)");
115
- throw new Error(
116
- `influxdb ${label}: ${res.status} ${res.statusText} \u2014 ${body}`
117
- );
118
- }
113
+ if (res.ok) return;
114
+ const body = await res.text().catch(() => "(unreadable body)");
115
+ const contentType = res.headers.get("content-type") ?? "";
116
+ const isHtml = contentType.includes("text/html") || body.trimStart().startsWith("<");
117
+ const v3Endpoints = /* @__PURE__ */ new Set([
118
+ "querySql",
119
+ "queryInfluxql",
120
+ "writeLineProtocol"
121
+ ]);
122
+ const looksLikeMissingV3 = (res.status === 405 || res.status === 404 || isHtml) && v3Endpoints.has(label);
123
+ const hint = looksLikeMissingV3 ? " \u2014 This InfluxDB instance does not support the v3 API at this path. It is likely InfluxDB 2 (e.g. InfluxDB Cloud on '*.cloud2.influxdata.com'). Use queryFlux() via '/api/v2/query?org={org}' instead." : isHtml ? " \u2014 Received HTML instead of a JSON/CSV API response; verify the URL points to the InfluxDB API host." : "";
124
+ const snippet = isHtml ? body.replace(/\s+/g, " ").slice(0, 200) : body;
125
+ throw new Error(
126
+ `influxdb ${label}: ${res.status} ${res.statusText}${hint} \u2014 ${snippet}`
127
+ );
119
128
  }
120
129
  return {
121
130
  database,
@@ -345,11 +354,11 @@ var influxdbOnboarding = new ConnectorOnboarding({
345
354
 
346
355
  #### Confirm the Database (or Bucket) Name
347
356
  - InfluxDB 3: use the database name
348
- - InfluxDB 2: use the bucket name (buckets act as databases in the v1/v3 compatibility endpoints)
357
+ - InfluxDB 2 (includes InfluxDB Cloud on \`*.cloud2.influxdata.com\`): use the bucket name (buckets act as databases in the v1/v3 compatibility endpoints)
349
358
 
350
- #### Organization (InfluxDB 2 only)
351
- - If you are on InfluxDB 2, set the Organization parameter to the org that owns the bucket
352
- - For InfluxDB 3 Cloud you can leave Organization blank`,
359
+ #### Organization
360
+ - InfluxDB 2: set the Organization parameter to the org that owns the bucket (required for Flux queries and writes)
361
+ - InfluxDB 3 Cloud Serverless: you can leave Organization blank when only using SQL`,
353
362
  ja: `#### API \u30C8\u30FC\u30AF\u30F3\u306E\u767A\u884C
354
363
  1. InfluxDB Cloud / OSS \u306B\u30B5\u30A4\u30F3\u30A4\u30F3
355
364
  2. Load Data \u2192 API Tokens \u2192 Generate API Token
@@ -358,19 +367,37 @@ var influxdbOnboarding = new ConnectorOnboarding({
358
367
 
359
368
  #### Database (\u307E\u305F\u306F Bucket) \u540D\u306E\u78BA\u8A8D
360
369
  - InfluxDB 3: database \u540D\u3092\u4F7F\u7528
361
- - InfluxDB 2: bucket \u540D\u3092\u4F7F\u7528\uFF08v1/v3 \u4E92\u63DB\u30A8\u30F3\u30C9\u30DD\u30A4\u30F3\u30C8\u3067\u306F bucket \u304C database \u3068\u3057\u3066\u6271\u308F\u308C\u308B\uFF09
370
+ - InfluxDB 2\uFF08\`*.cloud2.influxdata.com\` \u306E InfluxDB Cloud \u3092\u542B\u3080\uFF09: bucket \u540D\u3092\u4F7F\u7528\uFF08v1/v3 \u4E92\u63DB\u30A8\u30F3\u30C9\u30DD\u30A4\u30F3\u30C8\u3067\u306F bucket \u304C database \u3068\u3057\u3066\u6271\u308F\u308C\u308B\uFF09
362
371
 
363
- #### Organization\uFF08InfluxDB 2 \u306E\u307F\uFF09
364
- - InfluxDB 2 \u306E\u5834\u5408\u3001bucket \u3092\u4FDD\u6709\u3059\u308B\u7D44\u7E54\u540D\u3092 Organization \u30D1\u30E9\u30E1\u30FC\u30BF\u306B\u8A2D\u5B9A
365
- - InfluxDB 3 Cloud \u306E\u5834\u5408\u306F\u7A7A\u306E\u307E\u307E\u3067\u554F\u984C\u306A\u3044`
372
+ #### Organization
373
+ - InfluxDB 2: bucket \u3092\u4FDD\u6709\u3059\u308B\u7D44\u7E54\u540D\u3092 Organization \u30D1\u30E9\u30E1\u30FC\u30BF\u306B\u8A2D\u5B9A\uFF08Flux \u30AF\u30A8\u30EA\u3068\u66F8\u304D\u8FBC\u307F\u306B\u306F\u5FC5\u9808\uFF09
374
+ - InfluxDB 3 Cloud Serverless: SQL \u306E\u307F\u3092\u4F7F\u3046\u5834\u5408\u306F\u7A7A\u306E\u307E\u307E\u3067\u554F\u984C\u306A\u3044`
366
375
  },
367
376
  dataOverviewInstructions: {
368
- en: `1. For InfluxDB 3: call influxdb_request with POST /api/v3/query_sql, body { "db": "<database>", "q": "SHOW TABLES" } to list measurements
369
- 2. For InfluxDB 3: inspect a sample measurement with POST /api/v3/query_sql, body { "db": "<database>", "q": "SELECT * FROM <measurement> ORDER BY time DESC LIMIT 5" }
370
- 3. For InfluxDB 2: call influxdb_request with POST /api/v2/query?org=<org>, contentType 'application/vnd.flux', body 'buckets()' to list buckets, then 'from(bucket:"<bucket>") |> range(start: -1h) |> limit(n:5)' to inspect data`,
371
- ja: `1. InfluxDB 3 \u306E\u5834\u5408: influxdb_request \u3067 POST /api/v3/query_sql\u3001body { "db": "<database>", "q": "SHOW TABLES" } \u3092\u5B9F\u884C\u3057 measurement \u4E00\u89A7\u3092\u53D6\u5F97
372
- 2. InfluxDB 3 \u306E\u5834\u5408: POST /api/v3/query_sql\u3001body { "db": "<database>", "q": "SELECT * FROM <measurement> ORDER BY time DESC LIMIT 5" } \u3067\u4EE3\u8868\u7684\u306A measurement \u306E\u69CB\u9020\u3092\u78BA\u8A8D
373
- 3. InfluxDB 2 \u306E\u5834\u5408: POST /api/v2/query?org=<org>\u3001contentType 'application/vnd.flux'\u3001body 'buckets()' \u3067 bucket \u4E00\u89A7\u3092\u53D6\u5F97\u3057\u3001\u7D9A\u3044\u3066 'from(bucket:"<bucket>") |> range(start: -1h) |> limit(n:5)' \u3067\u30C7\u30FC\u30BF\u3092\u78BA\u8A8D`
377
+ en: `The instance may be either InfluxDB 3 (supports SQL) or InfluxDB 2 (Flux only; includes InfluxDB Cloud on '*.cloud2.influxdata.com'). Detect the variant first, then pick the matching endpoints.
378
+
379
+ 1. Probe for InfluxDB 3: call influxdb_request with POST /api/v3/query_sql, body { "db": "<database>", "q": "SELECT 1" }
380
+ - 200 with JSON rows \u2192 InfluxDB 3. Continue with SQL.
381
+ - 405 Method Not Allowed, or an HTML body like "<html>...405 Not Allowed..." \u2192 InfluxDB 2. Fall back to Flux (step 3).
382
+ 2. InfluxDB 3 data overview:
383
+ a. POST /api/v3/query_sql, body { "db": "<database>", "q": "SHOW TABLES" } to list measurements
384
+ b. POST /api/v3/query_sql, body { "db": "<database>", "q": "SELECT * FROM <measurement> ORDER BY time DESC LIMIT 5" } to inspect a sample
385
+ 3. InfluxDB 2 data overview (Organization parameter required):
386
+ a. POST /api/v2/query?org=<org>, contentType 'application/vnd.flux', body 'buckets()' to list buckets
387
+ b. POST /api/v2/query?org=<org>, contentType 'application/vnd.flux', body 'from(bucket:"<bucket>") |> range(start: -1h) |> limit(n:5)' to inspect data
388
+ - If the Organization parameter was not provided but v3 probing failed, ask the user to set it using updateConnectionParameters before continuing.`,
389
+ ja: `\u63A5\u7D9A\u5148\u306F InfluxDB 3\uFF08SQL \u5BFE\u5FDC\uFF09\u3068 InfluxDB 2\uFF08Flux \u306E\u307F\u3002\`*.cloud2.influxdata.com\` \u306E InfluxDB Cloud \u3092\u542B\u3080\uFF09\u306E\u3069\u3061\u3089\u306E\u53EF\u80FD\u6027\u3082\u3042\u308A\u307E\u3059\u3002\u307E\u305A\u30D0\u30EA\u30A2\u30F3\u30C8\u3092\u5224\u5225\u3057\u3001\u305D\u308C\u306B\u5408\u3046\u30A8\u30F3\u30C9\u30DD\u30A4\u30F3\u30C8\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044\u3002
390
+
391
+ 1. InfluxDB 3 \u306E\u5224\u5225: influxdb_request \u3067 POST /api/v3/query_sql\u3001body { "db": "<database>", "q": "SELECT 1" } \u3092\u5B9F\u884C
392
+ - 200 + JSON \u884C\u304C\u8FD4\u308B \u2192 InfluxDB 3\u3002\u305D\u306E\u307E\u307E SQL \u3067\u7D9A\u884C\u3002
393
+ - 405 Method Not Allowed\u3001\u307E\u305F\u306F "<html>...405 Not Allowed..." \u306E\u3088\u3046\u306A HTML \u672C\u6587\u304C\u8FD4\u308B \u2192 InfluxDB 2\u3002Flux \u306B\u30D5\u30A9\u30FC\u30EB\u30D0\u30C3\u30AF\uFF08\u624B\u9806 3\uFF09\u3002
394
+ 2. InfluxDB 3 \u306E\u5834\u5408\u306E\u30C7\u30FC\u30BF\u6982\u8981:
395
+ a. POST /api/v3/query_sql\u3001body { "db": "<database>", "q": "SHOW TABLES" } \u3067 measurement \u4E00\u89A7\u3092\u53D6\u5F97
396
+ b. POST /api/v3/query_sql\u3001body { "db": "<database>", "q": "SELECT * FROM <measurement> ORDER BY time DESC LIMIT 5" } \u3067\u4EE3\u8868\u7684\u306A measurement \u3092\u78BA\u8A8D
397
+ 3. InfluxDB 2 \u306E\u5834\u5408\u306E\u30C7\u30FC\u30BF\u6982\u8981\uFF08Organization \u30D1\u30E9\u30E1\u30FC\u30BF\u5FC5\u9808\uFF09:
398
+ a. POST /api/v2/query?org=<org>\u3001contentType 'application/vnd.flux'\u3001body 'buckets()' \u3067 bucket \u4E00\u89A7\u3092\u53D6\u5F97
399
+ b. POST /api/v2/query?org=<org>\u3001contentType 'application/vnd.flux'\u3001body 'from(bucket:"<bucket>") |> range(start: -1h) |> limit(n:5)' \u3067\u30C7\u30FC\u30BF\u3092\u78BA\u8A8D
400
+ - Organization \u30D1\u30E9\u30E1\u30FC\u30BF\u304C\u672A\u8A2D\u5B9A\u3067 v3 \u5224\u5225\u3082\u5931\u6557\u3057\u305F\u5834\u5408\u306F\u3001updateConnectionParameters \u3067\u30E6\u30FC\u30B6\u30FC\u306B\u8A2D\u5B9A\u3092\u4FC3\u3057\u3066\u304B\u3089\u7D9A\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002`
374
401
  }
375
402
  });
376
403
 
@@ -458,10 +485,17 @@ For read-only data exploration prefer SQL (InfluxDB 3) or InfluxQL queries \u201
458
485
  }
459
486
  if (!response.ok) {
460
487
  let errorMessage = `HTTP ${response.status} ${response.statusText}`;
488
+ const bodyText = typeof data === "string" ? data : void 0;
489
+ const isHtml = resContentType.includes("text/html") || bodyText !== void 0 && bodyText.trimStart().startsWith("<");
461
490
  if (data && typeof data === "object" && !Array.isArray(data) && typeof data.message === "string") {
462
491
  errorMessage = data.message;
463
- } else if (typeof data === "string" && data) {
464
- errorMessage = data;
492
+ } else if (bodyText) {
493
+ errorMessage = isHtml ? bodyText.replace(/\s+/g, " ").slice(0, 200) : bodyText;
494
+ }
495
+ const hitsV3Path = path2.includes("/api/v3/");
496
+ const looksLikeMissingV3 = hitsV3Path && (response.status === 405 || response.status === 404 || isHtml);
497
+ if (looksLikeMissingV3) {
498
+ errorMessage += " \u2014 This InfluxDB instance does not support the v3 API at this path. It is likely InfluxDB 2 (e.g. InfluxDB Cloud on '*.cloud2.influxdata.com'). Retry via Flux on '/api/v2/query?org={org}' with contentType 'application/vnd.flux'.";
465
499
  }
466
500
  return { success: false, error: errorMessage };
467
501
  }
@@ -483,14 +517,22 @@ var influxdbConnector = new ConnectorPlugin({
483
517
  authType: AUTH_TYPES.API_KEY,
484
518
  name: "InfluxDB",
485
519
  description: "Connect to InfluxDB (Cloud or OSS) to query time-series data with SQL, InfluxQL, or Flux and to write line protocol.",
486
- iconUrl: "https://upload.wikimedia.org/wikipedia/commons/b/b2/Influxdb_logo.svg",
520
+ iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/J1JauVRNmahSVTVrpPfQK/18350d8d3f2dc3be25e8e36ee52914a0/influxdb.png",
487
521
  parameters,
488
522
  releaseFlag: { dev1: true, dev2: false, prod: false },
489
523
  onboarding: influxdbOnboarding,
490
524
  systemPrompt: {
491
- en: `### Tools
525
+ en: `### Variant Detection
492
526
 
493
- - \`influxdb_request\`: The only way to call the InfluxDB HTTP API. Use it to run SQL / InfluxQL / Flux queries, write line protocol, and inspect buckets / databases. Authentication (\`Authorization: Token {token}\`) and the instance URL are configured automatically. For InfluxDB 3 prefer SQL (\`POST /api/v3/query_sql\`) \u2014 it returns JSON rows that are directly usable. For InfluxDB 2 use Flux (\`POST /api/v2/query?org={org}\`) \u2014 the response is annotated CSV. Writes use \`POST /api/v3/write_lp?db={db}\` (v3) or \`POST /api/v2/write?org={org}&bucket={bucket}\` (v2) with a line-protocol body and \`contentType\` set to \`text/plain; charset=utf-8\`.
527
+ The configured instance may be **InfluxDB 3** (supports SQL via \`/api/v3/query_sql\`) or **InfluxDB 2** (Flux only; includes InfluxDB Cloud on \`*.cloud2.influxdata.com\`). Always probe first, then use the matching endpoints:
528
+
529
+ 1. Call \`influxdb_request\` POST \`/api/v3/query_sql\` with body \`{ "db": "<database>", "q": "SELECT 1" }\`
530
+ 2. 200 + JSON rows \u2192 InfluxDB 3. Use SQL endpoints.
531
+ 3. 405 Method Not Allowed or HTML body (e.g. \`<html>...405 Not Allowed...</html>\`) \u2192 InfluxDB 2. Use Flux via \`/api/v2/query?org={org}\`. Require the \`org\` parameter; if missing, ask the user via \`updateConnectionParameters\`.
532
+
533
+ ### Tools
534
+
535
+ - \`influxdb_request\`: The only way to call the InfluxDB HTTP API. Use it to run SQL / InfluxQL / Flux queries, write line protocol, and inspect buckets / databases. Authentication (\`Authorization: Token {token}\`) and the instance URL are configured automatically. On InfluxDB 3 prefer SQL (\`POST /api/v3/query_sql\`) \u2014 it returns JSON rows that are directly usable. On InfluxDB 2 use Flux (\`POST /api/v2/query?org={org}\`) \u2014 the response is annotated CSV. Writes use \`POST /api/v3/write_lp?db={db}\` (v3) or \`POST /api/v2/write?org={org}&bucket={bucket}\` (v2) with a line-protocol body and \`contentType\` set to \`text/plain; charset=utf-8\`.
494
536
 
495
537
  ### Business Logic
496
538
 
@@ -551,7 +593,15 @@ export default async function handler(c: Context) {
551
593
  - Time filtering uses standard SQL \`time\` column comparisons (\`time >= now() - INTERVAL '...' \`)
552
594
  - Aggregates: \`AVG\`, \`SUM\`, \`MIN\`, \`MAX\`, \`COUNT\`; bucket time with \`date_bin('5 minutes', time)\`
553
595
  - List measurements: \`SHOW TABLES\`; list columns: \`SHOW COLUMNS FROM <measurement>\``,
554
- ja: `### \u30C4\u30FC\u30EB
596
+ ja: `### \u30D0\u30EA\u30A2\u30F3\u30C8\u5224\u5225
597
+
598
+ \u63A5\u7D9A\u5148\u306F **InfluxDB 3**\uFF08\`/api/v3/query_sql\` \u306E SQL \u5BFE\u5FDC\uFF09\u3068 **InfluxDB 2**\uFF08Flux \u306E\u307F\u3002\`*.cloud2.influxdata.com\` \u306E InfluxDB Cloud \u3092\u542B\u3080\uFF09\u306E\u3069\u3061\u3089\u306E\u53EF\u80FD\u6027\u3082\u3042\u308A\u307E\u3059\u3002\u5FC5\u305A\u6700\u521D\u306B\u30D7\u30ED\u30FC\u30D6\u3057\u3066\u304B\u3089\u3001\u5BFE\u5FDC\u3059\u308B\u30A8\u30F3\u30C9\u30DD\u30A4\u30F3\u30C8\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044:
599
+
600
+ 1. \`influxdb_request\` \u3067 POST \`/api/v3/query_sql\`\u3001body \`{ "db": "<database>", "q": "SELECT 1" }\` \u3092\u547C\u3073\u51FA\u3059
601
+ 2. 200 + JSON \u884C \u2192 InfluxDB 3\u3002SQL \u30A8\u30F3\u30C9\u30DD\u30A4\u30F3\u30C8\u3092\u4F7F\u7528\u3002
602
+ 3. 405 Method Not Allowed\u3001\u307E\u305F\u306F HTML \u672C\u6587\uFF08\u4F8B: \`<html>...405 Not Allowed...</html>\`\uFF09\u2192 InfluxDB 2\u3002\`/api/v2/query?org={org}\` \u304B\u3089 Flux \u3092\u4F7F\u7528\u3002\`org\` \u30D1\u30E9\u30E1\u30FC\u30BF\u5FC5\u9808\u3002\u672A\u8A2D\u5B9A\u306A\u3089 \`updateConnectionParameters\` \u3067\u30E6\u30FC\u30B6\u30FC\u306B\u8A2D\u5B9A\u3092\u4F9D\u983C\u3059\u308B\u3002
603
+
604
+ ### \u30C4\u30FC\u30EB
555
605
 
556
606
  - \`influxdb_request\`: InfluxDB HTTP API \u3092\u547C\u3073\u51FA\u3059\u552F\u4E00\u306E\u624B\u6BB5\u3067\u3059\u3002SQL / InfluxQL / Flux \u30AF\u30A8\u30EA\u306E\u5B9F\u884C\u3001line protocol \u66F8\u304D\u8FBC\u307F\u3001bucket / database \u306E\u78BA\u8A8D\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002\u8A8D\u8A3C\uFF08\`Authorization: Token {token}\`\uFF09\u3068 instance URL \u306F\u81EA\u52D5\u3067\u8A2D\u5B9A\u3055\u308C\u307E\u3059\u3002InfluxDB 3 \u3067\u306F SQL (\`POST /api/v3/query_sql\`) \u304C JSON \u884C\u3092\u8FD4\u3059\u305F\u3081\u6700\u3082\u6271\u3044\u3084\u3059\u3044\u3067\u3059\u3002InfluxDB 2 \u3067\u306F Flux (\`POST /api/v2/query?org={org}\`) \u3092\u4F7F\u7528\u3057\u3001\u30EC\u30B9\u30DD\u30F3\u30B9\u306F\u6CE8\u91C8\u4ED8\u304D CSV \u3067\u3059\u3002\u66F8\u304D\u8FBC\u307F\u306F \`POST /api/v3/write_lp?db={db}\` (v3) \u307E\u305F\u306F \`POST /api/v2/write?org={org}&bucket={bucket}\` (v2) \u306B line protocol \u3092\u9001\u308A\u307E\u3059\uFF08\`contentType\` \u306F \`text/plain; charset=utf-8\`\uFF09\u3002
557
607
 
@@ -615,7 +665,47 @@ export default async function handler(c: Context) {
615
665
  - \u96C6\u8A08: \`AVG\`, \`SUM\`, \`MIN\`, \`MAX\`, \`COUNT\`\u3002\u6642\u9593\u30D0\u30B1\u30C3\u30C8: \`date_bin('5 minutes', time)\`
616
666
  - measurement \u4E00\u89A7: \`SHOW TABLES\`\u3001\u5217\u4E00\u89A7: \`SHOW COLUMNS FROM <measurement>\``
617
667
  },
618
- tools
668
+ tools,
669
+ async checkConnection(params) {
670
+ const url = (params.url ?? "").replace(/\/$/, "");
671
+ const token = params.token;
672
+ if (!url) {
673
+ return { success: false, error: "InfluxDB URL is not configured" };
674
+ }
675
+ if (!token) {
676
+ return { success: false, error: "API Token is not configured" };
677
+ }
678
+ try {
679
+ const res = await fetch(`${url}/api/v2/orgs`, {
680
+ method: "GET",
681
+ headers: {
682
+ Authorization: `Token ${token}`,
683
+ Accept: "application/json"
684
+ }
685
+ });
686
+ if (res.status === 401 || res.status === 403) {
687
+ return {
688
+ success: false,
689
+ error: `Authentication failed (HTTP ${res.status}). Check the API token and its permissions.`
690
+ };
691
+ }
692
+ if (!res.ok) {
693
+ const body = await res.text().catch(() => res.statusText);
694
+ const snippet = body.replace(/\s+/g, " ").slice(0, 200);
695
+ return {
696
+ success: false,
697
+ error: `Connection check failed: HTTP ${res.status} ${res.statusText} \u2014 ${snippet}`
698
+ };
699
+ }
700
+ return { success: true };
701
+ } catch (error) {
702
+ const message = error instanceof Error ? error.message : String(error);
703
+ return {
704
+ success: false,
705
+ error: `Failed to reach InfluxDB at ${url}: ${message}`
706
+ };
707
+ }
708
+ }
619
709
  });
620
710
 
621
711
  // src/connectors/create-connector-sdk.ts
@@ -47,7 +47,7 @@ var parameters = {
47
47
  organizationSlug: new ParameterDefinition({
48
48
  slug: "organization-slug",
49
49
  name: "Sentry Organization Slug",
50
- description: "The slug of your Sentry organization (e.g., 'my-org'). Found in your Sentry URL: https://sentry.io/organizations/{slug}/",
50
+ description: "The slug of your Sentry organization (e.g., 'my-org'). Found in your Sentry URL: https://{slug}.sentry.io/",
51
51
  envVarBaseKey: "SENTRY_ORGANIZATION_SLUG",
52
52
  type: "text",
53
53
  secret: false,
@@ -82,6 +82,7 @@ async function fetchAccessToken(storeDomain, clientId, clientSecret) {
82
82
  method: "POST",
83
83
  headers: { "Content-Type": "application/json" },
84
84
  body: JSON.stringify({
85
+ grant_type: "client_credentials",
85
86
  client_id: clientId,
86
87
  client_secret: clientSecret
87
88
  })
@@ -495,6 +496,7 @@ Use this tool for all Shopify API interactions: listing products, orders, custom
495
496
  method: "POST",
496
497
  headers: { "Content-Type": "application/json" },
497
498
  body: JSON.stringify({
499
+ grant_type: "client_credentials",
498
500
  client_id: clientId,
499
501
  client_secret: clientSecret
500
502
  })