@squadbase/vite-server 0.1.6 → 0.1.7-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/index.js +238 -147
- package/dist/connectors/google-sheets.js +95 -138
- package/dist/connectors/influxdb.js +119 -29
- package/dist/connectors/sentry.js +1 -1
- package/dist/connectors/shopify.js +2 -0
- package/dist/index.js +238 -147
- package/dist/main.js +238 -147
- package/dist/vite-plugin.js +238 -147
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -72669,19 +72669,6 @@ await drive.updateFile("fileId123", {}, "newFolderId", "oldFolderId");
|
|
|
72669
72669
|
}
|
|
72670
72670
|
});
|
|
72671
72671
|
|
|
72672
|
-
// ../connectors/src/connectors/google-sheets/setup.ts
|
|
72673
|
-
var googleSheetsOnboarding = new ConnectorOnboarding({
|
|
72674
|
-
dataOverviewInstructions: {
|
|
72675
|
-
en: `1. Create a new spreadsheet with google-sheets-oauth_request (POST with body { properties: { title: "..." } }) or use an existing spreadsheet ID.
|
|
72676
|
-
2. Call google-sheets-oauth_request with GET /{spreadsheetId} to fetch spreadsheet metadata (sheet names and properties).`,
|
|
72677
|
-
ja: `1. google-sheets-oauth_request \u3092 POST\uFF08Body: { properties: { title: "..." } }\uFF09\u3067\u547C\u3073\u51FA\u3057\u3066\u65B0\u3057\u3044\u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8\u3092\u4F5C\u6210\u3059\u308B\u304B\u3001\u65E2\u5B58\u306E\u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8ID\u3092\u5229\u7528\u3057\u307E\u3059\u3002
|
|
72678
|
-
2. google-sheets-oauth_request \u3067 GET /{spreadsheetId} \u3092\u547C\u3073\u51FA\u3057\u3001\u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8\u306E\u30E1\u30BF\u30C7\u30FC\u30BF\uFF08\u30B7\u30FC\u30C8\u540D\u3068\u30D7\u30ED\u30D1\u30C6\u30A3\uFF09\u3092\u53D6\u5F97\u3057\u307E\u3059\u3002`
|
|
72679
|
-
}
|
|
72680
|
-
});
|
|
72681
|
-
|
|
72682
|
-
// ../connectors/src/connectors/google-sheets/parameters.ts
|
|
72683
|
-
var parameters18 = {};
|
|
72684
|
-
|
|
72685
72672
|
// ../connectors/src/connectors/google-sheets/tools/request.ts
|
|
72686
72673
|
import { z as z27 } from "zod";
|
|
72687
72674
|
var SHEETS_BASE_URL = "https://sheets.googleapis.com/v4/spreadsheets";
|
|
@@ -72722,11 +72709,10 @@ var inputSchema27 = z27.object({
|
|
|
72722
72709
|
"Brief description of what you intend to accomplish with this tool call"
|
|
72723
72710
|
),
|
|
72724
72711
|
connectionId: z27.string().describe("ID of the Google Sheets connection to use"),
|
|
72725
|
-
method: z27.enum(["GET"
|
|
72712
|
+
method: z27.enum(["GET"]).describe("HTTP method. Only GET is supported (read-only analysis)."),
|
|
72726
72713
|
path: z27.string().describe(
|
|
72727
|
-
"API path appended to https://sheets.googleapis.com/v4/spreadsheets (e.g., '
|
|
72714
|
+
"API path appended to https://sheets.googleapis.com/v4/spreadsheets (e.g., '/{spreadsheetId}', '/{spreadsheetId}/values/Sheet1!A1:D10'). The `{spreadsheetId}` placeholder is automatically replaced with the connection's configured spreadsheet ID."
|
|
72728
72715
|
),
|
|
72729
|
-
body: z27.record(z27.string(), z27.unknown()).optional().describe("JSON request body for POST/PUT requests"),
|
|
72730
72716
|
queryParams: z27.record(z27.string(), z27.string()).optional().describe("Query parameters to append to the URL")
|
|
72731
72717
|
});
|
|
72732
72718
|
var outputSchema27 = z27.discriminatedUnion("success", [
|
|
@@ -72742,12 +72728,12 @@ var outputSchema27 = z27.discriminatedUnion("success", [
|
|
|
72742
72728
|
]);
|
|
72743
72729
|
var requestTool9 = new ConnectorTool({
|
|
72744
72730
|
name: "request",
|
|
72745
|
-
description: `Send authenticated requests to the Google Sheets API v4.
|
|
72746
|
-
|
|
72731
|
+
description: `Send authenticated GET requests to the Google Sheets API v4 for read-only analysis.
|
|
72732
|
+
The \`{spreadsheetId}\` placeholder in the path is automatically replaced with the connection's configured spreadsheet ID.
|
|
72747
72733
|
Authentication is handled automatically via OAuth proxy.`,
|
|
72748
72734
|
inputSchema: inputSchema27,
|
|
72749
72735
|
outputSchema: outputSchema27,
|
|
72750
|
-
async execute({ connectionId, method, path: path5,
|
|
72736
|
+
async execute({ connectionId, method, path: path5, queryParams }, connections, config) {
|
|
72751
72737
|
const connection2 = connections.find((c6) => c6.id === connectionId);
|
|
72752
72738
|
if (!connection2) {
|
|
72753
72739
|
return {
|
|
@@ -72777,8 +72763,7 @@ Authentication is handled automatically via OAuth proxy.`,
|
|
|
72777
72763
|
},
|
|
72778
72764
|
body: JSON.stringify({
|
|
72779
72765
|
url,
|
|
72780
|
-
method
|
|
72781
|
-
...body != null ? { body: JSON.stringify(body) } : {}
|
|
72766
|
+
method
|
|
72782
72767
|
}),
|
|
72783
72768
|
signal: controller.signal
|
|
72784
72769
|
});
|
|
@@ -72798,13 +72783,69 @@ Authentication is handled automatically via OAuth proxy.`,
|
|
|
72798
72783
|
}
|
|
72799
72784
|
});
|
|
72800
72785
|
|
|
72786
|
+
// ../connectors/src/connectors/google-sheets/setup.ts
|
|
72787
|
+
var requestToolName = `google-sheets-oauth_${requestTool9.name}`;
|
|
72788
|
+
var googleSheetsOnboarding = new ConnectorOnboarding({
|
|
72789
|
+
connectionSetupInstructions: {
|
|
72790
|
+
ja: `\u4EE5\u4E0B\u306E\u624B\u9806\u3067Google Sheets (OAuth) \u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\u306E\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u3092\u884C\u3063\u3066\u304F\u3060\u3055\u3044\u3002\u5206\u6790\u5BFE\u8C61\u306E\u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8\u306F\u30E6\u30FC\u30B6\u30FC\u304B\u3089\u53D7\u3051\u53D6\u3063\u305FURL\u3067\u6307\u5B9A\u3057\u307E\u3059\uFF08\u65B0\u3057\u3044\u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8\u306F\u4F5C\u6210\u3057\u307E\u305B\u3093\uFF09\u3002
|
|
72791
|
+
|
|
72792
|
+
1. \`askUserQuestion\` \u3067\u5206\u6790\u5BFE\u8C61\u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8\u306EURL\u3092\u30D2\u30A2\u30EA\u30F3\u30B0\u3059\u308B:
|
|
72793
|
+
- \`type\`: \`"freeText"\`
|
|
72794
|
+
- \`question\`: \u300C\u5206\u6790\u3057\u305F\u3044Google Sheets\u306EURL\u3092\u8CBC\u308A\u4ED8\u3051\u3066\u304F\u3060\u3055\u3044\u300D
|
|
72795
|
+
- \`placeholder\`: \`"https://docs.google.com/spreadsheets/d/.../edit"\`
|
|
72796
|
+
2. \u53D7\u3051\u53D6\u3063\u305FURL\u304B\u3089\u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8ID\u3092\u62BD\u51FA\u3059\u308B\u3002URL\u306E \`/d/\` \u3068 \`/edit\`\uFF08\u307E\u305F\u306F\u672B\u5C3E\uFF09\u306E\u9593\u306B\u3042\u308B\u6587\u5B57\u5217\u304C\u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8ID\u3067\u3059\uFF08\u4F8B: \`https://docs.google.com/spreadsheets/d/1AbCxyz.../edit\` \u2192 \`1AbCxyz...\`\uFF09\u3002URL\u3067\u306F\u306A\u304FID\u3060\u3051\u304C\u6E21\u3055\u308C\u305F\u5834\u5408\u306F\u305D\u306E\u307E\u307E\u5229\u7528\u3057\u307E\u3059\u3002
|
|
72797
|
+
3. \u62BD\u51FA\u3057\u305FID\u3092 \`updateConnectionParameters\` \u3067\u4FDD\u5B58\u3059\u308B:
|
|
72798
|
+
- \`parameterSlug\`: \`"spreadsheet-id"\`
|
|
72799
|
+
- \`options\`: \`[{ value: <\u62BD\u51FA\u3057\u305FID>, label: <\u540C\u3058\u5024> }]\`\uFF081\u4EF6\u306E\u307F\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u81EA\u52D5\u9078\u629E\u3055\u308C\u308B\uFF09
|
|
72800
|
+
4. \`${requestToolName}\` \u3067\u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8\u306B\u30A2\u30AF\u30BB\u30B9\u3067\u304D\u308B\u3053\u3068\u3092\u78BA\u8A8D\u3059\u308B:
|
|
72801
|
+
- \`method\`: \`"GET"\`
|
|
72802
|
+
- \`path\`: \`"/{spreadsheetId}"\`
|
|
72803
|
+
5. \u30A8\u30E9\u30FC\u304C\u8FD4\u3055\u308C\u305F\u5834\u5408\u3001\u4EE5\u4E0B\u3092\u78BA\u8A8D\u3059\u308B\u3088\u3046\u30E6\u30FC\u30B6\u30FC\u306B\u4F1D\u3048\u308B:
|
|
72804
|
+
- OAuth\u3067\u63A5\u7D9A\u3057\u305FGoogle\u30A2\u30AB\u30A6\u30F3\u30C8\u304C\u305D\u306E\u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8\u306B\u95B2\u89A7\u6A29\u9650\u3092\u6301\u3063\u3066\u3044\u308B\u304B
|
|
72805
|
+
- \u5165\u529B\u3055\u308C\u305FURL\u304C\u6B63\u3057\u3044\u304B
|
|
72806
|
+
|
|
72807
|
+
#### \u5236\u7D04
|
|
72808
|
+
- **\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u4E2D\u306B\u30BB\u30EB\u5024\u3092\u5927\u91CF\u306B\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
|
|
72809
|
+
- \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`,
|
|
72810
|
+
en: `Follow these steps to set up the Google Sheets (OAuth) connection. The spreadsheet to analyze is specified by the URL provided by the user (no new spreadsheet is created).
|
|
72811
|
+
|
|
72812
|
+
1. Call \`askUserQuestion\` to ask for the spreadsheet URL to analyze:
|
|
72813
|
+
- \`type\`: \`"freeText"\`
|
|
72814
|
+
- \`question\`: "Please paste the URL of the Google Sheet you want to analyze"
|
|
72815
|
+
- \`placeholder\`: \`"https://docs.google.com/spreadsheets/d/.../edit"\`
|
|
72816
|
+
2. Extract the spreadsheet ID from the URL. It is the segment between \`/d/\` and \`/edit\` (or the end of the URL), e.g. \`https://docs.google.com/spreadsheets/d/1AbCxyz.../edit\` \u2192 \`1AbCxyz...\`. If the user pasted just the ID, use it as-is.
|
|
72817
|
+
3. Save the extracted ID via \`updateConnectionParameters\`:
|
|
72818
|
+
- \`parameterSlug\`: \`"spreadsheet-id"\`
|
|
72819
|
+
- \`options\`: \`[{ value: <extracted ID>, label: <same value> }]\` (a single option is auto-selected)
|
|
72820
|
+
4. Verify access by calling \`${requestToolName}\`:
|
|
72821
|
+
- \`method\`: \`"GET"\`
|
|
72822
|
+
- \`path\`: \`"/{spreadsheetId}"\`
|
|
72823
|
+
5. If an error is returned, ask the user to verify:
|
|
72824
|
+
- The OAuthed Google account has read access to the spreadsheet
|
|
72825
|
+
- The URL they entered is correct
|
|
72826
|
+
|
|
72827
|
+
#### Constraints
|
|
72828
|
+
- **Do NOT read large amounts of cell data during setup**. Only the metadata request specified above is allowed
|
|
72829
|
+
- Write only 1 sentence between tool calls, then immediately call the next tool. Skip unnecessary explanations and proceed efficiently`
|
|
72830
|
+
},
|
|
72831
|
+
dataOverviewInstructions: {
|
|
72832
|
+
en: `1. Call ${requestToolName} with GET /{spreadsheetId} to fetch spreadsheet metadata (sheet names, grid properties)
|
|
72833
|
+
2. For each sheet of interest, call ${requestToolName} with GET /{spreadsheetId}/values/{SheetName}!A1:Z5 to sample the first rows and understand the column layout`,
|
|
72834
|
+
ja: `1. ${requestToolName} \u3067 GET /{spreadsheetId} \u3092\u547C\u3073\u51FA\u3057\u3001\u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8\u306E\u30E1\u30BF\u30C7\u30FC\u30BF\uFF08\u30B7\u30FC\u30C8\u540D\u3001\u30B0\u30EA\u30C3\u30C9\u30D7\u30ED\u30D1\u30C6\u30A3\uFF09\u3092\u53D6\u5F97
|
|
72835
|
+
2. \u4E3B\u8981\u306A\u30B7\u30FC\u30C8\u306B\u3064\u3044\u3066 ${requestToolName} \u3067 GET /{spreadsheetId}/values/{\u30B7\u30FC\u30C8\u540D}!A1:Z5 \u3092\u547C\u3073\u51FA\u3057\u3001\u5148\u982D\u6570\u884C\u3092\u30B5\u30F3\u30D7\u30EA\u30F3\u30B0\u3057\u3066\u30AB\u30E9\u30E0\u69CB\u9020\u3092\u628A\u63E1`
|
|
72836
|
+
}
|
|
72837
|
+
});
|
|
72838
|
+
|
|
72839
|
+
// ../connectors/src/connectors/google-sheets/parameters.ts
|
|
72840
|
+
var parameters18 = {};
|
|
72841
|
+
|
|
72801
72842
|
// ../connectors/src/connectors/google-sheets/index.ts
|
|
72802
72843
|
var tools18 = { request: requestTool9 };
|
|
72803
72844
|
var googleSheetsConnector = new ConnectorPlugin({
|
|
72804
72845
|
slug: "google-sheets",
|
|
72805
72846
|
authType: AUTH_TYPES.OAUTH,
|
|
72806
72847
|
name: "Google Sheets",
|
|
72807
|
-
description: "Connect to Google Sheets for
|
|
72848
|
+
description: "Connect to an existing Google Sheets spreadsheet for read-only data analysis using OAuth.",
|
|
72808
72849
|
iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/1UPQuggyiZmbb26CuaSr2h/032770e8739b183fa00b7625f024e536/google-sheets.svg",
|
|
72809
72850
|
parameters: parameters18,
|
|
72810
72851
|
releaseFlag: { dev1: true, dev2: false, prod: false },
|
|
@@ -72813,30 +72854,25 @@ var googleSheetsConnector = new ConnectorPlugin({
|
|
|
72813
72854
|
allowlist: [
|
|
72814
72855
|
{
|
|
72815
72856
|
host: "sheets.googleapis.com",
|
|
72816
|
-
methods: ["GET"
|
|
72857
|
+
methods: ["GET"]
|
|
72817
72858
|
}
|
|
72818
72859
|
]
|
|
72819
72860
|
},
|
|
72820
72861
|
systemPrompt: {
|
|
72821
72862
|
en: `### Tools (setup-time only)
|
|
72822
72863
|
|
|
72823
|
-
- \`google-sheets-oauth_request\`: Call the Google Sheets API during setup / data overview.
|
|
72864
|
+
- \`google-sheets-oauth_request\`: Call the Google Sheets API during setup / data overview. Read-only (GET only). Use it to fetch spreadsheet metadata and sample cell values. The \`{spreadsheetId}\` placeholder in the path is automatically replaced with the spreadsheet configured at setup time. Authentication is configured automatically via OAuth.
|
|
72824
72865
|
|
|
72825
72866
|
> **Important**: The \`google-sheets-oauth_request\` tool is only available at setup time. Inside server-logic handlers, use the SDK (\`connection(id).getValues\`, etc.) \u2014 the SDK's fetch is already wired through the OAuth proxy. **Do NOT** hand-roll HTTP calls to \`_sqcore/connections/*/request\` from a handler.
|
|
72826
72867
|
|
|
72827
|
-
|
|
72868
|
+
> **Connection scope**: Each connection is bound to a single spreadsheet selected at setup time via URL. This connector does NOT create new spreadsheets and does NOT write to spreadsheets. The OAuth scope is \`spreadsheets.readonly\`.
|
|
72869
|
+
|
|
72870
|
+
### Google Sheets API Reference (read-only)
|
|
72828
72871
|
|
|
72829
|
-
#### Read Endpoints
|
|
72830
72872
|
- GET \`/{spreadsheetId}\` \u2014 Get spreadsheet metadata (title, sheets, properties)
|
|
72831
72873
|
- GET \`/{spreadsheetId}/values/{range}\` \u2014 Get cell values for a range
|
|
72832
72874
|
- GET \`/{spreadsheetId}/values:batchGet?ranges={range1}&ranges={range2}\` \u2014 Get values for multiple ranges
|
|
72833
72875
|
|
|
72834
|
-
#### Write Endpoints
|
|
72835
|
-
- POST \`\` (empty path, with body) \u2014 Create a new spreadsheet. Body: \`{ "properties": { "title": "My Sheet" }, "sheets": [{ "properties": { "title": "Sheet1" } }] }\`
|
|
72836
|
-
- PUT \`/{spreadsheetId}/values/{range}?valueInputOption=USER_ENTERED\` \u2014 Update cell values for a range. Body: \`{ "range": "Sheet1!A1:B2", "majorDimension": "ROWS", "values": [["a","b"],["c","d"]] }\`
|
|
72837
|
-
- POST \`/{spreadsheetId}/values/{range}:append?valueInputOption=USER_ENTERED&insertDataOption=INSERT_ROWS\` \u2014 Append rows after the last row. Body: \`{ "range": "Sheet1!A1", "majorDimension": "ROWS", "values": [["a","b"]] }\`
|
|
72838
|
-
- POST \`/{spreadsheetId}:batchUpdate\` \u2014 Apply multiple updates (formatting, add sheets, merge cells, etc.). Body: \`{ "requests": [...] }\`
|
|
72839
|
-
|
|
72840
72876
|
### Range Notation (A1 notation)
|
|
72841
72877
|
- \`Sheet1!A1:D10\` \u2014 Specific range on Sheet1
|
|
72842
72878
|
- \`Sheet1!A:A\` \u2014 Entire column A on Sheet1
|
|
@@ -72849,21 +72885,17 @@ var googleSheetsConnector = new ConnectorPlugin({
|
|
|
72849
72885
|
- Use \`valueRenderOption=FORMATTED_VALUE\` query param to get display values
|
|
72850
72886
|
- Use \`valueRenderOption=UNFORMATTED_VALUE\` for raw numeric values
|
|
72851
72887
|
- Use \`majorDimension=COLUMNS\` to get data organized by columns instead of rows
|
|
72852
|
-
- For write operations, always use \`valueInputOption=USER_ENTERED\` so values are parsed as if typed by a user (dates, numbers, formulas are auto-detected)
|
|
72853
|
-
- Sharing (permissions) cannot be done via this connector; only the OAuth user has access to the created spreadsheets
|
|
72854
72888
|
|
|
72855
72889
|
### Business Logic
|
|
72856
72890
|
|
|
72857
|
-
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 and do NOT read \`INTERNAL_SQUADBASE_*\` env vars \u2014 the SDK takes care of OAuth.
|
|
72891
|
+
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 and do NOT read \`INTERNAL_SQUADBASE_*\` env vars \u2014 the SDK takes care of OAuth. The spreadsheet ID is bound to the connection at setup time; do NOT ask handler callers to pass it.
|
|
72858
72892
|
|
|
72859
72893
|
SDK surface (client created via \`connection(connectionId)\`):
|
|
72860
|
-
- \`client.
|
|
72861
|
-
- \`client.
|
|
72862
|
-
- \`client.
|
|
72863
|
-
- \`client.
|
|
72864
|
-
- \`client.
|
|
72865
|
-
- \`client.appendValues(spreadsheetId, range, values)\` \u2014 append rows after the last row.
|
|
72866
|
-
- \`client.createSpreadsheet(title, sheetNames?)\` \u2014 create a new spreadsheet.
|
|
72894
|
+
- \`client.spreadsheetId\` \u2014 the spreadsheet ID configured for this connection.
|
|
72895
|
+
- \`client.request(path, init?)\` \u2014 low-level authenticated fetch (\`path\` is appended to \`https://sheets.googleapis.com/v4/spreadsheets\`; \`{spreadsheetId}\` is auto-replaced).
|
|
72896
|
+
- \`client.getSpreadsheet()\` \u2014 fetch spreadsheet metadata for the configured spreadsheet.
|
|
72897
|
+
- \`client.getValues(range)\` \u2014 read a range (A1 notation) from the configured spreadsheet.
|
|
72898
|
+
- \`client.batchGetValues(ranges)\` \u2014 read multiple ranges from the configured spreadsheet.
|
|
72867
72899
|
|
|
72868
72900
|
If a handler test fails with \`Connection proxy is not configured\`, retry \u2014 the sandbox is still initializing. Do NOT abandon the SDK and construct OAuth proxy URLs manually.
|
|
72869
72901
|
|
|
@@ -72874,43 +72906,31 @@ import { connection } from "@squadbase/vite-server/connectors/google-sheets";
|
|
|
72874
72906
|
|
|
72875
72907
|
const sheets = connection("<connectionId>");
|
|
72876
72908
|
|
|
72877
|
-
//
|
|
72878
|
-
const
|
|
72879
|
-
const spreadsheetId = newSheet.spreadsheetId;
|
|
72880
|
-
|
|
72881
|
-
// Get spreadsheet metadata
|
|
72882
|
-
const metadata = await sheets.getSpreadsheet(spreadsheetId);
|
|
72909
|
+
// Get metadata for the configured spreadsheet
|
|
72910
|
+
const metadata = await sheets.getSpreadsheet();
|
|
72883
72911
|
console.log(metadata.properties.title, metadata.sheets.map(s => s.properties.title));
|
|
72884
72912
|
|
|
72885
72913
|
// Get cell values
|
|
72886
|
-
const values = await sheets.getValues(
|
|
72914
|
+
const values = await sheets.getValues("Sheet1!A1:D10");
|
|
72887
72915
|
console.log(values.values); // 2D array
|
|
72888
72916
|
|
|
72889
|
-
//
|
|
72890
|
-
await sheets.
|
|
72891
|
-
|
|
72892
|
-
// Append rows
|
|
72893
|
-
await sheets.appendValues(spreadsheetId, "Sheet1!A1", [["Bob", "95"], ["Charlie", "88"]]);
|
|
72917
|
+
// Batch-get multiple ranges
|
|
72918
|
+
const batch = await sheets.batchGetValues(["Sheet1!A:A", "Sheet2!B2:C100"]);
|
|
72894
72919
|
\`\`\``,
|
|
72895
72920
|
ja: `### \u30C4\u30FC\u30EB\uFF08\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u6642\u306E\u307F\uFF09
|
|
72896
72921
|
|
|
72897
|
-
- \`google-sheets-oauth_request\`: \u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u3084\u30C7\u30FC\u30BF\u6982\u8981\u628A\u63E1\u6642\u306B Google Sheets API \u3092\u547C\u3073\u51FA\u3059\u30C4\u30FC\u30EB\u3067\u3059\u3002\u8AAD\u307F\u53D6\u308A\
|
|
72922
|
+
- \`google-sheets-oauth_request\`: \u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u3084\u30C7\u30FC\u30BF\u6982\u8981\u628A\u63E1\u6642\u306B Google Sheets API \u3092\u547C\u3073\u51FA\u3059\u30C4\u30FC\u30EB\u3067\u3059\u3002\u8AAD\u307F\u53D6\u308A\u5C02\u7528\uFF08GET \u306E\u307F\uFF09\u3067\u3059\u3002\u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8\u306E\u30E1\u30BF\u30C7\u30FC\u30BF\u53D6\u5F97\u3084\u30BB\u30EB\u5024\u306E\u30B5\u30F3\u30D7\u30EA\u30F3\u30B0\u306B\u4F7F\u7528\u3057\u307E\u3059\u3002\u30D1\u30B9\u5185\u306E \`{spreadsheetId}\` \u30D7\u30EC\u30FC\u30B9\u30DB\u30EB\u30C0\u306F\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u6642\u306B\u6307\u5B9A\u3055\u308C\u305F\u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8ID\u306B\u81EA\u52D5\u7684\u306B\u7F6E\u63DB\u3055\u308C\u307E\u3059\u3002OAuth \u7D4C\u7531\u3067\u8A8D\u8A3C\u306F\u81EA\u52D5\u8A2D\u5B9A\u3055\u308C\u307E\u3059\u3002
|
|
72898
72923
|
|
|
72899
72924
|
> **\u91CD\u8981**: \`google-sheets-oauth_request\` \u306F\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u6642\u306E\u307F\u5229\u7528\u53EF\u80FD\u3067\u3059\u3002\u30B5\u30FC\u30D0\u30FC\u30ED\u30B8\u30C3\u30AF\u306E\u30CF\u30F3\u30C9\u30E9\u5185\u3067\u306F\u5FC5\u305A SDK\uFF08\`connection(id).getValues\` \u306A\u3069\uFF09\u3092\u4F7F\u3063\u3066\u304F\u3060\u3055\u3044\u3002SDK \u306E fetch \u306F OAuth \u30D7\u30ED\u30AD\u30B7\u7D4C\u7531\u3067\u65E2\u306B\u914D\u7DDA\u3055\u308C\u3066\u3044\u307E\u3059\u3002\u30CF\u30F3\u30C9\u30E9\u304B\u3089 \`_sqcore/connections/*/request\` \u3092\u624B\u66F8\u304D\u3067\u547C\u3073\u51FA\u3055\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3002
|
|
72900
72925
|
|
|
72901
|
-
|
|
72926
|
+
> **\u63A5\u7D9A\u30B9\u30B3\u30FC\u30D7**: \u5404\u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\u306F\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u6642\u306BURL\u3067\u6307\u5B9A\u3055\u308C\u305F1\u3064\u306E\u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8\u306B\u7D10\u3065\u304D\u307E\u3059\u3002\u3053\u306E\u30B3\u30CD\u30AF\u30BF\u306F\u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8\u306E\u4F5C\u6210\u3084\u66F8\u304D\u8FBC\u307F\u306F\u884C\u3044\u307E\u305B\u3093\u3002OAuth \u30B9\u30B3\u30FC\u30D7\u306F \`spreadsheets.readonly\` \u3067\u3059\u3002
|
|
72927
|
+
|
|
72928
|
+
### Google Sheets API \u30EA\u30D5\u30A1\u30EC\u30F3\u30B9\uFF08\u8AAD\u307F\u53D6\u308A\u5C02\u7528\uFF09
|
|
72902
72929
|
|
|
72903
|
-
#### \u8AAD\u307F\u53D6\u308A\u30A8\u30F3\u30C9\u30DD\u30A4\u30F3\u30C8
|
|
72904
72930
|
- GET \`/{spreadsheetId}\` \u2014 \u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8\u306E\u30E1\u30BF\u30C7\u30FC\u30BF\u3092\u53D6\u5F97\uFF08\u30BF\u30A4\u30C8\u30EB\u3001\u30B7\u30FC\u30C8\u3001\u30D7\u30ED\u30D1\u30C6\u30A3\uFF09
|
|
72905
72931
|
- GET \`/{spreadsheetId}/values/{range}\` \u2014 \u7BC4\u56F2\u306E\u30BB\u30EB\u5024\u3092\u53D6\u5F97
|
|
72906
72932
|
- GET \`/{spreadsheetId}/values:batchGet?ranges={range1}&ranges={range2}\` \u2014 \u8907\u6570\u7BC4\u56F2\u306E\u5024\u3092\u53D6\u5F97
|
|
72907
72933
|
|
|
72908
|
-
#### \u66F8\u304D\u8FBC\u307F\u30A8\u30F3\u30C9\u30DD\u30A4\u30F3\u30C8
|
|
72909
|
-
- POST \`\`\uFF08\u7A7A\u30D1\u30B9\u3001\u30DC\u30C7\u30A3\u4ED8\u304D\uFF09\u2014 \u65B0\u3057\u3044\u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8\u3092\u4F5C\u6210\u3002Body: \`{ "properties": { "title": "\u30DE\u30A4\u30B7\u30FC\u30C8" }, "sheets": [{ "properties": { "title": "Sheet1" } }] }\`
|
|
72910
|
-
- PUT \`/{spreadsheetId}/values/{range}?valueInputOption=USER_ENTERED\` \u2014 \u7BC4\u56F2\u306E\u30BB\u30EB\u5024\u3092\u66F4\u65B0\u3002Body: \`{ "range": "Sheet1!A1:B2", "majorDimension": "ROWS", "values": [["a","b"],["c","d"]] }\`
|
|
72911
|
-
- POST \`/{spreadsheetId}/values/{range}:append?valueInputOption=USER_ENTERED&insertDataOption=INSERT_ROWS\` \u2014 \u6700\u7D42\u884C\u306E\u5F8C\u306B\u884C\u3092\u8FFD\u52A0\u3002Body: \`{ "range": "Sheet1!A1", "majorDimension": "ROWS", "values": [["a","b"]] }\`
|
|
72912
|
-
- POST \`/{spreadsheetId}:batchUpdate\` \u2014 \u8907\u6570\u306E\u66F4\u65B0\u3092\u9069\u7528\uFF08\u66F8\u5F0F\u8A2D\u5B9A\u3001\u30B7\u30FC\u30C8\u8FFD\u52A0\u3001\u30BB\u30EB\u7D50\u5408\u306A\u3069\uFF09\u3002Body: \`{ "requests": [...] }\`
|
|
72913
|
-
|
|
72914
72934
|
### \u7BC4\u56F2\u306E\u8868\u8A18\u6CD5\uFF08A1\u8868\u8A18\u6CD5\uFF09
|
|
72915
72935
|
- \`Sheet1!A1:D10\` \u2014 Sheet1\u4E0A\u306E\u7279\u5B9A\u7BC4\u56F2
|
|
72916
72936
|
- \`Sheet1!A:A\` \u2014 Sheet1\u306EA\u5217\u5168\u4F53
|
|
@@ -72923,21 +72943,17 @@ await sheets.appendValues(spreadsheetId, "Sheet1!A1", [["Bob", "95"], ["Charlie"
|
|
|
72923
72943
|
- \u8868\u793A\u5024\u3092\u53D6\u5F97\u3059\u308B\u306B\u306F \`valueRenderOption=FORMATTED_VALUE\` \u30AF\u30A8\u30EA\u30D1\u30E9\u30E1\u30FC\u30BF\u3092\u4F7F\u7528\u3057\u307E\u3059
|
|
72924
72944
|
- \u751F\u306E\u6570\u5024\u3092\u53D6\u5F97\u3059\u308B\u306B\u306F \`valueRenderOption=UNFORMATTED_VALUE\` \u3092\u4F7F\u7528\u3057\u307E\u3059
|
|
72925
72945
|
- \u5217\u3054\u3068\u306B\u30C7\u30FC\u30BF\u3092\u53D6\u5F97\u3059\u308B\u306B\u306F \`majorDimension=COLUMNS\` \u3092\u4F7F\u7528\u3057\u307E\u3059
|
|
72926
|
-
- \u66F8\u304D\u8FBC\u307F\u64CD\u4F5C\u3067\u306F\u5E38\u306B \`valueInputOption=USER_ENTERED\` \u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u5024\u304C\u30E6\u30FC\u30B6\u30FC\u5165\u529B\u306E\u3088\u3046\u306B\u89E3\u6790\u3055\u308C\u307E\u3059\uFF08\u65E5\u4ED8\u3001\u6570\u5024\u3001\u6570\u5F0F\u304C\u81EA\u52D5\u691C\u51FA\uFF09
|
|
72927
|
-
- \u5171\u6709\uFF08permissions\uFF09\u306F\u3053\u306E\u30B3\u30CD\u30AF\u30BF\u7D4C\u7531\u3067\u306F\u884C\u3048\u307E\u305B\u3093\u3002\u4F5C\u6210\u3057\u305F\u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8\u3078\u306F\u63A5\u7D9A\u3057\u305FOAuth\u30E6\u30FC\u30B6\u30FC\u306E\u307F\u304C\u30A2\u30AF\u30BB\u30B9\u53EF\u80FD\u3067\u3059
|
|
72928
72946
|
|
|
72929
72947
|
### Business Logic
|
|
72930
72948
|
|
|
72931
|
-
\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\u30BF SDK \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\`INTERNAL_SQUADBASE_*\` \u306E\u74B0\u5883\u5909\u6570\u3092\u4F7F\u3063\u3066\u624B\u52D5\u3067 OAuth \u30D7\u30ED\u30AD\u30B7\u3092\u53E9\u304F\u3053\u3068\u3082\u3057\u306A\u3044\u3067\u304F\u3060\u3055\u3044 \u2014 SDK \u304C OAuth \u3092\u51E6\u7406\u3057\u307E\u3059\u3002
|
|
72949
|
+
\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\u30BF SDK \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\`INTERNAL_SQUADBASE_*\` \u306E\u74B0\u5883\u5909\u6570\u3092\u4F7F\u3063\u3066\u624B\u52D5\u3067 OAuth \u30D7\u30ED\u30AD\u30B7\u3092\u53E9\u304F\u3053\u3068\u3082\u3057\u306A\u3044\u3067\u304F\u3060\u3055\u3044 \u2014 SDK \u304C OAuth \u3092\u51E6\u7406\u3057\u307E\u3059\u3002\u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8ID\u306F\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u6642\u306B\u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\u306B\u7D10\u3065\u3051\u3089\u308C\u3066\u3044\u308B\u306E\u3067\u3001\u30CF\u30F3\u30C9\u30E9\u306E\u547C\u3073\u51FA\u3057\u5143\u306B\u6E21\u3055\u305B\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3002
|
|
72932
72950
|
|
|
72933
72951
|
SDK\uFF08\`connection(connectionId)\` \u3067\u4F5C\u6210\u3057\u305F\u30AF\u30E9\u30A4\u30A2\u30F3\u30C8\uFF09:
|
|
72934
|
-
- \`client.
|
|
72935
|
-
- \`client.
|
|
72936
|
-
- \`client.
|
|
72937
|
-
- \`client.
|
|
72938
|
-
- \`client.
|
|
72939
|
-
- \`client.appendValues(spreadsheetId, range, values)\` \u2014 \u6700\u7D42\u884C\u306E\u5F8C\u306B\u884C\u3092\u8FFD\u52A0\u3002
|
|
72940
|
-
- \`client.createSpreadsheet(title, sheetNames?)\` \u2014 \u65B0\u3057\u3044\u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8\u3092\u4F5C\u6210\u3002
|
|
72952
|
+
- \`client.spreadsheetId\` \u2014 \u3053\u306E\u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\u306B\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u308B\u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8ID\u3002
|
|
72953
|
+
- \`client.request(path, init?)\` \u2014 \u4F4E\u30EC\u30D9\u30EB\u306E\u8A8D\u8A3C\u4ED8\u304D fetch\uFF08\`path\` \u306F \`https://sheets.googleapis.com/v4/spreadsheets\` \u306B\u8FFD\u52A0\u3055\u308C\u3001\`{spreadsheetId}\` \u306F\u81EA\u52D5\u7F6E\u63DB\u3055\u308C\u307E\u3059\uFF09\u3002
|
|
72954
|
+
- \`client.getSpreadsheet()\` \u2014 \u8A2D\u5B9A\u6E08\u307F\u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8\u306E\u30E1\u30BF\u30C7\u30FC\u30BF\u3092\u53D6\u5F97\u3002
|
|
72955
|
+
- \`client.getValues(range)\` \u2014 \u8A2D\u5B9A\u6E08\u307F\u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8\u306E\u7BC4\u56F2\u306E\u5024\u3092\u53D6\u5F97\uFF08A1 \u8868\u8A18\uFF09\u3002
|
|
72956
|
+
- \`client.batchGetValues(ranges)\` \u2014 \u8A2D\u5B9A\u6E08\u307F\u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8\u306E\u8907\u6570\u7BC4\u56F2\u306E\u5024\u3092\u53D6\u5F97\u3002
|
|
72941
72957
|
|
|
72942
72958
|
\u30CF\u30F3\u30C9\u30E9\u306E\u30C6\u30B9\u30C8\u304C \`Connection proxy is not configured\` \u3067\u5931\u6557\u3059\u308B\u5834\u5408\u306F\u518D\u8A66\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u901A\u5E38\u306F\u30B5\u30F3\u30C9\u30DC\u30C3\u30AF\u30B9\u306E\u521D\u671F\u5316\u4E2D\u306B\u8D77\u304D\u307E\u3059\u3002SDK \u3092\u8AE6\u3081\u3066 OAuth \u30D7\u30ED\u30AD\u30B7\u306E URL \u3092\u81EA\u5206\u3067\u7D44\u307F\u7ACB\u3066\u308B\u3053\u3068\u306F **\u3057\u306A\u3044\u3067\u304F\u3060\u3055\u3044**\u3002
|
|
72943
72959
|
|
|
@@ -72948,23 +72964,16 @@ import { connection } from "@squadbase/vite-server/connectors/google-sheets";
|
|
|
72948
72964
|
|
|
72949
72965
|
const sheets = connection("<connectionId>");
|
|
72950
72966
|
|
|
72951
|
-
// \
|
|
72952
|
-
const
|
|
72953
|
-
const spreadsheetId = newSheet.spreadsheetId;
|
|
72954
|
-
|
|
72955
|
-
// \u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8\u306E\u30E1\u30BF\u30C7\u30FC\u30BF\u3092\u53D6\u5F97
|
|
72956
|
-
const metadata = await sheets.getSpreadsheet(spreadsheetId);
|
|
72967
|
+
// \u8A2D\u5B9A\u6E08\u307F\u30B9\u30D7\u30EC\u30C3\u30C9\u30B7\u30FC\u30C8\u306E\u30E1\u30BF\u30C7\u30FC\u30BF\u3092\u53D6\u5F97
|
|
72968
|
+
const metadata = await sheets.getSpreadsheet();
|
|
72957
72969
|
console.log(metadata.properties.title, metadata.sheets.map(s => s.properties.title));
|
|
72958
72970
|
|
|
72959
72971
|
// \u30BB\u30EB\u5024\u3092\u53D6\u5F97
|
|
72960
|
-
const values = await sheets.getValues(
|
|
72972
|
+
const values = await sheets.getValues("Sheet1!A1:D10");
|
|
72961
72973
|
console.log(values.values); // 2D array
|
|
72962
72974
|
|
|
72963
|
-
// \
|
|
72964
|
-
await sheets.
|
|
72965
|
-
|
|
72966
|
-
// \u884C\u3092\u8FFD\u52A0
|
|
72967
|
-
await sheets.appendValues(spreadsheetId, "Sheet1!A1", [["Bob", "95"], ["Charlie", "88"]]);
|
|
72975
|
+
// \u8907\u6570\u7BC4\u56F2\u3092\u30D0\u30C3\u30C1\u53D6\u5F97
|
|
72976
|
+
const batch = await sheets.batchGetValues(["Sheet1!A:A", "Sheet2!B2:C100"]);
|
|
72968
72977
|
\`\`\``
|
|
72969
72978
|
},
|
|
72970
72979
|
tools: tools18
|
|
@@ -73397,12 +73406,12 @@ Authentication is handled automatically via OAuth proxy.`,
|
|
|
73397
73406
|
});
|
|
73398
73407
|
|
|
73399
73408
|
// ../connectors/src/connectors/hubspot-oauth/setup.ts
|
|
73400
|
-
var
|
|
73409
|
+
var requestToolName2 = `hubspot-oauth_${requestTool11.name}`;
|
|
73401
73410
|
var hubspotOnboarding = new ConnectorOnboarding({
|
|
73402
73411
|
connectionSetupInstructions: {
|
|
73403
73412
|
ja: `\u4EE5\u4E0B\u306E\u624B\u9806\u3067HubSpot\u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\u306E\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u3092\u884C\u3063\u3066\u304F\u3060\u3055\u3044\u3002
|
|
73404
73413
|
|
|
73405
|
-
1. \`${
|
|
73414
|
+
1. \`${requestToolName2}\` \u3092\u547C\u3073\u51FA\u3057\u3066\u3001\u30A2\u30AB\u30A6\u30F3\u30C8\u60C5\u5831\u3092\u53D6\u5F97\u3059\u308B:
|
|
73406
73415
|
- \`method\`: \`"GET"\`
|
|
73407
73416
|
- \`path\`: \`"/account-info/v3/details"\`
|
|
73408
73417
|
2. \u30A8\u30E9\u30FC\u304C\u8FD4\u3055\u308C\u305F\u5834\u5408\u3001\u30E6\u30FC\u30B6\u30FC\u306BOAuth\u63A5\u7D9A\u306E\u8A2D\u5B9A\u3092\u78BA\u8A8D\u3059\u308B\u3088\u3046\u4F1D\u3048\u308B
|
|
@@ -73412,7 +73421,7 @@ var hubspotOnboarding = new ConnectorOnboarding({
|
|
|
73412
73421
|
- \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`,
|
|
73413
73422
|
en: `Follow these steps to set up the HubSpot connection.
|
|
73414
73423
|
|
|
73415
|
-
1. Call \`${
|
|
73424
|
+
1. Call \`${requestToolName2}\` to fetch account info:
|
|
73416
73425
|
- \`method\`: \`"GET"\`
|
|
73417
73426
|
- \`path\`: \`"/account-info/v3/details"\`
|
|
73418
73427
|
2. If an error is returned, ask the user to check the OAuth connection settings
|
|
@@ -73686,12 +73695,12 @@ Authentication is handled automatically via OAuth proxy.`,
|
|
|
73686
73695
|
});
|
|
73687
73696
|
|
|
73688
73697
|
// ../connectors/src/connectors/stripe-oauth/setup.ts
|
|
73689
|
-
var
|
|
73698
|
+
var requestToolName3 = `stripe-oauth_${requestTool12.name}`;
|
|
73690
73699
|
var stripeOnboarding = new ConnectorOnboarding({
|
|
73691
73700
|
connectionSetupInstructions: {
|
|
73692
73701
|
ja: `\u4EE5\u4E0B\u306E\u624B\u9806\u3067Stripe\u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\u306E\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u3092\u884C\u3063\u3066\u304F\u3060\u3055\u3044\u3002
|
|
73693
73702
|
|
|
73694
|
-
1. \`${
|
|
73703
|
+
1. \`${requestToolName3}\` \u3092\u547C\u3073\u51FA\u3057\u3066\u3001\u30A2\u30AB\u30A6\u30F3\u30C8\u60C5\u5831\u3092\u53D6\u5F97\u3059\u308B:
|
|
73695
73704
|
- \`method\`: \`"GET"\`
|
|
73696
73705
|
- \`path\`: \`"/v1/accounts"\`
|
|
73697
73706
|
2. \u30A8\u30E9\u30FC\u304C\u8FD4\u3055\u308C\u305F\u5834\u5408\u3001\u30E6\u30FC\u30B6\u30FC\u306BOAuth\u63A5\u7D9A\u306E\u8A2D\u5B9A\u3092\u78BA\u8A8D\u3059\u308B\u3088\u3046\u4F1D\u3048\u308B
|
|
@@ -73701,7 +73710,7 @@ var stripeOnboarding = new ConnectorOnboarding({
|
|
|
73701
73710
|
- \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`,
|
|
73702
73711
|
en: `Follow these steps to set up the Stripe connection.
|
|
73703
73712
|
|
|
73704
|
-
1. Call \`${
|
|
73713
|
+
1. Call \`${requestToolName3}\` to fetch account info:
|
|
73705
73714
|
- \`method\`: \`"GET"\`
|
|
73706
73715
|
- \`path\`: \`"/v1/accounts"\`
|
|
73707
73716
|
2. If an error is returned, ask the user to check the OAuth connection settings
|
|
@@ -73976,12 +73985,12 @@ Use this tool for all Stripe API interactions: querying charges, customers, invo
|
|
|
73976
73985
|
});
|
|
73977
73986
|
|
|
73978
73987
|
// ../connectors/src/connectors/stripe-api-key/setup.ts
|
|
73979
|
-
var
|
|
73988
|
+
var requestToolName4 = `stripe-api-key_${requestTool13.name}`;
|
|
73980
73989
|
var stripeApiKeyOnboarding = new ConnectorOnboarding({
|
|
73981
73990
|
connectionSetupInstructions: {
|
|
73982
73991
|
ja: `\u4EE5\u4E0B\u306E\u624B\u9806\u3067Stripe\u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\u306E\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u3092\u884C\u3063\u3066\u304F\u3060\u3055\u3044\u3002
|
|
73983
73992
|
|
|
73984
|
-
1. \`${
|
|
73993
|
+
1. \`${requestToolName4}\` \u3092\u547C\u3073\u51FA\u3057\u3066\u3001\u30A2\u30AB\u30A6\u30F3\u30C8\u6B8B\u9AD8\u3092\u53D6\u5F97\u3059\u308B:
|
|
73985
73994
|
- \`method\`: \`"GET"\`
|
|
73986
73995
|
- \`path\`: \`"/v1/balance"\`
|
|
73987
73996
|
2. \u30A8\u30E9\u30FC\u304C\u8FD4\u3055\u308C\u305F\u5834\u5408\u3001\u30E6\u30FC\u30B6\u30FC\u306BAPI\u30AD\u30FC\u306E\u8A2D\u5B9A\u3092\u78BA\u8A8D\u3059\u308B\u3088\u3046\u4F1D\u3048\u308B\uFF08Secret API Key\u307E\u305F\u306FRestricted API Key\u304C\u6B63\u3057\u304F\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u308B\u304B\uFF09
|
|
@@ -73991,7 +74000,7 @@ var stripeApiKeyOnboarding = new ConnectorOnboarding({
|
|
|
73991
74000
|
- \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`,
|
|
73992
74001
|
en: `Follow these steps to set up the Stripe connection.
|
|
73993
74002
|
|
|
73994
|
-
1. Call \`${
|
|
74003
|
+
1. Call \`${requestToolName4}\` to fetch account balance:
|
|
73995
74004
|
- \`method\`: \`"GET"\`
|
|
73996
74005
|
- \`path\`: \`"/v1/balance"\`
|
|
73997
74006
|
2. If an error is returned, ask the user to check the API key settings (verify that the Secret API Key or Restricted API Key is configured correctly)
|
|
@@ -74001,11 +74010,11 @@ var stripeApiKeyOnboarding = new ConnectorOnboarding({
|
|
|
74001
74010
|
- Write only 1 sentence between tool calls, then immediately call the next tool. Skip unnecessary explanations and proceed efficiently`
|
|
74002
74011
|
},
|
|
74003
74012
|
dataOverviewInstructions: {
|
|
74004
|
-
en: `1. Call ${
|
|
74005
|
-
2. Call ${
|
|
74013
|
+
en: `1. Call ${requestToolName4} with GET /v1/customers?limit=5 to explore customers structure
|
|
74014
|
+
2. Call ${requestToolName4} with GET /v1/charges?limit=5 to explore charges structure
|
|
74006
74015
|
3. Explore other endpoints (invoices, subscriptions, products) as needed`,
|
|
74007
|
-
ja: `1. ${
|
|
74008
|
-
2. ${
|
|
74016
|
+
ja: `1. ${requestToolName4} \u3067 GET /v1/customers?limit=5 \u3092\u547C\u3073\u51FA\u3057\u3001\u9867\u5BA2\u306E\u69CB\u9020\u3092\u78BA\u8A8D
|
|
74017
|
+
2. ${requestToolName4} \u3067 GET /v1/charges?limit=5 \u3092\u547C\u3073\u51FA\u3057\u3001\u8AB2\u91D1\u306E\u69CB\u9020\u3092\u78BA\u8A8D
|
|
74009
74018
|
3. \u5FC5\u8981\u306B\u5FDC\u3058\u3066\u4ED6\u306E\u30A8\u30F3\u30C9\u30DD\u30A4\u30F3\u30C8\uFF08\u8ACB\u6C42\u66F8\u3001\u30B5\u30D6\u30B9\u30AF\u30EA\u30D7\u30B7\u30E7\u30F3\u3001\u5546\u54C1\uFF09\u3092\u63A2\u7D22`
|
|
74010
74019
|
}
|
|
74011
74020
|
});
|
|
@@ -74290,7 +74299,7 @@ Authentication is handled automatically via OAuth proxy.
|
|
|
74290
74299
|
});
|
|
74291
74300
|
|
|
74292
74301
|
// ../connectors/src/connectors/airtable-oauth/setup.ts
|
|
74293
|
-
var
|
|
74302
|
+
var requestToolName5 = `airtable-oauth_${requestTool14.name}`;
|
|
74294
74303
|
var airtableOauthOnboarding = new ConnectorOnboarding({
|
|
74295
74304
|
connectionSetupInstructions: {
|
|
74296
74305
|
ja: `\u4EE5\u4E0B\u306E\u624B\u9806\u3067Airtable OAuth\u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\u306E\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u3092\u884C\u3063\u3066\u304F\u3060\u3055\u3044\u3002
|
|
@@ -74300,7 +74309,7 @@ var airtableOauthOnboarding = new ConnectorOnboarding({
|
|
|
74300
74309
|
3. \`updateConnectionParameters\` \u3092\u547C\u3073\u51FA\u3059:
|
|
74301
74310
|
- \`parameterSlug\`: \`"base-id"\`
|
|
74302
74311
|
- \`value\`: \u62BD\u51FA\u3057\u305F\u30D9\u30FC\u30B9ID
|
|
74303
|
-
4. \`${
|
|
74312
|
+
4. \`${requestToolName5}\` \u3092\u547C\u3073\u51FA\u3057\u3066\u3001\u30D9\u30FC\u30B9\u306E\u30C6\u30FC\u30D6\u30EB\u4E00\u89A7\u3092\u53D6\u5F97\u3059\u308B:
|
|
74304
74313
|
- \`method\`: \`"GET"\`
|
|
74305
74314
|
- \`path\`: \`"/meta/bases/{baseId}/tables"\`
|
|
74306
74315
|
5. \u30A8\u30E9\u30FC\u304C\u8FD4\u3055\u308C\u305F\u5834\u5408\u3001\u30E6\u30FC\u30B6\u30FC\u306B\u30D9\u30FC\u30B9\u306E\u5171\u6709\u8A2D\u5B9A\u3092\u78BA\u8A8D\u3059\u308B\u3088\u3046\u4F1D\u3048\u308B
|
|
@@ -74315,7 +74324,7 @@ var airtableOauthOnboarding = new ConnectorOnboarding({
|
|
|
74315
74324
|
3. Call \`updateConnectionParameters\`:
|
|
74316
74325
|
- \`parameterSlug\`: \`"base-id"\`
|
|
74317
74326
|
- \`value\`: The extracted base ID
|
|
74318
|
-
4. Call \`${
|
|
74327
|
+
4. Call \`${requestToolName5}\` to fetch the base's table list:
|
|
74319
74328
|
- \`method\`: \`"GET"\`
|
|
74320
74329
|
- \`path\`: \`"/meta/bases/{baseId}/tables"\`
|
|
74321
74330
|
5. If an error is returned, ask the user to check the base sharing settings
|
|
@@ -76893,6 +76902,7 @@ Use this tool for all Shopify API interactions: listing products, orders, custom
|
|
|
76893
76902
|
method: "POST",
|
|
76894
76903
|
headers: { "Content-Type": "application/json" },
|
|
76895
76904
|
body: JSON.stringify({
|
|
76905
|
+
grant_type: "client_credentials",
|
|
76896
76906
|
client_id: clientId,
|
|
76897
76907
|
client_secret: clientSecret
|
|
76898
76908
|
})
|
|
@@ -77216,12 +77226,12 @@ Authentication is handled automatically via OAuth proxy.`,
|
|
|
77216
77226
|
});
|
|
77217
77227
|
|
|
77218
77228
|
// ../connectors/src/connectors/shopify-oauth/setup.ts
|
|
77219
|
-
var
|
|
77229
|
+
var requestToolName6 = `shopify-oauth_${requestTool22.name}`;
|
|
77220
77230
|
var shopifyOauthOnboarding = new ConnectorOnboarding({
|
|
77221
77231
|
connectionSetupInstructions: {
|
|
77222
77232
|
ja: `\u4EE5\u4E0B\u306E\u624B\u9806\u3067Shopify\u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\u306E\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u3092\u884C\u3063\u3066\u304F\u3060\u3055\u3044\u3002
|
|
77223
77233
|
|
|
77224
|
-
1. \`${
|
|
77234
|
+
1. \`${requestToolName6}\` \u3092\u547C\u3073\u51FA\u3057\u3066\u3001\u30B7\u30E7\u30C3\u30D7\u60C5\u5831\u3092\u53D6\u5F97\u3059\u308B:
|
|
77225
77235
|
- \`method\`: \`"GET"\`
|
|
77226
77236
|
- \`path\`: \`"/admin/api/2024-10/shop.json"\`
|
|
77227
77237
|
2. \u30A8\u30E9\u30FC\u304C\u8FD4\u3055\u308C\u305F\u5834\u5408\u3001\u30E6\u30FC\u30B6\u30FC\u306BOAuth\u63A5\u7D9A\u306E\u8A2D\u5B9A\u3092\u78BA\u8A8D\u3059\u308B\u3088\u3046\u4F1D\u3048\u308B
|
|
@@ -77231,7 +77241,7 @@ var shopifyOauthOnboarding = new ConnectorOnboarding({
|
|
|
77231
77241
|
- \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`,
|
|
77232
77242
|
en: `Follow these steps to set up the Shopify connection.
|
|
77233
77243
|
|
|
77234
|
-
1. Call \`${
|
|
77244
|
+
1. Call \`${requestToolName6}\` to fetch shop info:
|
|
77235
77245
|
- \`method\`: \`"GET"\`
|
|
77236
77246
|
- \`path\`: \`"/admin/api/2024-10/shop.json"\`
|
|
77237
77247
|
2. If an error is returned, ask the user to check the OAuth connection settings
|
|
@@ -79488,12 +79498,12 @@ Pagination uses cursor-based start_cursor and page_size (max 100).`,
|
|
|
79488
79498
|
});
|
|
79489
79499
|
|
|
79490
79500
|
// ../connectors/src/connectors/notion-oauth/setup.ts
|
|
79491
|
-
var
|
|
79501
|
+
var requestToolName7 = `notion-oauth_${requestTool28.name}`;
|
|
79492
79502
|
var notionOauthOnboarding = new ConnectorOnboarding({
|
|
79493
79503
|
connectionSetupInstructions: {
|
|
79494
79504
|
ja: `\u4EE5\u4E0B\u306E\u624B\u9806\u3067Notion\u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\u306E\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u3092\u884C\u3063\u3066\u304F\u3060\u3055\u3044\u3002
|
|
79495
79505
|
|
|
79496
|
-
1. \`${
|
|
79506
|
+
1. \`${requestToolName7}\` \u3092\u547C\u3073\u51FA\u3057\u3066\u3001\u30DC\u30C3\u30C8\u30E6\u30FC\u30B6\u30FC\u60C5\u5831\u3092\u53D6\u5F97\u3059\u308B:
|
|
79497
79507
|
- \`method\`: \`"GET"\`
|
|
79498
79508
|
- \`path\`: \`"/users/me"\`
|
|
79499
79509
|
2. \u30A8\u30E9\u30FC\u304C\u8FD4\u3055\u308C\u305F\u5834\u5408\u3001\u30E6\u30FC\u30B6\u30FC\u306BOAuth\u63A5\u7D9A\u306E\u8A2D\u5B9A\u3092\u78BA\u8A8D\u3059\u308B\u3088\u3046\u4F1D\u3048\u308B
|
|
@@ -79503,7 +79513,7 @@ var notionOauthOnboarding = new ConnectorOnboarding({
|
|
|
79503
79513
|
- \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`,
|
|
79504
79514
|
en: `Follow these steps to set up the Notion connection.
|
|
79505
79515
|
|
|
79506
|
-
1. Call \`${
|
|
79516
|
+
1. Call \`${requestToolName7}\` to fetch bot user info:
|
|
79507
79517
|
- \`method\`: \`"GET"\`
|
|
79508
79518
|
- \`path\`: \`"/users/me"\`
|
|
79509
79519
|
2. If an error is returned, ask the user to check the OAuth connection settings
|
|
@@ -82070,7 +82080,7 @@ All paths are relative to https://gmail.googleapis.com/gmail/v1/users. Use '/me'
|
|
|
82070
82080
|
});
|
|
82071
82081
|
|
|
82072
82082
|
// ../connectors/src/connectors/gmail/setup.ts
|
|
82073
|
-
var
|
|
82083
|
+
var requestToolName8 = `gmail-service-account_${requestTool35.name}`;
|
|
82074
82084
|
var gmailOnboarding = new ConnectorOnboarding({
|
|
82075
82085
|
connectionSetupInstructions: {
|
|
82076
82086
|
ja: `\u4EE5\u4E0B\u306E\u624B\u9806\u3067Gmail\uFF08\u30B5\u30FC\u30D3\u30B9\u30A2\u30AB\u30A6\u30F3\u30C8\uFF09\u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\u306E\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u3092\u884C\u3063\u3066\u304F\u3060\u3055\u3044\u3002\u63A5\u7D9A\u4F5C\u6210\u6642\u306B\u306F\u30B5\u30FC\u30D3\u30B9\u30A2\u30AB\u30A6\u30F3\u30C8JSON\u306E\u307F\u304C\u8A2D\u5B9A\u6E08\u307F\u3067\u3001\u59D4\u4EFB\u5BFE\u8C61\u306E\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u306F\u3053\u306E\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u4E2D\u306B\u53D6\u5F97\u3057\u307E\u3059\u3002
|
|
@@ -82082,14 +82092,14 @@ var gmailOnboarding = new ConnectorOnboarding({
|
|
|
82082
82092
|
2. \u53D7\u3051\u53D6\u3063\u305F\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u3092 \`updateConnectionParameters\` \u3067\u4FDD\u5B58\u3059\u308B:
|
|
82083
82093
|
- \`parameterSlug\`: \`"delegated-user-email"\`
|
|
82084
82094
|
- \`options\`: \`[{ value: <\u5165\u529B\u3055\u308C\u305F\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9>, label: <\u540C\u3058\u5024> }]\`\uFF081\u4EF6\u306E\u307F\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u306F\u81EA\u52D5\u9078\u629E\u3055\u308C\u308B\uFF09
|
|
82085
|
-
3. \`${
|
|
82095
|
+
3. \`${requestToolName8}\` \u3092\u547C\u3073\u51FA\u3057\u3066\u30E6\u30FC\u30B6\u30FC\u306E\u30D7\u30ED\u30D5\u30A3\u30FC\u30EB\u3092\u53D6\u5F97\u3059\u308B:
|
|
82086
82096
|
- \`method\`: \`"GET"\`
|
|
82087
82097
|
- \`path\`: \`"/me/profile"\`
|
|
82088
82098
|
4. \u30A8\u30E9\u30FC\u304C\u8FD4\u3055\u308C\u305F\u5834\u5408\u3001\u4EE5\u4E0B\u3092\u78BA\u8A8D\u3059\u308B\u3088\u3046\u30E6\u30FC\u30B6\u30FC\u306B\u4F1D\u3048\u308B:
|
|
82089
82099
|
- \u30B5\u30FC\u30D3\u30B9\u30A2\u30AB\u30A6\u30F3\u30C8\u306E\u30C9\u30E1\u30A4\u30F3\u5168\u4F53\u306E\u59D4\u4EFB\u304C\u6709\u52B9\u304B
|
|
82090
82100
|
- Google Workspace\u7BA1\u7406\u30B3\u30F3\u30BD\u30FC\u30EB\u3067Gmail API\u30B9\u30B3\u30FC\u30D7\u304C\u8A31\u53EF\u3055\u308C\u3066\u3044\u308B\u304B
|
|
82091
82101
|
- \u5165\u529B\u3055\u308C\u305F\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u304C\u6B63\u3057\u3044\u304B
|
|
82092
|
-
5. \`${
|
|
82102
|
+
5. \`${requestToolName8}\` \u3092\u547C\u3073\u51FA\u3057\u3066\u30E9\u30D9\u30EB\u4E00\u89A7\u3092\u53D6\u5F97\u3059\u308B:
|
|
82093
82103
|
- \`method\`: \`"GET"\`
|
|
82094
82104
|
- \`path\`: \`"/me/labels"\`
|
|
82095
82105
|
|
|
@@ -82105,14 +82115,14 @@ var gmailOnboarding = new ConnectorOnboarding({
|
|
|
82105
82115
|
2. Save the email via \`updateConnectionParameters\`:
|
|
82106
82116
|
- \`parameterSlug\`: \`"delegated-user-email"\`
|
|
82107
82117
|
- \`options\`: \`[{ value: <entered email>, label: <same value> }]\` (a single option is auto-selected)
|
|
82108
|
-
3. Call \`${
|
|
82118
|
+
3. Call \`${requestToolName8}\` to get the user's profile:
|
|
82109
82119
|
- \`method\`: \`"GET"\`
|
|
82110
82120
|
- \`path\`: \`"/me/profile"\`
|
|
82111
82121
|
4. If an error is returned, ask the user to verify:
|
|
82112
82122
|
- Domain-wide delegation is enabled for the service account
|
|
82113
82123
|
- Gmail API scope is authorized in Google Workspace admin console
|
|
82114
82124
|
- The entered email address is correct
|
|
82115
|
-
5. Call \`${
|
|
82125
|
+
5. Call \`${requestToolName8}\` to get the label list:
|
|
82116
82126
|
- \`method\`: \`"GET"\`
|
|
82117
82127
|
- \`path\`: \`"/me/labels"\`
|
|
82118
82128
|
|
|
@@ -82464,16 +82474,16 @@ All paths are relative to https://gmail.googleapis.com/gmail/v1/users. Use '/me'
|
|
|
82464
82474
|
});
|
|
82465
82475
|
|
|
82466
82476
|
// ../connectors/src/connectors/gmail-oauth/setup.ts
|
|
82467
|
-
var
|
|
82477
|
+
var requestToolName9 = `gmail-oauth_${requestTool36.name}`;
|
|
82468
82478
|
var gmailOnboarding2 = new ConnectorOnboarding({
|
|
82469
82479
|
connectionSetupInstructions: {
|
|
82470
82480
|
ja: `\u4EE5\u4E0B\u306E\u624B\u9806\u3067Gmail\u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\u306E\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u3092\u884C\u3063\u3066\u304F\u3060\u3055\u3044\u3002
|
|
82471
82481
|
|
|
82472
|
-
1. \`${
|
|
82482
|
+
1. \`${requestToolName9}\` \u3092\u547C\u3073\u51FA\u3057\u3066\u30E6\u30FC\u30B6\u30FC\u306E\u30D7\u30ED\u30D5\u30A3\u30FC\u30EB\u3092\u53D6\u5F97\u3059\u308B:
|
|
82473
82483
|
- \`method\`: \`"GET"\`
|
|
82474
82484
|
- \`path\`: \`"/me/profile"\`
|
|
82475
82485
|
2. \u30A8\u30E9\u30FC\u304C\u8FD4\u3055\u308C\u305F\u5834\u5408\u3001OAuth\u306E\u8A8D\u8A3C\u304C\u6B63\u3057\u304F\u5B8C\u4E86\u3057\u3066\u3044\u308B\u304B\u78BA\u8A8D\u3059\u308B\u3088\u3046\u30E6\u30FC\u30B6\u30FC\u306B\u4F1D\u3048\u308B
|
|
82476
|
-
3. \`${
|
|
82486
|
+
3. \`${requestToolName9}\` \u3092\u547C\u3073\u51FA\u3057\u3066\u30E9\u30D9\u30EB\u4E00\u89A7\u3092\u53D6\u5F97\u3059\u308B:
|
|
82477
82487
|
- \`method\`: \`"GET"\`
|
|
82478
82488
|
- \`path\`: \`"/me/labels"\`
|
|
82479
82489
|
|
|
@@ -82482,11 +82492,11 @@ var gmailOnboarding2 = new ConnectorOnboarding({
|
|
|
82482
82492
|
- \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`,
|
|
82483
82493
|
en: `Follow these steps to set up the Gmail connection.
|
|
82484
82494
|
|
|
82485
|
-
1. Call \`${
|
|
82495
|
+
1. Call \`${requestToolName9}\` to get the user's profile:
|
|
82486
82496
|
- \`method\`: \`"GET"\`
|
|
82487
82497
|
- \`path\`: \`"/me/profile"\`
|
|
82488
82498
|
2. If an error is returned, ask the user to verify that OAuth authentication completed correctly
|
|
82489
|
-
3. Call \`${
|
|
82499
|
+
3. Call \`${requestToolName9}\` to get the label list:
|
|
82490
82500
|
- \`method\`: \`"GET"\`
|
|
82491
82501
|
- \`path\`: \`"/me/labels"\`
|
|
82492
82502
|
|
|
@@ -83689,12 +83699,12 @@ Zendesk uses cursor-based pagination with page[size] and page[after] parameters.
|
|
|
83689
83699
|
});
|
|
83690
83700
|
|
|
83691
83701
|
// ../connectors/src/connectors/zendesk-oauth/setup.ts
|
|
83692
|
-
var
|
|
83702
|
+
var requestToolName10 = `zendesk-oauth_${requestTool39.name}`;
|
|
83693
83703
|
var zendeskOauthOnboarding = new ConnectorOnboarding({
|
|
83694
83704
|
connectionSetupInstructions: {
|
|
83695
83705
|
en: `Follow these steps to set up the Zendesk connection.
|
|
83696
83706
|
|
|
83697
|
-
1. Call \`${
|
|
83707
|
+
1. Call \`${requestToolName10}\` to fetch account info:
|
|
83698
83708
|
- \`method\`: \`"GET"\`
|
|
83699
83709
|
- \`path\`: \`"/api/v2/account/settings.json"\`
|
|
83700
83710
|
2. If an error is returned, ask the user to check the OAuth connection settings
|
|
@@ -83704,7 +83714,7 @@ var zendeskOauthOnboarding = new ConnectorOnboarding({
|
|
|
83704
83714
|
- Write only 1 sentence between tool calls, then immediately call the next tool. Skip unnecessary explanations and proceed efficiently`,
|
|
83705
83715
|
ja: `\u4EE5\u4E0B\u306E\u624B\u9806\u3067Zendesk\u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\u306E\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u3092\u884C\u3063\u3066\u304F\u3060\u3055\u3044\u3002
|
|
83706
83716
|
|
|
83707
|
-
1. \`${
|
|
83717
|
+
1. \`${requestToolName10}\` \u3092\u547C\u3073\u51FA\u3057\u3066\u3001\u30A2\u30AB\u30A6\u30F3\u30C8\u60C5\u5831\u3092\u53D6\u5F97\u3059\u308B:
|
|
83708
83718
|
- \`method\`: \`"GET"\`
|
|
83709
83719
|
- \`path\`: \`"/api/v2/account/settings.json"\`
|
|
83710
83720
|
2. \u30A8\u30E9\u30FC\u304C\u8FD4\u3055\u308C\u305F\u5834\u5408\u3001\u30E6\u30FC\u30B6\u30FC\u306BOAuth\u63A5\u7D9A\u306E\u8A2D\u5B9A\u3092\u78BA\u8A8D\u3059\u308B\u3088\u3046\u4F1D\u3048\u308B
|
|
@@ -84329,12 +84339,12 @@ Search endpoints (contacts/search, conversations/search) use POST with a query o
|
|
|
84329
84339
|
});
|
|
84330
84340
|
|
|
84331
84341
|
// ../connectors/src/connectors/intercom-oauth/setup.ts
|
|
84332
|
-
var
|
|
84342
|
+
var requestToolName11 = `intercom-oauth_${requestTool41.name}`;
|
|
84333
84343
|
var intercomOauthOnboarding = new ConnectorOnboarding({
|
|
84334
84344
|
connectionSetupInstructions: {
|
|
84335
84345
|
en: `Follow these steps to set up the Intercom connection.
|
|
84336
84346
|
|
|
84337
|
-
1. Call \`${
|
|
84347
|
+
1. Call \`${requestToolName11}\` to verify the connection:
|
|
84338
84348
|
- \`method\`: \`"GET"\`
|
|
84339
84349
|
- \`path\`: \`"/me"\`
|
|
84340
84350
|
2. If an error is returned, ask the user to check the OAuth connection settings
|
|
@@ -84344,7 +84354,7 @@ var intercomOauthOnboarding = new ConnectorOnboarding({
|
|
|
84344
84354
|
- Write only 1 sentence between tool calls, then immediately call the next tool. Skip unnecessary explanations and proceed efficiently`,
|
|
84345
84355
|
ja: `\u4EE5\u4E0B\u306E\u624B\u9806\u3067Intercom\u30B3\u30CD\u30AF\u30B7\u30E7\u30F3\u306E\u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u3092\u884C\u3063\u3066\u304F\u3060\u3055\u3044\u3002
|
|
84346
84356
|
|
|
84347
|
-
1. \`${
|
|
84357
|
+
1. \`${requestToolName11}\` \u3092\u547C\u3073\u51FA\u3057\u3066\u3001\u63A5\u7D9A\u3092\u78BA\u8A8D\u3059\u308B:
|
|
84348
84358
|
- \`method\`: \`"GET"\`
|
|
84349
84359
|
- \`path\`: \`"/me"\`
|
|
84350
84360
|
2. \u30A8\u30E9\u30FC\u304C\u8FD4\u3055\u308C\u305F\u5834\u5408\u3001\u30E6\u30FC\u30B6\u30FC\u306BOAuth\u63A5\u7D9A\u306E\u8A2D\u5B9A\u3092\u78BA\u8A8D\u3059\u308B\u3088\u3046\u4F1D\u3048\u308B
|
|
@@ -85828,7 +85838,7 @@ var parameters61 = {
|
|
|
85828
85838
|
organizationSlug: new ParameterDefinition({
|
|
85829
85839
|
slug: "organization-slug",
|
|
85830
85840
|
name: "Sentry Organization Slug",
|
|
85831
|
-
description: "The slug of your Sentry organization (e.g., 'my-org'). Found in your Sentry URL: https://sentry.io/
|
|
85841
|
+
description: "The slug of your Sentry organization (e.g., 'my-org'). Found in your Sentry URL: https://{slug}.sentry.io/",
|
|
85832
85842
|
envVarBaseKey: "SENTRY_ORGANIZATION_SLUG",
|
|
85833
85843
|
type: "text",
|
|
85834
85844
|
secret: false,
|
|
@@ -86534,11 +86544,11 @@ var influxdbOnboarding = new ConnectorOnboarding({
|
|
|
86534
86544
|
|
|
86535
86545
|
#### Confirm the Database (or Bucket) Name
|
|
86536
86546
|
- InfluxDB 3: use the database name
|
|
86537
|
-
- InfluxDB 2: use the bucket name (buckets act as databases in the v1/v3 compatibility endpoints)
|
|
86547
|
+
- InfluxDB 2 (includes InfluxDB Cloud on \`*.cloud2.influxdata.com\`): use the bucket name (buckets act as databases in the v1/v3 compatibility endpoints)
|
|
86538
86548
|
|
|
86539
|
-
#### Organization
|
|
86540
|
-
-
|
|
86541
|
-
-
|
|
86549
|
+
#### Organization
|
|
86550
|
+
- InfluxDB 2: set the Organization parameter to the org that owns the bucket (required for Flux queries and writes)
|
|
86551
|
+
- InfluxDB 3 Cloud Serverless: you can leave Organization blank when only using SQL`,
|
|
86542
86552
|
ja: `#### API \u30C8\u30FC\u30AF\u30F3\u306E\u767A\u884C
|
|
86543
86553
|
1. InfluxDB Cloud / OSS \u306B\u30B5\u30A4\u30F3\u30A4\u30F3
|
|
86544
86554
|
2. Load Data \u2192 API Tokens \u2192 Generate API Token
|
|
@@ -86547,19 +86557,37 @@ var influxdbOnboarding = new ConnectorOnboarding({
|
|
|
86547
86557
|
|
|
86548
86558
|
#### Database (\u307E\u305F\u306F Bucket) \u540D\u306E\u78BA\u8A8D
|
|
86549
86559
|
- InfluxDB 3: database \u540D\u3092\u4F7F\u7528
|
|
86550
|
-
- 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
|
|
86560
|
+
- 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
|
|
86551
86561
|
|
|
86552
|
-
#### Organization
|
|
86553
|
-
- InfluxDB 2
|
|
86554
|
-
- InfluxDB 3 Cloud \u306E\u5834\u5408\u306F\u7A7A\u306E\u307E\u307E\u3067\u554F\u984C\u306A\u3044`
|
|
86562
|
+
#### Organization
|
|
86563
|
+
- 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
|
|
86564
|
+
- InfluxDB 3 Cloud Serverless: SQL \u306E\u307F\u3092\u4F7F\u3046\u5834\u5408\u306F\u7A7A\u306E\u307E\u307E\u3067\u554F\u984C\u306A\u3044`
|
|
86555
86565
|
},
|
|
86556
86566
|
dataOverviewInstructions: {
|
|
86557
|
-
en: `
|
|
86558
|
-
|
|
86559
|
-
|
|
86560
|
-
|
|
86561
|
-
|
|
86562
|
-
|
|
86567
|
+
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.
|
|
86568
|
+
|
|
86569
|
+
1. Probe for InfluxDB 3: call influxdb_request with POST /api/v3/query_sql, body { "db": "<database>", "q": "SELECT 1" }
|
|
86570
|
+
- 200 with JSON rows \u2192 InfluxDB 3. Continue with SQL.
|
|
86571
|
+
- 405 Method Not Allowed, or an HTML body like "<html>...405 Not Allowed..." \u2192 InfluxDB 2. Fall back to Flux (step 3).
|
|
86572
|
+
2. InfluxDB 3 data overview:
|
|
86573
|
+
a. POST /api/v3/query_sql, body { "db": "<database>", "q": "SHOW TABLES" } to list measurements
|
|
86574
|
+
b. POST /api/v3/query_sql, body { "db": "<database>", "q": "SELECT * FROM <measurement> ORDER BY time DESC LIMIT 5" } to inspect a sample
|
|
86575
|
+
3. InfluxDB 2 data overview (Organization parameter required):
|
|
86576
|
+
a. POST /api/v2/query?org=<org>, contentType 'application/vnd.flux', body 'buckets()' to list buckets
|
|
86577
|
+
b. POST /api/v2/query?org=<org>, contentType 'application/vnd.flux', body 'from(bucket:"<bucket>") |> range(start: -1h) |> limit(n:5)' to inspect data
|
|
86578
|
+
- If the Organization parameter was not provided but v3 probing failed, ask the user to set it using updateConnectionParameters before continuing.`,
|
|
86579
|
+
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
|
|
86580
|
+
|
|
86581
|
+
1. InfluxDB 3 \u306E\u5224\u5225: influxdb_request \u3067 POST /api/v3/query_sql\u3001body { "db": "<database>", "q": "SELECT 1" } \u3092\u5B9F\u884C
|
|
86582
|
+
- 200 + JSON \u884C\u304C\u8FD4\u308B \u2192 InfluxDB 3\u3002\u305D\u306E\u307E\u307E SQL \u3067\u7D9A\u884C\u3002
|
|
86583
|
+
- 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
|
|
86584
|
+
2. InfluxDB 3 \u306E\u5834\u5408\u306E\u30C7\u30FC\u30BF\u6982\u8981:
|
|
86585
|
+
a. POST /api/v3/query_sql\u3001body { "db": "<database>", "q": "SHOW TABLES" } \u3067 measurement \u4E00\u89A7\u3092\u53D6\u5F97
|
|
86586
|
+
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
|
|
86587
|
+
3. InfluxDB 2 \u306E\u5834\u5408\u306E\u30C7\u30FC\u30BF\u6982\u8981\uFF08Organization \u30D1\u30E9\u30E1\u30FC\u30BF\u5FC5\u9808\uFF09:
|
|
86588
|
+
a. POST /api/v2/query?org=<org>\u3001contentType 'application/vnd.flux'\u3001body 'buckets()' \u3067 bucket \u4E00\u89A7\u3092\u53D6\u5F97
|
|
86589
|
+
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
|
|
86590
|
+
- 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`
|
|
86563
86591
|
}
|
|
86564
86592
|
});
|
|
86565
86593
|
|
|
@@ -86568,7 +86596,7 @@ var parameters63 = {
|
|
|
86568
86596
|
url: new ParameterDefinition({
|
|
86569
86597
|
slug: "url",
|
|
86570
86598
|
name: "InfluxDB URL",
|
|
86571
|
-
description: "The base URL of your InfluxDB instance (e.g., '
|
|
86599
|
+
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).",
|
|
86572
86600
|
envVarBaseKey: "INFLUXDB_URL",
|
|
86573
86601
|
type: "text",
|
|
86574
86602
|
secret: false,
|
|
@@ -86595,7 +86623,7 @@ var parameters63 = {
|
|
|
86595
86623
|
org: new ParameterDefinition({
|
|
86596
86624
|
slug: "org",
|
|
86597
86625
|
name: "Organization",
|
|
86598
|
-
description: "The InfluxDB organization name. Required for InfluxDB 2
|
|
86626
|
+
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.",
|
|
86599
86627
|
envVarBaseKey: "INFLUXDB_ORG",
|
|
86600
86628
|
type: "text",
|
|
86601
86629
|
secret: false,
|
|
@@ -86687,10 +86715,17 @@ For read-only data exploration prefer SQL (InfluxDB 3) or InfluxQL queries \u201
|
|
|
86687
86715
|
}
|
|
86688
86716
|
if (!response.ok) {
|
|
86689
86717
|
let errorMessage = `HTTP ${response.status} ${response.statusText}`;
|
|
86718
|
+
const bodyText = typeof data === "string" ? data : void 0;
|
|
86719
|
+
const isHtml = resContentType.includes("text/html") || bodyText !== void 0 && bodyText.trimStart().startsWith("<");
|
|
86690
86720
|
if (data && typeof data === "object" && !Array.isArray(data) && typeof data.message === "string") {
|
|
86691
86721
|
errorMessage = data.message;
|
|
86692
|
-
} else if (
|
|
86693
|
-
errorMessage =
|
|
86722
|
+
} else if (bodyText) {
|
|
86723
|
+
errorMessage = isHtml ? bodyText.replace(/\s+/g, " ").slice(0, 200) : bodyText;
|
|
86724
|
+
}
|
|
86725
|
+
const hitsV3Path = path5.includes("/api/v3/");
|
|
86726
|
+
const looksLikeMissingV3 = hitsV3Path && (response.status === 405 || response.status === 404 || isHtml);
|
|
86727
|
+
if (looksLikeMissingV3) {
|
|
86728
|
+
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'.";
|
|
86694
86729
|
}
|
|
86695
86730
|
return { success: false, error: errorMessage };
|
|
86696
86731
|
}
|
|
@@ -86712,14 +86747,22 @@ var influxdbConnector = new ConnectorPlugin({
|
|
|
86712
86747
|
authType: AUTH_TYPES.API_KEY,
|
|
86713
86748
|
name: "InfluxDB",
|
|
86714
86749
|
description: "Connect to InfluxDB (Cloud or OSS) to query time-series data with SQL, InfluxQL, or Flux and to write line protocol.",
|
|
86715
|
-
iconUrl: "https://
|
|
86750
|
+
iconUrl: "https://images.ctfassets.net/9ncizv60xc5y/J1JauVRNmahSVTVrpPfQK/18350d8d3f2dc3be25e8e36ee52914a0/influxdb.png",
|
|
86716
86751
|
parameters: parameters63,
|
|
86717
86752
|
releaseFlag: { dev1: true, dev2: false, prod: false },
|
|
86718
86753
|
onboarding: influxdbOnboarding,
|
|
86719
86754
|
systemPrompt: {
|
|
86720
|
-
en: `###
|
|
86755
|
+
en: `### Variant Detection
|
|
86756
|
+
|
|
86757
|
+
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:
|
|
86758
|
+
|
|
86759
|
+
1. Call \`influxdb_request\` POST \`/api/v3/query_sql\` with body \`{ "db": "<database>", "q": "SELECT 1" }\`
|
|
86760
|
+
2. 200 + JSON rows \u2192 InfluxDB 3. Use SQL endpoints.
|
|
86761
|
+
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\`.
|
|
86721
86762
|
|
|
86722
|
-
|
|
86763
|
+
### Tools
|
|
86764
|
+
|
|
86765
|
+
- \`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\`.
|
|
86723
86766
|
|
|
86724
86767
|
### Business Logic
|
|
86725
86768
|
|
|
@@ -86780,7 +86823,15 @@ export default async function handler(c: Context) {
|
|
|
86780
86823
|
- Time filtering uses standard SQL \`time\` column comparisons (\`time >= now() - INTERVAL '...' \`)
|
|
86781
86824
|
- Aggregates: \`AVG\`, \`SUM\`, \`MIN\`, \`MAX\`, \`COUNT\`; bucket time with \`date_bin('5 minutes', time)\`
|
|
86782
86825
|
- List measurements: \`SHOW TABLES\`; list columns: \`SHOW COLUMNS FROM <measurement>\``,
|
|
86783
|
-
ja: `### \
|
|
86826
|
+
ja: `### \u30D0\u30EA\u30A2\u30F3\u30C8\u5224\u5225
|
|
86827
|
+
|
|
86828
|
+
\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:
|
|
86829
|
+
|
|
86830
|
+
1. \`influxdb_request\` \u3067 POST \`/api/v3/query_sql\`\u3001body \`{ "db": "<database>", "q": "SELECT 1" }\` \u3092\u547C\u3073\u51FA\u3059
|
|
86831
|
+
2. 200 + JSON \u884C \u2192 InfluxDB 3\u3002SQL \u30A8\u30F3\u30C9\u30DD\u30A4\u30F3\u30C8\u3092\u4F7F\u7528\u3002
|
|
86832
|
+
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
|
|
86833
|
+
|
|
86834
|
+
### \u30C4\u30FC\u30EB
|
|
86784
86835
|
|
|
86785
86836
|
- \`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
|
|
86786
86837
|
|
|
@@ -86844,7 +86895,47 @@ export default async function handler(c: Context) {
|
|
|
86844
86895
|
- \u96C6\u8A08: \`AVG\`, \`SUM\`, \`MIN\`, \`MAX\`, \`COUNT\`\u3002\u6642\u9593\u30D0\u30B1\u30C3\u30C8: \`date_bin('5 minutes', time)\`
|
|
86845
86896
|
- measurement \u4E00\u89A7: \`SHOW TABLES\`\u3001\u5217\u4E00\u89A7: \`SHOW COLUMNS FROM <measurement>\``
|
|
86846
86897
|
},
|
|
86847
|
-
tools: tools63
|
|
86898
|
+
tools: tools63,
|
|
86899
|
+
async checkConnection(params) {
|
|
86900
|
+
const url = (params.url ?? "").replace(/\/$/, "");
|
|
86901
|
+
const token = params.token;
|
|
86902
|
+
if (!url) {
|
|
86903
|
+
return { success: false, error: "InfluxDB URL is not configured" };
|
|
86904
|
+
}
|
|
86905
|
+
if (!token) {
|
|
86906
|
+
return { success: false, error: "API Token is not configured" };
|
|
86907
|
+
}
|
|
86908
|
+
try {
|
|
86909
|
+
const res = await fetch(`${url}/api/v2/orgs`, {
|
|
86910
|
+
method: "GET",
|
|
86911
|
+
headers: {
|
|
86912
|
+
Authorization: `Token ${token}`,
|
|
86913
|
+
Accept: "application/json"
|
|
86914
|
+
}
|
|
86915
|
+
});
|
|
86916
|
+
if (res.status === 401 || res.status === 403) {
|
|
86917
|
+
return {
|
|
86918
|
+
success: false,
|
|
86919
|
+
error: `Authentication failed (HTTP ${res.status}). Check the API token and its permissions.`
|
|
86920
|
+
};
|
|
86921
|
+
}
|
|
86922
|
+
if (!res.ok) {
|
|
86923
|
+
const body = await res.text().catch(() => res.statusText);
|
|
86924
|
+
const snippet = body.replace(/\s+/g, " ").slice(0, 200);
|
|
86925
|
+
return {
|
|
86926
|
+
success: false,
|
|
86927
|
+
error: `Connection check failed: HTTP ${res.status} ${res.statusText} \u2014 ${snippet}`
|
|
86928
|
+
};
|
|
86929
|
+
}
|
|
86930
|
+
return { success: true };
|
|
86931
|
+
} catch (error2) {
|
|
86932
|
+
const message = error2 instanceof Error ? error2.message : String(error2);
|
|
86933
|
+
return {
|
|
86934
|
+
success: false,
|
|
86935
|
+
error: `Failed to reach InfluxDB at ${url}: ${message}`
|
|
86936
|
+
};
|
|
86937
|
+
}
|
|
86938
|
+
}
|
|
86848
86939
|
});
|
|
86849
86940
|
|
|
86850
86941
|
// ../connectors/src/connectors/registry.ts
|